@claspo/components 1.1.20-theme.36 → 1.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const t="cl-";function e(e){return t+e}function i(t){return"cl-"+t}const s="VIEW",n="MODULE",o="CONTAINER",r="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 u=d;var p,m;class g{static sortActions(t){const e={[u.CLOSE_WIDGET]:-1,[u.OPEN_LINK]:-2,[u.SHOW_WIDGET]:1,[u.SUBSCRIBE_CONTACT]:2,[u.REQUEST]:3},i=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>i(t)>i(e)?-1:i(t)<i(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,s){this.state=t;const n=s(),o=n.getAttribute(i("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(i("type"))));let s=0;for(;e[s]&&e[s].getAttribute(i("id"))!==o;){let t=e[s].getAttribute(i("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;s++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((n.shadowRoot||n).querySelectorAll(this.config.relativeSelector)):[n],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,i,s;try{for(var n,o=!0,r=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,i=t[Symbol.asyncIterator];return i?i.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},s("next"),s("throw"),s("return"),e[Symbol.asyncIterator]=function(){return this},e);function s(i){e[i]=t[i]&&function(e){return new Promise((function(s,n){!function(t,e,i,s){Promise.resolve(s).then((function(e){t({value:e,done:i})}),e)}(s,n,(e=t[i](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(n=await r.next()).done);o=!0){s=n.value,o=!1;const{event:t}=s;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}}catch(t){e={error:t}}finally{try{o||t||!(i=r.return)||await i.call(r)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}g.IGNORING_VIEW_ENTRY_TYPES=[l,a,r],(m=p||(p={})).CLICK="CLICK",m.COMPONENT_EVENT="COMPONENT_EVENT";class b{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,i){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class E{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map((t=>this.actionFactory.get(t)));switch(e.forEach((t=>this.actionRegister.register(t))),t.type){case p.CLICK:return new g(t,e);case p.COMPONENT_EVENT:return new b(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class y{static generate(){let t,e="";for(let i=0;i<32;i++)8!==i&&12!==i&&16!==i&&20!==i||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class f{constructor(){this.listeners=f.createDefaultListenersState()}emit(t,e,i=null){const s=this.listeners[t];s&&Object.values(s).forEach((s=>s(e,t,i))),Object.values(this.listeners["*"]).forEach((s=>s(e,t,i)))}on(t,e){const i=y.generate(),s=this.listeners[t];return s?s[i]=e:this.listeners[t]={[i]:e},{off:()=>{var e,s;(null===(s=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===s?void 0:s[i])&&delete this.listeners[t][i]}}}destroy(){this.listeners=f.createDefaultListenersState()}}f.createDefaultListenersState=()=>({"*":{}});const v=f,O=(t,e,i,s)=>{const n=EventTarget.prototype,{addEventListenerBase:o,addEventListener:r}=n;(o||r).call(t,e,i,s)};class S{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class T{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===n?Object.assign(Object.assign({},t),T.moduleToContainerParams):t));return Object.assign(Object.assign({},t),{children:e})}));return Object.assign(Object.assign({},t),{views:e})}static sort(t,e){return t.index>e.index?1:-1}static reIndex(t,e){return Object.assign(Object.assign({},t),{index:e+t.index})}}var C,_,N,A,R,L,I,P,x,M,D,U,w;T.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(_=C||(C={})).VIEW="VIEW",_.CONTAINER="CONTAINER",_.TEXT="TEXT",_.INPUT="INPUT",_.BUTTON="BUTTON",_.IMAGE="IMAGE",_.CONSENT="CONSENT",_.COUNTDOWN_TIMER="COUNTDOWN_TIMER",_.PROMO_CODE="PROMO_CODE",_.MULTIPLE_INPUT="MULTIPLE_INPUT",_.VIDEO="VIDEO",_.SLIDER="SLIDER",_.SLIDE="SLIDE",_.SOCIAL="SOCIAL",_.COLUMNS="COLUMNS",_.COLUMN="COLUMN",_.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(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"}(A||(A={})),function(t){t.SELF="_self",t.BLANK="_blank"}(R||(R={})),(L||(L={})).ACCENT="accent",function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(I||(I={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(P||(P={})),function(t){t.SLIDE_TO_TOP="SLIDE_TO_TOP",t.SLIDE_TO_BOTTOM="SLIDE_TO_BOTTOM",t.SLIDE_TO_LEFT="SLIDE_TO_LEFT",t.SLIDE_TO_RIGHT="SLIDE_TO_RIGHT"}(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"}(M||(M={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(D||(D={})),(w=U||(U={})).BEFORE="BEFORE",w.AFTER="AFTER",w.INSIDE="INSIDE",w.INSTEAD="INSTEAD";class j extends v{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(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 k{static set(t,e){const i=t[k.accumulatorPropertyName]||{};t[k.accumulatorPropertyName]=Object.assign(Object.assign({},i),e.styleAttributes),Object.keys(t[k.accumulatorPropertyName]).forEach((i=>{i.includes("--")?t.style.setProperty(i,e.styleAttributes[i]||""):t.style[i]=e.styleAttributes[i]?e.styleAttributes[i]:""}))}}k.accumulatorPropertyName="clStyleAttributes";const F=k;var W;!function(t){t.BUILT_IN="BUILT_IN",t.DETACHED="DETACHED",t.FLOATING_BOX="FLOATING_BOX",t.FLOATING_BAR="FLOATING_BAR",t.LAUNCHER="LAUNCHER",t.CONTENT_LOCKER="CONTENT_LOCKER"}(W||(W={}));class G{static applyHostStyles(t,e,i=null,n){var r,l,a;const d=null===(l=null===(r=null==i?void 0:i.props)||void 0===r?void 0:r.handlers)||void 0===l?void 0:l.find((t=>"CLICK"===t.type));d&&(null===(a=d.actions)||void 0===a?void 0:a.length)&&(e.style.cursor="pointer"),t!==s&&t!==o&&t!==c||(e.style.display=n===W.CONTENT_LOCKER&&t===s?"flex":"inline-flex",e.style.position="relative"),e.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(t=""){this.styles=`${this.styles} ${t}`}getStyles(){return this.styles}}class H{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class ${constructor(t,e,i,s,n,o){this.hostElement=e,this.documentModel=t,this.getSharedCb=i,this.getPropsCb=s,this.getEnvCb=n,this.httpClient=o,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,i]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:i.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((i=>{var s,n,o,r,l;const a=null===(n=null===(s=e.adaptiveStyles)||void 0===s?void 0:s[t])||void 0===n?void 0:n.find((t=>t.element===i)),c=(null===(o=e.styles)||void 0===o?void 0:o.find((t=>t.element===i)))||{},d=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),h=this.parseBackground(d);h.url&&this.envUrlMaps[t].set(i,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,i])=>this.httpClient.execute(i.originalSVGResourceURL).then((t=>t.text())).then((s=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},i),{inlineSvgString:s}))}))))).then((()=>{var e;this._applyHostElementBackground(this.envUrlMaps[t].get("host"),null===(e=this.getSharedCb().theme)||void 0===e?void 0:e.schema)})).catch((t=>{console.error(t),H.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("THEME_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)})),this}_applyHostElementBackground(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(t,e){const i=t.inlineSvgString.trim();let s=i;return[...i.matchAll(/var\(--cl-schema-([^)]+)\)/g)].forEach((t=>{const i=function(t=""){return t.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}(t[1]);s=s.replace(`var(--${function(t){return`cl-schema-${t}`}(i)})`,e[i])})),`url('data:image/svg+xml,${encodeURIComponent(s)}')${t.positionOptions}`}off(){var t;null===(t=this.subscription)||void 0===t||t.off()}}const V=new class{execute(t,e="GET",i=null,s,n){const o={method:e,headers:Object.assign({"Content-Type":"text/plain"},s||{}),credentials:"same-origin",body:null,signal:n};return i&&(o.body="string"==typeof i?i:JSON.stringify(i)),fetch(t,o)}};function K(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,i)=>Object.assign(Object.assign({},e),{[i]:t[i]})),{})}class Q{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}}class 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 X;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.EXECUTE_ACTION_BY_PREDICATE="EXECUTE_ACTION_BY_PREDICATE"}(X||(X={}));const J=X;class q{constructor(t,e,i){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(J.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(J.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=i,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)}},Z=Y,tt="props",et="shared",it="environment";function st(t,e,i,s){const n=t=>{let o=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return o&&(s&&"function"==typeof s?s(o.getAttribute(e)):(null===(r=null==o?void 0:o.getAttribute)||void 0===r?void 0:r.call(o,e))===i)?o:o&&o.parentNode&&n(o.parentNode)||null;var r};return n(t)}const nt="SUBMIT";function ot(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((i=>{if("element"===i||"classes"===i)return;const s=e[i];s&&"object"==typeof s&&!Array.isArray(s)?t[i]=Object.assign(Object.assign({},t[i]||{}),s):t[i]=s})),t):t}function rt(t,e,i){var s;return null===(s=null==t?void 0:t[e])||void 0===s?void 0:s.find((t=>t.element===i))}function lt(t){const{element:e,html:i,appendHtml:s}=t,n=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(i);s?e.innerHTML+=n:e.innerHTML=n}class at extends Event{constructor(t,e,i){super(t,i),this.detail={},Object.defineProperty(this,"detail",{value:e})}}var ct;!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(ct||(ct={}));class dt extends HTMLElement{constructor(){var s;super(),this.construct=()=>{let t;const e=this.getAttribute(i("id")),s=this.getWidgetContainerNode();if(!s)throw new Error("Widget container not found in construct");const n=s.closest(`[${i("widget-id")}]`);let o;n&&(o=n.getAttribute(i("widget-id")));let r=new at("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(i("path")),id:e,widgetId:o},{bubbles:!0,composed:!0});this.dispatchEvent(r),t=r.detail.props,Object.assign(this,t),this.observers=Z(tt,et,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 v,this.componentResourceManager=new q(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new E(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(tt).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),s=i("floating");t.floating&&!e.getAttribute(s)?e.setAttribute(s,"true"):!t.floating&&e.getAttribute(s)&&e.removeAttribute(s)})),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 $(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),V),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(it).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===ct.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===ct.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(it).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${i("element")}]`)).filter((t=>!t.hasAttribute(i("component"))))],this.getElement=(t,e)=>this.getElements().find((s=>e?s.getAttribute(i("element"))===t&&s.id===e:s.getAttribute(i("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const s=this.getElements();if(!s.length)return;const n=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const i=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let s=!1,n=!1;i.desktop&&i.desktop.forEach((i=>{i.element===e&&(ot(i,t),s=!0)})),i.mobile&&i.mobile.forEach((i=>{i.element===e&&(ot(i,t),n=!0)})),!s&&i.desktop&&i.desktop.push(JSON.parse(JSON.stringify(t))),!n&&i.mobile&&i.mobile.push(JSON.parse(JSON.stringify(t)))})),i}(t,e),o=i("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)),lt({element:l,html:""}),s.forEach((t=>{let e=t.getAttribute(i("element"));const s=this.getEnvironment();let o=rt(n,s,e);if(o){if(this.resizeListener.isMobile()){const t=rt(n,"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[i,s]of Object.entries(e))t.style[i]=s;return!0},this.applyStylesToElement=(t,e,s)=>{var n,o;const r=[];"host"===(e=dt._resolveTogglableStylesForElementModel(e)).element&&(G.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(n=this.model.props.backgroundDynamicInlineSVGElements)||void 0===n?void 0:n.desktop)||"mobile"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),r.push("background")));let l=e.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],O(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),O(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:K(e.styleAttributes,r)});if(F.set(t,c),this._setClassAttributes(t,e),s){if(e.hoverStyleAttributes){let n=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const i=t.tagName.toLowerCase(),s=`flip-up-animation-${e.element}`;let o=this.getRootElement().querySelector(`#${s}`);o||(o=document.createElement("style"),o.id=s,t.appendChild(o)),lt({element:o,html:`\n ${i}::before {\n content: '';\n background: ${n.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${i}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),n=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}n.borderTopWidth&&"0px"!==n.borderTopWidth||delete n.borderTopColor,n.borderBottomWidth&&"0px"!==n.borderBottomWidth||delete n.borderBottomColor,n.borderLeftWidth&&"0px"!==n.borderLeftWidth||delete n.borderLeftColor,n.borderRightWidth&&"0px"!==n.borderRightWidth||delete n.borderRightColor,this._addStylesToStyleElement(s,e.element,n,`:not(.${i("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(s,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(s,this.getShared()),this.stylesAppliedToElement(t,e,s)}},this.applySharedClassesToElementModel=e=>function(e,i){let s=e;return(s.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((t=>{var e;let n=null===(e=i.textClasses)||void 0===e?void 0:e[t];n&&(n.styleAttributes.fontFamily||(n.isHeader&&i.headerFontFamily&&(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:i.headerFontFamily})})),!n.isHeader&&i.textFontFamily&&(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:i.textFontFamily})}))),s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),n.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},s.placeholderStyleAttributes),n.placeholderStyleAttributes)}))})),s.styleAttributes.fontFamily||(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:i.textFontFamily})})),s}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,s,n="",o)=>{const r=Object.keys(s).reduce(((t,e)=>t+` ${Q.camelCaseToDashCase(e)}: ${s[e]}${o?" !important;":";"}`),"");lt({element:t,html:`[${i("element")}="${e}"]${n} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{lt({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var i,s,n,o;e.linkColor&&lt({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(i=e.linkParams)||void 0===i?void 0:i.color)&&lt({element:t,html:`a {color: ${null===(s=e.linkParams)||void 0===s?void 0:s.color}}, a:visited {color: ${null===(n=e.linkParams)||void 0===n?void 0:n.color}}`,appendHtml:!0}),(null===(o=e.linkParams)||void 0===o?void 0:o.removeUnderline)&&lt({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(i,s)=>{Array.from(i.classList).filter((t=>t!==e("hovered")&&t!==e("focused"))).forEach((e=>{e.startsWith(t)&&i.classList.remove(e)}));const n=((i.getAttribute("class")||"")+" "+s.classes).trim();i.setAttribute("class",n)},this.getParentComponent=()=>st(this.parentNode,i("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(i("path"));return t&&1===t.split(",").length?this.parentNode:st(this.parentNode,i("path"),void 0,(t=>t&&1===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,i)=>{if(e)return e;const s=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const i=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[i]?{translations:e[i],language:i}:null}(i,t);return s||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,i)=>{},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,i,s,n,o,r;const l=t.control.name;if(["email","first_name","last_name"].includes(l))return l.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(n=null===(s=null===(i=t.adaptiveStyles)||void 0===i?void 0:i.desktop.find((t=>"label"===t.element)))||void 0===s?void 0:s.params)||void 0===n?void 0:n.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(o=t.content)||void 0===o?void 0:o.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(r=t.control)||void 0===r?void 0:r.integrationName)?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{var e;switch(null===(e=t.control)||void 0===e?void 0:e.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},i=this.services.actionRegister.getRegisteredActions().find((t=>t.category===nt));i?null==i||i.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:u.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===(s=this.constructor.define)||void 0===s?void 0:s.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}}dt._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=dt._resolveTogglableStyles(e[t]))})),e},dt._resolveTogglableStyles=t=>{const e=Object.assign({},t),i=(t,i,s)=>{i in e&&(t.forEach((t=>{t in e&&(e[t]=e[i]?e[t]:s)})),delete e[i])};return i(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),i(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e};const ht=dt,ut={name:"SysSlideComponent",componentType:"SLIDE",version:"1.0.0",focusParentOnClick:!0,preventDraggable:!0,propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0,params:{indentationType:"PADDING"}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0,params:{indentationType:"PADDING"}}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0}}]},events:{dispatch:[],listen:[]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1}}]},i18nPropPaths:["handlers,[id],actions,[id],params,link"],props:{content:{name:null},styles:[{element:"host",styleAttributes:{background:"#FFFFFF"},classes:""}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{display:"inline-flex",position:"relative",width:"100%",minWidth:null,height:"auto",minHeight:null,overflow:"hidden",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"20px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}],mobile:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:null,height:"auto",minHeight:null,overflow:"hidden",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"20px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}]}},waitForResourcesLoad:!0,resourcesPropPaths:[["adaptiveStyles",":ENV","styleAttributes","background"],["styles","styleAttributes","background"]],metaDescription:{label:{en:"Slide",ru:"Слайд",uk:"Слайд",es:"Diapositiva",fr:"Diapositive",de:"Slide",it:"Slide",pt:"Diapositivo",ro:"Slide",bg:"Слайд",cs:"Slide",el:"Slide",nl:"Slide",pl:"Slajd",sv:"Slide",tr:"Slide",ar:"Slide",zh:"Slide",da:"Slide",he:"Slide",fi:"Slide",hi:"Slide",hr:"Slide",hu:"Slide",id:"Slide",ja:"Slide",ko:"Slide",no:"Slide",sk:"Slide",sl:"Slide",sr:"Slide"}}};function pt(t){return pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pt(t)}function mt(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,vt(s.key),s)}}function gt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(gt=function(){return!!t})()}function bt(){return bt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var s=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=Et(t)););return t}(t,e);if(s){var n=Object.getOwnPropertyDescriptor(s,e);return n.get?n.get.call(arguments.length<3?t:i):n.value}},bt.apply(null,arguments)}function Et(t){return Et=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Et(t)}function yt(t,e){return yt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yt(t,e)}function ft(t,e,i){return(e=vt(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function vt(t){var e=function(t){if("object"!=pt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=pt(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==pt(e)?e:e+""}var Ot=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ft(e=function(t,e,i){return e=Et(e),function(t,e){if(e&&("object"==pt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,gt()?Reflect.construct(e,i||[],Et(t).constructor):e.apply(t,i))}(this,t),"manifest",ut),e.getRootElement().innerHTML="\n <style>\n :host {\n position: relative;\n flex: 0 0 100%;\n min-width: 20px;\n min-height: 20px;\n }\n </style>\n ",e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&yt(t,e)}(t,ht),function(t,e){return e&&mt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;!function(t,e,i){var s=bt(Et(t.prototype),"connectedCallback",i);return"function"==typeof s?function(t){return s.apply(i,t)}:s}(t,0,this)([]),this.observeProps((function(t,i){e.applyAutoAdaptiveStyles(i.adaptiveStyles,i.styles)}))}}])}();ft(Ot,"define",{name:"sys-slide",model:ut.name,manifest:ut});export{Ot as default};window.clComponentClass_SysSlideComponent=Ot;
1
+ const t="cl-";function e(e){return t+e}function i(t){return"cl-"+t}const s="VIEW",n="MODULE",o="CONTAINER",r="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 u=d;var p,m;class g{static sortActions(t){const e={[u.CLOSE_WIDGET]:-1,[u.OPEN_LINK]:-2,[u.SHOW_WIDGET]:1,[u.SUBSCRIBE_CONTACT]:2,[u.REQUEST]:3},i=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>i(t)>i(e)?-1:i(t)<i(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,s){this.state=t;const n=s(),o=n.getAttribute(i("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(i("type"))));let s=0;for(;e[s]&&e[s].getAttribute(i("id"))!==o;){let t=e[s].getAttribute(i("type"));if(g.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;s++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((n.shadowRoot||n).querySelectorAll(this.config.relativeSelector)):[n],this.targetElements.forEach((t=>{t.addEventListener("click",this.listener)}))}async execute(){var t,e,i,s;try{for(var n,o=!0,r=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,i=t[Symbol.asyncIterator];return i?i.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},s("next"),s("throw"),s("return"),e[Symbol.asyncIterator]=function(){return this},e);function s(i){e[i]=t[i]&&function(e){return new Promise((function(s,n){!function(t,e,i,s){Promise.resolve(s).then((function(e){t({value:e,done:i})}),e)}(s,n,(e=t[i](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(n=await r.next()).done);o=!0){s=n.value,o=!1;const{event:t}=s;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}}catch(t){e={error:t}}finally{try{o||t||!(i=r.return)||await i.call(r)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}g.IGNORING_VIEW_ENTRY_TYPES=[l,a,r],(m=p||(p={})).CLICK="CLICK",m.COMPONENT_EVENT="COMPONENT_EVENT";class b{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,i){this.componentEmitterListener=e.on(this.config.eventName,(()=>{this.actions.forEach((e=>e.execute(t.getState(),this.config.params)))}))}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class E{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map((t=>this.actionFactory.get(t)));switch(e.forEach((t=>this.actionRegister.register(t))),t.type){case p.CLICK:return new g(t,e);case p.COMPONENT_EVENT:return new b(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class y{static generate(){let t,e="";for(let i=0;i<32;i++)8!==i&&12!==i&&16!==i&&20!==i||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class f{constructor(){this.listeners=f.createDefaultListenersState()}emit(t,e,i=null){const s=this.listeners[t];s&&Object.values(s).forEach((s=>s(e,t,i))),Object.values(this.listeners["*"]).forEach((s=>s(e,t,i)))}on(t,e){const i=y.generate(),s=this.listeners[t];return s?s[i]=e:this.listeners[t]={[i]:e},{off:()=>{var e,s;(null===(s=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===s?void 0:s[i])&&delete this.listeners[t][i]}}}destroy(){this.listeners=f.createDefaultListenersState()}}f.createDefaultListenersState=()=>({"*":{}});const v=f,O=(t,e,i,s)=>{const n=EventTarget.prototype,{addEventListenerBase:o,addEventListener:r}=n;(o||r).call(t,e,i,s)};class S{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class T{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===n?Object.assign(Object.assign({},t),T.moduleToContainerParams):t));return Object.assign(Object.assign({},t),{children:e})}));return Object.assign(Object.assign({},t),{views:e})}static sort(t,e){return t.index>e.index?1:-1}static reIndex(t,e){return Object.assign(Object.assign({},t),{index:e+t.index})}}var C,_,N,A,R,L,I,P,x,M,D,U;T.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"},(_=C||(C={})).VIEW="VIEW",_.CONTAINER="CONTAINER",_.TEXT="TEXT",_.INPUT="INPUT",_.BUTTON="BUTTON",_.IMAGE="IMAGE",_.CONSENT="CONSENT",_.COUNTDOWN_TIMER="COUNTDOWN_TIMER",_.PROMO_CODE="PROMO_CODE",_.MULTIPLE_INPUT="MULTIPLE_INPUT",_.VIDEO="VIDEO",_.SLIDER="SLIDER",_.SLIDE="SLIDE",_.SOCIAL="SOCIAL",_.COLUMNS="COLUMNS",_.COLUMN="COLUMN",_.PRIZE_BASED_GAMING="PRIZE_BASED_GAMING",(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"}(A||(A={})),function(t){t.SELF="_self",t.BLANK="_blank"}(R||(R={})),function(t){t.TOP="TOP",t.CENTER="CENTER",t.BOTTOM="BOTTOM"}(L||(L={})),function(t){t.LEFT="LEFT",t.CENTER="CENTER",t.RIGHT="RIGHT"}(I||(I={})),function(t){t.SLIDE_TO_TOP="SLIDE_TO_TOP",t.SLIDE_TO_BOTTOM="SLIDE_TO_BOTTOM",t.SLIDE_TO_LEFT="SLIDE_TO_LEFT",t.SLIDE_TO_RIGHT="SLIDE_TO_RIGHT"}(P||(P={})),function(t){t.PULSE="PULSE",t.VIBRATE="VIBRATE",t.WOBBLE="WOBBLE",t.SHAKE="SHAKE",t.JELLO="JELLO",t.BOUNCE="BOUNCE",t.BLINK="BLINK",t.FLICKER="FLICKER",t.PING="PING"}(x||(x={})),function(t){t.LEFT="LEFT",t.RIGHT="RIGHT"}(M||(M={})),(U=D||(D={})).BEFORE="BEFORE",U.AFTER="AFTER",U.INSIDE="INSIDE",U.INSTEAD="INSTEAD";class w extends v{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(w.changeEventName,this._isMobile)}))}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(w.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(w.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}w.changeEventName="CHANGE";const j=w;class B{static set(t,e){const i=t[B.accumulatorPropertyName]||{};t[B.accumulatorPropertyName]=Object.assign(Object.assign({},i),e.styleAttributes),Object.keys(t[B.accumulatorPropertyName]).forEach((i=>{i.includes("--")?t.style.setProperty(i,e.styleAttributes[i]||""):t.style[i]=e.styleAttributes[i]?e.styleAttributes[i]:""}))}}B.accumulatorPropertyName="clStyleAttributes";const k=B;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,i=null,n){var r,l,a;const d=null===(l=null===(r=null==i?void 0:i.props)||void 0===r?void 0:r.handlers)||void 0===l?void 0:l.find((t=>"CLICK"===t.type));d&&(null===(a=d.actions)||void 0===a?void 0:a.length)&&(e.style.cursor="pointer"),t!==s&&t!==o&&t!==c||(e.style.display=n===F.CONTENT_LOCKER&&t===s?"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 G{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class H{constructor(t,e,i,s,n,o){this.hostElement=e,this.documentModel=t,this.getSharedCb=i,this.getPropsCb=s,this.getEnvCb=n,this.httpClient=o,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,i]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:i.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((i=>{var s,n,o,r,l;const a=null===(n=null===(s=e.adaptiveStyles)||void 0===s?void 0:s[t])||void 0===n?void 0:n.find((t=>t.element===i)),c=(null===(o=e.styles)||void 0===o?void 0:o.find((t=>t.element===i)))||{},d=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),h=this.parseBackground(d);h.url&&this.envUrlMaps[t].set(i,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,i])=>this.httpClient.execute(i.originalSVGResourceURL).then((t=>t.text())).then((s=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},i),{inlineSvgString:s}))}))))).then((()=>{this._applyHostElementBackground(this.envUrlMaps[t].get("host"),this.getSharedCb().cssVars)})).catch((t=>{console.error(t),G.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t)})),this}_applyHostElementBackground(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(t,e){const i=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(i)}')${t.positionOptions}`}off(){var t;null===(t=this.subscription)||void 0===t||t.off()}}const V=new class{execute(t,e="GET",i=null,s,n){const o={method:e,headers:Object.assign({"Content-Type":"text/plain"},s||{}),credentials:"same-origin",body:null,signal:n};return i&&(o.body="string"==typeof i?i:JSON.stringify(i)),fetch(t,o)}};function $(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,i)=>Object.assign(Object.assign({},e),{[i]:t[i]})),{})}class K{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase()))}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,(t=>"_"+t)).toUpperCase()}}class Q{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}var z;!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"}(z||(z={}));const X=z;class J{constructor(t,e,i){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(X.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(X.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=i,this.counters={pending:new Q(this.onCounterStateUpdate)}}}const q=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>q(...t)}},Y=q,Z="props",tt="shared",et="environment";function it(t,e,i,s){const n=t=>{let o=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return o&&(s&&"function"==typeof s?s(o.getAttribute(e)):(null===(r=null==o?void 0:o.getAttribute)||void 0===r?void 0:r.call(o,e))===i)?o:o&&o.parentNode&&n(o.parentNode)||null;var r};return n(t)}const st="SUBMIT";function nt(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((i=>{if("element"===i||"classes"===i)return;const s=e[i];s&&"object"==typeof s&&!Array.isArray(s)?t[i]=Object.assign(Object.assign({},t[i]||{}),s):t[i]=s})),t):t}function ot(t,e,i){var s;return null===(s=null==t?void 0:t[e])||void 0===s?void 0:s.find((t=>t.element===i))}function rt(t){const{element:e,html:i,appendHtml:s}=t,n=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(i);s?e.innerHTML+=n:e.innerHTML=n}class lt extends Event{constructor(t,e,i){super(t,i),this.detail={},Object.defineProperty(this,"detail",{value:e})}}var at;!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(at||(at={}));class ct extends HTMLElement{constructor(){var s;super(),this.construct=()=>{let t;const e=this.getAttribute(i("id")),s=this.getWidgetContainerNode();if(!s)throw new Error("Widget container not found in construct");const n=s.closest(`[${i("widget-id")}]`);let o;n&&(o=n.getAttribute(i("widget-id")));let r=new lt("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(i("path")),id:e,widgetId:o},{bubbles:!0,composed:!0});this.dispatchEvent(r),t=r.detail.props,Object.assign(this,t),this.observers=Y(Z,tt,et),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach((t=>null==t?void 0:t.off()))}},this.state=new S({}),this.componentEventEmitter=new v,this.componentResourceManager=new J(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new E(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(Z).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),s=i("floating");t.floating&&!e.getAttribute(s)?e.setAttribute(s,"true"):!t.floating&&e.getAttribute(s)&&e.removeAttribute(s)})),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(tt).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new H(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),V),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(j.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(et).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===at.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===at.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(Z).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(tt).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(et).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${i("element")}]`)).filter((t=>!t.hasAttribute(i("component"))))],this.getElement=(t,e)=>this.getElements().find((s=>e?s.getAttribute(i("element"))===t&&s.id===e:s.getAttribute(i("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const s=this.getElements();if(!s.length)return;const n=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const i=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let s=!1,n=!1;i.desktop&&i.desktop.forEach((i=>{i.element===e&&(nt(i,t),s=!0)})),i.mobile&&i.mobile.forEach((i=>{i.element===e&&(nt(i,t),n=!0)})),!s&&i.desktop&&i.desktop.push(JSON.parse(JSON.stringify(t))),!n&&i.mobile&&i.mobile.push(JSON.parse(JSON.stringify(t)))})),i}(t,e),o=i("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)),rt({element:l,html:""}),s.forEach((t=>{let e=t.getAttribute(i("element"));const s=this.getEnvironment();let o=ot(n,s,e);if(o){if(this.resizeListener.isMobile()){const t=ot(n,"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[i,s]of Object.entries(e))t.style[i]=s;return!0},this.applyStylesToElement=(t,e,s)=>{var n,o;const r=[];"host"===(e=ct._resolveTogglableStylesForElementModel(e)).element&&(W.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(n=this.model.props.backgroundDynamicInlineSVGElements)||void 0===n?void 0:n.desktop)||"mobile"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),r.push("background")));let l=e.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],O(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),O(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:$(e.styleAttributes,r)});if(k.set(t,c),this._setClassAttributes(t,e),s){if(e.hoverStyleAttributes){let n=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const i=t.tagName.toLowerCase(),s=`flip-up-animation-${e.element}`;let o=this.getRootElement().querySelector(`#${s}`);o||(o=document.createElement("style"),o.id=s,t.appendChild(o)),rt({element:o,html:`\n ${i}::before {\n content: '';\n background: ${n.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${i}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),n=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}n.borderTopWidth&&"0px"!==n.borderTopWidth||delete n.borderTopColor,n.borderBottomWidth&&"0px"!==n.borderBottomWidth||delete n.borderBottomColor,n.borderLeftWidth&&"0px"!==n.borderLeftWidth||delete n.borderLeftColor,n.borderRightWidth&&"0px"!==n.borderRightWidth||delete n.borderRightColor,this._addStylesToStyleElement(s,e.element,n,`:not(.${i("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(s,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(s,this.getShared()),this.stylesAppliedToElement(t,e,s)}},this.applySharedClassesToElementModel=e=>function(e,i){let s=e;return(s.classes||"").split(" ").filter((e=>e.startsWith(t))).forEach((t=>{var e;let n=null===(e=i.textClasses)||void 0===e?void 0:e[t];n&&(n.styleAttributes.fontFamily||(n.isHeader&&i.headerFontFamily&&(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:i.headerFontFamily})})),!n.isHeader&&i.textFontFamily&&(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:i.textFontFamily})}))),s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),n.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},s.placeholderStyleAttributes),n.placeholderStyleAttributes)}))})),s.styleAttributes.fontFamily||(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:i.textFontFamily})})),s}(e,this.documentModel.getShared()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,s,n="",o)=>{const r=Object.keys(s).reduce(((t,e)=>t+` ${K.camelCaseToDashCase(e)}: ${s[e]}${o?" !important;":";"}`),"");rt({element:t,html:`[${i("element")}="${e}"]${n} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{rt({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var i,s,n,o;e.linkColor&&rt({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(i=e.linkParams)||void 0===i?void 0:i.color)&&rt({element:t,html:`a {color: ${null===(s=e.linkParams)||void 0===s?void 0:s.color}}, a:visited {color: ${null===(n=e.linkParams)||void 0===n?void 0:n.color}}`,appendHtml:!0}),(null===(o=e.linkParams)||void 0===o?void 0:o.removeUnderline)&&rt({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(i,s)=>{Array.from(i.classList).filter((t=>t!==e("hovered")&&t!==e("focused"))).forEach((e=>{e.startsWith(t)&&i.classList.remove(e)}));const n=((i.getAttribute("class")||"")+" "+s.classes).trim();i.setAttribute("class",n)},this.getParentComponent=()=>it(this.parentNode,i("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(i("path"));return t&&1===t.split(",").length?this.parentNode:it(this.parentNode,i("path"),void 0,(t=>t&&1===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,i)=>{if(e)return e;const s=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const i=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[i]?{translations:e[i],language:i}:null}(i,t);return s||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,i)=>{},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,i,s,n,o,r;const l=t.control.name;if(["email","first_name","last_name"].includes(l))return l.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(n=null===(s=null===(i=t.adaptiveStyles)||void 0===i?void 0:i.desktop.find((t=>"label"===t.element)))||void 0===s?void 0:s.params)||void 0===n?void 0:n.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(o=t.content)||void 0===o?void 0:o.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(r=t.control)||void 0===r?void 0:r.integrationName)?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{var e;switch(null===(e=t.control)||void 0===e?void 0:e.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},i=this.services.actionRegister.getRegisteredActions().find((t=>t.category===st));i?null==i||i.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:u.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===(s=this.constructor.define)||void 0===s?void 0:s.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}}ct._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=ct._resolveTogglableStyles(e[t]))})),e},ct._resolveTogglableStyles=t=>{const e=Object.assign({},t),i=(t,i,s)=>{i in e&&(t.forEach((t=>{t in e&&(e[t]=e[i]?e[t]:s)})),delete e[i])};return i(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),i(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e};const dt=ct,ht={name:"SysSlideComponent",componentType:"SLIDE",version:"1.0.0",focusParentOnClick:!0,preventDraggable:!0,propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0,params:{indentationType:"PADDING"}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"ALIGNMENT",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=host]","styleAttributes"],hideSyncSelect:!0},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",hideSyncSelect:!0,params:{indentationType:"PADDING"}}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0}}]},events:{dispatch:[],listen:[]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1}}]},i18nPropPaths:["handlers,[id],actions,[id],params,link"],props:{content:{name:null},styles:[{element:"host",styleAttributes:{background:"#FFFFFF"},classes:""}],adaptiveStyles:{desktop:[{element:"host",styleAttributes:{display:"inline-flex",position:"relative",width:"100%",minWidth:null,height:"auto",minHeight:null,overflow:"hidden",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"20px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}],mobile:[{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:null,height:"auto",minHeight:null,overflow:"hidden",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:"20px",paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1,borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"0px",borderTopColor:"rgb(0, 0, 0)",borderBottomWidth:"0px",borderBottomColor:"rgb(0, 0, 0)",borderLeftWidth:"0px",borderLeftColor:"rgb(0, 0, 0)",borderRightWidth:"0px",borderRightColor:"rgb(0, 0, 0)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},classes:""}]}},waitForResourcesLoad:!0,resourcesPropPaths:[["adaptiveStyles",":ENV","styleAttributes","background"],["styles","styleAttributes","background"]],metaDescription:{label:{en:"Slide",ru:"Слайд",uk:"Слайд",es:"Diapositiva",fr:"Diapositive",de:"Slide",it:"Slide",pt:"Diapositivo",ro:"Slide",bg:"Слайд",cs:"Slide",el:"Slide",nl:"Slide",pl:"Slajd",sv:"Slide",tr:"Slide",ar:"Slide",zh:"Slide",da:"Slide",he:"Slide",fi:"Slide",hi:"Slide",hr:"Slide",hu:"Slide",id:"Slide",ja:"Slide",ko:"Slide",no:"Slide",sk:"Slide",sl:"Slide",sr:"Slide"}},syncEnabled:!0,stylesImitationEnabled:!0};function ut(t){return ut="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},ut(t)}function pt(t,e){for(var i=0;i<e.length;i++){var s=e[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(t,ft(s.key),s)}}function mt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(mt=function(){return!!t})()}function gt(){return gt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var s=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=bt(t)););return t}(t,e);if(s){var n=Object.getOwnPropertyDescriptor(s,e);return n.get?n.get.call(arguments.length<3?t:i):n.value}},gt.apply(null,arguments)}function bt(t){return bt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},bt(t)}function Et(t,e){return Et=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Et(t,e)}function yt(t,e,i){return(e=ft(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ft(t){var e=function(t){if("object"!=ut(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=ut(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ut(e)?e:e+""}var vt=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),yt(e=function(t,e,i){return e=bt(e),function(t,e){if(e&&("object"==ut(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,mt()?Reflect.construct(e,i||[],bt(t).constructor):e.apply(t,i))}(this,t),"manifest",ht),e.getRootElement().innerHTML="\n <style>\n :host {\n position: relative;\n flex: 0 0 100%;\n min-width: 20px;\n min-height: 20px;\n }\n </style>\n ",e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Et(t,e)}(t,dt),function(t,e){return e&&pt(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;!function(t,e,i){var s=gt(bt(t.prototype),"connectedCallback",i);return"function"==typeof s?function(t){return s.apply(i,t)}:s}(t,0,this)([]),this.observeProps((function(t,i){e.applyAutoAdaptiveStyles(i.adaptiveStyles,i.styles)}))}}])}();yt(vt,"define",{name:"sys-slide",model:ht.name,manifest:ht});export{vt as default};window.clComponentClass_SysSlideComponent=vt;