@claspo/components 1.2.3 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const t="cl-";function e(e){return t+e}function n(t){return"cl-"+t}const o="VIEW",r="MODULE",i="CONTAINER",s="INPUT",a="BUTTON",l="CONSENT",c="COLUMN";var u,h;(h=u||(u={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",h.REQUEST="REQUEST",h.DISPATCH_EVENT="DISPATCH_EVENT",h.GO_TO_VIEW="GO_TO_VIEW",h.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",h.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",h.SHOW_WIDGET="SHOW_WIDGET",h.OPEN_LINK="OPEN_LINK",h.CLOSE_WIDGET="CLOSE_WIDGET",h.CLICK="CLICK";const p=u;var d,m;class g{static sortActions(t){const e={[p.CLOSE_WIDGET]:-1,[p.OPEN_LINK]:-2,[p.SHOW_WIDGET]:1,[p.SUBSCRIBE_CONTACT]:2,[p.REQUEST]: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,o){this.state=t;const r=o(),i=r.getAttribute(n("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(n("type"))));let o=0;for(;e[o]&&e[o].getAttribute(n("id"))!==i;){let t=e[o].getAttribute(n("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;o++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((r.shadowRoot||r).querySelectorAll(this.config.relativeSelector)):[r],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,o;try{for(var r,i=!0,s=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(o,r){!function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)}(o,r,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(r=await s.next()).done);i=!0){o=r.value,i=!1;const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}}catch(t){e={error:t}}finally{try{i||t||!(n=s.return)||await n.call(s)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}g.IGNORING_VIEW_ENTRY_TYPES=[a,l,s],(m=d||(d={})).CLICK="CLICK",m.COMPONENT_EVENT="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 y{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 d.CLICK:return new g(t,e);case d.COMPONENT_EVENT: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 b{constructor(){this.listeners=b.createDefaultListenersState()}emit(t,e,n=null){const o=this.listeners[t];o&&Object.values(o).forEach((o=>o(e,t,n))),Object.values(this.listeners["*"]).forEach((o=>o(e,t,n)))}on(t,e){const n=E.generate(),o=this.listeners[t];return o?o[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,o;(null===(o=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===o?void 0:o[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=b.createDefaultListenersState()}}b.createDefaultListenersState=()=>({"*":{}});const v=b,O=(t,e,n,o)=>{const r=EventTarget.prototype,{addEventListenerBase:i,addEventListener:s}=r;(i||s).call(t,e,n,o)};class S{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class T{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===r?Object.assign(Object.assign({},t),T.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})}}var C,A,_,N,I,L,P,R,M,w,j,k,U;T.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(A=C||(C={})).VIEW="VIEW",A.CONTAINER="CONTAINER",A.TEXT="TEXT",A.INPUT="INPUT",A.BUTTON="BUTTON",A.IMAGE="IMAGE",A.CONSENT="CONSENT",A.COUNTDOWN_TIMER="COUNTDOWN_TIMER",A.PROMO_CODE="PROMO_CODE",A.MULTIPLE_INPUT="MULTIPLE_INPUT",A.VIDEO="VIDEO",A.SLIDER="SLIDER",A.SLIDE="SLIDE",A.SOCIAL="SOCIAL",A.COLUMNS="COLUMNS",A.COLUMN="COLUMN",A.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(_||(_={})).CLICK="CLICK",function(t){t.SHOW_WIDGET="SHOW_WIDGET",t.OPEN_LINK="OPEN_LINK",t.SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",t.REQUEST="REQUEST",t.CLOSE_WIDGET="CLOSE_WIDGET",t.GO_TO_VIEW="GO_TO_VIEW",t.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",t.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",t.CLICK="CLICK"}(N||(N={})),function(t){t.SELF="_self",t.BLANK="_blank"}(I||(I={})),(L||(L={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(P||(P={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(R||(R={})),function(t){t.SLIDE_TO_TOP="SLIDE_TO_TOP",t.SLIDE_TO_BOTTOM="SLIDE_TO_BOTTOM",t.SLIDE_TO_LEFT="SLIDE_TO_LEFT",t.SLIDE_TO_RIGHT="SLIDE_TO_RIGHT"}(M||(M={})),function(t){t.PULSE="PULSE",t.VIBRATE="VIBRATE",t.WOBBLE="WOBBLE",t.SHAKE="SHAKE",t.JELLO="JELLO",t.BOUNCE="BOUNCE",t.BLINK="BLINK",t.FLICKER="FLICKER",t.PING="PING"}(w||(w={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(j||(j={})),(U=k||(k={})).BEFORE="BEFORE",U.AFTER="AFTER",U.INSIDE="INSIDE",U.INSTEAD="INSTEAD";class D extends v{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(D.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(D.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(D.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}D.changeEventName="CHANGE";const x=D;class F{static set(t,e){const n=t[F.accumulatorPropertyName]||{};t[F.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[F.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}F.accumulatorPropertyName="clStyleAttributes";const W=F;var B;!function(t){t.BUILT_IN="BUILT_IN",t.DETACHED="DETACHED",t.FLOATING_BOX="FLOATING_BOX",t.FLOATING_BAR="FLOATING_BAR",t.LAUNCHER="LAUNCHER",t.CONTENT_LOCKER="CONTENT_LOCKER"}(B||(B={}));class G{static applyHostStyles(t,e,n=null,r){var s,a,l;const u=null===(a=null===(s=null==n?void 0:n.props)||void 0===s?void 0:s.handlers)||void 0===a?void 0:a.find((t=>"CLICK"===t.type));u&&(null===(l=u.actions)||void 0===l?void 0:l.length)&&(e.style.cursor="pointer"),t!==o&&t!==i&&t!==c||(e.style.display=r===B.CONTENT_LOCKER&&t===o?"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 H{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class V{constructor(t,e,n,o,r,i){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=r,this.httpClient=i,this.schemaSubscription=null,this.themeSubscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((n=>{var o,r,i,s,a;const l=null===(r=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===r?void 0:r.find((t=>t.element===n)),c=(null===(i=e.styles)||void 0===i?void 0:i.find((t=>t.element===n)))||{},u=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(a=null==l?void 0:l.styleAttributes)||void 0===a?void 0:a.background),h=this.parseBackground(u);h.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((t=>t.text())).then((o=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))))).then((()=>{var e;const n=this.getSharedCb();return Object.keys((null===(e=n.theme)||void 0===e?void 0:e.schema)||{}).length>0?this._applyHostElementBackgroundFromTheme(this.envUrlMaps[t].get("host"),n.theme.schema):this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[t].get("host"),n.cssVars)})).catch((t=>{console.error(t),H.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.schemaSubscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(t=>{this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[this.getEnvCb()].get("host"),t)})),this.themeSubscription=this.documentModel.on("THEME_UPDATE",(t=>{this._applyHostElementBackgroundFromTheme(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)})),this}_applyHostElementBackgroundFromCssVars(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromCssVars(t,e))}_applyHostElementBackgroundFromTheme(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromTheme(t,e))}_buildBackgroundUrlFromCssVars(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}`}_buildBackgroundUrlFromTheme(t,e){const n=t.inlineSvgString.trim();let o=n;return[...n.matchAll(/var\(--cl-schema-([^)]+)\)/g)].forEach((t=>{const n=function(t=""){return t.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}(t[1]);var r;o=o.replace(`var(--${r=n,`cl-schema-${r}`})`,e[n])})),`url('data:image/svg+xml,${encodeURIComponent(o)}')${t.positionOptions}`}off(){var t,e;null===(t=this.schemaSubscription)||void 0===t||t.off(),null===(e=this.themeSubscription)||void 0===e||e.off()}}const $=new class{execute(t,e="GET",n=null,o,r){const i={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:r};return n&&(i.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,i)}};function K(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class z{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 Q{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}}var q;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.EXECUTE_ACTION_BY_PREDICATE="EXECUTE_ACTION_BY_PREDICATE"}(q||(q={}));const Y=q;class X{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(Y.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(Y.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new Q(this.onCounterStateUpdate)}}}const Z=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>Z(...t)}},J=Z,tt="props",et="shared",nt="environment";function ot(t,e,n,o){const r=t=>{let i=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return i&&(o&&"function"==typeof o?o(i.getAttribute(e)):(null===(s=null==i?void 0:i.getAttribute)||void 0===s?void 0:s.call(i,e))===n)?i:i&&i.parentNode&&r(i.parentNode)||null;var s};return r(t)}const rt="SUBMIT";function it(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{if("element"===n||"classes"===n)return;const o=e[n];o&&"object"==typeof o&&!Array.isArray(o)?t[n]=Object.assign(Object.assign({},t[n]||{}),o):t[n]=o})),t):t}const st={DESKTOP:"desktop",MOBILE:"mobile"};function at(t,e,n){var o;return null===(o=null==t?void 0:t[e])||void 0===o?void 0:o.find((t=>t.element===n))}function lt(t){const{element:e,html:n,appendHtml:o}=t,r=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(n);o?e.innerHTML+=r:e.innerHTML=r}class ct extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}var ut;!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(ut||(ut={}));class ht extends HTMLElement{constructor(){var o;super(),this.skipGameBlur=!0,this.construct=()=>{let t;const e=this.getAttribute(n("id")),o=this.getWidgetContainerNode();if(!o)throw new Error("Widget container not found in construct");const r=o.closest(`[${n("widget-id")}]`);let i;r&&(i=r.getAttribute(n("widget-id")));let s=new ct("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("path")),id:e,widgetId:i},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.detail.props,Object.assign(this,t),this.observers=J(tt,et,nt),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 v,this.componentResourceManager=new X(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new y(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(tt).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),o=n("floating");t.floating&&!e.getAttribute(o)?e.setAttribute(o,"true"):!t.floating&&e.getAttribute(o)&&e.removeAttribute(o)})),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(et).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new V(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),$),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(x.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(nt).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_READY_TO_PLAY",(()=>{this.skipGameBlur||this.getHostElement().classList.add("cl-game-spotlight-component")}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_COMPLETED",(()=>{this.skipGameBlur||this.getHostElement().classList.remove("cl-game-spotlight-component")})))},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.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===ut.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===ut.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(tt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(et).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(nt).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((o=>e?o.getAttribute(n("element"))===t&&o.id===e:o.getAttribute(n("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const o=this.getElements();if(!o.length)return;const r=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let o=!1,r=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(it(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(it(n,t),r=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!r&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e),i=n("type"),s="element-styles";let a=this.getRootElement().querySelector(`style[${i}="${s}"]`);a||(a=document.createElement("style"),a.setAttribute(i,s),this.getRootElement().appendChild(a)),lt({element:a,html:""}),o.forEach((t=>{let e=t.getAttribute(n("element"));const o=this.getEnvironment();let i=at(r,o,e);if(i){if(this.resizeListener.isMobile()){const t=at(r,"desktop",e);t&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),i.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(i),a)}})),this._addLinkColor(a,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,o)=>{var r,i;const s=[];"host"===(e=ht._resolveTogglableStylesForElementModel(e)).element&&(G.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(r=this.model.props.backgroundDynamicInlineSVGElements)||void 0===r?void 0:r.desktop)||"mobile"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.push("background")));let 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],O(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),O(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:K(e.styleAttributes,s)});if(W.set(t,c),this._setClassAttributes(t,e),o){if(e.hoverStyleAttributes){let r=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(),o=`flip-up-animation-${e.element}`;let i=this.getRootElement().querySelector(`#${o}`);i||(i=document.createElement("style"),i.id=o,t.appendChild(i)),lt({element:i,html:`\n ${n}::before {\n content: '';\n background: ${r.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 `}),r=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}r.borderTopWidth&&"0px"!==r.borderTopWidth||delete r.borderTopColor,r.borderBottomWidth&&"0px"!==r.borderBottomWidth||delete r.borderBottomColor,r.borderLeftWidth&&"0px"!==r.borderLeftWidth||delete r.borderLeftColor,r.borderRightWidth&&"0px"!==r.borderRightWidth||delete r.borderRightColor,this._addStylesToStyleElement(o,e.element,r,`:not(.${n("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(o,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(o,this.getShared()),this.stylesAppliedToElement(t,e,o)}},this.applySharedClassesToElementModel=e=>function(e,n){let o=e;return(o.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((t=>{var e;let r=null===(e=n.textClasses)||void 0===e?void 0:e[t];r&&(r.styleAttributes.fontFamily||(r.isHeader&&n.headerFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:n.headerFontFamily})})),!r.isHeader&&n.textFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:n.textFontFamily})}))),o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),r.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},o.placeholderStyleAttributes),r.placeholderStyleAttributes)}))})),o.styleAttributes.fontFamily||(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.textFontFamily})})),o}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,o,r="",i)=>{const s=Object.keys(o).reduce(((t,e)=>t+` ${z.camelCaseToDashCase(e)}: ${o[e]}${i?" !important;":";"}`),"");lt({element:t,html:`[${n("element")}="${e}"]${r} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{lt({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,r,i;e.linkColor&&lt({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)&&lt({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(r=e.linkParams)||void 0===r?void 0:r.color}}`,appendHtml:!0}),(null===(i=e.linkParams)||void 0===i?void 0:i.removeUnderline)&&lt({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(n,o)=>{Array.from(n.classList).filter((t=>t!==e("hovered")&&t!==e("focused"))).forEach((e=>{e.startsWith(t)&&n.classList.remove(e)}));const r=((n.getAttribute("class")||"")+" "+o.classes).trim();n.setAttribute("class",r)},this.getParentComponent=()=>ot(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(n("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:ot(this.parentNode,n("path"),void 0,(t=>1===(null==t?void 0:t.split(",").length)))},this.getWidgetLanguages=()=>function(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null}),null)}(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,o,r,i,s;const a=t.control.name;if(["email","first_name","last_name"].includes(a))return a.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(r=null===(o=null===(n=t.adaptiveStyles)||void 0===n?void 0:n.desktop.find((t=>"label"===t.element)))||void 0===o?void 0:o.params)||void 0===r?void 0:r.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(i=t.content)||void 0===i?void 0:i.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(s=t.control)||void 0===s?void 0:s.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=>{var e;switch(null===(e=t.control)||void 0===e?void 0:e.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===rt));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:p.REQUEST}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>{var t;return(null===(t=this.getProps())||void 0===t?void 0:t.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===(o=this.constructor.define)||void 0===o?void 0:o.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}));const t=document.createElement("style");t.textContent='\n :host(.cl-game-spotlight-component)::after {\n content: "";\n position: absolute;\n background-size: 100% 100%;\n background-repeat: no-repeat;\n overflow: visible;\n \n backdrop-filter: blur(4px);\n \n inset: -30px;\n mask-image: \n linear-gradient(to bottom, transparent, grey 30px, grey calc(100% - 30px), transparent),\n linear-gradient(to right, transparent, grey 30px, grey calc(100% - 30px), transparent);\n mask-composite: intersect;\n -webkit-mask-composite: source-in; /* for Chrome/Safari */\n \n transition: opacity 0.35s ease;\n pointer-events: auto;\n }\n ',this.getRootElement().prepend(t)}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}}ht._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=ht._resolveTogglableStyles(e[t]))})),e},ht._resolveTogglableStyles=t=>{const e=Object.assign({},t),n=(t,n,o)=>{n in e&&(t.forEach((t=>{t in e&&(e[t]=e[n]?e[t]:o)})),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e};const pt=ht;var dt={FOLLOW:"FOLLOW",SHARE:"SHARE"},mt={FACEBOOK:"FACEBOOK",INSTAGRAM:"INSTAGRAM",LINKEDIN:"LINKEDIN",TWITTER:"TWITTER",CUSTOM:"CUSTOM",EMAIL:"EMAIL",PINTEREST:"PINTEREST",WHATSAPP:"WHATSAPP"},gt={ROUNDED:"ROUNDED"};function ft(t){return ft="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},ft(t)}function yt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,Et(o.key),o)}}function Et(t){var e=function(t){if("object"!=ft(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ft(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ft(e)?e:e+""}var bt=function(){return function(t,e){return e&&yt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.imgPath="".concat(e.replace(/\/$/,""),"/img")}),[{key:"getValidPlatformName",value:function(t){return mt[t.type]?t.type:mt.CUSTOM}},{key:"getValidIconMode",value:function(t){return(gt[t.mode]?t.mode:gt.ROUNDED).toLowerCase()}},{key:"getDefaultImage",value:function(){return"".concat(this.imgPath,"/image-placeholder.svg")}},{key:"getPlatformImageUrl",value:function(t){if(t.image)return t.image;var e=this.getValidPlatformName(t);if(e===mt.CUSTOM)return this.getDefaultImage();var n="".concat(e.toLowerCase(),"-logo"),o=this.getValidIconMode(t),r=o?"-".concat(o):"";return"".concat(this.imgPath,"/").concat(n).concat(r,".svg")}}])}();const vt={name:"SysSocialComponent",componentType:"SOCIAL",version:"1.0.0",events:{dispatch:[],listen:[]},contextMenuModel:function(t){return Object.values(st).map((e=>({type:"GROUP",propPath:["adaptiveStyles",e],children:t})))}([{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]),propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SOCIAL_ICON_SIZE",propPath:["control","size","desktop"]},{type:"CONTROL",name:"SOCIAL_TYPE_AND_ICON_SELECT",propPath:["control"]}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SOCIAL_ICON_SIZE",propPath:["control","size","mobile"]},{type:"CONTROL",name:"SOCIAL_TYPE_AND_ICON_SELECT",propPath:["control"]}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0}}]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1}}]},i18nPropPaths:["content,text","handlers,[id],actions,[id],params,link","handlers,[id],actions,[id],params,customData"],props:{control:{options:[{type:"FACEBOOK",order:0},{type:"INSTAGRAM",order:1},{type:"LINKEDIN",order:2},{type:"TWITTER",order:3}],mode:"FOLLOW",size:{desktop:32,mobile:32}},adaptiveStyles:{desktop:[{element:"host",styleAttributes:{}}],mobile:[{element:"host",styleAttributes:{}}]}},metaDescription:{icon:"/SysSocialComponent/assets/img/social-component-icon.svg",label:{en:"Social",ru:"Социальные сети",uk:"Соціальні мережі",es:"Social",de:"Social",fr:"Social",it:"Social",pt:"Social",ro:"Social",bg:"Social",cs:"Social",el:"Social",nl:"Social",pl:"Social",sv:"Social",tr:"Social",ar:"Social",zh:"社群媒体",da:"Social",he:"Social",fi:"Social",hi:"Social",hr:"Social",hu:"Social",id:"Social",ja:"Social",ko:"Social",no:"Social",sk:"Social",sl:"Social",sr:"Social"}},syncEnabled:!0,stylesImitationEnabled:!0};function Ot(t){return Ot="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},Ot(t)}function St(t,e,n){return(e=function(t){var e=function(t){if("object"!=Ot(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ot(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ot(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tt(t){var e=t&&t.type;return Boolean(e)}function Ct(t){return Ct="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},Ct(t)}function At(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function _t(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?At(Object(n),!0).forEach((function(e){Nt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):At(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Nt(t,e,n){return(e=function(t){var e=function(t){if("object"!=Ct(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ct(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function It(t){var e,n,o,r,i=function(t){Array.isArray(t.options)||(console.warn("SysSocial: options should be an array, setting default value"),t.options=[]);var e=t.options.filter(Tt);return e.length!==t.options.length&&(console.error("SysSocial: options contain invalid platforms, filtering them out"),t.options=e),Object.values(dt).includes(t.mode)||(console.error("SysSocial: mode is invalid, setting default value"),t.mode=dt.FOLLOW),"object"!==Ct(t.size)&&Number.isNaN(Number(t.size))&&(console.error("SysSocial: size should be a number, setting default value"),t.size=32),"string"!=typeof t.size&&"number"!=typeof t.size||(console.warn("SysSocial: migrating size from primitive to object"),t.size={desktop:t.size,mobile:t.size}),t}(_t({},null==t?void 0:t.control));return i.mode===dt.SHARE&&(i.options=(n=(e=i).options,o=e.shareUrl,r="INTERNAL"===e.shareUrlType?window.location.href:o,n.reduce((function(t,e){var n=function(t){return t?St(St(St(St(St(St({},mt.FACEBOOK,(function(t){var e=t.url;return"https://www.facebook.com/sharer/sharer.php?u=".concat(e)})),mt.LINKEDIN,(function(t){var e=t.url;return"https://www.linkedin.com/sharing/share-offsite/?url=".concat(e)})),mt.TWITTER,(function(t){var e=t.url;return"https://twitter.com/intent/tweet?url=".concat(e)})),mt.PINTEREST,(function(t){var e=t.url;return"https://www.pinterest.com/pin/create/button/?url=".concat(e)})),mt.WHATSAPP,(function(t){var e=t.url;return"https://wa.me/?text=".concat(e)})),mt.EMAIL,(function(t){var e=t.url,n=t.subject,o=void 0===n?"":n;return"mailto:?body=".concat(e,"&subject=").concat(o)}))[t.type]:null}(e);return n&&t.push(_t(_t({},e),{},{url:n(_t({url:r},e.props))})),t}),[]))),i}function Lt(t){const{element:e,html:n,appendHtml:o}=t,r=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(n);o?e.innerHTML+=r:e.innerHTML=r}function Pt(t){return Pt="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},Pt(t)}function Rt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function Mt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,xt(o.key),o)}}function wt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wt=function(){return!!t})()}function jt(){return jt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=kt(t)););return t}(t,e);if(o){var r=Object.getOwnPropertyDescriptor(o,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},jt.apply(null,arguments)}function kt(t){return kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kt(t)}function Ut(t,e){return Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ut(t,e)}function Dt(t,e,n){return(e=xt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xt(t){var e=function(t){if("object"!=Pt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Pt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pt(e)?e:e+""}var Ft=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),Dt(e=function(t,e,n){return e=kt(e),function(t,e){if(e&&("object"==Pt(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,wt()?Reflect.construct(e,n||[],kt(t).constructor):e.apply(t,n))}(this,t),"createContent",(function(t){var n=e.getElement("social"),o=It(t),r=n.querySelector(".items-wrapper");r?e._renderItemsForExistingComponent(r,o):e._renderItemsForEmptyComponent(n,o)})),Dt(e,"_renderItemsForEmptyComponent",(function(t,n){var o=document.createElement("div");o.classList.add("items-wrapper"),e.addItemsContent(o,n),Lt({element:t,html:""}),t.append(o)})),Dt(e,"_renderItemsForExistingComponent",(function(t,n){var o={};n.options.forEach((function(r){var i=e.getPlatformKey(r),s=t.querySelector('[key="'.concat(i,'"]'));o[i]=s?e._updatePlatformComponent(s,r,n):e._createNewPlatformComponent(t,r,n),e._setPlatformStyles(o[i],r)}));var r,i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Rt(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)?Rt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0,r=function(){};return{s:r,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}(t.children);try{for(i.s();!(r=i.n()).done;){var s=r.value,a=s.getAttribute("key");o[a]||t.removeChild(s)}}catch(t){i.e(t)}finally{i.f()}})),Dt(e,"_updatePlatformComponent",(function(t,n,o){var r=t.querySelector("img"),i=e.urlManager.getPlatformImageUrl(n);r.src!==i&&(r.src=i);var s=o.size[e.getEnvironment()];return s!==r.width&&(r.height=s,r.width=s),t})),Dt(e,"_createNewPlatformComponent",(function(t,n,o){var r=e.createPlatformComponent(n,o);return t.append(r),r})),Dt(e,"addItemsContent",(function(t,n){return t.classList.add("social-list"),n.options.forEach((function(o){t.append(e.createPlatformComponent(o,n))})),t})),Dt(e,"createPlatformComponent",(function(t,n){var o,r=n.size,i=t.url;i?((o=document.createElement("a")).setAttribute("href",i||"#"),o.setAttribute("target","_blank")):o=document.createElement("div"),o.classList.add("social-list-item"),o.setAttribute("key",e.getPlatformKey(t)),e._setPlatformStyles(o,t);var s=e.urlManager.getPlatformImageUrl(t),a=r[e.getEnvironment()],l=document.createElement("img");return l.src=s,l.height=a,l.width=a,Lt({element:o,html:""}),o.appendChild(l),o})),Dt(e,"getPlatformKey",(function(t){return"".concat(t.type,"-").concat(t.order)})),Dt(e,"_setPlatformStyles",(function(t,e){t.setAttribute("style","order:".concat(e.order))})),Dt(e,"manifest",vt),e.getRootElement().innerHTML="\n <style>".concat(t.componentStyle,"</style>\n ").concat(t.componentTemplate,"\n "),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ut(t,e)}(t,pt),function(t,e){return e&&Mt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;!function(t,e,n){var o=jt(kt(t.prototype),"connectedCallback",n);return"function"==typeof o?function(t){return o.apply(n,t)}:o}(t,0,this)([]),this.urlManager=new bt(this.assets()),this.observeProps((function(t,n){e.createContent(n),e.applyAutoAdaptiveStyles(n.adaptiveStyles)})),this.observeEnvironment((function(){var t=e.getProps();e.createContent(t),e.applyAutoAdaptiveStyles(t.adaptiveStyles)}))}}])}();Dt(Ft,"define",{name:"sys-social",model:vt.name,manifest:vt}),Dt(Ft,"componentStyle","\n .social-list {\n display: flex;\n gap: 10px;\n }\n \n .social-list-item {\n display: flex;\n }\n"),Dt(Ft,"componentTemplate",'\n <div class="social-container">\n <div cl-element="social" class="social-list-content">\n </div>\n </div>\n');export{Ft as default};window.clComponentClass_SysSocialComponent=Ft;
1
+ const t="cl-";function e(e){return t+e}function n(t){return"cl-"+t}const o="VIEW",r="MODULE",i="CONTAINER",s="INPUT",a="BUTTON",l="CONSENT",c="COLUMN";var u,h;(h=u||(u={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",h.REQUEST="REQUEST",h.DISPATCH_EVENT="DISPATCH_EVENT",h.GO_TO_VIEW="GO_TO_VIEW",h.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",h.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",h.SHOW_WIDGET="SHOW_WIDGET",h.OPEN_LINK="OPEN_LINK",h.CLOSE_WIDGET="CLOSE_WIDGET",h.CLICK="CLICK";const p=u;var d,m;class g{static sortActions(t){const e={[p.CLOSE_WIDGET]:-1,[p.OPEN_LINK]:-2,[p.SHOW_WIDGET]:1,[p.SUBSCRIBE_CONTACT]:2,[p.REQUEST]: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,o){this.state=t;const r=o(),i=r.getAttribute(n("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(n("type"))));let o=0;for(;e[o]&&e[o].getAttribute(n("id"))!==i;){let t=e[o].getAttribute(n("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;o++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((r.shadowRoot||r).querySelectorAll(this.config.relativeSelector)):[r],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,o;try{for(var r,i=!0,s=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise((function(o,r){!function(t,e,n,o){Promise.resolve(o).then((function(e){t({value:e,done:n})}),e)}(o,r,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(r=await s.next()).done);i=!0){o=r.value,i=!1;const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}}catch(t){e={error:t}}finally{try{i||t||!(n=s.return)||await n.call(s)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}g.IGNORING_VIEW_ENTRY_TYPES=[a,l,s],(m=d||(d={})).CLICK="CLICK",m.COMPONENT_EVENT="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 y{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 d.CLICK:return new g(t,e);case d.COMPONENT_EVENT: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 b{constructor(){this.listeners=b.createDefaultListenersState()}emit(t,e,n=null){const o=this.listeners[t];o&&Object.values(o).forEach((o=>o(e,t,n))),Object.values(this.listeners["*"]).forEach((o=>o(e,t,n)))}on(t,e){const n=E.generate(),o=this.listeners[t];return o?o[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,o;(null===(o=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===o?void 0:o[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=b.createDefaultListenersState()}}b.createDefaultListenersState=()=>({"*":{}});const v=b,O=(t,e,n,o)=>{const r=EventTarget.prototype,{addEventListenerBase:i,addEventListener:s}=r;(i||s).call(t,e,n,o)};class S{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class T{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===r?Object.assign(Object.assign({},t),T.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})}}var C,_,A,N,I,L,P,R,M,w,j,U,k;T.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(_=C||(C={})).VIEW="VIEW",_.CONTAINER="CONTAINER",_.TEXT="TEXT",_.INPUT="INPUT",_.BUTTON="BUTTON",_.IMAGE="IMAGE",_.CONSENT="CONSENT",_.COUNTDOWN_TIMER="COUNTDOWN_TIMER",_.PROMO_CODE="PROMO_CODE",_.MULTIPLE_INPUT="MULTIPLE_INPUT",_.VIDEO="VIDEO",_.SLIDER="SLIDER",_.SLIDE="SLIDE",_.SOCIAL="SOCIAL",_.COLUMNS="COLUMNS",_.COLUMN="COLUMN",_.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(A||(A={})).CLICK="CLICK",function(t){t.SHOW_WIDGET="SHOW_WIDGET",t.OPEN_LINK="OPEN_LINK",t.SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",t.REQUEST="REQUEST",t.CLOSE_WIDGET="CLOSE_WIDGET",t.GO_TO_VIEW="GO_TO_VIEW",t.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",t.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",t.CLICK="CLICK"}(N||(N={})),function(t){t.SELF="_self",t.BLANK="_blank"}(I||(I={})),(L||(L={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(P||(P={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(R||(R={})),function(t){t.SLIDE_TO_TOP="SLIDE_TO_TOP",t.SLIDE_TO_BOTTOM="SLIDE_TO_BOTTOM",t.SLIDE_TO_LEFT="SLIDE_TO_LEFT",t.SLIDE_TO_RIGHT="SLIDE_TO_RIGHT"}(M||(M={})),function(t){t.PULSE="PULSE",t.VIBRATE="VIBRATE",t.WOBBLE="WOBBLE",t.SHAKE="SHAKE",t.JELLO="JELLO",t.BOUNCE="BOUNCE",t.BLINK="BLINK",t.FLICKER="FLICKER",t.PING="PING"}(w||(w={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(j||(j={})),(k=U||(U={})).BEFORE="BEFORE",k.AFTER="AFTER",k.INSIDE="INSIDE",k.INSTEAD="INSTEAD";class D extends v{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(D.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(D.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(D.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}D.changeEventName="CHANGE";const x=D;class F{static set(t,e){const n=t[F.accumulatorPropertyName]||{};t[F.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[F.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}F.accumulatorPropertyName="clStyleAttributes";const B=F;var W;!function(t){t.BUILT_IN="BUILT_IN",t.DETACHED="DETACHED",t.FLOATING_BOX="FLOATING_BOX",t.FLOATING_BAR="FLOATING_BAR",t.LAUNCHER="LAUNCHER",t.CONTENT_LOCKER="CONTENT_LOCKER"}(W||(W={}));class G{static applyHostStyles(t,e,n=null,r){var s,a,l;const u=null===(a=null===(s=null==n?void 0:n.props)||void 0===s?void 0:s.handlers)||void 0===a?void 0:a.find((t=>"CLICK"===t.type));u&&(null===(l=u.actions)||void 0===l?void 0:l.length)&&(e.style.cursor="pointer"),t!==o&&t!==i&&t!==c||(e.style.display=r===W.CONTENT_LOCKER&&t===o?"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 H{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class V{constructor(t,e,n,o,r,i){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=r,this.httpClient=i,this.schemaSubscription=null,this.themeSubscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((n=>{var o,r,i,s,a;const l=null===(r=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===r?void 0:r.find((t=>t.element===n)),c=(null===(i=e.styles)||void 0===i?void 0:i.find((t=>t.element===n)))||{},u=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(a=null==l?void 0:l.styleAttributes)||void 0===a?void 0:a.background),h=this.parseBackground(u);h.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((t=>t.text())).then((o=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))))).then((()=>{var e;const n=this.getSharedCb();return Object.keys((null===(e=n.theme)||void 0===e?void 0:e.schema)||{}).length>0?this._applyHostElementBackgroundFromTheme(this.envUrlMaps[t].get("host"),n.theme.schema):this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[t].get("host"),n.cssVars)})).catch((t=>{console.error(t),H.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.schemaSubscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(t=>{this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[this.getEnvCb()].get("host"),t)})),this.themeSubscription=this.documentModel.on("THEME_UPDATE",(t=>{this._applyHostElementBackgroundFromTheme(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)})),this}_applyHostElementBackgroundFromCssVars(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromCssVars(t,e))}_applyHostElementBackgroundFromTheme(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromTheme(t,e))}_buildBackgroundUrlFromCssVars(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}`}_buildBackgroundUrlFromTheme(t,e){const n=t.inlineSvgString.trim();let o=n;return[...n.matchAll(/var\(--cl-schema-([^)]+)\)/g)].forEach((t=>{const n=function(t=""){return t.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}(t[1]);var r;o=o.replace(`var(--${r=n,`cl-schema-${r}`})`,e[n])})),`url('data:image/svg+xml,${encodeURIComponent(o)}')${t.positionOptions}`}off(){var t,e;null===(t=this.schemaSubscription)||void 0===t||t.off(),null===(e=this.themeSubscription)||void 0===e||e.off()}}const $=new class{execute(t,e="GET",n=null,o,r){const i={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:r};return n&&(i.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,i)}};function K(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class z{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 Q{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}}var Y;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.EXECUTE_ACTION_BY_PREDICATE="EXECUTE_ACTION_BY_PREDICATE"}(Y||(Y={}));const q=Y;class X{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(q.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(q.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new Q(this.onCounterStateUpdate)}}}const J=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>J(...t)}},Z=J,tt="props",et="shared",nt="environment";function ot(t,e,n,o){const r=t=>{let i=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return i&&(o&&"function"==typeof o?o(i.getAttribute(e)):(null===(s=null==i?void 0:i.getAttribute)||void 0===s?void 0:s.call(i,e))===n)?i:i&&i.parentNode&&r(i.parentNode)||null;var s};return r(t)}const rt="SUBMIT";function it(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{if("element"===n||"classes"===n)return;const o=e[n];o&&"object"==typeof o&&!Array.isArray(o)?t[n]=Object.assign(Object.assign({},t[n]||{}),o):t[n]=o})),t):t}const st={DESKTOP:"desktop",MOBILE:"mobile"};function at(t,e,n){var o;return null===(o=null==t?void 0:t[e])||void 0===o?void 0:o.find((t=>t.element===n))}function lt(t){const{element:e,html:n,appendHtml:o}=t,r=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(n);o?e.innerHTML+=r:e.innerHTML=r}class ct extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}var ut;!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(ut||(ut={}));class ht extends HTMLElement{constructor(){var o;super(),this.skipGameBlur=!0,this.construct=()=>{let t;const e=this.getAttribute(n("id")),o=this.getWidgetContainerNode();if(!o)throw new Error("Widget container not found in construct");const r=o.closest(`[${n("widget-id")}]`);let i;r&&(i=r.getAttribute(n("widget-id")));let s=new ct("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("path")),id:e,widgetId:i},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.detail.props,Object.assign(this,t),this.observers=Z(tt,et,nt),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 v,this.componentResourceManager=new X(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new y(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(tt).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),o=n("floating");t.floating&&!e.getAttribute(o)?e.setAttribute(o,"true"):!t.floating&&e.getAttribute(o)&&e.removeAttribute(o)})),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(et).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new V(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),$),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(x.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(nt).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_READY_TO_PLAY",(()=>{this.skipGameBlur||this.getHostElement().classList.add("cl-game-spotlight-component")}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_COMPLETED",(()=>{this.skipGameBlur||this.getHostElement().classList.remove("cl-game-spotlight-component")})))},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.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===ut.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===ut.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(tt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(et).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(nt).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((o=>e?o.getAttribute(n("element"))===t&&o.id===e:o.getAttribute(n("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const o=this.getElements();if(!o.length)return;const r=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let o=!1,r=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(it(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(it(n,t),r=!0)})),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!r&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e),i=n("type"),s="element-styles";let a=this.getRootElement().querySelector(`style[${i}="${s}"]`);a||(a=document.createElement("style"),a.setAttribute(i,s),this.getRootElement().appendChild(a)),lt({element:a,html:""}),o.forEach((t=>{let e=t.getAttribute(n("element"));const o=this.getEnvironment();let i=at(r,o,e);if(i){if(this.resizeListener.isMobile()){const t=at(r,"desktop",e);t&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),i.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(i),a)}})),this._addLinkColor(a,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,o)=>{var r,i;const s=[];"host"===(e=ht._resolveTogglableStylesForElementModel(e)).element&&(G.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(r=this.model.props.backgroundDynamicInlineSVGElements)||void 0===r?void 0:r.desktop)||"mobile"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.push("background")));let 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],O(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),O(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:K(e.styleAttributes,s)});if(B.set(t,c),this._setClassAttributes(t,e),o){if(e.hoverStyleAttributes){let r=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(),o=`flip-up-animation-${e.element}`;let i=this.getRootElement().querySelector(`#${o}`);i||(i=document.createElement("style"),i.id=o,t.appendChild(i)),lt({element:i,html:`\n ${n}::before {\n content: '';\n background: ${r.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 `}),r=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}r.borderTopWidth&&"0px"!==r.borderTopWidth||delete r.borderTopColor,r.borderBottomWidth&&"0px"!==r.borderBottomWidth||delete r.borderBottomColor,r.borderLeftWidth&&"0px"!==r.borderLeftWidth||delete r.borderLeftColor,r.borderRightWidth&&"0px"!==r.borderRightWidth||delete r.borderRightColor,this._addStylesToStyleElement(o,e.element,r,`:not(.${n("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(o,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(o,this.getShared()),this.stylesAppliedToElement(t,e,o)}},this.applySharedClassesToElementModel=e=>function(e,n){let o=e;return(o.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((t=>{var e;let r=null===(e=n.textClasses)||void 0===e?void 0:e[t];r&&(r.styleAttributes.fontFamily||(r.isHeader&&n.headerFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:n.headerFontFamily})})),!r.isHeader&&n.textFontFamily&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:n.textFontFamily})}))),o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),r.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},o.placeholderStyleAttributes),r.placeholderStyleAttributes)}))})),o.styleAttributes.fontFamily||(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.textFontFamily})})),o}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,o,r="",i)=>{const s=Object.keys(o).reduce(((t,e)=>t+` ${z.camelCaseToDashCase(e)}: ${o[e]}${i?" !important;":";"}`),"");lt({element:t,html:`[${n("element")}="${e}"]${r} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{lt({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,r,i;e.linkColor&&lt({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)&&lt({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(r=e.linkParams)||void 0===r?void 0:r.color}}`,appendHtml:!0}),(null===(i=e.linkParams)||void 0===i?void 0:i.removeUnderline)&&lt({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(n,o)=>{Array.from(n.classList).filter((t=>t!==e("hovered")&&t!==e("focused"))).forEach((e=>{e.startsWith(t)&&n.classList.remove(e)}));const r=((n.getAttribute("class")||"")+" "+o.classes).trim();n.setAttribute("class",r)},this.getParentComponent=()=>ot(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(n("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:ot(this.parentNode,n("path"),void 0,(t=>1===(null==t?void 0:t.split(",").length)))},this.getWidgetLanguages=()=>function(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null}),null)}(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,o,r,i,s;const a=t.control.name;if(["email","first_name","last_name"].includes(a))return a.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(r=null===(o=null===(n=t.adaptiveStyles)||void 0===n?void 0:n.desktop.find((t=>"label"===t.element)))||void 0===o?void 0:o.params)||void 0===r?void 0:r.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(i=t.content)||void 0===i?void 0:i.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(s=t.control)||void 0===s?void 0:s.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=>{var e;switch(null===(e=t.control)||void 0===e?void 0:e.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===rt));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:p.REQUEST}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>{var t;return(null===(t=this.getProps())||void 0===t?void 0:t.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===(o=this.constructor.define)||void 0===o?void 0:o.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}));const t=document.createElement("style");t.textContent='\n :host(.cl-game-spotlight-component)::after {\n content: "";\n position: absolute;\n background-size: 100% 100%;\n background-repeat: no-repeat;\n overflow: visible;\n \n backdrop-filter: blur(4px);\n \n inset: -30px;\n mask-image: \n linear-gradient(to bottom, transparent, grey 30px, grey calc(100% - 30px), transparent),\n linear-gradient(to right, transparent, grey 30px, grey calc(100% - 30px), transparent);\n mask-composite: intersect;\n -webkit-mask-composite: source-in; /* for Chrome/Safari */\n \n transition: opacity 0.35s ease;\n pointer-events: auto;\n }\n ',this.getRootElement().prepend(t)}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}}ht._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=ht._resolveTogglableStyles(e[t]))})),e},ht._resolveTogglableStyles=t=>{const e=Object.assign({},t),n=(t,n,o)=>{n in e&&(t.forEach((t=>{t in e&&(e[t]=e[n]?e[t]:o)})),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e};const pt=ht;var dt={FOLLOW:"FOLLOW",SHARE:"SHARE"},mt={FACEBOOK:"FACEBOOK",INSTAGRAM:"INSTAGRAM",LINKEDIN:"LINKEDIN",TWITTER:"TWITTER",CUSTOM:"CUSTOM",EMAIL:"EMAIL",PINTEREST:"PINTEREST",WHATSAPP:"WHATSAPP"},gt={ROUNDED:"ROUNDED"};function ft(t){return ft="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},ft(t)}function yt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,Et(o.key),o)}}function Et(t){var e=function(t){if("object"!=ft(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ft(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ft(e)?e:e+""}var bt=function(){return function(t,e){return e&&yt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.imgPath="".concat(e.replace(/\/$/,""),"/img")}),[{key:"getValidPlatformName",value:function(t){return mt[t.type]?t.type:mt.CUSTOM}},{key:"getValidIconMode",value:function(t){return(gt[t.mode]?t.mode:gt.ROUNDED).toLowerCase()}},{key:"getDefaultImage",value:function(){return"".concat(this.imgPath,"/image-placeholder.svg")}},{key:"getPlatformImageUrl",value:function(t){if(t.image)return t.image;var e=this.getValidPlatformName(t);if(e===mt.CUSTOM)return this.getDefaultImage();var n="".concat(e.toLowerCase(),"-logo"),o=this.getValidIconMode(t),r=o?"-".concat(o):"";return"".concat(this.imgPath,"/").concat(n).concat(r,".svg")}}])}();const vt={name:"SysSocialComponent",componentType:"SOCIAL",version:"1.0.0",events:{dispatch:[],listen:[]},contextMenuModel:function(t){return Object.values(st).map((e=>({type:"GROUP",propPath:["adaptiveStyles",e],children:t})))}([{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]),propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SOCIAL_ICON_SIZE",propPath:["control","size","desktop"]},{type:"CONTROL",name:"SOCIAL_TYPE_AND_ICON_SELECT",propPath:["control"]}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SOCIAL_ICON_SIZE",propPath:["control","size","mobile"]},{type:"CONTROL",name:"SOCIAL_TYPE_AND_ICON_SELECT",propPath:["control"]}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0}}]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1}}]},i18nPropPaths:["content,text","handlers,[id],actions,[id],params,link","handlers,[id],actions,[id],params,customData"],props:{control:{options:[{type:"FACEBOOK",order:0},{type:"INSTAGRAM",order:1},{type:"LINKEDIN",order:2},{type:"TWITTER",order:3}],mode:"FOLLOW",size:{desktop:32,mobile:32}},adaptiveStyles:{desktop:[{element:"host",styleAttributes:{}}],mobile:[{element:"host",styleAttributes:{}}]}},metaDescription:{icon:"/SysSocialComponent/assets/img/social-component-icon.svg",label:{en:"Social",ru:"Социальные сети",uk:"Соціальні мережі",es:"Social",de:"Social",fr:"Social",it:"Social",pt:"Social",ro:"Social",bg:"Social",cs:"Social",el:"Social",nl:"Social",pl:"Social",sv:"Social",tr:"Social",ar:"Social",zh:"社群媒体",da:"Social",he:"Social",fi:"Social",hi:"Social",hr:"Social",hu:"Social",id:"Social",ja:"Social",ko:"Social",no:"Social",sk:"Social",sl:"Social",sr:"Social"}},syncEnabled:!0,stylesImitationEnabled:!0};function Ot(t){return Ot="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},Ot(t)}function St(t,e,n){return(e=function(t){var e=function(t){if("object"!=Ot(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ot(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ot(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tt(t){var e=t&&t.type;return Boolean(e)}function Ct(t){return Ct="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},Ct(t)}function _t(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function At(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?_t(Object(n),!0).forEach((function(e){Nt(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_t(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Nt(t,e,n){return(e=function(t){var e=function(t){if("object"!=Ct(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Ct(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function It(t){var e,n,o,r,i=function(t){Array.isArray(t.options)||(console.warn("SysSocial: options should be an array, setting default value"),t.options=[]);var e=t.options.filter(Tt);return e.length!==t.options.length&&(console.error("SysSocial: options contain invalid platforms, filtering them out"),t.options=e),Object.values(dt).includes(t.mode)||(console.error("SysSocial: mode is invalid, setting default value"),t.mode=dt.FOLLOW),"object"!==Ct(t.size)&&Number.isNaN(Number(t.size))&&(console.error("SysSocial: size should be a number, setting default value"),t.size=32),"string"!=typeof t.size&&"number"!=typeof t.size||(console.warn("SysSocial: migrating size from primitive to object"),t.size={desktop:t.size,mobile:t.size}),t}(At({},null==t?void 0:t.control));return i.mode===dt.SHARE&&(i.options=(n=(e=i).options,o=e.shareUrl,r="INTERNAL"===e.shareUrlType?window.location.href:o,n.reduce((function(t,e){var n=function(t){return t?St(St(St(St(St(St({},mt.FACEBOOK,(function(t){var e=t.url;return"https://www.facebook.com/sharer/sharer.php?u=".concat(e)})),mt.LINKEDIN,(function(t){var e=t.url;return"https://www.linkedin.com/sharing/share-offsite/?url=".concat(e)})),mt.TWITTER,(function(t){var e=t.url;return"https://twitter.com/intent/tweet?url=".concat(e)})),mt.PINTEREST,(function(t){var e=t.url;return"https://www.pinterest.com/pin/create/button/?url=".concat(e)})),mt.WHATSAPP,(function(t){var e=t.url;return"https://wa.me/?text=".concat(e)})),mt.EMAIL,(function(t){var e=t.url,n=t.subject,o=void 0===n?"":n;return"mailto:?body=".concat(e,"&subject=").concat(o)}))[t.type]:null}(e);return n&&t.push(At(At({},e),{},{url:n(At({url:r},e.props))})),t}),[]))),i}function Lt(t){return Lt="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},Lt(t)}function Pt(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function Rt(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,Dt(o.key),o)}}function Mt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Mt=function(){return!!t})()}function wt(){return wt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=jt(t)););return t}(t,e);if(o){var r=Object.getOwnPropertyDescriptor(o,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},wt.apply(null,arguments)}function jt(t){return jt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},jt(t)}function Ut(t,e){return Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ut(t,e)}function kt(t,e,n){return(e=Dt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dt(t){var e=function(t){if("object"!=Lt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Lt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Lt(e)?e:e+""}var xt=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),kt(e=function(t,e,n){return e=jt(e),function(t,e){if(e&&("object"==Lt(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||[],jt(t).constructor):e.apply(t,n))}(this,t),"createContent",(function(t){var n=e.getElement("social"),o=It(t),r=n.querySelector(".items-wrapper");r?e._renderItemsForExistingComponent(r,o):e._renderItemsForEmptyComponent(n,o)})),kt(e,"_renderItemsForEmptyComponent",(function(t,n){var o=document.createElement("div");o.classList.add("items-wrapper"),e.addItemsContent(o,n),lt({element:t,html:""}),t.append(o)})),kt(e,"_renderItemsForExistingComponent",(function(t,n){var o={};n.options.forEach((function(r){var i=e.getPlatformKey(r),s=t.querySelector('[key="'.concat(i,'"]'));o[i]=s?e._updatePlatformComponent(s,r,n):e._createNewPlatformComponent(t,r,n),e._setPlatformStyles(o[i],r)}));var r,i=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return Pt(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)?Pt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0,r=function(){};return{s:r,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return s=t.done,t},e:function(t){a=!0,i=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}(t.children);try{for(i.s();!(r=i.n()).done;){var s=r.value,a=s.getAttribute("key");o[a]||t.removeChild(s)}}catch(t){i.e(t)}finally{i.f()}})),kt(e,"_updatePlatformComponent",(function(t,n,o){var r=t.querySelector("img"),i=e.urlManager.getPlatformImageUrl(n);r.src!==i&&(r.src=i);var s=o.size[e.getEnvironment()];return s!==r.width&&(r.height=s,r.width=s),t})),kt(e,"_createNewPlatformComponent",(function(t,n,o){var r=e.createPlatformComponent(n,o);return t.append(r),r})),kt(e,"addItemsContent",(function(t,n){return t.classList.add("social-list"),n.options.forEach((function(o){t.append(e.createPlatformComponent(o,n))})),t})),kt(e,"createPlatformComponent",(function(t,n){var o,r=n.size,i=t.url;i?((o=document.createElement("a")).setAttribute("href",i||"#"),o.setAttribute("target","_blank")):o=document.createElement("div"),o.classList.add("social-list-item"),o.setAttribute("key",e.getPlatformKey(t)),e._setPlatformStyles(o,t);var s=e.urlManager.getPlatformImageUrl(t),a=r[e.getEnvironment()],l=document.createElement("img");return l.src=s,l.height=a,l.width=a,lt({element:o,html:""}),o.appendChild(l),o})),kt(e,"getPlatformKey",(function(t){return"".concat(t.type,"-").concat(t.order)})),kt(e,"_setPlatformStyles",(function(t,e){t.setAttribute("style","order:".concat(e.order))})),kt(e,"manifest",vt),e.getRootElement().innerHTML="\n <style>".concat(t.componentStyle,"</style>\n ").concat(t.componentTemplate,"\n "),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ut(t,e)}(t,pt),function(t,e){return e&&Rt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;!function(t,e,n){var o=wt(jt(t.prototype),"connectedCallback",n);return"function"==typeof o?function(t){return o.apply(n,t)}:o}(t,0,this)([]),this.urlManager=new bt(this.assets()),this.observeProps((function(t,n){e.createContent(n),e.applyAutoAdaptiveStyles(n.adaptiveStyles)})),this.observeEnvironment((function(){var t=e.getProps();e.createContent(t),e.applyAutoAdaptiveStyles(t.adaptiveStyles)}))}}])}();kt(xt,"define",{name:"sys-social",model:vt.name,manifest:vt}),kt(xt,"componentStyle","\n .social-list {\n display: flex;\n gap: 10px;\n }\n \n .social-list-item {\n display: flex;\n }\n"),kt(xt,"componentTemplate",'\n <div class="social-container">\n <div cl-element="social" class="social-list-content">\n </div>\n </div>\n');export{xt as default};window.clComponentClass_SysSocialComponent=xt;
@@ -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",a="BUTTON",l="CONSENT",c="COLUMN";var u,d;(d=u||(u={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",d.REQUEST="REQUEST",d.DISPATCH_EVENT="DISPATCH_EVENT",d.GO_TO_VIEW="GO_TO_VIEW",d.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",d.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",d.SHOW_WIDGET="SHOW_WIDGET",d.OPEN_LINK="OPEN_LINK",d.CLOSE_WIDGET="CLOSE_WIDGET",d.CLICK="CLICK";const h=u;var p,m;class g{static sortActions(t){const e={[h.CLOSE_WIDGET]:-1,[h.OPEN_LINK]:-2,[h.SHOW_WIDGET]:1,[h.SUBSCRIBE_CONTACT]:2,[h.REQUEST]: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);o=!0){i=s.value,o=!1;const{event:t}=i;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}}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],(m=p||(p={})).CLICK="CLICK",m.COMPONENT_EVENT="COMPONENT_EVENT";class y{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 f{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 p.CLICK:return new g(t,e);case p.COMPONENT_EVENT:return new y(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class b{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 E{constructor(){this.listeners=E.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=b.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=E.createDefaultListenersState()}}E.createDefaultListenersState=()=>({"*":{}});const v=E,O=(t,e,n,i)=>{const s=EventTarget.prototype,{addEventListenerBase:o,addEventListener:r}=s;(o||r).call(t,e,n,i)};class T{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class S{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===s?Object.assign(Object.assign({},t),S.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})}}var A,C,_,N,R,L,x,I,P,M,w,j,k;S.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(C=A||(A={})).VIEW="VIEW",C.CONTAINER="CONTAINER",C.TEXT="TEXT",C.INPUT="INPUT",C.BUTTON="BUTTON",C.IMAGE="IMAGE",C.CONSENT="CONSENT",C.COUNTDOWN_TIMER="COUNTDOWN_TIMER",C.PROMO_CODE="PROMO_CODE",C.MULTIPLE_INPUT="MULTIPLE_INPUT",C.VIDEO="VIDEO",C.SLIDER="SLIDER",C.SLIDE="SLIDE",C.SOCIAL="SOCIAL",C.COLUMNS="COLUMNS",C.COLUMN="COLUMN",C.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(_||(_={})).CLICK="CLICK",function(t){t.SHOW_WIDGET="SHOW_WIDGET",t.OPEN_LINK="OPEN_LINK",t.SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",t.REQUEST="REQUEST",t.CLOSE_WIDGET="CLOSE_WIDGET",t.GO_TO_VIEW="GO_TO_VIEW",t.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",t.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",t.CLICK="CLICK"}(N||(N={})),function(t){t.SELF="_self",t.BLANK="_blank"}(R||(R={})),(L||(L={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(x||(x={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(I||(I={})),function(t){t.SLIDE_TO_TOP="SLIDE_TO_TOP",t.SLIDE_TO_BOTTOM="SLIDE_TO_BOTTOM",t.SLIDE_TO_LEFT="SLIDE_TO_LEFT",t.SLIDE_TO_RIGHT="SLIDE_TO_RIGHT"}(P||(P={})),function(t){t.PULSE="PULSE",t.VIBRATE="VIBRATE",t.WOBBLE="WOBBLE",t.SHAKE="SHAKE",t.JELLO="JELLO",t.BOUNCE="BOUNCE",t.BLINK="BLINK",t.FLICKER="FLICKER",t.PING="PING"}(M||(M={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(w||(w={})),(k=j||(j={})).BEFORE="BEFORE",k.AFTER="AFTER",k.INSIDE="INSIDE",k.INSTEAD="INSTEAD";class D extends v{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(D.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(D.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(D.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}D.changeEventName="CHANGE";const U=D;class F{static set(t,e){const n=t[F.accumulatorPropertyName]||{};t[F.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[F.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}F.accumulatorPropertyName="clStyleAttributes";const B=F;var W;!function(t){t.BUILT_IN="BUILT_IN",t.DETACHED="DETACHED",t.FLOATING_BOX="FLOATING_BOX",t.FLOATING_BAR="FLOATING_BAR",t.LAUNCHER="LAUNCHER",t.CONTENT_LOCKER="CONTENT_LOCKER"}(W||(W={}));class G{static applyHostStyles(t,e,n=null,s){var r,a,l;const u=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));u&&(null===(l=u.actions)||void 0===l?void 0:l.length)&&(e.style.cursor="pointer"),t!==i&&t!==o&&t!==c||(e.style.display=s===W.CONTENT_LOCKER&&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 H{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class V{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.schemaSubscription=null,this.themeSubscription=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)))||{},u=(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),d=this.parseBackground(u);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((()=>{var e;const n=this.getSharedCb();return Object.keys((null===(e=n.theme)||void 0===e?void 0:e.schema)||{}).length>0?this._applyHostElementBackgroundFromTheme(this.envUrlMaps[t].get("host"),n.theme.schema):this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[t].get("host"),n.cssVars)})).catch((t=>{console.error(t),H.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.schemaSubscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(t=>{this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[this.getEnvCb()].get("host"),t)})),this.themeSubscription=this.documentModel.on("THEME_UPDATE",(t=>{this._applyHostElementBackgroundFromTheme(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)})),this}_applyHostElementBackgroundFromCssVars(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromCssVars(t,e))}_applyHostElementBackgroundFromTheme(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromTheme(t,e))}_buildBackgroundUrlFromCssVars(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}`}_buildBackgroundUrlFromTheme(t,e){const n=t.inlineSvgString.trim();let i=n;return[...n.matchAll(/var\(--cl-schema-([^)]+)\)/g)].forEach((t=>{const n=function(t=""){return t.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}(t[1]);var s;i=i.replace(`var(--${s=n,`cl-schema-${s}`})`,e[n])})),`url('data:image/svg+xml,${encodeURIComponent(i)}')${t.positionOptions}`}off(){var t,e;null===(t=this.schemaSubscription)||void 0===t||t.off(),null===(e=this.themeSubscription)||void 0===e||e.off()}}const $=new class{execute(t,e="GET",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 K(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class z{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 X{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}}var Q;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.EXECUTE_ACTION_BY_PREDICATE="EXECUTE_ACTION_BY_PREDICATE"}(Q||(Q={}));const q=Q;class Y{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(q.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(q.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new X(this.onCounterStateUpdate)}}}const Z=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>Z(...t)}},J=Z,tt="props",et="shared",nt="environment";function it(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 st="SUBMIT";function ot(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{if("element"===n||"classes"===n)return;const i=e[n];i&&"object"==typeof i&&!Array.isArray(i)?t[n]=Object.assign(Object.assign({},t[n]||{}),i):t[n]=i})),t):t}const rt={DESKTOP:"desktop",MOBILE:"mobile"};function at(t,e,n){var i;return null===(i=null==t?void 0:t[e])||void 0===i?void 0:i.find((t=>t.element===n))}function lt(t=[]){return t.map((t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)})))}function ct(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 ut extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}var dt;!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(dt||(dt={}));class ht extends HTMLElement{constructor(){var i;super(),this.skipGameBlur=!0,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 ut("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=J(tt,et,nt),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 T({}),this.componentEventEmitter=new v,this.componentResourceManager=new Y(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),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}`,(t=>{this.model.props=t,this.observers.get(tt).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(et).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new V(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),$),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(U.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(nt).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_READY_TO_PLAY",(()=>{this.skipGameBlur||this.getHostElement().classList.add("cl-game-spotlight-component")}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_COMPLETED",(()=>{this.skipGameBlur||this.getHostElement().classList.remove("cl-game-spotlight-component")})))},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.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===dt.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===dt.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(tt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(et).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(nt).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;const s=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&&(ot(n,t),i=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(ot(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),o=n("type"),r="element-styles";let a=this.getRootElement().querySelector(`style[${o}="${r}"]`);a||(a=document.createElement("style"),a.setAttribute(o,r),this.getRootElement().appendChild(a)),ct({element:a,html:""}),i.forEach((t=>{let e=t.getAttribute(n("element"));const i=this.getEnvironment();let o=at(s,i,e);if(o){if(this.resizeListener.isMobile()){const t=at(s,"desktop",e);t&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),o.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(o),a)}})),this._addLinkColor(a,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=ht._resolveTogglableStylesForElementModel(e)).element&&(G.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],O(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),O(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:K(e.styleAttributes,r)});if(B.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)),ct({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.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+` ${z.camelCaseToDashCase(e)}: ${i[e]}${o?" !important;":";"}`),"");ct({element:t,html:`[${n("element")}="${e}"]${s} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{ct({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,i,s,o;e.linkColor&&ct({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)&&ct({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)&&ct({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=()=>it(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(n("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:it(this.parentNode,n("path"),void 0,(t=>1===(null==t?void 0:t.split(",").length)))},this.getWidgetLanguages=()=>function(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}(this.services.config),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,i,s,o,r;const a=t.control.name;if(["email","first_name","last_name"].includes(a))return a.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(s=null===(i=null===(n=t.adaptiveStyles)||void 0===n?void 0:n.desktop.find((t=>"label"===t.element)))||void 0===i?void 0:i.params)||void 0===s?void 0:s.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(o=t.content)||void 0===o?void 0:o.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(r=t.control)||void 0===r?void 0:r.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=>{var e;switch(null===(e=t.control)||void 0===e?void 0:e.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===st));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:h.REQUEST}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>{var t;return(null===(t=this.getProps())||void 0===t?void 0:t.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.constructor.define)||void 0===i?void 0:i.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}));const t=document.createElement("style");t.textContent='\n :host(.cl-game-spotlight-component)::after {\n content: "";\n position: absolute;\n background-size: 100% 100%;\n background-repeat: no-repeat;\n overflow: visible;\n \n backdrop-filter: blur(4px);\n \n inset: -30px;\n mask-image: \n linear-gradient(to bottom, transparent, grey 30px, grey calc(100% - 30px), transparent),\n linear-gradient(to right, transparent, grey 30px, grey calc(100% - 30px), transparent);\n mask-composite: intersect;\n -webkit-mask-composite: source-in; /* for Chrome/Safari */\n \n transition: opacity 0.35s ease;\n pointer-events: auto;\n }\n ',this.getRootElement().prepend(t)}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}}ht._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=ht._resolveTogglableStyles(e[t]))})),e},ht._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 pt=ht;function mt(t){return Object.values(rt).map((e=>({type:"GROUP",propPath:["adaptiveStyles",e],children:t})))}const gt={name:"SysTextComponent",componentType:"TEXT",version:"1.0.0",events:{dispatch:[],listen:[]},contextMenuModel:mt([{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]),floatingControlsModel:mt([{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:mt([{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"}]},{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:(yt=[{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(rt).reduce(((t,e)=>Object.assign(t,{[e]:lt(yt)})),{desktop:[],mobile:[]})),content:{text:"Text",textContrastEnabled:!0}},metaDescription:{icon:"/SysTextComponent/assets/img/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"}},syncEnabled:!0,stylesImitationEnabled:!0};var yt;function ft(t,e=1){return t.reduce(((t,n)=>Array.isArray(n)&&e>=1?t.concat(ft(n,e-1)):t.concat(n)),[])}function bt(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}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 vt(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)||Ot(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 Ot(t,e){if(t){if("string"==typeof t)return Tt(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)?Tt(t,e):void 0}}function Tt(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 St(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 At(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?St(Object(n),!0).forEach((function(e){Ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):St(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ct(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 _t={maxWidth:"100%",width:"fit-content",display:"inline-flex",fontFamily:"inherit"},Nt={padding:"0 5px",display:"inline-block",maxWidth:"calc(100% - 0px)",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},Rt={display:"inline-flex",justifyContent:"center",minHeight:"fit-content"};function Lt(t,e){var n=e.id,i=Pt(e.options),s=At(At({},Nt),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 xt(o,s),xt(n,{display:"inline-flex",justifyContent:r["text-align"]||Rt.justifyContent},i,s),n})),r=At({},_t),a=document.createElement("span");a.classList.add("container"),xt(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,xt(l,At(At({},s),{},{visibility:"hidden"}));var c=document.createElement("span");c.classList.add("opts"),o.forEach((function(t){c.appendChild(t)})),a.append(l,c),bt({element:t,html:""}),t.appendChild(a),xt(t,r);var u=a.querySelectorAll(".opt")[0].offsetHeight,d="".concat(u,"px");a.style.height=d,l.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 Tt(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)||Ot(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=ft(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");bt({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,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 xt(t,e,n,i,s){var o={};if(n){var r=It(n,e,i);o={minWidth:"".concat(r>s?r:Math.min(r,s),"px")}}Object.entries(At(At({},o),e)||{}).forEach((function(e){var n=vt(e,2),i=n[0],s=n[1];t.style[i]=s}))}function It(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=vt(r[o],2),l=a[0],c=a[1];s.style[l]=c}for(var u=0,d=Object.entries(e);u<d.length;u++){var h=vt(d[u],2),p=h[0],m=h[1];i.style[p]=m}i.style.visibility="hidden",document.body.appendChild(i);var g=i.getBoundingClientRect().width;return document.body.removeChild(i),g}function Pt(t){return t.map((function(t){return{value:t,width:It(t)}})).sort((function(t,e){return e.width-t.width})).at(0).value}function Mt(t){return Mt="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},Mt(t)}function wt(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,Bt(i.key),i)}}function jt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(jt=function(){return!!t})()}function kt(){return kt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Dt(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}},kt.apply(null,arguments)}function Dt(t){return Dt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Dt(t)}function Ut(t,e){return Ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ut(t,e)}function Ft(t,e,n){return(e=Bt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bt(t){var e=function(t){if("object"!=Mt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Mt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Mt(e)?e:e+""}var Wt=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),Ft(e=function(t,e,n){return e=Dt(e),function(t,e){if(e&&("object"==Mt(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,jt()?Reflect.construct(e,n||[],Dt(t).constructor):e.apply(t,n))}(this,t),"processTextRoller",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.getElement("text");if(n){var i=e.isStaticRenderMode();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?Lt(e,s):function(t,e){var n=e.id,i=document.createElement("span");i.classList.add("outer");var s=Pt(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),u=(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),d=At(At(At({},Nt),e.styleAttributes),u);xt(o,d),xt(i,At(At({},Rt),{},{borderRadius:o.style["border-radius"]||Rt.borderRadius,justifyContent:c["text-align"]||Rt.justifyContent}),s,d,parseFloat(c.width)),bt({element:t,html:""}),xt(t,At({},_t)),t.appendChild(i)}(e,s)}}))}})),Ft(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))})),Ft(e,"manifest",gt),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&&Ut(t,e)}(t,pt),function(t,e){return e&&wt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;!function(t,e,n){var i=kt(Dt(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")&&(bt({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)}))}}])}();Ft(Wt,"define",{name:"sys-text",model:gt.name,manifest:gt});export{Wt as default};window.clComponentClass_SysTextComponent=Wt;
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";var u,d;(d=u||(u={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",d.REQUEST="REQUEST",d.DISPATCH_EVENT="DISPATCH_EVENT",d.GO_TO_VIEW="GO_TO_VIEW",d.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",d.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",d.SHOW_WIDGET="SHOW_WIDGET",d.OPEN_LINK="OPEN_LINK",d.CLOSE_WIDGET="CLOSE_WIDGET",d.CLICK="CLICK";const h=u;var p,m;class g{static sortActions(t){const e={[h.CLOSE_WIDGET]:-1,[h.OPEN_LINK]:-2,[h.SHOW_WIDGET]:1,[h.SUBSCRIBE_CONTACT]:2,[h.REQUEST]: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);o=!0){i=s.value,o=!1;const{event:t}=i;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}}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],(m=p||(p={})).CLICK="CLICK",m.COMPONENT_EVENT="COMPONENT_EVENT";class y{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 b{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 p.CLICK:return new g(t,e);case p.COMPONENT_EVENT:return new y(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class f{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 E{constructor(){this.listeners=E.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=f.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=E.createDefaultListenersState()}}E.createDefaultListenersState=()=>({"*":{}});const v=E,O=(t,e,n,i)=>{const s=EventTarget.prototype,{addEventListenerBase:o,addEventListener:r}=s;(o||r).call(t,e,n,i)};class T{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class S{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===s?Object.assign(Object.assign({},t),S.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})}}var C,A,_,N,R,L,x,I,P,M,w,j,k;S.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(A=C||(C={})).VIEW="VIEW",A.CONTAINER="CONTAINER",A.TEXT="TEXT",A.INPUT="INPUT",A.BUTTON="BUTTON",A.IMAGE="IMAGE",A.CONSENT="CONSENT",A.COUNTDOWN_TIMER="COUNTDOWN_TIMER",A.PROMO_CODE="PROMO_CODE",A.MULTIPLE_INPUT="MULTIPLE_INPUT",A.VIDEO="VIDEO",A.SLIDER="SLIDER",A.SLIDE="SLIDE",A.SOCIAL="SOCIAL",A.COLUMNS="COLUMNS",A.COLUMN="COLUMN",A.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(_||(_={})).CLICK="CLICK",function(t){t.SHOW_WIDGET="SHOW_WIDGET",t.OPEN_LINK="OPEN_LINK",t.SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",t.REQUEST="REQUEST",t.CLOSE_WIDGET="CLOSE_WIDGET",t.GO_TO_VIEW="GO_TO_VIEW",t.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",t.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",t.CLICK="CLICK"}(N||(N={})),function(t){t.SELF="_self",t.BLANK="_blank"}(R||(R={})),(L||(L={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(x||(x={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(I||(I={})),function(t){t.SLIDE_TO_TOP="SLIDE_TO_TOP",t.SLIDE_TO_BOTTOM="SLIDE_TO_BOTTOM",t.SLIDE_TO_LEFT="SLIDE_TO_LEFT",t.SLIDE_TO_RIGHT="SLIDE_TO_RIGHT"}(P||(P={})),function(t){t.PULSE="PULSE",t.VIBRATE="VIBRATE",t.WOBBLE="WOBBLE",t.SHAKE="SHAKE",t.JELLO="JELLO",t.BOUNCE="BOUNCE",t.BLINK="BLINK",t.FLICKER="FLICKER",t.PING="PING"}(M||(M={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(w||(w={})),(k=j||(j={})).BEFORE="BEFORE",k.AFTER="AFTER",k.INSIDE="INSIDE",k.INSTEAD="INSTEAD";class D extends v{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(D.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(D.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(D.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}D.changeEventName="CHANGE";const U=D;class B{static set(t,e){const n=t[B.accumulatorPropertyName]||{};t[B.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[B.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}B.accumulatorPropertyName="clStyleAttributes";const F=B;var W;!function(t){t.BUILT_IN="BUILT_IN",t.DETACHED="DETACHED",t.FLOATING_BOX="FLOATING_BOX",t.FLOATING_BAR="FLOATING_BAR",t.LAUNCHER="LAUNCHER",t.CONTENT_LOCKER="CONTENT_LOCKER"}(W||(W={}));class G{static applyHostStyles(t,e,n=null,s){var r,a,l;const u=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));u&&(null===(l=u.actions)||void 0===l?void 0:l.length)&&(e.style.cursor="pointer"),t!==i&&t!==o&&t!==c||(e.style.display=s===W.CONTENT_LOCKER&&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 H{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class V{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.schemaSubscription=null,this.themeSubscription=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)))||{},u=(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),d=this.parseBackground(u);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((()=>{var e;const n=this.getSharedCb();return Object.keys((null===(e=n.theme)||void 0===e?void 0:e.schema)||{}).length>0?this._applyHostElementBackgroundFromTheme(this.envUrlMaps[t].get("host"),n.theme.schema):this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[t].get("host"),n.cssVars)})).catch((t=>{console.error(t),H.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.schemaSubscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(t=>{this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[this.getEnvCb()].get("host"),t)})),this.themeSubscription=this.documentModel.on("THEME_UPDATE",(t=>{this._applyHostElementBackgroundFromTheme(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)})),this}_applyHostElementBackgroundFromCssVars(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromCssVars(t,e))}_applyHostElementBackgroundFromTheme(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromTheme(t,e))}_buildBackgroundUrlFromCssVars(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}`}_buildBackgroundUrlFromTheme(t,e){const n=t.inlineSvgString.trim();let i=n;return[...n.matchAll(/var\(--cl-schema-([^)]+)\)/g)].forEach((t=>{const n=function(t=""){return t.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}(t[1]);var s;i=i.replace(`var(--${s=n,`cl-schema-${s}`})`,e[n])})),`url('data:image/svg+xml,${encodeURIComponent(i)}')${t.positionOptions}`}off(){var t,e;null===(t=this.schemaSubscription)||void 0===t||t.off(),null===(e=this.themeSubscription)||void 0===e||e.off()}}const $=new class{execute(t,e="GET",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 K(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class z{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 X{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}}var Q;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.EXECUTE_ACTION_BY_PREDICATE="EXECUTE_ACTION_BY_PREDICATE"}(Q||(Q={}));const Y=Q;class q{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(Y.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(Y.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new X(this.onCounterStateUpdate)}}}const J=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>J(...t)}},Z=J,tt="props",et="shared",nt="environment";function it(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 st="SUBMIT";function ot(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{if("element"===n||"classes"===n)return;const i=e[n];i&&"object"==typeof i&&!Array.isArray(i)?t[n]=Object.assign(Object.assign({},t[n]||{}),i):t[n]=i})),t):t}const rt={DESKTOP:"desktop",MOBILE:"mobile"};function at(t,e,n){var i;return null===(i=null==t?void 0:t[e])||void 0===i?void 0:i.find((t=>t.element===n))}function lt(t=[]){return t.map((t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)})))}function ct(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 ut extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}var dt;!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(dt||(dt={}));class ht extends HTMLElement{constructor(){var i;super(),this.skipGameBlur=!0,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 ut("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=Z(tt,et,nt),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 T({}),this.componentEventEmitter=new v,this.componentResourceManager=new q(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new b(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(tt).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(et).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new V(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),$),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(U.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(nt).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_READY_TO_PLAY",(()=>{this.skipGameBlur||this.getHostElement().classList.add("cl-game-spotlight-component")}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_COMPLETED",(()=>{this.skipGameBlur||this.getHostElement().classList.remove("cl-game-spotlight-component")})))},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.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===dt.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===dt.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(tt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(et).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(nt).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;const s=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&&(ot(n,t),i=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(ot(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),o=n("type"),r="element-styles";let a=this.getRootElement().querySelector(`style[${o}="${r}"]`);a||(a=document.createElement("style"),a.setAttribute(o,r),this.getRootElement().appendChild(a)),ct({element:a,html:""}),i.forEach((t=>{let e=t.getAttribute(n("element"));const i=this.getEnvironment();let o=at(s,i,e);if(o){if(this.resizeListener.isMobile()){const t=at(s,"desktop",e);t&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),o.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(o),a)}})),this._addLinkColor(a,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=ht._resolveTogglableStylesForElementModel(e)).element&&(G.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],O(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),O(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:K(e.styleAttributes,r)});if(F.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)),ct({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.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+` ${z.camelCaseToDashCase(e)}: ${i[e]}${o?" !important;":";"}`),"");ct({element:t,html:`[${n("element")}="${e}"]${s} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{ct({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,i,s,o;e.linkColor&&ct({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)&&ct({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)&&ct({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=()=>it(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(n("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:it(this.parentNode,n("path"),void 0,(t=>1===(null==t?void 0:t.split(",").length)))},this.getWidgetLanguages=()=>function(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}(this.services.config),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,i,s,o,r;const a=t.control.name;if(["email","first_name","last_name"].includes(a))return a.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(s=null===(i=null===(n=t.adaptiveStyles)||void 0===n?void 0:n.desktop.find((t=>"label"===t.element)))||void 0===i?void 0:i.params)||void 0===s?void 0:s.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(o=t.content)||void 0===o?void 0:o.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(r=t.control)||void 0===r?void 0:r.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=>{var e;switch(null===(e=t.control)||void 0===e?void 0:e.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===st));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:h.REQUEST}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>{var t;return(null===(t=this.getProps())||void 0===t?void 0:t.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.constructor.define)||void 0===i?void 0:i.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}));const t=document.createElement("style");t.textContent='\n :host(.cl-game-spotlight-component)::after {\n content: "";\n position: absolute;\n background-size: 100% 100%;\n background-repeat: no-repeat;\n overflow: visible;\n \n backdrop-filter: blur(4px);\n \n inset: -30px;\n mask-image: \n linear-gradient(to bottom, transparent, grey 30px, grey calc(100% - 30px), transparent),\n linear-gradient(to right, transparent, grey 30px, grey calc(100% - 30px), transparent);\n mask-composite: intersect;\n -webkit-mask-composite: source-in; /* for Chrome/Safari */\n \n transition: opacity 0.35s ease;\n pointer-events: auto;\n }\n ',this.getRootElement().prepend(t)}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}}ht._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=ht._resolveTogglableStyles(e[t]))})),e},ht._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 pt=ht;function mt(t){return Object.values(rt).map((e=>({type:"GROUP",propPath:["adaptiveStyles",e],children:t})))}const gt={name:"SysTextComponent",componentType:"TEXT",version:"1.0.0",events:{dispatch:[],listen:[]},contextMenuModel:mt([{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]),floatingControlsModel:mt([{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:mt([{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"}]},{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:(yt=[{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(rt).reduce(((t,e)=>Object.assign(t,{[e]:lt(yt)})),{desktop:[],mobile:[]})),content:{text:"Text",textContrastEnabled:!0}},metaDescription:{icon:"/SysTextComponent/assets/img/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"}},syncEnabled:!0,stylesImitationEnabled:!0};var yt;function bt(t,e=1){return t.reduce(((t,n)=>Array.isArray(n)&&e>=1?t.concat(bt(n,e-1)):t.concat(n)),[])}function ft(t){return ft="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},ft(t)}function Et(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)||vt(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 vt(t,e){if(t){if("string"==typeof t)return Ot(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)?Ot(t,e):void 0}}function Ot(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 Tt(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 St(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Tt(Object(n),!0).forEach((function(e){Ct(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Tt(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Ct(t,e,n){return(e=function(t){var e=function(t){if("object"!=ft(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ft(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ft(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var At={maxWidth:"100%",width:"fit-content",display:"inline-flex",fontFamily:"inherit"},_t={padding:"0 5px",display:"inline-block",maxWidth:"calc(100% - 0px)",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},Nt={display:"inline-flex",justifyContent:"center",minHeight:"fit-content"};function Rt(t,e){var n=e.id,i=It(e.options),s=St(St({},_t),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 Lt(o,s),Lt(n,{display:"inline-flex",justifyContent:r["text-align"]||Nt.justifyContent},i,s),n})),r=St({},At),a=document.createElement("span");a.classList.add("container"),Lt(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,Lt(l,St(St({},s),{},{visibility:"hidden"}));var c=document.createElement("span");c.classList.add("opts"),o.forEach((function(t){c.appendChild(t)})),a.append(l,c),ct({element:t,html:""}),t.appendChild(a),Lt(t,r);var u=a.querySelectorAll(".opt")[0].offsetHeight,d="".concat(u,"px");a.style.height=d,l.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 Ot(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)||vt(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=bt(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");ct({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,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 Lt(t,e,n,i,s){var o={};if(n){var r=xt(n,e,i);o={minWidth:"".concat(r>s?r:Math.min(r,s),"px")}}Object.entries(St(St({},o),e)||{}).forEach((function(e){var n=Et(e,2),i=n[0],s=n[1];t.style[i]=s}))}function xt(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=Et(r[o],2),l=a[0],c=a[1];s.style[l]=c}for(var u=0,d=Object.entries(e);u<d.length;u++){var h=Et(d[u],2),p=h[0],m=h[1];i.style[p]=m}i.style.visibility="hidden",document.body.appendChild(i);var g=i.getBoundingClientRect().width;return document.body.removeChild(i),g}function It(t){return t.map((function(t){return{value:t,width:xt(t)}})).sort((function(t,e){return e.width-t.width})).at(0).value}function Pt(t){return Pt="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},Pt(t)}function Mt(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,Bt(i.key),i)}}function wt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(wt=function(){return!!t})()}function jt(){return jt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=kt(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}},jt.apply(null,arguments)}function kt(t){return kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},kt(t)}function Dt(t,e){return Dt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Dt(t,e)}function Ut(t,e,n){return(e=Bt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Bt(t){var e=function(t){if("object"!=Pt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Pt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Pt(e)?e:e+""}var Ft=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),Ut(e=function(t,e,n){return e=kt(e),function(t,e){if(e&&("object"==Pt(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,wt()?Reflect.construct(e,n||[],kt(t).constructor):e.apply(t,n))}(this,t),"processTextRoller",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=e.getElement("text");if(n){var i=e.isStaticRenderMode();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?Rt(e,s):function(t,e){var n=e.id,i=document.createElement("span");i.classList.add("outer");var s=It(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),u=(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),d=St(St(St({},_t),e.styleAttributes),u);Lt(o,d),Lt(i,St(St({},Nt),{},{borderRadius:o.style["border-radius"]||Nt.borderRadius,justifyContent:c["text-align"]||Nt.justifyContent}),s,d,parseFloat(c.width)),ct({element:t,html:""}),Lt(t,St({},At)),t.appendChild(i)}(e,s)}}))}})),Ut(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))})),Ut(e,"manifest",gt),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&&Dt(t,e)}(t,pt),function(t,e){return e&&Mt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;!function(t,e,n){var i=jt(kt(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")&&(ct({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)}))}}])}();Ut(Ft,"define",{name:"sys-text",model:gt.name,manifest:gt});export{Ft as default};window.clComponentClass_SysTextComponent=Ft;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claspo/components",
3
- "version": "1.2.3",
3
+ "version": "1.2.6",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "prebuild": "rm -rf out",
@@ -17,8 +17,8 @@
17
17
  "node": ">=18.16.0"
18
18
  },
19
19
  "dependencies": {
20
- "@claspo/common": "7.0.0",
21
- "@claspo/renderer": "18.0.3"
20
+ "@claspo/common": "7.0.4",
21
+ "@claspo/renderer": "18.0.5"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@babel/core": "^7.27.4",