@rokt/dcui-orchestrator 0.0.4-rc.12 → 0.0.4-rc.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom/client"),a=require("react-redux"),i=require("ramda"),o=require("@emotion/css"),r=require("redux-saga/effects"),s=require("@reduxjs/toolkit"),l=require("redux-saga"),c=require("@redux-saga/core/effects"),d=require("embla-carousel-react"),u=require("insane"),p=require("@emotion/css/create-instance");function f(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var y=f(t);function h(e){const t=["elements","own"],n=["default","dimension","width","type"],a=["default","dimension","width","value"],o=["default","dimension","minWidth"],r=i.path(t,e);return r&&Array.isArray(r)&&r.length?i.assocPath(t,r.map(i.when(i.allPass([i.hasPath(n),i.complement(i.hasPath(o)),i.pathEq("fixed",n)]),(e=>i.assocPath(o,i.path(a,e),e)))),e):e}function m(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function v(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function g(){return"ontouchstart"in document.documentElement}function b(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function E(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function I(e){return E(e)&&"Fulfillment"===e.action}function x(e){return E(e)&&"Url"===e.action}function S(e){return E(e)&&"External"===e.action}function w(e){return(I(e)||x(e))&&"RealTime"===e.conversionType&&"rclid"in e}function C(e={}){return Object.assign({light:"https://plus.unsplash.com/premium_photo-1675826774817-fe983ceb0475?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=200&q=80",dark:"https://images.unsplash.com/photo-1679941734238-56628f5991f7?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=200&q=80"},e)}const O={pluginId:"shared",pageInstanceGuid:"N/A"};var T;!function(e){e.DCUI="DCUI",e.Partner="partner"}(T||(T={}));const A=["SignalCartItemQuantitySelected"],R="ERROR",j="WARNING";class L extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const N=["V2_CART_ITEM_UPDATED","CART_ITEM_INSTANT_PURCHASE","OFFER_ENGAGEMENT","POSITIVE_ENGAGEMENT","UPSELL_CREATIVE_SENT","REALTIME_OFFER_FULFILLMENT_REFERRAL","REALTIME_OFFER_FULFILLMENT_CONVERSION","REALTIME_OFFER_FULFILLMENT_SUCCESS","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];const _=(e,t)=>i.concat(e,i.slice(e.length,t.length,t)),D=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?_(t,e):t,a=t.length>e.length?_(e,t):e;return i.zipWith(F,a,n)}return t},k=e=>null==e,P=e=>!k(e),$=(e,t)=>k(t)?e:t,G=(e,t)=>{throw new L("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function F(e,t){return i.cond([[(e,t)=>i.type(e)!==i.type(t)&&P(e)&&P(t),G],[(e,t)=>k(e)||k(t),$],[(e,t)=>"Object"===i.type(e),i.mergeDeepWith(F)],[(e,t)=>"Array"===i.type(e),D],[i.T,i.flip(i.unary(i.identity))]])(e,t)}function M(e,t){return F(e,t)}function B(e=0){return`breakpoint-${e}px`}function U(e,t){return t?`${t}-child${e}`:void 0}const V="GLOBAL/RAISE_METRIC",z="GLOBAL/OFFER_ENGAGEMENT";function q(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&I(e.responseOption)&&"fulfillment"in e&&b(e.fulfillment)}function H(e){return S(e)}function W(e){return x(e)}function J(e){return function(e){return E(e)&&"CaptureOnly"===e.action}(e)}function K(e){return!!(w(e)||"responseOption"in e&&w(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}const Y="GLOBAL/RAISE_SIGNAL",Z="GLOBAL/OFFER_LIFECYCLE",Q="GLOBAL/SET_CUSTOM_STATE",X="GLOBAL/SEND_PARTNER",ee="GLOBAL/SET_DOMAIN_STATE",te="GLOBAL/PREPARE_SIGNAL",ne="GLOBAL/OPEN_LINK",ae="GLOBAL/SET_PARTNER_VALIDATION_STATUS",ie="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",oe="GLOBAL/LAUNCH_CHILD_LAYOUT",re={RAISE_METRIC:V,PREPARE_SIGNAL:te,OFFER_ENGAGEMENT:z,RAISE_SIGNAL:Y,OFFER_LIFECYCLE:Z,SEND_PARTNER:X,SET_CUSTOM_STATE:Q,SET_DOMAIN_STATE:ee,OPEN_LINK:ne,SET_PARTNER_VALIDATION_STATUS:ae,SET_GLOBAL_OFFER_DATA_CART:ie,LAUNCH_CHILD_LAYOUT:oe},se="data-open-in-app",le="data-click-signal-context";function ce(e,n){function a(e){var t;if(!(e.target&&e.target instanceof HTMLElement))return;const a=null===(t=e.target)||void 0===t?void 0:t.closest("a");if(a){const t=a.getAttribute("href"),i=a.getAttribute(le);if(i&&n({type:Y,payload:{name:"SignalUserInteraction",action:"Click",context:i}}),t){e.preventDefault();let i="newTab";a.hasAttribute(se)&&(i="inApp"),n({type:ne,payload:{url:t,urlBehaviour:i}})}}}t.useEffect((()=>null!==e?(e.addEventListener("click",a),()=>{e.removeEventListener("click",a)}):()=>{}),[e])}function de(){const e=t.useRef(null);return t.useEffect((()=>{const t=t=>{"Tab"===t.key&&ue(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const ue=(e,t)=>{var n;const a=null===(n=t.current)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!a)return;const i=a[0],o=a[a.length-1],{activeElement:r}=window.document;if(1!==a.length)return r===i&&e.shiftKey?(o&&o.focus(),void e.preventDefault()):r!==o||e.shiftKey?void 0:(i&&i.focus(),void e.preventDefault());e.preventDefault()},pe="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function fe(e,t){return t?"false"!==pe.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${B(e)} ${t.trim()}`:`#app-container.${B(e)} & {${t}}`:"";var n}const ye={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"};function he(e){return function(e){return Object.keys(ye).indexOf(e)>-1}(e)?ye[e]:""}const me={container:{justifyContent:"justify-content",alignItems:"align-items",shadow:"box-shadow",gap:"gap",overflow:"overflow",blur:"filter",opacity:"opacity"},text:{textColor:"color",fontSize:"font-size",fontFamily:"font-family",fontWeight:"font-weight",fontStyle:"font-style",lineHeight:"line-height",lineLimit:"",letterSpacing:"letter-spacing",baselineTextAlign:"vertical-align",horizontalTextAlign:"text-align",textDecoration:"text-decoration",textTransform:"text-transform"},background:{backgroundColor:"background-color",backgroundImage:""},dimension:{width:"width",maxWidth:"max-width",minWidth:"min-width",height:"height",maxHeight:"max-height",minHeight:"min-height",rotateZ:"transform"},flexChild:{alignSelf:"align-self",weight:"flex",order:"order"},spacing:{margin:"margin",padding:"padding",offset:""},border:{borderColor:"border-color",borderRadius:"border-radius",borderWidth:"border-width",borderStyle:"border-style"}};function ve(e,t){if(!me[e]||!me[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return me[e][t]}function ge(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function be(...e){let t="";const n=(...e)=>e.reduce(((e,n)=>(e&&n?e=e+t+n:n&&(e=n),e)),"");return 1===e.length?(t=e[0],n):n(...e)}function Ee(e,t){return`${e}:${t};`}function Ie(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class xe extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function Se(e,t){if(null===t)return!1;const n=("function"==typeof e?[e]:e).map((e=>e(t))).reduce(((e,t)=>t?e?e+=`, ${t}`:t:e),void 0);if(n)throw new xe(n,JSON.stringify(t));return!0}function we(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function Ce(e){return t=>{const n=t&&"symbol"!=typeof t?t.toString():t;if(!(e.indexOf(n)>=0))return`value must be one of [${e.join(",")}]`}}function Oe(e){if(null==e||""===e)return"value must not be omitted"}function Te(e){const t=new RegExp(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{3})$/);if("string"!=typeof e||!t.test(e))return"value must be a valid hex color"}function Ae(e){const t=new RegExp(/^(?:(?:data:image\/[^;]+;base64[^"]+)|(?:(?:https?:)?\/\/[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)*(?::\d{1,10})?)?(?:\.\.?\/?)*\/(?:[a-zA-Z\d\-_]+\/)*[a-zA-Z\d\-_]+\.[a-zA-Z\d]{2,6}(?:\?(?:.+=.+&?)*)?)(?:#.+)?$/);if("string"!=typeof e||!t.test(e))return"value must be a valid CSS URL string"}function Re(e){if(null!=e&&""!==e)return"value must not be specified"}function je(e){return t=>{if(t&&"object"==typeof t&&"value"in t&&"type"in t&&"string"==typeof t.type&&function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t.type)&&"function"==typeof e[t.type]){const n=e[t.type](t.value);if(!n)return;return`object must have valid "value" for type: ${t.type}: ${n}`}return`value must be an object that has a "type" property that matches one of: [${Object.keys(e).join(", ")}] and a "value" property`}}function Le(...e){return t=>{if("string"==typeof t){const n=t.split(" ");if(n.length>1&&e.indexOf(n.length)>-1){if(!n.reduce(((e,t)=>e||we(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function Ne(e,t){return n=>{const a=e(n),i=t(n);if(a&&i)return`one of these must be true: ${a} -OR- ${i}`}}function _e(e){if("string"!=typeof e)return"value must be a string"}const De=i.is(Object);function ke(e){const t=Object.entries(e);return n=>De(n)&&!Array.isArray(n)?t.reduce(((e,[t,a])=>e||a(n[t])),void 0):`Input value (${e}) must be an object`}function Pe(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function $e(e,t,n){return Se(we,n)?Ee(ve(e,t),`${n}`):""}function Ge(e){return(t,n,a)=>Se(Ce(Object.keys(e)),a)?Ee(ve(t,n),`${e[a]}`):""}function Fe(e){return Se(Oe,e)?ge({light:t(Ae,!1),dark:t(Ne(Re,Ae),!0)},be("\n "))(e):"";function t(e,t){return n=>{if(Se(e,n)&&n){const e=Ee("background-image",`url("${n}")`);return t?Ie(e):e}return""}}}function Me(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),Se(Ne(Re,Ce(Object.keys(t))),e)&&e?Ee("background-size",t[e]):""}const Be=i.cond([[i.equals("top-left"),i.always("top left")],[i.equals("top-right"),i.always("top right")],[i.equals("bottom-left"),i.always("bottom left")],[i.equals("bottom-right"),i.always("bottom right")],[i.T,i.identity]]);function Ue(e){const t="string"==typeof e?e.toLowerCase():e;return Se(Ne(Re,Ce(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?Ee("background-position",Be(t)):""}function Ve(e,t,n){return Se(Ne(we,Le(2,3,4)),n)?Ee(ve(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function ze(e){return(t,n,a)=>Se(je({fit:Ce(e),percentage:we,fixed:we}),a)?Ee(ve(t,n),function(e){const t={"wrap-content":"fit-content","fit-width":"100%","fit-height":"100%"};switch(e.type){case"fixed":return`${e.value}px`;case"percentage":return`${e.value}%`;case"fit":return t[e.value]}}(a)):""}const qe=ke({light:Te,dark:Ne(Re,Te)});function He(e,t,n){return a=>{if(a){const i=Ee(ve(e,t),Je(String(a)));return n?Ie(i):i}return""}}function We(e,t,n){return Se(qe,n)?ge({light:He(e,t,!1),dark:He(e,t,!0)},be("\n "))(n):""}function Je(e){const t=e.toUpperCase();switch(t.length){case 5:return`#${t.substring(2,5)}${t[1]}`;case 9:return`#${t.substring(3,9)}${t[1]}${t[2]}`;default:return t.toUpperCase()}}const Ke=ke({offsetX:Ne(Re,we),offsetY:Ne(Re,we),blurRadius:Ne(Re,we),spreadRadius:Ne(Re,we),color:qe}),Ye=e=>t=>null!=t?String(t):e,Ze=i.compose(i.concat(i.__,"px"),Ye("0")),Qe=e=>t=>"string"==typeof t?e(t):t,Xe=i.compose(Qe(i.concat(i.__,"px")),Ye(void 0)),et=i.compose(Qe(Je),i.prop("dark"));function tt(e,t,n){return Ee(e,ge({offsetX:Ze,offsetY:Ze,blurRadius:t.spreadRadius?Ze:Xe,spreadRadius:Xe,color:n},be(" "))(t))}const nt={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},at={container:{justifyContent:Ge(nt),alignItems:Ge(nt),shadow:function(e,t,n){var a,o,r;if(Se(Ke,n)){const s=ve(e,t);return be("\n")(tt(s,n,(o="light",r="#80000000",i.compose(Je,i.propOr(r,o)))),(null===(a=n.color)||void 0===a?void 0:a.dark)?Ie(tt(s,n,et)):"")}return""},gap:Ve,overflow:Ge({hidden:"hidden",visible:"visible"}),blur:function(e,t,n){return Se(Pe,n)?Ee(ve(e,t),`blur(${n.toString()}px)`):""},opacity:$e},text:{textColor:We,fontSize:Ve,fontFamily:function(e,t,n){return Se(_e,n)?Ee(ve(e,t),(a=`${n}`,a.replace(/['();{}@:[\]!/=]/g,"")).split(",").map(((e,t)=>{const n=0===t?e:e.trim();if(n.includes(" ")){const e=n.startsWith('"')?"":'"',t=n.endsWith('"')?"":'"';return`${e}${n}${t}`}return n})).join(",")):"";var a},fontWeight:Ge({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:Ge({normal:"normal",italic:"italic"}),lineHeight:Ve,lineLimit:function(e,t,n){return Se(we,n)?`\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: ${n};\n line-clamp: ${n}; \n -webkit-box-orient: vertical;\n `:""},letterSpacing:Ve,baselineTextAlign:Ge({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:Ge({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:Ge({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:Ge({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:We,backgroundImage:function(e,t,n){return Se(Oe,n)?ge({url:Fe,position:Ue,scale:Me},be)(n):""}},dimension:{width:ze(["wrap-content","fit-width"]),maxWidth:Ve,minWidth:Ve,height:ze(["wrap-content","fit-height"]),maxHeight:Ve,minHeight:Ve,rotateZ:(it="Z",(e,t,n)=>{const a=`rotate${it}`;return Se(we,n)?Ee(ve(e,t),`${a}(${n.toString()}deg)`):""})},flexChild:{alignSelf:Ge(nt),weight:$e,order:$e},spacing:{margin:Ve,padding:Ve,offset:function(e,t,n){return Se(Le(2),n)?`transform:translate(${n.split(" ").join("px, ")}px)`:""}},border:{borderColor:We,borderRadius:Ve,borderWidth:Ve,borderStyle:Ge({solid:"solid",dashed:"dashed"})}};var it;function ot(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((a=>{if(!at[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const i=at[n][a];if(!i)throw new Error(`No styling transformer exists for property: ${n}.${a.toString()}`);try{t+=i(n,a,e[n][a])}catch(e){throw e&&"object"==typeof e&&"message"in e&&(e.message=`Error parsing styling key ${n}.${a.toString()}: ${e.message}`),e}})),t)),"")}const rt="FAILED_TEMPLATING_DATA",st=new Map;function lt(e){return String.fromCharCode(97+e)}function ct(e,t,n){const a=`${e||O.pluginId}-${void 0!==t?String(t):"outer"}`,i=st.get(a);if(i&&i.sheet.container.isConnected)return i.css;const o=function(e,t){const n={key:void 0!==e?`inner-css-${lt(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),p(n)}(t,n);return st.set(a,o),o.css}const dt="%%%OWN_CLASS_REF%%%",ut=i.memoizeWith(((e,t,n,a)=>`${String(e)}-${t}-${n}`),pt);function pt(e,t,n,a){const i=ct(t,n,a);let o=1;return function t(n,a=!1){var r;if("string"==typeof n){const e={scopeClass:n};return t.bind(e)}const s=n,l=this.scopeClass,c=Object.entries(null!==(r=s.elements)&&void 0!==r?r:{});try{const t=c.reduce(((t,[n,i])=>Object.assign(Object.assign({},t),{[n]:ft(i,l,a,String(n),e)})),{}),n=Object.entries(t),r=a?"parent-"+o++:"",s=function(e){return"own"in e&&"string"==typeof e.own&&e.own.length>0}(t)?i(t.own):"";return n.reduce(((e,[t,n=""])=>{if("own"===t)return e;const a=n.replace(dt,r);return Object.assign(Object.assign({},e),{[t]:a?i(a):""})}),{own:`${s}${s&&r?" ":""}${r}`})}catch(e){const t=e;throw t.code="FAILED_PARSING_STYLES",t}}.bind({})}function ft(e,t,n,a,i){return e.map(function(e,t,n){return a=>Object.entries(a).map((([a,i])=>{const o=i?ot(i):"";switch(!0){case"default"===a:return o?`\n${o}\n`:"";case Boolean(e):return`\n .${e}${he(a)} & {\n${o}\n}\n`;case t&&"own"!==n:return`\n .${dt}${he(a)} & {\n${o}\n}\n`;default:return`\n &${he(a)} {\n${o}\n}\n`}})).join("")}(t,n,a)).reduce(((e,t,n)=>{const a=i[n];return void 0!==a?e+(0===n?t:`${fe(a,t)}\n`):e}),"")}const yt=t.createContext(i.always(void 0)),ht=()=>t.useContext(yt),mt=t.createContext(null);function vt(e,n){var a;const i=t.useContext(mt);return i&&null!==(a=n(i))&&void 0!==a?a:e}const gt=t.createContext((()=>{throw Error("Node Mapper Context does not have a mapper. Use the NodeMapperProvider with the default nodeMapper as a value before you consume this mapper")})),bt=gt.Consumer,Et=()=>t.useContext(gt),It=e=>t.createElement(gt.Provider,{value:(t,n,a)=>e.value(t,null!=n?n:e.overrides,a)},e.children),xt=t.createContext(null),St=()=>t.useContext(xt),wt=t.createContext({get(){throw Error("Offer context has not been set")}}),Ct=e=>t.createElement(wt.Provider,{value:{get:()=>e.context}},e.children),Ot=()=>t.useContext(wt).get(),Tt=()=>{try{return t.useContext(wt).get().creative.copy}catch(e){return}},At=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),Rt=i.compose(i.not,i.isEmpty),jt=i.where({url:Rt,title:Rt});function Lt(e,t,n){return t.reduce(((t,n)=>{const[a,i]=n.slice(0,-1).split("["),o=i?i.split(","):[];if(!a)throw new Error(_t(e,"This Meta Attribute could not be parsed."));return function(e,t,n,a){switch(t){case"openLinks":return function(e,t,n){Nt(t,e,"openLinks",1,2);const a=Dt(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),i=kt(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===a)return n.replace(At,((e,t)=>`<a ${se} ${i?`${le}="${i}" `:""}${t}`));return n}(e,n,a);case"sliceText":return function(e,t,n){Nt(t,e,"sliceText",2,2);const a=Dt(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),i=Dt(t,e,1,(e=>{const t=Number(e);return!Number.isNaN(t)&&t>=0?t:null}),"sliceText meta attribute second argument must be a positive number");if("Chars"===a)return function(e,t){const n=new RegExp("(?<=<a.*>).*(?=</a>)");return e.startsWith("<a")?e.replace(n,(e=>e.slice(0,t))):e.slice(0,t)}(n,i);throw Error(_t(e,`Unknown "SliceBy" value. ${a}`))}(e,n,a);default:throw new Error(_t(e,`Unknown Meta Attribute '${t}'.`))}}(e,a,o,t)}),n)}function Nt(e,t,n,a,i){const o=new Error(_t(t,`${n} meta attribute takes ${a!=i?`between ${a} and ${i}`:a} arguments; received ${e.length}.`));if(e.length<a||e.length>i)throw o}function _t(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function Dt(e,t,n,a,i){const o=kt(e,n,a);if(null!==o)return o;throw Error(_t(t,i||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function kt(e,t,n){return n(e[t])}const Pt="DATA",$t="STATE",Gt=new RegExp(`^(${Pt}|${$t})`),Ft=new RegExp(`^${$t}`),Mt=new RegExp(`%\\^(?:${Pt}|${$t})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*(?:\\:[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,]*\\])*(?:\\|.*?)?\\^%`,"g"),Bt=Symbol("invalid");function Ut(e,t="creativeCopy"){const n=Vt({data:e},t);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Vt(t,n,this.dataMap)});let a=!1;const o=t,r=i.pipe(i.slice(2,-2),i.split("|"),(e=>{const t=i.reduce(((e,t)=>{let n;if(Gt.test(t)){if(!this.dataMap.has(t)&&Ft.test(t))throw new L(rt,`Invalid use of STATE template key in a context it does not exist: ${t}`);const a=i.split(":",t);if(a[0]){if(n=this.dataMap.get(a[0]),n&&n===Bt)throw new L(rt,`Invalid template key referenced: "${t}" is an object but expected a string, boolean, number or empty. \nDid you mean to reference a child property of ${t}?`);if(a.length>1&&n)try{n=Lt(a[0],a.slice(1),n)}catch(e){throw new L(rt,`Failed to apply meta attributes. ${function(e){return null!=e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message?e.message:String(e)}(e)}`)}}return n?i.reduced({provided:!0,value:n}):e}return i.reduced({provided:!0,value:t})}),{provided:!1,value:""},e);return t.provided||(a=!0),t.value})),s=i.replace(Mt,r,o);return!1===a?s:""}.bind({dataMap:n})}function Vt(e,t,n){const a=new Map(n);return"data"in e&&o(e.data,`${Pt}${t?"."+t:""}`),"state"in e&&o(e.state,`${$t}${t?"."+t:""}`),a;function o(e,t){"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e?a.set(t,(null==e?void 0:e.toString())||""):a.set(t,Bt),e&&"object"==typeof e&&i.forEachObjIndexed(((e,n)=>o(e,`${t}.${n}`)),e)}}const zt=t.createContext(Ut({})),qt=zt.Consumer,Ht=zt.Provider,Wt=()=>t.useContext(zt),Jt=t.createContext(null),Kt=Jt.Provider,Yt=t.createContext("OUTER"),Zt=()=>"VARIANT"===t.useContext(Yt),Qt=t.createContext(void 0),Xt=()=>t.useContext(Qt);var en,tn,nn,an,on,rn,sn=function(e,t,n,a){return new(n||(n=Promise))((function(i,o){function r(e){try{l(a.next(e))}catch(e){o(e)}}function s(e){try{l(a.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((a=a.apply(e,t||[])).next())}))},ln=function(e,t,n,a,i){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?i.call(e,n):i?i.value=n:t.set(e,n),n},cn=function(e,t,n,a){if("a"===n&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?a:"a"===n?a.call(e):a?a.value:t.get(e)};class dn{constructor(e,t,n,a,o){en.set(this,void 0),tn.set(this,void 0),nn.set(this,new Set),an.set(this,void 0),on.set(this,void 0),rn.set(this,void 0),ln(this,en,i.partial(e.subscribe.bind(e),[n]),"f"),ln(this,tn,i.partial(e.dispatch.bind(e),[n]),"f"),ln(this,an,t,"f"),ln(this,on,a,"f"),ln(this,rn,o,"f"),this.onGlobalStateChange=this.onGlobalStateChange.bind(this),this.onInteractivityChange=this.onInteractivityChange.bind(this),this.onEvent=this.onEvent.bind(this),this.globalDispatch=this.globalDispatch.bind(this),this.createChildPlugin=this.createChildPlugin.bind(this)}onGlobalStateChange(e){const t=cn(this,en,"f").call(this,e),n=()=>{t(),cn(this,nn,"f").delete(n)};return cn(this,nn,"f").add(n),n}onInteractivityChange(e){return cn(this,on,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=cn(this,rn,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),cn(this,nn,"f").delete(n)};return cn(this,nn,"f").add(n),n}globalDispatch(e){cn(this,tn,"f").call(this,e)}dispose(){cn(this,nn,"f").forEach((e=>e())),ln(this,nn,new Set,"f"),cn(this,on,"f").clear()}createChildPlugin(e){return cn(this,an,"f").call(this,e)}}en=new WeakMap,tn=new WeakMap,nn=new WeakMap,an=new WeakMap,on=new WeakMap,rn=new WeakMap;class un{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>sn(this,void 0,void 0,(function*(){})),onClose:()=>sn(this,void 0,void 0,(function*(){})),putConfig:()=>sn(this,void 0,void 0,(function*(){})),send:()=>sn(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var pn,fn,yn=function(e,t,n,a,i){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?i.call(e,n):i?i.value=n:t.set(e,n),n},hn=function(e,t,n,a){if("a"===n&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?a:"a"===n?a.call(e):a?a.value:t.get(e)};class mn{constructor(e){pn.set(this,void 0),fn.set(this,new Set),yn(this,pn,e,"f")}subscribe(e){return hn(this,fn,"f").add(e),!0===e(hn(this,pn,"f"))&&hn(this,fn,"f").delete(e),()=>{hn(this,fn,"f").delete(e)}}publish(e){yn(this,pn,e,"f"),hn(this,fn,"f").forEach((e=>{!0===e(hn(this,pn,"f"))&&hn(this,fn,"f").delete(e)}))}clear(){hn(this,fn,"f").clear()}}pn=new WeakMap,fn=new WeakMap;var vn=function(e,t,n,a){if("a"===n&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?a:"a"===n?a.call(e):a?a.value:t.get(e)},gn=function(e,t,n,a,i){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?i.call(e,n):i?i.value=n:t.set(e,n),n};const bn="breakpoint-0px";class En{constructor(){this.logger=()=>{}}withAppFactory(e){return this.appFactory=e,this}withLogger(e){return this.logger=e,this}withGatewayFactory(e){return this.gatewayFactory=e,this}build(){var e,t,n,a,i,o,r,s,l,c;const d=this.appFactory,u=this.logger,p=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new un;return c=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint"]}constructor(){super(),t.add(this),n.set(this,(()=>null)),a.set(this,(()=>null)),i.set(this,void 0),o.set(this,!1),r.set(this,null),s.set(this,null);const e=this.attachShadow({mode:"open"});gn(this,i,document.createElement("div"),"f"),vn(this,i,"f").id="app-container",vn(this,i,"f").classList.add("default"),e.appendChild(vn(this,i,"f"))}attributeChangedCallback(e,i,o){if(o!==i)switch(e){case"visible":vn(this,n,"f").call(this,"true"===o);break;case"interactivity":"ENABLED"!==o&&"DISABLED"!==o||vn(this,a,"f").call(this,o);break;case"active-breakpoint":vn(this,t,"m",l).call(this,o,i)}}makeInteractivityUpdateHandler(e){gn(this,a,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,t,a){const i="true"===this.getAttribute("visible"),o=this.getAttribute("slotInstanceGuid");gn(this,n,(i=>{i&&(gn(this,n,(()=>null),"f"),0===e&&a.globalDispatch({type:Z,payload:{event:"Interactive"}}),t&&(a.globalDispatch({type:Y,payload:{name:"SignalImpression",parentGuid:t}}),this.trackViewability(t,a)),o&&a.globalDispatch({type:Y,payload:{name:"SignalImpression",parentGuid:o}}))}),"f"),vn(this,n,"f").call(this,i)}trackViewability(e,t){vn(this,o,"f")||("IntersectionObserver"in window&&!vn(this,r,"f")?(gn(this,r,new IntersectionObserver((n=>{n.forEach((n=>{n.isIntersecting&&n.intersectionRatio>=.5?vn(this,s,"f")||gn(this,s,window.setTimeout((()=>{t.globalDispatch({type:Y,payload:{name:"SignalViewed",parentGuid:e,objectData:{supportedByBrowser:!0}}}),gn(this,o,!0,"f"),vn(this,r,"f")&&(vn(this,r,"f").disconnect(),gn(this,r,null,"f"))}),1e3),"f"):vn(this,s,"f")&&(clearTimeout(vn(this,s,"f")),gn(this,s,null,"f"))}))}),{threshold:.5}),"f"),vn(this,r,"f").observe(vn(this,i,"f"))):(t.globalDispatch({type:Y,payload:{name:"SignalViewed",parentGuid:e,objectData:{supportedByBrowser:!1}}}),gn(this,o,!0,"f")))}getOfferPositionAttr(){const e=this.getAttribute("offerPositionIndex"),t=Number(e);return(null==e||isNaN(t)||t<0)&&f(`Offer position attribute (${e}) is invalid`),t}getJSONAttr(e,t="{}"){const n=this.getAttribute(e);try{return JSON.parse(null!=n?n:t)}catch(t){f(`Invalid JSON attribute ${e}: ${n}`)}}disconnectedCallback(){vn(this,r,"f")&&(vn(this,r,"f").disconnect(),gn(this,r,null,"f")),vn(this,s,"f")&&(clearTimeout(vn(this,s,"f")),gn(this,s,null,"f"))}connectedCallback(){var e,t,n;const a=this.getAttribute("container"),o=this.getAttribute("plugin-id");vn(this,i,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===a?"column":"row"));const r=this.getOfferPositionAttr(),s=this.getJSONAttr("layoutSchema"),l=this.getJSONAttr("childLayouts","[]"),c=this.getJSONAttr("offerData"),y=new mn("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),h=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"";d||f("Cannot create app without factory. Please build the connector withAppFactory.");const m=p({offerPositionIndex:r,creativeInstanceGuid:null===(t=null==c?void 0:c.creative)||void 0===t?void 0:t.instanceGuid},y);this.makeInteractivityUpdateHandler(y),d({rootElement:vn(this,i,"f"),gateway:m,logger:u,offerPositionIndex:r,offerData:c,layoutSchema:s,childLayouts:l,schemaVersion:h,pluginId:o||O.pluginId}),this.makeVisbilityUpdateHandler(r,null===(n=null==c?void 0:c.creative)||void 0===n?void 0:n.instanceGuid,m)}},n=new WeakMap,a=new WeakMap,i=new WeakMap,o=new WeakMap,r=new WeakMap,s=new WeakMap,t=new WeakSet,l=function(e,t){vn(this,i,"f").classList.remove(t||bn),vn(this,i,"f").classList.add(e||bn)},c;function f(e){throw u({level:R,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const In=t.createContext({get:()=>new un}),xn=e=>t.createElement(In.Provider,{value:{get:()=>e.context}},e.children);const Sn=t.createContext({get(){throw Error("Layout Schema context has not been set")}}),wn=e=>t.createElement(Sn.Provider,{value:{get:()=>e.context}},e.children),Cn=()=>t.useContext(Sn).get(),On=t.createContext("ENABLED"),Tn=()=>t.useContext(On);function An(e){const t=jn(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:jn(t,this.dataMap)});if(!n)throw new L("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");const a=t;return i.path([n,a],this.dataMap)}.bind({dataMap:t})}const Rn={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function jn(e,t=Rn){return["images","links","icons","copy","responseOptionsMap"].reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Object.assign(Object.assign({},t[n]),e[n])})),t)}const Ln=t.createContext(An({}));Ln.Consumer;const Nn=Ln.Provider,_n=()=>t.useContext(Ln),Dn=t.createContext({});function kn({info:e,children:n}){const a=t.useContext(Dn);return t.createElement(Dn.Provider,{value:Object.assign(Object.assign({},a),e)},n)}const Pn=t.createContext({get(){throw Error("Catalog Item context has not been set")}}),$n=e=>t.createElement(Pn.Provider,{value:{get:()=>e.context}},e.children),Gn=()=>t.useContext(Pn).get(),Fn=t.createContext(""),Mn=()=>t.useContext(Fn),Bn=t.createContext(""),Un=i.compose(i.anyPass([i.isEmpty,i.all(i.isEmpty)]),i.flatten,i.map(i.values),i.map(i.ifElse(i.isNil,i.always({}),i.identity)),i.values,i.propOr({},"value")),Vn=i.compose(i.isEmpty,i.prop("predicates"));function zn(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const qn=i.curry(((e,{duration:t,predicates:n,styles:a})=>{return{predicates:n,classname:e(ot(a)),transitionBaseClassname:e(zn(t,(o=a,i.toPairs(o).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?i.keys(n).map((e=>ve(t,e))):[]})))))};var o})),Hn=i.anyPass([Un,Vn]);const Wn={is:i.equals,"is-not":i.compose(i.not,i.equals),"is-below":i.lt,"is-above":i.gt};function Jn(e,t){return e.includes(t)}const Kn={is:i.equals,"is-not":i.compose(i.not,i.equals),exists:Jn,"not-exists":i.compose(i.not,Jn)},Yn={exists:i.compose(i.not,i.either(i.isNil,i.isEmpty)),"not-exists":i.either(i.isNil,i.isEmpty)},Zn={"is-true":i.equals(!0),"is-false":i.equals(!1)},Qn={is:i.equals,"is-not":i.compose(i.not,i.equals)};function Xn(e){return(t,n)=>n[e]}const ea=i.cond([[(e,t)=>i.equals("Breakpoint",e),Xn("activeBreakpoint")],[(e,t)=>i.equals("Progression",e),Xn("progressionIndex")],[(e,t)=>i.equals("Position",e),Xn("positionIndex")]]);function ta(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const na=i.cond([[i.equals("Breakpoint"),(e,t,n)=>{const a=i.lensPath(["breakpoints",t]);return i.pipe(i.over(a,Number),i.view(a))(n)}],[i.equals("Progression"),(e,t,n)=>i.cond([[i.gt(0),i.add(n.totalGroups)],[i.lte(0),i.identity]])(Number(t))],[i.equals("Position"),(e,t,n)=>i.cond([[i.gt(0),i.add(n.totalOffers)],[i.lte(0),i.identity]])(Number(t))]]),aa=i.compose(i.not,isNaN);function ia(e,t){return e.map((e=>{var n,a,i;switch(e.type){case"StaticString":return(0,Qn[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,Yn[e.predicate.condition])(ta(t,e.predicate.value));case"StaticBoolean":return(0,Zn[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,Wn[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,Wn[e.predicate.condition])(null!==(a=t.domainStates[e.predicate.key])&&void 0!==a?a:0,e.predicate.value);case"DarkMode":throw new Error("DarkMode has not yet been implemented.");case"Placeholder":return function(e){switch(e.predicate.type){case"TextValue":return(0,Kn[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,Wn[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"Numeric":return(0,Wn[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=Wn[e.predicate.condition],a=null!==(i=ea(e.type,t))&&void 0!==i?i:NaN,o=na(e.type,e.predicate.value,t);return!!aa(a)&&n(a,o)}}}))}function oa(e){return i.pathOr(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const ra={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{}};function sa(e,t,n,a){const o=t.map((e=>"Progression"===e.type?Object.assign(Object.assign({},e),{type:a?"Position":e.type}):e)),{cached:r,uncached:s}=o.reduce(((t,a)=>function(e,t,n,a){const o=function(e,t){switch(e.type){case"Position":case"StaticBoolean":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:static-state`;case"StaticString":return`${e.type}:${e.predicate.input}:${e.predicate.condition}:${e.predicate.value}:static-state`;case"CreativeCopy":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${ta(t,e.predicate.value)}:${t.totalGroups}`;case"CustomState":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${e.predicate.key}:${t.customStates[e.predicate.key]}`;case"DomainState":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${e.predicate.key}:${t.domainStates[e.predicate.key]}`;case"Placeholder":return`${e.type}:${e.predicate.type}:${e.predicate.content.condition}:data:${e.predicate.content.input}:${e.predicate.content.value}`;default:return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${ea(e.type,t)}:${t.totalGroups}`}}(e,t),r=n.current.get(o);return i.evolve(la(r)?{cached:i.append(r)}:{uncached:i.append({key:o,predicate:e})},a)}(a,n,e,t)),{cached:[],uncached:[]}),l=ia(s.map((({predicate:e})=>e)),n);return i.zip(s,l).forEach((([{key:t},n])=>{e.current.set(t,n)})),r.concat(l)}const la=i.is(Boolean);const ca=i.curry(((e,t,n)=>{var a,i,o,r,s,l;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:oa(n),progressionIndex:null!==(i=null===(a=n.progression)||void 0===a?void 0:a.activeGroupIndex)&&void 0!==i?i:0,totalOffers:null!==(r=null===(o=n.progression)||void 0===o?void 0:o.totalOffers)&&void 0!==r?r:0,totalGroups:null!==(l=null===(s=n.progression)||void 0===s?void 0:s.totalGroups)&&void 0!==l?l:0,customStates:n.customStates,domainStates:n.domainStates,positionIndex:e,creativeCopy:t}})),da=i.lensPath(["predicate","content","input"]),ua=i.lensPath(["predicate","content","value"]);function pa(e,t){const n=i.over(da,(t=>t?e(t):"")),a=i.over(ua,(t=>"string"==typeof t?e(t):t)),o=i.compose(n,a);return t.map((e=>"Placeholder"===e.type?"TextValue"===e.predicate.type?o(e):n(e):e))}const fa=i.all(i.equals(!0));function ya(e){const n=Zt(),a=Xt(),o=t.useRef(new Map),r=Tt(),s=vt(ra,ca(a,r)),l=Wt();return t.useMemo((()=>i.mapObjIndexed((e=>{const t=pa(l,e);return fa(sa(o,t,s,n))}),e)),[o,e,s,n,l])}function ha(e){e&&(e.style.display="")}function ma(e){e&&(e.style.display="none")}function va(e){return e.settings.duration}const ga=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],ba=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function Ea(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const a=t?ga:ba,i=e.animate(a,{duration:n,iterations:1});return i.onfinish=()=>{t?ha(e):ma(e)},i.oncancel=()=>{t?ha(e):ma(e)},()=>{i.finish()}}return t?ha(e):ma(e),()=>{}}function Ia({inTransitions:e,outTransitions:n,visible:a,children:i,containerClassName:o}){const r=t.useRef(null);return t.useEffect((()=>a&&e?e.forEach((e=>{r.current&&function(e,t,n,a){if("FadeIn"===a)Ea(e,t,n)}(r.current,a,va(e),e.type)})):!a&&n?n.forEach((e=>{r.current&&function(e,t,n,a){if("FadeOut"===a)Ea(e,t,n)}(r.current,a,va(e),e.type)})):()=>{}),[a]),t.createElement("div",{ref:r,style:{display:"none"},className:o},i)}function xa(e){const n=Et(),a=function(e){const n=Zt(),a=Xt(),i=t.useRef(new Map),o=Tt(),r=vt(ra,ca(a,o)),s=pa(Wt(),e);return t.useMemo((()=>fa(sa(i,s,r,n))),[i,s,r,n])}(e.schema.predicates),i=t.Children.toArray(e.schema.children.map(((t,a)=>n(t,void 0,e.testId?`${e.testId}-child${a}`:void 0))));return e.schema.transition?t.createElement(Ia,{inTransitions:e.schema.transition.inTransition,outTransitions:e.schema.transition.outTransition,visible:a},i):"functionally"===e.schema.hide?t.createElement(On.Provider,{value:a?"ENABLED":"DISABLED"},i):a?t.createElement(t.Fragment,null,i):null}const Sa=i.mergeWith(((e,t)=>`${e||""} ${t||""}`.trim())),wa=e=>{var n;const a=t.useContext(Jt),o=Xt(),r=St()||document.head,s=Mn(),l=ct(s,o,r),c=t.useCallback(ut,[]),d=vt([],(e=>Object.values(e.breakpoint.breakpoints))),u=a||c(d,s,o,r),p=e.styles?u(e.styles):{},f=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=qn(e);return i.mapObjIndexed((e=>Hn(t)||!e?null:n({predicates:t.predicates,duration:t.duration,styles:e})),t.value)}(l,null===(n=e.styles)||void 0===n?void 0:n.conditionalTransitions):void 0,y=ya(f?i.mapObjIndexed(i.propOr([],"predicates"),f):{}),h=i.mapObjIndexed(((e,t)=>e?function(e,t){var n;if(e&&t in e)return null===(n=e[t])||void 0===n?void 0:n.classname}(f,t):void 0),y),m=f?i.mapObjIndexed(i.prop("transitionBaseClassname"),f):{},v=e.styles?(g=m,Sa(Sa(p,h),g)):void 0;var g;return e.children({classnames:v,mapperRef:u})};function Ca(e){const n=Et();return t.createElement(wa,{styles:e.schema.styles},(({classnames:a})=>{var i;return t.createElement("div",{className:a?a.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},t.Children.toArray(e.schema.children.map(((t,a)=>n(t,void 0,U(a,e.testId))))))}))}function Oa(e){const n=Et();return t.createElement(wa,{styles:e.schema.styles},(({classnames:a})=>{var i;return t.createElement("div",{className:a?a.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},t.Children.toArray(e.schema.children.map(((t,a)=>n(t,void 0,U(a,e.testId))))))}))}const Ta={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",se,le],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},Aa=new Map([["&","_;^;_"]]),Ra=new RegExp(`<a *(?=${Ta.allowedAttributes.a.join("|")}|>)`,"g"),ja=new RegExp('<a [^>]*href="([^"]+)"',"g"),La=new RegExp("(<br *?>)|(<br *?/>)","g"),Na="<br/>";function _a(e){const n=Wt(),a=Tn(),i=t.useMemo((()=>{const t=n(e.schema.value);if(!function(e){const t=function(e){return e.replaceAll(ja,((e,t)=>{const n=t.replaceAll("&",Aa.get("&"));return e.replace(t,n)})).replaceAll(La,Na)}(e);return t===u(t,Ta)}(t))throw new L("FAILED_SANITISING_HTML","Invalid HTML tags");return t.trim()?t:""}),[e.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=m(a);return i?t.createElement(wa,{styles:e.schema.styles},(({classnames:n})=>{const a=[(null==n?void 0:n.link)?`class = "${null==n?void 0:n.link}"`:"",s?'tabindex="-1"':"",s?"style=\"pointer-events: 'none'; user-select: none;\"":"",s?'aria-disabled="true"':""].filter((e=>e.length>0));return l=i,new RegExp("</(p|ul|ol)>").test(l)?t.createElement("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(Ra,`<a ${a.join(" ")}`)}}):t.createElement("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(Ra,`<a ${a.join(" ")}`)}});var l})):null}function Da(e){const n=Wt()(e.schema.value),a=Tn(),{tabIndex:i,styles:o,isDisabled:r}=m(a);return n?t.createElement(wa,{styles:e.schema.styles},(({classnames:a})=>{const s={tabIndex:i,"aria-hidden":r,className:null==a?void 0:a.own,"data-testid":e.testId,"data-e2e":"BasicText"};return e.isInline?t.createElement("span",Object.assign({style:o},s),n):t.createElement("p",Object.assign({style:o},s),n)})):null}function ka(e,n,a){if("BasicText"===e.type)return t.createElement(Da,{schema:e.node,testId:n,isInline:null!=a&&a})}function Pa(e,n,a){return t.Children.toArray(e.map(((e,t)=>n(e,void 0,U(t,a)))))}function $a(e){const n=ht(),a=Et(),i=Ot(),o=Wt(),r=Xt(),s=Tn(),l=i.creative.responseOptionsMap[e.schema.responseKey],c=S(l);t.useEffect((()=>{c&&n(function(e){if(e.externalKey)return{type:te,payload:{criteria:{key:e.externalKey},signal:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:e.action,externalKey:e.externalKey}}}};throw new Error(`Invalid External Response: No 'externalKey' found for external response option with instanceGuid: ${e.instanceGuid}`)}(l))}),[l,n,c]);const d=l?o({data:l},"creativeResponse"):o,{tabIndex:u,styles:p,isDisabled:f}=m(s);return E(l)&&!c&&void 0!==r?t.createElement(wa,{styles:e.schema.styles},(({classnames:o,mapperRef:r})=>{var s;return t.createElement("button",{type:"button",tabIndex:u,"aria-disabled":f,"aria-label":null!==(s=e.schema.a11yLabel)&&void 0!==s?s:void 0,style:Object.assign({cursor:"pointer"},p),"data-testid":e.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":e.schema.responseKey,onClick:e=>{e.preventDefault();const t=function(e,t){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(b(n))return{fulfillment:n,responseOption:t,creativeInstanceGuid:e.creative.instanceGuid,accountID:e.accountId,referralCreativeID:e.creative.referralCreativeId};throw new Error(`Invalid Fulfillment: ${n} with referralCreativeID: ${e.creative.referralCreativeId}`)}case"Url":return Object.assign(Object.assign({},t),{accountID:e.accountId,creativeInstanceGuid:e.creative.instanceGuid,referralCreativeID:e.creative.referralCreativeId});default:return Object.assign(Object.assign({},t),{creativeInstanceGuid:e.creative.instanceGuid})}}(i,l);n({type:z,payload:t})},className:null==o?void 0:o.own,disabled:f},t.createElement(Ht,{value:d},(null==o?void 0:o.own)?function(e,n,a,i,o){return t.createElement(Kt,{value:a(n)},Pa(e,i,o))}(e.schema.children,o.own,r,a,e.testId):Pa(e.schema.children,a,e.testId)))})):null}function Ga(e){const n=Tn(),{styles:a,isDisabled:i}=m(n);return e.schema.url.light?t.createElement(wa,{styles:h(e.schema.styles)},(({classnames:n})=>t.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},a),{display:"inline-block"}),alt:i?void 0:e.schema.alt||void 0,title:e.schema.title||void 0,className:n?n.own:void 0,"data-testid":e.testId,"data-e2e":"StaticImage",src:e.schema.url.light}))):null}function Fa(e){const n=Tn(),{styles:a,isDisabled:i}=m(n),o=(e=>{const n=t.useContext(Ln),a=e.split("|");for(const e of a){const t=n(e.trim(),"images");if(t)return t}})(e.schema.imageKey);return null!=(r=o)&&"object"==typeof r&&"light"in r&&"string"==typeof r.light?t.createElement(wa,{styles:h(e.schema.styles)},(({classnames:n})=>t.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},a),{display:"inline-block"}),alt:o.alt,title:o.title,className:n?n.own:void 0,"data-testid":e.testId,"data-e2e":"DataImage",src:o.light}))):null;var r}const Ma={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Ba(e){const n=e.schema.name,a=e.schema.description,i=e.schema.styles?M(Ma,e.schema.styles):Ma,o=Tn(),{styles:r,isDisabled:s}=m(o);return n?t.createElement(wa,{styles:i},(({classnames:i})=>t.createElement("span",Object.assign({style:Object.assign(Object.assign({},r),{display:"inline-block"}),className:"rokt-icon"+((null==i?void 0:i.own)?" "+i.own:""),"data-testid":e.testId,"data-e2e":`StaticIcon-${n}`},!s&&a?{title:a}:{"aria-hidden":"true"}),n))):null}const Ua={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class Va extends t.Component{constructor(e){super(e),this.state={errorMessage:""}}static getDerivedStateFromError(e){return{errorMessage:e.message}}componentDidUpdate(e){this.state.errorMessage&&JSON.stringify(e.schema)!==JSON.stringify(this.props.schema)&&this.setState({errorMessage:""})}componentDidCatch(e,t){var n;this.props.reporter&&"true"===pe.REPORT_RENDER_ERRORS&&this.props.reporter({level:R,code:null!==(n=e.code)&&void 0!==n?n:"UNHANDLED_RENDERING_EXCEPTION",message:e.message,additionalInformation:Object.assign({componentStack:t.componentStack,stack:e.stack},this.context||{})})}render(){return this.state.errorMessage?"true"===pe.DISPLAY_ERRORS?t.createElement("pre",{style:Ua},t.createElement("strong",null,"Error:")," [",t.createElement("em",null,this.props.schema.type),"]"," ",this.state.errorMessage):void 0:this.props.children}}Va.contextType=Dn;const za={internally:"_top",externally:"_blank"};function qa(e,n,a){return t.Children.toArray(e.map(((e,t)=>n(e,void 0,a?`${a}-child${t}`:void 0))))}function Ha(e){var n;const a=za[e.schema.open],i=Et(),o=Tn(),{tabIndex:r,styles:s,isDisabled:l}=m(o);return(null===(n=e.schema.children)||void 0===n?void 0:n.length)>0?t.createElement(wa,{styles:e.schema.styles},(({classnames:n,mapperRef:o})=>{var c;return t.createElement("a",{href:e.schema.src,"data-testid":e.testId,"data-e2e":"StaticLink",target:null!=a?a:"_blank",tabIndex:r,"aria-disabled":l,"aria-label":null!==(c=e.schema.a11yLabel)&&void 0!==c?c:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:e.isInline?"inline":"block"},s),className:null==n?void 0:n.own},(null==n?void 0:n.own)?function(e,n,a,i,o){return t.createElement(Kt,{value:a(n)},qa(e,i,o))}(e.schema.children,null==n?void 0:n.own,o,i,e.testId):qa(e.schema.children,i,e.testId))})):null}function Wa(e,n,a){if("StaticLink"===e.type)return t.createElement(Ha,{schema:e.node,testId:n,isInline:null!=a&&a})}const Ja={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Ka(e){const n=(a=e.schema.iconKey,t.useContext(Ln)(a,"icons"));var a;const i=null==n?void 0:n.name,o=e.schema.styles?M(Ja,e.schema.styles):Ja,r=Tn(),{styles:s}=m(r);return i?t.createElement(wa,{styles:o},(({classnames:n})=>t.createElement("span",{style:Object.assign(Object.assign({},s),{display:"inline-block"}),"aria-hidden":"true",className:"rokt-icon"+((null==n?void 0:n.own)?" "+n.own:""),"data-testid":e.testId,"data-e2e":`DataIcon-${i}`},i))):null}const Ya=o.css`
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom/client"),a=require("react-redux"),i=require("ramda"),o=require("@emotion/css"),r=require("redux-saga/effects"),s=require("@reduxjs/toolkit"),l=require("redux-saga"),c=require("@redux-saga/core/effects"),d=require("embla-carousel-react"),u=require("insane"),p=require("@emotion/css/create-instance");function f(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var y=f(t);function h(e){const t=["elements","own"],n=["default","dimension","width","type"],a=["default","dimension","width","value"],o=["default","dimension","minWidth"],r=i.path(t,e);return r&&Array.isArray(r)&&r.length?i.assocPath(t,r.map(i.when(i.allPass([i.hasPath(n),i.complement(i.hasPath(o)),i.pathEq("fixed",n)]),(e=>i.assocPath(o,i.path(a,e),e)))),e):e}function m(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function v(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function g(){return"ontouchstart"in document.documentElement}function b(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function E(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function I(e){return E(e)&&"Fulfillment"===e.action}function x(e){return E(e)&&"Url"===e.action}function S(e){return E(e)&&"External"===e.action}function w(e){return(I(e)||x(e))&&"RealTime"===e.conversionType&&"rclid"in e}function C(e={}){return Object.assign({light:"https://plus.unsplash.com/premium_photo-1675826774817-fe983ceb0475?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=200&q=80",dark:"https://images.unsplash.com/photo-1679941734238-56628f5991f7?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=200&q=80"},e)}const O={pluginId:"shared",pageInstanceGuid:"N/A"};var T;!function(e){e.DCUI="DCUI",e.Partner="partner"}(T||(T={}));const A=["SignalCartItemQuantitySelected"],R="ERROR",j="WARNING";class L extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const N=["V2_CART_ITEM_UPDATED","CART_ITEM_INSTANT_PURCHASE","OFFER_ENGAGEMENT","POSITIVE_ENGAGEMENT","UPSELL_CREATIVE_SENT","REALTIME_OFFER_FULFILLMENT_REFERRAL","REALTIME_OFFER_FULFILLMENT_CONVERSION","REALTIME_OFFER_FULFILLMENT_SUCCESS","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];const _=(e,t)=>i.concat(e,i.slice(e.length,t.length,t)),D=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?_(t,e):t,a=t.length>e.length?_(e,t):e;return i.zipWith(F,a,n)}return t},k=e=>null==e,P=e=>!k(e),$=(e,t)=>k(t)?e:t,G=(e,t)=>{throw new L("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function F(e,t){return i.cond([[(e,t)=>i.type(e)!==i.type(t)&&P(e)&&P(t),G],[(e,t)=>k(e)||k(t),$],[(e,t)=>"Object"===i.type(e),i.mergeDeepWith(F)],[(e,t)=>"Array"===i.type(e),D],[i.T,i.flip(i.unary(i.identity))]])(e,t)}function M(e,t){return F(e,t)}function B(e=0){return`breakpoint-${e}px`}function U(e,t){return t?`${t}-child${e}`:void 0}const V="GLOBAL/RAISE_METRIC",z="GLOBAL/OFFER_ENGAGEMENT";function q(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&I(e.responseOption)&&"fulfillment"in e&&b(e.fulfillment)}function H(e){return S(e)}function W(e){return x(e)}function J(e){return function(e){return E(e)&&"CaptureOnly"===e.action}(e)}function K(e){return!!(w(e)||"responseOption"in e&&w(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}const Y="GLOBAL/RAISE_SIGNAL",Z="GLOBAL/OFFER_LIFECYCLE",Q="GLOBAL/SET_CUSTOM_STATE",X="GLOBAL/SEND_PARTNER",ee="GLOBAL/SET_DOMAIN_STATE",te="GLOBAL/PREPARE_SIGNAL",ne="GLOBAL/OPEN_LINK",ae="GLOBAL/SET_PARTNER_VALIDATION_STATUS",ie="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",oe="GLOBAL/LAUNCH_CHILD_LAYOUT",re={RAISE_METRIC:V,PREPARE_SIGNAL:te,OFFER_ENGAGEMENT:z,RAISE_SIGNAL:Y,OFFER_LIFECYCLE:Z,SEND_PARTNER:X,SET_CUSTOM_STATE:Q,SET_DOMAIN_STATE:ee,OPEN_LINK:ne,SET_PARTNER_VALIDATION_STATUS:ae,SET_GLOBAL_OFFER_DATA_CART:ie,LAUNCH_CHILD_LAYOUT:oe},se="data-open-in-app",le="data-click-signal-context";function ce(e,n){function a(e){var t;if(!(e.target&&e.target instanceof HTMLElement))return;const a=null===(t=e.target)||void 0===t?void 0:t.closest("a");if(a){const t=a.getAttribute("href"),i=a.getAttribute(le);if(i&&n({type:Y,payload:{name:"SignalUserInteraction",action:"Click",context:i}}),t){e.preventDefault();let i="newTab";a.hasAttribute(se)&&(i="inApp"),n({type:ne,payload:{url:t,urlBehaviour:i}})}}}t.useEffect((()=>null!==e?(e.addEventListener("click",a),()=>{e.removeEventListener("click",a)}):()=>{}),[e])}function de(){const e=t.useRef(null);return t.useEffect((()=>{const t=t=>{"Tab"===t.key&&ue(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const ue=(e,t)=>{var n;const a=null===(n=t.current)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!a)return;const i=a[0],o=a[a.length-1],{activeElement:r}=window.document;if(1!==a.length)return r===i&&e.shiftKey?(o&&o.focus(),void e.preventDefault()):r!==o||e.shiftKey?void 0:(i&&i.focus(),void e.preventDefault());e.preventDefault()},pe="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function fe(e,t){return t?"false"!==pe.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${B(e)} ${t.trim()}`:`#app-container.${B(e)} & {${t}}`:"";var n}const ye={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"};function he(e){return function(e){return Object.keys(ye).indexOf(e)>-1}(e)?ye[e]:""}const me={container:{justifyContent:"justify-content",alignItems:"align-items",shadow:"box-shadow",gap:"gap",overflow:"overflow",blur:"filter",opacity:"opacity"},text:{textColor:"color",fontSize:"font-size",fontFamily:"font-family",fontWeight:"font-weight",fontStyle:"font-style",lineHeight:"line-height",lineLimit:"",letterSpacing:"letter-spacing",baselineTextAlign:"vertical-align",horizontalTextAlign:"text-align",textDecoration:"text-decoration",textTransform:"text-transform"},background:{backgroundColor:"background-color",backgroundImage:""},dimension:{width:"width",maxWidth:"max-width",minWidth:"min-width",height:"height",maxHeight:"max-height",minHeight:"min-height",rotateZ:"transform"},flexChild:{alignSelf:"align-self",weight:"flex",order:"order"},spacing:{margin:"margin",padding:"padding",offset:""},border:{borderColor:"border-color",borderRadius:"border-radius",borderWidth:"border-width",borderStyle:"border-style"}};function ve(e,t){if(!me[e]||!me[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return me[e][t]}function ge(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function be(...e){let t="";const n=(...e)=>e.reduce(((e,n)=>(e&&n?e=e+t+n:n&&(e=n),e)),"");return 1===e.length?(t=e[0],n):n(...e)}function Ee(e,t){return`${e}:${t};`}function Ie(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class xe extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function Se(e,t){if(null===t)return!1;const n=("function"==typeof e?[e]:e).map((e=>e(t))).reduce(((e,t)=>t?e?e+=`, ${t}`:t:e),void 0);if(n)throw new xe(n,JSON.stringify(t));return!0}function we(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function Ce(e){return t=>{const n=t&&"symbol"!=typeof t?t.toString():t;if(!(e.indexOf(n)>=0))return`value must be one of [${e.join(",")}]`}}function Oe(e){if(null==e||""===e)return"value must not be omitted"}function Te(e){const t=new RegExp(/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{3})$/);if("string"!=typeof e||!t.test(e))return"value must be a valid hex color"}function Ae(e){const t=new RegExp(/^(?:(?:data:image\/[^;]+;base64[^"]+)|(?:(?:https?:)?\/\/[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)*(?::\d{1,10})?)?(?:\.\.?\/?)*\/(?:[a-zA-Z\d\-_]+\/)*[a-zA-Z\d\-_]+\.[a-zA-Z\d]{2,6}(?:\?(?:.+=.+&?)*)?)(?:#.+)?$/);if("string"!=typeof e||!t.test(e))return"value must be a valid CSS URL string"}function Re(e){if(null!=e&&""!==e)return"value must not be specified"}function je(e){return t=>{if(t&&"object"==typeof t&&"value"in t&&"type"in t&&"string"==typeof t.type&&function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}(e,t.type)&&"function"==typeof e[t.type]){const n=e[t.type](t.value);if(!n)return;return`object must have valid "value" for type: ${t.type}: ${n}`}return`value must be an object that has a "type" property that matches one of: [${Object.keys(e).join(", ")}] and a "value" property`}}function Le(...e){return t=>{if("string"==typeof t){const n=t.split(" ");if(n.length>1&&e.indexOf(n.length)>-1){if(!n.reduce(((e,t)=>e||we(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function Ne(e,t){return n=>{const a=e(n),i=t(n);if(a&&i)return`one of these must be true: ${a} -OR- ${i}`}}function _e(e){if("string"!=typeof e)return"value must be a string"}const De=i.is(Object);function ke(e){const t=Object.entries(e);return n=>De(n)&&!Array.isArray(n)?t.reduce(((e,[t,a])=>e||a(n[t])),void 0):`Input value (${e}) must be an object`}function Pe(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function $e(e,t,n){return Se(we,n)?Ee(ve(e,t),`${n}`):""}function Ge(e){return(t,n,a)=>Se(Ce(Object.keys(e)),a)?Ee(ve(t,n),`${e[a]}`):""}function Fe(e){return Se(Oe,e)?ge({light:t(Ae,!1),dark:t(Ne(Re,Ae),!0)},be("\n "))(e):"";function t(e,t){return n=>{if(Se(e,n)&&n){const e=Ee("background-image",`url("${n}")`);return t?Ie(e):e}return""}}}function Me(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),Se(Ne(Re,Ce(Object.keys(t))),e)&&e?Ee("background-size",t[e]):""}const Be=i.cond([[i.equals("top-left"),i.always("top left")],[i.equals("top-right"),i.always("top right")],[i.equals("bottom-left"),i.always("bottom left")],[i.equals("bottom-right"),i.always("bottom right")],[i.T,i.identity]]);function Ue(e){const t="string"==typeof e?e.toLowerCase():e;return Se(Ne(Re,Ce(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?Ee("background-position",Be(t)):""}function Ve(e,t,n){return Se(Ne(we,Le(2,3,4)),n)?Ee(ve(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function ze(e){return(t,n,a)=>Se(je({fit:Ce(e),percentage:we,fixed:we}),a)?Ee(ve(t,n),function(e){const t={"wrap-content":"fit-content","fit-width":"100%","fit-height":"100%"};switch(e.type){case"fixed":return`${e.value}px`;case"percentage":return`${e.value}%`;case"fit":return t[e.value]}}(a)):""}const qe=ke({light:Te,dark:Ne(Re,Te)});function He(e,t,n){return a=>{if(a){const i=Ee(ve(e,t),Je(String(a)));return n?Ie(i):i}return""}}function We(e,t,n){return Se(qe,n)?ge({light:He(e,t,!1),dark:He(e,t,!0)},be("\n "))(n):""}function Je(e){const t=e.toUpperCase();switch(t.length){case 5:return`#${t.substring(2,5)}${t[1]}`;case 9:return`#${t.substring(3,9)}${t[1]}${t[2]}`;default:return t.toUpperCase()}}const Ke=ke({offsetX:Ne(Re,we),offsetY:Ne(Re,we),blurRadius:Ne(Re,we),spreadRadius:Ne(Re,we),color:qe}),Ye=e=>t=>null!=t?String(t):e,Ze=i.compose(i.concat(i.__,"px"),Ye("0")),Qe=e=>t=>"string"==typeof t?e(t):t,Xe=i.compose(Qe(i.concat(i.__,"px")),Ye(void 0)),et=i.compose(Qe(Je),i.prop("dark"));function tt(e,t,n){return Ee(e,ge({offsetX:Ze,offsetY:Ze,blurRadius:t.spreadRadius?Ze:Xe,spreadRadius:Xe,color:n},be(" "))(t))}const nt={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},at={container:{justifyContent:Ge(nt),alignItems:Ge(nt),shadow:function(e,t,n){var a,o,r;if(Se(Ke,n)){const s=ve(e,t);return be("\n")(tt(s,n,(o="light",r="#80000000",i.compose(Je,i.propOr(r,o)))),(null===(a=n.color)||void 0===a?void 0:a.dark)?Ie(tt(s,n,et)):"")}return""},gap:Ve,overflow:Ge({hidden:"hidden",visible:"visible"}),blur:function(e,t,n){return Se(Pe,n)?Ee(ve(e,t),`blur(${n.toString()}px)`):""},opacity:$e},text:{textColor:We,fontSize:Ve,fontFamily:function(e,t,n){return Se(_e,n)?Ee(ve(e,t),(a=`${n}`,a.replace(/['();{}@:[\]!/=]/g,"")).split(",").map(((e,t)=>{const n=0===t?e:e.trim();if(n.includes(" ")){const e=n.startsWith('"')?"":'"',t=n.endsWith('"')?"":'"';return`${e}${n}${t}`}return n})).join(",")):"";var a},fontWeight:Ge({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:Ge({normal:"normal",italic:"italic"}),lineHeight:Ve,lineLimit:function(e,t,n){return Se(we,n)?`\n overflow: hidden;\n text-overflow: ellipsis;\n display: -webkit-box;\n -webkit-line-clamp: ${n};\n line-clamp: ${n}; \n -webkit-box-orient: vertical;\n `:""},letterSpacing:Ve,baselineTextAlign:Ge({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:Ge({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:Ge({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:Ge({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:We,backgroundImage:function(e,t,n){return Se(Oe,n)?ge({url:Fe,position:Ue,scale:Me},be)(n):""}},dimension:{width:ze(["wrap-content","fit-width"]),maxWidth:Ve,minWidth:Ve,height:ze(["wrap-content","fit-height"]),maxHeight:Ve,minHeight:Ve,rotateZ:(it="Z",(e,t,n)=>{const a=`rotate${it}`;return Se(we,n)?Ee(ve(e,t),`${a}(${n.toString()}deg)`):""})},flexChild:{alignSelf:Ge(nt),weight:$e,order:$e},spacing:{margin:Ve,padding:Ve,offset:function(e,t,n){return Se(Le(2),n)?`transform:translate(${n.split(" ").join("px, ")}px)`:""}},border:{borderColor:We,borderRadius:Ve,borderWidth:Ve,borderStyle:Ge({solid:"solid",dashed:"dashed"})}};var it;function ot(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((a=>{if(!at[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const i=at[n][a];if(!i)throw new Error(`No styling transformer exists for property: ${n}.${a.toString()}`);try{t+=i(n,a,e[n][a])}catch(e){throw e&&"object"==typeof e&&"message"in e&&(e.message=`Error parsing styling key ${n}.${a.toString()}: ${e.message}`),e}})),t)),"")}const rt="FAILED_TEMPLATING_DATA",st=new Map;function lt(e){return String.fromCharCode(97+e)}function ct(e,t,n){const a=`${e||O.pluginId}-${void 0!==t?String(t):"outer"}`,i=st.get(a);if(i&&i.sheet.container.isConnected)return i.css;const o=function(e,t){const n={key:void 0!==e?`inner-css-${lt(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),p(n)}(t,n);return st.set(a,o),o.css}const dt="%%%OWN_CLASS_REF%%%",ut=i.memoizeWith(((e,t,n,a)=>`${String(e)}-${t}-${n}`),pt);function pt(e,t,n,a){const i=ct(t,n,a);let o=1;return function t(n,a=!1){var r;if("string"==typeof n){const e={scopeClass:n};return t.bind(e)}const s=n,l=this.scopeClass,c=Object.entries(null!==(r=s.elements)&&void 0!==r?r:{});try{const t=c.reduce(((t,[n,i])=>Object.assign(Object.assign({},t),{[n]:ft(i,l,a,String(n),e)})),{}),n=Object.entries(t),r=a?"parent-"+o++:"",s=function(e){return"own"in e&&"string"==typeof e.own&&e.own.length>0}(t)?i(t.own):"";return n.reduce(((e,[t,n=""])=>{if("own"===t)return e;const a=n.replace(dt,r);return Object.assign(Object.assign({},e),{[t]:a?i(a):""})}),{own:`${s}${s&&r?" ":""}${r}`})}catch(e){const t=e;throw t.code="FAILED_PARSING_STYLES",t}}.bind({})}function ft(e,t,n,a,i){return e.map(function(e,t,n){return a=>Object.entries(a).map((([a,i])=>{const o=i?ot(i):"";switch(!0){case"default"===a:return o?`\n${o}\n`:"";case Boolean(e):return`\n .${e}${he(a)} & {\n${o}\n}\n`;case t&&"own"!==n:return`\n .${dt}${he(a)} & {\n${o}\n}\n`;default:return`\n &${he(a)} {\n${o}\n}\n`}})).join("")}(t,n,a)).reduce(((e,t,n)=>{const a=i[n];return void 0!==a?e+(0===n?t:`${fe(a,t)}\n`):e}),"")}const yt=t.createContext(i.always(void 0)),ht=()=>t.useContext(yt),mt=t.createContext(null);function vt(e,n){var a;const i=t.useContext(mt);return i&&null!==(a=n(i))&&void 0!==a?a:e}const gt=t.createContext((()=>{throw Error("Node Mapper Context does not have a mapper. Use the NodeMapperProvider with the default nodeMapper as a value before you consume this mapper")})),bt=gt.Consumer,Et=()=>t.useContext(gt),It=e=>t.createElement(gt.Provider,{value:(t,n,a)=>e.value(t,null!=n?n:e.overrides,a)},e.children),xt=t.createContext(null),St=()=>t.useContext(xt),wt=t.createContext({get(){throw Error("Offer context has not been set")}}),Ct=e=>t.createElement(wt.Provider,{value:{get:()=>e.context}},e.children),Ot=()=>t.useContext(wt).get(),Tt=()=>{try{return t.useContext(wt).get().creative.copy}catch(e){return}},At=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),Rt=i.compose(i.not,i.isEmpty),jt=i.where({url:Rt,title:Rt});function Lt(e,t,n){return t.reduce(((t,n)=>{const[a,i]=n.slice(0,-1).split("["),o=i?i.split(","):[];if(!a)throw new Error(_t(e,"This Meta Attribute could not be parsed."));return function(e,t,n,a){switch(t){case"openLinks":return function(e,t,n){Nt(t,e,"openLinks",1,2);const a=Dt(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),i=kt(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===a)return n.replace(At,((e,t)=>`<a ${se} ${i?`${le}="${i}" `:""}${t}`));return n}(e,n,a);case"sliceText":return function(e,t,n){Nt(t,e,"sliceText",2,2);const a=Dt(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),i=Dt(t,e,1,(e=>{const t=Number(e);return!Number.isNaN(t)&&t>=0?t:null}),"sliceText meta attribute second argument must be a positive number");if("Chars"===a)return function(e,t){const n=new RegExp("(?<=<a.*>).*(?=</a>)");return e.startsWith("<a")?e.replace(n,(e=>e.slice(0,t))):e.slice(0,t)}(n,i);throw Error(_t(e,`Unknown "SliceBy" value. ${a}`))}(e,n,a);default:throw new Error(_t(e,`Unknown Meta Attribute '${t}'.`))}}(e,a,o,t)}),n)}function Nt(e,t,n,a,i){const o=new Error(_t(t,`${n} meta attribute takes ${a!=i?`between ${a} and ${i}`:a} arguments; received ${e.length}.`));if(e.length<a||e.length>i)throw o}function _t(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function Dt(e,t,n,a,i){const o=kt(e,n,a);if(null!==o)return o;throw Error(_t(t,i||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function kt(e,t,n){return n(e[t])}const Pt="DATA",$t="STATE",Gt=new RegExp(`^(${Pt}|${$t})`),Ft=new RegExp(`^${$t}`),Mt=new RegExp(`%\\^(?:${Pt}|${$t})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*(?:\\:[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,]*\\])*(?:\\|.*?)?\\^%`,"g"),Bt=Symbol("invalid");function Ut(e,t="creativeCopy"){const n=Vt({data:e},t);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Vt(t,n,this.dataMap)});let a=!1;const o=t,r=i.pipe(i.slice(2,-2),i.split("|"),(e=>{const t=i.reduce(((e,t)=>{let n;if(Gt.test(t)){if(!this.dataMap.has(t)&&Ft.test(t))throw new L(rt,`Invalid use of STATE template key in a context it does not exist: ${t}`);const a=i.split(":",t);if(a[0]){if(n=this.dataMap.get(a[0]),n&&n===Bt)throw new L(rt,`Invalid template key referenced: "${t}" is an object but expected a string, boolean, number or empty. \nDid you mean to reference a child property of ${t}?`);if(a.length>1&&n)try{n=Lt(a[0],a.slice(1),n)}catch(e){throw new L(rt,`Failed to apply meta attributes. ${function(e){return null!=e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message?e.message:String(e)}(e)}`)}}return n?i.reduced({provided:!0,value:n}):e}return i.reduced({provided:!0,value:t})}),{provided:!1,value:""},e);return t.provided||(a=!0),t.value})),s=i.replace(Mt,r,o);return!1===a?s:""}.bind({dataMap:n})}function Vt(e,t,n){const a=new Map(n);return"data"in e&&o(e.data,`${Pt}${t?"."+t:""}`),"state"in e&&o(e.state,`${$t}${t?"."+t:""}`),a;function o(e,t){"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e?a.set(t,(null==e?void 0:e.toString())||""):a.set(t,Bt),e&&"object"==typeof e&&i.forEachObjIndexed(((e,n)=>o(e,`${t}.${n}`)),e)}}const zt=t.createContext(Ut({})),qt=zt.Consumer,Ht=zt.Provider,Wt=()=>t.useContext(zt),Jt=t.createContext(null),Kt=Jt.Provider,Yt=t.createContext("OUTER"),Zt=()=>"VARIANT"===t.useContext(Yt),Qt=t.createContext(void 0),Xt=()=>t.useContext(Qt);var en,tn,nn,an,on,rn,sn=function(e,t,n,a){return new(n||(n=Promise))((function(i,o){function r(e){try{l(a.next(e))}catch(e){o(e)}}function s(e){try{l(a.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((a=a.apply(e,t||[])).next())}))},ln=function(e,t,n,a,i){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?i.call(e,n):i?i.value=n:t.set(e,n),n},cn=function(e,t,n,a){if("a"===n&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?a:"a"===n?a.call(e):a?a.value:t.get(e)};class dn{constructor(e,t,n,a,o){en.set(this,void 0),tn.set(this,void 0),nn.set(this,new Set),an.set(this,void 0),on.set(this,void 0),rn.set(this,void 0),ln(this,en,i.partial(e.subscribe.bind(e),[n]),"f"),ln(this,tn,i.partial(e.dispatch.bind(e),[n]),"f"),ln(this,an,t,"f"),ln(this,on,a,"f"),ln(this,rn,o,"f"),this.onGlobalStateChange=this.onGlobalStateChange.bind(this),this.onInteractivityChange=this.onInteractivityChange.bind(this),this.onEvent=this.onEvent.bind(this),this.globalDispatch=this.globalDispatch.bind(this),this.createChildPlugin=this.createChildPlugin.bind(this)}onGlobalStateChange(e){const t=cn(this,en,"f").call(this,e),n=()=>{t(),cn(this,nn,"f").delete(n)};return cn(this,nn,"f").add(n),n}onInteractivityChange(e){return cn(this,on,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=cn(this,rn,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),cn(this,nn,"f").delete(n)};return cn(this,nn,"f").add(n),n}globalDispatch(e){cn(this,tn,"f").call(this,e)}dispose(){cn(this,nn,"f").forEach((e=>e())),ln(this,nn,new Set,"f"),cn(this,on,"f").clear()}createChildPlugin(e){return cn(this,an,"f").call(this,e)}}en=new WeakMap,tn=new WeakMap,nn=new WeakMap,an=new WeakMap,on=new WeakMap,rn=new WeakMap;class un{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>sn(this,void 0,void 0,(function*(){})),onClose:()=>sn(this,void 0,void 0,(function*(){})),putConfig:()=>sn(this,void 0,void 0,(function*(){})),send:()=>sn(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var pn,fn,yn=function(e,t,n,a,i){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?i.call(e,n):i?i.value=n:t.set(e,n),n},hn=function(e,t,n,a){if("a"===n&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?a:"a"===n?a.call(e):a?a.value:t.get(e)};class mn{constructor(e){pn.set(this,void 0),fn.set(this,new Set),yn(this,pn,e,"f")}subscribe(e){return hn(this,fn,"f").add(e),!0===e(hn(this,pn,"f"))&&hn(this,fn,"f").delete(e),()=>{hn(this,fn,"f").delete(e)}}publish(e){yn(this,pn,e,"f"),hn(this,fn,"f").forEach((e=>{!0===e(hn(this,pn,"f"))&&hn(this,fn,"f").delete(e)}))}clear(){hn(this,fn,"f").clear()}}pn=new WeakMap,fn=new WeakMap;var vn=function(e,t,n,a){if("a"===n&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?a:"a"===n?a.call(e):a?a.value:t.get(e)},gn=function(e,t,n,a,i){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?i.call(e,n):i?i.value=n:t.set(e,n),n};const bn="breakpoint-0px";class En{constructor(){this.logger=()=>{}}withAppFactory(e){return this.appFactory=e,this}withLogger(e){return this.logger=e,this}withGatewayFactory(e){return this.gatewayFactory=e,this}build(){var e,t,n,a,i,o,r,s,l,c,d,u,p,f;const y=this.appFactory,h=this.logger,m=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new un;return f=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint"]}constructor(){super(),t.add(this),n.set(this,(()=>null)),a.set(this,(()=>null)),i.set(this,void 0),o.set(this,!1),r.set(this,null),s.set(this,null),l.set(this,null);const e=this.attachShadow({mode:"open"});gn(this,i,document.createElement("div"),"f"),vn(this,i,"f").id="app-container",vn(this,i,"f").classList.add("default"),e.appendChild(vn(this,i,"f"))}attributeChangedCallback(e,i,o){if(o!==i)switch(e){case"visible":vn(this,n,"f").call(this,"true"===o);break;case"interactivity":"ENABLED"!==o&&"DISABLED"!==o||vn(this,a,"f").call(this,o);break;case"active-breakpoint":vn(this,t,"m",c).call(this,o,i)}}makeInteractivityUpdateHandler(e){gn(this,a,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,a,i){const o="true"===this.getAttribute("visible"),r=this.getAttribute("slotInstanceGuid");gn(this,n,(o=>{o?(gn(this,n,(()=>null),"f"),0===e&&i.globalDispatch({type:Z,payload:{event:"Interactive"}}),a&&(i.globalDispatch({type:Y,payload:{name:"SignalImpression",parentGuid:a}}),this.trackViewability(a,i)),r&&i.globalDispatch({type:Y,payload:{name:"SignalImpression",parentGuid:r}})):vn(this,t,"m",p).call(this)}),"f"),vn(this,n,"f").call(this,o)}trackViewability(e,n){vn(this,o,"f")||("IntersectionObserver"in window&&!vn(this,r,"f")?(gn(this,r,new IntersectionObserver((a=>{a.forEach((a=>{a.isIntersecting&&a.intersectionRatio>=.5?vn(this,t,"m",u).call(this,(()=>{vn(this,o,"f")||(n.globalDispatch({type:Y,payload:{name:"SignalViewed",parentGuid:e,objectData:{supportedByBrowser:!0}}}),gn(this,o,!0,"f"),vn(this,t,"m",p).call(this))})):vn(this,t,"m",d).call(this)}))}),{threshold:.5}),"f"),gn(this,l,(()=>{var e,n;"visible"===document.visibilityState?null===(e=vn(this,r,"f"))||void 0===e||e.observe(vn(this,i,"f")):(vn(this,t,"m",d).call(this),null===(n=vn(this,r,"f"))||void 0===n||n.disconnect())}),"f"),document.addEventListener("visibilitychange",vn(this,l,"f")),vn(this,l,"f").call(this)):(n.globalDispatch({type:Y,payload:{name:"SignalViewed",parentGuid:e,objectData:{supportedByBrowser:!1}}}),gn(this,o,!0,"f")))}getOfferPositionAttr(){const e=this.getAttribute("offerPositionIndex"),t=Number(e);return(null==e||isNaN(t)||t<0)&&v(`Offer position attribute (${e}) is invalid`),t}getJSONAttr(e,t="{}"){const n=this.getAttribute(e);try{return JSON.parse(null!=n?n:t)}catch(t){v(`Invalid JSON attribute ${e}: ${n}`)}}disconnectedCallback(){vn(this,t,"m",p).call(this)}connectedCallback(){var e,t,n;const a=this.getAttribute("container"),o=this.getAttribute("plugin-id");vn(this,i,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===a?"column":"row"));const r=this.getOfferPositionAttr(),s=this.getJSONAttr("layoutSchema"),l=this.getJSONAttr("childLayouts","[]"),c=this.getJSONAttr("offerData"),d=new mn("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),u=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"";y||v("Cannot create app without factory. Please build the connector withAppFactory.");const p=m({offerPositionIndex:r,creativeInstanceGuid:null===(t=null==c?void 0:c.creative)||void 0===t?void 0:t.instanceGuid},d);this.makeInteractivityUpdateHandler(d),y({rootElement:vn(this,i,"f"),gateway:p,logger:h,offerPositionIndex:r,offerData:c,layoutSchema:s,childLayouts:l,schemaVersion:u,pluginId:o||O.pluginId}),this.makeVisbilityUpdateHandler(r,null===(n=null==c?void 0:c.creative)||void 0===n?void 0:n.instanceGuid,p)}},n=new WeakMap,a=new WeakMap,i=new WeakMap,o=new WeakMap,r=new WeakMap,s=new WeakMap,l=new WeakMap,t=new WeakSet,c=function(e,t){vn(this,i,"f").classList.remove(t||bn),vn(this,i,"f").classList.add(e||bn)},d=function(){vn(this,s,"f")&&(clearTimeout(vn(this,s,"f")),gn(this,s,null,"f"))},u=function(e){vn(this,t,"m",d).call(this),gn(this,s,window.setTimeout(e,1e3),"f")},p=function(){vn(this,t,"m",d).call(this),vn(this,r,"f")&&(vn(this,r,"f").disconnect(),gn(this,r,null,"f")),vn(this,l,"f")&&(document.removeEventListener("visibilitychange",vn(this,l,"f")),gn(this,l,null,"f"))},f;function v(e){throw h({level:R,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const In=t.createContext({get:()=>new un}),xn=e=>t.createElement(In.Provider,{value:{get:()=>e.context}},e.children);const Sn=t.createContext({get(){throw Error("Layout Schema context has not been set")}}),wn=e=>t.createElement(Sn.Provider,{value:{get:()=>e.context}},e.children),Cn=()=>t.useContext(Sn).get(),On=t.createContext("ENABLED"),Tn=()=>t.useContext(On);function An(e){const t=jn(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:jn(t,this.dataMap)});if(!n)throw new L("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");const a=t;return i.path([n,a],this.dataMap)}.bind({dataMap:t})}const Rn={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function jn(e,t=Rn){return["images","links","icons","copy","responseOptionsMap"].reduce(((t,n)=>Object.assign(Object.assign({},t),{[n]:Object.assign(Object.assign({},t[n]),e[n])})),t)}const Ln=t.createContext(An({}));Ln.Consumer;const Nn=Ln.Provider,_n=()=>t.useContext(Ln),Dn=t.createContext({});function kn({info:e,children:n}){const a=t.useContext(Dn);return t.createElement(Dn.Provider,{value:Object.assign(Object.assign({},a),e)},n)}const Pn=t.createContext({get(){throw Error("Catalog Item context has not been set")}}),$n=e=>t.createElement(Pn.Provider,{value:{get:()=>e.context}},e.children),Gn=()=>t.useContext(Pn).get(),Fn=t.createContext(""),Mn=()=>t.useContext(Fn),Bn=t.createContext(""),Un=i.compose(i.anyPass([i.isEmpty,i.all(i.isEmpty)]),i.flatten,i.map(i.values),i.map(i.ifElse(i.isNil,i.always({}),i.identity)),i.values,i.propOr({},"value")),Vn=i.compose(i.isEmpty,i.prop("predicates"));function zn(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const qn=i.curry(((e,{duration:t,predicates:n,styles:a})=>{return{predicates:n,classname:e(ot(a)),transitionBaseClassname:e(zn(t,(o=a,i.toPairs(o).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?i.keys(n).map((e=>ve(t,e))):[]})))))};var o})),Hn=i.anyPass([Un,Vn]);const Wn={is:i.equals,"is-not":i.compose(i.not,i.equals),"is-below":i.lt,"is-above":i.gt};function Jn(e,t){return e.includes(t)}const Kn={is:i.equals,"is-not":i.compose(i.not,i.equals),exists:Jn,"not-exists":i.compose(i.not,Jn)},Yn={exists:i.compose(i.not,i.either(i.isNil,i.isEmpty)),"not-exists":i.either(i.isNil,i.isEmpty)},Zn={"is-true":i.equals(!0),"is-false":i.equals(!1)},Qn={is:i.equals,"is-not":i.compose(i.not,i.equals)};function Xn(e){return(t,n)=>n[e]}const ea=i.cond([[(e,t)=>i.equals("Breakpoint",e),Xn("activeBreakpoint")],[(e,t)=>i.equals("Progression",e),Xn("progressionIndex")],[(e,t)=>i.equals("Position",e),Xn("positionIndex")]]);function ta(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const na=i.cond([[i.equals("Breakpoint"),(e,t,n)=>{const a=i.lensPath(["breakpoints",t]);return i.pipe(i.over(a,Number),i.view(a))(n)}],[i.equals("Progression"),(e,t,n)=>i.cond([[i.gt(0),i.add(n.totalGroups)],[i.lte(0),i.identity]])(Number(t))],[i.equals("Position"),(e,t,n)=>i.cond([[i.gt(0),i.add(n.totalOffers)],[i.lte(0),i.identity]])(Number(t))]]),aa=i.compose(i.not,isNaN);function ia(e,t){return e.map((e=>{var n,a,i;switch(e.type){case"StaticString":return(0,Qn[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,Yn[e.predicate.condition])(ta(t,e.predicate.value));case"StaticBoolean":return(0,Zn[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,Wn[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,Wn[e.predicate.condition])(null!==(a=t.domainStates[e.predicate.key])&&void 0!==a?a:0,e.predicate.value);case"DarkMode":throw new Error("DarkMode has not yet been implemented.");case"Placeholder":return function(e){switch(e.predicate.type){case"TextValue":return(0,Kn[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,Wn[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"Numeric":return(0,Wn[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=Wn[e.predicate.condition],a=null!==(i=ea(e.type,t))&&void 0!==i?i:NaN,o=na(e.type,e.predicate.value,t);return!!aa(a)&&n(a,o)}}}))}function oa(e){return i.pathOr(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const ra={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{}};function sa(e,t,n,a){const o=t.map((e=>"Progression"===e.type?Object.assign(Object.assign({},e),{type:a?"Position":e.type}):e)),{cached:r,uncached:s}=o.reduce(((t,a)=>function(e,t,n,a){const o=function(e,t){switch(e.type){case"Position":case"StaticBoolean":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:static-state`;case"StaticString":return`${e.type}:${e.predicate.input}:${e.predicate.condition}:${e.predicate.value}:static-state`;case"CreativeCopy":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${ta(t,e.predicate.value)}:${t.totalGroups}`;case"CustomState":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${e.predicate.key}:${t.customStates[e.predicate.key]}`;case"DomainState":return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${e.predicate.key}:${t.domainStates[e.predicate.key]}`;case"Placeholder":return`${e.type}:${e.predicate.type}:${e.predicate.content.condition}:data:${e.predicate.content.input}:${e.predicate.content.value}`;default:return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${ea(e.type,t)}:${t.totalGroups}`}}(e,t),r=n.current.get(o);return i.evolve(la(r)?{cached:i.append(r)}:{uncached:i.append({key:o,predicate:e})},a)}(a,n,e,t)),{cached:[],uncached:[]}),l=ia(s.map((({predicate:e})=>e)),n);return i.zip(s,l).forEach((([{key:t},n])=>{e.current.set(t,n)})),r.concat(l)}const la=i.is(Boolean);const ca=i.curry(((e,t,n)=>{var a,i,o,r,s,l;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:oa(n),progressionIndex:null!==(i=null===(a=n.progression)||void 0===a?void 0:a.activeGroupIndex)&&void 0!==i?i:0,totalOffers:null!==(r=null===(o=n.progression)||void 0===o?void 0:o.totalOffers)&&void 0!==r?r:0,totalGroups:null!==(l=null===(s=n.progression)||void 0===s?void 0:s.totalGroups)&&void 0!==l?l:0,customStates:n.customStates,domainStates:n.domainStates,positionIndex:e,creativeCopy:t}})),da=i.lensPath(["predicate","content","input"]),ua=i.lensPath(["predicate","content","value"]);function pa(e,t){const n=i.over(da,(t=>t?e(t):"")),a=i.over(ua,(t=>"string"==typeof t?e(t):t)),o=i.compose(n,a);return t.map((e=>"Placeholder"===e.type?"TextValue"===e.predicate.type?o(e):n(e):e))}const fa=i.all(i.equals(!0));function ya(e){const n=Zt(),a=Xt(),o=t.useRef(new Map),r=Tt(),s=vt(ra,ca(a,r)),l=Wt();return t.useMemo((()=>i.mapObjIndexed((e=>{const t=pa(l,e);return fa(sa(o,t,s,n))}),e)),[o,e,s,n,l])}function ha(e){e&&(e.style.display="")}function ma(e){e&&(e.style.display="none")}function va(e){return e.settings.duration}const ga=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],ba=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function Ea(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const a=t?ga:ba,i=e.animate(a,{duration:n,iterations:1});return i.onfinish=()=>{t?ha(e):ma(e)},i.oncancel=()=>{t?ha(e):ma(e)},()=>{i.finish()}}return t?ha(e):ma(e),()=>{}}function Ia({inTransitions:e,outTransitions:n,visible:a,children:i,containerClassName:o}){const r=t.useRef(null);return t.useEffect((()=>a&&e?e.forEach((e=>{r.current&&function(e,t,n,a){if("FadeIn"===a)Ea(e,t,n)}(r.current,a,va(e),e.type)})):!a&&n?n.forEach((e=>{r.current&&function(e,t,n,a){if("FadeOut"===a)Ea(e,t,n)}(r.current,a,va(e),e.type)})):()=>{}),[a]),t.createElement("div",{ref:r,style:{display:"none"},className:o},i)}function xa(e){const n=Et(),a=function(e){const n=Zt(),a=Xt(),i=t.useRef(new Map),o=Tt(),r=vt(ra,ca(a,o)),s=pa(Wt(),e);return t.useMemo((()=>fa(sa(i,s,r,n))),[i,s,r,n])}(e.schema.predicates),i=t.Children.toArray(e.schema.children.map(((t,a)=>n(t,void 0,e.testId?`${e.testId}-child${a}`:void 0))));return e.schema.transition?t.createElement(Ia,{inTransitions:e.schema.transition.inTransition,outTransitions:e.schema.transition.outTransition,visible:a},i):"functionally"===e.schema.hide?t.createElement(On.Provider,{value:a?"ENABLED":"DISABLED"},i):a?t.createElement(t.Fragment,null,i):null}const Sa=i.mergeWith(((e,t)=>`${e||""} ${t||""}`.trim())),wa=e=>{var n;const a=t.useContext(Jt),o=Xt(),r=St()||document.head,s=Mn(),l=ct(s,o,r),c=t.useCallback(ut,[]),d=vt([],(e=>Object.values(e.breakpoint.breakpoints))),u=a||c(d,s,o,r),p=e.styles?u(e.styles):{},f=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=qn(e);return i.mapObjIndexed((e=>Hn(t)||!e?null:n({predicates:t.predicates,duration:t.duration,styles:e})),t.value)}(l,null===(n=e.styles)||void 0===n?void 0:n.conditionalTransitions):void 0,y=ya(f?i.mapObjIndexed(i.propOr([],"predicates"),f):{}),h=i.mapObjIndexed(((e,t)=>e?function(e,t){var n;if(e&&t in e)return null===(n=e[t])||void 0===n?void 0:n.classname}(f,t):void 0),y),m=f?i.mapObjIndexed(i.prop("transitionBaseClassname"),f):{},v=e.styles?(g=m,Sa(Sa(p,h),g)):void 0;var g;return e.children({classnames:v,mapperRef:u})};function Ca(e){const n=Et();return t.createElement(wa,{styles:e.schema.styles},(({classnames:a})=>{var i;return t.createElement("div",{className:a?a.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},t.Children.toArray(e.schema.children.map(((t,a)=>n(t,void 0,U(a,e.testId))))))}))}function Oa(e){const n=Et();return t.createElement(wa,{styles:e.schema.styles},(({classnames:a})=>{var i;return t.createElement("div",{className:a?a.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},t.Children.toArray(e.schema.children.map(((t,a)=>n(t,void 0,U(a,e.testId))))))}))}const Ta={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",se,le],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},Aa=new Map([["&","_;^;_"]]),Ra=new RegExp(`<a *(?=${Ta.allowedAttributes.a.join("|")}|>)`,"g"),ja=new RegExp('<a [^>]*href="([^"]+)"',"g"),La=new RegExp("(<br *?>)|(<br *?/>)","g"),Na="<br/>";function _a(e){const n=Wt(),a=Tn(),i=t.useMemo((()=>{const t=n(e.schema.value);if(!function(e){const t=function(e){return e.replaceAll(ja,((e,t)=>{const n=t.replaceAll("&",Aa.get("&"));return e.replace(t,n)})).replaceAll(La,Na)}(e);return t===u(t,Ta)}(t))throw new L("FAILED_SANITISING_HTML","Invalid HTML tags");return t.trim()?t:""}),[e.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=m(a);return i?t.createElement(wa,{styles:e.schema.styles},(({classnames:n})=>{const a=[(null==n?void 0:n.link)?`class = "${null==n?void 0:n.link}"`:"",s?'tabindex="-1"':"",s?"style=\"pointer-events: 'none'; user-select: none;\"":"",s?'aria-disabled="true"':""].filter((e=>e.length>0));return l=i,new RegExp("</(p|ul|ol)>").test(l)?t.createElement("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(Ra,`<a ${a.join(" ")}`)}}):t.createElement("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(Ra,`<a ${a.join(" ")}`)}});var l})):null}function Da(e){const n=Wt()(e.schema.value),a=Tn(),{tabIndex:i,styles:o,isDisabled:r}=m(a);return n?t.createElement(wa,{styles:e.schema.styles},(({classnames:a})=>{const s={tabIndex:i,"aria-hidden":r,className:null==a?void 0:a.own,"data-testid":e.testId,"data-e2e":"BasicText"};return e.isInline?t.createElement("span",Object.assign({style:o},s),n):t.createElement("p",Object.assign({style:o},s),n)})):null}function ka(e,n,a){if("BasicText"===e.type)return t.createElement(Da,{schema:e.node,testId:n,isInline:null!=a&&a})}function Pa(e,n,a){return t.Children.toArray(e.map(((e,t)=>n(e,void 0,U(t,a)))))}function $a(e){const n=ht(),a=Et(),i=Ot(),o=Wt(),r=Xt(),s=Tn(),l=i.creative.responseOptionsMap[e.schema.responseKey],c=S(l);t.useEffect((()=>{c&&n(function(e){if(e.externalKey)return{type:te,payload:{criteria:{key:e.externalKey},signal:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:e.action,externalKey:e.externalKey}}}};throw new Error(`Invalid External Response: No 'externalKey' found for external response option with instanceGuid: ${e.instanceGuid}`)}(l))}),[l,n,c]);const d=l?o({data:l},"creativeResponse"):o,{tabIndex:u,styles:p,isDisabled:f}=m(s);return E(l)&&!c&&void 0!==r?t.createElement(wa,{styles:e.schema.styles},(({classnames:o,mapperRef:r})=>{var s;return t.createElement("button",{type:"button",tabIndex:u,"aria-disabled":f,"aria-label":null!==(s=e.schema.a11yLabel)&&void 0!==s?s:void 0,style:Object.assign({cursor:"pointer"},p),"data-testid":e.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":e.schema.responseKey,onClick:e=>{e.preventDefault();const t=function(e,t){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(b(n))return{fulfillment:n,responseOption:t,creativeInstanceGuid:e.creative.instanceGuid,accountID:e.accountId,referralCreativeID:e.creative.referralCreativeId};throw new Error(`Invalid Fulfillment: ${n} with referralCreativeID: ${e.creative.referralCreativeId}`)}case"Url":return Object.assign(Object.assign({},t),{accountID:e.accountId,creativeInstanceGuid:e.creative.instanceGuid,referralCreativeID:e.creative.referralCreativeId});default:return Object.assign(Object.assign({},t),{creativeInstanceGuid:e.creative.instanceGuid})}}(i,l);n({type:z,payload:t})},className:null==o?void 0:o.own,disabled:f},t.createElement(Ht,{value:d},(null==o?void 0:o.own)?function(e,n,a,i,o){return t.createElement(Kt,{value:a(n)},Pa(e,i,o))}(e.schema.children,o.own,r,a,e.testId):Pa(e.schema.children,a,e.testId)))})):null}function Ga(e){const n=Tn(),{styles:a,isDisabled:i}=m(n);return e.schema.url.light?t.createElement(wa,{styles:h(e.schema.styles)},(({classnames:n})=>t.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},a),{display:"inline-block"}),alt:i?void 0:e.schema.alt||void 0,title:e.schema.title||void 0,className:n?n.own:void 0,"data-testid":e.testId,"data-e2e":"StaticImage",src:e.schema.url.light}))):null}function Fa(e){const n=Tn(),{styles:a,isDisabled:i}=m(n),o=(e=>{const n=t.useContext(Ln),a=e.split("|");for(const e of a){const t=n(e.trim(),"images");if(t)return t}})(e.schema.imageKey);return null!=(r=o)&&"object"==typeof r&&"light"in r&&"string"==typeof r.light?t.createElement(wa,{styles:h(e.schema.styles)},(({classnames:n})=>t.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},a),{display:"inline-block"}),alt:o.alt,title:o.title,className:n?n.own:void 0,"data-testid":e.testId,"data-e2e":"DataImage",src:o.light}))):null;var r}const Ma={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Ba(e){const n=e.schema.name,a=e.schema.description,i=e.schema.styles?M(Ma,e.schema.styles):Ma,o=Tn(),{styles:r,isDisabled:s}=m(o);return n?t.createElement(wa,{styles:i},(({classnames:i})=>t.createElement("span",Object.assign({style:Object.assign(Object.assign({},r),{display:"inline-block"}),className:"rokt-icon"+((null==i?void 0:i.own)?" "+i.own:""),"data-testid":e.testId,"data-e2e":`StaticIcon-${n}`},!s&&a?{title:a}:{"aria-hidden":"true"}),n))):null}const Ua={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class Va extends t.Component{constructor(e){super(e),this.state={errorMessage:""}}static getDerivedStateFromError(e){return{errorMessage:e.message}}componentDidUpdate(e){this.state.errorMessage&&JSON.stringify(e.schema)!==JSON.stringify(this.props.schema)&&this.setState({errorMessage:""})}componentDidCatch(e,t){var n;this.props.reporter&&"true"===pe.REPORT_RENDER_ERRORS&&this.props.reporter({level:R,code:null!==(n=e.code)&&void 0!==n?n:"UNHANDLED_RENDERING_EXCEPTION",message:e.message,additionalInformation:Object.assign({componentStack:t.componentStack,stack:e.stack},this.context||{})})}render(){return this.state.errorMessage?"true"===pe.DISPLAY_ERRORS?t.createElement("pre",{style:Ua},t.createElement("strong",null,"Error:")," [",t.createElement("em",null,this.props.schema.type),"]"," ",this.state.errorMessage):void 0:this.props.children}}Va.contextType=Dn;const za={internally:"_top",externally:"_blank"};function qa(e,n,a){return t.Children.toArray(e.map(((e,t)=>n(e,void 0,a?`${a}-child${t}`:void 0))))}function Ha(e){var n;const a=za[e.schema.open],i=Et(),o=Tn(),{tabIndex:r,styles:s,isDisabled:l}=m(o);return(null===(n=e.schema.children)||void 0===n?void 0:n.length)>0?t.createElement(wa,{styles:e.schema.styles},(({classnames:n,mapperRef:o})=>{var c;return t.createElement("a",{href:e.schema.src,"data-testid":e.testId,"data-e2e":"StaticLink",target:null!=a?a:"_blank",tabIndex:r,"aria-disabled":l,"aria-label":null!==(c=e.schema.a11yLabel)&&void 0!==c?c:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:e.isInline?"inline":"block"},s),className:null==n?void 0:n.own},(null==n?void 0:n.own)?function(e,n,a,i,o){return t.createElement(Kt,{value:a(n)},qa(e,i,o))}(e.schema.children,null==n?void 0:n.own,o,i,e.testId):qa(e.schema.children,i,e.testId))})):null}function Wa(e,n,a){if("StaticLink"===e.type)return t.createElement(Ha,{schema:e.node,testId:n,isInline:null!=a&&a})}const Ja={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Ka(e){const n=(a=e.schema.iconKey,t.useContext(Ln)(a,"icons"));var a;const i=null==n?void 0:n.name,o=e.schema.styles?M(Ja,e.schema.styles):Ja,r=Tn(),{styles:s}=m(r);return i?t.createElement(wa,{styles:o},(({classnames:n})=>t.createElement("span",{style:Object.assign(Object.assign({},s),{display:"inline-block"}),"aria-hidden":"true",className:"rokt-icon"+((null==n?void 0:n.own)?" "+n.own:""),"data-testid":e.testId,"data-e2e":`DataIcon-${i}`},i))):null}const Ya=o.css`
2
2
  display: flex;
3
3
  position: relative;
4
4
  overflow: hidden;