@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="cl-";function e(e){return t+e}function n(t){return"cl-"+t}const i="VIEW",s="MODULE",o="CONTAINER",r="INPUT",l="BUTTON",a="CONSENT",c="COLUMN",p="SUBSCRIBE_CONTACT",d="REQUEST",h="SHOW_WIDGET",u="OPEN_LINK",m="CLOSE_WIDGET";class g{static sortActions(t){const e={[m]:-1,[u]:-2,[h]:1,[p]:2,[d]: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=g.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,i){this.state=t;const s=i(),o=s.getAttribute(n("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(n("type"))));let i=0;for(;e[i]&&e[i].getAttribute(n("id"))!==o;){let t=e[i].getAttribute(n("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((s.shadowRoot||s).querySelectorAll(this.config.relativeSelector)):[s],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,i;try{for(var s,o=!0,r=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={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(n){e[n]=t[n]&&function(e){return new Promise((function(i,s){!function(t,e,n,i){Promise.resolve(i).then((function(e){t({value:e,done:n})}),e)}(i,s,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(s=await r.next()).done);){i=s.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||!(n=r.return)||await n.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 y="CLICK",f="COMPONENT_EVENT";class b{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 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 y:return new g(t,e);case f:return new b(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class E{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 O{constructor(){this.listeners=O.createDefaultListenersState()}emit(t,e,n=null){const i=this.listeners[t];i&&Object.values(i).forEach((i=>i(e,t,n))),Object.values(this.listeners["*"]).forEach((i=>i(e,t,n)))}on(t,e){const n=E.generate(),i=this.listeners[t];return i?i[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,i;(null===(i=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===i?void 0:i[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=O.createDefaultListenersState()}}O.createDefaultListenersState=()=>({"*":{}});const T=(t,e,n,i)=>{const{addEventListenerBase:s,addEventListener:o}=EventTarget.prototype;(s||o).call(t,e,n,i)};class S{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class A{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===s?Object.assign(Object.assign({},t),A.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})}}A.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class x extends O{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 C{static set(t,e){const n=t[C.accumulatorPropertyName]||{};t[C.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[C.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}C.accumulatorPropertyName="clStyleAttributes";const R="CONTENT_LOCKER";class N{static applyHostStyles(t,e,n=null,s){var r,l,a;const p=null===(l=null===(r=null==n?void 0:n.props)||void 0===r?void 0:r.handlers)||void 0===l?void 0:l.find((t=>"CLICK"===t.type));p&&(null===(a=p.actions)||void 0===a?void 0:a.length)&&(e.style.cursor="pointer"),t!==i&&t!==o&&t!==c||(e.style.display=s===R&&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 w{constructor(t,e,n,i,s,o){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=i,this.getEnvCb=s,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,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 i,s,o,r,l;const a=null===(s=null===(i=e.adaptiveStyles)||void 0===i?void 0:i[t])||void 0===s?void 0:s.find((t=>t.element===n)),c=(null===(o=e.styles)||void 0===o?void 0:o.find((t=>t.element===n)))||{},p=(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),d=this.parseBackground(p);d.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:d.url,inlineSvgString:null,positionOptions:d.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((t=>t.text())).then((i=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{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 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 L=new class{execute(t,e,n=null,i,s){const o={method:e,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:s};return n&&(o.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,o)}};function _(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class j{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 M{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",I="FAILED_TO_LOAD_COMPONENT_RESOURCE";class D{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(k,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(I,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new M(this.onCounterStateUpdate)}}}const F=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>F(...t)}},U=F,W="props",B="shared",$="environment";function H(t,e,n,i){const s=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))===n)?o:o&&o.parentNode&&s(o.parentNode)||null;var r};return s(t)}const G="SUBMIT";function z(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}function V(t,e,n){var i;return null===(i=t[e])||void 0===i?void 0:i.find((t=>t.element===n))}function q(t){const{element:e,html:n,appendHtml:i}=t,s=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);i?e.innerHTML+=s:e.innerHTML=s}class K extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class Q extends HTMLElement{constructor(){var i,s;super(),this.construct=()=>{let t;const e=this.getAttribute(n("id")),i=this.getWidgetContainerNode();if(!i)throw new Error("Widget container not found in construct");const s=i.closest(`[${n("widget-id")}]`);let o;s&&(o=s.getAttribute(n("widget-id")));let r=new K("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("path")),id:e,widgetId:o},{bubbles:!0,composed:!0});this.dispatchEvent(r),t=r.detail.props,Object.assign(this,t),this.observers=U(W,B,$),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 S,this.componentEventEmitter=new O,this.componentResourceManager=new D(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(W).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),i=n("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(B).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new w(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),L),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(W).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(B).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(`[${n("element")}]`)).filter((t=>!t.hasAttribute(n("component"))))],this.getElement=(t,e)=>this.getElements().find((i=>e?i.getAttribute(n("element"))===t&&i.id===e:i.getAttribute(n("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 n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let i=!1,s=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(z(n,t),i=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(z(n,t),s=!0)})),!i&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!s&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e);const s=n("type"),o="element-styles";let r=this.getRootElement().querySelector(`style[${s}="${o}"]`);r||(r=document.createElement("style"),r.setAttribute(s,o),this.getRootElement().appendChild(r)),q({element:r,html:""}),i.forEach((e=>{let i=e.getAttribute(n("element"));const s=this.getEnvironment();let o=V(t,s,i);if(o){if(this.resizeListener.isMobile()){const e=V(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[n,i]of Object.entries(e))t.style[n]=i;return!0},this.applyStylesToElement=(t,e,i)=>{var s,o;const r=[];"host"===(e=Q._resolveTogglableStylesForElementModel(e)).element&&(N.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(s=this.model.props.backgroundDynamicInlineSVGElements)||void 0===s?void 0:s.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],T(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),T(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:_(e.styleAttributes,r)});if(C.set(t,c),this._setClassAttributes(t,e),i){if(e.hoverStyleAttributes){let s=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(),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 ${n}::before {\n content: '';\n background: ${s.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 `}),s=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}s.borderTopWidth&&"0px"!==s.borderTopWidth||delete s.borderTopColor,s.borderBottomWidth&&"0px"!==s.borderBottomWidth||delete s.borderBottomColor,s.borderLeftWidth&&"0px"!==s.borderLeftWidth||delete s.borderLeftColor,s.borderRightWidth&&"0px"!==s.borderRightWidth||delete s.borderRightColor,this._addStylesToStyleElement(i,e.element,s,`:not(.${n("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),s="host",o=t.getAttribute(n("element"))===s;if(!i||!o)return;const r=this.getProps(),l=this.getEnvironment(),{styleAttributes:a}=V(r.adaptiveStyles,l,s)||{};if(!a)return;const c=a.marginLeft||a.marginRight,p="100%"===a.width;if(c&&p){const e=(parseFloat(a.marginLeft)||0)+(parseFloat(a.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=e=>function(e,n){let i=e;return(i.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((t=>{var e;let s=null===(e=n.textClasses)||void 0===e?void 0:e[t];s&&(s.styleAttributes.fontFamily||(s.isHeader&&n.headerFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:n.headerFontFamily})})),!s.isHeader&&n.textFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:n.textFontFamily})}))),i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),s.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},i.placeholderStyleAttributes),s.placeholderStyleAttributes)}))})),i.styleAttributes.fontFamily||(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.textFontFamily})})),i}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,i,s="",o)=>{const r=Object.keys(i).reduce(((t,e)=>t+` ${j.camelCaseToDashCase(e)}: ${i[e]}${o?" !important;":";"}`),"");q({element:t,html:`[${n("element")}="${e}"]${s} { ${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 n,i,s,o;e.linkColor&&q({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)&&q({element:t,html:`a {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(s=e.linkParams)||void 0===s?void 0:s.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=(n,i)=>{Array.from(n.classList).filter((t=>t!==e("hovered")&&t!==e("focused"))).forEach((e=>{e.startsWith(t)&&n.classList.remove(e)}));const s=((n.getAttribute("class")||"")+" "+i.classes).trim();n.setAttribute("class",s)},this.getParentComponent=()=>H(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(n("path"));return t&&1===t.split(",").length?this.parentNode:H(this.parentNode,n("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,n)=>{if(e)return e;const i=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 i||null}),null)}(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 i=t.control.name;if(["email","first_name","last_name"].includes(i))return i.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===G));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:d}).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===(s=this.constructor.define)||void 0===s?void 0:s.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]=Q._resolveTogglableStyles(e[t]))})),e}static _resolveTogglableStyles(t){const e=Object.assign({},t),n=(t,n,i)=>{n in e&&(t.forEach((t=>{t in e&&(e[t]=e[n]?e[t]:i)})),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}const X={name:"SysTextComponent",componentType:"TEXT",version:"1.0.0",events:{dispatch:[],listen:[]},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:"host",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:"host",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:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["hug"]}},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"text",isLineSpaceAvailable:!0,isTextTransformAvailable:!0}]},{type:"CONTROL",name:"INSERT_BLOCK",params:[{element:"text",label:"DOCUMENT_TEXT",isLinkAvailable:!0,origin:!0}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=host]","styleAttributes"],params:{onlyColorSelection:!0},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"text",params:{indentationType:"PADDING"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["hug"]}},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"text",isLineSpaceAvailable:!0,isTextTransformAvailable:!0}]},{type:"CONTROL",name:"INSERT_BLOCK",params:[{element:"text",label:"DOCUMENT_TEXT",isLinkAvailable:!0,origin:!0}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=host]","styleAttributes"],params:{onlyColorSelection:!0},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"text",params:{indentationType:"PADDING"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"}]}]},autoContrast:[{slave:{element:"text",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"host",propPath:["styles","[element=host]","styleAttributes","background"]},enabledPropPath:["content","textContrastEnabled"]}],i18nPropPaths:["content,text","content,textrollers","content,mergeTags"],i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"INSERT_BLOCK",params:[{element:"text",label:"DOCUMENT_TEXT",isLinkAvailable:!0,origin:!1}]}]},props:{styles:[{element:"host",styleAttributes:{background:"transparent"}}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{width:"100%",minWidth:null,height:"auto",minHeight:null,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1}},{element:"text",styleAttributes:{paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,color:"rgb(50, 66, 67)",textAlign:"start",lineHeight:"120%",fontWeight:"500",fontSize:"16px",textShadow:"none"},classes:""}],mobile:[{element:"host",styleAttributes:{width:"100%",minWidth:null,height:"auto",minHeight:null,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1}},{element:"text",styleAttributes:{paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,color:"rgb(50, 66, 67)",textAlign:"start",lineHeight:"120%",fontWeight:"500",fontSize:"16px",textShadow:"none"},classes:""}]},content:{text:"Text",textContrastEnabled:!0}},metaDescription:{icon:"/SysTextComponent/assets/img/text-component-icon.svg",label:{en:"Text",ru:"Текст",uk:"Текст",es:"Texto",de:"Text",fr:"Texte",it:"Testo",pt:"Texto",ro:"Text",bg:"Текст",cs:"Text",el:"Κείμενο",nl:"Tekst",pl:"Tekst",sv:"Text",tr:"Metin",ar:"النَّص",zh:"文本字段",da:"Tekst",he:"טקסט",fi:"Teksti",hi:"टेक्स्ट",hr:"Tekst",hu:"Szöveg",id:"Teks",ja:"テキスト",ko:"텍스트",no:"Tekst",sk:"Text",sl:"Besedilo",sr:"Tekst"}}};function Y(t,e=1){return t.reduce(((t,n)=>Array.isArray(n)&&e>=1?t.concat(Y(n,e-1)):t.concat(n)),[])}function Z(t){return Z="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},Z(t)}function J(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,s,o,r,l=[],a=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;a=!1}else for(;!(a=(i=o.call(n)).done)&&(l.push(i.value),l.length!==e);a=!0);}catch(t){c=!0,s=t}finally{try{if(!a&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(c)throw s}}return l}}(t,e)||tt(t,e)||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.")}()}function tt(t,e){if(t){if("string"==typeof t)return et(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)?et(t,e):void 0}}function et(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function nt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function it(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?nt(Object(n),!0).forEach((function(e){st(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function st(t,e,n){return(e=function(t){var e=function(t){if("object"!=Z(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Z(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Z(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ot={maxWidth:"100%",width:"fit-content",display:"inline-flex",fontFamily:"inherit"},rt={padding:"0 5px",display:"inline-block",maxWidth:"calc(100% - 0px)",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},lt={display:"inline-flex",justifyContent:"center",minHeight:"fit-content"};function at(t,e){var n=e.id,i=dt(e.options),s=it(it({},rt),e.styleAttributes),o=e.options.map((function(e){var n=document.createElement("span");n.classList.add("opt");var o=document.createElement("span");o.innerText=e,n.appendChild(o);var r=window.getComputedStyle(t.parentElement);return ct(o,s),ct(n,{display:"inline-flex",justifyContent:r["text-align"]||lt.justifyContent},i,s),n})),r=it({},ot),l=document.createElement("span");l.classList.add("container"),ct(l,{paddingLeft:e.styleAttributes.borderLeftWidth||0,paddingRight:e.styleAttributes.borderRightWidth||0,paddingTop:e.styleAttributes.borderTopWidth||0,paddingBottom:e.styleAttributes.borderBottomWidth||0});var a=document.createElement("span");a.innerText=i,ct(a,it(it({},s),{},{visibility:"hidden"}));var c=document.createElement("span");c.classList.add("opts"),o.forEach((function(t){c.appendChild(t)})),l.append(a,c),q({element:t,html:""}),t.appendChild(l),ct(t,r);var p=l.querySelectorAll(".opt")[0].offsetHeight,d="".concat(p,"px");l.style.height=d,a.style.height=d,t.classList.add("container--staticTextRoller");var h=function(t){var e,n=1e3*(t.animationSpeedInSec||1),i=Math.max.apply(Math,function(t){if(Array.isArray(t))return et(t)}(e=t.options.map((function(t){return t.replace(/\s+/g,"").length})))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||tt(e)||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.")}()),s=Math.max(Math.ceil(i/15),1),o=t.options.length;return{optionTimePercentage:100/o,duration:o*(s*n+500),longestOptionFractions:s}}(e);return function(t,e,n){var i=1*(e.options.length-1),s=n.longestOptionFractions>1?1.5:3,o=n.optionTimePercentage/s,r=Y(e.options.map((function(t,e){return"\n ".concat(e*n.optionTimePercentage,"% {\n transform: translateY(calc(").concat(100*e,"% + ").concat(1*e,"px));\n }\n ").concat(e*n.optionTimePercentage+o,"% {\n transform: translateY(calc(").concat(100*e,"% + ").concat(1*e,"px));\n }")}))).concat("\n 100% {\n transform: translateY(calc(".concat(100*e.options.length,"% + ").concat(i,"px));\n }\n ")).join("\n"),l=document.createElement("style");q({element:l,html:"@keyframes slide-down {".concat(r,"}")});var a=t.querySelector(".opt").cloneNode(!0);t.appendChild(l),t.querySelector(".opts").appendChild(a)}(t,e,h),function(t,e,n){var i=n.duration/1e3;e.options.length>1?t.style.animation="slide-down ".concat(i,"s infinite"):(t.style.transform="translateY(0%)",t.querySelectorAll(".opt")[0].style.display="none")}(c,e,h),{element:t,id:n}}function ct(t,e,n,i,s){var o={};if(n){var r=pt(n,e,i);o={minWidth:"".concat(r>s?r:Math.min(r,s),"px")}}Object.entries(it(it({},o),e)||{}).forEach((function(e){var n=J(e,2),i=n[0],s=n[1];t.style[i]=s}))}function pt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=document.createElement("span"),s=document.createElement("span");s.innerText=t,i.appendChild(s);for(var o=0,r=Object.entries(n);o<r.length;o++){var l=J(r[o],2),a=l[0],c=l[1];s.style[a]=c}for(var p=0,d=Object.entries(e);p<d.length;p++){var h=J(d[p],2),u=h[0],m=h[1];i.style[u]=m}i.style.visibility="hidden",document.body.appendChild(i);var g=i.getBoundingClientRect().width;return document.body.removeChild(i),g}function dt(t){return t.map((function(t){return{value:t,width:pt(t)}})).sort((function(t,e){return e.width-t.width})).at(0).value}function ht(t){return ht="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},ht(t)}function ut(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,vt(i.key),i)}}function mt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(mt=function(){return!!t})()}function gt(){return gt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=yt(t)););return t}(t,e);if(i){var s=Object.getOwnPropertyDescriptor(i,e);return s.get?s.get.call(arguments.length<3?t:n):s.value}},gt.apply(null,arguments)}function yt(t){return yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},yt(t)}function ft(t,e){return ft=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ft(t,e)}function bt(t,e,n){return(e=vt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function vt(t){var e=function(t){if("object"!=ht(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ht(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ht(e)?e:e+""}var Et=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),bt(e=function(t,e,n){return e=yt(e),function(t,e){if(e&&("object"==ht(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,mt()?Reflect.construct(e,n||[],yt(t).constructor):e.apply(t,n))}(this,t),"manifest",X),bt(e,"processTextRoller",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.getElement("text");if(n){var i="STATIC"===e.services.config.getConfig("entryModuleType");n.childNodes.forEach((function(e){if(e.nodeType!==Node.TEXT_NODE&&"TEXT_ROLLER"===e.getAttribute("cl-type")){var n=e.getAttribute("cl-id"),s=t[n];if(!s)return;i?at(e,s):function(t,e){var n=e.id,i=document.createElement("span");i.classList.add("outer");var s=dt(e.options),o=document.createElement("span");o.classList.add("inner"),o.textContent=e.options.at(0)||"Option 1",o.setAttribute("contenteditable","false"),i.appendChild(o);var r,l,a,c=window.getComputedStyle(t.parentElement),p=(r=c,l={},a=["font-size","font-weight","font-style","font-family","text-align","text-shadow","letter-spacing","line-height"],Object.keys(r).forEach((function(t){if(Number.isInteger(Number(t))){var e=r[t];a.includes(e)&&(l[e]=r.getPropertyValue(e))}})),l),d=it(it(it({},rt),e.styleAttributes),p);ct(o,d),ct(i,it(it({},lt),{},{borderRadius:o.style["border-radius"]||lt.borderRadius,justifyContent:c["text-align"]||lt.justifyContent}),s,d,parseFloat(c.width)),q({element:t,html:""}),ct(t,it({},ot)),t.appendChild(i)}(e,s)}}))}})),bt(e,"stylesAppliedToElement",(function(t,e){"text"===e.element&&e.styleAttributes.textAlign&&"flex"===getComputedStyle(t).display&&(t.style.justifyContent="center"===e.styleAttributes.textAlign?"center":"flex-".concat(e.styleAttributes.textAlign))})),e.getRootElement().innerHTML='\n <style>\n .text {\n outline: none;\n min-height: fit-content;\n width: 100%;\n overflow-wrap: break-word;\n }\n </style>\n \n <style>\n [cl-type="TEXT_ROLLER"] {\n position: relative;\n }\n\n .text {\n align-items: center;\n }\n \n .container--staticTextRoller {\n display: inline-flex;\n max-width: 100%;\n width: fit-content;\n }\n \n .container {\n display: inline-flex;\n align-items: center;\n overflow: hidden;\n position: relative;\n height: 100%;\n }\n\n .opts {\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n left: 0;\n z-index: 1;\n padding: 0;\n margin: 0;\n display: flex;\n gap: 1px;\n flex-direction: column-reverse;\n transform: translateY(-100%);\n }\n \n .opt {\n width: 100%;\n height: 100%;\n text-align: center;\n display: inline-flex;\n justify-content: center;\n }\n \n .opt span {\n white-space: nowrap;\n align-items: center;\n text-overflow: ellipsis;\n overflow: hidden;\n width: fit-content;\n max-width: 100%;\n padding: 0 2px;\n }\n </style>\n\n <div class="text" cl-element="text" cl-inline-edit="content, text"></div>\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&&ft(t,e)}(t,Q),e=t,n=[{key:"connectedCallback",value:function(){var e,n,i,s=this;(e=t,n=this,"function"==typeof(i=gt(yt(1&3?e.prototype:e),"connectedCallback",n))?function(t){return i.apply(n,t)}:i)([]),this.observeProps((function(t,e){var n,i,o;s.applyAutoAdaptiveStyles(e.adaptiveStyles,e.styles),null!==(n=e.content)&&void 0!==n&&n.text&&s.getElement("text")&&(q({element:s.getElement("text"),html:null===(o=e.content)||void 0===o?void 0:o.text}),s.mergeTagsProcessor.process(s.getElement("text"),e.content.mergeTags,s.getModel().id)),s.processTextRoller(null===(i=e.content)||void 0===i?void 0:i.textrollers)})),this.observeShared((function(){var t,e=s.getProps();s.processTextRoller(null===(t=e.content)||void 0===t?void 0:t.textrollers)}))}}],n&&ut(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();bt(Et,"define",{name:"sys-text",model:X.name,manifest:X});export{Et as default};window.clComponentClass_SysTextComponent=Et;
1
+ const t="cl-";function e(e){return t+e}function n(t){return"cl-"+t}const i="VIEW",s="MODULE",o="CONTAINER",r="INPUT",a="BUTTON",l="CONSENT",c="COLUMN",d="SUBSCRIBE_CONTACT",p="REQUEST",u="SHOW_WIDGET",h="OPEN_LINK",m="CLOSE_WIDGET";class g{static sortActions(t){const e={[m]:-1,[h]:-2,[u]:1,[d]:2,[p]: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=g.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,i){this.state=t;const s=i(),o=s.getAttribute(n("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(n("type"))));let i=0;for(;e[i]&&e[i].getAttribute(n("id"))!==o;){let t=e[i].getAttribute(n("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((s.shadowRoot||s).querySelectorAll(this.config.relativeSelector)):[s],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,i;try{for(var s,o=!0,r=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={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(n){e[n]=t[n]&&function(e){return new Promise((function(i,s){!function(t,e,n,i){Promise.resolve(i).then((function(e){t({value:e,done:n})}),e)}(i,s,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(s=await r.next()).done);){i=s.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||!(n=r.return)||await n.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=[a,l,r];const y="CLICK",b="COMPONENT_EVENT";class f{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 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 y:return new g(t,e);case b:return new f(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class E{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 O{constructor(){this.listeners=O.createDefaultListenersState()}emit(t,e,n=null){const i=this.listeners[t];i&&Object.values(i).forEach((i=>i(e,t,n))),Object.values(this.listeners["*"]).forEach((i=>i(e,t,n)))}on(t,e){const n=E.generate(),i=this.listeners[t];return i?i[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,i;(null===(i=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===i?void 0:i[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=O.createDefaultListenersState()}}O.createDefaultListenersState=()=>({"*":{}});const T=(t,e,n,i)=>{const{addEventListenerBase:s,addEventListener:o}=EventTarget.prototype;(s||o).call(t,e,n,i)};class S{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class A{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===s?Object.assign(Object.assign({},t),A.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})}}A.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class x extends O{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 C{static set(t,e){const n=t[C.accumulatorPropertyName]||{};t[C.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[C.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}C.accumulatorPropertyName="clStyleAttributes";const R="CONTENT_LOCKER";class P{static applyHostStyles(t,e,n=null,s){var r,a,l;const d=null===(a=null===(r=null==n?void 0:n.props)||void 0===r?void 0:r.handlers)||void 0===a?void 0:a.find((t=>"CLICK"===t.type));d&&(null===(l=d.actions)||void 0===l?void 0:l.length)&&(e.style.cursor="pointer"),t!==i&&t!==o&&t!==c||(e.style.display=s===R&&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 N{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class w{constructor(t,e,n,i,s,o){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=i,this.getEnvCb=s,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,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 i,s,o,r,a;const l=null===(s=null===(i=e.adaptiveStyles)||void 0===i?void 0:i[t])||void 0===s?void 0:s.find((t=>t.element===n)),c=(null===(o=e.styles)||void 0===o?void 0:o.find((t=>t.element===n)))||{},d=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(a=null==l?void 0:l.styleAttributes)||void 0===a?void 0:a.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((i=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{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),N.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 L=new class{execute(t,e,n=null,i,s){const o={method:e,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:s};return n&&(o.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,o)}};function j(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class _{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 M{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",I="FAILED_TO_LOAD_COMPONENT_RESOURCE";class D{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(k,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(I,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new M(this.onCounterStateUpdate)}}}const F=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>F(...t)}},U=F,B="props",W="shared",$="environment";function H(t,e,n,i){const s=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))===n)?o:o&&o.parentNode&&s(o.parentNode)||null;var r};return s(t)}const G="SUBMIT";function z(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 V={DESKTOP:"desktop",MOBILE:"mobile"};function K(t,e,n){var i;return null===(i=t[e])||void 0===i?void 0:i.find((t=>t.element===n))}function q(t=[]){return t.map((t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)})))}function Q(t){const{element:e,html:n,appendHtml:i}=t,s=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);i?e.innerHTML+=s:e.innerHTML=s}class X extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class Y extends HTMLElement{constructor(){var i,s;super(),this.construct=()=>{let t;const e=this.getAttribute(n("id")),i=this.getWidgetContainerNode();if(!i)throw new Error("Widget container not found in construct");const s=i.closest(`[${n("widget-id")}]`);let o;s&&(o=s.getAttribute(n("widget-id")));let r=new X("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("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 S,this.componentEventEmitter=new O,this.componentResourceManager=new D(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=n("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 w(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),L),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(`[${n("element")}]`)).filter((t=>!t.hasAttribute(n("component"))))],this.getElement=(t,e)=>this.getElements().find((i=>e?i.getAttribute(n("element"))===t&&i.id===e:i.getAttribute(n("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 n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let i=!1,s=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(z(n,t),i=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(z(n,t),s=!0)})),!i&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!s&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e);const s=n("type"),o="element-styles";let r=this.getRootElement().querySelector(`style[${s}="${o}"]`);r||(r=document.createElement("style"),r.setAttribute(s,o),this.getRootElement().appendChild(r)),Q({element:r,html:""}),i.forEach((e=>{let i=e.getAttribute(n("element"));const s=this.getEnvironment();let o=K(t,s,i);if(o){if(this.resizeListener.isMobile()){const e=K(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[n,i]of Object.entries(e))t.style[n]=i;return!0},this.applyStylesToElement=(t,e,i)=>{var s,o;const r=[];"host"===(e=Y._resolveTogglableStylesForElementModel(e)).element&&(P.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(s=this.model.props.backgroundDynamicInlineSVGElements)||void 0===s?void 0:s.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 a=e.styleAttributes.background,l=a&&a.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&l){this.componentResourceManager.getPending().increment();const t=new Image;t.src=l[1],T(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),T(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:j(e.styleAttributes,r)});if(C.set(t,c),this._setClassAttributes(t,e),i){if(e.hoverStyleAttributes){let s=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(),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 ${n}::before {\n content: '';\n background: ${s.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 `}),s=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}s.borderTopWidth&&"0px"!==s.borderTopWidth||delete s.borderTopColor,s.borderBottomWidth&&"0px"!==s.borderBottomWidth||delete s.borderBottomColor,s.borderLeftWidth&&"0px"!==s.borderLeftWidth||delete s.borderLeftColor,s.borderRightWidth&&"0px"!==s.borderRightWidth||delete s.borderRightColor,this._addStylesToStyleElement(i,e.element,s,`:not(.${n("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),s="host",o=t.getAttribute(n("element"))===s;if(!i||!o)return;const r=this.getProps(),a=this.getEnvironment(),{styleAttributes:l}=K(r.adaptiveStyles,a,s)||{};if(!l)return;const c=l.marginLeft||l.marginRight,d="100%"===l.width;if(c&&d){const e=(parseFloat(l.marginLeft)||0)+(parseFloat(l.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=e=>function(e,n){let i=e;return(i.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((t=>{var e;let s=null===(e=n.textClasses)||void 0===e?void 0:e[t];s&&(s.styleAttributes.fontFamily||(s.isHeader&&n.headerFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:n.headerFontFamily})})),!s.isHeader&&n.textFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:n.textFontFamily})}))),i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),s.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},i.placeholderStyleAttributes),s.placeholderStyleAttributes)}))})),i.styleAttributes.fontFamily||(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.textFontFamily})})),i}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,i,s="",o)=>{const r=Object.keys(i).reduce(((t,e)=>t+` ${_.camelCaseToDashCase(e)}: ${i[e]}${o?" !important;":";"}`),"");Q({element:t,html:`[${n("element")}="${e}"]${s} { ${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 n,i,s,o;e.linkColor&&Q({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)&&Q({element:t,html:`a {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(s=e.linkParams)||void 0===s?void 0:s.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=(n,i)=>{Array.from(n.classList).filter((t=>t!==e("hovered")&&t!==e("focused"))).forEach((e=>{e.startsWith(t)&&n.classList.remove(e)}));const s=((n.getAttribute("class")||"")+" "+i.classes).trim();n.setAttribute("class",s)},this.getParentComponent=()=>H(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(n("path"));return t&&1===t.split(",").length?this.parentNode:H(this.parentNode,n("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,n)=>{if(e)return e;const i=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 i||null}),null)}(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 i=t.control.name;if(["email","first_name","last_name"].includes(i))return i.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===G));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:p}).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===(s=this.constructor.define)||void 0===s?void 0:s.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]=Y._resolveTogglableStyles(e[t]))})),e}static _resolveTogglableStyles(t){const e=Object.assign({},t),n=(t,n,i)=>{n in e&&(t.forEach((t=>{t in e&&(e[t]=e[n]?e[t]:i)})),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}const Z={name:"SysTextComponent",componentType:"TEXT",version:"1.0.0",events:{dispatch:[],listen:[]},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:"host",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:"host",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:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["hug"]}},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"text",isLineSpaceAvailable:!0,isTextTransformAvailable:!0}]},{type:"CONTROL",name:"INSERT_BLOCK",params:[{element:"text",label:"DOCUMENT_TEXT",isLinkAvailable:!0,origin:!0}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=host]","styleAttributes"],params:{onlyColorSelection:!0},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"text",params:{indentationType:"PADDING"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["hug"]}},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"text",isLineSpaceAvailable:!0,isTextTransformAvailable:!0}]},{type:"CONTROL",name:"INSERT_BLOCK",params:[{element:"text",label:"DOCUMENT_TEXT",isLinkAvailable:!0,origin:!0}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=host]","styleAttributes"],params:{onlyColorSelection:!0},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"text",params:{indentationType:"PADDING"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"}]}]},autoContrast:[{slave:{element:"text",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"host",propPath:["styles","[element=host]","styleAttributes","background"]},enabledPropPath:["content","textContrastEnabled"]}],i18nPropPaths:["content,text","content,textrollers","content,mergeTags"],i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"INSERT_BLOCK",params:[{element:"text",label:"DOCUMENT_TEXT",isLinkAvailable:!0,origin:!1}]}]},props:{styles:[{element:"host",styleAttributes:{background:"transparent"}}],adaptiveStyles:(J=[{element:"host",styleAttributes:{width:"100%",minWidth:null,height:"auto",minHeight:null,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1}},{element:"text",styleAttributes:{paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,color:"var(--cl-schema-text, rgb(50, 66, 67))",textAlign:"start",lineHeight:"120%",fontWeight:"500",fontSize:"16px",textShadow:"none"},classes:""}],Object.values(V).reduce(((t,e)=>Object.assign(t,{[e]:q(J)})),{[V.DESKTOP]:[],[V.MOBILE]:[]})),content:{text:"Text",textContrastEnabled:!0}},metaDescription:{icon:"/SysTextComponent/assets/img/text-component-icon.svg",label:{en:"Text",ru:"Текст",uk:"Текст",es:"Texto",de:"Text",fr:"Texte",it:"Testo",pt:"Texto",ro:"Text",bg:"Текст",cs:"Text",el:"Κείμενο",nl:"Tekst",pl:"Tekst",sv:"Text",tr:"Metin",ar:"النَّص",zh:"文本字段",da:"Tekst",he:"טקסט",fi:"Teksti",hi:"टेक्स्ट",hr:"Tekst",hu:"Szöveg",id:"Teks",ja:"テキスト",ko:"텍스트",no:"Tekst",sk:"Text",sl:"Besedilo",sr:"Tekst"}}};var J;function tt(t,e=1){return t.reduce(((t,n)=>Array.isArray(n)&&e>=1?t.concat(tt(n,e-1)):t.concat(n)),[])}function et(t){return et="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},et(t)}function nt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,s,o,r,a=[],l=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){c=!0,s=t}finally{try{if(!l&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(c)throw s}}return a}}(t,e)||it(t,e)||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.")}()}function it(t,e){if(t){if("string"==typeof t)return st(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)?st(t,e):void 0}}function st(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function ot(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function rt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ot(Object(n),!0).forEach((function(e){at(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ot(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function at(t,e,n){return(e=function(t){var e=function(t){if("object"!=et(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=et(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==et(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var lt={maxWidth:"100%",width:"fit-content",display:"inline-flex",fontFamily:"inherit"},ct={padding:"0 5px",display:"inline-block",maxWidth:"calc(100% - 0px)",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},dt={display:"inline-flex",justifyContent:"center",minHeight:"fit-content"};function pt(t,e){var n=e.id,i=mt(e.options),s=rt(rt({},ct),e.styleAttributes),o=e.options.map((function(e){var n=document.createElement("span");n.classList.add("opt");var o=document.createElement("span");o.innerText=e,n.appendChild(o);var r=window.getComputedStyle(t.parentElement);return ut(o,s),ut(n,{display:"inline-flex",justifyContent:r["text-align"]||dt.justifyContent},i,s),n})),r=rt({},lt),a=document.createElement("span");a.classList.add("container"),ut(a,{paddingLeft:e.styleAttributes.borderLeftWidth||0,paddingRight:e.styleAttributes.borderRightWidth||0,paddingTop:e.styleAttributes.borderTopWidth||0,paddingBottom:e.styleAttributes.borderBottomWidth||0});var l=document.createElement("span");l.innerText=i,ut(l,rt(rt({},s),{},{visibility:"hidden"}));var c=document.createElement("span");c.classList.add("opts"),o.forEach((function(t){c.appendChild(t)})),a.append(l,c),Q({element:t,html:""}),t.appendChild(a),ut(t,r);var d=a.querySelectorAll(".opt")[0].offsetHeight,p="".concat(d,"px");a.style.height=p,l.style.height=p,t.classList.add("container--staticTextRoller");var u=function(t){var e,n=1e3*(t.animationSpeedInSec||1),i=Math.max.apply(Math,function(t){if(Array.isArray(t))return st(t)}(e=t.options.map((function(t){return t.replace(/\s+/g,"").length})))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||it(e)||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.")}()),s=Math.max(Math.ceil(i/15),1),o=t.options.length;return{optionTimePercentage:100/o,duration:o*(s*n+500),longestOptionFractions:s}}(e);return function(t,e,n){var i=1*(e.options.length-1),s=n.longestOptionFractions>1?1.5:3,o=n.optionTimePercentage/s,r=tt(e.options.map((function(t,e){return"\n ".concat(e*n.optionTimePercentage,"% {\n transform: translateY(calc(").concat(100*e,"% + ").concat(1*e,"px));\n }\n ").concat(e*n.optionTimePercentage+o,"% {\n transform: translateY(calc(").concat(100*e,"% + ").concat(1*e,"px));\n }")}))).concat("\n 100% {\n transform: translateY(calc(".concat(100*e.options.length,"% + ").concat(i,"px));\n }\n ")).join("\n"),a=document.createElement("style");Q({element:a,html:"@keyframes slide-down {".concat(r,"}")});var l=t.querySelector(".opt").cloneNode(!0);t.appendChild(a),t.querySelector(".opts").appendChild(l)}(t,e,u),function(t,e,n){var i=n.duration/1e3;e.options.length>1?t.style.animation="slide-down ".concat(i,"s infinite"):(t.style.transform="translateY(0%)",t.querySelectorAll(".opt")[0].style.display="none")}(c,e,u),{element:t,id:n}}function ut(t,e,n,i,s){var o={};if(n){var r=ht(n,e,i);o={minWidth:"".concat(r>s?r:Math.min(r,s),"px")}}Object.entries(rt(rt({},o),e)||{}).forEach((function(e){var n=nt(e,2),i=n[0],s=n[1];t.style[i]=s}))}function ht(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=document.createElement("span"),s=document.createElement("span");s.innerText=t,i.appendChild(s);for(var o=0,r=Object.entries(n);o<r.length;o++){var a=nt(r[o],2),l=a[0],c=a[1];s.style[l]=c}for(var d=0,p=Object.entries(e);d<p.length;d++){var u=nt(p[d],2),h=u[0],m=u[1];i.style[h]=m}i.style.visibility="hidden",document.body.appendChild(i);var g=i.getBoundingClientRect().width;return document.body.removeChild(i),g}function mt(t){return t.map((function(t){return{value:t,width:ht(t)}})).sort((function(t,e){return e.width-t.width})).at(0).value}function gt(t){return gt="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},gt(t)}function yt(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Tt(i.key),i)}}function bt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(bt=function(){return!!t})()}function ft(){return ft="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=vt(t)););return t}(t,e);if(i){var s=Object.getOwnPropertyDescriptor(i,e);return s.get?s.get.call(arguments.length<3?t:n):s.value}},ft.apply(null,arguments)}function vt(t){return vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},vt(t)}function Et(t,e){return Et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Et(t,e)}function Ot(t,e,n){return(e=Tt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tt(t){var e=function(t){if("object"!=gt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=gt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==gt(e)?e:e+""}var St=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),Ot(e=function(t,e,n){return e=vt(e),function(t,e){if(e&&("object"==gt(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,bt()?Reflect.construct(e,n||[],vt(t).constructor):e.apply(t,n))}(this,t),"manifest",Z),Ot(e,"processTextRoller",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.getElement("text");if(n){var i="STATIC"===e.services.config.getConfig("entryModuleType");n.childNodes.forEach((function(e){if(e.nodeType!==Node.TEXT_NODE&&"TEXT_ROLLER"===e.getAttribute("cl-type")){var n=e.getAttribute("cl-id"),s=t[n];if(!s)return;i?pt(e,s):function(t,e){var n=e.id,i=document.createElement("span");i.classList.add("outer");var s=mt(e.options),o=document.createElement("span");o.classList.add("inner"),o.textContent=e.options.at(0)||"Option 1",o.setAttribute("contenteditable","false"),i.appendChild(o);var r,a,l,c=window.getComputedStyle(t.parentElement),d=(r=c,a={},l=["font-size","font-weight","font-style","font-family","text-align","text-shadow","letter-spacing","line-height"],Object.keys(r).forEach((function(t){if(Number.isInteger(Number(t))){var e=r[t];l.includes(e)&&(a[e]=r.getPropertyValue(e))}})),a),p=rt(rt(rt({},ct),e.styleAttributes),d);ut(o,p),ut(i,rt(rt({},dt),{},{borderRadius:o.style["border-radius"]||dt.borderRadius,justifyContent:c["text-align"]||dt.justifyContent}),s,p,parseFloat(c.width)),Q({element:t,html:""}),ut(t,rt({},lt)),t.appendChild(i)}(e,s)}}))}})),Ot(e,"stylesAppliedToElement",(function(t,e){"text"===e.element&&e.styleAttributes.textAlign&&"flex"===getComputedStyle(t).display&&(t.style.justifyContent="center"===e.styleAttributes.textAlign?"center":"flex-".concat(e.styleAttributes.textAlign))})),e.getRootElement().innerHTML='\n <style>\n .text {\n outline: none;\n min-height: fit-content;\n width: 100%;\n overflow-wrap: break-word;\n }\n </style>\n \n <style>\n [cl-type="TEXT_ROLLER"] {\n position: relative;\n }\n\n .text {\n align-items: center;\n }\n \n .container--staticTextRoller {\n display: inline-flex;\n max-width: 100%;\n width: fit-content;\n }\n \n .container {\n display: inline-flex;\n align-items: center;\n overflow: hidden;\n position: relative;\n height: 100%;\n }\n\n .opts {\n position: absolute;\n height: 100%;\n width: 100%;\n top: 0;\n left: 0;\n z-index: 1;\n padding: 0;\n margin: 0;\n display: flex;\n gap: 1px;\n flex-direction: column-reverse;\n transform: translateY(-100%);\n }\n \n .opt {\n width: 100%;\n height: 100%;\n text-align: center;\n display: inline-flex;\n justify-content: center;\n }\n \n .opt span {\n white-space: nowrap;\n align-items: center;\n text-overflow: ellipsis;\n overflow: hidden;\n width: fit-content;\n max-width: 100%;\n padding: 0 2px;\n }\n </style>\n\n <div class="text" cl-element="text" cl-inline-edit="content, text"></div>\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&&Et(t,e)}(t,Y),e=t,n=[{key:"connectedCallback",value:function(){var e=this;!function(t,e,n){var i=ft(vt(t.prototype),"connectedCallback",n);return"function"==typeof i?function(t){return i.apply(n,t)}:i}(t,0,this)([]),this.observeProps((function(t,n){var i,s,o;e.applyAutoAdaptiveStyles(n.adaptiveStyles,n.styles),null!==(i=n.content)&&void 0!==i&&i.text&&e.getElement("text")&&(Q({element:e.getElement("text"),html:null===(o=n.content)||void 0===o?void 0:o.text}),e.mergeTagsProcessor.process(e.getElement("text"),n.content.mergeTags,e.getModel().id)),e.processTextRoller(null===(s=n.content)||void 0===s?void 0:s.textrollers)})),this.observeShared((function(){var t,n=e.getProps();e.processTextRoller(null===(t=n.content)||void 0===t?void 0:t.textrollers)}))}}],n&&yt(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();Ot(St,"define",{name:"sys-text",model:Z.name,manifest:Z});export{St as default};window.clComponentClass_SysTextComponent=St;
@@ -1 +1 @@
1
- const e="cl-";function t(t){return e+t}function n(e){return"cl-"+e}const i="VIEW",s="MODULE",o="CONTAINER",r="INPUT",a="BUTTON",l="CONSENT",c="COLUMN",d="SUBSCRIBE_CONTACT",h="REQUEST",u="SHOW_WIDGET",p="OPEN_LINK",m="CLOSE_WIDGET";class g{static sortActions(e){const t={[m]:-1,[p]:-2,[u]:1,[d]:2,[h]:3},n=e=>void 0!==t[e.type]?t[e.type]:0;return[...e].sort(((e,t)=>n(e)>n(t)?-1:n(e)<n(t)?1:0))}constructor(e,t){this.config=e,this.actions=g.sortActions(t),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(e,t,i){this.state=e;const s=i(),o=s.getAttribute(n("id"));this.listener=e=>{const t=e.composedPath().filter((e=>e instanceof HTMLElement&&e.getAttribute(n("type"))));let i=0;for(;t[i]&&t[i].getAttribute(n("id"))!==o;){let e=t[i].getAttribute(n("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(e))return;i++}this.eventsQueue.push({event:e}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((s.shadowRoot||s).querySelectorAll(this.config.relativeSelector)):[s],this.targetElements.forEach((e=>{e.addEventListener("click",this.listener)}))}async execute(){var e,t,n,i;try{for(var s,o=!0,r=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise((function(i,s){!function(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)}(i,s,(t=e[n](t)).done,t.value)}))}}}(this.eventsQueue);!(e=(s=await r.next()).done);){i=s.value,o=!1;try{const{event:e}=i;for(const t of this.actions)if(!await t.execute(this.state.getState(),e))break}finally{o=!0}}}catch(e){t={error:e}}finally{try{o||e||!(n=r.return)||await n.call(r)}finally{if(t)throw t.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((e=>{e.removeEventListener("click",this.listener)})),this.targetElements=[])}}g.IGNORING_VIEW_ENTRY_TYPES=[a,l,r];const y="CLICK",b="COMPONENT_EVENT";class v{constructor(e,t){this.config=e,this.actions=t,this.componentEmitterListener=null}activate(e,t,n){this.componentEmitterListener=t.on(this.config.eventName,(()=>{this.actions.forEach((t=>t.execute(e.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class f{constructor(e,t){this.actionFactory=e,this.actionRegister=t}get(e){const t=e.actions.map((e=>this.actionFactory.get(e)));switch(t.forEach((e=>this.actionRegister.register(e))),e.type){case y:return new g(e,t);case b:return new v(e,t);default:throw new Error(`Not supported handler type ${e.type}`)}}}class O{static generate(){let e,t="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(t+="-"),e=Math.floor(16*Math.random()).toString(16).toUpperCase(),t+=e;return t}}class E{constructor(){this.listeners=E.createDefaultListenersState()}emit(e,t,n=null){const i=this.listeners[e];i&&Object.values(i).forEach((i=>i(t,e,n))),Object.values(this.listeners["*"]).forEach((i=>i(t,e,n)))}on(e,t){const n=O.generate(),i=this.listeners[e];return i?i[n]=t:this.listeners[e]={[n]:t},{off:()=>{var t,i;(null===(i=null===(t=this.listeners)||void 0===t?void 0:t[e])||void 0===i?void 0:i[n])&&delete this.listeners[e][n]}}}destroy(){this.listeners=E.createDefaultListenersState()}}E.createDefaultListenersState=()=>({"*":{}});const C=(e,t,n,i)=>{const{addEventListenerBase:s,addEventListener:o}=EventTarget.prototype;(s||o).call(e,t,n,i)};class S{constructor(e){this.state=e||{}}getState(){return this.state}setState(e){this.state=Object.assign(Object.assign({},this.state),e)}destroy(){}}class A{static extract(e){const t=e.views.map((e=>{const t=e.children.map((e=>e.type===s?Object.assign(Object.assign({},e),A.moduleToContainerParams):e));return Object.assign(Object.assign({},e),{children:t})}));return Object.assign(Object.assign({},e),{views:t})}static sort(e,t){return e.index>t.index?1:-1}static reIndex(e,t){return Object.assign(Object.assign({},e),{index:t+e.index})}}A.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class R extends E{constructor(e,t){super(),this.config=t,this.handleMobileBreakpoint(e.getShared().mobileBreakpointWidth),e.on("ENVIRONMENT_UPDATE",(({isMobileEnv:e})=>{this._isMobile=e,this.emit(R.changeEventName,this._isMobile)}))}handleMobileBreakpoint(e){this.mobileBreakpointWidth=e;const t=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${t})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(R.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(e){this._isMobile=e.matches,this.emit(R.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}R.changeEventName="CHANGE";class P{static set(e,t){const n=e[P.accumulatorPropertyName]||{};e[P.accumulatorPropertyName]=Object.assign(Object.assign({},n),t.styleAttributes),Object.keys(e[P.accumulatorPropertyName]).forEach((n=>{n.includes("--")?e.style.setProperty(n,t.styleAttributes[n]||""):e.style[n]=t.styleAttributes[n]?t.styleAttributes[n]:""}))}}P.accumulatorPropertyName="clStyleAttributes";const T="CONTENT_LOCKER";class w{static applyHostStyles(e,t,n=null,s){var r,a,l;const d=null===(a=null===(r=null==n?void 0:n.props)||void 0===r?void 0:r.handlers)||void 0===a?void 0:a.find((e=>"CLICK"===e.type));d&&(null===(l=d.actions)||void 0===l?void 0:l.length)&&(t.style.cursor="pointer"),e!==i&&e!==o&&e!==c||(t.style.display=s===T&&e===i?"flex":"inline-flex",t.style.position="relative"),t.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(e=""){this.styles=`${this.styles} ${e}`}getStyles(){return this.styles}}class N{static log(e){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(e)):console.error(e)}}class L{constructor(e,t,n,i,s,o){this.hostElement=t,this.documentModel=e,this.getSharedCb=n,this.getPropsCb=i,this.getEnvCb=s,this.httpClient=o,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(e){const t=String(e||"");if(t.includes("url")){const[e,n]=t.split("(")[1].split(")");return{url:e.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(e){const t=this.getPropsCb();return t.backgroundDynamicInlineSVGElements[e].forEach((n=>{var i,s,o,r,a;const l=null===(s=null===(i=t.adaptiveStyles)||void 0===i?void 0:i[e])||void 0===s?void 0:s.find((e=>e.element===n)),c=(null===(o=t.styles)||void 0===o?void 0:o.find((e=>e.element===n)))||{},d=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(a=null==l?void 0:l.styleAttributes)||void 0===a?void 0:a.background),h=this.parseBackground(d);h.url&&this.envUrlMaps[e].set(n,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})})),Promise.all([...this.envUrlMaps[e].entries()].map((([t,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((e=>e.text())).then((i=>{this.envUrlMaps[e].set(t,Object.assign(Object.assign({},n),{inlineSvgString:i}))}))))).then((()=>{this._applyHostElementBackground(this.envUrlMaps[e].get("host"),this.getSharedCb().cssVars)})).catch((e=>{console.error(e),N.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${e}`)}))}on(){return this.subscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(e=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),e)})),this}_applyHostElementBackground(e,t){e&&(this.hostElement.style.background=this._buildBackgroundUrl(e,t))}_buildBackgroundUrl(e,t){const n=e.inlineSvgString.trim().replace("var(--cl-schema-accent)",t["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${e.positionOptions}`}off(){var e;null===(e=this.subscription)||void 0===e||e.off()}}const x=new class{execute(e,t,n=null,i,s){const o={method:t,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:s};return n&&(o.body="string"==typeof n?n:JSON.stringify(n)),fetch(e,o)}};function _(e,t){return Object.keys(e).filter((e=>!t.includes(e))).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]})),{})}class M{static camelCaseToDashCase(e){return e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))}static camelCaseToUpperSnakeCase(e){return e.replace(/[A-Z]/g,(e=>"_"+e)).toUpperCase()}}class I{constructor(e){this._count=0,this.onUpdateCb=e}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",j="FAILED_TO_LOAD_COMPONENT_RESOURCE";class U{constructor(e,t,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=e=>{0===e&&this.systemEventEmitter.emit(k,this.componentId)},this.onResourceLoadFailure=e=>{this.isStaticEntryModule?this.systemEventEmitter.emit(j,`Failed to load: ${e}`):this.counters.pending.decrement()},this.componentId=e,this.systemEventEmitter=t,this.isStaticEntryModule=n,this.counters={pending:new I(this.onCounterStateUpdate)}}}const D=(...e)=>{let t=e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:[]})),{});return{get:e=>t[e],clear:()=>D(...e)}},F=D,B="props",V="shared",W="environment";function H(e,t,n,i){const s=e=>{let o=e instanceof DocumentFragment||(null==e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?e.host:e;return o&&(i&&"function"==typeof i?i(o.getAttribute(t)):(null===(r=null==o?void 0:o.getAttribute)||void 0===r?void 0:r.call(o,t))===n)?o:o&&o.parentNode&&s(o.parentNode)||null;var r};return s(e)}const $="SUBMIT";function G(e,t){return t?(e.classes=`${e.classes||""} ${t.classes||""}`.trim(),Object.keys(t).forEach((n=>{"element"!==n&&"classes"!==n&&(t[n]&&"object"==typeof t[n]&&!Array.isArray(t[n])?e[n]=Object.assign(Object.assign({},e[n]||{}),t[n]):e[n]=t[n])})),e):e}function z(e,t,n){var i;return null===(i=e[t])||void 0===i?void 0:i.find((e=>e.element===n))}function q(e){const{element:t,html:n,appendHtml:i}=e,s=function(e){if(null==e)return"";if("string"!=typeof e)return String(e);if(""===e)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(e))return e;const t=(new DOMParser).parseFromString(e,"text/html");return t.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((e=>e.remove())),t.querySelectorAll("*").forEach((e=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((t=>e.removeAttribute(t))),Array.from(e.attributes).forEach((t=>{t.name.startsWith("on")&&e.removeAttribute(t.name)})),"A"===e.tagName||"AREA"===e.tagName){const t=e.getAttribute("href");t&&(t.startsWith("javascript:")||t.startsWith("data:"))&&e.removeAttribute("href")}if("IMG"===e.tagName||"IFRAME"===e.tagName){const t=e.getAttribute("src");t&&(t.startsWith("javascript:")||t.startsWith("data:text/html"))&&e.removeAttribute("src")}if("FORM"===e.tagName){const t=e.getAttribute("action");t&&t.startsWith("javascript:")&&e.removeAttribute("action")}})),t.body.innerHTML}(n);i?t.innerHTML+=s:t.innerHTML=s}class Z extends Event{constructor(e,t,n){super(e,n),this.detail={},Object.defineProperty(this,"detail",{value:t})}}class Q extends HTMLElement{constructor(){var i,s;super(),this.construct=()=>{let e;const t=this.getAttribute(n("id")),i=this.getWidgetContainerNode();if(!i)throw new Error("Widget container not found in construct");const s=i.closest(`[${n("widget-id")}]`);let o;s&&(o=s.getAttribute(n("widget-id")));let r=new Z("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("path")),id:t,widgetId:o},{bubbles:!0,composed:!0});this.dispatchEvent(r),e=r.detail.props,Object.assign(this,e),this.observers=F(B,V,W),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(e){this.subscriptions.push(e)}off(){this.subscriptions.forEach((e=>null==e?void 0:e.off()))}},this.state=new S,this.componentEventEmitter=new E,this.componentResourceManager=new U(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 f(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(e=>{this.model.props=e,this.observers.get(B).forEach((t=>t(this.prevProps,e))),this.prevProps=e;const t=this.getHostElement(),i=n("floating");e.floating&&!t.getAttribute(i)?t.setAttribute(i,"true"):!e.floating&&t.getAttribute(i)&&t.removeAttribute(i)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(e=>{Object.assign(this.model,e)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(V).forEach((e=>e(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new L(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),x),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(R.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const e=this.getEnvironment();this.observers.get(W).forEach((t=>t(this.prevEnvironment,e))),this.prevEnvironment=e})))},this.attachHandlers=()=>{this.getHandlers().map((e=>this._handlerFactory.get(e))).map((e=>()=>e.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((e=>e()))},this.postponeHandlers=()=>{var e;null===(e=this.handlers)||void 0===e||e.forEach((e=>e.postpone()))},this.releaseHandlers=()=>{var e;null===(e=this.handlers)||void 0===e||e.forEach((e=>e.release()))},this.getProps=()=>{var e;return null===(e=this.getModel())||void 0===e?void 0:e.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=e=>{this.observers.get(B).push(e),e(null,this.prevProps)},this.observeShared=e=>{this.observers.get(V).push(e),e(this.getShared())},this.observeEnvironment=e=>{this.observers.get(W).push(e),e(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${n("element")}]`)).filter((e=>!e.hasAttribute(n("component"))))],this.getElement=(e,t)=>this.getElements().find((i=>t?i.getAttribute(n("element"))===e&&i.id===t:i.getAttribute(n("element"))===e)),this.applyAutoAdaptiveStyles=(e,t)=>{if(!e&&!t)return;const i=this.getElements();if(!i.length)return;e=function(e,t){if(!t)return e||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(e||{desktop:[],mobile:[]}));return t.forEach((e=>{const t=e.element;let i=!1,s=!1;n.desktop&&n.desktop.forEach((n=>{n.element===t&&(G(n,e),i=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===t&&(G(n,e),s=!0)})),!i&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(e))),!s&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(e)))})),n}(e,t);const s=n("type"),o="element-styles";let r=this.getRootElement().querySelector(`style[${s}="${o}"]`);r||(r=document.createElement("style"),r.setAttribute(s,o),this.getRootElement().appendChild(r)),q({element:r,html:""}),i.forEach((t=>{let i=t.getAttribute(n("element"));const s=this.getEnvironment();let o=z(e,s,i);if(o){if(this.resizeListener.isMobile()){const t=z(e,"desktop",i);t&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),o.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(o),r)}})),this._addLinkColor(r,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(e,t={})=>{if(!e||!e.style)return!1;for(const[n,i]of Object.entries(t))e.style[n]=i;return!0},this.applyStylesToElement=(e,t,i)=>{var s,o;const r=[];"host"===(t=Q._resolveTogglableStylesForElementModel(t)).element&&(w.applyHostStyles(this.model.type,e,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(s=this.model.props.backgroundDynamicInlineSVGElements)||void 0===s?void 0:s.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 a=t.styleAttributes.background,l=a&&a.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&l){this.componentResourceManager.getPending().increment();const e=new Image;e.src=l[1],C(e,"load",(()=>{this.componentResourceManager.getPending().decrement()})),C(e,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(e.src),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},t),{styleAttributes:_(t.styleAttributes,r)});if(P.set(e,c),this._setClassAttributes(e,t),i){if(t.hoverStyleAttributes){let s=Object.assign({},t.hoverStyleAttributes);if("FILL_UP"===t.hoverAnimationType){e.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",e.style.overflow="hidden";const n=e.tagName.toLowerCase(),i=`flip-up-animation-${t.element}`;let o=this.getRootElement().querySelector(`#${i}`);o||(o=document.createElement("style"),o.id=i,e.appendChild(o)),q({element:o,html:`\n ${n}::before {\n content: '';\n background: ${s.background};\n position: absolute;\n left: 0;\n top: ${e.getBoundingClientRect().height}px;\n height: ${e.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),s=Object.assign(Object.assign({},t.hoverStyleAttributes),{background:"transparent",position:"relative"})}s.borderTopWidth&&"0px"!==s.borderTopWidth||delete s.borderTopColor,s.borderBottomWidth&&"0px"!==s.borderBottomWidth||delete s.borderBottomColor,s.borderLeftWidth&&"0px"!==s.borderLeftWidth||delete s.borderLeftColor,s.borderRightWidth&&"0px"!==s.borderRightWidth||delete s.borderRightColor,this._addStylesToStyleElement(i,t.element,s,`:not(.${n("no-hover")}):hover`,!0)}t.placeholderStyleAttributes&&this._addStylesToStyleElement(i,t.element,t.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(i,this.getShared()),this.stylesAppliedToElement(e,t,i)}},this._fixMarginOverflow=e=>{const t=this.getParentComponent(),i=t&&("flex"===t.style.display||"inline-flex"===t.style.display),s="host",o=e.getAttribute(n("element"))===s;if(!i||!o)return;const r=this.getProps(),a=this.getEnvironment(),{styleAttributes:l}=z(r.adaptiveStyles,a,s)||{};if(!l)return;const c=l.marginLeft||l.marginRight,d="100%"===l.width;if(c&&d){const t=(parseFloat(l.marginLeft)||0)+(parseFloat(l.marginRight)||0);t&&setTimeout((()=>{e.style.width=`calc(100% - ${t}px)`}))}},this.applySharedClassesToElementModel=t=>function(t,n){let i=t;return(i.classes||"").split(" ").filter((t=>t.startsWith(e))).forEach((e=>{var t;let s=null===(t=n.textClasses)||void 0===t?void 0:t[e];s&&(s.styleAttributes.fontFamily||(s.isHeader&&n.headerFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:n.headerFontFamily})})),!s.isHeader&&n.textFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:n.textFontFamily})}))),i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),s.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},i.placeholderStyleAttributes),s.placeholderStyleAttributes)}))})),i.styleAttributes.fontFamily||(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.textFontFamily})})),i}(t,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(e,t,i,s="",o)=>{const r=Object.keys(i).reduce(((e,t)=>e+` ${M.camelCaseToDashCase(t)}: ${i[t]}${o?" !important;":";"}`),"");q({element:e,html:`[${n("element")}="${t}"]${s} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(e,t)=>{q({element:e,html:`[cl-type] {font-family:${t.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(e,t)=>{var n,i,s,o;t.linkColor&&q({element:e,html:`a {color: ${t.linkColor}}, a:visited {color: ${t.linkColor}}`,appendHtml:!0}),(null===(n=t.linkParams)||void 0===n?void 0:n.color)&&q({element:e,html:`a {color: ${null===(i=t.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(s=t.linkParams)||void 0===s?void 0:s.color}}`,appendHtml:!0}),(null===(o=t.linkParams)||void 0===o?void 0:o.removeUnderline)&&q({element:e,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(n,i)=>{Array.from(n.classList).filter((e=>e!==t("hovered")&&e!==t("focused"))).forEach((t=>{t.startsWith(e)&&n.classList.remove(t)}));const s=((n.getAttribute("class")||"")+" "+i.classes).trim();n.setAttribute("class",s)},this.getParentComponent=()=>H(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const e=null==this?void 0:this.getAttribute(n("path"));return e&&1===e.split(",").length?this.parentNode:H(this.parentNode,n("path"),void 0,(e=>e&&1===e.split(",").length))},this.getWidgetLanguages=()=>{return[(e=this.services.config).getConfig("appearanceLanguage"),e.getConfig("browserLanguage"),"en"].filter((e=>!!e));var e},this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=e=>function(e,t){return t.reduce(((t,n)=>{if(t)return t;const i=function(e,t){if(!e)return null;if(t[e])return{translations:t[e],language:e};const n=function(e){return e.includes("-")?e.split("-")[0].toLowerCase():e.includes("_")?e.split("_")[0].toLowerCase():e}(e);return t[n]?{translations:t[n],language:n}:null}(n,e);return i||null}),null)}(e,this.getWidgetLanguages()),this.stylesAppliedToElement=(e,t,n)=>{},this.updateContext=()=>{var e;const t=this.getModel();this.services.context.updateRecord(t.id,{label:this.getContextRecordLabel(t.props),viewIndex:null===(e=t.path)||void 0===e?void 0:e[0]})},this.addContextRecord=()=>{var e;const t=this.getModel();this.services.context.addRecord(t.id,{recordKey:t.id,id:t.props.control.name,label:this.getContextRecordLabel(t.props),value:t.props.control.defaultValue||"",viewIndex:null===(e=t.path)||void 0===e?void 0:e[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(t.props)}})},this.getContextRecordLabel=e=>{var t,n;const i=e.control.name;if(["email","first_name","last_name"].includes(i))return i.toUpperCase();if(e.content.label&&(null===(n=null===(t=e.adaptiveStyles.desktop.find((e=>"label"===e.element)))||void 0===t?void 0:t.params)||void 0===n?void 0:n.enabled)){const t=(new DOMParser).parseFromString(e.content.label,"text/html");return this.capitalizeFirstLetter(t.body.textContent||"")}return e.content.placeholder?this.capitalizeFirstLetter(e.content.placeholder):e.control.integrationName?this.capitalizeFirstLetter(e.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=e=>e.charAt(0).toUpperCase()+e.slice(1),this.getContextRecordExampleValue=e=>{switch(e.control.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(e)}},this.completeSubmitAction=e=>{const t=e||{},n=this.services.actionRegister.getRegisteredActions().find((e=>e.category===$));n?null==n||n.execute(void 0,void 0,!0,t):this.services.actionFactory.get({type:h}).execute(void 0,void 0,!0,t)},this.getHandlers=()=>this.getProps().handlers&&this.getProps().handlers.length?[...this.getProps().handlers]:[],this.assets=(e="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${e?`/${e}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(i=this.define)||void 0===i?void 0:i.manifest)||(null===(s=this.constructor.define)||void 0===s?void 0:s.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var e;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(e=this.mergeTagsProcessor)||void 0===e||e.destroy()}static _resolveTogglableStylesForElementModel(e){const t=Object.assign({},e);return Object.keys(t).forEach((e=>{e.toLowerCase().includes("styleattributes")&&(t[e]=Q._resolveTogglableStyles(t[e]))})),t}static _resolveTogglableStyles(e){const t=Object.assign({},e),n=(e,n,i)=>{n in t&&(e.forEach((e=>{e in t&&(t[e]=t[n]?t[e]:i)})),delete t[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),t}}const Y={name:"SysVideoComponent",componentType:"VIDEO",version:"1.0.0",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:"host",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:"host",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:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill"]}}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill"]}}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]}],general:[{type:"CONTROL",name:"VIDEO_URL",propPath:["control","youtubeUrl"],params:{label:"DOCUMENT_YOUTUBE_URL",placeholder:"https://www.youtube.com/watch..."}},{type:"CONTROL",name:"SWITCH",propPath:["content","autoplay"],params:{label:"DOCUMENT_AUTOPLAY",boldLabel:!0,description:"DOCUMENT_AUTOPLAY_DESCRIPTION"}},{type:"CONTROL",name:"VIDEO_CUSTOM_COVER",elementProp:"styleAttributes",element:"overlay",params:{aspectRatioPropPath:["content","aspectRatio"],showPlayButtonPropPath:["content","showPlayButton"]}}]},events:{dispatch:[],listen:[]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"VIDEO_URL",propPath:["control","youtubeUrl"],params:{label:"DOCUMENT_YOUTUBE_URL",placeholder:"https://www.youtube.com/watch..."}}]},i18nPropPaths:["control,youtubeUrl","content,videoId","content,aspectRatio"],i18n:{},props:{content:{videoId:null,autoplay:!1,aspectRatio:1.7777777777777777,videoPreviewImageUrl:null,showPlayButton:!0},control:{},styles:[{element:"host",styleAttributes:{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:""}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{width:"350px",minWidth:"350px",height:"197px",minHeight:"197px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,overflow:"hidden"},classes:""},{element:"overlay",styleAttributes:{background:null},classes:""}],mobile:[{element:"host",styleAttributes:{width:"350px",minWidth:"350px",height:"197px",minHeight:"197px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,overflow:"hidden"},classes:""},{element:"overlay",styleAttributes:{background:null},classes:""}]}},metaDescription:{icon:"/SysVideoComponent/assets/img/video-component-icon.svg",label:{en:"Video",ru:"Видео",uk:"Вiдео",es:"Video",de:"Video",fr:"Vidéo",it:"Video",pt:"Vídeo",ro:"Video",bg:"Видео",cs:"Rádio",el:"Ραδιόφωνο",nl:"Radio",pl:"Radio",sv:"Radio",tr:"Video",ar:"الفيديو",zh:"视频",da:"Video",he:"וידאו",fi:"Video",hi:"वीडियो",hr:"Video",hu:"Videó",id:"Video",ja:"ビデオ",ko:"비디오",no:"Video",sk:"Video",sl:"Video",sr:"Video zapis"}}};function J(e){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J(e)}function K(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,oe(i.key),i)}}function X(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(X=function(){return!!e})()}function ee(e,t,n,i){var s=te(ne(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof s?function(e){return s.apply(n,e)}:s}function te(){return te="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=ne(e)););return e}(e,t);if(i){var s=Object.getOwnPropertyDescriptor(i,t);return s.get?s.get.call(arguments.length<3?e:n):s.value}},te.apply(null,arguments)}function ne(e){return ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ne(e)}function ie(e,t){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ie(e,t)}function se(e,t,n){return(t=oe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oe(e){var t=function(e){if("object"!=J(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=J(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==J(t)?t:t+""}var re=function(){function e(){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),se(t=function(e,t,n){return t=ne(t),function(e,t){if(t&&("object"==J(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,X()?Reflect.construct(t,n||[],ne(e).constructor):t.apply(e,n))}(this,e),"manifest",Y),se(t,"resizeObserver",void 0),se(t,"adjustVideoHeight",(function(e,n){if(e){var i=t.getHostElement(),s=n||i.getBoundingClientRect().width,o="".concat(s/e,"px");i.style.height=o,i.style.minHeight=o}})),se(t,"updatePlayButtonVisibility",(function(e,n,i){var s=t.getRootElement().querySelector(".video-overlay"),o="--cl-video-component-play-btn-visibility";return i&&!n?s.style.setProperty(o,"visible"):n?void(e.content.showPlayButton?s.style.setProperty(o,"visible"):s.style.setProperty(o,"hidden")):s.style.setProperty(o,"hidden")})),se(t,"preloadImage",(function(e,t){var n=new Image;n.src=e,n.onload=function(){return t()},n.onerror=function(){return t()}})),se(t,"displayPreviewImageAfterImageLoaded",(function(e,n,i){if(n||i){var s="UPDATING"===t.services.config.getConfig("entryModuleType"),o=e.querySelector("#youtube-player");if(i){var r=i.split(")")[0].slice(5,-1);!s&&o&&(o.style.opacity="0"),t.preloadImage(r,(function(){t.displayPreviewImage(e,n,i),!s&&o&&(o.style.opacity="1")}))}else t.displayPreviewImage(e,n,i)}})),se(t,"displayPreviewImage",(function(e,n,i){var s=e.querySelector(".video-overlay"),o=e.querySelector("#youtube-player");s.style.setProperty("--cl-video-component-overlay-visibility","visible"),i||setTimeout((function(){return s.style.backgroundImage="url(".concat(n,")")})),o&&(s.onclick=function(){o.src=o.src+"&autoplay=1",o.onload=function(){return t.hidePreviewImage(e)}})})),se(t,"hidePreviewImage",(function(e){var t=e.querySelector(".video-overlay");t.style.setProperty("--cl-video-component-overlay-visibility","hidden"),t.style.setProperty("--cl-video-component-play-btn-visibility","hidden"),t.style.backgroundImage="none"})),se(t,"createUpdatedIFrame",(function(e){var t=document.createElement("iframe");return t.src=e,t.id="youtube-player",t.allow="autoplay",t.setAttribute("frameborder","0"),t})),t.getRootElement().innerHTML="\n ".concat("\n <style>\n .main-container {\n height: 100%;\n overflow: hidden;\n position: relative;\n box-shadow: 0 0 0 3px inset #a1a1a1;\n background: #515151;\n background-repeat: no-repeat;\n background-position: center;\n background-image: url(\"data:image/svg+xml,%3Csvg%20width%3D%2244%22%20height%3D%2231%22%20viewBox%3D%220%200%2044%2031%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M19.4898%2010.6062C20.1401%2010.2582%2020.9292%2010.2963%2021.5429%2010.7055L26.2391%2013.8363C26.7955%2014.2072%2027.1297%2014.8317%2027.1297%2015.5004C27.1297%2016.1691%2026.7955%2016.7936%2026.2391%2017.1645L21.5429%2020.2953C20.9292%2020.7044%2020.1401%2020.7426%2019.4898%2020.3946C18.8395%2020.0465%2018.4335%2019.3688%2018.4335%2018.6312V12.3696C18.4335%2011.632%2018.8395%2010.9543%2019.4898%2010.6062ZM6.3803%203.05351C4.68417%203.18398%203.32052%204.50218%203.13266%206.19292C2.44536%2012.3786%202.44536%2018.6214%203.13266%2024.8071C3.32052%2026.4978%204.68417%2027.816%206.3803%2027.9465L14.4857%2028.57C19.4891%2028.9549%2024.5147%2028.9549%2029.5182%2028.57L37.6235%2027.9465C39.3197%2027.816%2040.6833%2026.4978%2040.8712%2024.8071C41.5585%2018.6214%2041.5585%2012.3786%2040.8712%206.19292C40.6833%204.50218%2039.3197%203.18398%2037.6235%203.05351L29.5182%202.43002C24.5147%202.04514%2019.4891%202.04514%2014.4857%202.43002L6.3803%203.05351ZM20.4335%2012.3696V18.6312L25.1297%2015.5004L20.4335%2012.3696ZM1.14489%205.97206C1.43886%203.32634%203.57274%201.26357%206.2269%201.0594L14.3323%200.435909C19.4378%200.0431735%2024.566%200.0431736%2029.6716%200.435909L37.7769%201.0594C40.4311%201.26357%2042.565%203.32633%2042.8589%205.97206C43.5626%2012.3045%2043.5626%2018.6955%2042.8589%2025.0279C42.565%2027.6737%2040.4311%2029.7364%2037.7769%2029.9406L29.6716%2030.5641C24.566%2030.9568%2019.4378%2030.9568%2014.3323%2030.5641L6.2269%2029.9406C3.57274%2029.7364%201.43886%2027.6737%201.14489%2025.0279C0.441285%2018.6955%200.441285%2012.3045%201.14489%205.97206Z%22%20fill%3D%22%23a1a1a1%22%2F%3E%0A%3C%2Fsvg%3E%0A\");\n }\n \n .video-overlay {\n visibility: var(--cl-video-component-overlay-visibility, hidden);\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center;\n cursor: pointer;\n }\n \n .video-overlay:after {\n content: '';\n visibility: var(--cl-video-component-play-btn-visibility, hidden);\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: center;\n background-size: 64px 48px;\n background-image: url(\"data:image/svg+xml,%3Csvg width='159' height='110' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m154 17.5c-1.82-6.73-7.07-12-13.8-13.8-9.04-3.49-96.6-5.2-122 0.1-6.73 1.82-12 7.07-13.8 13.8-4.08 17.9-4.39 56.6 0.1 74.9 1.82 6.73 7.07 12 13.8 13.8 17.9 4.12 103 4.7 122 0 6.73-1.82 12-7.07 13.8-13.8 4.35-19.5 4.66-55.8-0.1-75z' fill='%23f00'/%3E%3Cpath d='m105 55-40.8-23.4v46.8z' fill='%23fff'/%3E%3C/svg%3E%0A\");\n }\n \n #youtube-player {\n width: 100%;\n height: 100%;\n }\n </style>\n ",'\n <div class="main-container" cl-element="main">\n <div class="video-overlay" cl-element="overlay"></div>\n <iframe\n id="youtube-player"\n src=""\n allow="autoplay"\n frameborder="0">\n </iframe>\n </div>\n '),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ie(e,t)}(e,Q),t=e,(n=[{key:"connectedCallback",value:function(){var t=this;ee(e,"connectedCallback",this,3)([]);var n=this.getRootElement(),i="UPDATING"===this.services.config.getConfig("entryModuleType"),s=this.services.config.getConfig("previewMode");window.ResizeObserver&&(this.resizeObserver=new ResizeObserver((function(e){window.requestAnimationFrame((function(){if(Array.isArray(e)&&e.length){var n=e[0].contentRect;t.adjustVideoHeight(t.getProps().content.aspectRatio,n.width)}}))})),this.resizeObserver.observe(n.querySelector(".main-container")));var o=function(e){return!i&&!s&&e},r=function(e,i){var s=n.querySelector("#youtube-player");if(e){var r="https://www.youtube.com/embed/".concat(e,"?controls=1").concat(o(i)?"&autoplay=1&mute=1":"");if(!s||s.src!==r){var a,l=t.createUpdatedIFrame(r);null===(a=n.querySelector("#youtube-player"))||void 0===a||a.remove(),n.querySelector(".main-container").appendChild(l),o(i)&&(l.onload=function(){t.hidePreviewImage(n)})}}else{var c;null===(c=n.querySelector("#youtube-player"))||void 0===c||c.remove()}};this.observeProps((function(e,i){var o,a=t.getEnvironment(),l=null===(o=i.adaptiveStyles[a])||void 0===o||null===(o=o.find((function(e){return"overlay"===e.element})))||void 0===o?void 0:o.styleAttributes.background;t.applyAutoAdaptiveStyles(i.adaptiveStyles,i.styles),s||r(i.content.videoId,i.content.autoplay),(s||l)&&t.displayPreviewImageAfterImageLoaded(n,i.content.videoPreviewImageUrl,l,r),t.updatePlayButtonVisibility(i,l,s),t.adjustVideoHeight(i.content.aspectRatio)}))}},{key:"disconnectedCallback",value:function(){var t;ee(e,"disconnectedCallback",this,3)([]),window.ResizeObserver&&(null===(t=this.resizeObserver)||void 0===t||t.unobserve(this.getRootElement().querySelector(".main-container")))}}])&&K(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n}();se(re,"define",{name:"sys-video",model:Y.name,manifest:Y});export{re as default};window.clComponentClass_SysVideoComponent=re;
1
+ const e="cl-";function t(t){return e+t}function n(e){return"cl-"+e}const i="VIEW",s="MODULE",o="CONTAINER",r="INPUT",a="BUTTON",l="CONSENT",c="COLUMN",d="SUBSCRIBE_CONTACT",h="REQUEST",u="SHOW_WIDGET",p="OPEN_LINK",m="CLOSE_WIDGET";class g{static sortActions(e){const t={[m]:-1,[p]:-2,[u]:1,[d]:2,[h]:3},n=e=>void 0!==t[e.type]?t[e.type]:0;return[...e].sort(((e,t)=>n(e)>n(t)?-1:n(e)<n(t)?1:0))}constructor(e,t){this.config=e,this.actions=g.sortActions(t),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(e,t,i){this.state=e;const s=i(),o=s.getAttribute(n("id"));this.listener=e=>{const t=e.composedPath().filter((e=>e instanceof HTMLElement&&e.getAttribute(n("type"))));let i=0;for(;t[i]&&t[i].getAttribute(n("id"))!==o;){let e=t[i].getAttribute(n("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(e))return;i++}this.eventsQueue.push({event:e}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((s.shadowRoot||s).querySelectorAll(this.config.relativeSelector)):[s],this.targetElements.forEach((e=>{e.addEventListener("click",this.listener)}))}async execute(){var e,t,n,i;try{for(var s,o=!0,r=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(n){t[n]=e[n]&&function(t){return new Promise((function(i,s){!function(e,t,n,i){Promise.resolve(i).then((function(t){e({value:t,done:n})}),t)}(i,s,(t=e[n](t)).done,t.value)}))}}}(this.eventsQueue);!(e=(s=await r.next()).done);){i=s.value,o=!1;try{const{event:e}=i;for(const t of this.actions)if(!await t.execute(this.state.getState(),e))break}finally{o=!0}}}catch(e){t={error:e}}finally{try{o||e||!(n=r.return)||await n.call(r)}finally{if(t)throw t.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((e=>{e.removeEventListener("click",this.listener)})),this.targetElements=[])}}g.IGNORING_VIEW_ENTRY_TYPES=[a,l,r];const y="CLICK",b="COMPONENT_EVENT";class v{constructor(e,t){this.config=e,this.actions=t,this.componentEmitterListener=null}activate(e,t,n){this.componentEmitterListener=t.on(this.config.eventName,(()=>{this.actions.forEach((t=>t.execute(e.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class f{constructor(e,t){this.actionFactory=e,this.actionRegister=t}get(e){const t=e.actions.map((e=>this.actionFactory.get(e)));switch(t.forEach((e=>this.actionRegister.register(e))),e.type){case y:return new g(e,t);case b:return new v(e,t);default:throw new Error(`Not supported handler type ${e.type}`)}}}class E{static generate(){let e,t="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(t+="-"),e=Math.floor(16*Math.random()).toString(16).toUpperCase(),t+=e;return t}}class O{constructor(){this.listeners=O.createDefaultListenersState()}emit(e,t,n=null){const i=this.listeners[e];i&&Object.values(i).forEach((i=>i(t,e,n))),Object.values(this.listeners["*"]).forEach((i=>i(t,e,n)))}on(e,t){const n=E.generate(),i=this.listeners[e];return i?i[n]=t:this.listeners[e]={[n]:t},{off:()=>{var t,i;(null===(i=null===(t=this.listeners)||void 0===t?void 0:t[e])||void 0===i?void 0:i[n])&&delete this.listeners[e][n]}}}destroy(){this.listeners=O.createDefaultListenersState()}}O.createDefaultListenersState=()=>({"*":{}});const C=(e,t,n,i)=>{const{addEventListenerBase:s,addEventListener:o}=EventTarget.prototype;(s||o).call(e,t,n,i)};class S{constructor(e){this.state=e||{}}getState(){return this.state}setState(e){this.state=Object.assign(Object.assign({},this.state),e)}destroy(){}}class A{static extract(e){const t=e.views.map((e=>{const t=e.children.map((e=>e.type===s?Object.assign(Object.assign({},e),A.moduleToContainerParams):e));return Object.assign(Object.assign({},e),{children:t})}));return Object.assign(Object.assign({},e),{views:t})}static sort(e,t){return e.index>t.index?1:-1}static reIndex(e,t){return Object.assign(Object.assign({},e),{index:t+e.index})}}A.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class R extends O{constructor(e,t){super(),this.config=t,this.handleMobileBreakpoint(e.getShared().mobileBreakpointWidth),e.on("ENVIRONMENT_UPDATE",(({isMobileEnv:e})=>{this._isMobile=e,this.emit(R.changeEventName,this._isMobile)}))}handleMobileBreakpoint(e){this.mobileBreakpointWidth=e;const t=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${t})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(R.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(e){this._isMobile=e.matches,this.emit(R.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}R.changeEventName="CHANGE";class P{static set(e,t){const n=e[P.accumulatorPropertyName]||{};e[P.accumulatorPropertyName]=Object.assign(Object.assign({},n),t.styleAttributes),Object.keys(e[P.accumulatorPropertyName]).forEach((n=>{n.includes("--")?e.style.setProperty(n,t.styleAttributes[n]||""):e.style[n]=t.styleAttributes[n]?t.styleAttributes[n]:""}))}}P.accumulatorPropertyName="clStyleAttributes";const T="CONTENT_LOCKER";class w{static applyHostStyles(e,t,n=null,s){var r,a,l;const d=null===(a=null===(r=null==n?void 0:n.props)||void 0===r?void 0:r.handlers)||void 0===a?void 0:a.find((e=>"CLICK"===e.type));d&&(null===(l=d.actions)||void 0===l?void 0:l.length)&&(t.style.cursor="pointer"),e!==i&&e!==o&&e!==c||(t.style.display=s===T&&e===i?"flex":"inline-flex",t.style.position="relative"),t.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(e=""){this.styles=`${this.styles} ${e}`}getStyles(){return this.styles}}class N{static log(e){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(e)):console.error(e)}}class L{constructor(e,t,n,i,s,o){this.hostElement=t,this.documentModel=e,this.getSharedCb=n,this.getPropsCb=i,this.getEnvCb=s,this.httpClient=o,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(e){const t=String(e||"");if(t.includes("url")){const[e,n]=t.split("(")[1].split(")");return{url:e.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(e){const t=this.getPropsCb();return t.backgroundDynamicInlineSVGElements[e].forEach((n=>{var i,s,o,r,a;const l=null===(s=null===(i=t.adaptiveStyles)||void 0===i?void 0:i[e])||void 0===s?void 0:s.find((e=>e.element===n)),c=(null===(o=t.styles)||void 0===o?void 0:o.find((e=>e.element===n)))||{},d=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(a=null==l?void 0:l.styleAttributes)||void 0===a?void 0:a.background),h=this.parseBackground(d);h.url&&this.envUrlMaps[e].set(n,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})})),Promise.all([...this.envUrlMaps[e].entries()].map((([t,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((e=>e.text())).then((i=>{this.envUrlMaps[e].set(t,Object.assign(Object.assign({},n),{inlineSvgString:i}))}))))).then((()=>{var t;this._applyHostElementBackground(this.envUrlMaps[e].get("host"),null===(t=this.getSharedCb().theme)||void 0===t?void 0:t.schema)})).catch((e=>{console.error(e),N.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${e}`)}))}on(){return this.subscription=this.documentModel.on("THEME_UPDATE",(e=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),e.schema)})),this}_applyHostElementBackground(e,t={}){e&&(this.hostElement.style.background=this._buildBackgroundUrl(e,t))}_buildBackgroundUrl(e,t){const n=e.inlineSvgString.trim().replace("var(--cl-schema-accent)",t.accent);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${e.positionOptions}`}}const x=new class{execute(e,t,n=null,i,s){const o={method:t,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:s};return n&&(o.body="string"==typeof n?n:JSON.stringify(n)),fetch(e,o)}};function _(e,t){return Object.keys(e).filter((e=>!t.includes(e))).reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]})),{})}class M{static camelCaseToDashCase(e){return e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))}static camelCaseToUpperSnakeCase(e){return e.replace(/[A-Z]/g,(e=>"_"+e)).toUpperCase()}}class I{constructor(e){this._count=0,this.onUpdateCb=e}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",j="FAILED_TO_LOAD_COMPONENT_RESOURCE";class U{constructor(e,t,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=e=>{0===e&&this.systemEventEmitter.emit(k,this.componentId)},this.onResourceLoadFailure=e=>{this.isStaticEntryModule?this.systemEventEmitter.emit(j,`Failed to load: ${e}`):this.counters.pending.decrement()},this.componentId=e,this.systemEventEmitter=t,this.isStaticEntryModule=n,this.counters={pending:new I(this.onCounterStateUpdate)}}}const D=(...e)=>{let t=e.reduce(((e,t)=>Object.assign(Object.assign({},e),{[t]:[]})),{});return{get:e=>t[e],clear:()=>D(...e)}},F=D,B="props",V="shared",W="environment";function H(e,t,n,i){const s=e=>{let o=e instanceof DocumentFragment||(null==e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?e.host:e;return o&&(i&&"function"==typeof i?i(o.getAttribute(t)):(null===(r=null==o?void 0:o.getAttribute)||void 0===r?void 0:r.call(o,t))===n)?o:o&&o.parentNode&&s(o.parentNode)||null;var r};return s(e)}const $="SUBMIT";function G(e,t){return t?(e.classes=`${e.classes||""} ${t.classes||""}`.trim(),Object.keys(t).forEach((n=>{"element"!==n&&"classes"!==n&&(t[n]&&"object"==typeof t[n]&&!Array.isArray(t[n])?e[n]=Object.assign(Object.assign({},e[n]||{}),t[n]):e[n]=t[n])})),e):e}function z(e,t,n){var i;return null===(i=e[t])||void 0===i?void 0:i.find((e=>e.element===n))}function q(e){const{element:t,html:n,appendHtml:i}=e,s=function(e){if(null==e)return"";if("string"!=typeof e)return String(e);if(""===e)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(e))return e;const t=(new DOMParser).parseFromString(e,"text/html");return t.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((e=>e.remove())),t.querySelectorAll("*").forEach((e=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((t=>e.removeAttribute(t))),Array.from(e.attributes).forEach((t=>{t.name.startsWith("on")&&e.removeAttribute(t.name)})),"A"===e.tagName||"AREA"===e.tagName){const t=e.getAttribute("href");t&&(t.startsWith("javascript:")||t.startsWith("data:"))&&e.removeAttribute("href")}if("IMG"===e.tagName||"IFRAME"===e.tagName){const t=e.getAttribute("src");t&&(t.startsWith("javascript:")||t.startsWith("data:text/html"))&&e.removeAttribute("src")}if("FORM"===e.tagName){const t=e.getAttribute("action");t&&t.startsWith("javascript:")&&e.removeAttribute("action")}})),t.body.innerHTML}(n);i?t.innerHTML+=s:t.innerHTML=s}class Z extends Event{constructor(e,t,n){super(e,n),this.detail={},Object.defineProperty(this,"detail",{value:t})}}class Q extends HTMLElement{constructor(){var i,s;super(),this.construct=()=>{let e;const t=this.getAttribute(n("id")),i=this.getWidgetContainerNode();if(!i)throw new Error("Widget container not found in construct");const s=i.closest(`[${n("widget-id")}]`);let o;s&&(o=s.getAttribute(n("widget-id")));let r=new Z("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("path")),id:t,widgetId:o},{bubbles:!0,composed:!0});this.dispatchEvent(r),e=r.detail.props,Object.assign(this,e),this.observers=F(B,V,W),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(e){this.subscriptions.push(e)}off(){this.subscriptions.forEach((e=>null==e?void 0:e.off()))}},this.state=new S,this.componentEventEmitter=new O,this.componentResourceManager=new U(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 f(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(e=>{this.model.props=e,this.observers.get(B).forEach((t=>t(this.prevProps,e))),this.prevProps=e;const t=this.getHostElement(),i=n("floating");e.floating&&!t.getAttribute(i)?t.setAttribute(i,"true"):!e.floating&&t.getAttribute(i)&&t.removeAttribute(i)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(e=>{Object.assign(this.model,e)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(V).forEach((e=>e(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new L(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),x),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(R.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const e=this.getEnvironment();this.observers.get(W).forEach((t=>t(this.prevEnvironment,e))),this.prevEnvironment=e})))},this.attachHandlers=()=>{this.getHandlers().map((e=>this._handlerFactory.get(e))).map((e=>()=>e.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((e=>e()))},this.postponeHandlers=()=>{var e;null===(e=this.handlers)||void 0===e||e.forEach((e=>e.postpone()))},this.releaseHandlers=()=>{var e;null===(e=this.handlers)||void 0===e||e.forEach((e=>e.release()))},this.getProps=()=>{var e;return null===(e=this.getModel())||void 0===e?void 0:e.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=e=>{this.observers.get(B).push(e),e(null,this.prevProps)},this.observeShared=e=>{this.observers.get(V).push(e),e(this.getShared())},this.observeEnvironment=e=>{this.observers.get(W).push(e),e(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${n("element")}]`)).filter((e=>!e.hasAttribute(n("component"))))],this.getElement=(e,t)=>this.getElements().find((i=>t?i.getAttribute(n("element"))===e&&i.id===t:i.getAttribute(n("element"))===e)),this.applyAutoAdaptiveStyles=(e,t)=>{if(!e&&!t)return;const i=this.getElements();if(!i.length)return;e=function(e,t){if(!t)return e||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(e||{desktop:[],mobile:[]}));return t.forEach((e=>{const t=e.element;let i=!1,s=!1;n.desktop&&n.desktop.forEach((n=>{n.element===t&&(G(n,e),i=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===t&&(G(n,e),s=!0)})),!i&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(e))),!s&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(e)))})),n}(e,t);const s=n("type"),o="element-styles";let r=this.getRootElement().querySelector(`style[${s}="${o}"]`);r||(r=document.createElement("style"),r.setAttribute(s,o),this.getRootElement().appendChild(r)),q({element:r,html:""}),i.forEach((t=>{let i=t.getAttribute(n("element"));const s=this.getEnvironment();let o=z(e,s,i);if(o){if(this.resizeListener.isMobile()){const t=z(e,"desktop",i);t&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),o.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(o),r)}})),this._addLinkColor(r,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(e,t={})=>{if(!e||!e.style)return!1;for(const[n,i]of Object.entries(t))e.style[n]=i;return!0},this.applyStylesToElement=(e,t,i)=>{var s,o;const r=[];"host"===(t=Q._resolveTogglableStylesForElementModel(t)).element&&(w.applyHostStyles(this.model.type,e,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(s=this.model.props.backgroundDynamicInlineSVGElements)||void 0===s?void 0:s.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 a=t.styleAttributes.background,l=a&&a.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&l){this.componentResourceManager.getPending().increment();const e=new Image;e.src=l[1],C(e,"load",(()=>{this.componentResourceManager.getPending().decrement()})),C(e,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(e.src),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},t),{styleAttributes:_(t.styleAttributes,r)});if(P.set(e,c),this._setClassAttributes(e,t),i){if(t.hoverStyleAttributes){let s=Object.assign({},t.hoverStyleAttributes);if("FILL_UP"===t.hoverAnimationType){e.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",e.style.overflow="hidden";const n=e.tagName.toLowerCase(),i=`flip-up-animation-${t.element}`;let o=this.getRootElement().querySelector(`#${i}`);o||(o=document.createElement("style"),o.id=i,e.appendChild(o)),q({element:o,html:`\n ${n}::before {\n content: '';\n background: ${s.background};\n position: absolute;\n left: 0;\n top: ${e.getBoundingClientRect().height}px;\n height: ${e.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),s=Object.assign(Object.assign({},t.hoverStyleAttributes),{background:"transparent",position:"relative"})}s.borderTopWidth&&"0px"!==s.borderTopWidth||delete s.borderTopColor,s.borderBottomWidth&&"0px"!==s.borderBottomWidth||delete s.borderBottomColor,s.borderLeftWidth&&"0px"!==s.borderLeftWidth||delete s.borderLeftColor,s.borderRightWidth&&"0px"!==s.borderRightWidth||delete s.borderRightColor,this._addStylesToStyleElement(i,t.element,s,`:not(.${n("no-hover")}):hover`,!0)}t.placeholderStyleAttributes&&this._addStylesToStyleElement(i,t.element,t.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(i,this.getShared()),this.stylesAppliedToElement(e,t,i)}},this._fixMarginOverflow=e=>{const t=this.getParentComponent(),i=t&&("flex"===t.style.display||"inline-flex"===t.style.display),s="host",o=e.getAttribute(n("element"))===s;if(!i||!o)return;const r=this.getProps(),a=this.getEnvironment(),{styleAttributes:l}=z(r.adaptiveStyles,a,s)||{};if(!l)return;const c=l.marginLeft||l.marginRight,d="100%"===l.width;if(c&&d){const t=(parseFloat(l.marginLeft)||0)+(parseFloat(l.marginRight)||0);t&&setTimeout((()=>{e.style.width=`calc(100% - ${t}px)`}))}},this.applySharedClassesToElementModel=t=>function(t,n){let i=t;return(i.classes||"").split(" ").filter((t=>t.startsWith(e))).forEach((e=>{var t;let s=null===(t=n.textClasses)||void 0===t?void 0:t[e];s&&(s.styleAttributes.fontFamily||(s.isHeader&&n.headerFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:n.headerFontFamily})})),!s.isHeader&&n.textFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:n.textFontFamily})}))),i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),s.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},i.placeholderStyleAttributes),s.placeholderStyleAttributes)}))})),i.styleAttributes.fontFamily||(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.textFontFamily})})),i}(t,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(e,t,i,s="",o)=>{const r=Object.keys(i).reduce(((e,t)=>e+` ${M.camelCaseToDashCase(t)}: ${i[t]}${o?" !important;":";"}`),"");q({element:e,html:`[${n("element")}="${t}"]${s} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(e,t)=>{q({element:e,html:`[cl-type] {font-family:${t.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(e,t)=>{var n,i,s,o;t.linkColor&&q({element:e,html:`a {color: ${t.linkColor}}, a:visited {color: ${t.linkColor}}`,appendHtml:!0}),(null===(n=t.linkParams)||void 0===n?void 0:n.color)&&q({element:e,html:`a {color: ${null===(i=t.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(s=t.linkParams)||void 0===s?void 0:s.color}}`,appendHtml:!0}),(null===(o=t.linkParams)||void 0===o?void 0:o.removeUnderline)&&q({element:e,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(n,i)=>{Array.from(n.classList).filter((e=>e!==t("hovered")&&e!==t("focused"))).forEach((t=>{t.startsWith(e)&&n.classList.remove(t)}));const s=((n.getAttribute("class")||"")+" "+i.classes).trim();n.setAttribute("class",s)},this.getParentComponent=()=>H(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const e=null==this?void 0:this.getAttribute(n("path"));return e&&1===e.split(",").length?this.parentNode:H(this.parentNode,n("path"),void 0,(e=>e&&1===e.split(",").length))},this.getWidgetLanguages=()=>{return[(e=this.services.config).getConfig("appearanceLanguage"),e.getConfig("browserLanguage"),"en"].filter((e=>!!e));var e},this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=e=>function(e,t){return t.reduce(((t,n)=>{if(t)return t;const i=function(e,t){if(!e)return null;if(t[e])return{translations:t[e],language:e};const n=function(e){return e.includes("-")?e.split("-")[0].toLowerCase():e.includes("_")?e.split("_")[0].toLowerCase():e}(e);return t[n]?{translations:t[n],language:n}:null}(n,e);return i||null}),null)}(e,this.getWidgetLanguages()),this.stylesAppliedToElement=(e,t,n)=>{},this.updateContext=()=>{var e;const t=this.getModel();this.services.context.updateRecord(t.id,{label:this.getContextRecordLabel(t.props),viewIndex:null===(e=t.path)||void 0===e?void 0:e[0]})},this.addContextRecord=()=>{var e;const t=this.getModel();this.services.context.addRecord(t.id,{recordKey:t.id,id:t.props.control.name,label:this.getContextRecordLabel(t.props),value:t.props.control.defaultValue||"",viewIndex:null===(e=t.path)||void 0===e?void 0:e[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(t.props)}})},this.getContextRecordLabel=e=>{var t,n;const i=e.control.name;if(["email","first_name","last_name"].includes(i))return i.toUpperCase();if(e.content.label&&(null===(n=null===(t=e.adaptiveStyles.desktop.find((e=>"label"===e.element)))||void 0===t?void 0:t.params)||void 0===n?void 0:n.enabled)){const t=(new DOMParser).parseFromString(e.content.label,"text/html");return this.capitalizeFirstLetter(t.body.textContent||"")}return e.content.placeholder?this.capitalizeFirstLetter(e.content.placeholder):e.control.integrationName?this.capitalizeFirstLetter(e.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=e=>e.charAt(0).toUpperCase()+e.slice(1),this.getContextRecordExampleValue=e=>{switch(e.control.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(e)}},this.completeSubmitAction=e=>{const t=e||{},n=this.services.actionRegister.getRegisteredActions().find((e=>e.category===$));n?null==n||n.execute(void 0,void 0,!0,t):this.services.actionFactory.get({type:h}).execute(void 0,void 0,!0,t)},this.getHandlers=()=>this.getProps().handlers&&this.getProps().handlers.length?[...this.getProps().handlers]:[],this.assets=(e="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${e?`/${e}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(i=this.define)||void 0===i?void 0:i.manifest)||(null===(s=this.constructor.define)||void 0===s?void 0:s.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var e;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(e=this.mergeTagsProcessor)||void 0===e||e.destroy()}static _resolveTogglableStylesForElementModel(e){const t=Object.assign({},e);return Object.keys(t).forEach((e=>{e.toLowerCase().includes("styleattributes")&&(t[e]=Q._resolveTogglableStyles(t[e]))})),t}static _resolveTogglableStyles(e){const t=Object.assign({},e),n=(e,n,i)=>{n in t&&(e.forEach((e=>{e in t&&(t[e]=t[n]?t[e]:i)})),delete t[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),t}}const Y={name:"SysVideoComponent",componentType:"VIDEO",version:"1.0.0",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:"host",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:"host",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:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill"]}}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill"]}}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"]},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]}],general:[{type:"CONTROL",name:"VIDEO_URL",propPath:["control","youtubeUrl"],params:{label:"DOCUMENT_YOUTUBE_URL",placeholder:"https://www.youtube.com/watch..."}},{type:"CONTROL",name:"SWITCH",propPath:["content","autoplay"],params:{label:"DOCUMENT_AUTOPLAY",boldLabel:!0,description:"DOCUMENT_AUTOPLAY_DESCRIPTION"}},{type:"CONTROL",name:"VIDEO_CUSTOM_COVER",elementProp:"styleAttributes",element:"overlay",params:{aspectRatioPropPath:["content","aspectRatio"],showPlayButtonPropPath:["content","showPlayButton"]}}]},events:{dispatch:[],listen:[]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"VIDEO_URL",propPath:["control","youtubeUrl"],params:{label:"DOCUMENT_YOUTUBE_URL",placeholder:"https://www.youtube.com/watch..."}}]},i18nPropPaths:["control,youtubeUrl","content,videoId","content,aspectRatio"],i18n:{},props:{content:{videoId:null,autoplay:!1,aspectRatio:1.7777777777777777,videoPreviewImageUrl:null,showPlayButton:!0},control:{},styles:[{element:"host",styleAttributes:{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:""}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{width:"350px",minWidth:"350px",height:"197px",minHeight:"197px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,overflow:"hidden"},classes:""},{element:"overlay",styleAttributes:{background:null},classes:""}],mobile:[{element:"host",styleAttributes:{width:"350px",minWidth:"350px",height:"197px",minHeight:"197px",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,overflow:"hidden"},classes:""},{element:"overlay",styleAttributes:{background:null},classes:""}]}},metaDescription:{icon:"/SysVideoComponent/assets/img/video-component-icon.svg",label:{en:"Video",ru:"Видео",uk:"Вiдео",es:"Video",de:"Video",fr:"Vidéo",it:"Video",pt:"Vídeo",ro:"Video",bg:"Видео",cs:"Rádio",el:"Ραδιόφωνο",nl:"Radio",pl:"Radio",sv:"Radio",tr:"Video",ar:"الفيديو",zh:"视频",da:"Video",he:"וידאו",fi:"Video",hi:"वीडियो",hr:"Video",hu:"Videó",id:"Video",ja:"ビデオ",ko:"비디오",no:"Video",sk:"Video",sl:"Video",sr:"Video zapis"}}};function J(e){return J="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},J(e)}function K(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,oe(i.key),i)}}function X(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(X=function(){return!!e})()}function ee(e,t,n,i){var s=te(ne(1&i?e.prototype:e),t,n);return 2&i&&"function"==typeof s?function(e){return s.apply(n,e)}:s}function te(){return te="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=ne(e)););return e}(e,t);if(i){var s=Object.getOwnPropertyDescriptor(i,t);return s.get?s.get.call(arguments.length<3?e:n):s.value}},te.apply(null,arguments)}function ne(e){return ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ne(e)}function ie(e,t){return ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ie(e,t)}function se(e,t,n){return(t=oe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oe(e){var t=function(e){if("object"!=J(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=J(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==J(t)?t:t+""}var re=function(){function e(){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),se(t=function(e,t,n){return t=ne(t),function(e,t){if(t&&("object"==J(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,X()?Reflect.construct(t,n||[],ne(e).constructor):t.apply(e,n))}(this,e),"manifest",Y),se(t,"resizeObserver",void 0),se(t,"adjustVideoHeight",(function(e,n){if(e){var i=t.getHostElement(),s=n||i.getBoundingClientRect().width,o="".concat(s/e,"px");i.style.height=o,i.style.minHeight=o}})),se(t,"updatePlayButtonVisibility",(function(e,n,i){var s=t.getRootElement().querySelector(".video-overlay"),o="--cl-video-component-play-btn-visibility";return i&&!n?s.style.setProperty(o,"visible"):n?void(e.content.showPlayButton?s.style.setProperty(o,"visible"):s.style.setProperty(o,"hidden")):s.style.setProperty(o,"hidden")})),se(t,"preloadImage",(function(e,t){var n=new Image;n.src=e,n.onload=function(){return t()},n.onerror=function(){return t()}})),se(t,"displayPreviewImageAfterImageLoaded",(function(e,n,i){if(n||i){var s="UPDATING"===t.services.config.getConfig("entryModuleType"),o=e.querySelector("#youtube-player");if(i){var r=i.split(")")[0].slice(5,-1);!s&&o&&(o.style.opacity="0"),t.preloadImage(r,(function(){t.displayPreviewImage(e,n,i),!s&&o&&(o.style.opacity="1")}))}else t.displayPreviewImage(e,n,i)}})),se(t,"displayPreviewImage",(function(e,n,i){var s=e.querySelector(".video-overlay"),o=e.querySelector("#youtube-player");s.style.setProperty("--cl-video-component-overlay-visibility","visible"),i||setTimeout((function(){return s.style.backgroundImage="url(".concat(n,")")})),o&&(s.onclick=function(){o.src=o.src+"&autoplay=1",o.onload=function(){return t.hidePreviewImage(e)}})})),se(t,"hidePreviewImage",(function(e){var t=e.querySelector(".video-overlay");t.style.setProperty("--cl-video-component-overlay-visibility","hidden"),t.style.setProperty("--cl-video-component-play-btn-visibility","hidden"),t.style.backgroundImage="none"})),se(t,"createUpdatedIFrame",(function(e){var t=document.createElement("iframe");return t.src=e,t.id="youtube-player",t.allow="autoplay",t.setAttribute("frameborder","0"),t})),t.getRootElement().innerHTML="\n ".concat("\n <style>\n .main-container {\n height: 100%;\n overflow: hidden;\n position: relative;\n box-shadow: 0 0 0 3px inset #a1a1a1;\n background: #515151;\n background-repeat: no-repeat;\n background-position: center;\n background-image: url(\"data:image/svg+xml,%3Csvg%20width%3D%2244%22%20height%3D%2231%22%20viewBox%3D%220%200%2044%2031%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M19.4898%2010.6062C20.1401%2010.2582%2020.9292%2010.2963%2021.5429%2010.7055L26.2391%2013.8363C26.7955%2014.2072%2027.1297%2014.8317%2027.1297%2015.5004C27.1297%2016.1691%2026.7955%2016.7936%2026.2391%2017.1645L21.5429%2020.2953C20.9292%2020.7044%2020.1401%2020.7426%2019.4898%2020.3946C18.8395%2020.0465%2018.4335%2019.3688%2018.4335%2018.6312V12.3696C18.4335%2011.632%2018.8395%2010.9543%2019.4898%2010.6062ZM6.3803%203.05351C4.68417%203.18398%203.32052%204.50218%203.13266%206.19292C2.44536%2012.3786%202.44536%2018.6214%203.13266%2024.8071C3.32052%2026.4978%204.68417%2027.816%206.3803%2027.9465L14.4857%2028.57C19.4891%2028.9549%2024.5147%2028.9549%2029.5182%2028.57L37.6235%2027.9465C39.3197%2027.816%2040.6833%2026.4978%2040.8712%2024.8071C41.5585%2018.6214%2041.5585%2012.3786%2040.8712%206.19292C40.6833%204.50218%2039.3197%203.18398%2037.6235%203.05351L29.5182%202.43002C24.5147%202.04514%2019.4891%202.04514%2014.4857%202.43002L6.3803%203.05351ZM20.4335%2012.3696V18.6312L25.1297%2015.5004L20.4335%2012.3696ZM1.14489%205.97206C1.43886%203.32634%203.57274%201.26357%206.2269%201.0594L14.3323%200.435909C19.4378%200.0431735%2024.566%200.0431736%2029.6716%200.435909L37.7769%201.0594C40.4311%201.26357%2042.565%203.32633%2042.8589%205.97206C43.5626%2012.3045%2043.5626%2018.6955%2042.8589%2025.0279C42.565%2027.6737%2040.4311%2029.7364%2037.7769%2029.9406L29.6716%2030.5641C24.566%2030.9568%2019.4378%2030.9568%2014.3323%2030.5641L6.2269%2029.9406C3.57274%2029.7364%201.43886%2027.6737%201.14489%2025.0279C0.441285%2018.6955%200.441285%2012.3045%201.14489%205.97206Z%22%20fill%3D%22%23a1a1a1%22%2F%3E%0A%3C%2Fsvg%3E%0A\");\n }\n \n .video-overlay {\n visibility: var(--cl-video-component-overlay-visibility, hidden);\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-size: cover;\n background-repeat: no-repeat;\n background-position: center;\n cursor: pointer;\n }\n \n .video-overlay:after {\n content: '';\n visibility: var(--cl-video-component-play-btn-visibility, hidden);\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n background-repeat: no-repeat;\n background-position: center;\n background-size: 64px 48px;\n background-image: url(\"data:image/svg+xml,%3Csvg width='159' height='110' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m154 17.5c-1.82-6.73-7.07-12-13.8-13.8-9.04-3.49-96.6-5.2-122 0.1-6.73 1.82-12 7.07-13.8 13.8-4.08 17.9-4.39 56.6 0.1 74.9 1.82 6.73 7.07 12 13.8 13.8 17.9 4.12 103 4.7 122 0 6.73-1.82 12-7.07 13.8-13.8 4.35-19.5 4.66-55.8-0.1-75z' fill='%23f00'/%3E%3Cpath d='m105 55-40.8-23.4v46.8z' fill='%23fff'/%3E%3C/svg%3E%0A\");\n }\n \n #youtube-player {\n width: 100%;\n height: 100%;\n }\n </style>\n ",'\n <div class="main-container" cl-element="main">\n <div class="video-overlay" cl-element="overlay"></div>\n <iframe\n id="youtube-player"\n src=""\n allow="autoplay"\n frameborder="0">\n </iframe>\n </div>\n '),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ie(e,t)}(e,Q),t=e,(n=[{key:"connectedCallback",value:function(){var t=this;ee(e,"connectedCallback",this,3)([]);var n=this.getRootElement(),i="UPDATING"===this.services.config.getConfig("entryModuleType"),s=this.services.config.getConfig("previewMode");window.ResizeObserver&&(this.resizeObserver=new ResizeObserver((function(e){window.requestAnimationFrame((function(){if(Array.isArray(e)&&e.length){var n=e[0].contentRect;t.adjustVideoHeight(t.getProps().content.aspectRatio,n.width)}}))})),this.resizeObserver.observe(n.querySelector(".main-container")));var o=function(e){return!i&&!s&&e},r=function(e,i){var s=n.querySelector("#youtube-player");if(e){var r="https://www.youtube.com/embed/".concat(e,"?controls=1").concat(o(i)?"&autoplay=1&mute=1":"");if(!s||s.src!==r){var a,l=t.createUpdatedIFrame(r);null===(a=n.querySelector("#youtube-player"))||void 0===a||a.remove(),n.querySelector(".main-container").appendChild(l),o(i)&&(l.onload=function(){t.hidePreviewImage(n)})}}else{var c;null===(c=n.querySelector("#youtube-player"))||void 0===c||c.remove()}};this.observeProps((function(e,i){var o,a=t.getEnvironment(),l=null===(o=i.adaptiveStyles[a])||void 0===o||null===(o=o.find((function(e){return"overlay"===e.element})))||void 0===o?void 0:o.styleAttributes.background;t.applyAutoAdaptiveStyles(i.adaptiveStyles,i.styles),s||r(i.content.videoId,i.content.autoplay),(s||l)&&t.displayPreviewImageAfterImageLoaded(n,i.content.videoPreviewImageUrl,l,r),t.updatePlayButtonVisibility(i,l,s),t.adjustVideoHeight(i.content.aspectRatio)}))}},{key:"disconnectedCallback",value:function(){var t;ee(e,"disconnectedCallback",this,3)([]),window.ResizeObserver&&(null===(t=this.resizeObserver)||void 0===t||t.unobserve(this.getRootElement().querySelector(".main-container")))}}])&&K(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n}();se(re,"define",{name:"sys-video",model:Y.name,manifest:Y});export{re as default};window.clComponentClass_SysVideoComponent=re;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claspo/components",
3
- "version": "1.1.15",
3
+ "version": "1.2.0-theme.13",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "prebuild": "rm -rf out",
@@ -15,8 +15,8 @@
15
15
  "node": ">=18.16.0"
16
16
  },
17
17
  "dependencies": {
18
- "@claspo/common": "5.2.1",
19
- "@claspo/renderer": "16.6.3"
18
+ "@claspo/common": "5.2.1-theme.13",
19
+ "@claspo/renderer": "16.7.0-theme.13"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@babel/core": "^7.27.4",