@rettangoli/ui 0.1.2-rc10 → 0.1.2-rc12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var rettangoli=(()=>{function l(e,...t){let s="";return e.forEach((n,a)=>{s+=n+(t[a]||"")}),s}var Z=["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),w=e=>e.concat(Z.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[n,a]of Object.entries(V)){n!=="default"&&(s+=`${a} {`);for(let[i,o]of Object.entries(e)){let h=t[i]?` ${t[i]} `:" ";for(let[d,c]of Object.entries(o)){let u=I[i],f=c.startsWith("--")?`var(${c})`:c,v=n==="default"?i:`${n}-${i}`,T=n==="default"?`h-${i}`:`${n}-h-${i}`;if(u){let L=u.split(" ").map(Y=>`${Y}: ${f};`).join(" ");s+=`
1
+ var rettangoli=(()=>{function l(e,...t){let s="";return e.forEach((n,a)=>{s+=n+(t[a]||"")}),s}var Z=["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),w=e=>e.concat(Z.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[n,a]of Object.entries(V)){n!=="default"&&(s+=`${a} {`);for(let[i,o]of Object.entries(e)){let h=t[i]?` ${t[i]} `:" ";for(let[d,g]of Object.entries(o)){let u=I[i],f=g.startsWith("--")?`var(${g})`:g,v=n==="default"?i:`${n}-${i}`,T=n==="default"?`h-${i}`:`${n}-h-${i}`;if(u){let L=u.split(" ").map(Y=>`${Y}: ${f};`).join(" ");s+=`
2
2
  :host([${v}="${d}"])${h}{
3
3
  ${L}
4
4
  }
@@ -7,12 +7,12 @@ var rettangoli=(()=>{function l(e,...t){let s="";return e.forEach((n,a)=>{s+=n+(
7
7
  }
8
8
  `}else s+=`
9
9
  :host([${v}="${d}"])${h}{
10
- ${c}
10
+ ${g}
11
11
  }
12
12
  :host([${T}="${d}"]:hover)${h}{
13
- ${c}
13
+ ${g}
14
14
  }
15
- `}}n!=="default"&&(s+="}")}return s};function tt(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var et=e=>/%$/.test(e),g=e=>{if(e!==void 0)return et(e)?e:tt(e)?`${e}px`:Object.keys(r).includes(e)?`var(${r[e]})`:e},r={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function x(e,t=":host"){let s="";for(let[n,a]of Object.entries(V)){n!=="default"&&(s+=`${a} {
15
+ `}}n!=="default"&&(s+="}")}return s};function tt(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var et=e=>/%$/.test(e),c=e=>{if(e!==void 0)return et(e)?e:tt(e)?`${e}px`:Object.keys(r).includes(e)?`var(${r[e]})`:e},r={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function x(e,t=":host"){let s="";for(let[n,a]of Object.entries(V)){n!=="default"&&(s+=`${a} {
16
16
  `);let i="";for(let[o,h]of Object.entries(e[n]))h!=null&&(i+=`${o}: ${h};
17
17
  `);s+=`${t} {
18
18
  ${i.trim()}
@@ -258,7 +258,7 @@ var rettangoli=(()=>{function l(e,...t){let s="";return e.forEach((n,a)=>{s+=n+(
258
258
 
259
259
  ${H}
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,n){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 n=document.createElement("a");n.setAttribute("href",s);let a=this.getAttribute("target");a&&n.setAttribute("target",a),n.appendChild(this._buttonElement),this.shadow.appendChild(n),this._containerElement=n}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"},n={sm:14,md:18,lg:22},a=s[this.getAttribute("v")]||"pr-fg",i=18;if(this.hasAttribute("sq")){let h={sm:14,lg:22},d=this.getAttribute("s");i=h[d]||18}else i=n[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=g(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})=>C;var U=l`
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,n){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 n=document.createElement("a");n.setAttribute("href",s);let a=this.getAttribute("target");a&&n.setAttribute("target",a),n.appendChild(this._buttonElement),this.shadow.appendChild(n),this._containerElement=n}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"},n={sm:14,md:18,lg:22},a=s[this.getAttribute("v")]||"pr-fg",i=18;if(this.hasAttribute("sq")){let h={sm:14,lg:22},d=this.getAttribute("s");i=h[d]||18}else i=n[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})=>C;var U=l`
262
262
 
263
263
  :host([d="h"]) {
264
264
  flex-direction: row;
@@ -427,7 +427,7 @@ var rettangoli=(()=>{function l(e,...t){let s="";return e.forEach((n,a)=>{s+=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",...w([...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,n){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}`,h=this.getAttribute(o("wh")),d=g(h===null?this.getAttribute(o("w")):h),c=g(h===null?this.getAttribute(o("h")):h),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),d==="f"?this._styles[i].width="var(--width-stretch)":d!==void 0&&(this._styles[i].width=d,this._styles[i]["min-width"]=d,this._styles[i]["max-width"]=d),c==="f"?this._styles[i].height="100%":c!==void 0&&(this._styles[i].height=c,this._styles[i]["min-height"]=c,this._styles[i]["max-height"]=c),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="flex !important")});let a=x(this._styles);a!==this._lastStyleString&&(this._styleElement.textContent=a,this._lastStyleString=a)}},N=({render:e,html:t})=>$;var lt={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",...w([...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,n){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}`,h=this.getAttribute(o("wh")),d=c(h===null?this.getAttribute(o("w")):h),g=c(h===null?this.getAttribute(o("h")):h),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),d==="f"?this._styles[i].width="var(--width-stretch)":d!==void 0&&(this._styles[i].width=d,this._styles[i]["min-width"]=d,this._styles[i]["max-width"]=d),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=x(this._styles);a!==this._lastStyleString&&(this._styleElement.textContent=a,this._lastStyleString=a)}},N=({render:e,html:t})=>$;var lt={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);
@@ -502,7 +502,7 @@ var rettangoli=(()=>{function l(e,...t){let s="";return e.forEach((n,a)=>{s+=n+(
502
502
  ${A}
503
503
  ${b}
504
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,s,n){t==="href"||t==="target"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=g(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"),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)}},K=({render:e,html:t})=>z;var M=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(l`
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,s,n){t==="href"||t==="target"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=c(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"),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)}},K=({render:e,html:t})=>z;var M=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(l`
506
506
  :host {
507
507
  border-style: solid;
508
508
  box-sizing: border-box;
@@ -541,7 +541,7 @@ var rettangoli=(()=>{function l(e,...t){let s="";return e.forEach((n,a)=>{s+=n+(
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 w([...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,n){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}`,h=this.getAttribute(o("wh")),d=g(h===null?this.getAttribute(o("w")):h),c=g(h===null?this.getAttribute(o("h")):h),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),d==="f"?this._styles[i].width="var(--width-stretch)":d!==void 0&&(this._styles[i].width=d,this._styles[i]["min-width"]=d,this._styles[i]["max-width"]=d),c==="f"?this._styles[i].height="100%":c!==void 0&&(this._styles[i].height=c,this._styles[i]["min-height"]=c,this._styles[i]["max-height"]=c),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="block !important")});let a=x(this._styles);a!==this._lastStyleString&&(this._styleElement.textContent=a,this._lastStyleString=a),this._updateImageAttributes()}_updateImageAttributes(){let t=this.getAttribute("src"),s=this.getAttribute("width"),n=this.getAttribute("height");t!==null&&this._imgElement.setAttribute("src",t),s!==null&&this._imgElement.setAttribute("width",s),n!==null&&this._imgElement.setAttribute("height",n)}connectedCallback(){this._updateImageAttributes()}},Q=({render:e,html:t})=>M;var R=l`
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 w([...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,n){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}`,h=this.getAttribute(o("wh")),d=c(h===null?this.getAttribute(o("w")):h),g=c(h===null?this.getAttribute(o("h")):h),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),d==="f"?this._styles[i].width="var(--width-stretch)":d!==void 0&&(this._styles[i].width=d,this._styles[i]["min-width"]=d,this._styles[i]["max-width"]=d),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=x(this._styles);a!==this._lastStyleString&&(this._styleElement.textContent=a,this._lastStyleString=a),this._updateImageAttributes()}_updateImageAttributes(){let t=this.getAttribute("src"),s=this.getAttribute("width"),n=this.getAttribute("height");t!==null&&this._imgElement.setAttribute("src",t),s!==null&&this._imgElement.setAttribute("width",s),n!==null&&this._imgElement.setAttribute("height",n)}connectedCallback(){this._updateImageAttributes()}},Q=({render:e,html:t})=>M;var R=l`
545
545
  :host([pt="xs"]) svg {
546
546
  padding-top: var(--spacing-xs);
547
547
  }
@@ -665,7 +665,7 @@ var rettangoli=(()=>{function l(e,...t){let s="";return e.forEach((n,a)=>{s+=n+(
665
665
  ${R}
666
666
  ${S}
667
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,s){e._icons[t]=s}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,s,n){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),s=g(t===null?this.getAttribute("w"):t),n=g(t===null?this.getAttribute("h"):t);s&&(this.style.width=s),n&&(this.style.height=n)}_render(){try{let t=this.getAttribute("svg"),s=e._icons[t]||(window.rtglIcons||{})[t];if(s){this.shadow.innerHTML=s;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},G=({render:e,html:t})=>j;var O=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(l`
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,s){e._icons[t]=s}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,s,n){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),s=c(t===null?this.getAttribute("w"):t),n=c(t===null?this.getAttribute("h"):t);s&&(this.style.width=s),n&&(this.style.height=n)}_render(){try{let t=this.getAttribute("svg"),s=e._icons[t]||(window.rtglIcons||{})[t];if(s){this.shadow.innerHTML=s;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},G=({render:e,html:t})=>j;var O=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(l`
669
669
  :host {
670
670
  display: contents;
671
671
  }
@@ -700,7 +700,7 @@ var rettangoli=(()=>{function l(e,...t){let s="";return e.forEach((n,a)=>{s+=n+(
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",...w([...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,n){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}`,h=this.getAttribute(o("wh")),d=g(h===null?this.getAttribute(o("w")):h),c=g(h===null?this.getAttribute(o("h")):h),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),d==="f"?this._styles[i].width="var(--width-stretch)":d!==void 0&&(this._styles[i].width=d,this._styles[i]["min-width"]=d,this._styles[i]["max-width"]=d),c==="f"?this._styles[i].height="100%":c!==void 0&&(this._styles[i].height=c,this._styles[i]["min-height"]=c,this._styles[i]["max-height"]=c),this.hasAttribute(o("hidden"))&&(this._styles[i].display="none !important"),this.hasAttribute(o("visible"))&&(this._styles[i].display="block !important")});let a=x(this._styles,"input");a!==this._lastStyleString&&(this._styleElement.textContent=a,this._lastStyleString=a)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",s=this.getAttribute("placeholder"),n=this.getAttribute("value"),a=this.getAttribute("step"),i=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),s!==null?this._inputElement.setAttribute("placeholder",s):this._inputElement.removeAttribute("placeholder"),n!==null&&(this._inputElement.value=n),a!==null?this._inputElement.setAttribute("step",a):this._inputElement.removeAttribute("step"),i?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},F=({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(l`
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",...w([...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,n){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}`,h=this.getAttribute(o("wh")),d=c(h===null?this.getAttribute(o("w")):h),g=c(h===null?this.getAttribute(o("h")):h),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),d==="f"?this._styles[i].width="var(--width-stretch)":d!==void 0&&(this._styles[i].width=d,this._styles[i]["min-width"]=d,this._styles[i]["max-width"]=d),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=x(this._styles,"input");a!==this._lastStyleString&&(this._styleElement.textContent=a,this._lastStyleString=a)}_updateInputAttributes(){let t=this.getAttribute("type")||"text",s=this.getAttribute("placeholder"),n=this.getAttribute("value"),a=this.getAttribute("step"),i=this.hasAttribute("disabled");this._inputElement.setAttribute("type",t),s!==null?this._inputElement.setAttribute("placeholder",s):this._inputElement.removeAttribute("placeholder"),n!==null&&(this._inputElement.value=n),a!==null?this._inputElement.setAttribute("step",a):this._inputElement.removeAttribute("step"),i?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},F=({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(l`
704
704
  :host {
705
705
  display: contents;
706
706
  }
@@ -795,4 +795,4 @@ var rettangoli=(()=>{function l(e,...t){let s="";return e.forEach((n,a)=>{s+=n+(
795
795
  dialog[open] slot[name="content"] {
796
796
  animation: dialog-in 150ms cubic-bezier(0.16, 1, 0.3, 1);
797
797
  }
798
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._dialogElement.addEventListener("contextmenu",t=>{t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}}))})}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}attributeChangedCallback(t,s,n){t==="open"?n!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():n===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0)}_hideModal(){this._dialogElement.open&&(this._dialogElement.close(),this._slotElement&&(this._dialogElement.removeChild(this._slotElement),this._slotElement=null))}get dialog(){return this._dialogElement}},X=({render:e,html:t})=>D;customElements.define("rtgl-button",B({}));customElements.define("rtgl-view",N({}));customElements.define("rtgl-text",K({}));customElements.define("rtgl-image",Q({}));customElements.define("rtgl-svg",G({}));customElements.define("rtgl-input",F({}));customElements.define("rtgl-textarea",J({}));customElements.define("rtgl-dialog",X({}));})();
798
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}})))}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}}))})}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}attributeChangedCallback(t,s,n){t==="open"?n!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():n===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0)}_hideModal(){this._dialogElement.open&&(this._dialogElement.close(),this._slotElement&&(this._dialogElement.removeChild(this._slotElement),this._slotElement=null))}get dialog(){return this._dialogElement}},X=({render:e,html:t})=>D;customElements.define("rtgl-button",B({}));customElements.define("rtgl-view",N({}));customElements.define("rtgl-text",K({}));customElements.define("rtgl-image",Q({}));customElements.define("rtgl-svg",G({}));customElements.define("rtgl-input",F({}));customElements.define("rtgl-textarea",J({}));customElements.define("rtgl-dialog",X({}));})();
@@ -1,4 +1,4 @@
1
- var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)jr(e,r,{get:t[r],enumerable:!0})};function A(e,...t){let r="";return e.forEach((s,i)=>{r+=s+(t[i]||"")}),r}var Vr=["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"},G=Object.keys(St),J=e=>e.concat(Vr.flatMap(t=>e.map(r=>`${t}-${r}`))),Et={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)"},U=(e,t={})=>{let r="";for(let[s,i]of Object.entries(Et)){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 f=St[n],g=h.startsWith("--")?`var(${h})`:h,k=s==="default"?n:`${s}-${n}`,L=s==="default"?`h-${n}`:`${s}-h-${n}`;if(f){let c=f.split(" ").map(d=>`${d}: ${g};`).join(" ");r+=`
1
+ var rettangoli=(()=>{var Dr=Object.defineProperty;var M=(e,t)=>{for(var r in t)Dr(e,r,{get:t[r],enumerable:!0})};function A(e,...t){let r="";return e.forEach((s,i)=>{r+=s+(t[i]||"")}),r}var Mr=["xs","sm","md","lg","xl"],At={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"},J=Object.keys(At),Y=e=>e.concat(Mr.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)"},U=(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 f=At[n],g=h.startsWith("--")?`var(${h})`:h,k=s==="default"?n:`${s}-${n}`,L=s==="default"?`h-${n}`:`${s}-h-${n}`;if(f){let c=f.split(" ").map(d=>`${d}: ${g};`).join(" ");r+=`
2
2
  :host([${k}="${l}"])${o}{
3
3
  ${c}
4
4
  }
@@ -12,13 +12,13 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
12
12
  :host([${L}="${l}"]:hover)${o}{
13
13
  ${h}
14
14
  }
15
- `}}s!=="default"&&(r+="}")}return r};function Dr(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var Mr=e=>/%$/.test(e),T=e=>{if(e!==void 0)return Mr(e)?e:Dr(e)?`${e}px`:Object.keys(C).includes(e)?`var(${C[e]})`:e},C={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function Y(e,t=":host"){let r="";for(let[s,i]of Object.entries(Et)){s!=="default"&&(r+=`${i} {
15
+ `}}s!=="default"&&(r+="}")}return r};function Rr(e){if(e===null||e.includes("/"))return!1;let t=String(e);return/[0-9]$/.test(t)}var zr=e=>/%$/.test(e),T=e=>{if(e!==void 0)return zr(e)?e:Rr(e)?`${e}px`:Object.keys(C).includes(e)?`var(${C[e]})`:e},C={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function X(e,t=":host"){let r="";for(let[s,i]of Object.entries($t)){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()}
19
19
  }
20
20
  `,s!=="default"&&(r+=`}
21
- `)}return r}var ne=A`
21
+ `)}return r}var ie=A`
22
22
  :host([flex="0"]) {
23
23
  flex: 0;
24
24
  }
@@ -58,7 +58,7 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
58
58
  :host([flex="12"]) {
59
59
  flex: 12;
60
60
  }
61
- `;var Rr={mt:C,mr:C,mb:C,ml:C,m:C,mh:C,mv:C,s:{sm:`
61
+ `;var Wr={mt:C,mr:C,mb:C,ml:C,m:C,mh:C,mv:C,s:{sm:`
62
62
  height: 28px;
63
63
  padding-left: 12px;
64
64
  padding-right: 12px;
@@ -104,7 +104,7 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
104
104
  `,lk:`
105
105
  background-color: transparent;
106
106
  color: var(--foreground);
107
- `}},zr={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},kt=U(Rr,zr);var ae=A`
107
+ `}},Fr={mt:"button",mr:"button",mb:"button",ml:"button",m:"button",mh:"button",mv:"button",s:"button",v:"button"},Ct=U(Wr,Fr);var ne=A`
108
108
  a, a:link, a:visited, a:hover, a:active {
109
109
  color: inherit;
110
110
  text-decoration: none;
@@ -114,7 +114,7 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
114
114
  margin: 0;
115
115
  font: inherit;
116
116
  }
117
- `;var Le=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
117
+ `;var je=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
118
118
  :host {
119
119
  display: contents;
120
120
  }
@@ -250,15 +250,15 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
250
250
  gap: 0;
251
251
  }
252
252
 
253
- ${ae}
253
+ ${ne}
254
254
 
255
255
  a {
256
256
  display: contents;
257
257
  }
258
258
 
259
- ${kt}
260
- ${ne}
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=T(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})=>Le;var $t=A`
259
+ ${Ct}
260
+ ${ie}
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=T(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="")}},Ot=({render:e,html:t})=>je;var It=A`
262
262
 
263
263
  :host([d="h"]) {
264
264
  flex-direction: row;
@@ -329,7 +329,7 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
329
329
  justify-content: center;
330
330
  }
331
331
  }
332
- `;var Wr={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},z=U(Wr);var Ct=A`
332
+ `;var Br={cur:{p:"pointer",m:"move",grab:"grab",grabbing:"grabbing"}},R=U(Br);var Tt=A`
333
333
  :host([sh]:not([sv])) {
334
334
  overflow-x: scroll;
335
335
  flex-wrap: nowrap;
@@ -347,7 +347,7 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
347
347
  flex-wrap: nowrap;
348
348
  }
349
349
 
350
- `;var de={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Fr={bgc:{pr:`
350
+ `;var de={xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Kr={bgc:{pr:`
351
351
  background-color: var(--primary);
352
352
  `,se:`
353
353
  background-color: var(--secondary);
@@ -387,7 +387,7 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
387
387
  left: 0;
388
388
  top: 0;
389
389
  height: 100%;
390
- `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:C,pr:C,pb:C,pl:C,p:C,ph:C,pv:C,g:C,gv:C,gh:C,bw:de,bwt:de,bwr:de,bwb:de,bwl:de,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},ge=U(Fr);var Br={mt:C,mr:C,mb:C,ml:C,m:C,mh:C,mv:C},W=U(Br);var Ne=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
390
+ `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:C,pr:C,pb:C,pl:C,p:C,ph:C,pv:C,g:C,gv:C,gh:C,bw:de,bwt:de,bwr:de,bwb:de,bwl:de,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},be=U(Kr);var Hr={mt:C,mr:C,mb:C,ml:C,m:C,mh:C,mv:C},z=U(Hr);var Ve=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
391
391
  slot {
392
392
  display: contents;
393
393
  }
@@ -406,13 +406,13 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
406
406
  flex-wrap: wrap;
407
407
  }
408
408
 
409
- ${ne}
410
- ${Ct}
411
- ${$t}
412
- ${W}
409
+ ${ie}
410
+ ${Tt}
411
+ ${It}
413
412
  ${z}
414
- ${ge}
415
- ${ae}
413
+ ${R}
414
+ ${be}
415
+ ${ne}
416
416
 
417
417
  :host([href]) {
418
418
  cursor: pointer;
@@ -427,7 +427,7 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
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([...G,"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=k=>`${n==="default"?"":`${n}-`}${k}`,o=this.getAttribute(a("wh")),l=T(o===null?this.getAttribute(a("w")):o),h=T(o===null?this.getAttribute(a("h")):o),f=this.getAttribute(a("op")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),f!==null&&(this._styles[n].opacity=f),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})=>Ne;var Hr={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",...Y([...J,"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=k=>`${n==="default"?"":`${n}-`}${k}`,o=this.getAttribute(a("wh")),l=T(o===null?this.getAttribute(a("w")):o),h=T(o===null?this.getAttribute(a("h")):o),f=this.getAttribute(a("op")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),f!==null&&(this._styles[n].opacity=f),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=X(this._styles);i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}},Lt=({render:e,html:t})=>Ve;var Ur={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 jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
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
- `}},It=U(Hr);var Kr={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},be=U(Kr);var Pe=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
470
+ `}},Nt=U(Ur);var qr={c:{fg:"--foreground",de:"--destructive","pr-fg":"--primary-foreground","se-fg":"--secondary-foreground","mu-fg":"--muted-foreground","ac-fg":"--accent-foreground"}},ve=U(qr);var De=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
471
471
  :host {
472
472
  display: block;
473
473
  font-size: var(--md-font-size);
@@ -498,11 +498,11 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
498
498
  bottom: 0;
499
499
  z-index: 1;
500
500
  }
501
- ${It}
502
- ${be}
503
- ${W}
501
+ ${Nt}
502
+ ${ve}
504
503
  ${z}
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=T(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})=>Pe;var je=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
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=T(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)}},Pt=({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(A`
506
506
  :host {
507
507
  border-style: solid;
508
508
  box-sizing: border-box;
@@ -526,7 +526,7 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
526
526
  width: 100%;
527
527
  }
528
528
 
529
- ${ae}
529
+ ${ne}
530
530
 
531
531
  a {
532
532
  display: block;
@@ -538,10 +538,10 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
538
538
  cursor: pointer;
539
539
  }
540
540
 
541
- ${ge}
542
- ${W}
541
+ ${be}
543
542
  ${z}
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([...G,"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=k=>`${n==="default"?"":`${n}-`}${k}`,o=this.getAttribute(a("wh")),l=T(o===null?this.getAttribute(a("w")):o),h=T(o===null?this.getAttribute(a("h")):o),f=this.getAttribute(a("o")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),f!==null&&(this._styles[n].opacity=f),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})=>je;var Nt=A`
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 Y([...J,"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=k=>`${n==="default"?"":`${n}-`}${k}`,o=this.getAttribute(a("wh")),l=T(o===null?this.getAttribute(a("w")):o),h=T(o===null?this.getAttribute(a("h")):o),f=this.getAttribute(a("o")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),f!==null&&(this._styles[n].opacity=f),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=X(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()}},jt=({render:e,html:t})=>Me;var Vt=A`
545
545
  :host([pt="xs"]) svg {
546
546
  padding-top: var(--spacing-xs);
547
547
  }
@@ -657,15 +657,15 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
657
657
  padding-top: var(--spacing-xl);
658
658
  padding-bottom: var(--spacing-xl);
659
659
  }
660
- `;var Ve=class e extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
660
+ `;var Re=class e extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
661
661
  :host {
662
662
  color: var(--foreground);
663
663
  }
664
- ${be}
665
- ${Nt}
666
- ${ne}
667
- ${z}
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=T(t===null?this.getAttribute("w"):t),s=T(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=""}},Pt=({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(A`
664
+ ${ve}
665
+ ${Vt}
666
+ ${ie}
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=T(t===null?this.getAttribute("w"):t),s=T(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=""}},Dt=({render:e,html:t})=>Re;var ze=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
669
669
  :host {
670
670
  display: contents;
671
671
  }
@@ -698,9 +698,9 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
698
698
  input:disabled {
699
699
  cursor: not-allowed;
700
700
  }
701
- ${W}
702
701
  ${z}
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([...G,"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=k=>`${n==="default"?"":`${n}-`}${k}`,o=this.getAttribute(a("wh")),l=T(o===null?this.getAttribute(a("w")):o),h=T(o===null?this.getAttribute(a("h")):o),f=this.getAttribute(a("op")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),f!==null&&(this._styles[n].opacity=f),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()}},jt=({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(A`
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",...Y([...J,"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=k=>`${n==="default"?"":`${n}-`}${k}`,o=this.getAttribute(a("wh")),l=T(o===null?this.getAttribute(a("w")):o),h=T(o===null?this.getAttribute(a("h")):o),f=this.getAttribute(a("op")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),f!==null&&(this._styles[n].opacity=f),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=X(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()}},Mt=({render:e,html:t})=>ze;var We=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
704
704
  :host {
705
705
  display: contents;
706
706
  }
@@ -723,9 +723,9 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
723
723
  textarea:focus {
724
724
  border-color: var(--foreground);
725
725
  }
726
- ${W}
727
726
  ${z}
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})=>Me;var Re=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
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")}},Rt=({render:e,html:t})=>We;var Fe=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
729
729
  :host {
730
730
  display: contents;
731
731
  }
@@ -746,9 +746,9 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
746
746
  cursor: not-allowed;
747
747
  opacity: 0.5;
748
748
  }
749
- ${W}
750
749
  ${z}
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([...G,"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=k=>`${n==="default"?"":`${n}-`}${k}`,o=this.getAttribute(a("wh")),l=T(o===null?this.getAttribute(a("w")):o),h=T(o===null?this.getAttribute(a("h")):o),f=this.getAttribute(a("op")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),f!==null&&(this._styles[n].opacity=f),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})=>Re;var ze=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
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",...Y([...J,"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=k=>`${n==="default"?"":`${n}-`}${k}`,o=this.getAttribute(a("wh")),l=T(o===null?this.getAttribute(a("w")):o),h=T(o===null?this.getAttribute(a("h")):o),f=this.getAttribute(a("op")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),f!==null&&(this._styles[n].opacity=f),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=X(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()}},zt=({render:e,html:t})=>Fe;var Be=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
752
752
  :host {
753
753
  display: contents;
754
754
  }
@@ -800,9 +800,9 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
800
800
  input[type="range"]:disabled::-moz-range-thumb {
801
801
  cursor: not-allowed;
802
802
  }
803
- ${W}
804
803
  ${z}
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([...G,"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=k=>`${n==="default"?"":`${n}-`}${k}`,o=this.getAttribute(a("wh")),l=T(o===null?this.getAttribute(a("w")):o),h=T(o===null?this.getAttribute(a("h")):o),f=this.getAttribute(a("op")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),f!==null&&(this._styles[n].opacity=f),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})=>ze;var We=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
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",...Y([...J,"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=k=>`${n==="default"?"":`${n}-`}${k}`,o=this.getAttribute(a("wh")),l=T(o===null?this.getAttribute(a("w")):o),h=T(o===null?this.getAttribute(a("h")):o),f=this.getAttribute(a("op")),g=this.getAttribute(a("z"));g!==null&&(this._styles[n]["z-index"]=g),f!==null&&(this._styles[n].opacity=f),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=X(this._styles,'input[type="range"]');i!==this._lastStyleString&&(this._styleElement.textContent=i,this._lastStyleString=i)}_updateInputAttributes(){let t=this.getAttribute("value"),r=this.getAttribute("min"),s=this.getAttribute("max"),i=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null&&(this._inputElement.value=t),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()}},Wt=({render:e,html:t})=>Be;var Ke=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
806
806
  :host {
807
807
  display: contents;
808
808
  }
@@ -872,7 +872,7 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
872
872
  dialog[open] slot[name="content"] {
873
873
  animation: dialog-in 150ms cubic-bezier(0.16, 1, 0.3, 1);
874
874
  }
875
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._dialogElement.addEventListener("contextmenu",t=>{t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}}))})}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}attributeChangedCallback(t,r,s){t==="open"?s!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():s===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0)}_hideModal(){this._dialogElement.open&&(this._dialogElement.close(),this._slotElement&&(this._dialogElement.removeChild(this._slotElement),this._slotElement=null))}get dialog(){return this._dialogElement}},Rt=({render:e,html:t})=>We;var Fe=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
875
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&(t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}})))}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}}))})}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}attributeChangedCallback(t,r,s){t==="open"?s!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():s===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0)}_hideModal(){this._dialogElement.open&&(this._dialogElement.close(),this._slotElement&&(this._dialogElement.removeChild(this._slotElement),this._slotElement=null))}get dialog(){return this._dialogElement}},Ft=({render:e,html:t})=>Ke;var He=class e extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){e.styleSheet||(e.styleSheet=new CSSStyleSheet,e.styleSheet.replaceSync(A`
876
876
  :host {
877
877
  display: contents;
878
878
  }
@@ -916,7 +916,7 @@ var rettangoli=(()=>{var jr=Object.defineProperty;var R=(e,t)=>{for(var r in t)j
916
916
  min-width: 200px;
917
917
  max-width: 400px;
918
918
  }
919
- `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._popoverOverlay=document.createElement("div"),this._popoverOverlay.className="popover-overlay",this.shadow.appendChild(this._popoverOverlay),this._popoverOverlay.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._popoverOverlay.addEventListener("contextmenu",t=>{t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this.shadow.appendChild(this._popoverContainer),this._slotElement=null,this._isOpen=!1,this._handleEscKey=this._handleEscKey.bind(this)}static get observedAttributes(){return["open","x","y","placement"]}connectedCallback(){this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._removeGlobalListeners()}attributeChangedCallback(t,r,s){t==="open"?s!==null&&!this._isOpen?this._show():s===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="placement")&&this._isOpen&&this._updatePosition()}_show(){this._isOpen||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._updatePosition(),this._addGlobalListeners())}_hide(){this._isOpen&&(this._isOpen=!1,this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null),this._removeGlobalListeners())}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),r=parseFloat(this.getAttribute("y")||"0"),s=this.getAttribute("placement")||"bottom-start";this.removeAttribute("positioned"),requestAnimationFrame(()=>{let i=this._popoverContainer.getBoundingClientRect(),{left:n,top:a}=this._calculatePosition(t,r,i.width,i.height,s);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${a}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,r,s,i,n){let o=t,l=r;switch(n){case"top":o=t-s/2,l=r-i-8;break;case"top-start":o=t,l=r-i-8;break;case"top-end":o=t-s,l=r-i-8;break;case"right":o=t+8,l=r-i/2;break;case"right-start":o=t+8,l=r;break;case"right-end":o=t+8,l=r-i;break;case"bottom":o=t-s/2,l=r+8;break;case"bottom-start":o=t,l=r+8;break;case"bottom-end":o=t-s,l=r+8;break;case"left":o=t-s-8,l=r-i/2;break;case"left-start":o=t-s-8,l=r;break;case"left-end":o=t-s-8,l=r-i;break}let h=8;return o=Math.max(h,Math.min(o,window.innerWidth-s-h)),l=Math.max(h,Math.min(l,window.innerHeight-i-h)),{left:o,top:l}}_addGlobalListeners(){setTimeout(()=>{document.addEventListener("keydown",this._handleEscKey)},0)}_removeGlobalListeners(){document.removeEventListener("keydown",this._handleEscKey)}_handleEscKey(t){t.key==="Escape"&&this.dispatchEvent(new CustomEvent("close",{detail:{}}))}get popover(){return this._popoverContainer}},zt=({render:e,html:t})=>Fe;var Be={};R(Be,{handleClickMenuItem:()=>qr,handleClosePopover:()=>Ur});var Ur=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("close"))},qr=(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 He={};R(He,{INITIAL_STATE:()=>Gr,toViewData:()=>Jr});var Gr=Object.freeze({}),Jr=({props:e,attrs:t})=>({items:e.items||[],open:!!t.open,x:t.x,y:t.y,placement:t.placement});var Wt={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"]}}}}}},attrsSchema:{type:"object",properties:{open:{type:"string"},x:{type:"string"},y:{type:"string"},placement:{type:"string"}}},refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option-*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} placement=${placement}",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},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," placement=",{type:1,path:"placement"}]}}],fast:!1}],fast:!1}};var Ke={};R(Ke,{handleActionClick:()=>Xr,handleBeforeMount:()=>Yr,handleColorPickerChange:()=>es,handleInputChange:()=>Qr,handleSelectChange:()=>Zr,handleSliderChange:()=>ts,handleSliderInputChange:()=>rs});var Yr=e=>{let{store:t,props:r}=e;t.setFormValues(r.defaultValues)},ue=(e,t,r,s)=>{s(new CustomEvent("form-change",{detail:{name:e,fieldValue:t,formValues:r}}))},Xr=(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()}}))},Qr=(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}),ue(i,e.detail.value,r.selectFormValues(),s))},Zr=(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}),ue(i,e.detail.selectedValue,r.selectFormValues(),s))},es=(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}),ue(i,e.detail.value,r.selectFormValues(),s))},ts=(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}),ue(i,e.detail.value,r.selectFormValues(),s))},rs=(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}),ue(i,e.detail.value,r.selectFormValues(),s))};var Ue={};R(Ue,{INITIAL_STATE:()=>ss,selectFormValues:()=>ls,selectState:()=>os,setFormFieldValue:()=>cs,setFormValues:()=>ps,toViewData:()=>as});var ss=Object.freeze({formValues:{}}),is=["id","class","style","slot"],ns=e=>Object.entries(e).filter(([t])=>!is.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),as=({state:e,props:t,attrs:r})=>{let s=ns(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}},os=({state:e})=>e,ls=({state:e})=>e.formValues,ps=(e,t)=>{e.formValues=t||{}},cs=(e,{name:t,value:r})=>{e.formValues[t]=r};var Ft={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 qe={};R(qe,{handleClickStart:()=>hs});var hs=(e,t)=>{let{dispatchEvent:r,store:s}=t;console.log("handle click start",s.selectPath()),r(new CustomEvent("clickStart",{detail:{path:s.selectPath()}}))};var Ge={};R(Ge,{INITIAL_STATE:()=>ds,selectPath:()=>ys,setState:()=>gs,toViewData:()=>ms});var ds=Object.freeze({}),us=["id","class","style","slot"],fs=e=>Object.entries(e).filter(([t])=>!us.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),ms=({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:fs(r),start:s||{label:"",image:{src:"",width:32,height:32,alt:""}}}},ys=({props:e})=>e.start.path,gs=e=>{};var Bt={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 Je={};R(Je,{handleBeforeMount:()=>vs});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())},bs=(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)}},vs=e=>{let{attrs:t}=e;requestAnimationFrame(()=>{let r=document.getElementById(t["target-id"]),s=bs(r,e);return()=>{s()}})};var Ye={};R(Ye,{INITIAL_STATE:()=>ws,selectCurrentId:()=>Ss,selectState:()=>_s,setContentContainer:()=>As,setCurrentId:()=>ks,setItems:()=>Es,toViewData:()=>xs});var ws=Object.freeze({items:[],currentId:null,contentContainer:null}),xs=({state:e})=>({items:e.items.map(t=>({...t,c:t.id===e.currentId?"fg":"mu-fg"})),currentId:e.currentId}),_s=({state:e})=>e,Ss=({state:e})=>e.currentId,Es=(e,t)=>{e.items=t},ks=(e,t)=>{e.currentId=t},As=(e,t)=>{e.contentContainer=t};var Kt={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 Xe={};R(Xe,{handleBeforeMount:()=>$s,handleButtonClick:()=>Cs,handleClickOptionsPopoverOverlay:()=>Os,handleOptionClick:()=>Is});var $s=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())}},Cs=(e,t)=>{let{store:r,render:s,getRefIds:i}=t;r.openOptionsPopover({position:{y:e.clientY,x:e.clientX}}),s()},Os=(e,t)=>{let{store:r,render:s}=t;r.closeOptionsPopover(),s()},Is=(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={};R(Qe,{INITIAL_STATE:()=>Ts,closeOptionsPopover:()=>js,openOptionsPopover:()=>Ps,selectState:()=>Ns,toViewData:()=>Ls,updateSelectOption:()=>Vs});var Ts=Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,selectedLabel:null}),Ls=({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"}},Ns=({state:e})=>e,Ps=(e,t)=>{let{position:r}=t;e.position=r,e.isOpen=!0},js=e=>{e.isOpen=!1},Vs=(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={};R(Ze,{handleHeaderClick:()=>Ds,handleItemClick:()=>Ms});var Ds=(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}))},Ms=(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={};R(tt,{INITIAL_STATE:()=>Rs,selectActiveItem:()=>Hs,selectHeader:()=>Bs,selectItem:()=>Ks,setState:()=>Us,toViewData:()=>Fs});var Rs=Object.freeze({}),zs=["id","class","style","slot"],Ws=e=>Object.entries(e).filter(([t])=>!zs.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 Fs=({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=Ws(r),o=r.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},h=i?et(i,n):[],f=o==="full"?272:64,g=o==="full"?"fs":"c",k=o==="full"?"fs":"c",L=o==="full"?"lg":"sm",p=o==="full"?"md":"sm",c=o==="shrunk-lg"?48:40,d=o==="shrunk-lg"?28:20,u=o==="shrunk-lg"?"md":"sm",b=o==="full",_=o==="full",y=o==="full"?"fs":"c",x=o==="full"?"":`ah=${k}`,v=o==="full"?"f":c;return{containerAttrString:a,mode:o,header:l,items:h,sidebarWidth:f,headerAlign:g,itemAlign:k,headerPadding:L,itemPadding:p,itemHeight:c,iconSize:d,firstLetterSize:u,showLabels:b,showGroupLabels:_,itemContentAlign:y,itemAlignAttr:x,itemWidth:v,headerWidth:v,selectedItemId:n,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":""}},Bs=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,Hs=({state:e,props:t})=>(t.items?et(t.items):[]).find(s=>s.active),Ks=({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)},Us=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",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"]}}],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={};R(rt,{handleBeforeMount:()=>qs,handleValueChange:()=>Gs});var qs=e=>{let{store:t,attrs:r}=e;t.setValue(r.defaultValue||0)},Gs=(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={};R(st,{INITIAL_STATE:()=>Js,setValue:()=>Xs,toViewData:()=>Ys});var Js=Object.freeze({value:0}),Ys=({state:e,attrs:t})=>({value:e.value,w:t.w||"",min:t.min||0,max:t.max||100,step:t.step||1}),Xs=(e,t)=>{e.value=t};var Gt={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=f type=range min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider w=f type=range min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input#input w=f type=number min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f type=number min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md w=",{type:1,path:"w"}]}}],fast:!0}],fast:!0}};var it={};R(it,{handleBeforeMount:()=>Qs,handleHeaderClick:()=>ei,handleRowClick:()=>Zs});var Qs=e=>{},Zs=(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}}))},ei=(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={};R(nt,{INITIAL_STATE:()=>ti,clearSort:()=>pi,selectSortInfo:()=>oi,selectState:()=>ai,setSortColumn:()=>li,toViewData:()=>ni});var ti=Object.freeze({sortColumn:null,sortDirection:null}),ri=["id","class","style","slot"],si=e=>Object.entries(e).filter(([t])=>!ri.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),ii=(e,t)=>{let r=t.split("."),s=e;for(let i of r){if(s==null)return null;s=s[i]}return s},ni=({state:e,props:t,attrs:r})=>{let s=si(r),i=t.data||{columns:[],rows:[]},n=i.rows.map((a,o)=>{let l=i.columns.map(h=>{let f=ii(a,h.key);return{key:h.key,value:f!=null?String(f):""}});return{index:o,cells:l}});return{containerAttrString:s,columns:i.columns||[],rows:n||[]}},ai=({state:e})=>e,oi=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),li=(e,{column:t,direction:r})=>{e.sortColumn=t,e.sortDirection=r},pi=e=>{e.sortColumn=null,e.sortDirection=null};var Jt={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"),Yt=Symbol.for("immer-draftable"),B=Symbol.for("immer-state");function q(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var oe=Object.getPrototypeOf;function le(e){return!!e&&!!e[B]}function ee(e){return e?rr(e)||Array.isArray(e)||!!e[Yt]||!!e.constructor?.[Yt]||Se(e)||Ee(e):!1}var ci=Object.prototype.constructor.toString();function rr(e){if(!e||typeof e!="object")return!1;let t=oe(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)===ci}function ve(e,t){_e(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function _e(e){let t=e[B];return t?t.type_:Array.isArray(e)?1:Se(e)?2:Ee(e)?3:0}function lt(e,t){return _e(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function sr(e,t,r){let s=_e(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function hi(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Se(e){return e instanceof Map}function Ee(e){return e instanceof Set}function Z(e){return e.copy_||e.base_}function pt(e,t){if(Se(e))return new Map(e);if(Ee(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[B];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(oe(e),s)}else{let s=oe(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function ft(e,t=!1){return ke(e)||le(e)||!ee(e)||(_e(e)>1&&(e.set=e.add=e.clear=e.delete=di),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>ft(s,!0))),e}function di(){q(2)}function ke(e){return Object.isFrozen(e)}var ui={};function te(e){let t=ui[e];return t||q(0,e),t}var fe;function ir(){return fe}function fi(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Xt(e,t){t&&(te("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ct(e){ht(e),e.drafts_.forEach(mi),e.drafts_=null}function ht(e){e===fe&&(fe=e.parent_)}function Qt(e){return fe=fi(fe,e)}function mi(e){let t=e[B];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[B].modified_&&(ct(t),q(4)),ee(e)&&(e=we(t,e),t.parent_||xe(t,e)),t.patches_&&te("Patches").generateReplacementPatches_(r[B].base_,e,t.patches_,t.inversePatches_)):e=we(t,r,[]),ct(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==tr?e:void 0}function we(e,t,r){if(ke(t))return t;let s=t[B];if(!s)return ve(t,(i,n)=>er(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return xe(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),ve(n,(o,l)=>er(e,s,i,o,l,r,a)),xe(e,i,!1),r&&e.patches_&&te("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function er(e,t,r,s,i,n,a){if(le(i)){let o=n&&t&&t.type_!==3&&!lt(t.assigned_,s)?n.concat(s):void 0,l=we(e,i,o);if(sr(r,s,l),le(l))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(ee(i)&&!ke(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;we(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&xe(e,i)}}function xe(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&ft(t,r)}function yi(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=me);let{revoke:a,proxy:o}=Proxy.revocable(i,n);return s.draft_=o,s.revoke_=a,o}var mt={get(e,t){if(t===B)return e;let r=Z(e);if(!lt(r,t))return gi(e,r,t);let s=r[t];return e.finalized_||!ee(s)?s:s===at(e.base_,t)?(ot(e),e.copy_[t]=ut(s,e)):s},has(e,t){return t in Z(e)},ownKeys(e){return Reflect.ownKeys(Z(e))},set(e,t,r){let s=nr(Z(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=at(Z(e),t),n=i?.[B];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(hi(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=Z(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){q(11)},getPrototypeOf(e){return oe(e.base_)},setPrototypeOf(){q(12)}},me={};ve(mt,(e,t)=>{me[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});me.deleteProperty=function(e,t){return me.set.call(this,e,t,void 0)};me.set=function(e,t,r){return mt.set.call(this,e[0],t,r,e[0])};function at(e,t){let r=e[B];return(r?Z(r):e)[t]}function gi(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=oe(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=oe(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 bi=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,f=>r.call(this,f,...h))}}typeof r!="function"&&q(6),s!==void 0&&typeof s!="function"&&q(7);let i;if(ee(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=[];te("Patches").generateReplacementPatches_(t,i,n,a),s(n,a)}return i}else q(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){ee(e)||q(8),le(e)&&(e=vi(e));let t=Qt(this),r=ut(e,void 0);return r[B].isManual_=!0,ht(t),r}finishDraft(e,t){let r=e&&e[B];(!r||!r.isManual_)&&q(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=te("Patches").applyPatches_;return le(e)?s(e,t):this.produce(e,i=>s(i,t))}};function ut(e,t){let r=Se(e)?te("MapSet").proxyMap_(e,t):Ee(e)?te("MapSet").proxySet_(e,t):yi(e,t);return(t?t.scope_:ir()).drafts_.push(r),r}function vi(e){return le(e)||q(10,e),ar(e)}function ar(e){if(!ee(e)||ke(e))return e;let t=e[B],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 ve(r,(s,i)=>{sr(r,s,ar(i))}),t&&(t.finalized_=!1),r}var H=new bi,or=H.produce,Ka=H.produceWithPatches.bind(H),Ua=H.setAutoFreeze.bind(H),qa=H.setUseStrictShallowCopy.bind(H),Ga=H.applyPatches.bind(H),Ja=H.createDraft.bind(H),Ya=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},K={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8},Ae={NOT:0};var pe=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var lr=(e,t)=>{if(t===null)return new pe(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new pe(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return new pe(`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 pe(`Unknown function '${e}' (${r})`)};var wi=(e,t,r={})=>V(e,r,t,{}),V=(e,t,r,s)=>{switch(e.type){case N.LITERAL:return e.value;case N.VARIABLE:return cr(e.path,r,s);case N.INTERPOLATION:return xi(e.parts,t,r,s);case N.FUNCTION:return hr(e,t,r,s);case N.BINARY:return dr(e,t,r,s);case N.UNARY:return ur(e,t,r,s);case N.CONDITIONAL:return _i(e,t,r,s);case N.LOOP:return Si(e,t,r,s);case N.OBJECT:return Ei(e,t,r,s);case N.ARRAY:return ki(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},xi=(e,t,r,s)=>{let i="";for(let n of e)if(typeof n=="string")i+=n;else{let a=V(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=>V(a,t,r,s));return i(...n)},$e=(e,t,r,s)=>{switch(e.type){case N.VARIABLE:return cr(e.path,r,s);case N.LITERAL:return e.value;case N.BINARY:return dr(e,t,r,s);case N.UNARY:return ur(e,t,r,s);case N.FUNCTION:return hr(e,t,r,s);default:return V(e,t,r,s)}},dr=(e,t,r,s)=>{if(e.op===K.AND||e.op===K.OR){let a=$e(e.left,t,r,s),o=$e(e.right,t,r,s);switch(e.op){case K.AND:return a&&o;case K.OR:return a||o}}let i=V(e.left,t,r,s),n=V(e.right,t,r,s);switch(e.op){case K.EQ:return i==n;case K.NEQ:return i!=n;case K.GT:return i>n;case K.LT:return i<n;case K.GTE:return i>=n;case K.LTE:return i<=n;case K.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===Ae.NOT?$e(e.operand,t,r,s):V(e.operand,t,r,s);switch(e.op){case Ae.NOT:return!i;default:throw new Error(`Unknown unary operator: ${e.op}`)}},_i=(e,t,r,s)=>{for(let i=0;i<e.conditions.length;i++){let n=e.conditions[i];if(n===null||$e(n,t,r,s))return V(e.bodies[i],t,r,s)}return{}},Si=(e,t,r,s)=>{let i=V(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=V(e.body,t,r,o);Array.isArray(l)&&l.length===1?n.push(l[0]):n.push(l)}return n},Ei=(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=V(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(f=>f.key.startsWith("$for "));if(h){let f=V(h.value,t,r,s);f!==void 0&&(i[o.key]=f)}else{let f=V(o.value,t,r,s);f!==void 0&&(i[o.key]=f)}}else{let h=o.parsedKey?V(o.parsedKey,t,r,s):o.key,f=V(o.value,t,r,s);f!==void 0&&(i[h]=f)}}return i},ki=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===N.LOOP){let a=V(n,t,r,s);i.push(a)}else i.push(V(n,t,r,s));return i},Ce=wi;var Oe=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...Oe(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]:Oe(n)})}}t.push(r)}return t},[]):e;var fr=(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)},mr=({h:e,template:t,viewData:r,refs:s,handlers:i})=>{let n=Ce(t,r,{}),a=Oe(n),o=Ci({h:e,items:a,refs:s,handlers:i,viewData:r});return e("div",{style:{display:"contents"}},o)},Ci=({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 f=Object.entries(l);if(f.length===0)return null;let[g,k]=f[0];if(!isNaN(Number(g)))return Array.isArray(k)?n(k,`${o}.${g}`):typeof k=="object"&&k!==null&&Object.entries(k).length>0?n([k],`${o}.${g}`):String(k);f.length>1&&console.warn("Item has multiple keys, processing only the first:",g);let L,p,c=g.indexOf(" ");c===-1?(L=g,p=""):(L=g.substring(0,c),p=g.substring(c+1).trim());let d=L.split(/[.#]/)[0],u=d.includes("-"),b={},_={};if(p){let S=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|(\S+))/g,m,I=new Set;for(;(m=S.exec(p))!==null;)if(I.add(m[1]),m[1].startsWith(".")){let M=m[1].substring(1),Q=m[4];_[M]=fr(i,Q)}else if(m[1].startsWith("?")){let M=m[1].substring(1),Q=m[2]||m[3]||m[4],ie;Q==="true"?ie=!0:Q==="false"?ie=!1:ie=fr(i,Q),ie&&(b[M]="")}else b[m[1]]=m[2]||m[3]||m[4];let P=/\b(\S+?)(?=\s|$)/g,D;for(;(D=P.exec(p))!==null;){let M=D[1];!I.has(M)&&!M.startsWith(".")&&!M.includes("=")&&(b[M]="")}}let y=L.match(/#([^.#\s]+)/);y&&!Object.prototype.hasOwnProperty.call(b,"id")&&(b.id=y[1]);let x=null;b.id?x=b.id:u&&(x=d);let v=Object.create(null),E=null;if(u)E=d;else{let S=L.match(/\.([^.#]+)/g);S&&S.forEach(I=>{let P=I.substring(1);v[P]=!0});let m=L.match(/#([^.#\s]+)/);m&&(E=m[1])}let w;typeof k=="string"||typeof k=="number"?w=String(k):Array.isArray(k)?w=n(k,`${o}.${g}`):w=[],E&&!u&&(b.id=E);let $=Object.create(null);if(x&&r){let S=[];if(Object.keys(r).forEach(m=>{if(m.includes("*")){let I="^"+m.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(I).test(x)&&S.push(m)}catch(P){console.warn(`[Parser] Invalid regex pattern created from refKey '${m}': ${I}`,P)}}else x===m&&S.push(m)}),S.length>0){S.sort((I,P)=>{let D=!I.includes("*"),M=!P.includes("*");return D&&!M?-1:!D&&M?1:P.length-I.length});let m=S[0];if(r[m]&&r[m].eventListeners){let I=r[m].eventListeners;Object.entries(I).forEach(([P,D])=>{D.handler&&s[D.handler]?$[P]=M=>{s[D.handler](M)}:D.handler&&console.warn(`[Parser] Handler '${D.handler}' for refKey '${m}' (matching elementId '${x}') is referenced but not found in available handlers.`)})}}}let O={};if(x)O.key=x;else if(L){let S=o?`${o}.${h}`:String(h);if(O.key=`${L}-${S}`,Object.keys(_).length>0){let m=JSON.stringify(_).substring(0,50);O.key+=`-${m}`}}Object.keys(b).length>0&&(O.attrs=b),Object.keys(v).length>0&&(O.class=v),Object.keys($).length>0&&(O.on=$),Object.keys(_).length>0&&(O.props=_),u&&(O.hook={update:(S,m)=>{let I=S.data?.props||{},P=m.data?.props||{},D=S.data?.attrs||{},M=m.data?.attrs||{},Q=JSON.stringify(I)!==JSON.stringify(P),ie=JSON.stringify(D)!==JSON.stringify(M);if(Q||ie){let j=m.elm;j&&j.render&&typeof j.render=="function"&&(j.setAttribute("isDirty","true"),requestAnimationFrame(()=>{if(j.render(),j.removeAttribute("isDirty"),j.handlers&&j.handlers.handleOnUpdate){let Pr={...j.deps||{},store:j.store,render:j.render.bind(j),handlers:j.handlers,dispatchEvent:j.dispatchEvent.bind(j),refIds:j.refIds||{},getRefIds:()=>j.refIds||{}};j.handlers.handleOnUpdate({oldProps:I,newProps:P,oldAttrs:D,newAttrs:M},Pr)}}))}}});try{return e(d,O,w)}catch(S){return console.error("Error creating virtual node:",S,{tagName:d,snabbdomData:O,childrenOrText:w}),e("div",{},["Error creating element"])}}).filter(Boolean)}return n(t)};var Oi=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([a,o])=>` ${a}: ${o};`).join(`
919
+ `))}constructor(){super(),e.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[e.styleSheet],this._popoverOverlay=document.createElement("div"),this._popoverOverlay.className="popover-overlay",this.shadow.appendChild(this._popoverOverlay),this._popoverOverlay.addEventListener("click",()=>{this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._popoverOverlay.addEventListener("contextmenu",t=>{t.preventDefault(),this.dispatchEvent(new CustomEvent("close",{detail:{}}))}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this.shadow.appendChild(this._popoverContainer),this._slotElement=null,this._isOpen=!1,this._handleEscKey=this._handleEscKey.bind(this)}static get observedAttributes(){return["open","x","y","placement"]}connectedCallback(){this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._removeGlobalListeners()}attributeChangedCallback(t,r,s){t==="open"?s!==null&&!this._isOpen?this._show():s===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="placement")&&this._isOpen&&this._updatePosition()}_show(){this._isOpen||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._updatePosition(),this._addGlobalListeners())}_hide(){this._isOpen&&(this._isOpen=!1,this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null),this._removeGlobalListeners())}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),r=parseFloat(this.getAttribute("y")||"0"),s=this.getAttribute("placement")||"bottom-start";this.removeAttribute("positioned"),requestAnimationFrame(()=>{let i=this._popoverContainer.getBoundingClientRect(),{left:n,top:a}=this._calculatePosition(t,r,i.width,i.height,s);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${a}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,r,s,i,n){let o=t,l=r;switch(n){case"top":o=t-s/2,l=r-i-8;break;case"top-start":o=t,l=r-i-8;break;case"top-end":o=t-s,l=r-i-8;break;case"right":o=t+8,l=r-i/2;break;case"right-start":o=t+8,l=r;break;case"right-end":o=t+8,l=r-i;break;case"bottom":o=t-s/2,l=r+8;break;case"bottom-start":o=t,l=r+8;break;case"bottom-end":o=t-s,l=r+8;break;case"left":o=t-s-8,l=r-i/2;break;case"left-start":o=t-s-8,l=r;break;case"left-end":o=t-s-8,l=r-i;break}let h=8;return o=Math.max(h,Math.min(o,window.innerWidth-s-h)),l=Math.max(h,Math.min(l,window.innerHeight-i-h)),{left:o,top:l}}_addGlobalListeners(){setTimeout(()=>{document.addEventListener("keydown",this._handleEscKey)},0)}_removeGlobalListeners(){document.removeEventListener("keydown",this._handleEscKey)}_handleEscKey(t){t.key==="Escape"&&this.dispatchEvent(new CustomEvent("close",{detail:{}}))}get popover(){return this._popoverContainer}},Bt=({render:e,html:t})=>He;var Ue={};M(Ue,{handleClickMenuItem:()=>Jr,handleClosePopover:()=>Gr});var Gr=(e,t)=>{let{dispatchEvent:r}=t;r(new CustomEvent("close"))},Jr=(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 qe={};M(qe,{INITIAL_STATE:()=>Yr,toViewData:()=>Xr});var Yr=Object.freeze({}),Xr=({props:e,attrs:t})=>({items:e.items||[],open:!!t.open,x:t.x,y:t.y,placement:t.placement});var Kt={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"]}}}}}},attrsSchema:{type:"object",properties:{open:{type:"string"},x:{type:"string"},y:{type:"string"},placement:{type:"string"}}},refs:{popover:{eventListeners:{close:{handler:"handleClosePopover"}}},"option-*":{eventListeners:{click:{handler:"handleClickMenuItem"}}}},template:{type:9,items:[{type:8,properties:[{key:"rtgl-popover#popover ?open=${open} x=${x} y=${y} placement=${placement}",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},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"open"}," x=",{type:1,path:"x"}," y=",{type:1,path:"y"}," placement=",{type:1,path:"placement"}]}}],fast:!1}],fast:!1}};var Ge={};M(Ge,{handleActionClick:()=>Zr,handleBeforeMount:()=>Qr,handleColorPickerChange:()=>rs,handleInputChange:()=>es,handleSelectChange:()=>ts,handleSliderChange:()=>ss,handleSliderInputChange:()=>is});var Qr=e=>{let{store:t,props:r}=e;t.setFormValues(r.defaultValues)},ue=(e,t,r,s)=>{s(new CustomEvent("form-change",{detail:{name:e,fieldValue:t,formValues:r}}))},Zr=(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()}}))},es=(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}),ue(i,e.detail.value,r.selectFormValues(),s))},ts=(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}),ue(i,e.detail.selectedValue,r.selectFormValues(),s))},rs=(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}),ue(i,e.detail.value,r.selectFormValues(),s))},ss=(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}),ue(i,e.detail.value,r.selectFormValues(),s))},is=(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}),ue(i,e.detail.value,r.selectFormValues(),s))};var Je={};M(Je,{INITIAL_STATE:()=>ns,selectFormValues:()=>cs,selectState:()=>ps,setFormFieldValue:()=>ds,setFormValues:()=>hs,toViewData:()=>ls});var ns=Object.freeze({formValues:{}}),as=["id","class","style","slot"],os=e=>Object.entries(e).filter(([t])=>!as.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),ls=({state:e,props:t,attrs:r})=>{let s=os(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}},ps=({state:e})=>e,cs=({state:e})=>e.formValues,hs=(e,t)=>{e.formValues=t||{}},ds=(e,{name:t,value:r})=>{e.formValues[t]=r};var Ht={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 Ye={};M(Ye,{handleClickStart:()=>us});var us=(e,t)=>{let{dispatchEvent:r,store:s}=t;console.log("handle click start",s.selectPath()),r(new CustomEvent("clickStart",{detail:{path:s.selectPath()}}))};var Xe={};M(Xe,{INITIAL_STATE:()=>fs,selectPath:()=>bs,setState:()=>vs,toViewData:()=>gs});var fs=Object.freeze({}),ms=["id","class","style","slot"],ys=e=>Object.entries(e).filter(([t])=>!ms.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),gs=({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:ys(r),start:s||{label:"",image:{src:"",width:32,height:32,alt:""}}}},bs=({props:e})=>e.start.path,vs=e=>{};var Ut={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={};M(Qe,{handleBeforeMount:()=>xs});var qt=(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())},ws=(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),qt(n,t),s();let o=qt.bind(void 0,n,t);return e.addEventListener("scroll",o,{passive:!0}),()=>{e.removeEventListener("scroll",o)}},xs=e=>{let{attrs:t}=e;requestAnimationFrame(()=>{let r=document.getElementById(t["target-id"]),s=ws(r,e);return()=>{s()}})};var Ze={};M(Ze,{INITIAL_STATE:()=>_s,selectCurrentId:()=>ks,selectState:()=>Es,setContentContainer:()=>Cs,setCurrentId:()=>$s,setItems:()=>As,toViewData:()=>Ss});var _s=Object.freeze({items:[],currentId:null,contentContainer:null}),Ss=({state:e})=>({items:e.items.map(t=>({...t,c:t.id===e.currentId?"fg":"mu-fg"})),currentId:e.currentId}),Es=({state:e})=>e,ks=({state:e})=>e.currentId,As=(e,t)=>{e.items=t},$s=(e,t)=>{e.currentId=t},Cs=(e,t)=>{e.contentContainer=t};var Gt={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 et={};M(et,{handleBeforeMount:()=>Os,handleButtonClick:()=>Is,handleClickOptionsPopoverOverlay:()=>Ts,handleOptionClick:()=>Ls});var Os=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())}},Is=(e,t)=>{let{store:r,render:s,getRefIds:i}=t;r.openOptionsPopover({position:{y:e.clientY,x:e.clientX}}),s()},Ts=(e,t)=>{let{store:r,render:s}=t;r.closeOptionsPopover(),s()},Ls=(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 tt={};M(tt,{INITIAL_STATE:()=>Ns,closeOptionsPopover:()=>Ds,openOptionsPopover:()=>Vs,selectState:()=>js,toViewData:()=>Ps,updateSelectOption:()=>Ms});var Ns=Object.freeze({isOpen:!1,position:{x:0,y:0},selectedValue:null,selectedLabel:null}),Ps=({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"}},js=({state:e})=>e,Vs=(e,t)=>{let{position:r}=t;e.position=r,e.isOpen=!0},Ds=e=>{e.isOpen=!1},Ms=(e,t)=>{e.selectedValue=t.value,e.selectedLabel=t.label,e.isOpen=!1};var Jt={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 ?open=${isOpen} x=${position.x} y=${position.y}",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},parsedKey:{type:2,parts:["rtgl-popover#popover ?open=",{type:1,path:"isOpen"}," x=",{type:1,path:"position.x"}," y=",{type:1,path:"position.y"}]}}],fast:!1}],fast:!1}};var rt={};M(rt,{handleHeaderClick:()=>Rs,handleItemClick:()=>zs});var Rs=(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}))},zs=(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 it={};M(it,{INITIAL_STATE:()=>Ws,selectActiveItem:()=>Us,selectHeader:()=>Hs,selectItem:()=>qs,setState:()=>Gs,toViewData:()=>Ks});var Ws=Object.freeze({}),Fs=["id","class","style","slot"],Bs=e=>Object.entries(e).filter(([t])=>!Fs.includes(t)).map(([t,r])=>`${t}=${r}`).join(" ");function st(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 Ks=({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=Bs(r),o=r.mode||"full",l=s||{label:"",path:"",image:{src:"",alt:"",width:0,height:0}},h=i?st(i,n):[],f=o==="full"?272:64,g=o==="full"?"fs":"c",k=o==="full"?"fs":"c",L=o==="full"?"lg":"sm",p=o==="full"?"md":"sm",c=o==="shrunk-lg"?48:40,d=o==="shrunk-lg"?28:20,u=o==="shrunk-lg"?"md":"sm",b=o==="full",_=o==="full",y=o==="full"?"fs":"c",x=o==="full"?"":`ah=${k}`,v=o==="full"?"f":c;return{containerAttrString:a,mode:o,header:l,items:h,sidebarWidth:f,headerAlign:g,itemAlign:k,headerPadding:L,itemPadding:p,itemHeight:c,iconSize:d,firstLetterSize:u,showLabels:b,showGroupLabels:_,itemContentAlign:y,itemAlignAttr:x,itemWidth:v,headerWidth:v,selectedItemId:n,ah:o==="shrunk-lg"||o==="shrunk-md"?"c":""}},Hs=({state:e,props:t,attrs:r})=>r.header?JSON.parse(decodeURIComponent(r.header)):t.header,Us=({state:e,props:t})=>(t.items?st(t.items):[]).find(s=>s.active),qs=({state:e,props:t,attrs:r},s)=>{let i=r.items?JSON.parse(decodeURIComponent(r.items)):t.items;return(i?st(i):[]).find(a=>a.id===s)},Gs=e=>{};var Yt={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",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"]}}],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 nt={};M(nt,{handleBeforeMount:()=>Js,handleValueChange:()=>Ys});var Js=e=>{let{store:t,attrs:r}=e;t.setValue(r.defaultValue||0)},Ys=(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 at={};M(at,{INITIAL_STATE:()=>Xs,setValue:()=>Zs,toViewData:()=>Qs});var Xs=Object.freeze({value:0}),Qs=({state:e,attrs:t})=>({value:e.value,w:t.w||"",min:t.min||0,max:t.max||100,step:t.step||1}),Zs=(e,t)=>{e.value=t};var Xt={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=f type=range min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-slider#slider w=f type=range min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],fast:!0},{type:8,properties:[{key:"rtgl-view w=84",value:{type:9,items:[{type:8,properties:[{key:"rtgl-input#input w=f type=number min=${min} max=${max} step=${step} value=${value}",value:{type:0,value:null},parsedKey:{type:2,parts:["rtgl-input#input w=f type=number min=",{type:1,path:"min"}," max=",{type:1,path:"max"}," step=",{type:1,path:"step"}," value=",{type:1,path:"value"}]}}],fast:!0}],fast:!0}}],fast:!0}],fast:!0},parsedKey:{type:2,parts:["rtgl-view d=h av=c g=md w=",{type:1,path:"w"}]}}],fast:!0}],fast:!0}};var ot={};M(ot,{handleBeforeMount:()=>ei,handleHeaderClick:()=>ri,handleRowClick:()=>ti});var ei=e=>{},ti=(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}}))},ri=(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 lt={};M(lt,{INITIAL_STATE:()=>si,clearSort:()=>hi,selectSortInfo:()=>pi,selectState:()=>li,setSortColumn:()=>ci,toViewData:()=>oi});var si=Object.freeze({sortColumn:null,sortDirection:null}),ii=["id","class","style","slot"],ni=e=>Object.entries(e).filter(([t])=>!ii.includes(t)).map(([t,r])=>`${t}=${r}`).join(" "),ai=(e,t)=>{let r=t.split("."),s=e;for(let i of r){if(s==null)return null;s=s[i]}return s},oi=({state:e,props:t,attrs:r})=>{let s=ni(r),i=t.data||{columns:[],rows:[]},n=i.rows.map((a,o)=>{let l=i.columns.map(h=>{let f=ai(a,h.key);return{key:h.key,value:f!=null?String(f):""}});return{index:o,cells:l}});return{containerAttrString:s,columns:i.columns||[],rows:n||[]}},li=({state:e})=>e,pi=({state:e})=>({column:e.sortColumn,direction:e.sortDirection}),ci=(e,{column:t,direction:r})=>{e.sortColumn=t,e.sortDirection=r},hi=e=>{e.sortColumn=null,e.sortDirection=null};var Qt={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 ir=Symbol.for("immer-nothing"),Zt=Symbol.for("immer-draftable"),F=Symbol.for("immer-state");function q(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var ae=Object.getPrototypeOf;function oe(e){return!!e&&!!e[F]}function ee(e){return e?nr(e)||Array.isArray(e)||!!e[Zt]||!!e.constructor?.[Zt]||Ee(e)||ke(e):!1}var di=Object.prototype.constructor.toString();function nr(e){if(!e||typeof e!="object")return!1;let t=ae(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)===di}function we(e,t){Se(e)===0?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,s)=>t(s,r,e))}function Se(e){let t=e[F];return t?t.type_:Array.isArray(e)?1:Ee(e)?2:ke(e)?3:0}function ht(e,t){return Se(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ar(e,t,r){let s=Se(e);s===2?e.set(t,r):s===3?e.add(r):e[t]=r}function ui(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Ee(e){return e instanceof Map}function ke(e){return e instanceof Set}function Z(e){return e.copy_||e.base_}function dt(e,t){if(Ee(e))return new Map(e);if(ke(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=nr(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(ae(e),s)}else{let s=ae(e);if(s!==null&&r)return{...e};let i=Object.create(s);return Object.assign(i,e)}}function gt(e,t=!1){return Ae(e)||oe(e)||!ee(e)||(Se(e)>1&&(e.set=e.add=e.clear=e.delete=fi),Object.freeze(e),t&&Object.entries(e).forEach(([r,s])=>gt(s,!0))),e}function fi(){q(2)}function Ae(e){return Object.isFrozen(e)}var mi={};function te(e){let t=mi[e];return t||q(0,e),t}var fe;function or(){return fe}function yi(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function er(e,t){t&&(te("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ut(e){ft(e),e.drafts_.forEach(gi),e.drafts_=null}function ft(e){e===fe&&(fe=e.parent_)}function tr(e){return fe=yi(fe,e)}function gi(e){let t=e[F];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function rr(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return e!==void 0&&e!==r?(r[F].modified_&&(ut(t),q(4)),ee(e)&&(e=xe(t,e),t.parent_||_e(t,e)),t.patches_&&te("Patches").generateReplacementPatches_(r[F].base_,e,t.patches_,t.inversePatches_)):e=xe(t,r,[]),ut(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ir?e:void 0}function xe(e,t,r){if(Ae(t))return t;let s=t[F];if(!s)return we(t,(i,n)=>sr(e,s,t,i,n,r)),t;if(s.scope_!==e)return t;if(!s.modified_)return _e(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),we(n,(o,l)=>sr(e,s,i,o,l,r,a)),_e(e,i,!1),r&&e.patches_&&te("Patches").generatePatches_(s,r,e.patches_,e.inversePatches_)}return s.copy_}function sr(e,t,r,s,i,n,a){if(oe(i)){let o=n&&t&&t.type_!==3&&!ht(t.assigned_,s)?n.concat(s):void 0,l=xe(e,i,o);if(ar(r,s,l),oe(l))e.canAutoFreeze_=!1;else return}else a&&r.add(i);if(ee(i)&&!Ae(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;xe(e,i),(!t||!t.scope_.parent_)&&typeof s!="symbol"&&Object.prototype.propertyIsEnumerable.call(r,s)&&_e(e,i)}}function _e(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&gt(t,r)}function bi(e,t){let r=Array.isArray(e),s={type_:r?1:0,scope_:t?t.scope_:or(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=s,n=bt;r&&(i=[s],n=me);let{revoke:a,proxy:o}=Proxy.revocable(i,n);return s.draft_=o,s.revoke_=a,o}var bt={get(e,t){if(t===F)return e;let r=Z(e);if(!ht(r,t))return vi(e,r,t);let s=r[t];return e.finalized_||!ee(s)?s:s===pt(e.base_,t)?(ct(e),e.copy_[t]=yt(s,e)):s},has(e,t){return t in Z(e)},ownKeys(e){return Reflect.ownKeys(Z(e))},set(e,t,r){let s=lr(Z(e),t);if(s?.set)return s.set.call(e.draft_,r),!0;if(!e.modified_){let i=pt(Z(e),t),n=i?.[F];if(n&&n.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(ui(r,i)&&(r!==void 0||ht(e.base_,t)))return!0;ct(e),mt(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return pt(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,ct(e),mt(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){let r=Z(e),s=Reflect.getOwnPropertyDescriptor(r,t);return s&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:s.enumerable,value:r[t]}},defineProperty(){q(11)},getPrototypeOf(e){return ae(e.base_)},setPrototypeOf(){q(12)}},me={};we(bt,(e,t)=>{me[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});me.deleteProperty=function(e,t){return me.set.call(this,e,t,void 0)};me.set=function(e,t,r){return bt.set.call(this,e[0],t,r,e[0])};function pt(e,t){let r=e[F];return(r?Z(r):e)[t]}function vi(e,t,r){let s=lr(t,r);return s?"value"in s?s.value:s.get?.call(e.draft_):void 0}function lr(e,t){if(!(t in e))return;let r=ae(e);for(;r;){let s=Object.getOwnPropertyDescriptor(r,t);if(s)return s;r=ae(r)}}function mt(e){e.modified_||(e.modified_=!0,e.parent_&&mt(e.parent_))}function ct(e){e.copy_||(e.copy_=dt(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var wi=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,f=>r.call(this,f,...h))}}typeof r!="function"&&q(6),s!==void 0&&typeof s!="function"&&q(7);let i;if(ee(t)){let n=tr(this),a=yt(t,void 0),o=!0;try{i=r(a),o=!1}finally{o?ut(n):ft(n)}return er(n,s),rr(i,n)}else if(!t||typeof t!="object"){if(i=r(t),i===void 0&&(i=t),i===ir&&(i=void 0),this.autoFreeze_&&gt(i,!0),s){let n=[],a=[];te("Patches").generateReplacementPatches_(t,i,n,a),s(n,a)}return i}else q(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){ee(e)||q(8),oe(e)&&(e=xi(e));let t=tr(this),r=yt(e,void 0);return r[F].isManual_=!0,ft(t),r}finishDraft(e,t){let r=e&&e[F];(!r||!r.isManual_)&&q(9);let{scope_:s}=r;return er(s,t),rr(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=te("Patches").applyPatches_;return oe(e)?s(e,t):this.produce(e,i=>s(i,t))}};function yt(e,t){let r=Ee(e)?te("MapSet").proxyMap_(e,t):ke(e)?te("MapSet").proxySet_(e,t):bi(e,t);return(t?t.scope_:or()).drafts_.push(r),r}function xi(e){return oe(e)||q(10,e),pr(e)}function pr(e){if(!ee(e)||Ae(e))return e;let t=e[F],r;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=dt(e,t.scope_.immer_.useStrictShallowCopy_)}else r=dt(e,!0);return we(r,(s,i)=>{ar(r,s,pr(i))}),t&&(t.finalized_=!1),r}var B=new wi,cr=B.produce,qa=B.produceWithPatches.bind(B),Ga=B.setAutoFreeze.bind(B),Ja=B.setUseStrictShallowCopy.bind(B),Ya=B.applyPatches.bind(B),Xa=B.createDraft.bind(B),Qa=B.finishDraft.bind(B);var j={LITERAL:0,VARIABLE:1,INTERPOLATION:2,FUNCTION:3,BINARY:4,UNARY:5,CONDITIONAL:6,LOOP:7,OBJECT:8,ARRAY:9},K={EQ:0,NEQ:1,GT:2,LT:3,GTE:4,LTE:5,AND:6,OR:7,IN:8},$e={NOT:0};var le=class extends Error{constructor(t){super(`Render Error: ${t}`),this.name="JemplRenderError"}};var hr=(e,t)=>{if(t===null)return new le(`Cannot iterate over null value at '$for ${e}'`);if(t===void 0)return new le(`Cannot iterate over undefined value at '$for ${e}'`);let r=typeof t;return new le(`Cannot iterate over non-array value (got: ${r}) at '$for ${e}'`)},dr=(e,t)=>{let r=t&&Object.keys(t).length>0?Object.keys(t).join(", "):"no custom functions provided";return new le(`Unknown function '${e}' (${r})`)};var _i=(e,t,r={})=>V(e,r,t,{}),V=(e,t,r,s)=>{switch(e.type){case j.LITERAL:return e.value;case j.VARIABLE:return ur(e.path,r,s);case j.INTERPOLATION:return Si(e.parts,t,r,s);case j.FUNCTION:return fr(e,t,r,s);case j.BINARY:return mr(e,t,r,s);case j.UNARY:return yr(e,t,r,s);case j.CONDITIONAL:return Ei(e,t,r,s);case j.LOOP:return ki(e,t,r,s);case j.OBJECT:return Ai(e,t,r,s);case j.ARRAY:return $i(e,t,r,s);default:throw new Error(`Unknown node type: ${e.type}`)}},ur=(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},Si=(e,t,r,s)=>{let i="";for(let n of e)if(typeof n=="string")i+=n;else{let a=V(n,t,r,s);i+=a!=null?String(a):""}return i},fr=(e,t,r,s)=>{let i=t[e.name];if(!i)throw dr(e.name,t);let n=e.args.map(a=>V(a,t,r,s));return i(...n)},Ce=(e,t,r,s)=>{switch(e.type){case j.VARIABLE:return ur(e.path,r,s);case j.LITERAL:return e.value;case j.BINARY:return mr(e,t,r,s);case j.UNARY:return yr(e,t,r,s);case j.FUNCTION:return fr(e,t,r,s);default:return V(e,t,r,s)}},mr=(e,t,r,s)=>{if(e.op===K.AND||e.op===K.OR){let a=Ce(e.left,t,r,s),o=Ce(e.right,t,r,s);switch(e.op){case K.AND:return a&&o;case K.OR:return a||o}}let i=V(e.left,t,r,s),n=V(e.right,t,r,s);switch(e.op){case K.EQ:return i==n;case K.NEQ:return i!=n;case K.GT:return i>n;case K.LT:return i<n;case K.GTE:return i>=n;case K.LTE:return i<=n;case K.IN:return Array.isArray(n)?n.includes(i):!1;default:throw new Error(`Unknown binary operator: ${e.op}`)}},yr=(e,t,r,s)=>{let i=e.op===$e.NOT?Ce(e.operand,t,r,s):V(e.operand,t,r,s);switch(e.op){case $e.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||Ce(n,t,r,s))return V(e.bodies[i],t,r,s)}return{}},ki=(e,t,r,s)=>{let i=V(e.iterable,t,r,s);if(!Array.isArray(i)){let a=`${e.itemVar}${e.indexVar?`, ${e.indexVar}`:""} in ${e.iterable.path}`;throw hr(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=V(e.body,t,r,o);Array.isArray(l)&&l.length===1?n.push(l[0]):n.push(l)}return n},Ai=(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=V(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(f=>f.key.startsWith("$for "));if(h){let f=V(h.value,t,r,s);f!==void 0&&(i[o.key]=f)}else{let f=V(o.value,t,r,s);f!==void 0&&(i[o.key]=f)}}else{let h=o.parsedKey?V(o.parsedKey,t,r,s):o.key,f=V(o.value,t,r,s);f!==void 0&&(i[h]=f)}}return i},$i=(e,t,r,s)=>{let i=[];for(let n of e.items)if(n.type===j.LOOP){let a=V(n,t,r,s);i.push(a)}else i.push(V(n,t,r,s));return i},Oe=_i;var Ie=e=>Array.isArray(e)?e.reduce((t,r)=>{if(Array.isArray(r))t.push(...Ie(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]:Ie(n)})}}t.push(r)}return t},[]):e;var gr=(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)},br=({h:e,template:t,viewData:r,refs:s,handlers:i})=>{let n=Oe(t,r,{}),a=Ie(n),o=Ii({h:e,items:a,refs:s,handlers:i,viewData:r});return e("div",{style:{display:"contents"}},o)},Ii=({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 f=Object.entries(l);if(f.length===0)return null;let[g,k]=f[0];if(!isNaN(Number(g)))return Array.isArray(k)?n(k,`${o}.${g}`):typeof k=="object"&&k!==null&&Object.entries(k).length>0?n([k],`${o}.${g}`):String(k);f.length>1&&console.warn("Item has multiple keys, processing only the first:",g);let L,p,c=g.indexOf(" ");c===-1?(L=g,p=""):(L=g.substring(0,c),p=g.substring(c+1).trim());let d=L.split(/[.#]/)[0],u=d.includes("-"),b={},_={};if(p){let S=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]+))/g,m,I=new Set;for(;(m=S.exec(p))!==null;)if(I.add(m[1]),m[1].startsWith(".")){let H=m[1].substring(1),he=m[4];_[H]=gr(i,he)}else if(m[1].startsWith("?")){let H=m[1].substring(1),he=m[2]||m[3]||m[4],ge;he==="true"?ge=!0:he==="false"?ge=!1:ge=gr(i,he),ge&&(b[H]="")}else b[m[1]]=m[2]||m[3]||m[4];let N=p,D=[],G,Ne=/(\S+?)=(?:\"([^\"]*)\"|\'([^\']*)\'|([^\s]+))/g;for(;(G=Ne.exec(p))!==null;)D.push(G[0]);D.forEach(H=>{N=N.replace(H," ")});let Pe=/\b(\S+?)(?=\s|$)/g,P;for(;(P=Pe.exec(N))!==null;){let H=P[1];!I.has(H)&&!H.startsWith(".")&&!H.includes("=")&&(b[H]="")}}let y=L.match(/#([^.#\s]+)/);y&&!Object.prototype.hasOwnProperty.call(b,"id")&&(b.id=y[1]);let x=null;b.id?x=b.id:u&&(x=d);let v=Object.create(null),E=null;if(u)E=d;else{let S=L.match(/\.([^.#]+)/g);S&&S.forEach(I=>{let N=I.substring(1);v[N]=!0});let m=L.match(/#([^.#\s]+)/);m&&(E=m[1])}let w;typeof k=="string"||typeof k=="number"?w=String(k):Array.isArray(k)?w=n(k,`${o}.${g}`):w=[],E&&!u&&(b.id=E);let $=Object.create(null);if(x&&r){let S=[];if(Object.keys(r).forEach(m=>{if(m.includes("*")){let I="^"+m.replace(/[.*+?^${}()|[\\\]\\]/g,"\\$&").replace(/\\\*/g,".*")+"$";try{new RegExp(I).test(x)&&S.push(m)}catch(N){console.warn(`[Parser] Invalid regex pattern created from refKey '${m}': ${I}`,N)}}else x===m&&S.push(m)}),S.length>0){S.sort((I,N)=>{let D=!I.includes("*"),G=!N.includes("*");return D&&!G?-1:!D&&G?1:N.length-I.length});let m=S[0];if(r[m]&&r[m].eventListeners){let I=r[m].eventListeners;Object.entries(I).forEach(([N,D])=>{D.handler&&s[D.handler]?$[N]=G=>{s[D.handler](G)}:D.handler&&console.warn(`[Parser] Handler '${D.handler}' for refKey '${m}' (matching elementId '${x}') is referenced but not found in available handlers.`)})}}}let O={};if(x)O.key=x;else if(L){let S=o?`${o}.${h}`:String(h);if(O.key=`${L}-${S}`,Object.keys(_).length>0){let m=JSON.stringify(_).substring(0,50);O.key+=`-${m}`}}Object.keys(b).length>0&&(O.attrs=b),Object.keys(v).length>0&&(O.class=v),Object.keys($).length>0&&(O.on=$),Object.keys(_).length>0&&(O.props=_),u&&(O.hook={update:(S,m)=>{let I=S.data?.props||{},N=m.data?.props||{},D=S.data?.attrs||{},G=m.data?.attrs||{},Ne=JSON.stringify(I)!==JSON.stringify(N),Pe=JSON.stringify(D)!==JSON.stringify(G);if(Ne||Pe){let P=m.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 H={...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:N,oldAttrs:D,newAttrs:G},H)}}))}}});try{return e(d,O,w)}catch(S){return console.error("Error creating virtual node:",S,{tagName:d,snabbdomData:O,childrenOrText:w}),e("div",{},["Error creating element"])}}).filter(Boolean)}return n(t)};var Ti=(e,t)=>{if(!t||typeof t!="object")return"";let r="",s=n=>Object.entries(n).map(([a,o])=>` ${a}: ${o};`).join(`
920
920
  `),i=(n,a)=>{if(typeof a!="object"||a===null)return"";if(n.startsWith("@")){let o=Object.entries(a).map(([l,h])=>{let f=s(h);return` ${l} {
921
921
  ${f.split(`
922
922
  `).map(g=>g?` ${g}`:"").join(`
@@ -928,7 +928,7 @@ ${o}
928
928
  ${o}
929
929
  }`}};return Object.entries(t).forEach(([n,a])=>{let o=i(n,a);o&&(r+=(r?`
930
930
 
931
- `:"")+o)}),r},Ii=e=>{let t=e.map(r=>r.subscribe());return()=>{for(let r of t)r&&typeof r.unsubscribe=="function"&&r.unsubscribe()}};function Ti(e){return new Proxy({},{get(t,r){if(typeof r=="string"){let s=e.getAttribute(r);return s===""?!0:s}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(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 Li(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(`
931
+ `:"")+o)}),r},Li=e=>{let t=e.map(r=>r.subscribe());return()=>{for(let r of t)r&&typeof r.unsubscribe=="function"&&r.unsubscribe()}};function Ni(e){return new Proxy({},{get(t,r){if(typeof r=="string"){let s=e.getAttribute(r);return s===""?!0:s}},set(){throw new Error("Cannot assign to read-only proxy")},defineProperty(){throw new Error("Cannot define properties on read-only proxy")},deleteProperty(){throw new Error("Cannot delete properties from read-only proxy")},has(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 Pi(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 vt=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(`
932
932
  a, a:link, a:visited, a:hover, a:active {
933
933
  display: contents;
934
934
  color: inherit;
@@ -940,4 +940,4 @@ ${o}
940
940
  font: inherit;
941
941
  cursor: pointer;
942
942
  }
943
- `);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)};if(Object.keys(this.handlers||{}).forEach(i=>{this.transformedHandlers[i]=n=>this.handlers[i](n,s)}),this.handlers?.handleBeforeMount&&(this._unmountCallback=this.handlers?.handleBeforeMount(s),this._unmountCallback&&typeof this._unmountCallback.then=="function"))throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");this.render(),this.handlers?.handleAfterMount&&this.handlers?.handleAfterMount(s),this.handlers?.subscriptions&&(this.unsubscribeAll=Ii(this.handlers.subscriptions(s)))}disconnectedCallback(){this._unmountCallback&&this._unmountCallback(),this.unsubscribeAll&&this.unsubscribeAll()}attributeChangedCallback(t,r,s){if(r!==s&&this.render)if(this.handlers?.handleOnUpdate){let i={[t]:{oldValue:r,newValue:s}},n={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this),store:this.store,render:this.render.bind(this)};this.handlers.handleOnUpdate(i,n)}else 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=mr({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)}}},Ni=(e,t,r)=>{let{INITIAL_STATE:s,toViewData:i,...n}=e,a={},o={},l=structuredClone(s);return Object.entries(n).forEach(([h,f])=>{h.startsWith("select")?a[h]=(...g)=>f({state:l,props:t,attrs:r},...g):o[h]=g=>(l=or(l,k=>f(k,g)),l)}),{toViewData:()=>i({state:l,props:t,attrs:r}),getState:()=>l,...o,...a}},Pi=({handlers:e,view:t,store:r,patch:s,h:i},n)=>{let{elementName:a,propsSchema:o,attrsSchema:l,template:h,refs:f,styles:g}=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 k extends yt{static get observedAttributes(){let p=["key"],c=l?.properties?Object.keys(l.properties):[];return[...p,...c]}constructor(){super();let p=Ti(this);this.propsSchema=o,this.props=o?Li(this,Object.keys(o.properties)):{},this.elementName=a,this.styles=g,this.store=Ni(r,this.props,p),this.template=h,this.handlers=e,this.refs=f,this.patch=s,this.deps={...n,store:this.store,render:this.render,handlers:e,attrs:p,props:this.props},this.h=i,this.cssText=Oi(a,g)}}return k},gt=Pi;function re(e,t,r,s,i){let n=t===void 0?void 0:t.key;return{sel:e,data:t,children:r,text:s,elm:i,key:n}}var ce=Array.isArray;function he(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function ji(e,t){return document.createElement(e,t)}function Vi(e,t,r){return document.createElementNS(e,t,r)}function Di(){return se(document.createDocumentFragment())}function Mi(e){return document.createTextNode(e)}function Ri(e){return document.createComment(e)}function zi(e,t,r){if(X(e)){let s=e;for(;s&&X(s);)s=se(s).parent;e=s??e}X(t)&&(t=se(t,e)),r&&X(r)&&(r=se(r).firstChildNode),e.insertBefore(t,r)}function Wi(e,t){e.removeChild(t)}function Fi(e,t){X(t)&&(t=se(t,e)),e.appendChild(t)}function gr(e){if(X(e)){for(;e&&X(e);)e=se(e).parent;return e??null}return e.parentNode}function Bi(e){var t;if(X(e)){let r=se(e),s=gr(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 Hi(e){return e.tagName}function Ki(e,t){e.textContent=t}function Ui(e){return e.textContent}function qi(e){return e.nodeType===1}function Gi(e){return e.nodeType===3}function Ji(e){return e.nodeType===8}function X(e){return e.nodeType===11}function se(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 br={createElement:ji,createElementNS:Vi,createTextNode:Mi,createDocumentFragment:Di,createComment:Ri,insertBefore:zi,removeChild:Wi,appendChild:Fi,parentNode:gr,nextSibling:Bi,tagName:Hi,setTextContent:Ki,getTextContent:Ui,isElement:qi,isText:Gi,isComment:Ji,isDocumentFragment:X};function Ie(e){return e===void 0}function F(e){return e!==void 0}var bt=re("",{},[],void 0,void 0);function ye(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 Yi(){throw new Error("The document fragment is not supported on this platform.")}function Xi(e,t){return e.isElement(t)}function Qi(e,t){return e.isDocumentFragment(t)}function Zi(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 en=["create","update","remove","destroy","pre","post"];function vr(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:br;for(let p of en)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"),u=d?"."+d.split(" ").join("."):"";return re(i.tagName(p).toLowerCase()+c+u,{},[],void 0,p)}function a(p){return re(void 0,{},[],void 0,p)}function o(p,c){return function(){if(--c===0){let u=i.parentNode(p);u!==null&&i.removeChild(u,p)}}}function l(p,c){var d,u,b,_;let y,x=p.data;if(x!==void 0){let w=(d=x.hook)===null||d===void 0?void 0:d.init;F(w)&&(w(p),x=p.data)}let v=p.children,E=p.sel;if(E==="!")Ie(p.text)&&(p.text=""),p.elm=i.createComment(p.text);else if(E==="")p.elm=i.createTextNode(p.text);else if(E!==void 0){let w=E.indexOf("#"),$=E.indexOf(".",w),O=w>0?w:E.length,S=$>0?$:E.length,m=w!==-1||$!==-1?E.slice(0,Math.min(O,S)):E,I=p.elm=F(x)&&F(y=x.ns)?i.createElementNS(y,m,x):i.createElement(m,x);for(O<S&&I.setAttribute("id",E.slice(O+1,S)),$>0&&I.setAttribute("class",E.slice(S+1).replace(/\./g," ")),y=0;y<s.create.length;++y)s.create[y](bt,p);if(he(p.text)&&(!ce(v)||v.length===0)&&i.appendChild(I,i.createTextNode(p.text)),ce(v))for(y=0;y<v.length;++y){let D=v[y];D!=null&&i.appendChild(I,l(D,c))}let P=p.data.hook;F(P)&&((u=P.create)===null||u===void 0||u.call(P,bt,p),P.insert&&c.push(p))}else if(!((b=r?.experimental)===null||b===void 0)&&b.fragments&&p.children){for(p.elm=((_=i.createDocumentFragment)!==null&&_!==void 0?_:Yi)(),y=0;y<s.create.length;++y)s.create[y](bt,p);for(y=0;y<p.children.length;++y){let w=p.children[y];w!=null&&i.appendChild(p.elm,l(w,c))}}else p.elm=i.createTextNode(p.text);return p.elm}function h(p,c,d,u,b,_){for(;u<=b;++u){let y=d[u];y!=null&&i.insertBefore(p,l(y,_),c)}}function f(p){var c,d;let u=p.data;if(u!==void 0){(d=(c=u?.hook)===null||c===void 0?void 0:c.destroy)===null||d===void 0||d.call(c,p);for(let b=0;b<s.destroy.length;++b)s.destroy[b](p);if(p.children!==void 0)for(let b=0;b<p.children.length;++b){let _=p.children[b];_!=null&&typeof _!="string"&&f(_)}}}function g(p,c,d,u){for(var b,_;d<=u;++d){let y,x,v=c[d];if(v!=null)if(F(v.sel)){f(v),y=s.remove.length+1,x=o(v.elm,y);for(let w=0;w<s.remove.length;++w)s.remove[w](v,x);let E=(_=(b=v?.data)===null||b===void 0?void 0:b.hook)===null||_===void 0?void 0:_.remove;F(E)?E(v,x):x()}else v.children?(f(v),g(p,v.children,0,v.children.length-1)):i.removeChild(p,v.elm)}}function k(p,c,d,u){let b=0,_=0,y=c.length-1,x=c[0],v=c[y],E=d.length-1,w=d[0],$=d[E],O,S,m,I;for(;b<=y&&_<=E;)x==null?x=c[++b]:v==null?v=c[--y]:w==null?w=d[++_]:$==null?$=d[--E]:ye(x,w)?(L(x,w,u),x=c[++b],w=d[++_]):ye(v,$)?(L(v,$,u),v=c[--y],$=d[--E]):ye(x,$)?(L(x,$,u),i.insertBefore(p,x.elm,i.nextSibling(v.elm)),x=c[++b],$=d[--E]):ye(v,w)?(L(v,w,u),i.insertBefore(p,v.elm,x.elm),v=c[--y],w=d[++_]):(O===void 0&&(O=Zi(c,b,y)),S=O[w.key],Ie(S)?(i.insertBefore(p,l(w,u),x.elm),w=d[++_]):Ie(O[$.key])?(i.insertBefore(p,l($,u),i.nextSibling(v.elm)),$=d[--E]):(m=c[S],m.sel!==w.sel?i.insertBefore(p,l(w,u),x.elm):(L(m,w,u),c[S]=void 0,i.insertBefore(p,m.elm,x.elm)),w=d[++_]));_<=E&&(I=d[E+1]==null?null:d[E+1].elm,h(p,I,d,_,E,u)),b<=y&&g(p,c,b,y)}function L(p,c,d){var u,b,_,y,x,v,E,w;let $=(u=c.data)===null||u===void 0?void 0:u.hook;(b=$?.prepatch)===null||b===void 0||b.call($,p,c);let O=c.elm=p.elm;if(p===c)return;if(c.data!==void 0||F(c.text)&&c.text!==p.text){(_=c.data)!==null&&_!==void 0||(c.data={}),(y=p.data)!==null&&y!==void 0||(p.data={});for(let I=0;I<s.update.length;++I)s.update[I](p,c);(E=(v=(x=c.data)===null||x===void 0?void 0:x.hook)===null||v===void 0?void 0:v.update)===null||E===void 0||E.call(v,p,c)}let S=p.children,m=c.children;Ie(c.text)?F(S)&&F(m)?S!==m&&k(O,S,m,d):F(m)?(F(p.text)&&i.setTextContent(O,""),h(O,null,m,0,m.length-1,d)):F(S)?g(O,S,0,S.length-1):F(p.text)&&i.setTextContent(O,""):p.text!==c.text&&(F(S)&&g(O,S,0,S.length-1),i.setTextContent(O,c.text)),(w=$?.postpatch)===null||w===void 0||w.call($,p,c)}return function(c,d){let u,b,_,y=[];for(u=0;u<s.pre.length;++u)s.pre[u]();for(Xi(i,c)?c=n(c):Qi(i,c)&&(c=a(c)),ye(c,d)?L(c,d,y):(b=c.elm,_=i.parentNode(b),l(d,y),_!==null&&(i.insertBefore(_,d.elm,i.nextSibling(b)),g(_,[c],0,0))),u=0;u<y.length;++u)y[u].data.hook.insert(y[u]);for(u=0;u<s.post.length;++u)s.post[u]();return d}}function wr(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 xr={create:wr,update:wr};function _r(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 Sr={create:_r,update:_r};var tn="http://www.w3.org/1999/xlink",rn="http://www.w3.org/2000/xmlns/",sn="http://www.w3.org/XML/1998/namespace";function Er(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(sn,r,a):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(rn,r,a):s.setAttributeNS(tn,r,a):s.setAttribute(r,a))}for(r in i)r in n||s.removeAttribute(r)}}var kr={create:Er,update:Er};var Ar=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,nn=function(e){Ar(function(){Ar(e)})},vt=!1;function an(e,t,r){nn(function(){e[t]=r})}function $r(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])&&an(i.style,l,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function on(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 ln(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 f=getComputedStyle(i)["transition-property"].split(", ");for(;n<f.length;++n)l.indexOf(f[n])!==-1&&o++;i.addEventListener("transitionend",function(g){g.target===i&&--o,o===0&&t()})}function pn(){vt=!1}var Cr={pre:pn,create:$r,update:$r,destroy:on,remove:ln};function Or(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++)Or(e[s],t,r)}function cn(e,t){let r=e.type,s=t.data.on;s&&s[r]&&Or(s[r],t,e)}function hn(){return function e(t){cn(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||hn();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 Ir={create:wt,update:wt,destroy:wt};var dn=()=>vr([xr,Sr,kr,Cr,Ir]),xt=dn;function Tr(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&&Tr(n,i.children,i.sel)}}function _t(e,t,r){let s={},i,n,a;if(r!==void 0?(t!==null&&(s=t),ce(r)?i=r:he(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(ce(t)?i=t:he(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(a=0;a<i.length;++a)he(i[a])&&(i[a]=re(void 0,void 0,void 0,i[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Tr(s,i,e),re(e,s,i,n,void 0)}var un={},Lr={components:un},Nr=xt();var Te={components:{dropdownMenu:{handlers:Be,store:He,view:Wt},form:{handlers:Ke,store:Ue,view:Ft},navbar:{handlers:qe,store:Ge,view:Bt},pageOutline:{handlers:Je,store:Ye,view:Kt},select:{handlers:Xe,store:Qe,view:Ut},sidebar:{handlers:Ze,store:tt,view:qt},sliderInput:{handlers:rt,store:st,view:Gt},table:{handlers:it,store:nt,view:Jt}}};Object.keys(Te).forEach(e=>{Object.keys(Te[e]).forEach(t=>{let r=gt({...Te[e][t],patch:Nr,h:_t},Lr[e]);customElements.define(Te[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",Pt({}));customElements.define("rtgl-input",jt({}));customElements.define("rtgl-textarea",Vt({}));customElements.define("rtgl-color-picker",Dt({}));customElements.define("rtgl-slider",Mt({}));customElements.define("rtgl-dialog",Rt({}));customElements.define("rtgl-popover",zt({}));})();
943
+ `);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)};if(Object.keys(this.handlers||{}).forEach(i=>{this.transformedHandlers[i]=n=>this.handlers[i](n,s)}),this.handlers?.handleBeforeMount&&(this._unmountCallback=this.handlers?.handleBeforeMount(s),this._unmountCallback&&typeof this._unmountCallback.then=="function"))throw new Error("handleBeforeMount must be synchronous and cannot return a Promise.");this.render(),this.handlers?.handleAfterMount&&this.handlers?.handleAfterMount(s),this.handlers?.subscriptions&&(this.unsubscribeAll=Li(this.handlers.subscriptions(s)))}disconnectedCallback(){this._unmountCallback&&this._unmountCallback(),this.unsubscribeAll&&this.unsubscribeAll()}attributeChangedCallback(t,r,s){if(r!==s&&this.render)if(this.handlers?.handleOnUpdate){let i={[t]:{oldValue:r,newValue:s}},n={...this.deps,refIds:this.refIds,getRefIds:()=>this.refIds,dispatchEvent:this.dispatchEvent.bind(this),store:this.store,render:this.render.bind(this)};this.handlers.handleOnUpdate(i,n)}else 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=br({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)}}},ji=(e,t,r)=>{let{INITIAL_STATE:s,toViewData:i,...n}=e,a={},o={},l=structuredClone(s);return Object.entries(n).forEach(([h,f])=>{h.startsWith("select")?a[h]=(...g)=>f({state:l,props:t,attrs:r},...g):o[h]=g=>(l=cr(l,k=>f(k,g)),l)}),{toViewData:()=>i({state:l,props:t,attrs:r}),getState:()=>l,...o,...a}},Vi=({handlers:e,view:t,store:r,patch:s,h:i},n)=>{let{elementName:a,propsSchema:o,attrsSchema:l,template:h,refs:f,styles:g}=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 k extends vt{static get observedAttributes(){let p=["key"],c=l?.properties?Object.keys(l.properties):[];return[...p,...c]}constructor(){super();let p=Ni(this);this.propsSchema=o,this.props=o?Pi(this,Object.keys(o.properties)):{},this.elementName=a,this.styles=g,this.store=ji(r,this.props,p),this.template=h,this.handlers=e,this.refs=f,this.patch=s,this.deps={...n,store:this.store,render:this.render,handlers:e,attrs:p,props:this.props},this.h=i,this.cssText=Ti(a,g)}}return k},wt=Vi;function re(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 pe=Array.isArray;function ce(e){return typeof e=="string"||typeof e=="number"||e instanceof String||e instanceof Number}function Di(e,t){return document.createElement(e,t)}function Mi(e,t,r){return document.createElementNS(e,t,r)}function Ri(){return se(document.createDocumentFragment())}function zi(e){return document.createTextNode(e)}function Wi(e){return document.createComment(e)}function Fi(e,t,r){if(Q(e)){let s=e;for(;s&&Q(s);)s=se(s).parent;e=s??e}Q(t)&&(t=se(t,e)),r&&Q(r)&&(r=se(r).firstChildNode),e.insertBefore(t,r)}function Bi(e,t){e.removeChild(t)}function Ki(e,t){Q(t)&&(t=se(t,e)),e.appendChild(t)}function wr(e){if(Q(e)){for(;e&&Q(e);)e=se(e).parent;return e??null}return e.parentNode}function Hi(e){var t;if(Q(e)){let r=se(e),s=wr(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 Ui(e){return e.tagName}function qi(e,t){e.textContent=t}function Gi(e){return e.textContent}function Ji(e){return e.nodeType===1}function Yi(e){return e.nodeType===3}function Xi(e){return e.nodeType===8}function Q(e){return e.nodeType===11}function se(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 xr={createElement:Di,createElementNS:Mi,createTextNode:zi,createDocumentFragment:Ri,createComment:Wi,insertBefore:Fi,removeChild:Bi,appendChild:Ki,parentNode:wr,nextSibling:Hi,tagName:Ui,setTextContent:qi,getTextContent:Gi,isElement:Ji,isText:Yi,isComment:Xi,isDocumentFragment:Q};function Te(e){return e===void 0}function W(e){return e!==void 0}var xt=re("",{},[],void 0,void 0);function ye(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 Qi(){throw new Error("The document fragment is not supported on this platform.")}function Zi(e,t){return e.isElement(t)}function en(e,t){return e.isDocumentFragment(t)}function tn(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 rn=["create","update","remove","destroy","pre","post"];function _r(e,t,r){let s={create:[],update:[],remove:[],destroy:[],pre:[],post:[]},i=t!==void 0?t:xr;for(let p of rn)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"),u=d?"."+d.split(" ").join("."):"";return re(i.tagName(p).toLowerCase()+c+u,{},[],void 0,p)}function a(p){return re(void 0,{},[],void 0,p)}function o(p,c){return function(){if(--c===0){let u=i.parentNode(p);u!==null&&i.removeChild(u,p)}}}function l(p,c){var d,u,b,_;let y,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 v=p.children,E=p.sel;if(E==="!")Te(p.text)&&(p.text=""),p.elm=i.createComment(p.text);else if(E==="")p.elm=i.createTextNode(p.text);else if(E!==void 0){let w=E.indexOf("#"),$=E.indexOf(".",w),O=w>0?w:E.length,S=$>0?$:E.length,m=w!==-1||$!==-1?E.slice(0,Math.min(O,S)):E,I=p.elm=W(x)&&W(y=x.ns)?i.createElementNS(y,m,x):i.createElement(m,x);for(O<S&&I.setAttribute("id",E.slice(O+1,S)),$>0&&I.setAttribute("class",E.slice(S+1).replace(/\./g," ")),y=0;y<s.create.length;++y)s.create[y](xt,p);if(ce(p.text)&&(!pe(v)||v.length===0)&&i.appendChild(I,i.createTextNode(p.text)),pe(v))for(y=0;y<v.length;++y){let D=v[y];D!=null&&i.appendChild(I,l(D,c))}let N=p.data.hook;W(N)&&((u=N.create)===null||u===void 0||u.call(N,xt,p),N.insert&&c.push(p))}else if(!((b=r?.experimental)===null||b===void 0)&&b.fragments&&p.children){for(p.elm=((_=i.createDocumentFragment)!==null&&_!==void 0?_:Qi)(),y=0;y<s.create.length;++y)s.create[y](xt,p);for(y=0;y<p.children.length;++y){let w=p.children[y];w!=null&&i.appendChild(p.elm,l(w,c))}}else p.elm=i.createTextNode(p.text);return p.elm}function h(p,c,d,u,b,_){for(;u<=b;++u){let y=d[u];y!=null&&i.insertBefore(p,l(y,_),c)}}function f(p){var c,d;let u=p.data;if(u!==void 0){(d=(c=u?.hook)===null||c===void 0?void 0:c.destroy)===null||d===void 0||d.call(c,p);for(let b=0;b<s.destroy.length;++b)s.destroy[b](p);if(p.children!==void 0)for(let b=0;b<p.children.length;++b){let _=p.children[b];_!=null&&typeof _!="string"&&f(_)}}}function g(p,c,d,u){for(var b,_;d<=u;++d){let y,x,v=c[d];if(v!=null)if(W(v.sel)){f(v),y=s.remove.length+1,x=o(v.elm,y);for(let w=0;w<s.remove.length;++w)s.remove[w](v,x);let E=(_=(b=v?.data)===null||b===void 0?void 0:b.hook)===null||_===void 0?void 0:_.remove;W(E)?E(v,x):x()}else v.children?(f(v),g(p,v.children,0,v.children.length-1)):i.removeChild(p,v.elm)}}function k(p,c,d,u){let b=0,_=0,y=c.length-1,x=c[0],v=c[y],E=d.length-1,w=d[0],$=d[E],O,S,m,I;for(;b<=y&&_<=E;)x==null?x=c[++b]:v==null?v=c[--y]:w==null?w=d[++_]:$==null?$=d[--E]:ye(x,w)?(L(x,w,u),x=c[++b],w=d[++_]):ye(v,$)?(L(v,$,u),v=c[--y],$=d[--E]):ye(x,$)?(L(x,$,u),i.insertBefore(p,x.elm,i.nextSibling(v.elm)),x=c[++b],$=d[--E]):ye(v,w)?(L(v,w,u),i.insertBefore(p,v.elm,x.elm),v=c[--y],w=d[++_]):(O===void 0&&(O=tn(c,b,y)),S=O[w.key],Te(S)?(i.insertBefore(p,l(w,u),x.elm),w=d[++_]):Te(O[$.key])?(i.insertBefore(p,l($,u),i.nextSibling(v.elm)),$=d[--E]):(m=c[S],m.sel!==w.sel?i.insertBefore(p,l(w,u),x.elm):(L(m,w,u),c[S]=void 0,i.insertBefore(p,m.elm,x.elm)),w=d[++_]));_<=E&&(I=d[E+1]==null?null:d[E+1].elm,h(p,I,d,_,E,u)),b<=y&&g(p,c,b,y)}function L(p,c,d){var u,b,_,y,x,v,E,w;let $=(u=c.data)===null||u===void 0?void 0:u.hook;(b=$?.prepatch)===null||b===void 0||b.call($,p,c);let O=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={}),(y=p.data)!==null&&y!==void 0||(p.data={});for(let I=0;I<s.update.length;++I)s.update[I](p,c);(E=(v=(x=c.data)===null||x===void 0?void 0:x.hook)===null||v===void 0?void 0:v.update)===null||E===void 0||E.call(v,p,c)}let S=p.children,m=c.children;Te(c.text)?W(S)&&W(m)?S!==m&&k(O,S,m,d):W(m)?(W(p.text)&&i.setTextContent(O,""),h(O,null,m,0,m.length-1,d)):W(S)?g(O,S,0,S.length-1):W(p.text)&&i.setTextContent(O,""):p.text!==c.text&&(W(S)&&g(O,S,0,S.length-1),i.setTextContent(O,c.text)),(w=$?.postpatch)===null||w===void 0||w.call($,p,c)}return function(c,d){let u,b,_,y=[];for(u=0;u<s.pre.length;++u)s.pre[u]();for(Zi(i,c)?c=n(c):en(i,c)&&(c=a(c)),ye(c,d)?L(c,d,y):(b=c.elm,_=i.parentNode(b),l(d,y),_!==null&&(i.insertBefore(_,d.elm,i.nextSibling(b)),g(_,[c],0,0))),u=0;u<y.length;++u)y[u].data.hook.insert(y[u]);for(u=0;u<s.post.length;++u)s.post[u]();return d}}function Sr(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 Er={create:Sr,update:Sr};function kr(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 Ar={create:kr,update:kr};var sn="http://www.w3.org/1999/xlink",nn="http://www.w3.org/2000/xmlns/",an="http://www.w3.org/XML/1998/namespace";function $r(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(an,r,a):r.charCodeAt(5)===58?r.charCodeAt(1)===109?s.setAttributeNS(nn,r,a):s.setAttributeNS(sn,r,a):s.setAttribute(r,a))}for(r in i)r in n||s.removeAttribute(r)}}var Cr={create:$r,update:$r};var Or=typeof window?.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):setTimeout,on=function(e){Or(function(){Or(e)})},_t=!1;function ln(e,t,r){on(function(){e[t]=r})}function Ir(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])&&ln(i.style,l,r);else s!=="remove"&&r!==n[s]&&(s[0]==="-"&&s[1]==="-"?i.style.setProperty(s,r):i.style[s]=r)}function pn(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 cn(e,t){let r=e.data.style;if(!r||!r.remove){t();return}_t||(e.elm.offsetLeft,_t=!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 f=getComputedStyle(i)["transition-property"].split(", ");for(;n<f.length;++n)l.indexOf(f[n])!==-1&&o++;i.addEventListener("transitionend",function(g){g.target===i&&--o,o===0&&t()})}function hn(){_t=!1}var Tr={pre:hn,create:Ir,update:Ir,destroy:pn,remove:cn};function Lr(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++)Lr(e[s],t,r)}function dn(e,t){let r=e.type,s=t.data.on;s&&s[r]&&Lr(s[r],t,e)}function un(){return function e(t){dn(t,e.vnode)}}function St(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||un();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 Nr={create:St,update:St,destroy:St};var fn=()=>_r([Er,Ar,Cr,Tr,Nr]),Et=fn;function Pr(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&&Pr(n,i.children,i.sel)}}function kt(e,t,r){let s={},i,n,a;if(r!==void 0?(t!==null&&(s=t),pe(r)?i=r:ce(r)?n=r.toString():r&&r.sel&&(i=[r])):t!=null&&(pe(t)?i=t:ce(t)?n=t.toString():t&&t.sel?i=[t]:s=t),i!==void 0)for(a=0;a<i.length;++a)ce(i[a])&&(i[a]=re(void 0,void 0,void 0,i[a],void 0));return e.startsWith("svg")&&(e.length===3||e[3]==="."||e[3]==="#")&&Pr(s,i,e),re(e,s,i,n,void 0)}var mn={},jr={components:mn},Vr=Et();var Le={components:{dropdownMenu:{handlers:Ue,store:qe,view:Kt},form:{handlers:Ge,store:Je,view:Ht},navbar:{handlers:Ye,store:Xe,view:Ut},pageOutline:{handlers:Qe,store:Ze,view:Gt},select:{handlers:et,store:tt,view:Jt},sidebar:{handlers:rt,store:it,view:Yt},sliderInput:{handlers:nt,store:at,view:Xt},table:{handlers:ot,store:lt,view:Qt}}};Object.keys(Le).forEach(e=>{Object.keys(Le[e]).forEach(t=>{let r=wt({...Le[e][t],patch:Vr,h:kt},jr[e]);customElements.define(Le[e][t].view.elementName,r)})});customElements.define("rtgl-button",Ot({}));customElements.define("rtgl-view",Lt({}));customElements.define("rtgl-text",Pt({}));customElements.define("rtgl-image",jt({}));customElements.define("rtgl-svg",Dt({}));customElements.define("rtgl-input",Mt({}));customElements.define("rtgl-textarea",Rt({}));customElements.define("rtgl-color-picker",zt({}));customElements.define("rtgl-slider",Wt({}));customElements.define("rtgl-dialog",Ft({}));customElements.define("rtgl-popover",Bt({}));})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rettangoli/ui",
3
- "version": "0.1.2-rc10",
3
+ "version": "0.1.2-rc12",
4
4
  "description": "A UI component library for building web interfaces.",
5
5
  "main": "dist/rettangoli-esm.min.js",
6
6
  "type": "module",
@@ -43,7 +43,7 @@ events: {}
43
43
  template:
44
44
  - rtgl-button#select-button v=ol:
45
45
  - ${selectedLabel}
46
- - rtgl-popover#popover .isOpen=isOpen .position=position:
46
+ - rtgl-popover#popover ?open=${isOpen} x=${position.x} y=${position.y}:
47
47
  - rtgl-view wh=300 g=xs slot=content bgc=background br=md sv=true:
48
48
  - $for option, i in options:
49
49
  - rtgl-view#option-${i} w=f h-bgc=ac ph=lg pv=md cur=p br=md bgc=${option.bgc}:
@@ -97,25 +97,27 @@ class RettangoliDialogElement extends HTMLElement {
97
97
  // Handle click outside - emit custom event
98
98
  this._dialogElement.addEventListener('click', (e) => {
99
99
  if (e.target === this._dialogElement) {
100
- this.dispatchEvent(new CustomEvent('close', {
101
- detail: {}
100
+ this.dispatchEvent(new CustomEvent('close', {
101
+ detail: {}
102
102
  }));
103
103
  }
104
104
  });
105
105
 
106
106
  // Handle right-click on overlay to close dialog
107
107
  this._dialogElement.addEventListener('contextmenu', (e) => {
108
- e.preventDefault();
109
- this.dispatchEvent(new CustomEvent('close', {
110
- detail: {}
111
- }));
108
+ if (e.target === this._dialogElement) {
109
+ e.preventDefault();
110
+ this.dispatchEvent(new CustomEvent('close', {
111
+ detail: {}
112
+ }));
113
+ }
112
114
  });
113
115
 
114
116
  // Handle ESC key - prevent native close and emit custom event
115
117
  this._dialogElement.addEventListener('cancel', (e) => {
116
118
  e.preventDefault();
117
- this.dispatchEvent(new CustomEvent('close', {
118
- detail: {}
119
+ this.dispatchEvent(new CustomEvent('close', {
120
+ detail: {}
119
121
  }));
120
122
  });
121
123
  }