@rettangoli/ui 1.7.4 → 1.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rettangoli-iife-layout.min.js +42 -42
- package/dist/rettangoli-iife-ui.min.js +54 -54
- package/package.json +1 -1
- package/src/common/popover.js +74 -0
- package/src/components/dropdownMenu/dropdownMenu.handlers.js +12 -0
- package/src/components/form/form.view.yaml +1 -1
- package/src/components/select/select.handlers.js +11 -1
- package/src/components/tagSelect/tagSelect.handlers.js +1 -1
- package/src/components/tagSelect/tagSelect.schema.yaml +2 -0
- package/src/components/tagSelect/tagSelect.store.js +2 -1
- package/src/primitives/popover.js +117 -81
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var rettangoli=(()=>{var
|
|
1
|
+
var rettangoli=(()=>{var W=`
|
|
2
2
|
:host([href]) {
|
|
3
3
|
cursor: pointer;
|
|
4
4
|
position: relative;
|
|
@@ -12,27 +12,27 @@ var rettangoli=(()=>{var L=`
|
|
|
12
12
|
bottom: 0;
|
|
13
13
|
z-index: 1;
|
|
14
14
|
}
|
|
15
|
-
`,
|
|
16
|
-
${
|
|
15
|
+
`,O=({linkElement:i,href:t,newTab:e,rel:s})=>{i.href=t,e?i.target="_blank":i.removeAttribute("target"),s!=null?i.rel=s:e?i.rel="noopener noreferrer":i.removeAttribute("rel")},L=({shadowRoot:i,slotElement:t,linkElement:e,href:s,newTab:n,rel:r})=>{if(t.parentNode!==i&&i.appendChild(t),!s)return e&&e.parentNode===i&&i.removeChild(e),null;let o=e||document.createElement("a");return O({linkElement:o,href:s,newTab:n,rel:r}),o.parentNode!==i&&i.appendChild(o),o},Q=({shadowRoot:i,childElement:t,linkElement:e,href:s,newTab:n,rel:r})=>{if(!s)return e?(t.parentNode===e&&i.appendChild(t),e.parentNode===i&&i.removeChild(e),null):(t.parentNode!==i&&i.appendChild(t),null);let o=e||document.createElement("a");return O({linkElement:o,href:s,newTab:n,rel:r}),t.parentNode!==o&&o.appendChild(t),o.parentNode!==i&&i.appendChild(o),o};var S=["default","sm","md","lg","xl"],f=()=>S.reduce((i,t)=>(i[t]={},i),{}),Ct=["sm","md","lg","xl"],de=({size:i,attr:t})=>i==="default"?t:`${i}-${t}`,ce=({size:i,includeDefault:t=!0})=>{if(i==="default")return["default"];let e=Ct.indexOf(i);if(e===-1)return t?["default"]:[];let s=Ct.slice(e);return t&&s.push("default"),s},J=({element:i,size:t,attr:e,includeDefault:s=!0})=>{let n=ce({size:t,includeDefault:s});for(let r of n){let o=de({size:r,attr:e}),l=i.getAttribute(o);if(l!==null)return l}return null};var ue=/^([1-9]|1[0-2])fg$/,pe=/^([1-9]\d*)\/([1-9]\d*)fb$/,Z=i=>typeof i=="string"&&ue.test(i),j=i=>{if(typeof i!="string")return null;let t=i.match(pe);if(!t)return null;let e=Number(t[1]),s=Number(t[2]);return!Number.isInteger(e)||!Number.isInteger(s)||s<=0||e>s?null:{numerator:e,denominator:s}};function kt({numerator:i,denominator:t,gapVar:e}){return i===t?"100%":i===1?`calc((100% - ((${t} - 1) * ${e})) / ${t})`:`calc(((100% - ((${t} - 1) * ${e})) * ${i}) / ${t})`}var b=({styleBucket:i,axis:t,dimension:e,fillValue:s,allowFlexGrow:n=!1,flexMinDimension:r="0",lockBounds:o=!0})=>{let l=()=>{!n||t!=="width"||(i["flex-grow"]="0",i["flex-shrink"]="1",i["flex-basis"]="auto")},a=()=>{i[`min-${t}`]="unset",i[`max-${t}`]="unset"};if(e===void 0)return;if(e==="f"){l(),i[t]=s,a();return}if(n&&Z(e)){i["flex-grow"]=e.slice(0,-2),i["flex-basis"]="0%",i[`min-${t}`]=r,i[`max-${t}`]="unset";return}let h=n?j(e):null;if(h){i["flex-grow"]="0",i["flex-shrink"]="0",i["flex-basis"]=kt({...h,gapVar:"var(--rtgl-flex-gap, 0px)"}),i[`min-${t}`]=r,i[`max-${t}`]="unset";return}l(),i[t]=e,o&&(i[`min-${t}`]=e,i[`max-${t}`]=e)},B=({style:i,width:t,fillValue:e="var(--width-stretch)",allowFlexGrow:s=!0,flexMinWidth:n="0"})=>{if(t==="f"){i.width=e,i.flexGrow="",i.flexBasis="",i.minWidth="";return}if(s&&Z(t)){i.width="",i.flexGrow=t.slice(0,-2),i.flexShrink="",i.flexBasis="0%",i.minWidth=n;return}let r=s?j(t):null;if(r){i.width="",i.flexGrow="0",i.flexShrink="0",i.flexBasis=kt({...r,gapVar:"var(--rtgl-flex-gap, 0px)"}),i.minWidth=n;return}if(t!=null){i.width=t,i.flexGrow="",i.flexShrink="",i.flexBasis="",i.minWidth="";return}i.width="",i.flexGrow="",i.flexShrink="",i.flexBasis="",i.minWidth=""};var me=i=>`${i}`.trim().replace(/\s*\/\s*/g,"/"),R=i=>{if(i==null)return;let t=me(i);if(t.length!==0)return typeof CSS<"u"&&typeof CSS.supports=="function"?CSS.supports("aspect-ratio",t)?t:void 0:t};function c(i,...t){let e="";return i.forEach((s,n)=>{e+=s+(t[n]||"")}),e}var ge=["sm","md","lg","xl"],It={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap --rtgl-flex-gap",gv:"row-gap --rtgl-flex-gap",gh:"column-gap --rtgl-flex-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",cur:"cursor"},C=Object.keys(It),y=i=>i.concat(ge.flatMap(t=>i.map(e=>`${t}-${e}`))),U={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)"},v=(i,t={},e=null)=>{let s="";for(let[n,r]of Object.entries(U)){n!=="default"&&(s+=`${r} {`);for(let[o,l]of Object.entries(i))for(let[a,h]of Object.entries(l)){let d=It[o],_=h.startsWith("--")?`var(${h})`:h,x=n==="default"?o:`${n}-${o}`,k=n==="default"?`h-${o}`:`${n}-h-${o}`,z=(A,E=!1)=>{let I=E?`:host([${A}="${a}"]:hover)`:`:host([${A}="${a}"])`;if(e)return e.split(",").map(Y=>`${I} ${Y.trim()}`).join(", ");let D=t[o];return D?`${I} ${D}`:I};if(d){let E=d.split(" ").map(I=>`${I}: ${_};`).join(" ");s+=`
|
|
16
|
+
${z(x)}{
|
|
17
17
|
${E}
|
|
18
18
|
}
|
|
19
|
-
${
|
|
19
|
+
${z(k,!0)}{
|
|
20
20
|
${E}
|
|
21
21
|
}
|
|
22
22
|
`}else s+=`
|
|
23
|
-
${
|
|
23
|
+
${z(x)}{
|
|
24
24
|
${h}
|
|
25
25
|
}
|
|
26
|
-
${
|
|
26
|
+
${z(k,!0)}{
|
|
27
27
|
${h}
|
|
28
28
|
}
|
|
29
|
-
`}n!=="default"&&(s+="}")}return s};function
|
|
29
|
+
`}n!=="default"&&(s+="}")}return s};function fe(i){if(i===null||i.includes("/"))return!1;let t=String(i);return/[0-9]$/.test(t)}var be=i=>/%$/.test(i),ve=i=>/^([1-9]|1[0-2])fg$/.test(i),u=i=>{if(i!=null)return ve(i)||be(i)?i:fe(i)?`${i}px`:Object.keys(p).includes(i)?`var(${p[i]})`:i},p={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function w(i,t=":host"){let e="",s=["default","xl","lg","md","sm"];for(let n of s){let r=U[n];if(!i[n]||Object.keys(i[n]).length===0)continue;n!=="default"&&(e+=`${r} {
|
|
30
30
|
`);let o="";for(let[l,a]of Object.entries(i[n]))a!=null&&(o+=`${l}: ${a} !important;
|
|
31
31
|
`);e+=`${t} {
|
|
32
32
|
${o.trim()}
|
|
33
33
|
}
|
|
34
34
|
`,n!=="default"&&(e+=`}
|
|
35
|
-
`)}return e}var
|
|
35
|
+
`)}return e}var _e={mt:p,mr:p,mb:p,ml:p,m:p,mh:p,mv:p,s:{sm:`
|
|
36
36
|
height: 28px;
|
|
37
37
|
padding-left: 12px;
|
|
38
38
|
padding-right: 12px;
|
|
@@ -81,7 +81,7 @@ var rettangoli=(()=>{var L=`
|
|
|
81
81
|
`,lk:`
|
|
82
82
|
background-color: transparent;
|
|
83
83
|
color: var(--foreground);
|
|
84
|
-
`}}
|
|
84
|
+
`}},zt=v(_e,{},".surface");var ye=[{prefix:"sm",maxWidth:640},{prefix:"md",maxWidth:768},{prefix:"lg",maxWidth:1024},{prefix:"xl",maxWidth:1280}],tt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
85
85
|
:host {
|
|
86
86
|
display: inline-flex;
|
|
87
87
|
}
|
|
@@ -252,8 +252,8 @@ var rettangoli=(()=>{var L=`
|
|
|
252
252
|
color: inherit;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
${
|
|
256
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._containerElement=null,this._surfaceElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._prefixIcon=null,this._suffixIcon=null,this._surfaceElement.className="surface",this._surfaceElement.appendChild(this._slotElement),this._onWindowResize=this._onWindowResize.bind(this)}static get observedAttributes(){return["key","href","new-tab","rel","w","pre","suf","disabled","v","s","sq","sm-s","md-s","lg-s","xl-s"]}connectedCallback(){window.addEventListener("resize",this._onWindowResize),this._updateButton()}disconnectedCallback(){window.removeEventListener("resize",this._onWindowResize)}attributeChangedCallback(t,e,s){this._updateButton()}_onWindowResize(){(this.hasAttribute("sm-s")||this.hasAttribute("md-s")||this.hasAttribute("lg-s")||this.hasAttribute("xl-s"))&&this._updateIcon()}_resolveResponsiveSizeToken(){let t=window.innerWidth;for(let{prefix:e,maxWidth:s}of
|
|
255
|
+
${zt}
|
|
256
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._containerElement=null,this._surfaceElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._prefixIcon=null,this._suffixIcon=null,this._surfaceElement.className="surface",this._surfaceElement.appendChild(this._slotElement),this._onWindowResize=this._onWindowResize.bind(this)}static get observedAttributes(){return["key","href","new-tab","rel","w","pre","suf","disabled","v","s","sq","sm-s","md-s","lg-s","xl-s"]}connectedCallback(){window.addEventListener("resize",this._onWindowResize),this._updateButton()}disconnectedCallback(){window.removeEventListener("resize",this._onWindowResize)}attributeChangedCallback(t,e,s){this._updateButton()}_onWindowResize(){(this.hasAttribute("sm-s")||this.hasAttribute("md-s")||this.hasAttribute("lg-s")||this.hasAttribute("xl-s"))&&this._updateIcon()}_resolveResponsiveSizeToken(){let t=window.innerWidth;for(let{prefix:e,maxWidth:s}of ye){let n=`${e}-s`;if(t<=s&&this.hasAttribute(n))return this.getAttribute(n)}return this.getAttribute("s")}_updateButton(){this.shadow.innerHTML="";let t=this.hasAttribute("disabled"),e=this.getAttribute("href"),s=this.hasAttribute("new-tab"),n=this.getAttribute("rel"),r=e&&!t,o=r?"a":"button";if(this._surfaceElement.tagName.toLowerCase()!==o){let l=document.createElement(o);l.className="surface",l.appendChild(this._slotElement),this._surfaceElement=l}this._updateIcon(),this.hasAttribute("sq")?(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):this._updateWidth(),r?(O({linkElement:this._surfaceElement,href:e,newTab:s,rel:n}),this._surfaceElement.removeAttribute("disabled")):(this._surfaceElement.removeAttribute("href"),this._surfaceElement.removeAttribute("target"),this._surfaceElement.removeAttribute("rel"),t?this._surfaceElement.setAttribute("disabled",""):this._surfaceElement.removeAttribute("disabled")),this.shadow.appendChild(this._surfaceElement),this._containerElement=this._surfaceElement}_updateIcon(){this._prefixIcon&&(this._prefixIcon.remove(),this._prefixIcon=null),this._suffixIcon&&(this._suffixIcon.remove(),this._suffixIcon=null);let t={sm:14,md:18,lg:22},e=this._resolveResponsiveSizeToken(),s=18;this.hasAttribute("sq")?s={sm:14,lg:22}[e]||18:s=t[e]||18;let n=this.getAttribute("pre");n&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",n),this._prefixIcon.setAttribute("wh",s.toString()),this._prefixIcon.style.color="inherit",this._surfaceElement.insertBefore(this._prefixIcon,this._slotElement));let r=this.getAttribute("suf");r&&(this._suffixIcon=document.createElement("rtgl-svg"),this._suffixIcon.setAttribute("svg",r),this._suffixIcon.setAttribute("wh",s.toString()),this._suffixIcon.style.color="inherit",this._surfaceElement.appendChild(this._suffixIcon))}_updateWidth(){let t=u(this.getAttribute("w"));t==="f"?(this.style.width="var(--width-stretch)",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):t!=null?(this.style.width=t,this.style.minWidth=t,this.style.maxWidth=t,this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth="")}getBoundingClientRect(){return this._surfaceElement?this._surfaceElement.getBoundingClientRect():super.getBoundingClientRect()}},$t=({render:i,html:t})=>tt;var we=({numerator:i,denominator:t,gapVar:e})=>i===t?"100%":i===1?`calc((100% - ((${t} - 1) * ${e})) / ${t})`:`calc(((100% - ((${t} - 1) * ${e})) * ${i}) / ${t})`,H=({index:i,maxIndex:t})=>!Number.isFinite(i)||!Number.isFinite(t)||t<0?0:Math.min(Math.max(Math.trunc(i),0),t),et=({value:i,defaultValue:t=!1})=>{if(i==null)return t;let e=`${i}`.trim().toLowerCase();return e.length===0?!0:!(e==="false"||e==="0"||e==="no"||e==="off"||e==="none")},it=i=>{if(i==null)return"x mandatory";let t=`${i}`.trim().toLowerCase();return t===""||t==="true"||t==="1"||t==="yes"?"x mandatory":t==="false"||t==="0"||t==="no"||t==="off"||t==="none"?"none":"x mandatory"},Wt=({slideLeft:i,slideWidth:t,viewportWidth:e,scrollPaddingInlineStart:s=0,scrollPaddingInlineEnd:n=0,snapAlign:r="center",maxScrollLeft:o=Number.POSITIVE_INFINITY})=>{if(!Number.isFinite(i)||!Number.isFinite(t)||!Number.isFinite(e))return 0;let l=s,a=e-n,h=Math.max(a-l,0),d;r==="start"?d=i-l:r==="end"?d=i+t-a:d=i+t/2-(l+h/2);let _=Number.isFinite(o)?Math.max(o,0):Number.POSITIVE_INFINITY;return Math.min(Math.max(d,0),_)},Lt=({slideWidthCss:i,snapAlign:t="center"})=>`${t??""}`.trim().toLowerCase()!=="center"?"0px":`max(calc((100% - (${i&&`${i}`.trim().length>0?`${i}`.trim():"100%"})) / 2), 0px)`,Tt=({slideWidth:i,gapVar:t="var(--rtgl-carousel-gap, 0px)"})=>{if(i==null||`${i}`.trim()===""||i==="f")return"100%";let e=j(`${i}`.trim());return e?we({...e,gapVar:t}):u(`${i}`.trim())??"100%"};var xe=["a","button","input","select","textarea","label","summary","[contenteditable]"].join(", "),st=i=>{if(i==null)return null;let t=`${i}`.trim();return t.length>0?t:null},Se=i=>i<.5?2*i*i:1-Math.pow(-2*i+2,2)/2,Ot=i=>{let t="http://www.w3.org/2000/svg",e=document.createElementNS(t,"svg");e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("aria-hidden","true"),e.setAttribute("focusable","false");let s=document.createElementNS(t,"path");return s.setAttribute("d",i==="left"?"M15 18 9 12l6-6":"M9 18l6-6-6-6"),s.setAttribute("fill","none"),s.setAttribute("stroke","currentColor"),s.setAttribute("stroke-width","2"),s.setAttribute("stroke-linecap","round"),s.setAttribute("stroke-linejoin","round"),e.appendChild(s),e},rt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
257
257
|
:host {
|
|
258
258
|
display: block;
|
|
259
259
|
width: 100%;
|
|
@@ -448,7 +448,7 @@ var rettangoli=(()=>{var L=`
|
|
|
448
448
|
border-color: var(--foreground);
|
|
449
449
|
transform: scale(1.2);
|
|
450
450
|
}
|
|
451
|
-
`))}static get observedAttributes(){return["index","sw","sna","g","spi","sbh","snap","nav","pager"]}constructor(){super(),i.initializeStyleSheet(),this._slides=[],this._pagerButtons=[],this._currentIndex=0,this._clickSuppressUntil=0,this._dragState=null,this._scrollFrame=null,this._resizeFrame=null,this._scrollAnimationFrame=null,this._isReflectingIndex=!1,this._slideStyleCache=new WeakMap,this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._rootElement=document.createElement("div"),this._rootElement.id="root",this._viewportShellElement=document.createElement("div"),this._viewportShellElement.id="viewport-shell",this._viewportShellElement.setAttribute("part","viewport-shell"),this._viewportElement=document.createElement("div"),this._viewportElement.id="viewport",this._viewportElement.tabIndex=0,this._viewportElement.setAttribute("part","viewport"),this._slotElement=document.createElement("slot"),this._viewportElement.appendChild(this._slotElement),this._controlsElement=document.createElement("div"),this._controlsElement.id="controls",this._controlsElement.setAttribute("part","controls"),this._controlsElement.hidden=!0,this._prevButton=document.createElement("button"),this._prevButton.id="prev-button",this._prevButton.type="button",this._prevButton.hidden=!0,this._prevButton.append(Bt("left")),this._prevButton.setAttribute("part","nav-button prev-button"),this._prevButton.setAttribute("aria-label","Previous slide"),this._pagerElement=document.createElement("div"),this._pagerElement.id="pager",this._pagerElement.setAttribute("part","pager"),this._pagerElement.hidden=!0,this._nextButton=document.createElement("button"),this._nextButton.id="next-button",this._nextButton.type="button",this._nextButton.hidden=!0,this._nextButton.append(Bt("right")),this._nextButton.setAttribute("part","nav-button next-button"),this._nextButton.setAttribute("aria-label","Next slide"),this._viewportShellElement.append(this._viewportElement,this._prevButton,this._nextButton),this._controlsElement.append(this._pagerElement),this._rootElement.append(this._viewportShellElement,this._controlsElement),this.shadow.append(this._rootElement),this._handleSlotChange=this._handleSlotChange.bind(this),this._handleClickPrev=this._handleClickPrev.bind(this),this._handleClickNext=this._handleClickNext.bind(this),this._handleViewportKeydown=this._handleViewportKeydown.bind(this),this._handleViewportScroll=this._handleViewportScroll.bind(this),this._handleViewportPointerDown=this._handleViewportPointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._handleViewportClickCapture=this._handleViewportClickCapture.bind(this),this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._resizeFrame!==null&&cancelAnimationFrame(this._resizeFrame),this._resizeFrame=requestAnimationFrame(()=>{this._resizeFrame=null,!(this._dragState?.dragging||!this._slides.length)&&this.goTo(this._currentIndex,{behavior:"auto"})})}):null}get index(){return this._currentIndex}set index(t){let e=Number(t);this.setAttribute("index",Number.isFinite(e)?`${e}`:"0")}get snap(){return it(this.getAttribute("snap"))!=="none"}set snap(t){if(t===!1||`${t}`.trim().toLowerCase()==="false"){this.setAttribute("snap","false");return}this.setAttribute("snap","true")}connectedCallback(){this._slotElement.addEventListener("slotchange",this._handleSlotChange),this._prevButton.addEventListener("click",this._handleClickPrev),this._nextButton.addEventListener("click",this._handleClickNext),this._viewportElement.addEventListener("keydown",this._handleViewportKeydown),this._viewportElement.addEventListener("scroll",this._handleViewportScroll,{passive:!0}),this._viewportElement.addEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.addEventListener("click",this._handleViewportClickCapture,!0),this._resizeObserver?.observe(this._viewportElement),this._syncSlides(),this._updateLayoutStyles();let t=this.hasAttribute("index")?Number(this.getAttribute("index")):0;this.goTo(t,{behavior:"auto"})}disconnectedCallback(){this._slotElement.removeEventListener("slotchange",this._handleSlotChange),this._prevButton.removeEventListener("click",this._handleClickPrev),this._nextButton.removeEventListener("click",this._handleClickNext),this._viewportElement.removeEventListener("keydown",this._handleViewportKeydown),this._viewportElement.removeEventListener("scroll",this._handleViewportScroll),this._viewportElement.removeEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.removeEventListener("click",this._handleViewportClickCapture,!0),this._removePointerListeners(),this._resizeObserver?.disconnect(),this._scrollFrame!==null&&(cancelAnimationFrame(this._scrollFrame),this._scrollFrame=null),this._resizeFrame!==null&&(cancelAnimationFrame(this._resizeFrame),this._resizeFrame=null),this._cancelScrollAnimation(),this._setDraggingState(!1),this._slides.forEach(t=>{this._restoreSlideStyles(t),t.removeAttribute("data-rtgl-carousel-active")})}attributeChangedCallback(t,e,s){if(e!==s){if(t==="index"){if(this._isReflectingIndex){this._isReflectingIndex=!1;return}this.goTo(Number(s),{behavior:"smooth"});return}if(t==="nav"||t==="pager"){this._updateControls();return}this._updateLayoutStyles()}}next(){this.goTo(this._currentIndex+1)}prev(){this.goTo(this._currentIndex-1)}_showsNavControls(){return et({value:this.getAttribute("nav"),defaultValue:!0})}_showsPagerControls(){return et({value:this.getAttribute("pager"),defaultValue:!1})}goTo(t,e={}){if(!this._slides.length){this._setCurrentIndex(0,{emit:!1,reflect:!0});return}let s=q({index:Number(t),maxIndex:this._slides.length-1}),n=this._slides[s],r=e.behavior??"smooth";n&&(this._scrollViewportTo(this._getSlideTargetScrollLeft(n),{behavior:r}),this._setCurrentIndex(s))}_handleSlotChange(){this._syncSlides(),this._updateLayoutStyles(),this.goTo(this._currentIndex,{behavior:"auto"})}_handleClickPrev(){this.prev()}_handleClickNext(){this.next()}_handleViewportKeydown(t){t.key==="ArrowRight"?(t.preventDefault(),this.next()):t.key==="ArrowLeft"&&(t.preventDefault(),this.prev())}_handleViewportScroll(){this._scrollAnimationFrame===null&&(this._dragState?.dragging||this._requestSyncFromScroll())}_handleViewportPointerDown(t){t.pointerType==="mouse"&&(t.button!==0||!this._slides.length||this._eventTargetsInteractiveElement(t)||(this._cancelScrollAnimation(),this._dragState={pointerId:t.pointerId,startX:t.clientX,startScrollLeft:this._viewportElement.scrollLeft,dragging:!1},this._viewportElement.setPointerCapture(t.pointerId),this._viewportElement.addEventListener("pointermove",this._handlePointerMove),this._viewportElement.addEventListener("pointerup",this._handlePointerUp),this._viewportElement.addEventListener("pointercancel",this._handlePointerUp)))}_handlePointerMove(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let e=t.clientX-this._dragState.startX;!this._dragState.dragging&&Math.abs(e)>6&&(this._dragState.dragging=!0,this._setDraggingState(!0)),this._dragState.dragging&&(t.preventDefault(),this._viewportElement.scrollLeft=this._dragState.startScrollLeft-e)}_handlePointerUp(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let e=this._dragState.dragging,s=e?this._findNearestSlideIndex():this._currentIndex;this._viewportElement.hasPointerCapture(t.pointerId)&&this._viewportElement.releasePointerCapture(t.pointerId),this._dragState=null,this._setDraggingState(!1),this._removePointerListeners(),e&&(this._clickSuppressUntil=performance.now()+250,this.snap?this.goTo(s,{behavior:"smooth"}):this._requestSyncFromScroll())}_handleViewportClickCapture(t){performance.now()<this._clickSuppressUntil&&(t.preventDefault(),t.stopPropagation())}_removePointerListeners(){this._viewportElement.removeEventListener("pointermove",this._handlePointerMove),this._viewportElement.removeEventListener("pointerup",this._handlePointerUp),this._viewportElement.removeEventListener("pointercancel",this._handlePointerUp)}_eventTargetsInteractiveElement(t){return t.composedPath().some(e=>e instanceof Element&&e.matches(we))}_requestSyncFromScroll(){this._scrollFrame!==null&&cancelAnimationFrame(this._scrollFrame),this._scrollFrame=requestAnimationFrame(()=>{this._scrollFrame=null;let t=this._findNearestSlideIndex();this._setCurrentIndex(t)})}_findNearestSlideIndex(){if(!this._slides.length)return 0;let t=this._viewportElement.scrollLeft,e=this._currentIndex,s=Number.POSITIVE_INFINITY;return this._slides.forEach((n,r)=>{let o=Math.abs(this._getSlideTargetScrollLeft(n)-t);o<s&&(e=r,s=o)}),e}_syncSlides(){let t=new Set(this._slides),e=this._slotElement.assignedElements({flatten:!0}).filter(s=>!s.hasAttribute("hidden"));t.forEach(s=>{e.includes(s)||(this._restoreSlideStyles(s),s.removeAttribute("data-rtgl-carousel-active"))}),this._slides=e,this._slides.forEach(s=>{this._slideStyleCache.has(s)||this._slideStyleCache.set(s,{flex:s.style.flex,width:s.style.width,minWidth:s.style.minWidth,maxWidth:s.style.maxWidth,boxSizing:s.style.boxSizing,scrollSnapAlign:s.style.scrollSnapAlign,scrollSnapStop:s.style.scrollSnapStop})}),this._buildPager(),this._setCurrentIndex(q({index:this._currentIndex,maxIndex:this._slides.length-1}),{emit:!1,reflect:!0})}_restoreSlideStyles(t){let e=this._slideStyleCache.get(t);e&&(t.style.flex=e.flex,t.style.width=e.width,t.style.minWidth=e.minWidth,t.style.maxWidth=e.maxWidth,t.style.boxSizing=e.boxSizing,t.style.scrollSnapAlign=e.scrollSnapAlign,t.style.scrollSnapStop=e.scrollSnapStop)}_updateLayoutStyles(){let t=Wt({slideWidth:this.getAttribute("sw")}),e=st(this.getAttribute("sna"))??"center",s=it(this.getAttribute("snap")),n=c(this.getAttribute("g"))??"var(--spacing-md)",r=c(this.getAttribute("spi"))??"0px",o=st(this.getAttribute("sbh"))??"smooth",l=Tt({slideWidthCss:t,snapAlign:e});this.style.setProperty("--rtgl-carousel-slide-width",t),this.style.setProperty("--rtgl-carousel-gap",n),this.style.setProperty("--rtgl-carousel-scroll-snap-type",s),this.style.setProperty("--rtgl-carousel-scroll-padding-inline",r),this.style.setProperty("--rtgl-carousel-edge-padding-inline",l),this.style.setProperty("--rtgl-carousel-scroll-behavior",o),this.style.setProperty("--rtgl-carousel-snap-align",e),this._slides.forEach(a=>{a.style.flex=`0 0 ${t}`,a.style.width=t,a.style.minWidth="0",a.style.maxWidth="unset",a.style.boxSizing="border-box",a.style.scrollSnapAlign=e,a.style.scrollSnapStop="always"})}_setDraggingState(t){if(t){this.setAttribute("dragging",""),this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this.removeAttribute("dragging"),this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior=""}_scrollViewportTo(t,e={}){let s=e.behavior??"smooth",n=Math.min(Math.max(t,0),Math.max(this._viewportElement.scrollWidth-this._viewportElement.clientWidth,0));if(s!=="smooth"||Math.abs(n-this._viewportElement.scrollLeft)<1){this._cancelScrollAnimation(),this._viewportElement.scrollLeft=n;return}this._cancelScrollAnimation();let r=this._viewportElement.scrollLeft,o=n-r,l=Math.min(720,Math.max(420,Math.abs(o)*.35)),a=performance.now();this._setAnimatingScrollState(!0);let h=p=>{let _=p-a,x=Math.min(_/l,1),C=xe(x);if(this._viewportElement.scrollLeft=r+o*C,x<1){this._scrollAnimationFrame=requestAnimationFrame(h);return}this._viewportElement.scrollLeft=n,this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1)};this._scrollAnimationFrame=requestAnimationFrame(h)}_cancelScrollAnimation(){this._scrollAnimationFrame!==null&&(cancelAnimationFrame(this._scrollAnimationFrame),this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1))}_buildPager(){this._pagerElement.replaceChildren(),this._pagerButtons=[],this._slides.forEach((t,e)=>{let s=document.createElement("button");s.type="button",s.setAttribute("part","pager-button"),s.setAttribute("aria-label",`Go to slide ${e+1}`),s.setAttribute("title",`Go to slide ${e+1}`),s.addEventListener("click",()=>{this.goTo(e)}),this._pagerElement.appendChild(s),this._pagerButtons.push(s)}),this._updateControls()}_updateControls(){let t=this._slides.length>0,e=this._slides.length>1,s=this._currentIndex<=0,n=this._currentIndex>=this._slides.length-1,r=e&&this._showsNavControls(),o=e&&this._showsPagerControls();this._prevButton.hidden=!r,this._nextButton.hidden=!r,this._pagerElement.hidden=!o,this._controlsElement.hidden=!o,this._prevButton.disabled=!t||s,this._nextButton.disabled=!t||n,this._pagerButtons.forEach((l,a)=>{let h=a===this._currentIndex;l.classList.toggle("is-active",h),l.disabled=h,l.setAttribute("part",h?"pager-button pager-button-active":"pager-button"),h?l.setAttribute("aria-current","true"):l.removeAttribute("aria-current")})}_setCurrentIndex(t,e={}){let s=q({index:t,maxIndex:this._slides.length-1}),n=e.emit??!0,r=e.reflect??!0,o=this._currentIndex;this._currentIndex=s,this._slides.forEach((l,a)=>{a===s?l.setAttribute("data-rtgl-carousel-active","true"):l.removeAttribute("data-rtgl-carousel-active")}),this._updateControls(),r&&this.getAttribute("index")!==`${s}`&&(this._isReflectingIndex=!0,this.setAttribute("index",`${s}`)),n&&o!==s&&this.dispatchEvent(new CustomEvent("index-change",{detail:{index:s},bubbles:!0}))}_resolveScrollInlinePosition(){let t=st(this.getAttribute("sna"))??"center";return t==="start"||t==="end"||t==="center"?t:"center"}_getSlideTargetScrollLeft(t){let e=this._viewportElement.getBoundingClientRect(),s=t.getBoundingClientRect();if(e.width<=0||s.width<=0)return this._viewportElement.scrollLeft;let n=getComputedStyle(this._viewportElement),r=this._viewportElement.scrollLeft,o=s.left-e.left+r;return Lt({slideLeft:o,slideWidth:s.width,viewportWidth:e.width,scrollPaddingInlineStart:this._parsePx(n.scrollPaddingInlineStart),scrollPaddingInlineEnd:this._parsePx(n.scrollPaddingInlineEnd),snapAlign:this._resolveScrollInlinePosition(),maxScrollLeft:this._viewportElement.scrollWidth-this._viewportElement.clientWidth})}_parsePx(t){let e=Number.parseFloat(t);return Number.isFinite(e)?e:0}_setAnimatingScrollState(t){if(t){this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this._dragState?.dragging||(this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior="")}},Mt=()=>rt;var Se={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out"}},m=v(Se);var H=d`
|
|
451
|
+
`))}static get observedAttributes(){return["index","sw","sna","g","spi","sbh","snap","nav","pager"]}constructor(){super(),i.initializeStyleSheet(),this._slides=[],this._pagerButtons=[],this._currentIndex=0,this._clickSuppressUntil=0,this._dragState=null,this._scrollFrame=null,this._resizeFrame=null,this._scrollAnimationFrame=null,this._isReflectingIndex=!1,this._slideStyleCache=new WeakMap,this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._rootElement=document.createElement("div"),this._rootElement.id="root",this._viewportShellElement=document.createElement("div"),this._viewportShellElement.id="viewport-shell",this._viewportShellElement.setAttribute("part","viewport-shell"),this._viewportElement=document.createElement("div"),this._viewportElement.id="viewport",this._viewportElement.tabIndex=0,this._viewportElement.setAttribute("part","viewport"),this._slotElement=document.createElement("slot"),this._viewportElement.appendChild(this._slotElement),this._controlsElement=document.createElement("div"),this._controlsElement.id="controls",this._controlsElement.setAttribute("part","controls"),this._controlsElement.hidden=!0,this._prevButton=document.createElement("button"),this._prevButton.id="prev-button",this._prevButton.type="button",this._prevButton.hidden=!0,this._prevButton.append(Ot("left")),this._prevButton.setAttribute("part","nav-button prev-button"),this._prevButton.setAttribute("aria-label","Previous slide"),this._pagerElement=document.createElement("div"),this._pagerElement.id="pager",this._pagerElement.setAttribute("part","pager"),this._pagerElement.hidden=!0,this._nextButton=document.createElement("button"),this._nextButton.id="next-button",this._nextButton.type="button",this._nextButton.hidden=!0,this._nextButton.append(Ot("right")),this._nextButton.setAttribute("part","nav-button next-button"),this._nextButton.setAttribute("aria-label","Next slide"),this._viewportShellElement.append(this._viewportElement,this._prevButton,this._nextButton),this._controlsElement.append(this._pagerElement),this._rootElement.append(this._viewportShellElement,this._controlsElement),this.shadow.append(this._rootElement),this._handleSlotChange=this._handleSlotChange.bind(this),this._handleClickPrev=this._handleClickPrev.bind(this),this._handleClickNext=this._handleClickNext.bind(this),this._handleViewportKeydown=this._handleViewportKeydown.bind(this),this._handleViewportScroll=this._handleViewportScroll.bind(this),this._handleViewportPointerDown=this._handleViewportPointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._handleViewportClickCapture=this._handleViewportClickCapture.bind(this),this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._resizeFrame!==null&&cancelAnimationFrame(this._resizeFrame),this._resizeFrame=requestAnimationFrame(()=>{this._resizeFrame=null,!(this._dragState?.dragging||!this._slides.length)&&this.goTo(this._currentIndex,{behavior:"auto"})})}):null}get index(){return this._currentIndex}set index(t){let e=Number(t);this.setAttribute("index",Number.isFinite(e)?`${e}`:"0")}get snap(){return it(this.getAttribute("snap"))!=="none"}set snap(t){if(t===!1||`${t}`.trim().toLowerCase()==="false"){this.setAttribute("snap","false");return}this.setAttribute("snap","true")}connectedCallback(){this._slotElement.addEventListener("slotchange",this._handleSlotChange),this._prevButton.addEventListener("click",this._handleClickPrev),this._nextButton.addEventListener("click",this._handleClickNext),this._viewportElement.addEventListener("keydown",this._handleViewportKeydown),this._viewportElement.addEventListener("scroll",this._handleViewportScroll,{passive:!0}),this._viewportElement.addEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.addEventListener("click",this._handleViewportClickCapture,!0),this._resizeObserver?.observe(this._viewportElement),this._syncSlides(),this._updateLayoutStyles();let t=this.hasAttribute("index")?Number(this.getAttribute("index")):0;this.goTo(t,{behavior:"auto"})}disconnectedCallback(){this._slotElement.removeEventListener("slotchange",this._handleSlotChange),this._prevButton.removeEventListener("click",this._handleClickPrev),this._nextButton.removeEventListener("click",this._handleClickNext),this._viewportElement.removeEventListener("keydown",this._handleViewportKeydown),this._viewportElement.removeEventListener("scroll",this._handleViewportScroll),this._viewportElement.removeEventListener("pointerdown",this._handleViewportPointerDown),this._viewportElement.removeEventListener("click",this._handleViewportClickCapture,!0),this._removePointerListeners(),this._resizeObserver?.disconnect(),this._scrollFrame!==null&&(cancelAnimationFrame(this._scrollFrame),this._scrollFrame=null),this._resizeFrame!==null&&(cancelAnimationFrame(this._resizeFrame),this._resizeFrame=null),this._cancelScrollAnimation(),this._setDraggingState(!1),this._slides.forEach(t=>{this._restoreSlideStyles(t),t.removeAttribute("data-rtgl-carousel-active")})}attributeChangedCallback(t,e,s){if(e!==s){if(t==="index"){if(this._isReflectingIndex){this._isReflectingIndex=!1;return}this.goTo(Number(s),{behavior:"smooth"});return}if(t==="nav"||t==="pager"){this._updateControls();return}this._updateLayoutStyles()}}next(){this.goTo(this._currentIndex+1)}prev(){this.goTo(this._currentIndex-1)}_showsNavControls(){return et({value:this.getAttribute("nav"),defaultValue:!0})}_showsPagerControls(){return et({value:this.getAttribute("pager"),defaultValue:!1})}goTo(t,e={}){if(!this._slides.length){this._setCurrentIndex(0,{emit:!1,reflect:!0});return}let s=H({index:Number(t),maxIndex:this._slides.length-1}),n=this._slides[s],r=e.behavior??"smooth";n&&(this._scrollViewportTo(this._getSlideTargetScrollLeft(n),{behavior:r}),this._setCurrentIndex(s))}_handleSlotChange(){this._syncSlides(),this._updateLayoutStyles(),this.goTo(this._currentIndex,{behavior:"auto"})}_handleClickPrev(){this.prev()}_handleClickNext(){this.next()}_handleViewportKeydown(t){t.key==="ArrowRight"?(t.preventDefault(),this.next()):t.key==="ArrowLeft"&&(t.preventDefault(),this.prev())}_handleViewportScroll(){this._scrollAnimationFrame===null&&(this._dragState?.dragging||this._requestSyncFromScroll())}_handleViewportPointerDown(t){t.pointerType==="mouse"&&(t.button!==0||!this._slides.length||this._eventTargetsInteractiveElement(t)||(this._cancelScrollAnimation(),this._dragState={pointerId:t.pointerId,startX:t.clientX,startScrollLeft:this._viewportElement.scrollLeft,dragging:!1},this._viewportElement.setPointerCapture(t.pointerId),this._viewportElement.addEventListener("pointermove",this._handlePointerMove),this._viewportElement.addEventListener("pointerup",this._handlePointerUp),this._viewportElement.addEventListener("pointercancel",this._handlePointerUp)))}_handlePointerMove(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let e=t.clientX-this._dragState.startX;!this._dragState.dragging&&Math.abs(e)>6&&(this._dragState.dragging=!0,this._setDraggingState(!0)),this._dragState.dragging&&(t.preventDefault(),this._viewportElement.scrollLeft=this._dragState.startScrollLeft-e)}_handlePointerUp(t){if(!this._dragState||t.pointerId!==this._dragState.pointerId)return;let e=this._dragState.dragging,s=e?this._findNearestSlideIndex():this._currentIndex;this._viewportElement.hasPointerCapture(t.pointerId)&&this._viewportElement.releasePointerCapture(t.pointerId),this._dragState=null,this._setDraggingState(!1),this._removePointerListeners(),e&&(this._clickSuppressUntil=performance.now()+250,this.snap?this.goTo(s,{behavior:"smooth"}):this._requestSyncFromScroll())}_handleViewportClickCapture(t){performance.now()<this._clickSuppressUntil&&(t.preventDefault(),t.stopPropagation())}_removePointerListeners(){this._viewportElement.removeEventListener("pointermove",this._handlePointerMove),this._viewportElement.removeEventListener("pointerup",this._handlePointerUp),this._viewportElement.removeEventListener("pointercancel",this._handlePointerUp)}_eventTargetsInteractiveElement(t){return t.composedPath().some(e=>e instanceof Element&&e.matches(xe))}_requestSyncFromScroll(){this._scrollFrame!==null&&cancelAnimationFrame(this._scrollFrame),this._scrollFrame=requestAnimationFrame(()=>{this._scrollFrame=null;let t=this._findNearestSlideIndex();this._setCurrentIndex(t)})}_findNearestSlideIndex(){if(!this._slides.length)return 0;let t=this._viewportElement.scrollLeft,e=this._currentIndex,s=Number.POSITIVE_INFINITY;return this._slides.forEach((n,r)=>{let o=Math.abs(this._getSlideTargetScrollLeft(n)-t);o<s&&(e=r,s=o)}),e}_syncSlides(){let t=new Set(this._slides),e=this._slotElement.assignedElements({flatten:!0}).filter(s=>!s.hasAttribute("hidden"));t.forEach(s=>{e.includes(s)||(this._restoreSlideStyles(s),s.removeAttribute("data-rtgl-carousel-active"))}),this._slides=e,this._slides.forEach(s=>{this._slideStyleCache.has(s)||this._slideStyleCache.set(s,{flex:s.style.flex,width:s.style.width,minWidth:s.style.minWidth,maxWidth:s.style.maxWidth,boxSizing:s.style.boxSizing,scrollSnapAlign:s.style.scrollSnapAlign,scrollSnapStop:s.style.scrollSnapStop})}),this._buildPager(),this._setCurrentIndex(H({index:this._currentIndex,maxIndex:this._slides.length-1}),{emit:!1,reflect:!0})}_restoreSlideStyles(t){let e=this._slideStyleCache.get(t);e&&(t.style.flex=e.flex,t.style.width=e.width,t.style.minWidth=e.minWidth,t.style.maxWidth=e.maxWidth,t.style.boxSizing=e.boxSizing,t.style.scrollSnapAlign=e.scrollSnapAlign,t.style.scrollSnapStop=e.scrollSnapStop)}_updateLayoutStyles(){let t=Tt({slideWidth:this.getAttribute("sw")}),e=st(this.getAttribute("sna"))??"center",s=it(this.getAttribute("snap")),n=u(this.getAttribute("g"))??"var(--spacing-md)",r=u(this.getAttribute("spi"))??"0px",o=st(this.getAttribute("sbh"))??"smooth",l=Lt({slideWidthCss:t,snapAlign:e});this.style.setProperty("--rtgl-carousel-slide-width",t),this.style.setProperty("--rtgl-carousel-gap",n),this.style.setProperty("--rtgl-carousel-scroll-snap-type",s),this.style.setProperty("--rtgl-carousel-scroll-padding-inline",r),this.style.setProperty("--rtgl-carousel-edge-padding-inline",l),this.style.setProperty("--rtgl-carousel-scroll-behavior",o),this.style.setProperty("--rtgl-carousel-snap-align",e),this._slides.forEach(a=>{a.style.flex=`0 0 ${t}`,a.style.width=t,a.style.minWidth="0",a.style.maxWidth="unset",a.style.boxSizing="border-box",a.style.scrollSnapAlign=e,a.style.scrollSnapStop="always"})}_setDraggingState(t){if(t){this.setAttribute("dragging",""),this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this.removeAttribute("dragging"),this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior=""}_scrollViewportTo(t,e={}){let s=e.behavior??"smooth",n=Math.min(Math.max(t,0),Math.max(this._viewportElement.scrollWidth-this._viewportElement.clientWidth,0));if(s!=="smooth"||Math.abs(n-this._viewportElement.scrollLeft)<1){this._cancelScrollAnimation(),this._viewportElement.scrollLeft=n;return}this._cancelScrollAnimation();let r=this._viewportElement.scrollLeft,o=n-r,l=Math.min(720,Math.max(420,Math.abs(o)*.35)),a=performance.now();this._setAnimatingScrollState(!0);let h=d=>{let _=d-a,x=Math.min(_/l,1),k=Se(x);if(this._viewportElement.scrollLeft=r+o*k,x<1){this._scrollAnimationFrame=requestAnimationFrame(h);return}this._viewportElement.scrollLeft=n,this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1)};this._scrollAnimationFrame=requestAnimationFrame(h)}_cancelScrollAnimation(){this._scrollAnimationFrame!==null&&(cancelAnimationFrame(this._scrollAnimationFrame),this._scrollAnimationFrame=null,this._setAnimatingScrollState(!1))}_buildPager(){this._pagerElement.replaceChildren(),this._pagerButtons=[],this._slides.forEach((t,e)=>{let s=document.createElement("button");s.type="button",s.setAttribute("part","pager-button"),s.setAttribute("aria-label",`Go to slide ${e+1}`),s.setAttribute("title",`Go to slide ${e+1}`),s.addEventListener("click",()=>{this.goTo(e)}),this._pagerElement.appendChild(s),this._pagerButtons.push(s)}),this._updateControls()}_updateControls(){let t=this._slides.length>0,e=this._slides.length>1,s=this._currentIndex<=0,n=this._currentIndex>=this._slides.length-1,r=e&&this._showsNavControls(),o=e&&this._showsPagerControls();this._prevButton.hidden=!r,this._nextButton.hidden=!r,this._pagerElement.hidden=!o,this._controlsElement.hidden=!o,this._prevButton.disabled=!t||s,this._nextButton.disabled=!t||n,this._pagerButtons.forEach((l,a)=>{let h=a===this._currentIndex;l.classList.toggle("is-active",h),l.disabled=h,l.setAttribute("part",h?"pager-button pager-button-active":"pager-button"),h?l.setAttribute("aria-current","true"):l.removeAttribute("aria-current")})}_setCurrentIndex(t,e={}){let s=H({index:t,maxIndex:this._slides.length-1}),n=e.emit??!0,r=e.reflect??!0,o=this._currentIndex;this._currentIndex=s,this._slides.forEach((l,a)=>{a===s?l.setAttribute("data-rtgl-carousel-active","true"):l.removeAttribute("data-rtgl-carousel-active")}),this._updateControls(),r&&this.getAttribute("index")!==`${s}`&&(this._isReflectingIndex=!0,this.setAttribute("index",`${s}`)),n&&o!==s&&this.dispatchEvent(new CustomEvent("index-change",{detail:{index:s},bubbles:!0}))}_resolveScrollInlinePosition(){let t=st(this.getAttribute("sna"))??"center";return t==="start"||t==="end"||t==="center"?t:"center"}_getSlideTargetScrollLeft(t){let e=this._viewportElement.getBoundingClientRect(),s=t.getBoundingClientRect();if(e.width<=0||s.width<=0)return this._viewportElement.scrollLeft;let n=getComputedStyle(this._viewportElement),r=this._viewportElement.scrollLeft,o=s.left-e.left+r;return Wt({slideLeft:o,slideWidth:s.width,viewportWidth:e.width,scrollPaddingInlineStart:this._parsePx(n.scrollPaddingInlineStart),scrollPaddingInlineEnd:this._parsePx(n.scrollPaddingInlineEnd),snapAlign:this._resolveScrollInlinePosition(),maxScrollLeft:this._viewportElement.scrollWidth-this._viewportElement.clientWidth})}_parsePx(t){let e=Number.parseFloat(t);return Number.isFinite(e)?e:0}_setAnimatingScrollState(t){if(t){this._viewportElement.style.scrollSnapType="none",this._viewportElement.style.scrollBehavior="auto";return}this._dragState?.dragging||(this._viewportElement.style.scrollSnapType="",this._viewportElement.style.scrollBehavior="")}},Bt=()=>rt;var Ee={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out"}},m=v(Ee);var q=c`
|
|
452
452
|
:host([sh]:not([sv])) {
|
|
453
453
|
overflow-x: auto;
|
|
454
454
|
flex-wrap: nowrap;
|
|
@@ -528,7 +528,7 @@ var rettangoli=(()=>{var L=`
|
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
530
|
|
|
531
|
-
`;var
|
|
531
|
+
`;var M={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Ae={bgc:{pr:`
|
|
532
532
|
background-color: var(--primary);
|
|
533
533
|
`,se:`
|
|
534
534
|
background-color: var(--secondary);
|
|
@@ -570,7 +570,7 @@ var rettangoli=(()=>{var L=`
|
|
|
570
570
|
left: 0;
|
|
571
571
|
top: 0;
|
|
572
572
|
height: 100%;
|
|
573
|
-
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:
|
|
573
|
+
`},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:p,pr:p,pb:p,pl:p,p,ph:p,pv:p,g:p,gv:p,gh:p,bw:M,bwt:M,bwr:M,bwb:M,bwl:M,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",su:"--surface",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"}},G=v(Ae);var Ce={mt:p,mr:p,mb:p,ml:p,m:p,mh:p,mv:p},g=v(Ce);var T=c`
|
|
574
574
|
a, a:link, a:visited, a:hover, a:active {
|
|
575
575
|
color: inherit;
|
|
576
576
|
text-decoration: none;
|
|
@@ -580,7 +580,7 @@ var rettangoli=(()=>{var L=`
|
|
|
580
580
|
margin: 0;
|
|
581
581
|
font: inherit;
|
|
582
582
|
}
|
|
583
|
-
`;var ke=i=>{if(i==null)return null;let t=i.trim();return t===""?null:/^[1-9]\d*$/.test(t)?`repeat(${t}, minmax(0, 1fr))`:t},nt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(
|
|
583
|
+
`;var ke=i=>{if(i==null)return null;let t=i.trim();return t===""?null:/^[1-9]\d*$/.test(t)?`repeat(${t}, minmax(0, 1fr))`:t},nt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
584
584
|
slot {
|
|
585
585
|
display: contents;
|
|
586
586
|
}
|
|
@@ -594,13 +594,13 @@ var rettangoli=(()=>{var L=`
|
|
|
594
594
|
border-color: var(--border);
|
|
595
595
|
}
|
|
596
596
|
|
|
597
|
-
${
|
|
597
|
+
${q}
|
|
598
598
|
${g}
|
|
599
599
|
${m}
|
|
600
600
|
${G}
|
|
601
|
+
${T}
|
|
601
602
|
${W}
|
|
602
|
-
|
|
603
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...y([...k,"cols","op","wh","w","h","hide","show","sh","sv","z","overflow"])]}_styles=f();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=T({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=f(),S.forEach(e=>{let s=C=>`${e==="default"?"":`${e}-`}${C}`,n=this.getAttribute(s("wh")),r=c(n===null?this.getAttribute(s("w")):n),o=c(n===null?this.getAttribute(s("h")):n),l=ke(this.getAttribute(s("cols"))),a=this.getAttribute(s("op")),h=this.getAttribute(s("z"));l!==null&&(this._styles[e]["grid-template-columns"]=l),h!==null&&(this._styles[e]["z-index"]=h),a!==null&&(this._styles[e].opacity=a),b({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),b({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="grid");let p=this.hasAttribute(s("sh")),_=this.hasAttribute(s("sv")),x=this.getAttribute(s("overflow"));p&&_?(this._styles[e].overflow="auto",this._styles[e]["scrollbar-gutter"]="stable"):p?(this._styles[e]["overflow-x"]="auto",this._styles[e]["scrollbar-gutter"]="stable"):_&&(this._styles[e]["overflow-y"]="auto",this._styles[e]["scrollbar-gutter"]="stable"),x==="hidden"&&(this._styles[e].overflow="hidden")});let t=w(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,e,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}e!==s&&this.updateStyles()}},Ot=({render:i,html:t})=>nt;var Nt=d`
|
|
603
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...y([...C,"cols","op","wh","w","h","hide","show","sh","sv","z","overflow"])]}_styles=f();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=L({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=f(),S.forEach(e=>{let s=k=>`${e==="default"?"":`${e}-`}${k}`,n=this.getAttribute(s("wh")),r=u(n===null?this.getAttribute(s("w")):n),o=u(n===null?this.getAttribute(s("h")):n),l=ke(this.getAttribute(s("cols"))),a=this.getAttribute(s("op")),h=this.getAttribute(s("z"));l!==null&&(this._styles[e]["grid-template-columns"]=l),h!==null&&(this._styles[e]["z-index"]=h),a!==null&&(this._styles[e].opacity=a),b({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),b({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="grid");let d=this.hasAttribute(s("sh")),_=this.hasAttribute(s("sv")),x=this.getAttribute(s("overflow"));d&&_?(this._styles[e].overflow="auto",this._styles[e]["scrollbar-gutter"]="stable"):d?(this._styles[e]["overflow-x"]="auto",this._styles[e]["scrollbar-gutter"]="stable"):_&&(this._styles[e]["overflow-y"]="auto",this._styles[e]["scrollbar-gutter"]="stable"),x==="hidden"&&(this._styles[e].overflow="hidden")});let t=w(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,e,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}e!==s&&this.updateStyles()}},Rt=({render:i,html:t})=>nt;var Mt=c`
|
|
604
604
|
|
|
605
605
|
:host([d="h"]) {
|
|
606
606
|
flex-direction: row;
|
|
@@ -671,7 +671,7 @@ var rettangoli=(()=>{var L=`
|
|
|
671
671
|
justify-content: center;
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
|
-
`;var K=i=>{if(i==null)return null;let t=`${i}`.trim();return t.length>0?t:null},ot=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(
|
|
674
|
+
`;var K=i=>{if(i==null)return null;let t=`${i}`.trim();return t.length>0?t:null},ot=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
675
675
|
slot {
|
|
676
676
|
display: contents;
|
|
677
677
|
}
|
|
@@ -687,14 +687,14 @@ var rettangoli=(()=>{var L=`
|
|
|
687
687
|
}
|
|
688
688
|
|
|
689
689
|
|
|
690
|
-
${
|
|
691
|
-
${
|
|
690
|
+
${q}
|
|
691
|
+
${Mt}
|
|
692
692
|
${g}
|
|
693
693
|
${m}
|
|
694
694
|
${G}
|
|
695
|
+
${T}
|
|
695
696
|
${W}
|
|
696
|
-
|
|
697
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...y([...k,"op","wh","w","h","ar","bgi","bgs","bgp","bgr","hsb","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow","stretch"])]}_styles=f();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=T({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=f(),S.forEach(e=>{let s=At=>`${e==="default"?"":`${e}-`}${At}`,n=this.getAttribute(s("wh")),r=c(n===null?this.getAttribute(s("w")):n),o=c(n===null?this.getAttribute(s("h")):n),l=this.getAttribute(s("op")),a=this.getAttribute(s("z")),h=O(this.getAttribute(s("ar"))),p=K(this.getAttribute(s("bgi"))),_=K(this.getAttribute(s("bgs"))),x=K(this.getAttribute(s("bgp"))),C=K(this.getAttribute(s("bgr")));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),h!==void 0&&(this._styles[e]["aspect-ratio"]=h),p!==null&&(this._styles[e]["background-image"]=p),_!==null&&(this._styles[e]["background-size"]=_),x!==null&&(this._styles[e]["background-position"]=x),C!==null&&(this._styles[e]["background-repeat"]=C),b({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),b({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="flex");let $=this.getAttribute(s("d")),A=this.getAttribute(s("ah")),E=this.getAttribute(s("av")),I=J({element:this,size:e,attr:"d"});$==="h"?this._styles[e]["flex-direction"]="row":$==="v"?this._styles[e]["flex-direction"]="column":e==="default"&&!$&&["sm","md","lg","xl"].some(ae=>this.hasAttribute(`${ae}-d`))&&(this._styles[e]["flex-direction"]="column");let V=I==="h",Y=I==="v"||!I;V&&(A==="c"?this._styles[e]["justify-content"]="center":A==="e"?this._styles[e]["justify-content"]="flex-end":A==="s"&&(this._styles[e]["justify-content"]="flex-start"),E==="c"?(this._styles[e]["align-items"]="center",this._styles[e]["align-content"]="center"):E==="e"?(this._styles[e]["align-items"]="flex-end",this._styles[e]["align-content"]="flex-end"):E==="s"&&(this._styles[e]["align-items"]="flex-start")),Y&&(A!==null||E!==null)&&(A==="c"?this._styles[e]["align-items"]="center":A==="e"?this._styles[e]["align-items"]="flex-end":A==="s"&&(this._styles[e]["align-items"]="flex-start"),E==="c"?this._styles[e]["justify-content"]="center":E==="e"?this._styles[e]["justify-content"]="flex-end":E==="s"&&(this._styles[e]["justify-content"]="flex-start"));let re=this.hasAttribute(s("wrap")),ne=this.hasAttribute(s("no-wrap"));re&&(this._styles[e]["flex-wrap"]="wrap"),ne&&(this._styles[e]["flex-wrap"]="nowrap"),this.hasAttribute(s("stretch"))&&(this._styles[e]["align-self"]="stretch");let St=this.hasAttribute(s("sh")),Et=this.hasAttribute(s("sv")),oe=this.hasAttribute(s("hsb")),le=this.getAttribute(s("overflow"));St&&Et?(this._styles[e].overflow="auto",this._styles[e]["scrollbar-gutter"]="stable",this._styles[e]["flex-wrap"]="nowrap"):St?(this._styles[e]["overflow-x"]="auto",this._styles[e]["scrollbar-gutter"]="stable",this._styles[e]["flex-wrap"]="nowrap"):Et&&(this._styles[e]["overflow-y"]="auto",this._styles[e]["scrollbar-gutter"]="stable",this._styles[e]["flex-wrap"]="nowrap"),le==="hidden"&&(this._styles[e].overflow="hidden",this._styles[e]["flex-wrap"]="nowrap"),oe&&(this._styles[e]["-ms-overflow-style"]="none",this._styles[e]["scrollbar-gutter"]="auto",this._styles[e]["scrollbar-width"]="none")});let t=w(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,e,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}e!==s&&this.updateStyles()}},Rt=({render:i,html:t})=>ot;var Ce={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
|
|
697
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...y([...C,"op","wh","w","h","ar","bgi","bgs","bgp","bgr","hsb","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow","stretch"])]}_styles=f();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=L({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=f(),S.forEach(e=>{let s=At=>`${e==="default"?"":`${e}-`}${At}`,n=this.getAttribute(s("wh")),r=u(n===null?this.getAttribute(s("w")):n),o=u(n===null?this.getAttribute(s("h")):n),l=this.getAttribute(s("op")),a=this.getAttribute(s("z")),h=R(this.getAttribute(s("ar"))),d=K(this.getAttribute(s("bgi"))),_=K(this.getAttribute(s("bgs"))),x=K(this.getAttribute(s("bgp"))),k=K(this.getAttribute(s("bgr")));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),h!==void 0&&(this._styles[e]["aspect-ratio"]=h),d!==null&&(this._styles[e]["background-image"]=d),_!==null&&(this._styles[e]["background-size"]=_),x!==null&&(this._styles[e]["background-position"]=x),k!==null&&(this._styles[e]["background-repeat"]=k),b({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),b({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="flex");let z=this.getAttribute(s("d")),A=this.getAttribute(s("ah")),E=this.getAttribute(s("av")),I=J({element:this,size:e,attr:"d"});z==="h"?this._styles[e]["flex-direction"]="row":z==="v"?this._styles[e]["flex-direction"]="column":e==="default"&&!z&&["sm","md","lg","xl"].some(he=>this.hasAttribute(`${he}-d`))&&(this._styles[e]["flex-direction"]="column");let D=I==="h",Y=I==="v"||!I;D&&(A==="c"?this._styles[e]["justify-content"]="center":A==="e"?this._styles[e]["justify-content"]="flex-end":A==="s"&&(this._styles[e]["justify-content"]="flex-start"),E==="c"?(this._styles[e]["align-items"]="center",this._styles[e]["align-content"]="center"):E==="e"?(this._styles[e]["align-items"]="flex-end",this._styles[e]["align-content"]="flex-end"):E==="s"&&(this._styles[e]["align-items"]="flex-start")),Y&&(A!==null||E!==null)&&(A==="c"?this._styles[e]["align-items"]="center":A==="e"?this._styles[e]["align-items"]="flex-end":A==="s"&&(this._styles[e]["align-items"]="flex-start"),E==="c"?this._styles[e]["justify-content"]="center":E==="e"?this._styles[e]["justify-content"]="flex-end":E==="s"&&(this._styles[e]["justify-content"]="flex-start"));let ne=this.hasAttribute(s("wrap")),oe=this.hasAttribute(s("no-wrap"));ne&&(this._styles[e]["flex-wrap"]="wrap"),oe&&(this._styles[e]["flex-wrap"]="nowrap"),this.hasAttribute(s("stretch"))&&(this._styles[e]["align-self"]="stretch");let St=this.hasAttribute(s("sh")),Et=this.hasAttribute(s("sv")),le=this.hasAttribute(s("hsb")),ae=this.getAttribute(s("overflow"));St&&Et?(this._styles[e].overflow="auto",this._styles[e]["scrollbar-gutter"]="stable",this._styles[e]["flex-wrap"]="nowrap"):St?(this._styles[e]["overflow-x"]="auto",this._styles[e]["scrollbar-gutter"]="stable",this._styles[e]["flex-wrap"]="nowrap"):Et&&(this._styles[e]["overflow-y"]="auto",this._styles[e]["scrollbar-gutter"]="stable",this._styles[e]["flex-wrap"]="nowrap"),ae==="hidden"&&(this._styles[e].overflow="hidden",this._styles[e]["flex-wrap"]="nowrap"),le&&(this._styles[e]["-ms-overflow-style"]="none",this._styles[e]["scrollbar-gutter"]="auto",this._styles[e]["scrollbar-width"]="none")});let t=w(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,e,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}e!==s&&this.updateStyles()}},Ft=({render:i,html:t})=>ot;var Ie={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
|
|
698
698
|
font-size: var(--h1-font-size);
|
|
699
699
|
font-weight: var(--h1-font-weight);
|
|
700
700
|
line-height: var(--h1-line-height);
|
|
@@ -734,7 +734,7 @@ var rettangoli=(()=>{var L=`
|
|
|
734
734
|
font-weight: var(--xs-font-weight);
|
|
735
735
|
line-height: var(--xs-line-height);
|
|
736
736
|
letter-spacing: var(--xs-letter-spacing);
|
|
737
|
-
`}},
|
|
737
|
+
`}},Nt=v(Ie);var ze={c:{pr:"color: var(--primary);",se:"color: var(--secondary);",de:"color: var(--destructive);",fg:"color: var(--foreground);",bg:"color: var(--background);",mu:"color: var(--muted-foreground);",ac:"color: var(--accent);",bo:"color: var(--border);",tr:"color: transparent;","pr-fg":"color: var(--primary-foreground);","se-fg":"color: var(--secondary-foreground);","de-fg":"color: var(--destructive-foreground);","mu-fg":"color: var(--muted-foreground);","ac-fg":"color: var(--accent-foreground);"}},X=v(ze);var lt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
738
738
|
:host {
|
|
739
739
|
display: block;
|
|
740
740
|
font-size: var(--md-font-size);
|
|
@@ -753,12 +753,12 @@ var rettangoli=(()=>{var L=`
|
|
|
753
753
|
text-decoration: var(--anchor-text-decoration-hover);
|
|
754
754
|
color: var(--anchor-color-hover);
|
|
755
755
|
}
|
|
756
|
-
${
|
|
757
|
-
${
|
|
756
|
+
${W}
|
|
757
|
+
${Nt}
|
|
758
758
|
${X}
|
|
759
759
|
${g}
|
|
760
760
|
${m}
|
|
761
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","new-tab","rel","break-long-tokens"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,e,s){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=
|
|
761
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","new-tab","rel","break-long-tokens"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,e,s){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=u(this.getAttribute("w")),e=this.hasAttribute("ellipsis"),s=this.hasAttribute("break-long-tokens");e?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap",this.style.overflowWrap="",this.style.wordBreak=""):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace="",this.style.overflowWrap=s?"anywhere":"",this.style.wordBreak=s?"break-word":""),B({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=L({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}},Pt=({render:i,html:t})=>lt;var F={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},$e={bgc:{pr:"background-color: var(--primary);",se:"background-color: var(--secondary);",de:"background-color: var(--destructive);",fg:"background-color: var(--foreground);",bg:"background-color: var(--background);",su:"background-color: var(--surface);",mu:"background-color: var(--muted);",ac:"background-color: var(--accent);",bo:"background-color: var(--border);"},pos:{rel:"relative",abs:"absolute",fix:"fixed"},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},bw:F,bwt:F,bwr:F,bwb:F,bwl:F,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",su:"--surface",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"}},Vt=i=>v($e,{},i);var We={mt:p,mr:p,mb:p,ml:p,m:p,mh:p,mv:p},Dt=i=>v(We,{},i);var at=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
762
762
|
:host {
|
|
763
763
|
display: contents;
|
|
764
764
|
}
|
|
@@ -785,7 +785,7 @@ var rettangoli=(()=>{var L=`
|
|
|
785
785
|
height: auto;
|
|
786
786
|
}
|
|
787
787
|
|
|
788
|
-
${
|
|
788
|
+
${T}
|
|
789
789
|
|
|
790
790
|
a {
|
|
791
791
|
display: block;
|
|
@@ -793,10 +793,10 @@ var rettangoli=(()=>{var L=`
|
|
|
793
793
|
width: 100%;
|
|
794
794
|
}
|
|
795
795
|
|
|
796
|
-
${Dt("img, a")}
|
|
797
796
|
${Vt("img, a")}
|
|
797
|
+
${Dt("img, a")}
|
|
798
798
|
${m}
|
|
799
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.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([...
|
|
799
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.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([...C,"key","src","alt","href","new-tab","rel","wh","w","h","ar","hide","show","op","z","of"])}_styles=f();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=Q({shadowRoot:this.shadow,childElement:this._imgElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this._updateImageAttributes(),this.updateStyles()}attributeChangedCallback(t,e,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}if(t==="src"||t==="alt"){this._updateImageAttributes();return}e!==s&&this.updateStyles()}updateStyles(){this._styles=f(),S.forEach(e=>{let s=d=>`${e==="default"?"":`${e}-`}${d}`,n=this.getAttribute(s("wh")),r=u(n===null?this.getAttribute(s("w")):n),o=u(n===null?this.getAttribute(s("h")):n),l=this.getAttribute(s("op")),a=this.getAttribute(s("z")),h=R(this.getAttribute(s("ar")));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),h!==void 0&&(this._styles[e]["aspect-ratio"]=h),b({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)"}),b({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none !important"),this.hasAttribute(s("show"))&&(this._styles[e].display="block !important")});let t=w(this._styles,"img, a");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_updateImageAttributes(){let t=this.getAttribute("src"),e=this.getAttribute("alt");t!==null?this._imgElement.setAttribute("src",t):this._imgElement.removeAttribute("src"),e!==null?this._imgElement.setAttribute("alt",e):this._imgElement.removeAttribute("alt")}},jt=({render:i,html:t})=>at;var Le={s:{sm:`
|
|
800
800
|
height: 20px;
|
|
801
801
|
padding-left: 8px;
|
|
802
802
|
padding-right: 8px;
|
|
@@ -849,7 +849,7 @@ var rettangoli=(()=>{var L=`
|
|
|
849
849
|
background-color: var(--destructive);
|
|
850
850
|
color: var(--destructive-foreground);
|
|
851
851
|
border-color: transparent;
|
|
852
|
-
`}},Ut=v(Le,{},".surface");var ht=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(
|
|
852
|
+
`}},Ut=v(Le,{},".surface");var ht=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
853
853
|
:host {
|
|
854
854
|
display: inline-flex;
|
|
855
855
|
min-width: 0;
|
|
@@ -951,7 +951,7 @@ var rettangoli=(()=>{var L=`
|
|
|
951
951
|
}
|
|
952
952
|
${g}
|
|
953
953
|
${m}
|
|
954
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._surfaceElement=document.createElement("span"),this._surfaceElement.className="surface",this._surfaceElement.setAttribute("part","surface"),this._labelElement=document.createElement("span"),this._labelElement.className="label",this._labelElement.setAttribute("part","label"),this._slotElement=document.createElement("slot"),this._labelElement.appendChild(this._slotElement),this._surfaceElement.appendChild(this._labelElement),this.shadow.appendChild(this._surfaceElement),this._prefixIcon=null,this._suffixIcon=null,this._removeButton=null,this._onRemoveClick=this._onRemoveClick.bind(this)}static get observedAttributes(){return["key","pre","suf","removable","w"]}connectedCallback(){this._updateWidth(),this._updateStructure()}attributeChangedCallback(t,e,s){if(t==="w"){this._updateWidth();return}e!==s&&this._updateStructure()}_updateWidth(){let t=
|
|
954
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._surfaceElement=document.createElement("span"),this._surfaceElement.className="surface",this._surfaceElement.setAttribute("part","surface"),this._labelElement=document.createElement("span"),this._labelElement.className="label",this._labelElement.setAttribute("part","label"),this._slotElement=document.createElement("slot"),this._labelElement.appendChild(this._slotElement),this._surfaceElement.appendChild(this._labelElement),this.shadow.appendChild(this._surfaceElement),this._prefixIcon=null,this._suffixIcon=null,this._removeButton=null,this._onRemoveClick=this._onRemoveClick.bind(this)}static get observedAttributes(){return["key","pre","suf","removable","w"]}connectedCallback(){this._updateWidth(),this._updateStructure()}attributeChangedCallback(t,e,s){if(t==="w"){this._updateWidth();return}e!==s&&this._updateStructure()}_updateWidth(){let t=u(this.getAttribute("w"));B({style:this.style,width:t,flexMinWidth:"0"})}_createIconElement(t,e){let s=document.createElement("rtgl-svg");return s.className=t,s.setAttribute("part",e),s.setAttribute("aria-hidden","true"),s}_syncIcon({iconName:t,element:e,className:s,part:n,insertBeforeElement:r}){if(!t)return e&&e.remove(),null;let o=e||this._createIconElement(s,n);return o.setAttribute("svg",t),o.parentNode!==this._surfaceElement?this._surfaceElement.insertBefore(o,r):o.nextSibling!==r&&this._surfaceElement.insertBefore(o,r),o}_syncRemoveButton(){if(!this.hasAttribute("removable")){this._removeButton&&(this._removeButton.removeEventListener("click",this._onRemoveClick),this._removeButton.remove(),this._removeButton=null);return}this._removeButton||(this._removeButton=document.createElement("button"),this._removeButton.type="button",this._removeButton.className="removeButton",this._removeButton.setAttribute("part","remove-button"),this._removeButton.setAttribute("aria-label","Remove tag"),this._removeButton.addEventListener("click",this._onRemoveClick),this._surfaceElement.appendChild(this._removeButton))}_updateStructure(){this._prefixIcon=this._syncIcon({iconName:this.getAttribute("pre"),element:this._prefixIcon,className:"prefixIcon",part:"prefix-icon",insertBeforeElement:this._labelElement}),this._syncRemoveButton(),this._suffixIcon=this._syncIcon({iconName:this.getAttribute("suf"),element:this._suffixIcon,className:"suffixIcon",part:"suffix-icon",insertBeforeElement:this._removeButton})}_onRemoveClick(t){t.preventDefault(),t.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-click",{detail:{value:this.getAttribute("value")},bubbles:!0,composed:!0}))}},Ht=({render:i,html:t})=>ht;var qt=c`
|
|
955
955
|
:host([pt="xs"]) svg {
|
|
956
956
|
padding-top: var(--spacing-xs);
|
|
957
957
|
}
|
|
@@ -1067,7 +1067,7 @@ var rettangoli=(()=>{var L=`
|
|
|
1067
1067
|
padding-top: var(--spacing-xl);
|
|
1068
1068
|
padding-bottom: var(--spacing-xl);
|
|
1069
1069
|
}
|
|
1070
|
-
`;var dt=class i extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(
|
|
1070
|
+
`;var dt=class i extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
1071
1071
|
:host {
|
|
1072
1072
|
display: contents;
|
|
1073
1073
|
color: var(--foreground);
|
|
@@ -1093,10 +1093,10 @@ var rettangoli=(()=>{var L=`
|
|
|
1093
1093
|
}
|
|
1094
1094
|
|
|
1095
1095
|
${X}
|
|
1096
|
-
${
|
|
1096
|
+
${qt}
|
|
1097
1097
|
${g}
|
|
1098
1098
|
${m}
|
|
1099
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return i._icons}static addIcon(t,e){i._icons[t]=e}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,e,s){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),e=
|
|
1099
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return i._icons}static addIcon(t,e){i._icons[t]=e}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,e,s){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),e=u(t===null?this.getAttribute("w"):t),s=u(t===null?this.getAttribute("h"):t);e!=null?this.style.width=e:this.style.width="",s!=null?this.style.height=s:this.style.height=""}getBoundingClientRect(){let t=this.shadow.querySelector("svg");return t?t.getBoundingClientRect():super.getBoundingClientRect()}_render(){try{let t=this.getAttribute("svg"),e=i._icons[t]||(window.rtglIcons||{})[t];if(e){this.shadow.innerHTML=e;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},Gt=({render:i,html:t})=>dt;var Te=["mt","mr","mb","ml","m","mh","mv","cur"],ct=class i extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["type","disabled","min","max","step","s"];static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
1100
1100
|
:host {
|
|
1101
1101
|
display: contents;
|
|
1102
1102
|
}
|
|
@@ -1160,7 +1160,7 @@ var rettangoli=(()=>{var L=`
|
|
|
1160
1160
|
}
|
|
1161
1161
|
${g}
|
|
1162
1162
|
${m}
|
|
1163
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=f(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","min","max","step","s",...y([...Te,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,e,s){if(e!==s){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(i.inputSpecificAttributes.includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=f(),S.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,n=this.getAttribute(s("wh")),r=
|
|
1163
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=f(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","min","max","step","s",...y([...Te,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,e,s){if(e!==s){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(i.inputSpecificAttributes.includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=f(),S.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,n=this.getAttribute(s("wh")),r=u(n===null?this.getAttribute(s("w")):n),o=u(n===null?this.getAttribute(s("h")):n),l=this.getAttribute(s("op")),a=this.getAttribute(s("z"));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),b({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)"}),b({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="block")});let t=w(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,e){if(e==null||e==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,e)}_syncValueAttribute(){this._inputElement.value=this.getAttribute("value")??""}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("type"),s=new Set(["text","password","date","time","datetime-local"]).has(t)?t:"text",n=this.getAttribute("min"),r=this.getAttribute("max"),o=this.getAttribute("step"),l=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",s),this._setOrRemoveInputAttribute("min",n),this._setOrRemoveInputAttribute("max",r),this._setOrRemoveInputAttribute("step",o),l?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},$=({render:i,html:t})=>ct;var Oe=$({}),N="date",ut=class extends Oe{connectedCallback(){this.getAttribute("type")!==N&&super.setAttribute("type",N),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==N){this.getAttribute("type")!==N&&super.setAttribute("type",N);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},Kt=({render:i,html:t})=>ut;var Be=$({}),P="time",pt=class extends Be{connectedCallback(){this.getAttribute("type")!==P&&super.setAttribute("type",P),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==P){this.getAttribute("type")!==P&&super.setAttribute("type",P);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},Xt=({render:i,html:t})=>pt;var Re=$({}),V="datetime-local",mt=class extends Re{connectedCallback(){this.getAttribute("type")!==V&&super.setAttribute("type",V),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==V){this.getAttribute("type")!==V&&super.setAttribute("type",V);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},Yt=({render:i,html:t})=>mt;var Me=["mt","mr","mb","ml","m","mh","mv","cur"],gt=class i extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["disabled","step","min","max","s"];static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
1164
1164
|
:host {
|
|
1165
1165
|
display: contents;
|
|
1166
1166
|
}
|
|
@@ -1195,7 +1195,7 @@ var rettangoli=(()=>{var L=`
|
|
|
1195
1195
|
}
|
|
1196
1196
|
${g}
|
|
1197
1197
|
${m}
|
|
1198
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=f(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","placeholder","disabled","value","step","min","max","s",...y([...
|
|
1198
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=f(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","placeholder","disabled","value","step","min","max","s",...y([...Me,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_emitValueEvent=t=>{let e=this._inputElement.value;if(e.trim()===""){this.dispatchEvent(new CustomEvent(t,{detail:{value:null},bubbles:!0}));return}let s=parseFloat(e);isNaN(s)||(s=this._clampValueToBounds(s),this._inputElement.value=s.toString(),this.dispatchEvent(new CustomEvent(t,{detail:{value:s},bubbles:!0})))};_onInput=()=>{this._emitValueEvent("value-input")};_onChange=()=>{this._emitValueEvent("value-change")};attributeChangedCallback(t,e,s){if(e!==s){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(i.inputSpecificAttributes.includes(t)){this._updateInputAttributes(),(t==="min"||t==="max")&&this._syncValueAttribute();return}this.updateStyles()}}updateStyles(){this._styles=f(),S.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,n=this.getAttribute(s("wh")),r=u(n===null?this.getAttribute(s("w")):n),o=u(n===null?this.getAttribute(s("h")):n),l=this.getAttribute(s("op")),a=this.getAttribute(s("z"));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),b({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)"}),b({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="block")});let t=w(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,e){if(e==null||e==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,e)}_clampValueToBounds(t){let e=t,s=this.getAttribute("min");if(s!==null){let r=parseFloat(s);isNaN(r)||(e=Math.max(e,r))}let n=this.getAttribute("max");if(n!==null){let r=parseFloat(n);isNaN(r)||(e=Math.min(e,r))}return e}_syncValueAttribute(){let t=this.getAttribute("value");if(t==null||t===""){this._inputElement.value="";return}let e=parseFloat(t);if(isNaN(e)){this._inputElement.value="";return}let s=this._clampValueToBounds(e);this._inputElement.value=s.toString()}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("step"),e=this.getAttribute("min"),s=this.getAttribute("max"),n=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",e),this._setOrRemoveInputAttribute("max",s),n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},Qt=({render:i,html:t})=>gt;var ft=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
1199
1199
|
:host {
|
|
1200
1200
|
display: contents;
|
|
1201
1201
|
}
|
|
@@ -1223,7 +1223,7 @@ var rettangoli=(()=>{var L=`
|
|
|
1223
1223
|
}
|
|
1224
1224
|
${g}
|
|
1225
1225
|
${m}
|
|
1226
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",...y([...
|
|
1226
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",...y([...C,"wh","w","h","hide","show","op","z"])]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}focus(){this._textareaElement&&this._textareaElement.focus()}select(){this._textareaElement&&this._textareaElement.select()}attributeChangedCallback(t,e,s){if(t==="key"){requestAnimationFrame(()=>{let r=this.getAttribute("value");this._textareaElement.value=r??""});return}if(t==="value"&&requestAnimationFrame(()=>{let r=this.getAttribute("value");this._textareaElement.value=r??""}),t==="placeholder"&&requestAnimationFrame(()=>{let r=this.getAttribute("placeholder");r===void 0||r==="null"?this._textareaElement.removeAttribute("placeholder"):this._textareaElement.setAttribute("placeholder",r??"")}),["cols","rows","disabled"].includes(t)){this._updateTextareaAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(r=>{let o=x=>`${r==="default"?"":`${r}-`}${x}`,l=this.getAttribute(o("wh")),a=u(l===null?this.getAttribute(o("w")):l),h=u(l===null?this.getAttribute(o("h")):l),d=this.getAttribute(o("op")),_=this.getAttribute(o("z"));_!==null&&(this._styles[r]["z-index"]=_),d!==null&&(this._styles[r].opacity=d),a==="f"?this._styles[r].width="var(--width-stretch)":a!==void 0&&(this._styles[r].width=a,this._styles[r]["min-width"]=a,this._styles[r]["max-width"]=a),h==="f"?this._styles[r].height="100%":h!==void 0&&(this._styles[r].height=h,this._styles[r]["min-height"]=h,this._styles[r]["max-height"]=h),this.hasAttribute(o("hide"))&&(this._styles[r].display="none"),this.hasAttribute(o("show"))&&(this._styles[r].display="block")});let n=w(this._styles,"textarea");n!==this._lastStyleString&&(this._styleElement.textContent=n,this._lastStyleString=n)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),e=this.getAttribute("rows"),s=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),e!==null?this._textareaElement.setAttribute("rows",e):this._textareaElement.removeAttribute("rows"),s?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},Jt=({render:i,html:t})=>ft;var Fe=["mt","mr","mb","ml","m","mh","mv","cur"],Ne=/^#[0-9a-fA-F]{6}$/,bt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
1227
1227
|
:host {
|
|
1228
1228
|
display: contents;
|
|
1229
1229
|
}
|
|
@@ -1246,7 +1246,7 @@ var rettangoli=(()=>{var L=`
|
|
|
1246
1246
|
}
|
|
1247
1247
|
${g}
|
|
1248
1248
|
${m}
|
|
1249
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=f(),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([...
|
|
1249
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=f(),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([...Fe,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,e,s){if(e!==s){if(t==="key"){this._syncValueAttribute();return}if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=f(),S.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,n=this.getAttribute(s("wh")),r=u(n===null?this.getAttribute(s("w")):n),o=u(n===null?this.getAttribute(s("h")):n),l=this.getAttribute(s("op")),a=this.getAttribute(s("z"));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),b({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)"}),b({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="block")});let t=w(this._styles,'input[type="color"]');t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_syncValueAttribute(){let t=this.getAttribute("value");if(t===null){this._inputElement.value="#000000";return}this._inputElement.value=Ne.test(t)?t:"#000000"}_updateInputAttributes(){let t=this.hasAttribute("disabled");this._syncValueAttribute(),t?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this.updateStyles()}},Zt=({render:i,html:t})=>bt;var vt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
1250
1250
|
:host {
|
|
1251
1251
|
display: contents;
|
|
1252
1252
|
}
|
|
@@ -1300,7 +1300,7 @@ var rettangoli=(()=>{var L=`
|
|
|
1300
1300
|
}
|
|
1301
1301
|
${g}
|
|
1302
1302
|
${m}
|
|
1303
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.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([...
|
|
1303
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.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([...C,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};attributeChangedCallback(t,e,s){if(t==="key"&&e!==s){requestAnimationFrame(()=>{let r=this.getAttribute("value"),o=this.getAttribute("min")||"0";this._inputElement.value=r??o});return}if(["value","min","max","step","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(r=>{let o=x=>`${r==="default"?"":`${r}-`}${x}`,l=this.getAttribute(o("wh")),a=u(l===null?this.getAttribute(o("w")):l),h=u(l===null?this.getAttribute(o("h")):l),d=this.getAttribute(o("op")),_=this.getAttribute(o("z"));_!==null&&(this._styles[r]["z-index"]=_),d!==null&&(this._styles[r].opacity=d),a==="f"?this._styles[r].width="var(--width-stretch)":a!==void 0&&(this._styles[r].width=a,this._styles[r]["min-width"]=a,this._styles[r]["max-width"]=a),h==="f"?this._styles[r].height="100%":h!==void 0&&(this._styles[r].height=h,this._styles[r]["min-height"]=h,this._styles[r]["max-height"]=h),this.hasAttribute(o("hide"))&&(this._styles[r].display="none"),this.hasAttribute(o("show"))&&(this._styles[r].display="block")});let n=w(this._styles,'input[type="range"]');n!==this._lastStyleString&&(this._styleElement.textContent=n,this._lastStyleString=n)}_updateInputAttributes(){let t=this.getAttribute("value"),e=this.getAttribute("min"),s=this.getAttribute("max"),n=this.getAttribute("step"),r=this.hasAttribute("disabled");t!==null?this._inputElement.value=t:this._inputElement.value=e??0,e!==null?this._inputElement.min=e:this._inputElement.min="0",s!==null?this._inputElement.max=s:this._inputElement.max="100",n!==null?this._inputElement.step=n:this._inputElement.step="1",r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},te=({render:i,html:t})=>vt;var _t=40,Pe=6,yt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
1304
1304
|
:host {
|
|
1305
1305
|
display: contents;
|
|
1306
1306
|
}
|
|
@@ -1387,7 +1387,7 @@ var rettangoli=(()=>{var L=`
|
|
|
1387
1387
|
animation: none;
|
|
1388
1388
|
}
|
|
1389
1389
|
}
|
|
1390
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._adaptiveFrameId=null,this._layoutRetryCount=0,this._observedContentElement=null,this._managedLongTokenTextElements=new Set,this._contentMutationObserver=typeof MutationObserver<"u"?new MutationObserver(()=>{this._syncLongTokenWrapping()}):null,this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._scheduleAdaptiveCentering()}):null,this._onSlotChange=()=>{this._syncLongTokenWrapping(),this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onWindowResize=()=>{this._scheduleAdaptiveCentering({resetRetries:!0})},this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}disconnectedCallback(){this._isConnected=!1,this._clearManagedLongTokenWrapping(),this._stopAdaptiveObservers(),this._slotElement&&this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,e,s){t==="open"?s!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():s===null&&this._dialogElement.open&&this._hideModal():t==="s"?this._scheduleAdaptiveCentering({resetRetries:!0}):t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_clearManagedLongTokenWrapping(){for(let t of this._managedLongTokenTextElements)t?.isConnected&&t.removeAttribute("break-long-tokens");this._managedLongTokenTextElements.clear()}_collectTextElements(t,e){if(!(!t||t.nodeType!==Node.ELEMENT_NODE)){t.localName==="rtgl-text"&&e.push(t);for(let s of t.children)this._collectTextElements(s,e);if(t.shadowRoot)for(let s of t.shadowRoot.children)this._collectTextElements(s,e)}}_syncLongTokenWrapping(){if(this._clearManagedLongTokenWrapping(),!this._slotElement)return;let t=this._slotElement.assignedNodes({flatten:!0}),e=[];for(let s of t)this._collectTextElements(s,e);for(let s of e)s.hasAttribute("ellipsis")||s.hasAttribute("break-long-tokens")||(s.setAttribute("break-long-tokens",""),this._managedLongTokenTextElements.add(s))}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._slotElement.addEventListener("slotchange",this._onSlotChange),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,window.addEventListener("resize",this._onWindowResize),this._syncLongTokenWrapping(),this._observeAssignedContent(),this._layoutRetryCount=0,this._applyAdaptiveCentering())}_hideModal(){this._dialogElement.open&&(this._clearManagedLongTokenWrapping(),this._stopAdaptiveObservers(),this._dialogElement.close(),this._slotElement&&(this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_stopAdaptiveObservers(){this._adaptiveFrameId!==null&&(cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=null),this._layoutRetryCount=0,window.removeEventListener("resize",this._onWindowResize),this._resizeObserver&&this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._contentMutationObserver&&this._contentMutationObserver.disconnect(),this._observedContentElement=null}_getAssignedContentElement(){if(!this._slotElement)return null;let t=this._slotElement.assignedElements({flatten:!0});return t.length>0?t[0]:null}_observeAssignedContent(){if(!this._resizeObserver&&!this._contentMutationObserver)return;let t=this._getAssignedContentElement();this._observedContentElement!==t&&(this._observedContentElement&&(this._resizeObserver&&this._resizeObserver.unobserve(this._observedContentElement),this._contentMutationObserver&&this._contentMutationObserver.disconnect()),this._observedContentElement=t,this._observedContentElement&&(this._resizeObserver&&this._resizeObserver.observe(this._observedContentElement),this._contentMutationObserver&&this._contentMutationObserver.observe(this._observedContentElement,{childList:!0,subtree:!0}),this._syncLongTokenWrapping()))}_scheduleAdaptiveCentering({resetRetries:t=!1}={}){!this._slotElement||!this._dialogElement.open||(t&&(this._layoutRetryCount=0),this._adaptiveFrameId!==null&&cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=null,this._applyAdaptiveCentering()})}))}_applyAdaptiveCentering(){if(!this._slotElement||!this._dialogElement.open)return;this._observeAssignedContent();let t=this._getAssignedContentElement(),e=t?Math.round(t.getBoundingClientRect().height):0;if(e<=0){this._layoutRetryCount<
|
|
1390
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._adaptiveFrameId=null,this._layoutRetryCount=0,this._observedContentElement=null,this._managedLongTokenTextElements=new Set,this._contentMutationObserver=typeof MutationObserver<"u"?new MutationObserver(()=>{this._syncLongTokenWrapping()}):null,this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._scheduleAdaptiveCentering()}):null,this._onSlotChange=()=>{this._syncLongTokenWrapping(),this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onWindowResize=()=>{this._scheduleAdaptiveCentering({resetRetries:!0})},this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}disconnectedCallback(){this._isConnected=!1,this._clearManagedLongTokenWrapping(),this._stopAdaptiveObservers(),this._slotElement&&this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,e,s){t==="open"?s!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():s===null&&this._dialogElement.open&&this._hideModal():t==="s"?this._scheduleAdaptiveCentering({resetRetries:!0}):t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_clearManagedLongTokenWrapping(){for(let t of this._managedLongTokenTextElements)t?.isConnected&&t.removeAttribute("break-long-tokens");this._managedLongTokenTextElements.clear()}_collectTextElements(t,e){if(!(!t||t.nodeType!==Node.ELEMENT_NODE)){t.localName==="rtgl-text"&&e.push(t);for(let s of t.children)this._collectTextElements(s,e);if(t.shadowRoot)for(let s of t.shadowRoot.children)this._collectTextElements(s,e)}}_syncLongTokenWrapping(){if(this._clearManagedLongTokenWrapping(),!this._slotElement)return;let t=this._slotElement.assignedNodes({flatten:!0}),e=[];for(let s of t)this._collectTextElements(s,e);for(let s of e)s.hasAttribute("ellipsis")||s.hasAttribute("break-long-tokens")||(s.setAttribute("break-long-tokens",""),this._managedLongTokenTextElements.add(s))}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._slotElement.addEventListener("slotchange",this._onSlotChange),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,window.addEventListener("resize",this._onWindowResize),this._syncLongTokenWrapping(),this._observeAssignedContent(),this._layoutRetryCount=0,this._applyAdaptiveCentering())}_hideModal(){this._dialogElement.open&&(this._clearManagedLongTokenWrapping(),this._stopAdaptiveObservers(),this._dialogElement.close(),this._slotElement&&(this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_stopAdaptiveObservers(){this._adaptiveFrameId!==null&&(cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=null),this._layoutRetryCount=0,window.removeEventListener("resize",this._onWindowResize),this._resizeObserver&&this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._contentMutationObserver&&this._contentMutationObserver.disconnect(),this._observedContentElement=null}_getAssignedContentElement(){if(!this._slotElement)return null;let t=this._slotElement.assignedElements({flatten:!0});return t.length>0?t[0]:null}_observeAssignedContent(){if(!this._resizeObserver&&!this._contentMutationObserver)return;let t=this._getAssignedContentElement();this._observedContentElement!==t&&(this._observedContentElement&&(this._resizeObserver&&this._resizeObserver.unobserve(this._observedContentElement),this._contentMutationObserver&&this._contentMutationObserver.disconnect()),this._observedContentElement=t,this._observedContentElement&&(this._resizeObserver&&this._resizeObserver.observe(this._observedContentElement),this._contentMutationObserver&&this._contentMutationObserver.observe(this._observedContentElement,{childList:!0,subtree:!0}),this._syncLongTokenWrapping()))}_scheduleAdaptiveCentering({resetRetries:t=!1}={}){!this._slotElement||!this._dialogElement.open||(t&&(this._layoutRetryCount=0),this._adaptiveFrameId!==null&&cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=null,this._applyAdaptiveCentering()})}))}_applyAdaptiveCentering(){if(!this._slotElement||!this._dialogElement.open)return;this._observeAssignedContent();let t=this._getAssignedContentElement(),e=t?Math.round(t.getBoundingClientRect().height):0;if(e<=0){this._layoutRetryCount<Pe&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let s=window.innerHeight;if(e>=s-2*_t){this._slotElement.style.marginTop=`${_t}px`,this._slotElement.style.marginBottom=`${_t}px`,this._dialogElement.style.height="100vh";return}let n=s-e,r=Math.floor(n/2);this._slotElement.style.marginTop=`${r}px`,this._slotElement.style.marginBottom=`${r}px`,this._dialogElement.style.height="auto"}get dialog(){return this._dialogElement}},ee=({render:i,html:t})=>yt;var ie=({x:i,y:t,width:e,height:s,place:n,viewportWidth:r,viewportHeight:o,offset:l=8,padding:a=8})=>{let h=i,d=t;switch(n){case"t":h=i-e/2,d=t-s-l;break;case"ts":h=i,d=t-s-l;break;case"te":h=i-e,d=t-s-l;break;case"r":h=i+l,d=t-s/2;break;case"rs":h=i+l,d=t;break;case"re":h=i+l,d=t-s;break;case"b":h=i-e/2,d=t+l;break;case"bs":h=i,d=t+l;break;case"be":h=i-e,d=t+l;break;case"l":h=i-e-l,d=t-s/2;break;case"ls":h=i-e-l,d=t;break;case"le":h=i-e-l,d=t-s;break;default:h=i,d=t+l;break}return{left:Math.max(a,Math.min(h,r-e-a)),top:Math.max(a,Math.min(d,o-s-a))}};var se="data-rtgl-popover-content",wt="min-width: 200px; max-width: 400px; box-sizing: border-box;",xt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(c`
|
|
1391
1391
|
:host {
|
|
1392
1392
|
display: contents;
|
|
1393
1393
|
}
|
|
@@ -1436,4 +1436,4 @@ var rettangoli=(()=>{var L=`
|
|
|
1436
1436
|
slot[name="content"] {
|
|
1437
1437
|
display: contents;
|
|
1438
1438
|
}
|
|
1439
|
-
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let e=t.composedPath();(e[0]===this._dialogElement||e[0].nodeName==="DIALOG"&&e[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let e=t.composedPath();(e[0]===this._dialogElement||e[0].nodeName==="DIALOG"&&e[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._contentWrapper=null,this._isOpen=!1}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay","content-w","content-h","content-wh","content-g","content-sv","content-ph","content-pv","content-bgc","content-style"]}connectedCallback(){this._syncContentWrapper({reposition:!1}),this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,e,s){t==="open"?s!==null&&!this._isOpen?this.isConnected&&this._show():s===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this.
|
|
1439
|
+
`))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let e=t.composedPath();(e[0]===this._dialogElement||e[0].nodeName==="DIALOG"&&e[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let e=t.composedPath();(e[0]===this._dialogElement||e[0].nodeName==="DIALOG"&&e[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._contentWrapper=null,this._isOpen=!1,this._positionFrameId=null,this._revealFrameId=null,this._positionVersion=0,this._isObservingResize=!1,this._observedContentWrapper=null,this._resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>{this._isOpen&&this._schedulePositionUpdate()}):null}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay","content-w","content-h","content-wh","content-g","content-sv","content-ph","content-pv","content-bgc","content-style"]}connectedCallback(){this._syncContentWrapper({reposition:!1}),this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._cancelScheduledPositionUpdate(),this._stopResizeObserver(),this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,e,s){t==="open"?s!==null&&!this._isOpen?this.isConnected&&this._show():s===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this._schedulePositionUpdate():t==="no-overlay"&&e!==s&&this._isOpen?(this._hide(),this._show()):t.startsWith("content-")&&this._syncContentWrapper()}_isIgnorableTextNode(t){return t?.nodeType===Node.TEXT_NODE&&t.textContent?.trim()===""}_ensureContentWrapper(){if(this._contentWrapper?.parentNode===this)return this._contentWrapper;let t=Array.from(this.children).find(e=>e.hasAttribute(se));return t?this._contentWrapper=t:(this._contentWrapper=document.createElement("rtgl-view"),this._contentWrapper.setAttribute(se,""),this._contentWrapper.setAttribute("part","content"),this._contentWrapper.setAttribute("bgc","su"),this._contentWrapper.setAttribute("bw","xs"),this._contentWrapper.setAttribute("bc","bo"),this._contentWrapper.setAttribute("br","md"),this._contentWrapper.setAttribute("ph","sm"),this._contentWrapper.setAttribute("pv","sm"),this._contentWrapper.setAttribute("style",wt)),this._contentWrapper.parentNode!==this&&this.appendChild(this._contentWrapper),this._contentWrapper}_syncContentWrapperAttributes(){let t=this._ensureContentWrapper(),e=[["content-w","w"],["content-h","h"],["content-wh","wh"],["content-g","g"],["content-sv","sv"]];for(let[n,r]of e){let o=this.getAttribute(n);o===null?t.removeAttribute(r):t.setAttribute(r,o)}t.setAttribute("bgc",this.getAttribute("content-bgc")||"su"),t.setAttribute("ph",this.getAttribute("content-ph")||"sm"),t.setAttribute("pv",this.getAttribute("content-pv")||"sm");let s=this.getAttribute("content-style");t.setAttribute("style",s?`${wt} ${s}`:wt)}_syncContentWrapper({reposition:t=!0}={}){let e=this._ensureContentWrapper(),s=Array.from(this.childNodes).filter(r=>r!==e&&!this._isIgnorableTextNode(r));for(let r of s)r.nodeType===Node.ELEMENT_NODE&&r.getAttribute("slot")==="content"&&r.removeAttribute("slot"),e.appendChild(r);this._syncContentWrapperAttributes(),Array.from(e.childNodes).some(r=>!this._isIgnorableTextNode(r))||this.hasAttribute("open")?e.setAttribute("slot","content"):e.removeAttribute("slot"),t&&this._isOpen&&this._schedulePositionUpdate()}_show(){this._isOpen||(this._syncContentWrapper({reposition:!1}),this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._startResizeObserver(),this._dialogElement.open?this._schedulePositionUpdate():setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal()),this._schedulePositionUpdate()},0))}_hide(){this._isOpen&&(this._isOpen=!1,this._cancelScheduledPositionUpdate(),this._stopResizeObserver(),this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_startResizeObserver(){this._resizeObserver&&(this._isObservingResize||(this._resizeObserver.observe(this._popoverContainer),this._isObservingResize=!0),this._contentWrapper&&this._observedContentWrapper!==this._contentWrapper&&(this._observedContentWrapper&&this._resizeObserver.unobserve(this._observedContentWrapper),this._resizeObserver.observe(this._contentWrapper),this._observedContentWrapper=this._contentWrapper))}_stopResizeObserver(){this._resizeObserver?.disconnect(),this._isObservingResize=!1,this._observedContentWrapper=null}_cancelScheduledPositionUpdate(){this._positionFrameId!==null&&(cancelAnimationFrame(this._positionFrameId),this._positionFrameId=null),this._revealFrameId!==null&&(cancelAnimationFrame(this._revealFrameId),this._revealFrameId=null),this._positionVersion+=1,this.removeAttribute("positioned")}_readCoordinateAttr(t){let e=parseFloat(this.getAttribute(t)||"0");return Number.isFinite(e)?e:0}_schedulePositionUpdate(){this._isOpen&&(this.removeAttribute("positioned"),this._positionVersion+=1,this._positionFrameId===null&&(this._positionFrameId=requestAnimationFrame(()=>{if(this._positionFrameId=null,!this._isOpen)return;if(!this._dialogElement.open){this._schedulePositionUpdate();return}this._syncContentWrapper({reposition:!1}),this._startResizeObserver();let t=this._readCoordinateAttr("x"),e=this._readCoordinateAttr("y"),s=this.getAttribute("place")||"bs",n=this._popoverContainer.getBoundingClientRect(),{left:r,top:o}=this._calculatePosition(t,e,n.width,n.height,s);this._popoverContainer.style.left=`${r}px`,this._popoverContainer.style.top=`${o}px`;let l=this._positionVersion;this._revealFrameId=requestAnimationFrame(()=>{this._revealFrameId=null,this._isOpen&&this._positionVersion===l&&this.setAttribute("positioned","")})})))}_calculatePosition(t,e,s,n,r){return ie({x:t,y:e,width:s,height:n,place:r,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight})}get popover(){return this._popoverContainer}get content(){return this._contentWrapper}refreshContent(){this._syncContentWrapper()}},re=({render:i,html:t})=>xt;customElements.define("rtgl-button",$t({}));customElements.define("rtgl-carousel",Bt({}));customElements.define("rtgl-grid",Rt({}));customElements.define("rtgl-view",Ft({}));customElements.define("rtgl-text",Pt({}));customElements.define("rtgl-image",jt({}));customElements.define("rtgl-tag",Ht({}));customElements.define("rtgl-svg",Gt({}));customElements.define("rtgl-input",$({}));customElements.define("rtgl-input-date",Kt({}));customElements.define("rtgl-input-time",Xt({}));customElements.define("rtgl-input-datetime",Yt({}));customElements.define("rtgl-input-number",Qt({}));customElements.define("rtgl-textarea",Jt({}));customElements.define("rtgl-color-picker",Zt({}));customElements.define("rtgl-slider",te({}));customElements.define("rtgl-dialog",ee({}));customElements.define("rtgl-popover",re({}));})();
|