@claspo/components 1.10.12-sp1 → 1.10.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SysButtonComponent/SysButtonComponent.js +1 -1
- package/SysCalendarComponent/SysCalendarComponent.js +1 -1
- package/SysCheckboxListComponent/SysCheckboxListComponent.js +1 -1
- package/SysChoiceButtonsComponent/SysChoiceButtonsComponent.js +1 -1
- package/SysConsentComponent/SysConsentComponent.js +1 -1
- package/SysContainerComponent/SysContainerComponent.js +1 -1
- package/SysCountdownTimerComponent/SysCountdownTimerComponent.js +1 -1
- package/SysDateComponent/SysDateComponent.js +1 -1
- package/SysImageComponent/SysImageComponent.js +1 -1
- package/SysInAppColumnsComponent/SysInAppColumnsComponent.js +1 -1
- package/SysPhoneInputComponent/SysPhoneInputComponent.js +1 -1
- package/SysPromoCodeComponent/SysPromoCodeComponent.js +1 -2
- package/SysRadioGroupComponent/SysRadioGroupComponent.js +1 -1
- package/SysSliderComponent/SysSliderComponent.js +1 -1
- package/SysSocialComponent/SysSocialComponent.js +1 -1
- package/SysTextComponent/SysTextComponent.js +1 -1
- package/package.json +3 -3
- package/SysPromoCodeComponent/SysPromoCodeComponent.js.LICENSE.txt +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const t="cl-";function e(e){return t+e}function n(t){return"cl-"+t}const o="VIEW",i="MODULE",r="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 d=u;var p,m;class g{static sortActions(t){const e={[d.CLOSE_WIDGET]:-1,[d.OPEN_LINK]:-2,[d.SHOW_WIDGET]:1,[d.SUBSCRIBE_CONTACT]:2,[d.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 i=o(),r=i.getAttribute(n("id"));this.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,r)}),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"))!==r;){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((i.shadowRoot||i).querySelectorAll(this.config.relativeSelector)):[i],this.targetElements.forEach(t=>{t.addEventListener("click",this.listener)})}async execute(){var t,e,n,o;try{for(var i,r=!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,i){!function(t,e,n,o){Promise.resolve(o).then(function(e){t({value:e,done:n})},e)}(o,i,(e=t[n](e)).done,e.value)})}}}(this.eventsQueue);!(t=(i=await s.next()).done);r=!0){o=i.value,r=!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{r||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=p||(p={})).CLICK="CLICK",m.COMPONENT_EVENT="COMPONENT_EVENT";class f{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,o){var i;const r=null===(i=o())||void 0===i?void 0:i.getAttribute(n("id"));this.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,r)}),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 E{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 f(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class y{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 v{constructor(){this.listeners=v.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=y.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=v.createDefaultListenersState()}}v.createDefaultListenersState=()=>({"*":{}});const b=v,O=(t,e,n,o)=>{const i=EventTarget.prototype,{addEventListenerBase:r,addEventListener:s}=i;(r||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===i?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 _,A,C,I,N,R,L,P,M,U,w,D,j,k,x;T.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(A=_||(_={})).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",(C||(C={})).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"}(I||(I={})),function(t){t.SELF="_self",t.BLANK="_blank"}(N||(N={})),(R||(R={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(L||(L={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(P||(P={})),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"}(U||(U={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(w||(w={})),(j=D||(D={})).BEFORE="BEFORE",j.AFTER="AFTER",j.INSIDE="INSIDE",j.INSTEAD="INSTEAD",function(t){t.GO_TO_VIEW="GO_TO_VIEW",t.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",t.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",t.SUBMIT="SUBMIT",t.NPS_CONDITIONAL="NPS_CONDITIONAL"}(k||(k={})),function(t){t.TRUE_TERMINAL="TRUE_TERMINAL",t.INTERMEDIATE="INTERMEDIATE"}(x||(x={})),I.REQUEST,I.SUBSCRIBE_CONTACT;class F{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class B extends b{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",({isMobileEnv:t})=>{this._isMobile=t,this.emit(B.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(B.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(B.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}B.changeEventName="CHANGE";const W=B;class G{static set(t,e){const n=t[G.accumulatorPropertyName]||{};t[G.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[G.accumulatorPropertyName]).forEach(n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""})}}G.accumulatorPropertyName="clStyleAttributes";const V=G;var H;!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"}(H||(H={}));class ${static applyHostStyles(t,e,n=null,i){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!==r&&t!==c||(e.style.display=i===H.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 K{constructor(t,e,n,o,i,r){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=i,this.httpClient=r,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,i,r,s,a;const l=null===(i=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===i?void 0:i.find(t=>t.element===n),c=(null===(r=e.styles)||void 0===r?void 0:r.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),F.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 i;o=o.replace(`var(--${i=n,`cl-schema-${i}`})`,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 z=new class{execute(t,e="GET",n=null,o,i){const r={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:i};return n&&(r.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,r)}};function Q(t,e){return Object.keys(t).filter(t=>!e.includes(t)).reduce((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]}),{})}class Y{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,t=>"_"+t).toUpperCase()}}class J{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}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.SUBMIT_REQUEST_STARTED="SUBMIT_REQUEST_STARTED",t.SUBMIT_REQUEST_FINISHED="SUBMIT_REQUEST_FINISHED",t.SUBMIT_REQUEST_ERROR_WITHOUT_VIEW="SUBMIT_REQUEST_ERROR_WITHOUT_VIEW",t.PROMO_CODE_SHOWN="PROMO_CODE_SHOWN",t.LEAD_PROGRESS="LEAD_PROGRESS"}(q||(q={}));const X=q;class Z{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(X.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(X.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 J(this.onCounterStateUpdate)}}}const tt=(...t)=>{let e=t.reduce((t,e)=>Object.assign(Object.assign({},t),{[e]:[]}),{});return{get:t=>e[t],clear:()=>tt(...t)}},et=tt,nt="props",ot="shared",it="environment";function rt(t,e,n,o){const i=t=>{let r=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return r&&(o&&"function"==typeof o?o(r.getAttribute(e)):(null===(s=null==r?void 0:r.getAttribute)||void 0===s?void 0:s.call(r,e))===n)?r:r&&r.parentNode&&i(r.parentNode)||null;var s};return i(t)}const st="SUBMIT";function at(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 lt={DESKTOP:"desktop",MOBILE:"mobile"};function ct(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 ut(t){const{element:e,html:n,appendHtml:o}=t,i=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+=i:e.innerHTML=i}const ht=Object.getPrototypeOf(document.createEvent("CustomEvent")).constructor;class dt extends ht{constructor(t,e={},n){super(t,Object.assign(Object.assign({},n),{detail:e}))}}var pt,mt,gt;function ft(t){if(null!=t&&""!==t)return"string"==typeof t?t:"object"==typeof t?JSON.stringify(t):String(t)}!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(pt||(pt={})),(gt=mt||(mt={})).STATIC="STATIC",gt.DATA_LAYER="DATA_LAYER",gt.URL_QUERY_PARAMS="URL_QUERY_PARAMS",gt.JS_API_VARIABLE="JS_API_VARIABLE",gt.COOKIE="COOKIE",gt.LOCAL_STORAGE="LOCAL_STORAGE";class Et{constructor(t,e){this.configService=t,this.registry=e}resolveValue(t,e){if(!(null==t?void 0:t.enabled)||!t.sourceType||this.configService.getConfig("renderMode")===pt.UPDATING)return;const n=function(t,e,n,o){if(!e)return;if(e===mt.STATIC)return ft(null==n?void 0:n.value);const i=t.getSource(e);if(!i)return;const r=i.getValue(o);return ft("function"==typeof(null==r?void 0:r.processor)?r.processor(i,Object.assign({id:o},n)):null==r?void 0:r.value)}(this.registry,t.sourceType,t.config,e);if(void 0===n)return;const o=n.trim();return""===o?void 0:o}}class yt extends HTMLElement{constructor(){var o;super(),this.skipGameBlur=!0,this.isAutofillValidated=!1,this.validatedAutofillValue=void 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 i=o.closest(`[${n("widget-id")}]`);let r;i&&(r=i.getAttribute(n("widget-id")));let s=new dt("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("path")),id:e,widgetId:r},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.detail.props,Object.assign(this,t),this.observers=et(nt,ot,it),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 b,this.componentResourceManager=new Z(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new E(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(nt).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(ot).forEach(t=>t(this.getShared()))}),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new K(this.documentModel,this.getHostElement(),()=>this.getShared(),()=>this.model.props,()=>this.getEnvironment(),z),this.colorSchemaListener.apply(this.getEnvironment()).then(()=>{this.subscriptions.push(this.colorSchemaListener.on())})),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(W.changeEventName,()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(it).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")===pt.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===pt.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(nt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(ot).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(it).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 i=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,i=!1;n.desktop&&n.desktop.forEach(n=>{n.element===e&&(at(n,t),o=!0)}),n.mobile&&n.mobile.forEach(n=>{n.element===e&&(at(n,t),i=!0)}),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!i&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))}),n}(t,e),r=n("type"),s="element-styles";let a=this.getRootElement().querySelector(`style[${r}="${s}"]`);a||(a=document.createElement("style"),a.setAttribute(r,s),this.getRootElement().appendChild(a)),ut({element:a,html:""}),o.forEach(t=>{let e=t.getAttribute(n("element"));const o=this.getEnvironment();let r=ct(i,o,e);if(r){if(this.resizeListener.isMobile()){const t=ct(i,"desktop",e);t&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),r.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(r),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 i,r;const s=[];"host"===(e=yt._resolveTogglableStylesForElementModel(e)).element&&($.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.desktop)||"mobile"===this.getEnvironment()&&(null===(r=this.model.props.backgroundDynamicInlineSVGElements)||void 0===r?void 0:r.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:Q(e.styleAttributes,s)});if(V.set(t,c),this._setClassAttributes(t,e),o){if(e.hoverStyleAttributes){let i=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 r=this.getRootElement().querySelector(`#${o}`);r||(r=document.createElement("style"),r.id=o,t.appendChild(r)),ut({element:r,html:`\n ${n}::before {\n content: '';\n background: ${i.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 `}),i=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}i.borderTopWidth&&"0px"!==i.borderTopWidth||delete i.borderTopColor,i.borderBottomWidth&&"0px"!==i.borderBottomWidth||delete i.borderBottomColor,i.borderLeftWidth&&"0px"!==i.borderLeftWidth||delete i.borderLeftColor,i.borderRightWidth&&"0px"!==i.borderRightWidth||delete i.borderRightColor,this._addStylesToStyleElement(o,e.element,i,`: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 i=null===(e=n.textClasses)||void 0===e?void 0:e[t];i&&(i.styleAttributes.fontFamily||(i.isHeader&&n.headerFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.headerFontFamily})})),!i.isHeader&&n.textFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.textFontFamily})}))),o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),i.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},o.placeholderStyleAttributes),i.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,i="",r)=>{const s=Object.keys(o).reduce((t,e)=>t+` ${Y.camelCaseToDashCase(e)}: ${o[e]}${r?" !important;":";"}`,"");ut({element:t,html:`[${n("element")}="${e}"]${i} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{ut({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,i,r;e.linkColor&&ut({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)&&ut({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}`,appendHtml:!0}),(null===(r=e.linkParams)||void 0===r?void 0:r.removeUnderline)&&ut({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 i=((n.getAttribute("class")||"")+" "+o.classes).trim();n.setAttribute("class",i)},this.getParentComponent=()=>rt(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:rt(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.getAutofillValue=()=>{var t;const e=this.getModel();return new Et(this.services.config,this.services.context.getRegistry()).resolveValue(null===(t=e.props.control)||void 0===t?void 0:t.autofill,e.id)},this.getValidatedAutofillValue=()=>this.isAutofillValidated?this.validatedAutofillValue:void 0,this.syncAutofillContextRecord=(t,e)=>{this.isAutofillValidated=!0,this.validatedAutofillValue=t?e:void 0,t&&this.services.context.updateRecord(this.getModel().id,{value:e})},this.addContextRecord=()=>{var t,e;const n=this.getModel();this.services.context.addRecord(n.id,{recordKey:n.id,id:n.props.control.name,label:this.getContextRecordLabel(n.props),value:null!==(t=this.getValidatedAutofillValue())&&void 0!==t?t:n.props.control.defaultValue||"",viewIndex:null===(e=n.path)||void 0===e?void 0:e[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(n.props)}})},this.getContextRecordLabel=t=>{var e,n,o,i,r,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===(i=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===i?void 0:i.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(r=t.content)||void 0===r?void 0:r.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===st);n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:d.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()}}yt._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach(t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=yt._resolveTogglableStyles(e[t]))}),e},yt._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 vt=yt;var bt={FOLLOW:"FOLLOW",SHARE:"SHARE"},Ot={FACEBOOK:"FACEBOOK",INSTAGRAM:"INSTAGRAM",LINKEDIN:"LINKEDIN",TWITTER:"TWITTER",CUSTOM:"CUSTOM",EMAIL:"EMAIL",PINTEREST:"PINTEREST",WHATSAPP:"WHATSAPP"},St={ROUNDED:"ROUNDED"};function Tt(t){return Tt="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},Tt(t)}function _t(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,At(o.key),o)}}function At(t){var e=function(t){if("object"!=Tt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Tt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tt(e)?e:e+""}var Ct=function(){return function(t,e){return e&&_t(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 Ot[t.type]?t.type:Ot.CUSTOM}},{key:"getValidIconMode",value:function(t){return(St[t.mode]?t.mode:St.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===Ot.CUSTOM)return this.getDefaultImage();var n="".concat(e.toLowerCase(),"-logo"),o=this.getValidIconMode(t),i=o?"-".concat(o):"";return"".concat(this.imgPath,"/").concat(n).concat(i,".svg")}}])}();const It={name:"SysSocialComponent",componentType:"SOCIAL",version:"1.0.0",events:{dispatch:[],listen:[]},contextMenuModel:function(t){return Object.values(lt).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 Nt(t){return Nt="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},Nt(t)}function Rt(t,e,n){return(e=function(t){var e=function(t){if("object"!=Nt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Nt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lt(t){var e=t&&t.type;return Boolean(e)}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){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 Ut(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mt(Object(n),!0).forEach(function(e){wt(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mt(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function wt(t,e,n){return(e=function(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+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dt(t){var e,n,o,i,r=function(t){Array.isArray(t.options)||(console.warn("SysSocial: options should be an array, setting default value"),t.options=[]);var e=t.options.filter(Lt);return e.length!==t.options.length&&(console.error("SysSocial: options contain invalid platforms, filtering them out"),t.options=e),Object.values(bt).includes(t.mode)||(console.error("SysSocial: mode is invalid, setting default value"),t.mode=bt.FOLLOW),"object"!==Pt(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}(Ut({},null==t?void 0:t.control));return r.mode===bt.SHARE&&(r.options=(n=(e=r).options,o=e.shareUrl,i="INTERNAL"===e.shareUrlType?window.location.href:o,n.reduce(function(t,e){var n=function(t){return t?Rt(Rt(Rt(Rt(Rt(Rt({},Ot.FACEBOOK,function(t){var e=t.url;return"https://www.facebook.com/sharer/sharer.php?u=".concat(e)}),Ot.LINKEDIN,function(t){var e=t.url;return"https://www.linkedin.com/sharing/share-offsite/?url=".concat(e)}),Ot.TWITTER,function(t){var e=t.url;return"https://twitter.com/intent/tweet?url=".concat(e)}),Ot.PINTEREST,function(t){var e=t.url;return"https://www.pinterest.com/pin/create/button/?url=".concat(e)}),Ot.WHATSAPP,function(t){var e=t.url;return"https://wa.me/?text=".concat(e)}),Ot.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(Ut(Ut({},e),{},{url:n(Ut({url:i},e.props))})),t},[]))),r}function jt(t){return jt="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},jt(t)}function kt(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 xt(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,Ht(o.key),o)}}function Ft(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ft=function(){return!!t})()}function Bt(){return Bt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Wt(t)););return t}(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},Bt.apply(null,arguments)}function Wt(t){return Wt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Wt(t)}function Gt(t,e){return Gt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Gt(t,e)}function Vt(t,e,n){return(e=Ht(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ht(t){var e=function(t){if("object"!=jt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==jt(e)?e:e+""}var $t=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),Vt(e=function(t,e,n){return e=Wt(e),function(t,e){if(e&&("object"==jt(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,Ft()?Reflect.construct(e,n||[],Wt(t).constructor):e.apply(t,n))}(this,t),"createContent",function(t){var n=e.getElement("social"),o=Dt(t),i=n.querySelector(".items-wrapper");i?e._renderItemsForExistingComponent(i,o):e._renderItemsForEmptyComponent(n,o)}),Vt(e,"_renderItemsForEmptyComponent",function(t,n){var o=document.createElement("div");o.classList.add("items-wrapper"),e.addItemsContent(o,n),ut({element:t,html:""}),t.append(o)}),Vt(e,"_renderItemsForExistingComponent",function(t,n){var o={};n.options.forEach(function(i){var r=e.getPlatformKey(i),s=t.querySelector('[key="'.concat(r,'"]'));o[r]=s?e._updatePlatformComponent(s,i,n):e._createNewPlatformComponent(t,i,n),e._setPlatformStyles(o[r],i)});var i,r=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 kt(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)?kt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}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 r,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,r=t},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw r}}}}(t.children);try{for(r.s();!(i=r.n()).done;){var s=i.value,a=s.getAttribute("key");o[a]||t.removeChild(s)}}catch(t){r.e(t)}finally{r.f()}}),Vt(e,"_updatePlatformComponent",function(t,n,o){var i=t.querySelector("img"),r=e.urlManager.getPlatformImageUrl(n);i.src!==r&&(i.src=r);var s=o.size[e.getEnvironment()];return s!==i.width&&(i.height=s,i.width=s),t}),Vt(e,"_createNewPlatformComponent",function(t,n,o){var i=e.createPlatformComponent(n,o);return t.append(i),i}),Vt(e,"addItemsContent",function(t,n){return t.classList.add("social-list"),t.setAttribute("role","list"),n.options.forEach(function(o){t.append(e.createPlatformComponent(o,n))}),t}),Vt(e,"createPlatformComponent",function(t,n){var o,i=n.size,r=t.url;r?((o=document.createElement("a")).setAttribute("href",r||"#"),o.setAttribute("target","_blank"),o.setAttribute("rel","noopener noreferrer"),o.setAttribute("aria-label",e.getPlatformAccessibleLabel(t))):((o=document.createElement("div")).setAttribute("role","img"),o.setAttribute("aria-label",e.getPlatformAccessibleLabel(t))),o.classList.add("social-list-item"),o.setAttribute("key",e.getPlatformKey(t)),e._setPlatformStyles(o,t);var s=e.urlManager.getPlatformImageUrl(t),a=i[e.getEnvironment()],l=document.createElement("img");return l.src=s,l.height=a,l.width=a,l.alt="",l.setAttribute("aria-hidden","true"),ut({element:o,html:""}),o.appendChild(l),o}),Vt(e,"getPlatformKey",function(t){return"".concat(t.type,"-").concat(t.order)}),Vt(e,"_setPlatformStyles",function(t,e){t.setAttribute("style","order:".concat(e.order))}),Vt(e,"getPlatformAccessibleLabel",function(t){var e={FACEBOOK:"Facebook",INSTAGRAM:"Instagram",LINKEDIN:"LinkedIn",TWITTER:"Twitter",CUSTOM:"Custom social link",EMAIL:"Email",PINTEREST:"Pinterest",WHATSAPP:"WhatsApp"};return e[t.type]||e.CUSTOM}),Vt(e,"manifest",It),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&&Gt(t,e)}(t,vt),function(t,e){return e&&xt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;!function(t,e,n){var o=Bt(Wt(t.prototype),"connectedCallback",n);return"function"==typeof o?function(t){return o.apply(n,t)}:o}(t,0,this)([]),this.urlManager=new Ct(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)})}}])}();Vt($t,"define",{name:"sys-social",model:It.name,manifest:It}),Vt($t,"componentStyle","\n .social-list {\n display: flex;\n gap: 10px;\n }\n \n .social-list-item {\n display: flex;\n }\n"),Vt($t,"componentTemplate",'\n <div class="social-container">\n <div cl-element="social" class="social-list-content">\n </div>\n </div>\n');export{$t as default};window.clComponentClass_SysSocialComponent=$t;
|
|
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 d=u;var p,m;class g{static sortActions(t){const e={[d.CLOSE_WIDGET]:-1,[d.OPEN_LINK]:-2,[d.SHOW_WIDGET]:1,[d.SUBSCRIBE_CONTACT]:2,[d.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.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,i)}),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=p||(p={})).CLICK="CLICK",m.COMPONENT_EVENT="COMPONENT_EVENT";class f{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,o){var r;const i=null===(r=o())||void 0===r?void 0:r.getAttribute(n("id"));this.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,i)}),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 E{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 f(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class y{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=y.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 A,_,C,I,N,R,L,P,M,U,w,D,j,k,x;T.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(_=A||(A={})).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",(C||(C={})).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"}(I||(I={})),function(t){t.SELF="_self",t.BLANK="_blank"}(N||(N={})),(R||(R={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(L||(L={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(P||(P={})),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"}(U||(U={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(w||(w={})),(j=D||(D={})).BEFORE="BEFORE",j.AFTER="AFTER",j.INSIDE="INSIDE",j.INSTEAD="INSTEAD",function(t){t.GO_TO_VIEW="GO_TO_VIEW",t.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",t.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",t.SUBMIT="SUBMIT",t.NPS_CONDITIONAL="NPS_CONDITIONAL"}(k||(k={})),function(t){t.TRUE_TERMINAL="TRUE_TERMINAL",t.INTERMEDIATE="INTERMEDIATE"}(x||(x={})),I.REQUEST,I.SUBSCRIBE_CONTACT;class F{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class W 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(W.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(W.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(W.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}W.changeEventName="CHANGE";const B=W;class G{static set(t,e){const n=t[G.accumulatorPropertyName]||{};t[G.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[G.accumulatorPropertyName]).forEach(n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""})}}G.accumulatorPropertyName="clStyleAttributes";const V=G;var H;!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"}(H||(H={}));class ${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===H.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 K{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),F.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 z=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 Q(t,e){return Object.keys(t).filter(t=>!e.includes(t)).reduce((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]}),{})}class q{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 Y{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 J;!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.SUBMIT_REQUEST_STARTED="SUBMIT_REQUEST_STARTED",t.SUBMIT_REQUEST_FINISHED="SUBMIT_REQUEST_FINISHED",t.SUBMIT_REQUEST_ERROR_WITHOUT_VIEW="SUBMIT_REQUEST_ERROR_WITHOUT_VIEW",t.PROMO_CODE_SHOWN="PROMO_CODE_SHOWN",t.LEAD_PROGRESS="LEAD_PROGRESS"}(J||(J={}));const X=J;class Z{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(X.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(X.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 Y(this.onCounterStateUpdate)}}}const tt=(...t)=>{let e=t.reduce((t,e)=>Object.assign(Object.assign({},t),{[e]:[]}),{});return{get:t=>e[t],clear:()=>tt(...t)}},et=tt,nt="props",ot="shared",rt="environment";function it(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 st="SUBMIT";function at(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 lt={DESKTOP:"desktop",MOBILE:"mobile"};function ct(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 ut(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}const ht=Object.getPrototypeOf(document.createEvent("CustomEvent")).constructor;class dt extends ht{constructor(t,e={},n){super(t,Object.assign(Object.assign({},n),{detail:e}))}}var pt,mt,gt;function ft(t){if(null!=t&&""!==t)return"string"==typeof t?t:"object"==typeof t?JSON.stringify(t):String(t)}!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(pt||(pt={})),(gt=mt||(mt={})).STATIC="STATIC",gt.DATA_LAYER="DATA_LAYER",gt.URL_QUERY_PARAMS="URL_QUERY_PARAMS",gt.JS_API_VARIABLE="JS_API_VARIABLE",gt.COOKIE="COOKIE",gt.LOCAL_STORAGE="LOCAL_STORAGE";class Et{constructor(t,e){this.configService=t,this.registry=e}resolveValue(t,e){if(!(null==t?void 0:t.enabled)||!t.sourceType||this.configService.getConfig("renderMode")===pt.UPDATING)return;const n=function(t,e,n,o){if(!e)return;if(e===mt.STATIC)return ft(null==n?void 0:n.value);const r=t.getSource(e);if(!r)return;const i=r.getValue(o);return ft("function"==typeof(null==i?void 0:i.processor)?i.processor(r,Object.assign({id:o},n)):null==i?void 0:i.value)}(this.registry,t.sourceType,t.config,e);if(void 0===n)return;const o=n.trim();return""===o?void 0:o}}class yt extends HTMLElement{constructor(){var o;super(),this.skipGameBlur=!0,this.isAutofillValidated=!1,this.validatedAutofillValue=void 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 dt("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=et(nt,ot,rt),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 Z(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new E(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(nt).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(ot).forEach(t=>t(this.getShared()))}),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new K(this.documentModel,this.getHostElement(),()=>this.getShared(),()=>this.model.props,()=>this.getEnvironment(),z),this.colorSchemaListener.apply(this.getEnvironment()).then(()=>{this.subscriptions.push(this.colorSchemaListener.on())})),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(B.changeEventName,()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(rt).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")===pt.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===pt.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(nt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(ot).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(rt).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&&(at(n,t),o=!0)}),n.mobile&&n.mobile.forEach(n=>{n.element===e&&(at(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)),ut({element:a,html:""}),o.forEach(t=>{let e=t.getAttribute(n("element"));const o=this.getEnvironment();let i=ct(r,o,e);if(i){if(this.resizeListener.isMobile()){const t=ct(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=yt._resolveTogglableStylesForElementModel(e)).element&&($.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:Q(e.styleAttributes,s)});if(V.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)),ut({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+` ${q.camelCaseToDashCase(e)}: ${o[e]}${i?" !important;":";"}`,"");ut({element:t,html:`[${n("element")}="${e}"]${r} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{ut({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,r,i;e.linkColor&&ut({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)&&ut({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)&&ut({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=()=>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 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.getAutofillValue=()=>{var t;const e=this.getModel();return new Et(this.services.config,this.services.context.getRegistry()).resolveValue(null===(t=e.props.control)||void 0===t?void 0:t.autofill,e.id)},this.getValidatedAutofillValue=()=>this.isAutofillValidated?this.validatedAutofillValue:void 0,this.syncAutofillContextRecord=(t,e)=>{this.isAutofillValidated=!0,this.validatedAutofillValue=t?e:void 0,t&&this.services.context.updateRecord(this.getModel().id,{value:e})},this.addContextRecord=()=>{var t,e;const n=this.getModel();this.services.context.addRecord(n.id,{recordKey:n.id,id:n.props.control.name,label:this.getContextRecordLabel(n.props),value:null!==(t=this.getValidatedAutofillValue())&&void 0!==t?t:n.props.control.defaultValue||"",viewIndex:null===(e=n.path)||void 0===e?void 0:e[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(n.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===st);n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:d.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()}}yt._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach(t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=yt._resolveTogglableStyles(e[t]))}),e},yt._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 bt=yt;var vt={FOLLOW:"FOLLOW",SHARE:"SHARE"},Ot={FACEBOOK:"FACEBOOK",INSTAGRAM:"INSTAGRAM",LINKEDIN:"LINKEDIN",TWITTER:"TWITTER",CUSTOM:"CUSTOM",EMAIL:"EMAIL",PINTEREST:"PINTEREST",WHATSAPP:"WHATSAPP"},St={ROUNDED:"ROUNDED"};function Tt(t){return Tt="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},Tt(t)}function At(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,_t(o.key),o)}}function _t(t){var e=function(t){if("object"!=Tt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Tt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Tt(e)?e:e+""}var Ct=function(){return function(t,e){return e&&At(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 Ot[t.type]?t.type:Ot.CUSTOM}},{key:"getValidIconMode",value:function(t){return(St[t.mode]?t.mode:St.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===Ot.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 It={name:"SysSocialComponent",componentType:"SOCIAL",version:"1.0.0",events:{dispatch:[],listen:[]},contextMenuModel:function(t){return Object.values(lt).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 Nt(t){return Nt="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},Nt(t)}function Rt(t,e,n){return(e=function(t){var e=function(t){if("object"!=Nt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Nt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Lt(t){var e=t&&t.type;return Boolean(e)}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){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 Ut(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mt(Object(n),!0).forEach(function(e){wt(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mt(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function wt(t,e,n){return(e=function(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+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Dt(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(Lt);return e.length!==t.options.length&&(console.error("SysSocial: options contain invalid platforms, filtering them out"),t.options=e),Object.values(vt).includes(t.mode)||(console.error("SysSocial: mode is invalid, setting default value"),t.mode=vt.FOLLOW),"object"!==Pt(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}(Ut({},null==t?void 0:t.control));return i.mode===vt.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?Rt(Rt(Rt(Rt(Rt(Rt({},Ot.FACEBOOK,function(t){var e=t.url;return"https://www.facebook.com/sharer/sharer.php?u=".concat(e)}),Ot.LINKEDIN,function(t){var e=t.url;return"https://www.linkedin.com/sharing/share-offsite/?url=".concat(e)}),Ot.TWITTER,function(t){var e=t.url;return"https://twitter.com/intent/tweet?url=".concat(e)}),Ot.PINTEREST,function(t){var e=t.url;return"https://www.pinterest.com/pin/create/button/?url=".concat(e)}),Ot.WHATSAPP,function(t){var e=t.url;return"https://wa.me/?text=".concat(e)}),Ot.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(Ut(Ut({},e),{},{url:n(Ut({url:r},e.props))})),t},[]))),i}function jt(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 kt(t){return kt="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},kt(t)}function xt(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 Ft(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,$t(o.key),o)}}function Wt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Wt=function(){return!!t})()}function Bt(){return Bt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Gt(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}},Bt.apply(null,arguments)}function Gt(t){return Gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Gt(t)}function Vt(t,e){return Vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Vt(t,e)}function Ht(t,e,n){return(e=$t(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function $t(t){var e=function(t){if("object"!=kt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=kt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==kt(e)?e:e+""}var Kt=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),Ht(e=function(t,e,n){return e=Gt(e),function(t,e){if(e&&("object"==kt(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||[],Gt(t).constructor):e.apply(t,n))}(this,t),"createContent",function(t){var n=e.getElement("social"),o=Dt(t),r=n.querySelector(".items-wrapper");r?e._renderItemsForExistingComponent(r,o):e._renderItemsForEmptyComponent(n,o)}),Ht(e,"_renderItemsForEmptyComponent",function(t,n){var o=document.createElement("div");o.classList.add("items-wrapper"),e.addItemsContent(o,n),jt({element:t,html:""}),t.append(o)}),Ht(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 xt(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)?xt(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()}}),Ht(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}),Ht(e,"_createNewPlatformComponent",function(t,n,o){var r=e.createPlatformComponent(n,o);return t.append(r),r}),Ht(e,"addItemsContent",function(t,n){return t.classList.add("social-list"),t.setAttribute("role","list"),n.options.forEach(function(o){t.append(e.createPlatformComponent(o,n))}),t}),Ht(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.setAttribute("rel","noopener noreferrer"),o.setAttribute("aria-label",e.getPlatformAccessibleLabel(t))):((o=document.createElement("div")).setAttribute("role","img"),o.setAttribute("aria-label",e.getPlatformAccessibleLabel(t))),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,l.alt="",l.setAttribute("aria-hidden","true"),jt({element:o,html:""}),o.appendChild(l),o}),Ht(e,"getPlatformKey",function(t){return"".concat(t.type,"-").concat(t.order)}),Ht(e,"_setPlatformStyles",function(t,e){t.setAttribute("style","order:".concat(e.order))}),Ht(e,"getPlatformAccessibleLabel",function(t){var e={FACEBOOK:"Facebook",INSTAGRAM:"Instagram",LINKEDIN:"LinkedIn",TWITTER:"Twitter",CUSTOM:"Custom social link",EMAIL:"Email",PINTEREST:"Pinterest",WHATSAPP:"WhatsApp"};return e[t.type]||e.CUSTOM}),Ht(e,"manifest",It),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&&Vt(t,e)}(t,bt),function(t,e){return e&&Ft(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;!function(t,e,n){var o=Bt(Gt(t.prototype),"connectedCallback",n);return"function"==typeof o?function(t){return o.apply(n,t)}:o}(t,0,this)([]),this.urlManager=new Ct(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)})}}])}();Ht(Kt,"define",{name:"sys-social",model:It.name,manifest:It}),Ht(Kt,"componentStyle","\n .social-list {\n display: flex;\n gap: 10px;\n }\n \n .social-list-item {\n display: flex;\n }\n"),Ht(Kt,"componentTemplate",'\n <div class="social-container">\n <div cl-element="social" class="social-list-content">\n </div>\n </div>\n');export{Kt as default};window.clComponentClass_SysSocialComponent=Kt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t="cl-";function e(e){return t+e}function n(t){return"cl-"+t}const i="VIEW",s="MODULE",o="CONTAINER",r="INPUT",l="BUTTON",a="CONSENT",c="COLUMN";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.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,o)}),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=[l,a,r],(m=p||(p={})).CLICK="CLICK",m.COMPONENT_EVENT="COMPONENT_EVENT";class E{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,i){var s;const o=null===(s=i())||void 0===s?void 0:s.getAttribute(n("id"));this.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,o)}),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 E(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class y{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 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=y.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=b.createDefaultListenersState()}}b.createDefaultListenersState=()=>({"*":{}});const v=b,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,R,I,N,L,x,P,M,w,U,j,D,k;S.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(_=A||(A={})).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",(C||(C={})).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"}(R||(R={})),function(t){t.SELF="_self",t.BLANK="_blank"}(I||(I={})),(N||(N={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(L||(L={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(x||(x={})),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={})),(j=U||(U={})).BEFORE="BEFORE",j.AFTER="AFTER",j.INSIDE="INSIDE",j.INSTEAD="INSTEAD",function(t){t.GO_TO_VIEW="GO_TO_VIEW",t.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",t.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",t.SUBMIT="SUBMIT",t.NPS_CONDITIONAL="NPS_CONDITIONAL"}(D||(D={})),function(t){t.TRUE_TERMINAL="TRUE_TERMINAL",t.INTERMEDIATE="INTERMEDIATE"}(k||(k={})),R.REQUEST,R.SUBSCRIBE_CONTACT;class B{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class W 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(W.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(W.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(W.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}W.changeEventName="CHANGE";const F=W;class G{static set(t,e){const n=t[G.accumulatorPropertyName]||{};t[G.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[G.accumulatorPropertyName]).forEach(n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""})}}G.accumulatorPropertyName="clStyleAttributes";const V=G;var H;!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"}(H||(H={}));class ${static applyHostStyles(t,e,n=null,s){var r,l,a;const u=null===(l=null===(r=null==n?void 0:n.props)||void 0===r?void 0:r.handlers)||void 0===l?void 0:l.find(t=>"CLICK"===t.type);u&&(null===(a=u.actions)||void 0===a?void 0:a.length)&&(e.style.cursor="pointer"),t!==i&&t!==o&&t!==c||(e.style.display=s===H.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 K{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,l;const a=null===(s=null===(i=e.adaptiveStyles)||void 0===i?void 0:i[t])||void 0===s?void 0:s.find(t=>t.element===n),c=(null===(o=e.styles)||void 0===o?void 0:o.find(t=>t.element===n))||{},u=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),d=this.parseBackground(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),B.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 Q=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 z(t,e){return Object.keys(t).filter(t=>!e.includes(t)).reduce((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]}),{})}class Y{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.SUBMIT_REQUEST_STARTED="SUBMIT_REQUEST_STARTED",t.SUBMIT_REQUEST_FINISHED="SUBMIT_REQUEST_FINISHED",t.SUBMIT_REQUEST_ERROR_WITHOUT_VIEW="SUBMIT_REQUEST_ERROR_WITHOUT_VIEW",t.PROMO_CODE_SHOWN="PROMO_CODE_SHOWN",t.LEAD_PROGRESS="LEAD_PROGRESS"}(q||(q={}));const J=q;class Z{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(J.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(J.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 tt=(...t)=>{let e=t.reduce((t,e)=>Object.assign(Object.assign({},t),{[e]:[]}),{});return{get:t=>e[t],clear:()=>tt(...t)}},et=tt,nt="props",it="shared",st="environment";function ot(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 rt="SUBMIT";function lt(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 at={DESKTOP:"desktop",MOBILE:"mobile"};function ct(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 ut(t=[]){return t.map(t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)}))}function dt(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}const ht=Object.getPrototypeOf(document.createEvent("CustomEvent")).constructor;class pt extends ht{constructor(t,e={},n){super(t,Object.assign(Object.assign({},n),{detail:e}))}}var mt,gt,Et;function ft(t){if(null!=t&&""!==t)return"string"==typeof t?t:"object"==typeof t?JSON.stringify(t):String(t)}!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(mt||(mt={})),(Et=gt||(gt={})).STATIC="STATIC",Et.DATA_LAYER="DATA_LAYER",Et.URL_QUERY_PARAMS="URL_QUERY_PARAMS",Et.JS_API_VARIABLE="JS_API_VARIABLE",Et.COOKIE="COOKIE",Et.LOCAL_STORAGE="LOCAL_STORAGE";class yt{constructor(t,e){this.configService=t,this.registry=e}resolveValue(t,e){if(!(null==t?void 0:t.enabled)||!t.sourceType||this.configService.getConfig("renderMode")===mt.UPDATING)return;const n=function(t,e,n,i){if(!e)return;if(e===gt.STATIC)return ft(null==n?void 0:n.value);const s=t.getSource(e);if(!s)return;const o=s.getValue(i);return ft("function"==typeof(null==o?void 0:o.processor)?o.processor(s,Object.assign({id:i},n)):null==o?void 0:o.value)}(this.registry,t.sourceType,t.config,e);if(void 0===n)return;const i=n.trim();return""===i?void 0:i}}class bt extends HTMLElement{constructor(){var i;super(),this.skipGameBlur=!0,this.isAutofillValidated=!1,this.validatedAutofillValue=void 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 pt("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=et(nt,it,st),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 Z(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(nt).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(it).forEach(t=>t(this.getShared()))}),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new K(this.documentModel,this.getHostElement(),()=>this.getShared(),()=>this.model.props,()=>this.getEnvironment(),Q),this.colorSchemaListener.apply(this.getEnvironment()).then(()=>{this.subscriptions.push(this.colorSchemaListener.on())})),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(F.changeEventName,()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(st).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")===mt.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===mt.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(nt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(it).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(st).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&&(lt(n,t),i=!0)}),n.mobile&&n.mobile.forEach(n=>{n.element===e&&(lt(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 l=this.getRootElement().querySelector(`style[${o}="${r}"]`);l||(l=document.createElement("style"),l.setAttribute(o,r),this.getRootElement().appendChild(l)),dt({element:l,html:""}),i.forEach(t=>{let e=t.getAttribute(n("element"));const i=this.getEnvironment();let o=ct(s,i,e);if(o){if(this.resizeListener.isMobile()){const t=ct(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),l)}}),this._addLinkColor(l,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=bt._resolveTogglableStylesForElementModel(e)).element&&($.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(s=this.model.props.backgroundDynamicInlineSVGElements)||void 0===s?void 0:s.desktop)||"mobile"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),r.push("background")));let l=e.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],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:z(e.styleAttributes,r)});if(V.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)),dt({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+` ${Y.camelCaseToDashCase(e)}: ${i[e]}${o?" !important;":";"}`,"");dt({element:t,html:`[${n("element")}="${e}"]${s} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{dt({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,i,s,o;e.linkColor&&dt({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)&&dt({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)&&dt({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=()=>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 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.getAutofillValue=()=>{var t;const e=this.getModel();return new yt(this.services.config,this.services.context.getRegistry()).resolveValue(null===(t=e.props.control)||void 0===t?void 0:t.autofill,e.id)},this.getValidatedAutofillValue=()=>this.isAutofillValidated?this.validatedAutofillValue:void 0,this.syncAutofillContextRecord=(t,e)=>{this.isAutofillValidated=!0,this.validatedAutofillValue=t?e:void 0,t&&this.services.context.updateRecord(this.getModel().id,{value:e})},this.addContextRecord=()=>{var t,e;const n=this.getModel();this.services.context.addRecord(n.id,{recordKey:n.id,id:n.props.control.name,label:this.getContextRecordLabel(n.props),value:null!==(t=this.getValidatedAutofillValue())&&void 0!==t?t:n.props.control.defaultValue||"",viewIndex:null===(e=n.path)||void 0===e?void 0:e[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(n.props)}})},this.getContextRecordLabel=t=>{var e,n,i,s,o,r;const l=t.control.name;if(["email","first_name","last_name"].includes(l))return l.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===rt);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()}}bt._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach(t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=bt._resolveTogglableStyles(e[t]))}),e},bt._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 vt=bt;function Ot(t){return Object.values(at).map(e=>({type:"GROUP",propPath:["adaptiveStyles",e],children:t}))}const Tt={name:"SysTextComponent",componentType:"TEXT",version:"1.0.0",events:{dispatch:[],listen:[]},contextMenuModel:Ot([{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]),floatingControlsModel:Ot([{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:Ot([{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["hug"]}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{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:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"text",params:{indentationType:"PADDING"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}}])},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:(St=[{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(at).reduce((t,e)=>Object.assign(t,{[e]:ut(St)}),{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 St;function At(t,e=1){return t.reduce((t,n)=>Array.isArray(n)&&e>=1?t.concat(At(n,e-1)):t.concat(n),[])}function _t(t){return _t="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},_t(t)}function Ct(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,s,o,r,l=[],a=!0,c=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;a=!1}else for(;!(a=(i=o.call(n)).done)&&(l.push(i.value),l.length!==e);a=!0);}catch(t){c=!0,s=t}finally{try{if(!a&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(c)throw s}}return l}}(t,e)||Rt(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 Rt(t,e){if(t){if("string"==typeof t)return It(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)?It(t,e):void 0}}function It(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=Array(e);n<e;n++)i[n]=t[n];return i}function Nt(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function Lt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Nt(Object(n),!0).forEach(function(e){xt(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Nt(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function xt(t,e,n){return(e=function(t){var e=function(t){if("object"!=_t(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=_t(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==_t(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Pt={maxWidth:"100%",width:"fit-content",display:"inline-flex",fontFamily:"inherit"},Mt={padding:"0 5px",display:"inline-block",maxWidth:"calc(100% - 0px)",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},wt={display:"inline-flex",justifyContent:"center",minHeight:"fit-content"};function Ut(t,e){var n=e.id,i=kt(e.options),s=Lt(Lt({},Mt),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 jt(o,s),jt(n,{display:"inline-flex",justifyContent:r["text-align"]||wt.justifyContent},i,s),n}),r=Lt({},Pt),l=document.createElement("span");l.classList.add("container"),jt(l,{paddingLeft:e.styleAttributes.borderLeftWidth||0,paddingRight:e.styleAttributes.borderRightWidth||0,paddingTop:e.styleAttributes.borderTopWidth||0,paddingBottom:e.styleAttributes.borderBottomWidth||0});var a=document.createElement("span");a.innerText=i,jt(a,Lt(Lt({},s),{},{visibility:"hidden"}));var c=document.createElement("span");c.classList.add("opts"),o.forEach(function(t){c.appendChild(t)}),l.append(a,c),dt({element:t,html:""}),t.appendChild(l),jt(t,r);var u=l.querySelectorAll(".opt")[0].offsetHeight,d="".concat(u,"px");l.style.height=d,a.style.height=d,t.classList.add("container--staticTextRoller");var h=function(t){var e,n=1e3*(t.animationSpeedInSec||1),i=Math.max.apply(Math,function(t){if(Array.isArray(t))return It(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)||Rt(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=At(e.options.map(function(t,e){return"\n ".concat(e*n.optionTimePercentage,"% {\n transform: translateY(calc(").concat(100*e,"% + ").concat(1*e,"px));\n }\n ").concat(e*n.optionTimePercentage+o,"% {\n transform: translateY(calc(").concat(100*e,"% + ").concat(1*e,"px));\n }")})).concat("\n 100% {\n transform: translateY(calc(".concat(100*e.options.length,"% + ").concat(i,"px));\n }\n ")).join("\n"),l=document.createElement("style");dt({element:l,html:"@keyframes slide-down {".concat(r,"}")});var a=t.querySelector(".opt").cloneNode(!0);t.appendChild(l),t.querySelector(".opts").appendChild(a)}(t,e,h),function(t,e,n){var i=n.duration/1e3;e.options.length>1?t.style.animation="slide-down ".concat(i,"s infinite"):(t.style.transform="translateY(0%)",t.querySelectorAll(".opt")[0].style.display="none")}(c,e,h),{element:t,id:n}}function jt(t,e,n,i,s){var o={};if(n){var r=Dt(n,e,i);o={minWidth:"".concat(r>s?r:Math.min(r,s),"px")}}Object.entries(Lt(Lt({},o),e)||{}).forEach(function(e){var n=Ct(e,2),i=n[0],s=n[1];t.style[i]=s})}function Dt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=document.createElement("span"),s=document.createElement("span");s.innerText=t,i.appendChild(s);for(var o=0,r=Object.entries(n);o<r.length;o++){var l=Ct(r[o],2),a=l[0],c=l[1];s.style[a]=c}for(var u=0,d=Object.entries(e);u<d.length;u++){var h=Ct(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 kt(t){return t.map(function(t){return{value:t,width:Dt(t)}}).sort(function(t,e){return e.width-t.width}).at(0).value}function Bt(t){return Bt="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},Bt(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,Kt(i.key),i)}}function Ft(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ft=function(){return!!t})()}function Gt(){return Gt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Vt(t)););return t}(t,e);if(i){var s=Object.getOwnPropertyDescriptor(i,e);return s.get?s.get.call(arguments.length<3?t:n):s.value}},Gt.apply(null,arguments)}function Vt(t){return Vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Vt(t)}function Ht(t,e){return Ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ht(t,e)}function $t(t,e,n){return(e=Kt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Kt(t){var e=function(t){if("object"!=Bt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Bt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Bt(e)?e:e+""}var Qt=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),$t(e=function(t,e,n){return e=Vt(e),function(t,e){if(e&&("object"==Bt(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,Ft()?Reflect.construct(e,n||[],Vt(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.querySelectorAll('[cl-type="TEXT_ROLLER"]').forEach(function(e){var n=e.getAttribute("cl-id"),s=t[n];s&&(i?Ut(e,s):function(t,e){var n=e.id,i=document.createElement("span");i.classList.add("outer");var s=kt(e.options),o=document.createElement("span");o.classList.add("inner"),o.textContent=e.options.at(0)||"Option 1",o.setAttribute("contenteditable","false"),i.appendChild(o);var r,l,a,c=window.getComputedStyle(t.parentElement),u=(r=c,l={},a=["font-size","font-weight","font-style","font-family","text-align","text-shadow","letter-spacing","line-height"],Object.keys(r).forEach(function(t){if(Number.isInteger(Number(t))){var e=r[t];a.includes(e)&&(l[e]=r.getPropertyValue(e))}}),l),d=Lt(Lt(Lt({},Mt),e.styleAttributes),u);jt(o,d),jt(i,Lt(Lt({},wt),{},{borderRadius:o.style["border-radius"]||wt.borderRadius,justifyContent:c["text-align"]||wt.justifyContent}),s,d,parseFloat(c.width)),dt({element:t,html:""}),jt(t,Lt({},Pt)),t.appendChild(i)}(e,s))})}}),$t(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))}),$t(e,"manifest",Tt),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&&Ht(t,e)}(t,vt),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=Gt(Vt(t.prototype),"connectedCallback",n);return"function"==typeof i?function(t){return i.apply(n,t)}:i}(t,0,this)([]),this.observeProps(function(t,n){var i,s,o;e.applyAutoAdaptiveStyles(n.adaptiveStyles,n.styles),null!==(i=n.content)&&void 0!==i&&i.text&&e.getElement("text")&&(dt({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)})}}])}();$t(Qt,"define",{name:"sys-text",model:Tt.name,manifest:Tt});export{Qt as default};window.clComponentClass_SysTextComponent=Qt;
|
|
1
|
+
const t="cl-";function e(e){return t+e}function n(t){return"cl-"+t}const i="VIEW",o="MODULE",s="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 o=i(),s=o.getAttribute(n("id"));this.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,s)}),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"))!==s;){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((o.shadowRoot||o).querySelectorAll(this.config.relativeSelector)):[o],this.targetElements.forEach(t=>{t.addEventListener("click",this.listener)})}async execute(){var t,e,n,i;try{for(var o,s=!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,o){!function(t,e,n,i){Promise.resolve(i).then(function(e){t({value:e,done:n})},e)}(i,o,(e=t[n](e)).done,e.value)})}}}(this.eventsQueue);!(t=(o=await r.next()).done);s=!0){i=o.value,s=!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{s||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 E{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,i){var o;const s=null===(o=i())||void 0===o?void 0:o.getAttribute(n("id"));this.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,s)}),this.componentEmitterListener=e.on(this.config.eventName,()=>{this.actions.forEach(e=>e.execute(t.getState(),this.config.params))})}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class 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 E(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class y{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 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=y.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=b.createDefaultListenersState()}}b.createDefaultListenersState=()=>({"*":{}});const v=b,O=(t,e,n,i)=>{const o=EventTarget.prototype,{addEventListenerBase:s,addEventListener:r}=o;(s||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===o?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,R,I,N,L,x,P,M,w,j,U,D,k;S.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(_=A||(A={})).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",(C||(C={})).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"}(R||(R={})),function(t){t.SELF="_self",t.BLANK="_blank"}(I||(I={})),(N||(N={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(L||(L={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(x||(x={})),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={})),(U=j||(j={})).BEFORE="BEFORE",U.AFTER="AFTER",U.INSIDE="INSIDE",U.INSTEAD="INSTEAD",function(t){t.GO_TO_VIEW="GO_TO_VIEW",t.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",t.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",t.SUBMIT="SUBMIT",t.NPS_CONDITIONAL="NPS_CONDITIONAL"}(D||(D={})),function(t){t.TRUE_TERMINAL="TRUE_TERMINAL",t.INTERMEDIATE="INTERMEDIATE"}(k||(k={})),R.REQUEST,R.SUBSCRIBE_CONTACT;class B{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class W 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(W.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(W.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(W.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}W.changeEventName="CHANGE";const F=W;class G{static set(t,e){const n=t[G.accumulatorPropertyName]||{};t[G.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[G.accumulatorPropertyName]).forEach(n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""})}}G.accumulatorPropertyName="clStyleAttributes";const V=G;var H;!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"}(H||(H={}));class ${static applyHostStyles(t,e,n=null,o){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!==s&&t!==c||(e.style.display=o===H.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 K{constructor(t,e,n,i,o,s){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=i,this.getEnvCb=o,this.httpClient=s,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,o,s,r,a;const l=null===(o=null===(i=e.adaptiveStyles)||void 0===i?void 0:i[t])||void 0===o?void 0:o.find(t=>t.element===n),c=(null===(s=e.styles)||void 0===s?void 0:s.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),B.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 o;i=i.replace(`var(--${o=n,`cl-schema-${o}`})`,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 Q=new class{execute(t,e="GET",n=null,i,o){const s={method:e,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:o};return n&&(s.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,s)}};function z(t,e){return Object.keys(t).filter(t=>!e.includes(t)).reduce((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]}),{})}class Y{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 X;!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.SUBMIT_REQUEST_STARTED="SUBMIT_REQUEST_STARTED",t.SUBMIT_REQUEST_FINISHED="SUBMIT_REQUEST_FINISHED",t.SUBMIT_REQUEST_ERROR_WITHOUT_VIEW="SUBMIT_REQUEST_ERROR_WITHOUT_VIEW",t.PROMO_CODE_SHOWN="PROMO_CODE_SHOWN",t.LEAD_PROGRESS="LEAD_PROGRESS"}(X||(X={}));const J=X;class Z{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(J.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(J.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 tt=(...t)=>{let e=t.reduce((t,e)=>Object.assign(Object.assign({},t),{[e]:[]}),{});return{get:t=>e[t],clear:()=>tt(...t)}},et=tt,nt="props",it="shared",ot="environment";function st(t,e,n,i){const o=t=>{let s=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return s&&(i&&"function"==typeof i?i(s.getAttribute(e)):(null===(r=null==s?void 0:s.getAttribute)||void 0===r?void 0:r.call(s,e))===n)?s:s&&s.parentNode&&o(s.parentNode)||null;var r};return o(t)}const rt="SUBMIT";function at(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 lt={DESKTOP:"desktop",MOBILE:"mobile"};function ct(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 ut(t=[]){return t.map(t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)}))}function dt(t){const{element:e,html:n,appendHtml:i}=t,o=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+=o:e.innerHTML=o}const ht=Object.getPrototypeOf(document.createEvent("CustomEvent")).constructor;class pt extends ht{constructor(t,e={},n){super(t,Object.assign(Object.assign({},n),{detail:e}))}}var mt,gt,Et;function ft(t){if(null!=t&&""!==t)return"string"==typeof t?t:"object"==typeof t?JSON.stringify(t):String(t)}!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(mt||(mt={})),(Et=gt||(gt={})).STATIC="STATIC",Et.DATA_LAYER="DATA_LAYER",Et.URL_QUERY_PARAMS="URL_QUERY_PARAMS",Et.JS_API_VARIABLE="JS_API_VARIABLE",Et.COOKIE="COOKIE",Et.LOCAL_STORAGE="LOCAL_STORAGE";class yt{constructor(t,e){this.configService=t,this.registry=e}resolveValue(t,e){if(!(null==t?void 0:t.enabled)||!t.sourceType||this.configService.getConfig("renderMode")===mt.UPDATING)return;const n=function(t,e,n,i){if(!e)return;if(e===gt.STATIC)return ft(null==n?void 0:n.value);const o=t.getSource(e);if(!o)return;const s=o.getValue(i);return ft("function"==typeof(null==s?void 0:s.processor)?s.processor(o,Object.assign({id:i},n)):null==s?void 0:s.value)}(this.registry,t.sourceType,t.config,e);if(void 0===n)return;const i=n.trim();return""===i?void 0:i}}class bt extends HTMLElement{constructor(){var i;super(),this.skipGameBlur=!0,this.isAutofillValidated=!1,this.validatedAutofillValue=void 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 o=i.closest(`[${n("widget-id")}]`);let s;o&&(s=o.getAttribute(n("widget-id")));let r=new pt("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("path")),id:e,widgetId:s},{bubbles:!0,composed:!0});this.dispatchEvent(r),t=r.detail.props,Object.assign(this,t),this.observers=et(nt,it,ot),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 Z(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(nt).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(it).forEach(t=>t(this.getShared()))}),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new K(this.documentModel,this.getHostElement(),()=>this.getShared(),()=>this.model.props,()=>this.getEnvironment(),Q),this.colorSchemaListener.apply(this.getEnvironment()).then(()=>{this.subscriptions.push(this.colorSchemaListener.on())})),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(F.changeEventName,()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(ot).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")===mt.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===mt.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(nt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(it).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(ot).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 o=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,o=!1;n.desktop&&n.desktop.forEach(n=>{n.element===e&&(at(n,t),i=!0)}),n.mobile&&n.mobile.forEach(n=>{n.element===e&&(at(n,t),o=!0)}),!i&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!o&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))}),n}(t,e),s=n("type"),r="element-styles";let a=this.getRootElement().querySelector(`style[${s}="${r}"]`);a||(a=document.createElement("style"),a.setAttribute(s,r),this.getRootElement().appendChild(a)),dt({element:a,html:""}),i.forEach(t=>{let e=t.getAttribute(n("element"));const i=this.getEnvironment();let s=ct(o,i,e);if(s){if(this.resizeListener.isMobile()){const t=ct(o,"desktop",e);t&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),s.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(s),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 o,s;const r=[];"host"===(e=bt._resolveTogglableStylesForElementModel(e)).element&&($.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(s=this.model.props.backgroundDynamicInlineSVGElements)||void 0===s?void 0:s.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:z(e.styleAttributes,r)});if(V.set(t,c),this._setClassAttributes(t,e),i){if(e.hoverStyleAttributes){let o=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const n=t.tagName.toLowerCase(),i=`flip-up-animation-${e.element}`;let s=this.getRootElement().querySelector(`#${i}`);s||(s=document.createElement("style"),s.id=i,t.appendChild(s)),dt({element:s,html:`\n ${n}::before {\n content: '';\n background: ${o.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),o=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}o.borderTopWidth&&"0px"!==o.borderTopWidth||delete o.borderTopColor,o.borderBottomWidth&&"0px"!==o.borderBottomWidth||delete o.borderBottomColor,o.borderLeftWidth&&"0px"!==o.borderLeftWidth||delete o.borderLeftColor,o.borderRightWidth&&"0px"!==o.borderRightWidth||delete o.borderRightColor,this._addStylesToStyleElement(i,e.element,o,`: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 o=null===(e=n.textClasses)||void 0===e?void 0:e[t];o&&(o.styleAttributes.fontFamily||(o.isHeader&&n.headerFontFamily&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.headerFontFamily})})),!o.isHeader&&n.textFontFamily&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:n.textFontFamily})}))),i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),o.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},i.placeholderStyleAttributes),o.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,o="",s)=>{const r=Object.keys(i).reduce((t,e)=>t+` ${Y.camelCaseToDashCase(e)}: ${i[e]}${s?" !important;":";"}`,"");dt({element:t,html:`[${n("element")}="${e}"]${o} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{dt({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,i,o,s;e.linkColor&&dt({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)&&dt({element:t,html:`a {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}`,appendHtml:!0}),(null===(s=e.linkParams)||void 0===s?void 0:s.removeUnderline)&&dt({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 o=((n.getAttribute("class")||"")+" "+i.classes).trim();n.setAttribute("class",o)},this.getParentComponent=()=>st(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:st(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.getAutofillValue=()=>{var t;const e=this.getModel();return new yt(this.services.config,this.services.context.getRegistry()).resolveValue(null===(t=e.props.control)||void 0===t?void 0:t.autofill,e.id)},this.getValidatedAutofillValue=()=>this.isAutofillValidated?this.validatedAutofillValue:void 0,this.syncAutofillContextRecord=(t,e)=>{this.isAutofillValidated=!0,this.validatedAutofillValue=t?e:void 0,t&&this.services.context.updateRecord(this.getModel().id,{value:e})},this.addContextRecord=()=>{var t,e;const n=this.getModel();this.services.context.addRecord(n.id,{recordKey:n.id,id:n.props.control.name,label:this.getContextRecordLabel(n.props),value:null!==(t=this.getValidatedAutofillValue())&&void 0!==t?t:n.props.control.defaultValue||"",viewIndex:null===(e=n.path)||void 0===e?void 0:e[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(n.props)}})},this.getContextRecordLabel=t=>{var e,n,i,o,s,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===(o=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===o?void 0:o.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(s=t.content)||void 0===s?void 0:s.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===rt);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()}}bt._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach(t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=bt._resolveTogglableStyles(e[t]))}),e},bt._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 vt=bt;function Ot(t){return Object.values(lt).map(e=>({type:"GROUP",propPath:["adaptiveStyles",e],children:t}))}const Tt={name:"SysTextComponent",componentType:"TEXT",version:"1.0.0",events:{dispatch:[],listen:[]},contextMenuModel:Ot([{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]),floatingControlsModel:Ot([{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:Ot([{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["hug"]}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{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:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"text",params:{indentationType:"PADDING"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}}])},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:(St=[{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(lt).reduce((t,e)=>Object.assign(t,{[e]:ut(St)}),{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 St;function At(t,e=1){return t.reduce((t,n)=>Array.isArray(n)&&e>=1?t.concat(At(n,e-1)):t.concat(n),[])}function _t(t){const{element:e,html:n,appendHtml:i}=t,o=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+=o:e.innerHTML=o}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 Rt(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,o,s,r,a=[],l=!0,c=!1;try{if(s=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=s.call(n)).done)&&(a.push(i.value),a.length!==e);l=!0);}catch(t){c=!0,o=t}finally{try{if(!l&&null!=n.return&&(r=n.return(),Object(r)!==r))return}finally{if(c)throw o}}return a}}(t,e)||It(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function It(t,e){if(t){if("string"==typeof t)return Nt(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)?Nt(t,e):void 0}}function Nt(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 Lt(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 xt(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Lt(Object(n),!0).forEach(function(e){Pt(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Lt(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function Pt(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}var Mt={maxWidth:"100%",width:"fit-content",display:"inline-flex",fontFamily:"inherit"},wt={padding:"0 5px",display:"inline-block",maxWidth:"calc(100% - 0px)",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},jt={display:"inline-flex",justifyContent:"center",minHeight:"fit-content"};function Ut(t,e){var n=e.id,i=Bt(e.options),o=xt(xt({},wt),e.styleAttributes),s=e.options.map(function(e){var n=document.createElement("span");n.classList.add("opt");var s=document.createElement("span");s.innerText=e,n.appendChild(s);var r=window.getComputedStyle(t.parentElement);return Dt(s,o),Dt(n,{display:"inline-flex",justifyContent:r["text-align"]||jt.justifyContent},i,o),n}),r=xt({},Mt),a=document.createElement("span");a.classList.add("container"),Dt(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,Dt(l,xt(xt({},o),{},{visibility:"hidden"}));var c=document.createElement("span");c.classList.add("opts"),s.forEach(function(t){c.appendChild(t)}),a.append(l,c),_t({element:t,html:""}),t.appendChild(a),Dt(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 Nt(t)}(e=t.options.map(function(t){return t.replace(/\s+/g,"").length}))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(e)||It(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),o=Math.max(Math.ceil(i/15),1),s=t.options.length;return{optionTimePercentage:100/s,duration:s*(o*n+500),longestOptionFractions:o}}(e);return function(t,e,n){var i=1*(e.options.length-1),o=n.longestOptionFractions>1?1.5:3,s=n.optionTimePercentage/o,r=At(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+s,"% {\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");_t({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 Dt(t,e,n,i,o){var s={};if(n){var r=kt(n,e,i);s={minWidth:"".concat(r>o?r:Math.min(r,o),"px")}}Object.entries(xt(xt({},s),e)||{}).forEach(function(e){var n=Rt(e,2),i=n[0],o=n[1];t.style[i]=o})}function kt(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"),o=document.createElement("span");o.innerText=t,i.appendChild(o);for(var s=0,r=Object.entries(n);s<r.length;s++){var a=Rt(r[s],2),l=a[0],c=a[1];o.style[l]=c}for(var u=0,d=Object.entries(e);u<d.length;u++){var h=Rt(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 Bt(t){return t.map(function(t){return{value:t,width:kt(t)}}).sort(function(t,e){return e.width-t.width}).at(0).value}function Wt(t){return Wt="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},Wt(t)}function Ft(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,Qt(i.key),i)}}function Gt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Gt=function(){return!!t})()}function Vt(){return Vt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Ht(t)););return t}(t,e);if(i){var o=Object.getOwnPropertyDescriptor(i,e);return o.get?o.get.call(arguments.length<3?t:n):o.value}},Vt.apply(null,arguments)}function Ht(t){return Ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ht(t)}function $t(t,e){return $t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},$t(t,e)}function Kt(t,e,n){return(e=Qt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Qt(t){var e=function(t){if("object"!=Wt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Wt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Wt(e)?e:e+""}var zt=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=Ht(e),function(t,e){if(e&&("object"==Wt(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,Gt()?Reflect.construct(e,n||[],Ht(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.querySelectorAll('[cl-type="TEXT_ROLLER"]').forEach(function(e){var n=e.getAttribute("cl-id"),o=t[n];o&&(i?Ut(e,o):function(t,e){var n=e.id,i=document.createElement("span");i.classList.add("outer");var o=Bt(e.options),s=document.createElement("span");s.classList.add("inner"),s.textContent=e.options.at(0)||"Option 1",s.setAttribute("contenteditable","false"),i.appendChild(s);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=xt(xt(xt({},wt),e.styleAttributes),u);Dt(s,d),Dt(i,xt(xt({},jt),{},{borderRadius:s.style["border-radius"]||jt.borderRadius,justifyContent:c["text-align"]||jt.justifyContent}),o,d,parseFloat(c.width)),_t({element:t,html:""}),Dt(t,xt({},Mt)),t.appendChild(i)}(e,o))})}}),Kt(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))}),Kt(e,"manifest",Tt),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&&$t(t,e)}(t,vt),function(t,e){return e&&Ft(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;!function(t,e,n){var i=Vt(Ht(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,o,s;e.applyAutoAdaptiveStyles(n.adaptiveStyles,n.styles),null!==(i=n.content)&&void 0!==i&&i.text&&e.getElement("text")&&(_t({element:e.getElement("text"),html:null===(s=n.content)||void 0===s?void 0:s.text}),e.mergeTagsProcessor.process(e.getElement("text"),n.content.mergeTags,e.getModel().id)),e.processTextRoller(null===(o=n.content)||void 0===o?void 0:o.textrollers)}),this.observeShared(function(){var t,n=e.getProps();e.processTextRoller(null===(t=n.content)||void 0===t?void 0:t.textrollers)})}}])}();Kt(zt,"define",{name:"sys-text",model:Tt.name,manifest:Tt});export{zt as default};window.clComponentClass_SysTextComponent=zt;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claspo/components",
|
|
3
|
-
"version": "1.10.12
|
|
3
|
+
"version": "1.10.12",
|
|
4
4
|
"description": "",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"prebuild": "rm -rf out",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"node": ">=18.16.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@claspo/common": "7.
|
|
22
|
-
"@claspo/renderer": "18.
|
|
21
|
+
"@claspo/common": "7.3.1",
|
|
22
|
+
"@claspo/renderer": "18.8.2"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@babel/core": "^7.27.4",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
|