@claspo/components 1.1.15 → 1.2.0-theme.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const t="validationStatusChanged",e="touchedStatusChanged",n="cl-";function o(t){return n+t}function r(t){return"cl-"+t}class i{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){return t=t||document,Math.max(t.documentElement.clientWidth,t.defaultView.innerWidth||0)}static height(t){return t=t||document,Math.max(t.documentElement.clientHeight,t.defaultView.innerHeight||0)}static scrollbarWidth(t){return(t=t||document).defaultView.innerWidth-t.documentElement.clientWidth}}var s=[];for(var l in{transparent:"#0000"})s.push(l);var a="\\s*([.\\d%]+)\\s*",c="\\("+[a,a,a]+"(?:,\\s*([.\\d]+)\\s*)?\\)",d="(?:rgb)a?",p="("+s.join("|")+")";function u(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}RegExp(d+c,"i"),RegExp([p,"(?:#([a-f0-9]{3,8}))",d+c,"(?:hsl)a?"+c].join("|"),"gi");var h=Array.prototype.concat,m=Array.prototype.slice,b=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var r=t[n];u(r)?e=h.call(e,m.call(r)):e.push(r)}return e};b.wrap=function(t){return function(){return t(b(arguments))}};const g=b;var y={},f=Object.hasOwnProperty,v=Object.create(null);for(var E in y)f.call(y,E)&&(v[y[E]]=E);var O={to:{},get:{}};function S(t,e,n){return Math.min(Math.max(e,t),n)}O.get=function(t){var e,n;return"hsl"===t.substring(0,3).toLowerCase()?(e=O.get.hsl(t),n="hsl"):(e=O.get.rgb(t),n="rgb"),e?{model:n,value:e}:null},O.get.rgb=function(t){if(!t)return null;var e,n,o,r=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){var i=2*n;r[n]=parseInt(e.slice(i,i+2),16)}o&&(r[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],n=0;n<3;n++)r[n]=parseInt(e[n]+e[n],16);o&&(r[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)r[n]=parseInt(e[n+1],0);e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:f.call(y,e[1])?((r=y[e[1]])[3]=1,r):null:null;for(n=0;n<3;n++)r[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}for(n=0;n<3;n++)r[n]=S(r[n],0,255);return r[3]=S(r[3],0,1),r},O.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,S(parseFloat(e[2]),0,100),S(parseFloat(e[3]),0,100),S(isNaN(n)?1:n,0,1)]}return null},O.to.rgb=function(){var t=g(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},O.to.hsl=function(){var t=g(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};const T=O,C={},R={};for(const t of Object.keys(C))R[C[t]]=t;const A={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const t of Object.keys(A)){if(!("channels"in A[t]))throw new Error("missing channels property: "+t);if(!("labels"in A[t]))throw new Error("missing channel labels property: "+t);if(A[t].labels.length!==A[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=A[t];delete A[t].channels,delete A[t].labels,Object.defineProperty(A[t],"channels",{value:e}),Object.defineProperty(A[t],"labels",{value:n})}A.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,r=Math.min(e,n,o),i=Math.max(e,n,o),s=i-r;let l,a;i===r?l=0:e===i?l=(n-o)/s:n===i?l=2+(o-e)/s:o===i&&(l=4+(e-n)/s),l=Math.min(60*l,360),l<0&&(l+=360);const c=(r+i)/2;return a=i===r?0:c<=.5?s/(i+r):s/(2-i-r),[l,100*a,100*c]},A.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,o=t[2]/100;let r,i,s;if(0===n)return s=255*o,[s,s,s];r=o<.5?o*(1+n):o+n-o*n;const l=2*o-r,a=[0,0,0];for(let t=0;t<3;t++)i=e+1/3*-(t-1),i<0&&i++,i>1&&i--,s=6*i<1?l+6*(r-l)*i:2*i<1?r:3*i<2?l+(r-l)*(2/3-i)*6:l,a[t]=255*s;return a};const x=A;function P(t,e){return function(n){return e(t(n))}}function w(t,e){const n=[e[t].parent,t];let o=x[e[t].parent][t],r=e[t].parent;for(;e[r].parent;)n.unshift(e[r].parent),o=P(x[e[r].parent][r],o),r=e[r].parent;return o.conversion=n,o}const k={};Object.keys(x).forEach((t=>{k[t]={},Object.defineProperty(k[t],"channels",{value:x[t].channels}),Object.defineProperty(k[t],"labels",{value:x[t].labels});const e=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(x);for(let n=e.length,o=0;o<n;o++)t[e[o]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;){const t=n.pop(),o=Object.keys(x[t]);for(let r=o.length,i=0;i<r;i++){const r=o[i],s=e[r];-1===s.distance&&(s.distance=e[t].distance+1,s.parent=t,n.unshift(r))}}return e}(t),n={},o=Object.keys(e);for(let t=o.length,r=0;r<t;r++){const t=o[r];null!==e[t].parent&&(n[t]=w(t,e))}return n}(t);Object.keys(e).forEach((n=>{const o=e[n];k[t][n]=function(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const o=t(e);if("object"==typeof o)for(let t=o.length,e=0;e<t;e++)o[e]=Math.round(o[e]);return o};return"conversion"in t&&(e.conversion=t.conversion),e}(o),k[t][n].raw=function(t){const e=function(...e){const n=e[0];return null==n?n:(n.length>1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(o)}))}));const N=k,I=["keyword","gray","hex"],L={};for(const t of Object.keys(N))L[[...N[t].labels].sort().join("")]=t;const _={};function M(t,e){if(!(this instanceof M))return new M(t,e);if(e&&e in I&&(e=null),e&&!(e in N))throw new Error("Unknown model: "+e);let n,o;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof M)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const e=T.get(t);if(null===e)throw new Error("Unable to parse color from string: "+t);this.model=e.model,o=N[this.model].channels,this.color=e.value.slice(0,o),this.valpha="number"==typeof e.value[o]?e.value[o]:1}else if(t.length>0){this.model=e||"rgb",o=N[this.model].channels;const n=Array.prototype.slice.call(t,0,o);this.color=U(n,o),this.valpha="number"==typeof t[o]?t[o]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const e=Object.keys(t);"alpha"in t&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const o=e.sort().join("");if(!(o in L))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=L[o];const{labels:r}=N[this.model],i=[];for(n=0;n<r.length;n++)i.push(t[r[n]]);this.color=U(i)}if(_[this.model])for(o=N[this.model].channels,n=0;n<o;n++){const t=_[this.model][n];t&&(this.color[n]=t(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}M.prototype={toString(){return this.string()},string(t){let e=this.model in T.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return T.to[e.model](n)},round(t){return t=Math.max(t||0,0),new M([...this.color.map(j(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new M([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},lighten(t){const e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){const e=this.hsl();return e.color[2]-=e.color[2]*t,e}};for(const t of Object.keys(N)){if(I.includes(t))continue;const{channels:e}=N[t];M.prototype[t]=function(...e){return this.model===t?new M(this):e.length>0?new M(e,t):new M([...D(N[this.model][t].raw(this.color)),this.valpha],t)},M[t]=function(...n){let o=n[0];return"number"==typeof o&&(o=U(n,e)),new M(o,t)}}function j(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function D(t){return Array.isArray(t)?t:[t]}function U(t,e){for(let n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}const B=M;function W(t){const{element:e,html:n,appendHtml:o}=t,r=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(n);o?e.innerHTML+=r:e.innerHTML=r}function F(t,e){Object.keys(e).forEach((n=>{t.style[n]=e[n]}))}function $(t,e){const n=window.getComputedStyle(t);return e.reduce(((t,e)=>(t[e]=n.getPropertyValue(e),t)),{})}function G(t,e){var n,o;let r;return t.styles&&(r=null===(n=t.styles.find((t=>"label"===t.element)))||void 0===n?void 0:n.params),t.adaptiveStyles&&!r&&(r=null===(o=t.adaptiveStyles[e].find((t=>"label"===t.element)))||void 0===o?void 0:o.params),r}function H(t,e,n,o){const r=n.querySelector(o),i=G(t,e);if(!i)return;const s=n.querySelector(".label");W({element:s,html:t.content.label}),"TOP"===i.position?(r.style.flexDirection="column",r.style.alignItems="unset",F(s,{marginRight:0,marginBottom:`${i.margin}px`})):(r.style.flexDirection="row",r.style.alignItems="center",F(s,{marginRight:`${i.margin}px`,marginBottom:0})),i.enabled?s.style.display="":s.style.display="none"}function V(t,e,n,o,r){const i=function(t,e){var n;let o;if(t.styles){const e=null===(n=t.styles.find((t=>"input"===t.element)))||void 0===n?void 0:n.styleAttributes;(null==e?void 0:e.width)&&(o=e)}if(t.adaptiveStyles&&!o){const n=t.adaptiveStyles[e].find((t=>"input"===t.element)).styleAttributes;(null==n?void 0:n.width)&&(o=n)}return o}(t,e);if(!i)return;const s=G(t,e),l=r&&s&&s.enabled&&"TOP"===s.position?r.getBoundingClientRect().height+s.margin:0;i.width&&(i.width.includes("100%")?(o.style.width="100%",n.style.width=i.width):n.style.width="auto"),i.height&&(i.height.includes("100%")?(o.style.height="100%",n.style.height=i.height):n.style.height=`${parseFloat(i.height)+l}px`)}function z(t,e,n){const o=function(t,e){const n=getComputedStyle(t)[e]||t.style.getPropertyValue(e);if(n&&n.includes("rgb")&&(!(n.split("rgb").length>2)||n.includes("#")))return n}(e,n);if(o){const e=B(o).alpha(.5).string();return t.classList.add("focus-outline-defined"),t.style.setProperty("--clFocusOutline",`3px solid ${e}`),e}return null}function Q(t){const{width:e,height:n}=t.getBoundingClientRect(),{marginBottom:o,marginTop:r,marginLeft:i,marginRight:s}=window.getComputedStyle(t);return{width:e+parseInt(i,10)+parseInt(s,10),height:n+parseInt(r,10)+parseInt(o,10)}}function q(t,e,n,o,r){switch(t.position){case"top":return{left:`${K(e,n,o,r)}px`,top:t.availableSpaceAboveTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"bottom":return{left:`${K(e,n,o,r)}px`,bottom:t.availableSpaceBelowTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"left":return{left:t.availableSpaceToTheLeftSideOfTheTrigger-e.width-t.contentWidth-t.horizontalOffset+"px",top:`${Z(0,t)}px`};case"right":return{right:t.availableSpaceToTheRightSideOfTheTrigger-t.contentWidth-t.horizontalOffset+"px",top:`${Z(0,t)}px`}}}function K(t,e,n,o){let r=n?t.x+t.width/2-e.width/2:t.x;return r<0&&(r=0),r+e.width>i.width(o)&&(r-=r+e.width-i.width(o)),r}function Z(t,e){let n=e.availableSpaceAboveTriggerElem;return e.contentHeight>e.availableSpaceBelowTriggerElem&&(n-=e.contentHeight-e.availableSpaceBelowTriggerElem),n}const J="cl-tooltip-text-styles",X=`\n .cl-tooltip-text {\n z-index: ${Number.MAX_SAFE_INTEGER};\n width: max-content;\n height: fit-content;\n visibility: hidden;\n background-color: white;\n color: #000;\n border: 1px solid rgb(194, 194, 194);\n border-radius: 5px;\n padding: 5px 10px;\n position: fixed;\n max-width: 300px;\n max-height: 100vh;\n box-shadow: 0 1px 5px rgba(0,0,0,.28);\n font-size: 14px;\n }\n\n .cl-tooltip-text[cl-tooltip-position='top']:before {\n content: "";\n position: absolute;\n top: 100%;\n left: calc(50% - 13px);\n border-width: 12px;\n border-style: solid;\n border-color: rgb(194, 194, 194) transparent transparent transparent;\n }\n \n .cl-tooltip-text[cl-tooltip-position='top']:after {\n content: "";\n position: absolute;\n top: 100%;\n left: calc(50% - 5px);\n margin-left: -8px;\n margin-top: -2px;\n border-width: 12px;\n border-style: solid;\n border-color: white transparent transparent transparent;\n }\n\n .cl-tooltip-text[cl-tooltip-position='bottom']:before {\n content: "";\n position: absolute;\n top: -24px;\n left: calc(50% - 9px);\n border-width: 12px;\n border-style: solid;\n border-color: transparent transparent rgb(194, 194, 194) transparent;\n }\n \n .cl-tooltip-text[cl-tooltip-position='bottom']:after {\n content: "";\n position: absolute;\n top: -22px;\n left: calc(50% - 4px);\n margin-left: -5px;\n margin-bottom: -2px;\n border-width: 12px;\n border-style: solid;\n border-color: transparent transparent white transparent;\n }\n`;function Y(t,e,n,o){let r;o=o||document,t.classList.add("invalid"),e.style.visibility="visible",e.onmouseenter=()=>{(function(t){if((t=t||document).head.querySelector(`#${J}`))return;const e=document.createElement("style");e.setAttribute("id",J),W({element:e,html:X}),t.head.appendChild(e)})(o),r=function(t){const e="cl-overlay-tooltip-text",n=document.getElementById(e)||document.createElement("div");return n.classList.add("cl-tooltip-text"),n.textContent!==t&&(n.textContent=t,n.style=null),n.id||(n.id=e),n}(n),o.body.append(r),r.style.visibility="visible",function(t){const{triggerElement:e,tooltipElement:n,offset:o=10,htmlDocumentObject:r}=t,s=function(t,e,n,o,r,s){const l=function(t,e,n,o,r){const s=function(t,e,n,o){const r=i.width(o),{right:s}=t.getBoundingClientRect(),l=r-n-s-i.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:Q(e).width,availableSpaceToTheLeftSideOfTheTrigger:s-n,availableSpaceToTheRightSideOfTheTrigger:l}}(t,e,n,r),l=function(t,e,n,o){const r=i.height(o),{top:s,bottom:l}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:Q(e).height,availableSpaceAboveTriggerElem:s-n,availableSpaceBelowTriggerElem:r-l-n}}(t,e,n,r);let a="undefined";const c={bottom:l.availableSpaceBelowTriggerElem>=l.contentHeight,top:l.availableSpaceAboveTriggerElem>=l.contentHeight,right:s.availableSpaceToTheRightSideOfTheTrigger>=s.contentWidth,left:s.availableSpaceToTheLeftSideOfTheTrigger>=s.contentWidth};if(c.top?a="top":c.bottom?a="bottom":c.right?a="right":c.left&&(a="left"),c[o]&&(a=o),"undefined"===a){const t=Math.max(l.availableSpaceBelowTriggerElem,l.availableSpaceAboveTriggerElem,s.availableSpaceToTheRightSideOfTheTrigger,s.availableSpaceToTheLeftSideOfTheTrigger);t===l.availableSpaceBelowTriggerElem?a="bottom":t===l.availableSpaceAboveTriggerElem?a="top":t===s.availableSpaceToTheRightSideOfTheTrigger?a="right":t===s.availableSpaceToTheLeftSideOfTheTrigger&&(a="left")}return Object.assign(Object.assign(Object.assign({},l),s),{position:a})}(t,e,n,o,s=s||document);return function(t,e){const{marginBottom:n,marginTop:o}=window.getComputedStyle(e);if("top"===t.position)F(e,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),F(e,{"margin-bottom":"0px"});else if("bottom"===t.position)F(e,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),F(e,{"margin-top":"0px"});else{const t=(parseInt(n,10)+parseInt(o,10))/2+"px";F(e,{"margin-top":t,"margin-bottom":t})}}(l,e),{coordinates:q(l,t.getBoundingClientRect(),e.getBoundingClientRect(),r,s),position:l.position}}(e,n,o,"top",!0,r);n.setAttribute("cl-tooltip-position",s.position),F(n,s.coordinates)}({triggerElement:e,tooltipElement:r,htmlDocumentObject:o})},e.onmouseleave=()=>{r&&(r.remove(),function(t){const e=(t=t||document).head.querySelector(`#${J}`);e&&e.remove()}(o))}}function tt(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}function et(t,e){return e.reduce(((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null}),null)}const nt="VIEW",ot="MODULE",rt="CONTAINER",it="INPUT",st="BUTTON",lt="CONSENT",at="COLUMN",ct="SUBSCRIBE_CONTACT",dt="REQUEST",pt="SHOW_WIDGET",ut="OPEN_LINK",ht="CLOSE_WIDGET";class mt{static sortActions(t){const e={[ht]:-1,[ut]:-2,[pt]:1,[ct]:2,[dt]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>n(t)>n(e)?-1:n(t)<n(e)?1:0))}constructor(t,e){this.config=t,this.actions=mt.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,n){this.state=t;const o=n(),i=o.getAttribute(r("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(r("type"))));let n=0;for(;e[n]&&e[n].getAttribute(r("id"))!==i;){let t=e[n].getAttribute(r("type"));if(mt.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;n++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((o.shadowRoot||o).querySelectorAll(this.config.relativeSelector)):[o],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,o;try{for(var r,i=!0,s=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(o,r){!function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)}(o,r,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(r=await s.next()).done);){o=r.value,i=!1;try{const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{i=!0}}}catch(t){e={error:t}}finally{try{i||t||!(n=s.return)||await n.call(s)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}mt.IGNORING_VIEW_ENTRY_TYPES=[st,lt,it];const bt="CLICK",gt="COMPONENT_EVENT";class yt{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class ft{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map((t=>this.actionFactory.get(t)));switch(e.forEach((t=>this.actionRegister.register(t))),t.type){case bt:return new mt(t,e);case gt:return new yt(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class vt{static generate(){let t,e="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class Et{constructor(){this.listeners=Et.createDefaultListenersState()}emit(t,e,n=null){const o=this.listeners[t];o&&Object.values(o).forEach((o=>o(e,t,n))),Object.values(this.listeners["*"]).forEach((o=>o(e,t,n)))}on(t,e){const n=vt.generate(),o=this.listeners[t];return o?o[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,o;(null===(o=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===o?void 0:o[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=Et.createDefaultListenersState()}}Et.createDefaultListenersState=()=>({"*":{}});const Ot=(t,e,n,o)=>{const{addEventListenerBase:r,addEventListener:i}=EventTarget.prototype;(r||i).call(t,e,n,o)};class St{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class Tt{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===ot?Object.assign(Object.assign({},t),Tt.moduleToContainerParams):t));return Object.assign(Object.assign({},t),{children:e})}));return Object.assign(Object.assign({},t),{views:e})}static sort(t,e){return t.index>e.index?1:-1}static reIndex(t,e){return Object.assign(Object.assign({},t),{index:e+t.index})}}Tt.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class Ct extends Et{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(Ct.changeEventName,this._isMobile)}))}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(Ct.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(Ct.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}Ct.changeEventName="CHANGE";class Rt{static set(t,e){const n=t[Rt.accumulatorPropertyName]||{};t[Rt.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[Rt.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}Rt.accumulatorPropertyName="clStyleAttributes";const At="CONTENT_LOCKER";class xt{static applyHostStyles(t,e,n=null,o){var r,i,s;const l=null===(i=null===(r=null==n?void 0:n.props)||void 0===r?void 0:r.handlers)||void 0===i?void 0:i.find((t=>"CLICK"===t.type));l&&(null===(s=l.actions)||void 0===s?void 0:s.length)&&(e.style.cursor="pointer"),t!==nt&&t!==rt&&t!==at||(e.style.display=o===At&&t===nt?"flex":"inline-flex",e.style.position="relative"),e.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(t=""){this.styles=`${this.styles} ${t}`}getStyles(){return this.styles}}class Pt{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class wt{constructor(t,e,n,o,r,i){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=r,this.httpClient=i,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((n=>{var o,r,i,s,l;const a=null===(r=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===r?void 0:r.find((t=>t.element===n)),c=(null===(i=e.styles)||void 0===i?void 0:i.find((t=>t.element===n)))||{},d=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),p=this.parseBackground(d);p.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:p.url,inlineSvgString:null,positionOptions:p.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((t=>t.text())).then((o=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))))).then((()=>{this._applyHostElementBackground(this.envUrlMaps[t].get("host"),this.getSharedCb().cssVars)})).catch((t=>{console.error(t),Pt.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t)})),this}_applyHostElementBackground(t,e){t&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(t,e){const n=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}off(){var t;null===(t=this.subscription)||void 0===t||t.off()}}const kt=new class{execute(t,e,n=null,o,r){const i={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:r};return n&&(i.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,i)}};function Nt(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class It{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}}class Lt{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}const _t="COMPONENT_RESOURCES_LOADED",Mt="FAILED_TO_LOAD_COMPONENT_RESOURCE";class jt{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(_t,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(Mt,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new Lt(this.onCounterStateUpdate)}}}const Dt=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>Dt(...t)}},Ut=Dt,Bt="props",Wt="shared",Ft="environment";function $t(t,e,n,o){const r=t=>{let i=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return i&&(o&&"function"==typeof o?o(i.getAttribute(e)):(null===(s=null==i?void 0:i.getAttribute)||void 0===s?void 0:s.call(i,e))===n)?i:i&&i.parentNode&&r(i.parentNode)||null;var s};return r(t)}const Gt="SUBMIT";function Ht(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{"element"!==n&&"classes"!==n&&(e[n]&&"object"==typeof e[n]&&!Array.isArray(e[n])?t[n]=Object.assign(Object.assign({},t[n]||{}),e[n]):t[n]=e[n])})),t):t}const Vt={DESKTOP:"desktop",MOBILE:"mobile"};function zt(t,e,n){var o;return null===(o=t[e])||void 0===o?void 0:o.find((t=>t.element===n))}function Qt(t=[]){return t.map((t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)})))}class qt extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class Kt extends HTMLElement{constructor(){var t,e;super(),this.construct=()=>{let t;const e=this.getAttribute(r("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const o=n.closest(`[${r("widget-id")}]`);let i;o&&(i=o.getAttribute(r("widget-id")));let s=new qt("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(r("path")),id:e,widgetId:i},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.detail.props,Object.assign(this,t),this.observers=Ut(Bt,Wt,Ft),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach((t=>null==t?void 0:t.off()))}},this.state=new St,this.componentEventEmitter=new Et,this.componentResourceManager=new jt(this.model.id,this.services.eventEmitter,"STATIC"===this.services.config.getConfig("entryModuleType")),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new ft(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(Bt).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),n=r("floating");t.floating&&!e.getAttribute(n)?e.setAttribute(n,"true"):!t.floating&&e.getAttribute(n)&&e.removeAttribute(n)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(Wt).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new wt(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),kt),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(Ct.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(Ft).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(Bt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(Wt).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(Ft).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${r("element")}]`)).filter((t=>!t.hasAttribute(r("component"))))],this.getElement=(t,e)=>this.getElements().find((n=>e?n.getAttribute(r("element"))===t&&n.id===e:n.getAttribute(r("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const n=this.getElements();if(!n.length)return;t=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let o=!1,r=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(Ht(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(Ht(n,t),r=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!r&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e);const o=r("type"),i="element-styles";let s=this.getRootElement().querySelector(`style[${o}="${i}"]`);s||(s=document.createElement("style"),s.setAttribute(o,i),this.getRootElement().appendChild(s)),W({element:s,html:""}),n.forEach((e=>{let n=e.getAttribute(r("element"));const o=this.getEnvironment();let i=zt(t,o,n);if(i){if(this.resizeListener.isMobile()){const e=zt(t,"desktop",n);e&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),i.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(i),s)}})),this._addLinkColor(s,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,n)=>{var o,i;const s=[];"host"===(e=Kt._resolveTogglableStylesForElementModel(e)).element&&(xt.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.push("background")));let l=e.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],Ot(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),Ot(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:Nt(e.styleAttributes,s)});if(Rt.set(t,c),this._setClassAttributes(t,e),n){if(e.hoverStyleAttributes){let o=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const n=t.tagName.toLowerCase(),r=`flip-up-animation-${e.element}`;let i=this.getRootElement().querySelector(`#${r}`);i||(i=document.createElement("style"),i.id=r,t.appendChild(i)),W({element:i,html:`\n ${n}::before {\n content: '';\n background: ${o.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),o=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}o.borderTopWidth&&"0px"!==o.borderTopWidth||delete o.borderTopColor,o.borderBottomWidth&&"0px"!==o.borderBottomWidth||delete o.borderBottomColor,o.borderLeftWidth&&"0px"!==o.borderLeftWidth||delete o.borderLeftColor,o.borderRightWidth&&"0px"!==o.borderRightWidth||delete o.borderRightColor,this._addStylesToStyleElement(n,e.element,o,`:not(.${r("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(n,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(n,this.getShared()),this.stylesAppliedToElement(t,e,n)}},this._fixMarginOverflow=t=>{const e=this.getParentComponent(),n=e&&("flex"===e.style.display||"inline-flex"===e.style.display),o="host",i=t.getAttribute(r("element"))===o;if(!n||!i)return;const s=this.getProps(),l=this.getEnvironment(),{styleAttributes:a}=zt(s.adaptiveStyles,l,o)||{};if(!a)return;const c=a.marginLeft||a.marginRight,d="100%"===a.width;if(c&&d){const e=(parseFloat(a.marginLeft)||0)+(parseFloat(a.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=t=>function(t,e){let o=t;return(o.classes||"").split(" ").filter((t=>t.startsWith(n))).forEach((t=>{var n;let r=null===(n=e.textClasses)||void 0===n?void 0:n[t];r&&(r.styleAttributes.fontFamily||(r.isHeader&&e.headerFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:e.headerFontFamily})})),!r.isHeader&&e.textFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:e.textFontFamily})}))),o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),r.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},o.placeholderStyleAttributes),r.placeholderStyleAttributes)}))})),o.styleAttributes.fontFamily||(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:e.textFontFamily})})),o}(t,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,n,o="",i)=>{const s=Object.keys(n).reduce(((t,e)=>t+` ${It.camelCaseToDashCase(e)}: ${n[e]}${i?" !important;":";"}`),"");W({element:t,html:`[${r("element")}="${e}"]${o} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{W({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,r,i;e.linkColor&&W({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&W({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(r=e.linkParams)||void 0===r?void 0:r.color}}`,appendHtml:!0}),(null===(i=e.linkParams)||void 0===i?void 0:i.removeUnderline)&&W({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(t,e)=>{Array.from(t.classList).filter((t=>t!==o("hovered")&&t!==o("focused"))).forEach((e=>{e.startsWith(n)&&t.classList.remove(e)}));const r=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",r)},this.getParentComponent=()=>$t(this.parentNode,r("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(r("path"));return t&&1===t.split(",").length?this.parentNode:$t(this.parentNode,r("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>tt(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>et(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n;const o=t.control.name;if(["email","first_name","last_name"].includes(o))return o.toUpperCase();if(t.content.label&&(null===(n=null===(e=t.adaptiveStyles.desktop.find((t=>"label"===t.element)))||void 0===e?void 0:e.params)||void 0===n?void 0:n.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return t.content.placeholder?this.capitalizeFirstLetter(t.content.placeholder):t.control.integrationName?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{switch(t.control.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find((t=>t.category===Gt));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:dt}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>this.getProps().handlers&&this.getProps().handlers.length?[...this.getProps().handlers]:[],this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(t=this.define)||void 0===t?void 0:t.manifest)||(null===(e=this.constructor.define)||void 0===e?void 0:e.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=Kt._resolveTogglableStyles(e[t]))})),e}static _resolveTogglableStyles(t){const e=Object.assign({},t),n=(t,n,o)=>{n in e&&(t.forEach((t=>{t in e&&(e[t]=e[n]?e[t]:o)})),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}const Zt=Symbol("required");var Jt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n};function Xt(){}const Yt="pending",te="valid",ee="invalid";class ne extends Kt{constructor(){super(...arguments),this._createControl=(t={},...e)=>{var{element:n}=t,o=Jt(t,["element"]);const r=this.getProps(),i=this.getModel(),s=Object.assign(Object.assign(Object.assign({},r.control),{componentId:i.id,viewIdx:i.path[0]}),o),l=this.services.form,a=[s,n,...e];return l.hasControl(r.control.name)?l.updateControl(...a):l.registerControl(...a)},this.createControlWithValidation=(t=[],e={})=>{var{element:n=this.getElement("input"),tooltipElement:o=this.getRootElement().querySelector(".input-tooltip"),validCallback:r=Xt,invalidCallback:i=Xt,pendingCallback:s=Xt,elementToListen:l=n,validationMap:a={},listenStatusChange:c=!0}=e,d=Jt(e,["element","tooltipElement","validCallback","invalidCallback","pendingCallback","elementToListen","validationMap","listenStatusChange"]);if(o&&(o.style.visibility="hidden"),!t||!Array.isArray(t))throw new Error("Validators should be an array");const p=this.getProps().control.validation,u=a[null==p?void 0:p.validator],h=t.some((t=>t[Zt])),m=!!(null==p?void 0:p.required),b=m||h,g=[...t];m&&!h&&g.unshift(function(t="REQUIRED"){const e=e=>{let n;switch(typeof e){case"string":n=e&&e.length>0;break;case"boolean":n=e;break;case"number":n=!isNaN(e);break;default:n=!!e}return{isValid:n,errorKey:n?null:t}};return e[Zt]=!0,e}()),u&&g.push(u);const y=this._prepareAsyncValidators(g),f=this._createControl({element:n,validation:{validator:"custom",required:b}},void 0,y);return c&&this._handleControlStatusChange(Object.assign({control:f,element:l,tooltipElement:o,configService:this.services.config,i18n:this.manifest.i18n,validCallback:r,invalidCallback:i,pendingCallback:s},d)),f},this._prepareAsyncValidators=(t=[])=>t.reduce(((t,e,n)=>"function"!=typeof e?(console.warn(`Validator ${n} should be a function, so it will be skipped`),t):(t[`custom_${n}`]=async(...t)=>{const n=await Promise.resolve(e(...t));return"object"==typeof n&&"isValid"in n?Object.assign(Object.assign({},n),{errorKey:n.isValid?null:n.errorKey}):{isValid:!1,errorKey:"INVALID_VALIDATOR_RESPONSE"}},t)),{}),this._handleControlStatusChange=n=>{n.control.on(t,(t=>{this._handleValidationStatus(n,t)})),n.control.on(e,(()=>{let t=Yt;switch(!0){case n.control.pending:t=Yt;break;case n.control.valid:t=te;break;default:t=ee}this._handleValidationStatus(n,t)}))},this._handleValidationStatus=(t,e)=>{const{control:n,element:o,tooltipElement:r,validCallback:i,invalidCallback:s,errorMessageMapper:l,pendingCallback:a}=t,c=this.services.config,d=this.manifest.i18n;switch(e){case te:(function(t,e){t.classList.remove("invalid"),e.style.visibility="hidden"})(o,r),i&&i();break;case ee:if(n.touched){const t=n.getErrorKeys();if(!t)break;const e=t[0];let i=function(t,e,n){const o=et(e,tt(t)).translations,r=Object.keys(o).find((t=>t.includes(n)));return r?o[r]:n}(c,d,e);l&&(i=l(e,i)),Y(o,r,i,this.htmlDocumentObject),s&&s()}break;case Yt:n.touched&&(function(t,e){e.style.visibility="hidden",t.classList.contains("invalid")&&t.classList.remove("invalid")}(o,r),a&&a())}}}}const oe={name:"SysRadioGroupComponent",componentType:"MULTIPLE_INPUT",version:"1.0.0",mappingTypes:["SELECT"],contextMenuModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]}],floatingControlsModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"input",params:{height:{hide:!0}}},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"input",params:{height:{hide:!0}}},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]}],propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",element:"input",elementProp:"styleAttributes",params:{width:{options:["fixed","hug","fill"]},height:{options:["hug","fill"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"input",showPlaceholderControl:!1,isLineSpaceAvailable:!0,isTextTransformAvailable:!0},{element:"label",displayCondition:"return !!sdk.component.getProps().styles.find(element => element.element === 'label').params.enabled",isLineSpaceAvailable:!0,isTextTransformAvailable:!0}]},{type:"CONTROL",name:"LIST_POSITION",elementProp:"styleAttributes",element:"listContainer"},{type:"CONTROL",name:"MULTIPLE_INPUT_SIZE",element:"input",params:{inputType:"RADIO"}},{type:"CONTROL",name:"BACKGROUND_MARKER_SELECTED",propPath:["styles","[element=input]","markerStyleAttributes"],params:{label:"DOCUMENT_CHOSEN_ITEM_COLOR_TITLE",property:"selectedColor",onlyColorSelection:!0,disableGradientSelection:!0,hideSwitch:!0}},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=input]","markerStyleAttributes"],params:{onlyColorSelection:!0}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=input]","markerStyleAttributes"],params:{minValue:1,maxValue:5,hideAdditionalParams:!0}},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=input]","markerStyleAttributes"]},{type:"CONTROL",name:"INPUT_LABEL",propPath:["styles","[element=label]","params"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"input",elementProp:"styleAttributes",params:{width:{options:["fixed","hug","fill"]},height:{options:["hug","fill"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"input",showPlaceholderControl:!1,isLineSpaceAvailable:!0,isTextTransformAvailable:!0},{element:"label",displayCondition:"return !!sdk.component.getProps().styles.find(element => element.element === 'label').params.enabled",isLineSpaceAvailable:!0,isTextTransformAvailable:!0}]},{type:"CONTROL",name:"LIST_POSITION",elementProp:"styleAttributes",element:"listContainer"},{type:"CONTROL",name:"MULTIPLE_INPUT_SIZE",element:"input",params:{inputType:"RADIO"}},{type:"CONTROL",name:"BACKGROUND_MARKER_SELECTED",propPath:["styles","[element=input]","markerStyleAttributes"],params:{label:"DOCUMENT_CHOSEN_ITEM_COLOR_TITLE",property:"selectedColor",onlyColorSelection:!0,disableGradientSelection:!0,hideSwitch:!0}},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=input]","markerStyleAttributes"],params:{onlyColorSelection:!0}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=input]","markerStyleAttributes"],params:{minValue:1,maxValue:5,hideAdditionalParams:!0}},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=input]","markerStyleAttributes"]},{type:"CONTROL",name:"INPUT_LABEL",propPath:["styles","[element=label]","params"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]}],general:[{type:"CONTROL",name:"INTEGRATION_FIELD_MAPPING",params:{integrationNamePropPath:["control","integrationName"],groupNamePropPath:["control","groupName"],fieldNamePropPath:["control","fieldName"],fieldTypePropPath:["control","fieldType"],validationPropPath:["control","validation"],placeholderPropPath:["content","placeholder"],labelPropPath:["content","label"],optionsPropPath:["control","options"],optionsAlphabeticSortPropPath:["control","optionsAlphabeticSort"]}},{type:"CONTROL",name:"COMPONENT_OPTIONS",params:{label:"DOCUMENT_EXPORT_ID",header:"DOCUMENT_OPTIONS_HEADER",tooltip:"DOCUMENT_OPTIONS_TOOLTIP_PART1,DOCUMENT_OPTIONS_TOOLTIP_PART2",origin:!0,optionsPropPath:["control","options"],optionsAlphabeticSortPropPath:["control","optionsAlphabeticSort"],integrationNamePropPath:["control","integrationName"]}},{type:"CONTROL",name:"INPUT_VALIDATION",params:{validationPropPath:["control","validation"],fieldTypePropPath:["control","fieldType"],required:!0}}]},autoContrast:[{slave:{element:"input",propPath:["styles","[element=input]","markerStyleAttributes","selectedColor"]},master:{element:"input",propPath:["styles","[element=input]","markerStyleAttributes","background"]},enabledPropPath:["content","selectedColorContrastEnabled"]}],i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"COMPONENT_OPTIONS",params:{label:"DOCUMENT_EXPORT_ID",header:"DOCUMENT_OPTIONS_HEADER",tooltip:"DOCUMENT_OPTIONS_TOOLTIP_PART1,DOCUMENT_OPTIONS_TOOLTIP_PART2",origin:!1,optionsPropPath:["control","options"],optionsAlphabeticSortPropPath:["control","optionsAlphabeticSort"],integrationNamePropPath:["control","integrationName"]}}]},focusableElements:["input","label"],events:{dispatch:[],listen:[]},i18nPropPaths:["content,label","control,options,[id],label"],i18n:{en:{"control,validation,validationErrors,REQUIRED":"Required field","content,label":"Title"},ru:{"control,validation,validationErrors,REQUIRED":"Обязательное поле","content,label":"Заголовок"},uk:{"control,validation,validationErrors,REQUIRED":"Обов'язкове поле","content,label":"Заголовок"},es:{"control,validation,validationErrors,REQUIRED":"Campo obligatorio","content,label":"Título"},de:{"control,validation,validationErrors,REQUIRED":"Pflichtfeld","content,label":"Titel"},fr:{"control,validation,validationErrors,REQUIRED":"Champs requis","content,label":"Titre"},it:{"control,validation,validationErrors,REQUIRED":"Campo obbligatorio","content,label":"Titolo"},pt:{"control,validation,validationErrors,REQUIRED":"Campo obrigatório","content,label":"Título"},ro:{"control,validation,validationErrors,REQUIRED":"Câmp obligatoriu","content,label":"Titlu"},bg:{"control,validation,validationErrors,REQUIRED":"Изисквано поле","content,label":"Заглавие"},cs:{"control,validation,validationErrors,REQUIRED":"Vyžadované pole","content,label":"Titul"},el:{"control,validation,validationErrors,REQUIRED":"Απαιτητό πεδίο","content,label":"Τίτλος"},nl:{"control,validation,validationErrors,REQUIRED":"Verplicht veld","content,label":"Titel"},pl:{"control,validation,validationErrors,REQUIRED":"Wymagane pole","content,label":"Tytuł"},sv:{"control,validation,validationErrors,REQUIRED":"Obligatoriskt fält","content,label":"Tytuł"},tr:{"control,validation,validationErrors,REQUIRED":"Gerekli alan","content,label":"Başlık"},ar:{"control,validation,validationErrors,REQUIRED":"الحقل المطلوب","content,label":"عنوان"},zh:{"control,validation,validationErrors,REQUIRED":"必填字段","content,label":"Title"},da:{"control,validation,validationErrors,REQUIRED":"Påkrævet felt","content,label":"Titel"},he:{"control,validation,validationErrors,REQUIRED":"שדה נדרש","content,label":"Title"},fi:{"control,validation,validationErrors,REQUIRED":"Vaadittu kenttä","content,label":"Title"},hi:{"control,validation,validationErrors,REQUIRED":"आवश्यक फील्ड","content,label":"Title"},hr:{"control,validation,validationErrors,REQUIRED":"Obavezno polje","content,label":"Title"},hu:{"control,validation,validationErrors,REQUIRED":"Kötelező mező","content,label":"Title"},id:{"control,validation,validationErrors,REQUIRED":"Bidang yang wajib diisi","content,label":"Title"},ja:{"control,validation,validationErrors,REQUIRED":"必須フィールド","content,label":"Title"},ko:{"control,validation,validationErrors,REQUIRED":"필수 칸","content,label":"Title"},no:{"control,validation,validationErrors,REQUIRED":"Obligatorisk felt","content,label":"Title"},sk:{"control,validation,validationErrors,REQUIRED":"Povinné pole","content,label":"Title"},sl:{"control,validation,validationErrors,REQUIRED":"Obvezno polje","content,label":"Title"},sr:{"control,validation,validationErrors,REQUIRED":"Obavezno polje","content,label":"Title"}},props:{content:{label:"Title",selectedColorContrastEnabled:!0},control:{name:"radioGroup",integrationName:"radioGroup",defaultValue:null,options:{option_1:{exportId:"option_1",label:"Option 1",id:"option_1",sort:0},option_2:{exportId:"option_2",label:"Option 2",id:"option_2",sort:1},option_3:{exportId:"other",label:"Other",id:"option_3",sort:2}},optionsAlphabeticSort:{enabled:!1},validation:{required:!0}},styles:[{element:"input",markerStyleAttributes:{selectedColor:"rgba(0, 0, 0, 1)",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"1px",borderTopColor:"rgba(68, 68, 68, 1)",borderBottomWidth:"1px",borderBottomColor:"rgba(68, 68, 68, 1)",borderLeftWidth:"1px",borderLeftColor:"rgba(68, 68, 68, 1)",borderRightWidth:"1px",borderRightColor:"rgba(68, 68, 68, 1)",boxShadow:"none",background:"rgba(255, 255, 255, 1)"}},{element:"label",params:{enabled:!0,position:"TOP",margin:5}}],adaptiveStyles:(re=[{element:"host",styleAttributes:{marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1},classes:""},{element:"listContainer",styleAttributes:{display:"flex",flexDirection:"column",alignItems:"start",justifyContent:"start",gap:"20px"},classes:""},{element:"input",styleAttributes:{width:"100%",minWidth:null,height:"auto",minHeight:null,background:"rgba(0, 0, 0, 0)",color:"rgba(68, 68, 68, 1)",paddingBottom:"0",paddingLeft:"0",paddingRight:"0",paddingTop:"0",_paddingEnabled:!1,textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"14px",textShadow:"none"},markerStyleAttributes:{inputSize:"22px",inputToTextGapSize:"13px",textShadow:"none"},classes:""},{element:"label",styleAttributes:{color:"rgba(68, 68, 68, 1)",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"14px",textShadow:"none"},classes:""},{element:"optionWrapper",styleAttributes:{margin:"0 3px"}}],Object.values(Vt).reduce(((t,e)=>Object.assign(t,{[e]:Qt(re)})),{[Vt.DESKTOP]:[],[Vt.MOBILE]:[]}))},metaDescription:{icon:"/SysRadioGroupComponent/assets/img/radio-btn-component-icon.svg",label:{en:"Radio",ru:"Радио",uk:"Радіо",es:"Radio",fr:"Radio",de:"Radio",it:"Radio",pt:"Rádio",ro:"Radio",bg:"Радио",cs:"Rádio",el:"Ραδιόφωνο",nl:"Radio",pl:"Radio",sv:"Radio",tr:"Radyo",ar:"الراديو",zh:"电台",da:"Radio",he:"רדיו",fi:"Radio",hi:"रेडियो",hr:"Radio",hu:"Választógomb",id:"Radio",ja:"ラジオ",ko:"라디오",no:"Radio",sk:"Rádio",sl:"Radio",sr:"Radio"}}};var re;const ie={inputSize:"22px",inputToTextGapSize:"13px",selectedColor:"rgba(0, 0, 0, 1)",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"1px",borderTopColor:"rgba(0, 0, 0, 1)",borderBottomWidth:"1px",borderBottomColor:"rgba(0, 0, 0, 1)",borderLeftWidth:"1px",borderLeftColor:"rgba(0, 0, 0, 1)",borderRightWidth:"1px",borderRightColor:"rgba(0, 0, 0, 1)",boxShadow:"none",textShadow:"none",outline:"none",border:"1px solid",background:"rgb(255, 255, 255)",backdropFilter:"none"};function se(t){return se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},se(t)}function le(t){return function(t){if(Array.isArray(t))return ce(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ae(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ae(t,e){if(t){if("string"==typeof t)return ce(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ce(t,e):void 0}}function ce(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function de(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function pe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?de(Object(n),!0).forEach((function(e){ye(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):de(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ue(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,fe(o.key),o)}}function he(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(he=function(){return!!t})()}function me(){return me="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=be(t)););return t}(t,e);if(o){var r=Object.getOwnPropertyDescriptor(o,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},me.apply(null,arguments)}function be(t){return be=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},be(t)}function ge(t,e){return ge=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ge(t,e)}function ye(t,e,n){return(e=fe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fe(t){var e=function(t){if("object"!=se(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=se(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==se(e)?e:e+""}var ve=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ye(e=function(t,e,n){return e=be(e),function(t,e){if(e&&("object"==se(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,he()?Reflect.construct(e,n||[],be(t).constructor):e.apply(t,n))}(this,t),"manifest",oe),ye(e,"registeredControl",void 0),ye(e,"controlExportId",void 0),ye(e,"markerStyleAttributes",void 0),ye(e,"getInputAdaptiveStyles",(function(){var t=e.getProps(),n=e.getEnvironment();return t.adaptiveStyles[n].filter((function(t){return"input"===t.element}))})),ye(e,"setMarkerStyleAttributes",(function(){var n=e.getInputAdaptiveStyles();if(n.length&&n[0].markerStyleAttributes){var o;e.markerStyleAttributes=pe(pe({},ie),n[0].markerStyleAttributes);var r=null===(o=e.getProps().styles)||void 0===o||null===(o=o.find((function(t){return"input"===t.element})))||void 0===o?void 0:o.markerStyleAttributes;r&&(e.markerStyleAttributes=pe(pe({},e.markerStyleAttributes),r))}else e.markerStyleAttributes=t.defaultMarkerStyleAttributes})),ye(e,"setStylesVariables",(function(t){Object.keys(e.markerStyleAttributes).forEach((function(n){return t.style.setProperty("--".concat(n),e.markerStyleAttributes[n])}))})),ye(e,"getOptions",(function(){var t,n=e.getProps().control.options,o={};Object.keys(n).forEach((function(t){var e=n[t];o[t]={id:t,label:e.label,exportId:e.exportId,sort:e.sort}}));var r=null!==(t=e.getProps().control.optionsAlphabeticSort)&&void 0!==t&&t.enabled?"label":"sort";return function(t,e,n=!1){return function(t){return[...t].reduce(((t,[e,n])=>(t[e]=n,t)),{})}(Object.entries(t).sort((([t,o],[r,i])=>function(t,e,n,o=!1){let r=t[n],i=e[n];return isNaN(r)||isNaN(i)?"string"!=typeof r||"string"!=typeof i?0:(r=r.toLowerCase(),i=i.toLowerCase(),o?i.localeCompare(r):r.localeCompare(i)):r<i?o?1:-1:r>i?o?-1:1:0}(o,i,e,n))))}(e.getProps().control.options,r)})),ye(e,"applyStylesToOptionWrapper",(function(){var t=e.getElement("listContainer"),n=zt(e.getProps().adaptiveStyles,e.getEnvironment(),"optionWrapper"),o=t.querySelectorAll(".option-wrapper");if(n){var r=Object.keys(n);o.forEach((function(t){r.forEach((function(e){t.style[e]=n[e]}))}))}else o.forEach((function(t){t.style.margin="10px 3px"})),t.style.gap="0px"})),ye(e,"createRadioGroupItemComponent",(function(t,n,o){var r=e.getHostElement(),i=document.createElement("div");i.classList.add("option-wrapper"),i.setAttribute("cl-element","optionWrapper");var s=document.createElement("label");s.classList.add("radio-mark-container");var l=document.createElement("div");l.classList.add("radio-mark-shadow"),s.appendChild(l);var a=document.createElement("input");a.setAttribute("type","radio"),a.setAttribute("name",e.controlExportId),s.appendChild(a);var c=document.createElement("span");c.classList.add("radio-mark"),s.appendChild(c);var d=document.createElement("span");if(d.classList.add("radio-box-label"),d.textContent=t.label,e.setStylesVariables(r),F(d,o),s.appendChild(d),n){var p=e.markerStyleAttributes.selectedColor;c.classList.add("radio-mark-checked"),c.style.borderColor=p,c.style.outlineColor=p,e.getHostElement().style.setProperty("--selectedColor","".concat(p)),c.style.setProperty("--borderColor","".concat(p))}else c.style.borderColor=null,c.style.outlineColor=null,e.getHostElement().style.setProperty("--borderColor","rgba(0,0,0, 0.7)");return i.appendChild(s),i})),ye(e,"updateGap",(function(){var t=e.getElement("listContainer");t&&[].concat(le(t.querySelectorAll(".radio-mark-container")),le(t.querySelectorAll(".radio-mark-shadow")),le(t.querySelectorAll(".radio-mark"))).forEach((function(t){e.updateElementSizeStyles(t,e.markerStyleAttributes)}))})),ye(e,"updateElementSizeStyles",(function(t,e){t.style.setProperty("--inputSize",e.inputSize),t.style.setProperty("--inputToTextGapSize",e.inputToTextGapSize)})),ye(e,"applyStyleToOptionLabels",(function(){var n=e.getElement("input"),o=$(n,t.radioGroupButtonMenuStyles);n.querySelectorAll(".radio-box-label").forEach((function(t){F(t,o)}))})),ye(e,"applyStylesToMarkers",(function(){e.getElement("input").querySelectorAll(".radio-mark").forEach((function(t){e.setStylesVariables(t),function(t){let e;const n=t,o=["transparent","initial"];t&&(t.style.borderColor&&!o.includes(t.style.borderColor)&&(parseFloat(t.style.borderWidth)||parseFloat(t.style.borderBottomWidth))&&(e=z(n,t,"borderColor")),!e&&t.style.getPropertyValue("--borderBottomColor")&&!o.includes(t.style.getPropertyValue("--borderBottomColor"))&&parseFloat(t.style.getPropertyValue("--borderBottomWidth"))&&(e=z(n,t,"--borderBottomColor")),e||!t.style.backgroundColor||o.includes(t.style.backgroundColor)||(e=z(n,t,"backgroundColor")),e||!t.style.color||o.includes(t.style.color)||(e=z(n,t,"color")),e||n.classList.remove("focus-outline-defined"))}(t)}))})),ye(e,"applyStylesToMarkersShadows",(function(){e.getElement("input").querySelectorAll(".radio-mark-shadow").forEach((function(t){e.setStylesVariables(t)}))})),ye(e,"unselectButtons",(function(t,e){t.querySelectorAll(".radioGroupItem").forEach((function(t){if(t.getAttribute("name")!==e){var n=t.querySelector(".radio-mark");n.classList.remove("radio-mark-checked"),n.style.borderColor=null,n.style.outlineColor=null}}))})),ye(e,"setSelectedBorderColor",(function(t){var n=e.markerStyleAttributes.selectedColor;t.style.borderColor="".concat(n),t.style.outlineColor="".concat(n),t.style.setProperty("--borderColor","".concat(n))})),ye(e,"setBorderTopWidth",(function(t){var n=e.markerStyleAttributes.borderTopWidth;t.style.setProperty("--borderTopWidth","".concat(n))})),ye(e,"createContent",(function(){var n,o=e.getElement("input"),r=$(o,t.radioGroupButtonMenuStyles),i=JSON.parse((null===(n=e.registeredControl)||void 0===n?void 0:n.getValue())||null),s=e.getOptions(),l=document.createElement("div");l.classList.add("radio-buttons-list"),l.setAttribute("cl-element","listContainer"),Object.entries(s).forEach((function(t){var n,o,a=(n=t,o=1,function(t){if(Array.isArray(t))return t}(n)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,s,l=[],a=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;a=!1}else for(;!(a=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);a=!0);}catch(t){c=!0,r=t}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw r}}return l}}(n,o)||ae(n,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],c=s[a],d=(null==i?void 0:i.id)===a,p=e.createRadioGroupItemComponent(c,d,r);p.classList.add("radioGroupItem"),p.setAttribute("name",c.id),e.setBorderTopWidth(p),"UPDATING"!==e.services.config.getConfig("entryModuleType")&&p.addEventListener("click",(function(t){t.stopPropagation(),t.preventDefault();var n=p.querySelector(".radio-mark");n.classList.add("radio-mark-checked"),e.setSelectedBorderColor(n),e.registeredControl.setValue(JSON.stringify({id:a,exportId:s[a].exportId})),e.unselectButtons(l,a)})),l.appendChild(p)})),W({element:o,html:""}),o.append(l)})),ye(e,"registerControl",(function(t){var n=t.querySelector(".radio-group-tooltip");e.registeredControl=e.createControlWithValidation([],{tooltipElement:n}),e.registeredControl.setValue(null,{silent:!0,skipValidation:!0})})),ye(e,"handleSafariHeightIssue",(function(){var t=e.getHostElement();t.style.height&&"auto"!==t.style.height||(t.style.height="fit-content")})),e.getRootElement().innerHTML="\n <style>".concat(t.componentStyle,"</style>\n ").concat(t.componentTemplate,"\n "),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ge(t,e)}(t,ne),e=t,n=[{key:"connectedCallback",value:function(){var e=this;!function(t,e,n){var o=me(be(t.prototype),"connectedCallback",n);return"function"==typeof o?function(t){return o.apply(n,t)}:o}(t,0,this)([]);var n=this.getRootElement(),o=this.getProps();this.controlExportId=o.control.integrationName,this.registerControl(n),this.observeProps((function(t,o){var r=e.getEnvironment();H(o,r,n,".label-with-radio-group-container"),V(o,r,e.getHostElement(),e.getElement("input"),e.getElement("label")),e.setMarkerStyleAttributes(),e.createContent(),e.applyAutoAdaptiveStyles(o.adaptiveStyles,o.styles),e.handleSafariHeightIssue(),e.applyStylesToMarkers(),e.applyStylesToMarkersShadows(),e.applyStylesToOptionWrapper(),e.updateGap()})),this.observeShared((function(t,n){e.applyStyleToOptionLabels(e.getProps(),e.getEnvironment())})),this.observeEnvironment((function(t,o){var r=e.getProps();e.setMarkerStyleAttributes(),e.applyStylesToMarkers(),e.applyStylesToMarkersShadows(),H(r,o,n,".label-with-radio-group-container"),V(r,o,e.getHostElement(),e.getElement("input"),e.getElement("label")),e.handleSafariHeightIssue(),e.applyStyleToOptionLabels(r,o),e.updateGap()}))}}],n&&ue(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();ye(ve,"define",{name:"sys-radio-group",model:oe.name,manifest:oe}),ye(ve,"componentStyle",'\n .main-container {\n height: 100%;\n }\n \n .label-with-radio-group-container {\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n \n .label {\n min-height: 10px;\n }\n \n .label.cl-focused {\n min-height: auto;\n }\n \n .radio-buttons-list {\n width: 100%;\n height: auto;\n text-align: inherit;\n }\n \n .radio-group-with-tooltip {\n position: relative;\n display: flex;\n height: 100%;\n width: 100%;\n cursor: pointer;\n }\n \n .invalid {\n border: 1px solid #ff0000 !important;\n }\n \n .radio-group-tooltip {\n visibility: hidden;\n position: absolute;\n right: -10px;\n top: -10px;\n z-index: 1;\n border-radius: 100%;\n width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Chrome/Safari/Opera */\n -khtml-user-select: none; /* Konqueror */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n }\n \n .radio-group-content {\n display: flex;\n /*align-items: center;*/\n /*position: absolute;*/\n height: 100%;\n width: 100%;\n /*padding: 0 35px 0 20px;*/\n cursor: pointer;\n border: 1px solid transparent;\n /*TODO*/\n /*padding: 10px;\n margin: -10px;*/\n }\n \n .option-wrapper {\n border: 0;\n align-items: center;\n outline: 0;\n text-align: inherit;\n padding: var(--borderTopWidth);\n }\n \n input {\n -moz-appearance: none;\n -webkit-appearance: none;\n -o-appearance: none;\n width: 24px;\n height: auto;\n padding: 0 10px;\n margin: 0;\n }\n \n /* The container */\n .radio-mark-container {\n cursor: pointer;\n display: flex;\n position: relative;\n padding-left: calc(var(--inputSize, 22px) + var(--inputToTextGapSize, 18px) + var(--borderTopWidth, 1));\n height: var(--inputSize, 22px);\n width: 100%;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n \n /* Hide the browser\'s default checkbox */\n .radio-mark-container input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n }\n \n .radio-mark-container .radio-box-label {\n display: block;\n }\n \n /* Create a custom radio */\n .radio-mark {\n cursor: pointer;\n position: absolute;\n top: 0;\n left: 0;\n height: var(--inputSize, 22px);\n width: var(--inputSize, 22px);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 2px;\n border-radius: 50px;\n box-shadow: 0 0 0 var(--borderTopWidth) var(--borderTopColor);\n outline: none;\n /*border-style: var(--borderStyle);\n border-color: var(--borderTopColor);\n border-width: var(--borderTopWidth);*/\n /*outline-width: var(--borderTopWidth);\n outline-color: var(--borderTopColor);\n outline-style: var(--borderStyle);*/\n z-index: 2;\n background: var(--background, rgb(256, 256, 256));\n backdrop-filter: var(--backdropFilter);\n }\n \n .radio-mark-shadow {\n box-shadow: var(--boxShadow);\n position: absolute;\n top: 0;\n left: 0;\n height: var(--inputSize, 22px);\n width: var(--inputSize, 22px);\n border-radius: 50px;\n z-index: 1;\n }\n \n .radio-mark:after {\n content: "";\n position: absolute;\n display: none;\n }\n \n .radio-mark-checked {\n box-shadow: 0 0 0 var(--borderTopWidth) var(--selectedColor);\n }\n \n .radio-mark-checked:after {\n display: block;\n }\n \n .radio-mark-container .radio-mark:after {\n width: var(--inputSize, 22px);\n height: var(--inputSize, 22px);\n border-radius: 50px;\n border-width: 1px;\n border-style: solid;\n background: var(--borderColor);\n border-color: var(--borderColor);\n scale: 0.8;\n }\n \n .radio-box-label {\n margin: 0;\n height: auto;\n min-height: 10px;\n width: auto;\n align-self: center;\n text-shadow: var(--textShadow);\n }\n \n input:focus ~ .radio-mark.focus-outline-defined {\n /*outline: var(--clFocusOutline);*/\n z-index: 3;\n outline-width: calc(var(--borderTopWidth) + 3px);\n outline-color: var(--borderTopColor);\n outline-style: solid;\n opacity: 0.7;\n }\n \n input:focus ~ .radio-mark.radio-mark-checked.focus-outline-defined {\n outline-color: var(--selectedColor);\n }\n'),ye(ve,"componentTemplate",'\n<div class="main-container">\n <div class="label-with-radio-group-container">\n <div cl-element="label"\n cl-inline-edit="content, label"\n class="label">\n </div>\n <div class="radio-group-with-tooltip">\n <div cl-element="input" class="radio-group-content">\n </div>\n <div class="radio-group-tooltip">\n <svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M1.5 13.0604C1.5 19.4116 6.6481 24.5605 13.0075 24.5605C19.353 24.5605 24.5 19.4107 24.5 13.0604C24.5 6.70865 19.3531 1.55909 13.0075 1.55908C6.64806 1.55908 1.5 6.7077 1.5 13.0604ZM12.9775 17.9668C12.7032 17.9668 12.4807 17.7443 12.4807 17.47C12.4807 17.1956 12.7032 16.9732 12.9775 16.9732C13.2519 16.9732 13.4743 17.1956 13.4743 17.47C13.4743 17.7443 13.2519 17.9668 12.9775 17.9668ZM12.9775 13.4764C12.7032 13.4764 12.4807 13.254 12.4807 12.9796L12.4807 8.48924C12.4807 8.21487 12.7032 7.99245 12.9775 7.99245C13.2519 7.99245 13.4743 8.21487 13.4743 8.48924L13.4743 12.9796C13.4743 13.254 13.2519 13.4764 12.9775 13.4764Z" fill="#FF0000" stroke="white" stroke-width="2"></path>\n </svg>\n </div>\n </div>\n </div>\n</div>\n'),ye(ve,"radioGroupButtonMenuStyles",["color","font-family","font-size","letter-spacing","text-shadow","font-weight","line-height","text-align"]),ye(ve,"defaultMarkerStyleAttributes",ie);export{ve as default};window.clComponentClass_SysRadioGroupComponent=ve;
1
+ const t="validationStatusChanged",e="touchedStatusChanged",n="cl-";function o(t){return n+t}function r(t){return"cl-"+t}class i{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){return t=t||document,Math.max(t.documentElement.clientWidth,t.defaultView.innerWidth||0)}static height(t){return t=t||document,Math.max(t.documentElement.clientHeight,t.defaultView.innerHeight||0)}static scrollbarWidth(t){return(t=t||document).defaultView.innerWidth-t.documentElement.clientWidth}}var s=[];for(var l in{transparent:"#0000"})s.push(l);var a="\\s*([.\\d%]+)\\s*",c="\\("+[a,a,a]+"(?:,\\s*([.\\d]+)\\s*)?\\)",d="(?:rgb)a?",p="("+s.join("|")+")";function u(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}RegExp(d+c,"i"),RegExp([p,"(?:#([a-f0-9]{3,8}))",d+c,"(?:hsl)a?"+c].join("|"),"gi");var h=Array.prototype.concat,m=Array.prototype.slice,b=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var r=t[n];u(r)?e=h.call(e,m.call(r)):e.push(r)}return e};b.wrap=function(t){return function(){return t(b(arguments))}};const g=b;var y={},f=Object.hasOwnProperty,v=Object.create(null);for(var E in y)f.call(y,E)&&(v[y[E]]=E);var O={to:{},get:{}};function S(t,e,n){return Math.min(Math.max(e,t),n)}O.get=function(t){var e,n;return"hsl"===t.substring(0,3).toLowerCase()?(e=O.get.hsl(t),n="hsl"):(e=O.get.rgb(t),n="rgb"),e?{model:n,value:e}:null},O.get.rgb=function(t){if(!t)return null;var e,n,o,r=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){var i=2*n;r[n]=parseInt(e.slice(i,i+2),16)}o&&(r[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],n=0;n<3;n++)r[n]=parseInt(e[n]+e[n],16);o&&(r[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)r[n]=parseInt(e[n+1],0);e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:f.call(y,e[1])?((r=y[e[1]])[3]=1,r):null:null;for(n=0;n<3;n++)r[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}for(n=0;n<3;n++)r[n]=S(r[n],0,255);return r[3]=S(r[3],0,1),r},O.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,S(parseFloat(e[2]),0,100),S(parseFloat(e[3]),0,100),S(isNaN(n)?1:n,0,1)]}return null},O.to.rgb=function(){var t=g(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},O.to.hsl=function(){var t=g(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};const T=O,C={},R={};for(const t of Object.keys(C))R[C[t]]=t;const A={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const t of Object.keys(A)){if(!("channels"in A[t]))throw new Error("missing channels property: "+t);if(!("labels"in A[t]))throw new Error("missing channel labels property: "+t);if(A[t].labels.length!==A[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=A[t];delete A[t].channels,delete A[t].labels,Object.defineProperty(A[t],"channels",{value:e}),Object.defineProperty(A[t],"labels",{value:n})}A.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,r=Math.min(e,n,o),i=Math.max(e,n,o),s=i-r;let l,a;i===r?l=0:e===i?l=(n-o)/s:n===i?l=2+(o-e)/s:o===i&&(l=4+(e-n)/s),l=Math.min(60*l,360),l<0&&(l+=360);const c=(r+i)/2;return a=i===r?0:c<=.5?s/(i+r):s/(2-i-r),[l,100*a,100*c]},A.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,o=t[2]/100;let r,i,s;if(0===n)return s=255*o,[s,s,s];r=o<.5?o*(1+n):o+n-o*n;const l=2*o-r,a=[0,0,0];for(let t=0;t<3;t++)i=e+1/3*-(t-1),i<0&&i++,i>1&&i--,s=6*i<1?l+6*(r-l)*i:2*i<1?r:3*i<2?l+(r-l)*(2/3-i)*6:l,a[t]=255*s;return a};const x=A;function P(t,e){return function(n){return e(t(n))}}function w(t,e){const n=[e[t].parent,t];let o=x[e[t].parent][t],r=e[t].parent;for(;e[r].parent;)n.unshift(e[r].parent),o=P(x[e[r].parent][r],o),r=e[r].parent;return o.conversion=n,o}const k={};Object.keys(x).forEach((t=>{k[t]={},Object.defineProperty(k[t],"channels",{value:x[t].channels}),Object.defineProperty(k[t],"labels",{value:x[t].labels});const e=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(x);for(let n=e.length,o=0;o<n;o++)t[e[o]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;){const t=n.pop(),o=Object.keys(x[t]);for(let r=o.length,i=0;i<r;i++){const r=o[i],s=e[r];-1===s.distance&&(s.distance=e[t].distance+1,s.parent=t,n.unshift(r))}}return e}(t),n={},o=Object.keys(e);for(let t=o.length,r=0;r<t;r++){const t=o[r];null!==e[t].parent&&(n[t]=w(t,e))}return n}(t);Object.keys(e).forEach((n=>{const o=e[n];k[t][n]=function(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const o=t(e);if("object"==typeof o)for(let t=o.length,e=0;e<t;e++)o[e]=Math.round(o[e]);return o};return"conversion"in t&&(e.conversion=t.conversion),e}(o),k[t][n].raw=function(t){const e=function(...e){const n=e[0];return null==n?n:(n.length>1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(o)}))}));const N=k,I=["keyword","gray","hex"],L={};for(const t of Object.keys(N))L[[...N[t].labels].sort().join("")]=t;const _={};function M(t,e){if(!(this instanceof M))return new M(t,e);if(e&&e in I&&(e=null),e&&!(e in N))throw new Error("Unknown model: "+e);let n,o;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof M)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const e=T.get(t);if(null===e)throw new Error("Unable to parse color from string: "+t);this.model=e.model,o=N[this.model].channels,this.color=e.value.slice(0,o),this.valpha="number"==typeof e.value[o]?e.value[o]:1}else if(t.length>0){this.model=e||"rgb",o=N[this.model].channels;const n=Array.prototype.slice.call(t,0,o);this.color=U(n,o),this.valpha="number"==typeof t[o]?t[o]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const e=Object.keys(t);"alpha"in t&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const o=e.sort().join("");if(!(o in L))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=L[o];const{labels:r}=N[this.model],i=[];for(n=0;n<r.length;n++)i.push(t[r[n]]);this.color=U(i)}if(_[this.model])for(o=N[this.model].channels,n=0;n<o;n++){const t=_[this.model][n];t&&(this.color[n]=t(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}M.prototype={toString(){return this.string()},string(t){let e=this.model in T.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return T.to[e.model](n)},round(t){return t=Math.max(t||0,0),new M([...this.color.map(j(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new M([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},lighten(t){const e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){const e=this.hsl();return e.color[2]-=e.color[2]*t,e}};for(const t of Object.keys(N)){if(I.includes(t))continue;const{channels:e}=N[t];M.prototype[t]=function(...e){return this.model===t?new M(this):e.length>0?new M(e,t):new M([...D(N[this.model][t].raw(this.color)),this.valpha],t)},M[t]=function(...n){let o=n[0];return"number"==typeof o&&(o=U(n,e)),new M(o,t)}}function j(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function D(t){return Array.isArray(t)?t:[t]}function U(t,e){for(let n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}const B=M;function W(t){const{element:e,html:n,appendHtml:o}=t,r=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(n);o?e.innerHTML+=r:e.innerHTML=r}function F(t,e){Object.keys(e).forEach((n=>{t.style[n]=e[n]}))}function $(t,e){const n=window.getComputedStyle(t);return e.reduce(((t,e)=>(t[e]=n.getPropertyValue(e),t)),{})}function G(t,e){var n,o;let r;return t.styles&&(r=null===(n=t.styles.find((t=>"label"===t.element)))||void 0===n?void 0:n.params),t.adaptiveStyles&&!r&&(r=null===(o=t.adaptiveStyles[e].find((t=>"label"===t.element)))||void 0===o?void 0:o.params),r}function H(t,e,n,o){const r=n.querySelector(o),i=G(t,e);if(!i)return;const s=n.querySelector(".label");W({element:s,html:t.content.label}),"TOP"===i.position?(r.style.flexDirection="column",r.style.alignItems="unset",F(s,{marginRight:0,marginBottom:`${i.margin}px`})):(r.style.flexDirection="row",r.style.alignItems="center",F(s,{marginRight:`${i.margin}px`,marginBottom:0})),i.enabled?s.style.display="":s.style.display="none"}function z(t,e,n,o,r){const i=function(t,e){var n;let o;if(t.styles){const e=null===(n=t.styles.find((t=>"input"===t.element)))||void 0===n?void 0:n.styleAttributes;(null==e?void 0:e.width)&&(o=e)}if(t.adaptiveStyles&&!o){const n=t.adaptiveStyles[e].find((t=>"input"===t.element)).styleAttributes;(null==n?void 0:n.width)&&(o=n)}return o}(t,e);if(!i)return;const s=G(t,e),l=r&&s&&s.enabled&&"TOP"===s.position?r.getBoundingClientRect().height+s.margin:0;i.width&&(i.width.includes("100%")?(o.style.width="100%",n.style.width=i.width):n.style.width="auto"),i.height&&(i.height.includes("100%")?(o.style.height="100%",n.style.height=i.height):n.style.height=`${parseFloat(i.height)+l}px`)}function V(t,e,n){const o=function(t,e){const n=getComputedStyle(t)[e]||t.style.getPropertyValue(e);if(n&&n.includes("rgb")&&(!(n.split("rgb").length>2)||n.includes("#")))return n}(e,n);if(o){const e=B(o).alpha(.5).string();return t.classList.add("focus-outline-defined"),t.style.setProperty("--clFocusOutline",`3px solid ${e}`),e}return null}function Q(t){const{width:e,height:n}=t.getBoundingClientRect(),{marginBottom:o,marginTop:r,marginLeft:i,marginRight:s}=window.getComputedStyle(t);return{width:e+parseInt(i,10)+parseInt(s,10),height:n+parseInt(r,10)+parseInt(o,10)}}function q(t,e,n,o,r){switch(t.position){case"top":return{left:`${K(e,n,o,r)}px`,top:t.availableSpaceAboveTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"bottom":return{left:`${K(e,n,o,r)}px`,bottom:t.availableSpaceBelowTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"left":return{left:t.availableSpaceToTheLeftSideOfTheTrigger-e.width-t.contentWidth-t.horizontalOffset+"px",top:`${Z(0,t)}px`};case"right":return{right:t.availableSpaceToTheRightSideOfTheTrigger-t.contentWidth-t.horizontalOffset+"px",top:`${Z(0,t)}px`}}}function K(t,e,n,o){let r=n?t.x+t.width/2-e.width/2:t.x;return r<0&&(r=0),r+e.width>i.width(o)&&(r-=r+e.width-i.width(o)),r}function Z(t,e){let n=e.availableSpaceAboveTriggerElem;return e.contentHeight>e.availableSpaceBelowTriggerElem&&(n-=e.contentHeight-e.availableSpaceBelowTriggerElem),n}const J="cl-tooltip-text-styles",X=`\n .cl-tooltip-text {\n z-index: ${Number.MAX_SAFE_INTEGER};\n width: max-content;\n height: fit-content;\n visibility: hidden;\n background-color: white;\n color: #000;\n border: 1px solid rgb(194, 194, 194);\n border-radius: 5px;\n padding: 5px 10px;\n position: fixed;\n max-width: 300px;\n max-height: 100vh;\n box-shadow: 0 1px 5px rgba(0,0,0,.28);\n font-size: 14px;\n }\n\n .cl-tooltip-text[cl-tooltip-position='top']:before {\n content: "";\n position: absolute;\n top: 100%;\n left: calc(50% - 13px);\n border-width: 12px;\n border-style: solid;\n border-color: rgb(194, 194, 194) transparent transparent transparent;\n }\n \n .cl-tooltip-text[cl-tooltip-position='top']:after {\n content: "";\n position: absolute;\n top: 100%;\n left: calc(50% - 5px);\n margin-left: -8px;\n margin-top: -2px;\n border-width: 12px;\n border-style: solid;\n border-color: white transparent transparent transparent;\n }\n\n .cl-tooltip-text[cl-tooltip-position='bottom']:before {\n content: "";\n position: absolute;\n top: -24px;\n left: calc(50% - 9px);\n border-width: 12px;\n border-style: solid;\n border-color: transparent transparent rgb(194, 194, 194) transparent;\n }\n \n .cl-tooltip-text[cl-tooltip-position='bottom']:after {\n content: "";\n position: absolute;\n top: -22px;\n left: calc(50% - 4px);\n margin-left: -5px;\n margin-bottom: -2px;\n border-width: 12px;\n border-style: solid;\n border-color: transparent transparent white transparent;\n }\n`;function Y(t,e,n,o){let r;o=o||document,t.classList.add("invalid"),e.style.visibility="visible",e.onmouseenter=()=>{(function(t){if((t=t||document).head.querySelector(`#${J}`))return;const e=document.createElement("style");e.setAttribute("id",J),W({element:e,html:X}),t.head.appendChild(e)})(o),r=function(t){const e="cl-overlay-tooltip-text",n=document.getElementById(e)||document.createElement("div");return n.classList.add("cl-tooltip-text"),n.textContent!==t&&(n.textContent=t,n.style=null),n.id||(n.id=e),n}(n),o.body.append(r),r.style.visibility="visible",function(t){const{triggerElement:e,tooltipElement:n,offset:o=10,htmlDocumentObject:r}=t,s=function(t,e,n,o,r,s){const l=function(t,e,n,o,r){const s=function(t,e,n,o){const r=i.width(o),{right:s}=t.getBoundingClientRect(),l=r-n-s-i.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:Q(e).width,availableSpaceToTheLeftSideOfTheTrigger:s-n,availableSpaceToTheRightSideOfTheTrigger:l}}(t,e,n,r),l=function(t,e,n,o){const r=i.height(o),{top:s,bottom:l}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:Q(e).height,availableSpaceAboveTriggerElem:s-n,availableSpaceBelowTriggerElem:r-l-n}}(t,e,n,r);let a="undefined";const c={bottom:l.availableSpaceBelowTriggerElem>=l.contentHeight,top:l.availableSpaceAboveTriggerElem>=l.contentHeight,right:s.availableSpaceToTheRightSideOfTheTrigger>=s.contentWidth,left:s.availableSpaceToTheLeftSideOfTheTrigger>=s.contentWidth};if(c.top?a="top":c.bottom?a="bottom":c.right?a="right":c.left&&(a="left"),c[o]&&(a=o),"undefined"===a){const t=Math.max(l.availableSpaceBelowTriggerElem,l.availableSpaceAboveTriggerElem,s.availableSpaceToTheRightSideOfTheTrigger,s.availableSpaceToTheLeftSideOfTheTrigger);t===l.availableSpaceBelowTriggerElem?a="bottom":t===l.availableSpaceAboveTriggerElem?a="top":t===s.availableSpaceToTheRightSideOfTheTrigger?a="right":t===s.availableSpaceToTheLeftSideOfTheTrigger&&(a="left")}return Object.assign(Object.assign(Object.assign({},l),s),{position:a})}(t,e,n,o,s=s||document);return function(t,e){const{marginBottom:n,marginTop:o}=window.getComputedStyle(e);if("top"===t.position)F(e,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),F(e,{"margin-bottom":"0px"});else if("bottom"===t.position)F(e,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),F(e,{"margin-top":"0px"});else{const t=(parseInt(n,10)+parseInt(o,10))/2+"px";F(e,{"margin-top":t,"margin-bottom":t})}}(l,e),{coordinates:q(l,t.getBoundingClientRect(),e.getBoundingClientRect(),r,s),position:l.position}}(e,n,o,"top",!0,r);n.setAttribute("cl-tooltip-position",s.position),F(n,s.coordinates)}({triggerElement:e,tooltipElement:r,htmlDocumentObject:o})},e.onmouseleave=()=>{r&&(r.remove(),function(t){const e=(t=t||document).head.querySelector(`#${J}`);e&&e.remove()}(o))}}function tt(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}function et(t,e){return e.reduce(((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null}),null)}const nt="VIEW",ot="MODULE",rt="CONTAINER",it="INPUT",st="BUTTON",lt="CONSENT",at="COLUMN",ct="SUBSCRIBE_CONTACT",dt="REQUEST",pt="SHOW_WIDGET",ut="OPEN_LINK",ht="CLOSE_WIDGET";class mt{static sortActions(t){const e={[ht]:-1,[ut]:-2,[pt]:1,[ct]:2,[dt]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>n(t)>n(e)?-1:n(t)<n(e)?1:0))}constructor(t,e){this.config=t,this.actions=mt.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,n){this.state=t;const o=n(),i=o.getAttribute(r("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(r("type"))));let n=0;for(;e[n]&&e[n].getAttribute(r("id"))!==i;){let t=e[n].getAttribute(r("type"));if(mt.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;n++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((o.shadowRoot||o).querySelectorAll(this.config.relativeSelector)):[o],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,o;try{for(var r,i=!0,s=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(o,r){!function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)}(o,r,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(r=await s.next()).done);){o=r.value,i=!1;try{const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{i=!0}}}catch(t){e={error:t}}finally{try{i||t||!(n=s.return)||await n.call(s)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}mt.IGNORING_VIEW_ENTRY_TYPES=[st,lt,it];const bt="CLICK",gt="COMPONENT_EVENT";class yt{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class ft{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map((t=>this.actionFactory.get(t)));switch(e.forEach((t=>this.actionRegister.register(t))),t.type){case bt:return new mt(t,e);case gt:return new yt(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class vt{static generate(){let t,e="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class Et{constructor(){this.listeners=Et.createDefaultListenersState()}emit(t,e,n=null){const o=this.listeners[t];o&&Object.values(o).forEach((o=>o(e,t,n))),Object.values(this.listeners["*"]).forEach((o=>o(e,t,n)))}on(t,e){const n=vt.generate(),o=this.listeners[t];return o?o[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,o;(null===(o=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===o?void 0:o[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=Et.createDefaultListenersState()}}Et.createDefaultListenersState=()=>({"*":{}});const Ot=(t,e,n,o)=>{const{addEventListenerBase:r,addEventListener:i}=EventTarget.prototype;(r||i).call(t,e,n,o)};class St{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class Tt{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===ot?Object.assign(Object.assign({},t),Tt.moduleToContainerParams):t));return Object.assign(Object.assign({},t),{children:e})}));return Object.assign(Object.assign({},t),{views:e})}static sort(t,e){return t.index>e.index?1:-1}static reIndex(t,e){return Object.assign(Object.assign({},t),{index:e+t.index})}}Tt.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class Ct extends Et{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(Ct.changeEventName,this._isMobile)}))}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(Ct.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(Ct.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}Ct.changeEventName="CHANGE";class Rt{static set(t,e){const n=t[Rt.accumulatorPropertyName]||{};t[Rt.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[Rt.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}Rt.accumulatorPropertyName="clStyleAttributes";const At="CONTENT_LOCKER";class xt{static applyHostStyles(t,e,n=null,o){var r,i,s;const l=null===(i=null===(r=null==n?void 0:n.props)||void 0===r?void 0:r.handlers)||void 0===i?void 0:i.find((t=>"CLICK"===t.type));l&&(null===(s=l.actions)||void 0===s?void 0:s.length)&&(e.style.cursor="pointer"),t!==nt&&t!==rt&&t!==at||(e.style.display=o===At&&t===nt?"flex":"inline-flex",e.style.position="relative"),e.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(t=""){this.styles=`${this.styles} ${t}`}getStyles(){return this.styles}}class Pt{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class wt{constructor(t,e,n,o,r,i){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=r,this.httpClient=i,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((n=>{var o,r,i,s,l;const a=null===(r=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===r?void 0:r.find((t=>t.element===n)),c=(null===(i=e.styles)||void 0===i?void 0:i.find((t=>t.element===n)))||{},d=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),p=this.parseBackground(d);p.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:p.url,inlineSvgString:null,positionOptions:p.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((t=>t.text())).then((o=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))))).then((()=>{var e;this._applyHostElementBackground(this.envUrlMaps[t].get("host"),null===(e=this.getSharedCb().theme)||void 0===e?void 0:e.schema)})).catch((t=>{console.error(t),Pt.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("THEME_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)})),this}_applyHostElementBackground(t,e={}){t&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(t,e){const n=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e.accent);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}}const kt=new class{execute(t,e,n=null,o,r){const i={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:r};return n&&(i.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,i)}};function Nt(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class It{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}}class Lt{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}const _t="COMPONENT_RESOURCES_LOADED",Mt="FAILED_TO_LOAD_COMPONENT_RESOURCE";class jt{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(_t,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(Mt,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new Lt(this.onCounterStateUpdate)}}}const Dt=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>Dt(...t)}},Ut=Dt,Bt="props",Wt="shared",Ft="environment";function $t(t,e,n,o){const r=t=>{let i=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return i&&(o&&"function"==typeof o?o(i.getAttribute(e)):(null===(s=null==i?void 0:i.getAttribute)||void 0===s?void 0:s.call(i,e))===n)?i:i&&i.parentNode&&r(i.parentNode)||null;var s};return r(t)}const Gt="SUBMIT";function Ht(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{"element"!==n&&"classes"!==n&&(e[n]&&"object"==typeof e[n]&&!Array.isArray(e[n])?t[n]=Object.assign(Object.assign({},t[n]||{}),e[n]):t[n]=e[n])})),t):t}const zt={DESKTOP:"desktop",MOBILE:"mobile"};function Vt(t,e,n){var o;return null===(o=t[e])||void 0===o?void 0:o.find((t=>t.element===n))}function Qt(t=[]){return t.map((t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)})))}class qt extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class Kt extends HTMLElement{constructor(){var t,e;super(),this.construct=()=>{let t;const e=this.getAttribute(r("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const o=n.closest(`[${r("widget-id")}]`);let i;o&&(i=o.getAttribute(r("widget-id")));let s=new qt("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(r("path")),id:e,widgetId:i},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.detail.props,Object.assign(this,t),this.observers=Ut(Bt,Wt,Ft),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach((t=>null==t?void 0:t.off()))}},this.state=new St,this.componentEventEmitter=new Et,this.componentResourceManager=new jt(this.model.id,this.services.eventEmitter,"STATIC"===this.services.config.getConfig("entryModuleType")),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new ft(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(Bt).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),n=r("floating");t.floating&&!e.getAttribute(n)?e.setAttribute(n,"true"):!t.floating&&e.getAttribute(n)&&e.removeAttribute(n)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(Wt).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new wt(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),kt),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(Ct.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(Ft).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(Bt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(Wt).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(Ft).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${r("element")}]`)).filter((t=>!t.hasAttribute(r("component"))))],this.getElement=(t,e)=>this.getElements().find((n=>e?n.getAttribute(r("element"))===t&&n.id===e:n.getAttribute(r("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const n=this.getElements();if(!n.length)return;t=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let o=!1,r=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(Ht(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(Ht(n,t),r=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!r&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e);const o=r("type"),i="element-styles";let s=this.getRootElement().querySelector(`style[${o}="${i}"]`);s||(s=document.createElement("style"),s.setAttribute(o,i),this.getRootElement().appendChild(s)),W({element:s,html:""}),n.forEach((e=>{let n=e.getAttribute(r("element"));const o=this.getEnvironment();let i=Vt(t,o,n);if(i){if(this.resizeListener.isMobile()){const e=Vt(t,"desktop",n);e&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),i.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(i),s)}})),this._addLinkColor(s,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,n)=>{var o,i;const s=[];"host"===(e=Kt._resolveTogglableStylesForElementModel(e)).element&&(xt.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.push("background")));let l=e.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],Ot(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),Ot(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:Nt(e.styleAttributes,s)});if(Rt.set(t,c),this._setClassAttributes(t,e),n){if(e.hoverStyleAttributes){let o=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const n=t.tagName.toLowerCase(),r=`flip-up-animation-${e.element}`;let i=this.getRootElement().querySelector(`#${r}`);i||(i=document.createElement("style"),i.id=r,t.appendChild(i)),W({element:i,html:`\n ${n}::before {\n content: '';\n background: ${o.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),o=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}o.borderTopWidth&&"0px"!==o.borderTopWidth||delete o.borderTopColor,o.borderBottomWidth&&"0px"!==o.borderBottomWidth||delete o.borderBottomColor,o.borderLeftWidth&&"0px"!==o.borderLeftWidth||delete o.borderLeftColor,o.borderRightWidth&&"0px"!==o.borderRightWidth||delete o.borderRightColor,this._addStylesToStyleElement(n,e.element,o,`:not(.${r("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(n,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(n,this.getShared()),this.stylesAppliedToElement(t,e,n)}},this._fixMarginOverflow=t=>{const e=this.getParentComponent(),n=e&&("flex"===e.style.display||"inline-flex"===e.style.display),o="host",i=t.getAttribute(r("element"))===o;if(!n||!i)return;const s=this.getProps(),l=this.getEnvironment(),{styleAttributes:a}=Vt(s.adaptiveStyles,l,o)||{};if(!a)return;const c=a.marginLeft||a.marginRight,d="100%"===a.width;if(c&&d){const e=(parseFloat(a.marginLeft)||0)+(parseFloat(a.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=t=>function(t,e){let o=t;return(o.classes||"").split(" ").filter((t=>t.startsWith(n))).forEach((t=>{var n;let r=null===(n=e.textClasses)||void 0===n?void 0:n[t];r&&(r.styleAttributes.fontFamily||(r.isHeader&&e.headerFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:e.headerFontFamily})})),!r.isHeader&&e.textFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:e.textFontFamily})}))),o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),r.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},o.placeholderStyleAttributes),r.placeholderStyleAttributes)}))})),o.styleAttributes.fontFamily||(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:e.textFontFamily})})),o}(t,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,n,o="",i)=>{const s=Object.keys(n).reduce(((t,e)=>t+` ${It.camelCaseToDashCase(e)}: ${n[e]}${i?" !important;":";"}`),"");W({element:t,html:`[${r("element")}="${e}"]${o} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{W({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,r,i;e.linkColor&&W({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&W({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(r=e.linkParams)||void 0===r?void 0:r.color}}`,appendHtml:!0}),(null===(i=e.linkParams)||void 0===i?void 0:i.removeUnderline)&&W({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(t,e)=>{Array.from(t.classList).filter((t=>t!==o("hovered")&&t!==o("focused"))).forEach((e=>{e.startsWith(n)&&t.classList.remove(e)}));const r=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",r)},this.getParentComponent=()=>$t(this.parentNode,r("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(r("path"));return t&&1===t.split(",").length?this.parentNode:$t(this.parentNode,r("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>tt(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>et(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n;const o=t.control.name;if(["email","first_name","last_name"].includes(o))return o.toUpperCase();if(t.content.label&&(null===(n=null===(e=t.adaptiveStyles.desktop.find((t=>"label"===t.element)))||void 0===e?void 0:e.params)||void 0===n?void 0:n.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return t.content.placeholder?this.capitalizeFirstLetter(t.content.placeholder):t.control.integrationName?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{switch(t.control.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find((t=>t.category===Gt));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:dt}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>this.getProps().handlers&&this.getProps().handlers.length?[...this.getProps().handlers]:[],this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(t=this.define)||void 0===t?void 0:t.manifest)||(null===(e=this.constructor.define)||void 0===e?void 0:e.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=Kt._resolveTogglableStyles(e[t]))})),e}static _resolveTogglableStyles(t){const e=Object.assign({},t),n=(t,n,o)=>{n in e&&(t.forEach((t=>{t in e&&(e[t]=e[n]?e[t]:o)})),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}const Zt=Symbol("required");var Jt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n};function Xt(){}const Yt="pending",te="valid",ee="invalid";class ne extends Kt{constructor(){super(...arguments),this._createControl=(t={},...e)=>{var{element:n}=t,o=Jt(t,["element"]);const r=this.getProps(),i=this.getModel(),s=Object.assign(Object.assign(Object.assign({},r.control),{componentId:i.id,viewIdx:i.path[0]}),o),l=this.services.form,a=[s,n,...e];return l.hasControl(r.control.name)?l.updateControl(...a):l.registerControl(...a)},this.createControlWithValidation=(t=[],e={})=>{var{element:n=this.getElement("input"),tooltipElement:o=this.getRootElement().querySelector(".input-tooltip"),validCallback:r=Xt,invalidCallback:i=Xt,pendingCallback:s=Xt,elementToListen:l=n,validationMap:a={},listenStatusChange:c=!0}=e,d=Jt(e,["element","tooltipElement","validCallback","invalidCallback","pendingCallback","elementToListen","validationMap","listenStatusChange"]);if(o&&(o.style.visibility="hidden"),!t||!Array.isArray(t))throw new Error("Validators should be an array");const p=this.getProps().control.validation,u=a[null==p?void 0:p.validator],h=t.some((t=>t[Zt])),m=!!(null==p?void 0:p.required),b=m||h,g=[...t];m&&!h&&g.unshift(function(t="REQUIRED"){const e=e=>{let n;switch(typeof e){case"string":n=e&&e.length>0;break;case"boolean":n=e;break;case"number":n=!isNaN(e);break;default:n=!!e}return{isValid:n,errorKey:n?null:t}};return e[Zt]=!0,e}()),u&&g.push(u);const y=this._prepareAsyncValidators(g),f=this._createControl({element:n,validation:{validator:"custom",required:b}},void 0,y);return c&&this._handleControlStatusChange(Object.assign({control:f,element:l,tooltipElement:o,configService:this.services.config,i18n:this.manifest.i18n,validCallback:r,invalidCallback:i,pendingCallback:s},d)),f},this._prepareAsyncValidators=(t=[])=>t.reduce(((t,e,n)=>"function"!=typeof e?(console.warn(`Validator ${n} should be a function, so it will be skipped`),t):(t[`custom_${n}`]=async(...t)=>{const n=await Promise.resolve(e(...t));return"object"==typeof n&&"isValid"in n?Object.assign(Object.assign({},n),{errorKey:n.isValid?null:n.errorKey}):{isValid:!1,errorKey:"INVALID_VALIDATOR_RESPONSE"}},t)),{}),this._handleControlStatusChange=n=>{n.control.on(t,(t=>{this._handleValidationStatus(n,t)})),n.control.on(e,(()=>{let t=Yt;switch(!0){case n.control.pending:t=Yt;break;case n.control.valid:t=te;break;default:t=ee}this._handleValidationStatus(n,t)}))},this._handleValidationStatus=(t,e)=>{const{control:n,element:o,tooltipElement:r,validCallback:i,invalidCallback:s,errorMessageMapper:l,pendingCallback:a}=t,c=this.services.config,d=this.manifest.i18n;switch(e){case te:(function(t,e){t.classList.remove("invalid"),e.style.visibility="hidden"})(o,r),i&&i();break;case ee:if(n.touched){const t=n.getErrorKeys();if(!t)break;const e=t[0];let i=function(t,e,n){const o=et(e,tt(t)).translations,r=Object.keys(o).find((t=>t.includes(n)));return r?o[r]:n}(c,d,e);l&&(i=l(e,i)),Y(o,r,i,this.htmlDocumentObject),s&&s()}break;case Yt:n.touched&&(function(t,e){e.style.visibility="hidden",t.classList.contains("invalid")&&t.classList.remove("invalid")}(o,r),a&&a())}}}}const oe={name:"SysRadioGroupComponent",componentType:"MULTIPLE_INPUT",version:"1.0.0",mappingTypes:["SELECT"],contextMenuModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]}],floatingControlsModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"input",params:{height:{hide:!0}}},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"input",params:{height:{hide:!0}}},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]}],propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",element:"input",elementProp:"styleAttributes",params:{width:{options:["fixed","hug","fill"]},height:{options:["hug","fill"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"input",showPlaceholderControl:!1,isLineSpaceAvailable:!0,isTextTransformAvailable:!0},{element:"label",displayCondition:"return !!sdk.component.getProps().styles.find(element => element.element === 'label').params.enabled",isLineSpaceAvailable:!0,isTextTransformAvailable:!0}]},{type:"CONTROL",name:"LIST_POSITION",elementProp:"styleAttributes",element:"listContainer"},{type:"CONTROL",name:"MULTIPLE_INPUT_SIZE",element:"input",params:{inputType:"RADIO"}},{type:"CONTROL",name:"BACKGROUND_MARKER_SELECTED",propPath:["styles","[element=input]","markerStyleAttributes"],params:{label:"DOCUMENT_CHOSEN_ITEM_COLOR_TITLE",property:"selectedColor",onlyColorSelection:!0,disableGradientSelection:!0,hideSwitch:!0}},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=input]","markerStyleAttributes"],params:{onlyColorSelection:!0}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=input]","markerStyleAttributes"],params:{minValue:1,maxValue:5,hideAdditionalParams:!0}},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=input]","markerStyleAttributes"]},{type:"CONTROL",name:"INPUT_LABEL",propPath:["styles","[element=label]","params"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"input",elementProp:"styleAttributes",params:{width:{options:["fixed","hug","fill"]},height:{options:["hug","fill"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"input",showPlaceholderControl:!1,isLineSpaceAvailable:!0,isTextTransformAvailable:!0},{element:"label",displayCondition:"return !!sdk.component.getProps().styles.find(element => element.element === 'label').params.enabled",isLineSpaceAvailable:!0,isTextTransformAvailable:!0}]},{type:"CONTROL",name:"LIST_POSITION",elementProp:"styleAttributes",element:"listContainer"},{type:"CONTROL",name:"MULTIPLE_INPUT_SIZE",element:"input",params:{inputType:"RADIO"}},{type:"CONTROL",name:"BACKGROUND_MARKER_SELECTED",propPath:["styles","[element=input]","markerStyleAttributes"],params:{label:"DOCUMENT_CHOSEN_ITEM_COLOR_TITLE",property:"selectedColor",onlyColorSelection:!0,disableGradientSelection:!0,hideSwitch:!0}},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=input]","markerStyleAttributes"],params:{onlyColorSelection:!0}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=input]","markerStyleAttributes"],params:{minValue:1,maxValue:5,hideAdditionalParams:!0}},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=input]","markerStyleAttributes"]},{type:"CONTROL",name:"INPUT_LABEL",propPath:["styles","[element=label]","params"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]}],general:[{type:"CONTROL",name:"INTEGRATION_FIELD_MAPPING",params:{integrationNamePropPath:["control","integrationName"],groupNamePropPath:["control","groupName"],fieldNamePropPath:["control","fieldName"],fieldTypePropPath:["control","fieldType"],validationPropPath:["control","validation"],placeholderPropPath:["content","placeholder"],labelPropPath:["content","label"],optionsPropPath:["control","options"],optionsAlphabeticSortPropPath:["control","optionsAlphabeticSort"]}},{type:"CONTROL",name:"COMPONENT_OPTIONS",params:{label:"DOCUMENT_EXPORT_ID",header:"DOCUMENT_OPTIONS_HEADER",tooltip:"DOCUMENT_OPTIONS_TOOLTIP_PART1,DOCUMENT_OPTIONS_TOOLTIP_PART2",origin:!0,optionsPropPath:["control","options"],optionsAlphabeticSortPropPath:["control","optionsAlphabeticSort"],integrationNamePropPath:["control","integrationName"]}},{type:"CONTROL",name:"INPUT_VALIDATION",params:{validationPropPath:["control","validation"],fieldTypePropPath:["control","fieldType"],required:!0}}]},autoContrast:[{slave:{element:"input",propPath:["styles","[element=input]","markerStyleAttributes","selectedColor"]},master:{element:"input",propPath:["styles","[element=input]","markerStyleAttributes","background"]},enabledPropPath:["content","selectedColorContrastEnabled"]}],i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"COMPONENT_OPTIONS",params:{label:"DOCUMENT_EXPORT_ID",header:"DOCUMENT_OPTIONS_HEADER",tooltip:"DOCUMENT_OPTIONS_TOOLTIP_PART1,DOCUMENT_OPTIONS_TOOLTIP_PART2",origin:!1,optionsPropPath:["control","options"],optionsAlphabeticSortPropPath:["control","optionsAlphabeticSort"],integrationNamePropPath:["control","integrationName"]}}]},focusableElements:["input","label"],events:{dispatch:[],listen:[]},i18nPropPaths:["content,label","control,options,[id],label"],i18n:{en:{"control,validation,validationErrors,REQUIRED":"Required field","content,label":"Title"},ru:{"control,validation,validationErrors,REQUIRED":"Обязательное поле","content,label":"Заголовок"},uk:{"control,validation,validationErrors,REQUIRED":"Обов'язкове поле","content,label":"Заголовок"},es:{"control,validation,validationErrors,REQUIRED":"Campo obligatorio","content,label":"Título"},de:{"control,validation,validationErrors,REQUIRED":"Pflichtfeld","content,label":"Titel"},fr:{"control,validation,validationErrors,REQUIRED":"Champs requis","content,label":"Titre"},it:{"control,validation,validationErrors,REQUIRED":"Campo obbligatorio","content,label":"Titolo"},pt:{"control,validation,validationErrors,REQUIRED":"Campo obrigatório","content,label":"Título"},ro:{"control,validation,validationErrors,REQUIRED":"Câmp obligatoriu","content,label":"Titlu"},bg:{"control,validation,validationErrors,REQUIRED":"Изисквано поле","content,label":"Заглавие"},cs:{"control,validation,validationErrors,REQUIRED":"Vyžadované pole","content,label":"Titul"},el:{"control,validation,validationErrors,REQUIRED":"Απαιτητό πεδίο","content,label":"Τίτλος"},nl:{"control,validation,validationErrors,REQUIRED":"Verplicht veld","content,label":"Titel"},pl:{"control,validation,validationErrors,REQUIRED":"Wymagane pole","content,label":"Tytuł"},sv:{"control,validation,validationErrors,REQUIRED":"Obligatoriskt fält","content,label":"Tytuł"},tr:{"control,validation,validationErrors,REQUIRED":"Gerekli alan","content,label":"Başlık"},ar:{"control,validation,validationErrors,REQUIRED":"الحقل المطلوب","content,label":"عنوان"},zh:{"control,validation,validationErrors,REQUIRED":"必填字段","content,label":"Title"},da:{"control,validation,validationErrors,REQUIRED":"Påkrævet felt","content,label":"Titel"},he:{"control,validation,validationErrors,REQUIRED":"שדה נדרש","content,label":"Title"},fi:{"control,validation,validationErrors,REQUIRED":"Vaadittu kenttä","content,label":"Title"},hi:{"control,validation,validationErrors,REQUIRED":"आवश्यक फील्ड","content,label":"Title"},hr:{"control,validation,validationErrors,REQUIRED":"Obavezno polje","content,label":"Title"},hu:{"control,validation,validationErrors,REQUIRED":"Kötelező mező","content,label":"Title"},id:{"control,validation,validationErrors,REQUIRED":"Bidang yang wajib diisi","content,label":"Title"},ja:{"control,validation,validationErrors,REQUIRED":"必須フィールド","content,label":"Title"},ko:{"control,validation,validationErrors,REQUIRED":"필수 칸","content,label":"Title"},no:{"control,validation,validationErrors,REQUIRED":"Obligatorisk felt","content,label":"Title"},sk:{"control,validation,validationErrors,REQUIRED":"Povinné pole","content,label":"Title"},sl:{"control,validation,validationErrors,REQUIRED":"Obvezno polje","content,label":"Title"},sr:{"control,validation,validationErrors,REQUIRED":"Obavezno polje","content,label":"Title"}},props:{content:{label:"Title",selectedColorContrastEnabled:!0},control:{name:"radioGroup",integrationName:"radioGroup",defaultValue:null,options:{option_1:{exportId:"option_1",label:"Option 1",id:"option_1",sort:0},option_2:{exportId:"option_2",label:"Option 2",id:"option_2",sort:1},option_3:{exportId:"other",label:"Other",id:"option_3",sort:2}},optionsAlphabeticSort:{enabled:!1},validation:{required:!0}},styles:[{element:"input",markerStyleAttributes:{selectedColor:"var(--cl-schema-primary, rgb(0, 0, 0))",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"1px",borderTopColor:"var(--cl-schema-primary, rgb(68, 68, 68))",borderBottomWidth:"1px",borderBottomColor:"var(--cl-schema-primary, rgb(68, 68, 68))",borderLeftWidth:"1px",borderLeftColor:"var(--cl-schema-primary, rgb(68, 68, 68))",borderRightWidth:"1px",borderRightColor:"var(--cl-schema-primary, rgb(68, 68, 68))",boxShadow:"none",background:"rgba(255, 255, 255, 1)"}},{element:"label",params:{enabled:!0,position:"TOP",margin:5}}],adaptiveStyles:(re=[{element:"host",styleAttributes:{marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1},classes:""},{element:"listContainer",styleAttributes:{display:"flex",flexDirection:"column",alignItems:"start",justifyContent:"start",gap:"20px"},classes:""},{element:"input",styleAttributes:{width:"100%",minWidth:null,height:"auto",minHeight:null,background:"rgba(0, 0, 0, 0)",color:"var(--cl-schema-primary, rgb(68, 68, 68))",paddingBottom:"0",paddingLeft:"0",paddingRight:"0",paddingTop:"0",_paddingEnabled:!1,textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"14px",textShadow:"none"},markerStyleAttributes:{inputSize:"22px",inputToTextGapSize:"13px",textShadow:"none"},classes:""},{element:"label",styleAttributes:{color:"var(--cl-schema-text, rgb(68, 68, 68))",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"14px",textShadow:"none"},classes:""},{element:"optionWrapper",styleAttributes:{margin:"0 3px"}}],Object.values(zt).reduce(((t,e)=>Object.assign(t,{[e]:Qt(re)})),{[zt.DESKTOP]:[],[zt.MOBILE]:[]}))},metaDescription:{icon:"/SysRadioGroupComponent/assets/img/radio-btn-component-icon.svg",label:{en:"Radio",ru:"Радио",uk:"Радіо",es:"Radio",fr:"Radio",de:"Radio",it:"Radio",pt:"Rádio",ro:"Radio",bg:"Радио",cs:"Rádio",el:"Ραδιόφωνο",nl:"Radio",pl:"Radio",sv:"Radio",tr:"Radyo",ar:"الراديو",zh:"电台",da:"Radio",he:"רדיו",fi:"Radio",hi:"रेडियो",hr:"Radio",hu:"Választógomb",id:"Radio",ja:"ラジオ",ko:"라디오",no:"Radio",sk:"Rádio",sl:"Radio",sr:"Radio"}}};var re;const ie={inputSize:"22px",inputToTextGapSize:"13px",selectedColor:"rgba(0, 0, 0, 1)",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"1px",borderTopColor:"rgba(0, 0, 0, 1)",borderBottomWidth:"1px",borderBottomColor:"rgba(0, 0, 0, 1)",borderLeftWidth:"1px",borderLeftColor:"rgba(0, 0, 0, 1)",borderRightWidth:"1px",borderRightColor:"rgba(0, 0, 0, 1)",boxShadow:"none",textShadow:"none",outline:"none",border:"1px solid",background:"rgb(255, 255, 255)",backdropFilter:"none"};function se(t){return se="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},se(t)}function le(t){return function(t){if(Array.isArray(t))return ce(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ae(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ae(t,e){if(t){if("string"==typeof t)return ce(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ce(t,e):void 0}}function ce(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function de(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function pe(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?de(Object(n),!0).forEach((function(e){ye(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):de(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function ue(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,fe(o.key),o)}}function he(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(he=function(){return!!t})()}function me(){return me="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=be(t)););return t}(t,e);if(o){var r=Object.getOwnPropertyDescriptor(o,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},me.apply(null,arguments)}function be(t){return be=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},be(t)}function ge(t,e){return ge=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ge(t,e)}function ye(t,e,n){return(e=fe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fe(t){var e=function(t){if("object"!=se(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=se(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==se(e)?e:e+""}var ve=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ye(e=function(t,e,n){return e=be(e),function(t,e){if(e&&("object"==se(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,he()?Reflect.construct(e,n||[],be(t).constructor):e.apply(t,n))}(this,t),"manifest",oe),ye(e,"registeredControl",void 0),ye(e,"controlExportId",void 0),ye(e,"markerStyleAttributes",void 0),ye(e,"getInputAdaptiveStyles",(function(){var t=e.getProps(),n=e.getEnvironment();return t.adaptiveStyles[n].filter((function(t){return"input"===t.element}))})),ye(e,"setMarkerStyleAttributes",(function(){var n=e.getInputAdaptiveStyles();if(n.length&&n[0].markerStyleAttributes){var o;e.markerStyleAttributes=pe(pe({},ie),n[0].markerStyleAttributes);var r=null===(o=e.getProps().styles)||void 0===o||null===(o=o.find((function(t){return"input"===t.element})))||void 0===o?void 0:o.markerStyleAttributes;r&&(e.markerStyleAttributes=pe(pe({},e.markerStyleAttributes),r))}else e.markerStyleAttributes=t.defaultMarkerStyleAttributes})),ye(e,"setStylesVariables",(function(t){Object.keys(e.markerStyleAttributes).forEach((function(n){return t.style.setProperty("--".concat(n),e.markerStyleAttributes[n])}))})),ye(e,"getOptions",(function(){var t,n=e.getProps().control.options,o={};Object.keys(n).forEach((function(t){var e=n[t];o[t]={id:t,label:e.label,exportId:e.exportId,sort:e.sort}}));var r=null!==(t=e.getProps().control.optionsAlphabeticSort)&&void 0!==t&&t.enabled?"label":"sort";return function(t,e,n=!1){return function(t){return[...t].reduce(((t,[e,n])=>(t[e]=n,t)),{})}(Object.entries(t).sort((([t,o],[r,i])=>function(t,e,n,o=!1){let r=t[n],i=e[n];return isNaN(r)||isNaN(i)?"string"!=typeof r||"string"!=typeof i?0:(r=r.toLowerCase(),i=i.toLowerCase(),o?i.localeCompare(r):r.localeCompare(i)):r<i?o?1:-1:r>i?o?-1:1:0}(o,i,e,n))))}(e.getProps().control.options,r)})),ye(e,"applyStylesToOptionWrapper",(function(){var t=e.getElement("listContainer"),n=Vt(e.getProps().adaptiveStyles,e.getEnvironment(),"optionWrapper"),o=t.querySelectorAll(".option-wrapper");if(n){var r=Object.keys(n);o.forEach((function(t){r.forEach((function(e){t.style[e]=n[e]}))}))}else o.forEach((function(t){t.style.margin="10px 3px"})),t.style.gap="0px"})),ye(e,"createRadioGroupItemComponent",(function(t,n,o){var r=e.getHostElement(),i=document.createElement("div");i.classList.add("option-wrapper"),i.setAttribute("cl-element","optionWrapper");var s=document.createElement("label");s.classList.add("radio-mark-container");var l=document.createElement("div");l.classList.add("radio-mark-shadow"),s.appendChild(l);var a=document.createElement("input");a.setAttribute("type","radio"),a.setAttribute("name",e.controlExportId),s.appendChild(a);var c=document.createElement("span");c.classList.add("radio-mark"),s.appendChild(c);var d=document.createElement("span");if(d.classList.add("radio-box-label"),d.textContent=t.label,e.setStylesVariables(r),F(d,o),s.appendChild(d),n){var p=e.markerStyleAttributes.selectedColor;c.classList.add("radio-mark-checked"),c.style.borderColor=p,c.style.outlineColor=p,e.getHostElement().style.setProperty("--selectedColor","".concat(p)),c.style.setProperty("--borderColor","".concat(p))}else c.style.borderColor=null,c.style.outlineColor=null,e.getHostElement().style.setProperty("--borderColor","rgba(0,0,0, 0.7)");return i.appendChild(s),i})),ye(e,"updateGap",(function(){var t=e.getElement("listContainer");t&&[].concat(le(t.querySelectorAll(".radio-mark-container")),le(t.querySelectorAll(".radio-mark-shadow")),le(t.querySelectorAll(".radio-mark"))).forEach((function(t){e.updateElementSizeStyles(t,e.markerStyleAttributes)}))})),ye(e,"updateElementSizeStyles",(function(t,e){t.style.setProperty("--inputSize",e.inputSize),t.style.setProperty("--inputToTextGapSize",e.inputToTextGapSize)})),ye(e,"applyStyleToOptionLabels",(function(){var n=e.getElement("input"),o=$(n,t.radioGroupButtonMenuStyles);n.querySelectorAll(".radio-box-label").forEach((function(t){F(t,o)}))})),ye(e,"applyStylesToMarkers",(function(){e.getElement("input").querySelectorAll(".radio-mark").forEach((function(t){e.setStylesVariables(t),function(t){let e;const n=t,o=["transparent","initial"];t&&(t.style.borderColor&&!o.includes(t.style.borderColor)&&(parseFloat(t.style.borderWidth)||parseFloat(t.style.borderBottomWidth))&&(e=V(n,t,"borderColor")),!e&&t.style.getPropertyValue("--borderBottomColor")&&!o.includes(t.style.getPropertyValue("--borderBottomColor"))&&parseFloat(t.style.getPropertyValue("--borderBottomWidth"))&&(e=V(n,t,"--borderBottomColor")),e||!t.style.backgroundColor||o.includes(t.style.backgroundColor)||(e=V(n,t,"backgroundColor")),e||!t.style.color||o.includes(t.style.color)||(e=V(n,t,"color")),e||n.classList.remove("focus-outline-defined"))}(t)}))})),ye(e,"applyStylesToMarkersShadows",(function(){e.getElement("input").querySelectorAll(".radio-mark-shadow").forEach((function(t){e.setStylesVariables(t)}))})),ye(e,"unselectButtons",(function(t,e){t.querySelectorAll(".radioGroupItem").forEach((function(t){if(t.getAttribute("name")!==e){var n=t.querySelector(".radio-mark");n.classList.remove("radio-mark-checked"),n.style.borderColor=null,n.style.outlineColor=null}}))})),ye(e,"setSelectedBorderColor",(function(t){var n=e.markerStyleAttributes.selectedColor;t.style.borderColor="".concat(n),t.style.outlineColor="".concat(n),t.style.setProperty("--borderColor","".concat(n))})),ye(e,"setBorderTopWidth",(function(t){var n=e.markerStyleAttributes.borderTopWidth;t.style.setProperty("--borderTopWidth","".concat(n))})),ye(e,"createContent",(function(){var n,o=e.getElement("input"),r=$(o,t.radioGroupButtonMenuStyles),i=JSON.parse((null===(n=e.registeredControl)||void 0===n?void 0:n.getValue())||null),s=e.getOptions(),l=document.createElement("div");l.classList.add("radio-buttons-list"),l.setAttribute("cl-element","listContainer"),Object.entries(s).forEach((function(t){var n,o,a=(n=t,o=1,function(t){if(Array.isArray(t))return t}(n)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,s,l=[],a=!0,c=!1;try{if(i=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;a=!1}else for(;!(a=(o=i.call(n)).done)&&(l.push(o.value),l.length!==e);a=!0);}catch(t){c=!0,r=t}finally{try{if(!a&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw r}}return l}}(n,o)||ae(n,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],c=s[a],d=(null==i?void 0:i.id)===a,p=e.createRadioGroupItemComponent(c,d,r);p.classList.add("radioGroupItem"),p.setAttribute("name",c.id),e.setBorderTopWidth(p),"UPDATING"!==e.services.config.getConfig("entryModuleType")&&p.addEventListener("click",(function(t){t.stopPropagation(),t.preventDefault();var n=p.querySelector(".radio-mark");n.classList.add("radio-mark-checked"),e.setSelectedBorderColor(n),e.registeredControl.setValue(JSON.stringify({id:a,exportId:s[a].exportId})),e.unselectButtons(l,a)})),l.appendChild(p)})),W({element:o,html:""}),o.append(l)})),ye(e,"registerControl",(function(t){var n=t.querySelector(".radio-group-tooltip");e.registeredControl=e.createControlWithValidation([],{tooltipElement:n}),e.registeredControl.setValue(null,{silent:!0,skipValidation:!0})})),ye(e,"handleSafariHeightIssue",(function(){var t=e.getHostElement();t.style.height&&"auto"!==t.style.height||(t.style.height="fit-content")})),e.getRootElement().innerHTML="\n <style>".concat(t.componentStyle,"</style>\n ").concat(t.componentTemplate,"\n "),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ge(t,e)}(t,ne),e=t,n=[{key:"connectedCallback",value:function(){var e=this;!function(t,e,n){var o=me(be(t.prototype),"connectedCallback",n);return"function"==typeof o?function(t){return o.apply(n,t)}:o}(t,0,this)([]);var n=this.getRootElement(),o=this.getProps();this.controlExportId=o.control.integrationName,this.registerControl(n),this.observeProps((function(t,o){var r=e.getEnvironment();H(o,r,n,".label-with-radio-group-container"),z(o,r,e.getHostElement(),e.getElement("input"),e.getElement("label")),e.setMarkerStyleAttributes(),e.createContent(),e.applyAutoAdaptiveStyles(o.adaptiveStyles,o.styles),e.handleSafariHeightIssue(),e.applyStylesToMarkers(),e.applyStylesToMarkersShadows(),e.applyStylesToOptionWrapper(),e.updateGap()})),this.observeShared((function(t,n){e.applyStyleToOptionLabels(e.getProps(),e.getEnvironment())})),this.observeEnvironment((function(t,o){var r=e.getProps();e.setMarkerStyleAttributes(),e.applyStylesToMarkers(),e.applyStylesToMarkersShadows(),H(r,o,n,".label-with-radio-group-container"),z(r,o,e.getHostElement(),e.getElement("input"),e.getElement("label")),e.handleSafariHeightIssue(),e.applyStyleToOptionLabels(r,o),e.updateGap()}))}}],n&&ue(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();ye(ve,"define",{name:"sys-radio-group",model:oe.name,manifest:oe}),ye(ve,"componentStyle",'\n .main-container {\n height: 100%;\n }\n \n .label-with-radio-group-container {\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n \n .label {\n min-height: 10px;\n }\n \n .label.cl-focused {\n min-height: auto;\n }\n \n .radio-buttons-list {\n width: 100%;\n height: auto;\n text-align: inherit;\n }\n \n .radio-group-with-tooltip {\n position: relative;\n display: flex;\n height: 100%;\n width: 100%;\n cursor: pointer;\n }\n \n .invalid {\n border: 1px solid #ff0000 !important;\n }\n \n .radio-group-tooltip {\n visibility: hidden;\n position: absolute;\n right: -10px;\n top: -10px;\n z-index: 1;\n border-radius: 100%;\n width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Chrome/Safari/Opera */\n -khtml-user-select: none; /* Konqueror */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n }\n \n .radio-group-content {\n display: flex;\n /*align-items: center;*/\n /*position: absolute;*/\n height: 100%;\n width: 100%;\n /*padding: 0 35px 0 20px;*/\n cursor: pointer;\n border: 1px solid transparent;\n /*TODO*/\n /*padding: 10px;\n margin: -10px;*/\n }\n \n .option-wrapper {\n border: 0;\n align-items: center;\n outline: 0;\n text-align: inherit;\n padding: var(--borderTopWidth);\n }\n \n input {\n -moz-appearance: none;\n -webkit-appearance: none;\n -o-appearance: none;\n width: 24px;\n height: auto;\n padding: 0 10px;\n margin: 0;\n }\n \n /* The container */\n .radio-mark-container {\n cursor: pointer;\n display: flex;\n position: relative;\n padding-left: calc(var(--inputSize, 22px) + var(--inputToTextGapSize, 18px) + var(--borderTopWidth, 1));\n height: var(--inputSize, 22px);\n width: 100%;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n }\n \n /* Hide the browser\'s default checkbox */\n .radio-mark-container input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n }\n \n .radio-mark-container .radio-box-label {\n display: block;\n }\n \n /* Create a custom radio */\n .radio-mark {\n cursor: pointer;\n position: absolute;\n top: 0;\n left: 0;\n height: var(--inputSize, 22px);\n width: var(--inputSize, 22px);\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 2px;\n border-radius: 50px;\n box-shadow: 0 0 0 var(--borderTopWidth) var(--borderTopColor);\n outline: none;\n /*border-style: var(--borderStyle);\n border-color: var(--borderTopColor);\n border-width: var(--borderTopWidth);*/\n /*outline-width: var(--borderTopWidth);\n outline-color: var(--borderTopColor);\n outline-style: var(--borderStyle);*/\n z-index: 2;\n background: var(--background, rgb(256, 256, 256));\n backdrop-filter: var(--backdropFilter);\n }\n \n .radio-mark-shadow {\n box-shadow: var(--boxShadow);\n position: absolute;\n top: 0;\n left: 0;\n height: var(--inputSize, 22px);\n width: var(--inputSize, 22px);\n border-radius: 50px;\n z-index: 1;\n }\n \n .radio-mark:after {\n content: "";\n position: absolute;\n display: none;\n }\n \n .radio-mark-checked {\n box-shadow: 0 0 0 var(--borderTopWidth) var(--selectedColor);\n }\n \n .radio-mark-checked:after {\n display: block;\n }\n \n .radio-mark-container .radio-mark:after {\n width: var(--inputSize, 22px);\n height: var(--inputSize, 22px);\n border-radius: 50px;\n border-width: 1px;\n border-style: solid;\n background: var(--borderColor);\n border-color: var(--borderColor);\n scale: 0.8;\n }\n \n .radio-box-label {\n margin: 0;\n height: auto;\n min-height: 10px;\n width: auto;\n align-self: center;\n text-shadow: var(--textShadow);\n }\n \n input:focus ~ .radio-mark.focus-outline-defined {\n /*outline: var(--clFocusOutline);*/\n z-index: 3;\n outline-width: calc(var(--borderTopWidth) + 3px);\n outline-color: var(--borderTopColor);\n outline-style: solid;\n opacity: 0.7;\n }\n \n input:focus ~ .radio-mark.radio-mark-checked.focus-outline-defined {\n outline-color: var(--selectedColor);\n }\n'),ye(ve,"componentTemplate",'\n<div class="main-container">\n <div class="label-with-radio-group-container">\n <div cl-element="label"\n cl-inline-edit="content, label"\n class="label">\n </div>\n <div class="radio-group-with-tooltip">\n <div cl-element="input" class="radio-group-content">\n </div>\n <div class="radio-group-tooltip">\n <svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path d="M1.5 13.0604C1.5 19.4116 6.6481 24.5605 13.0075 24.5605C19.353 24.5605 24.5 19.4107 24.5 13.0604C24.5 6.70865 19.3531 1.55909 13.0075 1.55908C6.64806 1.55908 1.5 6.7077 1.5 13.0604ZM12.9775 17.9668C12.7032 17.9668 12.4807 17.7443 12.4807 17.47C12.4807 17.1956 12.7032 16.9732 12.9775 16.9732C13.2519 16.9732 13.4743 17.1956 13.4743 17.47C13.4743 17.7443 13.2519 17.9668 12.9775 17.9668ZM12.9775 13.4764C12.7032 13.4764 12.4807 13.254 12.4807 12.9796L12.4807 8.48924C12.4807 8.21487 12.7032 7.99245 12.9775 7.99245C13.2519 7.99245 13.4743 8.21487 13.4743 8.48924L13.4743 12.9796C13.4743 13.254 13.2519 13.4764 12.9775 13.4764Z" fill="#FF0000" stroke="white" stroke-width="2"></path>\n </svg>\n </div>\n </div>\n </div>\n</div>\n'),ye(ve,"radioGroupButtonMenuStyles",["color","font-family","font-size","letter-spacing","text-shadow","font-weight","line-height","text-align"]),ye(ve,"defaultMarkerStyleAttributes",ie);export{ve as default};window.clComponentClass_SysRadioGroupComponent=ve;
@@ -1 +1 @@
1
- const t="cl-";function e(e){return t+e}function s(t){return"cl-"+t}const i="VIEW",n="MODULE",o="CONTAINER",r="INPUT",l="BUTTON",a="CONSENT",c="COLUMN",d="SUBSCRIBE_CONTACT",h="REQUEST",p="SHOW_WIDGET",u="OPEN_LINK",m="CLOSE_WIDGET";class g{static sortActions(t){const e={[m]:-1,[u]:-2,[p]:1,[d]:2,[h]:3},s=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>s(t)>s(e)?-1:s(t)<s(e)?1:0))}constructor(t,e){this.config=t,this.actions=g.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,i){this.state=t;const n=i(),o=n.getAttribute(s("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(s("type"))));let i=0;for(;e[i]&&e[i].getAttribute(s("id"))!==o;){let t=e[i].getAttribute(s("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;i++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((n.shadowRoot||n).querySelectorAll(this.config.relativeSelector)):[n],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,s,i;try{for(var n,o=!0,r=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,s=t[Symbol.asyncIterator];return s?s.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=t[s]&&function(e){return new Promise((function(i,n){!function(t,e,s,i){Promise.resolve(i).then((function(e){t({value:e,done:s})}),e)}(i,n,(e=t[s](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(n=await r.next()).done);){i=n.value,o=!1;try{const{event:t}=i;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{o=!0}}}catch(t){e={error:t}}finally{try{o||t||!(s=r.return)||await s.call(r)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}g.IGNORING_VIEW_ENTRY_TYPES=[l,a,r];const b="CLICK",y="COMPONENT_EVENT";class f{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,s){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class v{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map((t=>this.actionFactory.get(t)));switch(e.forEach((t=>this.actionRegister.register(t))),t.type){case b:return new g(t,e);case y:return new f(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class E{static generate(){let t,e="";for(let s=0;s<32;s++)8!==s&&12!==s&&16!==s&&20!==s||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class S{constructor(){this.listeners=S.createDefaultListenersState()}emit(t,e,s=null){const i=this.listeners[t];i&&Object.values(i).forEach((i=>i(e,t,s))),Object.values(this.listeners["*"]).forEach((i=>i(e,t,s)))}on(t,e){const s=E.generate(),i=this.listeners[t];return i?i[s]=e:this.listeners[t]={[s]:e},{off:()=>{var e,i;(null===(i=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===i?void 0:i[s])&&delete this.listeners[t][s]}}}destroy(){this.listeners=S.createDefaultListenersState()}}S.createDefaultListenersState=()=>({"*":{}});const O=(t,e,s,i)=>{const{addEventListenerBase:n,addEventListener:o}=EventTarget.prototype;(n||o).call(t,e,s,i)};class A{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class C{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===n?Object.assign(Object.assign({},t),C.moduleToContainerParams):t));return Object.assign(Object.assign({},t),{children:e})}));return Object.assign(Object.assign({},t),{views:e})}static sort(t,e){return t.index>e.index?1:-1}static reIndex(t,e){return Object.assign(Object.assign({},t),{index:e+t.index})}}C.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class x extends S{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(x.changeEventName,this._isMobile)}))}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(x.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(x.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}x.changeEventName="CHANGE";class R{static set(t,e){const s=t[R.accumulatorPropertyName]||{};t[R.accumulatorPropertyName]=Object.assign(Object.assign({},s),e.styleAttributes),Object.keys(t[R.accumulatorPropertyName]).forEach((s=>{s.includes("--")?t.style.setProperty(s,e.styleAttributes[s]||""):t.style[s]=e.styleAttributes[s]?e.styleAttributes[s]:""}))}}R.accumulatorPropertyName="clStyleAttributes";const T="CONTENT_LOCKER";class L{static applyHostStyles(t,e,s=null,n){var r,l,a;const d=null===(l=null===(r=null==s?void 0:s.props)||void 0===r?void 0:r.handlers)||void 0===l?void 0:l.find((t=>"CLICK"===t.type));d&&(null===(a=d.actions)||void 0===a?void 0:a.length)&&(e.style.cursor="pointer"),t!==i&&t!==o&&t!==c||(e.style.display=n===T&&t===i?"flex":"inline-flex",e.style.position="relative"),e.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(t=""){this.styles=`${this.styles} ${t}`}getStyles(){return this.styles}}class P{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class N{constructor(t,e,s,i,n,o){this.hostElement=e,this.documentModel=t,this.getSharedCb=s,this.getPropsCb=i,this.getEnvCb=n,this.httpClient=o,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,s]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:s.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((s=>{var i,n,o,r,l;const a=null===(n=null===(i=e.adaptiveStyles)||void 0===i?void 0:i[t])||void 0===n?void 0:n.find((t=>t.element===s)),c=(null===(o=e.styles)||void 0===o?void 0:o.find((t=>t.element===s)))||{},d=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),h=this.parseBackground(d);h.url&&this.envUrlMaps[t].set(s,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,s])=>this.httpClient.execute(s.originalSVGResourceURL).then((t=>t.text())).then((i=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},s),{inlineSvgString:i}))}))))).then((()=>{this._applyHostElementBackground(this.envUrlMaps[t].get("host"),this.getSharedCb().cssVars)})).catch((t=>{console.error(t),P.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t)})),this}_applyHostElementBackground(t,e){t&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(t,e){const s=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(s)}')${t.positionOptions}`}off(){var t;null===(t=this.subscription)||void 0===t||t.off()}}const _=new class{execute(t,e,s=null,i,n){const o={method:e,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:n};return s&&(o.body="string"==typeof s?s:JSON.stringify(s)),fetch(t,o)}};function w(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,s)=>Object.assign(Object.assign({},e),{[s]:t[s]})),{})}class M{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}}class j{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}const k="COMPONENT_RESOURCES_LOADED",F="FAILED_TO_LOAD_COMPONENT_RESOURCE";class I{constructor(t,e,s){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(k,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(F,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=s,this.counters={pending:new j(this.onCounterStateUpdate)}}}const D=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>D(...t)}},U=D,B="props",W="shared",$="environment";function H(t,e,s,i){const n=t=>{let o=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return o&&(i&&"function"==typeof i?i(o.getAttribute(e)):(null===(r=null==o?void 0:o.getAttribute)||void 0===r?void 0:r.call(o,e))===s)?o:o&&o.parentNode&&n(o.parentNode)||null;var r};return n(t)}const G="SUBMIT";function V(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((s=>{"element"!==s&&"classes"!==s&&(e[s]&&"object"==typeof e[s]&&!Array.isArray(e[s])?t[s]=Object.assign(Object.assign({},t[s]||{}),e[s]):t[s]=e[s])})),t):t}function z(t,e,s){var i;return null===(i=t[e])||void 0===i?void 0:i.find((t=>t.element===s))}function Q(t){const{element:e,html:s,appendHtml:i}=t,n=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(s);i?e.innerHTML+=n:e.innerHTML=n}class q extends Event{constructor(t,e,s){super(t,s),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class J extends HTMLElement{constructor(){var i,n;super(),this.construct=()=>{let t;const e=this.getAttribute(s("id")),i=this.getWidgetContainerNode();if(!i)throw new Error("Widget container not found in construct");const n=i.closest(`[${s("widget-id")}]`);let o;n&&(o=n.getAttribute(s("widget-id")));let r=new q("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(s("path")),id:e,widgetId:o},{bubbles:!0,composed:!0});this.dispatchEvent(r),t=r.detail.props,Object.assign(this,t),this.observers=U(B,W,$),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach((t=>null==t?void 0:t.off()))}},this.state=new A,this.componentEventEmitter=new S,this.componentResourceManager=new I(this.model.id,this.services.eventEmitter,"STATIC"===this.services.config.getConfig("entryModuleType")),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new v(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(B).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),i=s("floating");t.floating&&!e.getAttribute(i)?e.setAttribute(i,"true"):!t.floating&&e.getAttribute(i)&&e.removeAttribute(i)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(W).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new N(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),_),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(x.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get($).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(B).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(W).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get($).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${s("element")}]`)).filter((t=>!t.hasAttribute(s("component"))))],this.getElement=(t,e)=>this.getElements().find((i=>e?i.getAttribute(s("element"))===t&&i.id===e:i.getAttribute(s("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const i=this.getElements();if(!i.length)return;t=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const s=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let i=!1,n=!1;s.desktop&&s.desktop.forEach((s=>{s.element===e&&(V(s,t),i=!0)})),s.mobile&&s.mobile.forEach((s=>{s.element===e&&(V(s,t),n=!0)})),!i&&s.desktop&&s.desktop.push(JSON.parse(JSON.stringify(t))),!n&&s.mobile&&s.mobile.push(JSON.parse(JSON.stringify(t)))})),s}(t,e);const n=s("type"),o="element-styles";let r=this.getRootElement().querySelector(`style[${n}="${o}"]`);r||(r=document.createElement("style"),r.setAttribute(n,o),this.getRootElement().appendChild(r)),Q({element:r,html:""}),i.forEach((e=>{let i=e.getAttribute(s("element"));const n=this.getEnvironment();let o=z(t,n,i);if(o){if(this.resizeListener.isMobile()){const e=z(t,"desktop",i);e&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),o.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(o),r)}})),this._addLinkColor(r,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[s,i]of Object.entries(e))t.style[s]=i;return!0},this.applyStylesToElement=(t,e,i)=>{var n,o;const r=[];"host"===(e=J._resolveTogglableStylesForElementModel(e)).element&&(L.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(n=this.model.props.backgroundDynamicInlineSVGElements)||void 0===n?void 0:n.desktop)||"mobile"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),r.push("background")));let l=e.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],O(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),O(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:w(e.styleAttributes,r)});if(R.set(t,c),this._setClassAttributes(t,e),i){if(e.hoverStyleAttributes){let n=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const s=t.tagName.toLowerCase(),i=`flip-up-animation-${e.element}`;let o=this.getRootElement().querySelector(`#${i}`);o||(o=document.createElement("style"),o.id=i,t.appendChild(o)),Q({element:o,html:`\n ${s}::before {\n content: '';\n background: ${n.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${s}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),n=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}n.borderTopWidth&&"0px"!==n.borderTopWidth||delete n.borderTopColor,n.borderBottomWidth&&"0px"!==n.borderBottomWidth||delete n.borderBottomColor,n.borderLeftWidth&&"0px"!==n.borderLeftWidth||delete n.borderLeftColor,n.borderRightWidth&&"0px"!==n.borderRightWidth||delete n.borderRightColor,this._addStylesToStyleElement(i,e.element,n,`:not(.${s("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(i,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(i,this.getShared()),this.stylesAppliedToElement(t,e,i)}},this._fixMarginOverflow=t=>{const e=this.getParentComponent(),i=e&&("flex"===e.style.display||"inline-flex"===e.style.display),n="host",o=t.getAttribute(s("element"))===n;if(!i||!o)return;const r=this.getProps(),l=this.getEnvironment(),{styleAttributes:a}=z(r.adaptiveStyles,l,n)||{};if(!a)return;const c=a.marginLeft||a.marginRight,d="100%"===a.width;if(c&&d){const e=(parseFloat(a.marginLeft)||0)+(parseFloat(a.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=e=>function(e,s){let i=e;return(i.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((t=>{var e;let n=null===(e=s.textClasses)||void 0===e?void 0:e[t];n&&(n.styleAttributes.fontFamily||(n.isHeader&&s.headerFontFamily&&(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:s.headerFontFamily})})),!n.isHeader&&s.textFontFamily&&(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:s.textFontFamily})}))),i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),n.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},i.placeholderStyleAttributes),n.placeholderStyleAttributes)}))})),i.styleAttributes.fontFamily||(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:s.textFontFamily})})),i}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,i,n="",o)=>{const r=Object.keys(i).reduce(((t,e)=>t+` ${M.camelCaseToDashCase(e)}: ${i[e]}${o?" !important;":";"}`),"");Q({element:t,html:`[${s("element")}="${e}"]${n} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{Q({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var s,i,n,o;e.linkColor&&Q({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(s=e.linkParams)||void 0===s?void 0:s.color)&&Q({element:t,html:`a {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(n=e.linkParams)||void 0===n?void 0:n.color}}`,appendHtml:!0}),(null===(o=e.linkParams)||void 0===o?void 0:o.removeUnderline)&&Q({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(s,i)=>{Array.from(s.classList).filter((t=>t!==e("hovered")&&t!==e("focused"))).forEach((e=>{e.startsWith(t)&&s.classList.remove(e)}));const n=((s.getAttribute("class")||"")+" "+i.classes).trim();s.setAttribute("class",n)},this.getParentComponent=()=>H(this.parentNode,s("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(s("path"));return t&&1===t.split(",").length?this.parentNode:H(this.parentNode,s("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>{return[(t=this.services.config).getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t));var t},this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,s)=>{if(e)return e;const i=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const s=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[s]?{translations:e[s],language:s}:null}(s,t);return i||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,s)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,s;const i=t.control.name;if(["email","first_name","last_name"].includes(i))return i.toUpperCase();if(t.content.label&&(null===(s=null===(e=t.adaptiveStyles.desktop.find((t=>"label"===t.element)))||void 0===e?void 0:e.params)||void 0===s?void 0:s.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return t.content.placeholder?this.capitalizeFirstLetter(t.content.placeholder):t.control.integrationName?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{switch(t.control.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},s=this.services.actionRegister.getRegisteredActions().find((t=>t.category===G));s?null==s||s.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:h}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>this.getProps().handlers&&this.getProps().handlers.length?[...this.getProps().handlers]:[],this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(i=this.define)||void 0===i?void 0:i.manifest)||(null===(n=this.constructor.define)||void 0===n?void 0:n.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=J._resolveTogglableStyles(e[t]))})),e}static _resolveTogglableStyles(t){const e=Object.assign({},t),s=(t,s,i)=>{s in e&&(t.forEach((t=>{t in e&&(e[t]=e[s]?e[t]:i)})),delete e[s])};return s(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),s(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}const K={name:"SysSlideComponent",componentType:"SLIDE",version:"1.0.0",focusParentOnClick:!0,preventDraggable:!0,propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0,params:{indentationType:"PADDING"}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0,params:{indentationType:"PADDING"}}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0}}]},events:{dispatch:[],listen:[]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1}}]},i18nPropPaths:["handlers,[id],actions,[id],params,link"],props:{content:{name:null},styles:[{element:"host",styleAttributes:{background:"#FFFFFF"},classes:""}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{display:"inline-flex",position:"relative",width:"100%",minWidth:null,height:"auto",minHeight:null,overflow:"hidden",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"20px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}],mobile:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:null,height:"auto",minHeight:null,overflow:"hidden",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"20px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}]}},waitForResourcesLoad:!0,resourcesPropPaths:[["adaptiveStyles",":ENV","styleAttributes","background"],["styles","styleAttributes","background"]],metaDescription:{label:{en:"Slide",ru:"Слайд",uk:"Слайд",es:"Diapositiva",fr:"Diapositive",de:"Slide",it:"Slide",pt:"Diapositivo",ro:"Slide",bg:"Слайд",cs:"Slide",el:"Slide",nl:"Slide",pl:"Slajd",sv:"Slide",tr:"Slide",ar:"Slide",zh:"Slide",da:"Slide",he:"Slide",fi:"Slide",hi:"Slide",hr:"Slide",hu:"Slide",id:"Slide",ja:"Slide",ko:"Slide",no:"Slide",sk:"Slide",sl:"Slide",sr:"Slide"}}};function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function Z(t,e){for(var s=0;s<e.length;s++){var i=e[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,nt(i.key),i)}}function X(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(X=function(){return!!t})()}function tt(){return tt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,s){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=et(t)););return t}(t,e);if(i){var n=Object.getOwnPropertyDescriptor(i,e);return n.get?n.get.call(arguments.length<3?t:s):n.value}},tt.apply(null,arguments)}function et(t){return et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},et(t)}function st(t,e){return st=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},st(t,e)}function it(t,e,s){return(e=nt(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function nt(t){var e=function(t){if("object"!=Y(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,"string");if("object"!=Y(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Y(e)?e:e+""}var ot=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),it(e=function(t,e,s){return e=et(e),function(t,e){if(e&&("object"==Y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,X()?Reflect.construct(e,s||[],et(t).constructor):e.apply(t,s))}(this,t),"manifest",K),e.getRootElement().innerHTML="\n <style>\n :host {\n position: relative;\n flex: 0 0 100%;\n min-width: 20px;\n min-height: 20px;\n }\n </style>\n ",e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&st(t,e)}(t,J),e=t,s=[{key:"connectedCallback",value:function(){var e,s,i,n=this;(e=t,s=this,"function"==typeof(i=tt(et(1&3?e.prototype:e),"connectedCallback",s))?function(t){return i.apply(s,t)}:i)([]),this.observeProps((function(t,e){n.applyAutoAdaptiveStyles(e.adaptiveStyles,e.styles)}))}}],s&&Z(e.prototype,s),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,s}();it(ot,"define",{name:"sys-slide",model:K.name,manifest:K});export{ot as default};window.clComponentClass_SysSlideComponent=ot;
1
+ const t="cl-";function e(e){return t+e}function s(t){return"cl-"+t}const i="VIEW",n="MODULE",o="CONTAINER",r="INPUT",l="BUTTON",a="CONSENT",c="COLUMN",d="SUBSCRIBE_CONTACT",h="REQUEST",p="SHOW_WIDGET",u="OPEN_LINK",m="CLOSE_WIDGET";class g{static sortActions(t){const e={[m]:-1,[u]:-2,[p]:1,[d]:2,[h]:3},s=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>s(t)>s(e)?-1:s(t)<s(e)?1:0))}constructor(t,e){this.config=t,this.actions=g.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,i){this.state=t;const n=i(),o=n.getAttribute(s("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(s("type"))));let i=0;for(;e[i]&&e[i].getAttribute(s("id"))!==o;){let t=e[i].getAttribute(s("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;i++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((n.shadowRoot||n).querySelectorAll(this.config.relativeSelector)):[n],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,s,i;try{for(var n,o=!0,r=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,s=t[Symbol.asyncIterator];return s?s.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(s){e[s]=t[s]&&function(e){return new Promise((function(i,n){!function(t,e,s,i){Promise.resolve(i).then((function(e){t({value:e,done:s})}),e)}(i,n,(e=t[s](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(n=await r.next()).done);){i=n.value,o=!1;try{const{event:t}=i;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{o=!0}}}catch(t){e={error:t}}finally{try{o||t||!(s=r.return)||await s.call(r)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}g.IGNORING_VIEW_ENTRY_TYPES=[l,a,r];const b="CLICK",y="COMPONENT_EVENT";class f{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,s){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class v{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map((t=>this.actionFactory.get(t)));switch(e.forEach((t=>this.actionRegister.register(t))),t.type){case b:return new g(t,e);case y:return new f(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class E{static generate(){let t,e="";for(let s=0;s<32;s++)8!==s&&12!==s&&16!==s&&20!==s||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class S{constructor(){this.listeners=S.createDefaultListenersState()}emit(t,e,s=null){const i=this.listeners[t];i&&Object.values(i).forEach((i=>i(e,t,s))),Object.values(this.listeners["*"]).forEach((i=>i(e,t,s)))}on(t,e){const s=E.generate(),i=this.listeners[t];return i?i[s]=e:this.listeners[t]={[s]:e},{off:()=>{var e,i;(null===(i=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===i?void 0:i[s])&&delete this.listeners[t][s]}}}destroy(){this.listeners=S.createDefaultListenersState()}}S.createDefaultListenersState=()=>({"*":{}});const O=(t,e,s,i)=>{const{addEventListenerBase:n,addEventListener:o}=EventTarget.prototype;(n||o).call(t,e,s,i)};class A{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class C{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===n?Object.assign(Object.assign({},t),C.moduleToContainerParams):t));return Object.assign(Object.assign({},t),{children:e})}));return Object.assign(Object.assign({},t),{views:e})}static sort(t,e){return t.index>e.index?1:-1}static reIndex(t,e){return Object.assign(Object.assign({},t),{index:e+t.index})}}C.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class x extends S{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(x.changeEventName,this._isMobile)}))}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(x.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(x.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}x.changeEventName="CHANGE";class R{static set(t,e){const s=t[R.accumulatorPropertyName]||{};t[R.accumulatorPropertyName]=Object.assign(Object.assign({},s),e.styleAttributes),Object.keys(t[R.accumulatorPropertyName]).forEach((s=>{s.includes("--")?t.style.setProperty(s,e.styleAttributes[s]||""):t.style[s]=e.styleAttributes[s]?e.styleAttributes[s]:""}))}}R.accumulatorPropertyName="clStyleAttributes";const T="CONTENT_LOCKER";class L{static applyHostStyles(t,e,s=null,n){var r,l,a;const d=null===(l=null===(r=null==s?void 0:s.props)||void 0===r?void 0:r.handlers)||void 0===l?void 0:l.find((t=>"CLICK"===t.type));d&&(null===(a=d.actions)||void 0===a?void 0:a.length)&&(e.style.cursor="pointer"),t!==i&&t!==o&&t!==c||(e.style.display=n===T&&t===i?"flex":"inline-flex",e.style.position="relative"),e.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(t=""){this.styles=`${this.styles} ${t}`}getStyles(){return this.styles}}class P{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class N{constructor(t,e,s,i,n,o){this.hostElement=e,this.documentModel=t,this.getSharedCb=s,this.getPropsCb=i,this.getEnvCb=n,this.httpClient=o,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,s]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:s.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((s=>{var i,n,o,r,l;const a=null===(n=null===(i=e.adaptiveStyles)||void 0===i?void 0:i[t])||void 0===n?void 0:n.find((t=>t.element===s)),c=(null===(o=e.styles)||void 0===o?void 0:o.find((t=>t.element===s)))||{},d=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),h=this.parseBackground(d);h.url&&this.envUrlMaps[t].set(s,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,s])=>this.httpClient.execute(s.originalSVGResourceURL).then((t=>t.text())).then((i=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},s),{inlineSvgString:i}))}))))).then((()=>{var e;this._applyHostElementBackground(this.envUrlMaps[t].get("host"),null===(e=this.getSharedCb().theme)||void 0===e?void 0:e.schema)})).catch((t=>{console.error(t),P.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("THEME_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)})),this}_applyHostElementBackground(t,e={}){t&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(t,e){const s=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e.accent);return`url('data:image/svg+xml,${encodeURIComponent(s)}')${t.positionOptions}`}}const _=new class{execute(t,e,s=null,i,n){const o={method:e,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:n};return s&&(o.body="string"==typeof s?s:JSON.stringify(s)),fetch(t,o)}};function w(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,s)=>Object.assign(Object.assign({},e),{[s]:t[s]})),{})}class M{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}}class j{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}const k="COMPONENT_RESOURCES_LOADED",F="FAILED_TO_LOAD_COMPONENT_RESOURCE";class I{constructor(t,e,s){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(k,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(F,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=s,this.counters={pending:new j(this.onCounterStateUpdate)}}}const D=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>D(...t)}},U=D,B="props",W="shared",$="environment";function H(t,e,s,i){const n=t=>{let o=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return o&&(i&&"function"==typeof i?i(o.getAttribute(e)):(null===(r=null==o?void 0:o.getAttribute)||void 0===r?void 0:r.call(o,e))===s)?o:o&&o.parentNode&&n(o.parentNode)||null;var r};return n(t)}const G="SUBMIT";function V(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((s=>{"element"!==s&&"classes"!==s&&(e[s]&&"object"==typeof e[s]&&!Array.isArray(e[s])?t[s]=Object.assign(Object.assign({},t[s]||{}),e[s]):t[s]=e[s])})),t):t}function z(t,e,s){var i;return null===(i=t[e])||void 0===i?void 0:i.find((t=>t.element===s))}function Q(t){const{element:e,html:s,appendHtml:i}=t,n=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(s);i?e.innerHTML+=n:e.innerHTML=n}class q extends Event{constructor(t,e,s){super(t,s),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class J extends HTMLElement{constructor(){var i,n;super(),this.construct=()=>{let t;const e=this.getAttribute(s("id")),i=this.getWidgetContainerNode();if(!i)throw new Error("Widget container not found in construct");const n=i.closest(`[${s("widget-id")}]`);let o;n&&(o=n.getAttribute(s("widget-id")));let r=new q("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(s("path")),id:e,widgetId:o},{bubbles:!0,composed:!0});this.dispatchEvent(r),t=r.detail.props,Object.assign(this,t),this.observers=U(B,W,$),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach((t=>null==t?void 0:t.off()))}},this.state=new A,this.componentEventEmitter=new S,this.componentResourceManager=new I(this.model.id,this.services.eventEmitter,"STATIC"===this.services.config.getConfig("entryModuleType")),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new v(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(B).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),i=s("floating");t.floating&&!e.getAttribute(i)?e.setAttribute(i,"true"):!t.floating&&e.getAttribute(i)&&e.removeAttribute(i)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(W).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new N(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),_),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(x.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get($).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(B).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(W).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get($).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${s("element")}]`)).filter((t=>!t.hasAttribute(s("component"))))],this.getElement=(t,e)=>this.getElements().find((i=>e?i.getAttribute(s("element"))===t&&i.id===e:i.getAttribute(s("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const i=this.getElements();if(!i.length)return;t=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const s=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let i=!1,n=!1;s.desktop&&s.desktop.forEach((s=>{s.element===e&&(V(s,t),i=!0)})),s.mobile&&s.mobile.forEach((s=>{s.element===e&&(V(s,t),n=!0)})),!i&&s.desktop&&s.desktop.push(JSON.parse(JSON.stringify(t))),!n&&s.mobile&&s.mobile.push(JSON.parse(JSON.stringify(t)))})),s}(t,e);const n=s("type"),o="element-styles";let r=this.getRootElement().querySelector(`style[${n}="${o}"]`);r||(r=document.createElement("style"),r.setAttribute(n,o),this.getRootElement().appendChild(r)),Q({element:r,html:""}),i.forEach((e=>{let i=e.getAttribute(s("element"));const n=this.getEnvironment();let o=z(t,n,i);if(o){if(this.resizeListener.isMobile()){const e=z(t,"desktop",i);e&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),o.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(o),r)}})),this._addLinkColor(r,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[s,i]of Object.entries(e))t.style[s]=i;return!0},this.applyStylesToElement=(t,e,i)=>{var n,o;const r=[];"host"===(e=J._resolveTogglableStylesForElementModel(e)).element&&(L.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(n=this.model.props.backgroundDynamicInlineSVGElements)||void 0===n?void 0:n.desktop)||"mobile"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),r.push("background")));let l=e.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],O(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),O(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:w(e.styleAttributes,r)});if(R.set(t,c),this._setClassAttributes(t,e),i){if(e.hoverStyleAttributes){let n=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const s=t.tagName.toLowerCase(),i=`flip-up-animation-${e.element}`;let o=this.getRootElement().querySelector(`#${i}`);o||(o=document.createElement("style"),o.id=i,t.appendChild(o)),Q({element:o,html:`\n ${s}::before {\n content: '';\n background: ${n.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${s}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),n=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}n.borderTopWidth&&"0px"!==n.borderTopWidth||delete n.borderTopColor,n.borderBottomWidth&&"0px"!==n.borderBottomWidth||delete n.borderBottomColor,n.borderLeftWidth&&"0px"!==n.borderLeftWidth||delete n.borderLeftColor,n.borderRightWidth&&"0px"!==n.borderRightWidth||delete n.borderRightColor,this._addStylesToStyleElement(i,e.element,n,`:not(.${s("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(i,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(i,this.getShared()),this.stylesAppliedToElement(t,e,i)}},this._fixMarginOverflow=t=>{const e=this.getParentComponent(),i=e&&("flex"===e.style.display||"inline-flex"===e.style.display),n="host",o=t.getAttribute(s("element"))===n;if(!i||!o)return;const r=this.getProps(),l=this.getEnvironment(),{styleAttributes:a}=z(r.adaptiveStyles,l,n)||{};if(!a)return;const c=a.marginLeft||a.marginRight,d="100%"===a.width;if(c&&d){const e=(parseFloat(a.marginLeft)||0)+(parseFloat(a.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=e=>function(e,s){let i=e;return(i.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((t=>{var e;let n=null===(e=s.textClasses)||void 0===e?void 0:e[t];n&&(n.styleAttributes.fontFamily||(n.isHeader&&s.headerFontFamily&&(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:s.headerFontFamily})})),!n.isHeader&&s.textFontFamily&&(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:s.textFontFamily})}))),i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),n.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},i.placeholderStyleAttributes),n.placeholderStyleAttributes)}))})),i.styleAttributes.fontFamily||(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:s.textFontFamily})})),i}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,i,n="",o)=>{const r=Object.keys(i).reduce(((t,e)=>t+` ${M.camelCaseToDashCase(e)}: ${i[e]}${o?" !important;":";"}`),"");Q({element:t,html:`[${s("element")}="${e}"]${n} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{Q({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var s,i,n,o;e.linkColor&&Q({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(s=e.linkParams)||void 0===s?void 0:s.color)&&Q({element:t,html:`a {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(n=e.linkParams)||void 0===n?void 0:n.color}}`,appendHtml:!0}),(null===(o=e.linkParams)||void 0===o?void 0:o.removeUnderline)&&Q({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(s,i)=>{Array.from(s.classList).filter((t=>t!==e("hovered")&&t!==e("focused"))).forEach((e=>{e.startsWith(t)&&s.classList.remove(e)}));const n=((s.getAttribute("class")||"")+" "+i.classes).trim();s.setAttribute("class",n)},this.getParentComponent=()=>H(this.parentNode,s("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(s("path"));return t&&1===t.split(",").length?this.parentNode:H(this.parentNode,s("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>{return[(t=this.services.config).getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t));var t},this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,s)=>{if(e)return e;const i=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const s=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[s]?{translations:e[s],language:s}:null}(s,t);return i||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,s)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,s;const i=t.control.name;if(["email","first_name","last_name"].includes(i))return i.toUpperCase();if(t.content.label&&(null===(s=null===(e=t.adaptiveStyles.desktop.find((t=>"label"===t.element)))||void 0===e?void 0:e.params)||void 0===s?void 0:s.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return t.content.placeholder?this.capitalizeFirstLetter(t.content.placeholder):t.control.integrationName?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{switch(t.control.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},s=this.services.actionRegister.getRegisteredActions().find((t=>t.category===G));s?null==s||s.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:h}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>this.getProps().handlers&&this.getProps().handlers.length?[...this.getProps().handlers]:[],this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(i=this.define)||void 0===i?void 0:i.manifest)||(null===(n=this.constructor.define)||void 0===n?void 0:n.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=J._resolveTogglableStyles(e[t]))})),e}static _resolveTogglableStyles(t){const e=Object.assign({},t),s=(t,s,i)=>{s in e&&(t.forEach((t=>{t in e&&(e[t]=e[s]?e[t]:i)})),delete e[s])};return s(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),s(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}const K={name:"SysSlideComponent",componentType:"SLIDE",version:"1.0.0",focusParentOnClick:!0,preventDraggable:!0,propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0,params:{indentationType:"PADDING"}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0,params:{indentationType:"PADDING"}}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0}}]},events:{dispatch:[],listen:[]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1}}]},i18nPropPaths:["handlers,[id],actions,[id],params,link"],props:{content:{name:null},styles:[{element:"host",styleAttributes:{background:"#FFFFFF"},classes:""}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{display:"inline-flex",position:"relative",width:"100%",minWidth:null,height:"auto",minHeight:null,overflow:"hidden",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"20px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}],mobile:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:null,height:"auto",minHeight:null,overflow:"hidden",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"20px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}]}},waitForResourcesLoad:!0,resourcesPropPaths:[["adaptiveStyles",":ENV","styleAttributes","background"],["styles","styleAttributes","background"]],metaDescription:{label:{en:"Slide",ru:"Слайд",uk:"Слайд",es:"Diapositiva",fr:"Diapositive",de:"Slide",it:"Slide",pt:"Diapositivo",ro:"Slide",bg:"Слайд",cs:"Slide",el:"Slide",nl:"Slide",pl:"Slajd",sv:"Slide",tr:"Slide",ar:"Slide",zh:"Slide",da:"Slide",he:"Slide",fi:"Slide",hi:"Slide",hr:"Slide",hu:"Slide",id:"Slide",ja:"Slide",ko:"Slide",no:"Slide",sk:"Slide",sl:"Slide",sr:"Slide"}}};function Y(t){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(t)}function Z(t,e){for(var s=0;s<e.length;s++){var i=e[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,nt(i.key),i)}}function X(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(X=function(){return!!t})()}function tt(){return tt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,s){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=et(t)););return t}(t,e);if(i){var n=Object.getOwnPropertyDescriptor(i,e);return n.get?n.get.call(arguments.length<3?t:s):n.value}},tt.apply(null,arguments)}function et(t){return et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},et(t)}function st(t,e){return st=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},st(t,e)}function it(t,e,s){return(e=nt(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function nt(t){var e=function(t){if("object"!=Y(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,"string");if("object"!=Y(s))return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Y(e)?e:e+""}var ot=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),it(e=function(t,e,s){return e=et(e),function(t,e){if(e&&("object"==Y(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,X()?Reflect.construct(e,s||[],et(t).constructor):e.apply(t,s))}(this,t),"manifest",K),e.getRootElement().innerHTML="\n <style>\n :host {\n position: relative;\n flex: 0 0 100%;\n min-width: 20px;\n min-height: 20px;\n }\n </style>\n ",e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&st(t,e)}(t,J),e=t,s=[{key:"connectedCallback",value:function(){var e,s,i,n=this;(e=t,s=this,"function"==typeof(i=tt(et(1&3?e.prototype:e),"connectedCallback",s))?function(t){return i.apply(s,t)}:i)([]),this.observeProps((function(t,e){n.applyAutoAdaptiveStyles(e.adaptiveStyles,e.styles)}))}}],s&&Z(e.prototype,s),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,s}();it(ot,"define",{name:"sys-slide",model:K.name,manifest:K});export{ot as default};window.clComponentClass_SysSlideComponent=ot;