@claspo/components 1.4.0 → 1.4.1-promo.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
const t={DESKTOP:"desktop",MOBILE:"mobile"};function e(e){return Object.values(t).map((t=>({type:"GROUP",propPath:["adaptiveStyles",t],children:e})))}const n={name:"SysContainerComponent",componentType:"CONTAINER",version:"1.0.0",contextMenuModel:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT",params:{hideForEntryType:"VIEW"}}],floatingControlsModel:e([{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"PARENT_ALIGNMENT",elementProp:"styleAttributes",element:"host"}]),propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType},syncSelectOptions:["SAME_TYPE_CROSS_ENV_WHILE_VALUES_MATCH",null]},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0,displayCondition:function(t){var e;return"VIEW"!==t.component.type||null===(e=t.editorConfig.allowBackdropFilterOnView)||void 0===e||e},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"PADDING"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},displayCondition:function(t){return"VIEW"!==t.component.type||"BUILT_IN"===t.layoutType},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"SWITCH",propPath:["styles","[element=host]","styleAttributes","overflow"],params:{label:"DOCUMENT_OVERFLOW_TITLE",boldLabel:!0,description:"DOCUMENT_OVERFLOW_ENABLED_DESCRIPTION",getValueMapper:{undefined:!1,"":!1,visible:!1,hidden:!0},setValueMapper:{true:"hidden",false:"visible"}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType},syncSelectOptions:["SAME_TYPE_CROSS_ENV_WHILE_VALUES_MATCH",null]},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0,displayCondition:function(t){var e;return"VIEW"!==t.component.type||null===(e=t.editorConfig.allowBackdropFilterOnView)||void 0===e||e},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"PADDING"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},displayCondition:function(t){return"VIEW"!==t.component.type||"BUILT_IN"===t.layoutType},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"SWITCH",propPath:["styles","[element=host]","styleAttributes","overflow"],params:{label:"DOCUMENT_OVERFLOW_TITLE",boldLabel:!0,description:"DOCUMENT_OVERFLOW_ENABLED_DESCRIPTION",getValueMapper:{undefined:!1,"":!1,visible:!1,hidden:!0},setValueMapper:{true:"hidden",false:"visible"}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0},displayCondition:function(t){return"TEASER"!==t.widgetType}}]},events:{dispatch:[],listen:[]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1},displayCondition:function(t){return"TEASER"!==t.widgetType}}]},i18nPropPaths:["handlers,[id],actions,[id],params,link","handlers,[id],actions,[id],params,customData"],props:{styles:[{element:"host",styleAttributes:{overflow:"visible",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:"min-content",height:"auto",minHeight:null,flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,background:"rgba(0, 0, 0, 0.06)"},classes:""}],mobile:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:"min-content",height:"auto",minHeight:null,flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,background:"rgba(0, 0, 0, 0.06)"},classes:""}]}},metaDescription:{icon:"/SysContainerComponent/assets/img/component-icon.svg",label:{en:"Container",ru:"Контейнер",uk:"Контейнер",es:"Envase",fr:"Récipient",de:"Container",it:"Contenitore",pt:"Embalagem",ro:"Container",bg:"Контейнер",cs:"Kontejner",el:"Περιέκτης",nl:"Container",pl:"Kontener",sv:"Behållare",tr:"Konteyner",ar:"الحاوية",zh:"容器",da:"Beholder",he:"קונטיינר",fi:"Säiliö",hi:"कंटेनर",hr:"Kontejner",hu:"Tárhely",id:"Kontainer",ja:"コンテナ",ko:"컨테이너",no:"Container",sk:"Krabica",sl:"Rezervoar",sr:"Kontejner"}},waitForResourcesLoad:!0,resourcesPropPaths:[["adaptiveStyles",":ENV","styleAttributes","background"]],syncEnabled:!0,stylesImitationEnabled:!0},o="cl-";function i(t){return o+t}function r(t){return"cl-"+t}function s(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 l(t=[]){return t.map((t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)})))}function a(t){return a="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},a(t)}function c(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 p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e,n){return(e=function(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const d=p(p({},n),{},{name:"SysColumnComponent",componentType:"COLUMN",preventDraggable:!1,focusParentOnClick:!1,recursiveRemove:!0,version:"1.0.0",props:p(p({},n.props),{},{styles:[{element:"host",styleAttributes:{position:"relative",width:"auto",minWidth:"min-content",height:"100%",borderStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none",flexBasis:"0"},classes:""}],adaptiveStyles:(h=[{element:"host",styleAttributes:{display:"inline-flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1},classes:""}],Object.values(t).reduce(((t,e)=>Object.assign(t,{[e]:l(h)})),{desktop:[],mobile:[]})),content:{size:1}}),propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",params:{mode:"horizontal"},hideSyncSelect:!0},{type:"CONTROL",name:"DISPLAY",propPath:["adaptiveStyles","mobile"],elementProp:"styleAttributes",elementSubProp:"display",element:"host",params:{label:"DOCUMENT_DISPLAY_ON_MOBILE",displayPropertyValue:"inline-flex"}},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"PADDING"},hideSyncSelect:!0}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",params:{mode:"horizontal"},hideSyncSelect:!0},{type:"CONTROL",name:"DISPLAY",elementProp:"styleAttributes",elementSubProp:"display",element:"host",params:{label:"DOCUMENT_DISPLAY_ON_MOBILE",displayPropertyValue:"inline-flex"}},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"PADDING"},hideSyncSelect:!0}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0}}]},floatingControlsModel:e([{type:"CONTROL",name:"COLUMNS_PROPORTIONS",propPath:["content","size"]},{type:"CONTROL",name:"PARENT_ALIGNMENT",elementProp:"styleAttributes",element:"host",params:{mode:"horizontal"}},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]),contextMenuModel:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT",params:{hideForEntryType:"VIEW"}}],metaDescription:{label:{en:"Column",ru:"Колонка",uk:"Колонка",es:"Columna",fr:"Colonne",de:"Spalte",it:"Colonna",pt:"Coluna",ro:"Coloană",bg:"Колона",cs:"Column",el:"Column",nl:"Column",pl:"Column",sv:"Column",tr:"Column",ar:"Column",zh:"Column",da:"Column",he:"Column",fi:"Column",hi:"Column",hr:"Column",hu:"Column",id:"Column",ja:"Column",ko:"Column",no:"Column",sk:"Column",sl:"Column",sr:"Column"}},syncEnabled:!0,stylesImitationEnabled:!0});var h;const m="VIEW",y="MODULE",g="CONTAINER",b="INPUT",E="BUTTON",f="CONSENT",O="COLUMN";var v,T;(T=v||(v={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",T.REQUEST="REQUEST",T.DISPATCH_EVENT="DISPATCH_EVENT",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.SHOW_WIDGET="SHOW_WIDGET",T.OPEN_LINK="OPEN_LINK",T.CLOSE_WIDGET="CLOSE_WIDGET",T.CLICK="CLICK";const S=v;var C,R;class A{static sortActions(t){const e={[S.CLOSE_WIDGET]:-1,[S.OPEN_LINK]:-2,[S.SHOW_WIDGET]:1,[S.SUBSCRIBE_CONTACT]:2,[S.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=A.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,n){this.state=t;const o=n(),i=o.getAttribute(r("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(r("type"))));let n=0;for(;e[n]&&e[n].getAttribute(r("id"))!==i;){let t=e[n].getAttribute(r("type"));if(A.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;n++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((o.shadowRoot||o).querySelectorAll(this.config.relativeSelector)):[o],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,o;try{for(var 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=[])}}A.IGNORING_VIEW_ENTRY_TYPES=[E,f,b],(R=C||(C={})).CLICK="CLICK",R.COMPONENT_EVENT="COMPONENT_EVENT";class N{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class _{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 C.CLICK:return new A(t,e);case C.COMPONENT_EVENT:return new N(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class L{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 P{constructor(){this.listeners=P.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=L.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=P.createDefaultListenersState()}}P.createDefaultListenersState=()=>({"*":{}});const I=P,D=(t,e,n,o)=>{const i=EventTarget.prototype,{addEventListenerBase:r,addEventListener:s}=i;(r||s).call(t,e,n,o)};class M{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class w{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===y?Object.assign(Object.assign({},t),w.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 x,j,B,U,k,W,F,G,H,V,$,K,z;w.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(j=x||(x={})).VIEW="VIEW",j.CONTAINER="CONTAINER",j.TEXT="TEXT",j.INPUT="INPUT",j.BUTTON="BUTTON",j.IMAGE="IMAGE",j.CONSENT="CONSENT",j.COUNTDOWN_TIMER="COUNTDOWN_TIMER",j.PROMO_CODE="PROMO_CODE",j.MULTIPLE_INPUT="MULTIPLE_INPUT",j.VIDEO="VIDEO",j.SLIDER="SLIDER",j.SLIDE="SLIDE",j.SOCIAL="SOCIAL",j.COLUMNS="COLUMNS",j.COLUMN="COLUMN",j.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(B||(B={})).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"}(U||(U={})),function(t){t.SELF="_self",t.BLANK="_blank"}(k||(k={})),(W||(W={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(F||(F={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(G||(G={})),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"}(H||(H={})),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"}(V||(V={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}($||($={})),(z=K||(K={})).BEFORE="BEFORE",z.AFTER="AFTER",z.INSIDE="INSIDE",z.INSTEAD="INSTEAD";class Y extends I{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(Y.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(Y.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(Y.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}Y.changeEventName="CHANGE";const Q=Y;class X{static set(t,e){const n=t[X.accumulatorPropertyName]||{};t[X.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[X.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}X.accumulatorPropertyName="clStyleAttributes";const J=X;var Z;!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"}(Z||(Z={}));class q{static applyHostStyles(t,e,n=null,o){var i,r,s;const l=null===(r=null===(i=null==n?void 0:n.props)||void 0===i?void 0:i.handlers)||void 0===r?void 0:r.find((t=>"CLICK"===t.type));l&&(null===(s=l.actions)||void 0===s?void 0:s.length)&&(e.style.cursor="pointer"),t!==m&&t!==g&&t!==O||(e.style.display=o===Z.CONTENT_LOCKER&&t===m?"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 tt{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class et{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,l;const a=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)))||{},p=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),u=this.parseBackground(p);u.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:u.url,inlineSvgString:null,positionOptions:u.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),tt.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 nt=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 ot(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class it{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}}class rt{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 st;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.EXECUTE_ACTION_BY_PREDICATE="EXECUTE_ACTION_BY_PREDICATE"}(st||(st={}));const lt=st;class at{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(lt.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(lt.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 rt(this.onCounterStateUpdate)}}}const ct=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>ct(...t)}},pt=ct,ut="props",dt="shared",ht="environment";function mt(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 yt="SUBMIT";function gt(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}function bt(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}class Et extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}var ft;!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(ft||(ft={}));class Ot extends HTMLElement{constructor(){var t;super(),this.skipGameBlur=!0,this.construct=()=>{let t;const e=this.getAttribute(r("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const o=n.closest(`[${r("widget-id")}]`);let i;o&&(i=o.getAttribute(r("widget-id")));let s=new Et("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(r("path")),id:e,widgetId:i},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.detail.props,Object.assign(this,t),this.observers=pt(ut,dt,ht),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 M({}),this.componentEventEmitter=new I,this.componentResourceManager=new at(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new _(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(ut).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),n=r("floating");t.floating&&!e.getAttribute(n)?e.setAttribute(n,"true"):!t.floating&&e.getAttribute(n)&&e.removeAttribute(n)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(dt).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new et(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),nt),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(Q.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(ht).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")===ft.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===ft.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(ut).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(dt).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(ht).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${r("element")}]`)).filter((t=>!t.hasAttribute(r("component"))))],this.getElement=(t,e)=>this.getElements().find((n=>e?n.getAttribute(r("element"))===t&&n.id===e:n.getAttribute(r("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const n=this.getElements();if(!n.length)return;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 o=!1,i=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(gt(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(gt(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),i=r("type"),l="element-styles";let a=this.getRootElement().querySelector(`style[${i}="${l}"]`);a||(a=document.createElement("style"),a.setAttribute(i,l),this.getRootElement().appendChild(a)),bt({element:a,html:""}),n.forEach((t=>{let e=t.getAttribute(r("element"));const n=this.getEnvironment();let i=s(o,n,e);if(i){if(this.resizeListener.isMobile()){const t=s(o,"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,n)=>{var o,i;const s=[];"host"===(e=Ot._resolveTogglableStylesForElementModel(e)).element&&(q.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.push("background")));let l=e.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],D(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),D(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:ot(e.styleAttributes,s)});if(J.set(t,c),this._setClassAttributes(t,e),n){if(e.hoverStyleAttributes){let o=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const n=t.tagName.toLowerCase(),i=`flip-up-animation-${e.element}`;let r=this.getRootElement().querySelector(`#${i}`);r||(r=document.createElement("style"),r.id=i,t.appendChild(r)),bt({element:r,html:`\n ${n}::before {\n content: '';\n background: ${o.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),o=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}o.borderTopWidth&&"0px"!==o.borderTopWidth||delete o.borderTopColor,o.borderBottomWidth&&"0px"!==o.borderBottomWidth||delete o.borderBottomColor,o.borderLeftWidth&&"0px"!==o.borderLeftWidth||delete o.borderLeftColor,o.borderRightWidth&&"0px"!==o.borderRightWidth||delete o.borderRightColor,this._addStylesToStyleElement(n,e.element,o,`:not(.${r("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(n,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(n,this.getShared()),this.stylesAppliedToElement(t,e,n)}},this.applySharedClassesToElementModel=t=>function(t,e){let n=t;return(n.classes||"").split(" ").filter((t=>t.startsWith(o))).forEach((t=>{var o;let i=null===(o=e.textClasses)||void 0===o?void 0:o[t];i&&(i.styleAttributes.fontFamily||(i.isHeader&&e.headerFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:e.headerFontFamily})})),!i.isHeader&&e.textFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:e.textFontFamily})}))),n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),i.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},n.placeholderStyleAttributes),i.placeholderStyleAttributes)}))})),n.styleAttributes.fontFamily||(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:e.textFontFamily})})),n}(t,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,n,o="",i)=>{const s=Object.keys(n).reduce(((t,e)=>t+` ${it.camelCaseToDashCase(e)}: ${n[e]}${i?" !important;":";"}`),"");bt({element:t,html:`[${r("element")}="${e}"]${o} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{bt({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,i,r;e.linkColor&&bt({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)&&bt({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)&&bt({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(t,e)=>{Array.from(t.classList).filter((t=>t!==i("hovered")&&t!==i("focused"))).forEach((e=>{e.startsWith(o)&&t.classList.remove(e)}));const n=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",n)},this.getParentComponent=()=>mt(this.parentNode,r("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(r("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:mt(this.parentNode,r("path"),void 0,(t=>1===(null==t?void 0:t.split(",").length)))},this.getWidgetLanguages=()=>function(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n,o,i,r,s;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===(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===yt));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:S.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===(t=this.constructor.define)||void 0===t?void 0:t.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()}}Ot._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=Ot._resolveTogglableStyles(e[t]))})),e},Ot._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=Ot;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 St(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,Pt(o.key),o)}}function Ct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ct=function(){return!!t})()}function Rt(t,e,n,o){var i=At(Nt(1&o?t.prototype:t),e,n);return 2&o&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function At(){return At="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Nt(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}},At.apply(null,arguments)}function Nt(t){return Nt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Nt(t)}function _t(t,e){return _t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_t(t,e)}function Lt(t,e,n){return(e=Pt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pt(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 It=function(){function t(){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return Lt(e=function(t,e,n){return e=Nt(e),function(t,e){if(e&&("object"==Tt(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,Ct()?Reflect.construct(e,n||[],Nt(t).constructor):e.apply(t,n))}(this,t,[].concat(o)),"manifest",{name:"SysContainerComponent"}),Lt(e,"getComponentName",(function(){return e.manifest.name})),Lt(e,"processStyles",(function(){e.innerHTML+='\n <style>\n [cl-component="'.concat(e.getComponentName(),'"] {\n position: relative;\n min-width: 50px;\n min-height: 50px;\n }\n </style>')})),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&&St(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;Rt(t,"connectedCallback",this,3)([]),this.processStyles(),this.observeProps((function(t,n){e.applyAutoAdaptiveStyles(n.adaptiveStyles,n.styles)}))}},{key:"disconnectedCallback",value:function(){Rt(t,"disconnectedCallback",this,3)([])}}])}();function Dt(t){return Dt="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},Dt(t)}function Mt(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 wt(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,Ft(o.key),o)}}function xt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(xt=function(){return!!t})()}function jt(t,e,n,o){var i=Bt(Ut(1&o?t.prototype:t),e,n);return 2&o&&"function"==typeof i?function(t){return i.apply(n,t)}:i}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=Ut(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 Ut(t){return Ut=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ut(t)}function kt(t,e){return kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kt(t,e)}function Wt(t,e,n){return(e=Ft(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ft(t){var e=function(t){if("object"!=Dt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Dt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Dt(e)?e:e+""}var Gt=function(){function t(){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return Wt(e=function(t,e,n){return e=Ut(e),function(t,e){if(e&&("object"==Dt(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,xt()?Reflect.construct(e,n||[],Ut(t).constructor):e.apply(t,n))}(this,t,[].concat(o)),"updateResponsiveStyles",(function(){var t,n,o=null===(t=e.getParentComponent())||void 0===t||null===(t=t.getProps())||void 0===t?void 0:t.isResponsive,i=(n=e.shadowRoot.children,function(t){if(Array.isArray(t))return Mt(t)}(n)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,e){if(t){if("string"==typeof t)return Mt(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)?Mt(t,e):void 0}}(n)||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.")}()).filter((function(t){return t.hasAttribute("cl-element")})),r=e.getHostElement().style;i.length?r.minWidth="min-content":(["paddingTop","paddingBottom","paddingLeft","paddingRight","padding"].map((function(t){return r[t]})).map((function(t){return t&&parseFloat(t)})).some(Boolean)&&(r.minWidth="min-content"),r.minWidth="20px"),"mobile"===e.getEnvironment()&&o&&(i.length?r.minHeight="auto":r.background.includes("url")?r.minHeight="150px":i.length||(r.minHeight="50px"))})),Wt(e,"updateEmptyState",(function(){var t=!(Array.from(e.getRootElement().children).filter((function(t){return"STYLE"!==t.tagName&&"SCRIPT"!==t.tagName}))||[]).length;e.setAttribute(r("empty"),t)})),Wt(e,"watchChildren",(function(){var t=e;e.mutationObserver=new MutationObserver((function(){t.updateEmptyState(),t.updateResponsiveStyles()})),e.mutationObserver.observe(e.getRootElement(),{childList:!0})})),Wt(e,"processSize",(function(t){var n,o="flexGrow",i=null!==(n=null!=t?t:e.style[o])&&void 0!==n?n:"1";e.style[o]=i})),Wt(e,"processStyles",(function(){e.innerHTML+='\n <style>\n [cl-component="'.concat(e.getComponentName(),'"] {\n position: relative;\n min-width: 50px;\n min-height: 50px;\n }\n </style>')})),Wt(e,"manifest",d),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&&kt(t,e)}(t,It),function(t,e){return e&&wt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e,n=this;jt(t,"connectedCallback",this,3)([]),this.updateEmptyState(),this.watchChildren(),this.observeEnvironment((function(){n.updateResponsiveStyles()})),this.observeProps((function(t,e){var o;n.updateResponsiveStyles(),n.processSize(null===(o=e.content)||void 0===o?void 0:o.size)})),null===(e=this.getParentComponent())||void 0===e||e.observeProps((function(){n.updateResponsiveStyles()}))}},{key:"disconnectedCallback",value:function(){var e;jt(t,"disconnectedCallback",this,3)([]),null===(e=this.mutationObserver)||void 0===e||e.disconnect()}}])}();Wt(Gt,"define",{name:"sys-column",model:d.name,manifest:d});export{Gt as default};window.clComponentClass_SysColumnComponent=Gt;
|
|
1
|
+
const t={DESKTOP:"desktop",MOBILE:"mobile"};function e(e){return Object.values(t).map((t=>({type:"GROUP",propPath:["adaptiveStyles",t],children:e})))}const n={name:"SysContainerComponent",componentType:"CONTAINER",version:"1.0.0",contextMenuModel:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT",params:{hideForEntryType:"VIEW"}}],floatingControlsModel:e([{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"PARENT_ALIGNMENT",elementProp:"styleAttributes",element:"host"}]),propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType},syncSelectOptions:["SAME_TYPE_CROSS_ENV_WHILE_VALUES_MATCH",null]},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0,displayCondition:function(t){var e;return"VIEW"!==t.component.type||null===(e=t.editorConfig.allowBackdropFilterOnView)||void 0===e||e},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"PADDING"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},displayCondition:function(t){return"VIEW"!==t.component.type||"BUILT_IN"===t.layoutType},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"SWITCH",propPath:["styles","[element=host]","styleAttributes","overflow"],params:{label:"DOCUMENT_OVERFLOW_TITLE",boldLabel:!0,description:"DOCUMENT_OVERFLOW_ENABLED_DESCRIPTION",getValueMapper:{undefined:!1,"":!1,visible:!1,hidden:!0},setValueMapper:{true:"hidden",false:"visible"}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType},syncSelectOptions:["SAME_TYPE_CROSS_ENV_WHILE_VALUES_MATCH",null]},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0,displayCondition:function(t){var e;return"VIEW"!==t.component.type||null===(e=t.editorConfig.allowBackdropFilterOnView)||void 0===e||e},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"PADDING"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"},displayCondition:function(t){return"VIEW"!==t.component.type||"BUILT_IN"===t.layoutType},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"SWITCH",propPath:["styles","[element=host]","styleAttributes","overflow"],params:{label:"DOCUMENT_OVERFLOW_TITLE",boldLabel:!0,description:"DOCUMENT_OVERFLOW_ENABLED_DESCRIPTION",getValueMapper:{undefined:!1,"":!1,visible:!1,hidden:!0},setValueMapper:{true:"hidden",false:"visible"}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0},displayCondition:function(t){return"TEASER"!==t.widgetType}}]},events:{dispatch:[],listen:[]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1},displayCondition:function(t){return"TEASER"!==t.widgetType}}]},i18nPropPaths:["handlers,[id],actions,[id],params,link","handlers,[id],actions,[id],params,customData"],props:{styles:[{element:"host",styleAttributes:{overflow:"visible",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:"min-content",height:"auto",minHeight:null,flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,background:"rgba(0, 0, 0, 0.06)"},classes:""}],mobile:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:"min-content",height:"auto",minHeight:null,flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,background:"rgba(0, 0, 0, 0.06)"},classes:""}]}},metaDescription:{icon:"/SysContainerComponent/assets/img/component-icon.svg",label:{en:"Container",ru:"Контейнер",uk:"Контейнер",es:"Envase",fr:"Récipient",de:"Container",it:"Contenitore",pt:"Embalagem",ro:"Container",bg:"Контейнер",cs:"Kontejner",el:"Περιέκτης",nl:"Container",pl:"Kontener",sv:"Behållare",tr:"Konteyner",ar:"الحاوية",zh:"容器",da:"Beholder",he:"קונטיינר",fi:"Säiliö",hi:"कंटेनर",hr:"Kontejner",hu:"Tárhely",id:"Kontainer",ja:"コンテナ",ko:"컨테이너",no:"Container",sk:"Krabica",sl:"Rezervoar",sr:"Kontejner"}},waitForResourcesLoad:!0,resourcesPropPaths:[["adaptiveStyles",":ENV","styleAttributes","background"]],syncEnabled:!0,stylesImitationEnabled:!0},o="cl-";function i(t){return o+t}function r(t){return"cl-"+t}function s(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 l(t=[]){return t.map((t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)})))}function a(t){return a="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},a(t)}function c(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 p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?c(Object(n),!0).forEach((function(e){u(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function u(t,e,n){return(e=function(t){var e=function(t){if("object"!=a(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==a(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const d=p(p({},n),{},{name:"SysColumnComponent",componentType:"COLUMN",preventDraggable:!1,focusParentOnClick:!1,recursiveRemove:!0,version:"1.0.0",props:p(p({},n.props),{},{styles:[{element:"host",styleAttributes:{position:"relative",width:"auto",minWidth:"min-content",height:"100%",borderStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none",flexBasis:"0"},classes:""}],adaptiveStyles:(h=[{element:"host",styleAttributes:{display:"inline-flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"10px",paddingTop:"10px",paddingBottom:"10px",paddingLeft:"10px",paddingRight:"10px",_paddingEnabled:!0,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1},classes:""}],Object.values(t).reduce(((t,e)=>Object.assign(t,{[e]:l(h)})),{desktop:[],mobile:[]})),content:{size:1}}),propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",params:{hideDirectionControl:!0},hideSyncSelect:!0},{type:"CONTROL",name:"DISPLAY",propPath:["adaptiveStyles","mobile"],elementProp:"styleAttributes",elementSubProp:"display",element:"host",params:{label:"DOCUMENT_DISPLAY_ON_MOBILE",displayPropertyValue:"inline-flex"}},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"PADDING"},hideSyncSelect:!0}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",params:{hideDirectionControl:!0},hideSyncSelect:!0},{type:"CONTROL",name:"DISPLAY",elementProp:"styleAttributes",elementSubProp:"display",element:"host",params:{label:"DOCUMENT_DISPLAY_ON_MOBILE",displayPropertyValue:"inline-flex"}},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"PADDING"},hideSyncSelect:!0}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0}}]},floatingControlsModel:e([{type:"CONTROL",name:"COLUMNS_PROPORTIONS",propPath:["content","size"]},{type:"CONTROL",name:"PARENT_ALIGNMENT",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]),contextMenuModel:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT",params:{hideForEntryType:"VIEW"}}],metaDescription:{label:{en:"Column",ru:"Колонка",uk:"Колонка",es:"Columna",fr:"Colonne",de:"Spalte",it:"Colonna",pt:"Coluna",ro:"Coloană",bg:"Колона",cs:"Column",el:"Column",nl:"Column",pl:"Column",sv:"Column",tr:"Column",ar:"Column",zh:"Column",da:"Column",he:"Column",fi:"Column",hi:"Column",hr:"Column",hu:"Column",id:"Column",ja:"Column",ko:"Column",no:"Column",sk:"Column",sl:"Column",sr:"Column"}},syncEnabled:!0,stylesImitationEnabled:!0});var h;const m="VIEW",y="MODULE",g="CONTAINER",b="INPUT",E="BUTTON",f="CONSENT",O="COLUMN";var v,T;(T=v||(v={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",T.REQUEST="REQUEST",T.DISPATCH_EVENT="DISPATCH_EVENT",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.SHOW_WIDGET="SHOW_WIDGET",T.OPEN_LINK="OPEN_LINK",T.CLOSE_WIDGET="CLOSE_WIDGET",T.CLICK="CLICK";const S=v;var C,R;class A{static sortActions(t){const e={[S.CLOSE_WIDGET]:-1,[S.OPEN_LINK]:-2,[S.SHOW_WIDGET]:1,[S.SUBSCRIBE_CONTACT]:2,[S.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=A.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,n){this.state=t;const o=n(),i=o.getAttribute(r("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(r("type"))));let n=0;for(;e[n]&&e[n].getAttribute(r("id"))!==i;){let t=e[n].getAttribute(r("type"));if(A.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;n++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((o.shadowRoot||o).querySelectorAll(this.config.relativeSelector)):[o],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,n,o;try{for(var 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=[])}}A.IGNORING_VIEW_ENTRY_TYPES=[E,f,b],(R=C||(C={})).CLICK="CLICK",R.COMPONENT_EVENT="COMPONENT_EVENT";class N{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class _{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 C.CLICK:return new A(t,e);case C.COMPONENT_EVENT:return new N(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class L{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 P{constructor(){this.listeners=P.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=L.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=P.createDefaultListenersState()}}P.createDefaultListenersState=()=>({"*":{}});const I=P,D=(t,e,n,o)=>{const i=EventTarget.prototype,{addEventListenerBase:r,addEventListener:s}=i;(r||s).call(t,e,n,o)};class M{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class w{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===y?Object.assign(Object.assign({},t),w.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 x,j,B,U,k,W,F,G,H,V,$,K,z;w.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(j=x||(x={})).VIEW="VIEW",j.CONTAINER="CONTAINER",j.TEXT="TEXT",j.INPUT="INPUT",j.BUTTON="BUTTON",j.IMAGE="IMAGE",j.CONSENT="CONSENT",j.COUNTDOWN_TIMER="COUNTDOWN_TIMER",j.PROMO_CODE="PROMO_CODE",j.MULTIPLE_INPUT="MULTIPLE_INPUT",j.VIDEO="VIDEO",j.SLIDER="SLIDER",j.SLIDE="SLIDE",j.SOCIAL="SOCIAL",j.COLUMNS="COLUMNS",j.COLUMN="COLUMN",j.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(B||(B={})).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"}(U||(U={})),function(t){t.SELF="_self",t.BLANK="_blank"}(k||(k={})),(W||(W={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(F||(F={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(G||(G={})),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"}(H||(H={})),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"}(V||(V={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}($||($={})),(z=K||(K={})).BEFORE="BEFORE",z.AFTER="AFTER",z.INSIDE="INSIDE",z.INSTEAD="INSTEAD";class Y extends I{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(Y.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(Y.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(Y.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}Y.changeEventName="CHANGE";const Q=Y;class X{static set(t,e){const n=t[X.accumulatorPropertyName]||{};t[X.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[X.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}X.accumulatorPropertyName="clStyleAttributes";const J=X;var Z;!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"}(Z||(Z={}));class q{static applyHostStyles(t,e,n=null,o){var i,r,s;const l=null===(r=null===(i=null==n?void 0:n.props)||void 0===i?void 0:i.handlers)||void 0===r?void 0:r.find((t=>"CLICK"===t.type));l&&(null===(s=l.actions)||void 0===s?void 0:s.length)&&(e.style.cursor="pointer"),t!==m&&t!==g&&t!==O||(e.style.display=o===Z.CONTENT_LOCKER&&t===m?"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 tt{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class et{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,l;const a=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)))||{},p=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),u=this.parseBackground(p);u.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:u.url,inlineSvgString:null,positionOptions:u.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),tt.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 nt=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 ot(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class it{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}}class rt{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 st;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.EXECUTE_ACTION_BY_PREDICATE="EXECUTE_ACTION_BY_PREDICATE"}(st||(st={}));const lt=st;class at{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(lt.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(lt.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 rt(this.onCounterStateUpdate)}}}const ct=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>ct(...t)}},pt=ct,ut="props",dt="shared",ht="environment";function mt(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 yt="SUBMIT";function gt(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}function bt(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}class Et extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}var ft;!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(ft||(ft={}));class Ot extends HTMLElement{constructor(){var t;super(),this.skipGameBlur=!0,this.construct=()=>{let t;const e=this.getAttribute(r("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const o=n.closest(`[${r("widget-id")}]`);let i;o&&(i=o.getAttribute(r("widget-id")));let s=new Et("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(r("path")),id:e,widgetId:i},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.detail.props,Object.assign(this,t),this.observers=pt(ut,dt,ht),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 M({}),this.componentEventEmitter=new I,this.componentResourceManager=new at(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new _(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(ut).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),n=r("floating");t.floating&&!e.getAttribute(n)?e.setAttribute(n,"true"):!t.floating&&e.getAttribute(n)&&e.removeAttribute(n)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(dt).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new et(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),nt),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(Q.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(ht).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")===ft.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===ft.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(ut).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(dt).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(ht).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${r("element")}]`)).filter((t=>!t.hasAttribute(r("component"))))],this.getElement=(t,e)=>this.getElements().find((n=>e?n.getAttribute(r("element"))===t&&n.id===e:n.getAttribute(r("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const n=this.getElements();if(!n.length)return;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 o=!1,i=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(gt(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(gt(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),i=r("type"),l="element-styles";let a=this.getRootElement().querySelector(`style[${i}="${l}"]`);a||(a=document.createElement("style"),a.setAttribute(i,l),this.getRootElement().appendChild(a)),bt({element:a,html:""}),n.forEach((t=>{let e=t.getAttribute(r("element"));const n=this.getEnvironment();let i=s(o,n,e);if(i){if(this.resizeListener.isMobile()){const t=s(o,"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,n)=>{var o,i;const s=[];"host"===(e=Ot._resolveTogglableStylesForElementModel(e)).element&&(q.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.push("background")));let l=e.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],D(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),D(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:ot(e.styleAttributes,s)});if(J.set(t,c),this._setClassAttributes(t,e),n){if(e.hoverStyleAttributes){let o=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const n=t.tagName.toLowerCase(),i=`flip-up-animation-${e.element}`;let r=this.getRootElement().querySelector(`#${i}`);r||(r=document.createElement("style"),r.id=i,t.appendChild(r)),bt({element:r,html:`\n ${n}::before {\n content: '';\n background: ${o.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),o=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}o.borderTopWidth&&"0px"!==o.borderTopWidth||delete o.borderTopColor,o.borderBottomWidth&&"0px"!==o.borderBottomWidth||delete o.borderBottomColor,o.borderLeftWidth&&"0px"!==o.borderLeftWidth||delete o.borderLeftColor,o.borderRightWidth&&"0px"!==o.borderRightWidth||delete o.borderRightColor,this._addStylesToStyleElement(n,e.element,o,`:not(.${r("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(n,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(n,this.getShared()),this.stylesAppliedToElement(t,e,n)}},this.applySharedClassesToElementModel=t=>function(t,e){let n=t;return(n.classes||"").split(" ").filter((t=>t.startsWith(o))).forEach((t=>{var o;let i=null===(o=e.textClasses)||void 0===o?void 0:o[t];i&&(i.styleAttributes.fontFamily||(i.isHeader&&e.headerFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:e.headerFontFamily})})),!i.isHeader&&e.textFontFamily&&(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:e.textFontFamily})}))),n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),i.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},n.placeholderStyleAttributes),i.placeholderStyleAttributes)}))})),n.styleAttributes.fontFamily||(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:e.textFontFamily})})),n}(t,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,n,o="",i)=>{const s=Object.keys(n).reduce(((t,e)=>t+` ${it.camelCaseToDashCase(e)}: ${n[e]}${i?" !important;":";"}`),"");bt({element:t,html:`[${r("element")}="${e}"]${o} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{bt({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,i,r;e.linkColor&&bt({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)&&bt({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)&&bt({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(t,e)=>{Array.from(t.classList).filter((t=>t!==i("hovered")&&t!==i("focused"))).forEach((e=>{e.startsWith(o)&&t.classList.remove(e)}));const n=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",n)},this.getParentComponent=()=>mt(this.parentNode,r("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(r("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:mt(this.parentNode,r("path"),void 0,(t=>1===(null==t?void 0:t.split(",").length)))},this.getWidgetLanguages=()=>function(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n,o,i,r,s;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===(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===yt));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:S.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===(t=this.constructor.define)||void 0===t?void 0:t.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()}}Ot._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=Ot._resolveTogglableStyles(e[t]))})),e},Ot._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=Ot;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 St(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,Pt(o.key),o)}}function Ct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Ct=function(){return!!t})()}function Rt(t,e,n,o){var i=At(Nt(1&o?t.prototype:t),e,n);return 2&o&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function At(){return At="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Nt(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}},At.apply(null,arguments)}function Nt(t){return Nt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Nt(t)}function _t(t,e){return _t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_t(t,e)}function Lt(t,e,n){return(e=Pt(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pt(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 It=function(){function t(){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return Lt(e=function(t,e,n){return e=Nt(e),function(t,e){if(e&&("object"==Tt(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,Ct()?Reflect.construct(e,n||[],Nt(t).constructor):e.apply(t,n))}(this,t,[].concat(o)),"manifest",{name:"SysContainerComponent"}),Lt(e,"getComponentName",(function(){return e.manifest.name})),Lt(e,"processStyles",(function(){e.innerHTML+='\n <style>\n [cl-component="'.concat(e.getComponentName(),'"] {\n position: relative;\n min-width: 50px;\n min-height: 50px;\n }\n </style>')})),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&&St(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;Rt(t,"connectedCallback",this,3)([]),this.processStyles(),this.observeProps((function(t,n){e.applyAutoAdaptiveStyles(n.adaptiveStyles,n.styles)}))}},{key:"disconnectedCallback",value:function(){Rt(t,"disconnectedCallback",this,3)([])}}])}();function Dt(t){return Dt="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},Dt(t)}function Mt(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 wt(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,Ft(o.key),o)}}function xt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(xt=function(){return!!t})()}function jt(t,e,n,o){var i=Bt(Ut(1&o?t.prototype:t),e,n);return 2&o&&"function"==typeof i?function(t){return i.apply(n,t)}:i}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=Ut(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 Ut(t){return Ut=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ut(t)}function kt(t,e){return kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},kt(t,e)}function Wt(t,e,n){return(e=Ft(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ft(t){var e=function(t){if("object"!=Dt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Dt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Dt(e)?e:e+""}var Gt=function(){function t(){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return Wt(e=function(t,e,n){return e=Ut(e),function(t,e){if(e&&("object"==Dt(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,xt()?Reflect.construct(e,n||[],Ut(t).constructor):e.apply(t,n))}(this,t,[].concat(o)),"updateResponsiveStyles",(function(){var t,n,o=null===(t=e.getParentComponent())||void 0===t||null===(t=t.getProps())||void 0===t?void 0:t.isResponsive,i=(n=e.shadowRoot.children,function(t){if(Array.isArray(t))return Mt(t)}(n)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t,e){if(t){if("string"==typeof t)return Mt(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)?Mt(t,e):void 0}}(n)||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.")}()).filter((function(t){return t.hasAttribute("cl-element")})),r=e.getHostElement().style;i.length?r.minWidth="min-content":(["paddingTop","paddingBottom","paddingLeft","paddingRight","padding"].map((function(t){return r[t]})).map((function(t){return t&&parseFloat(t)})).some(Boolean)&&(r.minWidth="min-content"),r.minWidth="20px"),"mobile"===e.getEnvironment()&&o&&(i.length?r.minHeight="auto":r.background.includes("url")?r.minHeight="150px":i.length||(r.minHeight="50px"))})),Wt(e,"updateEmptyState",(function(){var t=!(Array.from(e.getRootElement().children).filter((function(t){return"STYLE"!==t.tagName&&"SCRIPT"!==t.tagName}))||[]).length;e.setAttribute(r("empty"),t)})),Wt(e,"watchChildren",(function(){var t=e;e.mutationObserver=new MutationObserver((function(){t.updateEmptyState(),t.updateResponsiveStyles()})),e.mutationObserver.observe(e.getRootElement(),{childList:!0})})),Wt(e,"processSize",(function(t){var n,o="flexGrow",i=null!==(n=null!=t?t:e.style[o])&&void 0!==n?n:"1";e.style[o]=i})),Wt(e,"processStyles",(function(){e.innerHTML+='\n <style>\n [cl-component="'.concat(e.getComponentName(),'"] {\n position: relative;\n min-width: 50px;\n min-height: 50px;\n }\n </style>')})),Wt(e,"manifest",d),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&&kt(t,e)}(t,It),function(t,e){return e&&wt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e,n=this;jt(t,"connectedCallback",this,3)([]),this.updateEmptyState(),this.watchChildren(),this.observeEnvironment((function(){n.updateResponsiveStyles()})),this.observeProps((function(t,e){var o;n.updateResponsiveStyles(),n.processSize(null===(o=e.content)||void 0===o?void 0:o.size)})),null===(e=this.getParentComponent())||void 0===e||e.observeProps((function(){n.updateResponsiveStyles()}))}},{key:"disconnectedCallback",value:function(){var e;jt(t,"disconnectedCallback",this,3)([]),null===(e=this.mutationObserver)||void 0===e||e.disconnect()}}])}();Wt(Gt,"define",{name:"sys-column",model:d.name,manifest:d});export{Gt as default};window.clComponentClass_SysColumnComponent=Gt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=(t,e,n,i)=>{const o=EventTarget.prototype,{addEventListenerBase:s,addEventListener:r}=o;(s||r).call(t,e,n,i)},e={name:"SysImageComponent",componentType:"IMAGE",version:"1.0.0",contextMenuModel:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}],floatingControlsModel:(n=[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host",params:{rotation:{elementProp:"styleAttributes",element:"host"}}},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"ROTATION",elementProp:"styleAttributes",element:"host"}],Object.values({DESKTOP:"desktop",MOBILE:"mobile"}).map((t=>({type:"GROUP",propPath:["adaptiveStyles",t],children:n})))),propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"RADIO_BUTTONS",elementProp:"styleAttributes",elementSubProp:"objectFit",element:"image",params:{label:"DOCUMENT_IMAGE",options:[{label:"DOCUMENT_IMAGE_RESIZE_COVER",value:"cover"},{label:"DOCUMENT_IMAGE_RESIZE_CONTAIN",value:"contain"},{label:"DOCUMENT_IMAGE_RESIZE_NONE",value:"none"}]},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"IMAGE_SOURCES",element:"image",propPath:["control","imageSource"]},{type:"CONTROL",name:"FLOATING_COMPONENT_POSITION",element:"host",elementProp:"styleAttributes",displayCondition:function(t){return!!t.component.getProps().floating&&!t.component.getProps().control.positioning},params:{label:"DOCUMENT_POSITION"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"DISPLAY",elementProp:"styleAttributes",elementSubProp:"display",element:"host",params:{label:"DOCUMENT_DISPLAY_ON_DESKTOP"}},{type:"CONTROL",name:"DISPLAY",propPath:["adaptiveStyles","mobile"],elementProp:"styleAttributes",elementSubProp:"display",element:"host",params:{label:"DOCUMENT_DISPLAY_ON_MOBILE"}},{type:"CONTROL",name:"BORDER_RADIUS",elementProp:"styleAttributes",element:"image",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",displayCondition:function(t){return!t.component.getProps().floating},params:{indentationType:"PADDING"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",displayCondition:function(t){return!t.component.getProps().floating},params:{indentationType:"MARGIN"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"RADIO_BUTTONS",elementProp:"styleAttributes",elementSubProp:"objectFit",element:"image",params:{label:"DOCUMENT_IMAGE",options:[{label:"DOCUMENT_IMAGE_RESIZE_COVER",value:"cover"},{label:"DOCUMENT_IMAGE_RESIZE_CONTAIN",value:"contain"},{label:"DOCUMENT_IMAGE_RESIZE_NONE",value:"none"}]},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"IMAGE_SOURCES",element:"image",propPath:["control","imageSource"]},{type:"CONTROL",name:"FLOATING_COMPONENT_POSITION",element:"host",elementProp:"styleAttributes",displayCondition:function(t){return!!t.component.getProps().floating&&!t.component.getProps().control.positioning},params:{label:"DOCUMENT_POSITION"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"DISPLAY",elementProp:"styleAttributes",elementSubProp:"display",element:"host",params:{label:"DOCUMENT_DISPLAY_ON_MOBILE"}},{type:"CONTROL",name:"BORDER_RADIUS",elementProp:"styleAttributes",element:"image",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",displayCondition:function(t){return!t.component.getProps().floating},params:{indentationType:"PADDING"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",displayCondition:function(t){return!t.component.getProps().floating},params:{indentationType:"MARGIN"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0},displayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"TEXT_INPUT",propPath:["control","altText"],params:{label:"DOCUMENT_IMAGE_ALT_TEXT",tooltip:"DOCUMENT_IMAGE_ALT_TEXT_TOOLTIP"}}]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1},displayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"TEXT_INPUT",propPath:["control","altText"],params:{label:"DOCUMENT_IMAGE_ALT_TEXT",tooltip:"DOCUMENT_IMAGE_ALT_TEXT_TOOLTIP"}}]},i18nPropPaths:["handlers,[id],actions,[id],params,link","handlers,[id],actions,[id],params,customData","control,altText"],events:{dispatch:[],listen:[]},props:{control:{imageSource:{url:""},altText:""},adaptiveStyles:{desktop:[{element:"host",styleAttributes:{width:"150px",minWidth:"150px",height:"auto",minHeight:null,paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,display:"block"},classes:""},{element:"image",styleAttributes:{background:"transparent",objectFit:"cover",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},classes:""}],mobile:[{element:"host",styleAttributes:{width:"150px",minWidth:"150px",height:"auto",minHeight:null,paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,display:"block"},classes:""},{element:"image",styleAttributes:{background:"transparent",objectFit:"cover",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},classes:""}]}},metaDescription:{icon:"/SysImageComponent/assets/img/image-component-icon.svg",label:{en:"Image",ru:"Изображение",uk:"Зображення",es:"Imagen",fr:"Menu déroulant",de:"Bild",it:"Immagine",pt:"Imagem",ro:"Imagine",bg:"Изображение",cs:"Obrázek",el:"Εικόνα",nl:"Afbeelding",pl:"Obraz",sv:"Bild",tr:"Resim",ar:"الصورة",zh:"图像",da:"Billede",he:"תמונה",fi:"Kuva",hi:"इमेज ",hr:"Slika",hu:"Kép",id:"Gambar",ja:"画像",ko:"이미지",no:"Bilde",sk:"Obrázok",sl:"Slika",sr:"Slika"}},waitForResourcesLoad:!0,resourcesPropPaths:[["control","imageSource","url"]],syncEnabled:!0,stylesImitationEnabled:!0};var n;const i="cl-";function o(t){return i+t}function s(t){return"cl-"+t}const r="VIEW",l="MODULE",a="CONTAINER",c="INPUT",u="BUTTON",p="CONSENT",d="COLUMN";var h,m;(m=h||(h={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",m.REQUEST="REQUEST",m.DISPATCH_EVENT="DISPATCH_EVENT",m.GO_TO_VIEW="GO_TO_VIEW",m.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",m.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",m.SHOW_WIDGET="SHOW_WIDGET",m.OPEN_LINK="OPEN_LINK",m.CLOSE_WIDGET="CLOSE_WIDGET",m.CLICK="CLICK";const g=h;var E;class y{static sortActions(t){const e={[g.CLOSE_WIDGET]:-1,[g.OPEN_LINK]:-2,[g.SHOW_WIDGET]:1,[g.SUBSCRIBE_CONTACT]:2,[g.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=y.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,n){this.state=t;const i=n(),o=i.getAttribute(s("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(s("type"))));let n=0;for(;e[n]&&e[n].getAttribute(s("id"))!==o;){let t=e[n].getAttribute(s("type"));if(y.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;n++}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,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=[])}}y.IGNORING_VIEW_ENTRY_TYPES=[u,p,c],function(t){t.CLICK="CLICK",t.COMPONENT_EVENT="COMPONENT_EVENT"}(E||(E={}));class b{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class v{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map((t=>this.actionFactory.get(t)));switch(e.forEach((t=>this.actionRegister.register(t))),t.type){case E.CLICK:return new y(t,e);case E.COMPONENT_EVENT:return new b(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class f{static generate(){let t,e="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class O{constructor(){this.listeners=O.createDefaultListenersState()}emit(t,e,n=null){const i=this.listeners[t];i&&Object.values(i).forEach((i=>i(e,t,n))),Object.values(this.listeners["*"]).forEach((i=>i(e,t,n)))}on(t,e){const n=f.generate(),i=this.listeners[t];return i?i[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,i;(null===(i=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===i?void 0:i[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=O.createDefaultListenersState()}}O.createDefaultListenersState=()=>({"*":{}});const T=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 A{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===l?Object.assign(Object.assign({},t),A.moduleToContainerParams):t));return Object.assign(Object.assign({},t),{children:e})}));return Object.assign(Object.assign({},t),{views:e})}static sort(t,e){return t.index>e.index?1:-1}static reIndex(t,e){return Object.assign(Object.assign({},t),{index:e+t.index})}}var C,_,N,R,I,L,P,M,x,D,w,U,k;A.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(_=C||(C={})).VIEW="VIEW",_.CONTAINER="CONTAINER",_.TEXT="TEXT",_.INPUT="INPUT",_.BUTTON="BUTTON",_.IMAGE="IMAGE",_.CONSENT="CONSENT",_.COUNTDOWN_TIMER="COUNTDOWN_TIMER",_.PROMO_CODE="PROMO_CODE",_.MULTIPLE_INPUT="MULTIPLE_INPUT",_.VIDEO="VIDEO",_.SLIDER="SLIDER",_.SLIDE="SLIDE",_.SOCIAL="SOCIAL",_.COLUMNS="COLUMNS",_.COLUMN="COLUMN",_.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(N||(N={})).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={})),(L||(L={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(P||(P={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(M||(M={})),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"}(x||(x={})),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"}(D||(D={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(w||(w={})),(k=U||(U={})).BEFORE="BEFORE",k.AFTER="AFTER",k.INSIDE="INSIDE",k.INSTEAD="INSTEAD";class B extends T{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 F=B;class j{static set(t,e){const n=t[j.accumulatorPropertyName]||{};t[j.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[j.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}j.accumulatorPropertyName="clStyleAttributes";const G=j;var W;!function(t){t.BUILT_IN="BUILT_IN",t.DETACHED="DETACHED",t.FLOATING_BOX="FLOATING_BOX",t.FLOATING_BAR="FLOATING_BAR",t.LAUNCHER="LAUNCHER",t.CONTENT_LOCKER="CONTENT_LOCKER"}(W||(W={}));class H{static applyHostStyles(t,e,n=null,i){var o,s,l;const c=null===(s=null===(o=null==n?void 0:n.props)||void 0===o?void 0:o.handlers)||void 0===s?void 0:s.find((t=>"CLICK"===t.type));c&&(null===(l=c.actions)||void 0===l?void 0:l.length)&&(e.style.cursor="pointer"),t!==r&&t!==a&&t!==d||(e.style.display=i===W.CONTENT_LOCKER&&t===r?"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 V{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class ${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,l;const a=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===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),p=this.parseBackground(u);p.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:p.url,inlineSvgString:null,positionOptions:p.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((t=>t.text())).then((i=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:i}))}))))).then((()=>{var e;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),V.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 K=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 X{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 Q;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.EXECUTE_ACTION_BY_PREDICATE="EXECUTE_ACTION_BY_PREDICATE"}(Q||(Q={}));const Z=Q;class q{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(Z.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(Z.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 J=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>J(...t)}},tt=J,et="props",nt="shared",it="environment";function ot(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 st="SUBMIT";function rt(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}function lt(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 at(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}class ct extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}var ut;!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(ut||(ut={}));class pt extends HTMLElement{constructor(){var e;super(),this.skipGameBlur=!0,this.construct=()=>{let t;const e=this.getAttribute(s("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const i=n.closest(`[${s("widget-id")}]`);let o;i&&(o=i.getAttribute(s("widget-id")));let r=new ct("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(s("path")),id:e,widgetId:o},{bubbles:!0,composed:!0});this.dispatchEvent(r),t=r.detail.props,Object.assign(this,t),this.observers=tt(et,nt,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 T,this.componentResourceManager=new q(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new v(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(et).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),n=s("floating");t.floating&&!e.getAttribute(n)?e.setAttribute(n,"true"):!t.floating&&e.getAttribute(n)&&e.removeAttribute(n)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(nt).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new $(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),K),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(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")===ut.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===ut.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(et).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(nt).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(`[${s("element")}]`)).filter((t=>!t.hasAttribute(s("component"))))],this.getElement=(t,e)=>this.getElements().find((n=>e?n.getAttribute(s("element"))===t&&n.id===e:n.getAttribute(s("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const n=this.getElements();if(!n.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 i=!1,o=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(rt(n,t),i=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(rt(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),o=s("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)),at({element:l,html:""}),n.forEach((t=>{let e=t.getAttribute(s("element"));const n=this.getEnvironment();let o=lt(i,n,e);if(o){if(this.resizeListener.isMobile()){const t=lt(i,"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=(e,n,i)=>{var o,r;const l=[];"host"===(n=pt._resolveTogglableStylesForElementModel(n)).element&&(H.applyHostStyles(this.model.type,e,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(r=this.model.props.backgroundDynamicInlineSVGElements)||void 0===r?void 0:r.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),l.push("background")));let a=n.styleAttributes.background,c=a&&a.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&c){this.componentResourceManager.getPending().increment();const e=new Image;e.src=c[1],t(e,"load",(()=>{this.componentResourceManager.getPending().decrement()})),t(e,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(e.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const u=Object.assign(Object.assign({},n),{styleAttributes:z(n.styleAttributes,l)});if(G.set(e,u),this._setClassAttributes(e,n),i){if(n.hoverStyleAttributes){let t=Object.assign({},n.hoverStyleAttributes);if("FILL_UP"===n.hoverAnimationType){e.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",e.style.overflow="hidden";const i=e.tagName.toLowerCase(),o=`flip-up-animation-${n.element}`;let s=this.getRootElement().querySelector(`#${o}`);s||(s=document.createElement("style"),s.id=o,e.appendChild(s)),at({element:s,html:`\n ${i}::before {\n content: '';\n background: ${t.background};\n position: absolute;\n left: 0;\n top: ${e.getBoundingClientRect().height}px;\n height: ${e.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${i}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),t=Object.assign(Object.assign({},n.hoverStyleAttributes),{background:"transparent",position:"relative"})}t.borderTopWidth&&"0px"!==t.borderTopWidth||delete t.borderTopColor,t.borderBottomWidth&&"0px"!==t.borderBottomWidth||delete t.borderBottomColor,t.borderLeftWidth&&"0px"!==t.borderLeftWidth||delete t.borderLeftColor,t.borderRightWidth&&"0px"!==t.borderRightWidth||delete t.borderRightColor,this._addStylesToStyleElement(i,n.element,t,`:not(.${s("no-hover")}):hover`,!0)}n.placeholderStyleAttributes&&this._addStylesToStyleElement(i,n.element,n.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(i,this.getShared()),this.stylesAppliedToElement(e,n,i)}},this.applySharedClassesToElementModel=t=>function(t,e){let n=t;return(n.classes||"").split(" ").filter((t=>t.startsWith(i))).forEach((t=>{var i;let o=null===(i=e.textClasses)||void 0===i?void 0:i[t];o&&(o.styleAttributes.fontFamily||(o.isHeader&&e.headerFontFamily&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:e.headerFontFamily})})),!o.isHeader&&e.textFontFamily&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:e.textFontFamily})}))),n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),o.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},n.placeholderStyleAttributes),o.placeholderStyleAttributes)}))})),n.styleAttributes.fontFamily||(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:e.textFontFamily})})),n}(t,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,n,i="",o)=>{const r=Object.keys(n).reduce(((t,e)=>t+` ${X.camelCaseToDashCase(e)}: ${n[e]}${o?" !important;":";"}`),"");at({element:t,html:`[${s("element")}="${e}"]${i} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{at({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,i,o,s;e.linkColor&&at({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)&&at({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)&&at({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(t,e)=>{Array.from(t.classList).filter((t=>t!==o("hovered")&&t!==o("focused"))).forEach((e=>{e.startsWith(i)&&t.classList.remove(e)}));const n=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",n)},this.getParentComponent=()=>ot(this.parentNode,s("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(s("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:ot(this.parentNode,s("path"),void 0,(t=>1===(null==t?void 0:t.split(",").length)))},this.getWidgetLanguages=()=>function(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,n)=>{if(e)return e;const i=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return i||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n,i,o,s,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===(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===st));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:g.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===(e=this.constructor.define)||void 0===e?void 0:e.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()}}pt._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=pt._resolveTogglableStyles(e[t]))})),e},pt._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 dt=pt;function ht(t){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ht(t)}function mt(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ot(i.key),i)}}function gt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(gt=function(){return!!t})()}function Et(t,e,n,i){var o=yt(bt(1&i?t.prototype:t),e,n);return 2&i&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function yt(){return yt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=bt(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}},yt.apply(null,arguments)}function bt(t){return bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bt(t)}function vt(t,e){return vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vt(t,e)}function ft(t,e,n){return(e=Ot(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ot(t){var e=function(t){if("object"!=ht(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ht(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ht(e)?e:e+""}var Tt={TOP:"top",CENTER:"center",BOTTOM:"bottom"},St={LEFT:"left",CENTER:"center",RIGHT:"right"},At={FIXED:"fixed",STICKY:"sticky"},Ct=function(){function e(){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),ft(n=function(t,e,n){return e=bt(e),function(t,e){if(e&&("object"==ht(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,gt()?Reflect.construct(e,n||[],bt(t).constructor):e.apply(t,n))}(this,e),"applyAltText",(function(t){var e,i=n.getElement("image");if(i){var o=(null===(e=t.control)||void 0===e?void 0:e.altText)||"";"IMG"===i.nodeName?i.alt=o:i.setAttribute("aria-label",o)}})),ft(n,"applyStylesRespectingRelativePositioning",(function(){var t=n.processPositioningStyles(n.getProps());n.originalApplyAutoAdaptiveStyles(t),n.fixFloatingImageSize(t)})),ft(n,"recalculateStylesAfterImageLoad",(function(){n.resourcesLoadedListener=n.services.eventEmitter.on("VIEW_COMPONENT_RESOURCES_LOADED",(function(){requestAnimationFrame((function(){n.applyAdaptiveStyles(n.getProps())}))}))})),ft(n,"processPositioningStyles",(function(t){var e,i,o=t.adaptiveStyles;if(((null===(e=t.control)||void 0===e?void 0:e.positioningMode)||At.FIXED)===At.FIXED)return o;var s=n.getEnvironment(),r=(null===(i=t.control)||void 0===i||null===(i=i.positioning)||void 0===i?void 0:i[s])||{},l=(null==r?void 0:r.diff)||{};if(!Boolean("x"in l&&"y"in l))return o;var a=lt(o,s,"host").styleAttributes,c=n._getHostNewDimensionsWithStyles(a),u=c.width,p=c.height,d=z(a,["left","right","top","bottom"]),h=u/2,m=l.x-h;r.horizontalPosition===St.LEFT?(d.left="".concat(m,"px"),d.right="auto"):r.horizontalPosition===St.RIGHT?(d.right="".concat(-u-m,"px"),d.left="auto"):(d.left="calc(50% + ".concat(m,"px)"),d.right="auto");var g=p/2,E=l.y-g;return r.verticalPosition===Tt.TOP?(d.top="".concat(E,"px"),d.bottom="auto"):r.verticalPosition===Tt.BOTTOM?(d.bottom="".concat(-p-E,"px"),d.top="auto"):(d.top="calc(50% + ".concat(E,"px)"),d.bottom="auto"),function(t,e,n,i={}){return Object.assign(Object.assign({},t),{[e]:t[e].map((t=>t.element===n?Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},i)}):t))})}(o,s,"host",d)})),ft(n,"deleteElementIfPresent",(function(t,e){var n=t.querySelector(e);n&&n.remove()})),ft(n,"upsertSvg",(function(t,e){var i=t.querySelector("svg");return i&&i.getAttribute("inline-svg-url")===e?Promise.resolve():(i&&n.deleteElementIfPresent(n.getRootElement(),".svgOverflowContainer"),fetch(e).then((function(t){return t.text()})).then((function(i){var o=document.createElement("template"),s=document.createElement("div");s.style.overflow="hidden",s.style.width="100%",s.style.height="inherit",s.classList.add("svgOverflowContainer"),o.append(s),o.firstChild.innerHTML=i.trim();var r=o.firstChild,l=r.querySelector("svg");return l.setAttribute("cl-element","image"),l.setAttribute("inline-svg-url",e),n.componentResourceManager.getPending().decrement(),t.append(r),t})).catch((function(e){console.error(e),n.upsertImage(t,null)})))})),ft(n,"upsertImage",(function(e,i){var o=e.querySelector("img");if(o)return o.src=i,t(o,"load",(function(){n.componentResourceManager.getPending().decrement()})),t(o,"error",(function(){n.componentResourceManager.onResourceLoadFailure(o.src)})),Promise.resolve();var s=new Image;return s.setAttribute("cl-element","image"),s.src=i,t(s,"load",(function(){n.componentResourceManager.getPending().decrement()})),t(s,"error",(function(){n.componentResourceManager.onResourceLoadFailure(s.src)})),e.append(s),Promise.resolve()})),ft(n,"applyAdaptiveStyles",(function(t){var e;n.applyAutoAdaptiveStyles(t.adaptiveStyles);var i=n.getEnvironment(),o=t.adaptiveStyles[i],s=o.find((function(t){return"host"===t.element})),r=o.find((function(t){return"image"===t.element})),l=n.getElement("image"),a={cover:"xMidYMid slice",contain:"xMidYMid meet",none:""},c=l&&"svg"===l.nodeName,u=(null==r||null===(e=r.styleAttributes)||void 0===e?void 0:e.objectFit)&&a.hasOwnProperty(r.styleAttributes.objectFit);if(c&&u)if(l.setAttribute("preserveAspectRatio",a[r.styleAttributes.objectFit]),"none"===r.styleAttributes.objectFit)l.setAttribute("width",l.viewBox.baseVal.width+"px"),l.setAttribute("height",l.viewBox.baseVal.height+"px");else{var p=l.viewBox.baseVal.width/l.viewBox.baseVal.height;if("auto"!==s.styleAttributes.width&&"auto"!==s.styleAttributes.height)return l.setAttribute("height","100%"),void l.setAttribute("width","100%");if("auto"===s.styleAttributes.width&&"auto"===s.styleAttributes.height)return l.setAttribute("width",l.viewBox.baseVal.width+"px"),void l.setAttribute("height",l.viewBox.baseVal.height+"px");"auto"===s.styleAttributes.width&&(l.setAttribute("height","100%"),"100%"!==s.styleAttributes.height&&"calc(100% - 0px)"!==s.styleAttributes.height&&l.setAttribute("width","".concat(Math.round(parseInt(s.styleAttributes.height,10)*p),"px"))),"auto"===s.styleAttributes.height&&(l.setAttribute("width","100%"),"100%"!==s.styleAttributes.width&&"calc(100% - 0px)"!==s.styleAttributes.width&&l.setAttribute("height","".concat(Math.round(parseInt(s.styleAttributes.width,10)/p),"px")))}})),ft(n,"fixFloatingImageSize",(function(t){var e=n.getElement("image");e&&(n._isFloating()&&"auto"===lt(t,n.getEnvironment(),"host").styleAttributes.width?e.style.width="":e.style.width="100%")})),ft(n,"_getHostNewDimensionsWithStyles",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.getHostElement();return["height","width","minHeight","minWidth","maxHeight","maxWidth","display"].forEach((function(n){t[n]?e.style[n]=t[n]:e.style[n]&&(e.style[n]="")})),{width:e.offsetWidth,height:e.offsetHeight}})),ft(n,"_isFloating",(function(){return n.getProps().floating||n.getModel().floating})),n.originalApplyAutoAdaptiveStyles=n.applyAutoAdaptiveStyles,n.applyAutoAdaptiveStyles=n.applyStylesRespectingRelativePositioning,n.getRootElement().innerHTML="\n ".concat("\n <style>\n :host {\n transform: rotate(var(--rotation, 0deg));\n }\n \n img {\n display: block;\n max-height: inherit;\n height: inherit;\n min-height: inherit;\n }\n </style>\n ",'\n <img cl-element="image" draggable="false" alt="">\n '),n}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)}(e,dt),function(t,e){return e&&mt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"connectedCallback",value:function(){var t=this;Et(e,"connectedCallback",this,3)([]),this.skipGameBlur=!this._isFloating(),this.componentResourceManager.getPending().increment(),this.recalculateStylesAfterImageLoad(),this.observeProps((function(e,n){var i;t.applyAutoAdaptiveStyles(n.adaptiveStyles),t.applyAltText(n);var o=t.getElement("image");null!==(i=n.control)&&void 0!==i&&i.imageSource.url&&o&&"src"in o&&(o.src=n.control.imageSource.url);var s=n.control.imageSource.url,r=e&&e.control.imageSource.url,l=String(n.control.imageSource.url).endsWith(".svg")?n.control.imageSource.url:null,a=e&&String(e.control.imageSource.url).endsWith(".svg")?e.control.imageSource.url:null;if(l){if(l===a)return void t.applyAdaptiveStyles(n);t.deleteElementIfPresent(t.getRootElement(),"img"),t.upsertSvg(t.getRootElement(),l).then((function(){t.applyAltText(n),t.applyAdaptiveStyles(n)}))}else if(s){if(s===r)return void t.applyAdaptiveStyles(n);t.deleteElementIfPresent(t.getRootElement(),".svgOverflowContainer"),t.upsertImage(t.getRootElement(),s).then((function(){t.applyAltText(n),t.applyAdaptiveStyles(n)}))}else t.deleteElementIfPresent(t.getRootElement(),".svgOverflowContainer"),t.upsertImage(t.getRootElement(),t.assets("img/image-placeholder.svg")).then((function(){t.applyAltText(n),t.applyAdaptiveStyles(n)}))}))}},{key:"disconnectedCallback",value:function(){var t;Et(e,"disconnectedCallback",this,3)([]),null===(t=this.resourcesLoadedListener)||void 0===t||t.off()}}])}();ft(Ct,"define",{name:"sys-image",model:e.name,manifest:e});export{St as HorizontalPosition,At as PositioningModes,Tt as VerticalPosition,Ct as default};window.clComponentClass_SysImageComponent=Ct;
|
|
1
|
+
const t=(t,e,n,i)=>{const o=EventTarget.prototype,{addEventListenerBase:s,addEventListener:r}=o;(s||r).call(t,e,n,i)},e={name:"SysImageComponent",componentType:"IMAGE",version:"1.0.0",contextMenuModel:[{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}],floatingControlsModel:(n=[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host",params:{rotation:{elementProp:"styleAttributes",element:"host"}}},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"ROTATION",elementProp:"styleAttributes",element:"host"}],Object.values({DESKTOP:"desktop",MOBILE:"mobile"}).map((t=>({type:"GROUP",propPath:["adaptiveStyles",t],children:n})))),propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill"]}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"RADIO_BUTTONS",elementProp:"styleAttributes",elementSubProp:"objectFit",element:"image",params:{label:"DOCUMENT_IMAGE",options:[{label:"DOCUMENT_IMAGE_RESIZE_COVER",value:"cover"},{label:"DOCUMENT_IMAGE_RESIZE_CONTAIN",value:"contain"},{label:"DOCUMENT_IMAGE_RESIZE_NONE",value:"none"}]},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"IMAGE_SOURCES",element:"image",propPath:["control","imageSource"]},{type:"CONTROL",name:"FLOATING_COMPONENT_POSITION",element:"host",elementProp:"styleAttributes",displayCondition:function(t){return!!t.component.getProps().floating&&!t.component.getProps().control.positioning},params:{label:"DOCUMENT_POSITION"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"DISPLAY",elementProp:"styleAttributes",elementSubProp:"display",element:"host",params:{label:"DOCUMENT_DISPLAY_ON_DESKTOP"}},{type:"CONTROL",name:"DISPLAY",propPath:["adaptiveStyles","mobile"],elementProp:"styleAttributes",elementSubProp:"display",element:"host",params:{label:"DOCUMENT_DISPLAY_ON_MOBILE"}},{type:"CONTROL",name:"BORDER_RADIUS",elementProp:"styleAttributes",element:"image",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",displayCondition:function(t){return!t.component.getProps().floating},params:{indentationType:"PADDING"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",displayCondition:function(t){return!t.component.getProps().floating},params:{indentationType:"MARGIN"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill"]}},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"RADIO_BUTTONS",elementProp:"styleAttributes",elementSubProp:"objectFit",element:"image",params:{label:"DOCUMENT_IMAGE",options:[{label:"DOCUMENT_IMAGE_RESIZE_COVER",value:"cover"},{label:"DOCUMENT_IMAGE_RESIZE_CONTAIN",value:"contain"},{label:"DOCUMENT_IMAGE_RESIZE_NONE",value:"none"}]},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"IMAGE_SOURCES",element:"image",propPath:["control","imageSource"]},{type:"CONTROL",name:"FLOATING_COMPONENT_POSITION",element:"host",elementProp:"styleAttributes",displayCondition:function(t){return!!t.component.getProps().floating&&!t.component.getProps().control.positioning},params:{label:"DOCUMENT_POSITION"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"DISPLAY",elementProp:"styleAttributes",elementSubProp:"display",element:"host",params:{label:"DOCUMENT_DISPLAY_ON_MOBILE"}},{type:"CONTROL",name:"BORDER_RADIUS",elementProp:"styleAttributes",element:"image",syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",displayCondition:function(t){return!t.component.getProps().floating},params:{indentationType:"PADDING"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",displayCondition:function(t){return!t.component.getProps().floating},params:{indentationType:"MARGIN"},syncSelectDisplayCondition:function(t){return"TEASER"!==t.widgetType}}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0},displayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"TEXT_INPUT",propPath:["control","altText"],params:{label:"DOCUMENT_IMAGE_ALT_TEXT",tooltip:"DOCUMENT_IMAGE_ALT_TEXT_TOOLTIP"}}]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1},displayCondition:function(t){return"TEASER"!==t.widgetType}},{type:"CONTROL",name:"TEXT_INPUT",propPath:["control","altText"],params:{label:"DOCUMENT_IMAGE_ALT_TEXT",tooltip:"DOCUMENT_IMAGE_ALT_TEXT_TOOLTIP"}}]},i18nPropPaths:["handlers,[id],actions,[id],params,link","handlers,[id],actions,[id],params,customData","control,altText"],events:{dispatch:[],listen:[]},props:{control:{imageSource:{url:""},altText:""},adaptiveStyles:{desktop:[{element:"host",styleAttributes:{width:"150px",minWidth:"150px",height:"auto",minHeight:null,paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,display:"block"},classes:""},{element:"image",styleAttributes:{background:"transparent",objectFit:"cover",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},classes:""}],mobile:[{element:"host",styleAttributes:{width:"150px",minWidth:"150px",height:"auto",minHeight:null,paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,display:"block"},classes:""},{element:"image",styleAttributes:{background:"transparent",objectFit:"cover",borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px"},classes:""}]}},metaDescription:{icon:"/SysImageComponent/assets/img/image-component-icon.svg",label:{en:"Image",ru:"Изображение",uk:"Зображення",es:"Imagen",fr:"Menu déroulant",de:"Bild",it:"Immagine",pt:"Imagem",ro:"Imagine",bg:"Изображение",cs:"Obrázek",el:"Εικόνα",nl:"Afbeelding",pl:"Obraz",sv:"Bild",tr:"Resim",ar:"الصورة",zh:"图像",da:"Billede",he:"תמונה",fi:"Kuva",hi:"इमेज ",hr:"Slika",hu:"Kép",id:"Gambar",ja:"画像",ko:"이미지",no:"Bilde",sk:"Obrázok",sl:"Slika",sr:"Slika"}},waitForResourcesLoad:!0,resourcesPropPaths:[["control","imageSource","url"]],syncEnabled:!0,stylesImitationEnabled:!0};var n;const i="cl-";function o(t){return i+t}function s(t){return"cl-"+t}const r="VIEW",l="MODULE",a="CONTAINER",c="INPUT",u="BUTTON",p="CONSENT",d="COLUMN";var h,m;(m=h||(h={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",m.REQUEST="REQUEST",m.DISPATCH_EVENT="DISPATCH_EVENT",m.GO_TO_VIEW="GO_TO_VIEW",m.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",m.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",m.SHOW_WIDGET="SHOW_WIDGET",m.OPEN_LINK="OPEN_LINK",m.CLOSE_WIDGET="CLOSE_WIDGET",m.CLICK="CLICK";const g=h;var E;class y{static sortActions(t){const e={[g.CLOSE_WIDGET]:-1,[g.OPEN_LINK]:-2,[g.SHOW_WIDGET]:1,[g.SUBSCRIBE_CONTACT]:2,[g.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=y.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,n){this.state=t;const i=n(),o=i.getAttribute(s("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(s("type"))));let n=0;for(;e[n]&&e[n].getAttribute(s("id"))!==o;){let t=e[n].getAttribute(s("type"));if(y.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;n++}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,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=[])}}y.IGNORING_VIEW_ENTRY_TYPES=[u,p,c],function(t){t.CLICK="CLICK",t.COMPONENT_EVENT="COMPONENT_EVENT"}(E||(E={}));class b{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class v{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map((t=>this.actionFactory.get(t)));switch(e.forEach((t=>this.actionRegister.register(t))),t.type){case E.CLICK:return new y(t,e);case E.COMPONENT_EVENT:return new b(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class f{static generate(){let t,e="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class O{constructor(){this.listeners=O.createDefaultListenersState()}emit(t,e,n=null){const i=this.listeners[t];i&&Object.values(i).forEach((i=>i(e,t,n))),Object.values(this.listeners["*"]).forEach((i=>i(e,t,n)))}on(t,e){const n=f.generate(),i=this.listeners[t];return i?i[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,i;(null===(i=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===i?void 0:i[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=O.createDefaultListenersState()}}O.createDefaultListenersState=()=>({"*":{}});const T=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 A{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===l?Object.assign(Object.assign({},t),A.moduleToContainerParams):t));return Object.assign(Object.assign({},t),{children:e})}));return Object.assign(Object.assign({},t),{views:e})}static sort(t,e){return t.index>e.index?1:-1}static reIndex(t,e){return Object.assign(Object.assign({},t),{index:e+t.index})}}var C,_,N,R,I,L,P,M,x,D,w,U,k;A.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(_=C||(C={})).VIEW="VIEW",_.CONTAINER="CONTAINER",_.TEXT="TEXT",_.INPUT="INPUT",_.BUTTON="BUTTON",_.IMAGE="IMAGE",_.CONSENT="CONSENT",_.COUNTDOWN_TIMER="COUNTDOWN_TIMER",_.PROMO_CODE="PROMO_CODE",_.MULTIPLE_INPUT="MULTIPLE_INPUT",_.VIDEO="VIDEO",_.SLIDER="SLIDER",_.SLIDE="SLIDE",_.SOCIAL="SOCIAL",_.COLUMNS="COLUMNS",_.COLUMN="COLUMN",_.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(N||(N={})).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={})),(L||(L={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(P||(P={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(M||(M={})),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"}(x||(x={})),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"}(D||(D={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(w||(w={})),(k=U||(U={})).BEFORE="BEFORE",k.AFTER="AFTER",k.INSIDE="INSIDE",k.INSTEAD="INSTEAD";class B extends T{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 F=B;class j{static set(t,e){const n=t[j.accumulatorPropertyName]||{};t[j.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[j.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}j.accumulatorPropertyName="clStyleAttributes";const G=j;var W;!function(t){t.BUILT_IN="BUILT_IN",t.DETACHED="DETACHED",t.FLOATING_BOX="FLOATING_BOX",t.FLOATING_BAR="FLOATING_BAR",t.LAUNCHER="LAUNCHER",t.CONTENT_LOCKER="CONTENT_LOCKER"}(W||(W={}));class H{static applyHostStyles(t,e,n=null,i){var o,s,l;const c=null===(s=null===(o=null==n?void 0:n.props)||void 0===o?void 0:o.handlers)||void 0===s?void 0:s.find((t=>"CLICK"===t.type));c&&(null===(l=c.actions)||void 0===l?void 0:l.length)&&(e.style.cursor="pointer"),t!==r&&t!==a&&t!==d||(e.style.display=i===W.CONTENT_LOCKER&&t===r?"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 V{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class ${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,l;const a=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===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),p=this.parseBackground(u);p.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:p.url,inlineSvgString:null,positionOptions:p.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,n])=>this.httpClient.execute(n.originalSVGResourceURL).then((t=>t.text())).then((i=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:i}))}))))).then((()=>{var e;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),V.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 K=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 X{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 Q;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.EXECUTE_ACTION_BY_PREDICATE="EXECUTE_ACTION_BY_PREDICATE"}(Q||(Q={}));const Z=Q;class q{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(Z.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(Z.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 J=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>J(...t)}},tt=J,et="props",nt="shared",it="environment";function ot(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 st="SUBMIT";function rt(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}function lt(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 at(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}class ct extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}var ut;!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(ut||(ut={}));class pt extends HTMLElement{constructor(){var e;super(),this.skipGameBlur=!0,this.construct=()=>{let t;const e=this.getAttribute(s("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const i=n.closest(`[${s("widget-id")}]`);let o;i&&(o=i.getAttribute(s("widget-id")));let r=new ct("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(s("path")),id:e,widgetId:o},{bubbles:!0,composed:!0});this.dispatchEvent(r),t=r.detail.props,Object.assign(this,t),this.observers=tt(et,nt,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 T,this.componentResourceManager=new q(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new v(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(et).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),n=s("floating");t.floating&&!e.getAttribute(n)?e.setAttribute(n,"true"):!t.floating&&e.getAttribute(n)&&e.removeAttribute(n)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(nt).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new $(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),K),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(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")===ut.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===ut.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(et).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(nt).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(`[${s("element")}]`)).filter((t=>!t.hasAttribute(s("component"))))],this.getElement=(t,e)=>this.getElements().find((n=>e?n.getAttribute(s("element"))===t&&n.id===e:n.getAttribute(s("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const n=this.getElements();if(!n.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 i=!1,o=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(rt(n,t),i=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(rt(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),o=s("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)),at({element:l,html:""}),n.forEach((t=>{let e=t.getAttribute(s("element"));const n=this.getEnvironment();let o=lt(i,n,e);if(o){if(this.resizeListener.isMobile()){const t=lt(i,"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=(e,n,i)=>{var o,r;const l=[];"host"===(n=pt._resolveTogglableStylesForElementModel(n)).element&&(H.applyHostStyles(this.model.type,e,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(r=this.model.props.backgroundDynamicInlineSVGElements)||void 0===r?void 0:r.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),l.push("background")));let a=n.styleAttributes.background,c=a&&a.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&c){this.componentResourceManager.getPending().increment();const e=new Image;e.src=c[1],t(e,"load",(()=>{this.componentResourceManager.getPending().decrement()})),t(e,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(e.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const u=Object.assign(Object.assign({},n),{styleAttributes:z(n.styleAttributes,l)});if(G.set(e,u),this._setClassAttributes(e,n),i){if(n.hoverStyleAttributes){let t=Object.assign({},n.hoverStyleAttributes);if("FILL_UP"===n.hoverAnimationType){e.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",e.style.overflow="hidden";const i=e.tagName.toLowerCase(),o=`flip-up-animation-${n.element}`;let s=this.getRootElement().querySelector(`#${o}`);s||(s=document.createElement("style"),s.id=o,e.appendChild(s)),at({element:s,html:`\n ${i}::before {\n content: '';\n background: ${t.background};\n position: absolute;\n left: 0;\n top: ${e.getBoundingClientRect().height}px;\n height: ${e.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${i}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),t=Object.assign(Object.assign({},n.hoverStyleAttributes),{background:"transparent",position:"relative"})}t.borderTopWidth&&"0px"!==t.borderTopWidth||delete t.borderTopColor,t.borderBottomWidth&&"0px"!==t.borderBottomWidth||delete t.borderBottomColor,t.borderLeftWidth&&"0px"!==t.borderLeftWidth||delete t.borderLeftColor,t.borderRightWidth&&"0px"!==t.borderRightWidth||delete t.borderRightColor,this._addStylesToStyleElement(i,n.element,t,`:not(.${s("no-hover")}):hover`,!0)}n.placeholderStyleAttributes&&this._addStylesToStyleElement(i,n.element,n.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(i,this.getShared()),this.stylesAppliedToElement(e,n,i)}},this.applySharedClassesToElementModel=t=>function(t,e){let n=t;return(n.classes||"").split(" ").filter((t=>t.startsWith(i))).forEach((t=>{var i;let o=null===(i=e.textClasses)||void 0===i?void 0:i[t];o&&(o.styleAttributes.fontFamily||(o.isHeader&&e.headerFontFamily&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:e.headerFontFamily})})),!o.isHeader&&e.textFontFamily&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},o.styleAttributes),{fontFamily:e.textFontFamily})}))),n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),o.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},n.placeholderStyleAttributes),o.placeholderStyleAttributes)}))})),n.styleAttributes.fontFamily||(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:e.textFontFamily})})),n}(t,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,n,i="",o)=>{const r=Object.keys(n).reduce(((t,e)=>t+` ${X.camelCaseToDashCase(e)}: ${n[e]}${o?" !important;":";"}`),"");at({element:t,html:`[${s("element")}="${e}"]${i} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{at({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,i,o,s;e.linkColor&&at({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)&&at({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)&&at({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(t,e)=>{Array.from(t.classList).filter((t=>t!==o("hovered")&&t!==o("focused"))).forEach((e=>{e.startsWith(i)&&t.classList.remove(e)}));const n=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",n)},this.getParentComponent=()=>ot(this.parentNode,s("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(s("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:ot(this.parentNode,s("path"),void 0,(t=>1===(null==t?void 0:t.split(",").length)))},this.getWidgetLanguages=()=>function(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,n)=>{if(e)return e;const i=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return i||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n,i,o,s,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===(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===st));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:g.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===(e=this.constructor.define)||void 0===e?void 0:e.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()}}pt._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=pt._resolveTogglableStyles(e[t]))})),e},pt._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 dt=pt;function ht(t){return ht="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ht(t)}function mt(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,Ot(i.key),i)}}function gt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(gt=function(){return!!t})()}function Et(t,e,n,i){var o=yt(bt(1&i?t.prototype:t),e,n);return 2&i&&"function"==typeof o?function(t){return o.apply(n,t)}:o}function yt(){return yt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=bt(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}},yt.apply(null,arguments)}function bt(t){return bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bt(t)}function vt(t,e){return vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vt(t,e)}function ft(t,e,n){return(e=Ot(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ot(t){var e=function(t){if("object"!=ht(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ht(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ht(e)?e:e+""}var Tt={TOP:"top",CENTER:"center",BOTTOM:"bottom"},St={LEFT:"left",CENTER:"center",RIGHT:"right"},At={FIXED:"fixed",STICKY:"sticky"},Ct=function(){function e(){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),ft(n=function(t,e,n){return e=bt(e),function(t,e){if(e&&("object"==ht(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,gt()?Reflect.construct(e,n||[],bt(t).constructor):e.apply(t,n))}(this,e),"applyAltText",(function(t){var e,i=n.getElement("image");if(i){var o=(null===(e=t.control)||void 0===e?void 0:e.altText)||"";"IMG"===i.nodeName?i.alt=o:i.setAttribute("aria-label",o)}})),ft(n,"applyStylesRespectingRelativePositioning",(function(){var t=n.processPositioningStyles(n.getProps());n.originalApplyAutoAdaptiveStyles(t),n.fixFloatingImageSize(t)})),ft(n,"recalculateStylesAfterImageLoad",(function(){n.resourcesLoadedListener=n.services.eventEmitter.on("VIEW_COMPONENT_RESOURCES_LOADED",(function(){requestAnimationFrame((function(){n.applyAdaptiveStyles(n.getProps())}))}))})),ft(n,"processPositioningStyles",(function(t){var e,i,o=t.adaptiveStyles;if(((null===(e=t.control)||void 0===e?void 0:e.positioningMode)||At.FIXED)===At.FIXED)return o;var s=n.getEnvironment(),r=(null===(i=t.control)||void 0===i||null===(i=i.positioning)||void 0===i?void 0:i[s])||{},l=(null==r?void 0:r.diff)||{};if(!Boolean("x"in l&&"y"in l))return o;var a=lt(o,s,"host").styleAttributes,c=n._getHostNewDimensionsWithStyles(a),u=c.width,p=c.height,d=z(a,["left","right","top","bottom"]),h=u/2,m=l.x-h;r.horizontalPosition===St.LEFT?(d.left="".concat(m,"px"),d.right="auto"):r.horizontalPosition===St.RIGHT?(d.right="".concat(-u-m,"px"),d.left="auto"):(d.left="calc(50% + ".concat(m,"px)"),d.right="auto");var g=p/2,E=l.y-g;return r.verticalPosition===Tt.TOP?(d.top="".concat(E,"px"),d.bottom="auto"):r.verticalPosition===Tt.BOTTOM?(d.bottom="".concat(-p-E,"px"),d.top="auto"):(d.top="calc(50% + ".concat(E,"px)"),d.bottom="auto"),function(t,e,n,i={}){return Object.assign(Object.assign({},t),{[e]:t[e].map((t=>t.element===n?Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},i)}):t))})}(o,s,"host",d)})),ft(n,"deleteElementIfPresent",(function(t,e){var n=t.querySelector(e);n&&n.remove()})),ft(n,"upsertSvg",(function(t,e){var i=t.querySelector("svg");return i&&i.getAttribute("inline-svg-url")===e?Promise.resolve():(i&&n.deleteElementIfPresent(n.getRootElement(),".svgOverflowContainer"),fetch(e).then((function(t){return t.text()})).then((function(i){var o=document.createElement("template"),s=document.createElement("div");s.style.overflow="hidden",s.style.width="100%",s.style.height="inherit",s.classList.add("svgOverflowContainer"),o.append(s),o.firstChild.innerHTML=i.trim();var r=o.firstChild,l=r.querySelector("svg");return l.setAttribute("cl-element","image"),l.setAttribute("inline-svg-url",e),n.componentResourceManager.getPending().decrement(),t.append(r),t})).catch((function(e){console.error(e),n.upsertImage(t,null)})))})),ft(n,"upsertImage",(function(e,i){var o=e.querySelector("img");if(o)return o.src=i,t(o,"load",(function(){n.componentResourceManager.getPending().decrement()})),t(o,"error",(function(){n.componentResourceManager.onResourceLoadFailure(o.src)})),Promise.resolve();var s=new Image;return s.setAttribute("cl-element","image"),s.src=i,t(s,"load",(function(){n.componentResourceManager.getPending().decrement()})),t(s,"error",(function(){n.componentResourceManager.onResourceLoadFailure(s.src)})),e.append(s),Promise.resolve()})),ft(n,"applyAdaptiveStyles",(function(t){var e;n.applyAutoAdaptiveStyles(t.adaptiveStyles);var i=n.getEnvironment(),o=t.adaptiveStyles[i],s=o.find((function(t){return"host"===t.element})),r=o.find((function(t){return"image"===t.element})),l=n.getElement("image"),a={cover:"xMidYMid slice",contain:"xMidYMid meet",none:""},c=l&&"svg"===l.nodeName,u=(null==r||null===(e=r.styleAttributes)||void 0===e?void 0:e.objectFit)&&a.hasOwnProperty(r.styleAttributes.objectFit);if(c&&u)if(l.setAttribute("preserveAspectRatio",a[r.styleAttributes.objectFit]),"none"===r.styleAttributes.objectFit)l.setAttribute("width",l.viewBox.baseVal.width+"px"),l.setAttribute("height",l.viewBox.baseVal.height+"px");else{var p=l.viewBox.baseVal.width/l.viewBox.baseVal.height;if("auto"!==s.styleAttributes.width&&"auto"!==s.styleAttributes.height)return l.setAttribute("height","100%"),void l.setAttribute("width","100%");if("auto"===s.styleAttributes.width&&"auto"===s.styleAttributes.height)return l.setAttribute("width",l.viewBox.baseVal.width+"px"),void l.setAttribute("height",l.viewBox.baseVal.height+"px");"auto"===s.styleAttributes.width&&(l.setAttribute("height","100%"),"100%"!==s.styleAttributes.height&&"calc(100% - 0px)"!==s.styleAttributes.height&&l.setAttribute("width","".concat(Math.round(parseInt(s.styleAttributes.height,10)*p),"px"))),"auto"===s.styleAttributes.height&&(l.setAttribute("width","100%"),"100%"!==s.styleAttributes.width&&"calc(100% - 0px)"!==s.styleAttributes.width&&l.setAttribute("height","".concat(Math.round(parseInt(s.styleAttributes.width,10)/p),"px")))}})),ft(n,"fixFloatingImageSize",(function(t){var e=n.getElement("image");e&&(n._isFloating()&&"auto"===lt(t,n.getEnvironment(),"host").styleAttributes.width?e.style.width="":e.style.width="100%")})),ft(n,"_getHostNewDimensionsWithStyles",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=n.getHostElement();return["height","width","minHeight","minWidth","maxHeight","maxWidth","display"].forEach((function(n){t[n]?e.style[n]=t[n]:e.style[n]&&(e.style[n]="")})),{width:e.offsetWidth,height:e.offsetHeight}})),ft(n,"_isFloating",(function(){return n.getProps().floating||n.getModel().floating})),n.originalApplyAutoAdaptiveStyles=n.applyAutoAdaptiveStyles,n.applyAutoAdaptiveStyles=n.applyStylesRespectingRelativePositioning,n.getRootElement().innerHTML="\n ".concat("\n <style>\n :host {\n transform: rotate(var(--rotation, 0deg));\n }\n \n img {\n display: block;\n max-height: inherit;\n height: inherit;\n min-height: inherit;\n }\n </style>\n ",'\n <img cl-element="image" draggable="false" alt="">\n '),n}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)}(e,dt),function(t,e){return e&&mt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(e,[{key:"connectedCallback",value:function(){var t=this;Et(e,"connectedCallback",this,3)([]),this.skipGameBlur=!this._isFloating(),this.componentResourceManager.getPending().increment(),this.recalculateStylesAfterImageLoad(),this.observeProps((function(e,n){var i;t.applyAutoAdaptiveStyles(n.adaptiveStyles),t.applyAltText(n);var o=t.getElement("image");null!==(i=n.control)&&void 0!==i&&i.imageSource.url&&o&&"src"in o&&(o.src=n.control.imageSource.url);var s=n.control.imageSource.url,r=e&&e.control.imageSource.url,l=String(n.control.imageSource.url).endsWith(".svg")?n.control.imageSource.url:null,a=e&&String(e.control.imageSource.url).endsWith(".svg")?e.control.imageSource.url:null;if(l){if(l===a)return void t.applyAdaptiveStyles(n);t.deleteElementIfPresent(t.getRootElement(),"img"),t.upsertSvg(t.getRootElement(),l).then((function(){t.applyAltText(n),t.applyAdaptiveStyles(n)}))}else if(s){if(s===r)return void t.applyAdaptiveStyles(n);t.deleteElementIfPresent(t.getRootElement(),".svgOverflowContainer"),t.upsertImage(t.getRootElement(),s).then((function(){t.applyAltText(n),t.applyAdaptiveStyles(n)}))}else t.deleteElementIfPresent(t.getRootElement(),".svgOverflowContainer"),t.upsertImage(t.getRootElement(),t.assets("img/image-placeholder.svg")).then((function(){t.applyAltText(n),t.applyAdaptiveStyles(n)}))}))}},{key:"disconnectedCallback",value:function(){var t;Et(e,"disconnectedCallback",this,3)([]),null===(t=this.resourcesLoadedListener)||void 0===t||t.off()}}])}();ft(Ct,"define",{name:"sys-image",model:e.name,manifest:e});export{St as HorizontalPosition,At as PositioningModes,Tt as VerticalPosition,Ct as default};window.clComponentClass_SysImageComponent=Ct;
|
|
@@ -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",l="BUTTON",a="CONSENT",c="COLUMN";var h,d;(d=h||(h={})).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 p=h;var u,m;class g{static sortActions(t){const e={[p.CLOSE_WIDGET]:-1,[p.OPEN_LINK]:-2,[p.SHOW_WIDGET]:1,[p.SUBSCRIBE_CONTACT]:2,[p.REQUEST]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>n(t)>n(e)?-1:n(t)<n(e)?1:0))}constructor(t,e){this.config=t,this.actions=g.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,o){this.state=t;const i=o(),r=i.getAttribute(n("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(n("type"))));let o=0;for(;e[o]&&e[o].getAttribute(n("id"))!==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=[l,a,s],(m=u||(u={})).CLICK="CLICK",m.COMPONENT_EVENT="COMPONENT_EVENT";class f{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class b{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map((t=>this.actionFactory.get(t)));switch(e.forEach((t=>this.actionRegister.register(t))),t.type){case u.CLICK:return new g(t,e);case u.COMPONENT_EVENT:return new f(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class v{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 y{constructor(){this.listeners=y.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=v.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=y.createDefaultListenersState()}}y.createDefaultListenersState=()=>({"*":{}});const E=y,C=(t,e,n,o)=>{const i=EventTarget.prototype,{addEventListenerBase:r,addEventListener:s}=i;(r||s).call(t,e,n,o)};class T{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class O{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===i?Object.assign(Object.assign({},t),O.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 S,A,_,x,R,I,N,L,w,P,M,k,j;O.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(A=S||(S={})).VIEW="VIEW",A.CONTAINER="CONTAINER",A.TEXT="TEXT",A.INPUT="INPUT",A.BUTTON="BUTTON",A.IMAGE="IMAGE",A.CONSENT="CONSENT",A.COUNTDOWN_TIMER="COUNTDOWN_TIMER",A.PROMO_CODE="PROMO_CODE",A.MULTIPLE_INPUT="MULTIPLE_INPUT",A.VIDEO="VIDEO",A.SLIDER="SLIDER",A.SLIDE="SLIDE",A.SOCIAL="SOCIAL",A.COLUMNS="COLUMNS",A.COLUMN="COLUMN",A.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(_||(_={})).CLICK="CLICK",function(t){t.SHOW_WIDGET="SHOW_WIDGET",t.OPEN_LINK="OPEN_LINK",t.SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",t.REQUEST="REQUEST",t.CLOSE_WIDGET="CLOSE_WIDGET",t.GO_TO_VIEW="GO_TO_VIEW",t.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",t.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",t.CLICK="CLICK"}(x||(x={})),function(t){t.SELF="_self",t.BLANK="_blank"}(R||(R={})),(I||(I={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(N||(N={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(L||(L={})),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"}(w||(w={})),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"}(P||(P={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(M||(M={})),(j=k||(k={})).BEFORE="BEFORE",j.AFTER="AFTER",j.INSIDE="INSIDE",j.INSTEAD="INSTEAD";class D extends E{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(D.changeEventName,this._isMobile)}))}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(D.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(D.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}D.changeEventName="CHANGE";const B=D;class H{static set(t,e){const n=t[H.accumulatorPropertyName]||{};t[H.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[H.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}H.accumulatorPropertyName="clStyleAttributes";const U=H;var F;!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"}(F||(F={}));class W{static applyHostStyles(t,e,n=null,i){var s,l,a;const h=null===(l=null===(s=null==n?void 0:n.props)||void 0===s?void 0:s.handlers)||void 0===l?void 0:l.find((t=>"CLICK"===t.type));h&&(null===(a=h.actions)||void 0===a?void 0:a.length)&&(e.style.cursor="pointer"),t!==o&&t!==r&&t!==c||(e.style.display=i===F.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 V{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class G{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,l;const a=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)))||{},h=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),d=this.parseBackground(h);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((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),V.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 $=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 K(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class z{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}}class Z{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}var Q;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.EXECUTE_ACTION_BY_PREDICATE="EXECUTE_ACTION_BY_PREDICATE"}(Q||(Q={}));const q=Q;class X{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(q.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(q.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new Z(this.onCounterStateUpdate)}}}const Y=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>Y(...t)}},J=Y,tt="props",et="shared",nt="environment";function ot(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 it="SUBMIT";function rt(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{if("element"===n||"classes"===n)return;const o=e[n];o&&"object"==typeof o&&!Array.isArray(o)?t[n]=Object.assign(Object.assign({},t[n]||{}),o):t[n]=o})),t):t}const st={DESKTOP:"desktop",MOBILE:"mobile"};function lt(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 at(t=[]){return t.map((t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)})))}function ct(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}class ht extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}var dt;!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(dt||(dt={}));class pt extends HTMLElement{constructor(){var o;super(),this.skipGameBlur=!0,this.construct=()=>{let t;const e=this.getAttribute(n("id")),o=this.getWidgetContainerNode();if(!o)throw new Error("Widget container not found in construct");const i=o.closest(`[${n("widget-id")}]`);let r;i&&(r=i.getAttribute(n("widget-id")));let s=new ht("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=J(tt,et,nt),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach((t=>null==t?void 0:t.off()))}},this.state=new T({}),this.componentEventEmitter=new E,this.componentResourceManager=new X(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new b(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(tt).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),o=n("floating");t.floating&&!e.getAttribute(o)?e.setAttribute(o,"true"):!t.floating&&e.getAttribute(o)&&e.removeAttribute(o)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(et).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new G(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),$),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(B.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(nt).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_READY_TO_PLAY",(()=>{this.skipGameBlur||this.getHostElement().classList.add("cl-game-spotlight-component")}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_COMPLETED",(()=>{this.skipGameBlur||this.getHostElement().classList.remove("cl-game-spotlight-component")})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===dt.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===dt.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(tt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(et).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(nt).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${n("element")}]`)).filter((t=>!t.hasAttribute(n("component"))))],this.getElement=(t,e)=>this.getElements().find((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&&(rt(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(rt(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 l=this.getRootElement().querySelector(`style[${r}="${s}"]`);l||(l=document.createElement("style"),l.setAttribute(r,s),this.getRootElement().appendChild(l)),ct({element:l,html:""}),o.forEach((t=>{let e=t.getAttribute(n("element"));const o=this.getEnvironment();let r=lt(i,o,e);if(r){if(this.resizeListener.isMobile()){const t=lt(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),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,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,o)=>{var i,r;const s=[];"host"===(e=pt._resolveTogglableStylesForElementModel(e)).element&&(W.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 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],C(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),C(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:K(e.styleAttributes,s)});if(U.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)),ct({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+` ${z.camelCaseToDashCase(e)}: ${o[e]}${r?" !important;":";"}`),"");ct({element:t,html:`[${n("element")}="${e}"]${i} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{ct({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,i,r;e.linkColor&&ct({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&ct({element:t,html:`a {color: ${null===(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)&&ct({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=()=>ot(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(n("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:ot(this.parentNode,n("path"),void 0,(t=>1===(null==t?void 0:t.split(",").length)))},this.getWidgetLanguages=()=>function(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n,o,i,r,s;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===(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===it));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:p.REQUEST}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>{var t;return(null===(t=this.getProps())||void 0===t?void 0:t.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(o=this.constructor.define)||void 0===o?void 0:o.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}));const t=document.createElement("style");t.textContent='\n :host(.cl-game-spotlight-component)::after {\n content: "";\n position: absolute;\n background-size: 100% 100%;\n background-repeat: no-repeat;\n overflow: visible;\n \n backdrop-filter: blur(4px);\n \n inset: -30px;\n mask-image: \n linear-gradient(to bottom, transparent, grey 30px, grey calc(100% - 30px), transparent),\n linear-gradient(to right, transparent, grey 30px, grey calc(100% - 30px), transparent);\n mask-composite: intersect;\n -webkit-mask-composite: source-in; /* for Chrome/Safari */\n \n transition: opacity 0.35s ease;\n pointer-events: auto;\n }\n ',this.getRootElement().prepend(t)}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}}pt._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=pt._resolveTogglableStyles(e[t]))})),e},pt._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 ut=pt;function mt(t){return Object.values(st).map((e=>({type:"GROUP",propPath:["adaptiveStyles",e],children:t})))}const gt={name:"SysPromoCodeComponent",componentType:"PROMO_CODE",version:"1.0.0",events:{dispatch:[],listen:[]},contextMenuModel:mt([{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]),floatingControlsModel:mt([{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]),propertyPaneModel:{content:mt([{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"text"}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"PROMOCODE_ICON",propPath:["styles","[element=icon]","styleAttributes"],params:{visibleDisplayValue:"flex"}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"HOVER_ANIMATION",propPath:["styles","[element=text]","hoverStyleAttributes"],params:{animationTypeProp:{propPath:["styles","[element=text]","hoverAnimationType"]}}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"text",params:{indentationType:"PADDING"}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]),general:[{type:"TEXT",params:{text:"DOCUMENT_CLICK_COMPONENT_TO_COPY_TO_CLIPBOARD",type:"SECONDARY"},displayCondition:function(t){return!t.documentUtils.findComponentsByTypes(t.views,["PRIZE_BASED_GAMING"]).some((function(e){return e.path[0]<t.component.path[0]}))}},{type:"CONTROL",name:"PRIZE_SETTINGS",propPath:["content","prize"],params:{linkedGamifiedComponentType:"PRIZE_BASED_GAMING"},displayCondition:function(t){return t.documentUtils.findComponentsByTypes(t.views,["PRIZE_BASED_GAMING"]).some((function(e){return e.path[0]<t.component.path[0]}))}},{type:"CONTROL",name:"SWITCH",propPath:["content","countAsTargetAction"],params:{label:"i18n_DOCUMENT_COUNT_AS_TARGET_ACTION_LABEL",boldLabel:!0,tooltip:"i18n_DOCUMENT_COUNT_AS_TARGET_ACTION_TOOLTIP"},displayCondition:function(t){return"INFORMER"===t.widgetType}}]},autoContrast:[{slave:{element:"text",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"text",elementProp:"styleAttributes",elementSubProp:"background"},enabledPropPath:["content","textContrastEnabled"]},{slave:{element:"icon",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"text",elementProp:"styleAttributes",elementSubProp:"background"},enabledPropPath:["content","iconContrastEnabled"]}],i18nPropPaths:["content,text"],props:{styles:[{element:"text",styleAttributes:{borderTopStyle:"dashed",borderRightStyle:"dashed",borderBottomStyle:"dashed",borderLeftStyle:"dashed",borderTopWidth:"2px",borderTopColor:"var(--cl-schema-accent, rgb(68, 68, 68))",borderBottomWidth:"2px",borderBottomColor:"var(--cl-schema-accent, rgb(68, 68, 68))",borderLeftWidth:"2px",borderLeftColor:"var(--cl-schema-accent, rgb(68, 68, 68))",borderRightWidth:"2px",borderRightColor:"var(--cl-schema-accent, rgb(68, 68, 68))",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none",background:"transparent"},hoverStyleAttributes:{}},{element:"icon",styleAttributes:{display:"flex",position:"static",marginLeft:"10px",right:"5px",color:"var(--cl-schema-accent, rgb(68, 68, 68))","--clPromocodeIconWidth":"18px","--clPromocodeIconHeight":"18px"}}],adaptiveStyles:(ft=[{element:"host",styleAttributes:{width:"auto",minWidth:null,height:"auto",minHeight:null,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1}},{element:"text",styleAttributes:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"20px",paddingRight:"20px",_paddingEnabled:!0,color:"var(--cl-schema-accent, rgb(68, 68, 68))",textAlign:"center",lineHeight:"120%",fontWeight:"500",fontSize:"18px",textShadow:"none"},classes:""}],Object.values(st).reduce(((t,e)=>Object.assign(t,{[e]:at(ft)})),{desktop:[],mobile:[]})),content:{text:"SALE_15",iconContent:0,iconContrastEnabled:!0,textContrastEnabled:!0}},metaDescription:{icon:"/SysPromoCodeComponent/assets/img/component-icon.svg",label:{en:"Promo code",ru:"Промокод",uk:"Промокод",es:"Código promocional",fr:"Code promo",de:"Gutscheincode",it:"Codice promozionale",pt:"Código promocional",ro:"Cod promoțional",bg:"Промоционален код",cs:"Promo kód",el:"Κωδικός προσφοράς",nl:"Promotiecode",pl:"Kod promocyjny",sv:"Rabattkod",tr:"Promosyon kodu",ar:"الرمز الترويجي",zh:"促销码",da:"Kampagnekode",he:"קוד קידום",fi:"Alennuskoodi",hi:"प्रोमो कोड",hr:"Promotivni kod",hu:"Promo kód",id:"Kode promo",ja:"プロモコード",ko:"프로모션 코드",no:"Kampanjekode",sk:"Propagačný kód",sl:"Promocijska koda",sr:"Promo kod"}},syncEnabled:!0,stylesImitationEnabled:!0};var ft;const bt={en:"Copied!",ru:"Скопировано!",uk:"Скопійовано!",es:"Copiado!",de:"Kopiert!",fr:"Copié!",it:"Copiato!",pt:"Copiado!",ro:"Copiat!",bg:"Копирано!",cs:"Zkopírováno!",el:"Αντιγράφηκε!",nl:"Gekopieerd!",pl:"Skopiowane!",sv:"Kopierade!",tr:"Kopyalandı!",ar:"نسخ!",hu:"Másolva!"},vt=['\n <svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24">\n <path d="M7.9,9.5L0,3.8c1.2-1.6,3.4-2,5.1-0.9l8.5,6l3.1-2.2c-1.2-2-0.6-4.6,1.3-5.9c2-1.4,4.8-0.9,6.2,1.1 c1.4,2,0.9,4.8-1.1,6.3c-1.4,1-3.1,1.1-4.6,0.3l-3.8,2.7l3.8,2.7c1.4-0.7,3.2-0.6,4.6,0.3c2,1.4,2.5,4.2,1.1,6.3 c-1.4,2-4.2,2.5-6.2,1.1c-1.9-1.4-2.5-3.9-1.3-5.9l-4-2.7H7.4l3-1.7L7.9,9.5z M22.8,17.9c0-1.3-1-2.3-2.3-2.3c-1.3,0-2.3,1-2.3,2.3 c0,1.3,1,2.3,2.3,2.3C21.8,20.2,22.8,19.2,22.8,17.9z M22.8,4.5c0-1.3-1-2.3-2.3-2.3c-1.3,0-2.3,1-2.3,2.3s1,2.3,2.3,2.3 C21.8,6.8,22.8,5.8,22.8,4.5z" fill="currentColor"/>\n </svg>\n ','\n <svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24" fill="none">\n <path d="M10.5278 12.0003L0.0870176 20.5846C0.0276258 20.6336 0.021828 20.72 0.0784574 20.7716C0.735083 21.3673 4.70771 24.1658 13.7643 14.862L15.2546 16.1708C15.0272 16.728 14.9013 17.3393 14.9013 17.9815C14.9013 20.571 16.9449 22.667 19.47 22.667C21.9952 22.667 24.0391 20.571 24.0391 17.9815C24.0391 15.392 21.9952 13.2961 19.47 13.2961C18.5938 13.2961 17.7758 13.5487 17.0811 13.9867L14.8192 12.0003L17.0811 10.0137C17.7761 10.4516 18.5941 10.7043 19.47 10.7043C21.9952 10.7043 24.0391 8.60803 24.0391 6.01913C24.0391 3.43022 21.9952 1.33366 19.47 1.33366C16.9449 1.33366 14.9013 3.42965 14.9013 6.01913C14.9013 6.66132 15.0272 7.27265 15.2546 7.82986L13.764 9.13947C4.70771 -0.164618 0.735083 2.63335 0.0784574 3.22909C0.021828 3.28093 0.0276258 3.36677 0.0870176 3.41606L10.5278 12.0003ZM19.47 15.7884C20.6518 15.7886 21.6087 16.7696 21.6087 17.9815C21.6087 19.1934 20.6518 20.1747 19.47 20.1747C18.2885 20.1747 17.3317 19.1934 17.3317 17.9815C17.3317 16.7696 18.2885 15.7884 19.47 15.7884ZM19.47 3.82625C20.6518 3.82625 21.6087 4.80725 21.6087 6.01913C21.6087 7.231 20.6518 8.21229 19.47 8.21229C18.2885 8.21229 17.3317 7.231 17.3317 6.01913C17.3317 4.80725 18.2885 3.82625 19.47 3.82625Z" fill="currentColor"/>\n </svg>\n '],yt=['\n <svg width="16" height="18" viewBox="0 0 16 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3 0H10C11.6569 0 13 1.34315 13 3V12C13 13.6569 11.6569 15 10 15H3C1.34315 15 0 13.6569 0 12V3C0 1.34314 1.34315 0 3 0ZM3 2C2.44772 2 2 2.44772 2 3V12C2 12.5523 2.44772 13 3 13H10C10.5523 13 11 12.5523 11 12V3C11 2.44772 10.5523 2 10 2H3Z" fill="currentColor"/>\n <path d="M3 15C3 16.6569 4.34315 18 6 18H13C14.6569 18 16 16.6569 16 15V6C16 4.34315 14.6569 3 13 3V5C13.5523 5 14 5.44772 14 6V15C14 15.5523 13.5523 16 13 16H6C5.44772 16 5 15.5523 5 15H3Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M10.8 1H2.2C1.53726 1 1 1.53726 1 2.2V12.8C1 13.4627 1.53726 14 2.2 14H10.8C11.4627 14 12 13.4627 12 12.8V2.2C12 1.53726 11.4627 1 10.8 1ZM2.2 0C0.984974 0 0 0.984973 0 2.2V12.8C0 14.015 0.984973 15 2.2 15H10.8C12.015 15 13 14.015 13 12.8V2.2C13 0.984974 12.015 0 10.8 0H2.2Z" fill="currentColor"/>\n <path d="M4 15V15.8C4 16.4627 4.53726 17 5.2 17H13.8C14.4627 17 15 16.4627 15 15.8V5.2C15 4.53726 14.4627 4 13.8 4H12.9492V3H13.8C15.015 3 16 3.98497 16 5.2V15.8C16 17.015 15.015 18 13.8 18H5.2C3.98497 18 3 17.015 3 15.8V15H4Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M2.2 0C0.984974 0 0 0.984973 0 2.2V12.8C0 14.015 0.984973 15 2.2 15H10.8C12.015 15 13 14.015 13 12.8V2.2C13 0.984974 12.015 0 10.8 0H2.2Z" fill="currentColor"/>\n <path d="M4 15V15.8C4 16.4627 4.53726 17 5.2 17H13.8C14.4627 17 15 16.4627 15 15.8V5.2C15 4.53726 14.4627 4 13.8 4H12.9492V3H13.8C15.015 3 16 3.98497 16 5.2V15.8C16 17.015 15.015 18 13.8 18H5.2C3.98497 18 3 17.015 3 15.8V15H4Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path d="M0 2C0 0.89543 0.895431 0 2 0H11C12.1046 0 13 0.895431 13 2V13C13 14.1046 12.1046 15 11 15H2C0.89543 15 0 14.1046 0 13V2Z" fill="currentColor"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3 16C3 17.1046 3.89543 18 5 18H14C15.1046 18 16 17.1046 16 16V5C16 3.89543 15.1046 3 14 3V13C14 14.6569 12.6569 16 11 16H3ZM3 15V5C3 3.89543 3.89543 3 5 3H13V13C13 14.1046 12.1046 15 11 15H3Z" fill="currentColor"/>\n </svg>\n '];var Et="12px",Ct="14px";const Tt="\n .cl-promo-code-tooltip-container {\n z-index: ".concat(String(Number.MAX_SAFE_INTEGER),";\n padding: 10px;\n display: inline-block;\n position: fixed;\n background: #000;\n opacity: 1;\n border: 2px solid #FFF;\n border-radius: 5px;\n max-height: fit-content;\n }\n \n .cl-promo-code-tooltip-container[cl-tooltip-position='top']:after {\n content: \"\";\n position: absolute;\n top: 100%;\n left: calc(50% - 5px);\n margin-left: -8px;\n margin-top: -2px;\n border-width: ").concat(Et,";\n border-style: solid;\n border-color: black transparent transparent transparent;\n }\n\n .cl-promo-code-tooltip-container[cl-tooltip-position='top']:before {\n content: \"\";\n position: absolute;\n top: 100%;\n left: calc(50% - 15px);\n border-width: ").concat(Ct,";\n border-style: solid;\n border-color: white transparent transparent transparent;\n }\n \n .cl-promo-code-tooltip-container[cl-tooltip-position='bottom']:after {\n content: \"\";\n position: absolute;\n top: -22px;\n left: calc(50% - 4px);\n margin-left: -5px;\n margin-bottom: -2px;\n border-width: ").concat(Et,";\n border-style: solid;\n border-color: transparent transparent black transparent;\n }\n\n .cl-promo-code-tooltip-container[cl-tooltip-position='bottom']:before {\n content: \"\";\n position: absolute;\n top: -28px;\n left: calc(50% - 11px);\n border-width: ").concat(Ct,";\n border-style: solid;\n border-color: transparent transparent white transparent;\n }\n");class Ot{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){var e;const n=t||document;return Math.max(n.documentElement.clientWidth,(null===(e=n.defaultView)||void 0===e?void 0:e.innerWidth)||0)}static height(t){var e;const n=t||document;return Math.max(n.documentElement.clientHeight,(null===(e=n.defaultView)||void 0===e?void 0:e.innerHeight)||0)}static scrollbarWidth(t){var e;const n=t||document;return((null===(e=n.defaultView)||void 0===e?void 0:e.innerWidth)||0)-n.documentElement.clientWidth}}var St=[];for(var At in{transparent:"#0000"})St.push(At);var _t="\\s*([.\\d%]+)\\s*",xt="\\("+[_t,_t,_t]+"(?:,\\s*([.\\d]+)\\s*)?\\)",Rt="(?:rgb)a?",It="("+St.join("|")+")";function Nt(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}RegExp(Rt+xt,"i"),RegExp([It,"(?:#([a-f0-9]{3,8}))",Rt+xt,"(?:hsl)a?"+xt].join("|"),"gi");var Lt=Array.prototype.concat,wt=Array.prototype.slice,Pt=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var i=t[n];Nt(i)?e=Lt.call(e,wt.call(i)):e.push(i)}return e};Pt.wrap=function(t){return function(){return t(Pt(arguments))}};const Mt=Pt;var kt={},jt=Object.hasOwnProperty,Dt=Object.create(null);for(var Bt in kt)jt.call(kt,Bt)&&(Dt[kt[Bt]]=Bt);var Ht={to:{},get:{}};function Ut(t,e,n){return Math.min(Math.max(e,t),n)}Ht.get=function(t){var e,n;return"hsl"===t.substring(0,3).toLowerCase()?(e=Ht.get.hsl(t),n="hsl"):(e=Ht.get.rgb(t),n="rgb"),e?{model:n,value:e}:null},Ht.get.rgb=function(t){if(!t)return null;var e,n,o,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){var r=2*n;i[n]=parseInt(e.slice(r,r+2),16)}o&&(i[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);o&&(i[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:jt.call(kt,e[1])?((i=kt[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=Ut(i[n],0,255);return i[3]=Ut(i[3],0,1),i},Ht.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,Ut(parseFloat(e[2]),0,100),Ut(parseFloat(e[3]),0,100),Ut(isNaN(n)?1:n,0,1)]}return null},Ht.to.rgb=function(){var t=Mt(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},Ht.to.hsl=function(){var t=Mt(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};const Ft=Ht,Wt={},Vt={};for(const t of Object.keys(Wt))Vt[Wt[t]]=t;const Gt={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const t of Object.keys(Gt)){if(!("channels"in Gt[t]))throw new Error("missing channels property: "+t);if(!("labels"in Gt[t]))throw new Error("missing channel labels property: "+t);if(Gt[t].labels.length!==Gt[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=Gt[t];delete Gt[t].channels,delete Gt[t].labels,Object.defineProperty(Gt[t],"channels",{value:e}),Object.defineProperty(Gt[t],"labels",{value:n})}Gt.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,i=Math.min(e,n,o),r=Math.max(e,n,o),s=r-i;let l,a;r===i?l=0:e===r?l=(n-o)/s:n===r?l=2+(o-e)/s:o===r&&(l=4+(e-n)/s),l=Math.min(60*l,360),l<0&&(l+=360);const c=(i+r)/2;return a=r===i?0:c<=.5?s/(r+i):s/(2-r-i),[l,100*a,100*c]},Gt.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,o=t[2]/100;let i,r,s;if(0===n)return s=255*o,[s,s,s];i=o<.5?o*(1+n):o+n-o*n;const l=2*o-i,a=[0,0,0];for(let t=0;t<3;t++)r=e+1/3*-(t-1),r<0&&r++,r>1&&r--,s=6*r<1?l+6*(i-l)*r:2*r<1?i:3*r<2?l+(i-l)*(2/3-r)*6:l,a[t]=255*s;return a};const $t=Gt;function Kt(t,e){return function(n){return e(t(n))}}function zt(t,e){const n=[e[t].parent,t];let o=$t[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),o=Kt($t[e[i].parent][i],o),i=e[i].parent;return o.conversion=n,o}const Zt={};Object.keys($t).forEach((t=>{Zt[t]={},Object.defineProperty(Zt[t],"channels",{value:$t[t].channels}),Object.defineProperty(Zt[t],"labels",{value:$t[t].labels});const e=function(t){const e=function(t){const e=function(){const t={},e=Object.keys($t);for(let n=e.length,o=0;o<n;o++)t[e[o]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;){const t=n.pop(),o=Object.keys($t[t]);for(let i=o.length,r=0;r<i;r++){const i=o[r],s=e[i];-1===s.distance&&(s.distance=e[t].distance+1,s.parent=t,n.unshift(i))}}return e}(t),n={},o=Object.keys(e);for(let t=o.length,i=0;i<t;i++){const t=o[i];null!==e[t].parent&&(n[t]=zt(t,e))}return n}(t);Object.keys(e).forEach((n=>{const o=e[n];Zt[t][n]=function(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const o=t(e);if("object"==typeof o)for(let t=o.length,e=0;e<t;e++)o[e]=Math.round(o[e]);return o};return"conversion"in t&&(e.conversion=t.conversion),e}(o),Zt[t][n].raw=function(t){const e=function(...e){const n=e[0];return null==n?n:(n.length>1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(o)}))}));const Qt=Zt,qt=["keyword","gray","hex"],Xt={};for(const t of Object.keys(Qt))Xt[[...Qt[t].labels].sort().join("")]=t;const Yt={};function Jt(t,e){if(!(this instanceof Jt))return new Jt(t,e);if(e&&e in qt&&(e=null),e&&!(e in Qt))throw new Error("Unknown model: "+e);let n,o;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof Jt)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const e=Ft.get(t);if(null===e)throw new Error("Unable to parse color from string: "+t);this.model=e.model,o=Qt[this.model].channels,this.color=e.value.slice(0,o),this.valpha="number"==typeof e.value[o]?e.value[o]:1}else if(t.length>0){this.model=e||"rgb",o=Qt[this.model].channels;const n=Array.prototype.slice.call(t,0,o);this.color=ne(n,o),this.valpha="number"==typeof t[o]?t[o]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const e=Object.keys(t);"alpha"in t&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const o=e.sort().join("");if(!(o in Xt))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=Xt[o];const{labels:i}=Qt[this.model],r=[];for(n=0;n<i.length;n++)r.push(t[i[n]]);this.color=ne(r)}if(Yt[this.model])for(o=Qt[this.model].channels,n=0;n<o;n++){const t=Yt[this.model][n];t&&(this.color[n]=t(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Jt.prototype={toString(){return this.string()},string(t){let e=this.model in Ft.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return Ft.to[e.model](n)},round(t){return t=Math.max(t||0,0),new Jt([...this.color.map(te(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new Jt([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},lighten(t){const e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){const e=this.hsl();return e.color[2]-=e.color[2]*t,e}};for(const t of Object.keys(Qt)){if(qt.includes(t))continue;const{channels:e}=Qt[t];Jt.prototype[t]=function(...e){return this.model===t?new Jt(this):e.length>0?new Jt(e,t):new Jt([...ee(Qt[this.model][t].raw(this.color)),this.valpha],t)},Jt[t]=function(...n){let o=n[0];return"number"==typeof o&&(o=ne(n,e)),new Jt(o,t)}}function te(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function ee(t){return Array.isArray(t)?t:[t]}function ne(t,e){for(let n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}const oe=Jt;function ie(t,e){Object.keys(e).forEach((n=>{t.style[n]=e[n]}))}function re(t,e,n){const o=function(t,e){const n=getComputedStyle(t)[e]||t.style.getPropertyValue(e);if(n&&n.includes("rgb")&&(!(n.split("rgb").length>2)||n.includes("#")))return n}(e,n);if(o){const e=oe(o).alpha(.5).string();return t.classList.add("focus-outline-defined"),t.style.setProperty("--clFocusOutline",`3px solid ${e}`),e}return null}function se(t){const{width:e,height:n}=t.getBoundingClientRect(),{marginBottom:o,marginTop:i,marginLeft:r,marginRight:s}=window.getComputedStyle(t);return{width:e+parseInt(r,10)+parseInt(s,10),height:n+parseInt(i,10)+parseInt(o,10)}}function le(t,e,n,o,i){switch(t.position){case"top":return{left:`${ae(e,n,o,i)}px`,top:t.availableSpaceAboveTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"bottom":return{left:`${ae(e,n,o,i)}px`,bottom:t.availableSpaceBelowTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"left":return{left:t.availableSpaceToTheLeftSideOfTheTrigger-e.width-t.contentWidth-t.horizontalOffset+"px",top:`${ce(0,t)}px`};case"right":return{right:t.availableSpaceToTheRightSideOfTheTrigger-t.contentWidth-t.horizontalOffset+"px",top:`${ce(0,t)}px`}}}function ae(t,e,n,o){let i=n?t.x+t.width/2-e.width/2:t.x;return i<0&&(i=0),i+e.width>Ot.width(o)&&(i-=i+e.width-Ot.width(o)),i}function ce(t,e){let n=e.availableSpaceAboveTriggerElem;return e.contentHeight>e.availableSpaceBelowTriggerElem&&(n-=e.contentHeight-e.availableSpaceBelowTriggerElem),n}function he(t){const{triggerElement:e,tooltipElement:n,offset:o=10,htmlDocumentObject:i}=t,r=function(t,e,n,o,i,r){const s=function(t,e,n,o,i){const r=function(t,e,n,o){const i=Ot.width(o),{right:r}=t.getBoundingClientRect(),s=i-n-r-Ot.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:se(e).width,availableSpaceToTheLeftSideOfTheTrigger:r-n,availableSpaceToTheRightSideOfTheTrigger:s}}(t,e,n,i),s=function(t,e,n,o){const i=Ot.height(o),{top:r,bottom:s}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:se(e).height,availableSpaceAboveTriggerElem:r-n,availableSpaceBelowTriggerElem:i-s-n}}(t,e,n,i);let l="undefined";const a={bottom:s.availableSpaceBelowTriggerElem>=s.contentHeight,top:s.availableSpaceAboveTriggerElem>=s.contentHeight,right:r.availableSpaceToTheRightSideOfTheTrigger>=r.contentWidth,left:r.availableSpaceToTheLeftSideOfTheTrigger>=r.contentWidth};if(a.top?l="top":a.bottom?l="bottom":a.right?l="right":a.left&&(l="left"),o&&a[o]&&(l=o),"undefined"===l){const t=Math.max(s.availableSpaceBelowTriggerElem,s.availableSpaceAboveTriggerElem,r.availableSpaceToTheRightSideOfTheTrigger,r.availableSpaceToTheLeftSideOfTheTrigger);t===s.availableSpaceBelowTriggerElem?l="bottom":t===s.availableSpaceAboveTriggerElem?l="top":t===r.availableSpaceToTheRightSideOfTheTrigger?l="right":t===r.availableSpaceToTheLeftSideOfTheTrigger&&(l="left")}return Object.assign(Object.assign(Object.assign({},s),r),{position:l})}(t,e,n,o,r=r||document);return function(t,e){const{marginBottom:n,marginTop:o}=window.getComputedStyle(e);if("top"===t.position)ie(e,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),ie(e,{"margin-bottom":"0px"});else if("bottom"===t.position)ie(e,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),ie(e,{"margin-top":"0px"});else{const t=(parseInt(n,10)+parseInt(o,10))/2+"px";ie(e,{"margin-top":t,"margin-bottom":t})}}(s,e),{coordinates:le(s,t.getBoundingClientRect(),e.getBoundingClientRect(),i,r),position:s.position}}(e,n,o,"top",!0,i);n.setAttribute("cl-tooltip-position",r.position),ie(n,r.coordinates)}function de(t){return de="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},de(t)}function pe(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,ye(o.key),o)}}function ue(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ue=function(){return!!t})()}function me(t,e,n,o){var i=ge(fe(1&o?t.prototype:t),e,n);return 2&o&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function ge(){return ge="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=fe(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}},ge.apply(null,arguments)}function fe(t){return fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fe(t)}function be(t,e){return be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},be(t,e)}function ve(t,e,n){return(e=ye(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ye(t){var e=function(t){if("object"!=de(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=de(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==de(e)?e:e+""}var Ee="lastPromoCode",Ce=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),ve(e=function(t,e,n){return e=fe(e),function(t,e){if(e&&("object"==de(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,ue()?Reflect.construct(e,n||[],fe(t).constructor):e.apply(t,n))}(this,t),"renderTooltip",(function(t){var n=e.getTranslationsMap(bt).translations;e.tooltipContainerElement=document.createElement("div"),e.tooltipContainerElement.classList.add("cl-promo-code-tooltip-container");var o=document.createElement("div");o.style.padding="5px",o.style.color="#fff",o.innerText=n,e.tooltipContainerElement.append(o),e.htmlDocumentObject.body.appendChild(e.tooltipContainerElement),e.firstTooltipTimer=setTimeout((function(){he({triggerElement:t,tooltipElement:e.tooltipContainerElement,htmlDocumentObject:e.htmlDocumentObject}),e.boundOnScrollHandler=function(){return he({triggerElement:t,tooltipElement:e.tooltipContainerElement,htmlDocumentObject:e.htmlDocumentObject})},document.addEventListener("scroll",e.boundOnScrollHandler,!0),e.secondTooltipTimer=setTimeout((function(){e.removeScrollListener(),e.tooltipContainerElement.style.transition="0.15s",e.tooltipContainerElement.style.top="".concat(t.getBoundingClientRect().top+window.pageYOffset,"px"),e.tooltipContainerElement.style.opacity="0",e.thirdTooltipTimer=setTimeout((function(){e.destroyTooltip()}),150)}),1500)}))})),ve(e,"getTooltipTopPosition",(function(t,e,n){var o=t.getBoundingClientRect();return"".concat(o.top-e.height-n+window.pageYOffset,"px")})),ve(e,"getTooltipLeftPosition",(function(t,e){var n=t.getBoundingClientRect();return"".concat(n.left+n.width/2-e.width/2+window.pageXOffset,"px")})),ve(e,"destroyTooltip",(function(){e.tooltipContainerElement&&(e.tooltipContainerElement.remove(),e.tooltipContainerElement=null)})),ve(e,"clearTooltipTimers",(function(){clearTimeout(e.firstTooltipTimer),clearTimeout(e.secondTooltipTimer),clearTimeout(e.thirdTooltipTimer)})),ve(e,"removeScrollListener",(function(){document.removeEventListener("scroll",e.boundOnScrollHandler,!0)})),ve(e,"mapStyleControlValuesToInnerContent",(function(){var t=e.getElement("text"),n=e.getRootElement().querySelector('[cl-inline-edit="content, text"]');e.getElement("text").querySelector(".".concat(e.inlineEditPromocodeClass)).style.whiteSpace=e.isByContentWidth?"nowrap":"",t&&n&&(n.style.minWidth="20px",n.style.width="max-content",n.style.minHeight=t.style.fontSize,n.style.textAlign=t.style.textAlign,n.style.lineHeight=t.style.lineHeight,n.style.fontWeight=t.style.fontWeight,n.style.fontSize=t.style.fontSize,n.style.textShadow=t.style.textShadow,n.style.letterSpacing=t.style.letterSpacing,n.style.fontFamily=t.style.fontFamily)})),ve(e,"mapAlignValueToTextElementContent",(function(t){"center"===t.style.textAlign&&(t.style.justifyContent="center"),"start"===t.style.textAlign&&(t.style.justifyContent="flex-start"),"end"===t.style.textAlign&&(t.style.justifyContent="flex-end")})),ve(e,"handleSafariHeightIssue",(function(){var t=e.getHostElement();"auto"===t.style.height&&(t.style.height="fit-content")})),ve(e,"storeStrokeTopWidthAsCssVar",(function(){var t=e.getElement("host"),n=e.getElement("text");t.style.setProperty("--clStrokeForIconWidth",n.style.borderTopWidth||0)})),ve(e,"destroyExistingIcon",(function(){var t=e.getRootElement().querySelector('[cl-element="icon"]');t&&t.remove()})),ve(e,"showIconIfAny",(function(t,n){var o=n.content.iconContent,i=parseFloat(o),r=!isNaN(i);if(e.destroyExistingIcon(),null!=o){if(r){var s=(n.styles?"absolute"===n.styles.find((function(t){return"icon"===t.element})).styleAttributes.position:"absolute"===n.adaptiveStyles[e.getEnvironment()].find((function(t){return"icon"===t.element})).styleAttributes.position)?vt[i]:yt[i],l=document.createElement("span");l.classList.add("promocode-icon"),l.setAttribute("cl-element","icon"),ct({element:l,html:s}),t.appendChild(l)}else{var a=document.createElement("img");a.src=o,a.classList.add("promocode-icon"),a.setAttribute("cl-element","icon"),t.appendChild(a)}e.applyAutoAdaptiveStyles(n.adaptiveStyles,n.styles)}})),ve(e,"addTooltipStyles",(function(){if(!e.htmlDocumentObject.head.querySelector("#".concat(e.tooltipStylesId))){var t=document.createElement("style");t.setAttribute("id",e.tooltipStylesId),ct({element:t,html:Tt}),e.htmlDocumentObject.head.appendChild(t)}})),ve(e,"removeTooltipStyles",(function(){var t=e.htmlDocumentObject.head.querySelector("#".concat(e.tooltipStylesId));t&&t.remove()})),ve(e,"_handleContextRecord",(function(t){var n;if(!e.services.context.getKVMap().promoCode&&t.key===Ee){var o=e.getModel();if(!(t.value.viewIndex>=o.path[0])){var i=(null===(n=e.services.context.getRecord(Ee))||void 0===n?void 0:n.value.value)||null,r=e.getElement("text").querySelector(".".concat(e.inlineEditPromocodeClass));i?(r.removeAttribute(e.inlineEditAttributeName),r.innerText=i):r.setAttribute(e.inlineEditAttributeName,e.inlineEditAttributeValue)}}})),ve(e,"checkWidthMode",(function(t){var n,o=e.getEnvironment(),i=null===(n=t.adaptiveStyles[o])||void 0===n||null===(n=n.find((function(t){return"host"===t.element})))||void 0===n?void 0:n.styleAttributes.width;e.isByContentWidth="auto"===i,e.isByContainerWidth="100%"===i})),ve(e,"manifest",gt),ve(e,"tooltipContainerElement",void 0),ve(e,"firstTooltipTimer",void 0),ve(e,"secondTooltipTimer",void 0),ve(e,"thirdTooltipTimer",void 0),ve(e,"boundOnScrollHandler",void 0),ve(e,"contextSubscriptions",[]),ve(e,"tooltipStylesId","cl-promo-code-tooltip-styles"),ve(e,"inlineEditPromocodeClass","cl--inline--edit"),ve(e,"inlineEditAttributeName","cl-inline-edit"),ve(e,"inlineEditAttributeValue","content, text"),ve(e,"isByContainerWidth",!1),ve(e,"isByContentWidth",!1),e.getRootElement().innerHTML="\n <style>".concat("\n.text {\n outline: none;\n min-height: 20px;\n cursor: pointer;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n position: relative;\n}\n\n.promocode-icon {\n top: calc(((var(--clPromocodeIconHeight) / 2) * -1) - var(--clStrokeForIconWidth));\n width: var(--clPromocodeIconWidth);\n height: var(--clPromocodeIconHeight);\n}\n\n.promocode-icon svg {\n display: flex;\n width: 100%;\n height: auto;\n}\n\nbutton.focus-outline-defined:focus {\n outline: var(--clFocusOutline);\n}\n\n.cl--inline--edit {\n overflow-wrap: break-word;\n max-width: 100%;\n}\n",'</style>\n <button class="text" cl-element="text">\n <span class="').concat(e.inlineEditPromocodeClass,'" ').concat(e.inlineEditAttributeName,'="').concat(e.inlineEditAttributeValue,'"></span>\n </button>'),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&&be(t,e)}(t,ut),function(t,e){return e&&pe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;me(t,"connectedCallback",this,3)([]),this.addTooltipStyles();var n=this.getElement("text"),o=n.querySelector("[".concat(this.inlineEditAttributeName,'="').concat(this.inlineEditAttributeValue,'"]'));this.contextSubscriptions=[this.services.context.on("RECORD_ADDED",this._handleContextRecord.bind(this)),this.services.context.on("RECORD_UPDATED",this._handleContextRecord.bind(this)),this.services.context.on("RECORD_DELETED",this._handleContextRecord.bind(this))],this.isStaticRenderMode()&&n.addEventListener("click",(function(t){var i,r;t.stopPropagation(),(i=o.textContent,(null===(r=navigator.clipboard)||void 0===r?void 0:r.writeText)?navigator.clipboard.writeText(String(i).trim().replace("<br>"," ")):Promise.reject()).then((function(){e.destroyTooltip(),e.clearTooltipTimers(),e.removeScrollListener(),e.renderTooltip(n)})).catch((function(t){return console.error("SysPromoCodeComponent couldn't write to clipboard",t)})),e.services.trackingService.send("FormClick_[Name]"),e.services.trackingService.trackClick({countAsTargetAction:e.getProps().content.countAsTargetAction}),e.services.trackingService.trackTargetAction(e.getProps().content.countAsTargetAction)})),this.observeProps((function(t,i){e.applyAutoAdaptiveStyles(i.adaptiveStyles,i.styles),e.checkWidthMode(i);var r=e.services.context.getKVMap().promoCode;r?o.innerText=r:ct({element:o,html:i.content.text});var s=e.services.context.getRecord(Ee);s&&e._handleContextRecord(s),e.mapAlignValueToTextElementContent(e.getElement("text")),e.mapStyleControlValuesToInnerContent(),e.showIconIfAny(n,i),e.storeStrokeTopWidthAsCssVar(),e.handleSafariHeightIssue(),function(t){let e=null;const n=t,o=["transparent","initial"];t&&(t.style.borderColor&&!o.includes(t.style.borderColor)&&(parseFloat(t.style.borderWidth)||parseFloat(t.style.borderBottomWidth))&&(e=re(n,t,"borderColor")),!e&&t.style.getPropertyValue("--borderBottomColor")&&!o.includes(t.style.getPropertyValue("--borderBottomColor"))&&parseFloat(t.style.getPropertyValue("--borderBottomWidth"))&&(e=re(n,t,"--borderBottomColor")),e||!t.style.backgroundColor||o.includes(t.style.backgroundColor)||(e=re(n,t,"backgroundColor")),e||!t.style.color||o.includes(t.style.color)||(e=re(n,t,"color")),e||n.classList.remove("focus-outline-defined"))}(e.getElement("text"))})),this.observeShared((function(){e.mapAlignValueToTextElementContent(e.getElement("text")),e.mapStyleControlValuesToInnerContent()})),this.observeEnvironment((function(){e.handleSafariHeightIssue(),e.mapStyleControlValuesToInnerContent()}))}},{key:"disconnectedCallback",value:function(){me(t,"disconnectedCallback",this,3)([]),this.destroyTooltip(),this.clearTooltipTimers(),this.removeScrollListener(),this.removeTooltipStyles(),this.contextSubscriptions.forEach((function(t){return t.off()}))}}])}();ve(Ce,"define",{name:"sys-promo-code",model:gt.name,manifest:gt});export{Ce as default};window.clComponentClass_SysPromoCodeComponent=Ce;
|
|
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",l="BUTTON",a="CONSENT",c="COLUMN";var d,h;(h=d||(d={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",h.REQUEST="REQUEST",h.DISPATCH_EVENT="DISPATCH_EVENT",h.GO_TO_VIEW="GO_TO_VIEW",h.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",h.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",h.SHOW_WIDGET="SHOW_WIDGET",h.OPEN_LINK="OPEN_LINK",h.CLOSE_WIDGET="CLOSE_WIDGET",h.CLICK="CLICK";const p=d;var u,m;class g{static sortActions(t){const e={[p.CLOSE_WIDGET]:-1,[p.OPEN_LINK]:-2,[p.SHOW_WIDGET]:1,[p.SUBSCRIBE_CONTACT]:2,[p.REQUEST]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>n(t)>n(e)?-1:n(t)<n(e)?1:0))}constructor(t,e){this.config=t,this.actions=g.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,o){this.state=t;const i=o(),r=i.getAttribute(n("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(n("type"))));let o=0;for(;e[o]&&e[o].getAttribute(n("id"))!==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=[l,a,s],(m=u||(u={})).CLICK="CLICK",m.COMPONENT_EVENT="COMPONENT_EVENT";class f{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class b{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map((t=>this.actionFactory.get(t)));switch(e.forEach((t=>this.actionRegister.register(t))),t.type){case u.CLICK:return new g(t,e);case u.COMPONENT_EVENT:return new f(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class v{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 y{constructor(){this.listeners=y.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=v.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=y.createDefaultListenersState()}}y.createDefaultListenersState=()=>({"*":{}});const E=y,C=(t,e,n,o)=>{const i=EventTarget.prototype,{addEventListenerBase:r,addEventListener:s}=i;(r||s).call(t,e,n,o)};class T{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class O{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===i?Object.assign(Object.assign({},t),O.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 S,A,_,x,R,N,I,L,P,w,M,k,D;O.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(A=S||(S={})).VIEW="VIEW",A.CONTAINER="CONTAINER",A.TEXT="TEXT",A.INPUT="INPUT",A.BUTTON="BUTTON",A.IMAGE="IMAGE",A.CONSENT="CONSENT",A.COUNTDOWN_TIMER="COUNTDOWN_TIMER",A.PROMO_CODE="PROMO_CODE",A.MULTIPLE_INPUT="MULTIPLE_INPUT",A.VIDEO="VIDEO",A.SLIDER="SLIDER",A.SLIDE="SLIDE",A.SOCIAL="SOCIAL",A.COLUMNS="COLUMNS",A.COLUMN="COLUMN",A.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(_||(_={})).CLICK="CLICK",function(t){t.SHOW_WIDGET="SHOW_WIDGET",t.OPEN_LINK="OPEN_LINK",t.SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",t.REQUEST="REQUEST",t.CLOSE_WIDGET="CLOSE_WIDGET",t.GO_TO_VIEW="GO_TO_VIEW",t.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",t.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",t.CLICK="CLICK"}(x||(x={})),function(t){t.SELF="_self",t.BLANK="_blank"}(R||(R={})),(N||(N={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(I||(I={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(L||(L={})),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"}(w||(w={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(M||(M={})),(D=k||(k={})).BEFORE="BEFORE",D.AFTER="AFTER",D.INSIDE="INSIDE",D.INSTEAD="INSTEAD";class j extends E{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(j.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(j.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(j.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}j.changeEventName="CHANGE";const B=j;class H{static set(t,e){const n=t[H.accumulatorPropertyName]||{};t[H.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[H.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}H.accumulatorPropertyName="clStyleAttributes";const U=H;var F;!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"}(F||(F={}));class W{static applyHostStyles(t,e,n=null,i){var s,l,a;const d=null===(l=null===(s=null==n?void 0:n.props)||void 0===s?void 0:s.handlers)||void 0===l?void 0:l.find((t=>"CLICK"===t.type));d&&(null===(a=d.actions)||void 0===a?void 0:a.length)&&(e.style.cursor="pointer"),t!==o&&t!==r&&t!==c||(e.style.display=i===F.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 V{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class G{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,l;const a=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)))||{},d=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),h=this.parseBackground(d);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),V.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 $=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 K(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]})),{})}class z{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}}class Z{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}var Q;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.EXECUTE_ACTION_BY_PREDICATE="EXECUTE_ACTION_BY_PREDICATE"}(Q||(Q={}));const q=Q;class X{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(q.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(q.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new Z(this.onCounterStateUpdate)}}}const Y=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>Y(...t)}},J=Y,tt="props",et="shared",nt="environment";function ot(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 it="SUBMIT";function rt(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{if("element"===n||"classes"===n)return;const o=e[n];o&&"object"==typeof o&&!Array.isArray(o)?t[n]=Object.assign(Object.assign({},t[n]||{}),o):t[n]=o})),t):t}const st={DESKTOP:"desktop",MOBILE:"mobile"};function lt(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 at(t=[]){return t.map((t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)})))}function ct(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}class dt extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}var ht;!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(ht||(ht={}));class pt extends HTMLElement{constructor(){var o;super(),this.skipGameBlur=!0,this.construct=()=>{let t;const e=this.getAttribute(n("id")),o=this.getWidgetContainerNode();if(!o)throw new Error("Widget container not found in construct");const 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=J(tt,et,nt),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach((t=>null==t?void 0:t.off()))}},this.state=new T({}),this.componentEventEmitter=new E,this.componentResourceManager=new X(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new b(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(tt).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),o=n("floating");t.floating&&!e.getAttribute(o)?e.setAttribute(o,"true"):!t.floating&&e.getAttribute(o)&&e.removeAttribute(o)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(et).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new G(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),$),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(B.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(nt).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_READY_TO_PLAY",(()=>{this.skipGameBlur||this.getHostElement().classList.add("cl-game-spotlight-component")}))),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_COMPLETED",(()=>{this.skipGameBlur||this.getHostElement().classList.remove("cl-game-spotlight-component")})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===ht.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===ht.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(tt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(et).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(nt).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${n("element")}]`)).filter((t=>!t.hasAttribute(n("component"))))],this.getElement=(t,e)=>this.getElements().find((o=>e?o.getAttribute(n("element"))===t&&o.id===e:o.getAttribute(n("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const o=this.getElements();if(!o.length)return;const 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&&(rt(n,t),o=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(rt(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 l=this.getRootElement().querySelector(`style[${r}="${s}"]`);l||(l=document.createElement("style"),l.setAttribute(r,s),this.getRootElement().appendChild(l)),ct({element:l,html:""}),o.forEach((t=>{let e=t.getAttribute(n("element"));const o=this.getEnvironment();let r=lt(i,o,e);if(r){if(this.resizeListener.isMobile()){const t=lt(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),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,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,o)=>{var i,r;const s=[];"host"===(e=pt._resolveTogglableStylesForElementModel(e)).element&&(W.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 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],C(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),C(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:K(e.styleAttributes,s)});if(U.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)),ct({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+` ${z.camelCaseToDashCase(e)}: ${o[e]}${r?" !important;":";"}`),"");ct({element:t,html:`[${n("element")}="${e}"]${i} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{ct({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,i,r;e.linkColor&&ct({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&ct({element:t,html:`a {color: ${null===(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)&&ct({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=()=>ot(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(n("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:ot(this.parentNode,n("path"),void 0,(t=>1===(null==t?void 0:t.split(",").length)))},this.getWidgetLanguages=()=>function(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t))}(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n,o,i,r,s;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===(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===it));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:p.REQUEST}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>{var t;return(null===(t=this.getProps())||void 0===t?void 0:t.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(o=this.constructor.define)||void 0===o?void 0:o.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}));const t=document.createElement("style");t.textContent='\n :host(.cl-game-spotlight-component)::after {\n content: "";\n position: absolute;\n background-size: 100% 100%;\n background-repeat: no-repeat;\n overflow: visible;\n \n backdrop-filter: blur(4px);\n \n inset: -30px;\n mask-image: \n linear-gradient(to bottom, transparent, grey 30px, grey calc(100% - 30px), transparent),\n linear-gradient(to right, transparent, grey 30px, grey calc(100% - 30px), transparent);\n mask-composite: intersect;\n -webkit-mask-composite: source-in; /* for Chrome/Safari */\n \n transition: opacity 0.35s ease;\n pointer-events: auto;\n }\n ',this.getRootElement().prepend(t)}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}}pt._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=pt._resolveTogglableStyles(e[t]))})),e},pt._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 ut=pt;function mt(t){return Object.values(st).map((e=>({type:"GROUP",propPath:["adaptiveStyles",e],children:t})))}const gt={name:"SysPromoCodeComponent",componentType:"PROMO_CODE",version:"1.0.0",events:{dispatch:[],listen:[]},contextMenuModel:mt([{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]),floatingControlsModel:mt([{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]),propertyPaneModel:{content:mt([{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"text"}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"PROMOCODE_ICON",propPath:["styles","[element=icon]","styleAttributes"],params:{visibleDisplayValue:"flex"}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"HOVER_ANIMATION",propPath:["styles","[element=text]","hoverStyleAttributes"],params:{animationTypeProp:{propPath:["styles","[element=text]","hoverAnimationType"]}}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"text",params:{indentationType:"PADDING"}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}]),general:[{type:"TEXT",params:{text:"DOCUMENT_CLICK_COMPONENT_TO_COPY_TO_CLIPBOARD",type:"SECONDARY"},displayCondition:function(t){return!t.documentUtils.findComponentsByTypes(t.views,["PRIZE_BASED_GAMING"]).some((function(e){return e.path[0]<t.component.path[0]}))}},{type:"CONTROL",name:"PRIZE_SETTINGS",propPath:["content","prize"],params:{linkedGamifiedComponentType:"PRIZE_BASED_GAMING"},displayCondition:function(t){return t.documentUtils.findComponentsByTypes(t.views,["PRIZE_BASED_GAMING"]).some((function(e){return e.path[0]<t.component.path[0]}))}},{type:"CONTROL",name:"SWITCH",propPath:["content","countAsTargetAction"],params:{label:"i18n_DOCUMENT_COUNT_AS_TARGET_ACTION_LABEL",boldLabel:!0,tooltip:"i18n_DOCUMENT_COUNT_AS_TARGET_ACTION_TOOLTIP"},displayCondition:function(t){return"INFORMER"===t.widgetType}},{type:"CONTROL",name:"SWITCH",propPath:["content","autoRedeem"],params:{label:"i18n_DOCUMENT_AUTO_REDEEM_LABEL",boldLabel:!0,tooltip:"i18n_DOCUMENT_AUTO_REDEEM_TOOLTIP"},displayCondition:function(t){var e;return!0===(null===(e=t.editorConfig)||void 0===e?void 0:e.shopifyEnabled)}}]},autoContrast:[{slave:{element:"text",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"text",elementProp:"styleAttributes",elementSubProp:"background"},enabledPropPath:["content","textContrastEnabled"]},{slave:{element:"icon",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"text",elementProp:"styleAttributes",elementSubProp:"background"},enabledPropPath:["content","iconContrastEnabled"]}],i18nPropPaths:["content,text"],props:{styles:[{element:"text",styleAttributes:{borderTopStyle:"dashed",borderRightStyle:"dashed",borderBottomStyle:"dashed",borderLeftStyle:"dashed",borderTopWidth:"2px",borderTopColor:"var(--cl-schema-accent, rgb(68, 68, 68))",borderBottomWidth:"2px",borderBottomColor:"var(--cl-schema-accent, rgb(68, 68, 68))",borderLeftWidth:"2px",borderLeftColor:"var(--cl-schema-accent, rgb(68, 68, 68))",borderRightWidth:"2px",borderRightColor:"var(--cl-schema-accent, rgb(68, 68, 68))",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none",background:"transparent"},hoverStyleAttributes:{}},{element:"icon",styleAttributes:{display:"flex",position:"static",marginLeft:"10px",right:"5px",color:"var(--cl-schema-accent, rgb(68, 68, 68))","--clPromocodeIconWidth":"18px","--clPromocodeIconHeight":"18px"}}],adaptiveStyles:(ft=[{element:"host",styleAttributes:{width:"auto",minWidth:null,height:"auto",minHeight:null,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1}},{element:"text",styleAttributes:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"20px",paddingRight:"20px",_paddingEnabled:!0,color:"var(--cl-schema-accent, rgb(68, 68, 68))",textAlign:"center",lineHeight:"120%",fontWeight:"500",fontSize:"18px",textShadow:"none"},classes:""}],Object.values(st).reduce(((t,e)=>Object.assign(t,{[e]:at(ft)})),{desktop:[],mobile:[]})),content:{text:"SALE_15",iconContent:0,iconContrastEnabled:!0,textContrastEnabled:!0,autoRedeem:!0}},metaDescription:{icon:"/SysPromoCodeComponent/assets/img/component-icon.svg",label:{en:"Promo code",ru:"Промокод",uk:"Промокод",es:"Código promocional",fr:"Code promo",de:"Gutscheincode",it:"Codice promozionale",pt:"Código promocional",ro:"Cod promoțional",bg:"Промоционален код",cs:"Promo kód",el:"Κωδικός προσφοράς",nl:"Promotiecode",pl:"Kod promocyjny",sv:"Rabattkod",tr:"Promosyon kodu",ar:"الرمز الترويجي",zh:"促销码",da:"Kampagnekode",he:"קוד קידום",fi:"Alennuskoodi",hi:"प्रोमो कोड",hr:"Promotivni kod",hu:"Promo kód",id:"Kode promo",ja:"プロモコード",ko:"프로모션 코드",no:"Kampanjekode",sk:"Propagačný kód",sl:"Promocijska koda",sr:"Promo kod"}},syncEnabled:!0,stylesImitationEnabled:!0};var ft;const bt={en:"Copied!",ru:"Скопировано!",uk:"Скопійовано!",es:"Copiado!",de:"Kopiert!",fr:"Copié!",it:"Copiato!",pt:"Copiado!",ro:"Copiat!",bg:"Копирано!",cs:"Zkopírováno!",el:"Αντιγράφηκε!",nl:"Gekopieerd!",pl:"Skopiowane!",sv:"Kopierade!",tr:"Kopyalandı!",ar:"نسخ!",hu:"Másolva!"},vt=['\n <svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24">\n <path d="M7.9,9.5L0,3.8c1.2-1.6,3.4-2,5.1-0.9l8.5,6l3.1-2.2c-1.2-2-0.6-4.6,1.3-5.9c2-1.4,4.8-0.9,6.2,1.1 c1.4,2,0.9,4.8-1.1,6.3c-1.4,1-3.1,1.1-4.6,0.3l-3.8,2.7l3.8,2.7c1.4-0.7,3.2-0.6,4.6,0.3c2,1.4,2.5,4.2,1.1,6.3 c-1.4,2-4.2,2.5-6.2,1.1c-1.9-1.4-2.5-3.9-1.3-5.9l-4-2.7H7.4l3-1.7L7.9,9.5z M22.8,17.9c0-1.3-1-2.3-2.3-2.3c-1.3,0-2.3,1-2.3,2.3 c0,1.3,1,2.3,2.3,2.3C21.8,20.2,22.8,19.2,22.8,17.9z M22.8,4.5c0-1.3-1-2.3-2.3-2.3c-1.3,0-2.3,1-2.3,2.3s1,2.3,2.3,2.3 C21.8,6.8,22.8,5.8,22.8,4.5z" fill="currentColor"/>\n </svg>\n ','\n <svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24" fill="none">\n <path d="M10.5278 12.0003L0.0870176 20.5846C0.0276258 20.6336 0.021828 20.72 0.0784574 20.7716C0.735083 21.3673 4.70771 24.1658 13.7643 14.862L15.2546 16.1708C15.0272 16.728 14.9013 17.3393 14.9013 17.9815C14.9013 20.571 16.9449 22.667 19.47 22.667C21.9952 22.667 24.0391 20.571 24.0391 17.9815C24.0391 15.392 21.9952 13.2961 19.47 13.2961C18.5938 13.2961 17.7758 13.5487 17.0811 13.9867L14.8192 12.0003L17.0811 10.0137C17.7761 10.4516 18.5941 10.7043 19.47 10.7043C21.9952 10.7043 24.0391 8.60803 24.0391 6.01913C24.0391 3.43022 21.9952 1.33366 19.47 1.33366C16.9449 1.33366 14.9013 3.42965 14.9013 6.01913C14.9013 6.66132 15.0272 7.27265 15.2546 7.82986L13.764 9.13947C4.70771 -0.164618 0.735083 2.63335 0.0784574 3.22909C0.021828 3.28093 0.0276258 3.36677 0.0870176 3.41606L10.5278 12.0003ZM19.47 15.7884C20.6518 15.7886 21.6087 16.7696 21.6087 17.9815C21.6087 19.1934 20.6518 20.1747 19.47 20.1747C18.2885 20.1747 17.3317 19.1934 17.3317 17.9815C17.3317 16.7696 18.2885 15.7884 19.47 15.7884ZM19.47 3.82625C20.6518 3.82625 21.6087 4.80725 21.6087 6.01913C21.6087 7.231 20.6518 8.21229 19.47 8.21229C18.2885 8.21229 17.3317 7.231 17.3317 6.01913C17.3317 4.80725 18.2885 3.82625 19.47 3.82625Z" fill="currentColor"/>\n </svg>\n '],yt=['\n <svg width="16" height="18" viewBox="0 0 16 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3 0H10C11.6569 0 13 1.34315 13 3V12C13 13.6569 11.6569 15 10 15H3C1.34315 15 0 13.6569 0 12V3C0 1.34314 1.34315 0 3 0ZM3 2C2.44772 2 2 2.44772 2 3V12C2 12.5523 2.44772 13 3 13H10C10.5523 13 11 12.5523 11 12V3C11 2.44772 10.5523 2 10 2H3Z" fill="currentColor"/>\n <path d="M3 15C3 16.6569 4.34315 18 6 18H13C14.6569 18 16 16.6569 16 15V6C16 4.34315 14.6569 3 13 3V5C13.5523 5 14 5.44772 14 6V15C14 15.5523 13.5523 16 13 16H6C5.44772 16 5 15.5523 5 15H3Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M10.8 1H2.2C1.53726 1 1 1.53726 1 2.2V12.8C1 13.4627 1.53726 14 2.2 14H10.8C11.4627 14 12 13.4627 12 12.8V2.2C12 1.53726 11.4627 1 10.8 1ZM2.2 0C0.984974 0 0 0.984973 0 2.2V12.8C0 14.015 0.984973 15 2.2 15H10.8C12.015 15 13 14.015 13 12.8V2.2C13 0.984974 12.015 0 10.8 0H2.2Z" fill="currentColor"/>\n <path d="M4 15V15.8C4 16.4627 4.53726 17 5.2 17H13.8C14.4627 17 15 16.4627 15 15.8V5.2C15 4.53726 14.4627 4 13.8 4H12.9492V3H13.8C15.015 3 16 3.98497 16 5.2V15.8C16 17.015 15.015 18 13.8 18H5.2C3.98497 18 3 17.015 3 15.8V15H4Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M2.2 0C0.984974 0 0 0.984973 0 2.2V12.8C0 14.015 0.984973 15 2.2 15H10.8C12.015 15 13 14.015 13 12.8V2.2C13 0.984974 12.015 0 10.8 0H2.2Z" fill="currentColor"/>\n <path d="M4 15V15.8C4 16.4627 4.53726 17 5.2 17H13.8C14.4627 17 15 16.4627 15 15.8V5.2C15 4.53726 14.4627 4 13.8 4H12.9492V3H13.8C15.015 3 16 3.98497 16 5.2V15.8C16 17.015 15.015 18 13.8 18H5.2C3.98497 18 3 17.015 3 15.8V15H4Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path d="M0 2C0 0.89543 0.895431 0 2 0H11C12.1046 0 13 0.895431 13 2V13C13 14.1046 12.1046 15 11 15H2C0.89543 15 0 14.1046 0 13V2Z" fill="currentColor"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3 16C3 17.1046 3.89543 18 5 18H14C15.1046 18 16 17.1046 16 16V5C16 3.89543 15.1046 3 14 3V13C14 14.6569 12.6569 16 11 16H3ZM3 15V5C3 3.89543 3.89543 3 5 3H13V13C13 14.1046 12.1046 15 11 15H3Z" fill="currentColor"/>\n </svg>\n '];var Et="12px",Ct="14px";const Tt="\n .cl-promo-code-tooltip-container {\n z-index: ".concat(String(Number.MAX_SAFE_INTEGER),";\n padding: 10px;\n display: inline-block;\n position: fixed;\n background: #000;\n opacity: 1;\n border: 2px solid #FFF;\n border-radius: 5px;\n max-height: fit-content;\n }\n \n .cl-promo-code-tooltip-container[cl-tooltip-position='top']:after {\n content: \"\";\n position: absolute;\n top: 100%;\n left: calc(50% - 5px);\n margin-left: -8px;\n margin-top: -2px;\n border-width: ").concat(Et,";\n border-style: solid;\n border-color: black transparent transparent transparent;\n }\n\n .cl-promo-code-tooltip-container[cl-tooltip-position='top']:before {\n content: \"\";\n position: absolute;\n top: 100%;\n left: calc(50% - 15px);\n border-width: ").concat(Ct,";\n border-style: solid;\n border-color: white transparent transparent transparent;\n }\n \n .cl-promo-code-tooltip-container[cl-tooltip-position='bottom']:after {\n content: \"\";\n position: absolute;\n top: -22px;\n left: calc(50% - 4px);\n margin-left: -5px;\n margin-bottom: -2px;\n border-width: ").concat(Et,";\n border-style: solid;\n border-color: transparent transparent black transparent;\n }\n\n .cl-promo-code-tooltip-container[cl-tooltip-position='bottom']:before {\n content: \"\";\n position: absolute;\n top: -28px;\n left: calc(50% - 11px);\n border-width: ").concat(Ct,";\n border-style: solid;\n border-color: transparent transparent white transparent;\n }\n");class Ot{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){var e;const n=t||document;return Math.max(n.documentElement.clientWidth,(null===(e=n.defaultView)||void 0===e?void 0:e.innerWidth)||0)}static height(t){var e;const n=t||document;return Math.max(n.documentElement.clientHeight,(null===(e=n.defaultView)||void 0===e?void 0:e.innerHeight)||0)}static scrollbarWidth(t){var e;const n=t||document;return((null===(e=n.defaultView)||void 0===e?void 0:e.innerWidth)||0)-n.documentElement.clientWidth}}var St=[];for(var At in{transparent:"#0000"})St.push(At);var _t="\\s*([.\\d%]+)\\s*",xt="\\("+[_t,_t,_t]+"(?:,\\s*([.\\d]+)\\s*)?\\)",Rt="(?:rgb)a?",Nt="("+St.join("|")+")";function It(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}RegExp(Rt+xt,"i"),RegExp([Nt,"(?:#([a-f0-9]{3,8}))",Rt+xt,"(?:hsl)a?"+xt].join("|"),"gi");var Lt=Array.prototype.concat,Pt=Array.prototype.slice,wt=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var i=t[n];It(i)?e=Lt.call(e,Pt.call(i)):e.push(i)}return e};wt.wrap=function(t){return function(){return t(wt(arguments))}};const Mt=wt;var kt={},Dt=Object.hasOwnProperty,jt=Object.create(null);for(var Bt in kt)Dt.call(kt,Bt)&&(jt[kt[Bt]]=Bt);var Ht={to:{},get:{}};function Ut(t,e,n){return Math.min(Math.max(e,t),n)}Ht.get=function(t){var e,n;return"hsl"===t.substring(0,3).toLowerCase()?(e=Ht.get.hsl(t),n="hsl"):(e=Ht.get.rgb(t),n="rgb"),e?{model:n,value:e}:null},Ht.get.rgb=function(t){if(!t)return null;var e,n,o,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){var r=2*n;i[n]=parseInt(e.slice(r,r+2),16)}o&&(i[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);o&&(i[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:Dt.call(kt,e[1])?((i=kt[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=Ut(i[n],0,255);return i[3]=Ut(i[3],0,1),i},Ht.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,Ut(parseFloat(e[2]),0,100),Ut(parseFloat(e[3]),0,100),Ut(isNaN(n)?1:n,0,1)]}return null},Ht.to.rgb=function(){var t=Mt(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},Ht.to.hsl=function(){var t=Mt(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};const Ft=Ht,Wt={},Vt={};for(const t of Object.keys(Wt))Vt[Wt[t]]=t;const Gt={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const t of Object.keys(Gt)){if(!("channels"in Gt[t]))throw new Error("missing channels property: "+t);if(!("labels"in Gt[t]))throw new Error("missing channel labels property: "+t);if(Gt[t].labels.length!==Gt[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=Gt[t];delete Gt[t].channels,delete Gt[t].labels,Object.defineProperty(Gt[t],"channels",{value:e}),Object.defineProperty(Gt[t],"labels",{value:n})}Gt.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,i=Math.min(e,n,o),r=Math.max(e,n,o),s=r-i;let l,a;r===i?l=0:e===r?l=(n-o)/s:n===r?l=2+(o-e)/s:o===r&&(l=4+(e-n)/s),l=Math.min(60*l,360),l<0&&(l+=360);const c=(i+r)/2;return a=r===i?0:c<=.5?s/(r+i):s/(2-r-i),[l,100*a,100*c]},Gt.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,o=t[2]/100;let i,r,s;if(0===n)return s=255*o,[s,s,s];i=o<.5?o*(1+n):o+n-o*n;const l=2*o-i,a=[0,0,0];for(let t=0;t<3;t++)r=e+1/3*-(t-1),r<0&&r++,r>1&&r--,s=6*r<1?l+6*(i-l)*r:2*r<1?i:3*r<2?l+(i-l)*(2/3-r)*6:l,a[t]=255*s;return a};const $t=Gt;function Kt(t,e){return function(n){return e(t(n))}}function zt(t,e){const n=[e[t].parent,t];let o=$t[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),o=Kt($t[e[i].parent][i],o),i=e[i].parent;return o.conversion=n,o}const Zt={};Object.keys($t).forEach((t=>{Zt[t]={},Object.defineProperty(Zt[t],"channels",{value:$t[t].channels}),Object.defineProperty(Zt[t],"labels",{value:$t[t].labels});const e=function(t){const e=function(t){const e=function(){const t={},e=Object.keys($t);for(let n=e.length,o=0;o<n;o++)t[e[o]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;){const t=n.pop(),o=Object.keys($t[t]);for(let i=o.length,r=0;r<i;r++){const i=o[r],s=e[i];-1===s.distance&&(s.distance=e[t].distance+1,s.parent=t,n.unshift(i))}}return e}(t),n={},o=Object.keys(e);for(let t=o.length,i=0;i<t;i++){const t=o[i];null!==e[t].parent&&(n[t]=zt(t,e))}return n}(t);Object.keys(e).forEach((n=>{const o=e[n];Zt[t][n]=function(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const o=t(e);if("object"==typeof o)for(let t=o.length,e=0;e<t;e++)o[e]=Math.round(o[e]);return o};return"conversion"in t&&(e.conversion=t.conversion),e}(o),Zt[t][n].raw=function(t){const e=function(...e){const n=e[0];return null==n?n:(n.length>1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(o)}))}));const Qt=Zt,qt=["keyword","gray","hex"],Xt={};for(const t of Object.keys(Qt))Xt[[...Qt[t].labels].sort().join("")]=t;const Yt={};function Jt(t,e){if(!(this instanceof Jt))return new Jt(t,e);if(e&&e in qt&&(e=null),e&&!(e in Qt))throw new Error("Unknown model: "+e);let n,o;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof Jt)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const e=Ft.get(t);if(null===e)throw new Error("Unable to parse color from string: "+t);this.model=e.model,o=Qt[this.model].channels,this.color=e.value.slice(0,o),this.valpha="number"==typeof e.value[o]?e.value[o]:1}else if(t.length>0){this.model=e||"rgb",o=Qt[this.model].channels;const n=Array.prototype.slice.call(t,0,o);this.color=ne(n,o),this.valpha="number"==typeof t[o]?t[o]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const e=Object.keys(t);"alpha"in t&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const o=e.sort().join("");if(!(o in Xt))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=Xt[o];const{labels:i}=Qt[this.model],r=[];for(n=0;n<i.length;n++)r.push(t[i[n]]);this.color=ne(r)}if(Yt[this.model])for(o=Qt[this.model].channels,n=0;n<o;n++){const t=Yt[this.model][n];t&&(this.color[n]=t(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Jt.prototype={toString(){return this.string()},string(t){let e=this.model in Ft.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return Ft.to[e.model](n)},round(t){return t=Math.max(t||0,0),new Jt([...this.color.map(te(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new Jt([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},lighten(t){const e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){const e=this.hsl();return e.color[2]-=e.color[2]*t,e}};for(const t of Object.keys(Qt)){if(qt.includes(t))continue;const{channels:e}=Qt[t];Jt.prototype[t]=function(...e){return this.model===t?new Jt(this):e.length>0?new Jt(e,t):new Jt([...ee(Qt[this.model][t].raw(this.color)),this.valpha],t)},Jt[t]=function(...n){let o=n[0];return"number"==typeof o&&(o=ne(n,e)),new Jt(o,t)}}function te(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function ee(t){return Array.isArray(t)?t:[t]}function ne(t,e){for(let n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}const oe=Jt;function ie(t,e){Object.keys(e).forEach((n=>{t.style[n]=e[n]}))}function re(t,e,n){const o=function(t,e){const n=getComputedStyle(t)[e]||t.style.getPropertyValue(e);if(n&&n.includes("rgb")&&(!(n.split("rgb").length>2)||n.includes("#")))return n}(e,n);if(o){const e=oe(o).alpha(.5).string();return t.classList.add("focus-outline-defined"),t.style.setProperty("--clFocusOutline",`3px solid ${e}`),e}return null}function se(t){const{width:e,height:n}=t.getBoundingClientRect(),{marginBottom:o,marginTop:i,marginLeft:r,marginRight:s}=window.getComputedStyle(t);return{width:e+parseInt(r,10)+parseInt(s,10),height:n+parseInt(i,10)+parseInt(o,10)}}function le(t,e,n,o,i){switch(t.position){case"top":return{left:`${ae(e,n,o,i)}px`,top:t.availableSpaceAboveTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"bottom":return{left:`${ae(e,n,o,i)}px`,bottom:t.availableSpaceBelowTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"left":return{left:t.availableSpaceToTheLeftSideOfTheTrigger-e.width-t.contentWidth-t.horizontalOffset+"px",top:`${ce(0,t)}px`};case"right":return{right:t.availableSpaceToTheRightSideOfTheTrigger-t.contentWidth-t.horizontalOffset+"px",top:`${ce(0,t)}px`}}}function ae(t,e,n,o){let i=n?t.x+t.width/2-e.width/2:t.x;return i<0&&(i=0),i+e.width>Ot.width(o)&&(i-=i+e.width-Ot.width(o)),i}function ce(t,e){let n=e.availableSpaceAboveTriggerElem;return e.contentHeight>e.availableSpaceBelowTriggerElem&&(n-=e.contentHeight-e.availableSpaceBelowTriggerElem),n}function de(t){const{triggerElement:e,tooltipElement:n,offset:o=10,htmlDocumentObject:i}=t,r=function(t,e,n,o,i,r){const s=function(t,e,n,o,i){const r=function(t,e,n,o){const i=Ot.width(o),{right:r}=t.getBoundingClientRect(),s=i-n-r-Ot.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:se(e).width,availableSpaceToTheLeftSideOfTheTrigger:r-n,availableSpaceToTheRightSideOfTheTrigger:s}}(t,e,n,i),s=function(t,e,n,o){const i=Ot.height(o),{top:r,bottom:s}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:se(e).height,availableSpaceAboveTriggerElem:r-n,availableSpaceBelowTriggerElem:i-s-n}}(t,e,n,i);let l="undefined";const a={bottom:s.availableSpaceBelowTriggerElem>=s.contentHeight,top:s.availableSpaceAboveTriggerElem>=s.contentHeight,right:r.availableSpaceToTheRightSideOfTheTrigger>=r.contentWidth,left:r.availableSpaceToTheLeftSideOfTheTrigger>=r.contentWidth};if(a.top?l="top":a.bottom?l="bottom":a.right?l="right":a.left&&(l="left"),o&&a[o]&&(l=o),"undefined"===l){const t=Math.max(s.availableSpaceBelowTriggerElem,s.availableSpaceAboveTriggerElem,r.availableSpaceToTheRightSideOfTheTrigger,r.availableSpaceToTheLeftSideOfTheTrigger);t===s.availableSpaceBelowTriggerElem?l="bottom":t===s.availableSpaceAboveTriggerElem?l="top":t===r.availableSpaceToTheRightSideOfTheTrigger?l="right":t===r.availableSpaceToTheLeftSideOfTheTrigger&&(l="left")}return Object.assign(Object.assign(Object.assign({},s),r),{position:l})}(t,e,n,o,r=r||document);return function(t,e){const{marginBottom:n,marginTop:o}=window.getComputedStyle(e);if("top"===t.position)ie(e,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),ie(e,{"margin-bottom":"0px"});else if("bottom"===t.position)ie(e,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),ie(e,{"margin-top":"0px"});else{const t=(parseInt(n,10)+parseInt(o,10))/2+"px";ie(e,{"margin-top":t,"margin-bottom":t})}}(s,e),{coordinates:le(s,t.getBoundingClientRect(),e.getBoundingClientRect(),i,r),position:s.position}}(e,n,o,"top",!0,i);n.setAttribute("cl-tooltip-position",r.position),ie(n,r.coordinates)}function he(t){return he="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},he(t)}function pe(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,ye(o.key),o)}}function ue(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(ue=function(){return!!t})()}function me(t,e,n,o){var i=ge(fe(1&o?t.prototype:t),e,n);return 2&o&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function ge(){return ge="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=fe(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}},ge.apply(null,arguments)}function fe(t){return fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fe(t)}function be(t,e){return be=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},be(t,e)}function ve(t,e,n){return(e=ye(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ye(t){var e=function(t){if("object"!=he(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=he(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==he(e)?e:e+""}var Ee="lastPromoCode",Ce=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),ve(e=function(t,e,n){return e=fe(e),function(t,e){if(e&&("object"==he(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,ue()?Reflect.construct(e,n||[],fe(t).constructor):e.apply(t,n))}(this,t),"renderTooltip",(function(t){var n=e.getTranslationsMap(bt).translations;e.tooltipContainerElement=document.createElement("div"),e.tooltipContainerElement.classList.add("cl-promo-code-tooltip-container");var o=document.createElement("div");o.style.padding="5px",o.style.color="#fff",o.innerText=n,e.tooltipContainerElement.append(o),e.htmlDocumentObject.body.appendChild(e.tooltipContainerElement),e.firstTooltipTimer=setTimeout((function(){de({triggerElement:t,tooltipElement:e.tooltipContainerElement,htmlDocumentObject:e.htmlDocumentObject}),e.boundOnScrollHandler=function(){return de({triggerElement:t,tooltipElement:e.tooltipContainerElement,htmlDocumentObject:e.htmlDocumentObject})},document.addEventListener("scroll",e.boundOnScrollHandler,!0),e.secondTooltipTimer=setTimeout((function(){e.removeScrollListener(),e.tooltipContainerElement.style.transition="0.15s",e.tooltipContainerElement.style.top="".concat(t.getBoundingClientRect().top+window.pageYOffset,"px"),e.tooltipContainerElement.style.opacity="0",e.thirdTooltipTimer=setTimeout((function(){e.destroyTooltip()}),150)}),1500)}))})),ve(e,"getTooltipTopPosition",(function(t,e,n){var o=t.getBoundingClientRect();return"".concat(o.top-e.height-n+window.pageYOffset,"px")})),ve(e,"getTooltipLeftPosition",(function(t,e){var n=t.getBoundingClientRect();return"".concat(n.left+n.width/2-e.width/2+window.pageXOffset,"px")})),ve(e,"destroyTooltip",(function(){e.tooltipContainerElement&&(e.tooltipContainerElement.remove(),e.tooltipContainerElement=null)})),ve(e,"clearTooltipTimers",(function(){clearTimeout(e.firstTooltipTimer),clearTimeout(e.secondTooltipTimer),clearTimeout(e.thirdTooltipTimer)})),ve(e,"removeScrollListener",(function(){document.removeEventListener("scroll",e.boundOnScrollHandler,!0)})),ve(e,"mapStyleControlValuesToInnerContent",(function(){var t=e.getElement("text"),n=e.getRootElement().querySelector('[cl-inline-edit="content, text"]');e.getElement("text").querySelector(".".concat(e.inlineEditPromocodeClass)).style.whiteSpace=e.isByContentWidth?"nowrap":"",t&&n&&(n.style.minWidth="20px",n.style.width="max-content",n.style.minHeight=t.style.fontSize,n.style.textAlign=t.style.textAlign,n.style.lineHeight=t.style.lineHeight,n.style.fontWeight=t.style.fontWeight,n.style.fontSize=t.style.fontSize,n.style.textShadow=t.style.textShadow,n.style.letterSpacing=t.style.letterSpacing,n.style.fontFamily=t.style.fontFamily)})),ve(e,"mapAlignValueToTextElementContent",(function(t){"center"===t.style.textAlign&&(t.style.justifyContent="center"),"start"===t.style.textAlign&&(t.style.justifyContent="flex-start"),"end"===t.style.textAlign&&(t.style.justifyContent="flex-end")})),ve(e,"handleSafariHeightIssue",(function(){var t=e.getHostElement();"auto"===t.style.height&&(t.style.height="fit-content")})),ve(e,"storeStrokeTopWidthAsCssVar",(function(){var t=e.getElement("host"),n=e.getElement("text");t.style.setProperty("--clStrokeForIconWidth",n.style.borderTopWidth||0)})),ve(e,"destroyExistingIcon",(function(){var t=e.getRootElement().querySelector('[cl-element="icon"]');t&&t.remove()})),ve(e,"showIconIfAny",(function(t,n){var o=n.content.iconContent,i=parseFloat(o),r=!isNaN(i);if(e.destroyExistingIcon(),null!=o){if(r){var s=(n.styles?"absolute"===n.styles.find((function(t){return"icon"===t.element})).styleAttributes.position:"absolute"===n.adaptiveStyles[e.getEnvironment()].find((function(t){return"icon"===t.element})).styleAttributes.position)?vt[i]:yt[i],l=document.createElement("span");l.classList.add("promocode-icon"),l.setAttribute("cl-element","icon"),ct({element:l,html:s}),t.appendChild(l)}else{var a=document.createElement("img");a.src=o,a.classList.add("promocode-icon"),a.setAttribute("cl-element","icon"),t.appendChild(a)}e.applyAutoAdaptiveStyles(n.adaptiveStyles,n.styles)}})),ve(e,"addTooltipStyles",(function(){if(!e.htmlDocumentObject.head.querySelector("#".concat(e.tooltipStylesId))){var t=document.createElement("style");t.setAttribute("id",e.tooltipStylesId),ct({element:t,html:Tt}),e.htmlDocumentObject.head.appendChild(t)}})),ve(e,"removeTooltipStyles",(function(){var t=e.htmlDocumentObject.head.querySelector("#".concat(e.tooltipStylesId));t&&t.remove()})),ve(e,"_handleContextRecord",(function(t){var n;if(!e.services.context.getKVMap().promoCode&&t.key===Ee){var o=e.getModel();if(!(t.value.viewIndex>=o.path[0])){var i=(null===(n=e.services.context.getRecord(Ee))||void 0===n?void 0:n.value.value)||null,r=e.getElement("text").querySelector(".".concat(e.inlineEditPromocodeClass));i?(r.removeAttribute(e.inlineEditAttributeName),r.innerText=i):r.setAttribute(e.inlineEditAttributeName,e.inlineEditAttributeValue)}}})),ve(e,"checkWidthMode",(function(t){var n,o=e.getEnvironment(),i=null===(n=t.adaptiveStyles[o])||void 0===n||null===(n=n.find((function(t){return"host"===t.element})))||void 0===n?void 0:n.styleAttributes.width;e.isByContentWidth="auto"===i,e.isByContainerWidth="100%"===i})),ve(e,"manifest",gt),ve(e,"tooltipContainerElement",void 0),ve(e,"firstTooltipTimer",void 0),ve(e,"secondTooltipTimer",void 0),ve(e,"thirdTooltipTimer",void 0),ve(e,"boundOnScrollHandler",void 0),ve(e,"contextSubscriptions",[]),ve(e,"tooltipStylesId","cl-promo-code-tooltip-styles"),ve(e,"inlineEditPromocodeClass","cl--inline--edit"),ve(e,"inlineEditAttributeName","cl-inline-edit"),ve(e,"inlineEditAttributeValue","content, text"),ve(e,"isByContainerWidth",!1),ve(e,"isByContentWidth",!1),e.getRootElement().innerHTML="\n <style>".concat("\n.text {\n outline: none;\n min-height: 20px;\n cursor: pointer;\n width: 100%;\n height: 100%;\n display: flex;\n align-items: center;\n position: relative;\n}\n\n.promocode-icon {\n top: calc(((var(--clPromocodeIconHeight) / 2) * -1) - var(--clStrokeForIconWidth));\n width: var(--clPromocodeIconWidth);\n height: var(--clPromocodeIconHeight);\n}\n\n.promocode-icon svg {\n display: flex;\n width: 100%;\n height: auto;\n}\n\nbutton.focus-outline-defined:focus {\n outline: var(--clFocusOutline);\n}\n\n.cl--inline--edit {\n overflow-wrap: break-word;\n max-width: 100%;\n}\n",'</style>\n <button class="text" cl-element="text">\n <span class="').concat(e.inlineEditPromocodeClass,'" ').concat(e.inlineEditAttributeName,'="').concat(e.inlineEditAttributeValue,'"></span>\n </button>'),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&&be(t,e)}(t,ut),function(t,e){return e&&pe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;me(t,"connectedCallback",this,3)([]),this.addTooltipStyles();var n=this.getElement("text"),o=n.querySelector("[".concat(this.inlineEditAttributeName,'="').concat(this.inlineEditAttributeValue,'"]'));this.contextSubscriptions=[this.services.context.on("RECORD_ADDED",this._handleContextRecord.bind(this)),this.services.context.on("RECORD_UPDATED",this._handleContextRecord.bind(this)),this.services.context.on("RECORD_DELETED",this._handleContextRecord.bind(this))],this.isStaticRenderMode()&&n.addEventListener("click",(function(t){var i,r;t.stopPropagation(),(i=o.textContent,(null===(r=navigator.clipboard)||void 0===r?void 0:r.writeText)?navigator.clipboard.writeText(String(i).trim().replace("<br>"," ")):Promise.reject()).then((function(){e.destroyTooltip(),e.clearTooltipTimers(),e.removeScrollListener(),e.renderTooltip(n)})).catch((function(t){return console.error("SysPromoCodeComponent couldn't write to clipboard",t)})),e.services.trackingService.send("FormClick_[Name]"),e.services.trackingService.trackClick({countAsTargetAction:e.getProps().content.countAsTargetAction}),e.services.trackingService.trackTargetAction(e.getProps().content.countAsTargetAction)})),this.observeProps((function(t,i){e.applyAutoAdaptiveStyles(i.adaptiveStyles,i.styles),e.checkWidthMode(i);var r=e.services.context.getKVMap().promoCode;r?o.innerText=r:ct({element:o,html:i.content.text});var s=e.services.context.getRecord(Ee);s&&e._handleContextRecord(s),e.mapAlignValueToTextElementContent(e.getElement("text")),e.mapStyleControlValuesToInnerContent(),e.showIconIfAny(n,i),e.storeStrokeTopWidthAsCssVar(),e.handleSafariHeightIssue(),function(t){let e=null;const n=t,o=["transparent","initial"];t&&(t.style.borderColor&&!o.includes(t.style.borderColor)&&(parseFloat(t.style.borderWidth)||parseFloat(t.style.borderBottomWidth))&&(e=re(n,t,"borderColor")),!e&&t.style.getPropertyValue("--borderBottomColor")&&!o.includes(t.style.getPropertyValue("--borderBottomColor"))&&parseFloat(t.style.getPropertyValue("--borderBottomWidth"))&&(e=re(n,t,"--borderBottomColor")),e||!t.style.backgroundColor||o.includes(t.style.backgroundColor)||(e=re(n,t,"backgroundColor")),e||!t.style.color||o.includes(t.style.color)||(e=re(n,t,"color")),e||n.classList.remove("focus-outline-defined"))}(e.getElement("text"))})),this.observeShared((function(){e.mapAlignValueToTextElementContent(e.getElement("text")),e.mapStyleControlValuesToInnerContent()})),this.observeEnvironment((function(){e.handleSafariHeightIssue(),e.mapStyleControlValuesToInnerContent()}));var i,r=this.services.context.getKVMap().promoCode||this.getProps().content.text;r&&this.services.eventEmitter.emit("promo-code-shown",{code:r,autoRedeem:!1!==(null===(i=this.getProps())||void 0===i||null===(i=i.content)||void 0===i?void 0:i.autoRedeem)})}},{key:"disconnectedCallback",value:function(){me(t,"disconnectedCallback",this,3)([]),this.destroyTooltip(),this.clearTooltipTimers(),this.removeScrollListener(),this.removeTooltipStyles(),this.contextSubscriptions.forEach((function(t){return t.off()}))}}])}();ve(Ce,"define",{name:"sys-promo-code",model:gt.name,manifest:gt});export{Ce as default};window.clComponentClass_SysPromoCodeComponent=Ce;
|