@claspo/components 1.1.15 → 1.2.0-theme.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const t=(t,e,i,n)=>{const{addEventListenerBase:s,addEventListener:o}=EventTarget.prototype;(s||o).call(t,e,i,n)},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:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{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"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{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"}]}],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:"return sdk.widgetType !== 'TEASER'"},{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:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"IMAGE_SOURCES",element:"image",propPath:["control","imageSource"]},{type:"CONTROL",name:"FLOATING_COMPONENT_POSITION",element:"host",elementProp:"styleAttributes",displayCondition:"return sdk.component.getProps().floating ? !sdk.component.getProps().control.positioning : false;",params:{label:"DOCUMENT_POSITION"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"DISPLAY",elementProp:"styleAttributes",elementSubProp:"display",element:"host",params:{label:"DOCUMENT_DISPLAY_ON_DESKTOP"}},{type:"CONTROL",name:"BORDER_RADIUS",elementProp:"styleAttributes",element:"image",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",displayCondition:"return !sdk.component.getProps().floating;",params:{indentationType:"PADDING"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",displayCondition:"return !sdk.component.getProps().floating;",params:{indentationType:"MARGIN"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{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:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"IMAGE_SOURCES",element:"image",propPath:["control","imageSource"]},{type:"CONTROL",name:"FLOATING_COMPONENT_POSITION",element:"host",elementProp:"styleAttributes",displayCondition:"return sdk.component.getProps().floating ? !sdk.component.getProps().control.positioning : false;",params:{label:"DOCUMENT_POSITION"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"DISPLAY",elementProp:"styleAttributes",elementSubProp:"display",element:"host",params:{label:"DOCUMENT_DISPLAY_ON_MOBILE"},displayCondition:"return sdk.appConfig.modelType !== 'RESPONSIVE'"},{type:"CONTROL",name:"BORDER_RADIUS",elementProp:"styleAttributes",element:"image",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",displayCondition:"return !sdk.component.getProps().floating;",params:{indentationType:"PADDING"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",displayCondition:"return !sdk.component.getProps().floating;",params:{indentationType:"MARGIN"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0},displayCondition:"return sdk.widgetType !== 'TEASER'"}]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1},displayCondition:"return sdk.widgetType !== 'TEASER'"}]},i18nPropPaths:["handlers,[id],actions,[id],params,link","handlers,[id],actions,[id],params,customData"],events:{dispatch:[],listen:[]},props:{control:{imageSource:{url:""}},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"]]},i="cl-";function n(t){return i+t}function s(t){return"cl-"+t}const o="VIEW",r="MODULE",l="CONTAINER",a="INPUT",c="BUTTON",d="CONSENT",p="COLUMN",u="SUBSCRIBE_CONTACT",h="REQUEST",m="SHOW_WIDGET",g="OPEN_LINK",y="CLOSE_WIDGET";class b{static sortActions(t){const e={[y]:-1,[g]:-2,[m]:1,[u]:2,[h]: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=b.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,i){this.state=t;const n=i(),o=n.getAttribute(s("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(s("type"))));let i=0;for(;e[i]&&e[i].getAttribute(s("id"))!==o;){let t=e[i].getAttribute(s("type"));if(b.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;i++}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,n;try{for(var s,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={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(i){e[i]=t[i]&&function(e){return new Promise((function(n,s){!function(t,e,i,n){Promise.resolve(n).then((function(e){t({value:e,done:i})}),e)}(n,s,(e=t[i](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(s=await r.next()).done);){n=s.value,o=!1;try{const{event:t}=n;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{o=!0}}}catch(t){e={error:t}}finally{try{o||t||!(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=[])}}b.IGNORING_VIEW_ENTRY_TYPES=[c,d,a];const f="CLICK",v="COMPONENT_EVENT";class E{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 O{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 f:return new b(t,e);case v:return new E(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class S{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 A{constructor(){this.listeners=A.createDefaultListenersState()}emit(t,e,i=null){const n=this.listeners[t];n&&Object.values(n).forEach((n=>n(e,t,i))),Object.values(this.listeners["*"]).forEach((n=>n(e,t,i)))}on(t,e){const i=S.generate(),n=this.listeners[t];return n?n[i]=e:this.listeners[t]={[i]:e},{off:()=>{var e,n;(null===(n=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===n?void 0:n[i])&&delete this.listeners[t][i]}}}destroy(){this.listeners=A.createDefaultListenersState()}}A.createDefaultListenersState=()=>({"*":{}});class T{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class R{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===r?Object.assign(Object.assign({},t),R.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})}}R.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class C extends A{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(C.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(C.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(C.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}C.changeEventName="CHANGE";class P{static set(t,e){const i=t[P.accumulatorPropertyName]||{};t[P.accumulatorPropertyName]=Object.assign(Object.assign({},i),e.styleAttributes),Object.keys(t[P.accumulatorPropertyName]).forEach((i=>{i.includes("--")?t.style.setProperty(i,e.styleAttributes[i]||""):t.style[i]=e.styleAttributes[i]?e.styleAttributes[i]:""}))}}P.accumulatorPropertyName="clStyleAttributes";const N="CONTENT_LOCKER";class x{static applyHostStyles(t,e,i=null,n){var s,r,a;const c=null===(r=null===(s=null==i?void 0:i.props)||void 0===s?void 0:s.handlers)||void 0===r?void 0:r.find((t=>"CLICK"===t.type));c&&(null===(a=c.actions)||void 0===a?void 0:a.length)&&(e.style.cursor="pointer"),t!==o&&t!==l&&t!==p||(e.style.display=n===N&&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 L{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class I{constructor(t,e,i,n,s,o){this.hostElement=e,this.documentModel=t,this.getSharedCb=i,this.getPropsCb=n,this.getEnvCb=s,this.httpClient=o,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,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 n,s,o,r,l;const a=null===(s=null===(n=e.adaptiveStyles)||void 0===n?void 0:n[t])||void 0===s?void 0:s.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),p=this.parseBackground(d);p.url&&this.envUrlMaps[t].set(i,{originalSVGResourceURL:p.url,inlineSvgString:null,positionOptions:p.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,i])=>this.httpClient.execute(i.originalSVGResourceURL).then((t=>t.text())).then((n=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},i),{inlineSvgString:n}))}))))).then((()=>{this._applyHostElementBackground(this.envUrlMaps[t].get("host"),this.getSharedCb().cssVars)})).catch((t=>{console.error(t),L.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t)})),this}_applyHostElementBackground(t,e){t&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(t,e){const 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 _=new class{execute(t,e,i=null,n,s){const o={method:e,headers:Object.assign({"Content-Type":"text/plain"},n||{}),credentials:"same-origin",body:null,signal:s};return i&&(o.body="string"==typeof i?i:JSON.stringify(i)),fetch(t,o)}};function M(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,i)=>Object.assign(Object.assign({},e),{[i]:t[i]})),{})}class w{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 k{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}const j="COMPONENT_RESOURCES_LOADED",D="FAILED_TO_LOAD_COMPONENT_RESOURCE";class F{constructor(t,e,i){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(j,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(D,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=i,this.counters={pending:new k(this.onCounterStateUpdate)}}}const U=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>U(...t)}},B=U,W="props",G="shared",H="environment";function $(t,e,i,n){const s=t=>{let o=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return o&&(n&&"function"==typeof n?n(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&&s(o.parentNode)||null;var r};return s(t)}const V="SUBMIT";function z(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((i=>{"element"!==i&&"classes"!==i&&(e[i]&&"object"==typeof e[i]&&!Array.isArray(e[i])?t[i]=Object.assign(Object.assign({},t[i]||{}),e[i]):t[i]=e[i])})),t):t}function Z(t,e,i){var n;return null===(n=t[e])||void 0===n?void 0:n.find((t=>t.element===i))}function q(t){const{element:e,html:i,appendHtml:n}=t,s=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(i);n?e.innerHTML+=s:e.innerHTML=s}class Y extends Event{constructor(t,e,i){super(t,i),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class K extends HTMLElement{constructor(){var e,o;super(),this.construct=()=>{let t;const e=this.getAttribute(s("id")),i=this.getWidgetContainerNode();if(!i)throw new Error("Widget container not found in construct");const n=i.closest(`[${s("widget-id")}]`);let o;n&&(o=n.getAttribute(s("widget-id")));let r=new Y("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=B(W,G,H),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 A,this.componentResourceManager=new F(this.model.id,this.services.eventEmitter,"STATIC"===this.services.config.getConfig("entryModuleType")),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new O(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(W).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),i=s("floating");t.floating&&!e.getAttribute(i)?e.setAttribute(i,"true"):!t.floating&&e.getAttribute(i)&&e.removeAttribute(i)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(G).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new I(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(C.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(H).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(W).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(G).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(H).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((i=>e?i.getAttribute(s("element"))===t&&i.id===e:i.getAttribute(s("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const i=this.getElements();if(!i.length)return;t=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const i=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let n=!1,s=!1;i.desktop&&i.desktop.forEach((i=>{i.element===e&&(z(i,t),n=!0)})),i.mobile&&i.mobile.forEach((i=>{i.element===e&&(z(i,t),s=!0)})),!n&&i.desktop&&i.desktop.push(JSON.parse(JSON.stringify(t))),!s&&i.mobile&&i.mobile.push(JSON.parse(JSON.stringify(t)))})),i}(t,e);const n=s("type"),o="element-styles";let r=this.getRootElement().querySelector(`style[${n}="${o}"]`);r||(r=document.createElement("style"),r.setAttribute(n,o),this.getRootElement().appendChild(r)),q({element:r,html:""}),i.forEach((e=>{let i=e.getAttribute(s("element"));const n=this.getEnvironment();let o=Z(t,n,i);if(o){if(this.resizeListener.isMobile()){const e=Z(t,"desktop",i);e&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),o.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(o),r)}})),this._addLinkColor(r,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[i,n]of Object.entries(e))t.style[i]=n;return!0},this.applyStylesToElement=(e,i,n)=>{var o,r;const l=[];"host"===(i=K._resolveTogglableStylesForElementModel(i)).element&&(x.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=i.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),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const d=Object.assign(Object.assign({},i),{styleAttributes:M(i.styleAttributes,l)});if(P.set(e,d),this._setClassAttributes(e,i),n){if(i.hoverStyleAttributes){let t=Object.assign({},i.hoverStyleAttributes);if("FILL_UP"===i.hoverAnimationType){e.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",e.style.overflow="hidden";const n=e.tagName.toLowerCase(),s=`flip-up-animation-${i.element}`;let o=this.getRootElement().querySelector(`#${s}`);o||(o=document.createElement("style"),o.id=s,e.appendChild(o)),q({element:o,html:`\n ${n}::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 ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),t=Object.assign(Object.assign({},i.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(n,i.element,t,`:not(.${s("no-hover")}):hover`,!0)}i.placeholderStyleAttributes&&this._addStylesToStyleElement(n,i.element,i.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(n,this.getShared()),this.stylesAppliedToElement(e,i,n)}},this._fixMarginOverflow=t=>{const e=this.getParentComponent(),i=e&&("flex"===e.style.display||"inline-flex"===e.style.display),n="host",o=t.getAttribute(s("element"))===n;if(!i||!o)return;const r=this.getProps(),l=this.getEnvironment(),{styleAttributes:a}=Z(r.adaptiveStyles,l,n)||{};if(!a)return;const c=a.marginLeft||a.marginRight,d="100%"===a.width;if(c&&d){const e=(parseFloat(a.marginLeft)||0)+(parseFloat(a.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=t=>function(t,e){let n=t;return(n.classes||"").split(" ").filter((t=>t.startsWith(i))).forEach((t=>{var i;let s=null===(i=e.textClasses)||void 0===i?void 0:i[t];s&&(s.styleAttributes.fontFamily||(s.isHeader&&e.headerFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:e.headerFontFamily})})),!s.isHeader&&e.textFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:e.textFontFamily})}))),n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),s.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},n.placeholderStyleAttributes),s.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,i,n="",o)=>{const r=Object.keys(i).reduce(((t,e)=>t+` ${w.camelCaseToDashCase(e)}: ${i[e]}${o?" !important;":";"}`),"");q({element:t,html:`[${s("element")}="${e}"]${n} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{q({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var i,n,s,o;e.linkColor&&q({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)&&q({element:t,html:`a {color: ${null===(n=e.linkParams)||void 0===n?void 0:n.color}}, a:visited {color: ${null===(s=e.linkParams)||void 0===s?void 0:s.color}}`,appendHtml:!0}),(null===(o=e.linkParams)||void 0===o?void 0:o.removeUnderline)&&q({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(t,e)=>{Array.from(t.classList).filter((t=>t!==n("hovered")&&t!==n("focused"))).forEach((e=>{e.startsWith(i)&&t.classList.remove(e)}));const s=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",s)},this.getParentComponent=()=>$(this.parentNode,s("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(s("path"));return t&&1===t.split(",").length?this.parentNode:$(this.parentNode,s("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>{return[(t=this.services.config).getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t));var t},this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,i)=>{if(e)return e;const n=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 n||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;const n=t.control.name;if(["email","first_name","last_name"].includes(n))return n.toUpperCase();if(t.content.label&&(null===(i=null===(e=t.adaptiveStyles.desktop.find((t=>"label"===t.element)))||void 0===e?void 0:e.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 t.content.placeholder?this.capitalizeFirstLetter(t.content.placeholder):t.control.integrationName?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{switch(t.control.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},i=this.services.actionRegister.getRegisteredActions().find((t=>t.category===V));i?null==i||i.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:h}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>this.getProps().handlers&&this.getProps().handlers.length?[...this.getProps().handlers]:[],this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(e=this.define)||void 0===e?void 0:e.manifest)||(null===(o=this.constructor.define)||void 0===o?void 0:o.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=K._resolveTogglableStyles(e[t]))})),e}static _resolveTogglableStyles(t){const e=Object.assign({},t),i=(t,i,n)=>{i in e&&(t.forEach((t=>{t in e&&(e[t]=e[i]?e[t]:n)})),delete e[i])};return i(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),i(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}function Q(t){return Q="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},Q(t)}function J(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ot(n.key),n)}}function X(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(X=function(){return!!t})()}function tt(t,e,i,n){var s=et(it(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof s?function(t){return s.apply(i,t)}:s}function et(){return et="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=it(t)););return t}(t,e);if(n){var s=Object.getOwnPropertyDescriptor(n,e);return s.get?s.get.call(arguments.length<3?t:i):s.value}},et.apply(null,arguments)}function it(t){return it=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},it(t)}function nt(t,e){return nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nt(t,e)}function st(t,e,i){return(e=ot(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ot(t){var e=function(t){if("object"!=Q(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=Q(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Q(e)?e:e+""}var rt={TOP:"top",CENTER:"center",BOTTOM:"bottom"},lt={LEFT:"left",CENTER:"center",RIGHT:"right"},at={FIXED:"fixed",STICKY:"sticky"},ct=function(){function e(){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),st(i=function(t,e,i){return e=it(e),function(t,e){if(e&&("object"==Q(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,X()?Reflect.construct(e,i||[],it(t).constructor):e.apply(t,i))}(this,e),"applyStylesRespectingRelativePositioning",(function(){var t=i.processPositioningStyles(i.getProps());i.originalApplyAutoAdaptiveStyles(t),i.fixFloatingImageSize(t)})),st(i,"recalculateStylesAfterImageLoad",(function(){i.resourcesLoadedListener=i.services.eventEmitter.on("VIEW_COMPONENT_RESOURCES_LOADED",(function(){requestAnimationFrame((function(){i.applyAdaptiveStyles(i.getProps())}))}))})),st(i,"_getHostNewDimensionsWithStyles",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=i.getHostElement();return["height","width","minHeight","minWidth","maxHeight","maxWidth","display"].forEach((function(i){t[i]?e.style[i]=t[i]:e.style[i]&&(e.style[i]="")})),{width:e.offsetWidth,height:e.offsetHeight}})),st(i,"processPositioningStyles",(function(t){var e,n,s=t.adaptiveStyles;if(((null===(e=t.control)||void 0===e?void 0:e.positioningMode)||at.FIXED)===at.FIXED)return s;var o=i.getEnvironment(),r=(null===(n=t.control)||void 0===n||null===(n=n.positioning)||void 0===n?void 0:n[o])||{},l=(null==r?void 0:r.diff)||{};if(!Boolean("x"in l&&"y"in l))return s;var a=Z(s,o,"host").styleAttributes,c=i._getHostNewDimensionsWithStyles(a),d=c.width,p=c.height,u=M(a,["left","right","top","bottom"]),h=d/2,m=l.x-h;r.horizontalPosition===lt.LEFT?(u.left="".concat(m,"px"),u.right="auto"):r.horizontalPosition===lt.RIGHT?(u.right="".concat(-d-m,"px"),u.left="auto"):(u.left="calc(50% + ".concat(m,"px)"),u.right="auto");var g=p/2,y=l.y-g;return r.verticalPosition===rt.TOP?(u.top="".concat(y,"px"),u.bottom="auto"):r.verticalPosition===rt.BOTTOM?(u.bottom="".concat(-p-y,"px"),u.top="auto"):(u.top="calc(50% + ".concat(y,"px)"),u.bottom="auto"),function(t,e,i,n={}){return Object.assign(Object.assign({},t),{[e]:t[e].map((t=>t.element===i?Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},n)}):t))})}(s,o,"host",u)})),st(i,"deleteElementIfPresent",(function(t,e){var i=t.querySelector(e);i&&i.remove()})),st(i,"upsertSvg",(function(t,e){var n=t.querySelector("svg");return n&&n.getAttribute("inline-svg-url")===e?Promise.resolve():(n&&i.deleteElementIfPresent(i.getRootElement(),".svgOverflowContainer"),fetch(e).then((function(t){return t.text()})).then((function(n){var s=document.createElement("template"),o=document.createElement("div");o.style.overflow="hidden",o.style.width="100%",o.style.height="inherit",o.classList.add("svgOverflowContainer"),s.append(o),s.firstChild.innerHTML=n.trim();var r=s.firstChild,l=r.querySelector("svg");return l.setAttribute("cl-element","image"),l.setAttribute("inline-svg-url",e),i.componentResourceManager.getPending().decrement(),t.append(r),t})).catch((function(e){console.error(e),i.upsertImage(t,null)})))})),st(i,"upsertImage",(function(e,n){var s=e.querySelector("img");if(s)return s.src=n,t(s,"load",(function(){i.componentResourceManager.getPending().decrement()})),t(s,"error",(function(){i.componentResourceManager.onResourceLoadFailure(s.src)})),Promise.resolve();var o=new Image;return o.setAttribute("cl-element","image"),o.src=n,t(o,"load",(function(){i.componentResourceManager.getPending().decrement()})),t(o,"error",(function(){i.componentResourceManager.onResourceLoadFailure(o.src)})),e.append(o),Promise.resolve()})),st(i,"applyAdaptiveStyles",(function(t){var e;i.applyAutoAdaptiveStyles(t.adaptiveStyles);var n=i.getEnvironment(),s=t.adaptiveStyles[n],o=s.find((function(t){return"host"===t.element})),r=s.find((function(t){return"image"===t.element})),l=i.getElement("image"),a={cover:"xMidYMid slice",contain:"xMidYMid meet",none:""},c=l&&"svg"===l.nodeName,d=(null==r||null===(e=r.styleAttributes)||void 0===e?void 0:e.objectFit)&&a.hasOwnProperty(r.styleAttributes.objectFit);if(c&&d)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"!==o.styleAttributes.width&&"auto"!==o.styleAttributes.height)return l.setAttribute("height","100%"),void l.setAttribute("width","100%");if("auto"===o.styleAttributes.width&&"auto"===o.styleAttributes.height)return l.setAttribute("width",l.viewBox.baseVal.width+"px"),void l.setAttribute("height",l.viewBox.baseVal.height+"px");"auto"===o.styleAttributes.width&&(l.setAttribute("height","100%"),"100%"!==o.styleAttributes.height&&"calc(100% - 0px)"!==o.styleAttributes.height&&l.setAttribute("width","".concat(Math.round(parseInt(o.styleAttributes.height,10)*p),"px"))),"auto"===o.styleAttributes.height&&(l.setAttribute("width","100%"),"100%"!==o.styleAttributes.width&&"calc(100% - 0px)"!==o.styleAttributes.width&&l.setAttribute("height","".concat(Math.round(parseInt(o.styleAttributes.width,10)/p),"px")))}})),st(i,"fixFloatingImageSize",(function(t){var e=i.getElement("image");e&&((i.getModel().floating||i.getProps().floating)&&"auto"===Z(t,i.getEnvironment(),"host").styleAttributes.width?e.style.width="":e.style.width="100%")})),i.originalApplyAutoAdaptiveStyles=i.applyAutoAdaptiveStyles,i.applyAutoAdaptiveStyles=i.applyStylesRespectingRelativePositioning,i.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 '),i}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&&nt(t,e)}(e,K),i=e,(n=[{key:"disconnectedCallback",value:function(){var t;tt(e,"disconnectedCallback",this,3)([]),null===(t=this.resourcesLoadedListener)||void 0===t||t.off()}},{key:"connectedCallback",value:function(){var t=this;tt(e,"connectedCallback",this,3)([]),this.componentResourceManager.getPending().increment(),this.recalculateStylesAfterImageLoad(),this.observeProps((function(e,i){var n;t.applyAutoAdaptiveStyles(i.adaptiveStyles);var s=t.getElement("image");null!==(n=i.control)&&void 0!==n&&n.imageSource.url&&s&&"src"in s&&(s.src=i.control.imageSource.url);var o=i.control.imageSource.url,r=e&&e.control.imageSource.url,l=String(i.control.imageSource.url).endsWith(".svg")?i.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(i);t.deleteElementIfPresent(t.getRootElement(),"img"),t.upsertSvg(t.getRootElement(),l).then((function(){t.applyAdaptiveStyles(i)}))}else if(o){if(o===r)return void t.applyAdaptiveStyles(i);t.deleteElementIfPresent(t.getRootElement(),".svgOverflowContainer"),t.upsertImage(t.getRootElement(),o).then((function(){t.applyAdaptiveStyles(i)}))}else t.deleteElementIfPresent(t.getRootElement(),".svgOverflowContainer"),t.upsertImage(t.getRootElement(),t.assets("img/image-placeholder.svg")).then((function(){t.applyAdaptiveStyles(i)}))}))}}])&&J(i.prototype,n),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,n}();st(ct,"define",{name:"sys-image",model:e.name,manifest:e});export{lt as HorizontalPosition,at as PositioningModes,rt as VerticalPosition,ct as default};window.clComponentClass_SysImageComponent=ct;
1
+ const t=(t,e,i,n)=>{const{addEventListenerBase:s,addEventListener:o}=EventTarget.prototype;(s||o).call(t,e,i,n)},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:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{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"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{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"}]}],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:"return sdk.widgetType !== 'TEASER'"},{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:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"IMAGE_SOURCES",element:"image",propPath:["control","imageSource"]},{type:"CONTROL",name:"FLOATING_COMPONENT_POSITION",element:"host",elementProp:"styleAttributes",displayCondition:"return sdk.component.getProps().floating ? !sdk.component.getProps().control.positioning : false;",params:{label:"DOCUMENT_POSITION"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"DISPLAY",elementProp:"styleAttributes",elementSubProp:"display",element:"host",params:{label:"DOCUMENT_DISPLAY_ON_DESKTOP"}},{type:"CONTROL",name:"BORDER_RADIUS",elementProp:"styleAttributes",element:"image",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",displayCondition:"return !sdk.component.getProps().floating;",params:{indentationType:"PADDING"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",displayCondition:"return !sdk.component.getProps().floating;",params:{indentationType:"MARGIN"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{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:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"IMAGE_SOURCES",element:"image",propPath:["control","imageSource"]},{type:"CONTROL",name:"FLOATING_COMPONENT_POSITION",element:"host",elementProp:"styleAttributes",displayCondition:"return sdk.component.getProps().floating ? !sdk.component.getProps().control.positioning : false;",params:{label:"DOCUMENT_POSITION"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"DISPLAY",elementProp:"styleAttributes",elementSubProp:"display",element:"host",params:{label:"DOCUMENT_DISPLAY_ON_MOBILE"},displayCondition:"return sdk.appConfig.modelType !== 'RESPONSIVE'"},{type:"CONTROL",name:"BORDER_RADIUS",elementProp:"styleAttributes",element:"image",syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",displayCondition:"return !sdk.component.getProps().floating;",params:{indentationType:"PADDING"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",displayCondition:"return !sdk.component.getProps().floating;",params:{indentationType:"MARGIN"},syncSelectDisplayCondition:"return sdk.widgetType !== 'TEASER'"}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0},displayCondition:"return sdk.widgetType !== 'TEASER'"}]},i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!1},displayCondition:"return sdk.widgetType !== 'TEASER'"}]},i18nPropPaths:["handlers,[id],actions,[id],params,link","handlers,[id],actions,[id],params,customData"],events:{dispatch:[],listen:[]},props:{control:{imageSource:{url:""}},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"]]},i="cl-";function n(t){return i+t}function s(t){return"cl-"+t}const o="VIEW",r="MODULE",l="CONTAINER",a="INPUT",c="BUTTON",d="CONSENT",p="COLUMN",u="SUBSCRIBE_CONTACT",h="REQUEST",m="SHOW_WIDGET",g="OPEN_LINK",y="CLOSE_WIDGET";class b{static sortActions(t){const e={[y]:-1,[g]:-2,[m]:1,[u]:2,[h]: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=b.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,i){this.state=t;const n=i(),o=n.getAttribute(s("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute(s("type"))));let i=0;for(;e[i]&&e[i].getAttribute(s("id"))!==o;){let t=e[i].getAttribute(s("type"));if(b.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;i++}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,n;try{for(var s,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={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(i){e[i]=t[i]&&function(e){return new Promise((function(n,s){!function(t,e,i,n){Promise.resolve(n).then((function(e){t({value:e,done:i})}),e)}(n,s,(e=t[i](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(s=await r.next()).done);){n=s.value,o=!1;try{const{event:t}=n;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{o=!0}}}catch(t){e={error:t}}finally{try{o||t||!(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=[])}}b.IGNORING_VIEW_ENTRY_TYPES=[c,d,a];const f="CLICK",v="COMPONENT_EVENT";class E{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 O{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 f:return new b(t,e);case v:return new E(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class S{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 A{constructor(){this.listeners=A.createDefaultListenersState()}emit(t,e,i=null){const n=this.listeners[t];n&&Object.values(n).forEach((n=>n(e,t,i))),Object.values(this.listeners["*"]).forEach((n=>n(e,t,i)))}on(t,e){const i=S.generate(),n=this.listeners[t];return n?n[i]=e:this.listeners[t]={[i]:e},{off:()=>{var e,n;(null===(n=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===n?void 0:n[i])&&delete this.listeners[t][i]}}}destroy(){this.listeners=A.createDefaultListenersState()}}A.createDefaultListenersState=()=>({"*":{}});class T{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class R{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===r?Object.assign(Object.assign({},t),R.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})}}R.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};class C extends A{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",(({isMobileEnv:t})=>{this._isMobile=t,this.emit(C.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(C.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(C.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}C.changeEventName="CHANGE";class P{static set(t,e){const i=t[P.accumulatorPropertyName]||{};t[P.accumulatorPropertyName]=Object.assign(Object.assign({},i),e.styleAttributes),Object.keys(t[P.accumulatorPropertyName]).forEach((i=>{i.includes("--")?t.style.setProperty(i,e.styleAttributes[i]||""):t.style[i]=e.styleAttributes[i]?e.styleAttributes[i]:""}))}}P.accumulatorPropertyName="clStyleAttributes";const N="CONTENT_LOCKER";class x{static applyHostStyles(t,e,i=null,n){var s,r,a;const c=null===(r=null===(s=null==i?void 0:i.props)||void 0===s?void 0:s.handlers)||void 0===r?void 0:r.find((t=>"CLICK"===t.type));c&&(null===(a=c.actions)||void 0===a?void 0:a.length)&&(e.style.cursor="pointer"),t!==o&&t!==l&&t!==p||(e.style.display=n===N&&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 I{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class L{constructor(t,e,i,n,s,o){this.hostElement=e,this.documentModel=t,this.getSharedCb=i,this.getPropsCb=n,this.getEnvCb=s,this.httpClient=o,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,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 n,s,o,r,l;const a=null===(s=null===(n=e.adaptiveStyles)||void 0===n?void 0:n[t])||void 0===s?void 0:s.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),p=this.parseBackground(d);p.url&&this.envUrlMaps[t].set(i,{originalSVGResourceURL:p.url,inlineSvgString:null,positionOptions:p.positionOptions})})),Promise.all([...this.envUrlMaps[t].entries()].map((([e,i])=>this.httpClient.execute(i.originalSVGResourceURL).then((t=>t.text())).then((n=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},i),{inlineSvgString:n}))}))))).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),I.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("THEME_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)})),this}_applyHostElementBackground(t,e={}){t&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(t,e){const i=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e.accent);return`url('data:image/svg+xml,${encodeURIComponent(i)}')${t.positionOptions}`}}const _=new class{execute(t,e,i=null,n,s){const o={method:e,headers:Object.assign({"Content-Type":"text/plain"},n||{}),credentials:"same-origin",body:null,signal:s};return i&&(o.body="string"==typeof i?i:JSON.stringify(i)),fetch(t,o)}};function M(t,e){return Object.keys(t).filter((t=>!e.includes(t))).reduce(((e,i)=>Object.assign(Object.assign({},e),{[i]:t[i]})),{})}class w{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 k{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}const j="COMPONENT_RESOURCES_LOADED",D="FAILED_TO_LOAD_COMPONENT_RESOURCE";class F{constructor(t,e,i){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(j,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(D,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=i,this.counters={pending:new k(this.onCounterStateUpdate)}}}const U=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>U(...t)}},B=U,W="props",G="shared",H="environment";function $(t,e,i,n){const s=t=>{let o=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return o&&(n&&"function"==typeof n?n(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&&s(o.parentNode)||null;var r};return s(t)}const V="SUBMIT";function z(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((i=>{"element"!==i&&"classes"!==i&&(e[i]&&"object"==typeof e[i]&&!Array.isArray(e[i])?t[i]=Object.assign(Object.assign({},t[i]||{}),e[i]):t[i]=e[i])})),t):t}function Z(t,e,i){var n;return null===(n=t[e])||void 0===n?void 0:n.find((t=>t.element===i))}function q(t){const{element:e,html:i,appendHtml:n}=t,s=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(i);n?e.innerHTML+=s:e.innerHTML=s}class Y extends Event{constructor(t,e,i){super(t,i),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class K extends HTMLElement{constructor(){var e,o;super(),this.construct=()=>{let t;const e=this.getAttribute(s("id")),i=this.getWidgetContainerNode();if(!i)throw new Error("Widget container not found in construct");const n=i.closest(`[${s("widget-id")}]`);let o;n&&(o=n.getAttribute(s("widget-id")));let r=new Y("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=B(W,G,H),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 A,this.componentResourceManager=new F(this.model.id,this.services.eventEmitter,"STATIC"===this.services.config.getConfig("entryModuleType")),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new O(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,(t=>{this.model.props=t,this.observers.get(W).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),i=s("floating");t.floating&&!e.getAttribute(i)?e.setAttribute(i,"true"):!t.floating&&e.getAttribute(i)&&e.removeAttribute(i)})),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,(t=>{Object.assign(this.model,t)})),this.documentModel.on("SHARED_UPDATE_ALL",(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(G).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new L(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(C.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(H).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(W).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(G).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(H).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((i=>e?i.getAttribute(s("element"))===t&&i.id===e:i.getAttribute(s("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const i=this.getElements();if(!i.length)return;t=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const i=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let n=!1,s=!1;i.desktop&&i.desktop.forEach((i=>{i.element===e&&(z(i,t),n=!0)})),i.mobile&&i.mobile.forEach((i=>{i.element===e&&(z(i,t),s=!0)})),!n&&i.desktop&&i.desktop.push(JSON.parse(JSON.stringify(t))),!s&&i.mobile&&i.mobile.push(JSON.parse(JSON.stringify(t)))})),i}(t,e);const n=s("type"),o="element-styles";let r=this.getRootElement().querySelector(`style[${n}="${o}"]`);r||(r=document.createElement("style"),r.setAttribute(n,o),this.getRootElement().appendChild(r)),q({element:r,html:""}),i.forEach((e=>{let i=e.getAttribute(s("element"));const n=this.getEnvironment();let o=Z(t,n,i);if(o){if(this.resizeListener.isMobile()){const e=Z(t,"desktop",i);e&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),o.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(o),r)}})),this._addLinkColor(r,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[i,n]of Object.entries(e))t.style[i]=n;return!0},this.applyStylesToElement=(e,i,n)=>{var o,r;const l=[];"host"===(i=K._resolveTogglableStylesForElementModel(i)).element&&(x.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=i.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),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const d=Object.assign(Object.assign({},i),{styleAttributes:M(i.styleAttributes,l)});if(P.set(e,d),this._setClassAttributes(e,i),n){if(i.hoverStyleAttributes){let t=Object.assign({},i.hoverStyleAttributes);if("FILL_UP"===i.hoverAnimationType){e.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",e.style.overflow="hidden";const n=e.tagName.toLowerCase(),s=`flip-up-animation-${i.element}`;let o=this.getRootElement().querySelector(`#${s}`);o||(o=document.createElement("style"),o.id=s,e.appendChild(o)),q({element:o,html:`\n ${n}::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 ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),t=Object.assign(Object.assign({},i.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(n,i.element,t,`:not(.${s("no-hover")}):hover`,!0)}i.placeholderStyleAttributes&&this._addStylesToStyleElement(n,i.element,i.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(n,this.getShared()),this.stylesAppliedToElement(e,i,n)}},this._fixMarginOverflow=t=>{const e=this.getParentComponent(),i=e&&("flex"===e.style.display||"inline-flex"===e.style.display),n="host",o=t.getAttribute(s("element"))===n;if(!i||!o)return;const r=this.getProps(),l=this.getEnvironment(),{styleAttributes:a}=Z(r.adaptiveStyles,l,n)||{};if(!a)return;const c=a.marginLeft||a.marginRight,d="100%"===a.width;if(c&&d){const e=(parseFloat(a.marginLeft)||0)+(parseFloat(a.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=t=>function(t,e){let n=t;return(n.classes||"").split(" ").filter((t=>t.startsWith(i))).forEach((t=>{var i;let s=null===(i=e.textClasses)||void 0===i?void 0:i[t];s&&(s.styleAttributes.fontFamily||(s.isHeader&&e.headerFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:e.headerFontFamily})})),!s.isHeader&&e.textFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:e.textFontFamily})}))),n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),s.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},n.placeholderStyleAttributes),s.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,i,n="",o)=>{const r=Object.keys(i).reduce(((t,e)=>t+` ${w.camelCaseToDashCase(e)}: ${i[e]}${o?" !important;":";"}`),"");q({element:t,html:`[${s("element")}="${e}"]${n} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{q({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var i,n,s,o;e.linkColor&&q({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)&&q({element:t,html:`a {color: ${null===(n=e.linkParams)||void 0===n?void 0:n.color}}, a:visited {color: ${null===(s=e.linkParams)||void 0===s?void 0:s.color}}`,appendHtml:!0}),(null===(o=e.linkParams)||void 0===o?void 0:o.removeUnderline)&&q({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(t,e)=>{Array.from(t.classList).filter((t=>t!==n("hovered")&&t!==n("focused"))).forEach((e=>{e.startsWith(i)&&t.classList.remove(e)}));const s=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",s)},this.getParentComponent=()=>$(this.parentNode,s("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(s("path"));return t&&1===t.split(",").length?this.parentNode:$(this.parentNode,s("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>{return[(t=this.services.config).getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t));var t},this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,i)=>{if(e)return e;const n=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 n||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;const n=t.control.name;if(["email","first_name","last_name"].includes(n))return n.toUpperCase();if(t.content.label&&(null===(i=null===(e=t.adaptiveStyles.desktop.find((t=>"label"===t.element)))||void 0===e?void 0:e.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 t.content.placeholder?this.capitalizeFirstLetter(t.content.placeholder):t.control.integrationName?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{switch(t.control.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},i=this.services.actionRegister.getRegisteredActions().find((t=>t.category===V));i?null==i||i.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:h}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>this.getProps().handlers&&this.getProps().handlers.length?[...this.getProps().handlers]:[],this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(e=this.define)||void 0===e?void 0:e.manifest)||(null===(o=this.constructor.define)||void 0===o?void 0:o.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=K._resolveTogglableStyles(e[t]))})),e}static _resolveTogglableStyles(t){const e=Object.assign({},t),i=(t,i,n)=>{i in e&&(t.forEach((t=>{t in e&&(e[t]=e[i]?e[t]:n)})),delete e[i])};return i(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),i(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}function Q(t){return Q="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},Q(t)}function J(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ot(n.key),n)}}function X(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(X=function(){return!!t})()}function tt(t,e,i,n){var s=et(it(1&n?t.prototype:t),e,i);return 2&n&&"function"==typeof s?function(t){return s.apply(i,t)}:s}function et(){return et="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,i){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=it(t)););return t}(t,e);if(n){var s=Object.getOwnPropertyDescriptor(n,e);return s.get?s.get.call(arguments.length<3?t:i):s.value}},et.apply(null,arguments)}function it(t){return it=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},it(t)}function nt(t,e){return nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},nt(t,e)}function st(t,e,i){return(e=ot(e))in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function ot(t){var e=function(t){if("object"!=Q(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=Q(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Q(e)?e:e+""}var rt={TOP:"top",CENTER:"center",BOTTOM:"bottom"},lt={LEFT:"left",CENTER:"center",RIGHT:"right"},at={FIXED:"fixed",STICKY:"sticky"},ct=function(){function e(){var i;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),st(i=function(t,e,i){return e=it(e),function(t,e){if(e&&("object"==Q(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,X()?Reflect.construct(e,i||[],it(t).constructor):e.apply(t,i))}(this,e),"applyStylesRespectingRelativePositioning",(function(){var t=i.processPositioningStyles(i.getProps());i.originalApplyAutoAdaptiveStyles(t),i.fixFloatingImageSize(t)})),st(i,"recalculateStylesAfterImageLoad",(function(){i.resourcesLoadedListener=i.services.eventEmitter.on("VIEW_COMPONENT_RESOURCES_LOADED",(function(){requestAnimationFrame((function(){i.applyAdaptiveStyles(i.getProps())}))}))})),st(i,"_getHostNewDimensionsWithStyles",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=i.getHostElement();return["height","width","minHeight","minWidth","maxHeight","maxWidth","display"].forEach((function(i){t[i]?e.style[i]=t[i]:e.style[i]&&(e.style[i]="")})),{width:e.offsetWidth,height:e.offsetHeight}})),st(i,"processPositioningStyles",(function(t){var e,n,s=t.adaptiveStyles;if(((null===(e=t.control)||void 0===e?void 0:e.positioningMode)||at.FIXED)===at.FIXED)return s;var o=i.getEnvironment(),r=(null===(n=t.control)||void 0===n||null===(n=n.positioning)||void 0===n?void 0:n[o])||{},l=(null==r?void 0:r.diff)||{};if(!Boolean("x"in l&&"y"in l))return s;var a=Z(s,o,"host").styleAttributes,c=i._getHostNewDimensionsWithStyles(a),d=c.width,p=c.height,u=M(a,["left","right","top","bottom"]),h=d/2,m=l.x-h;r.horizontalPosition===lt.LEFT?(u.left="".concat(m,"px"),u.right="auto"):r.horizontalPosition===lt.RIGHT?(u.right="".concat(-d-m,"px"),u.left="auto"):(u.left="calc(50% + ".concat(m,"px)"),u.right="auto");var g=p/2,y=l.y-g;return r.verticalPosition===rt.TOP?(u.top="".concat(y,"px"),u.bottom="auto"):r.verticalPosition===rt.BOTTOM?(u.bottom="".concat(-p-y,"px"),u.top="auto"):(u.top="calc(50% + ".concat(y,"px)"),u.bottom="auto"),function(t,e,i,n={}){return Object.assign(Object.assign({},t),{[e]:t[e].map((t=>t.element===i?Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},n)}):t))})}(s,o,"host",u)})),st(i,"deleteElementIfPresent",(function(t,e){var i=t.querySelector(e);i&&i.remove()})),st(i,"upsertSvg",(function(t,e){var n=t.querySelector("svg");return n&&n.getAttribute("inline-svg-url")===e?Promise.resolve():(n&&i.deleteElementIfPresent(i.getRootElement(),".svgOverflowContainer"),fetch(e).then((function(t){return t.text()})).then((function(n){var s=document.createElement("template"),o=document.createElement("div");o.style.overflow="hidden",o.style.width="100%",o.style.height="inherit",o.classList.add("svgOverflowContainer"),s.append(o),s.firstChild.innerHTML=n.trim();var r=s.firstChild,l=r.querySelector("svg");return l.setAttribute("cl-element","image"),l.setAttribute("inline-svg-url",e),i.componentResourceManager.getPending().decrement(),t.append(r),t})).catch((function(e){console.error(e),i.upsertImage(t,null)})))})),st(i,"upsertImage",(function(e,n){var s=e.querySelector("img");if(s)return s.src=n,t(s,"load",(function(){i.componentResourceManager.getPending().decrement()})),t(s,"error",(function(){i.componentResourceManager.onResourceLoadFailure(s.src)})),Promise.resolve();var o=new Image;return o.setAttribute("cl-element","image"),o.src=n,t(o,"load",(function(){i.componentResourceManager.getPending().decrement()})),t(o,"error",(function(){i.componentResourceManager.onResourceLoadFailure(o.src)})),e.append(o),Promise.resolve()})),st(i,"applyAdaptiveStyles",(function(t){var e;i.applyAutoAdaptiveStyles(t.adaptiveStyles);var n=i.getEnvironment(),s=t.adaptiveStyles[n],o=s.find((function(t){return"host"===t.element})),r=s.find((function(t){return"image"===t.element})),l=i.getElement("image"),a={cover:"xMidYMid slice",contain:"xMidYMid meet",none:""},c=l&&"svg"===l.nodeName,d=(null==r||null===(e=r.styleAttributes)||void 0===e?void 0:e.objectFit)&&a.hasOwnProperty(r.styleAttributes.objectFit);if(c&&d)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"!==o.styleAttributes.width&&"auto"!==o.styleAttributes.height)return l.setAttribute("height","100%"),void l.setAttribute("width","100%");if("auto"===o.styleAttributes.width&&"auto"===o.styleAttributes.height)return l.setAttribute("width",l.viewBox.baseVal.width+"px"),void l.setAttribute("height",l.viewBox.baseVal.height+"px");"auto"===o.styleAttributes.width&&(l.setAttribute("height","100%"),"100%"!==o.styleAttributes.height&&"calc(100% - 0px)"!==o.styleAttributes.height&&l.setAttribute("width","".concat(Math.round(parseInt(o.styleAttributes.height,10)*p),"px"))),"auto"===o.styleAttributes.height&&(l.setAttribute("width","100%"),"100%"!==o.styleAttributes.width&&"calc(100% - 0px)"!==o.styleAttributes.width&&l.setAttribute("height","".concat(Math.round(parseInt(o.styleAttributes.width,10)/p),"px")))}})),st(i,"fixFloatingImageSize",(function(t){var e=i.getElement("image");e&&((i.getModel().floating||i.getProps().floating)&&"auto"===Z(t,i.getEnvironment(),"host").styleAttributes.width?e.style.width="":e.style.width="100%")})),i.originalApplyAutoAdaptiveStyles=i.applyAutoAdaptiveStyles,i.applyAutoAdaptiveStyles=i.applyStylesRespectingRelativePositioning,i.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 '),i}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&&nt(t,e)}(e,K),i=e,(n=[{key:"disconnectedCallback",value:function(){var t;tt(e,"disconnectedCallback",this,3)([]),null===(t=this.resourcesLoadedListener)||void 0===t||t.off()}},{key:"connectedCallback",value:function(){var t=this;tt(e,"connectedCallback",this,3)([]),this.componentResourceManager.getPending().increment(),this.recalculateStylesAfterImageLoad(),this.observeProps((function(e,i){var n;t.applyAutoAdaptiveStyles(i.adaptiveStyles);var s=t.getElement("image");null!==(n=i.control)&&void 0!==n&&n.imageSource.url&&s&&"src"in s&&(s.src=i.control.imageSource.url);var o=i.control.imageSource.url,r=e&&e.control.imageSource.url,l=String(i.control.imageSource.url).endsWith(".svg")?i.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(i);t.deleteElementIfPresent(t.getRootElement(),"img"),t.upsertSvg(t.getRootElement(),l).then((function(){t.applyAdaptiveStyles(i)}))}else if(o){if(o===r)return void t.applyAdaptiveStyles(i);t.deleteElementIfPresent(t.getRootElement(),".svgOverflowContainer"),t.upsertImage(t.getRootElement(),o).then((function(){t.applyAdaptiveStyles(i)}))}else t.deleteElementIfPresent(t.getRootElement(),".svgOverflowContainer"),t.upsertImage(t.getRootElement(),t.assets("img/image-placeholder.svg")).then((function(){t.applyAdaptiveStyles(i)}))}))}}])&&J(i.prototype,n),Object.defineProperty(i,"prototype",{writable:!1}),i;var i,n}();st(ct,"define",{name:"sys-image",model:e.name,manifest:e});export{lt as HorizontalPosition,at as PositioningModes,rt as VerticalPosition,ct as default};window.clComponentClass_SysImageComponent=ct;
@@ -1 +1 @@
1
- var t={32:(t,e,n)=>{n.d(e,{A:()=>i});const i={name:"SysColumnsComponent",componentType:"COLUMNS",version:"1.0.0",contextMenuModel:[],floatingControlsModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host",params:{width:{minValue:50},height:{minValue:50}}},{type:"CONTROL",name:"CONTAINER_PADDING",propPathCondition:"return sdk.component.type === 'VIEW' ? {element: 'host', elementProp: 'styleAttributes'} : {propPath: ['styles', '[element=host]', 'styleAttributes']}"},{type:"CONTROL",name:"PARENT_ALIGNMENT",elementProp:"styleAttributes",element:"host",params:{mode:"horizontal"}},{type:"CONTROL",name:"COLUMNS_PROPORTIONS",propPath:["content","size"],params:{parent:!0}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host",params:{width:{minValue:50},height:{minValue:50}}},{type:"CONTROL",name:"CONTAINER_PADDING",propPathCondition:"return sdk.component.type === 'VIEW' ? {element: 'host', elementProp: 'styleAttributes'} : {propPath: ['styles', '[element=host]', 'styleAttributes']}"},{type:"CONTROL",name:"PARENT_ALIGNMENT",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"COLUMNS_PROPORTIONS",propPath:["content","size"],params:{parent:!0}}]}],propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"],minValue:50},height:{options:["fixed","fill","hug"],minValue:50}},displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"COLUMNS",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"SWITCH",propPath:["isResponsive"],params:{label:"ADAPTIVE_COLUMNS",boldLabel:!0}},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'",syncSelectOptions:["SAME_TYPE_CROSS_ENV_WHILE_VALUES_MATCH",null]},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"INDENTATION",propPathCondition:"return sdk.component.type === 'VIEW' ? {element: 'host', elementProp: 'styleAttributes'} : {propPath: ['styles', '[element=host]', 'styleAttributes']}",params:{indentationType:"PADDING"},syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{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:"return sdk.widgetType !== 'TEASER'"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"COLUMNS",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"SWITCH",propPath:["isResponsive"],params:{label:"ADAPTIVE_COLUMNS",boldLabel:!0}},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'",syncSelectOptions:["SAME_TYPE_CROSS_ENV_WHILE_VALUES_MATCH",null]},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"INDENTATION",propPathCondition:"return sdk.component.type === 'VIEW' ? {element: 'host', elementProp: 'styleAttributes'} : {propPath: ['styles', '[element=host]', 'styleAttributes']}",params:{indentationType:"PADDING"}},{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:"return sdk.widgetType !== 'TEASER'"}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0}}]},events:{dispatch:[],listen:[]},props:{styles:[{element:"host",styleAttributes:{}}],adaptiveStyles:(0,n(521).Q4)([{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:"50px",height:"auto",gap:"10px"}}]),isResponsive:!0},metaDescription:{icon:"/SysColumnsComponent/assets/img/columns-component-icon.svg",label:{en:"Columns",ru:"Колонки",uk:"Колонки",es:"Columns",fr:"Columns",de:"Columns",it:"Columns",pt:"Columns",ro:"Columns",bg:"Columns",cs:"Columns",el:"Columns",nl:"Columns",pl:"Columns",sv:"Columns",tr:"Columns",ar:"Columns",zh:"Columns",da:"Columns",he:"Columns",fi:"Columns",hi:"Columns",hr:"Columns",hu:"Columns",id:"Columns",ja:"Columns",ko:"Columns",no:"Columns",sk:"Columns",sl:"Columns",sr:"Columns"},defaultPreset:"50%-50%"},waitForResourcesLoad:!0,resourcesPropPaths:[["adaptiveStyles",":ENV","styleAttributes","background"]]}},360:(t,e,n)=>{n.d(e,{_N:()=>i,vi:()=>o,yU:()=>s});const i={SYSTEM_CLASS_PREFIX:"cl-",SYSTEM_ATTRIBUTE_PREFIX:"cl-"};function s(t){return i.SYSTEM_CLASS_PREFIX+t}function o(t){return i.SYSTEM_ATTRIBUTE_PREFIX+t}},390:(t,e,n)=>{n.d(e,{P:()=>i});const i={DESKTOP:"desktop",MOBILE:"mobile"};i.MOBILE},521:(t,e,n)=>{n.d(e,{MW:()=>l,Q4:()=>a,xK:()=>o});var i=n(390),s=n(360);function o(t,e,n){var i;return null===(i=t[e])||void 0===i?void 0:i.find((t=>t.element===n))}function r(t=[]){return t.map((t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)})))}function a(t){return Object.values(i.P).reduce(((e,n)=>Object.assign(e,{[n]:r(t)})),{[i.P.DESKTOP]:[],[i.P.MOBILE]:[]})}function l(t,e){let n=t;return(n.classes||"").split(" ").filter((t=>t.startsWith(s._N.SYSTEM_CLASS_PREFIX))).forEach((t=>{var i;let s=null===(i=e.textClasses)||void 0===i?void 0:i[t];s&&(s.styleAttributes.fontFamily||(s.isHeader&&e.headerFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:e.headerFontFamily})})),!s.isHeader&&e.textFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:e.textFontFamily})}))),n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),s.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},n.placeholderStyleAttributes),s.placeholderStyleAttributes)}))})),n.styleAttributes.fontFamily||(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:e.textFontFamily})})),n}},658:(t,e,n)=>{n.d(e,{A:()=>ut});var i=n(32),s=n(360);const o="VIEW",r="MODULE",a="CONTAINER",l="INPUT",c="BUTTON",u="CONSENT",p="COLUMN",h="SUBSCRIBE_CONTACT",d="REQUEST",m="SHOW_WIDGET",y="OPEN_LINK",g="CLOSE_WIDGET";class b{static sortActions(t){const e={[g]:-1,[y]:-2,[m]:1,[h]:2,[d]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>n(t)>n(e)?-1:n(t)<n(e)?1:0))}constructor(t,e){this.config=t,this.actions=b.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((0,s.vi)("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute((0,s.vi)("type"))));let n=0;for(;e[n]&&e[n].getAttribute((0,s.vi)("id"))!==o;){let t=e[n].getAttribute((0,s.vi)("type"));if(b.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 s,o=!0,r=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(n){e[n]=t[n]&&function(e){return new Promise((function(i,s){!function(t,e,n,i){Promise.resolve(i).then((function(e){t({value:e,done:n})}),e)}(i,s,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(s=await r.next()).done);){i=s.value,o=!1;try{const{event:t}=i;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{o=!0}}}catch(t){e={error:t}}finally{try{o||t||!(n=r.return)||await n.call(r)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}b.IGNORING_VIEW_ENTRY_TYPES=[c,u,l];const f="CLICK",v="COMPONENT_EVENT";class E{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 O{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 f:return new b(t,e);case v:return new E(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class C{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 S{constructor(){this.listeners=S.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=C.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=S.createDefaultListenersState()}}S.createDefaultListenersState=()=>({"*":{}});const A=(t,e,n,i)=>{const{addEventListenerBase:s,addEventListener:o}=EventTarget.prototype;(s||o).call(t,e,n,i)};class T{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class P{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===r?Object.assign(Object.assign({},t),P.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})}}P.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};const R="ENVIRONMENT_UPDATE";class N extends S{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on(R,(({isMobileEnv:t})=>{this._isMobile=t,this.emit(N.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(N.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(N.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}N.changeEventName="CHANGE";class L{static set(t,e){const n=t[L.accumulatorPropertyName]||{};t[L.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[L.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}L.accumulatorPropertyName="clStyleAttributes";const _="CONTENT_LOCKER";class w{static applyHostStyles(t,e,n=null,i){var s,r,l;const c=null===(r=null===(s=null==n?void 0:n.props)||void 0===s?void 0:s.handlers)||void 0===r?void 0:r.find((t=>"CLICK"===t.type));c&&(null===(l=c.actions)||void 0===l?void 0:l.length)&&(e.style.cursor="pointer"),t!==o&&t!==a&&t!==p||(e.style.display=i===_&&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 I{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class M{constructor(t,e,n,i,s,o){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=i,this.getEnvCb=s,this.httpClient=o,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((n=>{var i,s,o,r,a;const l=null===(s=null===(i=e.adaptiveStyles)||void 0===i?void 0:i[t])||void 0===s?void 0:s.find((t=>t.element===n)),c=(null===(o=e.styles)||void 0===o?void 0:o.find((t=>t.element===n)))||{},u=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(a=null==l?void 0:l.styleAttributes)||void 0===a?void 0:a.background),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((()=>{this._applyHostElementBackground(this.envUrlMaps[t].get("host"),this.getSharedCb().cssVars)})).catch((t=>{console.error(t),I.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t)})),this}_applyHostElementBackground(t,e){t&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(t,e){const n=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}off(){var t;null===(t=this.subscription)||void 0===t||t.off()}}const j=new class{execute(t,e,n=null,i,s){const o={method:e,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:s};return n&&(o.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,o)}};function k(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 D{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}const W="COMPONENT_RESOURCES_LOADED",U="FAILED_TO_LOAD_COMPONENT_RESOURCE";class V{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(W,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(U,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new D(this.onCounterStateUpdate)}}}const F=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>F(...t)}},B=F,H="props",$="shared",G="environment";function K(t,e,n,i){const s=t=>{let o=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return o&&(i&&"function"==typeof i?i(o.getAttribute(e)):(null===(r=null==o?void 0:o.getAttribute)||void 0===r?void 0:r.call(o,e))===n)?o:o&&o.parentNode&&s(o.parentNode)||null;var r};return s(t)}const z="SUBMIT";function Y(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{"element"!==n&&"classes"!==n&&(e[n]&&"object"==typeof e[n]&&!Array.isArray(e[n])?t[n]=Object.assign(Object.assign({},t[n]||{}),e[n]):t[n]=e[n])})),t):t}var Q=n(521);function q(t){const{element:e,html:n,appendHtml:i}=t,s=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(n);i?e.innerHTML+=s:e.innerHTML=s}class X extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class Z extends HTMLElement{constructor(){var t,e;super(),this.construct=()=>{let t;const e=this.getAttribute((0,s.vi)("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const i=n.closest(`[${(0,s.vi)("widget-id")}]`);let o;i&&(o=i.getAttribute((0,s.vi)("widget-id")));let r=new X("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute((0,s.vi)("path")),id:e,widgetId:o},{bubbles:!0,composed:!0});this.dispatchEvent(r),t=r.detail.props,Object.assign(this,t),this.observers=B(H,$,G),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 S,this.componentResourceManager=new V(this.model.id,this.services.eventEmitter,"STATIC"===this.services.config.getConfig("entryModuleType")),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new O(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(H).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),n=(0,s.vi)("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($).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new M(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),j),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(N.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(G).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(H).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get($).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(G).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${(0,s.vi)("element")}]`)).filter((t=>!t.hasAttribute((0,s.vi)("component"))))],this.getElement=(t,e)=>this.getElements().find((n=>e?n.getAttribute((0,s.vi)("element"))===t&&n.id===e:n.getAttribute((0,s.vi)("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const n=this.getElements();if(!n.length)return;t=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let i=!1,s=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(Y(n,t),i=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(Y(n,t),s=!0)})),!i&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!s&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e);const i=(0,s.vi)("type"),o="element-styles";let r=this.getRootElement().querySelector(`style[${i}="${o}"]`);r||(r=document.createElement("style"),r.setAttribute(i,o),this.getRootElement().appendChild(r)),q({element:r,html:""}),n.forEach((e=>{let n=e.getAttribute((0,s.vi)("element"));const i=this.getEnvironment();let o=(0,Q.xK)(t,i,n);if(o){if(this.resizeListener.isMobile()){const e=(0,Q.xK)(t,"desktop",n);e&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),o.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(o),r)}})),this._addLinkColor(r,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,i]of Object.entries(e))t.style[n]=i;return!0},this.applyStylesToElement=(t,e,n)=>{var i,o;const r=[];"host"===(e=Z._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===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),r.push("background")));let a=e.styleAttributes.background,l=a&&a.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&l){this.componentResourceManager.getPending().increment();const t=new Image;t.src=l[1],A(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),A(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:k(e.styleAttributes,r)});if(L.set(t,c),this._setClassAttributes(t,e),n){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(),s=`flip-up-animation-${e.element}`;let o=this.getRootElement().querySelector(`#${s}`);o||(o=document.createElement("style"),o.id=s,t.appendChild(o)),q({element:o,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(n,e.element,i,`:not(.${(0,s.vi)("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._fixMarginOverflow=t=>{const e=this.getParentComponent(),n=e&&("flex"===e.style.display||"inline-flex"===e.style.display),i="host",o=t.getAttribute((0,s.vi)("element"))===i;if(!n||!o)return;const r=this.getProps(),a=this.getEnvironment(),{styleAttributes:l}=(0,Q.xK)(r.adaptiveStyles,a,i)||{};if(!l)return;const c=l.marginLeft||l.marginRight,u="100%"===l.width;if(c&&u){const e=(parseFloat(l.marginLeft)||0)+(parseFloat(l.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=t=>{const e=this.documentModel.getShared();return(0,Q.MW)(t,e)},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;":";"}`),"");q({element:t,html:`[${(0,s.vi)("element")}="${e}"]${i} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{q({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,i,s,o;e.linkColor&&q({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&q({element:t,html:`a {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(s=e.linkParams)||void 0===s?void 0:s.color}}`,appendHtml:!0}),(null===(o=e.linkParams)||void 0===o?void 0:o.removeUnderline)&&q({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(t,e)=>{Array.from(t.classList).filter((t=>t!==(0,s.yU)("hovered")&&t!==(0,s.yU)("focused"))).forEach((e=>{e.startsWith(s._N.SYSTEM_CLASS_PREFIX)&&t.classList.remove(e)}));const n=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",n)},this.getParentComponent=()=>K(this.parentNode,(0,s.vi)("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute((0,s.vi)("path"));return t&&1===t.split(",").length?this.parentNode:K(this.parentNode,(0,s.vi)("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>{return[(t=this.services.config).getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t));var t},this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,n)=>{if(e)return e;const i=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return i||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n;const i=t.control.name;if(["email","first_name","last_name"].includes(i))return i.toUpperCase();if(t.content.label&&(null===(n=null===(e=t.adaptiveStyles.desktop.find((t=>"label"===t.element)))||void 0===e?void 0:e.params)||void 0===n?void 0:n.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return t.content.placeholder?this.capitalizeFirstLetter(t.content.placeholder):t.control.integrationName?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{switch(t.control.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find((t=>t.category===z));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:d}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>this.getProps().handlers&&this.getProps().handlers.length?[...this.getProps().handlers]:[],this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(t=this.define)||void 0===t?void 0:t.manifest)||(null===(e=this.constructor.define)||void 0===e?void 0:e.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=Z._resolveTogglableStyles(e[t]))})),e}static _resolveTogglableStyles(t){const e=Object.assign({},t),n=(t,n,i)=>{n in e&&(t.forEach((t=>{t in e&&(e[t]=e[n]?e[t]:i)})),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}const J=()=>{const t=window.screen.orientation||window.screen.mozOrientation||window.screen.msOrientation;return t?t.type.includes("portrait")?"PORTRAIT":"LANDSCAPE":void 0===window.orientation||0===window.orientation||180===window.orientation?"PORTRAIT":90===window.orientation||-90===window.orientation?"LANDSCAPE":void 0},tt=()=>/iPhone/i.test(navigator.userAgent)||/iPad/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;class et extends S{constructor(t,e){var n;super(),this.documentModel=t,this._orientation=null!==(n=e.config.defaultOrientation)&&void 0!==n?n:J(),this.documentModel.on(R,(t=>{t.orientation&&(this._orientation=t.orientation,this.emit(et.changeEventName,this._orientation))})),this.handleOrientationChangeBound=this.handleOrientationChange.bind(this),this.addOrientationChangeListener()}isPortrait(){return"PORTRAIT"===this._orientation}handleOrientationChange(t){var e,n;this._orientation=null!==(n=null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.orientation)&&void 0!==n?n:J(),this.emit(et.changeEventName,this._orientation)}addOrientationChangeListener(){!tt()&&window.screen.orientation?window.screen.orientation.addEventListener("change",this.handleOrientationChangeBound):"orientation"in window&&window.addEventListener("orientationchange",this.handleOrientationChangeBound)}removeOrientationChangeListener(){!tt()&&window.screen.orientation?window.screen.orientation.removeEventListener("change",this.handleOrientationChangeBound):"orientation"in window&&window.removeEventListener("orientationchange",this.handleOrientationChangeBound)}destroy(){super.destroy(),this.removeOrientationChangeListener()}}function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}function it(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,ct(i.key),i)}}function st(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(st=function(){return!!t})()}function ot(){return ot="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=rt(t)););return t}(t,e);if(i){var s=Object.getOwnPropertyDescriptor(i,e);return s.get?s.get.call(arguments.length<3?t:n):s.value}},ot.apply(null,arguments)}function rt(t){return rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rt(t)}function at(t,e){return at=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},at(t,e)}function lt(t,e,n){return(e=ct(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ct(t){var e=function(t){if("object"!=nt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==nt(e)?e:e+""}et.changeEventName="CHANGE";var ut=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),lt(t=function(t,e,n){return e=rt(e),function(t,e){if(e&&("object"==nt(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,st()?Reflect.construct(e,n||[],rt(t).constructor):e.apply(t,n))}(this,e),"manifest",i.A),lt(t,"updateResponsiveStyles",(function(){t.getProps().isResponsive&&"mobile"===t.getEnvironment()&&t.mobileDeviceOrientationListener.isPortrait()?t.getRootElement().querySelector(".columns-container").style.flexDirection="column":t.getRootElement().querySelector(".columns-container").style.flexDirection="row"})),t.getRootElement().innerHTML="\n ".concat("\n <style>\n :host {\n position: relative;\n min-width: 50px;\n min-height: 50px; \n display:flex;\n }\n\n .columns-container {\n height: auto;\n min-height: 50px; \n width: 100%;\n min-width: 50px;\n display: flex;\n gap: inherit;\n }\n </style>\n ","\n <div ").concat((0,s.vi)("render-outlet"),' class="columns-container"></div>\n '),t}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&&at(t,e)}(e,t),n=e,o=[{key:"connectedCallback",value:function(){var t,n,i,s=this;(t=e,n=this,"function"==typeof(i=ot(rt(1&3?t.prototype:t),"connectedCallback",n))?function(t){return i.apply(n,t)}:i)([]),this.observeProps((function(t,e){s.applyAutoAdaptiveStyles(e.adaptiveStyles,e.styles),s.updateResponsiveStyles()})),this.observeEnvironment((function(t,e){s.updateResponsiveStyles()})),this.subscriptions.push(this.mobileDeviceOrientationListener.on(et.changeEventName,(function(){s.updateResponsiveStyles()})))}}],o&&it(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}(Z);lt(ut,"define",{name:"sys-columns",model:i.A.name,manifest:i.A})}},e={};function n(i){var s=e[i];if(void 0!==s)return s.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var i=n(658),s=n(32);function o(t){return o="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},o(t)}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){l(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function l(t,e,n){return(e=function(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const c=a(a({},s.A),{},{props:a(a({},s.A.props),{},{isResponsive:!1})});function u(t){return u="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},u(t)}function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(p=function(){return!!t})()}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function m(t){var e=function(t){if("object"!=u(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==u(e)?e:e+""}var y,g,b,f=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,n){return e=h(e),function(t,e){if(e&&("object"==u(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,p()?Reflect.construct(e,n||[],h(t).constructor):e.apply(t,n))}(this,t,arguments)}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&&d(t,e)}(t,i.A),e=t,Object.defineProperty(e,"prototype",{writable:!1}),e;var e}();y=f,g="define",b={name:"sys-columns",model:c.name,manifest:c},(g=m(g))in y?Object.defineProperty(y,g,{value:b,enumerable:!0,configurable:!0,writable:!0}):y[g]=b;export{f as default};window.clComponentClass_SysInAppColumnsComponent=f;
1
+ var t={32:(t,e,n)=>{n.d(e,{A:()=>i});const i={name:"SysColumnsComponent",componentType:"COLUMNS",version:"1.0.0",contextMenuModel:[],floatingControlsModel:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host",params:{width:{minValue:50},height:{minValue:50}}},{type:"CONTROL",name:"CONTAINER_PADDING",propPathCondition:"return sdk.component.type === 'VIEW' ? {element: 'host', elementProp: 'styleAttributes'} : {propPath: ['styles', '[element=host]', 'styleAttributes']}"},{type:"CONTROL",name:"PARENT_ALIGNMENT",elementProp:"styleAttributes",element:"host",params:{mode:"horizontal"}},{type:"CONTROL",name:"COLUMNS_PROPORTIONS",propPath:["content","size"],params:{parent:!0}}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host",params:{width:{minValue:50},height:{minValue:50}}},{type:"CONTROL",name:"CONTAINER_PADDING",propPathCondition:"return sdk.component.type === 'VIEW' ? {element: 'host', elementProp: 'styleAttributes'} : {propPath: ['styles', '[element=host]', 'styleAttributes']}"},{type:"CONTROL",name:"PARENT_ALIGNMENT",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"COLUMNS_PROPORTIONS",propPath:["content","size"],params:{parent:!0}}]}],propertyPaneModel:{content:[{type:"GROUP",propPath:["adaptiveStyles","desktop"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"],minValue:50},height:{options:["fixed","fill","hug"],minValue:50}},displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"COLUMNS",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"SWITCH",propPath:["isResponsive"],params:{label:"ADAPTIVE_COLUMNS",boldLabel:!0}},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'",syncSelectOptions:["SAME_TYPE_CROSS_ENV_WHILE_VALUES_MATCH",null]},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"INDENTATION",propPathCondition:"return sdk.component.type === 'VIEW' ? {element: 'host', elementProp: 'styleAttributes'} : {propPath: ['styles', '[element=host]', 'styleAttributes']}",params:{indentationType:"PADDING"},syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{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:"return sdk.widgetType !== 'TEASER'"}]},{type:"GROUP",propPath:["adaptiveStyles","mobile"],children:[{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}},displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"COLUMNS",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"SWITCH",propPath:["isResponsive"],params:{label:"ADAPTIVE_COLUMNS",boldLabel:!0}},{type:"CONTROL",name:"BACKGROUND",elementProp:"styleAttributes",element:"host",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'",syncSelectOptions:["SAME_TYPE_CROSS_ENV_WHILE_VALUES_MATCH",null]},{type:"CONTROL",name:"BACKDROP_FILTER",propPath:["styles","[element=host]","styleAttributes"],syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=host]","styleAttributes"],displayCondition:"return sdk.component.type === 'VIEW' ? sdk.layoutType !== 'CONTENT_LOCKER' : true",syncSelectDisplayCondition:"return sdk.component.type === 'VIEW'"},{type:"CONTROL",name:"INDENTATION",propPathCondition:"return sdk.component.type === 'VIEW' ? {element: 'host', elementProp: 'styleAttributes'} : {propPath: ['styles', '[element=host]', 'styleAttributes']}",params:{indentationType:"PADDING"}},{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:"return sdk.widgetType !== 'TEASER'"}]}],general:[{type:"CONTROL",name:"ACTIONS",propPath:["handlers"],params:{origin:!0}}]},events:{dispatch:[],listen:[]},props:{styles:[{element:"host",styleAttributes:{}}],adaptiveStyles:(0,n(521).Q4)([{element:"host",styleAttributes:{position:"relative",width:"100%",minWidth:"50px",height:"auto",gap:"10px"}}]),isResponsive:!0},metaDescription:{icon:"/SysColumnsComponent/assets/img/columns-component-icon.svg",label:{en:"Columns",ru:"Колонки",uk:"Колонки",es:"Columns",fr:"Columns",de:"Columns",it:"Columns",pt:"Columns",ro:"Columns",bg:"Columns",cs:"Columns",el:"Columns",nl:"Columns",pl:"Columns",sv:"Columns",tr:"Columns",ar:"Columns",zh:"Columns",da:"Columns",he:"Columns",fi:"Columns",hi:"Columns",hr:"Columns",hu:"Columns",id:"Columns",ja:"Columns",ko:"Columns",no:"Columns",sk:"Columns",sl:"Columns",sr:"Columns"},defaultPreset:"50%-50%"},waitForResourcesLoad:!0,resourcesPropPaths:[["adaptiveStyles",":ENV","styleAttributes","background"]]}},360:(t,e,n)=>{n.d(e,{_N:()=>i,vi:()=>o,yU:()=>s});const i={SYSTEM_CLASS_PREFIX:"cl-",SYSTEM_ATTRIBUTE_PREFIX:"cl-"};function s(t){return i.SYSTEM_CLASS_PREFIX+t}function o(t){return i.SYSTEM_ATTRIBUTE_PREFIX+t}},390:(t,e,n)=>{n.d(e,{P:()=>i});const i={DESKTOP:"desktop",MOBILE:"mobile"};i.MOBILE},521:(t,e,n)=>{n.d(e,{MW:()=>l,Q4:()=>a,xK:()=>o});var i=n(390),s=n(360);function o(t,e,n){var i;return null===(i=t[e])||void 0===i?void 0:i.find((t=>t.element===n))}function r(t=[]){return t.map((t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)})))}function a(t){return Object.values(i.P).reduce(((e,n)=>Object.assign(e,{[n]:r(t)})),{[i.P.DESKTOP]:[],[i.P.MOBILE]:[]})}function l(t,e){let n=t;return(n.classes||"").split(" ").filter((t=>t.startsWith(s._N.SYSTEM_CLASS_PREFIX))).forEach((t=>{var i;let s=null===(i=e.textClasses)||void 0===i?void 0:i[t];s&&(s.styleAttributes.fontFamily||(s.isHeader&&e.headerFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:e.headerFontFamily})})),!s.isHeader&&e.textFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:e.textFontFamily})}))),n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),s.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},n.placeholderStyleAttributes),s.placeholderStyleAttributes)}))})),n.styleAttributes.fontFamily||(n=Object.assign(Object.assign({},n),{styleAttributes:Object.assign(Object.assign({},n.styleAttributes),{fontFamily:e.textFontFamily})})),n}},658:(t,e,n)=>{n.d(e,{A:()=>ut});var i=n(32),s=n(360);const o="VIEW",r="MODULE",a="CONTAINER",l="INPUT",c="BUTTON",u="CONSENT",p="COLUMN",h="SUBSCRIBE_CONTACT",d="REQUEST",m="SHOW_WIDGET",y="OPEN_LINK",g="CLOSE_WIDGET";class b{static sortActions(t){const e={[g]:-1,[y]:-2,[m]:1,[h]:2,[d]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort(((t,e)=>n(t)>n(e)?-1:n(t)<n(e)?1:0))}constructor(t,e){this.config=t,this.actions=b.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((0,s.vi)("id"));this.listener=t=>{const e=t.composedPath().filter((t=>t instanceof HTMLElement&&t.getAttribute((0,s.vi)("type"))));let n=0;for(;e[n]&&e[n].getAttribute((0,s.vi)("id"))!==o;){let t=e[n].getAttribute((0,s.vi)("type"));if(b.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 s,o=!0,r=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},i("next"),i("throw"),i("return"),e[Symbol.asyncIterator]=function(){return this},e);function i(n){e[n]=t[n]&&function(e){return new Promise((function(i,s){!function(t,e,n,i){Promise.resolve(i).then((function(e){t({value:e,done:n})}),e)}(i,s,(e=t[n](e)).done,e.value)}))}}}(this.eventsQueue);!(t=(s=await r.next()).done);){i=s.value,o=!1;try{const{event:t}=i;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}finally{o=!0}}}catch(t){e={error:t}}finally{try{o||t||!(n=r.return)||await n.call(r)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach((t=>{t.removeEventListener("click",this.listener)})),this.targetElements=[])}}b.IGNORING_VIEW_ENTRY_TYPES=[c,u,l];const f="CLICK",v="COMPONENT_EVENT";class E{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 O{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 f:return new b(t,e);case v:return new E(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class C{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 S{constructor(){this.listeners=S.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=C.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=S.createDefaultListenersState()}}S.createDefaultListenersState=()=>({"*":{}});const A=(t,e,n,i)=>{const{addEventListenerBase:s,addEventListener:o}=EventTarget.prototype;(s||o).call(t,e,n,i)};class T{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class P{static extract(t){const e=t.views.map((t=>{const e=t.children.map((t=>t.type===r?Object.assign(Object.assign({},t),P.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})}}P.moduleToContainerParams={name:"SysContainerComponent",version:"1.0.0"};const R="ENVIRONMENT_UPDATE";class N extends S{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on(R,(({isMobileEnv:t})=>{this._isMobile=t,this.emit(N.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(N.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(N.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}N.changeEventName="CHANGE";class L{static set(t,e){const n=t[L.accumulatorPropertyName]||{};t[L.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[L.accumulatorPropertyName]).forEach((n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""}))}}L.accumulatorPropertyName="clStyleAttributes";const _="CONTENT_LOCKER";class w{static applyHostStyles(t,e,n=null,i){var s,r,l;const c=null===(r=null===(s=null==n?void 0:n.props)||void 0===s?void 0:s.handlers)||void 0===r?void 0:r.find((t=>"CLICK"===t.type));c&&(null===(l=c.actions)||void 0===l?void 0:l.length)&&(e.style.cursor="pointer"),t!==o&&t!==a&&t!==p||(e.style.display=i===_&&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 I{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class M{constructor(t,e,n,i,s,o){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=i,this.getEnvCb=s,this.httpClient=o,this.subscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach((n=>{var i,s,o,r,a;const l=null===(s=null===(i=e.adaptiveStyles)||void 0===i?void 0:i[t])||void 0===s?void 0:s.find((t=>t.element===n)),c=(null===(o=e.styles)||void 0===o?void 0:o.find((t=>t.element===n)))||{},u=(null===(r=null==c?void 0:c.styleAttributes)||void 0===r?void 0:r.background)||(null===(a=null==l?void 0:l.styleAttributes)||void 0===a?void 0:a.background),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;this._applyHostElementBackground(this.envUrlMaps[t].get("host"),null===(e=this.getSharedCb().theme)||void 0===e?void 0:e.schema)})).catch((t=>{console.error(t),I.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)}))}on(){return this.subscription=this.documentModel.on("THEME_UPDATE",(t=>{this._applyHostElementBackground(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)})),this}_applyHostElementBackground(t,e={}){t&&(this.hostElement.style.background=this._buildBackgroundUrl(t,e))}_buildBackgroundUrl(t,e){const n=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e.accent);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}}const j=new class{execute(t,e,n=null,i,s){const o={method:e,headers:Object.assign({"Content-Type":"text/plain"},i||{}),credentials:"same-origin",body:null,signal:s};return n&&(o.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,o)}};function k(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 D{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}const W="COMPONENT_RESOURCES_LOADED",U="FAILED_TO_LOAD_COMPONENT_RESOURCE";class V{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(W,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(U,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new D(this.onCounterStateUpdate)}}}const F=(...t)=>{let e=t.reduce(((t,e)=>Object.assign(Object.assign({},t),{[e]:[]})),{});return{get:t=>e[t],clear:()=>F(...t)}},B=F,H="props",$="shared",G="environment";function K(t,e,n,i){const s=t=>{let o=t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host:t;return o&&(i&&"function"==typeof i?i(o.getAttribute(e)):(null===(r=null==o?void 0:o.getAttribute)||void 0===r?void 0:r.call(o,e))===n)?o:o&&o.parentNode&&s(o.parentNode)||null;var r};return s(t)}const z="SUBMIT";function Y(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach((n=>{"element"!==n&&"classes"!==n&&(e[n]&&"object"==typeof e[n]&&!Array.isArray(e[n])?t[n]=Object.assign(Object.assign({},t[n]||{}),e[n]):t[n]=e[n])})),t):t}var Q=n(521);function q(t){const{element:e,html:n,appendHtml:i}=t,s=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach((t=>t.remove())),e.querySelectorAll("*").forEach((t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach((e=>t.removeAttribute(e))),Array.from(t.attributes).forEach((e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)})),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}})),e.body.innerHTML}(n);i?e.innerHTML+=s:e.innerHTML=s}class X extends Event{constructor(t,e,n){super(t,n),this.detail={},Object.defineProperty(this,"detail",{value:e})}}class Z extends HTMLElement{constructor(){var t,e;super(),this.construct=()=>{let t;const e=this.getAttribute((0,s.vi)("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const i=n.closest(`[${(0,s.vi)("widget-id")}]`);let o;i&&(o=i.getAttribute((0,s.vi)("widget-id")));let r=new X("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute((0,s.vi)("path")),id:e,widgetId:o},{bubbles:!0,composed:!0});this.dispatchEvent(r),t=r.detail.props,Object.assign(this,t),this.observers=B(H,$,G),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 S,this.componentResourceManager=new V(this.model.id,this.services.eventEmitter,"STATIC"===this.services.config.getConfig("entryModuleType")),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new O(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(H).forEach((e=>e(this.prevProps,t))),this.prevProps=t;const e=this.getHostElement(),n=(0,s.vi)("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($).forEach((t=>t(this.getShared())))})),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new M(this.documentModel,this.getHostElement(),(()=>this.getShared()),(()=>this.model.props),(()=>this.getEnvironment()),j),this.colorSchemaListener.apply(this.getEnvironment()).then((()=>{this.subscriptions.push(this.colorSchemaListener.on())}))),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(N.changeEventName,(()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(G).forEach((e=>e(this.prevEnvironment,t))),this.prevEnvironment=t})))},this.attachHandlers=()=>{this.getHandlers().map((t=>this._handlerFactory.get(t))).map((t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this)))).forEach((t=>t()))},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.postpone()))},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach((t=>t.release()))},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(H).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get($).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(G).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${(0,s.vi)("element")}]`)).filter((t=>!t.hasAttribute((0,s.vi)("component"))))],this.getElement=(t,e)=>this.getElements().find((n=>e?n.getAttribute((0,s.vi)("element"))===t&&n.id===e:n.getAttribute((0,s.vi)("element"))===t)),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const n=this.getElements();if(!n.length)return;t=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach((t=>{const e=t.element;let i=!1,s=!1;n.desktop&&n.desktop.forEach((n=>{n.element===e&&(Y(n,t),i=!0)})),n.mobile&&n.mobile.forEach((n=>{n.element===e&&(Y(n,t),s=!0)})),!i&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!s&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))})),n}(t,e);const i=(0,s.vi)("type"),o="element-styles";let r=this.getRootElement().querySelector(`style[${i}="${o}"]`);r||(r=document.createElement("style"),r.setAttribute(i,o),this.getRootElement().appendChild(r)),q({element:r,html:""}),n.forEach((e=>{let n=e.getAttribute((0,s.vi)("element"));const i=this.getEnvironment();let o=(0,Q.xK)(t,i,n);if(o){if(this.resizeListener.isMobile()){const e=(0,Q.xK)(t,"desktop",n);e&&(o=Object.assign(Object.assign({},o),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),o.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(o),r)}})),this._addLinkColor(r,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,i]of Object.entries(e))t.style[n]=i;return!0},this.applyStylesToElement=(t,e,n)=>{var i,o;const r=[];"host"===(e=Z._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===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),r.push("background")));let a=e.styleAttributes.background,l=a&&a.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&l){this.componentResourceManager.getPending().increment();const t=new Image;t.src=l[1],A(t,"load",(()=>{this.componentResourceManager.getPending().decrement()})),A(t,"error",(()=>{this.componentResourceManager.onResourceLoadFailure(t.src),"UPDATING"===this.services.config.getConfig("entryModuleType")&&this.componentResourceManager.getPending().decrement()}))}const c=Object.assign(Object.assign({},e),{styleAttributes:k(e.styleAttributes,r)});if(L.set(t,c),this._setClassAttributes(t,e),n){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(),s=`flip-up-animation-${e.element}`;let o=this.getRootElement().querySelector(`#${s}`);o||(o=document.createElement("style"),o.id=s,t.appendChild(o)),q({element:o,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(n,e.element,i,`:not(.${(0,s.vi)("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._fixMarginOverflow=t=>{const e=this.getParentComponent(),n=e&&("flex"===e.style.display||"inline-flex"===e.style.display),i="host",o=t.getAttribute((0,s.vi)("element"))===i;if(!n||!o)return;const r=this.getProps(),a=this.getEnvironment(),{styleAttributes:l}=(0,Q.xK)(r.adaptiveStyles,a,i)||{};if(!l)return;const c=l.marginLeft||l.marginRight,u="100%"===l.width;if(c&&u){const e=(parseFloat(l.marginLeft)||0)+(parseFloat(l.marginRight)||0);e&&setTimeout((()=>{t.style.width=`calc(100% - ${e}px)`}))}},this.applySharedClassesToElementModel=t=>{const e=this.documentModel.getShared();return(0,Q.MW)(t,e)},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;":";"}`),"");q({element:t,html:`[${(0,s.vi)("element")}="${e}"]${i} { ${r} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{q({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,i,s,o;e.linkColor&&q({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&q({element:t,html:`a {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}, a:visited {color: ${null===(s=e.linkParams)||void 0===s?void 0:s.color}}`,appendHtml:!0}),(null===(o=e.linkParams)||void 0===o?void 0:o.removeUnderline)&&q({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(t,e)=>{Array.from(t.classList).filter((t=>t!==(0,s.yU)("hovered")&&t!==(0,s.yU)("focused"))).forEach((e=>{e.startsWith(s._N.SYSTEM_CLASS_PREFIX)&&t.classList.remove(e)}));const n=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",n)},this.getParentComponent=()=>K(this.parentNode,(0,s.vi)("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute((0,s.vi)("path"));return t&&1===t.split(",").length?this.parentNode:K(this.parentNode,(0,s.vi)("path"),void 0,(t=>t&&1===t.split(",").length))},this.getWidgetLanguages=()=>{return[(t=this.services.config).getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter((t=>!!t));var t},this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce(((e,n)=>{if(e)return e;const i=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return i||null}),null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.addContextRecord=()=>{var t;const e=this.getModel();this.services.context.addRecord(e.id,{recordKey:e.id,id:e.props.control.name,label:this.getContextRecordLabel(e.props),value:e.props.control.defaultValue||"",viewIndex:null===(t=e.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(e.props)}})},this.getContextRecordLabel=t=>{var e,n;const i=t.control.name;if(["email","first_name","last_name"].includes(i))return i.toUpperCase();if(t.content.label&&(null===(n=null===(e=t.adaptiveStyles.desktop.find((t=>"label"===t.element)))||void 0===e?void 0:e.params)||void 0===n?void 0:n.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return t.content.placeholder?this.capitalizeFirstLetter(t.content.placeholder):t.control.integrationName?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{switch(t.control.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find((t=>t.category===z));n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:d}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>this.getProps().handlers&&this.getProps().handlers.length?[...this.getProps().handlers]:[],this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(t=this.define)||void 0===t?void 0:t.manifest)||(null===(e=this.constructor.define)||void 0===e?void 0:e.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then((()=>{this.attachHandlers()}))}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}static _resolveTogglableStylesForElementModel(t){const e=Object.assign({},t);return Object.keys(e).forEach((t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=Z._resolveTogglableStyles(e[t]))})),e}static _resolveTogglableStyles(t){const e=Object.assign({},t),n=(t,n,i)=>{n in e&&(t.forEach((t=>{t in e&&(e[t]=e[n]?e[t]:i)})),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e}}const J=()=>{const t=window.screen.orientation||window.screen.mozOrientation||window.screen.msOrientation;return t?t.type.includes("portrait")?"PORTRAIT":"LANDSCAPE":void 0===window.orientation||0===window.orientation||180===window.orientation?"PORTRAIT":90===window.orientation||-90===window.orientation?"LANDSCAPE":void 0},tt=()=>/iPhone/i.test(navigator.userAgent)||/iPad/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1;class et extends S{constructor(t,e){var n;super(),this.documentModel=t,this._orientation=null!==(n=e.config.defaultOrientation)&&void 0!==n?n:J(),this.documentModel.on(R,(t=>{t.orientation&&(this._orientation=t.orientation,this.emit(et.changeEventName,this._orientation))})),this.handleOrientationChangeBound=this.handleOrientationChange.bind(this),this.addOrientationChangeListener()}isPortrait(){return"PORTRAIT"===this._orientation}handleOrientationChange(t){var e,n;this._orientation=null!==(n=null===(e=null==t?void 0:t.detail)||void 0===e?void 0:e.orientation)&&void 0!==n?n:J(),this.emit(et.changeEventName,this._orientation)}addOrientationChangeListener(){!tt()&&window.screen.orientation?window.screen.orientation.addEventListener("change",this.handleOrientationChangeBound):"orientation"in window&&window.addEventListener("orientationchange",this.handleOrientationChangeBound)}removeOrientationChangeListener(){!tt()&&window.screen.orientation?window.screen.orientation.removeEventListener("change",this.handleOrientationChangeBound):"orientation"in window&&window.removeEventListener("orientationchange",this.handleOrientationChangeBound)}destroy(){super.destroy(),this.removeOrientationChangeListener()}}function nt(t){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(t)}function it(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,ct(i.key),i)}}function st(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(st=function(){return!!t})()}function ot(){return ot="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var i=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=rt(t)););return t}(t,e);if(i){var s=Object.getOwnPropertyDescriptor(i,e);return s.get?s.get.call(arguments.length<3?t:n):s.value}},ot.apply(null,arguments)}function rt(t){return rt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rt(t)}function at(t,e){return at=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},at(t,e)}function lt(t,e,n){return(e=ct(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ct(t){var e=function(t){if("object"!=nt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==nt(e)?e:e+""}et.changeEventName="CHANGE";var ut=function(t){function e(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),lt(t=function(t,e,n){return e=rt(e),function(t,e){if(e&&("object"==nt(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,st()?Reflect.construct(e,n||[],rt(t).constructor):e.apply(t,n))}(this,e),"manifest",i.A),lt(t,"updateResponsiveStyles",(function(){t.getProps().isResponsive&&"mobile"===t.getEnvironment()&&t.mobileDeviceOrientationListener.isPortrait()?t.getRootElement().querySelector(".columns-container").style.flexDirection="column":t.getRootElement().querySelector(".columns-container").style.flexDirection="row"})),t.getRootElement().innerHTML="\n ".concat("\n <style>\n :host {\n position: relative;\n min-width: 50px;\n min-height: 50px; \n display:flex;\n }\n\n .columns-container {\n height: auto;\n min-height: 50px; \n width: 100%;\n min-width: 50px;\n display: flex;\n gap: inherit;\n }\n </style>\n ","\n <div ").concat((0,s.vi)("render-outlet"),' class="columns-container"></div>\n '),t}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&&at(t,e)}(e,t),n=e,o=[{key:"connectedCallback",value:function(){var t,n,i,s=this;(t=e,n=this,"function"==typeof(i=ot(rt(1&3?t.prototype:t),"connectedCallback",n))?function(t){return i.apply(n,t)}:i)([]),this.observeProps((function(t,e){s.applyAutoAdaptiveStyles(e.adaptiveStyles,e.styles),s.updateResponsiveStyles()})),this.observeEnvironment((function(t,e){s.updateResponsiveStyles()})),this.subscriptions.push(this.mobileDeviceOrientationListener.on(et.changeEventName,(function(){s.updateResponsiveStyles()})))}}],o&&it(n.prototype,o),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,o}(Z);lt(ut,"define",{name:"sys-columns",model:i.A.name,manifest:i.A})}},e={};function n(i){var s=e[i];if(void 0!==s)return s.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var i=n(658),s=n(32);function o(t){return o="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},o(t)}function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function a(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){l(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function l(t,e,n){return(e=function(t){var e=function(t){if("object"!=o(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==o(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const c=a(a({},s.A),{},{props:a(a({},s.A.props),{},{isResponsive:!1})});function u(t){return u="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},u(t)}function p(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(p=function(){return!!t})()}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function d(t,e){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},d(t,e)}function m(t){var e=function(t){if("object"!=u(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==u(e)?e:e+""}var y,g,b,f=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,n){return e=h(e),function(t,e){if(e&&("object"==u(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,p()?Reflect.construct(e,n||[],h(t).constructor):e.apply(t,n))}(this,t,arguments)}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&&d(t,e)}(t,i.A),e=t,Object.defineProperty(e,"prototype",{writable:!1}),e;var e}();y=f,g="define",b={name:"sys-columns",model:c.name,manifest:c},(g=m(g))in y?Object.defineProperty(y,g,{value:b,enumerable:!0,configurable:!0,writable:!0}):y[g]=b;export{f as default};window.clComponentClass_SysInAppColumnsComponent=f;