@rokt/dcui-orchestrator 0.0.4-rc.30 → 0.0.4-rc.31

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.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from"react";import a,{useEffect as o,useRef as r,createContext as s,useContext as l,useState as c,useMemo as d,useCallback as u,forwardRef as p}from"react";import{createRoot as y}from"react-dom/client";import{useDispatch as f,useSelector as m,connect as h,Provider as v}from"react-redux";import{path as g,assocPath as b,when as I,allPass as E,hasPath as S,complement as w,pathEq as C,cond as O,mergeDeepWith as T,T as A,flip as x,type as N,unary as _,identity as L,concat as R,zipWith as D,slice as k,is as P,equals as $,always as j,compose as G,propOr as F,__ as M,prop as B,memoizeWith as U,mapObjIndexed as V,where as z,not as H,isEmpty as W,forEachObjIndexed as q,pipe as J,split as Y,replace as K,reduce as Z,reduced as Q,partial as X,curry as ee,anyPass as te,toPairs as ne,keys as ie,all as ae,flatten as oe,map as re,values as se,ifElse as le,isNil as ce,over as de,lensPath as ue,zip as pe,pathOr as ye,evolve as fe,append as me,gt as he,lt as ve,either as ge,view as be,add as Ie,lte as Ee,mergeWith as Se,indexBy as we,mergeRight as Ce,lensProp as Oe,defaultTo as Te,findIndex as Ae,sortBy as xe,reject as Ne,whereEq as _e,uniqBy as Le,find as Re,has as De,omit as ke,assoc as Pe,gte as $e,clone as je,mergeDeepRight as Ge,isNotEmpty as Fe,F as Me}from"ramda";import{css as Be,cx as Ue,keyframes as Ve}from"@emotion/css";import{call as ze,actionChannel as He,take as We,put as qe,cancelled as Je,select as Ye,all as Ke,takeEvery as Ze,fork as Qe,takeLatest as Xe,spawn as et,race as tt,delay as nt}from"redux-saga/effects";import{configureStore as it,combineReducers as at}from"@reduxjs/toolkit";import ot,{buffers as rt,eventChannel as st,END as lt}from"redux-saga";import{all as ct,spawn as dt,takeEvery as ut,call as pt,put as yt,take as ft,delay as mt}from"@redux-saga/core/effects";import ht from"embla-carousel-react";import vt from"insane";import gt from"@emotion/css/create-instance";function bt(e){const t=["elements","own"],n=["default","dimension","width","type"],i=["default","dimension","width","value"],a=["default","dimension","minWidth"],o=g(t,e);return o&&Array.isArray(o)&&o.length?b(t,o.map(I(E([S(n),w(S(a)),C("fixed",n)]),(e=>b(a,g(i,e),e)))),e):e}function It(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function Et(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function St(){return"ontouchstart"in document.documentElement}function wt(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function Ct(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function Ot(e){return Ct(e)&&"Fulfillment"===e.action}function Tt(e){return Ct(e)&&"Url"===e.action}function At(e){return Ct(e)&&"ExternalPaymentTrigger"===e.action}function xt(e){return(Ot(e)||Tt(e))&&"RealTime"===e.conversionType&&"rclid"in e}function Nt(e){return(Ot(e)||Tt(e))&&"RealTimeReferral"===e.conversionType&&"rclid"in e}function _t(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 Lt={pluginId:"shared",pageInstanceGuid:"N/A"};var Rt;!function(e){e.DCUI="DCUI",e.Partner="partner"}(Rt||(Rt={}));const Dt=["SignalCartItemQuantitySelected"],kt="ERROR",Pt="WARNING";class $t extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const jt=["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","INITIATE_INSTANT_PURCHASE_EVENT","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];const Gt=(e,t)=>R(e,k(e.length,t.length,t)),Ft=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?Gt(t,e):t,i=t.length>e.length?Gt(e,t):e;return D(zt,i,n)}return t},Mt=e=>null==e,Bt=e=>!Mt(e),Ut=(e,t)=>Mt(t)?e:t,Vt=(e,t)=>{throw new $t("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function zt(e,t){return O([[(e,t)=>N(e)!==N(t)&&Bt(e)&&Bt(t),Vt],[(e,t)=>Mt(e)||Mt(t),Ut],[(e,t)=>"Object"===N(e),T(zt)],[(e,t)=>"Array"===N(e),Ft],[A,x(_(L))]])(e,t)}function Ht(e,t){return zt(e,t)}function Wt(e=0){return`breakpoint-${e}px`}function qt(e,t){return t?`${t}-child${e}`:void 0}const Jt="GLOBAL/RAISE_METRIC",Yt="GLOBAL/OFFER_ENGAGEMENT";function Kt(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&Ot(e.responseOption)&&"fulfillment"in e&&wt(e.fulfillment)}function Zt(e){return At(e)}function Qt(e){return Tt(e)}function Xt(e){return function(e){return Ct(e)&&"CaptureOnly"===e.action}(e)}function en(e){return!!(xt(e)||"responseOption"in e&&xt(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function tn(e){return!!(Nt(e)||"responseOption"in e&&Nt(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}const nn="GLOBAL/RAISE_SIGNAL",an="GLOBAL/OFFER_LIFECYCLE",on="GLOBAL/SET_CUSTOM_STATE",rn="GLOBAL/SEND_PARTNER",sn="GLOBAL/SET_DOMAIN_STATE",ln="GLOBAL/PREPARE_SIGNAL",cn="GLOBAL/OPEN_LINK",dn="GLOBAL/SET_PARTNER_VALIDATION_STATUS",un="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",pn="GLOBAL/LAUNCH_CHILD_LAYOUT",yn={RAISE_METRIC:Jt,PREPARE_SIGNAL:ln,OFFER_ENGAGEMENT:Yt,RAISE_SIGNAL:nn,OFFER_LIFECYCLE:an,SEND_PARTNER:rn,SET_CUSTOM_STATE:on,SET_DOMAIN_STATE:sn,OPEN_LINK:cn,SET_PARTNER_VALIDATION_STATUS:dn,SET_GLOBAL_OFFER_DATA_CART:un,LAUNCH_CHILD_LAYOUT:pn},fn="data-open-in-app",mn="data-click-signal-context";function hn(e,t){function n(e){var n;if(!(e.target&&e.target instanceof HTMLElement))return;const i=null===(n=e.target)||void 0===n?void 0:n.closest("a");if(i){const n=i.getAttribute("href"),a=i.getAttribute(mn);if(a&&t({type:nn,payload:{name:"SignalUserInteraction",action:"Click",context:a}}),n){e.preventDefault();let a="newTab";i.hasAttribute(fn)&&(a="inApp"),t({type:cn,payload:{url:n,urlBehaviour:a}})}}}o((()=>null!==e?(e.addEventListener("click",n),()=>{e.removeEventListener("click",n)}):()=>{}),[e])}function vn(){const e=r(null);return o((()=>{const t=t=>{"Tab"===t.key&&gn(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const gn=(e,t)=>{var n;const i=null===(n=t.current)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!i)return;const a=i[0],o=i[i.length-1],{activeElement:r}=window.document;if(1!==i.length)return r===a&&e.shiftKey?(o&&o.focus(),void e.preventDefault()):r!==o||e.shiftKey?void 0:(a&&a.focus(),void e.preventDefault());e.preventDefault()},bn="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function In(e,t){return t?"false"!==bn.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${Wt(e)} ${t.trim()}`:`#app-container.${Wt(e)} & {${t}}`:"";var n}const En={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"};function Sn(e){return function(e){return Object.keys(En).indexOf(e)>-1}(e)?En[e]:""}const wn={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 Cn(e,t){if(!wn[e]||!wn[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return wn[e][t]}function On(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function Tn(...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 An(e,t){return`${e}:${t};`}function xn(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class Nn extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function _n(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 Nn(n,JSON.stringify(t));return!0}function Ln(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function Rn(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 Dn(e){if(null==e||""===e)return"value must not be omitted"}function kn(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 Pn(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 $n(e){if(null!=e&&""!==e)return"value must not be specified"}function jn(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 Gn(...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||Ln(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function Fn(e,t){return n=>{const i=e(n),a=t(n);if(i&&a)return`one of these must be true: ${i} -OR- ${a}`}}function Mn(e){if("string"!=typeof e)return"value must be a string"}const Bn=P(Object);function Un(e){const t=Object.entries(e);return n=>Bn(n)&&!Array.isArray(n)?t.reduce(((e,[t,i])=>e||i(n[t])),void 0):`Input value (${e}) must be an object`}function Vn(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function zn(e,t,n){return _n(Ln,n)?An(Cn(e,t),`${n}`):""}function Hn(e){return(t,n,i)=>_n(Rn(Object.keys(e)),i)?An(Cn(t,n),`${e[i]}`):""}function Wn(e){return _n(Dn,e)?On({light:t(Pn,!1),dark:t(Fn($n,Pn),!0)},Tn("\n "))(e):"";function t(e,t){return n=>{if(_n(e,n)&&n){const e=An("background-image",`url("${n}")`);return t?xn(e):e}return""}}}function qn(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),_n(Fn($n,Rn(Object.keys(t))),e)&&e?An("background-size",t[e]):""}const Jn=O([[$("top-left"),j("top left")],[$("top-right"),j("top right")],[$("bottom-left"),j("bottom left")],[$("bottom-right"),j("bottom right")],[A,L]]);function Yn(e){const t="string"==typeof e?e.toLowerCase():e;return _n(Fn($n,Rn(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?An("background-position",Jn(t)):""}function Kn(e,t,n){return _n(Fn(Ln,Gn(2,3,4)),n)?An(Cn(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function Zn(e){return(t,n,i)=>_n(jn({fit:Rn(e),percentage:Ln,fixed:Ln}),i)?An(Cn(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]}}(i)):""}const Qn=Un({light:kn,dark:Fn($n,kn)});function Xn(e,t,n){return i=>{if(i){const a=An(Cn(e,t),ti(String(i)));return n?xn(a):a}return""}}function ei(e,t,n){return _n(Qn,n)?On({light:Xn(e,t,!1),dark:Xn(e,t,!0)},Tn("\n "))(n):""}function ti(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 ni=Un({offsetX:Fn($n,Ln),offsetY:Fn($n,Ln),blurRadius:Fn($n,Ln),spreadRadius:Fn($n,Ln),color:Qn}),ii=e=>t=>null!=t?String(t):e,ai=G(R(M,"px"),ii("0")),oi=e=>t=>"string"==typeof t?e(t):t,ri=G(oi(R(M,"px")),ii(void 0)),si=G(oi(ti),B("dark"));function li(e,t,n){return An(e,On({offsetX:ai,offsetY:ai,blurRadius:t.spreadRadius?ai:ri,spreadRadius:ri,color:n},Tn(" "))(t))}const ci={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},di={container:{justifyContent:Hn(ci),alignItems:Hn(ci),shadow:function(e,t,n){var i;if(_n(ni,n)){const a=Cn(e,t);return Tn("\n")(li(a,n,G(ti,F("#80000000","light"))),(null===(i=n.color)||void 0===i?void 0:i.dark)?xn(li(a,n,si)):"")}return""},gap:Kn,overflow:Hn({hidden:"hidden",visible:"visible"}),blur:function(e,t,n){return _n(Vn,n)?An(Cn(e,t),`blur(${n.toString()}px)`):""},opacity:zn},text:{textColor:ei,fontSize:Kn,fontFamily:function(e,t,n){return _n(Mn,n)?An(Cn(e,t),(i=`${n}`,i.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 i},fontWeight:Hn({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:Hn({normal:"normal",italic:"italic"}),lineHeight:Kn,lineLimit:function(e,t,n){return _n(Ln,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:Kn,baselineTextAlign:Hn({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:Hn({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:Hn({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:Hn({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:ei,backgroundImage:function(e,t,n){return _n(Dn,n)?On({url:Wn,position:Yn,scale:qn},Tn)(n):""}},dimension:{width:Zn(["wrap-content","fit-width"]),maxWidth:Kn,minWidth:Kn,height:Zn(["wrap-content","fit-height"]),maxHeight:Kn,minHeight:Kn,rotateZ:(ui="Z",(e,t,n)=>{const i=`rotate${ui}`;return _n(Ln,n)?An(Cn(e,t),`${i}(${n.toString()}deg)`):""})},flexChild:{alignSelf:Hn(ci),weight:zn,order:zn},spacing:{margin:Kn,padding:Kn,offset:function(e,t,n){return _n(Gn(2),n)?`transform:translate(${n.split(" ").join("px, ")}px)`:""}},border:{borderColor:ei,borderRadius:Kn,borderWidth:Kn,borderStyle:Hn({solid:"solid",dashed:"dashed"})}};var ui;function pi(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((i=>{if(!di[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const a=di[n][i];if(!a)throw new Error(`No styling transformer exists for property: ${n}.${i.toString()}`);try{t+=a(n,i,e[n][i])}catch(e){throw e&&"object"==typeof e&&"message"in e&&(e.message=`Error parsing styling key ${n}.${i.toString()}: ${e.message}`),e}})),t)),"")}const yi="FAILED_TEMPLATING_DATA",fi=new Map;function mi(e){return String.fromCharCode(97+e)}function hi(e,t,n){const i=`${e||Lt.pluginId}-${void 0!==t?String(t):"outer"}`,a=fi.get(i);if(a&&a.sheet.container.isConnected)return a.css;const o=function(e,t){const n={key:void 0!==e?`inner-css-${mi(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),gt(n)}(t,n);return fi.set(i,o),o.css}const vi="%%%OWN_CLASS_REF%%%",gi=U(((e,t,n,i)=>`${String(e)}-${t}-${n}`),bi);function bi(e,t,n,i){const a=hi(t,n,i);let o=1;return function t(n,i=!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,a])=>Object.assign(Object.assign({},t),{[n]:Ii(a,l,i,String(n),e)})),{}),n=Object.entries(t),r=i?"parent-"+o++:"",s=function(e){return"own"in e&&"string"==typeof e.own&&e.own.length>0}(t)?a(t.own):"";return n.reduce(((e,[t,n=""])=>{if("own"===t)return e;const i=n.replace(vi,r);return Object.assign(Object.assign({},e),{[t]:i?a(i):""})}),{own:`${s}${s&&r?" ":""}${r}`})}catch(e){const t=e;throw t.code="FAILED_PARSING_STYLES",t}}.bind({})}function Ii(e,t,n,i,a){return e.map(function(e,t,n){return i=>Object.entries(i).map((([i,a])=>{const o=a?pi(a):"";switch(!0){case"default"===i:return o?`\n${o}\n`:"";case Boolean(e):return`\n .${e}${Sn(i)} & {\n${o}\n}\n`;case t&&"own"!==n:return`\n .${vi}${Sn(i)} & {\n${o}\n}\n`;default:return`\n &${Sn(i)} {\n${o}\n}\n`}})).join("")}(t,n,i)).reduce(((e,t,n)=>{const i=a[n];return void 0!==i?e+(0===n?t:`${In(i,t)}\n`):e}),"")}const Ei=s(j(void 0)),Si=()=>l(Ei),wi=s(null);function Ci(e,t){var n;const i=l(wi);return i&&null!==(n=t(i))&&void 0!==n?n:e}const Oi=s((()=>{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")})),Ti=Oi.Consumer,Ai=()=>l(Oi),xi=e=>a.createElement(Oi.Provider,{value:(t,n,i)=>e.value(t,null!=n?n:e.overrides,i)},e.children),Ni=s(null),_i=()=>l(Ni),Li=s({get(){throw Error("Offer context has not been set")}}),Ri=e=>a.createElement(Li.Provider,{value:{get:()=>e.context}},e.children),Di=()=>l(Li).get(),ki=()=>{try{return l(Li).get().creative.copy}catch(e){return}},Pi=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),$i=G(H,W),ji=z({url:$i,title:$i});function Gi(e,t,n){return t.reduce(((t,n)=>{const[i,a]=n.slice(0,-1).split("["),o=a?a.split(","):[];if(!i)throw new Error(Mi(e,"This Meta Attribute could not be parsed."));return function(e,t,n,i){switch(t){case"openLinks":return function(e,t,n){Fi(t,e,"openLinks",1,2);const i=Bi(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),a=Ui(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===i)return n.replace(Pi,((e,t)=>`<a ${fn} ${a?`${mn}="${a}" `:""}${t}`));return n}(e,n,i);case"sliceText":return function(e,t,n){Fi(t,e,"sliceText",2,2);const i=Bi(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),a=Bi(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"===i)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,a);throw Error(Mi(e,`Unknown "SliceBy" value. ${i}`))}(e,n,i);default:throw new Error(Mi(e,`Unknown Meta Attribute '${t}'.`))}}(e,i,o,t)}),n)}function Fi(e,t,n,i,a){const o=new Error(Mi(t,`${n} meta attribute takes ${i!=a?`between ${i} and ${a}`:i} arguments; received ${e.length}.`));if(e.length<i||e.length>a)throw o}function Mi(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function Bi(e,t,n,i,a){const o=Ui(e,n,i);if(null!==o)return o;throw Error(Mi(t,a||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function Ui(e,t,n){return n(e[t])}const Vi="DATA",zi="STATE",Hi=new RegExp(`^(${Vi}|${zi})`),Wi=new RegExp(`^${zi}`),qi=new RegExp(`%\\^(?:${Vi}|${zi})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*(?:\\:[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,]*\\])*(?:\\|.*?)?\\^%`,"g"),Ji=Symbol("invalid");function Yi(e,t="creativeCopy"){const n=Ki({data:e},t);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Ki(t,n,this.dataMap)});let i=!1;const a=t,o=J(k(2,-2),Y("|"),(e=>{const t=Z(((e,t)=>{let n;if(Hi.test(t)){if(!this.dataMap.has(t)&&Wi.test(t))throw new $t(yi,`Invalid use of STATE template key in a context it does not exist: ${t}`);const i=Y(":",t);if(i[0]){if(n=this.dataMap.get(i[0]),n&&n===Ji)throw new $t(yi,`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(i.length>1&&n)try{n=Gi(i[0],i.slice(1),n)}catch(e){throw new $t(yi,`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?Q({provided:!0,value:n}):e}return Q({provided:!0,value:t})}),{provided:!1,value:""},e);return t.provided||(i=!0),t.value})),r=K(qi,o,a);return!1===i?r:""}.bind({dataMap:n})}function Ki(e,t,n){const i=new Map(n);return"data"in e&&a(e.data,`${Vi}${t?"."+t:""}`),"state"in e&&a(e.state,`${zi}${t?"."+t:""}`),i;function a(e,t){"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e?i.set(t,(null==e?void 0:e.toString())||""):i.set(t,Ji),e&&"object"==typeof e&&q(((e,n)=>a(e,`${t}.${n}`)),e)}}const Zi=s(Yi({})),Qi=Zi.Consumer,Xi=Zi.Provider,ea=()=>l(Zi),ta=s(null),na=ta.Provider,ia=s("OUTER"),aa=()=>"VARIANT"===l(ia),oa=s(void 0),ra=()=>l(oa);var sa,la,ca,da,ua,pa,ya=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))},fa=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},ma=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};class ha{constructor(e,t,n,i,a){sa.set(this,void 0),la.set(this,void 0),ca.set(this,new Set),da.set(this,void 0),ua.set(this,void 0),pa.set(this,void 0),fa(this,sa,X(e.subscribe.bind(e),[n]),"f"),fa(this,la,X(e.dispatch.bind(e),[n]),"f"),fa(this,da,t,"f"),fa(this,ua,i,"f"),fa(this,pa,a,"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=ma(this,sa,"f").call(this,e),n=()=>{t(),ma(this,ca,"f").delete(n)};return ma(this,ca,"f").add(n),n}onInteractivityChange(e){return ma(this,ua,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=ma(this,pa,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),ma(this,ca,"f").delete(n)};return ma(this,ca,"f").add(n),n}globalDispatch(e){ma(this,la,"f").call(this,e)}dispose(){ma(this,ca,"f").forEach((e=>e())),fa(this,ca,new Set,"f"),ma(this,ua,"f").clear()}createChildPlugin(e){return ma(this,da,"f").call(this,e)}}sa=new WeakMap,la=new WeakMap,ca=new WeakMap,da=new WeakMap,ua=new WeakMap,pa=new WeakMap;class va{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>ya(this,void 0,void 0,(function*(){})),onClose:()=>ya(this,void 0,void 0,(function*(){})),putConfig:()=>ya(this,void 0,void 0,(function*(){})),send:()=>ya(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var ga,ba,Ia=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},Ea=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};class Sa{constructor(e){ga.set(this,void 0),ba.set(this,new Set),Ia(this,ga,e,"f")}subscribe(e){return Ea(this,ba,"f").add(e),!0===e(Ea(this,ga,"f"))&&Ea(this,ba,"f").delete(e),()=>{Ea(this,ba,"f").delete(e)}}publish(e){Ia(this,ga,e,"f"),Ea(this,ba,"f").forEach((e=>{!0===e(Ea(this,ga,"f"))&&Ea(this,ba,"f").delete(e)}))}clear(){Ea(this,ba,"f").clear()}}ga=new WeakMap,ba=new WeakMap;var wa=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},Ca=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n};const Oa="breakpoint-0px";class Ta{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,i,a,o,r,s,l,c,d,u,p,y;const f=this.appFactory,m=this.logger,h=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new va;return y=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint"]}constructor(){super(),t.add(this),n.set(this,(()=>null)),i.set(this,(()=>null)),a.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"});Ca(this,a,document.createElement("div"),"f"),wa(this,a,"f").id="app-container",wa(this,a,"f").classList.add("default"),e.appendChild(wa(this,a,"f"))}attributeChangedCallback(e,a,o){if(o!==a)switch(e){case"visible":wa(this,n,"f").call(this,"true"===o);break;case"interactivity":"ENABLED"!==o&&"DISABLED"!==o||wa(this,i,"f").call(this,o);break;case"active-breakpoint":wa(this,t,"m",c).call(this,o,a)}}makeInteractivityUpdateHandler(e){Ca(this,i,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,i,a){const o="true"===this.getAttribute("visible"),r=this.getAttribute("slotInstanceGuid");Ca(this,n,(o=>{o?(Ca(this,n,(()=>null),"f"),0===e&&a.globalDispatch({type:an,payload:{event:"Interactive"}}),i&&(a.globalDispatch({type:nn,payload:{name:"SignalImpression",parentGuid:i}}),this.trackViewability(i,a)),r&&a.globalDispatch({type:nn,payload:{name:"SignalImpression",parentGuid:r}})):wa(this,t,"m",p).call(this)}),"f"),wa(this,n,"f").call(this,o)}trackViewability(e,n){if(!wa(this,o,"f"))if("IntersectionObserver"in window&&!wa(this,r,"f")){const i=()=>{wa(this,o,"f")||(n.globalDispatch({type:nn,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!0}}),Ca(this,o,!0,"f"),wa(this,t,"m",p).call(this),wa(this,a,"f").removeEventListener("click",i))};wa(this,a,"f").addEventListener("click",i),Ca(this,r,new IntersectionObserver((r=>{r.forEach((r=>{r.isIntersecting&&r.intersectionRatio>=.5?wa(this,t,"m",u).call(this,(()=>{wa(this,o,"f")||(n.globalDispatch({type:nn,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!1}}),Ca(this,o,!0,"f"),wa(this,t,"m",p).call(this),wa(this,a,"f").removeEventListener("click",i))})):wa(this,t,"m",d).call(this)}))}),{threshold:.5}),"f"),Ca(this,l,(()=>{var e,n;"visible"===document.visibilityState?null===(e=wa(this,r,"f"))||void 0===e||e.observe(wa(this,a,"f")):(wa(this,t,"m",d).call(this),null===(n=wa(this,r,"f"))||void 0===n||n.disconnect())}),"f"),document.addEventListener("visibilitychange",wa(this,l,"f")),wa(this,l,"f").call(this)}else n.globalDispatch({type:nn,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!1,inferred:!1}}),Ca(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(){wa(this,t,"m",p).call(this)}connectedCallback(){var e,t,n;const i=this.getAttribute("container"),o=this.getAttribute("plugin-id");wa(this,a,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===i?"column":"row"));const r=this.getOfferPositionAttr(),s=this.getJSONAttr("layoutSchema"),l=this.getJSONAttr("childLayouts","[]"),c=this.getJSONAttr("offerData"),d=new Sa("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),u=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"",p=this.getJSONAttr("offerState","{}");f||v("Cannot create app without factory. Please build the connector withAppFactory.");const y=h({offerPositionIndex:r,creativeInstanceGuid:null===(t=null==c?void 0:c.creative)||void 0===t?void 0:t.instanceGuid},d);this.makeInteractivityUpdateHandler(d),f({rootElement:wa(this,a,"f"),gateway:y,logger:m,offerPositionIndex:r,offerData:c,layoutSchema:s,childLayouts:l,schemaVersion:u,pluginId:o||Lt.pluginId,offerState:p}),this.makeVisbilityUpdateHandler(r,null===(n=null==c?void 0:c.creative)||void 0===n?void 0:n.instanceGuid,y)}},n=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,r=new WeakMap,s=new WeakMap,l=new WeakMap,t=new WeakSet,c=function(e,t){wa(this,a,"f").classList.remove(t||Oa),wa(this,a,"f").classList.add(e||Oa)},d=function(){wa(this,s,"f")&&(clearTimeout(wa(this,s,"f")),Ca(this,s,null,"f"))},u=function(e){wa(this,t,"m",d).call(this),Ca(this,s,window.setTimeout(e,1e3),"f")},p=function(){wa(this,t,"m",d).call(this),wa(this,r,"f")&&(wa(this,r,"f").disconnect(),Ca(this,r,null,"f")),wa(this,l,"f")&&(document.removeEventListener("visibilitychange",wa(this,l,"f")),Ca(this,l,null,"f"))},y;function v(e){throw m({level:kt,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const Aa=s({get:()=>new va}),xa=e=>a.createElement(Aa.Provider,{value:{get:()=>e.context}},e.children);const Na=s({get(){throw Error("Layout Schema context has not been set")}}),_a=e=>a.createElement(Na.Provider,{value:{get:()=>e.context}},e.children),La=()=>l(Na).get(),Ra=s("ENABLED"),Da=()=>l(Ra);function ka(e){const t=$a(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:$a(t,this.dataMap)});if(!n)throw new $t("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");return g([n,t],this.dataMap)}.bind({dataMap:t})}const Pa={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function $a(e,t=Pa){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 ja=s(ka({}));ja.Consumer;const Ga=ja.Provider,Fa=()=>l(ja),Ma=s({});function Ba({info:e,children:t}){const n=l(Ma);return a.createElement(Ma.Provider,{value:Object.assign(Object.assign({},n),e)},t)}const Ua=s({get(){throw Error("Catalog Item context has not been set")}}),Va=e=>a.createElement(Ua.Provider,{value:{get:()=>e.context}},e.children),za=()=>l(Ua).get(),Ha=s(""),Wa=()=>l(Ha),qa=s(""),Ja=s(void 0);function Ya({children:e}){const t=d((()=>{const e=document.createElement("div");return e.inert=!0,{inert:!0===e.inert}}),[]);return a.createElement(Ja.Provider,{value:t},e)}const Ka=G(te([W,ae(W)]),oe,re(se),re(le(ce,j({}),L)),se,F({},"value")),Za=G(W,B("predicates"));function Qa(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const Xa=ee(((e,{duration:t,predicates:n,styles:i})=>{return{predicates:n,classname:e(pi(i)),transitionBaseClassname:e(Qa(t,(a=i,ne(a).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?ie(n).map((e=>Cn(t,e))):[]})))))};var a})),eo=te([Ka,Za]);const to={is:$,"is-not":G(H,$),"is-below":ve,"is-above":he};function no(e,t){return e.includes(t)}const io={is:$,"is-not":G(H,$),exists:no,"not-exists":G(H,no)},ao={exists:G(H,ge(ce,W)),"not-exists":ge(ce,W)},oo={"is-true":$(!0),"is-false":$(!1)},ro={is:$,"is-not":G(H,$)};function so(e){return(t,n)=>n[e]}const lo=O([[(e,t)=>$("Breakpoint",e),so("activeBreakpoint")],[(e,t)=>$("Progression",e),so("progressionIndex")],[(e,t)=>$("Position",e),so("positionIndex")]]);function co(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const uo=O([[$("Breakpoint"),(e,t,n)=>{const i=ue(["breakpoints",t]);return J(de(i,Number),be(i))(n)}],[$("Progression"),(e,t,n)=>O([[he(0),Ie(n.totalGroups)],[Ee(0),L]])(Number(t))],[$("Position"),(e,t,n)=>O([[he(0),Ie(n.totalOffers)],[Ee(0),L]])(Number(t))]]),po=G(H,isNaN);function yo(e,t){return e.map((e=>{var n,i,a;switch(e.type){case"StaticString":return(0,ro[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,ao[e.predicate.condition])(co(t,e.predicate.value));case"StaticBoolean":return(0,oo[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,to[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,to[e.predicate.condition])(null!==(i=t.domainStates[e.predicate.key])&&void 0!==i?i: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,io[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,to[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"Numeric":return(0,to[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=to[e.predicate.condition],i=null!==(a=lo(e.type,t))&&void 0!==a?a:NaN,o=uo(e.type,e.predicate.value,t);return!!po(i)&&n(i,o)}}}))}function fo(e){return ye(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const mo={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{}};function ho(e,t,n,i){const a=t.map((e=>"Progression"===e.type?Object.assign(Object.assign({},e),{type:i?"Position":e.type}):e)),{cached:o,uncached:r}=a.reduce(((t,i)=>function(e,t,n,i){const a=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:${co(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:${lo(e.type,t)}:${t.totalGroups}`}}(e,t),o=n.current.get(a);return fe(vo(o)?{cached:me(o)}:{uncached:me({key:a,predicate:e})},i)}(i,n,e,t)),{cached:[],uncached:[]}),s=yo(r.map((({predicate:e})=>e)),n);return pe(r,s).forEach((([{key:t},n])=>{e.current.set(t,n)})),o.concat(s)}const vo=P(Boolean);const go=ee(((e,t,n)=>{var i,a,o,r,s,l;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:fo(n),progressionIndex:null!==(a=null===(i=n.progression)||void 0===i?void 0:i.activeGroupIndex)&&void 0!==a?a: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}})),bo=ue(["predicate","content","input"]),Io=ue(["predicate","content","value"]);function Eo(e,t){const n=de(bo,(t=>t?e(t):"")),i=de(Io,(t=>"string"==typeof t?e(t):t)),a=G(n,i);return t.map((e=>"Placeholder"===e.type?"TextValue"===e.predicate.type?a(e):n(e):e))}const So=ae($(!0));function wo(e){const t=aa(),n=ra(),i=r(new Map),a=ki(),o=Ci(mo,go(n,a)),s=ea();return d((()=>V((e=>{const n=Eo(s,e);return So(ho(i,n,o,t))}),e)),[i,e,o,t,s])}function Co(e){e&&(e.style.display="")}function Oo(e){e&&(e.style.display="none")}function To(e){return e.settings.duration}const Ao=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],xo=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function No(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const i=t?Ao:xo,a=e.animate(i,{duration:n,iterations:1});return a.onfinish=()=>{t?Co(e):Oo(e)},a.oncancel=()=>{t?Co(e):Oo(e)},()=>{a.finish()}}return t?Co(e):Oo(e),()=>{}}function _o({inTransitions:e,outTransitions:t,visible:n,children:i,containerClassName:s}){const l=r(null);return o((()=>n&&e?e.forEach((e=>{l.current&&function(e,t,n,i){if("FadeIn"===i)No(e,t,n)}(l.current,n,To(e),e.type)})):!n&&t?t.forEach((e=>{l.current&&function(e,t,n,i){if("FadeOut"===i)No(e,t,n)}(l.current,n,To(e),e.type)})):()=>{}),[n]),a.createElement("div",{ref:l,style:{display:"none"},className:s},i)}function Lo(e){const t=Ai(),n=function(e){const t=aa(),n=ra(),i=r(new Map),a=ki(),o=Ci(mo,go(n,a)),s=Eo(ea(),e);return d((()=>So(ho(i,s,o,t))),[i,s,o,t])}(e.schema.predicates),i=a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0))));return e.schema.transition?a.createElement(_o,{inTransitions:e.schema.transition.inTransition,outTransitions:e.schema.transition.outTransition,visible:n},i):"functionally"===e.schema.hide?a.createElement(Ra.Provider,{value:n?"ENABLED":"DISABLED"},i):n?a.createElement(a.Fragment,null,i):null}const Ro=Se(((e,t)=>`${e||""} ${t||""}`.trim())),Do=e=>{var t;const n=l(ta),i=ra(),a=_i()||document.head,o=Wa(),r=hi(o,i,a),s=u(gi,[]),c=Ci([],(e=>Object.values(e.breakpoint.breakpoints))),d=n||s(c,o,i,a),p=e.styles?d(e.styles):{},y=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=Xa(e);return V((e=>eo(t)||!e?null:n({predicates:t.predicates,duration:t.duration,styles:e})),t.value)}(r,null===(t=e.styles)||void 0===t?void 0:t.conditionalTransitions):void 0,f=wo(y?V(F([],"predicates"),y):{}),m=V(((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}(y,t):void 0),f),h=y?V(B("transitionBaseClassname"),y):{},v=e.styles?(g=h,Ro(Ro(p,m),g)):void 0;var g;return e.children({classnames:v,mapperRef:d})};function ko(e){const t=Ai();return a.createElement(Do,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.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},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,qt(i,e.testId))))))}))}function Po(e){const t=Ai();return a.createElement(Do,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.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},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,qt(i,e.testId))))))}))}const $o={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",fn,mn],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},jo=new Map([["&","_;^;_"]]),Go=new RegExp(`<a *(?=${$o.allowedAttributes.a.join("|")}|>)`,"g"),Fo=new RegExp('<a [^>]*href="([^"]+)"',"g"),Mo=new RegExp("(<br *?>)|(<br *?/>)","g"),Bo="<br/>";function Uo(e){const t=ea(),n=Da(),i=d((()=>{const n=t(e.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Fo,((e,t)=>{const n=t.replaceAll("&",jo.get("&"));return e.replace(t,n)})).replaceAll(Mo,Bo)}(e);return t===vt(t,$o)}(n))throw new $t("FAILED_SANITISING_HTML","Invalid HTML tags");return n.trim()?n:""}),[e.schema.value,t]),{tabIndex:o,styles:r,isDisabled:s}=It(n);return i?a.createElement(Do,{styles:e.schema.styles},(({classnames:t})=>{const n=[(null==t?void 0:t.link)?`class = "${null==t?void 0:t.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)?a.createElement("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==t?void 0:t.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(Go,`<a ${n.join(" ")}`)}}):a.createElement("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==t?void 0:t.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(Go,`<a ${n.join(" ")}`)}});var l})):null}function Vo(e){const t=ea()(e.schema.value),n=Da(),{tabIndex:i,styles:o,isDisabled:r}=It(n);return t?a.createElement(Do,{styles:e.schema.styles},(({classnames:n})=>{const s={tabIndex:i,"aria-hidden":r,className:null==n?void 0:n.own,"data-testid":e.testId,"data-e2e":"BasicText"};return e.isInline?a.createElement("span",Object.assign({style:o},s),t):a.createElement("p",Object.assign({style:o},s),t)})):null}function zo(e,t,n){if("BasicText"===e.type)return a.createElement(Vo,{schema:e.node,testId:t,isInline:null!=n&&n})}function Ho(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,qt(i,n)))))}function Wo(e){const t=Si(),n=Ai(),i=Di(),r=ea(),s=ra(),l=Da(),c=i.creative.responseOptionsMap[e.schema.responseKey],d=At(c);o((()=>{d&&t(function(e){if(e.paymentTriggerConfig)return{type:ln,payload:{criteria:{key:"PAYMENT_OFFER_SELECTED"},signal:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:e.action,externalKey:"PAYMENT_OFFER_SELECTED"}}}};throw new Error(`Invalid External Response: No 'paymentTriggerConfig' found for external response option with instanceGuid: ${e.instanceGuid}`)}(c))}),[c,t,d]);const u=c?r({data:c},"creativeResponse"):r,{tabIndex:p,styles:y,isDisabled:f}=It(l);return Ct(c)&&!d&&void 0!==s?a.createElement(Do,{styles:e.schema.styles},(({classnames:o,mapperRef:r})=>{var s;return a.createElement("button",{type:"button",tabIndex:p,"aria-disabled":f,"aria-label":null!==(s=e.schema.a11yLabel)&&void 0!==s?s:void 0,style:Object.assign({cursor:"pointer"},y),"data-testid":e.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":e.schema.responseKey,onClick:e=>{e.preventDefault();const n=function(e,t){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(wt(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,c);t({type:Yt,payload:n})},className:null==o?void 0:o.own,disabled:f},a.createElement(Xi,{value:u},(null==o?void 0:o.own)?function(e,t,n,i,o){return a.createElement(na,{value:n(t)},Ho(e,i,o))}(e.schema.children,o.own,r,n,e.testId):Ho(e.schema.children,n,e.testId)))})):null}function qo(e){const t=Da(),{styles:n,isDisabled:i}=It(t);return e.schema.url.light?a.createElement(Do,{styles:bt(e.schema.styles)},(({classnames:t})=>a.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},n),{display:"inline-block"}),alt:i?void 0:e.schema.alt||void 0,title:e.schema.title||void 0,className:t?t.own:void 0,"data-testid":e.testId,"data-e2e":"StaticImage",src:e.schema.url.light}))):null}function Jo(e){const t=Da(),{styles:n,isDisabled:i}=It(t),o=(e=>{const t=l(ja),n=e.split("|");for(const e of n){const n=t(e.trim(),"images");if(n)return n}})(e.schema.imageKey);return null!=(r=o)&&"object"==typeof r&&"light"in r&&"string"==typeof r.light?a.createElement(Do,{styles:bt(e.schema.styles)},(({classnames:t})=>a.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},n),{display:"inline-block"}),alt:o.alt,title:o.title,className:t?t.own:void 0,"data-testid":e.testId,"data-e2e":"DataImage",src:o.light}))):null;var r}const Yo={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Ko(e){const t=e.schema.name,n=e.schema.description,i=e.schema.styles?Ht(Yo,e.schema.styles):Yo,o=Da(),{styles:r,isDisabled:s}=It(o);return t?a.createElement(Do,{styles:i},(({classnames:i})=>a.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-${t}`},!s&&n?{title:n}:{"aria-hidden":"true"}),t))):null}const Zo={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class Qo extends a.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"===bn.REPORT_RENDER_ERRORS&&this.props.reporter({level:kt,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"===bn.DISPLAY_ERRORS?a.createElement("pre",{style:Zo},a.createElement("strong",null,"Error:")," [",a.createElement("em",null,this.props.schema.type),"]"," ",this.state.errorMessage):void 0:this.props.children}}Qo.contextType=Ma;const Xo={internally:"_top",externally:"_blank"};function er(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function tr(e){var t;const n=Xo[e.schema.open],i=Ai(),o=Da(),{tabIndex:r,styles:s,isDisabled:l}=It(o);return(null===(t=e.schema.children)||void 0===t?void 0:t.length)>0?a.createElement(Do,{styles:e.schema.styles},(({classnames:t,mapperRef:o})=>{var c;return a.createElement("a",{href:e.schema.src,"data-testid":e.testId,"data-e2e":"StaticLink",target:null!=n?n:"_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==t?void 0:t.own},(null==t?void 0:t.own)?function(e,t,n,i,o){return a.createElement(na,{value:n(t)},er(e,i,o))}(e.schema.children,null==t?void 0:t.own,o,i,e.testId):er(e.schema.children,i,e.testId))})):null}function nr(e,t,n){if("StaticLink"===e.type)return a.createElement(tr,{schema:e.node,testId:t,isInline:null!=n&&n})}const ir={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function ar(e){const t=(n=e.schema.iconKey,l(ja)(n,"icons"));var n;const i=null==t?void 0:t.name,o=e.schema.styles?Ht(ir,e.schema.styles):ir,r=Da(),{styles:s}=It(r);return i?a.createElement(Do,{styles:o},(({classnames:t})=>a.createElement("span",{style:Object.assign(Object.assign({},s),{display:"inline-block"}),"aria-hidden":"true",className:"rokt-icon"+((null==t?void 0:t.own)?" "+t.own:""),"data-testid":e.testId,"data-e2e":`DataIcon-${i}`},i))):null}const or=Be`
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from"react";import a,{useEffect as o,useRef as r,createContext as s,useContext as l,useState as c,useMemo as d,useCallback as u,forwardRef as p}from"react";import{createRoot as y}from"react-dom/client";import{useDispatch as f,useSelector as m,connect as h,Provider as v}from"react-redux";import{path as g,assocPath as b,when as I,allPass as E,hasPath as S,complement as C,pathEq as w,cond as O,mergeDeepWith as T,T as A,flip as x,type as N,unary as _,identity as L,concat as R,zipWith as D,slice as k,is as P,equals as $,always as j,compose as G,propOr as F,__ as M,prop as B,memoizeWith as U,mapObjIndexed as V,where as z,not as H,isEmpty as W,forEachObjIndexed as q,pipe as J,split as K,replace as Y,reduce as Z,reduced as Q,partial as X,curry as ee,anyPass as te,toPairs as ne,keys as ie,all as ae,flatten as oe,map as re,values as se,ifElse as le,isNil as ce,over as de,lensPath as ue,zip as pe,pathOr as ye,evolve as fe,append as me,gt as he,lt as ve,either as ge,view as be,add as Ie,lte as Ee,mergeWith as Se,indexBy as Ce,mergeRight as we,lensProp as Oe,defaultTo as Te,findIndex as Ae,sortBy as xe,reject as Ne,whereEq as _e,uniqBy as Le,find as Re,has as De,omit as ke,assoc as Pe,gte as $e,clone as je,mergeDeepRight as Ge,isNotEmpty as Fe,F as Me}from"ramda";import{css as Be,cx as Ue,keyframes as Ve}from"@emotion/css";import{call as ze,actionChannel as He,take as We,put as qe,cancelled as Je,select as Ke,all as Ye,takeEvery as Ze,fork as Qe,takeLatest as Xe,spawn as et,race as tt,delay as nt}from"redux-saga/effects";import{configureStore as it,combineReducers as at}from"@reduxjs/toolkit";import ot,{buffers as rt,eventChannel as st,END as lt}from"redux-saga";import{all as ct,spawn as dt,takeEvery as ut,call as pt,put as yt,take as ft,delay as mt}from"@redux-saga/core/effects";import ht from"embla-carousel-react";import vt from"insane";import gt from"@emotion/css/create-instance";function bt(e){const t=["elements","own"],n=["default","dimension","width","type"],i=["default","dimension","width","value"],a=["default","dimension","minWidth"],o=g(t,e);return o&&Array.isArray(o)&&o.length?b(t,o.map(I(E([S(n),C(S(a)),w("fixed",n)]),(e=>b(a,g(i,e),e)))),e):e}function It(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function Et(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function St(){return"ontouchstart"in document.documentElement}function Ct(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function wt(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function Ot(e){return wt(e)&&"Fulfillment"===e.action}function Tt(e){return wt(e)&&"Url"===e.action}function At(e){return wt(e)&&"ExternalPaymentTrigger"===e.action}function xt(e){return(Ot(e)||Tt(e))&&"RealTime"===e.conversionType&&"rclid"in e}function Nt(e){return(Ot(e)||Tt(e))&&"RealTimeReferral"===e.conversionType&&"rclid"in e}const _t={pluginId:"shared",pageInstanceGuid:"N/A"};var Lt;!function(e){e.DCUI="DCUI",e.Partner="partner"}(Lt||(Lt={}));const Rt=["SignalCartItemQuantitySelected"],Dt="ERROR",kt="WARNING";class Pt extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const $t=["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","INITIATE_INSTANT_PURCHASE_EVENT","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];const jt=(e,t)=>R(e,k(e.length,t.length,t)),Gt=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?jt(t,e):t,i=t.length>e.length?jt(e,t):e;return D(Vt,i,n)}return t},Ft=e=>null==e,Mt=e=>!Ft(e),Bt=(e,t)=>Ft(t)?e:t,Ut=(e,t)=>{throw new Pt("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function Vt(e,t){return O([[(e,t)=>N(e)!==N(t)&&Mt(e)&&Mt(t),Ut],[(e,t)=>Ft(e)||Ft(t),Bt],[(e,t)=>"Object"===N(e),T(Vt)],[(e,t)=>"Array"===N(e),Gt],[A,x(_(L))]])(e,t)}function zt(e,t){return Vt(e,t)}function Ht(e=0){return`breakpoint-${e}px`}function Wt(e,t){return t?`${t}-child${e}`:void 0}const qt="GLOBAL/RAISE_METRIC",Jt="GLOBAL/OFFER_ENGAGEMENT";function Kt(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&Ot(e.responseOption)&&"fulfillment"in e&&Ct(e.fulfillment)}function Yt(e){return At(e)}function Zt(e){return Tt(e)}function Qt(e){return function(e){return wt(e)&&"CaptureOnly"===e.action}(e)}function Xt(e){return!!(xt(e)||"responseOption"in e&&xt(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function en(e){return!!(Nt(e)||"responseOption"in e&&Nt(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}const tn="GLOBAL/RAISE_SIGNAL",nn="GLOBAL/OFFER_LIFECYCLE",an="GLOBAL/SET_CUSTOM_STATE",on="GLOBAL/SEND_PARTNER",rn="GLOBAL/SET_DOMAIN_STATE",sn="GLOBAL/PREPARE_SIGNAL",ln="GLOBAL/OPEN_LINK",cn="GLOBAL/SET_PARTNER_VALIDATION_STATUS",dn="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",un="GLOBAL/LAUNCH_CHILD_LAYOUT",pn={RAISE_METRIC:qt,PREPARE_SIGNAL:sn,OFFER_ENGAGEMENT:Jt,RAISE_SIGNAL:tn,OFFER_LIFECYCLE:nn,SEND_PARTNER:on,SET_CUSTOM_STATE:an,SET_DOMAIN_STATE:rn,OPEN_LINK:ln,SET_PARTNER_VALIDATION_STATUS:cn,SET_GLOBAL_OFFER_DATA_CART:dn,LAUNCH_CHILD_LAYOUT:un},yn="data-open-in-app",fn="data-click-signal-context";function mn(e,t){function n(e){var n;if(!(e.target&&e.target instanceof HTMLElement))return;const i=null===(n=e.target)||void 0===n?void 0:n.closest("a");if(i){const n=i.getAttribute("href"),a=i.getAttribute(fn);if(a&&t({type:tn,payload:{name:"SignalUserInteraction",action:"Click",context:a}}),n){e.preventDefault();let a="newTab";i.hasAttribute(yn)&&(a="inApp"),t({type:ln,payload:{url:n,urlBehaviour:a}})}}}o((()=>null!==e?(e.addEventListener("click",n),()=>{e.removeEventListener("click",n)}):()=>{}),[e])}function hn(){const e=r(null);return o((()=>{const t=t=>{"Tab"===t.key&&vn(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const vn=(e,t)=>{var n;const i=null===(n=t.current)||void 0===n?void 0:n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(!i)return;const a=i[0],o=i[i.length-1],{activeElement:r}=window.document;if(1!==i.length)return r===a&&e.shiftKey?(o&&o.focus(),void e.preventDefault()):r!==o||e.shiftKey?void 0:(a&&a.focus(),void e.preventDefault());e.preventDefault()},gn="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function bn(e,t){return t?"false"!==gn.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${Ht(e)} ${t.trim()}`:`#app-container.${Ht(e)} & {${t}}`:"";var n}const In={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"};function En(e){return function(e){return Object.keys(In).indexOf(e)>-1}(e)?In[e]:""}const Sn={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 Cn(e,t){if(!Sn[e]||!Sn[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return Sn[e][t]}function wn(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function On(...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 Tn(e,t){return`${e}:${t};`}function An(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class xn extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function Nn(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 xn(n,JSON.stringify(t));return!0}function _n(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function Ln(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 Rn(e){if(null==e||""===e)return"value must not be omitted"}function Dn(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 kn(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 Pn(e){if(null!=e&&""!==e)return"value must not be specified"}function $n(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 jn(...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||_n(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function Gn(e,t){return n=>{const i=e(n),a=t(n);if(i&&a)return`one of these must be true: ${i} -OR- ${a}`}}function Fn(e){if("string"!=typeof e)return"value must be a string"}const Mn=P(Object);function Bn(e){const t=Object.entries(e);return n=>Mn(n)&&!Array.isArray(n)?t.reduce(((e,[t,i])=>e||i(n[t])),void 0):`Input value (${e}) must be an object`}function Un(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function Vn(e,t,n){return Nn(_n,n)?Tn(Cn(e,t),`${n}`):""}function zn(e){return(t,n,i)=>Nn(Ln(Object.keys(e)),i)?Tn(Cn(t,n),`${e[i]}`):""}function Hn(e){return Nn(Rn,e)?wn({light:t(kn,!1),dark:t(Gn(Pn,kn),!0)},On("\n "))(e):"";function t(e,t){return n=>{if(Nn(e,n)&&n){const e=Tn("background-image",`url("${n}")`);return t?An(e):e}return""}}}function Wn(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),Nn(Gn(Pn,Ln(Object.keys(t))),e)&&e?Tn("background-size",t[e]):""}const qn=O([[$("top-left"),j("top left")],[$("top-right"),j("top right")],[$("bottom-left"),j("bottom left")],[$("bottom-right"),j("bottom right")],[A,L]]);function Jn(e){const t="string"==typeof e?e.toLowerCase():e;return Nn(Gn(Pn,Ln(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?Tn("background-position",qn(t)):""}function Kn(e,t,n){return Nn(Gn(_n,jn(2,3,4)),n)?Tn(Cn(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function Yn(e){return(t,n,i)=>Nn($n({fit:Ln(e),percentage:_n,fixed:_n}),i)?Tn(Cn(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]}}(i)):""}const Zn=Bn({light:Dn,dark:Gn(Pn,Dn)});function Qn(e,t,n){return i=>{if(i){const a=Tn(Cn(e,t),ei(String(i)));return n?An(a):a}return""}}function Xn(e,t,n){return Nn(Zn,n)?wn({light:Qn(e,t,!1),dark:Qn(e,t,!0)},On("\n "))(n):""}function ei(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 ti=Bn({offsetX:Gn(Pn,_n),offsetY:Gn(Pn,_n),blurRadius:Gn(Pn,_n),spreadRadius:Gn(Pn,_n),color:Zn}),ni=e=>t=>null!=t?String(t):e,ii=G(R(M,"px"),ni("0")),ai=e=>t=>"string"==typeof t?e(t):t,oi=G(ai(R(M,"px")),ni(void 0)),ri=G(ai(ei),B("dark"));function si(e,t,n){return Tn(e,wn({offsetX:ii,offsetY:ii,blurRadius:t.spreadRadius?ii:oi,spreadRadius:oi,color:n},On(" "))(t))}const li={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},ci={container:{justifyContent:zn(li),alignItems:zn(li),shadow:function(e,t,n){var i;if(Nn(ti,n)){const a=Cn(e,t);return On("\n")(si(a,n,G(ei,F("#80000000","light"))),(null===(i=n.color)||void 0===i?void 0:i.dark)?An(si(a,n,ri)):"")}return""},gap:Kn,overflow:zn({hidden:"hidden",visible:"visible"}),blur:function(e,t,n){return Nn(Un,n)?Tn(Cn(e,t),`blur(${n.toString()}px)`):""},opacity:Vn},text:{textColor:Xn,fontSize:Kn,fontFamily:function(e,t,n){return Nn(Fn,n)?Tn(Cn(e,t),(i=`${n}`,i.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 i},fontWeight:zn({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:zn({normal:"normal",italic:"italic"}),lineHeight:Kn,lineLimit:function(e,t,n){return Nn(_n,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:Kn,baselineTextAlign:zn({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:zn({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:zn({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:zn({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:Xn,backgroundImage:function(e,t,n){return Nn(Rn,n)?wn({url:Hn,position:Jn,scale:Wn},On)(n):""}},dimension:{width:Yn(["wrap-content","fit-width"]),maxWidth:Kn,minWidth:Kn,height:Yn(["wrap-content","fit-height"]),maxHeight:Kn,minHeight:Kn,rotateZ:(di="Z",(e,t,n)=>{const i=`rotate${di}`;return Nn(_n,n)?Tn(Cn(e,t),`${i}(${n.toString()}deg)`):""})},flexChild:{alignSelf:zn(li),weight:Vn,order:Vn},spacing:{margin:Kn,padding:Kn,offset:function(e,t,n){return Nn(jn(2),n)?`transform:translate(${n.split(" ").join("px, ")}px)`:""}},border:{borderColor:Xn,borderRadius:Kn,borderWidth:Kn,borderStyle:zn({solid:"solid",dashed:"dashed"})}};var di;function ui(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((i=>{if(!ci[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const a=ci[n][i];if(!a)throw new Error(`No styling transformer exists for property: ${n}.${i.toString()}`);try{t+=a(n,i,e[n][i])}catch(e){throw e&&"object"==typeof e&&"message"in e&&(e.message=`Error parsing styling key ${n}.${i.toString()}: ${e.message}`),e}})),t)),"")}const pi="FAILED_TEMPLATING_DATA",yi=new Map;function fi(e){return String.fromCharCode(97+e)}function mi(e,t,n){const i=`${e||_t.pluginId}-${void 0!==t?String(t):"outer"}`,a=yi.get(i);if(a&&a.sheet.container.isConnected)return a.css;const o=function(e,t){const n={key:void 0!==e?`inner-css-${fi(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),gt(n)}(t,n);return yi.set(i,o),o.css}const hi="%%%OWN_CLASS_REF%%%",vi=U(((e,t,n,i)=>`${String(e)}-${t}-${n}`),gi);function gi(e,t,n,i){const a=mi(t,n,i);let o=1;return function t(n,i=!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,a])=>Object.assign(Object.assign({},t),{[n]:bi(a,l,i,String(n),e)})),{}),n=Object.entries(t),r=i?"parent-"+o++:"",s=function(e){return"own"in e&&"string"==typeof e.own&&e.own.length>0}(t)?a(t.own):"";return n.reduce(((e,[t,n=""])=>{if("own"===t)return e;const i=n.replace(hi,r);return Object.assign(Object.assign({},e),{[t]:i?a(i):""})}),{own:`${s}${s&&r?" ":""}${r}`})}catch(e){const t=e;throw t.code="FAILED_PARSING_STYLES",t}}.bind({})}function bi(e,t,n,i,a){return e.map(function(e,t,n){return i=>Object.entries(i).map((([i,a])=>{const o=a?ui(a):"";switch(!0){case"default"===i:return o?`\n${o}\n`:"";case Boolean(e):return`\n .${e}${En(i)} & {\n${o}\n}\n`;case t&&"own"!==n:return`\n .${hi}${En(i)} & {\n${o}\n}\n`;default:return`\n &${En(i)} {\n${o}\n}\n`}})).join("")}(t,n,i)).reduce(((e,t,n)=>{const i=a[n];return void 0!==i?e+(0===n?t:`${bn(i,t)}\n`):e}),"")}const Ii=s(j(void 0)),Ei=()=>l(Ii),Si=s(null);function Ci(e,t){var n;const i=l(Si);return i&&null!==(n=t(i))&&void 0!==n?n:e}const wi=s((()=>{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")})),Oi=wi.Consumer,Ti=()=>l(wi),Ai=e=>a.createElement(wi.Provider,{value:(t,n,i)=>e.value(t,null!=n?n:e.overrides,i)},e.children),xi=s(null),Ni=()=>l(xi),_i=s({get(){throw Error("Offer context has not been set")}}),Li=e=>a.createElement(_i.Provider,{value:{get:()=>e.context}},e.children),Ri=()=>l(_i).get(),Di=()=>{try{return l(_i).get().creative.copy}catch(e){return}},ki=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),Pi=G(H,W),$i=z({url:Pi,title:Pi});function ji(e,t,n){return t.reduce(((t,n)=>{const[i,a]=n.slice(0,-1).split("["),o=a?a.split(","):[];if(!i)throw new Error(Fi(e,"This Meta Attribute could not be parsed."));return function(e,t,n,i){switch(t){case"openLinks":return function(e,t,n){Gi(t,e,"openLinks",1,2);const i=Mi(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),a=Bi(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===i)return n.replace(ki,((e,t)=>`<a ${yn} ${a?`${fn}="${a}" `:""}${t}`));return n}(e,n,i);case"sliceText":return function(e,t,n){Gi(t,e,"sliceText",2,2);const i=Mi(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),a=Mi(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"===i)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,a);throw Error(Fi(e,`Unknown "SliceBy" value. ${i}`))}(e,n,i);default:throw new Error(Fi(e,`Unknown Meta Attribute '${t}'.`))}}(e,i,o,t)}),n)}function Gi(e,t,n,i,a){const o=new Error(Fi(t,`${n} meta attribute takes ${i!=a?`between ${i} and ${a}`:i} arguments; received ${e.length}.`));if(e.length<i||e.length>a)throw o}function Fi(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function Mi(e,t,n,i,a){const o=Bi(e,n,i);if(null!==o)return o;throw Error(Fi(t,a||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function Bi(e,t,n){return n(e[t])}const Ui="DATA",Vi="STATE",zi=new RegExp(`^(${Ui}|${Vi})`),Hi=new RegExp(`^${Vi}`),Wi=new RegExp(`%\\^(?:${Ui}|${Vi})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*(?:\\:[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,]*\\])*(?:\\|.*?)?\\^%`,"g"),qi=Symbol("invalid");function Ji(e,t="creativeCopy"){const n=Ki({data:e},t);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Ki(t,n,this.dataMap)});let i=!1;const a=t,o=J(k(2,-2),K("|"),(e=>{const t=Z(((e,t)=>{let n;if(zi.test(t)){if(!this.dataMap.has(t)&&Hi.test(t))throw new Pt(pi,`Invalid use of STATE template key in a context it does not exist: ${t}`);const i=K(":",t);if(i[0]){if(n=this.dataMap.get(i[0]),n&&n===qi)throw new Pt(pi,`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(i.length>1&&n)try{n=ji(i[0],i.slice(1),n)}catch(e){throw new Pt(pi,`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?Q({provided:!0,value:n}):e}return Q({provided:!0,value:t})}),{provided:!1,value:""},e);return t.provided||(i=!0),t.value})),r=Y(Wi,o,a);return!1===i?r:""}.bind({dataMap:n})}function Ki(e,t,n){const i=new Map(n);return"data"in e&&a(e.data,`${Ui}${t?"."+t:""}`),"state"in e&&a(e.state,`${Vi}${t?"."+t:""}`),i;function a(e,t){"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e?i.set(t,(null==e?void 0:e.toString())||""):i.set(t,qi),e&&"object"==typeof e&&q(((e,n)=>a(e,`${t}.${n}`)),e)}}const Yi=s(Ji({})),Zi=Yi.Consumer,Qi=Yi.Provider,Xi=()=>l(Yi),ea=s(null),ta=ea.Provider,na=s("OUTER"),ia=()=>"VARIANT"===l(na),aa=s(void 0),oa=()=>l(aa);var ra,sa,la,ca,da,ua,pa=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))},ya=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},fa=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};class ma{constructor(e,t,n,i,a){ra.set(this,void 0),sa.set(this,void 0),la.set(this,new Set),ca.set(this,void 0),da.set(this,void 0),ua.set(this,void 0),ya(this,ra,X(e.subscribe.bind(e),[n]),"f"),ya(this,sa,X(e.dispatch.bind(e),[n]),"f"),ya(this,ca,t,"f"),ya(this,da,i,"f"),ya(this,ua,a,"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=fa(this,ra,"f").call(this,e),n=()=>{t(),fa(this,la,"f").delete(n)};return fa(this,la,"f").add(n),n}onInteractivityChange(e){return fa(this,da,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=fa(this,ua,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),fa(this,la,"f").delete(n)};return fa(this,la,"f").add(n),n}globalDispatch(e){fa(this,sa,"f").call(this,e)}dispose(){fa(this,la,"f").forEach((e=>e())),ya(this,la,new Set,"f"),fa(this,da,"f").clear()}createChildPlugin(e){return fa(this,ca,"f").call(this,e)}}ra=new WeakMap,sa=new WeakMap,la=new WeakMap,ca=new WeakMap,da=new WeakMap,ua=new WeakMap;class ha{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>pa(this,void 0,void 0,(function*(){})),onClose:()=>pa(this,void 0,void 0,(function*(){})),putConfig:()=>pa(this,void 0,void 0,(function*(){})),send:()=>pa(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var va,ga,ba=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},Ia=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};class Ea{constructor(e){va.set(this,void 0),ga.set(this,new Set),ba(this,va,e,"f")}subscribe(e){return Ia(this,ga,"f").add(e),!0===e(Ia(this,va,"f"))&&Ia(this,ga,"f").delete(e),()=>{Ia(this,ga,"f").delete(e)}}publish(e){ba(this,va,e,"f"),Ia(this,ga,"f").forEach((e=>{!0===e(Ia(this,va,"f"))&&Ia(this,ga,"f").delete(e)}))}clear(){Ia(this,ga,"f").clear()}}va=new WeakMap,ga=new WeakMap;var Sa=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)},Ca=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n};const wa="breakpoint-0px";class Oa{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,i,a,o,r,s,l,c,d,u,p,y;const f=this.appFactory,m=this.logger,h=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new ha;return y=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint"]}constructor(){super(),t.add(this),n.set(this,(()=>null)),i.set(this,(()=>null)),a.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"});Ca(this,a,document.createElement("div"),"f"),Sa(this,a,"f").id="app-container",Sa(this,a,"f").classList.add("default"),e.appendChild(Sa(this,a,"f"))}attributeChangedCallback(e,a,o){if(o!==a)switch(e){case"visible":Sa(this,n,"f").call(this,"true"===o);break;case"interactivity":"ENABLED"!==o&&"DISABLED"!==o||Sa(this,i,"f").call(this,o);break;case"active-breakpoint":Sa(this,t,"m",c).call(this,o,a)}}makeInteractivityUpdateHandler(e){Ca(this,i,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,i,a){const o="true"===this.getAttribute("visible"),r=this.getAttribute("slotInstanceGuid");Ca(this,n,(o=>{o?(Ca(this,n,(()=>null),"f"),0===e&&a.globalDispatch({type:nn,payload:{event:"Interactive"}}),i&&(a.globalDispatch({type:tn,payload:{name:"SignalImpression",parentGuid:i}}),this.trackViewability(i,a)),r&&a.globalDispatch({type:tn,payload:{name:"SignalImpression",parentGuid:r}})):Sa(this,t,"m",p).call(this)}),"f"),Sa(this,n,"f").call(this,o)}trackViewability(e,n){if(!Sa(this,o,"f"))if("IntersectionObserver"in window&&!Sa(this,r,"f")){const i=()=>{Sa(this,o,"f")||(n.globalDispatch({type:tn,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!0}}),Ca(this,o,!0,"f"),Sa(this,t,"m",p).call(this),Sa(this,a,"f").removeEventListener("click",i))};Sa(this,a,"f").addEventListener("click",i),Ca(this,r,new IntersectionObserver((r=>{r.forEach((r=>{r.isIntersecting&&r.intersectionRatio>=.5?Sa(this,t,"m",u).call(this,(()=>{Sa(this,o,"f")||(n.globalDispatch({type:tn,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!1}}),Ca(this,o,!0,"f"),Sa(this,t,"m",p).call(this),Sa(this,a,"f").removeEventListener("click",i))})):Sa(this,t,"m",d).call(this)}))}),{threshold:.5}),"f"),Ca(this,l,(()=>{var e,n;"visible"===document.visibilityState?null===(e=Sa(this,r,"f"))||void 0===e||e.observe(Sa(this,a,"f")):(Sa(this,t,"m",d).call(this),null===(n=Sa(this,r,"f"))||void 0===n||n.disconnect())}),"f"),document.addEventListener("visibilitychange",Sa(this,l,"f")),Sa(this,l,"f").call(this)}else n.globalDispatch({type:tn,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!1,inferred:!1}}),Ca(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(){Sa(this,t,"m",p).call(this)}connectedCallback(){var e,t,n;const i=this.getAttribute("container"),o=this.getAttribute("plugin-id");Sa(this,a,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===i?"column":"row"));const r=this.getOfferPositionAttr(),s=this.getJSONAttr("layoutSchema"),l=this.getJSONAttr("childLayouts","[]"),c=this.getJSONAttr("offerData"),d=new Ea("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),u=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"",p=this.getJSONAttr("offerState","{}");f||v("Cannot create app without factory. Please build the connector withAppFactory.");const y=h({offerPositionIndex:r,creativeInstanceGuid:null===(t=null==c?void 0:c.creative)||void 0===t?void 0:t.instanceGuid},d);this.makeInteractivityUpdateHandler(d),f({rootElement:Sa(this,a,"f"),gateway:y,logger:m,offerPositionIndex:r,offerData:c,layoutSchema:s,childLayouts:l,schemaVersion:u,pluginId:o||_t.pluginId,offerState:p}),this.makeVisbilityUpdateHandler(r,null===(n=null==c?void 0:c.creative)||void 0===n?void 0:n.instanceGuid,y)}},n=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,r=new WeakMap,s=new WeakMap,l=new WeakMap,t=new WeakSet,c=function(e,t){Sa(this,a,"f").classList.remove(t||wa),Sa(this,a,"f").classList.add(e||wa)},d=function(){Sa(this,s,"f")&&(clearTimeout(Sa(this,s,"f")),Ca(this,s,null,"f"))},u=function(e){Sa(this,t,"m",d).call(this),Ca(this,s,window.setTimeout(e,1e3),"f")},p=function(){Sa(this,t,"m",d).call(this),Sa(this,r,"f")&&(Sa(this,r,"f").disconnect(),Ca(this,r,null,"f")),Sa(this,l,"f")&&(document.removeEventListener("visibilitychange",Sa(this,l,"f")),Ca(this,l,null,"f"))},y;function v(e){throw m({level:Dt,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const Ta=s({get:()=>new ha}),Aa=e=>a.createElement(Ta.Provider,{value:{get:()=>e.context}},e.children);const xa=s({get(){throw Error("Layout Schema context has not been set")}}),Na=e=>a.createElement(xa.Provider,{value:{get:()=>e.context}},e.children),_a=()=>l(xa).get(),La=s("ENABLED"),Ra=()=>l(La);function Da(e){const t=Pa(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:Pa(t,this.dataMap)});if(!n)throw new Pt("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");return g([n,t],this.dataMap)}.bind({dataMap:t})}const ka={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function Pa(e,t=ka){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 $a=s(Da({}));$a.Consumer;const ja=$a.Provider,Ga=()=>l($a),Fa=s({});function Ma({info:e,children:t}){const n=l(Fa);return a.createElement(Fa.Provider,{value:Object.assign(Object.assign({},n),e)},t)}const Ba=s({get(){throw Error("Catalog Item context has not been set")}}),Ua=e=>a.createElement(Ba.Provider,{value:{get:()=>e.context}},e.children),Va=()=>l(Ba).get(),za=s(""),Ha=()=>l(za),Wa=s(""),qa=s(void 0);function Ja({children:e}){const t=d((()=>{const e=document.createElement("div");return e.inert=!0,{inert:!0===e.inert}}),[]);return a.createElement(qa.Provider,{value:t},e)}const Ka=G(te([W,ae(W)]),oe,re(se),re(le(ce,j({}),L)),se,F({},"value")),Ya=G(W,B("predicates"));function Za(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const Qa=ee(((e,{duration:t,predicates:n,styles:i})=>{return{predicates:n,classname:e(ui(i)),transitionBaseClassname:e(Za(t,(a=i,ne(a).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?ie(n).map((e=>Cn(t,e))):[]})))))};var a})),Xa=te([Ka,Ya]);const eo={is:$,"is-not":G(H,$),"is-below":ve,"is-above":he};function to(e,t){return e.includes(t)}const no={is:$,"is-not":G(H,$),exists:to,"not-exists":G(H,to)},io={exists:G(H,ge(ce,W)),"not-exists":ge(ce,W)},ao={"is-true":$(!0),"is-false":$(!1)},oo={is:$,"is-not":G(H,$)};function ro(e){return(t,n)=>n[e]}const so=O([[(e,t)=>$("Breakpoint",e),ro("activeBreakpoint")],[(e,t)=>$("Progression",e),ro("progressionIndex")],[(e,t)=>$("Position",e),ro("positionIndex")]]);function lo(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const co=O([[$("Breakpoint"),(e,t,n)=>{const i=ue(["breakpoints",t]);return J(de(i,Number),be(i))(n)}],[$("Progression"),(e,t,n)=>O([[he(0),Ie(n.totalGroups)],[Ee(0),L]])(Number(t))],[$("Position"),(e,t,n)=>O([[he(0),Ie(n.totalOffers)],[Ee(0),L]])(Number(t))]]),uo=G(H,isNaN);function po(e,t){return e.map((e=>{var n,i,a;switch(e.type){case"StaticString":return(0,oo[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,io[e.predicate.condition])(lo(t,e.predicate.value));case"StaticBoolean":return(0,ao[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,eo[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,eo[e.predicate.condition])(null!==(i=t.domainStates[e.predicate.key])&&void 0!==i?i: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,no[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,eo[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"Numeric":return(0,eo[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=eo[e.predicate.condition],i=null!==(a=so(e.type,t))&&void 0!==a?a:NaN,o=co(e.type,e.predicate.value,t);return!!uo(i)&&n(i,o)}}}))}function yo(e){return ye(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const fo={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{}};function mo(e,t,n,i){const a=t.map((e=>"Progression"===e.type?Object.assign(Object.assign({},e),{type:i?"Position":e.type}):e)),{cached:o,uncached:r}=a.reduce(((t,i)=>function(e,t,n,i){const a=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:${lo(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:${so(e.type,t)}:${t.totalGroups}`}}(e,t),o=n.current.get(a);return fe(ho(o)?{cached:me(o)}:{uncached:me({key:a,predicate:e})},i)}(i,n,e,t)),{cached:[],uncached:[]}),s=po(r.map((({predicate:e})=>e)),n);return pe(r,s).forEach((([{key:t},n])=>{e.current.set(t,n)})),o.concat(s)}const ho=P(Boolean);const vo=ee(((e,t,n)=>{var i,a,o,r,s,l;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:yo(n),progressionIndex:null!==(a=null===(i=n.progression)||void 0===i?void 0:i.activeGroupIndex)&&void 0!==a?a: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}})),go=ue(["predicate","content","input"]),bo=ue(["predicate","content","value"]);function Io(e,t){const n=de(go,(t=>t?e(t):"")),i=de(bo,(t=>"string"==typeof t?e(t):t)),a=G(n,i);return t.map((e=>"Placeholder"===e.type?"TextValue"===e.predicate.type?a(e):n(e):e))}const Eo=ae($(!0));function So(e){const t=ia(),n=oa(),i=r(new Map),a=Di(),o=Ci(fo,vo(n,a)),s=Xi();return d((()=>V((e=>{const n=Io(s,e);return Eo(mo(i,n,o,t))}),e)),[i,e,o,t,s])}function Co(e){e&&(e.style.display="")}function wo(e){e&&(e.style.display="none")}function Oo(e){return e.settings.duration}const To=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],Ao=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function xo(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const i=t?To:Ao,a=e.animate(i,{duration:n,iterations:1});return a.onfinish=()=>{t?Co(e):wo(e)},a.oncancel=()=>{t?Co(e):wo(e)},()=>{a.finish()}}return t?Co(e):wo(e),()=>{}}function No({inTransitions:e,outTransitions:t,visible:n,children:i,containerClassName:s}){const l=r(null);return o((()=>n&&e?e.forEach((e=>{l.current&&function(e,t,n,i){if("FadeIn"===i)xo(e,t,n)}(l.current,n,Oo(e),e.type)})):!n&&t?t.forEach((e=>{l.current&&function(e,t,n,i){if("FadeOut"===i)xo(e,t,n)}(l.current,n,Oo(e),e.type)})):()=>{}),[n]),a.createElement("div",{ref:l,style:{display:"none"},className:s},i)}function _o(e){const t=Ti(),n=function(e){const t=ia(),n=oa(),i=r(new Map),a=Di(),o=Ci(fo,vo(n,a)),s=Io(Xi(),e);return d((()=>Eo(mo(i,s,o,t))),[i,s,o,t])}(e.schema.predicates),i=a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0))));return e.schema.transition?a.createElement(No,{inTransitions:e.schema.transition.inTransition,outTransitions:e.schema.transition.outTransition,visible:n},i):"functionally"===e.schema.hide?a.createElement(La.Provider,{value:n?"ENABLED":"DISABLED"},i):n?a.createElement(a.Fragment,null,i):null}const Lo=Se(((e,t)=>`${e||""} ${t||""}`.trim())),Ro=e=>{var t;const n=l(ea),i=oa(),a=Ni()||document.head,o=Ha(),r=mi(o,i,a),s=u(vi,[]),c=Ci([],(e=>Object.values(e.breakpoint.breakpoints))),d=n||s(c,o,i,a),p=e.styles?d(e.styles):{},y=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=Qa(e);return V((e=>Xa(t)||!e?null:n({predicates:t.predicates,duration:t.duration,styles:e})),t.value)}(r,null===(t=e.styles)||void 0===t?void 0:t.conditionalTransitions):void 0,f=So(y?V(F([],"predicates"),y):{}),m=V(((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}(y,t):void 0),f),h=y?V(B("transitionBaseClassname"),y):{},v=e.styles?(g=h,Lo(Lo(p,m),g)):void 0;var g;return e.children({classnames:v,mapperRef:d})};function Do(e){const t=Ti();return a.createElement(Ro,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.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},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}function ko(e){const t=Ti();return a.createElement(Ro,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.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},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}const Po={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",yn,fn],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},$o=new Map([["&","_;^;_"]]),jo=new RegExp(`<a *(?=${Po.allowedAttributes.a.join("|")}|>)`,"g"),Go=new RegExp('<a [^>]*href="([^"]+)"',"g"),Fo=new RegExp("(<br *?>)|(<br *?/>)","g"),Mo="<br/>";function Bo(e){const t=Xi(),n=Ra(),i=d((()=>{const n=t(e.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Go,((e,t)=>{const n=t.replaceAll("&",$o.get("&"));return e.replace(t,n)})).replaceAll(Fo,Mo)}(e);return t===vt(t,Po)}(n))throw new Pt("FAILED_SANITISING_HTML","Invalid HTML tags");return n.trim()?n:""}),[e.schema.value,t]),{tabIndex:o,styles:r,isDisabled:s}=It(n);return i?a.createElement(Ro,{styles:e.schema.styles},(({classnames:t})=>{const n=[(null==t?void 0:t.link)?`class = "${null==t?void 0:t.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)?a.createElement("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==t?void 0:t.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(jo,`<a ${n.join(" ")}`)}}):a.createElement("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==t?void 0:t.own,"data-testid":e.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:i.replace(jo,`<a ${n.join(" ")}`)}});var l})):null}function Uo(e){const t=Xi()(e.schema.value),n=Ra(),{tabIndex:i,styles:o,isDisabled:r}=It(n);return t?a.createElement(Ro,{styles:e.schema.styles},(({classnames:n})=>{const s={tabIndex:i,"aria-hidden":r,className:null==n?void 0:n.own,"data-testid":e.testId,"data-e2e":"BasicText"};return e.isInline?a.createElement("span",Object.assign({style:o},s),t):a.createElement("p",Object.assign({style:o},s),t)})):null}function Vo(e,t,n){if("BasicText"===e.type)return a.createElement(Uo,{schema:e.node,testId:t,isInline:null!=n&&n})}function zo(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,Wt(i,n)))))}function Ho(e){const t=Ei(),n=Ti(),i=Ri(),r=Xi(),s=oa(),l=Ra(),c=i.creative.responseOptionsMap[e.schema.responseKey],d=At(c);o((()=>{d&&t(function(e){if(e.paymentTriggerConfig)return{type:sn,payload:{criteria:{key:"PAYMENT_OFFER_SELECTED"},signal:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:e.action,externalKey:"PAYMENT_OFFER_SELECTED"}}}};throw new Error(`Invalid External Response: No 'paymentTriggerConfig' found for external response option with instanceGuid: ${e.instanceGuid}`)}(c))}),[c,t,d]);const u=c?r({data:c},"creativeResponse"):r,{tabIndex:p,styles:y,isDisabled:f}=It(l);return wt(c)&&!d&&void 0!==s?a.createElement(Ro,{styles:e.schema.styles},(({classnames:o,mapperRef:r})=>{var s;return a.createElement("button",{type:"button",tabIndex:p,"aria-disabled":f,"aria-label":null!==(s=e.schema.a11yLabel)&&void 0!==s?s:void 0,style:Object.assign({cursor:"pointer"},y),"data-testid":e.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":e.schema.responseKey,onClick:e=>{e.preventDefault();const n=function(e,t){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(Ct(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,c);t({type:Jt,payload:n})},className:null==o?void 0:o.own,disabled:f},a.createElement(Qi,{value:u},(null==o?void 0:o.own)?function(e,t,n,i,o){return a.createElement(ta,{value:n(t)},zo(e,i,o))}(e.schema.children,o.own,r,n,e.testId):zo(e.schema.children,n,e.testId)))})):null}function Wo(e){const t=Ra(),{styles:n,isDisabled:i}=It(t);return e.schema.url.light?a.createElement(Ro,{styles:bt(e.schema.styles)},(({classnames:t})=>a.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},n),{display:"inline-block"}),alt:i?void 0:e.schema.alt||void 0,title:e.schema.title||void 0,className:t?t.own:void 0,"data-testid":e.testId,"data-e2e":"StaticImage",src:e.schema.url.light}))):null}function qo(e){const t=Ra(),{styles:n,isDisabled:i}=It(t),o=(e=>{const t=l($a),n=e.split("|");for(const e of n){const n=t(e.trim(),"images");if(n)return n}})(e.schema.imageKey);return null!=(r=o)&&"object"==typeof r&&"light"in r&&"string"==typeof r.light?a.createElement(Ro,{styles:bt(e.schema.styles)},(({classnames:t})=>a.createElement("img",{"aria-hidden":i,style:Object.assign(Object.assign({},n),{display:"inline-block"}),alt:o.alt,title:o.title,className:t?t.own:void 0,"data-testid":e.testId,"data-e2e":"DataImage",src:o.light}))):null;var r}const Jo={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Ko(e){const t=e.schema.name,n=e.schema.description,i=e.schema.styles?zt(Jo,e.schema.styles):Jo,o=Ra(),{styles:r,isDisabled:s}=It(o);return t?a.createElement(Ro,{styles:i},(({classnames:i})=>a.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-${t}`},!s&&n?{title:n}:{"aria-hidden":"true"}),t))):null}const Yo={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class Zo extends a.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"===gn.REPORT_RENDER_ERRORS&&this.props.reporter({level:Dt,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"===gn.DISPLAY_ERRORS?a.createElement("pre",{style:Yo},a.createElement("strong",null,"Error:")," [",a.createElement("em",null,this.props.schema.type),"]"," ",this.state.errorMessage):void 0:this.props.children}}Zo.contextType=Fa;const Qo={internally:"_top",externally:"_blank"};function Xo(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function er(e){var t;const n=Qo[e.schema.open],i=Ti(),o=Ra(),{tabIndex:r,styles:s,isDisabled:l}=It(o);return(null===(t=e.schema.children)||void 0===t?void 0:t.length)>0?a.createElement(Ro,{styles:e.schema.styles},(({classnames:t,mapperRef:o})=>{var c;return a.createElement("a",{href:e.schema.src,"data-testid":e.testId,"data-e2e":"StaticLink",target:null!=n?n:"_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==t?void 0:t.own},(null==t?void 0:t.own)?function(e,t,n,i,o){return a.createElement(ta,{value:n(t)},Xo(e,i,o))}(e.schema.children,null==t?void 0:t.own,o,i,e.testId):Xo(e.schema.children,i,e.testId))})):null}function tr(e,t,n){if("StaticLink"===e.type)return a.createElement(er,{schema:e.node,testId:t,isInline:null!=n&&n})}const nr={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function ir(e){const t=(n=e.schema.iconKey,l($a)(n,"icons"));var n;const i=null==t?void 0:t.name,o=e.schema.styles?zt(nr,e.schema.styles):nr,r=Ra(),{styles:s}=It(r);return i?a.createElement(Ro,{styles:o},(({classnames:t})=>a.createElement("span",{style:Object.assign(Object.assign({},s),{display:"inline-block"}),"aria-hidden":"true",className:"rokt-icon"+((null==t?void 0:t.own)?" "+t.own:""),"data-testid":e.testId,"data-e2e":`DataIcon-${i}`},i))):null}const ar=Be`
2
2
  display: flex;
3
3
  position: relative;
4
4
  overflow: hidden;
@@ -6,7 +6,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
6
6
  > * {
7
7
  position: absolute !important;
8
8
  }
9
- `;function rr(e){const t=Ai(),n=r(null);return o((()=>{const e=new ResizeObserver((()=>{requestAnimationFrame((()=>{if(n.current){const e=Array.from(n.current.children).reduce(((e,t)=>Math.max(e,t.clientHeight)),0);n.current.style.height=`${e}px`}}))}));return n.current&&Array.from(n.current.children).forEach((t=>{e.observe(t)})),()=>{e.disconnect()}}),[]),a.createElement(Do,{styles:e.schema.styles},(({classnames:i})=>{var o;return a.createElement("div",{ref:n,className:[or,null==i?void 0:i.own].filter(Boolean).join(" ")||void 0,"aria-label":null!==(o=e.schema.a11yLabel)&&void 0!==o?o:void 0,"data-testid":e.testId,"data-e2e":"ZStack"},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,qt(i,e.testId))))))}))}const sr={elements:{own:[{default:{dimension:{width:{type:"percentage",value:100},height:{type:"fixed",value:50}},background:{backgroundColor:{light:"#000"}},border:{borderRadius:25}}}],thumb:[{default:{dimension:{width:{type:"fixed",value:50},height:{type:"fixed",value:50}},background:{backgroundColor:{light:"#FFF"}},text:{fontSize:22,fontFamily:"rokt-icons",horizontalTextAlign:"center"},border:{borderRadius:25}}}],fill:[{default:{background:{backgroundColor:{light:"#000"}}}}],label:[{default:{text:{fontSize:18,textColor:{light:"#FFF"},horizontalTextAlign:"center"}}}]}};function lr(e){const[t,n]=c(!1),[i,s]=c(!1),l=Wa(),d=Da(),u=ra(),p=Si(),{customStateKey:y,customStateValue:f,label:m,a11yLabel:h,thumb:v}=e.schema,{containerClass:g,trackClass:b,fillClass:I,thumbClass:E,labelClass:S,buttonClass:w}=function(e,t){const n=hi(e,t);return{containerClass:n`
9
+ `;function or(e){const t=Ti(),n=r(null);return o((()=>{const e=new ResizeObserver((()=>{requestAnimationFrame((()=>{if(n.current){const e=Array.from(n.current.children).reduce(((e,t)=>Math.max(e,t.clientHeight)),0);n.current.style.height=`${e}px`}}))}));return n.current&&Array.from(n.current.children).forEach((t=>{e.observe(t)})),()=>{e.disconnect()}}),[]),a.createElement(Ro,{styles:e.schema.styles},(({classnames:i})=>{var o;return a.createElement("div",{ref:n,className:[ar,null==i?void 0:i.own].filter(Boolean).join(" ")||void 0,"aria-label":null!==(o=e.schema.a11yLabel)&&void 0!==o?o:void 0,"data-testid":e.testId,"data-e2e":"ZStack"},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}const rr={elements:{own:[{default:{dimension:{width:{type:"percentage",value:100},height:{type:"fixed",value:50}},background:{backgroundColor:{light:"#000"}},border:{borderRadius:25}}}],thumb:[{default:{dimension:{width:{type:"fixed",value:50},height:{type:"fixed",value:50}},background:{backgroundColor:{light:"#FFF"}},text:{fontSize:22,fontFamily:"rokt-icons",horizontalTextAlign:"center"},border:{borderRadius:25}}}],fill:[{default:{background:{backgroundColor:{light:"#000"}}}}],label:[{default:{text:{fontSize:18,textColor:{light:"#FFF"},horizontalTextAlign:"center"}}}]}};function sr(e){const[t,n]=c(!1),[i,s]=c(!1),l=Ha(),d=Ra(),u=oa(),p=Ei(),{customStateKey:y,customStateValue:f,label:m,a11yLabel:h,thumb:v}=e.schema,{containerClass:g,trackClass:b,fillClass:I,thumbClass:E,labelClass:S,buttonClass:C}=function(e,t){const n=mi(e,t);return{containerClass:n`
10
10
  position: relative;
11
11
  z-index: 1;
12
12
  flex: 1;
@@ -54,7 +54,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
54
54
  z-index: 0;
55
55
  background-color: #00000000;
56
56
  color: #00000000;
57
- `}}(l,u);if(!y)throw new Error("No custom state key provided for state trigger node.");const C={type:on,payload:{key:y,value:null!=f?f:1}},O={type:nn,payload:{name:"SignalUserInteraction",action:"Swipe",context:"SlideStateTrigger"}},T=e.schema.styles?Ht(sr,e.schema.styles):sr,A=r(null),x=r(null),N=r(null),_=r(!1),L=r(void 0),{isDisabled:R}=It(d);o((()=>{if(t)return St()?(document.addEventListener("touchmove",P),document.addEventListener("touchend",D)):(document.addEventListener("mousemove",P),document.addEventListener("mouseup",D)),M}),[t]);const D=()=>{M(),L.current=void 0,n(!1),i||(F(!0),_.current?(G(j()),$()):G(0))},k=e=>{t||i||R||(L.current=dr(e),F(!1),n(!0))},P=e=>{var t,n;if(cr(N)){const i=Math.min(Math.max(0,(null!==(t=dr(e))&&void 0!==t?t:0)-(null!==(n=L.current)&&void 0!==n?n:0)),j());G(i),i/j()*100>=75?_.current=!0:_.current=!1}},$=()=>{var e,t;s(!0),p(C),p(O),null===(t=null===(e=cr(A).parentElement)||void 0===e?void 0:e.parentElement)||void 0===t||t.focus()},j=()=>cr(A).getBoundingClientRect().width-cr(N).getBoundingClientRect().width,G=e=>{var t;cr(N).style.transform=`translateX(${e}px)`,cr(x).style.transform=`translateX(${e+(null===(t=cr(N))||void 0===t?void 0:t.getBoundingClientRect().width)/2}px)`},F=e=>{e?(cr(N).style.transition="transform .2s",cr(x).style.transition="transform .2s"):(cr(N).style.transition="",cr(x).style.transition="")},M=()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",D),document.removeEventListener("touchmove",P),document.removeEventListener("touchend",D)};return a.createElement(Do,{styles:T},(({classnames:t})=>{var n,o,r,s,l,c;return a.createElement("div",{className:`${g}`,"data-testid":e.testId,"data-e2e":"SlideStateTrigger"},a.createElement("div",{className:`${b} ${null!==(n=null==t?void 0:t.own)&&void 0!==n?n:""}`,ref:A,"aria-hidden":!0,"data-testid":e.testId&&`${e.testId}-track`},(null==m?void 0:m.value)?a.createElement("div",{className:`${S} ${null!==(o=null==t?void 0:t.label)&&void 0!==o?o:""}`,"data-testid":e.testId&&`${e.testId}-label`},m.value):null,a.createElement("div",{className:`${I} ${null!==(r=null==t?void 0:t.fill)&&void 0!==r?r:""}`,ref:x,"data-testid":e.testId&&`${e.testId}-fill`}),a.createElement("div",{className:`${E} ${null!==(s=null==t?void 0:t.thumb)&&void 0!==s?s:""}`,ref:N,"data-testid":e.testId&&`${e.testId}-thumb`,"data-e2e":"SlideStateTrigger-thumb",onMouseDown:k,onTouchStart:k},null!==(l=null==v?void 0:v.icon)&&void 0!==l?l:"ArrowForward")),a.createElement("button",{className:w,"aria-label":null!=h?h:void 0,onClick:$,disabled:i||R,"data-testid":e.testId&&`${e.testId}-button`},null!==(c=null==m?void 0:m.value)&&void 0!==c?c:"Unlock Offers"))}))}function cr(e){if(!e.current)throw new Error("Unexpected missing reference to required SlideStateTrigger Element");return e.current}function dr(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientX:e.clientX}function ur(e){const t=Ai();return a.createElement(Do,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row",flexWrap:"wrap"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,qt(i,e.testId))))))}))}function pr(e){const t=Da(),n=Si(),i=e.schema.customStateKey,o=Ci(0,(e=>e.customStates[i])),{tabIndex:r,styles:s,isDisabled:l}=It(t),c=()=>{n({type:on,payload:{key:i,value:o?0:1}})};return a.createElement(Do,{styles:e.schema.styles},(({classnames:t})=>{var n;return a.createElement("button",{className:null==t?void 0:t.own,onClick:c,"data-testid":e.testId,"data-e2e":"ToggleButtonStateTrigger",disabled:l,"aria-disabled":l,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:r,style:Object.assign({cursor:"pointer"},s)},a.createElement(Ti,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function yr(e){const t=Ai();return a.createElement(Do,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row",overflowX:"auto"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,qt(i,e.testId))))))}))}function fr(e){const t=Ai();return a.createElement(Do,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"column",overflowY:"auto"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,qt(i,e.testId))))))}))}const mr=s({extensions:{ctx:new Map,cache:[]}}),hr=()=>l(mr).extensions;function vr({extensions:e,extendStore:t,children:n}){const i=hr(),o=new Map([...i.ctx,...e.ctx]),r=i.cache.concat(e.cache);return a.createElement(mr.Provider,{value:{extensions:{ctx:o,cache:r},extendStore:t}},n)}function gr(e,t){const n=function(e){try{const t=JSON.parse(e);if(null!=t&&"object"==typeof t&&"type"in t&&"Extension"===t.type&&"name"in t&&"string"==typeof t.name&&t.name.trim().length>0&&"body"in t&&"object"==typeof t.body)return{type:"Extension",name:t.name,body:t.body}}catch(e){}return null}(t),i=n?e.ctx.get(n.name):null;return n&&i?[n,i]:null}function br({data:e}){const t=gr(hr(),e);var n;if((e=>{const{extendStore:t,extensions:n}=l(mr);o((()=>{e&&t&&!n.cache.includes(e.name)&&(t(e),n.cache.push(e.name))}),[e,n.cache,t])})((n=null==t?void 0:t[1])?{sagas:n.sagas,reducer:n.reducer,name:n.name,interceptors:n.interceptors}:void 0),t){const[e,n]=t;return n.componentFactory(e.body)}return null}function Ir(e,t){if(Et("Extension",e))return a.createElement(br,{data:e.node.data})}function Er(e){const t=Fa(),n=Di(),i=ea(),r=Ai(),s=Si(),l=d((()=>n.catalogItems||[]),[n]),c=e=>i({data:e},"catalogItem");return o((()=>{for(const e of l)s({type:nn,payload:{name:"SignalImpression",parentGuid:e.instanceGuid}})}),[l,s]),l.length>0?a.createElement(Do,{styles:e.schema.styles},(({classnames:n})=>a.createElement("div",{"data-testid":e.testId,"data-e2e":"CatalogStackedCollection",className:null==n?void 0:n.own,style:{display:"flex",flexDirection:"column"}},a.Children.toArray(l.map(((n,i)=>a.createElement(Va,{context:n},a.createElement(Ga,{value:t(n)},a.createElement(Xi,{value:c(n)},r(e.schema.template,void 0,qt(i,e.testId))))))))))):null}const Sr={BasicText:(e,t)=>zo(e,t,!0),StaticLink:(e,t)=>nr(e,t,!0)};function wr(e){const t=Ai();return a.createElement(xi,{value:t,overrides:Sr},a.createElement(Ti,null,(t=>a.createElement(Do,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:null==n?void 0:n.own,"data-testid":e.testId,"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,qt(i,e.testId))))))})))))}function Cr(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,qt(i,n)))))}function Or(e){const t=Da(),n=Si(),i=Ai(),o=ea(),{event:r}=e.schema,{tabIndex:s,styles:l,isDisabled:c}=It(t),d=V((e=>o(e)),r.data||{}),u=()=>{n({type:rn,payload:{name:r.type,body:{offerId:d.providerOfferId,title:d.title,description:d.description}}})};return a.createElement(Do,{styles:e.schema.styles},(({classnames:t,mapperRef:n})=>{var r;return a.createElement("button",{"aria-disabled":c,"aria-label":null!==(r=e.schema.a11yLabel)&&void 0!==r?r:void 0,className:null==t?void 0:t.own,"data-e2e":"PartnerEventButtonTrigger","data-testid":e.testId,disabled:c,onClick:u,tabIndex:s,type:"button",style:Object.assign({cursor:"pointer"},l)},a.createElement(Xi,{value:o},(null==t?void 0:t.own)?function(e,t,n,i,o){return a.createElement(na,{value:n(t)},Cr(e,i,o))}(e.schema.children,t.own,n,i,e.testId):Cr(e.schema.children,i,e.testId)))}))}function Tr(e){const t=Si(),n=e.schema.delay?e.schema.delay:1,i=e.schema.customStateKey,a=Ci(0,(e=>e.customStates[i]));return function({delay:e,callback:t}){const n=r(null);o((()=>{n.current=setTimeout(t,e)}),[])}({delay:n,callback:()=>{t({type:on,payload:{key:i,value:a?0:1}})}}),null}function Ar(e){const t=Da(),n=ea()(e.schema.value),i=Si(),o=e.schema.customStateKey,r=Ci(0,(e=>e.customStates[o])),{tabIndex:s,styles:l,isDisabled:c}=It(t),d=()=>{navigator.clipboard.writeText(n),r||i({type:on,payload:{key:o,value:1}})};return a.createElement(Do,{styles:e.schema.styles},(({classnames:t})=>{var n;return a.createElement("button",{className:null==t?void 0:t.own,onClick:d,"data-testid":e.testId,"data-e2e":"CopyToClipboardButton",disabled:c,"aria-disabled":c,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:s,style:Object.assign({cursor:"pointer"},l)},a.createElement(Ti,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function xr(e){const t=Da(),n=Si(),{customStateKey:i,value:o}=e.schema,{tabIndex:r,styles:s,isDisabled:l}=It(t),c=()=>{n({type:on,payload:{key:i,value:o}})};return a.createElement(Do,{styles:e.schema.styles},(({classnames:t})=>{var n;return a.createElement("button",{className:null==t?void 0:t.own,onClick:c,"data-testid":e.testId,"data-e2e":"ButtonStateTrigger",disabled:l,"aria-disabled":l,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:r,style:Object.assign({backgroundColor:"transparent",cursor:"pointer",margin:0,padding:0},s)},a.createElement(Ti,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function Nr(e){return()=>{throw new $t("FAILED_CREATING_UNHANDLED_NODE",`The default mapper does not handle the ${e} node. Make sure when you use the NodeMapperProvider, you pass an override for ${e} node.`)}}const _r={Column:function(e,t){if("Column"===e.type)return a.createElement(ko,{schema:e.node,testId:t})},Row:function(e,t){if("Row"===e.type)return a.createElement(Po,{schema:e.node,testId:t})},StaticImage:function(e,t){if("StaticImage"===e.type)return a.createElement(qo,{schema:e.node,testId:t})},DataImage:function(e,t){if("DataImage"===e.type)return a.createElement(Jo,{schema:e.node,testId:t})},CreativeResponse:function(e,t){if("CreativeResponse"===e.type)return a.createElement(Wo,{schema:e.node,testId:t})},OneByOneDistribution:Nr("OneByOneDistribution"),StackedDistribution:Nr("StackedDistribution"),CarouselDistribution:Nr("CarouselDistribution"),GroupedDistribution:Nr("GroupedDistribution"),ProgressIndicator:Nr("ProgressIndicator"),ProgressControl:Nr("ProgressControl"),When:function(e,t){if("When"===e.type)return a.createElement(Lo,{schema:e.node,testId:t})},Overlay:Nr("Overlay"),CloseButton:Nr("CloseButton"),RichText:function(e,t){if("RichText"===e.type)return a.createElement(Uo,{schema:e.node,testId:t})},BasicText:zo,StaticLink:nr,DataIcon:function(e,t){if("DataIcon"===e.type)return a.createElement(ar,{schema:e.node,testId:t})},StaticIcon:function(e,t){if("StaticIcon"===e.type)return a.createElement(Ko,{schema:e.node,testId:t})},ZStack:function(e,t){if("ZStack"===e.type)return a.createElement(rr,{schema:e.node,testId:t})},FlowRow:function(e,t){if("FlowRow"===e.type)return a.createElement(ur,{schema:e.node,testId:t})},SlideStateTrigger:function(e,t){if("SlideStateTrigger"===e.type)return a.createElement(lr,{schema:e.node,testId:t})},ToggleButtonStateTrigger:function(e,t){if("ToggleButtonStateTrigger"===e.type)return a.createElement(pr,{schema:e.node,testId:t})},PartnerEventButtonTrigger:function(e,t){if("PartnerEventButtonTrigger"===e.type)return a.createElement(Or,{schema:e.node,testId:t})},TimerStateTrigger:function(e,t){if("TimerStateTrigger"===e.type)return a.createElement(Tr,{schema:e.node})},CatalogStackedCollection:function(e,t){if("CatalogStackedCollection"===e.type)return a.createElement(Er,{schema:e.node,testId:t})},CatalogResponseButton:Nr("CatalogResponseButton"),ScrollableRow:function(e,t){if("ScrollableRow"===e.type)return a.createElement(yr,{schema:e.node,testId:t})},ScrollableColumn:function(e,t){if("ScrollableColumn"===e.type)return a.createElement(fr,{schema:e.node,testId:t})},EscapeHatch:Ir,BottomSheet:Nr("BottomSheet"),CatalogQuantityOption:Nr("CatalogQuantityOption"),CatalogRadioGroup:Nr("CatalogRadioGroup"),CatalogQuantityCounter:Nr("CatalogQuantityCounter"),InlineContainer:function(e,t){if("InlineContainer"===e.type)return a.createElement(wr,{schema:e.node,testId:t})},CopyToClipboardButton:function(e,t){if("CopyToClipboardButton"===e.type)return a.createElement(Ar,{schema:e.node,testId:t})},ButtonStateTrigger:function(e,t){if("ButtonStateTrigger"===e.type)return a.createElement(xr,{schema:e.node,testId:t})},CatalogCombinedCollection:Nr("CatalogCombinedCollection")};function Lr(e){return function(t,n,i){const o=n&&n[t.type],r=null!=o?o:_r[t.type];return a.createElement(Qo,{schema:t,reporter:e},r&&r(t,i)||function(e){throw new $t("FAILED_CREATING_LAYOUT_NODE",`Failed to create layout node ${JSON.stringify(e)}`)}(t))}}const Rr={transformLinksToAnchorText:function(e={}){return{data:V((e=>ji(e)?`<a target="_blank" href="${e.url}">${e.title}</a>`:""),e)}}};function Dr(e){const{childLayouts:t}=e,n=Si(),[i,a]=d((()=>{const e=we(B("childLayoutId"),t);return[e,V((e=>e.childLayoutSchema.predicates),e)]}),[t]),r=wo(a);o((()=>{Object.entries(r).forEach((([e,t])=>{const a=i[e];t&&a&&n({type:pn,payload:a})}))}),[r,i,n])}function kr(e){const{settings:t,dispatch:n,children:i}=e,r=Yi(t.offerData.creative.copy||{})(Rr.transformLinksToAnchorText(t.offerData.creative.links),"creativeLink"),s=Lr(t.logger),[l,d]=c("ENABLED");return o((()=>t.gateway.onInteractivityChange(d)),[t]),hn(t.rootElement,n),a.createElement(ia.Provider,{value:"VARIANT"},a.createElement(Ni.Provider,{value:t.rootElement},a.createElement(Ha.Provider,{value:t.pluginId},a.createElement(xa,{context:t.gateway},a.createElement(_a,{context:t.layoutSchema},a.createElement(qa.Provider,{value:t.schemaVersion},a.createElement(Ri,{context:t.offerData},a.createElement(Ga,{value:ka(t.offerData.creative)},a.createElement(Ra.Provider,{value:l},a.createElement(xi,{value:s},a.createElement(oa.Provider,{value:t.offerPositionIndex},a.createElement(Ei.Provider,{value:n},a.createElement(Xi,{value:r},a.createElement(Pr,null,a.createElement(Dr,{childLayouts:t.childLayouts}),i))))))))))))))}function Pr(e){var t;const{children:n}=e,i=Wa(),r=function(){const[e,t]=c(null),n=l(Aa).get();return o((()=>n.onGlobalStateChange((n=>{$(n,e)||t(n)}))),[n]),e}(),s=l(Ni)||void 0,d=ra(),p=u((e=>bi(e,i,d,s)),[s]);return r?a.createElement(na,{value:p(Object.values(null!==(t=null==r?void 0:r.breakpoint.breakpoints)&&void 0!==t?t:{}))},a.createElement(wi.Provider,{value:r},n)):null}function $r(e){return a.createElement("style",{"data-testid":e.testId},"\n* {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n}\nbody {\n margin: 0;\n font-family: sans-serif;\n}\np {\n margin: 0;\n}\nimg {\n max-width: 100%;\n}\n")}function jr(e,t,n,i,a,o){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){o.current.isRunning=!0,a&&"in"===t&&function(e,t){e.style.height=`${t.clientHeight}px`}(a,e);const r=e.animate(n,{duration:i,iterations:1});return r.onfinish=()=>{"in"===t?Co(e):Oo(e),o.current.isRunning=!1},r.oncancel=()=>{"in"===t?Co(e):Oo(e),o.current.isRunning=!1},()=>{r.finish()}}return"in"===t?Co(e):Oo(e),()=>{}}const Gr={FadeInOut:{in:[{opacity:0,display:"none"},{opacity:0,display:"none",offset:.5},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],out:[{opacity:1},{opacity:0,offset:.75},{opacity:0}]}};function Fr({visible:e,effect:t,children:n,parentElement:i,containerClassName:s}){const[l,d]=c(e),u=r(null),p=r({isRunning:!1}),y=To(t);return o((()=>{const t=new ResizeObserver((function(t){i&&e&&!p.current.isRunning&&t.forEach((e=>{e.contentBoxSize?function(e,t){var n;Array.isArray(e.contentBoxSize)&&e.contentBoxSize[0]?t.style.height=e.contentBoxSize[0].blockSize+"px":"object"==typeof(n=e.contentBoxSize)&&null!=n&&"blockSize"in n&&"number"==typeof n.blockSize&&"inlineSize"in n&&"number"==typeof n.inlineSize?t.style.height=e.contentBoxSize.blockSize+"px":t.style.height="auto"}(e,i):e.contentRect&&function(e,t){t.style.height=`${e.contentRect.height}px`}(e,i)}))}));return e&&u.current&&(Co(u.current),t.observe(u.current)),()=>{t.disconnect()}}),[e,i]),o((()=>e&&!l&&u.current&&i?(d(!0),jr(u.current,"in",Gr[t.type].in,y,i,p)):!e&&l&&u.current&&i?(d(!1),jr(u.current,"out",Gr[t.type].out,y/2,i,p)):()=>{}),[e,i,y]),a.createElement("div",{ref:u,style:{display:"none"},className:s},n)}function Mr(e){const t=Ai();return a.createElement(Do,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:null==n?void 0:n.own,"data-testid":e.testId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},t(e.schema.template))}))}const Br="ACTIVE/ADD",Ur="ACTIVE/DELETE",Vr="BREAKPOINT/UPDATE_ACTIVE",zr="BREAKPOINT/INITIALISE",Hr="BREAKPOINT/SET_BREAKPOINTS",Wr="FONTS/SET",qr="LAYOUT/UPDATE",Jr="CONFIG/HANDLE",Yr="PLUGIN/CLOSE_PLUGIN",Kr="SETTINGS/SET",Zr="CACHE/ADD_SERIALIZED_VALUE",Qr="CACHE/UPDATE_SERIALIZED_VALUE",Xr="CACHE/CLEAR_SERIALIZED_VALUE",es="SIGNAL/QUEUE",ts="SIGNAL/PROCESSED",ns="SIGNAL/PROCESS",is="OVERLAY/DISMISS_OVERLAY",as="ERROR/REPORT",os="LOG",rs="CUSTOM_STATES/SET",ss={LAYOUT_UPDATE:qr,UPDATE_ACTIVE_BREAKPOINT:Vr,INITIALISE_BREAKPOINT:zr,ACTIVE_ADD:Br,ACTIVE_DELETE:Ur,SET_FONTS:Wr,QUEUE_SIGNAL:es,SIGNAL_PROCESSED:ts,CACHE_SERIALIZED_VALUE:Zr,UPDATE_CACHED_SERIALIZED_VALUE:Qr,CLEAR_SERIALIZED_VALUE_FROM_CACHE:Xr,SET_SETTINGS:Kr,SET_CUSTOM_STATE:rs},ls={HANDLE_CONFIG:Jr,SET_BREAKPOINTS:Hr,CLOSE_PLUGIN:Yr,RAISE_METRIC:Jt,PREPARE_SIGNAL:ln,DISMISS_OVERLAY:is,REPORT_ERROR:as,LOG:os,OPEN_LINK:cn},cs="plugin-overlay",ds="plugin";function us(t){var n;const i=t.schema.styles,o=f(),r={type:(null===(n=t.action)||void 0===n?void 0:n.type)||is,payload:{id:cs,dismissalMethod:t.schema.dismissalMethod}},s=()=>{o(r)},l=Da(),{tabIndex:c,styles:d,isDisabled:u}=It(l);return e(Do,{styles:i,children:({classnames:n})=>{var i;return e("button",{title:"Close",className:null==n?void 0:n.own,onClick:s,"data-testid":t.testId,"data-e2e":"CloseButton",disabled:u,tabIndex:c,"aria-disabled":u,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:void 0,style:Object.assign({cursor:"pointer"},d),children:e(Ti,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}const ps={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var ys;function fs({isOpen:n,schema:i,testId:r,children:s}){const l=vn(),c=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),d=m((e=>e.active.has(ds))),u=f(),p=()=>{u({type:ls.DISMISS_OVERLAY,payload:{id:cs,dismissalMethod:"rokt_backdrop"}})};o((()=>{c&&u({type:nn,payload:{name:"SignalActivation",parentGuid:c}})}),[c]),o((()=>{d&&requestAnimationFrame((()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.focus()}))}),[d]);const y=Da(),{tabIndex:h,isDisabled:v,styles:g}=It(y),b=i.styles?Ce(ps,i.styles):ps;if(!n)return null;const I=e(Ti,{children:e=>a.Children.toArray(i.children.map(((t,n)=>e(t,void 0,r?`${r}-child${n}`:void 0))))});return e(Do,{styles:b,children:({classnames:n})=>{var a;return t("div",{className:null==n?void 0:n.wrapper,style:Object.assign({position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:"auto"},g),"aria-label":null!==(a=i.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":v,role:"dialog","aria-modal":!0,tabIndex:h,"data-testid":r,"data-e2e":"Overlay-Wrapper",children:[e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:i.allowBackdropToClose?p:void 0,"data-testid":r&&`${r}-backdrop`,"data-e2e":"Overlay-Backdrop"}),s(I,l)]})}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(ys||(ys={}));const ms={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const hs=p((function({schema:t,testId:n,children:i},a){const o=t.styles?Ce(ms,t.styles):ms;return e(Do,{styles:o,children:({classnames:t})=>e("div",{className:null==t?void 0:t.own,style:{position:"relative",zIndex:"3",outline:"none"},ref:a,tabIndex:-1,"data-e2e":"Overlay-Container","data-testid":n&&`${n}-container`,children:i})})}));const vs=h((function(e){return{isOpen:e.active.has(cs)}}))((function(t){return e(fs,Object.assign({},t,{children:(n,i)=>e(hs,Object.assign({},t,{ref:i,children:n}))}))}));const gs=h((function(e){return{isOpen:e.active.has(cs)}})),bs={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const Is=p((function({schema:t,testId:n,children:i},a){const s=r(null),l=t.styles?Ce(bs,t.styles):bs;return o((()=>{if(s.current)return function(e){const t=requestAnimationFrame((()=>{e&&e.style.setProperty("max-height","100%")}));return()=>{cancelAnimationFrame(t)}}(s.current)}),[]),e(Do,{styles:l,children:({classnames:t})=>e("div",{style:{width:"100%",maxHeight:"0%",transition:"max-height 0.8s",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)",alignSelf:"flex-end"},ref:s,children:e("div",{className:null==t?void 0:t.own,style:{position:"relative",zIndex:"3",outline:"none",borderBottomLeftRadius:"0",borderBottomRightRadius:"0"},ref:a,tabIndex:-1,"data-testid":n&&`${n}-container`,"data-e2e":"BottomSheet-Container",children:i})})})}));const Es=gs((function(t){const n=m((e=>e.breakpoint.activeBreakpoint));return e(fs,Object.assign({},t,{children:(i,a)=>e("default"===n?Is:hs,Object.assign({},t,{ref:a,children:i}))}))}));const Ss="DisplayPreset.FULLSCREEN",ws="DisplayPreset.EMBEDDED",Cs="DisplayPreset.ATTACHED",Os="ERROR",Ts="INFO",As="WARNING";var xs;!function(e){e.PAYPAL="Paypal"}(xs||(xs={}));const Ns="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DCUI_SCHEMA_VERSION:"",ROKT_DOMAIN:""};function*_s(e,t,n){(function(e){return"object"==typeof e&&null!==e&&"type"in e&&Object.values(yn).includes(e.type)})(n)&&!e.includes(n.type)&&(yield ze(t.globalDispatch.bind(t),n))}function Ls(e,t){return!e||t<1?null:{cartItemId:e.cartItemId,catalogItemId:e.catalogItemId,name:e.title,description:e.description,quantity:t,currency:e.currency||"$",unitPrice:e.price||0,totalPrice:(e.price||0)*t,linkedProductId:e.linkedProductId,quantityMustBeSynchronized:e.quantityMustBeSynchronized,providerData:e.providerData||""}}function Rs(e){switch(typeof e){case"undefined":return"";case"object":return null===e?"":JSON.stringify(e);case"string":return e;default:return String(e)}}function Ds(e){return re(Rs,e)}function*ks(e,t){const n=yield He(e,rt.expanding(10));for(;n;){const e=yield We(n);yield ze(t,e)}}function*Ps(e,t){const n=yield We(e);yield ze(t,n)}function*$s(e){for(;;){const t=yield We(e);yield qe(t)}}function*js(e,t){const n=de(Oe("moduleName"),Te("orchestrator"),t.payload.additionalInformation||{}),i=Object.assign(Object.assign({},t.payload),{additionalInformation:n?Ds(n):{}});try{yield ze(e,i)}catch(e){}t.payload.level===Os&&(yield qe({type:rn,payload:{name:"PLACEMENT_FAILURE"}}),yield qe({type:ls.CLOSE_PLUGIN}))}const Gs="INVALID_RESPONSE_OBJECT",Fs="FAILED_TO_OPEN_LINK",Ms="NO_PARENT_GUID",Bs="FAILED_TO_NOTIFY_INTERACTIVE",Us="FAILED_TO_ESTABLISH_PARTNER_VALIDATION";var Vs=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]])}return n};function zs(e,t){return n=>n&&n.replace(e,t)}const Hs=zs(/['""();{}@:[\]!/=]/g,""),Ws=/^(normal|italic|oblique( \d+deg)*)$/i,qs=(e="")=>Ws.test(e)?e:void 0,Js=zs(/[;{}@[\]!]/g,"");function Ys(e){const{fontFamily:t,sources:n}=e,i=Vs(e,["fontFamily","sources"]),a=document.fonts,o=new FontFace(t,n.join(", "),i);return a.add(o),o.load().catch((e=>(a.delete(o),Promise.reject(e))))}function Ks(e=[]){const t=Array.from(document.fonts.values());return Promise.all(e.map((e=>{const n=function(e){return{fontFamily:Hs(e.fontFamily)||"",style:qs(e.style),weight:Hs(e.weight),sources:e.sources.map((e=>Js(e)||"")),display:e.display}}(e);return t.find((e=>e.family===n.fontFamily&&e.weight===n.weight&&(e.style===n.style||!n.style)))?Promise.resolve():Ys(n).then((()=>{})).catch((e=>`${e}`.includes("SyntaxError")?(n.fontFamily='"'+n.fontFamily+'"',Ys(n).then((()=>{}))):Promise.reject(e))).catch((e=>Promise.resolve(`Error loading font: [Font (${JSON.stringify(n)})] [Message - ${e}]`)))}))).then((e=>{const t=e.filter(Boolean);return t.length>0?Promise.reject(t):Promise.resolve()}))}function Zs(e){const t=f(),n=m((e=>{const t=e.fonts.map((e=>({fontFamily:e.fontFamily,style:e.fontStyle||"normal",weight:e.fontWeight,sources:e.src}))),n=t.find((e=>"rokt-icons"===e.fontFamily));if(n)n.display="block";else{const e=null!==(i=Ns.ROKT_DOMAIN)&&void 0!==i?i:"";t.push(function(e=""){return{fontFamily:"rokt-icons",weight:"400",sources:[`url("${e}/icons/rokt-icons.woff") format("woff")`],display:"block"}}(e))}var i;return JSON.stringify(t)}));return o((()=>{Ks(JSON.parse(n)).catch((e=>{const n={type:as,payload:{level:Ts,code:"FAILED_TO_LOAD_FONT",message:`Error loading fonts:\n\t${e.join("\n\t")}`}};t(n)}))}),[n]),o((()=>{const e=()=>{var e,t;null===(t=null===(e=window.frameElement)||void 0===e?void 0:e.iFrameResizer)||void 0===t||t.resize()};return document.fonts.addEventListener("loadingdone",e),()=>{document.fonts.removeEventListener("loadingdone",e)}}),[]),null}function Qs(e){return null!=e?e:null}function Xs(){return new Set([cs])}function el(e){return e.breakpoint.breakpoints[e.breakpoint.activeBreakpoint]||0}const tl=xe(B(1)),nl=re(B(0)),il=e=>G(Ae($(e)),nl,tl,ne,ye({},["breakpoint","breakpoints"]));function al(e){return il(e.breakpoint.activeBreakpoint)(e)}function ol(e,t){return e.customStates[`module${t}`]||{}}function rl(e){return`${e.name}:${e.parentGuid}`}function sl(e,t){return!e.processed.includes(rl(t))||(n=t.name,void 0!==Dt.find((e=>e===n)));var n}function ll(){return new Map}const cl={layout:function(e=Qs(),t){return t.type===qr?t.payload:e},breakpoint:function(e={breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},t){var n;switch(t.type){case Vr:return Object.prototype.hasOwnProperty.call(e.breakpoints,t.payload.activeBreakpoint)?Object.assign(Object.assign({},e),{activeBreakpoint:t.payload.activeBreakpoint}):e;case zr:return{activeBreakpoint:null!==(n=t.payload.activeBreakpoint)&&void 0!==n?n:"default",breakpoints:Object.assign({default:0},t.payload.breakpoints),initialised:!0};default:return e}},active:function(e=Xs(),t){var n,i;switch(t.type){case Br:{const i=new Set(e);return i.add(null===(n=t.payload)||void 0===n?void 0:n.id),i}case Ur:{const n=new Set(e);return n.delete(null===(i=t.payload)||void 0===i?void 0:i.id),n}default:return e}},fonts:function(e=[],t){return t.type===Wr?t.payload:e},signal:function(e={queue:[],processed:[]},t){switch(t.type){case es:return fe({queue:n=>sl(e,t.payload.signal)?Le(J(B("signal"),rl),n.concat(t.payload)):n},e);case ts:return fe({queue:e=>Ne(J(B("signal"),_e({name:t.payload.name,parentGuid:t.payload.parentGuid})))(e),processed:me(rl(t.payload))},e);default:return e}},serializableCache:function(e=ll(),t){switch(t.type){case Zr:case Qr:if(t.payload.key&&t.payload.value){return new Map([...e]).set(t.payload.key,t.payload.value)}return e;case Xr:{const n=new Map([...e]);return t.payload&&n.delete(t.payload),n}default:return e}},settings:function(e={closeOnComplete:!0},t){return t.type===Kr?T(((e,t)=>ce(t)?e:t),e,t.payload):e},customStates:function(e={root:{}},t){if(t.type===rs){if(t.payload.key&&!isNaN(t.payload.value)){const n=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:"root";return b([n,t.payload.key],Number(t.payload.value),e)}return e}return e}};function*dl(e,t){var n,i;try{const a=(null===(n=e.activeBreakpointEventChannel)||void 0===n?void 0:n.call(e,t.payload))||(i=t.payload,st((e=>{const t=Object.entries(i).reduce(((e,t)=>{const i=window.matchMedia(`(min-width: ${t[1]}px)`);return"addEventListener"in i&&"function"==typeof i.addEventListener?(i.addEventListener("change",n),e[t[0]]=i):"addListener"in i&&"function"==typeof i.addListener&&(i.addListener(n),e[t[0]]=i),e}),{});return setTimeout((()=>n()),0),()=>{Object.entries(t).forEach((e=>{const t=e[1];"removeEventListener"in t&&"function"==typeof t.removeEventListener?t.removeEventListener("change",n):"removeListener"in t&&"function"==typeof t.removeListener&&t.removeListener(n)}))};function n(){try{e(function(e,t){return Object.entries(e).reduce(((e,n)=>n[1].matches&&(t[n[0]]||0)>(t[e]||0)?n[0]:e),"default")}(t,i))}catch(t){e(t)}}})));try{let e=yield We(a);for(yield qe({type:ss.INITIALISE_BREAKPOINT,payload:{activeBreakpoint:e,breakpoints:t.payload}});;)e=yield We(a),yield qe({type:ss.UPDATE_ACTIVE_BREAKPOINT,payload:{activeBreakpoint:e}})}catch(e){const n=e;yield qe({type:as,payload:{level:As,code:"FAILED_TO_DETERMINE_BREAKPOINT",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}finally{(yield Je())&&a.close()}}catch(e){const n=e;yield qe({type:as,payload:{level:Os,code:"FAILED_TO_ESTABLISH_BREAKPOINT_CHANNEL",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}}function ul(e,t,n){return st((i=>{const a=e.subscribe((e=>{const t=n(e);t&&i({type:Jr,payload:t})}),(e=>{i(e)})),o=t.fonts.subscribe((e=>{i({type:Wr,payload:e})}),(e=>{i(e)}));return()=>{a.unsubscribe(),o.unsubscribe()}}),rt.sliding(2))}var pl=Object.freeze({__proto__:null,CartEvent:{UPDATE_CART_ITEM_MESSAGE:"UPDATE_CART_ITEM_MESSAGE",UPSERT_ALERT:"UPSERT_ALERT",DELETE_ALERT:"DELETE_ALERT",UPSERT_DELIVERY_DETAILS:"UPSERT_DELIVERY_DETAILS"}}),yl=Object.freeze({__proto__:null,PartnerMessage:{UpdateCartItem:"V2_UPDATE_CART_ITEM"},PlacementMessage:{CartItemUpdated:"V2_CART_ITEM_UPDATED"}}),fl=Object.freeze({__proto__:null,V1:pl,V2:yl}),ml=Object.freeze({__proto__:null,PartnerMessage:{CartItemInstantPurchaseResponse:"CART_ITEM_INSTANT_PURCHASE_RESPONSE"},PlacementMessage:{CartItemInstantPurchase:"CART_ITEM_INSTANT_PURCHASE"}}),hl=Object.freeze({__proto__:null,PartnerValidationEvent:{SET_PARTNER_VALIDATION_STATUS:"SET_PARTNER_VALIDATION_STATUS",OPT_IN_TO_PARTNER_VALIDATION:"OPT_IN_TO_PARTNER_VALIDATION",SHOW_PARTNER_VALIDATION_STATUS:"SHOW_PARTNER_VALIDATION_STATUS"}});const vl="LINK_NAVIGATION_REQUEST",gl="REALTIME_OFFER_FULFILLMENT_SUCCESS",bl="REALTIME_OFFER_FULFILLMENT_FAILURE";var Il=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const El={newTab:"_blank",self:"_top",roktWebViewSDK:"roktWebViewSDK",inApp:"inApp",overrideLinkNavigation:"overrideLinkNavigation"};function Sl({url:e,urlBehavior:t,external:n},i=window){return Il(this,void 0,void 0,(function*(){if(!e)return null;if("overrideLinkNavigation"===t)return n.partner.send(vl,{url:e}).then((()=>null));const a=El[t];if(i.RoktWebViewSDK){const t=i.RoktWebViewSDK.open(e);return t?{ref:t}:null}if("_top"===a&&i.top)return i.top.location.href=e,null;const o=i.open(e,a);if(o)try{o.opener=null}catch(e){}return o?{ref:o}:null}))}var wl=Object.freeze({__proto__:null,openLink:Sl});function Cl(e,t,n,i){const a=function(e){return"object"==typeof e&&null!=e&&"message"in e&&"string"==typeof e.message&&e.message.includes("timed out")}(e),o=a?{originErrorCode:n}:void 0;return{type:as,payload:{level:As,code:a?"COMMUNICATION_FAILURE_WITH_WSDK":n,message:t,additionalInformation:Object.assign(Object.assign({},o),i)}}}var Ol=Object.freeze({__proto__:null,makePluginWarningAction:Cl});function Tl(e){return null!=e&&"object"==typeof e&&"ref"in e&&"object"==typeof e.ref&&!Array.isArray(e.ref)&&null!=e.ref}var Al=Object.freeze({__proto__:null,isWindow:Tl}),xl=Object.assign(Object.assign(Object.assign({},wl),Ol),Al);function*Nl(e=10){(yield Ye((e=>e.signal.queue.length>0)))&&(yield mt(30),e>=1&&(yield*Nl(e-1)))}function*_l(e){try{yield*Nl(10),yield pt(e.close)}catch(e){const t=xl.makePluginWarningAction(e,"Failed to close the plugin","FAILED_TO_CLOSE_PLUGIN");yield yt(t)}}function*Ll(e,{payload:t}){var n;if("string"==typeof(n=t.name)&&jt.includes(n))switch(t.name){case"V2_CART_ITEM_UPDATED":case"CART_ITEM_INSTANT_PURCHASE":case"UPSELL_CREATIVE_SENT":case"INITIATE_INSTANT_PURCHASE_EVENT":case"REALTIME_OFFER_FULFILLMENT_REFERRAL":case"REALTIME_OFFER_FULFILLMENT_CONVERSION":case"REALTIME_OFFER_FULFILLMENT_SUCCESS":yield e.send(t.name,t.body);break;case"OFFER_ENGAGEMENT":case"PLACEMENT_CLOSED":case"PLACEMENT_COMPLETED":case"PLACEMENT_FAILURE":case"PLACEMENT_INTERACTIVE":case"POSITIVE_ENGAGEMENT":yield e.send(t.name);break;default:return}}const Rl=F("FAILED_TO_PARSE_CONFIG","code");function*Dl(e,t){var n;const i=yield pt(ul,e.configService,e.themeService,t);for(;;)try{const e=yield ft(i);yield yt(e)}catch(e){const t=e;yield yt({type:as,payload:{level:Os,code:Rl(t),message:null!==(n=null==t?void 0:t.message)&&void 0!==n?n:"An error occured parsing or receiving Plugin config, fonts or configurables.",additionalInformation:{stack:null==t?void 0:t.stack}}})}}function*kl(e,t){yield ct([dt(Dl,e,t),ut(rn,Ll,e.partnerInteractionService)])}function Pl(e){switch(e){case"ATTACHED":return Cs;case"EMBEDDED":return ws;default:return Ss}}function*$l(e,t){const n={preset:Pl(t)};yield pt(e.setDisplaySettings,n),yield yt({type:ss.ACTIVE_ADD,payload:{id:ds}})}function*jl(e,t){var n;const i=null!==(n=t.payload.data)&&void 0!==n?n:{};try{yield ze(e,{code:t.payload.code,level:Ts,message:t.payload.message||"Plugin Generic Log",additionalInformation:Ds(i)})}catch(e){}}function*Gl(e){yield qe({type:ss.QUEUE_SIGNAL,payload:{signal:e.payload}}),yield qe({type:ns})}function*Fl(e){yield qe({type:ss.QUEUE_SIGNAL,payload:e.payload}),yield qe({type:ns})}function*Ml(e,t){const n=yield Ye((e=>e.signal.queue.filter((t=>sl(e.signal,t.signal)))));if(Array.isArray(n)&&n.length)for(const e of n){const t="criteria"in e?e.criteria:void 0;switch(e.signal.name){case"SignalActivation":case"SignalLoadComplete":case"SignalImpression":yield*Bl(e.signal,i(t));break;case"SignalViewed":yield*Ul(e.signal,i(t));break;case"SignalDismissal":yield*Vl(e.signal,i(t));break;case"SignalInstantPurchaseDismissal":yield*zl(e.signal,i(t));break;case"SignalLoadStart":yield*Hl(e.signal,i(t));break;case"SignalGatedResponse":case"SignalResponse":yield*Wl(e.signal,i(t,!0));break;case"SignalUserInteraction":yield*ql(e.signal,i(t));break;case"SignalCartItemQuantitySelected":yield*Jl(e.signal,i(t));break;case"SignalCartItemInstantPurchaseInitiated":yield*Yl(e.signal,i(t));break;case"SignalCartItemInstantPurchase":yield*Kl(e.signal,i(t));break;case"SignalCartItemInstantPurchaseFailure":yield*Zl(e.signal,i(t))}yield qe({type:ss.SIGNAL_PROCESSED,payload:e.signal})}function i(t,n=!1){return function(i,a,o){return t?ze(e.prepareExternalSignal,t.key,i,a,o):ze(n?e.issueSignalSync:e.issueSignal,i,a,o)}}}function*Bl(e,t){let n;e.creativeInstanceGuid&&(n={},n.creativeInstanceGuid=e.creativeInstanceGuid);try{yield t(e.name,e.parentGuid,n)}catch(t){yield Ql(e,t)}}function*Ul(e,t){try{yield t(e.name,e.parentGuid,{objectData:{supportedByBrowser:e.supportedByBrowser.toString()},metadata:[{name:"inferred",value:e.inferred.toString()}]})}catch(t){yield Ql(e,t)}}function*Vl(e,t){try{yield t(e.name,e.parentGuid,e.dismissalMethod?{objectData:{dismissalMethod:e.dismissalMethod}}:void 0)}catch(t){yield Ql(e,t)}}function*zl(e,t){try{yield t(e.name,e.parentGuid,void 0)}catch(t){yield Ql(e,t)}}function*Hl(e,t){var n;const i={overrideTimestamp:null!==(n=e.overrideTimestamp)&&void 0!==n?n:new Date};try{yield t(e.name,e.parentGuid,i)}catch(t){yield Ql(e,t)}}function*Wl(e,t){try{yield t(e.name,e.parentGuid,function(e){const t={creativeInstanceGuid:e.responseActionPayload.creativeInstanceGuid};"Url"===e.responseActionPayload.name&&(t.transformedTrafficURL=e.responseActionPayload.transformedTrafficURL);return t}(e))}catch(t){yield Ql(e,t)}}function*ql(e,t){const n=e.parentGuid?e.parentGuid:yield Ye((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));try{if(!n||"string"!=typeof n)throw new Error(`Cannot raise SignalUserInteraction, missing or invalid parent GUID: ${JSON.stringify(e)}`);yield t(e.name,n,{objectData:{action:e.action,context:e.context}})}catch(t){yield Ql(e,t)}}function*Jl(e,t){const n={objectData:{preselected:e.objectData.preselected.toString(),quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield Ql(e,t)}}function*Yl(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield Ql(e,t)}}function*Kl(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),initiatedBy:e.objectData.initiatedBy}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield Ql(e,t)}}function*Zl(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),failureReason:e.objectData.failureReason,providerId:e.objectData.providerId}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield Ql(e,t)}}function Ql(e,t){const n=xl.makePluginWarningAction(t,(null==t?void 0:t.message)||"Failed to issue signal","FAILED_TO_ISSUE_SIGNAL",{signalName:null==e?void 0:e.name,parentGuid:null==e?void 0:e.parentGuid,stack:null==t?void 0:t.stack});return qe(n)}function*Xl(e){yield qe({type:rs,payload:e.payload})}function*ec(e,t){if("Interactive"===t.payload.name)try{yield*function*(e){const t="METRIC";(yield Ye((e=>e.serializableCache.has(t))))||(yield ze(e.notifyInteractive),yield qe({type:Zr,payload:{key:t,value:"Interactive"}}))}(e)}catch(e){const t=e;yield*function*(e){var t;yield qe({type:as,payload:{level:Ts,code:Bs,message:null!==(t=null==e?void 0:e.message)&&void 0!==t?t:"Failed to notify interactive",additionalInformation:{stack:null==e?void 0:e.stack}}})}(t)}}function*tc(e,t){const n=e.context.getOverrideLinkNavigation()?"overrideLinkNavigation":t.payload.urlBehaviour;try{"inApp"===n?yield ze(e.createChildPlugin,{name:"url-modal",config:{url:t.payload.url,method:"GET"}}):yield ze(Sl,{url:t.payload.url,urlBehavior:n,external:e})}catch(e){yield qe(Cl(e,"Failed to open link",Fs,{url:t.payload.url,urlBehaviour:n}))}}function*nc(e){const t=yield Ye((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));yield qe({type:ss.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield qe({type:Yr}),t?yield qe({type:nn,payload:{name:"SignalDismissal",parentGuid:t,dismissalMethod:e.payload.dismissalMethod}}):yield qe({type:as,payload:{level:Ts,code:Ms,message:"ParentGuid does not exist"}})}const ic=h((function(e){return{isOpen:e.active.has(cs)}})),ac="undefined"!=typeof window;function oc(e,t){o((()=>{if(!ac||t)return;const n=e.current;if(!n)return;const i=e=>{e.preventDefault()},a=["wheel","touchmove"];a.forEach((e=>{n.addEventListener(e,i,{passive:!1})}));const o=e=>{["ArrowUp","ArrowDown","PageUp","PageDown","Space"].includes(e.code)&&e.preventDefault()};return window.addEventListener("keydown",o),()=>{a.forEach((e=>{n.removeEventListener(e,i)})),window.removeEventListener("keydown",o)}}),[e,t])}const rc="Minimized",sc=()=>{const e=r(null),t=r(null),n=r(null),i=r(null),a=r(null),s=Ci(0,(e=>e.customStates[rc])),l=Si(),c=Da(),d=r(0),p=r(!1),y=r(0),f=r([]),m=r(void 0),{isDisabled:h}=It(c);oc(e,!!s);const v=u((()=>{k(),m.current=void 0,p.current=!1,L(!0);g()?S():_(0)}),[]),g=()=>{const e=N();return s?e<=-.2:e>=.2};o((()=>{s?(C(),l(cc(!0))):(O(),l(cc(!1)))}),[s,l]),o((()=>{requestAnimationFrame((()=>{D(!s,n),D(!!s,i),R()}))}),[]);const b=u((e=>{if(t.current){e.preventDefault();const t=E(e);_(t)}}),[t]),I=u((e=>{Date.now()-y.current<200||(y.current=Date.now(),s?w(!1):p.current||h||(p.current=!0,x(),m.current=lc(e),L(!1),P()))}),[s,h]);o((()=>{const e=t.current;return e&&(e.addEventListener("mousedown",I),e.addEventListener("touchstart",I)),()=>{null==e||e.removeEventListener("mousedown",I),null==e||e.removeEventListener("touchstart",I)}}),[t,I]);const E=e=>{var t,n;return(null!==(t=lc(e))&&void 0!==t?t:0)-(null!==(n=m.current)&&void 0!==n?n:0)},S=()=>{w(!s)},w=e=>{const t=(e=>({type:on,payload:{key:rc,value:e?1:0}}))(e);t&&l(t)},C=()=>{var e,t,a,o;const r=null!==(t=null===(e=n.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,s=(null!==(o=null===(a=i.current)||void 0===a?void 0:a.clientHeight)&&void 0!==o?o:0)-r;L(!0),R(!0,!0),_(s),D(!1,n),D(!0,i),$()},O=()=>{L(!0),R(!0,!1),_(0),m.current=void 0,D(!0,n),D(!1,i),j()},T=u((()=>{p.current&&(A(),requestAnimationFrame(T))}),[]),A=()=>{f.current.push({yPosition:d.current,timestamp:Date.now()}),f.current.length>20&&f.current.shift()},x=u((()=>{f.current=[],T()}),[T]),N=()=>{const e=f.current;if(!e)return 0;const t=e[0],n=e[e.length-1];if(!t||!n)return 0;const i=n.timestamp-t.timestamp;return(n.yPosition-t.yPosition)/i},_=e=>{const n=Math.round(e);d.current=n,t.current&&(t.current.style.transform=`translateY(${n}px)`)},L=e=>{e?t.current&&(t.current.style.transition="transform .2s"):t.current&&(t.current.style.transition="")},R=(e,t=!1)=>{const a=t?i:n,o=t?n:i;o.current&&(o.current.style.transition="opacity .5s"),a.current&&(a.current.style.transition="opacity .2s")},D=(e,t)=>{const n=t.current;if(!n)return;const i=e?0:1;n.style.opacity=`${i}`,e?n.style.pointerEvents="none":setTimeout((()=>{n.style.pointerEvents="auto"}),400)},k=u((()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",v),document.removeEventListener("touchmove",b),document.removeEventListener("touchend",v)}),[b,v]),P=u((()=>{St()?(document.addEventListener("touchmove",b,{passive:!1}),document.addEventListener("touchend",v)):(document.addEventListener("mousemove",b,{passive:!1}),document.addEventListener("mouseup",v))}),[b,v]),$=()=>{const t=e.current;t&&(a.current=setTimeout((()=>{var e;const i=((null===(e=n.current)||void 0===e?void 0:e.clientHeight)||0)+1;t.style.height=i+"px"}),200))},j=()=>{a.current&&clearTimeout(a.current),e.current&&(e.current.style.height="100000px")};return{wrapperRef:e,containerRef:t,minimizedChildRef:n,maximizedChildRef:i}};function lc(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientY:e.clientY}const cc=e=>({type:nn,payload:{action:e?"BottomSheetMinimized":"BottomSheetMaximized",name:"SignalUserInteraction",context:"BottomSheetMinimized"}}),dc={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var uc;function pc({schema:t,testId:n}){const i=vn(),a=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),s=m((e=>e.active.has(ds))),l=r(null),c=f(),d=()=>{c({type:ls.DISMISS_OVERLAY,payload:{id:cs,dismissalMethod:"rokt_backdrop"}})},u=Ci(0,(e=>e.customStates[rc]));o((()=>{p(!!u)}),[u]),oc(l,!!u);const p=e=>{const t=l.current;t&&(e?t.style.opacity="0":(t.style.display="flex",t.style.opacity="1"))};o((()=>{a&&c({type:nn,payload:{name:"SignalActivation",parentGuid:a}})}),[a]),o((()=>{s&&requestAnimationFrame((()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.focus()}))}),[s]);const y=Da(),{tabIndex:h,isDisabled:v,styles:g}=It(y),b=t.styles?Ce(dc,t.styles):dc;return e(Do,{styles:b,children:({classnames:i})=>{var a;return e("div",{className:null==i?void 0:i.wrapper,style:Object.assign({height:"100%",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9998",overflow:"hidden",display:"flex",opacity:"1",transition:"opacity 0.2s ease-in-out"},g),"aria-label":null!==(a=t.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":v,role:"dialog","aria-modal":!0,tabIndex:h,"data-testid":n,"data-e2e":"Overlay-Wrapper",ref:l,children:e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:t.allowBackdropToClose?d:void 0,"data-testid":n&&`${n}-backdrop`,"data-e2e":"Overlay-Backdrop"})})}})}function yc(){return e("div",{style:{width:"48px",height:"4px",backgroundColor:"#C6C6C8",borderRadius:"2px",margin:"0 auto -4px",position:"relative",top:"6px"}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(uc||(uc={}));const fc={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};function mc(t){const n=m((e=>e.slots)),i=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0}));return e(hc,Object.assign({},t,{slots:n,currentIndex:i}))}function hc(n){const{wrapperRef:i,containerRef:a,minimizedChildRef:o,maximizedChildRef:r}=sc();return n.isOpen?t("div",{ref:i,style:{height:"100000px"},children:[e(pc,Object.assign({},n)),e(gc,Object.assign({},n,{containerRef:a,minimizedChildRef:o,maximizedChildRef:r}))]}):null}const vc=Be`
57
+ `}}(l,u);if(!y)throw new Error("No custom state key provided for state trigger node.");const w={type:an,payload:{key:y,value:null!=f?f:1}},O={type:tn,payload:{name:"SignalUserInteraction",action:"Swipe",context:"SlideStateTrigger"}},T=e.schema.styles?zt(rr,e.schema.styles):rr,A=r(null),x=r(null),N=r(null),_=r(!1),L=r(void 0),{isDisabled:R}=It(d);o((()=>{if(t)return St()?(document.addEventListener("touchmove",P),document.addEventListener("touchend",D)):(document.addEventListener("mousemove",P),document.addEventListener("mouseup",D)),M}),[t]);const D=()=>{M(),L.current=void 0,n(!1),i||(F(!0),_.current?(G(j()),$()):G(0))},k=e=>{t||i||R||(L.current=cr(e),F(!1),n(!0))},P=e=>{var t,n;if(lr(N)){const i=Math.min(Math.max(0,(null!==(t=cr(e))&&void 0!==t?t:0)-(null!==(n=L.current)&&void 0!==n?n:0)),j());G(i),i/j()*100>=75?_.current=!0:_.current=!1}},$=()=>{var e,t;s(!0),p(w),p(O),null===(t=null===(e=lr(A).parentElement)||void 0===e?void 0:e.parentElement)||void 0===t||t.focus()},j=()=>lr(A).getBoundingClientRect().width-lr(N).getBoundingClientRect().width,G=e=>{var t;lr(N).style.transform=`translateX(${e}px)`,lr(x).style.transform=`translateX(${e+(null===(t=lr(N))||void 0===t?void 0:t.getBoundingClientRect().width)/2}px)`},F=e=>{e?(lr(N).style.transition="transform .2s",lr(x).style.transition="transform .2s"):(lr(N).style.transition="",lr(x).style.transition="")},M=()=>{document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",D),document.removeEventListener("touchmove",P),document.removeEventListener("touchend",D)};return a.createElement(Ro,{styles:T},(({classnames:t})=>{var n,o,r,s,l,c;return a.createElement("div",{className:`${g}`,"data-testid":e.testId,"data-e2e":"SlideStateTrigger"},a.createElement("div",{className:`${b} ${null!==(n=null==t?void 0:t.own)&&void 0!==n?n:""}`,ref:A,"aria-hidden":!0,"data-testid":e.testId&&`${e.testId}-track`},(null==m?void 0:m.value)?a.createElement("div",{className:`${S} ${null!==(o=null==t?void 0:t.label)&&void 0!==o?o:""}`,"data-testid":e.testId&&`${e.testId}-label`},m.value):null,a.createElement("div",{className:`${I} ${null!==(r=null==t?void 0:t.fill)&&void 0!==r?r:""}`,ref:x,"data-testid":e.testId&&`${e.testId}-fill`}),a.createElement("div",{className:`${E} ${null!==(s=null==t?void 0:t.thumb)&&void 0!==s?s:""}`,ref:N,"data-testid":e.testId&&`${e.testId}-thumb`,"data-e2e":"SlideStateTrigger-thumb",onMouseDown:k,onTouchStart:k},null!==(l=null==v?void 0:v.icon)&&void 0!==l?l:"ArrowForward")),a.createElement("button",{className:C,"aria-label":null!=h?h:void 0,onClick:$,disabled:i||R,"data-testid":e.testId&&`${e.testId}-button`},null!==(c=null==m?void 0:m.value)&&void 0!==c?c:"Unlock Offers"))}))}function lr(e){if(!e.current)throw new Error("Unexpected missing reference to required SlideStateTrigger Element");return e.current}function cr(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientX:e.clientX}function dr(e){const t=Ti();return a.createElement(Ro,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row",flexWrap:"wrap"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}function ur(e){const t=Ra(),n=Ei(),i=e.schema.customStateKey,o=Ci(0,(e=>e.customStates[i])),{tabIndex:r,styles:s,isDisabled:l}=It(t),c=()=>{n({type:an,payload:{key:i,value:o?0:1}})};return a.createElement(Ro,{styles:e.schema.styles},(({classnames:t})=>{var n;return a.createElement("button",{className:null==t?void 0:t.own,onClick:c,"data-testid":e.testId,"data-e2e":"ToggleButtonStateTrigger",disabled:l,"aria-disabled":l,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:r,style:Object.assign({cursor:"pointer"},s)},a.createElement(Oi,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function pr(e){const t=Ti();return a.createElement(Ro,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"row",overflowX:"auto"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}function yr(e){const t=Ti();return a.createElement(Ro,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:n?n.own:void 0,"data-testid":e.testId,style:{display:"flex",flexDirection:"column",overflowY:"auto"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))}))}const fr=s({extensions:{ctx:new Map,cache:[]}}),mr=()=>l(fr).extensions;function hr({extensions:e,extendStore:t,children:n}){const i=mr(),o=new Map([...i.ctx,...e.ctx]),r=i.cache.concat(e.cache);return a.createElement(fr.Provider,{value:{extensions:{ctx:o,cache:r},extendStore:t}},n)}function vr(e,t){const n=function(e){try{const t=JSON.parse(e);if(null!=t&&"object"==typeof t&&"type"in t&&"Extension"===t.type&&"name"in t&&"string"==typeof t.name&&t.name.trim().length>0&&"body"in t&&"object"==typeof t.body)return{type:"Extension",name:t.name,body:t.body}}catch(e){}return null}(t),i=n?e.ctx.get(n.name):null;return n&&i?[n,i]:null}function gr({data:e}){const t=vr(mr(),e);var n;if((e=>{const{extendStore:t,extensions:n}=l(fr);o((()=>{e&&t&&!n.cache.includes(e.name)&&(t(e),n.cache.push(e.name))}),[e,n.cache,t])})((n=null==t?void 0:t[1])?{sagas:n.sagas,reducer:n.reducer,name:n.name,interceptors:n.interceptors}:void 0),t){const[e,n]=t;return n.componentFactory(e.body)}return null}function br(e,t){if(Et("Extension",e))return a.createElement(gr,{data:e.node.data})}function Ir(e){const t=Ga(),n=Ri(),i=Xi(),r=Ti(),s=Ei(),l=d((()=>n.catalogItems||[]),[n]),c=e=>i({data:e},"catalogItem");return o((()=>{for(const e of l)s({type:tn,payload:{name:"SignalImpression",parentGuid:e.instanceGuid}})}),[l,s]),l.length>0?a.createElement(Ro,{styles:e.schema.styles},(({classnames:n})=>a.createElement("div",{"data-testid":e.testId,"data-e2e":"CatalogStackedCollection",className:null==n?void 0:n.own,style:{display:"flex",flexDirection:"column"}},a.Children.toArray(l.map(((n,i)=>a.createElement(Ua,{context:n},a.createElement(ja,{value:t(n)},a.createElement(Qi,{value:c(n)},r(e.schema.template,void 0,Wt(i,e.testId))))))))))):null}const Er={BasicText:(e,t)=>Vo(e,t,!0),StaticLink:(e,t)=>tr(e,t,!0)};function Sr(e){const t=Ti();return a.createElement(Ai,{value:t,overrides:Er},a.createElement(Oi,null,(t=>a.createElement(Ro,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:null==n?void 0:n.own,"data-testid":e.testId,"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,Wt(i,e.testId))))))})))))}function Cr(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,Wt(i,n)))))}function wr(e){const t=Ra(),n=Ei(),i=Ti(),o=Xi(),{event:r}=e.schema,{tabIndex:s,styles:l,isDisabled:c}=It(t),d=V((e=>o(e)),r.data||{}),u=()=>{n({type:on,payload:{name:r.type,body:{offerId:d.providerOfferId,title:d.title,description:d.description}}})};return a.createElement(Ro,{styles:e.schema.styles},(({classnames:t,mapperRef:n})=>{var r;return a.createElement("button",{"aria-disabled":c,"aria-label":null!==(r=e.schema.a11yLabel)&&void 0!==r?r:void 0,className:null==t?void 0:t.own,"data-e2e":"PartnerEventButtonTrigger","data-testid":e.testId,disabled:c,onClick:u,tabIndex:s,type:"button",style:Object.assign({cursor:"pointer"},l)},a.createElement(Qi,{value:o},(null==t?void 0:t.own)?function(e,t,n,i,o){return a.createElement(ta,{value:n(t)},Cr(e,i,o))}(e.schema.children,t.own,n,i,e.testId):Cr(e.schema.children,i,e.testId)))}))}function Or(e){const t=Ei(),n=e.schema.delay?e.schema.delay:1,i=e.schema.customStateKey,a=Ci(0,(e=>e.customStates[i]));return function({delay:e,callback:t}){const n=r(null);o((()=>{n.current=setTimeout(t,e)}),[])}({delay:n,callback:()=>{t({type:an,payload:{key:i,value:a?0:1}})}}),null}function Tr(e){const t=Ra(),n=Xi()(e.schema.value),i=Ei(),o=e.schema.customStateKey,r=Ci(0,(e=>e.customStates[o])),{tabIndex:s,styles:l,isDisabled:c}=It(t),d=()=>{navigator.clipboard.writeText(n),r||i({type:an,payload:{key:o,value:1}})};return a.createElement(Ro,{styles:e.schema.styles},(({classnames:t})=>{var n;return a.createElement("button",{className:null==t?void 0:t.own,onClick:d,"data-testid":e.testId,"data-e2e":"CopyToClipboardButton",disabled:c,"aria-disabled":c,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:s,style:Object.assign({cursor:"pointer"},l)},a.createElement(Oi,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function Ar(e){const t=Ra(),n=Ei(),{customStateKey:i,value:o}=e.schema,{tabIndex:r,styles:s,isDisabled:l}=It(t),c=()=>{n({type:an,payload:{key:i,value:o}})};return a.createElement(Ro,{styles:e.schema.styles},(({classnames:t})=>{var n;return a.createElement("button",{className:null==t?void 0:t.own,onClick:c,"data-testid":e.testId,"data-e2e":"ButtonStateTrigger",disabled:l,"aria-disabled":l,"aria-label":null!==(n=e.schema.a11yLabel)&&void 0!==n?n:void 0,tabIndex:r,style:Object.assign({backgroundColor:"transparent",cursor:"pointer",margin:0,padding:0},s)},a.createElement(Oi,null,(t=>a.Children.toArray(e.schema.children.map(((n,i)=>t(n,void 0,e.testId?`${e.testId}-child${i}`:void 0)))))))}))}function xr(e){return()=>{throw new Pt("FAILED_CREATING_UNHANDLED_NODE",`The default mapper does not handle the ${e} node. Make sure when you use the NodeMapperProvider, you pass an override for ${e} node.`)}}const Nr={Column:function(e,t){if("Column"===e.type)return a.createElement(Do,{schema:e.node,testId:t})},Row:function(e,t){if("Row"===e.type)return a.createElement(ko,{schema:e.node,testId:t})},StaticImage:function(e,t){if("StaticImage"===e.type)return a.createElement(Wo,{schema:e.node,testId:t})},DataImage:function(e,t){if("DataImage"===e.type)return a.createElement(qo,{schema:e.node,testId:t})},CreativeResponse:function(e,t){if("CreativeResponse"===e.type)return a.createElement(Ho,{schema:e.node,testId:t})},OneByOneDistribution:xr("OneByOneDistribution"),StackedDistribution:xr("StackedDistribution"),CarouselDistribution:xr("CarouselDistribution"),GroupedDistribution:xr("GroupedDistribution"),ProgressIndicator:xr("ProgressIndicator"),ProgressControl:xr("ProgressControl"),When:function(e,t){if("When"===e.type)return a.createElement(_o,{schema:e.node,testId:t})},Overlay:xr("Overlay"),CloseButton:xr("CloseButton"),RichText:function(e,t){if("RichText"===e.type)return a.createElement(Bo,{schema:e.node,testId:t})},BasicText:Vo,StaticLink:tr,DataIcon:function(e,t){if("DataIcon"===e.type)return a.createElement(ir,{schema:e.node,testId:t})},StaticIcon:function(e,t){if("StaticIcon"===e.type)return a.createElement(Ko,{schema:e.node,testId:t})},ZStack:function(e,t){if("ZStack"===e.type)return a.createElement(or,{schema:e.node,testId:t})},FlowRow:function(e,t){if("FlowRow"===e.type)return a.createElement(dr,{schema:e.node,testId:t})},SlideStateTrigger:function(e,t){if("SlideStateTrigger"===e.type)return a.createElement(sr,{schema:e.node,testId:t})},ToggleButtonStateTrigger:function(e,t){if("ToggleButtonStateTrigger"===e.type)return a.createElement(ur,{schema:e.node,testId:t})},PartnerEventButtonTrigger:function(e,t){if("PartnerEventButtonTrigger"===e.type)return a.createElement(wr,{schema:e.node,testId:t})},TimerStateTrigger:function(e,t){if("TimerStateTrigger"===e.type)return a.createElement(Or,{schema:e.node})},CatalogStackedCollection:function(e,t){if("CatalogStackedCollection"===e.type)return a.createElement(Ir,{schema:e.node,testId:t})},CatalogResponseButton:xr("CatalogResponseButton"),ScrollableRow:function(e,t){if("ScrollableRow"===e.type)return a.createElement(pr,{schema:e.node,testId:t})},ScrollableColumn:function(e,t){if("ScrollableColumn"===e.type)return a.createElement(yr,{schema:e.node,testId:t})},EscapeHatch:br,BottomSheet:xr("BottomSheet"),CatalogQuantityOption:xr("CatalogQuantityOption"),CatalogRadioGroup:xr("CatalogRadioGroup"),CatalogQuantityCounter:xr("CatalogQuantityCounter"),InlineContainer:function(e,t){if("InlineContainer"===e.type)return a.createElement(Sr,{schema:e.node,testId:t})},CopyToClipboardButton:function(e,t){if("CopyToClipboardButton"===e.type)return a.createElement(Tr,{schema:e.node,testId:t})},ButtonStateTrigger:function(e,t){if("ButtonStateTrigger"===e.type)return a.createElement(Ar,{schema:e.node,testId:t})},CatalogCombinedCollection:xr("CatalogCombinedCollection")};function _r(e){return function(t,n,i){const o=n&&n[t.type],r=null!=o?o:Nr[t.type];return a.createElement(Zo,{schema:t,reporter:e},r&&r(t,i)||function(e){throw new Pt("FAILED_CREATING_LAYOUT_NODE",`Failed to create layout node ${JSON.stringify(e)}`)}(t))}}const Lr={transformLinksToAnchorText:function(e={}){return{data:V((e=>$i(e)?`<a target="_blank" href="${e.url}">${e.title}</a>`:""),e)}}};function Rr(e){const{childLayouts:t}=e,n=Ei(),[i,a]=d((()=>{const e=Ce(B("childLayoutId"),t);return[e,V((e=>e.childLayoutSchema.predicates),e)]}),[t]),r=So(a);o((()=>{Object.entries(r).forEach((([e,t])=>{const a=i[e];t&&a&&n({type:un,payload:a})}))}),[r,i,n])}function Dr(e){const{settings:t,dispatch:n,children:i}=e,r=Ji(t.offerData.creative.copy||{})(Lr.transformLinksToAnchorText(t.offerData.creative.links),"creativeLink"),s=_r(t.logger),[l,d]=c("ENABLED");return o((()=>t.gateway.onInteractivityChange(d)),[t]),mn(t.rootElement,n),a.createElement(na.Provider,{value:"VARIANT"},a.createElement(xi.Provider,{value:t.rootElement},a.createElement(za.Provider,{value:t.pluginId},a.createElement(Aa,{context:t.gateway},a.createElement(Na,{context:t.layoutSchema},a.createElement(Wa.Provider,{value:t.schemaVersion},a.createElement(Li,{context:t.offerData},a.createElement(ja,{value:Da(t.offerData.creative)},a.createElement(La.Provider,{value:l},a.createElement(Ai,{value:s},a.createElement(aa.Provider,{value:t.offerPositionIndex},a.createElement(Ii.Provider,{value:n},a.createElement(Qi,{value:r},a.createElement(kr,null,a.createElement(Rr,{childLayouts:t.childLayouts}),i))))))))))))))}function kr(e){var t;const{children:n}=e,i=Ha(),r=function(){const[e,t]=c(null),n=l(Ta).get();return o((()=>n.onGlobalStateChange((n=>{$(n,e)||t(n)}))),[n]),e}(),s=l(xi)||void 0,d=oa(),p=u((e=>gi(e,i,d,s)),[s]);return r?a.createElement(ta,{value:p(Object.values(null!==(t=null==r?void 0:r.breakpoint.breakpoints)&&void 0!==t?t:{}))},a.createElement(Si.Provider,{value:r},n)):null}function Pr(e){return a.createElement("style",{"data-testid":e.testId},"\n* {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n}\nbody {\n margin: 0;\n font-family: sans-serif;\n}\np {\n margin: 0;\n}\nimg {\n max-width: 100%;\n}\n")}function $r(e,t,n,i,a,o){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){o.current.isRunning=!0,a&&"in"===t&&function(e,t){e.style.height=`${t.clientHeight}px`}(a,e);const r=e.animate(n,{duration:i,iterations:1});return r.onfinish=()=>{"in"===t?Co(e):wo(e),o.current.isRunning=!1},r.oncancel=()=>{"in"===t?Co(e):wo(e),o.current.isRunning=!1},()=>{r.finish()}}return"in"===t?Co(e):wo(e),()=>{}}const jr={FadeInOut:{in:[{opacity:0,display:"none"},{opacity:0,display:"none",offset:.5},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],out:[{opacity:1},{opacity:0,offset:.75},{opacity:0}]}};function Gr({visible:e,effect:t,children:n,parentElement:i,containerClassName:s}){const[l,d]=c(e),u=r(null),p=r({isRunning:!1}),y=Oo(t);return o((()=>{const t=new ResizeObserver((function(t){i&&e&&!p.current.isRunning&&t.forEach((e=>{e.contentBoxSize?function(e,t){var n;Array.isArray(e.contentBoxSize)&&e.contentBoxSize[0]?t.style.height=e.contentBoxSize[0].blockSize+"px":"object"==typeof(n=e.contentBoxSize)&&null!=n&&"blockSize"in n&&"number"==typeof n.blockSize&&"inlineSize"in n&&"number"==typeof n.inlineSize?t.style.height=e.contentBoxSize.blockSize+"px":t.style.height="auto"}(e,i):e.contentRect&&function(e,t){t.style.height=`${e.contentRect.height}px`}(e,i)}))}));return e&&u.current&&(Co(u.current),t.observe(u.current)),()=>{t.disconnect()}}),[e,i]),o((()=>e&&!l&&u.current&&i?(d(!0),$r(u.current,"in",jr[t.type].in,y,i,p)):!e&&l&&u.current&&i?(d(!1),$r(u.current,"out",jr[t.type].out,y/2,i,p)):()=>{}),[e,i,y]),a.createElement("div",{ref:u,style:{display:"none"},className:s},n)}function Fr(e){const t=Ti();return a.createElement(Ro,{styles:e.schema.styles},(({classnames:n})=>{var i;return a.createElement("div",{className:null==n?void 0:n.own,"data-testid":e.testId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(i=e.schema.a11yLabel)&&void 0!==i?i:void 0},t(e.schema.template))}))}const Mr="ACTIVE/ADD",Br="ACTIVE/DELETE",Ur="BREAKPOINT/UPDATE_ACTIVE",Vr="BREAKPOINT/INITIALISE",zr="BREAKPOINT/SET_BREAKPOINTS",Hr="FONTS/SET",Wr="LAYOUT/UPDATE",qr="CONFIG/HANDLE",Jr="PLUGIN/CLOSE_PLUGIN",Kr="SETTINGS/SET",Yr="CACHE/ADD_SERIALIZED_VALUE",Zr="CACHE/UPDATE_SERIALIZED_VALUE",Qr="CACHE/CLEAR_SERIALIZED_VALUE",Xr="SIGNAL/QUEUE",es="SIGNAL/PROCESSED",ts="SIGNAL/PROCESS",ns="OVERLAY/DISMISS_OVERLAY",is="ERROR/REPORT",as="LOG",os="CUSTOM_STATES/SET",rs={LAYOUT_UPDATE:Wr,UPDATE_ACTIVE_BREAKPOINT:Ur,INITIALISE_BREAKPOINT:Vr,ACTIVE_ADD:Mr,ACTIVE_DELETE:Br,SET_FONTS:Hr,QUEUE_SIGNAL:Xr,SIGNAL_PROCESSED:es,CACHE_SERIALIZED_VALUE:Yr,UPDATE_CACHED_SERIALIZED_VALUE:Zr,CLEAR_SERIALIZED_VALUE_FROM_CACHE:Qr,SET_SETTINGS:Kr,SET_CUSTOM_STATE:os},ss={HANDLE_CONFIG:qr,SET_BREAKPOINTS:zr,CLOSE_PLUGIN:Jr,RAISE_METRIC:qt,PREPARE_SIGNAL:sn,DISMISS_OVERLAY:ns,REPORT_ERROR:is,LOG:as,OPEN_LINK:ln},ls="plugin-overlay",cs="plugin";function ds(t){var n;const i=t.schema.styles,o=f(),r={type:(null===(n=t.action)||void 0===n?void 0:n.type)||ns,payload:{id:ls,dismissalMethod:t.schema.dismissalMethod}},s=()=>{o(r)},l=Ra(),{tabIndex:c,styles:d,isDisabled:u}=It(l);return e(Ro,{styles:i,children:({classnames:n})=>{var i;return e("button",{title:"Close",className:null==n?void 0:n.own,onClick:s,"data-testid":t.testId,"data-e2e":"CloseButton",disabled:u,tabIndex:c,"aria-disabled":u,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:void 0,style:Object.assign({cursor:"pointer"},d),children:e(Oi,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}const us={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var ps;function ys({isOpen:n,schema:i,testId:r,children:s}){const l=hn(),c=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),d=m((e=>e.active.has(cs))),u=f(),p=()=>{u({type:ss.DISMISS_OVERLAY,payload:{id:ls,dismissalMethod:"rokt_backdrop"}})};o((()=>{c&&u({type:tn,payload:{name:"SignalActivation",parentGuid:c}})}),[c]),o((()=>{d&&requestAnimationFrame((()=>{var e;return null===(e=l.current)||void 0===e?void 0:e.focus()}))}),[d]);const y=Ra(),{tabIndex:h,isDisabled:v,styles:g}=It(y),b=i.styles?we(us,i.styles):us;if(!n)return null;const I=e(Oi,{children:e=>a.Children.toArray(i.children.map(((t,n)=>e(t,void 0,r?`${r}-child${n}`:void 0))))});return e(Ro,{styles:b,children:({classnames:n})=>{var a;return t("div",{className:null==n?void 0:n.wrapper,style:Object.assign({position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:"auto"},g),"aria-label":null!==(a=i.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":v,role:"dialog","aria-modal":!0,tabIndex:h,"data-testid":r,"data-e2e":"Overlay-Wrapper",children:[e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:i.allowBackdropToClose?p:void 0,"data-testid":r&&`${r}-backdrop`,"data-e2e":"Overlay-Backdrop"}),s(I,l)]})}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(ps||(ps={}));const fs={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const ms=p((function({schema:t,testId:n,children:i},a){const o=t.styles?we(fs,t.styles):fs;return e(Ro,{styles:o,children:({classnames:t})=>e("div",{className:null==t?void 0:t.own,style:{position:"relative",zIndex:"3",outline:"none"},ref:a,tabIndex:-1,"data-e2e":"Overlay-Container","data-testid":n&&`${n}-container`,children:i})})}));const hs=h((function(e){return{isOpen:e.active.has(ls)}}))((function(t){return e(ys,Object.assign({},t,{children:(n,i)=>e(ms,Object.assign({},t,{ref:i,children:n}))}))}));const vs=h((function(e){return{isOpen:e.active.has(ls)}})),gs={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const bs=p((function({schema:t,testId:n,children:i},a){const s=r(null),l=t.styles?we(gs,t.styles):gs;return o((()=>{if(s.current)return function(e){const t=requestAnimationFrame((()=>{e&&e.style.setProperty("max-height","100%")}));return()=>{cancelAnimationFrame(t)}}(s.current)}),[]),e(Ro,{styles:l,children:({classnames:t})=>e("div",{style:{width:"100%",maxHeight:"0%",transition:"max-height 0.8s",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)",alignSelf:"flex-end"},ref:s,children:e("div",{className:null==t?void 0:t.own,style:{position:"relative",zIndex:"3",outline:"none",borderBottomLeftRadius:"0",borderBottomRightRadius:"0"},ref:a,tabIndex:-1,"data-testid":n&&`${n}-container`,"data-e2e":"BottomSheet-Container",children:i})})})}));const Is=vs((function(t){const n=m((e=>e.breakpoint.activeBreakpoint));return e(ys,Object.assign({},t,{children:(i,a)=>e("default"===n?bs:ms,Object.assign({},t,{ref:a,children:i}))}))}));const Es="DisplayPreset.FULLSCREEN",Ss="DisplayPreset.EMBEDDED",Cs="DisplayPreset.ATTACHED",ws="ERROR",Os="INFO",Ts="WARNING";var As;!function(e){e.PAYPAL="Paypal"}(As||(As={}));const xs="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DCUI_SCHEMA_VERSION:"",ROKT_DOMAIN:""};function*Ns(e,t,n){(function(e){return"object"==typeof e&&null!==e&&"type"in e&&Object.values(pn).includes(e.type)})(n)&&!e.includes(n.type)&&(yield ze(t.globalDispatch.bind(t),n))}function _s(e,t){return!e||t<1?null:{cartItemId:e.cartItemId,catalogItemId:e.catalogItemId,name:e.title,description:e.description,quantity:t,currency:e.currency||"$",unitPrice:e.price||0,totalPrice:(e.price||0)*t,linkedProductId:e.linkedProductId,quantityMustBeSynchronized:e.quantityMustBeSynchronized,providerData:e.providerData||""}}function Ls(e){switch(typeof e){case"undefined":return"";case"object":return null===e?"":JSON.stringify(e);case"string":return e;default:return String(e)}}function Rs(e){return re(Ls,e)}function*Ds(e,t){const n=yield He(e,rt.expanding(10));for(;n;){const e=yield We(n);yield ze(t,e)}}function*ks(e,t){const n=yield We(e);yield ze(t,n)}function*Ps(e){for(;;){const t=yield We(e);yield qe(t)}}function*$s(e,t){const n=de(Oe("moduleName"),Te("orchestrator"),t.payload.additionalInformation||{}),i=Object.assign(Object.assign({},t.payload),{additionalInformation:n?Rs(n):{}});try{yield ze(e,i)}catch(e){}t.payload.level===ws&&(yield qe({type:on,payload:{name:"PLACEMENT_FAILURE"}}),yield qe({type:ss.CLOSE_PLUGIN}))}const js="INVALID_RESPONSE_OBJECT",Gs="FAILED_TO_OPEN_LINK",Fs="NO_PARENT_GUID",Ms="FAILED_TO_NOTIFY_INTERACTIVE",Bs="FAILED_TO_ESTABLISH_PARTNER_VALIDATION";var Us=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a<i.length;a++)t.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(e,i[a])&&(n[i[a]]=e[i[a]])}return n};function Vs(e,t){return n=>n&&n.replace(e,t)}const zs=Vs(/['""();{}@:[\]!/=]/g,""),Hs=/^(normal|italic|oblique( \d+deg)*)$/i,Ws=(e="")=>Hs.test(e)?e:void 0,qs=Vs(/[;{}@[\]!]/g,"");function Js(e){const{fontFamily:t,sources:n}=e,i=Us(e,["fontFamily","sources"]),a=document.fonts,o=new FontFace(t,n.join(", "),i);return a.add(o),o.load().catch((e=>(a.delete(o),Promise.reject(e))))}function Ks(e=[]){const t=Array.from(document.fonts.values());return Promise.all(e.map((e=>{const n=function(e){return{fontFamily:zs(e.fontFamily)||"",style:Ws(e.style),weight:zs(e.weight),sources:e.sources.map((e=>qs(e)||"")),display:e.display}}(e);return t.find((e=>e.family===n.fontFamily&&e.weight===n.weight&&(e.style===n.style||!n.style)))?Promise.resolve():Js(n).then((()=>{})).catch((e=>`${e}`.includes("SyntaxError")?(n.fontFamily='"'+n.fontFamily+'"',Js(n).then((()=>{}))):Promise.reject(e))).catch((e=>Promise.resolve(`Error loading font: [Font (${JSON.stringify(n)})] [Message - ${e}]`)))}))).then((e=>{const t=e.filter(Boolean);return t.length>0?Promise.reject(t):Promise.resolve()}))}function Ys(e){const t=f(),n=m((e=>{const t=e.fonts.map((e=>({fontFamily:e.fontFamily,style:e.fontStyle||"normal",weight:e.fontWeight,sources:e.src}))),n=t.find((e=>"rokt-icons"===e.fontFamily));if(n)n.display="block";else{const e=null!==(i=xs.ROKT_DOMAIN)&&void 0!==i?i:"";t.push(function(e=""){return{fontFamily:"rokt-icons",weight:"400",sources:[`url("${e}/icons/rokt-icons.woff") format("woff")`],display:"block"}}(e))}var i;return JSON.stringify(t)}));return o((()=>{Ks(JSON.parse(n)).catch((e=>{const n={type:is,payload:{level:Os,code:"FAILED_TO_LOAD_FONT",message:`Error loading fonts:\n\t${e.join("\n\t")}`}};t(n)}))}),[n]),o((()=>{const e=()=>{var e,t;null===(t=null===(e=window.frameElement)||void 0===e?void 0:e.iFrameResizer)||void 0===t||t.resize()};return document.fonts.addEventListener("loadingdone",e),()=>{document.fonts.removeEventListener("loadingdone",e)}}),[]),null}function Zs(e){return null!=e?e:null}function Qs(){return new Set([ls])}function Xs(e){return e.breakpoint.breakpoints[e.breakpoint.activeBreakpoint]||0}const el=xe(B(1)),tl=re(B(0)),nl=e=>G(Ae($(e)),tl,el,ne,ye({},["breakpoint","breakpoints"]));function il(e){return nl(e.breakpoint.activeBreakpoint)(e)}function al(e,t){return e.customStates[`module${t}`]||{}}function ol(e){return`${e.name}:${e.parentGuid}`}function rl(e,t){return!e.processed.includes(ol(t))||(n=t.name,void 0!==Rt.find((e=>e===n)));var n}function sl(){return new Map}const ll={layout:function(e=Zs(),t){return t.type===Wr?t.payload:e},breakpoint:function(e={breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},t){var n;switch(t.type){case Ur:return Object.prototype.hasOwnProperty.call(e.breakpoints,t.payload.activeBreakpoint)?Object.assign(Object.assign({},e),{activeBreakpoint:t.payload.activeBreakpoint}):e;case Vr:return{activeBreakpoint:null!==(n=t.payload.activeBreakpoint)&&void 0!==n?n:"default",breakpoints:Object.assign({default:0},t.payload.breakpoints),initialised:!0};default:return e}},active:function(e=Qs(),t){var n,i;switch(t.type){case Mr:{const i=new Set(e);return i.add(null===(n=t.payload)||void 0===n?void 0:n.id),i}case Br:{const n=new Set(e);return n.delete(null===(i=t.payload)||void 0===i?void 0:i.id),n}default:return e}},fonts:function(e=[],t){return t.type===Hr?t.payload:e},signal:function(e={queue:[],processed:[]},t){switch(t.type){case Xr:return fe({queue:n=>rl(e,t.payload.signal)?Le(J(B("signal"),ol),n.concat(t.payload)):n},e);case es:return fe({queue:e=>Ne(J(B("signal"),_e({name:t.payload.name,parentGuid:t.payload.parentGuid})))(e),processed:me(ol(t.payload))},e);default:return e}},serializableCache:function(e=sl(),t){switch(t.type){case Yr:case Zr:if(t.payload.key&&t.payload.value){return new Map([...e]).set(t.payload.key,t.payload.value)}return e;case Qr:{const n=new Map([...e]);return t.payload&&n.delete(t.payload),n}default:return e}},settings:function(e={closeOnComplete:!0},t){return t.type===Kr?T(((e,t)=>ce(t)?e:t),e,t.payload):e},customStates:function(e={root:{}},t){if(t.type===os){if(t.payload.key&&!isNaN(t.payload.value)){const n=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:"root";return b([n,t.payload.key],Number(t.payload.value),e)}return e}return e}};function*cl(e,t){var n,i;try{const a=(null===(n=e.activeBreakpointEventChannel)||void 0===n?void 0:n.call(e,t.payload))||(i=t.payload,st((e=>{const t=Object.entries(i).reduce(((e,t)=>{const i=window.matchMedia(`(min-width: ${t[1]}px)`);return"addEventListener"in i&&"function"==typeof i.addEventListener?(i.addEventListener("change",n),e[t[0]]=i):"addListener"in i&&"function"==typeof i.addListener&&(i.addListener(n),e[t[0]]=i),e}),{});return setTimeout((()=>n()),0),()=>{Object.entries(t).forEach((e=>{const t=e[1];"removeEventListener"in t&&"function"==typeof t.removeEventListener?t.removeEventListener("change",n):"removeListener"in t&&"function"==typeof t.removeListener&&t.removeListener(n)}))};function n(){try{e(function(e,t){return Object.entries(e).reduce(((e,n)=>n[1].matches&&(t[n[0]]||0)>(t[e]||0)?n[0]:e),"default")}(t,i))}catch(t){e(t)}}})));try{let e=yield We(a);for(yield qe({type:rs.INITIALISE_BREAKPOINT,payload:{activeBreakpoint:e,breakpoints:t.payload}});;)e=yield We(a),yield qe({type:rs.UPDATE_ACTIVE_BREAKPOINT,payload:{activeBreakpoint:e}})}catch(e){const n=e;yield qe({type:is,payload:{level:Ts,code:"FAILED_TO_DETERMINE_BREAKPOINT",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}finally{(yield Je())&&a.close()}}catch(e){const n=e;yield qe({type:is,payload:{level:ws,code:"FAILED_TO_ESTABLISH_BREAKPOINT_CHANNEL",message:null==n?void 0:n.message,additionalInformation:{stack:null==n?void 0:n.stack,breakpoints:t.payload}}})}}function dl(e,t,n){return st((i=>{const a=e.subscribe((e=>{const t=n(e);t&&i({type:qr,payload:t})}),(e=>{i(e)})),o=t.fonts.subscribe((e=>{i({type:Hr,payload:e})}),(e=>{i(e)}));return()=>{a.unsubscribe(),o.unsubscribe()}}),rt.sliding(2))}var ul=Object.freeze({__proto__:null,CartEvent:{UPDATE_CART_ITEM_MESSAGE:"UPDATE_CART_ITEM_MESSAGE",UPSERT_ALERT:"UPSERT_ALERT",DELETE_ALERT:"DELETE_ALERT",UPSERT_DELIVERY_DETAILS:"UPSERT_DELIVERY_DETAILS"}}),pl=Object.freeze({__proto__:null,PartnerMessage:{UpdateCartItem:"V2_UPDATE_CART_ITEM"},PlacementMessage:{CartItemUpdated:"V2_CART_ITEM_UPDATED"}}),yl=Object.freeze({__proto__:null,V1:ul,V2:pl}),fl=Object.freeze({__proto__:null,PartnerMessage:{CartItemInstantPurchaseResponse:"CART_ITEM_INSTANT_PURCHASE_RESPONSE"},PlacementMessage:{CartItemInstantPurchase:"CART_ITEM_INSTANT_PURCHASE"}}),ml=Object.freeze({__proto__:null,PartnerValidationEvent:{SET_PARTNER_VALIDATION_STATUS:"SET_PARTNER_VALIDATION_STATUS",OPT_IN_TO_PARTNER_VALIDATION:"OPT_IN_TO_PARTNER_VALIDATION",SHOW_PARTNER_VALIDATION_STATUS:"SHOW_PARTNER_VALIDATION_STATUS"}});const hl="LINK_NAVIGATION_REQUEST",vl="REALTIME_OFFER_FULFILLMENT_SUCCESS",gl="REALTIME_OFFER_FULFILLMENT_FAILURE";var bl=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const Il={newTab:"_blank",self:"_top",roktWebViewSDK:"roktWebViewSDK",inApp:"inApp",overrideLinkNavigation:"overrideLinkNavigation"};function El({url:e,urlBehavior:t,external:n},i=window){return bl(this,void 0,void 0,(function*(){if(!e)return null;if("overrideLinkNavigation"===t)return n.partner.send(hl,{url:e}).then((()=>null));const a=Il[t];if(i.RoktWebViewSDK){const t=i.RoktWebViewSDK.open(e);return t?{ref:t}:null}if("_top"===a&&i.top)return i.top.location.href=e,null;const o=i.open(e,a);if(o)try{o.opener=null}catch(e){}return o?{ref:o}:null}))}var Sl=Object.freeze({__proto__:null,openLink:El});function Cl(e,t,n,i){const a=function(e){return"object"==typeof e&&null!=e&&"message"in e&&"string"==typeof e.message&&e.message.includes("timed out")}(e),o=a?{originErrorCode:n}:void 0;return{type:is,payload:{level:Ts,code:a?"COMMUNICATION_FAILURE_WITH_WSDK":n,message:t,additionalInformation:Object.assign(Object.assign({},o),i)}}}var wl=Object.freeze({__proto__:null,makePluginWarningAction:Cl});function Ol(e){return null!=e&&"object"==typeof e&&"ref"in e&&"object"==typeof e.ref&&!Array.isArray(e.ref)&&null!=e.ref}var Tl=Object.freeze({__proto__:null,isWindow:Ol}),Al=Object.assign(Object.assign(Object.assign({},Sl),wl),Tl);function*xl(e=10){(yield Ke((e=>e.signal.queue.length>0)))&&(yield mt(30),e>=1&&(yield*xl(e-1)))}function*Nl(e){try{yield*xl(10),yield pt(e.close)}catch(e){const t=Al.makePluginWarningAction(e,"Failed to close the plugin","FAILED_TO_CLOSE_PLUGIN");yield yt(t)}}function*_l(e,{payload:t}){var n;if("string"==typeof(n=t.name)&&$t.includes(n))switch(t.name){case"V2_CART_ITEM_UPDATED":case"CART_ITEM_INSTANT_PURCHASE":case"UPSELL_CREATIVE_SENT":case"INITIATE_INSTANT_PURCHASE_EVENT":case"REALTIME_OFFER_FULFILLMENT_REFERRAL":case"REALTIME_OFFER_FULFILLMENT_CONVERSION":case"REALTIME_OFFER_FULFILLMENT_SUCCESS":yield e.send(t.name,t.body);break;case"OFFER_ENGAGEMENT":case"PLACEMENT_CLOSED":case"PLACEMENT_COMPLETED":case"PLACEMENT_FAILURE":case"PLACEMENT_INTERACTIVE":case"POSITIVE_ENGAGEMENT":yield e.send(t.name);break;default:return}}const Ll=F("FAILED_TO_PARSE_CONFIG","code");function*Rl(e,t){var n;const i=yield pt(dl,e.configService,e.themeService,t);for(;;)try{const e=yield ft(i);yield yt(e)}catch(e){const t=e;yield yt({type:is,payload:{level:ws,code:Ll(t),message:null!==(n=null==t?void 0:t.message)&&void 0!==n?n:"An error occured parsing or receiving Plugin config, fonts or configurables.",additionalInformation:{stack:null==t?void 0:t.stack}}})}}function*Dl(e,t){yield ct([dt(Rl,e,t),ut(on,_l,e.partnerInteractionService)])}function kl(e){switch(e){case"ATTACHED":return Cs;case"EMBEDDED":return Ss;default:return Es}}function*Pl(e,t){const n={preset:kl(t)};yield pt(e.setDisplaySettings,n),yield yt({type:rs.ACTIVE_ADD,payload:{id:cs}})}function*$l(e,t){var n;const i=null!==(n=t.payload.data)&&void 0!==n?n:{};try{yield ze(e,{code:t.payload.code,level:Os,message:t.payload.message||"Plugin Generic Log",additionalInformation:Rs(i)})}catch(e){}}function*jl(e){yield qe({type:rs.QUEUE_SIGNAL,payload:{signal:e.payload}}),yield qe({type:ts})}function*Gl(e){yield qe({type:rs.QUEUE_SIGNAL,payload:e.payload}),yield qe({type:ts})}function*Fl(e,t){const n=yield Ke((e=>e.signal.queue.filter((t=>rl(e.signal,t.signal)))));if(Array.isArray(n)&&n.length)for(const e of n){const t="criteria"in e?e.criteria:void 0;switch(e.signal.name){case"SignalActivation":case"SignalLoadComplete":case"SignalImpression":yield*Ml(e.signal,i(t));break;case"SignalViewed":yield*Bl(e.signal,i(t));break;case"SignalDismissal":yield*Ul(e.signal,i(t));break;case"SignalInstantPurchaseDismissal":yield*Vl(e.signal,i(t));break;case"SignalLoadStart":yield*zl(e.signal,i(t));break;case"SignalGatedResponse":case"SignalResponse":yield*Hl(e.signal,i(t,!0));break;case"SignalUserInteraction":yield*Wl(e.signal,i(t));break;case"SignalCartItemQuantitySelected":yield*ql(e.signal,i(t));break;case"SignalCartItemInstantPurchaseInitiated":yield*Jl(e.signal,i(t));break;case"SignalCartItemInstantPurchase":yield*Kl(e.signal,i(t));break;case"SignalCartItemInstantPurchaseFailure":yield*Yl(e.signal,i(t))}yield qe({type:rs.SIGNAL_PROCESSED,payload:e.signal})}function i(t,n=!1){return function(i,a,o){return t?ze(e.prepareExternalSignal,t.key,i,a,o):ze(n?e.issueSignalSync:e.issueSignal,i,a,o)}}}function*Ml(e,t){let n;e.creativeInstanceGuid&&(n={},n.creativeInstanceGuid=e.creativeInstanceGuid);try{yield t(e.name,e.parentGuid,n)}catch(t){yield Zl(e,t)}}function*Bl(e,t){try{yield t(e.name,e.parentGuid,{objectData:{supportedByBrowser:e.supportedByBrowser.toString()},metadata:[{name:"inferred",value:e.inferred.toString()}]})}catch(t){yield Zl(e,t)}}function*Ul(e,t){try{yield t(e.name,e.parentGuid,e.dismissalMethod?{objectData:{dismissalMethod:e.dismissalMethod}}:void 0)}catch(t){yield Zl(e,t)}}function*Vl(e,t){try{yield t(e.name,e.parentGuid,void 0)}catch(t){yield Zl(e,t)}}function*zl(e,t){var n;const i={overrideTimestamp:null!==(n=e.overrideTimestamp)&&void 0!==n?n:new Date};try{yield t(e.name,e.parentGuid,i)}catch(t){yield Zl(e,t)}}function*Hl(e,t){try{yield t(e.name,e.parentGuid,function(e){const t={creativeInstanceGuid:e.responseActionPayload.creativeInstanceGuid};"Url"===e.responseActionPayload.name&&(t.transformedTrafficURL=e.responseActionPayload.transformedTrafficURL);return t}(e))}catch(t){yield Zl(e,t)}}function*Wl(e,t){const n=e.parentGuid?e.parentGuid:yield Ke((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));try{if(!n||"string"!=typeof n)throw new Error(`Cannot raise SignalUserInteraction, missing or invalid parent GUID: ${JSON.stringify(e)}`);yield t(e.name,n,{objectData:{action:e.action,context:e.context}})}catch(t){yield Zl(e,t)}}function*ql(e,t){const n={objectData:{preselected:e.objectData.preselected.toString(),quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield Zl(e,t)}}function*Jl(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString()}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield Zl(e,t)}}function*Kl(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),initiatedBy:e.objectData.initiatedBy}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield Zl(e,t)}}function*Yl(e,t){const n={objectData:{catalogItemId:e.objectData.catalogItemId,quantity:e.objectData.quantity.toString(),failureReason:e.objectData.failureReason,providerId:e.objectData.providerId}};try{yield t(e.name,e.parentGuid,n)}catch(t){yield Zl(e,t)}}function Zl(e,t){const n=Al.makePluginWarningAction(t,(null==t?void 0:t.message)||"Failed to issue signal","FAILED_TO_ISSUE_SIGNAL",{signalName:null==e?void 0:e.name,parentGuid:null==e?void 0:e.parentGuid,stack:null==t?void 0:t.stack});return qe(n)}function*Ql(e){yield qe({type:os,payload:e.payload})}function*Xl(e,t){if("Interactive"===t.payload.name)try{yield*function*(e){const t="METRIC";(yield Ke((e=>e.serializableCache.has(t))))||(yield ze(e.notifyInteractive),yield qe({type:Yr,payload:{key:t,value:"Interactive"}}))}(e)}catch(e){const t=e;yield*function*(e){var t;yield qe({type:is,payload:{level:Os,code:Ms,message:null!==(t=null==e?void 0:e.message)&&void 0!==t?t:"Failed to notify interactive",additionalInformation:{stack:null==e?void 0:e.stack}}})}(t)}}function*ec(e,t){const n=e.context.getOverrideLinkNavigation()?"overrideLinkNavigation":t.payload.urlBehaviour;try{"inApp"===n?yield ze(e.createChildPlugin,{name:"url-modal",config:{url:t.payload.url,method:"GET"}}):yield ze(El,{url:t.payload.url,urlBehavior:n,external:e})}catch(e){yield qe(Cl(e,"Failed to open link",Gs,{url:t.payload.url,urlBehaviour:n}))}}function*tc(e){const t=yield Ke((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));yield qe({type:rs.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield qe({type:Jr}),t?yield qe({type:tn,payload:{name:"SignalDismissal",parentGuid:t,dismissalMethod:e.payload.dismissalMethod}}):yield qe({type:is,payload:{level:Os,code:Fs,message:"ParentGuid does not exist"}})}const nc=h((function(e){return{isOpen:e.active.has(ls)}})),ic="undefined"!=typeof window;function ac(e,t){o((()=>{if(!ic||t)return;const n=e.current;if(!n)return;const i=e=>{e.preventDefault()},a=["wheel","touchmove"];a.forEach((e=>{n.addEventListener(e,i,{passive:!1})}));const o=e=>{["ArrowUp","ArrowDown","PageUp","PageDown","Space"].includes(e.code)&&e.preventDefault()};return window.addEventListener("keydown",o),()=>{a.forEach((e=>{n.removeEventListener(e,i)})),window.removeEventListener("keydown",o)}}),[e,t])}const oc="Minimized",rc=()=>{const e=r(null),t=r(null),n=r(null),i=r(null),a=r(null),s=Ci(0,(e=>e.customStates[oc])),l=Ei(),c=Ra(),d=r(0),p=r(!1),y=r(0),f=r([]),m=r(void 0),{isDisabled:h}=It(c);ac(e,!!s);const v=u((()=>{k(),m.current=void 0,p.current=!1,L(!0);g()?S():_(0)}),[]),g=()=>{const e=N();return s?e<=-.2:e>=.2};o((()=>{s?(w(),l(lc(!0))):(O(),l(lc(!1)))}),[s,l]),o((()=>{requestAnimationFrame((()=>{D(!s,n),D(!!s,i),R()}))}),[]);const b=u((e=>{if(t.current){e.preventDefault();const t=E(e);_(t)}}),[t]),I=u((e=>{Date.now()-y.current<200||(y.current=Date.now(),s?C(!1):p.current||h||(p.current=!0,x(),m.current=sc(e),L(!1),P()))}),[s,h]);o((()=>{const e=t.current;return e&&(e.addEventListener("mousedown",I),e.addEventListener("touchstart",I)),()=>{null==e||e.removeEventListener("mousedown",I),null==e||e.removeEventListener("touchstart",I)}}),[t,I]);const E=e=>{var t,n;return(null!==(t=sc(e))&&void 0!==t?t:0)-(null!==(n=m.current)&&void 0!==n?n:0)},S=()=>{C(!s)},C=e=>{const t=(e=>({type:an,payload:{key:oc,value:e?1:0}}))(e);t&&l(t)},w=()=>{var e,t,a,o;const r=null!==(t=null===(e=n.current)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:0,s=(null!==(o=null===(a=i.current)||void 0===a?void 0:a.clientHeight)&&void 0!==o?o:0)-r;L(!0),R(!0,!0),_(s),D(!1,n),D(!0,i),$()},O=()=>{L(!0),R(!0,!1),_(0),m.current=void 0,D(!0,n),D(!1,i),j()},T=u((()=>{p.current&&(A(),requestAnimationFrame(T))}),[]),A=()=>{f.current.push({yPosition:d.current,timestamp:Date.now()}),f.current.length>20&&f.current.shift()},x=u((()=>{f.current=[],T()}),[T]),N=()=>{const e=f.current;if(!e)return 0;const t=e[0],n=e[e.length-1];if(!t||!n)return 0;const i=n.timestamp-t.timestamp;return(n.yPosition-t.yPosition)/i},_=e=>{const n=Math.round(e);d.current=n,t.current&&(t.current.style.transform=`translateY(${n}px)`)},L=e=>{e?t.current&&(t.current.style.transition="transform .2s"):t.current&&(t.current.style.transition="")},R=(e,t=!1)=>{const a=t?i:n,o=t?n:i;o.current&&(o.current.style.transition="opacity .5s"),a.current&&(a.current.style.transition="opacity .2s")},D=(e,t)=>{const n=t.current;if(!n)return;const i=e?0:1;n.style.opacity=`${i}`,e?n.style.pointerEvents="none":setTimeout((()=>{n.style.pointerEvents="auto"}),400)},k=u((()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",v),document.removeEventListener("touchmove",b),document.removeEventListener("touchend",v)}),[b,v]),P=u((()=>{St()?(document.addEventListener("touchmove",b,{passive:!1}),document.addEventListener("touchend",v)):(document.addEventListener("mousemove",b,{passive:!1}),document.addEventListener("mouseup",v))}),[b,v]),$=()=>{const t=e.current;t&&(a.current=setTimeout((()=>{var e;const i=((null===(e=n.current)||void 0===e?void 0:e.clientHeight)||0)+1;t.style.height=i+"px"}),200))},j=()=>{a.current&&clearTimeout(a.current),e.current&&(e.current.style.height="100000px")};return{wrapperRef:e,containerRef:t,minimizedChildRef:n,maximizedChildRef:i}};function sc(e){var t;return"touches"in e?null===(t=e.touches[0])||void 0===t?void 0:t.clientY:e.clientY}const lc=e=>({type:tn,payload:{action:e?"BottomSheetMinimized":"BottomSheetMaximized",name:"SignalUserInteraction",context:"BottomSheetMinimized"}}),cc={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var dc;function uc({schema:t,testId:n}){const i=hn(),a=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),s=m((e=>e.active.has(cs))),l=r(null),c=f(),d=()=>{c({type:ss.DISMISS_OVERLAY,payload:{id:ls,dismissalMethod:"rokt_backdrop"}})},u=Ci(0,(e=>e.customStates[oc]));o((()=>{p(!!u)}),[u]),ac(l,!!u);const p=e=>{const t=l.current;t&&(e?t.style.opacity="0":(t.style.display="flex",t.style.opacity="1"))};o((()=>{a&&c({type:tn,payload:{name:"SignalActivation",parentGuid:a}})}),[a]),o((()=>{s&&requestAnimationFrame((()=>{var e;return null===(e=i.current)||void 0===e?void 0:e.focus()}))}),[s]);const y=Ra(),{tabIndex:h,isDisabled:v,styles:g}=It(y),b=t.styles?we(cc,t.styles):cc;return e(Ro,{styles:b,children:({classnames:i})=>{var a;return e("div",{className:null==i?void 0:i.wrapper,style:Object.assign({height:"100%",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9998",overflow:"hidden",display:"flex",opacity:"1",transition:"opacity 0.2s ease-in-out"},g),"aria-label":null!==(a=t.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":v,role:"dialog","aria-modal":!0,tabIndex:h,"data-testid":n,"data-e2e":"Overlay-Wrapper",ref:l,children:e("div",{style:{position:"fixed",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},onClick:t.allowBackdropToClose?d:void 0,"data-testid":n&&`${n}-backdrop`,"data-e2e":"Overlay-Backdrop"})})}})}function pc(){return e("div",{style:{width:"48px",height:"4px",backgroundColor:"#C6C6C8",borderRadius:"2px",margin:"0 auto -4px",position:"relative",top:"6px"}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(dc||(dc={}));const yc={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};function fc(t){const n=m((e=>e.slots)),i=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0}));return e(mc,Object.assign({},t,{slots:n,currentIndex:i}))}function mc(n){const{wrapperRef:i,containerRef:a,minimizedChildRef:o,maximizedChildRef:r}=rc();return n.isOpen?t("div",{ref:i,style:{height:"100000px"},children:[e(uc,Object.assign({},n)),e(vc,Object.assign({},n,{containerRef:a,minimizedChildRef:o,maximizedChildRef:r}))]}):null}const hc=Be`
58
58
  display: flex;
59
59
  position: relative;
60
60
  overflow: hidden;
@@ -62,7 +62,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
62
62
  > * {
63
63
  position: absolute !important;
64
64
  }
65
- `,gc=p((function({schema:n,testId:i,slots:s,currentIndex:l,minimizedChildRef:c,containerRef:d,maximizedChildRef:u},p){var y,f;const m=r(null),h=r(null),v=r(!0),g=n.styles?Ce(fc,n.styles):fc,b=Ai(),I=()=>{const e=h.current;if(!e)return 0;return Array.from(e.children).reduce(((e,t)=>Math.max(e,t.clientHeight)),0)};o((()=>{const e=new ResizeObserver((()=>{(()=>{const e=h.current;if(!e)return;const t=I();e.style.height=`${t}px`})(),v.current&&(()=>{const e=I(),t=m.current;t&&(v.current=!1,t.style.setProperty("transform",`translateY(${e}px)`),requestAnimationFrame((()=>{t.style.transition="transform 0.8s",t.style.setProperty("transform","translateY(0px)")})))})()}));return h.current&&Array.from(h.current.children).forEach((t=>{e.observe(t)})),()=>{e.disconnect()}}),[]);const E=null===(f=null===(y=s[l])||void 0===y?void 0:y.offer)||void 0===f?void 0:f.creative,S=null==E?void 0:E.copy,w=Yi(S||{})(Rr.transformLinksToAnchorText(null==E?void 0:E.links),"creativeLink");return e(Do,{styles:g,children:({classnames:o})=>{var r;return t("div",{style:{width:"100%",position:"absolute",bottom:"-1000px",zIndex:"9999"},ref:d,children:[e("div",{style:{zIndex:"3",width:"100%",maxHeight:"0%",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)"},ref:m,children:t("div",{className:null==o?void 0:o.own,style:{height:"100%",position:"relative",outline:"none",borderBottomLeftRadius:"0",borderBottomRightRadius:"0",border:"1px solid #D5D7DA",borderBottom:"none",margin:"0px -1px"},ref:d,tabIndex:-1,"data-testid":i&&`${i}-container`,"data-e2e":"BottomSheet-Container",children:[e(yc,{}),e("div",{ref:h,className:vc,"aria-label":null!==(r=n.a11yLabel)&&void 0!==r?r:void 0,children:a.Children.toArray([e("div",{ref:u,style:{width:"100%"},children:b(n.children[0],void 0,qt(0,i))},"0"),e(Xi,{value:w,children:e(Ga,{value:ka(E),children:e("div",{ref:c,style:{width:"100%"},children:S&&e("div",{children:b(n.children[1],void 0,qt(1,i))})},"1")})})])})]})}),e("div",{style:{width:"100%",height:"1000px",backgroundColor:"white"}})]})}})}));function*bc(){(yield Ye((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex})))===(yield Ye((e=>{var t;return(null===(t=e.slots)||void 0===t?void 0:t.length)||1})))-1&&(yield qe({type:on,payload:{key:"Minimized",value:1}}))}ic(mc);const Ic={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var Ec;function Sc({isOpen:t,schema:n,testId:i,children:r}){const s=vn(),l=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),c=m((e=>e.active.has(ds))),d=f();o((()=>{l&&d({type:nn,payload:{name:"SignalActivation",parentGuid:l}})}),[l]),o((()=>{c&&requestAnimationFrame((()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}))}),[c]);const u=Da(),{tabIndex:p,isDisabled:y,styles:h}=It(u),v=n.styles?Ce(Ic,n.styles):Ic;if(!t)return null;const g=e(Ti,{children:e=>a.Children.toArray(n.children.map(((t,n)=>e(t,void 0,i?`${i}-child${n}`:void 0))))});return e(Do,{styles:v,children:({classnames:t})=>{var a;return e("div",{className:null==t?void 0:t.wrapper,style:Object.assign({height:"10000px",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:"auto",flexDirection:"column",justifyContent:"flex-end"},h),"aria-label":null!==(a=n.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":y,role:"dialog","aria-modal":!0,tabIndex:p,"data-testid":i,"data-e2e":"Overlay-Wrapper",children:r(g,s)})}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(Ec||(Ec={}));const wc={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const Cc=p((function({schema:t,testId:n,children:i},a){const o=t.styles?Ce(wc,t.styles):wc;return e(Do,{styles:o,children:({classnames:o})=>{var r;return e("div",{className:null==o?void 0:o.own,style:{position:"relative",zIndex:"3",outline:"none",alignSelf:"center"},ref:a,tabIndex:-1,"data-e2e":"Overlay-Container","aria-label":null!==(r=t.a11yLabel)&&void 0!==r?r:void 0,role:"dialog","aria-modal":!0,"data-testid":n&&`${n}-container`,children:i})}})}));const Oc=h((function(e){return{isOpen:e.active.has(cs)}}))((function(t){return e(Sc,Object.assign({},t,{children:(n,i)=>e(Cc,Object.assign({},t,{ref:i,children:n}))}))})),Tc=ic(mc),Ac={name:"minimized-bottomsheet-extension",sagas:function*(){yield Ke([Ze("OFFER_LIFECYCLE",bc)])},componentFactory:t=>"Overlay"===t.type?e(Oc,{schema:t}):function(e){const t=e.children instanceof Array;return t}(t)?e(Tc,{schema:t}):e("div",{children:"Could not Render Bottom Sheet"})};const xc=h((function(e,{schema:t}){var n,i,a;const o=t.startPosition||1;if((null===(n=e.progression)||void 0===n?void 0:n.totalCount)&&(null===(i=e.progression)||void 0===i?void 0:i.groupSize)){const t=(r=e.progression.totalCount,(s=e.progression.groupSize)<=0||r<=0||s>r?0:Math.ceil(r/s));let n;n=o>0?o-1:t+o>-1?t+o:0;return{numOfIndicators:t-n>-1?t-n:0,activeIndex:null!==(a=e.progression.currentGroupIndex)&&void 0!==a?a:0,startIndex:n}}var r,s;return{numOfIndicators:0,activeIndex:0,startIndex:0}})),Nc=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"37",height:"29",viewBox:"0 0 37 29",fill:"inherit",style:{maxWidth:"44px",maxHeight:"32px",width:"100%",height:"100%"}},a.createElement("path",{d:"M5.62263 14.7123L5.48251 5.86667L11.3433 4.79804L11.3655 6.53531L7.57989 7.22555L7.61586 9.03828L11.0283 8.41606L11.0513 10.1575L7.63884 10.7797L7.69779 14.3339L5.62263 14.7123ZM17.5824 3.66043L19.6534 3.28282L19.745 8.98818C19.7555 9.64756 19.6126 10.2497 19.3164 10.7947C19.0224 11.3363 18.6042 11.7908 18.0619 12.1583C17.5191 12.5229 16.8858 12.7712 16.1619 12.9032C15.4352 13.0357 14.7983 13.019 14.2512 12.8531C13.7035 12.6844 13.2748 12.3843 12.9651 11.9527C12.6549 11.5184 12.4931 10.9717 12.4799 10.3129L12.3882 4.60752L14.4634 4.22914L14.5473 9.74965C14.5538 10.0546 14.6243 10.3146 14.7588 10.5298C14.8957 10.7416 15.0825 10.8952 15.3194 10.9907C15.5557 11.0833 15.8276 11.1016 16.135 11.0455C16.4453 10.989 16.717 10.8716 16.9501 10.6933C17.1828 10.5123 17.3621 10.2919 17.488 10.0321C17.6134 9.76959 17.6728 9.48585 17.6663 9.18094L17.5824 3.66043ZM28.2611 1.71333L28.4012 10.5589L26.6405 10.88L23.1503 6.39639L23.0916 6.40709L23.1693 11.5129L21.0941 11.8913L20.954 3.04567L22.7399 2.72004L26.2075 7.19908L26.2788 7.18608L26.1901 2.09094L28.2611 1.71333ZM4.24231 28.1783L4.10219 19.3327L9.96295 18.2641L9.98516 20.0013L6.19957 20.6916L6.23554 22.5043L9.64803 21.8821L9.67101 23.6235L6.25852 24.2457L6.31747 27.7999L4.24231 28.1783ZM11.933 26.776L9.70271 27.1827L12.4594 17.8089L15.2221 17.3051L18.2591 25.6225L16.0288 26.0292L13.9145 19.7787L13.8474 19.7909L11.933 26.776ZM11.5852 23.3481L16.247 22.4981L16.2661 24.1233L11.6043 24.9733L11.5852 23.3481ZM26.4764 18.4671L24.4054 18.8447C24.3768 18.6247 24.3205 18.4343 24.2363 18.2735C24.1516 18.1099 24.0407 17.9771 23.9037 17.875C23.7662 17.7701 23.6063 17.7011 23.4241 17.6679C23.2419 17.6347 23.0376 17.6387 22.8113 17.68C22.3781 17.759 22.005 17.9382 21.6921 18.2176C21.3792 18.497 21.1409 18.861 20.9772 19.3096C20.8136 19.7581 20.7359 20.2747 20.7444 20.8594C20.7576 21.423 20.8423 21.8797 20.9985 22.2295C21.1575 22.5788 21.3782 22.823 21.6605 22.9621C21.9424 23.0985 22.2748 23.1317 22.6577 23.0619C22.9064 23.0165 23.1316 22.9451 23.3333 22.8477C23.5373 22.747 23.7155 22.6235 23.8679 22.4774C24.0203 22.3312 24.1446 22.1656 24.2408 21.9805C24.3393 21.7922 24.4051 21.591 24.4383 21.3771L26.5261 20.9964C26.4914 21.3926 26.3895 21.7996 26.2202 22.2174C26.0532 22.6319 25.8184 23.0227 25.5157 23.3898C25.213 23.7568 24.842 24.0743 24.4028 24.342C23.9636 24.6098 23.4548 24.7965 22.8762 24.902C22.0853 25.0462 21.371 24.993 20.7333 24.7426C20.0985 24.4916 19.5925 24.0525 19.2153 23.4253C18.8405 22.7948 18.6436 21.9846 18.6249 20.9947C18.6089 20.0359 18.7692 19.1967 19.1057 18.4769C19.4451 17.7566 19.9106 17.1736 20.5022 16.7279C21.0965 16.2817 21.764 15.991 22.5047 15.856C23.0413 15.7581 23.5366 15.7429 23.9907 15.8103C24.4471 15.8743 24.8501 16.0174 25.1996 16.2396C25.5486 16.459 25.8322 16.7552 26.0504 17.1284C26.2714 17.501 26.4134 17.9473 26.4764 18.4671ZM27.362 16.8329L27.3398 15.0956L34.5966 13.7725L34.6188 15.5097L32.0154 15.9844L32.1333 23.0928L30.0875 23.4658L29.9696 16.3575L27.362 16.8329Z",fill:"inherit"})),_c="FunFactMode";function Lc({activeIndex:e,startIndex:t,numOfIndicators:n,schema:i,slots:r}){var s,l,d;const p=Da(),y=f(),{tabIndex:m,styles:h,isDisabled:v}=It(p),g=Array(n+1).fill(i.indicator),[b,I]=c(new Set([t])),[E,S]=c(!1),w=Ci(0,(e=>e.customStates[_c])),C=u((e=>b.has(e)||b.has(e-1)),[b]);o((()=>{I((t=>new Set([...t,e])))}),[e,w]),o((()=>{w&&S(!0)}),[w]);const O=()=>{y({type:on,payload:{key:_c,value:1}})},T=null===(l=null===(s=r[e])||void 0===s?void 0:s.offer)||void 0===l?void 0:l.creative,A=null===(d=null==T?void 0:T.images.creativeImage)||void 0===d?void 0:d.light;return n>0&&(N=n+t+1,(x=e)>=t&&x<=N)?a.createElement(Qi,null,(o=>a.createElement(Do,{styles:i.styles},(i=>{var r;const s=i.classnames,l=t=>{var i,a,o,r;return t===n&&w?`${null==s?void 0:s.indicator} ${null!==(i=null==s?void 0:s.activeIndicator)&&void 0!==i?i:""}`:t!==e||w?b.has(t)||t===n&&E?`${null==s?void 0:s.indicator} ${null!==(o=null==s?void 0:s.seenIndicator)&&void 0!==o?o:""}`:t==e+1?`${null==s?void 0:s.indicator} ${null!==(r=null==s?void 0:s.clickableIndicator)&&void 0!==r?r:""}`:`${null==s?void 0:s.indicator}`:`${null==s?void 0:s.indicator} ${null!==(a=null==s?void 0:s.activeIndicator)&&void 0!==a?a:""}`};return a.createElement("div",{className:null!==(r=null==s?void 0:s.own)&&void 0!==r?r:"",style:Object.assign({display:"flex",flexDirection:"row",gap:"8px"},h),"data-e2e":"ProgressIndicator",tabIndex:m,"aria-hidden":v},a.Children.toArray(g.map(((i,r)=>{return r===n?a.createElement("button",{onClick:E||e==n-1?O:void 0,className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",fill:w?"#101828":"#A3A3A3",cursor:E||e==n-1?"pointer":"default"}},o({state:{indicatorPosition:String(r+1+t)}})(i),a.createElement("div",{style:{marginTop:"3px",marginLeft:"2px"},"data-testid":"fun-fact-icon"},Nc)):r!==e||w?a.createElement("button",{onClick:(s=r,()=>{C(s)&&(y({type:"PROGRESSION/INITIALISE",payload:{totalCount:n,currentGroupIndex:s,groupSize:1}}),w&&y({type:on,payload:{key:_c,value:0}}))}),className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",cursor:C(r)?"pointer":"default"}},o({state:{indicatorPosition:String(r+1+t)}})(""),a.createElement("div",{style:{fontSize:"30px",fontWeight:"700",lineHeight:"38px",display:"inline-block"}},`${r+1}`)):a.createElement("button",{className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",cursor:C(r)?"pointer":"default"}},o({state:{indicatorPosition:String(r+1+t)}})(""),A?a.createElement("img",{src:A,style:{marginTop:"3px"}}):a.createElement("div",{style:{fontSize:"30px",fontWeight:"700",lineHeight:"38px",display:"inline-block"}},`${r+1}`));var s}))))})))):null;var x,N}const Rc=xc(((e,t)=>{const n=m((e=>e.slots)),i=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0}));return a.createElement(Lc,Object.assign({},e,{slots:n,currentIndex:i,partnerColor:t}))})),Dc=({children:e,partnerColor:t,schema:n})=>{var i;const o=Ai(),r=d((()=>Math.random()),[]),s=Yi((null!==(i=kc[Math.floor(r*kc.length)])&&void 0!==i?i:{text:"",header:""})||{},"funfact"),l=Be`
65
+ `,vc=p((function({schema:n,testId:i,slots:s,currentIndex:l,minimizedChildRef:c,containerRef:d,maximizedChildRef:u},p){var y,f;const m=r(null),h=r(null),v=r(!0),g=n.styles?we(yc,n.styles):yc,b=Ti(),I=()=>{const e=h.current;if(!e)return 0;return Array.from(e.children).reduce(((e,t)=>Math.max(e,t.clientHeight)),0)};o((()=>{const e=new ResizeObserver((()=>{(()=>{const e=h.current;if(!e)return;const t=I();e.style.height=`${t}px`})(),v.current&&(()=>{const e=I(),t=m.current;t&&(v.current=!1,t.style.setProperty("transform",`translateY(${e}px)`),requestAnimationFrame((()=>{t.style.transition="transform 0.8s",t.style.setProperty("transform","translateY(0px)")})))})()}));return h.current&&Array.from(h.current.children).forEach((t=>{e.observe(t)})),()=>{e.disconnect()}}),[]);const E=null===(f=null===(y=s[l])||void 0===y?void 0:y.offer)||void 0===f?void 0:f.creative,S=null==E?void 0:E.copy,C=Ji(S||{})(Lr.transformLinksToAnchorText(null==E?void 0:E.links),"creativeLink");return e(Ro,{styles:g,children:({classnames:o})=>{var r;return t("div",{style:{width:"100%",position:"absolute",bottom:"-1000px",zIndex:"9999"},ref:d,children:[e("div",{style:{zIndex:"3",width:"100%",maxHeight:"0%",transitionTimingFunction:"cubic-bezier(0.05, 0.7, 0.1, 1.0)"},ref:m,children:t("div",{className:null==o?void 0:o.own,style:{height:"100%",position:"relative",outline:"none",borderBottomLeftRadius:"0",borderBottomRightRadius:"0",border:"1px solid #D5D7DA",borderBottom:"none",margin:"0px -1px"},ref:d,tabIndex:-1,"data-testid":i&&`${i}-container`,"data-e2e":"BottomSheet-Container",children:[e(pc,{}),e("div",{ref:h,className:hc,"aria-label":null!==(r=n.a11yLabel)&&void 0!==r?r:void 0,children:a.Children.toArray([e("div",{ref:u,style:{width:"100%"},children:b(n.children[0],void 0,Wt(0,i))},"0"),e(Qi,{value:C,children:e(ja,{value:Da(E),children:e("div",{ref:c,style:{width:"100%"},children:S&&e("div",{children:b(n.children[1],void 0,Wt(1,i))})},"1")})})])})]})}),e("div",{style:{width:"100%",height:"1000px",backgroundColor:"white"}})]})}})}));function*gc(){(yield Ke((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex})))===(yield Ke((e=>{var t;return(null===(t=e.slots)||void 0===t?void 0:t.length)||1})))-1&&(yield qe({type:an,payload:{key:"Minimized",value:1}}))}nc(fc);const bc={elements:{own:[],wrapper:[{default:{background:{backgroundColor:{light:"#80000000"}},container:{justifyContent:"center"}}}]}};var Ic;function Ec({isOpen:t,schema:n,testId:i,children:r}){const s=hn(),l=m((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid})),c=m((e=>e.active.has(cs))),d=f();o((()=>{l&&d({type:tn,payload:{name:"SignalActivation",parentGuid:l}})}),[l]),o((()=>{c&&requestAnimationFrame((()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}))}),[c]);const u=Ra(),{tabIndex:p,isDisabled:y,styles:h}=It(u),v=n.styles?we(bc,n.styles):bc;if(!t)return null;const g=e(Oi,{children:e=>a.Children.toArray(n.children.map(((t,n)=>e(t,void 0,i?`${i}-child${n}`:void 0))))});return e(Ro,{styles:v,children:({classnames:t})=>{var a;return e("div",{className:null==t?void 0:t.wrapper,style:Object.assign({height:"10000px",top:"0",right:"0",bottom:"0",left:"0",zIndex:"9999",display:"flex",overflow:"auto",flexDirection:"column",justifyContent:"flex-end"},h),"aria-label":null!==(a=n.a11yLabel)&&void 0!==a?a:void 0,"aria-hidden":y,role:"dialog","aria-modal":!0,tabIndex:p,"data-testid":i,"data-e2e":"Overlay-Wrapper",children:r(g,s)})}})}!function(e){e[e.BottomSheet=0]="BottomSheet",e[e.Overlay=1]="Overlay"}(Ic||(Ic={}));const Sc={elements:{own:[{default:{background:{backgroundColor:{light:"#FFF"}},flexChild:{alignSelf:"center"}}}],wrapper:[]}};const Cc=p((function({schema:t,testId:n,children:i},a){const o=t.styles?we(Sc,t.styles):Sc;return e(Ro,{styles:o,children:({classnames:o})=>{var r;return e("div",{className:null==o?void 0:o.own,style:{position:"relative",zIndex:"3",outline:"none",alignSelf:"center"},ref:a,tabIndex:-1,"data-e2e":"Overlay-Container","aria-label":null!==(r=t.a11yLabel)&&void 0!==r?r:void 0,role:"dialog","aria-modal":!0,"data-testid":n&&`${n}-container`,children:i})}})}));const wc=h((function(e){return{isOpen:e.active.has(ls)}}))((function(t){return e(Ec,Object.assign({},t,{children:(n,i)=>e(Cc,Object.assign({},t,{ref:i,children:n}))}))})),Oc=nc(fc),Tc={name:"minimized-bottomsheet-extension",sagas:function*(){yield Ye([Ze("OFFER_LIFECYCLE",gc)])},componentFactory:t=>"Overlay"===t.type?e(wc,{schema:t}):function(e){const t=e.children instanceof Array;return t}(t)?e(Oc,{schema:t}):e("div",{children:"Could not Render Bottom Sheet"})};const Ac=h((function(e,{schema:t}){var n,i,a;const o=t.startPosition||1;if((null===(n=e.progression)||void 0===n?void 0:n.totalCount)&&(null===(i=e.progression)||void 0===i?void 0:i.groupSize)){const t=(r=e.progression.totalCount,(s=e.progression.groupSize)<=0||r<=0||s>r?0:Math.ceil(r/s));let n;n=o>0?o-1:t+o>-1?t+o:0;return{numOfIndicators:t-n>-1?t-n:0,activeIndex:null!==(a=e.progression.currentGroupIndex)&&void 0!==a?a:0,startIndex:n}}var r,s;return{numOfIndicators:0,activeIndex:0,startIndex:0}})),xc=a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"37",height:"29",viewBox:"0 0 37 29",fill:"inherit",style:{maxWidth:"44px",maxHeight:"32px",width:"100%",height:"100%"}},a.createElement("path",{d:"M5.62263 14.7123L5.48251 5.86667L11.3433 4.79804L11.3655 6.53531L7.57989 7.22555L7.61586 9.03828L11.0283 8.41606L11.0513 10.1575L7.63884 10.7797L7.69779 14.3339L5.62263 14.7123ZM17.5824 3.66043L19.6534 3.28282L19.745 8.98818C19.7555 9.64756 19.6126 10.2497 19.3164 10.7947C19.0224 11.3363 18.6042 11.7908 18.0619 12.1583C17.5191 12.5229 16.8858 12.7712 16.1619 12.9032C15.4352 13.0357 14.7983 13.019 14.2512 12.8531C13.7035 12.6844 13.2748 12.3843 12.9651 11.9527C12.6549 11.5184 12.4931 10.9717 12.4799 10.3129L12.3882 4.60752L14.4634 4.22914L14.5473 9.74965C14.5538 10.0546 14.6243 10.3146 14.7588 10.5298C14.8957 10.7416 15.0825 10.8952 15.3194 10.9907C15.5557 11.0833 15.8276 11.1016 16.135 11.0455C16.4453 10.989 16.717 10.8716 16.9501 10.6933C17.1828 10.5123 17.3621 10.2919 17.488 10.0321C17.6134 9.76959 17.6728 9.48585 17.6663 9.18094L17.5824 3.66043ZM28.2611 1.71333L28.4012 10.5589L26.6405 10.88L23.1503 6.39639L23.0916 6.40709L23.1693 11.5129L21.0941 11.8913L20.954 3.04567L22.7399 2.72004L26.2075 7.19908L26.2788 7.18608L26.1901 2.09094L28.2611 1.71333ZM4.24231 28.1783L4.10219 19.3327L9.96295 18.2641L9.98516 20.0013L6.19957 20.6916L6.23554 22.5043L9.64803 21.8821L9.67101 23.6235L6.25852 24.2457L6.31747 27.7999L4.24231 28.1783ZM11.933 26.776L9.70271 27.1827L12.4594 17.8089L15.2221 17.3051L18.2591 25.6225L16.0288 26.0292L13.9145 19.7787L13.8474 19.7909L11.933 26.776ZM11.5852 23.3481L16.247 22.4981L16.2661 24.1233L11.6043 24.9733L11.5852 23.3481ZM26.4764 18.4671L24.4054 18.8447C24.3768 18.6247 24.3205 18.4343 24.2363 18.2735C24.1516 18.1099 24.0407 17.9771 23.9037 17.875C23.7662 17.7701 23.6063 17.7011 23.4241 17.6679C23.2419 17.6347 23.0376 17.6387 22.8113 17.68C22.3781 17.759 22.005 17.9382 21.6921 18.2176C21.3792 18.497 21.1409 18.861 20.9772 19.3096C20.8136 19.7581 20.7359 20.2747 20.7444 20.8594C20.7576 21.423 20.8423 21.8797 20.9985 22.2295C21.1575 22.5788 21.3782 22.823 21.6605 22.9621C21.9424 23.0985 22.2748 23.1317 22.6577 23.0619C22.9064 23.0165 23.1316 22.9451 23.3333 22.8477C23.5373 22.747 23.7155 22.6235 23.8679 22.4774C24.0203 22.3312 24.1446 22.1656 24.2408 21.9805C24.3393 21.7922 24.4051 21.591 24.4383 21.3771L26.5261 20.9964C26.4914 21.3926 26.3895 21.7996 26.2202 22.2174C26.0532 22.6319 25.8184 23.0227 25.5157 23.3898C25.213 23.7568 24.842 24.0743 24.4028 24.342C23.9636 24.6098 23.4548 24.7965 22.8762 24.902C22.0853 25.0462 21.371 24.993 20.7333 24.7426C20.0985 24.4916 19.5925 24.0525 19.2153 23.4253C18.8405 22.7948 18.6436 21.9846 18.6249 20.9947C18.6089 20.0359 18.7692 19.1967 19.1057 18.4769C19.4451 17.7566 19.9106 17.1736 20.5022 16.7279C21.0965 16.2817 21.764 15.991 22.5047 15.856C23.0413 15.7581 23.5366 15.7429 23.9907 15.8103C24.4471 15.8743 24.8501 16.0174 25.1996 16.2396C25.5486 16.459 25.8322 16.7552 26.0504 17.1284C26.2714 17.501 26.4134 17.9473 26.4764 18.4671ZM27.362 16.8329L27.3398 15.0956L34.5966 13.7725L34.6188 15.5097L32.0154 15.9844L32.1333 23.0928L30.0875 23.4658L29.9696 16.3575L27.362 16.8329Z",fill:"inherit"})),Nc="FunFactMode";function _c({activeIndex:e,startIndex:t,numOfIndicators:n,schema:i,slots:r}){var s,l,d;const p=Ra(),y=f(),{tabIndex:m,styles:h,isDisabled:v}=It(p),g=Array(n+1).fill(i.indicator),[b,I]=c(new Set([t])),[E,S]=c(!1),C=Ci(0,(e=>e.customStates[Nc])),w=u((e=>b.has(e)||b.has(e-1)),[b]);o((()=>{I((t=>new Set([...t,e])))}),[e,C]),o((()=>{C&&S(!0)}),[C]);const O=()=>{y({type:an,payload:{key:Nc,value:1}})},T=null===(l=null===(s=r[e])||void 0===s?void 0:s.offer)||void 0===l?void 0:l.creative,A=null===(d=null==T?void 0:T.images.creativeImage)||void 0===d?void 0:d.light;return n>0&&(N=n+t+1,(x=e)>=t&&x<=N)?a.createElement(Zi,null,(o=>a.createElement(Ro,{styles:i.styles},(i=>{var r;const s=i.classnames,l=t=>{var i,a,o,r;return t===n&&C?`${null==s?void 0:s.indicator} ${null!==(i=null==s?void 0:s.activeIndicator)&&void 0!==i?i:""}`:t!==e||C?b.has(t)||t===n&&E?`${null==s?void 0:s.indicator} ${null!==(o=null==s?void 0:s.seenIndicator)&&void 0!==o?o:""}`:t==e+1?`${null==s?void 0:s.indicator} ${null!==(r=null==s?void 0:s.clickableIndicator)&&void 0!==r?r:""}`:`${null==s?void 0:s.indicator}`:`${null==s?void 0:s.indicator} ${null!==(a=null==s?void 0:s.activeIndicator)&&void 0!==a?a:""}`};return a.createElement("div",{className:null!==(r=null==s?void 0:s.own)&&void 0!==r?r:"",style:Object.assign({display:"flex",flexDirection:"row",gap:"8px"},h),"data-e2e":"ProgressIndicator",tabIndex:m,"aria-hidden":v},a.Children.toArray(g.map(((i,r)=>{return r===n?a.createElement("button",{onClick:E||e==n-1?O:void 0,className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",fill:C?"#101828":"#A3A3A3",cursor:E||e==n-1?"pointer":"default"}},o({state:{indicatorPosition:String(r+1+t)}})(i),a.createElement("div",{style:{marginTop:"3px",marginLeft:"2px"},"data-testid":"fun-fact-icon"},xc)):r!==e||C?a.createElement("button",{onClick:(s=r,()=>{w(s)&&(y({type:"PROGRESSION/INITIALISE",payload:{totalCount:n,currentGroupIndex:s,groupSize:1}}),C&&y({type:an,payload:{key:Nc,value:0}}))}),className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",cursor:w(r)?"pointer":"default"}},o({state:{indicatorPosition:String(r+1+t)}})(""),a.createElement("div",{style:{fontSize:"30px",fontWeight:"700",lineHeight:"38px",display:"inline-block"}},`${r+1}`)):a.createElement("button",{className:l(r+t),style:{display:"inline-block",borderRadius:"50%",aspectRatio:"1/1",overflow:"hidden",cursor:w(r)?"pointer":"default"}},o({state:{indicatorPosition:String(r+1+t)}})(""),A?a.createElement("img",{src:A,style:{marginTop:"3px"}}):a.createElement("div",{style:{fontSize:"30px",fontWeight:"700",lineHeight:"38px",display:"inline-block"}},`${r+1}`));var s}))))})))):null;var x,N}const Lc=Ac(((e,t)=>{const n=m((e=>e.slots)),i=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0}));return a.createElement(_c,Object.assign({},e,{slots:n,currentIndex:i,partnerColor:t}))})),Rc=({children:e,partnerColor:t,schema:n})=>{var i;const o=Ti(),r=d((()=>Math.random()),[]),s=Ji((null!==(i=Dc[Math.floor(r*Dc.length)])&&void 0!==i?i:{text:"",header:""})||{},"funfact"),l=Be`
66
66
  display: inline;
67
67
  margin: 8px 16px;
68
68
  p {
@@ -72,7 +72,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
72
72
  font-size: 24px;
73
73
  font-weight: 600;
74
74
  color: ${t};
75
- `;return a.createElement(Xi,{value:s},a.createElement(Do,{styles:n.styles},(t=>{const n=t.classnames;return a.createElement(a.Fragment,null,a.Children.toArray(null==e?void 0:e.map(((e,t)=>a.createElement("div",{className:`${l} ${null==n?void 0:n.own}`},0===t?a.createElement(a.Fragment,null,a.createElement("p",{className:`${c} ${null==n?void 0:n.own}`},"Did you know...")," ",a.createElement("span",{className:`${null==n?void 0:n.own}`},o(e))):a.createElement("span",{className:`${null==n?void 0:n.own}`},o(e)))))))})))},kc=[{header:"the Eiffel Tower can grow taller in summer?",text:"The heat causes the metal to expand, adding up to six inches to its height."},{header:"flamingos aren't born pink?",text:"Their feathers turn pink from eating shrimp and algae rich in carotenoids."},{header:"bananas are berries, but strawberries aren't?",text:"Botanically, strawberries are aggregate fruits, while bananas meet all the criteria for a true berry."},{header:"a day on Venus is longer than a year on Venus?",text:"It takes Venus 243 Earth days to rotate once but only 225 Earth days to orbit the Sun."},{header:"sea cucumbers can eject their guts when threatened?",text:"This defense mechanism helps them escape predators and they regenerate the lost organs later."},{header:"prunes used to be said instead of cheese for photos?",text:'In the 1840s, people said "prunes" to maintain a tight-lipped expression instead of smiling.'},{header:"some frogs can freeze solid and survive?",text:"Species like wood frogs produce special proteins that prevent ice from damaging their cells."},{header:"Venus is the only planet that spins clockwise?",text:"Its unusual rotation direction makes it stand out among other planets in our solar system."},{header:"cats have 230 bones while humans have only 206?",text:"Their extra bones make them incredibly flexible jumpers and climbers."},{header:"the Statue of Liberty once functioned as a lighthouse?",text:"From 1886 to 1902, its light could be seen up to 24 miles away."},{header:"the first commercial flight lasted just 23 minutes?",text:"It flew between St. Petersburg and Tampa, Florida, in 1914."},{header:"octopuses have blue blood and nine brains?",text:"Their unique blood helps them survive in low-oxygen environments, and each arm has its own mini-brain."},{header:"hummingbirds can fly backward?",text:"They're the only birds capable of this agile movement thanks to their unique wing structure."},{header:"gorillas burp when they're happy?",text:"It's one of their ways of expressing contentment and relaxation."},{header:"Australia is wider than the Moon?",text:"Australia spans about 2,485 miles across, while the Moon's diameter is only about 2,159 miles."},{header:"ants can carry up to 50 times their body weight?",text:"These tiny insects are incredibly strong for their size due to their muscle structure."},{header:"lightning is five times hotter than the surface of the Sun?",text:"A single bolt can reach temperatures of up to 50,000 degrees Fahrenheit."},{header:"sharks are the only fish that can blink with both eyes?",text:"They have an extra eyelid called a nictitating membrane for protection during attacks or feeding."},{header:"octopuses have three hearts?",text:"Two pump blood to the gills, while the third pumps it to the rest of the body—and it stops beating when they swim."},{header:"a group of flamingos is called a flamboyance?",text:"Their bright pink color and synchronized movements make this name quite fitting."},{header:"honey never spoils?",text:"Archaeologists have found pots of honey in ancient Egyptian tombs that are still edible."},{header:"cats can't taste sweetness?",text:"Their taste buds lack the receptors for sugary flavors, which might explain their disinterest in desserts."},{header:"a crocodile can't stick out its tongue?",text:"A special membrane holds their tongue in place, helping them swallow prey underwater."},{header:"sea otters hold hands while they sleep?",text:"This keeps them from drifting apart in the water, especially when they're napping in groups."},{header:"bananas glow blue under black light?",text:"This happens because of the way their peel breaks down as they ripen."},{header:"a watermelon is 92% water?",text:"That's why it's such a refreshing snack on a hot day!"},{header:"butterflies taste with their feet?",text:"Their taste sensors are located on their legs, helping them identify suitable plants for laying eggs."},{header:"an ostrich's eye is bigger than its brain?",text:"This might explain why these birds rely more on instinct than intelligence."},{header:"kangaroos can't walk backward?",text:"Their muscular tails and body structure make this movement impossible."},{header:"avocados are fruits, not vegetables?",text:"They're technically berries because of their fleshy pulp and single seed."},{header:"dolphins have names for each other?",text:"They use unique whistles to identify and call out to specific individuals in their pods."},{header:'the Hollywood sign originally said "Hollywoodland"?',text:"It was installed in 1923 as an advertisement for a real estate development."},{header:"giraffe tongues can be up to 20 inches long?",text:"Their dark color helps protect them from sunburn while reaching for leaves."},{header:"M&M's were the first candy eaten in space?",text:"Astronauts love them because they don't crumble and create messes in zero gravity."},{header:"starfish don't have brains?",text:"They rely on a simple nervous system to sense their surroundings and move around."},{header:"peanuts are legumes, not nuts?",text:"They grow underground like beans and peas, making them part of the legume family."},{header:"the shortest war in history lasted only 38 minutes?",text:"It was between Britain and Zanzibar on August 27, 1896."},{header:"clouds can weigh over a million pounds?",text:"Despite their massive weight, the water droplets are spread out enough to float in the air!"}];function*Pc(){(yield Ye((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex})))===(yield Ye((e=>{var t;return(null===(t=e.slots)||void 0===t?void 0:t.length)||1})))-1&&(yield qe({type:on,payload:{key:"FunFactMode",value:1}}))}const $c={name:"logo-clickable-progression-extension",sagas:function*(){yield Ke([Ze("OFFER_LIFECYCLE",Pc)])},componentFactory:e=>e?"fun-fact"===e.variant?a.createElement(Dc,{partnerColor:e.partnerColor,schema:e},e.children):a.createElement(Rc,{schema:Object.assign(Object.assign({},e),{indicator:""}),partnerColor:e.partnerColor}):a.createElement("div",null,"Could not render Logo Clickable Progression"),interceptors:{}};const jc=Be`
75
+ `;return a.createElement(Qi,{value:s},a.createElement(Ro,{styles:n.styles},(t=>{const n=t.classnames;return a.createElement(a.Fragment,null,a.Children.toArray(null==e?void 0:e.map(((e,t)=>a.createElement("div",{className:`${l} ${null==n?void 0:n.own}`},0===t?a.createElement(a.Fragment,null,a.createElement("p",{className:`${c} ${null==n?void 0:n.own}`},"Did you know...")," ",a.createElement("span",{className:`${null==n?void 0:n.own}`},o(e))):a.createElement("span",{className:`${null==n?void 0:n.own}`},o(e)))))))})))},Dc=[{header:"the Eiffel Tower can grow taller in summer?",text:"The heat causes the metal to expand, adding up to six inches to its height."},{header:"flamingos aren't born pink?",text:"Their feathers turn pink from eating shrimp and algae rich in carotenoids."},{header:"bananas are berries, but strawberries aren't?",text:"Botanically, strawberries are aggregate fruits, while bananas meet all the criteria for a true berry."},{header:"a day on Venus is longer than a year on Venus?",text:"It takes Venus 243 Earth days to rotate once but only 225 Earth days to orbit the Sun."},{header:"sea cucumbers can eject their guts when threatened?",text:"This defense mechanism helps them escape predators and they regenerate the lost organs later."},{header:"prunes used to be said instead of cheese for photos?",text:'In the 1840s, people said "prunes" to maintain a tight-lipped expression instead of smiling.'},{header:"some frogs can freeze solid and survive?",text:"Species like wood frogs produce special proteins that prevent ice from damaging their cells."},{header:"Venus is the only planet that spins clockwise?",text:"Its unusual rotation direction makes it stand out among other planets in our solar system."},{header:"cats have 230 bones while humans have only 206?",text:"Their extra bones make them incredibly flexible jumpers and climbers."},{header:"the Statue of Liberty once functioned as a lighthouse?",text:"From 1886 to 1902, its light could be seen up to 24 miles away."},{header:"the first commercial flight lasted just 23 minutes?",text:"It flew between St. Petersburg and Tampa, Florida, in 1914."},{header:"octopuses have blue blood and nine brains?",text:"Their unique blood helps them survive in low-oxygen environments, and each arm has its own mini-brain."},{header:"hummingbirds can fly backward?",text:"They're the only birds capable of this agile movement thanks to their unique wing structure."},{header:"gorillas burp when they're happy?",text:"It's one of their ways of expressing contentment and relaxation."},{header:"Australia is wider than the Moon?",text:"Australia spans about 2,485 miles across, while the Moon's diameter is only about 2,159 miles."},{header:"ants can carry up to 50 times their body weight?",text:"These tiny insects are incredibly strong for their size due to their muscle structure."},{header:"lightning is five times hotter than the surface of the Sun?",text:"A single bolt can reach temperatures of up to 50,000 degrees Fahrenheit."},{header:"sharks are the only fish that can blink with both eyes?",text:"They have an extra eyelid called a nictitating membrane for protection during attacks or feeding."},{header:"octopuses have three hearts?",text:"Two pump blood to the gills, while the third pumps it to the rest of the body—and it stops beating when they swim."},{header:"a group of flamingos is called a flamboyance?",text:"Their bright pink color and synchronized movements make this name quite fitting."},{header:"honey never spoils?",text:"Archaeologists have found pots of honey in ancient Egyptian tombs that are still edible."},{header:"cats can't taste sweetness?",text:"Their taste buds lack the receptors for sugary flavors, which might explain their disinterest in desserts."},{header:"a crocodile can't stick out its tongue?",text:"A special membrane holds their tongue in place, helping them swallow prey underwater."},{header:"sea otters hold hands while they sleep?",text:"This keeps them from drifting apart in the water, especially when they're napping in groups."},{header:"bananas glow blue under black light?",text:"This happens because of the way their peel breaks down as they ripen."},{header:"a watermelon is 92% water?",text:"That's why it's such a refreshing snack on a hot day!"},{header:"butterflies taste with their feet?",text:"Their taste sensors are located on their legs, helping them identify suitable plants for laying eggs."},{header:"an ostrich's eye is bigger than its brain?",text:"This might explain why these birds rely more on instinct than intelligence."},{header:"kangaroos can't walk backward?",text:"Their muscular tails and body structure make this movement impossible."},{header:"avocados are fruits, not vegetables?",text:"They're technically berries because of their fleshy pulp and single seed."},{header:"dolphins have names for each other?",text:"They use unique whistles to identify and call out to specific individuals in their pods."},{header:'the Hollywood sign originally said "Hollywoodland"?',text:"It was installed in 1923 as an advertisement for a real estate development."},{header:"giraffe tongues can be up to 20 inches long?",text:"Their dark color helps protect them from sunburn while reaching for leaves."},{header:"M&M's were the first candy eaten in space?",text:"Astronauts love them because they don't crumble and create messes in zero gravity."},{header:"starfish don't have brains?",text:"They rely on a simple nervous system to sense their surroundings and move around."},{header:"peanuts are legumes, not nuts?",text:"They grow underground like beans and peas, making them part of the legume family."},{header:"the shortest war in history lasted only 38 minutes?",text:"It was between Britain and Zanzibar on August 27, 1896."},{header:"clouds can weigh over a million pounds?",text:"Despite their massive weight, the water droplets are spread out enough to float in the air!"}];function*kc(){(yield Ke((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex})))===(yield Ke((e=>{var t;return(null===(t=e.slots)||void 0===t?void 0:t.length)||1})))-1&&(yield qe({type:an,payload:{key:"FunFactMode",value:1}}))}const Pc={name:"logo-clickable-progression-extension",sagas:function*(){yield Ye([Ze("OFFER_LIFECYCLE",kc)])},componentFactory:e=>e?"fun-fact"===e.variant?a.createElement(Rc,{partnerColor:e.partnerColor,schema:e},e.children):a.createElement(Lc,{schema:Object.assign(Object.assign({},e),{indicator:""}),partnerColor:e.partnerColor}):a.createElement("div",null,"Could not render Logo Clickable Progression"),interceptors:{}};const $c=Be`
76
76
  height: 20px;
77
77
  border-radius: 4px;
78
78
  width: 100%;
@@ -81,40 +81,40 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
81
81
  background-size: 200% 100%;
82
82
  animation: 1.5s ${Ve`to { background-position-x: -200%; }`} linear
83
83
  infinite;
84
- `,Gc=Be`
84
+ `,jc=Be`
85
85
  width: 75%;
86
- `,Fc=Be`
86
+ `,Gc=Be`
87
87
  height: 40px;
88
88
  width: 200px;
89
- `,Mc=Be`
89
+ `,Fc=Be`
90
90
  width: 150px;
91
- `;function Bc({hasLoaded:e,animationSpeedMS:t,styles:n}){const[i,r]=c(!0);return o((()=>{if(e){const e=setTimeout((()=>{r(!1)}),t);return()=>clearTimeout(e)}return()=>null}),[e]),i?a.createElement("div",{"data-testid":"skeleton",className:Be(Object.assign({height:"100%"},null==n?void 0:n.skeleton))},a.createElement("div",{className:Be`
91
+ `;function Mc({hasLoaded:e,animationSpeedMS:t,styles:n}){const[i,r]=c(!0);return o((()=>{if(e){const e=setTimeout((()=>{r(!1)}),t);return()=>clearTimeout(e)}return()=>null}),[e]),i?a.createElement("div",{"data-testid":"skeleton",className:Be(Object.assign({height:"100%"},null==n?void 0:n.skeleton))},a.createElement("div",{className:Be`
92
92
  padding: 30px 24px;
93
93
  display: flex;
94
94
  flex-direction: column;
95
95
  gap: 16px;
96
96
  height: inherit;
97
97
  justify-content: center;
98
- `},a.createElement("div",{className:jc}),a.createElement("div",{className:jc}),a.createElement("div",{className:jc}),a.createElement("div",{className:Ue(jc,Gc)}),a.createElement("div",{className:Be`
98
+ `},a.createElement("div",{className:$c}),a.createElement("div",{className:$c}),a.createElement("div",{className:$c}),a.createElement("div",{className:Ue($c,jc)}),a.createElement("div",{className:Be`
99
99
  display: flex;
100
100
  gap: 16px;
101
101
  align-items: center;
102
- `},a.createElement("div",{className:Ue(jc,Fc)}),a.createElement("div",{className:Ue(jc,Mc)})))):null}function Uc({styles:e,hasLoaded:t,partnerText:n,animationSpeedMS:i}){if(!Array.isArray(n)||!(null==n?void 0:n.length))throw new Error("partnerText must be an string[]");const[r,s]=c(!0);return o((()=>{if(t){const e=setTimeout((()=>{s(!1)}),i);return()=>clearTimeout(e)}return()=>null}),[t]),r?a.createElement("div",{"data-testid":"partner-text",className:Be(Object.assign({height:"100%",width:"100%",display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:t?0:1,transition:`opacity ${i}ms ease-in-out`},null==e?void 0:e.partnerText))},n?a.Children.toArray(n.map((e=>a.createElement("p",{className:Be`
102
+ `},a.createElement("div",{className:Ue($c,Gc)}),a.createElement("div",{className:Ue($c,Fc)})))):null}function Bc({styles:e,hasLoaded:t,partnerText:n,animationSpeedMS:i}){if(!Array.isArray(n)||!(null==n?void 0:n.length))throw new Error("partnerText must be an string[]");const[r,s]=c(!0);return o((()=>{if(t){const e=setTimeout((()=>{s(!1)}),i);return()=>clearTimeout(e)}return()=>null}),[t]),r?a.createElement("div",{"data-testid":"partner-text",className:Be(Object.assign({height:"100%",width:"100%",display:"flex",alignItems:"center",flexDirection:"column",justifyContent:"center",opacity:t?0:1,transition:`opacity ${i}ms ease-in-out`},null==e?void 0:e.partnerText))},n?a.Children.toArray(n.map((e=>a.createElement("p",{className:Be`
103
103
  font-weight: 600;
104
104
  font-size: 14px;
105
105
  line-height: 21px;
106
106
  padding: 0 16px;
107
- `},e)))):null):null}const Vc=Ve`
107
+ `},e)))):null):null}const Uc=Ve`
108
108
  0% { width: 0; }
109
109
  100% { width: 100%; }
110
- }`;function zc(e){const[t,n]=c(!1),[i,r]=c(!1),s=f(),l=Ai(),{type:d,children:u,durationMS:p,styles:y,partnerText:m,animationSpeedMS:h}=e.data;let v=null;switch(d){case"skeleton":v=a.createElement(Bc,{hasLoaded:t,animationSpeedMS:h,styles:y});break;case"partnerText":v=a.createElement(Uc,{partnerText:m,hasLoaded:t,animationSpeedMS:h,styles:y})}return o((()=>{let e=null;const t=setTimeout((()=>{n(!0),e=setTimeout((()=>{r(!0)}),h)}),1.25*p);return()=>{t&&clearTimeout(t),e&&clearTimeout(e)}}),[p,s]),a.createElement("div",{"data-testid":"Loading"},a.createElement("div",{className:Be`
110
+ }`;function Vc(e){const[t,n]=c(!1),[i,r]=c(!1),s=f(),l=Ti(),{type:d,children:u,durationMS:p,styles:y,partnerText:m,animationSpeedMS:h}=e.data;let v=null;switch(d){case"skeleton":v=a.createElement(Mc,{hasLoaded:t,animationSpeedMS:h,styles:y});break;case"partnerText":v=a.createElement(Bc,{partnerText:m,hasLoaded:t,animationSpeedMS:h,styles:y})}return o((()=>{let e=null;const t=setTimeout((()=>{n(!0),e=setTimeout((()=>{r(!0)}),h)}),1.25*p);return()=>{t&&clearTimeout(t),e&&clearTimeout(e)}}),[p,s]),a.createElement("div",{"data-testid":"Loading"},a.createElement("div",{className:Be`
111
111
  position: relative;
112
112
  `},a.createElement("div",{className:Be`
113
113
  height: 4px;
114
114
  background-color: ${(null==y?void 0:y.primaryColor)||"#7F56D9"};
115
115
  position: absolute;
116
116
  top: 0;
117
- animation: ${Vc} ${p}ms linear forwards;
117
+ animation: ${Uc} ${p}ms linear forwards;
118
118
  transition: opacity ${h}ms ease-in-out;
119
119
  opacity: ${t?0:1};
120
120
  `}),a.createElement("div",{className:Be`
@@ -133,7 +133,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
133
133
  z-index: 10;
134
134
  transition: opacity ${h}ms ease-in-out;
135
135
  ${i?"\n opacity: 1;\n user-select: auto;\n pointer-events: auto;\n ":"\n opacity: 0;\n user-select: none;\n pointer-events: none;\n "}
136
- `},a.Children.toArray(u.map((e=>l(e))))))))}const Hc={name:"loading-extension",componentFactory:e=>a.createElement(zc,{data:e}),interceptors:{}},Wc=1e3;function qc(e){const t=e.data,{minutes:n,seconds:i,timeRemaining:s,restartTimer:l}=function(e){const[t,n]=c(e),i=(new Date).getTime()/Wc,a=r(null),s=()=>{const t=(new Date).getTime()/Wc;n(Math.max(Math.floor(e-(t-i)),0))};return o((()=>(a.current=setInterval(s,Wc),()=>{a.current&&"number"==typeof a.current&&clearInterval(a.current)})),[]),{minutes:Math.floor(t/60).toString(),seconds:Math.floor(Math.min(t%60,59)).toLocaleString("en-US",{minimumIntegerDigits:2,maximumFractionDigits:0,useGrouping:!1}),timeRemaining:t,restartTimer:function(){a.current&&"number"==typeof a.current&&clearInterval(a.current),n(e),a.current=setInterval(s,Wc)}}}((null==t?void 0:t.duration)||300),d=m((e=>{const t=g(["progression","currentGroupIndex"],e);return"number"==typeof t?t:0})),u=f();o((()=>{l()}),[d]),o((()=>{0===s&&(u({type:nn,payload:{name:"SignalUserInteraction",action:"TimerExpired",context:"TimerProgression"}}),u({type:"PROGRESSION/PROCESS",payload:{offerProcessStatus:"CONTINUE"}}))}),[n,i]);const p=Da(),{tabIndex:y,styles:h,isDisabled:v}=It(p);return a.createElement("p",{tabIndex:y,style:Object.assign(Object.assign({},null==t?void 0:t.styles),h),"aria-hidden":v,"data-e2e":"Timer"},`${n}:${i}`)}const Jc={name:"timer-progression-extension",componentFactory:e=>a.createElement(qc,{data:e}),interceptors:{}},Yc="MODULE/ADD_LOADED",Kc="MODULE/LOAD",Zc="PROGRESSION/INITIALISE",Qc="PROGRESSION/NEXT",Xc="PROGRESSION/PREV",ed="PROGRESSION/UPDATE_GROUP_SIZE",td="PROGRESSION/PROCESS",nd="SLOTS/SET",id="INSTANT_PURCHASE/DISMISS",ad="OFFER_LIFECYCLE",od="DOMAIN_STATES/SET",rd="OFFER_ENGAGEMENT",sd="GLOBAL_OFFER_DATA_STATE/SET_CART",ld=Object.assign(Object.assign({},ss),{NEXT_IN_PROGRESSION:Qc,PREV_IN_PROGRESSION:Xc,INITIALISE_PROGRESSION:Zc,UPDATE_GROUP_SIZE:ed,SET_SLOTS:nd,ADD_LOADED_MODULE:Yc,SET_DOMAIN_STATE:od,SET_GLOBAL_OFFER_DATA_CART:sd}),cd=Object.assign(Object.assign({},ls),{LOAD_MODULES:Kc,DISMISS_INSTANT_PURCHASE:id,PROCESS_PROGRESSION:td,OFFER_LIFECYCLE:ad,OFFER_ENGAGEMENT:rd,SET_PARTNER_VALIDATION_STATUS:dn});function dd(e,t){return t<=0||e<=0||t>e?0:Math.ceil(e/t)}function ud(e,t){const n=[];if(t<=0||e<=0||t>e)throw Error(`Could not generate the progression groups with groupSize: ${t} and totalCount: ${e}`);for(let i=0;i<dd(e,t);i++){const a=[];for(let n=0;n<t;n++)a.push(Math.min(i*t+n,e-1));n.push([...new Set(a)])}return n}const pd=Symbol("root");function yd(){return{[pd]:{}}}const fd=Object.assign({progression:function(e=null,t){switch(t.type){case Zc:if(function(e){const{totalCount:t,currentGroupIndex:n,groupSize:i}=e;return t>=0&&i>=0&&n>=0&&i<=t&&n<dd(t,i)}(t.payload)){const{totalCount:e,_:n,groupSize:i}=t.payload;return Object.assign(Object.assign({},t.payload),{indexGroups:ud(e,i)})}return null;case ed:{const{groupSize:n}=t.payload,i=null==e?void 0:e.totalCount;return i&&n<=i&&n>0?Object.assign(Object.assign({},e),{groupSize:n,indexGroups:ud(i,n),currentGroupIndex:0}):null}case Qc:{if(!e)return null;const{totalCount:t,groupSize:n,currentGroupIndex:i}=e;return t>0&&n>0&&i>=0?Object.assign(Object.assign({},e),{currentGroupIndex:Math.min(i+1,dd(t,n)-1)}):null}case Xc:{if(!e)return null;const{totalCount:t,groupSize:n,currentGroupIndex:i}=e;return t>0&&n>0&&i>=0?Object.assign(Object.assign({},e),{currentGroupIndex:Math.max(i-1,0)}):null}default:return e}},slots:function(e=[],t){return t.type===nd?t.payload:e},module:function(e={loadedModules:[]},t){return t.type===Yc?Object.assign(Object.assign({},e),{loadedModules:[...e.loadedModules,t.payload]}):e},domainStates:function(e=yd(),t){if(t.type===od){if(t.payload.key&&!isNaN(t.payload.value)){const n=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:pd;return n===pd?e:Object.assign(Object.assign({},b([n,t.payload.key],Number(t.payload.value),e)),{[pd]:{}})}return e}return e},globalOfferDataState:function(e={},t){if(t.type===sd){if(t.payload.cart){const n=`module${t.payload.offerPositionIndex}`;return Object.assign(Object.assign({},e),{[n]:{cart:t.payload.cart}})}return e}return e}},cl);function md(e={}){return Object.assign(Object.assign(Object.assign({},function(e={}){return Object.assign({layout:Qs(),breakpoint:{breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},active:Xs(),fonts:[],signal:{queue:[],processed:[]},serializableCache:ll(),settings:{closeOnComplete:!0},customStates:{root:{}}},e)}(e)),{progression:null,slots:[],module:{loadedModules:[]},domainStates:yd(),globalOfferDataState:{}}),e)}function hd(e){var t;return!!e.progression&&(1===e.progression.groupSize&&e.progression.currentGroupIndex===(null===(t=e.progression)||void 0===t?void 0:t.totalCount)-1)}function vd(e){return e.progression?{activeGroupIndex:e.progression.currentGroupIndex,totalOffers:e.progression.totalCount,totalGroups:dd(e.progression.totalCount,e.progression.groupSize),isLast:hd(e)}:null}function gd(e,t){return e.domainStates[`module${t}`]||{offerComplete:0,checkout:0}}function bd(e){return Object.values(e.globalOfferDataState).reduce(((e,t)=>{if(t&&"object"==typeof t&&"cart"in t){const n=t.cart;if(Array.isArray(n))return e+n.reduce(((e,t)=>e+("number"==typeof t.quantity?t.quantity:0)),0)}return e}),0)}function Id(i){var a;const{config:o,position:r,visible:s,container:c,testId:d}=i,u=Wa(),p=Da(),y=m(el),f=m((e=>function(e,t){return e.globalOfferDataState[`module${t}`]}(e,r))),h=l(qa),v=l(Ja),g=`rokt-${o.layoutVariant.moduleName}-${u}`;return t(n,{children:[!s&&e("div",{style:{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},"aria-hidden":"true"}),e(g,{style:{display:"flex",flexDirection:"column"===c?"column":"row",width:"100%"},slotInstanceGuid:o.instanceGuid,layoutSchema:JSON.stringify(o.layoutVariant.layoutVariantSchema),schemaVersion:h,childLayouts:JSON.stringify(null!==(a=o.layoutVariant.childLayouts)&&void 0!==a?a:[]),offerData:JSON.stringify(o.offer),offerPositionIndex:r,visible:s,container:c,interactivity:p,"data-testid":d,"data-e2e":`OfferSlot-${r}`,inert:(null==v?void 0:v.inert)&&!s?"":void 0,"aria-hidden":(null==v?void 0:v.inert)?void 0:!s,"module-component":!0,"plugin-id":u,"active-breakpoint":Wt(y),offerState:JSON.stringify(f)})]})}function Ed({schema:t,testId:n}){const i=t.styles,o=m((e=>e.slots)),s=r(null),l=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0})),c=Da(),{tabIndex:d,isDisabled:u,styles:p}=It(c);return o.length&&o[l]?e(Do,{styles:i,children:({classnames:i})=>e("div",{ref:s,"data-testid":n,"data-e2e":"OneByOneDistribution",className:null==i?void 0:i.own,tabIndex:d,"aria-hidden":u,style:Object.assign({position:"relative",transition:`height ${t.transition.settings.duration/2}ms ease-in-out`,overflow:"hidden",boxSizing:"content-box"},p),children:a.Children.toArray(o.map(((n,i)=>e(Fr,{effect:t.transition,visible:i===l,parentElement:s.current,children:e(Id,{config:n,position:i,visible:i===l,container:"column"})}))))})}):null}const Sd=h((function(e,{schema:t}){var n,i,a;const o=t.startPosition||1;if((null===(n=e.progression)||void 0===n?void 0:n.totalCount)&&(null===(i=e.progression)||void 0===i?void 0:i.groupSize)){const t=dd(e.progression.totalCount,e.progression.groupSize);let n;n=o>0?o-1:t+o>-1?t+o:0;return{numOfIndicators:t-n>-1?t-n:0,activeIndex:null!==(a=e.progression.currentGroupIndex)&&void 0!==a?a:0,startIndex:n}}return{numOfIndicators:0,activeIndex:0,startIndex:0}}))((function({activeIndex:t,startIndex:n,numOfIndicators:a,schema:o}){const r=Da(),{tabIndex:s,styles:l,isDisabled:c}=It(r),d=Array(a).fill(o.indicator);return a>1&&(p=a+n-1,(u=t)>=n&&u<=p)?e(Qi,{children:a=>e(Do,{styles:o.styles,children:o=>{var r;const u=o.classnames,p=e=>{var n,i;return e===t?`${null==u?void 0:u.indicator} ${(null==u?void 0:u.activeIndicator)?u.activeIndicator:null!==(n=null==u?void 0:u.seenIndicator)&&void 0!==n?n:""}`:e<t?`${null==u?void 0:u.indicator} ${null!==(i=null==u?void 0:u.seenIndicator)&&void 0!==i?i:""}`:null==u?void 0:u.indicator};return e("div",{className:null!==(r=null==u?void 0:u.own)&&void 0!==r?r:"",style:Object.assign({display:"flex",flexDirection:"row"},l),"data-e2e":"ProgressIndicator",tabIndex:s,"aria-hidden":c,children:i.Children.toArray(d.map(((t,i)=>e("span",{className:p(i+n),style:{display:"flex"},children:a({state:{indicatorPosition:String(i+1+n)}})(t)}))))})}})}):null;var u,p}));const wd="partnerValidationUI",Cd="stackedViewableItems";function Od(t){var n;const i=f(),r=m((e=>e.slots)),s=null!==(n=t.schema.viewableItems)&&void 0!==n?n:[],l=wo(s.reduce(((e,t,n)=>Object.assign(Object.assign({},e),{[n]:t.when})),{})),c=G((e=>{var t;return e&&(null===(t=s[e[0]])||void 0===t?void 0:t.value)||r.length}),Re((([e,t])=>t)),ne)(l);o((()=>{i({type:Qr,payload:{key:Cd,value:String(c)}})}),[c]);const d=r.slice(0,c),u=Da(),{tabIndex:p,isDisabled:y,styles:h}=It(u);return(null==d?void 0:d.length)>0?e(Do,{styles:t.schema.styles,children:({classnames:n})=>e("div",{"data-testid":t.testId,"data-e2e":"StackedDistribution",className:null==n?void 0:n.own,"aria-hidden":y,tabIndex:p,style:Object.assign({display:"flex",flexDirection:"column"},h),children:a.Children.toArray(d.map(((t,n)=>e(Id,{config:t,position:n,visible:!0,container:"column"}))))})}):null}function Td(t){const n=t.schema.styles,i=f(),o=Da(),r="Backward"===t.schema.direction?"Previous":"Next",{tabIndex:s,styles:l,isDisabled:c}=It(o),d=()=>{i({type:"Backward"===t.schema.direction?ld.PREV_IN_PROGRESSION:ld.NEXT_IN_PROGRESSION})};return e(Do,{styles:n,children:({classnames:n})=>{var i;return e("button",{title:r,className:null==n?void 0:n.own,onClick:d,"data-testid":t.testId,"data-e2e":"ProgressControl","data-e2e-direction":`${t.schema.direction}`,disabled:c,"aria-disabled":c,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:r,tabIndex:s,style:Object.assign({cursor:"pointer"},l),children:e(Ti,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}function Ad({schema:t,testId:n}){var i,r,s,l,c,d,u,p,y;const h=m((e=>e.progression)),v=null==h?void 0:h.indexGroups[null==h?void 0:h.currentGroupIndex],g=null!==(i=null==h?void 0:h.currentGroupIndex)&&void 0!==i?i:0,b=m((e=>e.slots)),I=m(al),E=t.viewableItems.length-1,[S,w]=ht({slidesToScroll:null!==(r=t.viewableItems[Math.min(I,E)])&&void 0!==r?r:"auto",containScroll:"trimSnaps"}),C=f(),O=Da(),{tabIndex:T,isDisabled:A,styles:x}=It(O),N=`${null!==(p=null===(u=null===(d=null===(c=null===(l=null===(s=t.styles)||void 0===s?void 0:s.elements)||void 0===l?void 0:l.own[I])||void 0===c?void 0:c.default)||void 0===d?void 0:d.container)||void 0===u?void 0:u.gap)&&void 0!==p?p:"0"}px`;o((()=>{function e(e){var t,n;const i=null!==(t=null==e?void 0:e.selectedScrollSnap())&&void 0!==t?t:0,a=null!==(n=null==e?void 0:e.previousScrollSnap())&&void 0!==n?n:0;i!==g&&(i>a?C({type:ld.NEXT_IN_PROGRESSION}):i<a&&C({type:ld.PREV_IN_PROGRESSION}))}return null!=g&&(null==w||w.on("select",e),null==w||w.scrollTo(g)),()=>{null==w||w.off("select",e)}}),[w,g,C]);const _={overflow:"hidden"},L={backfaceVisibility:"hidden",display:"flex",touchAction:"pan-y",gap:N,alignItems:"stretch"},R=e=>{var t;return null!==(t=null==v?void 0:v.includes(e))&&void 0!==t&&t},D=t.peekThroughSize[Math.min(I,t.peekThroughSize.length-1)],k=D?"Fixed"===(P=D).type?`${P.value}px`:`${P.value}%`:"0px";var P;const $=null!==(y=t.viewableItems[Math.min(E,I)])&&void 0!==y?y:1,j={flex:`0 0 calc(${(e=>"0px"!==e&&"0%"!==e)(k)?`(100% - 2 * ${k} - (${$} + 1) * ${N})/${$}`:`(100% - (${$} - 1) * ${N})/${$}`})`,position:"relative",display:"flex",overflow:"auto"};return(null==b?void 0:b.length)>0?e(Do,{styles:t.styles,children:({classnames:t})=>e("div",{ref:S,style:Object.assign(Object.assign({},_),x),"aria-disabled":A,tabIndex:T,className:null==t?void 0:t.own,"data-e2e":"CarouselDistribution","data-testid":n&&`${n}`,children:e("div",{style:L,"data-testid":n&&`${n}-container`,"data-e2e":"CarouselDistribution-Container",children:a.Children.toArray(b.map(((t,i)=>e("div",{style:j,"data-testid":n&&`${n}-slide-${i}`,"data-e2e":`CarouselDistribution-Slide-${i}`,children:e(Id,{config:t,position:i,container:"row",visible:R(i)})}))))})})}):null}const xd=Object.freeze([]);function Nd({schema:t,testId:n}){const i=Wa(),o=d((()=>hi(i)([{display:"flex",flexDirection:"column"}])),[i]),s=m((e=>{var t;return(null===(t=e.progression)||void 0===t?void 0:t.groupSize)||0})),l=m((e=>{var t;return(null===(t=e.progression)||void 0===t?void 0:t.indexGroups)||xd})),c=m((e=>e.slots||xd)),u=d((()=>l.map((e=>e.map((e=>c[e])).filter((e=>null!=e))))),[l,c]),p=r(null),y=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0})),f=Da(),{tabIndex:h,isDisabled:v,styles:g}=It(f);return u.length?e(Do,{styles:t.styles,children:({classnames:i})=>e("div",{ref:p,"data-testid":n,"data-e2e":"GroupedDistribution","aria-disabled":v,tabIndex:h,style:Object.assign({position:"relative",transition:`height ${t.transition.settings.duration/2}ms ease-in-out`,overflow:"hidden",boxSizing:"content-box"},g),children:a.Children.toArray(u.map(((r,l)=>e(Fr,{effect:t.transition,visible:l===y,parentElement:p.current,containerClassName:[o,null==i?void 0:i.own].filter(Boolean).join(" ")||void 0,children:a.Children.toArray(r.map(((t,i)=>{const a=s*l+i;return e(Id,{config:t,position:a,visible:l===y,container:"column",testId:n?`${n}-child${a}`:void 0})})))}))))})}):null}const _d={action:{CaptureOnly:"CaptureOnly",Url:"Url",Fulfillment:"Fulfillment",ExternalPaymentTrigger:"ExternalPaymentTrigger"},urlBehavior:{newTab:"newTab",roktWebViewSDK:"roktWebViewSDK",self:"self"},signalType:{SignalResponse:"SignalResponse",SignalGatedResponse:"SignalGatedResponse",SignalSecondaryResponse:"SignalSecondaryResponse"},conversionType:{Default:"Default",RealTime:"RealTime",RealTimeReferral:"RealTimeReferral"}};function Ld(e,t,n=!1){return Error(`Could not translate ${e} with guid: ${t}${n?" for child layout":""}`)}function Rd(e,t=!1){var n;try{if(e.responseOptionsMap||t)return Object.assign(Object.assign({},e),{responseOptionsMap:V(Dd,null!==(n=e.responseOptionsMap)&&void 0!==n?n:{})});{const t=`Creative: ${e.instanceGuid}, did not receive a valid response options map.`;throw new $t("NO_CREATIVE_RESPONSE_OPTIONS_MAP",t)}}catch(n){throw n.message?n:Ld("Creative",e.instanceGuid,t)}}function Dd(e){try{let t,n;if(e.urlBehavior&&(t=_d.urlBehavior[e.urlBehavior]),e.conversionType&&(n=_d.conversionType[e.conversionType]),"External"===e.action){const t=`Creative response with instanceGuid '${e.instanceGuid}' uses legacy action type 'External'. This should be 'ExternalPaymentTrigger'.`;throw new $t("LEGACY_EXTERNAL_ACTION_TYPE",t)}return Object.assign(Object.assign({},e),{urlBehavior:t,action:_d.action[e.action],signalType:_d.signalType[e.signalType],conversionType:n})}catch(t){throw t.message?t:Ld("CreativeResponse",e.instanceGuid)}}function kd(e,t,n){try{return JSON.parse(e)}catch(e){throw Error(`Parse JSON failed, invalid JSON file for ${t} with guid ${n}.`)}}function Pd(){o((()=>{const e=new ResizeObserver(function(e=100){let t;return()=>{t&&clearTimeout(t),t=setTimeout((()=>{var e,n;null===(n=null===(e=window.frameElement)||void 0===e?void 0:e.iFrameResizer)||void 0===n||n.resize(),t=void 0}),e)}}());return e.observe(document.body),()=>{e.disconnect()}}),[])}const $d={OneByOneDistribution:function(t){if("OneByOneDistribution"===t.type)return e(Ed,{schema:t.node})},StackedDistribution:function(t){if("StackedDistribution"===t.type)return e(Od,{schema:t.node})},ProgressIndicator:function(t){if("ProgressIndicator"===t.type)return e(Sd,{schema:t.node})},ProgressControl:function(t){if("ProgressControl"===t.type)return e(Td,{schema:t.node})},Overlay:function(t){if("Overlay"===t.type)return e(vs,{schema:t.node})},CloseButton:function(t){if("CloseButton"===t.type)return e(us,{schema:t.node})},EscapeHatch:(jd=[function(t,n){if(Et("CloseButton",t)){const n=JSON.parse(t.node.data);return e(us,{schema:n.node,action:n.action})}},Ir],e=>jd.reduce(((t,n)=>void 0===t?n(e):t),void 0)),CarouselDistribution:function(t){if("CarouselDistribution"===t.type)return e(Ad,{schema:t.node})},GroupedDistribution:function(t){if("GroupedDistribution"===t.type)return e(Nd,{schema:t.node})},BottomSheet:function(t){if("BottomSheet"===t.type)return e(Es,{schema:t.node})}};var jd;function Gd(e,t){e({type:nn,payload:{name:"SignalActivation",parentGuid:t}})}function Fd({pageInstanceGuid:t}){var n,i,a,r,s,l;const c=m((e=>e.layout),$),d=f(),u=m((e=>({breakpoint:e.breakpoint,progression:vd(e),customStates:e.customStates.root,domainStates:e.domainStates[pd]})),$),p=m((e=>e.slots.length)),y=m((e=>{var t;const n=Number(null!==(t=e.serializableCache.get(Cd))&&void 0!==t?t:"");return p-n})),h=m(bd);hn(_i(),d),o((()=>(c&&document.body.addEventListener("click",Gd.bind(null,d,c.instanceGuid),{once:!0}),()=>{c&&document.body.removeEventListener("click",Gd.bind(null,d,c.instanceGuid))})),[null==c?void 0:c.instanceGuid]),Pd(),o((()=>{if(c){const e={type:nn,payload:{name:"SignalImpression",parentGuid:c.instanceGuid}},t={type:os,payload:{code:"LAYOUT_IMPRESSED"}};d(e),d(t)}}),[c]);const v=e=>{d({type:cd.REPORT_ERROR,payload:e})},g=m((e=>e.breakpoint.initialised));if(c&&g){const o=Yi({})({state:{progression:(null!==(i=null===(n=u.progression)||void 0===n?void 0:n.activeGroupIndex)&&void 0!==i?i:0)+1,maxProgression:null!==(r=null===(a=u.progression)||void 0===a?void 0:a.totalGroups)&&void 0!==r?r:1,availableOffersCount:null!==(l=null===(s=u.progression)||void 0===s?void 0:s.totalGroups)&&void 0!==l?l:p,selectedCatalogItemQuantity:h,hiddenItemCount:y}}),f=Lr(v);return e(Ba,{info:{layoutType:"OuterLayout",pageInstanceGuid:t},children:e(Xi,{value:o,children:e(xi,{value:f,overrides:$d,children:e(wi.Provider,{value:u,children:e(Ei.Provider,{value:d,children:e(ia.Provider,{value:"OUTER",children:e(qa.Provider,{value:c.layoutSchemaVersion,children:e(Ti,{children:e=>e(c.layoutSchema)})})})})})})})})}return null}var Md=Object.freeze({__proto__:null,getDistribution:function e(t){var n;switch(t.type){case"OneByOneDistribution":case"StackedDistribution":case"CarouselDistribution":case"GroupedDistribution":return t;case"Row":case"Column":case"When":case"ZStack":case"FlowRow":case"InlineContainer":case"ScrollableRow":case"ScrollableColumn":case"BottomSheet":case"Overlay":for(const n of t.node.children){const t=e(n);if(t)return t}break;case"EscapeHatch":try{const{name:i,body:a}=JSON.parse(t.node.data);if(("loading-extension"===i||"minimized-bottomsheet-extension"===i)&&(null===(n=null==a?void 0:a.children)||void 0===n?void 0:n.length))for(const t of a.children){const n=e(t);if(n)return n}break}catch(e){break}case"StaticImage":case"DataImage":case"RichText":case"BasicText":case"ProgressIndicator":case"CreativeResponse":case"StaticLink":case"CloseButton":case"ProgressControl":case"StaticIcon":case"DataIcon":case"SlideStateTrigger":case"ToggleButtonStateTrigger":case"TimerStateTrigger":case"CatalogStackedCollection":case"CatalogResponseButton":case"CatalogQuantityOption":case"CatalogRadioGroup":case"CatalogQuantityCounter":case"PartnerEventButtonTrigger":case"CopyToClipboardButton":case"ButtonStateTrigger":case"CatalogCombinedCollection":break;default:!function(e){throw Error(`Could not handle layout: ${JSON.stringify(e)}`)}(t)}},getDistributionViewableItems:function(e){switch(null==e?void 0:e.type){case"CarouselDistribution":case"GroupedDistribution":return e.node.viewableItems;default:return}}}),Bd=Object.assign({},Md);function*Ud(e,t){const n=Bd.getDistribution(t),i=null==n?void 0:n.type,a=yield Ye(al),o=function(e=0,t){var n;switch(null==t?void 0:t.type){case"CarouselDistribution":case"GroupedDistribution":{const i=Math.min(t.node.viewableItems.length,e);return null!==(n=t.node.viewableItems[i])&&void 0!==n?n:1}default:return 1}}("number"==typeof a?a:0,n);"OneByOneDistribution"!==i&&"CarouselDistribution"!==i&&"GroupedDistribution"!==i||(yield yt({type:ld.INITIALISE_PROGRESSION,payload:{currentGroupIndex:0,totalCount:e,groupSize:o}}))}function*Vd(e,t){const{instanceGuid:n,layoutSchemaVersion:i,outerLayoutSchema:a,slots:o}=t.payload;n?yield yt({type:nn,payload:{name:"SignalLoadComplete",parentGuid:n}}):yield yt({type:as,payload:{level:Ts,code:Ms,message:"Layout instance guid does not exist"}}),yield yt({type:Kc,payload:{modules:o.map((e=>e.layoutVariant.moduleName))}}),yield yt({type:Hr,payload:a.breakpoints}),yield yt({type:ld.LAYOUT_UPDATE,payload:{instanceGuid:n,layoutSchemaVersion:i,layoutSchema:a.layout,settings:a.settings}}),yield yt({type:ld.SET_SLOTS,payload:o}),ce(a.settings)||(yield yt({type:ld.SET_SETTINGS,payload:a.settings})),yield*Ud(o.length,a.layout);const r=yield*function*(e,t,n){const i=null==t?void 0:t.enablePartnerValidation,a=["add-to-cart"],o=n.some((e=>a.some((t=>t===e.layoutVariant.moduleName))));if(i&&o)try{yield pt(e.send,hl.PartnerValidationEvent.OPT_IN_TO_PARTNER_VALIDATION),yield dt(zd,e,hl.PartnerValidationEvent.SHOW_PARTNER_VALIDATION_STATUS,(()=>({type:"ACTIVE/ADD",payload:{id:wd}})))}catch(e){return yield yt({type:as,payload:{level:Os,code:Us,message:"Failed to establish partner validation."}}),"FAILURE"}return"OK"}(e.partner,a.settings,o);"OK"===r&&(yield pt($l,e.display,a.display))}function*zd(e,t,n){const i=st((i=>{const a=e.onEvent(t).subscribe((e=>{i(n(e))}));return()=>{a.unsubscribe()}}));for(;;){const e=yield ft(i);yield yt(e)}}function Hd(e){return Ru(e)}function Wd(e,t){return Error(`Migration process from v0_0 to v0_1 failed: could not transform ${e} node. For more details: ${t}`)}const qd=ae(te([function(e){return"Row"===e.type&&Zd(e.node.children)},function(e){return"Column"===e.type&&Zd(e.node.children)},tu,nu])),Jd=ae(te([function(e){return"Row"===e.type&&Qd(e.node.children)},function(e){return"Column"===e.type&&Qd(e.node.children)},nu,tu,function(e){return"DataImage"===e.type},function(e){return"When"===e.type&&Qd(e.node.children)}])),Yd=ae(te([function(e){return"Row"===e.type&&Xd(e.node.children)},function(e){return"Column"===e.type&&Xd(e.node.children)},nu,tu])),Kd=ae(te([function(e){return"Row"===e.type&&eu(e.node.children)},function(e){return"Column"===e.type&&eu(e.node.children)},tu,function(e){return"RichText"===e.type},nu,function(e){return"ProgressIndicator"===e.type},function(e){return"OneByOneDistribution"===e.type},function(e){return"When"===e.type&&eu(e.node.children)},function(e){return"StaticLink"===e.type&&eu(e.node.children)},function(e){return"StackedDistribution"===e.type},function(e){return"CloseButton"===e.type&&eu(e.node.children)}]));function Zd(e){return qd(e)}function Qd(e){return Jd(e)}function Xd(e){return Yd(e)}function eu(e){return Kd(e)}function tu(e){return"StaticImage"===e.type}function nu(e){return"BasicText"===e.type}const iu=ue(["styles","elements","link"]),au=ue(["styles","elements","activeIndicator"]),ou=ue(["styles","elements","indicator"]),ru=ue(["styles","elements","seenIndicator"]),su=ue(["focussed"]),lu=ue(["hovered"]),cu=ue(["default"]),du=ue(["pressed"]),uu=e=>{var t;return{text:null!==(t=null==e?void 0:e.text)&&void 0!==t?t:{}}},pu=I(S(["styles","elements","link"]),J(de(iu,re((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default})))),de(iu,re(I(De("focussed"),de(su,uu)))),de(iu,re(I(De("hovered"),de(lu,uu)))),de(iu,re(I(De("default"),de(cu,uu)))),de(iu,re(I(De("pressed"),de(du,uu)))))),yu=J(I(S(["styles","elements","activeIndicator"]),de(au,re((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))),I(S(["styles","elements","indicator"]),de(ou,re((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))),I(S(["styles","elements","seenIndicator"]),de(ru,re((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))));function fu(e,t){return e?{elements:{own:e.elements.own.map(t)}}:void 0}const mu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),hu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),vu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),gu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),bu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),Iu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),Eu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),Su=e=>{switch(e){case"is":return"is";case"is not":return"is-not";case"is below":return"is-below";case"is above":return"is-above";default:throw Wd("When",`Invalid condition: ${e}`)}},wu=e=>{switch(e){case"breakpoint":return"Breakpoint";case"progression":return"Progression";case"position":return"Position";default:throw Wd("When",`Invalid target: ${e}`)}},Cu=e=>{const{target:t,condition:n,value:i}=e;return{type:wu(t),predicate:{condition:Su(n),value:i}}};function Ou(e){return{predicates:e.predicates.map(Cu),children:e.children.map((e=>Ru(e)))}}function Tu(e){const t={type:"FadeInOut",settings:{duration:e.transition.settings.duration}};return{styles:e.style,transition:t}}function Au(e){const t=e.children.map((e=>Ru(e)));if(Zd(t))return Object.assign(Object.assign({},e),{children:t,styles:fu(e.styles,bu)});throw Wd("CloseButton",`Invalid schema: ${JSON.stringify(e)}`)}function xu(e){const t=e.children.map((e=>Ru(e)));if(Qd(t))return Object.assign(Object.assign({},e),{children:t,styles:fu(e.styles,Iu)});throw Wd("CreativeResponse",`Invalid schema: ${JSON.stringify(e)}`)}function Nu(e){const t=e.children.map((e=>Ru(e)));if(Xd(t))return Object.assign(Object.assign({},e),{children:t,styles:fu(e.styles,Eu)});throw Wd("StaticLink",`Invalid schema: ${JSON.stringify(e)}`)}const _u=e=>({own:e.overlayContainer,wrapper:e.overlayWrapper});function Lu(e){var t,n;const i=(null===(t=e.styles)||void 0===t?void 0:t.elements)?{elements:_u(null===(n=e.styles)||void 0===n?void 0:n.elements)}:void 0,a=e.children.map((e=>Ru(e)));if(eu(a))return Object.assign(Object.assign({},e),{styles:i,children:a});throw Wd("Overlay",`Invalid schema: ${JSON.stringify(e)}`)}function Ru(e){switch(e.type){case"When":return{type:"When",node:Ou(e.node)};case"OneByOneDistribution":return{type:e.type,node:Tu(e.node)};case"Overlay":return{type:e.type,node:Lu(e.node)};case"Column":return{type:e.type,node:(r=e.node,{styles:fu(r.styles,mu),children:r.children.map((e=>Ru(e)))})};case"Row":return{type:e.type,node:(o=e.node,{styles:fu(o.styles,hu),children:o.children.map((e=>Ru(e)))})};case"RichText":return{type:e.type,node:(a=e.node,pu(a))};case"CloseButton":return{type:e.type,node:Au(e.node)};case"CreativeResponse":return{type:e.type,node:xu(e.node)};case"StaticLink":return{type:e.type,node:Nu(e.node)};case"StaticImage":return{type:e.type,node:(i=e.node,Object.assign(Object.assign({},i),{styles:fu(i.styles,vu)}))};case"DataImage":return{type:e.type,node:(n=e.node,Object.assign(Object.assign({},n),{styles:fu(n.styles,gu)}))};case"ProgressIndicator":return{type:e.type,node:(t=e.node,yu(t))};default:return e}var t,n,i,a,o,r}function Du(e){return Fp(e)}function ku(e,t){return Error(`Migration process from v0_23 to v1_0 failed: could not transform ${e} node. For more details: ${t}`)}const Pu=e=>"scroll"===e||"auto"===e?"visible":e,$u=ue(["elements","own"]),ju=ue(["transitions","transition","value","own"]),Gu=ue(["elements","wrapper"]),Fu=ue(["transitions","transition","value","wrapper"]),Mu=ue(["elements","indicator"]),Bu=ue(["transitions","transition","value","indicator"]),Uu=ue(["elements","activeIndicator"]),Vu=ue(["transitions","transition","value","activeIndicator"]),zu=ue(["elements","seenIndicator"]),Hu=ue(["transitions","transition","value","seenIndicator"]),Wu=ue(["default","container","overflow"]),qu=ue(["pressed","container","overflow"]),Ju=ue(["hovered","container","overflow"]),Yu=ue(["focussed","container","overflow"]),Ku=ue(["disabled","container","overflow"]),Zu=ue(["container","overflow"]),Qu=J(I(S(["default","container","overflow"]),de(Wu,Pu)),I(S(["pressed","container","overflow"]),de(qu,Pu)),I(S(["hovered","container","overflow"]),de(Ju,Pu)),I(S(["focussed","container","overflow"]),de(Yu,Pu)),I(S(["disabled","container","overflow"]),de(Ku,Pu))),Xu=I(S(["container","overflow"]),de(Zu,Pu)),ep=J(I(S(["elements","own"]),de($u,re(Qu))),I(S(["transitions","transition","value","own"]),de(ju,Xu))),tp=I(De("transitions"),(e=>{var t;return G(ke(["transitions"]),Pe("conditionalTransitions",null===(t=e.transitions)||void 0===t?void 0:t.transition))(e)})),np=J(ep,tp),ip=J(I(S(["elements","wrapper"]),de(Gu,re(Qu))),I(S(["transitions","transition","value","wrapper"]),de(Fu,Xu))),ap=J(I(S(["elements","indicator"]),de(Mu,re(Qu))),I(S(["transitions","transition","value","indicator"]),de(Bu,Xu))),op=J(I(S(["elements","activeIndicator"]),de(Uu,re(Qu))),I(S(["transitions","transition","value","activeIndicator"]),de(Vu,Xu))),rp=J(I(S(["elements","seenIndicator"]),de(zu,re(Qu))),I(S(["transitions","transition","value","seenIndicator"]),de(Hu,Xu)));function sp(e){return"StaticImage"===e.type}function lp(e){return"StaticIcon"===e.type}function cp(e){return"BasicText"===e.type}function dp(e){return"DataImage"===e.type}function up(e){return"DataIcon"===e.type}function pp(e){return"RichText"===e.type}function yp(e){return"SlideStateTrigger"===e.type}function fp(e){return"ToggleButtonStateTrigger"===e.type}const mp=ae(te([function(e){return"Row"===e.type&&hp(e.node.children)},function(e){return"Column"===e.type&&hp(e.node.children)},sp,lp,pp,cp,function(e){return"ProgressIndicator"===e.type},function(e){return"OneByOneDistribution"===e.type},function(e){return"When"===e.type&&hp(e.node.children)},function(e){return"StaticLink"===e.type&&hp(e.node.children)},function(e){return"StackedDistribution"===e.type},function(e){return"CarouselDistribution"===e.type},function(e){return"GroupedDistribution"===e.type},function(e){return"CloseButton"===e.type&&hp(e.node.children)},function(e){return"ProgressControl"===e.type&&Tp(e.node.children)},function(e){return"ZStack"===e.type&&hp(e.node.children)},function(e){return"FlowRow"===e.type&&hp(e.node.children)},yp,fp]));function hp(e){return mp(e)}const vp=J(ep,ip,tp);function gp(e){const t=e.children.map((e=>Fp(e)));if(hp(t))return Object.assign(Object.assign({},ke(["settings"],e)),{children:t,allowBackdropToClose:e.settings.allowBackdropToClose,styles:e.styles?vp(e.styles):void 0});throw ku("Overlay",`Invalid schema: ${JSON.stringify(e)}`)}function bp(e){const t=e.children.map((e=>Fp(e)));if(Tp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?np(e.styles):void 0});throw ku("CloseButton",`Invalid schema: ${JSON.stringify(e)}`)}function Ip(e){const t=e.children.map((e=>Fp(e)));if(xp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?np(e.styles):void 0});throw ku("CreativeResponse",`Invalid schema: ${JSON.stringify(e)}`)}function Ep(e){const t=e.children.map((e=>Fp(e)));if(Tp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?np(e.styles):void 0});throw ku("ProgressControl",`Invalid schema: ${JSON.stringify(e)}`)}const Sp=J(ep,ap,op,rp,tp);const wp=ae(te([cp,sp,lp,dp,up,function(e){return"Row"===e.type&&Cp(e.node.children)},function(e){return"FlowRow"===e.type&&Cp(e.node.children)},function(e){return"Column"===e.type&&Cp(e.node.children)},function(e){return"ZStack"===e.type&&Cp(e.node.children)},function(e){return"When"===e.type&&Cp(e.node.children)}]));function Cp(e){return wp(e)}const Op=ae(te([cp,sp,lp,function(e){return"Row"===e.type&&Tp(e.node.children)},function(e){return"FlowRow"===e.type&&Tp(e.node.children)},function(e){return"Column"===e.type&&Tp(e.node.children)},function(e){return"ZStack"===e.type&&Tp(e.node.children)},function(e){return"When"===e.type&&Tp(e.node.children)}]));function Tp(e){return Op(e)}const Ap=ae(te([cp,sp,lp,dp,up,function(e){return"Row"===e.type&&xp(e.node.children)},function(e){return"FlowRow"===e.type&&xp(e.node.children)},function(e){return"Column"===e.type&&xp(e.node.children)},function(e){return"ZStack"===e.type&&xp(e.node.children)},function(e){return"When"===e.type&&xp(e.node.children)}]));function xp(e){return Ap(e)}function Np(e){const t=e.children.map((e=>Fp(e)));if(Cp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?np(e.styles):void 0});throw ku("StaticLink",`Invalid schema: ${JSON.stringify(e)}`)}function _p(e){const t=e.children.map((e=>Fp(e)));if(xp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?np(e.styles):void 0});throw ku("CatalogResponseButton",`Invalid schema: ${JSON.stringify(e)}`)}function Lp(e){return"Row"===e.type&&kp(e.node.children)}function Rp(e){return"Column"===e.type&&kp(e.node.children)}const Dp=ae(te([cp,sp,lp,dp,up,pp,function(e){return"StaticLink"===e.type},yp,fp,function(e){return"CatalogResponseButton"===e.type},Lp,function(e){return"FlowRow"===e.type&&kp(e.node.children)},Rp,function(e){return"ZStack"===e.type&&kp(e.node.children)},function(e){return"When"===e.type&&kp(e.node.children)}]));function kp(e){return Dp(e)}const Pp=te([Lp,Rp]);function $p(e){const t=Fp(e.template);if(function(e){return Pp(e)}(t))return Object.assign(Object.assign({},e),{template:t,styles:e.styles?np(e.styles):void 0});throw ku("CatalogStackedCollection",`Invalid schema: ${JSON.stringify(e)}`)}function jp(e){const t=e.children.map((e=>Fp(e)));if(Cp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?np(e.styles):void 0});throw ku("ToggleButtonStateTrigger",`Invalid schema: ${JSON.stringify(e)}`)}function Gp(e){const t=e.transition?{inTransition:e.transition.in,outTransition:e.transition.out}:void 0;return Object.assign(Object.assign({},e),{children:e.children.map((e=>Fp(e))),transition:t})}function Fp(e){switch(e.type){case"Row":return{type:e.type,node:(v=e.node,Object.assign(Object.assign({},v),{children:v.children.map((e=>Fp(e))),styles:v.styles?np(v.styles):void 0}))};case"When":return{type:e.type,node:Gp(e.node)};case"FlowRow":return{type:e.type,node:(h=e.node,Object.assign(Object.assign({},h),{styles:h.styles?np(h.styles):void 0,children:h.children.map((e=>Fp(e)))}))};case"Column":return{type:e.type,node:(m=e.node,Object.assign(Object.assign({},m),{children:m.children.map((e=>Fp(e))),styles:m.styles?np(m.styles):void 0}))};case"ZStack":return{type:e.type,node:(f=e.node,Object.assign(Object.assign({},f),{styles:f.styles?np(f.styles):void 0,children:f.children.map((e=>Fp(e)))}))};case"Overlay":return{type:e.type,node:gp(e.node)};case"ProgressControl":return{type:e.type,node:Ep(e.node)};case"CarouselDistribution":return{type:"CarouselDistribution",node:(y=e.node,Object.assign(Object.assign({},ke(["settings"],y)),{viewableItems:y.settings.viewableItems,peekThroughSize:y.settings.peekThroughSize,styles:y.styles?np(y.styles):void 0}))};case"CloseButton":return{type:"CloseButton",node:bp(e.node)};case"CreativeResponse":return{type:"CreativeResponse",node:Ip(e.node)};case"GroupedDistribution":return{type:"GroupedDistribution",node:(p=e.node,Object.assign(Object.assign({},ke(["settings"],p)),{viewableItems:p.settings.viewableItems,transition:p.settings.transition,styles:p.styles?np(p.styles):void 0}))};case"OneByOneDistribution":return{type:"OneByOneDistribution",node:(u=e.node,Object.assign(Object.assign({},u),{styles:u.styles?np(u.styles):void 0}))};case"ProgressIndicator":return{type:"ProgressIndicator",node:(c=e.node,Object.assign(Object.assign({},ke(["settings"],c)),{startPosition:null===(d=c.settings)||void 0===d?void 0:d.startPosition,styles:c.styles?Sp(c.styles):void 0}))};case"SlideStateTrigger":return{type:"SlideStateTrigger",node:(l=e.node,Object.assign(Object.assign({},l),{styles:l.styles?np(l.styles):void 0}))};case"StackedDistribution":return{type:"StackedDistribution",node:(s=e.node,Object.assign(Object.assign({viewableItems:[]},s),{styles:s.styles?np(s.styles):void 0}))};case"StaticLink":return{type:"StaticLink",node:Np(e.node)};case"ToggleButtonStateTrigger":return{type:"ToggleButtonStateTrigger",node:jp(e.node)};case"CatalogResponseButton":return{type:"CatalogResponseButton",node:_p(e.node)};case"CatalogStackedCollection":return{type:"CatalogStackedCollection",node:$p(e.node)};case"RichText":return{type:"RichText",node:(r=e.node,Object.assign(Object.assign({},r),{styles:r.styles?tp(r.styles):void 0}))};case"DataImage":return{type:"DataImage",node:(o=e.node,Object.assign(Object.assign({},o),{styles:o.styles?tp(o.styles):void 0}))};case"StaticImage":return{type:"StaticImage",node:(a=e.node,Object.assign(Object.assign({},a),{styles:a.styles?tp(a.styles):void 0}))};case"DataIcon":return{type:"DataIcon",node:(i=e.node,Object.assign(Object.assign({},i),{styles:i.styles?tp(i.styles):void 0}))};case"StaticIcon":return{type:"StaticIcon",node:(n=e.node,Object.assign(Object.assign({},n),{styles:n.styles?tp(n.styles):void 0}))};case"BasicText":return{type:"BasicText",node:(t=e.node,Object.assign(Object.assign({},t),{styles:t.styles?tp(t.styles):void 0}))};default:return e}var t,n,i,a,o,r,s,l,c,d,u,p,y,f,m,h,v}function Mp(e){const t=e.split("."),n=Number(t[0]),i=Number(t[1]);if(t.length<2||Number.isNaN(n)||Number.isNaN(i))throw Error(`Fail to convert version ${e} to a valid version.`);return{major:n,minor:i}}function Bp(e,t){return e.major===t.major&&e.minor===t.minor}const Up=(e,t,n)=>E([Ee(e),$e(t)])(n);function Vp(e,t){return Bp(t,{major:0,minor:0})?Vp(Hd(e),{major:0,minor:1}):function(e,t){return 0===t.major&&Up(1,23,t.minor)}(0,t)?Vp(Du(e),{major:1,minor:0}):e}function zp(e,t){return Bp(t,{major:0,minor:0})?zp(function(e){return Object.assign(Object.assign({},e),{layout:Hd(e.layout)})}(e),{major:0,minor:1}):function(e,t){return 0===t.major&&Up(1,23,t.minor)}(0,t)?zp(function(e){return Object.assign(Object.assign({},e),{layout:Du(e.layout)})}(e),{major:1,minor:0}):e}function Hp(e,t,n,i){const a=Mp(n);if(i){const s=Mp(i);if(r=a,(o=s).major<r.major||o.major===r.major&&o.minor<r.minor||Bp(s,a))return t(e,s);throw Error(`Could not migrate received layout config, config schema version ${i} is higher than the supported version ${n}.`)}return t(e,Mp("0.0"));var o,r}function Wp(e){var t;try{return Object.assign(Object.assign({},je(e)),{offer:Object.assign(Object.assign({},je(e.offer)),{creative:Rd(e.offer.creative)}),layoutVariant:Object.assign(Object.assign({},je(e.layoutVariant)),{layoutVariantSchema:"string"==typeof e.layoutVariant.layoutVariantSchema?kd(e.layoutVariant.layoutVariantSchema,"LayoutSlotLayoutVariant",e.instanceGuid):e.layoutVariant.layoutVariantSchema,childLayouts:re(qp,null!==(t=e.layoutVariant.childLayouts)&&void 0!==t?t:[])})})}catch(t){throw t.message?t:Ld("Slot",e.instanceGuid)}}function qp(e){return Object.assign(Object.assign({},je(e)),{childLayoutSchema:"string"==typeof e.childLayoutSchema?kd(e.childLayoutSchema,"ChildLayoutRootSchema",e.childLayoutId):e.childLayoutSchema})}function Jp(e){if(e){const t=function(e){try{return Object.assign(Object.assign({},je(e)),{outerLayoutSchema:"string"==typeof e.outerLayoutSchema?kd(e.outerLayoutSchema,"LayoutRootLayoutSchema",e.instanceGuid):e.outerLayoutSchema,slots:re(Wp,e.slots)})}catch(t){throw t.message?t:Ld("LayoutConfig",e.instanceGuid)}}(e);return function(e,t){const{layoutSchemaVersion:n}=e,i=ue(["outerLayoutSchema"]),a=ue(["slots"]),o=ue(["layoutVariant","layoutVariantSchema"]);return J(de(a,re(de(o,(e=>Hp(e,Vp,t,n))))),de(i,(e=>Hp(e,zp,t,n))))(e)}(t,Ns.DCUI_SCHEMA_VERSION)}}const Yp=O([[z({signalType:$("SignalSecondaryResponse")}),function*(e,t){return yield qe({type:as,payload:{level:As,code:Gs,message:"DCUI does not support SignalSecondaryResponse creative response signal type.",additionalInformation:{instanceGuid:e.instanceGuid}}}),e.isPositive?"ERROR":"EXPLICIT_DISMISSAL"}],[z({isPositive:$(!0)}),function*(e,t,n){var i;if("url"in e&&e.url){const a=e.instanceGuid;yield qe({type:nn,payload:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:a,responseActionPayload:{name:"Url",transformedTrafficURL:e.url,creativeInstanceGuid:e.creativeInstanceGuid}}});const o=t.getOverrideLinkNavigation()?"overrideLinkNavigation":null!==(i=e.urlBehavior)&&void 0!==i?i:"newTab",r=yield*function*(e,t,n){try{const i=yield ze(Sl,t),a=Tl(i)?i.ref:void 0;return yield ze(e.addAdvertiserWindowRef,a,n),Tl(i)||"newTab"!==t.urlBehavior?"SUCCESS":(yield qe({type:as,payload:{level:As,code:Fs,message:`Did not receive a window reference opening link ${t.url}`}}),"UNSPECIFIED")}catch(e){return yield qe({type:as,payload:{level:As,code:Fs,message:`Errored attempting to open link ${t.url}: ${e.message}`,stack:e.stack}}),"ERROR"}}(t,{url:e.url,urlBehavior:o,external:{partner:n}},a);return"self"===o?"END":r}return yield qe({type:as,payload:{level:As,code:Gs,message:"URL response doesn't have a valid url",additionalInformation:{instanceGuid:e.instanceGuid}}}),"ERROR"}],[A,function*(){return"EXPLICIT_DISMISSAL"}]]);function*Kp(e){return yield qe({type:as,payload:{level:As,code:Gs,message:"DCUI does not support SignalSecondaryResponse creative response signal type.",additionalInformation:{instanceGuid:e.instanceGuid}}}),e.isPositive?"ERROR":"EXPLICIT_DISMISSAL"}function*Zp(e,t){let n="IMPLICIT_DISMISSAL";const i=t.payload.offerPositionIndex,a=Qt(t.payload)||Xt(t.payload)||Zt(t.payload)?t.payload:t.payload.responseOption;switch(a.action){case"Url":yield qe({type:rn,payload:{name:"OFFER_ENGAGEMENT"}}),a.isPositive&&(yield qe({type:os,payload:{code:"CREATIVE_RESPONSE",message:"creative positive response",data:{type:a.action,isPositive:a.isPositive,responseInstanceGuid:a.instanceGuid}}}),yield qe({type:rn,payload:{name:"POSITIVE_ENGAGEMENT"}})),n="SignalSecondaryResponse"===a.signalType?yield*Kp(a):yield*Yp(a,e.context,e.partner);break;case"CaptureOnly":yield qe({type:rn,payload:{name:"OFFER_ENGAGEMENT"}}),a.isPositive&&(yield qe({type:rn,payload:{name:"POSITIVE_ENGAGEMENT"}})),n="SignalSecondaryResponse"===a.signalType?yield*Kp(a):yield*function*(e){return yield qe({type:nn,payload:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:"CaptureOnly",creativeInstanceGuid:e.creativeInstanceGuid}}}),e.isPositive?"SUCCESS":"EXPLICIT_DISMISSAL"}(a);break;case"Fulfillment":yield qe({type:as,payload:{level:As,code:"INCORRECTLY_HANDLE_FULFILLMENT_ACTION",message:`Fulfillment action is incorrectly handled by the orchestrator instead of a module with the option ID: ${a.instanceGuid}`}}),n="ERROR";break;case"ExternalPaymentTrigger":yield qe({type:as,payload:{level:As,code:"INCORRECTLY_HANDLE_EXTERNAL_ACTION",message:`External action was dispatched as an engagement erroneously. Instance GUID: ${a.instanceGuid}`}}),n="ERROR"}en(t.payload)||(yield qe(function(e,t){switch(e){case"SUCCESS":return{type:ad,payload:{event:"Completed",completionReason:"Success",offerPositionIndex:t}};case"UNSPECIFIED":return{type:ad,payload:{event:"Completed",completionReason:"Unspecified",offerPositionIndex:t}};case"ERROR":return{type:ad,payload:{event:"Completed",completionReason:"Error",offerPositionIndex:t}};case"EXPLICIT_DISMISSAL":return{type:ad,payload:{event:"Dismissed",dismissalReason:"Explicit",offerPositionIndex:t}};case"IMPLICIT_DISMISSAL":return{type:ad,payload:{event:"Dismissed",dismissalReason:"Implicit",offerPositionIndex:t}};default:return{type:td,payload:{offerProcessStatus:"END"}}}}(n,i)))}function Qp(e,t,n,i){return st((a=>(i().then((e=>Promise.all([t.getRoktPageInstanceGuid(),(t.getUId||t.getPluginInstanceId)()]).then((([t,n])=>Object.assign(Object.assign({},e),{pageInstanceGuid:t,pluginInstanceId:n}))).catch((()=>e)))).then((({moduleConnectorBuilder:t,pageInstanceGuid:i,pluginInstanceId:o})=>{const r=`rokt-${n}-${o}`.toLowerCase();if(!customElements.get(r)){const o=t.withGatewayFactory(e).withLogger((e=>{a({type:as,payload:{level:e.level,code:e.code,message:e.message,additionalInformation:Object.assign(Object.assign({},e.additionalInformation),{moduleName:n,layoutType:"LayoutVariant",pageInstanceGuid:null!=i?i:"N/A"})}})})).build();customElements.define(r,o)}})).catch((e=>{const t=e&&"object"==typeof e&&"message"in e?e.message:void 0,i=e&&"object"==typeof e&&"stack"in e?e.stack:void 0;a({type:as,payload:{level:kt,code:"FAILED_TO_LOAD_MODULE",message:t,additionalInformation:{stack:i,reason:t?void 0:e,moduleName:n}}}),a(lt)})),()=>{})))}const Xp={"standard-marketing":()=>Promise.resolve().then((function(){return Sf})),"add-to-cart":()=>Promise.resolve().then((function(){return Om})),"instant-purchase":()=>Promise.resolve().then((function(){return Eh})),"layouts-xp-sandbox":()=>Promise.resolve().then((function(){return Xh}))};function*ey(e,t,n){let i=yield Ye((e=>e.module.loadedModules));for(const a of n.payload.modules)i&&!(null==i?void 0:i.includes(a))&&(i=[...i,a],yield Qe(ty,e,t,a))}function*ty(e,t,n){if(n in Xp){yield qe({type:Yc,payload:n});const i=yield ze(Qp,e,t,n,Xp[n]);yield ze($s,i)}else yield qe({type:as,payload:{level:Os,code:"INVALID_MODULE_NAME",message:`Could not load unknown module ${n}`}})}function*ny(e){const t=yield Ye((e=>Bd.getDistributionViewableItems(e.layout?Bd.getDistribution(e.layout.layoutSchema):void 0))),n=yield Ye((n=>{var i;const a=il(e.payload.activeBreakpoint)(n);return a>=0&&t?null!==(i=t[Math.min(t.length-1,a)])&&void 0!==i?i:1:void 0}));if("number"==typeof n){const e={type:ed,payload:{groupSize:n}};yield qe(e)}}const iy=O([[(e,t,n,i)=>"END"===e.offerProcessStatus,j({type:Yr})],[(e,t,n,i)=>t.isLastOffer&&n,j({type:Yr})],[(e,t,n,i)=>1===i&&!t.isLastOffer,j({type:Qc})],[A,j(void 0)]]);function*ay(e){const t=yield Ye((e=>({exists:null!==e.progression,isLastOffer:hd(e)}))),n=yield Ye((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.groupSize}));var i;null!=(i=t)&&i instanceof Object&&"exists"in i&&"isLastOffer"in i&&t.exists&&(yield*function*(e,t,n){const i=yield Ye((e=>e.settings.closeOnComplete)),a=iy(e,t,"boolean"==typeof i&&i,n);a&&(a.type===Yr&&(yield qe({type:rn,payload:{name:"PLACEMENT_COMPLETED"}})),yield qe(a))}(e.payload,t,n))}function oy(e){return e.type===ad&&"Interactive"===e.payload.event}function ry(e){return e.type===ad&&"Interactive"!==e.payload.event}function*sy(e){switch(e.payload.event){case"Dismissed":yield qe({type:td,payload:{offerProcessStatus:"CONTINUE"}});break;case"Completed":yield qe({type:od,payload:{key:"offerComplete",value:O([[$("Error"),j(-1)],[$("Success"),j(1)],[A,j(2)]])(e.payload.completionReason),offerPositionIndex:e.payload.offerPositionIndex}}),yield qe({type:td,payload:{offerProcessStatus:"CONTINUE"}});break;case"Interactive":yield qe({type:Jt,payload:{name:"Interactive",offerPositionIndex:e.payload.offerPositionIndex}}),yield qe({type:rn,payload:{name:"PLACEMENT_INTERACTIVE"}})}}function*ly(e,t){var n;try{const n=yield Ye((e=>{var t,n,i;return null!==(i=null===(n=null===(t=e.layout)||void 0===t?void 0:t.settings)||void 0===n?void 0:n.enablePartnerValidation)&&void 0!==i&&i}));n&&(yield ze(e.partner.send,hl.PartnerValidationEvent.SET_PARTNER_VALIDATION_STATUS,{errors:t.payload.errors}))}catch(i){const a=yield Ye((({slots:e})=>{var n,i;return"number"==typeof t.payload.offerPositionIndex?null!==(i=null===(n=e.at(t.payload.offerPositionIndex))||void 0===n?void 0:n.layoutVariant.moduleName)&&void 0!==i?i:"Unknown":"orchestrator"})),o=null!==(n=yield ze(e.context.getRoktPageInstanceGuid))&&void 0!==n?n:"N/A",r={type:as,payload:{level:Pt,code:"PARTNER_VALIDATION_UPDATE_FAILED",message:"Failed to update the partner with error status",additionalInformation:{moduleName:a,layoutType:"number"==typeof t.payload.offerPositionIndex?"LayoutVariant":"OuterLayout",pageInstanceGuid:o}}};yield qe(r)}}function*cy(e){const t=yield Ye((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));yield qe({type:ld.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield qe({type:Yr}),t?(yield qe({type:nn,payload:{name:"SignalInstantPurchaseDismissal",parentGuid:t}}),yield qe({type:nn,payload:{name:"SignalDismissal",parentGuid:t}})):yield qe({type:as,payload:{level:Ts,code:Ms,message:"ParentGuid does not exist"}})}function*dy(e,t){yield Ke([Ze(as,js.bind(null,e.errorService.raise)),Xe(Jr,Vd.bind(null,{display:e.displayService,partner:e.partnerInteractionService})),Ze(Kc,ey.bind(null,t,e.contextService)),Xe(rd,Zp.bind(null,{partner:e.partnerInteractionService,context:e.contextService})),Ze(td,ay),Ze(ry,sy),Ps(oy,sy),Xe(Hr,dl.bind(null,e.displayService)),Xe(Yr,_l.bind(null,e.contextService)),Xe(id,cy),Xe(is,nc),Ze(nn,Gl),Ze(ln,Fl),ks(Jt,ec.bind(null,e.metricsService)),ks(ns,Ml.bind(null,e.rdnService)),Ze(os,jl.bind(null,e.errorService.raise)),Xe(Vr,ny),Ze(on,Xl),Ze(cn,tc.bind(null,{createChildPlugin:e.childPlugin.create,partner:e.partnerInteractionService,context:e.contextService})),Xe(dn,ly.bind(null,{partner:e.partnerInteractionService,context:e.contextService}))])}var uy,py,yy,fy,my,hy=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},vy=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};const gy={[yn.SET_CUSTOM_STATE]:ld.SET_CUSTOM_STATE,[yn.SET_DOMAIN_STATE]:ld.SET_DOMAIN_STATE,[yn.SET_GLOBAL_OFFER_DATA_CART]:ld.SET_GLOBAL_OFFER_DATA_CART,[yn.OFFER_LIFECYCLE]:cd.OFFER_LIFECYCLE,[yn.OFFER_ENGAGEMENT]:cd.OFFER_ENGAGEMENT,[yn.SET_PARTNER_VALIDATION_STATUS]:cd.SET_PARTNER_VALIDATION_STATUS};class by{constructor(e){uy.add(this),py.set(this,void 0),hy(this,py,e,"f")}getState(e){const t=vy(this,py,"f").getState();return{breakpoint:t.breakpoint,progression:vd(t),customStates:ol(t,e.offerPositionIndex),domainStates:gd(t,e.offerPositionIndex)}}dispatch(e,t){vy(this,py,"f").dispatch(vy(this,uy,"m",my).call(this,e,t))}subscribe(e,t){return t(this.getState(e)),vy(this,py,"f").subscribe((()=>{t(this.getState(e))}))}}function Iy(e,t){const n=ot(),i={},a=it({reducer:fd,devTools:{name:"Orchestrator"},preloadedState:Object.assign(Object.assign({},md()),t),middleware:e=>{return e({thunk:!1,serializableCheck:!1}).concat((t=i,e=>e=>n=>{if("object"==typeof n&&null!==n&&"type"in n){const i=n.type,a=t[`${i}`];return e(a?a(n):n)}return e(n)}),n);var t}}),o=(r=function(e){return new by(e)}(a),s=e.childPlugin.create,l=e.partnerInteractionService.onEvent,(e,t)=>new ha(r,s,e,t,l));var r,s,l;n.run(dy,e,o),n.run(kl,e,Jp);const c={};return Object.assign(Object.assign({},a),{extend:({reducer:e,interceptors:t,sagas:o})=>{e&&(Object.assign(c,e),a.replaceReducer(at(Object.assign(Object.assign({},fd),c)))),t&&Object.assign(i,t),o&&n.run(o)}})}py=new WeakMap,uy=new WeakSet,yy=function(e,t,n){return{type:e,payload:Object.assign(Object.assign({},t),{offerPositionIndex:n.offerPositionIndex,creativeInstanceGuid:n.creativeInstanceGuid})}},fy=function(e,t){return t.type===ln?t.payload.signal.parentGuid||(t.payload.signal.parentGuid=e.creativeInstanceGuid):(t.payload.creativeInstanceGuid=e.creativeInstanceGuid,t.payload.parentGuid||(t.payload.parentGuid=e.creativeInstanceGuid)),t},my=function(e,t){return function(e){return e.type in gy}(t)?vy(this,uy,"m",yy).call(this,gy[t.type],t.payload,e):t.type===nn||t.type===ln?vy(this,uy,"m",fy).call(this,e,t):t};var Ey=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const Sy={ctx:new Map([[Jc.name,Jc],[Hc.name,Hc],[Ac.name,Ac],[$c.name,$c]]),cache:[]};function wy(n,i){return Ey(this,void 0,void 0,(function*(){const{pluginId:o,pageInstanceGuid:r}=yield function(e){return Promise.allSettled([(e.contextService.getUId||e.contextService.getPluginInstanceId)(),e.contextService.getRoktPageInstanceGuid()]).then((([e,t])=>({pluginId:"fulfilled"===e.status?e.value:Lt.pluginId,pageInstanceGuid:"fulfilled"===t.status?t.value:Lt.pageInstanceGuid}))).catch((()=>Lt))}(i),s=y(n),l=Iy(i);s.render(t(a.StrictMode,{children:[e($r,{}),e(Ya,{children:e(v,{store:l,children:t(Ha.Provider,{value:o,children:[e(Zs,{}),e(Ni.Provider,{value:n,children:e(vr,{extensions:Sy,extendStore:l.extend.bind(l),children:e(Fd,{pageInstanceGuid:r})})})]})})})]}))}))}class Cy{constructor(){this._subscribers=[]}add(e){this._subscribers.push(e)}unsubscribe(){this._subscribers.forEach((e=>e.unsubscribe()))}}const Oy=()=>{},Ty=(e=Oy,t=Oy,n=Oy)=>"function"!=typeof e?e:{next:e,error:t,complete:n};class Ay{constructor(e){this._setupFn=e}subscribe(e,t,n){const i=Ty(e,t,n);let a,o=!0;const r={next:e=>{o&&i.next(e)},complete:()=>{o&&(a&&a(),i.complete(),o=!1)},error:e=>{o&&(i.error(e),o=!1)}};a=this._setupFn(r),o||a&&a();const s=new Cy;return s.add({unsubscribe:()=>{a&&a(),o=!1}}),s}}class xy extends Ay{constructor(){super((e=>(this._isComplete&&e.complete(),this._observers.push(e),()=>this._observers=this._observers.filter((t=>t!==e))))),this._observers=[],this._isComplete=!1}next(e){for(const t of this._observers)t.next(e)}error(e){for(const t of this._observers)t.error(e)}complete(){this._isComplete=!0;for(const e of this._observers)e.complete()}asObservable(){return new Ay((e=>{const t=this.subscribe(e);return()=>t.unsubscribe()}))}}class Ny extends xy{constructor(e){super(),this._lastValue=e}subscribe(e,t,n){const i=Ty(e,t,n);return i.next(this._lastValue),super.subscribe(i)}next(e){return this._lastValue=e,super.next(e)}getValue(){return this._lastValue}}class _y extends xy{constructor(e=-1){super(),this._buffer=[],this._error=null,this._bufferLength=e}subscribe(e,t,n){const i=Ty(e,t,n);let a=!0;return this._buffer.filter((e=>(e===this._error&&(a=!1),a))).forEach((e=>i.next(e))),this._error&&i.error(this._error),i.error=e=>{this._error=e,t(e)},super.subscribe(i)}next(e){this._error||this._addToBuffer(e),super.next(e)}error(e){this._error=e,this._addToBuffer(e),super.error(e)}_addToBuffer(e){-1!==this._bufferLength&&this._buffer.length===this._bufferLength?(this._buffer.shift(),this._buffer.push(e)):this._buffer.push(e)}}const Ly={CompletedBeforeEmit:"CompletedBeforeEmit"},Ry=(e,t)=>{let n;const i="object"==typeof t;return new Promise(((a,o)=>{n=e.subscribe(a,o,(()=>{i?a(t.defaultValue):o(new Error(Ly.CompletedBeforeEmit))}))})).then((e=>(n.unsubscribe(),e))).catch((e=>{throw n.unsubscribe(),e}))},Dy=(e,t)=>new Promise(((n,i)=>{let a;"object"==typeof t&&(a=t.defaultValue),e.subscribe((e=>a=e),(e=>i(e)),(()=>n(a)))})),ky=(e,t)=>new Ay((n=>{const i=e=>n.next(e);return e.addEventListener(t,i),()=>e.removeEventListener(t,i)}));function Py(e){return new Ay((t=>{e.then((e=>{t.next(e),t.complete()}),(e=>t.error(e)))}))}const $y=(...e)=>new Ay((t=>{const n=new Cy;let i=0;for(const a of e)n.add(a.subscribe((e=>t.next(e)),(e=>t.error(e)),(()=>{i+=1,i>=e.length&&t.complete()})));return()=>n.unsubscribe()})),jy=(...e)=>new Ay((t=>{for(const n of e)t.next(n)})),Gy=(...e)=>new Ay((t=>{if(!e.length)return t.complete(),Oy;const n=new Cy,i=new Array(e.length),a=new Array(e.length),o=e=>!i.includes(void 0)&&t.next(e);for(let t=0;t<e.length;t++){const r=e[t].subscribe((e=>{a[t]=e,i[t]=!0,o(a)}));n.add(r)}return()=>n.unsubscribe()}));var Fy=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};function My(e,t){return new By(e,t)}class By{constructor(e,t){this._target=e,this._handler=t}subscribe(e,t,n){const i=e.next?e.next.bind(e):e,a={next:(...e)=>Fy(this,void 0,void 0,(function*(){try{yield i(...e)}catch(e){this._handler(e)}})),error:e.error?e.error.bind(e):t,complete:e.complete?e.complete.bind(e):n};return this._target.subscribe(a)}}class Uy{constructor(e){this.value=e,this.complete=!1,this.skip=!1}}var Vy=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const zy=e=>(...t)=>new Ay((n=>{const i=e.subscribe((e=>Vy(void 0,void 0,void 0,(function*(){try{let i=new Uy(e);for(const e of t){const t=e(i);if(i=t.then?yield t:t,!0===i.skip||!0===i.complete)break}if(i.skip)return;n.next(i.value),!0===i.complete&&n.complete()}catch(e){n.error(e)}}))),(e=>n.error(e)),(()=>n.complete()));return()=>i.unsubscribe()})),Hy=e=>t=>(!1===e(t.value)&&(t.skip=!0),t),Wy=e=>t=>(e?!0===e(t.value)?t.complete=!0:t.skip=!0:t.complete=!0,t),qy=e=>t=>{const n=e(t.value);return new Uy(n)},Jy=e=>t=>(e(t.value),t),Yy={FULLSCREEN:"DisplayPreset.FULLSCREEN",EMBEDDED:"DisplayPreset.EMBEDDED",ATTACHED:"DisplayPreset.ATTACHED"},Ky={ERROR:"ERROR",INFO:"INFO",WARNING:"WARNING"},Zy={getBreakpointCSSClass:Wt},Qy="CHILD_LAYOUTS/ADD_LAUNCHED",Xy="DYNAMIC_DATA/ADD";function ef(e={launched:{}},t){if(t.type===Qy){const n=t.payload;return n.childLayoutId?b(["launched",n.childLayoutId],n.shouldRelaunch,e):e}return e}function tf(e=null,t){return e}function nf(e=null,t){if(t.type===Xy){const n=t.payload;return e?n?Ge(e,n):e:n}return e}function af(e,t){var n;return null===(n=e.childLayouts.launched[t])||void 0===n||n}function of(e){var t;return null===(t=e.staticData)||void 0===t?void 0:t.offer}function rf(e){var t;return null===(t=e.staticData)||void 0===t?void 0:t.schemaVersion}const sf=Object.freeze({});function lf(e){var t;return(null===(t=e.dynamicData)||void 0===t?void 0:t.text)?e.dynamicData.text:sf}const cf="FAILED_TO_LAUNCH_CHILD_LAYOUT";function*df(e,t,n){var i;if(yield null===(i=Ye(af,n.payload.childLayoutId))||void 0===i||i){const i=yield Ye(rf),o=yield Ye(of),r=yield Ye(lf);try{const s=(a=function(e,t,n,i){return{instanceGuid:e.instanceGuid,childLayoutId:e.childLayoutId,childLayoutSchema:e.childLayoutSchema,offer:t,layoutSchemaVersion:n,content:{text:i}}}(n.payload,o,i,r),JSON.parse(JSON.stringify(a)));try{yield ze(e.createChildPlugin,{name:"dcui-child",config:s,targetElementSelector:n.payload.targetElementSelector})}catch(e){yield ze(t,{level:Pt,code:cf,message:"Could not launch child layout, failed creating plugin."})}}catch(e){yield ze(t,{level:Pt,code:cf,message:"Could not launch child layout, failed to make the child layout config serializable."})}yield qe({type:Qy,payload:{childLayoutId:n.payload.childLayoutId,shouldRelaunch:!1}})}var a}function uf(){const t=La(),n=m(lf),i=ea()({state:n},"textContent");return e(Xi,{value:i,children:e(Ti,{children:e=>e(t)})})}const pf={staticData:tf,dynamicData:nf,childLayouts:ef};function yf(e={}){return Object.assign({staticData:null,dynamicData:null,childLayouts:{launched:{}}},e)}function ff(e){let t,n,i;return st((a=>(Promise.race([e.onClose().then((()=>"CLOSED")),new Promise((n=>{t=e.onEvent("PLUGIN_TRANSITION_OFFER_SUCCESS").subscribe((()=>{n("SUCCESS")}))})),new Promise((t=>{n=e.onEvent("PLUGIN_TRANSITION_OFFER_CLOSE").subscribe((()=>{t("UNSPECIFIED")}))})),new Promise((e=>{i=e}))]).then((e=>{"END"!==e&&(a(e),a(lt))})),()=>{null==t||t.unsubscribe(),null==n||n.unsubscribe(),i("END")})))}function mf(e){return"object"==typeof e&&null!==e&&Object.entries(e).every((([e,t])=>"string"==typeof e&&"string"==typeof t))}function*hf(e,t,n,i,a){for(;;){switch(yield We(e)){case"CLOSED":t({type:an,payload:{event:"Dismissed",dismissalReason:"Implicit"}});break;case"SUCCESS":if((n||i)&&a){yield ze(a);break}t({type:an,payload:{event:"Completed",completionReason:"Success"}});break;case"UNSPECIFIED":t({type:an,payload:{event:"Completed",completionReason:"Unspecified"}})}}}function*vf(e,t,n){if(Kt(n)){const{responseOption:i,fulfillment:a}=n,o=en(n),r=tn(n);yield qe({type:nn,payload:{name:"SignalResponse",parentGuid:i.instanceGuid,responseActionPayload:{name:"Fulfillment"}}});const s=yield ze(e.createChildPlugin.bind(e),a);if("object"==typeof s&&"onClose"in s&&"close"in s){const i=yield ze(ff,s);if("object"==typeof i&&"take"in i){const a=function(e,t,n,i){if(n.responseOption.rclid)return function*(){yield qe({type:rn,payload:{name:"REALTIME_OFFER_FULFILLMENT_CONVERSION",body:{rclid:n.responseOption.rclid,accountID:n.accountID,referralCreativeID:n.referralCreativeID}}}),yield ze(gf,e,t,i)}}(e,t,n,s);return void(yield ze(hf,i,e.globalDispatch.bind(e),o,r,a))}}yield ze(t,{level:kt,code:"UNEXPECTED_NEXT_VALUE_IN_SAGA",message:'Received an unexpected input at a step in the saga "handleFullfillmentResponse" and could not continue.'})}else yield ze(t,{level:kt,code:"INVALID_FULFILLMENT_PAYLOAD",message:`Fulfillment payload is invalid, fulfillment: ${n}`})}function*gf(e,t,n){const i=function(e){return st((t=>{const n=e.onEvent({name:gl,source:"partner",callback:e=>{mf(e)&&t({eventName:gl,data:e})}},{name:bl,source:"partner",callback:e=>{mf(e)&&t({eventName:bl,data:e})}});return()=>{n()}}))}(e);try{for(;;){const a=yield We(i);switch(a.eventName){case gl:yield qe({type:rn,payload:{name:gl,body:a.data}}),yield qe({type:Xy,payload:{text:a.data}}),e.globalDispatch({type:an,payload:{event:"Completed",completionReason:"Success"}}),n&&(yield ze(n.close.bind(n)));break;case bl:e.globalDispatch({type:an,payload:{event:"Completed",completionReason:"Error"}}),n&&(yield ze(n.close.bind(n)));break;default:t({level:kt,code:"UNKNOWN_REALTIME_OFFER_FULFILLMENT_EVENT",message:`Unknown event: ${a.eventName}`})}}}catch(e){const n=e;t({level:Pt,code:"FAILED_TO_PROCESS_REALTIME_OFFER_FULFILLMENT_EVENT",message:null==n?void 0:n.message})}finally{(yield Je())&&i.close()}}function*bf(e,t,n){const i=Qt(n.payload)||Xt(n.payload)||Zt(n.payload)?n.payload:n.payload.responseOption;switch(i.action){case"Url":yield ze(e.globalDispatch.bind(e),n),(en(n.payload)||tn(n.payload))&&(yield qe({type:rn,payload:{name:"REALTIME_OFFER_FULFILLMENT_REFERRAL",body:{rclid:i.rclid,accountID:i.accountID,referralCreativeID:i.referralCreativeID,referralOnly:tn(n.payload)}}}),en(n.payload)&&(yield ze(gf,e,t)));break;case"CaptureOnly":yield ze(e.globalDispatch.bind(e),n);break;case"Fulfillment":yield qe({type:rn,payload:{name:"OFFER_ENGAGEMENT"}}),i.isPositive&&(yield qe({type:rn,payload:{name:"POSITIVE_ENGAGEMENT"}})),tn(n.payload)&&(yield qe({type:rn,payload:{name:"REALTIME_OFFER_FULFILLMENT_REFERRAL",body:{rclid:i.rclid,accountID:n.payload.accountID,referralCreativeID:n.payload.referralCreativeID,referralOnly:!0}}})),yield*vf(e,t,n.payload)}}function*If(e,t){yield Ke([Xe(Yt,bf.bind(null,e,t)),Ze(pn,df.bind(null,e,t)),Ze("*",_s.bind(null,[Yt,pn],e))])}Object.assign({},yn);const Ef=(new Ta).withAppFactory((function(n){var i;if(n.rootElement){const o=y(n.rootElement),r=yf({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),s=function(e,t,n=yf()){const i=ot(),a=it({reducer:pf,devTools:{name:"Standard Marketing"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(If,e,t),a}(n.gateway,n.logger,r);o.render(e(a.StrictMode,{children:t(Ba,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e($r,{}),e(v,{store:s,children:e(kr,{settings:n,dispatch:s.dispatch,children:e(uf,{})})})]})}))}}));var Sf=Object.freeze({__proto__:null,moduleConnectorBuilder:Ef});const wf="CART/UPDATE",Cf="CATALOG_ITEM/RESPONSE",Of="USER_CREATIVE_RESPONSE_HISTORY/ADD",Tf=O([[(e,t)=>0!==t,$],[(e,t)=>!Number.isNaN(e)&&0===t,$],[(e,t)=>Number.isNaN(e)&&0===t,Me]]);function Af({isChecked:t,isDisabled:n,outerClassname:i,outerCheckedClassname:a,innerClassname:o,innerCheckedClassname:r}){return e("span",{style:{display:"flex"},children:e("span",{className:`${i} ${t?a:""}`,tabIndex:n?-1:1,style:{display:"flex",boxSizing:"border-box"},children:e("span",{className:`${o} ${t?r:""}`,style:{flex:1}})})})}const xf="catalogRadioGroup__label",Nf=["Enter","Space"],_f={elements:{own:[],optionContainer:[],radioButtonInner:[{default:{border:{borderRadius:11},background:{backgroundColor:{light:"#FFF"}}}}],radioButtonInnerChecked:[{default:{background:{backgroundColor:{light:"#529ff4"}}}}],radioButtonOuter:[{default:{border:{borderRadius:16,borderColor:{light:"#999"},borderStyle:"solid",borderWidth:"1"},dimension:{width:{type:"fixed",value:16},height:{type:"fixed",value:16}},spacing:{padding:"4"}}}],radioButtonOuterChecked:[]}};function Lf(e,t,n){return e.map(O([[G($("Required"),F("","type")),({value:e})=>Number.isNaN(n)&&t>0?e.message:""],[A,j("")]])).filter(Fe)}function Rf({schema:n,testId:i}){var r;const s=f(),l=za(),c=null!==(r=m((e=>{var t,n;return l.cartItemId in e.cart?null!==(n=null===(t=e.cart[l.cartItemId])||void 0===t?void 0:t.quantity)&&void 0!==n?n:0:void 0})))&&void 0!==r?r:NaN,u=d((()=>Lf(n.validations,n.options.length,c)),[n.validations,n.options.length,c]),p=Da(),{tabIndex:y,styles:h,isDisabled:v}=It(p);o((()=>{v||s(Df(u))}),[]);const g=n.options.filter((({quantity:e})=>{var t,n;return e>=(null!==(t=l.minItemCount)&&void 0!==t?t:-1/0)&&e<=(null!==(n=l.maxItemCount)&&void 0!==n?n:1/0)}));function b(e){s({type:Cf,payload:{catalogItem:l,quantity:e}});const t=Lf(n.validations,n.options.length,e);s(Df(t))}return g.length>0?e(Do,{styles:n.styles?Ht(_f,n.styles):_f,children:({classnames:n,mapperRef:o})=>e("div",{className:null==n?void 0:n.own,style:Object.assign({display:"flex",flexDirection:"column"},h),children:e(na,{value:o(xf),children:a.Children.toArray(g.map(((a,o)=>{var r;const s=Tf(c,a.quantity),d=e=>i?`${i}-option${o}${e}`:void 0;return t("label",{tabIndex:y,"aria-disabled":v,style:{display:"flex"},className:`${xf} ${null!==(r=null==n?void 0:n.optionContainer)&&void 0!==r?r:""}`,onKeyDown:e=>{s||!Nf.includes(e.code)||v||b(a.quantity)},"data-e2e":"CatalogRadioGroup-Option","data-e2e-quantity":`${a.quantity}`,"data-testid":d("Label"),children:[e("input",{type:"radio",style:{display:"none"},tabIndex:-1,name:l.instanceGuid,value:a.quantity,checked:s,onChange:()=>b(a.quantity),"aria-disabled":v,disabled:v}),e(Af,{isChecked:s,isDisabled:v,innerClassname:null==n?void 0:n.radioButtonInner,innerCheckedClassname:null==n?void 0:n.radioButtonInnerChecked,outerClassname:null==n?void 0:n.radioButtonOuter,outerCheckedClassname:null==n?void 0:n.radioButtonOuterChecked}),e(Mr,{schema:a,testId:d("Content")})]})})))})})}):null}function Df(e){return{type:dn,payload:{errors:e}}}function kf(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Pf(t){const n=f(),i=Ai(),a=za(),o=Da(),{tabIndex:r,styles:s,isDisabled:l}=It(o);return e(Do,{styles:t.schema.styles,children:({classnames:o})=>e("button",{type:"button",tabIndex:r,"aria-disabled":l,disabled:l,style:Object.assign({cursor:"pointer"},s),"data-testid":t.testId,"data-e2e":"CatalogItemResponse",onClick:e=>{e.preventDefault();n({type:Cf,payload:{catalogItem:a,quantity:1}})},className:null==o?void 0:o.own,children:kf(t.schema.children,i,t.testId)})})}const $f={allowedTags:["em","strong","a","br","u","p","li","ul","ol","span"],allowedAttributes:{a:["href","target"],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],span:[]},allowedSchemes:["http","https"]},jf=new Map([["&","_;^;_"]]),Gf=new RegExp(`<a *(?=${$f.allowedAttributes.a.join("|")}|>)`,"g"),Ff=new RegExp(`<a *(?:(?:${$f.allowedAttributes.a.filter((e=>"href"!==e)).join("|")})="[^"]*")* *href="([^"]+)"`,"g"),Mf=new RegExp("(<br *?>)|(<br *?/>)","g"),Bf=new RegExp(`<ul *(?=${$f.allowedAttributes.ul.join("|")}|>)`,"g"),Uf=new RegExp(`<ol *(?=${$f.allowedAttributes.ol.join("|")}|>)`,"g"),Vf=new RegExp("<li *(?=>|\\s[^>]*>)","g"),zf="<br/>";function Hf(t){const n=ea(),i=Da(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Ff,((e,t)=>{const n=t.replaceAll("&",jf.get("&"));return e.replace(t,n)})).replaceAll(Mf,zf)}(e);return t===vt(t,$f)}(e))throw new $t("FAILED_SANITISING_HTML","Invalid HTML tags");return e}),[t.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=It(i);return a?e(Do,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(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)),l=((null==n?void 0:n.list)?`class="${n.list}"`:"")+' style="list-style-type: none; padding-inline-start: 0px; display: flex; flex-direction: column;"',c=((null==n?void 0:n.listItem)?`class="${n.listItem}"`:"")+' style="display: flex; align-items: flex-start; flex-shrink: 0; flex-grow: 1;"',d=`class="rokt-icon${(null==n?void 0:n.span)?" "+n.span:""}" style="display: inline-block; pointer-events: none; user-select: none;" aria-disabled="true"`,u=a.replace(Gf,`<a ${i.join(" ")}`).replace(Bf,`<ul ${l}`).replace(Uf,`<ol ${l}`).replace(Vf,`<li ${c}><span ${d}>Check</span`);return p=a,new RegExp("</(p|ul|ol)>").test(p)?e("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:u}}):e("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:u}});var p}}):null}const Wf={internally:"_top",externally:"_blank"};function qf(t,n,i,a,o){return e(na,{value:i(n),children:Jf(t,a,o)})}function Jf(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Yf(t){var n,i;const a=Wf[t.schema.open],o=Ai(),r=za(),s=Da(),l=f(),c=null!==(n=r.url)&&void 0!==n?n:"",{tabIndex:d,styles:u,isDisabled:p}=It(s);return Boolean(c)&&(null===(i=t.schema.children)||void 0===i?void 0:i.length)>0?e(Do,{styles:t.schema.styles,children:({classnames:n,mapperRef:i})=>{var s;return e("a",{href:c,onClick:()=>{var e;l({type:nn,payload:{name:"SignalResponse",parentGuid:null!==(e=r.instanceGuid)&&void 0!==e?e:"",responseActionPayload:{name:"Url",transformedTrafficURL:c}}})},"data-testid":t.testId,"data-e2e":"CatalogUrlLink",target:null!=a?a:"_blank",tabIndex:d,"aria-disabled":p,"aria-label":null!==(s=t.schema.a11yLabel)&&void 0!==s?s:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:"block"},u),className:null==n?void 0:n.own,children:(null==n?void 0:n.own)?qf(t.schema.children,null==n?void 0:n.own,i,o,t.testId):Jf(t.schema.children,o,t.testId)})}}):null}function Kf(e,t){const n=e.cart[t];return n||null}function Zf(e){var t,n;const i=null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.catalogItems)&&void 0!==n?n:[],a=function(e){return Object.values(e.cart).filter((e=>null!==e))}(e);return a.filter((e=>i.find((t=>t.catalogItemId===e.catalogItemId))))}function Qf(e,t){var n,i,a,o;const r=null===(n=e.staticData)||void 0===n?void 0:n.offer;if(r){const n=function(e){return Zf(e).reduce(((e,t)=>e+t.quantity),0)}(e),s=Kf(e,t.cartItemId),l=(null!==(i=null==r?void 0:r.maxTotalItemsQtyInOffer)&&void 0!==i?i:1/0)-n,c=(null!==(a=t.maxItemCount)&&void 0!==a?a:1/0)-(null!==(o=null==s?void 0:s.quantity)&&void 0!==o?o:0);return Math.min(l,c)}return 0}function Xf(e){var t,n;const i=null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.catalogItems)&&void 0!==n?n:[];return i.length>0?i:null}function em(e,t){var n,i;return null!==(i=null===(n=Xf(e))||void 0===n?void 0:n.find((e=>e.catalogItemId===t)))&&void 0!==i?i:null}function tm(e){var t;const n=null===(t=Xf(e))||void 0===t?void 0:t.filter((e=>e.preSelectedQuantity&&e.preSelectedQuantity>0));return n&&n.length>0?n:null}function nm(e){var t,n;return null!==(n=null===(t=tm(e))||void 0===t?void 0:t.reduce(((e,t)=>{var n;return e+(null!==(n=t.preSelectedQuantity)&&void 0!==n?n:0)}),0))&&void 0!==n?n:0}const im=G((e=>e.filter((e=>!ce(e[1]))).map((([e,t])=>({cartItemId:t.cartItemId,quantity:t.quantity})))),ne,B("cart"));function am(t,n,i,a,o){return e(na,{value:i(n),children:a(t,void 0,o)})}function om(e,t,n){return t(e,void 0,n)}function rm(i){var a;const{schema:o,testId:r}=i,{a11yInputLabel:s,styles:l,showInputField:c,buttons:d,forcedUpsellText:u}=o,{increment:p,decrement:y,a11yIncrementLabel:h,a11yDecrementLabel:v}=d||{},g=f(),b=za(),I=Ai(),E=ea(),S=Da(),{tabIndex:w,styles:C,isDisabled:O}=It(S),T=m((e=>function(e,t){var n,i,a;const o=em(e,t);return Boolean(o&&(null!==(n=o.preSelectedQuantity)&&void 0!==n?n:0)>0&&o.preSelectedQuantity===(null!==(i=o.minItemCount)&&void 0!==i?i:0)&&o.preSelectedQuantity===(null!==(a=o.maxItemCount)&&void 0!==a?a:0))}(e,b.catalogItemId))),A=m((e=>Kf(e,b.cartItemId))),x=m((e=>Qf(e,b))),N=(null==A?void 0:A.quantity)||0,_=It(O||N<=(null!==(a=b.minItemCount)&&void 0!==a?a:0)?"DISABLED":S),L=It(O||x<=0?"DISABLED":S),R=It(O||T?"DISABLED":S),D=e=>{var t;const n=e.target.value;if(0===n.length)k(null!==(t=b.minItemCount)&&void 0!==t?t:0);else{const e=Number(n);!Number.isNaN(e)&&e>=0&&k(e)}},k=e=>{O||g({type:Cf,payload:{catalogItem:b,quantity:e}})};return e(Do,{styles:l,children:({classnames:i,mapperRef:a})=>e("div",{className:null==i?void 0:i.own,style:Object.assign({display:"flex",flexDirection:"row"},C),children:T&&u?e(Vo,{schema:u,isInline:!1,testId:r?`${r}-forced-upsell-text`:void 0}):t(n,{children:[y?e("button",{className:null==i?void 0:i.decrementButton,style:Object.assign(Object.assign({},_.styles),{cursor:_.isDisabled?"not-allowed":"pointer",pointerEvents:"auto"}),onClick:e=>{e.preventDefault(),k(N-1)},tabIndex:_.tabIndex,"aria-label":v||void 0,disabled:_.isDisabled,"data-testid":r?`${r}-decrement-button`:void 0,children:e(Xi,{value:E,children:(null==i?void 0:i.decrementButton)?am(y,i.decrementButton,a,I,r):om(y,I,r)})}):null,c?e("input",{type:"text",className:null==i?void 0:i.input,style:Object.assign(Object.assign({},R),{cursor:R.isDisabled?"not-allowed":"auto",caretColor:R.isDisabled?"transparent":"auto",pointerEvents:"auto",outline:"none"}),value:N,onChange:D,"aria-label":s||void 0,tabIndex:w,disabled:O,"data-testid":r?`${r}-input`:void 0}):e("p",{className:null==i?void 0:i.input,style:C,"data-testid":r?`${r}-quantity-text`:void 0,children:N}),p?e("button",{className:null==i?void 0:i.incrementButton,style:Object.assign(Object.assign({},L.styles),{cursor:L.isDisabled?"not-allowed":"pointer",pointerEvents:"auto"}),onClick:e=>{e.preventDefault(),k(N+1)},tabIndex:L.tabIndex,"aria-label":h||void 0,disabled:L.isDisabled,"data-testid":r?`${r}-increment-button`:void 0,children:e(Xi,{value:E,children:(null==i?void 0:i.incrementButton)?am(p,i.incrementButton,a,I,r):om(p,I,r)})}):null]})})})}const sm={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(Pf,{schema:t.node,testId:n})},EscapeHatch:function(t){if("EscapeHatch"===t.type&&t.node.data){const n=JSON.parse(t.node.data);switch(null==n?void 0:n.type){case"InsuranceRichText":return e(Hf,{schema:n.node});case"CatalogUrlLink":return e(Yf,{schema:n.node});default:return}}},CatalogRadioGroup:function(t){if("CatalogRadioGroup"===t.type)return e(Rf,{schema:t.node})},CatalogQuantityCounter:function(t){if("CatalogQuantityCounter"===t.type)return e(rm,{schema:t.node})}};function lm(){const t=La(),n=Ai();return e(xi,{value:n,overrides:sm,children:e(Ti,{children:e=>e(t)})})}function cm(e){return e.reduce(((e,t)=>(e[t.cartItemId]=function(e={}){return Object.assign({cartItemId:"cartItemId",catalogItemId:"catalogItemId",name:"Catalog Title",description:"This is a catalog item",unitPrice:10,totalPrice:10,quantity:1,currency:"USD",linkedProductId:void 0,quantityMustBeSynchronized:void 0,providerData:""},e)}({cartItemId:t.cartItemId,quantity:t.quantity}),e)),{})}const dm={cart:function(e=cm([]),t){if(t.type===wf){const{catalogItem:n,quantity:i}=t.payload,a=n.cartItemId,o=Ls(n,i);return Object.assign(Object.assign({},e),{[a]:o})}return e},userCreativeResponseHistory:function(e=[],t){return t.type===Of?e.concat(t.payload.responseId):e},staticData:tf,childLayouts:ef};const um="INVALID_PARTNER_MESSAGE",pm="MISCONFIGURED_CATALOG_ITEM",ym="FAILED_TO_PROCESS_PARTNER_UPDATE_CART_ITEM";function*fm(e){var t,n;const i=yield Ye(tm),a=yield Ye(nm),o=yield Ye((e=>{var t;return null===(t=e.staticData)||void 0===t?void 0:t.offer.maxTotalItemsQtyInOffer}));if(bm(a)&&bm(o)&&a>o)yield ze(e,{level:Pt,code:pm,message:`Catalog items preselected quantities (${a}) exceeds the maximum allowed quantity (${o}) for this offer`});else if(i&&Array.isArray(i))for(const a of i){const i=null!==(t=a.preSelectedQuantity)&&void 0!==t?t:0,o=null!==(n=a.maxItemCount)&&void 0!==n?n:1/0;i>o?yield ze(e,{level:Pt,code:pm,message:`Preselected quantity (${i}) is greater than maxItemCount (${o}) for catalog item (${a.instanceGuid})`}):yield*gm(a,i,!0)}}function*mm(e,t,n){const{catalogItem:i,quantity:a}=n.payload;if(yield*gm(i,a,!1)){const n=yield Ye((e=>{var t,n,i;const a=null===(t=e.staticData)||void 0===t?void 0:t.offer.creative.responseOptionsMap.positive,o=e.userCreativeResponseHistory.at(-1),r=null===(n=e.staticData)||void 0===n?void 0:n.offer.creative.responseOptionsMap.negative;if(a&&o&&a.id===o&&"SignalGatedResponse"===(null==r?void 0:r.signalType))return function(e,t){var n;switch(e.action){case"Fulfillment":{const i=null==t?void 0:t.creative.fulfillment;return wt(i)?{type:Yt,payload:{fulfillment:i,responseOption:e,accountID:null!==(n=null==t?void 0:t.accountId)&&void 0!==n?n:""}}:`Could not get fulfillment for response (instanceGuid: ${e.instanceGuid})`}case"Url":return(null==t?void 0:t.accountId)?{type:Yt,payload:Object.assign(Object.assign({},e),{accountID:t.accountId})}:`Could not get accountId for response (instanceGuid: ${e.instanceGuid})`;default:return{type:Yt,payload:e}}}(r,null===(i=e.staticData)||void 0===i?void 0:i.offer)}));null!=(o=n)&&"object"==typeof o&&"type"in o&&"payload"in o&&"object"==typeof o.payload?yield ze(e.globalDispatch,n):function(e){return"string"==typeof e}(n)&&(yield ze(t,{level:Pt,code:"INVALID_RESPONSE_OBJECT",message:n}))}var o}function*hm(e,t){const n=function(e,t){return st((n=>{const i=e.onEvent({name:fl.V2.PartnerMessage.UpdateCartItem,source:"partner",callback:e=>{!function(e){return null!==e&&"object"==typeof e&&"cartItemId"in e&&"quantity"in e&&!("unitPrice"in e)}(e)?t({level:Pt,code:um,message:`Invalid UpdateCartItemPartnerMessageBody: ${JSON.stringify(e)}`}):n(e)}});return()=>{i()}}))}(e,t);try{for(;;){const e=yield We(n);yield ze(vm,e,t)}}catch(e){const n=e;t({level:Pt,code:ym,message:null==n?void 0:n.message})}finally{(yield Je())&&n.close()}}function*vm(e,t){const{cartItemId:n,quantity:i}=e,a=yield Ye(Kf,n);if(Im(a)){const e=yield Ye(em,a.catalogItemId);null!==(o=e)&&"object"==typeof o&&"catalogItemId"in o&&"price"in o?yield*gm(e,i,!1):yield ze(t,{level:Pt,code:ym,message:`Catalog item not found for cart item id (${n})`})}else yield ze(t,{level:Pt,code:ym,message:`Cart item not found for cart item id (${n})`});var o}function*gm(e,t,n){var i;const a=yield Ye(Kf,e.cartItemId),o=yield Ye(Qf,e),r=bm(o)?o:0,s=Im(a)?a.quantity:0;if(t!==s&&t>=(null!==(i=e.minItemCount)&&void 0!==i?i:0)&&t-s<=r){yield qe({type:wf,payload:{catalogItem:e,quantity:t}});const i=yield Ye(Kf,e.cartItemId),o=yield Ye(im);return yield qe({type:un,payload:{cart:o}}),yield qe({type:nn,payload:{name:"SignalCartItemQuantitySelected",parentGuid:e.instanceGuid,objectData:{quantity:t,preselected:n}}}),yield qe({type:rn,payload:{name:"V2_CART_ITEM_UPDATED",body:{oldCartItem:a,cartItem:i}}}),!0}return!1}function bm(e){return"number"==typeof e}function Im(e){return null!=e&&"object"==typeof e&&"cartItemId"in e&&"quantity"in e&&"unitPrice"in e}function*Em(e,t){var n;yield qe({type:Of,payload:{responseId:(n=t.payload,Kt(n)?n.responseOption.id:n.id)}}),yield ze(e.globalDispatch.bind(e),t)}function*Sm(e,t){yield Ke([et(fm.bind(null,t)),et(hm.bind(null,e,t)),Xe(Cf,mm.bind(null,e,t)),Xe(Yt,Em.bind(null,e)),Ze(pn,df.bind(null,e,t)),Ze("*",_s.bind(null,[Yt,pn],e))])}function wm(e){return"object"==typeof e&&null!==e&&"cartItemId"in e&&"quantity"in e}Object.assign(Object.assign({},yn),{CATALOG_ITEM_RESPONSE:Cf});const Cm=(new Ta).withAppFactory((function(n){var i;if(n.rootElement){const o=y(n.rootElement),r=function(e){return"object"==typeof e&&null!==e&&"cart"in e&&Array.isArray(e.cart)&&e.cart.every(wm)}(n.offerState)?n.offerState:{cart:[]},s=function(e={}){return Object.assign({cart:cm([]),userCreativeResponseHistory:[],staticData:null,childLayouts:{launched:{}}},e)}({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion},cart:cm(r.cart)}),l=function(e,t,n){const i=ot(),a=it({reducer:dm,devTools:{name:"Add To Cart"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(Sm,e,t),a}(n.gateway,n.logger,s);o.render(e(a.StrictMode,{children:t(Ba,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e($r,{}),e(v,{store:l,children:e(kr,{settings:n,dispatch:l.dispatch,children:e(lm,{})})})]})}))}}));var Om=Object.freeze({__proto__:null,moduleConnectorBuilder:Cm});const Tm="CATALOG/TRIGGER_SELECT_ITEM",Am="CATALOG/SET_SELECTED_ITEM",xm="CHECKOUT_LIFECYCLE",Nm="INSTANT_PURCHASE/INITIATE",_m="INSTANT_PURCHASE/PARTNER_RESPONSE",Lm="INSTANT_PURCAHSE/WSDK_RESPONSE";function Rm(t,n,i,a,o){return e(na,{value:i(n),children:Dm(t,a,o)})}function Dm(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function km(t){const n=f(),i=Ai(),a=Da(),{tabIndex:o,styles:r,isDisabled:s}=It(a),l=za(),c=Yi(l,"catalogItem");return e(Do,{styles:t.schema.styles,children:({classnames:a,mapperRef:d})=>e("button",{type:"button",tabIndex:o,"aria-disabled":s,disabled:s,style:Object.assign({cursor:"pointer"},r),"data-testid":t.testId,"data-e2e":"CatalogItemResponse",onClick:e=>{e.preventDefault();n({type:Nm,payload:{catalogItem:l,quantity:1,useInstantPurchaseExtension:!0}})},className:null==a?void 0:a.own,children:e(Xi,{value:c,children:(null==a?void 0:a.own)?Rm(t.schema.children,a.own,d,i,t.testId):Dm(t.schema.children,i,t.testId)})})})}function Pm(t,n,i,a,o){return e(na,{value:i(n),children:a(t,void 0,o)})}function $m(e,t,n){return t(e,void 0,n)}const jm=["ArrowDown","ArrowUp","Enter","Escape","Tab"];function Gm(n){const i=Di(),a=Ai(),s=za(),l=ea(),u=e=>l({data:e},"catalogItem"),p=d((()=>i.catalogItems||[]),[i]),y=Da(),{styles:m,isDisabled:h}=It(y),v=r(null),g=r([]),[b,I]=c(!1),[E,S]=c(0),w=f();function C(){h||(b?T():O())}function O(){h||I(!0)}function T(){h||I(!1)}function A(e){S(p.indexOf(e)),T(),w({type:Tm,payload:{catalogItem:e}})}o((()=>{if(b){const e=g.current[E];e&&e.focus()}}),[b,E]);const x={elements:{own:[{default:{background:{backgroundColor:{light:"#ffffff"}},dimension:{width:{type:"percentage",value:100}}}}]}};function N(e){if(!h&&jm.includes(e.key))switch(e.key){case"ArrowDown":{e.preventDefault();const t=E+1;t<p.length&&S(t);break}case"ArrowUp":{e.preventDefault();const t=E-1;t>=0&&S(t);break}case"Enter":if(e.preventDefault(),b){const e=p[E];e&&A(e)}else O();break;case"Tab":if(b){T();const e=p.indexOf(s);-1!==e&&S(e)}break;case"Escape":if(e.preventDefault(),b){T();const e=p.indexOf(s);-1!==e&&S(e)}}}return e(Do,{styles:n.schema.styles?Ht(x,n.schema.styles):x,children:({classnames:i,mapperRef:o})=>t("div",{ref:v,className:null==i?void 0:i.own,onKeyDown:N,onClick:C,onBlur:e=>{var t;(null===(t=v.current)||void 0===t?void 0:t.contains(e.relatedTarget))||b&&T()},"data-e2e":"DropDown","data-testid":n.testId?`${n.testId}-drop-down-container`:void 0,"aria-disabled":h,style:Object.assign({position:"relative"},m),tabIndex:0,children:[e("div",{className:null==i?void 0:i.dropDownSelectedElement,"aria-disabled":h,"data-testid":n.testId?`${n.testId}-drop-down-selected-element`:void 0,style:Object.assign({cursor:"pointer"},m),children:e(Xi,{value:u(s),children:(null==i?void 0:i.dropDownSelectedElement)?Pm(n.schema.closedTemplate,i.dropDownSelectedElement,o,a,n.testId):$m(n.schema.closedTemplate,a,n.testId)})}),b&&e("ul",{className:null==i?void 0:i.dropDownListContainer,onClick:e=>e.stopPropagation(),"data-testid":n.testId?`${n.testId}-drop-down-list-container`:void 0,tabIndex:-1,style:Object.assign({listStyle:"none",padding:0,zIndex:9999,position:"absolute",top:"100%",left:0,right:0,backgroundColor:"#FFF",overflow:"hidden"},m),children:p.map(((t,r)=>e("li",{ref:e=>function(e,t){g.current[t]=e}(e,r),className:null==i?void 0:i.dropDownListElement,onClick:e=>{e.stopPropagation(),h||A(t)},tabIndex:-1,"data-e2e":"DropDownItem","data-testid":n.testId?`${n.testId}-drop-down-item-${r}`:void 0,style:Object.assign({cursor:"pointer",display:"flex"},m),children:e(Xi,{value:u(t),children:(null==i?void 0:i.dropDownListElement)?Pm(n.schema.openTemplate,i.dropDownListElement,o,a,n.testId):$m(n.schema.openTemplate,a,n.testId)})},t.catalogItemId)))})]})})}function Fm(t){const n=t.schema.styles,i=f(),o=m((e=>e.staticData)),r=Da(),{tabIndex:s,styles:l,isDisabled:c}=It(r),d=()=>{var e;i({type:xm,payload:{event:"Checkout",targetStep:t.schema.targetStep,offerPositionIndex:null!==(e=null==o?void 0:o.position)&&void 0!==e?e:0}})};return e(Do,{styles:n,children:({classnames:n})=>{var i;return e("button",{title:t.schema.targetStep,className:null==n?void 0:n.own,onClick:d,"data-testid":t.testId,"data-e2e":"CheckoutStateButtonTrigger",disabled:c,"aria-disabled":c,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:t.schema.targetStep,tabIndex:s,style:Object.assign({cursor:"pointer"},l),children:e(Ti,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,qt(i,t.testId)))))})})}})}const Mm=/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{3})$/;function Bm(t){const n=ea(),i=Da(),{schema:a,testId:o}=t,r=n(a.value),{tabIndex:s,styles:l,isDisabled:c}=It(i);return"string"==typeof(d=r)&&Mm.test(d)?e(Do,{styles:a.styles,children:({classnames:t})=>e("div",{"aria-hidden":c,className:null==t?void 0:t.own,"data-e2e":"ColorSwatch","data-testid":o,style:Object.assign({backgroundColor:r},l),tabIndex:s})}):null;var d}function Um(n){const{schema:{imageKeys:i,styles:o},testId:r}=n,[s,d]=c(0),u=Da(),p=function(e){const t=l(ja);return e.reduce(((e,n)=>{const i=t(`${n}.src`,"copy"),a=t(`${n}.title`,"copy");return void 0===i?e:[...e,_t({light:i,title:a})]}),[])}(i),{styles:y,isDisabled:f,tabIndex:m}=It(u),h=p[s]||p[0];return p.length>0&&h?e(Do,{styles:o,children:({classnames:n})=>t("div",{className:null==n?void 0:n.own,children:[e("img",{"aria-hidden":f,src:h.light,alt:h.alt,title:h.title,className:null==n?void 0:n.mainImage,style:y,"data-testid":`${r}-main-image`,"data-e2e":"ImageGallery-mainImage"}),e("div",{className:null==n?void 0:n.thumbnailList,style:Object.assign(Object.assign({},y),{display:"flex"}),children:a.Children.toArray(p.map(((t,i)=>e("img",{src:t.light,alt:t.alt,title:t.title,className:null==n?void 0:n.thumbnailImage,style:Object.assign(Object.assign({},y),{cursor:f?"not-allowed":"pointer",pointerEvents:"auto"}),"data-testid":`${r}-thumbnail-${i}`,"data-e2e":"ImageGallery-thumbnail",tabIndex:m,onClick:()=>d(i)}))))})]})}):null}const Vm={size:80,radius:30,stroke:7,duration:2,primaryColor:"#222",secondaryColor:"#d6d6d6",primaryRotation:-50,secondaryRotation:45,arcFraction:1/3.5},zm={elements:{own:[{default:{container:{justifyContent:"center",alignItems:"center"},dimension:{width:{type:"percentage",value:100}}}}],spinner:[{default:{container:{justifyContent:"center",alignItems:"center"}}}]}};function Hm(n){var i;const{config:a}=n.schema,o=Object.assign(Object.assign({},Vm),a),r=o.radius,s=2*Math.PI*r,l=s*(null!==(i=o.arcFraction)&&void 0!==i?i:1/3.5),c=s-l,d=o.size/2,u={container:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%"},spinner:{display:"block",animation:`spin ${o.duration}s ease-in-out infinite`,transformOrigin:"center center"}};return e(Do,{styles:n.schema.styles?Ht(zm,n.schema.styles):zm,children:({classnames:i})=>t("div",{className:null==i?void 0:i.own,"data-testid":n.testId,"data-e2e":"LoadingSpinner",style:u.container,children:[t("svg",{width:o.size,height:o.size,viewBox:`0 0 ${o.size} ${o.size}`,className:null==i?void 0:i.spinner,style:u.spinner,children:[e("circle",{cx:d,cy:d,r:r,fill:"none",stroke:o.primaryColor,strokeWidth:o.stroke,strokeDasharray:`${l} ${c}`,strokeDashoffset:"0",strokeLinecap:"butt",transform:`rotate(${o.primaryRotation} ${d} ${d})`}),o.secondaryColor&&e("circle",{cx:d,cy:d,r:r,fill:"none",stroke:o.secondaryColor,strokeWidth:o.stroke,strokeDasharray:`${l} ${c}`,strokeDashoffset:"0",strokeLinecap:"butt",transform:`rotate(${o.secondaryRotation} ${d} ${d})`})]}),e("style",{children:"\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "})]})})}function Wm(t){const n=Ai(),i=Fa(),r=ea(),s=Si(),l=Di().catalogItems||[],c=m((e=>e.selectedItem))||l[0];return o((()=>{c&&s({type:nn,payload:{name:"SignalImpression",parentGuid:null==c?void 0:c.instanceGuid}})}),[c,s]),c?e(Do,{styles:t.schema.styles,children:({classnames:o})=>{return e("div",{"data-testid":t.testId,"data-e2e":"CatalogCombinedCollection",className:null==o?void 0:o.own,style:{display:"flex",flexDirection:"column"},children:a.Children.toArray(e(Va,{context:c,children:e(Ga,{value:i(c),children:e(Xi,{value:(s=c,r({data:s},"catalogItem")),children:n(t.schema.template,void 0,t.testId?`${t.testId}-child`:"")})})}))});var s}}):null}const qm={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(km,{schema:t.node,testId:n})},CatalogCombinedCollection:function(t,n){if("CatalogCombinedCollection"===t.type)return e(Wm,{schema:t.node,testId:n})},EscapeHatch:function(t){if("EscapeHatch"===t.type&&t.node.data){const n=JSON.parse(t.node.data);switch(null==n?void 0:n.type){case"CatalogDropDown":return e(Gm,{schema:n.node});case"CheckoutStateButtonTrigger":return e(Fm,{schema:n.node});case"ColorSwatch":return e(Bm,{schema:n.node});case"ImageGallery":return e(Um,{schema:n.node});case"LoadingSpinner":return e(Hm,{schema:n.node});default:return}}}};function Jm(){const t=La(),n=Ai(),i=m(lf),a=ea()({state:i},"textContent");return e(xi,{value:n,overrides:qm,children:e(Xi,{value:a,children:e(Ti,{children:e=>e(t)})})})}const Ym={staticData:tf,selectedItem:(e=null,t)=>t.type===Am?t.payload:e,dynamicData:nf,childLayouts:ef};function Km(e={}){return Object.assign({staticData:null,selectedItem:null,dynamicData:null,childLayouts:{launched:{}}},e)}const Zm="INVALID_RESPONSE_OBJECT";function Qm(e,t){return st((n=>e.onEvent({name:ml.PartnerMessage.CartItemInstantPurchaseResponse,source:"partner",callback:e=>{var i;"object"==typeof(i=e)&&null!==i&&"upsellItems"in i&&Array.isArray(i.upsellItems)&&i.upsellItems.every((e=>"object"==typeof e))&&"totalUpsellPrice"in i&&"number"==typeof i.totalUpsellPrice&&"currency"in i&&"string"==typeof i.currency&&"paid"in i&&"boolean"==typeof i.paid&&"success"in i&&"boolean"==typeof i.success?n(e):t({level:Pt,code:"MALFORMED_INSTANT_PURCHASE_PARTNER_DATA",message:`Malformed data received from partner\n ${e}`})}})))}function*Xm(e,t){var n;try{for(;;){const t=yield We(e);t&&(yield qe({type:_m,payload:t}))}}catch(e){yield ze(t,{level:Pt,code:"INSTANT_PURCHASE_PARTNER_CHANNEL_ERROR",message:null!==(n=e.message)&&void 0!==n?n:"Unknown error in instant-purchase partner channel"})}finally{e.close()}}function*eh(e,t){var n;try{for(;;){const t=yield We(e);if(t){yield qe({type:Lm,payload:t});break}}}catch(e){yield ze(t,{level:Pt,code:"INSTANT_PURCHASE_WSDK_CHANNEL_ERROR",message:null!==(n=e.message)&&void 0!==n?n:"Unknown error in instant-purchase WSDK channel"})}finally{e.close()}}function th(e){const t=function(e){var t,n;return null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.catalogItems)&&void 0!==n?n:[]}(e);return t[0]}const nh="Unknown failure reason",ih=6e4;function*ah(){const e=yield Ye(th);e&&(yield*uh(e))}function*oh(e){const{catalogItem:t}=e.payload;yield*uh(t)}function*rh(e,t,n){const{catalogItem:i,quantity:a}=n.payload,o=Ls(i,a);o?(yield qe({type:nn,payload:{name:"SignalCartItemInstantPurchaseInitiated",parentGuid:i.instanceGuid,objectData:{catalogItemId:i.catalogItemId,quantity:a}}}),yield*mh("ProcessingState",1),n.payload.useInstantPurchaseExtension?yield*function*(e,t,n){const i={upsellItems:[{cartItemId:e.cartItemId,catalogItemId:e.catalogItemId,quantity:e.quantity,unitPrice:e.unitPrice,totalPrice:e.totalPrice,currency:e.currency}],totalUpsellPrice:e.totalPrice,currency:e.currency};yield Qe(dh,t,n),yield qe({type:rn,payload:{name:"INITIATE_INSTANT_PURCHASE_EVENT",body:i}})}(o,e,t):yield*function*(e,t,n){yield Qe(ch,t,n),yield qe({type:rn,payload:{name:"CART_ITEM_INSTANT_PURCHASE",body:{upsellItems:[e],totalUpsellPrice:e.totalPrice||0,currency:e.currency}}})}(o,e,t)):(yield ze(t,{level:Pt,code:Zm,message:`Unable to translate catalog item with ID ${i.catalogItemId} to cart item for instant purchase transaction.`}),yield*hh("offerComplete",2))}function*sh(e,t){const n=yield Ye((e=>e.staticData));if(!n)return yield ze(e,{level:Pt,code:"MISSING_STATIC_DATA_IN_INSTANT_PURCHASE_MODULE",message:"App state is not configured with static data."}),void(yield*fh("Error"));if(!n.offer.catalogItems)return yield ze(e,{level:Pt,code:"MISSING_CATALOG_ITEMS",message:"No catalog items found within offer data."}),void(yield*fh("Error"));const i={accountId:n.offer.accountId,catalogItems:n.offer.catalogItems};let a,o;t.payload.success?(a=ph,o="Success"):(a=(e,n)=>function(e,t,n,i){return{name:"SignalCartItemInstantPurchaseFailure",parentGuid:e.instanceGuid,objectData:{catalogItemId:e.catalogItemId,quantity:t,failureReason:i.reason||nh,providerId:n.accountId.toString()}}}(e,n,i,t.payload),o="Unspecified"),yield*function*(e,t,n,i){const a=[];for(const i of e.upsellItems){const e=yh(i,t.catalogItems);void 0===e?a.push(i):yield qe({type:nn,payload:n(e,i.quantity)})}a.length>0&&(yield*function*(e,t){const n=JSON.stringify(e,null,"\t").replaceAll('"',"");yield ze(t,{level:Pt,code:Zm,message:`Unable to map cart items to catalog items in the instant purchase partner response: ${n}.`})}(a,i))}(t.payload,i,a,e),yield*fh(o)}function*lh(e){e.payload.response&&e.payload.response.success?yield*hh("offerComplete",1):yield*hh("offerComplete",2)}function*ch(e,t){const n=Qm(e,t),{timeout:i}=yield tt({channel:ze(Xm,n,t),timeout:nt(ih)});i&&(yield ze(t,{level:Pt,code:"INSTANT_PURCHASE_PARTNER_RESPONSE_TIMEOUT",message:"Instant-purchase partner response timed out after 60000ms"}),n.close(),yield*function*(e){yield*mh("ProcessingState",0),yield qe({type:an,payload:{event:"Dismissed",dismissalReason:e}})}("Implicit"))}function*dh(e,t){const n=function(e,t){return st((n=>e.onEvent(...["INSTANT_PURCHASE_SUCCESS","INSTANT_PURCHASE_FAILURE"].map((e=>({name:e,source:"partner",callback:e=>{var i;"object"==typeof(i=e)&&null!==i&&"timestamp"in i&&"string"==typeof i.timestamp&&"sessionId"in i&&"string"==typeof i.sessionId?n(e):t({level:Pt,code:"MALFORMED_INSTANT_PURCHASE_WSDK_DATA",message:`Malformed data received from wsdk\n ${e}`})}}))))))}(e,t),{timeout:i}=yield tt({channel:ze(eh,n,t),timeout:nt(ih)});i&&(yield ze(t,{level:Pt,code:"INSTANT_PURCHASE_WSDK_RESPONSE_TIMEOUT",message:"Instant-purchase wsdk response timed out after 60000ms"}),n.close(),yield*hh("offerComplete",2))}function*uh(e){var t,n,i;yield qe({type:Am,payload:e});const a={title:null!==(t=e.title)&&void 0!==t?t:"",description:null!==(n=e.description)&&void 0!==n?n:"",price:null!==(i=e.priceFormatted)&&void 0!==i?i:""};e.copy&&Object.entries(e.copy).forEach((([e,t])=>{a[`copy.${e}`]=t})),yield qe({type:Xy,payload:{text:a}})}function ph(e,t){return{name:"SignalCartItemInstantPurchase",parentGuid:e.instanceGuid,objectData:{catalogItemId:e.catalogItemId,quantity:t,initiatedBy:Rt.DCUI}}}function yh(e,t){return t.find((t=>t.catalogItemId===e.catalogItemId))}function*fh(e){yield*mh("ProcessingState",0),yield qe({type:an,payload:{event:"Completed",completionReason:e}})}function*mh(e,t){yield qe({type:on,payload:{key:e,value:t}})}function*hh(e,t){yield*mh("ProcessingState",0),yield qe({type:sn,payload:{key:e,value:t}})}function*vh(e){"Checkout"===e.payload.event&&(yield qe({type:sn,payload:{key:"checkout",value:gh(e.payload),offerPositionIndex:e.payload.offerPositionIndex}}))}function gh(e){var t;return null!==(t={ViewOffer:0,ViewTransactionDetails:1,EditPayment:2,EditShipping:3,EditPaymentAndShipping:4,CostBreakdown:5,Confirmation:6,CloseOffer:7}[e.targetStep])&&void 0!==t?t:0}function*bh(e,t){yield Ke([et(ah),Ze(xm,vh),Ze(Tm,oh),Xe(Nm,rh.bind(null,e,t)),Xe(_m,sh.bind(null,t)),Xe(Lm,lh.bind(null)),Ze(pn,df.bind(null,e,t)),Ze("*",_s.bind(null,[Yt,pn],e))])}Object.assign(Object.assign({},yn),{INITIATE_INSTANT_PURCHASE:Nm,INSTANT_PURCHASE_PARTNER_RESPONSE:_m,INSTANT_PURCHASE_WSDK_RESPONSE:Lm});const Ih=(new Ta).withAppFactory((function(n){var i;if(n.rootElement){const o=y(n.rootElement),r=Km({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),s=function(e,t,n=Km()){const i=ot(),a=it({reducer:Ym,devTools:{name:"Instant Purchase"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(bh,e,t),a}(n.gateway,n.logger,r);o.render(e(a.StrictMode,{children:t(Ba,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e($r,{}),e(v,{store:s,children:e(kr,{settings:n,dispatch:s.dispatch,children:e(Jm,{})})})]})}))}}));var Eh=Object.freeze({__proto__:null,moduleConnectorBuilder:Ih});const Sh=s(null),wh=({children:t})=>{var n;const[i,a]=c([]),[r,s]=c(0),[l,d]=c(0),u=ea();return o((()=>{let e=0;const t=i.length,n=setInterval((()=>{e=e+1>=t?0:e+1,s(e)}),l);return()=>clearInterval(n)}),[l,i]),e(Sh.Provider,{value:{images:i,activeIndex:r,duration:l,setImages:a,setActiveIndex:s,setDuration:d},children:e(Xi,{value:u({data:{"image.title":null===(n=i[r])||void 0===n?void 0:n.title}},"creativeCopy"),children:t})})};function Ch({active:t,duration:n,containerStyles:i,indicatorStyles:a}){const s=r(null);return o((()=>{t&&s.current&&function(e,t){const n="animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype,i=[{width:0},{width:"100%"}];if(n){const n=e.animate(i,{duration:t,iterations:1});return()=>{n.finish()}}}(s.current,n)}),[t]),e("div",{style:Object.assign({position:"relative",height:"2px",width:"100%",backgroundColor:"#FFFFFF66"},i),children:e("span",{ref:s,style:Object.assign({animationIterationCount:"infinite",animationFillMode:"forwards",animationTimingFunction:"linear",position:"absolute",top:0,left:0,height:"100%",backgroundColor:"#FFF",width:t?"100%":0},a)})})}function Oh(e){const t=l(ja),n=[];return e.forEach((e=>{const i=t(`${e}.src`,"copy"),a=t(`${e}.title`,"copy");if(void 0===i)return;const o=_t({light:i,title:a});n.push(o)})),n}function Th({schema:n,testId:i}){const r=JSON.parse(n.data),{styles:s,duration:c,imageKeys:d}=r,u=l(Sh),p=Oh(d);return o((()=>{null==u||u.setImages(p),null==u||u.setDuration(c)}),[]),t("div",{"data-testid":i,style:Object.assign({position:"relative",flexShrink:1,flexGrow:0,width:"100%"},s.elements.own),children:[a.Children.toArray(p.map(((t,n)=>e("img",{src:t.light,alt:t.title,style:Object.assign({opacity:n===(null==u?void 0:u.activeIndex)?1:0,position:0===n?"relative":"absolute",display:0===n?"block":"",top:0,width:"100%",height:"100%",maxHeight:"100%",maxWidth:"100%",transition:"opacity 300ms ease-in-out",objectFit:"contain"},s.elements.image)})))),e("div",{style:Object.assign({display:"flex",gap:"2px",width:"70%",position:"absolute",margin:"0 15%",bottom:"8px",zIndex:20,justifyContent:"center"},s.elements.indicatorWrapper),children:a.Children.toArray(p.map(((t,n)=>e(Ch,{duration:c,active:n===(null==u?void 0:u.activeIndex),containerStyles:s.elements.indicatorContainer,indicatorStyles:s.elements.indicator}))))})]})}const Ah={allowedTags:["em","strong","a","br","u","p","li","ul","ol","span"],allowedAttributes:{a:["href","target"],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],span:[]},allowedSchemes:["http","https"]},xh=new Map([["&","_;^;_"]]),Nh=new RegExp(`<a *(?=${Ah.allowedAttributes.a.join("|")}|>)`,"g"),_h=new RegExp("<span*>","g"),Lh=new RegExp(`<a *(?:(?:${Ah.allowedAttributes.a.filter((e=>"href"!==e)).join("|")})="[^"]*")* *href="([^"]+)"`,"g"),Rh=new RegExp("(<br *?>)|(<br *?/>)","g"),Dh="<br/>";function kh(t){const n=ea(),i=Da(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Lh,((e,t)=>{const n=t.replaceAll("&",xh.get("&"));return e.replace(t,n)})).replaceAll(Rh,Dh)}(e);return t===vt(t,Ah)}(e))throw new $t("FAILED_SANITISING_HTML","Invalid HTML tags");return e}),[t.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=It(i);return a?e(Do,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(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=a,new RegExp("</(p|ul|ol)>").test(l)?e("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(Nh,`<a ${i.join(" ")}`).replace(_h,`<span${(null==n?void 0:n.span)?` class=${n.span}`:""}>`)}}):e("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(Nh,`<a ${i.join(" ")}`).replace(_h,`<span${(null==n?void 0:n.span)?` class=${n.span}`:""}>`)}});var l}}):null}function Ph({schema:t}){const n=Ai(),i=hi(Wa(),ra()),o=JSON.parse(t.data),[r]=ht({loop:!1,align:"start",slidesToScroll:2,containScroll:"trimSnaps"}),{styles:s,body:{tierItems:l}}=o;if(!l||!l.length)return;const c=l.length>2;return e("div",{className:i`
136
+ `},a.Children.toArray(u.map((e=>l(e))))))))}const zc={name:"loading-extension",componentFactory:e=>a.createElement(Vc,{data:e}),interceptors:{}},Hc=1e3;function Wc(e){const t=e.data,{minutes:n,seconds:i,timeRemaining:s,restartTimer:l}=function(e){const[t,n]=c(e),i=(new Date).getTime()/Hc,a=r(null),s=()=>{const t=(new Date).getTime()/Hc;n(Math.max(Math.floor(e-(t-i)),0))};return o((()=>(a.current=setInterval(s,Hc),()=>{a.current&&"number"==typeof a.current&&clearInterval(a.current)})),[]),{minutes:Math.floor(t/60).toString(),seconds:Math.floor(Math.min(t%60,59)).toLocaleString("en-US",{minimumIntegerDigits:2,maximumFractionDigits:0,useGrouping:!1}),timeRemaining:t,restartTimer:function(){a.current&&"number"==typeof a.current&&clearInterval(a.current),n(e),a.current=setInterval(s,Hc)}}}((null==t?void 0:t.duration)||300),d=m((e=>{const t=g(["progression","currentGroupIndex"],e);return"number"==typeof t?t:0})),u=f();o((()=>{l()}),[d]),o((()=>{0===s&&(u({type:tn,payload:{name:"SignalUserInteraction",action:"TimerExpired",context:"TimerProgression"}}),u({type:"PROGRESSION/PROCESS",payload:{offerProcessStatus:"CONTINUE"}}))}),[n,i]);const p=Ra(),{tabIndex:y,styles:h,isDisabled:v}=It(p);return a.createElement("p",{tabIndex:y,style:Object.assign(Object.assign({},null==t?void 0:t.styles),h),"aria-hidden":v,"data-e2e":"Timer"},`${n}:${i}`)}const qc={name:"timer-progression-extension",componentFactory:e=>a.createElement(Wc,{data:e}),interceptors:{}},Jc="MODULE/ADD_LOADED",Kc="MODULE/LOAD",Yc="PROGRESSION/INITIALISE",Zc="PROGRESSION/NEXT",Qc="PROGRESSION/PREV",Xc="PROGRESSION/UPDATE_GROUP_SIZE",ed="PROGRESSION/PROCESS",td="SLOTS/SET",nd="INSTANT_PURCHASE/DISMISS",id="OFFER_LIFECYCLE",ad="DOMAIN_STATES/SET",od="OFFER_ENGAGEMENT",rd="GLOBAL_OFFER_DATA_STATE/SET_CART",sd=Object.assign(Object.assign({},rs),{NEXT_IN_PROGRESSION:Zc,PREV_IN_PROGRESSION:Qc,INITIALISE_PROGRESSION:Yc,UPDATE_GROUP_SIZE:Xc,SET_SLOTS:td,ADD_LOADED_MODULE:Jc,SET_DOMAIN_STATE:ad,SET_GLOBAL_OFFER_DATA_CART:rd}),ld=Object.assign(Object.assign({},ss),{LOAD_MODULES:Kc,DISMISS_INSTANT_PURCHASE:nd,PROCESS_PROGRESSION:ed,OFFER_LIFECYCLE:id,OFFER_ENGAGEMENT:od,SET_PARTNER_VALIDATION_STATUS:cn});function cd(e,t){return t<=0||e<=0||t>e?0:Math.ceil(e/t)}function dd(e,t){const n=[];if(t<=0||e<=0||t>e)throw Error(`Could not generate the progression groups with groupSize: ${t} and totalCount: ${e}`);for(let i=0;i<cd(e,t);i++){const a=[];for(let n=0;n<t;n++)a.push(Math.min(i*t+n,e-1));n.push([...new Set(a)])}return n}const ud=Symbol("root");function pd(){return{[ud]:{}}}const yd=Object.assign({progression:function(e=null,t){switch(t.type){case Yc:if(function(e){const{totalCount:t,currentGroupIndex:n,groupSize:i}=e;return t>=0&&i>=0&&n>=0&&i<=t&&n<cd(t,i)}(t.payload)){const{totalCount:e,_:n,groupSize:i}=t.payload;return Object.assign(Object.assign({},t.payload),{indexGroups:dd(e,i)})}return null;case Xc:{const{groupSize:n}=t.payload,i=null==e?void 0:e.totalCount;return i&&n<=i&&n>0?Object.assign(Object.assign({},e),{groupSize:n,indexGroups:dd(i,n),currentGroupIndex:0}):null}case Zc:{if(!e)return null;const{totalCount:t,groupSize:n,currentGroupIndex:i}=e;return t>0&&n>0&&i>=0?Object.assign(Object.assign({},e),{currentGroupIndex:Math.min(i+1,cd(t,n)-1)}):null}case Qc:{if(!e)return null;const{totalCount:t,groupSize:n,currentGroupIndex:i}=e;return t>0&&n>0&&i>=0?Object.assign(Object.assign({},e),{currentGroupIndex:Math.max(i-1,0)}):null}default:return e}},slots:function(e=[],t){return t.type===td?t.payload:e},module:function(e={loadedModules:[]},t){return t.type===Jc?Object.assign(Object.assign({},e),{loadedModules:[...e.loadedModules,t.payload]}):e},domainStates:function(e=pd(),t){if(t.type===ad){if(t.payload.key&&!isNaN(t.payload.value)){const n=void 0!==t.payload.offerPositionIndex?`module${t.payload.offerPositionIndex}`:ud;return n===ud?e:Object.assign(Object.assign({},b([n,t.payload.key],Number(t.payload.value),e)),{[ud]:{}})}return e}return e},globalOfferDataState:function(e={},t){if(t.type===rd){if(t.payload.cart){const n=`module${t.payload.offerPositionIndex}`;return Object.assign(Object.assign({},e),{[n]:{cart:t.payload.cart}})}return e}return e}},ll);function fd(e={}){return Object.assign(Object.assign(Object.assign({},function(e={}){return Object.assign({layout:Zs(),breakpoint:{breakpoints:{default:0},activeBreakpoint:"default",initialised:!1},active:Qs(),fonts:[],signal:{queue:[],processed:[]},serializableCache:sl(),settings:{closeOnComplete:!0},customStates:{root:{}}},e)}(e)),{progression:null,slots:[],module:{loadedModules:[]},domainStates:pd(),globalOfferDataState:{}}),e)}function md(e){var t;return!!e.progression&&(1===e.progression.groupSize&&e.progression.currentGroupIndex===(null===(t=e.progression)||void 0===t?void 0:t.totalCount)-1)}function hd(e){return e.progression?{activeGroupIndex:e.progression.currentGroupIndex,totalOffers:e.progression.totalCount,totalGroups:cd(e.progression.totalCount,e.progression.groupSize),isLast:md(e)}:null}function vd(e,t){return e.domainStates[`module${t}`]||{offerComplete:0,checkout:0}}function gd(e){return Object.values(e.globalOfferDataState).reduce(((e,t)=>{if(t&&"object"==typeof t&&"cart"in t){const n=t.cart;if(Array.isArray(n))return e+n.reduce(((e,t)=>e+("number"==typeof t.quantity?t.quantity:0)),0)}return e}),0)}function bd(i){var a;const{config:o,position:r,visible:s,container:c,testId:d}=i,u=Ha(),p=Ra(),y=m(Xs),f=m((e=>function(e,t){return e.globalOfferDataState[`module${t}`]}(e,r))),h=l(Wa),v=l(qa),g=`rokt-${o.layoutVariant.moduleName}-${u}`;return t(n,{children:[!s&&e("div",{style:{position:"absolute",top:"0",right:"0",bottom:"0",left:"0",zIndex:"1"},"aria-hidden":"true"}),e(g,{style:{display:"flex",flexDirection:"column"===c?"column":"row",width:"100%"},slotInstanceGuid:o.instanceGuid,layoutSchema:JSON.stringify(o.layoutVariant.layoutVariantSchema),schemaVersion:h,childLayouts:JSON.stringify(null!==(a=o.layoutVariant.childLayouts)&&void 0!==a?a:[]),offerData:JSON.stringify(o.offer),offerPositionIndex:r,visible:s,container:c,interactivity:p,"data-testid":d,"data-e2e":`OfferSlot-${r}`,inert:(null==v?void 0:v.inert)&&!s?"":void 0,"aria-hidden":(null==v?void 0:v.inert)?void 0:!s,"module-component":!0,"plugin-id":u,"active-breakpoint":Ht(y),offerState:JSON.stringify(f)})]})}function Id({schema:t,testId:n}){const i=t.styles,o=m((e=>e.slots)),s=r(null),l=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0})),c=Ra(),{tabIndex:d,isDisabled:u,styles:p}=It(c);return o.length&&o[l]?e(Ro,{styles:i,children:({classnames:i})=>e("div",{ref:s,"data-testid":n,"data-e2e":"OneByOneDistribution",className:null==i?void 0:i.own,tabIndex:d,"aria-hidden":u,style:Object.assign({position:"relative",transition:`height ${t.transition.settings.duration/2}ms ease-in-out`,overflow:"hidden",boxSizing:"content-box"},p),children:a.Children.toArray(o.map(((n,i)=>e(Gr,{effect:t.transition,visible:i===l,parentElement:s.current,children:e(bd,{config:n,position:i,visible:i===l,container:"column"})}))))})}):null}const Ed=h((function(e,{schema:t}){var n,i,a;const o=t.startPosition||1;if((null===(n=e.progression)||void 0===n?void 0:n.totalCount)&&(null===(i=e.progression)||void 0===i?void 0:i.groupSize)){const t=cd(e.progression.totalCount,e.progression.groupSize);let n;n=o>0?o-1:t+o>-1?t+o:0;return{numOfIndicators:t-n>-1?t-n:0,activeIndex:null!==(a=e.progression.currentGroupIndex)&&void 0!==a?a:0,startIndex:n}}return{numOfIndicators:0,activeIndex:0,startIndex:0}}))((function({activeIndex:t,startIndex:n,numOfIndicators:a,schema:o}){const r=Ra(),{tabIndex:s,styles:l,isDisabled:c}=It(r),d=Array(a).fill(o.indicator);return a>1&&(p=a+n-1,(u=t)>=n&&u<=p)?e(Zi,{children:a=>e(Ro,{styles:o.styles,children:o=>{var r;const u=o.classnames,p=e=>{var n,i;return e===t?`${null==u?void 0:u.indicator} ${(null==u?void 0:u.activeIndicator)?u.activeIndicator:null!==(n=null==u?void 0:u.seenIndicator)&&void 0!==n?n:""}`:e<t?`${null==u?void 0:u.indicator} ${null!==(i=null==u?void 0:u.seenIndicator)&&void 0!==i?i:""}`:null==u?void 0:u.indicator};return e("div",{className:null!==(r=null==u?void 0:u.own)&&void 0!==r?r:"",style:Object.assign({display:"flex",flexDirection:"row"},l),"data-e2e":"ProgressIndicator",tabIndex:s,"aria-hidden":c,children:i.Children.toArray(d.map(((t,i)=>e("span",{className:p(i+n),style:{display:"flex"},children:a({state:{indicatorPosition:String(i+1+n)}})(t)}))))})}})}):null;var u,p}));const Sd="partnerValidationUI",Cd="stackedViewableItems";function wd(t){var n;const i=f(),r=m((e=>e.slots)),s=null!==(n=t.schema.viewableItems)&&void 0!==n?n:[],l=So(s.reduce(((e,t,n)=>Object.assign(Object.assign({},e),{[n]:t.when})),{})),c=G((e=>{var t;return e&&(null===(t=s[e[0]])||void 0===t?void 0:t.value)||r.length}),Re((([e,t])=>t)),ne)(l);o((()=>{i({type:Zr,payload:{key:Cd,value:String(c)}})}),[c]);const d=r.slice(0,c),u=Ra(),{tabIndex:p,isDisabled:y,styles:h}=It(u);return(null==d?void 0:d.length)>0?e(Ro,{styles:t.schema.styles,children:({classnames:n})=>e("div",{"data-testid":t.testId,"data-e2e":"StackedDistribution",className:null==n?void 0:n.own,"aria-hidden":y,tabIndex:p,style:Object.assign({display:"flex",flexDirection:"column"},h),children:a.Children.toArray(d.map(((t,n)=>e(bd,{config:t,position:n,visible:!0,container:"column"}))))})}):null}function Od(t){const n=t.schema.styles,i=f(),o=Ra(),r="Backward"===t.schema.direction?"Previous":"Next",{tabIndex:s,styles:l,isDisabled:c}=It(o),d=()=>{i({type:"Backward"===t.schema.direction?sd.PREV_IN_PROGRESSION:sd.NEXT_IN_PROGRESSION})};return e(Ro,{styles:n,children:({classnames:n})=>{var i;return e("button",{title:r,className:null==n?void 0:n.own,onClick:d,"data-testid":t.testId,"data-e2e":"ProgressControl","data-e2e-direction":`${t.schema.direction}`,disabled:c,"aria-disabled":c,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:r,tabIndex:s,style:Object.assign({cursor:"pointer"},l),children:e(Oi,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,t.testId?`${t.testId}-child${i}`:void 0))))})})}})}function Td({schema:t,testId:n}){var i,r,s,l,c,d,u,p,y;const h=m((e=>e.progression)),v=null==h?void 0:h.indexGroups[null==h?void 0:h.currentGroupIndex],g=null!==(i=null==h?void 0:h.currentGroupIndex)&&void 0!==i?i:0,b=m((e=>e.slots)),I=m(il),E=t.viewableItems.length-1,[S,C]=ht({slidesToScroll:null!==(r=t.viewableItems[Math.min(I,E)])&&void 0!==r?r:"auto",containScroll:"trimSnaps"}),w=f(),O=Ra(),{tabIndex:T,isDisabled:A,styles:x}=It(O),N=`${null!==(p=null===(u=null===(d=null===(c=null===(l=null===(s=t.styles)||void 0===s?void 0:s.elements)||void 0===l?void 0:l.own[I])||void 0===c?void 0:c.default)||void 0===d?void 0:d.container)||void 0===u?void 0:u.gap)&&void 0!==p?p:"0"}px`;o((()=>{function e(e){var t,n;const i=null!==(t=null==e?void 0:e.selectedScrollSnap())&&void 0!==t?t:0,a=null!==(n=null==e?void 0:e.previousScrollSnap())&&void 0!==n?n:0;i!==g&&(i>a?w({type:sd.NEXT_IN_PROGRESSION}):i<a&&w({type:sd.PREV_IN_PROGRESSION}))}return null!=g&&(null==C||C.on("select",e),null==C||C.scrollTo(g)),()=>{null==C||C.off("select",e)}}),[C,g,w]);const _={overflow:"hidden"},L={backfaceVisibility:"hidden",display:"flex",touchAction:"pan-y",gap:N,alignItems:"stretch"},R=e=>{var t;return null!==(t=null==v?void 0:v.includes(e))&&void 0!==t&&t},D=t.peekThroughSize[Math.min(I,t.peekThroughSize.length-1)],k=D?"Fixed"===(P=D).type?`${P.value}px`:`${P.value}%`:"0px";var P;const $=null!==(y=t.viewableItems[Math.min(E,I)])&&void 0!==y?y:1,j={flex:`0 0 calc(${(e=>"0px"!==e&&"0%"!==e)(k)?`(100% - 2 * ${k} - (${$} + 1) * ${N})/${$}`:`(100% - (${$} - 1) * ${N})/${$}`})`,position:"relative",display:"flex",overflow:"auto"};return(null==b?void 0:b.length)>0?e(Ro,{styles:t.styles,children:({classnames:t})=>e("div",{ref:S,style:Object.assign(Object.assign({},_),x),"aria-disabled":A,tabIndex:T,className:null==t?void 0:t.own,"data-e2e":"CarouselDistribution","data-testid":n&&`${n}`,children:e("div",{style:L,"data-testid":n&&`${n}-container`,"data-e2e":"CarouselDistribution-Container",children:a.Children.toArray(b.map(((t,i)=>e("div",{style:j,"data-testid":n&&`${n}-slide-${i}`,"data-e2e":`CarouselDistribution-Slide-${i}`,children:e(bd,{config:t,position:i,container:"row",visible:R(i)})}))))})})}):null}const Ad=Object.freeze([]);function xd({schema:t,testId:n}){const i=Ha(),o=d((()=>mi(i)([{display:"flex",flexDirection:"column"}])),[i]),s=m((e=>{var t;return(null===(t=e.progression)||void 0===t?void 0:t.groupSize)||0})),l=m((e=>{var t;return(null===(t=e.progression)||void 0===t?void 0:t.indexGroups)||Ad})),c=m((e=>e.slots||Ad)),u=d((()=>l.map((e=>e.map((e=>c[e])).filter((e=>null!=e))))),[l,c]),p=r(null),y=m((e=>{var t,n;return null!==(n=null===(t=e.progression)||void 0===t?void 0:t.currentGroupIndex)&&void 0!==n?n:0})),f=Ra(),{tabIndex:h,isDisabled:v,styles:g}=It(f);return u.length?e(Ro,{styles:t.styles,children:({classnames:i})=>e("div",{ref:p,"data-testid":n,"data-e2e":"GroupedDistribution","aria-disabled":v,tabIndex:h,style:Object.assign({position:"relative",transition:`height ${t.transition.settings.duration/2}ms ease-in-out`,overflow:"hidden",boxSizing:"content-box"},g),children:a.Children.toArray(u.map(((r,l)=>e(Gr,{effect:t.transition,visible:l===y,parentElement:p.current,containerClassName:[o,null==i?void 0:i.own].filter(Boolean).join(" ")||void 0,children:a.Children.toArray(r.map(((t,i)=>{const a=s*l+i;return e(bd,{config:t,position:a,visible:l===y,container:"column",testId:n?`${n}-child${a}`:void 0})})))}))))})}):null}const Nd={action:{CaptureOnly:"CaptureOnly",Url:"Url",Fulfillment:"Fulfillment",ExternalPaymentTrigger:"ExternalPaymentTrigger"},urlBehavior:{newTab:"newTab",roktWebViewSDK:"roktWebViewSDK",self:"self"},signalType:{SignalResponse:"SignalResponse",SignalGatedResponse:"SignalGatedResponse",SignalSecondaryResponse:"SignalSecondaryResponse"},conversionType:{Default:"Default",RealTime:"RealTime",RealTimeReferral:"RealTimeReferral"}};function _d(e,t,n=!1){return Error(`Could not translate ${e} with guid: ${t}${n?" for child layout":""}`)}function Ld(e,t=!1){var n;try{if(e.responseOptionsMap||t)return Object.assign(Object.assign({},e),{responseOptionsMap:V(Rd,null!==(n=e.responseOptionsMap)&&void 0!==n?n:{})});{const t=`Creative: ${e.instanceGuid}, did not receive a valid response options map.`;throw new Pt("NO_CREATIVE_RESPONSE_OPTIONS_MAP",t)}}catch(n){throw n.message?n:_d("Creative",e.instanceGuid,t)}}function Rd(e){try{let t,n;if(e.urlBehavior&&(t=Nd.urlBehavior[e.urlBehavior]),e.conversionType&&(n=Nd.conversionType[e.conversionType]),"External"===e.action){const t=`Creative response with instanceGuid '${e.instanceGuid}' uses legacy action type 'External'. This should be 'ExternalPaymentTrigger'.`;throw new Pt("LEGACY_EXTERNAL_ACTION_TYPE",t)}return Object.assign(Object.assign({},e),{urlBehavior:t,action:Nd.action[e.action],signalType:Nd.signalType[e.signalType],conversionType:n})}catch(t){throw t.message?t:_d("CreativeResponse",e.instanceGuid)}}function Dd(e,t,n){try{return JSON.parse(e)}catch(e){throw Error(`Parse JSON failed, invalid JSON file for ${t} with guid ${n}.`)}}function kd(){o((()=>{const e=new ResizeObserver(function(e=100){let t;return()=>{t&&clearTimeout(t),t=setTimeout((()=>{var e,n;null===(n=null===(e=window.frameElement)||void 0===e?void 0:e.iFrameResizer)||void 0===n||n.resize(),t=void 0}),e)}}());return e.observe(document.body),()=>{e.disconnect()}}),[])}const Pd={OneByOneDistribution:function(t){if("OneByOneDistribution"===t.type)return e(Id,{schema:t.node})},StackedDistribution:function(t){if("StackedDistribution"===t.type)return e(wd,{schema:t.node})},ProgressIndicator:function(t){if("ProgressIndicator"===t.type)return e(Ed,{schema:t.node})},ProgressControl:function(t){if("ProgressControl"===t.type)return e(Od,{schema:t.node})},Overlay:function(t){if("Overlay"===t.type)return e(hs,{schema:t.node})},CloseButton:function(t){if("CloseButton"===t.type)return e(ds,{schema:t.node})},EscapeHatch:($d=[function(t,n){if(Et("CloseButton",t)){const n=JSON.parse(t.node.data);return e(ds,{schema:n.node,action:n.action})}},br],e=>$d.reduce(((t,n)=>void 0===t?n(e):t),void 0)),CarouselDistribution:function(t){if("CarouselDistribution"===t.type)return e(Td,{schema:t.node})},GroupedDistribution:function(t){if("GroupedDistribution"===t.type)return e(xd,{schema:t.node})},BottomSheet:function(t){if("BottomSheet"===t.type)return e(Is,{schema:t.node})}};var $d;function jd(e,t){e({type:tn,payload:{name:"SignalActivation",parentGuid:t}})}function Gd({pageInstanceGuid:t}){var n,i,a,r,s,l;const c=m((e=>e.layout),$),d=f(),u=m((e=>({breakpoint:e.breakpoint,progression:hd(e),customStates:e.customStates.root,domainStates:e.domainStates[ud]})),$),p=m((e=>e.slots.length)),y=m((e=>{var t;const n=Number(null!==(t=e.serializableCache.get(Cd))&&void 0!==t?t:"");return p-n})),h=m(gd);mn(Ni(),d),o((()=>(c&&document.body.addEventListener("click",jd.bind(null,d,c.instanceGuid),{once:!0}),()=>{c&&document.body.removeEventListener("click",jd.bind(null,d,c.instanceGuid))})),[null==c?void 0:c.instanceGuid]),kd(),o((()=>{if(c){const e={type:tn,payload:{name:"SignalImpression",parentGuid:c.instanceGuid}},t={type:as,payload:{code:"LAYOUT_IMPRESSED"}};d(e),d(t)}}),[c]);const v=e=>{d({type:ld.REPORT_ERROR,payload:e})},g=m((e=>e.breakpoint.initialised));if(c&&g){const o=Ji({})({state:{progression:(null!==(i=null===(n=u.progression)||void 0===n?void 0:n.activeGroupIndex)&&void 0!==i?i:0)+1,maxProgression:null!==(r=null===(a=u.progression)||void 0===a?void 0:a.totalGroups)&&void 0!==r?r:1,availableOffersCount:null!==(l=null===(s=u.progression)||void 0===s?void 0:s.totalGroups)&&void 0!==l?l:p,selectedCatalogItemQuantity:h,hiddenItemCount:y}}),f=_r(v);return e(Ma,{info:{layoutType:"OuterLayout",pageInstanceGuid:t},children:e(Qi,{value:o,children:e(Ai,{value:f,overrides:Pd,children:e(Si.Provider,{value:u,children:e(Ii.Provider,{value:d,children:e(na.Provider,{value:"OUTER",children:e(Wa.Provider,{value:c.layoutSchemaVersion,children:e(Oi,{children:e=>e(c.layoutSchema)})})})})})})})})}return null}var Fd=Object.freeze({__proto__:null,getDistribution:function e(t){var n;switch(t.type){case"OneByOneDistribution":case"StackedDistribution":case"CarouselDistribution":case"GroupedDistribution":return t;case"Row":case"Column":case"When":case"ZStack":case"FlowRow":case"InlineContainer":case"ScrollableRow":case"ScrollableColumn":case"BottomSheet":case"Overlay":for(const n of t.node.children){const t=e(n);if(t)return t}break;case"EscapeHatch":try{const{name:i,body:a}=JSON.parse(t.node.data);if(("loading-extension"===i||"minimized-bottomsheet-extension"===i)&&(null===(n=null==a?void 0:a.children)||void 0===n?void 0:n.length))for(const t of a.children){const n=e(t);if(n)return n}break}catch(e){break}case"StaticImage":case"DataImage":case"RichText":case"BasicText":case"ProgressIndicator":case"CreativeResponse":case"StaticLink":case"CloseButton":case"ProgressControl":case"StaticIcon":case"DataIcon":case"SlideStateTrigger":case"ToggleButtonStateTrigger":case"TimerStateTrigger":case"CatalogStackedCollection":case"CatalogResponseButton":case"CatalogQuantityOption":case"CatalogRadioGroup":case"CatalogQuantityCounter":case"PartnerEventButtonTrigger":case"CopyToClipboardButton":case"ButtonStateTrigger":case"CatalogCombinedCollection":break;default:!function(e){throw Error(`Could not handle layout: ${JSON.stringify(e)}`)}(t)}},getDistributionViewableItems:function(e){switch(null==e?void 0:e.type){case"CarouselDistribution":case"GroupedDistribution":return e.node.viewableItems;default:return}}}),Md=Object.assign({},Fd);function*Bd(e,t){const n=Md.getDistribution(t),i=null==n?void 0:n.type,a=yield Ke(il),o=function(e=0,t){var n;switch(null==t?void 0:t.type){case"CarouselDistribution":case"GroupedDistribution":{const i=Math.min(t.node.viewableItems.length,e);return null!==(n=t.node.viewableItems[i])&&void 0!==n?n:1}default:return 1}}("number"==typeof a?a:0,n);"OneByOneDistribution"!==i&&"CarouselDistribution"!==i&&"GroupedDistribution"!==i||(yield yt({type:sd.INITIALISE_PROGRESSION,payload:{currentGroupIndex:0,totalCount:e,groupSize:o}}))}function*Ud(e,t){const{instanceGuid:n,layoutSchemaVersion:i,outerLayoutSchema:a,slots:o}=t.payload;n?yield yt({type:tn,payload:{name:"SignalLoadComplete",parentGuid:n}}):yield yt({type:is,payload:{level:Os,code:Fs,message:"Layout instance guid does not exist"}}),yield yt({type:Kc,payload:{modules:o.map((e=>e.layoutVariant.moduleName))}}),yield yt({type:zr,payload:a.breakpoints}),yield yt({type:sd.LAYOUT_UPDATE,payload:{instanceGuid:n,layoutSchemaVersion:i,layoutSchema:a.layout,settings:a.settings}}),yield yt({type:sd.SET_SLOTS,payload:o}),ce(a.settings)||(yield yt({type:sd.SET_SETTINGS,payload:a.settings})),yield*Bd(o.length,a.layout);const r=yield*function*(e,t,n){const i=null==t?void 0:t.enablePartnerValidation,a=["add-to-cart"],o=n.some((e=>a.some((t=>t===e.layoutVariant.moduleName))));if(i&&o)try{yield pt(e.send,ml.PartnerValidationEvent.OPT_IN_TO_PARTNER_VALIDATION),yield dt(Vd,e,ml.PartnerValidationEvent.SHOW_PARTNER_VALIDATION_STATUS,(()=>({type:"ACTIVE/ADD",payload:{id:Sd}})))}catch(e){return yield yt({type:is,payload:{level:ws,code:Bs,message:"Failed to establish partner validation."}}),"FAILURE"}return"OK"}(e.partner,a.settings,o);"OK"===r&&(yield pt(Pl,e.display,a.display))}function*Vd(e,t,n){const i=st((i=>{const a=e.onEvent(t).subscribe((e=>{i(n(e))}));return()=>{a.unsubscribe()}}));for(;;){const e=yield ft(i);yield yt(e)}}function zd(e){return Lu(e)}function Hd(e,t){return Error(`Migration process from v0_0 to v0_1 failed: could not transform ${e} node. For more details: ${t}`)}const Wd=ae(te([function(e){return"Row"===e.type&&Yd(e.node.children)},function(e){return"Column"===e.type&&Yd(e.node.children)},eu,tu])),qd=ae(te([function(e){return"Row"===e.type&&Zd(e.node.children)},function(e){return"Column"===e.type&&Zd(e.node.children)},tu,eu,function(e){return"DataImage"===e.type},function(e){return"When"===e.type&&Zd(e.node.children)}])),Jd=ae(te([function(e){return"Row"===e.type&&Qd(e.node.children)},function(e){return"Column"===e.type&&Qd(e.node.children)},tu,eu])),Kd=ae(te([function(e){return"Row"===e.type&&Xd(e.node.children)},function(e){return"Column"===e.type&&Xd(e.node.children)},eu,function(e){return"RichText"===e.type},tu,function(e){return"ProgressIndicator"===e.type},function(e){return"OneByOneDistribution"===e.type},function(e){return"When"===e.type&&Xd(e.node.children)},function(e){return"StaticLink"===e.type&&Xd(e.node.children)},function(e){return"StackedDistribution"===e.type},function(e){return"CloseButton"===e.type&&Xd(e.node.children)}]));function Yd(e){return Wd(e)}function Zd(e){return qd(e)}function Qd(e){return Jd(e)}function Xd(e){return Kd(e)}function eu(e){return"StaticImage"===e.type}function tu(e){return"BasicText"===e.type}const nu=ue(["styles","elements","link"]),iu=ue(["styles","elements","activeIndicator"]),au=ue(["styles","elements","indicator"]),ou=ue(["styles","elements","seenIndicator"]),ru=ue(["focussed"]),su=ue(["hovered"]),lu=ue(["default"]),cu=ue(["pressed"]),du=e=>{var t;return{text:null!==(t=null==e?void 0:e.text)&&void 0!==t?t:{}}},uu=I(S(["styles","elements","link"]),J(de(nu,re((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default})))),de(nu,re(I(De("focussed"),de(ru,du)))),de(nu,re(I(De("hovered"),de(su,du)))),de(nu,re(I(De("default"),de(lu,du)))),de(nu,re(I(De("pressed"),de(cu,du)))))),pu=J(I(S(["styles","elements","activeIndicator"]),de(iu,re((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))),I(S(["styles","elements","indicator"]),de(au,re((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))),I(S(["styles","elements","seenIndicator"]),de(ou,re((e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}))))));function yu(e,t){return e?{elements:{own:e.elements.own.map(t)}}:void 0}const fu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),mu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),hu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),vu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default}),gu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),bu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),Iu=e=>({focussed:e.focused,hovered:e.hovered,pressed:e.pressed,default:e.default,disabled:e.disabled}),Eu=e=>{switch(e){case"is":return"is";case"is not":return"is-not";case"is below":return"is-below";case"is above":return"is-above";default:throw Hd("When",`Invalid condition: ${e}`)}},Su=e=>{switch(e){case"breakpoint":return"Breakpoint";case"progression":return"Progression";case"position":return"Position";default:throw Hd("When",`Invalid target: ${e}`)}},Cu=e=>{const{target:t,condition:n,value:i}=e;return{type:Su(t),predicate:{condition:Eu(n),value:i}}};function wu(e){return{predicates:e.predicates.map(Cu),children:e.children.map((e=>Lu(e)))}}function Ou(e){const t={type:"FadeInOut",settings:{duration:e.transition.settings.duration}};return{styles:e.style,transition:t}}function Tu(e){const t=e.children.map((e=>Lu(e)));if(Yd(t))return Object.assign(Object.assign({},e),{children:t,styles:yu(e.styles,gu)});throw Hd("CloseButton",`Invalid schema: ${JSON.stringify(e)}`)}function Au(e){const t=e.children.map((e=>Lu(e)));if(Zd(t))return Object.assign(Object.assign({},e),{children:t,styles:yu(e.styles,bu)});throw Hd("CreativeResponse",`Invalid schema: ${JSON.stringify(e)}`)}function xu(e){const t=e.children.map((e=>Lu(e)));if(Qd(t))return Object.assign(Object.assign({},e),{children:t,styles:yu(e.styles,Iu)});throw Hd("StaticLink",`Invalid schema: ${JSON.stringify(e)}`)}const Nu=e=>({own:e.overlayContainer,wrapper:e.overlayWrapper});function _u(e){var t,n;const i=(null===(t=e.styles)||void 0===t?void 0:t.elements)?{elements:Nu(null===(n=e.styles)||void 0===n?void 0:n.elements)}:void 0,a=e.children.map((e=>Lu(e)));if(Xd(a))return Object.assign(Object.assign({},e),{styles:i,children:a});throw Hd("Overlay",`Invalid schema: ${JSON.stringify(e)}`)}function Lu(e){switch(e.type){case"When":return{type:"When",node:wu(e.node)};case"OneByOneDistribution":return{type:e.type,node:Ou(e.node)};case"Overlay":return{type:e.type,node:_u(e.node)};case"Column":return{type:e.type,node:(r=e.node,{styles:yu(r.styles,fu),children:r.children.map((e=>Lu(e)))})};case"Row":return{type:e.type,node:(o=e.node,{styles:yu(o.styles,mu),children:o.children.map((e=>Lu(e)))})};case"RichText":return{type:e.type,node:(a=e.node,uu(a))};case"CloseButton":return{type:e.type,node:Tu(e.node)};case"CreativeResponse":return{type:e.type,node:Au(e.node)};case"StaticLink":return{type:e.type,node:xu(e.node)};case"StaticImage":return{type:e.type,node:(i=e.node,Object.assign(Object.assign({},i),{styles:yu(i.styles,hu)}))};case"DataImage":return{type:e.type,node:(n=e.node,Object.assign(Object.assign({},n),{styles:yu(n.styles,vu)}))};case"ProgressIndicator":return{type:e.type,node:(t=e.node,pu(t))};default:return e}var t,n,i,a,o,r}function Ru(e){return Gp(e)}function Du(e,t){return Error(`Migration process from v0_23 to v1_0 failed: could not transform ${e} node. For more details: ${t}`)}const ku=e=>"scroll"===e||"auto"===e?"visible":e,Pu=ue(["elements","own"]),$u=ue(["transitions","transition","value","own"]),ju=ue(["elements","wrapper"]),Gu=ue(["transitions","transition","value","wrapper"]),Fu=ue(["elements","indicator"]),Mu=ue(["transitions","transition","value","indicator"]),Bu=ue(["elements","activeIndicator"]),Uu=ue(["transitions","transition","value","activeIndicator"]),Vu=ue(["elements","seenIndicator"]),zu=ue(["transitions","transition","value","seenIndicator"]),Hu=ue(["default","container","overflow"]),Wu=ue(["pressed","container","overflow"]),qu=ue(["hovered","container","overflow"]),Ju=ue(["focussed","container","overflow"]),Ku=ue(["disabled","container","overflow"]),Yu=ue(["container","overflow"]),Zu=J(I(S(["default","container","overflow"]),de(Hu,ku)),I(S(["pressed","container","overflow"]),de(Wu,ku)),I(S(["hovered","container","overflow"]),de(qu,ku)),I(S(["focussed","container","overflow"]),de(Ju,ku)),I(S(["disabled","container","overflow"]),de(Ku,ku))),Qu=I(S(["container","overflow"]),de(Yu,ku)),Xu=J(I(S(["elements","own"]),de(Pu,re(Zu))),I(S(["transitions","transition","value","own"]),de($u,Qu))),ep=I(De("transitions"),(e=>{var t;return G(ke(["transitions"]),Pe("conditionalTransitions",null===(t=e.transitions)||void 0===t?void 0:t.transition))(e)})),tp=J(Xu,ep),np=J(I(S(["elements","wrapper"]),de(ju,re(Zu))),I(S(["transitions","transition","value","wrapper"]),de(Gu,Qu))),ip=J(I(S(["elements","indicator"]),de(Fu,re(Zu))),I(S(["transitions","transition","value","indicator"]),de(Mu,Qu))),ap=J(I(S(["elements","activeIndicator"]),de(Bu,re(Zu))),I(S(["transitions","transition","value","activeIndicator"]),de(Uu,Qu))),op=J(I(S(["elements","seenIndicator"]),de(Vu,re(Zu))),I(S(["transitions","transition","value","seenIndicator"]),de(zu,Qu)));function rp(e){return"StaticImage"===e.type}function sp(e){return"StaticIcon"===e.type}function lp(e){return"BasicText"===e.type}function cp(e){return"DataImage"===e.type}function dp(e){return"DataIcon"===e.type}function up(e){return"RichText"===e.type}function pp(e){return"SlideStateTrigger"===e.type}function yp(e){return"ToggleButtonStateTrigger"===e.type}const fp=ae(te([function(e){return"Row"===e.type&&mp(e.node.children)},function(e){return"Column"===e.type&&mp(e.node.children)},rp,sp,up,lp,function(e){return"ProgressIndicator"===e.type},function(e){return"OneByOneDistribution"===e.type},function(e){return"When"===e.type&&mp(e.node.children)},function(e){return"StaticLink"===e.type&&mp(e.node.children)},function(e){return"StackedDistribution"===e.type},function(e){return"CarouselDistribution"===e.type},function(e){return"GroupedDistribution"===e.type},function(e){return"CloseButton"===e.type&&mp(e.node.children)},function(e){return"ProgressControl"===e.type&&Op(e.node.children)},function(e){return"ZStack"===e.type&&mp(e.node.children)},function(e){return"FlowRow"===e.type&&mp(e.node.children)},pp,yp]));function mp(e){return fp(e)}const hp=J(Xu,np,ep);function vp(e){const t=e.children.map((e=>Gp(e)));if(mp(t))return Object.assign(Object.assign({},ke(["settings"],e)),{children:t,allowBackdropToClose:e.settings.allowBackdropToClose,styles:e.styles?hp(e.styles):void 0});throw Du("Overlay",`Invalid schema: ${JSON.stringify(e)}`)}function gp(e){const t=e.children.map((e=>Gp(e)));if(Op(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?tp(e.styles):void 0});throw Du("CloseButton",`Invalid schema: ${JSON.stringify(e)}`)}function bp(e){const t=e.children.map((e=>Gp(e)));if(Ap(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?tp(e.styles):void 0});throw Du("CreativeResponse",`Invalid schema: ${JSON.stringify(e)}`)}function Ip(e){const t=e.children.map((e=>Gp(e)));if(Op(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?tp(e.styles):void 0});throw Du("ProgressControl",`Invalid schema: ${JSON.stringify(e)}`)}const Ep=J(Xu,ip,ap,op,ep);const Sp=ae(te([lp,rp,sp,cp,dp,function(e){return"Row"===e.type&&Cp(e.node.children)},function(e){return"FlowRow"===e.type&&Cp(e.node.children)},function(e){return"Column"===e.type&&Cp(e.node.children)},function(e){return"ZStack"===e.type&&Cp(e.node.children)},function(e){return"When"===e.type&&Cp(e.node.children)}]));function Cp(e){return Sp(e)}const wp=ae(te([lp,rp,sp,function(e){return"Row"===e.type&&Op(e.node.children)},function(e){return"FlowRow"===e.type&&Op(e.node.children)},function(e){return"Column"===e.type&&Op(e.node.children)},function(e){return"ZStack"===e.type&&Op(e.node.children)},function(e){return"When"===e.type&&Op(e.node.children)}]));function Op(e){return wp(e)}const Tp=ae(te([lp,rp,sp,cp,dp,function(e){return"Row"===e.type&&Ap(e.node.children)},function(e){return"FlowRow"===e.type&&Ap(e.node.children)},function(e){return"Column"===e.type&&Ap(e.node.children)},function(e){return"ZStack"===e.type&&Ap(e.node.children)},function(e){return"When"===e.type&&Ap(e.node.children)}]));function Ap(e){return Tp(e)}function xp(e){const t=e.children.map((e=>Gp(e)));if(Cp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?tp(e.styles):void 0});throw Du("StaticLink",`Invalid schema: ${JSON.stringify(e)}`)}function Np(e){const t=e.children.map((e=>Gp(e)));if(Ap(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?tp(e.styles):void 0});throw Du("CatalogResponseButton",`Invalid schema: ${JSON.stringify(e)}`)}function _p(e){return"Row"===e.type&&Dp(e.node.children)}function Lp(e){return"Column"===e.type&&Dp(e.node.children)}const Rp=ae(te([lp,rp,sp,cp,dp,up,function(e){return"StaticLink"===e.type},pp,yp,function(e){return"CatalogResponseButton"===e.type},_p,function(e){return"FlowRow"===e.type&&Dp(e.node.children)},Lp,function(e){return"ZStack"===e.type&&Dp(e.node.children)},function(e){return"When"===e.type&&Dp(e.node.children)}]));function Dp(e){return Rp(e)}const kp=te([_p,Lp]);function Pp(e){const t=Gp(e.template);if(function(e){return kp(e)}(t))return Object.assign(Object.assign({},e),{template:t,styles:e.styles?tp(e.styles):void 0});throw Du("CatalogStackedCollection",`Invalid schema: ${JSON.stringify(e)}`)}function $p(e){const t=e.children.map((e=>Gp(e)));if(Cp(t))return Object.assign(Object.assign({},e),{children:t,styles:e.styles?tp(e.styles):void 0});throw Du("ToggleButtonStateTrigger",`Invalid schema: ${JSON.stringify(e)}`)}function jp(e){const t=e.transition?{inTransition:e.transition.in,outTransition:e.transition.out}:void 0;return Object.assign(Object.assign({},e),{children:e.children.map((e=>Gp(e))),transition:t})}function Gp(e){switch(e.type){case"Row":return{type:e.type,node:(v=e.node,Object.assign(Object.assign({},v),{children:v.children.map((e=>Gp(e))),styles:v.styles?tp(v.styles):void 0}))};case"When":return{type:e.type,node:jp(e.node)};case"FlowRow":return{type:e.type,node:(h=e.node,Object.assign(Object.assign({},h),{styles:h.styles?tp(h.styles):void 0,children:h.children.map((e=>Gp(e)))}))};case"Column":return{type:e.type,node:(m=e.node,Object.assign(Object.assign({},m),{children:m.children.map((e=>Gp(e))),styles:m.styles?tp(m.styles):void 0}))};case"ZStack":return{type:e.type,node:(f=e.node,Object.assign(Object.assign({},f),{styles:f.styles?tp(f.styles):void 0,children:f.children.map((e=>Gp(e)))}))};case"Overlay":return{type:e.type,node:vp(e.node)};case"ProgressControl":return{type:e.type,node:Ip(e.node)};case"CarouselDistribution":return{type:"CarouselDistribution",node:(y=e.node,Object.assign(Object.assign({},ke(["settings"],y)),{viewableItems:y.settings.viewableItems,peekThroughSize:y.settings.peekThroughSize,styles:y.styles?tp(y.styles):void 0}))};case"CloseButton":return{type:"CloseButton",node:gp(e.node)};case"CreativeResponse":return{type:"CreativeResponse",node:bp(e.node)};case"GroupedDistribution":return{type:"GroupedDistribution",node:(p=e.node,Object.assign(Object.assign({},ke(["settings"],p)),{viewableItems:p.settings.viewableItems,transition:p.settings.transition,styles:p.styles?tp(p.styles):void 0}))};case"OneByOneDistribution":return{type:"OneByOneDistribution",node:(u=e.node,Object.assign(Object.assign({},u),{styles:u.styles?tp(u.styles):void 0}))};case"ProgressIndicator":return{type:"ProgressIndicator",node:(c=e.node,Object.assign(Object.assign({},ke(["settings"],c)),{startPosition:null===(d=c.settings)||void 0===d?void 0:d.startPosition,styles:c.styles?Ep(c.styles):void 0}))};case"SlideStateTrigger":return{type:"SlideStateTrigger",node:(l=e.node,Object.assign(Object.assign({},l),{styles:l.styles?tp(l.styles):void 0}))};case"StackedDistribution":return{type:"StackedDistribution",node:(s=e.node,Object.assign(Object.assign({viewableItems:[]},s),{styles:s.styles?tp(s.styles):void 0}))};case"StaticLink":return{type:"StaticLink",node:xp(e.node)};case"ToggleButtonStateTrigger":return{type:"ToggleButtonStateTrigger",node:$p(e.node)};case"CatalogResponseButton":return{type:"CatalogResponseButton",node:Np(e.node)};case"CatalogStackedCollection":return{type:"CatalogStackedCollection",node:Pp(e.node)};case"RichText":return{type:"RichText",node:(r=e.node,Object.assign(Object.assign({},r),{styles:r.styles?ep(r.styles):void 0}))};case"DataImage":return{type:"DataImage",node:(o=e.node,Object.assign(Object.assign({},o),{styles:o.styles?ep(o.styles):void 0}))};case"StaticImage":return{type:"StaticImage",node:(a=e.node,Object.assign(Object.assign({},a),{styles:a.styles?ep(a.styles):void 0}))};case"DataIcon":return{type:"DataIcon",node:(i=e.node,Object.assign(Object.assign({},i),{styles:i.styles?ep(i.styles):void 0}))};case"StaticIcon":return{type:"StaticIcon",node:(n=e.node,Object.assign(Object.assign({},n),{styles:n.styles?ep(n.styles):void 0}))};case"BasicText":return{type:"BasicText",node:(t=e.node,Object.assign(Object.assign({},t),{styles:t.styles?ep(t.styles):void 0}))};default:return e}var t,n,i,a,o,r,s,l,c,d,u,p,y,f,m,h,v}function Fp(e){const t=e.split("."),n=Number(t[0]),i=Number(t[1]);if(t.length<2||Number.isNaN(n)||Number.isNaN(i))throw Error(`Fail to convert version ${e} to a valid version.`);return{major:n,minor:i}}function Mp(e,t){return e.major===t.major&&e.minor===t.minor}const Bp=(e,t,n)=>E([Ee(e),$e(t)])(n);function Up(e,t){return Mp(t,{major:0,minor:0})?Up(zd(e),{major:0,minor:1}):function(e,t){return 0===t.major&&Bp(1,23,t.minor)}(0,t)?Up(Ru(e),{major:1,minor:0}):e}function Vp(e,t){return Mp(t,{major:0,minor:0})?Vp(function(e){return Object.assign(Object.assign({},e),{layout:zd(e.layout)})}(e),{major:0,minor:1}):function(e,t){return 0===t.major&&Bp(1,23,t.minor)}(0,t)?Vp(function(e){return Object.assign(Object.assign({},e),{layout:Ru(e.layout)})}(e),{major:1,minor:0}):e}function zp(e,t,n,i){const a=Fp(n);if(i){const s=Fp(i);if(r=a,(o=s).major<r.major||o.major===r.major&&o.minor<r.minor||Mp(s,a))return t(e,s);throw Error(`Could not migrate received layout config, config schema version ${i} is higher than the supported version ${n}.`)}return t(e,Fp("0.0"));var o,r}function Hp(e){var t;try{return Object.assign(Object.assign({},je(e)),{offer:Object.assign(Object.assign({},je(e.offer)),{creative:Ld(e.offer.creative)}),layoutVariant:Object.assign(Object.assign({},je(e.layoutVariant)),{layoutVariantSchema:"string"==typeof e.layoutVariant.layoutVariantSchema?Dd(e.layoutVariant.layoutVariantSchema,"LayoutSlotLayoutVariant",e.instanceGuid):e.layoutVariant.layoutVariantSchema,childLayouts:re(Wp,null!==(t=e.layoutVariant.childLayouts)&&void 0!==t?t:[])})})}catch(t){throw t.message?t:_d("Slot",e.instanceGuid)}}function Wp(e){return Object.assign(Object.assign({},je(e)),{childLayoutSchema:"string"==typeof e.childLayoutSchema?Dd(e.childLayoutSchema,"ChildLayoutRootSchema",e.childLayoutId):e.childLayoutSchema})}function qp(e){if(e){const t=function(e){try{return Object.assign(Object.assign({},je(e)),{outerLayoutSchema:"string"==typeof e.outerLayoutSchema?Dd(e.outerLayoutSchema,"LayoutRootLayoutSchema",e.instanceGuid):e.outerLayoutSchema,slots:re(Hp,e.slots)})}catch(t){throw t.message?t:_d("LayoutConfig",e.instanceGuid)}}(e);return function(e,t){const{layoutSchemaVersion:n}=e,i=ue(["outerLayoutSchema"]),a=ue(["slots"]),o=ue(["layoutVariant","layoutVariantSchema"]);return J(de(a,re(de(o,(e=>zp(e,Up,t,n))))),de(i,(e=>zp(e,Vp,t,n))))(e)}(t,xs.DCUI_SCHEMA_VERSION)}}const Jp=O([[z({signalType:$("SignalSecondaryResponse")}),function*(e,t){return yield qe({type:is,payload:{level:Ts,code:js,message:"DCUI does not support SignalSecondaryResponse creative response signal type.",additionalInformation:{instanceGuid:e.instanceGuid}}}),e.isPositive?"ERROR":"EXPLICIT_DISMISSAL"}],[z({isPositive:$(!0)}),function*(e,t,n){var i;if("url"in e&&e.url){const a=e.instanceGuid;yield qe({type:tn,payload:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:a,responseActionPayload:{name:"Url",transformedTrafficURL:e.url,creativeInstanceGuid:e.creativeInstanceGuid}}});const o=t.getOverrideLinkNavigation()?"overrideLinkNavigation":null!==(i=e.urlBehavior)&&void 0!==i?i:"newTab",r=yield*function*(e,t,n){try{const i=yield ze(El,t),a=Ol(i)?i.ref:void 0;return yield ze(e.addAdvertiserWindowRef,a,n),Ol(i)||"newTab"!==t.urlBehavior?"SUCCESS":(yield qe({type:is,payload:{level:Ts,code:Gs,message:`Did not receive a window reference opening link ${t.url}`}}),"UNSPECIFIED")}catch(e){return yield qe({type:is,payload:{level:Ts,code:Gs,message:`Errored attempting to open link ${t.url}: ${e.message}`,stack:e.stack}}),"ERROR"}}(t,{url:e.url,urlBehavior:o,external:{partner:n}},a);return"self"===o?"END":r}return yield qe({type:is,payload:{level:Ts,code:js,message:"URL response doesn't have a valid url",additionalInformation:{instanceGuid:e.instanceGuid}}}),"ERROR"}],[A,function*(){return"EXPLICIT_DISMISSAL"}]]);function*Kp(e){return yield qe({type:is,payload:{level:Ts,code:js,message:"DCUI does not support SignalSecondaryResponse creative response signal type.",additionalInformation:{instanceGuid:e.instanceGuid}}}),e.isPositive?"ERROR":"EXPLICIT_DISMISSAL"}function*Yp(e,t){let n="IMPLICIT_DISMISSAL";const i=t.payload.offerPositionIndex,a=Zt(t.payload)||Qt(t.payload)||Yt(t.payload)?t.payload:t.payload.responseOption;switch(a.action){case"Url":yield qe({type:on,payload:{name:"OFFER_ENGAGEMENT"}}),a.isPositive&&(yield qe({type:as,payload:{code:"CREATIVE_RESPONSE",message:"creative positive response",data:{type:a.action,isPositive:a.isPositive,responseInstanceGuid:a.instanceGuid}}}),yield qe({type:on,payload:{name:"POSITIVE_ENGAGEMENT"}})),n="SignalSecondaryResponse"===a.signalType?yield*Kp(a):yield*Jp(a,e.context,e.partner);break;case"CaptureOnly":yield qe({type:on,payload:{name:"OFFER_ENGAGEMENT"}}),a.isPositive&&(yield qe({type:on,payload:{name:"POSITIVE_ENGAGEMENT"}})),n="SignalSecondaryResponse"===a.signalType?yield*Kp(a):yield*function*(e){return yield qe({type:tn,payload:{name:"SignalGatedResponse"===e.signalType?"SignalGatedResponse":"SignalResponse",parentGuid:e.instanceGuid,responseActionPayload:{name:"CaptureOnly",creativeInstanceGuid:e.creativeInstanceGuid}}}),e.isPositive?"SUCCESS":"EXPLICIT_DISMISSAL"}(a);break;case"Fulfillment":yield qe({type:is,payload:{level:Ts,code:"INCORRECTLY_HANDLE_FULFILLMENT_ACTION",message:`Fulfillment action is incorrectly handled by the orchestrator instead of a module with the option ID: ${a.instanceGuid}`}}),n="ERROR";break;case"ExternalPaymentTrigger":yield qe({type:is,payload:{level:Ts,code:"INCORRECTLY_HANDLE_EXTERNAL_ACTION",message:`External action was dispatched as an engagement erroneously. Instance GUID: ${a.instanceGuid}`}}),n="ERROR"}Xt(t.payload)||(yield qe(function(e,t){switch(e){case"SUCCESS":return{type:id,payload:{event:"Completed",completionReason:"Success",offerPositionIndex:t}};case"UNSPECIFIED":return{type:id,payload:{event:"Completed",completionReason:"Unspecified",offerPositionIndex:t}};case"ERROR":return{type:id,payload:{event:"Completed",completionReason:"Error",offerPositionIndex:t}};case"EXPLICIT_DISMISSAL":return{type:id,payload:{event:"Dismissed",dismissalReason:"Explicit",offerPositionIndex:t}};case"IMPLICIT_DISMISSAL":return{type:id,payload:{event:"Dismissed",dismissalReason:"Implicit",offerPositionIndex:t}};default:return{type:ed,payload:{offerProcessStatus:"END"}}}}(n,i)))}function Zp(e,t,n,i){return st((a=>(i().then((e=>Promise.all([t.getRoktPageInstanceGuid(),(t.getUId||t.getPluginInstanceId)()]).then((([t,n])=>Object.assign(Object.assign({},e),{pageInstanceGuid:t,pluginInstanceId:n}))).catch((()=>e)))).then((({moduleConnectorBuilder:t,pageInstanceGuid:i,pluginInstanceId:o})=>{const r=`rokt-${n}-${o}`.toLowerCase();if(!customElements.get(r)){const o=t.withGatewayFactory(e).withLogger((e=>{a({type:is,payload:{level:e.level,code:e.code,message:e.message,additionalInformation:Object.assign(Object.assign({},e.additionalInformation),{moduleName:n,layoutType:"LayoutVariant",pageInstanceGuid:null!=i?i:"N/A"})}})})).build();customElements.define(r,o)}})).catch((e=>{const t=e&&"object"==typeof e&&"message"in e?e.message:void 0,i=e&&"object"==typeof e&&"stack"in e?e.stack:void 0;a({type:is,payload:{level:Dt,code:"FAILED_TO_LOAD_MODULE",message:t,additionalInformation:{stack:i,reason:t?void 0:e,moduleName:n}}}),a(lt)})),()=>{})))}const Qp={"standard-marketing":()=>Promise.resolve().then((function(){return Ef})),"add-to-cart":()=>Promise.resolve().then((function(){return wm})),"instant-purchase":()=>Promise.resolve().then((function(){return Sh})),"layouts-xp-sandbox":()=>Promise.resolve().then((function(){return ev}))};function*Xp(e,t,n){let i=yield Ke((e=>e.module.loadedModules));for(const a of n.payload.modules)i&&!(null==i?void 0:i.includes(a))&&(i=[...i,a],yield Qe(ey,e,t,a))}function*ey(e,t,n){if(n in Qp){yield qe({type:Jc,payload:n});const i=yield ze(Zp,e,t,n,Qp[n]);yield ze(Ps,i)}else yield qe({type:is,payload:{level:ws,code:"INVALID_MODULE_NAME",message:`Could not load unknown module ${n}`}})}function*ty(e){const t=yield Ke((e=>Md.getDistributionViewableItems(e.layout?Md.getDistribution(e.layout.layoutSchema):void 0))),n=yield Ke((n=>{var i;const a=nl(e.payload.activeBreakpoint)(n);return a>=0&&t?null!==(i=t[Math.min(t.length-1,a)])&&void 0!==i?i:1:void 0}));if("number"==typeof n){const e={type:Xc,payload:{groupSize:n}};yield qe(e)}}const ny=O([[(e,t,n,i)=>"END"===e.offerProcessStatus,j({type:Jr})],[(e,t,n,i)=>t.isLastOffer&&n,j({type:Jr})],[(e,t,n,i)=>1===i&&!t.isLastOffer,j({type:Zc})],[A,j(void 0)]]);function*iy(e){const t=yield Ke((e=>({exists:null!==e.progression,isLastOffer:md(e)}))),n=yield Ke((e=>{var t;return null===(t=e.progression)||void 0===t?void 0:t.groupSize}));var i;null!=(i=t)&&i instanceof Object&&"exists"in i&&"isLastOffer"in i&&t.exists&&(yield*function*(e,t,n){const i=yield Ke((e=>e.settings.closeOnComplete)),a=ny(e,t,"boolean"==typeof i&&i,n);a&&(a.type===Jr&&(yield qe({type:on,payload:{name:"PLACEMENT_COMPLETED"}})),yield qe(a))}(e.payload,t,n))}function ay(e){return e.type===id&&"Interactive"===e.payload.event}function oy(e){return e.type===id&&"Interactive"!==e.payload.event}function*ry(e){switch(e.payload.event){case"Dismissed":yield qe({type:ed,payload:{offerProcessStatus:"CONTINUE"}});break;case"Completed":yield qe({type:ad,payload:{key:"offerComplete",value:O([[$("Error"),j(-1)],[$("Success"),j(1)],[A,j(2)]])(e.payload.completionReason),offerPositionIndex:e.payload.offerPositionIndex}}),yield qe({type:ed,payload:{offerProcessStatus:"CONTINUE"}});break;case"Interactive":yield qe({type:qt,payload:{name:"Interactive",offerPositionIndex:e.payload.offerPositionIndex}}),yield qe({type:on,payload:{name:"PLACEMENT_INTERACTIVE"}})}}function*sy(e,t){var n;try{const n=yield Ke((e=>{var t,n,i;return null!==(i=null===(n=null===(t=e.layout)||void 0===t?void 0:t.settings)||void 0===n?void 0:n.enablePartnerValidation)&&void 0!==i&&i}));n&&(yield ze(e.partner.send,ml.PartnerValidationEvent.SET_PARTNER_VALIDATION_STATUS,{errors:t.payload.errors}))}catch(i){const a=yield Ke((({slots:e})=>{var n,i;return"number"==typeof t.payload.offerPositionIndex?null!==(i=null===(n=e.at(t.payload.offerPositionIndex))||void 0===n?void 0:n.layoutVariant.moduleName)&&void 0!==i?i:"Unknown":"orchestrator"})),o=null!==(n=yield ze(e.context.getRoktPageInstanceGuid))&&void 0!==n?n:"N/A",r={type:is,payload:{level:kt,code:"PARTNER_VALIDATION_UPDATE_FAILED",message:"Failed to update the partner with error status",additionalInformation:{moduleName:a,layoutType:"number"==typeof t.payload.offerPositionIndex?"LayoutVariant":"OuterLayout",pageInstanceGuid:o}}};yield qe(r)}}function*ly(e){const t=yield Ke((e=>{var t;return null===(t=e.layout)||void 0===t?void 0:t.instanceGuid}));yield qe({type:sd.ACTIVE_DELETE,payload:{id:e.payload.id}}),yield qe({type:Jr}),t?(yield qe({type:tn,payload:{name:"SignalInstantPurchaseDismissal",parentGuid:t}}),yield qe({type:tn,payload:{name:"SignalDismissal",parentGuid:t}})):yield qe({type:is,payload:{level:Os,code:Fs,message:"ParentGuid does not exist"}})}function*cy(e,t){yield Ye([Ze(is,$s.bind(null,e.errorService.raise)),Xe(qr,Ud.bind(null,{display:e.displayService,partner:e.partnerInteractionService})),Ze(Kc,Xp.bind(null,t,e.contextService)),Xe(od,Yp.bind(null,{partner:e.partnerInteractionService,context:e.contextService})),Ze(ed,iy),Ze(oy,ry),ks(ay,ry),Xe(zr,cl.bind(null,e.displayService)),Xe(Jr,Nl.bind(null,e.contextService)),Xe(nd,ly),Xe(ns,tc),Ze(tn,jl),Ze(sn,Gl),Ds(qt,Xl.bind(null,e.metricsService)),Ds(ts,Fl.bind(null,e.rdnService)),Ze(as,$l.bind(null,e.errorService.raise)),Xe(Ur,ty),Ze(an,Ql),Ze(ln,ec.bind(null,{createChildPlugin:e.childPlugin.create,partner:e.partnerInteractionService,context:e.contextService})),Xe(cn,sy.bind(null,{partner:e.partnerInteractionService,context:e.contextService}))])}var dy,uy,py,yy,fy,my=function(e,t,n,i,a){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?a.call(e,n):a?a.value=n:t.set(e,n),n},hy=function(e,t,n,i){if("a"===n&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?i:"a"===n?i.call(e):i?i.value:t.get(e)};const vy={[pn.SET_CUSTOM_STATE]:sd.SET_CUSTOM_STATE,[pn.SET_DOMAIN_STATE]:sd.SET_DOMAIN_STATE,[pn.SET_GLOBAL_OFFER_DATA_CART]:sd.SET_GLOBAL_OFFER_DATA_CART,[pn.OFFER_LIFECYCLE]:ld.OFFER_LIFECYCLE,[pn.OFFER_ENGAGEMENT]:ld.OFFER_ENGAGEMENT,[pn.SET_PARTNER_VALIDATION_STATUS]:ld.SET_PARTNER_VALIDATION_STATUS};class gy{constructor(e){dy.add(this),uy.set(this,void 0),my(this,uy,e,"f")}getState(e){const t=hy(this,uy,"f").getState();return{breakpoint:t.breakpoint,progression:hd(t),customStates:al(t,e.offerPositionIndex),domainStates:vd(t,e.offerPositionIndex)}}dispatch(e,t){hy(this,uy,"f").dispatch(hy(this,dy,"m",fy).call(this,e,t))}subscribe(e,t){return t(this.getState(e)),hy(this,uy,"f").subscribe((()=>{t(this.getState(e))}))}}function by(e,t){const n=ot(),i={},a=it({reducer:yd,devTools:{name:"Orchestrator"},preloadedState:Object.assign(Object.assign({},fd()),t),middleware:e=>{return e({thunk:!1,serializableCheck:!1}).concat((t=i,e=>e=>n=>{if("object"==typeof n&&null!==n&&"type"in n){const i=n.type,a=t[`${i}`];return e(a?a(n):n)}return e(n)}),n);var t}}),o=(r=function(e){return new gy(e)}(a),s=e.childPlugin.create,l=e.partnerInteractionService.onEvent,(e,t)=>new ma(r,s,e,t,l));var r,s,l;n.run(cy,e,o),n.run(Dl,e,qp);const c={};return Object.assign(Object.assign({},a),{extend:({reducer:e,interceptors:t,sagas:o})=>{e&&(Object.assign(c,e),a.replaceReducer(at(Object.assign(Object.assign({},yd),c)))),t&&Object.assign(i,t),o&&n.run(o)}})}uy=new WeakMap,dy=new WeakSet,py=function(e,t,n){return{type:e,payload:Object.assign(Object.assign({},t),{offerPositionIndex:n.offerPositionIndex,creativeInstanceGuid:n.creativeInstanceGuid})}},yy=function(e,t){return t.type===sn?t.payload.signal.parentGuid||(t.payload.signal.parentGuid=e.creativeInstanceGuid):(t.payload.creativeInstanceGuid=e.creativeInstanceGuid,t.payload.parentGuid||(t.payload.parentGuid=e.creativeInstanceGuid)),t},fy=function(e,t){return function(e){return e.type in vy}(t)?hy(this,dy,"m",py).call(this,vy[t.type],t.payload,e):t.type===tn||t.type===sn?hy(this,dy,"m",yy).call(this,e,t):t};var Iy=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const Ey={ctx:new Map([[qc.name,qc],[zc.name,zc],[Tc.name,Tc],[Pc.name,Pc]]),cache:[]};function Sy(n,i){return Iy(this,void 0,void 0,(function*(){const{pluginId:o,pageInstanceGuid:r}=yield function(e){return Promise.allSettled([(e.contextService.getUId||e.contextService.getPluginInstanceId)(),e.contextService.getRoktPageInstanceGuid()]).then((([e,t])=>({pluginId:"fulfilled"===e.status?e.value:_t.pluginId,pageInstanceGuid:"fulfilled"===t.status?t.value:_t.pageInstanceGuid}))).catch((()=>_t))}(i),s=y(n),l=by(i);s.render(t(a.StrictMode,{children:[e(Pr,{}),e(Ja,{children:e(v,{store:l,children:t(za.Provider,{value:o,children:[e(Ys,{}),e(xi.Provider,{value:n,children:e(hr,{extensions:Ey,extendStore:l.extend.bind(l),children:e(Gd,{pageInstanceGuid:r})})})]})})})]}))}))}class Cy{constructor(){this._subscribers=[]}add(e){this._subscribers.push(e)}unsubscribe(){this._subscribers.forEach((e=>e.unsubscribe()))}}const wy=()=>{},Oy=(e=wy,t=wy,n=wy)=>"function"!=typeof e?e:{next:e,error:t,complete:n};class Ty{constructor(e){this._setupFn=e}subscribe(e,t,n){const i=Oy(e,t,n);let a,o=!0;const r={next:e=>{o&&i.next(e)},complete:()=>{o&&(a&&a(),i.complete(),o=!1)},error:e=>{o&&(i.error(e),o=!1)}};a=this._setupFn(r),o||a&&a();const s=new Cy;return s.add({unsubscribe:()=>{a&&a(),o=!1}}),s}}class Ay extends Ty{constructor(){super((e=>(this._isComplete&&e.complete(),this._observers.push(e),()=>this._observers=this._observers.filter((t=>t!==e))))),this._observers=[],this._isComplete=!1}next(e){for(const t of this._observers)t.next(e)}error(e){for(const t of this._observers)t.error(e)}complete(){this._isComplete=!0;for(const e of this._observers)e.complete()}asObservable(){return new Ty((e=>{const t=this.subscribe(e);return()=>t.unsubscribe()}))}}class xy extends Ay{constructor(e){super(),this._lastValue=e}subscribe(e,t,n){const i=Oy(e,t,n);return i.next(this._lastValue),super.subscribe(i)}next(e){return this._lastValue=e,super.next(e)}getValue(){return this._lastValue}}class Ny extends Ay{constructor(e=-1){super(),this._buffer=[],this._error=null,this._bufferLength=e}subscribe(e,t,n){const i=Oy(e,t,n);let a=!0;return this._buffer.filter((e=>(e===this._error&&(a=!1),a))).forEach((e=>i.next(e))),this._error&&i.error(this._error),i.error=e=>{this._error=e,t(e)},super.subscribe(i)}next(e){this._error||this._addToBuffer(e),super.next(e)}error(e){this._error=e,this._addToBuffer(e),super.error(e)}_addToBuffer(e){-1!==this._bufferLength&&this._buffer.length===this._bufferLength?(this._buffer.shift(),this._buffer.push(e)):this._buffer.push(e)}}const _y={CompletedBeforeEmit:"CompletedBeforeEmit"},Ly=(e,t)=>{let n;const i="object"==typeof t;return new Promise(((a,o)=>{n=e.subscribe(a,o,(()=>{i?a(t.defaultValue):o(new Error(_y.CompletedBeforeEmit))}))})).then((e=>(n.unsubscribe(),e))).catch((e=>{throw n.unsubscribe(),e}))},Ry=(e,t)=>new Promise(((n,i)=>{let a;"object"==typeof t&&(a=t.defaultValue),e.subscribe((e=>a=e),(e=>i(e)),(()=>n(a)))})),Dy=(e,t)=>new Ty((n=>{const i=e=>n.next(e);return e.addEventListener(t,i),()=>e.removeEventListener(t,i)}));function ky(e){return new Ty((t=>{e.then((e=>{t.next(e),t.complete()}),(e=>t.error(e)))}))}const Py=(...e)=>new Ty((t=>{const n=new Cy;let i=0;for(const a of e)n.add(a.subscribe((e=>t.next(e)),(e=>t.error(e)),(()=>{i+=1,i>=e.length&&t.complete()})));return()=>n.unsubscribe()})),$y=(...e)=>new Ty((t=>{for(const n of e)t.next(n)})),jy=(...e)=>new Ty((t=>{if(!e.length)return t.complete(),wy;const n=new Cy,i=new Array(e.length),a=new Array(e.length),o=e=>!i.includes(void 0)&&t.next(e);for(let t=0;t<e.length;t++){const r=e[t].subscribe((e=>{a[t]=e,i[t]=!0,o(a)}));n.add(r)}return()=>n.unsubscribe()}));var Gy=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};function Fy(e,t){return new My(e,t)}class My{constructor(e,t){this._target=e,this._handler=t}subscribe(e,t,n){const i=e.next?e.next.bind(e):e,a={next:(...e)=>Gy(this,void 0,void 0,(function*(){try{yield i(...e)}catch(e){this._handler(e)}})),error:e.error?e.error.bind(e):t,complete:e.complete?e.complete.bind(e):n};return this._target.subscribe(a)}}class By{constructor(e){this.value=e,this.complete=!1,this.skip=!1}}var Uy=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,s)}l((i=i.apply(e,t||[])).next())}))};const Vy=e=>(...t)=>new Ty((n=>{const i=e.subscribe((e=>Uy(void 0,void 0,void 0,(function*(){try{let i=new By(e);for(const e of t){const t=e(i);if(i=t.then?yield t:t,!0===i.skip||!0===i.complete)break}if(i.skip)return;n.next(i.value),!0===i.complete&&n.complete()}catch(e){n.error(e)}}))),(e=>n.error(e)),(()=>n.complete()));return()=>i.unsubscribe()})),zy=e=>t=>(!1===e(t.value)&&(t.skip=!0),t),Hy=e=>t=>(e?!0===e(t.value)?t.complete=!0:t.skip=!0:t.complete=!0,t),Wy=e=>t=>{const n=e(t.value);return new By(n)},qy=e=>t=>(e(t.value),t),Jy={FULLSCREEN:"DisplayPreset.FULLSCREEN",EMBEDDED:"DisplayPreset.EMBEDDED",ATTACHED:"DisplayPreset.ATTACHED"},Ky={ERROR:"ERROR",INFO:"INFO",WARNING:"WARNING"},Yy={getBreakpointCSSClass:Ht},Zy="CHILD_LAYOUTS/ADD_LAUNCHED",Qy="DYNAMIC_DATA/ADD";function Xy(e={launched:{}},t){if(t.type===Zy){const n=t.payload;return n.childLayoutId?b(["launched",n.childLayoutId],n.shouldRelaunch,e):e}return e}function ef(e=null,t){return e}function tf(e=null,t){if(t.type===Qy){const n=t.payload;return e?n?Ge(e,n):e:n}return e}function nf(e,t){var n;return null===(n=e.childLayouts.launched[t])||void 0===n||n}function af(e){var t;return null===(t=e.staticData)||void 0===t?void 0:t.offer}function of(e){var t;return null===(t=e.staticData)||void 0===t?void 0:t.schemaVersion}const rf=Object.freeze({});function sf(e){var t;return(null===(t=e.dynamicData)||void 0===t?void 0:t.text)?e.dynamicData.text:rf}const lf="FAILED_TO_LAUNCH_CHILD_LAYOUT";function*cf(e,t,n){var i;if(yield null===(i=Ke(nf,n.payload.childLayoutId))||void 0===i||i){const i=yield Ke(of),o=yield Ke(af),r=yield Ke(sf);try{const s=(a=function(e,t,n,i){return{instanceGuid:e.instanceGuid,childLayoutId:e.childLayoutId,childLayoutSchema:e.childLayoutSchema,offer:t,layoutSchemaVersion:n,content:{text:i}}}(n.payload,o,i,r),JSON.parse(JSON.stringify(a)));try{yield ze(e.createChildPlugin,{name:"dcui-child",config:s,targetElementSelector:n.payload.targetElementSelector})}catch(e){yield ze(t,{level:kt,code:lf,message:"Could not launch child layout, failed creating plugin."})}}catch(e){yield ze(t,{level:kt,code:lf,message:"Could not launch child layout, failed to make the child layout config serializable."})}yield qe({type:Zy,payload:{childLayoutId:n.payload.childLayoutId,shouldRelaunch:!1}})}var a}function df(){const t=_a(),n=m(sf),i=Xi()({state:n},"textContent");return e(Qi,{value:i,children:e(Oi,{children:e=>e(t)})})}const uf={staticData:ef,dynamicData:tf,childLayouts:Xy};function pf(e={}){return Object.assign({staticData:null,dynamicData:null,childLayouts:{launched:{}}},e)}function yf(e){let t,n,i;return st((a=>(Promise.race([e.onClose().then((()=>"CLOSED")),new Promise((n=>{t=e.onEvent("PLUGIN_TRANSITION_OFFER_SUCCESS").subscribe((()=>{n("SUCCESS")}))})),new Promise((t=>{n=e.onEvent("PLUGIN_TRANSITION_OFFER_CLOSE").subscribe((()=>{t("UNSPECIFIED")}))})),new Promise((e=>{i=e}))]).then((e=>{"END"!==e&&(a(e),a(lt))})),()=>{null==t||t.unsubscribe(),null==n||n.unsubscribe(),i("END")})))}function ff(e){return"object"==typeof e&&null!==e&&Object.entries(e).every((([e,t])=>"string"==typeof e&&"string"==typeof t))}function*mf(e,t,n,i,a){for(;;){switch(yield We(e)){case"CLOSED":t({type:nn,payload:{event:"Dismissed",dismissalReason:"Implicit"}});break;case"SUCCESS":if((n||i)&&a){yield ze(a);break}t({type:nn,payload:{event:"Completed",completionReason:"Success"}});break;case"UNSPECIFIED":t({type:nn,payload:{event:"Completed",completionReason:"Unspecified"}})}}}function*hf(e,t,n){if(Kt(n)){const{responseOption:i,fulfillment:a}=n,o=Xt(n),r=en(n);yield qe({type:tn,payload:{name:"SignalResponse",parentGuid:i.instanceGuid,responseActionPayload:{name:"Fulfillment"}}});const s=yield ze(e.createChildPlugin.bind(e),a);if("object"==typeof s&&"onClose"in s&&"close"in s){const i=yield ze(yf,s);if("object"==typeof i&&"take"in i){const a=function(e,t,n,i){if(n.responseOption.rclid)return function*(){yield qe({type:on,payload:{name:"REALTIME_OFFER_FULFILLMENT_CONVERSION",body:{rclid:n.responseOption.rclid,accountID:n.accountID,referralCreativeID:n.referralCreativeID}}}),yield ze(vf,e,t,i)}}(e,t,n,s);return void(yield ze(mf,i,e.globalDispatch.bind(e),o,r,a))}}yield ze(t,{level:Dt,code:"UNEXPECTED_NEXT_VALUE_IN_SAGA",message:'Received an unexpected input at a step in the saga "handleFullfillmentResponse" and could not continue.'})}else yield ze(t,{level:Dt,code:"INVALID_FULFILLMENT_PAYLOAD",message:`Fulfillment payload is invalid, fulfillment: ${n}`})}function*vf(e,t,n){const i=function(e){return st((t=>{const n=e.onEvent({name:vl,source:"partner",callback:e=>{ff(e)&&t({eventName:vl,data:e})}},{name:gl,source:"partner",callback:e=>{ff(e)&&t({eventName:gl,data:e})}});return()=>{n()}}))}(e);try{for(;;){const a=yield We(i);switch(a.eventName){case vl:yield qe({type:on,payload:{name:vl,body:a.data}}),yield qe({type:Qy,payload:{text:a.data}}),e.globalDispatch({type:nn,payload:{event:"Completed",completionReason:"Success"}}),n&&(yield ze(n.close.bind(n)));break;case gl:e.globalDispatch({type:nn,payload:{event:"Completed",completionReason:"Error"}}),n&&(yield ze(n.close.bind(n)));break;default:t({level:Dt,code:"UNKNOWN_REALTIME_OFFER_FULFILLMENT_EVENT",message:`Unknown event: ${a.eventName}`})}}}catch(e){const n=e;t({level:kt,code:"FAILED_TO_PROCESS_REALTIME_OFFER_FULFILLMENT_EVENT",message:null==n?void 0:n.message})}finally{(yield Je())&&i.close()}}function*gf(e,t,n){const i=Zt(n.payload)||Qt(n.payload)||Yt(n.payload)?n.payload:n.payload.responseOption;switch(i.action){case"Url":yield ze(e.globalDispatch.bind(e),n),(Xt(n.payload)||en(n.payload))&&(yield qe({type:on,payload:{name:"REALTIME_OFFER_FULFILLMENT_REFERRAL",body:{rclid:i.rclid,accountID:i.accountID,referralCreativeID:i.referralCreativeID,referralOnly:en(n.payload)}}}),Xt(n.payload)&&(yield ze(vf,e,t)));break;case"CaptureOnly":yield ze(e.globalDispatch.bind(e),n);break;case"Fulfillment":yield qe({type:on,payload:{name:"OFFER_ENGAGEMENT"}}),i.isPositive&&(yield qe({type:on,payload:{name:"POSITIVE_ENGAGEMENT"}})),en(n.payload)&&(yield qe({type:on,payload:{name:"REALTIME_OFFER_FULFILLMENT_REFERRAL",body:{rclid:i.rclid,accountID:n.payload.accountID,referralCreativeID:n.payload.referralCreativeID,referralOnly:!0}}})),yield*hf(e,t,n.payload)}}function*bf(e,t){yield Ye([Xe(Jt,gf.bind(null,e,t)),Ze(un,cf.bind(null,e,t)),Ze("*",Ns.bind(null,[Jt,un],e))])}Object.assign({},pn);const If=(new Oa).withAppFactory((function(n){var i;if(n.rootElement){const o=y(n.rootElement),r=pf({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),s=function(e,t,n=pf()){const i=ot(),a=it({reducer:uf,devTools:{name:"Standard Marketing"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(bf,e,t),a}(n.gateway,n.logger,r);o.render(e(a.StrictMode,{children:t(Ma,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(Pr,{}),e(v,{store:s,children:e(Dr,{settings:n,dispatch:s.dispatch,children:e(df,{})})})]})}))}}));var Ef=Object.freeze({__proto__:null,moduleConnectorBuilder:If});const Sf="CART/UPDATE",Cf="CATALOG_ITEM/RESPONSE",wf="USER_CREATIVE_RESPONSE_HISTORY/ADD",Of=O([[(e,t)=>0!==t,$],[(e,t)=>!Number.isNaN(e)&&0===t,$],[(e,t)=>Number.isNaN(e)&&0===t,Me]]);function Tf({isChecked:t,isDisabled:n,outerClassname:i,outerCheckedClassname:a,innerClassname:o,innerCheckedClassname:r}){return e("span",{style:{display:"flex"},children:e("span",{className:`${i} ${t?a:""}`,tabIndex:n?-1:1,style:{display:"flex",boxSizing:"border-box"},children:e("span",{className:`${o} ${t?r:""}`,style:{flex:1}})})})}const Af="catalogRadioGroup__label",xf=["Enter","Space"],Nf={elements:{own:[],optionContainer:[],radioButtonInner:[{default:{border:{borderRadius:11},background:{backgroundColor:{light:"#FFF"}}}}],radioButtonInnerChecked:[{default:{background:{backgroundColor:{light:"#529ff4"}}}}],radioButtonOuter:[{default:{border:{borderRadius:16,borderColor:{light:"#999"},borderStyle:"solid",borderWidth:"1"},dimension:{width:{type:"fixed",value:16},height:{type:"fixed",value:16}},spacing:{padding:"4"}}}],radioButtonOuterChecked:[]}};function _f(e,t,n){return e.map(O([[G($("Required"),F("","type")),({value:e})=>Number.isNaN(n)&&t>0?e.message:""],[A,j("")]])).filter(Fe)}function Lf({schema:n,testId:i}){var r;const s=f(),l=Va(),c=null!==(r=m((e=>{var t,n;return l.cartItemId in e.cart?null!==(n=null===(t=e.cart[l.cartItemId])||void 0===t?void 0:t.quantity)&&void 0!==n?n:0:void 0})))&&void 0!==r?r:NaN,u=d((()=>_f(n.validations,n.options.length,c)),[n.validations,n.options.length,c]),p=Ra(),{tabIndex:y,styles:h,isDisabled:v}=It(p);o((()=>{v||s(Rf(u))}),[]);const g=n.options.filter((({quantity:e})=>{var t,n;return e>=(null!==(t=l.minItemCount)&&void 0!==t?t:-1/0)&&e<=(null!==(n=l.maxItemCount)&&void 0!==n?n:1/0)}));function b(e){s({type:Cf,payload:{catalogItem:l,quantity:e}});const t=_f(n.validations,n.options.length,e);s(Rf(t))}return g.length>0?e(Ro,{styles:n.styles?zt(Nf,n.styles):Nf,children:({classnames:n,mapperRef:o})=>e("div",{className:null==n?void 0:n.own,style:Object.assign({display:"flex",flexDirection:"column"},h),children:e(ta,{value:o(Af),children:a.Children.toArray(g.map(((a,o)=>{var r;const s=Of(c,a.quantity),d=e=>i?`${i}-option${o}${e}`:void 0;return t("label",{tabIndex:y,"aria-disabled":v,style:{display:"flex"},className:`${Af} ${null!==(r=null==n?void 0:n.optionContainer)&&void 0!==r?r:""}`,onKeyDown:e=>{s||!xf.includes(e.code)||v||b(a.quantity)},"data-e2e":"CatalogRadioGroup-Option","data-e2e-quantity":`${a.quantity}`,"data-testid":d("Label"),children:[e("input",{type:"radio",style:{display:"none"},tabIndex:-1,name:l.instanceGuid,value:a.quantity,checked:s,onChange:()=>b(a.quantity),"aria-disabled":v,disabled:v}),e(Tf,{isChecked:s,isDisabled:v,innerClassname:null==n?void 0:n.radioButtonInner,innerCheckedClassname:null==n?void 0:n.radioButtonInnerChecked,outerClassname:null==n?void 0:n.radioButtonOuter,outerCheckedClassname:null==n?void 0:n.radioButtonOuterChecked}),e(Fr,{schema:a,testId:d("Content")})]})})))})})}):null}function Rf(e){return{type:cn,payload:{errors:e}}}function Df(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function kf(t){const n=f(),i=Ti(),a=Va(),o=Ra(),{tabIndex:r,styles:s,isDisabled:l}=It(o);return e(Ro,{styles:t.schema.styles,children:({classnames:o})=>e("button",{type:"button",tabIndex:r,"aria-disabled":l,disabled:l,style:Object.assign({cursor:"pointer"},s),"data-testid":t.testId,"data-e2e":"CatalogItemResponse",onClick:e=>{e.preventDefault();n({type:Cf,payload:{catalogItem:a,quantity:1}})},className:null==o?void 0:o.own,children:Df(t.schema.children,i,t.testId)})})}const Pf={allowedTags:["em","strong","a","br","u","p","li","ul","ol","span"],allowedAttributes:{a:["href","target"],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],span:[]},allowedSchemes:["http","https"]},$f=new Map([["&","_;^;_"]]),jf=new RegExp(`<a *(?=${Pf.allowedAttributes.a.join("|")}|>)`,"g"),Gf=new RegExp(`<a *(?:(?:${Pf.allowedAttributes.a.filter((e=>"href"!==e)).join("|")})="[^"]*")* *href="([^"]+)"`,"g"),Ff=new RegExp("(<br *?>)|(<br *?/>)","g"),Mf=new RegExp(`<ul *(?=${Pf.allowedAttributes.ul.join("|")}|>)`,"g"),Bf=new RegExp(`<ol *(?=${Pf.allowedAttributes.ol.join("|")}|>)`,"g"),Uf=new RegExp("<li *(?=>|\\s[^>]*>)","g"),Vf="<br/>";function zf(t){const n=Xi(),i=Ra(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Gf,((e,t)=>{const n=t.replaceAll("&",$f.get("&"));return e.replace(t,n)})).replaceAll(Ff,Vf)}(e);return t===vt(t,Pf)}(e))throw new Pt("FAILED_SANITISING_HTML","Invalid HTML tags");return e}),[t.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=It(i);return a?e(Ro,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(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)),l=((null==n?void 0:n.list)?`class="${n.list}"`:"")+' style="list-style-type: none; padding-inline-start: 0px; display: flex; flex-direction: column;"',c=((null==n?void 0:n.listItem)?`class="${n.listItem}"`:"")+' style="display: flex; align-items: flex-start; flex-shrink: 0; flex-grow: 1;"',d=`class="rokt-icon${(null==n?void 0:n.span)?" "+n.span:""}" style="display: inline-block; pointer-events: none; user-select: none;" aria-disabled="true"`,u=a.replace(jf,`<a ${i.join(" ")}`).replace(Mf,`<ul ${l}`).replace(Bf,`<ol ${l}`).replace(Uf,`<li ${c}><span ${d}>Check</span`);return p=a,new RegExp("</(p|ul|ol)>").test(p)?e("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:u}}):e("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:u}});var p}}):null}const Hf={internally:"_top",externally:"_blank"};function Wf(t,n,i,a,o){return e(ta,{value:i(n),children:qf(t,a,o)})}function qf(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Jf(t){var n,i;const a=Hf[t.schema.open],o=Ti(),r=Va(),s=Ra(),l=f(),c=null!==(n=r.url)&&void 0!==n?n:"",{tabIndex:d,styles:u,isDisabled:p}=It(s);return Boolean(c)&&(null===(i=t.schema.children)||void 0===i?void 0:i.length)>0?e(Ro,{styles:t.schema.styles,children:({classnames:n,mapperRef:i})=>{var s;return e("a",{href:c,onClick:()=>{var e;l({type:tn,payload:{name:"SignalResponse",parentGuid:null!==(e=r.instanceGuid)&&void 0!==e?e:"",responseActionPayload:{name:"Url",transformedTrafficURL:c}}})},"data-testid":t.testId,"data-e2e":"CatalogUrlLink",target:null!=a?a:"_blank",tabIndex:d,"aria-disabled":p,"aria-label":null!==(s=t.schema.a11yLabel)&&void 0!==s?s:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:"block"},u),className:null==n?void 0:n.own,children:(null==n?void 0:n.own)?Wf(t.schema.children,null==n?void 0:n.own,i,o,t.testId):qf(t.schema.children,o,t.testId)})}}):null}function Kf(e,t){const n=e.cart[t];return n||null}function Yf(e){var t,n;const i=null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.catalogItems)&&void 0!==n?n:[],a=function(e){return Object.values(e.cart).filter((e=>null!==e))}(e);return a.filter((e=>i.find((t=>t.catalogItemId===e.catalogItemId))))}function Zf(e,t){var n,i,a,o;const r=null===(n=e.staticData)||void 0===n?void 0:n.offer;if(r){const n=function(e){return Yf(e).reduce(((e,t)=>e+t.quantity),0)}(e),s=Kf(e,t.cartItemId),l=(null!==(i=null==r?void 0:r.maxTotalItemsQtyInOffer)&&void 0!==i?i:1/0)-n,c=(null!==(a=t.maxItemCount)&&void 0!==a?a:1/0)-(null!==(o=null==s?void 0:s.quantity)&&void 0!==o?o:0);return Math.min(l,c)}return 0}function Qf(e){var t,n;const i=null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.catalogItems)&&void 0!==n?n:[];return i.length>0?i:null}function Xf(e,t){var n,i;return null!==(i=null===(n=Qf(e))||void 0===n?void 0:n.find((e=>e.catalogItemId===t)))&&void 0!==i?i:null}function em(e){var t;const n=null===(t=Qf(e))||void 0===t?void 0:t.filter((e=>e.preSelectedQuantity&&e.preSelectedQuantity>0));return n&&n.length>0?n:null}function tm(e){var t,n;return null!==(n=null===(t=em(e))||void 0===t?void 0:t.reduce(((e,t)=>{var n;return e+(null!==(n=t.preSelectedQuantity)&&void 0!==n?n:0)}),0))&&void 0!==n?n:0}const nm=G((e=>e.filter((e=>!ce(e[1]))).map((([e,t])=>({cartItemId:t.cartItemId,quantity:t.quantity})))),ne,B("cart"));function im(t,n,i,a,o){return e(ta,{value:i(n),children:a(t,void 0,o)})}function am(e,t,n){return t(e,void 0,n)}function om(i){var a;const{schema:o,testId:r}=i,{a11yInputLabel:s,styles:l,showInputField:c,buttons:d,forcedUpsellText:u}=o,{increment:p,decrement:y,a11yIncrementLabel:h,a11yDecrementLabel:v}=d||{},g=f(),b=Va(),I=Ti(),E=Xi(),S=Ra(),{tabIndex:C,styles:w,isDisabled:O}=It(S),T=m((e=>function(e,t){var n,i,a;const o=Xf(e,t);return Boolean(o&&(null!==(n=o.preSelectedQuantity)&&void 0!==n?n:0)>0&&o.preSelectedQuantity===(null!==(i=o.minItemCount)&&void 0!==i?i:0)&&o.preSelectedQuantity===(null!==(a=o.maxItemCount)&&void 0!==a?a:0))}(e,b.catalogItemId))),A=m((e=>Kf(e,b.cartItemId))),x=m((e=>Zf(e,b))),N=(null==A?void 0:A.quantity)||0,_=It(O||N<=(null!==(a=b.minItemCount)&&void 0!==a?a:0)?"DISABLED":S),L=It(O||x<=0?"DISABLED":S),R=It(O||T?"DISABLED":S),D=e=>{var t;const n=e.target.value;if(0===n.length)k(null!==(t=b.minItemCount)&&void 0!==t?t:0);else{const e=Number(n);!Number.isNaN(e)&&e>=0&&k(e)}},k=e=>{O||g({type:Cf,payload:{catalogItem:b,quantity:e}})};return e(Ro,{styles:l,children:({classnames:i,mapperRef:a})=>e("div",{className:null==i?void 0:i.own,style:Object.assign({display:"flex",flexDirection:"row"},w),children:T&&u?e(Uo,{schema:u,isInline:!1,testId:r?`${r}-forced-upsell-text`:void 0}):t(n,{children:[y?e("button",{className:null==i?void 0:i.decrementButton,style:Object.assign(Object.assign({},_.styles),{cursor:_.isDisabled?"not-allowed":"pointer",pointerEvents:"auto"}),onClick:e=>{e.preventDefault(),k(N-1)},tabIndex:_.tabIndex,"aria-label":v||void 0,disabled:_.isDisabled,"data-testid":r?`${r}-decrement-button`:void 0,children:e(Qi,{value:E,children:(null==i?void 0:i.decrementButton)?im(y,i.decrementButton,a,I,r):am(y,I,r)})}):null,c?e("input",{type:"text",className:null==i?void 0:i.input,style:Object.assign(Object.assign({},R),{cursor:R.isDisabled?"not-allowed":"auto",caretColor:R.isDisabled?"transparent":"auto",pointerEvents:"auto",outline:"none"}),value:N,onChange:D,"aria-label":s||void 0,tabIndex:C,disabled:O,"data-testid":r?`${r}-input`:void 0}):e("p",{className:null==i?void 0:i.input,style:w,"data-testid":r?`${r}-quantity-text`:void 0,children:N}),p?e("button",{className:null==i?void 0:i.incrementButton,style:Object.assign(Object.assign({},L.styles),{cursor:L.isDisabled?"not-allowed":"pointer",pointerEvents:"auto"}),onClick:e=>{e.preventDefault(),k(N+1)},tabIndex:L.tabIndex,"aria-label":h||void 0,disabled:L.isDisabled,"data-testid":r?`${r}-increment-button`:void 0,children:e(Qi,{value:E,children:(null==i?void 0:i.incrementButton)?im(p,i.incrementButton,a,I,r):am(p,I,r)})}):null]})})})}const rm={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(kf,{schema:t.node,testId:n})},EscapeHatch:function(t){if("EscapeHatch"===t.type&&t.node.data){const n=JSON.parse(t.node.data);switch(null==n?void 0:n.type){case"InsuranceRichText":return e(zf,{schema:n.node});case"CatalogUrlLink":return e(Jf,{schema:n.node});default:return}}},CatalogRadioGroup:function(t){if("CatalogRadioGroup"===t.type)return e(Lf,{schema:t.node})},CatalogQuantityCounter:function(t){if("CatalogQuantityCounter"===t.type)return e(om,{schema:t.node})}};function sm(){const t=_a(),n=Ti();return e(Ai,{value:n,overrides:rm,children:e(Oi,{children:e=>e(t)})})}function lm(e){return e.reduce(((e,t)=>(e[t.cartItemId]=function(e={}){return Object.assign({cartItemId:"cartItemId",catalogItemId:"catalogItemId",name:"Catalog Title",description:"This is a catalog item",unitPrice:10,totalPrice:10,quantity:1,currency:"USD",linkedProductId:void 0,quantityMustBeSynchronized:void 0,providerData:""},e)}({cartItemId:t.cartItemId,quantity:t.quantity}),e)),{})}const cm={cart:function(e=lm([]),t){if(t.type===Sf){const{catalogItem:n,quantity:i}=t.payload,a=n.cartItemId,o=_s(n,i);return Object.assign(Object.assign({},e),{[a]:o})}return e},userCreativeResponseHistory:function(e=[],t){return t.type===wf?e.concat(t.payload.responseId):e},staticData:ef,childLayouts:Xy};const dm="INVALID_PARTNER_MESSAGE",um="MISCONFIGURED_CATALOG_ITEM",pm="FAILED_TO_PROCESS_PARTNER_UPDATE_CART_ITEM";function*ym(e){var t,n;const i=yield Ke(em),a=yield Ke(tm),o=yield Ke((e=>{var t;return null===(t=e.staticData)||void 0===t?void 0:t.offer.maxTotalItemsQtyInOffer}));if(gm(a)&&gm(o)&&a>o)yield ze(e,{level:kt,code:um,message:`Catalog items preselected quantities (${a}) exceeds the maximum allowed quantity (${o}) for this offer`});else if(i&&Array.isArray(i))for(const a of i){const i=null!==(t=a.preSelectedQuantity)&&void 0!==t?t:0,o=null!==(n=a.maxItemCount)&&void 0!==n?n:1/0;i>o?yield ze(e,{level:kt,code:um,message:`Preselected quantity (${i}) is greater than maxItemCount (${o}) for catalog item (${a.instanceGuid})`}):yield*vm(a,i,!0)}}function*fm(e,t,n){const{catalogItem:i,quantity:a}=n.payload;if(yield*vm(i,a,!1)){const n=yield Ke((e=>{var t,n,i;const a=null===(t=e.staticData)||void 0===t?void 0:t.offer.creative.responseOptionsMap.positive,o=e.userCreativeResponseHistory.at(-1),r=null===(n=e.staticData)||void 0===n?void 0:n.offer.creative.responseOptionsMap.negative;if(a&&o&&a.id===o&&"SignalGatedResponse"===(null==r?void 0:r.signalType))return function(e,t){var n;switch(e.action){case"Fulfillment":{const i=null==t?void 0:t.creative.fulfillment;return Ct(i)?{type:Jt,payload:{fulfillment:i,responseOption:e,accountID:null!==(n=null==t?void 0:t.accountId)&&void 0!==n?n:""}}:`Could not get fulfillment for response (instanceGuid: ${e.instanceGuid})`}case"Url":return(null==t?void 0:t.accountId)?{type:Jt,payload:Object.assign(Object.assign({},e),{accountID:t.accountId})}:`Could not get accountId for response (instanceGuid: ${e.instanceGuid})`;default:return{type:Jt,payload:e}}}(r,null===(i=e.staticData)||void 0===i?void 0:i.offer)}));null!=(o=n)&&"object"==typeof o&&"type"in o&&"payload"in o&&"object"==typeof o.payload?yield ze(e.globalDispatch,n):function(e){return"string"==typeof e}(n)&&(yield ze(t,{level:kt,code:"INVALID_RESPONSE_OBJECT",message:n}))}var o}function*mm(e,t){const n=function(e,t){return st((n=>{const i=e.onEvent({name:yl.V2.PartnerMessage.UpdateCartItem,source:"partner",callback:e=>{!function(e){return null!==e&&"object"==typeof e&&"cartItemId"in e&&"quantity"in e&&!("unitPrice"in e)}(e)?t({level:kt,code:dm,message:`Invalid UpdateCartItemPartnerMessageBody: ${JSON.stringify(e)}`}):n(e)}});return()=>{i()}}))}(e,t);try{for(;;){const e=yield We(n);yield ze(hm,e,t)}}catch(e){const n=e;t({level:kt,code:pm,message:null==n?void 0:n.message})}finally{(yield Je())&&n.close()}}function*hm(e,t){const{cartItemId:n,quantity:i}=e,a=yield Ke(Kf,n);if(bm(a)){const e=yield Ke(Xf,a.catalogItemId);null!==(o=e)&&"object"==typeof o&&"catalogItemId"in o&&"price"in o?yield*vm(e,i,!1):yield ze(t,{level:kt,code:pm,message:`Catalog item not found for cart item id (${n})`})}else yield ze(t,{level:kt,code:pm,message:`Cart item not found for cart item id (${n})`});var o}function*vm(e,t,n){var i;const a=yield Ke(Kf,e.cartItemId),o=yield Ke(Zf,e),r=gm(o)?o:0,s=bm(a)?a.quantity:0;if(t!==s&&t>=(null!==(i=e.minItemCount)&&void 0!==i?i:0)&&t-s<=r){yield qe({type:Sf,payload:{catalogItem:e,quantity:t}});const i=yield Ke(Kf,e.cartItemId),o=yield Ke(nm);return yield qe({type:dn,payload:{cart:o}}),yield qe({type:tn,payload:{name:"SignalCartItemQuantitySelected",parentGuid:e.instanceGuid,objectData:{quantity:t,preselected:n}}}),yield qe({type:on,payload:{name:"V2_CART_ITEM_UPDATED",body:{oldCartItem:a,cartItem:i}}}),!0}return!1}function gm(e){return"number"==typeof e}function bm(e){return null!=e&&"object"==typeof e&&"cartItemId"in e&&"quantity"in e&&"unitPrice"in e}function*Im(e,t){var n;yield qe({type:wf,payload:{responseId:(n=t.payload,Kt(n)?n.responseOption.id:n.id)}}),yield ze(e.globalDispatch.bind(e),t)}function*Em(e,t){yield Ye([et(ym.bind(null,t)),et(mm.bind(null,e,t)),Xe(Cf,fm.bind(null,e,t)),Xe(Jt,Im.bind(null,e)),Ze(un,cf.bind(null,e,t)),Ze("*",Ns.bind(null,[Jt,un],e))])}function Sm(e){return"object"==typeof e&&null!==e&&"cartItemId"in e&&"quantity"in e}Object.assign(Object.assign({},pn),{CATALOG_ITEM_RESPONSE:Cf});const Cm=(new Oa).withAppFactory((function(n){var i;if(n.rootElement){const o=y(n.rootElement),r=function(e){return"object"==typeof e&&null!==e&&"cart"in e&&Array.isArray(e.cart)&&e.cart.every(Sm)}(n.offerState)?n.offerState:{cart:[]},s=function(e={}){return Object.assign({cart:lm([]),userCreativeResponseHistory:[],staticData:null,childLayouts:{launched:{}}},e)}({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion},cart:lm(r.cart)}),l=function(e,t,n){const i=ot(),a=it({reducer:cm,devTools:{name:"Add To Cart"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(Em,e,t),a}(n.gateway,n.logger,s);o.render(e(a.StrictMode,{children:t(Ma,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(Pr,{}),e(v,{store:l,children:e(Dr,{settings:n,dispatch:l.dispatch,children:e(sm,{})})})]})}))}}));var wm=Object.freeze({__proto__:null,moduleConnectorBuilder:Cm});const Om="CATALOG/TRIGGER_SELECT_ITEM",Tm="CATALOG/SET_SELECTED_ITEM",Am="CHECKOUT_LIFECYCLE",xm="INSTANT_PURCHASE/INITIATE",Nm="INSTANT_PURCHASE/PARTNER_RESPONSE",_m="INSTANT_PURCAHSE/WSDK_RESPONSE";function Lm(t,n,i,a,o){return e(ta,{value:i(n),children:Rm(t,a,o)})}function Rm(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Dm(t){const n=f(),i=Ti(),a=Ra(),{tabIndex:o,styles:r,isDisabled:s}=It(a),l=Va(),c=Ji(l,"catalogItem");return e(Ro,{styles:t.schema.styles,children:({classnames:a,mapperRef:d})=>e("button",{type:"button",tabIndex:o,"aria-disabled":s,disabled:s,style:Object.assign({cursor:"pointer"},r),"data-testid":t.testId,"data-e2e":"CatalogItemResponse",onClick:e=>{e.preventDefault();n({type:xm,payload:{catalogItem:l,quantity:1,useInstantPurchaseExtension:!0}})},className:null==a?void 0:a.own,children:e(Qi,{value:c,children:(null==a?void 0:a.own)?Lm(t.schema.children,a.own,d,i,t.testId):Rm(t.schema.children,i,t.testId)})})})}function km(t,n,i,a,o){return e(ta,{value:i(n),children:a(t,void 0,o)})}function Pm(e,t,n){return t(e,void 0,n)}const $m=["ArrowDown","ArrowUp","Enter","Escape","Tab"];function jm(n){const i=Ri(),a=Ti(),s=Va(),l=Xi(),u=e=>l({data:e},"catalogItem"),p=d((()=>i.catalogItems||[]),[i]),y=Ra(),{styles:m,isDisabled:h}=It(y),v=r(null),g=r([]),[b,I]=c(!1),[E,S]=c(0),C=f();function w(){h||(b?T():O())}function O(){h||I(!0)}function T(){h||I(!1)}function A(e){S(p.indexOf(e)),T(),C({type:Om,payload:{catalogItem:e}})}o((()=>{if(b){const e=g.current[E];e&&e.focus()}}),[b,E]);const x={elements:{own:[{default:{background:{backgroundColor:{light:"#ffffff"}},dimension:{width:{type:"percentage",value:100}}}}]}};function N(e){if(!h&&$m.includes(e.key))switch(e.key){case"ArrowDown":{e.preventDefault();const t=E+1;t<p.length&&S(t);break}case"ArrowUp":{e.preventDefault();const t=E-1;t>=0&&S(t);break}case"Enter":if(e.preventDefault(),b){const e=p[E];e&&A(e)}else O();break;case"Tab":if(b){T();const e=p.indexOf(s);-1!==e&&S(e)}break;case"Escape":if(e.preventDefault(),b){T();const e=p.indexOf(s);-1!==e&&S(e)}}}return e(Ro,{styles:n.schema.styles?zt(x,n.schema.styles):x,children:({classnames:i,mapperRef:o})=>t("div",{ref:v,className:null==i?void 0:i.own,onKeyDown:N,onClick:w,onBlur:e=>{var t;(null===(t=v.current)||void 0===t?void 0:t.contains(e.relatedTarget))||b&&T()},"data-e2e":"DropDown","data-testid":n.testId?`${n.testId}-drop-down-container`:void 0,"aria-disabled":h,style:Object.assign({position:"relative"},m),tabIndex:0,children:[e("div",{className:null==i?void 0:i.dropDownSelectedElement,"aria-disabled":h,"data-testid":n.testId?`${n.testId}-drop-down-selected-element`:void 0,style:Object.assign({cursor:"pointer"},m),children:e(Qi,{value:u(s),children:(null==i?void 0:i.dropDownSelectedElement)?km(n.schema.closedTemplate,i.dropDownSelectedElement,o,a,n.testId):Pm(n.schema.closedTemplate,a,n.testId)})}),b&&e("ul",{className:null==i?void 0:i.dropDownListContainer,onClick:e=>e.stopPropagation(),"data-testid":n.testId?`${n.testId}-drop-down-list-container`:void 0,tabIndex:-1,style:Object.assign({listStyle:"none",padding:0,zIndex:9999,position:"absolute",top:"100%",left:0,right:0,backgroundColor:"#FFF",overflow:"hidden"},m),children:p.map(((t,r)=>e("li",{ref:e=>function(e,t){g.current[t]=e}(e,r),className:null==i?void 0:i.dropDownListElement,onClick:e=>{e.stopPropagation(),h||A(t)},tabIndex:-1,"data-e2e":"DropDownItem","data-testid":n.testId?`${n.testId}-drop-down-item-${r}`:void 0,style:Object.assign({cursor:"pointer",display:"flex"},m),children:e(Qi,{value:u(t),children:(null==i?void 0:i.dropDownListElement)?km(n.schema.openTemplate,i.dropDownListElement,o,a,n.testId):Pm(n.schema.openTemplate,a,n.testId)})},t.catalogItemId)))})]})})}function Gm(t){const n=t.schema.styles,i=f(),o=m((e=>e.staticData)),r=Ra(),{tabIndex:s,styles:l,isDisabled:c}=It(r),d=()=>{var e;i({type:Am,payload:{event:"Checkout",targetStep:t.schema.targetStep,offerPositionIndex:null!==(e=null==o?void 0:o.position)&&void 0!==e?e:0,data:t.schema.data}})};return e(Ro,{styles:n,children:({classnames:n})=>{var i;return e("button",{title:t.schema.targetStep,className:null==n?void 0:n.own,onClick:d,"data-testid":t.testId,"data-e2e":"CheckoutStateButtonTrigger",disabled:c,"aria-disabled":c,"aria-label":null!==(i=t.schema.a11yLabel)&&void 0!==i?i:t.schema.targetStep,tabIndex:s,style:Object.assign({cursor:"pointer"},l),children:e(Oi,{children:e=>a.Children.toArray(t.schema.children.map(((n,i)=>e(n,void 0,Wt(i,t.testId)))))})})}})}const Fm=/^#([A-Fa-f0-9]{8}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{3})$/;function Mm(t){const n=Xi(),i=Ra(),{schema:a,testId:o}=t,r=n(a.value),{tabIndex:s,styles:l,isDisabled:c}=It(i);return"string"==typeof(d=r)&&Fm.test(d)?e(Ro,{styles:a.styles,children:({classnames:t})=>e("div",{"aria-hidden":c,className:null==t?void 0:t.own,"data-e2e":"ColorSwatch","data-testid":o,style:Object.assign({backgroundColor:r},l),tabIndex:s})}):null;var d}function Bm(n){const{schema:{styles:i},testId:r}=n,[s,l]=c(0),d=Va(),u=Ra(),{styles:p,isDisabled:y,tabIndex:f}=It(u);o((()=>{l(0)}),[d.catalogItemId]);const m=Object.values(d.images||{}),h=m[s]||m[0];return m.length>0&&h?e(Ro,{styles:i,children:({classnames:n})=>t("div",{className:null==n?void 0:n.own,children:[e("img",{"aria-hidden":y,src:h.light,alt:h.alt,title:h.title,className:null==n?void 0:n.mainImage,style:p,"data-testid":`${r}-main-image`,"data-e2e":"CatalogImageGallery-mainImage"}),e("div",{className:null==n?void 0:n.thumbnailList,style:Object.assign(Object.assign({},p),{display:"flex"}),children:a.Children.toArray(m.map(((t,i)=>e("img",{src:t.light,alt:t.alt,title:t.title,className:null==n?void 0:n.thumbnailImage,style:Object.assign(Object.assign({},p),{cursor:y?"not-allowed":"pointer",pointerEvents:"auto"}),"data-testid":`${r}-thumbnail-${i}`,"data-e2e":"CatalogImageGallery-thumbnail",tabIndex:f,onClick:()=>l(i)}))))})]})}):null}const Um={size:80,radius:30,stroke:7,duration:2,primaryColor:"#222",secondaryColor:"#d6d6d6",primaryRotation:-50,secondaryRotation:45,arcFraction:1/3.5},Vm={elements:{own:[{default:{container:{justifyContent:"center",alignItems:"center"},dimension:{width:{type:"percentage",value:100}}}}],spinner:[{default:{container:{justifyContent:"center",alignItems:"center"}}}]}};function zm(n){var i;const{config:a}=n.schema,o=Object.assign(Object.assign({},Um),a),r=o.radius,s=2*Math.PI*r,l=s*(null!==(i=o.arcFraction)&&void 0!==i?i:1/3.5),c=s-l,d=o.size/2,u={container:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%"},spinner:{display:"block",animation:`spin ${o.duration}s ease-in-out infinite`,transformOrigin:"center center"}};return e(Ro,{styles:n.schema.styles?zt(Vm,n.schema.styles):Vm,children:({classnames:i})=>t("div",{className:null==i?void 0:i.own,"data-testid":n.testId,"data-e2e":"LoadingSpinner",style:u.container,children:[t("svg",{width:o.size,height:o.size,viewBox:`0 0 ${o.size} ${o.size}`,className:null==i?void 0:i.spinner,style:u.spinner,children:[e("circle",{cx:d,cy:d,r:r,fill:"none",stroke:o.primaryColor,strokeWidth:o.stroke,strokeDasharray:`${l} ${c}`,strokeDashoffset:"0",strokeLinecap:"butt",transform:`rotate(${o.primaryRotation} ${d} ${d})`}),o.secondaryColor&&e("circle",{cx:d,cy:d,r:r,fill:"none",stroke:o.secondaryColor,strokeWidth:o.stroke,strokeDasharray:`${l} ${c}`,strokeDashoffset:"0",strokeLinecap:"butt",transform:`rotate(${o.secondaryRotation} ${d} ${d})`})]}),e("style",{children:"\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "})]})})}function Hm(t){const n=Ti(),i=Ga(),r=Xi(),s=Ei(),l=Ri().catalogItems||[],c=m((e=>e.selectedItem))||l[0];return o((()=>{c&&s({type:tn,payload:{name:"SignalImpression",parentGuid:null==c?void 0:c.instanceGuid}})}),[c,s]),c?e(Ro,{styles:t.schema.styles,children:({classnames:o})=>{return e("div",{"data-testid":t.testId,"data-e2e":"CatalogCombinedCollection",className:null==o?void 0:o.own,style:{display:"flex",flexDirection:"column"},children:a.Children.toArray(e(Ua,{context:c,children:e(ja,{value:i(c),children:e(Qi,{value:(s=c,r({data:s},"catalogItem")),children:n(t.schema.template,void 0,t.testId?`${t.testId}-child`:"")})})}))});var s}}):null}const Wm={CatalogResponseButton:function(t,n){if("CatalogResponseButton"===t.type)return e(Dm,{schema:t.node,testId:n})},CatalogCombinedCollection:function(t,n){if("CatalogCombinedCollection"===t.type)return e(Hm,{schema:t.node,testId:n})},EscapeHatch:function(t){if("EscapeHatch"===t.type&&t.node.data){const n=JSON.parse(t.node.data);switch(null==n?void 0:n.type){case"CatalogDropDown":return e(jm,{schema:n.node});case"CheckoutStateButtonTrigger":return e(Gm,{schema:n.node});case"ColorSwatch":return e(Mm,{schema:n.node});case"CatalogImageGallery":return e(Bm,{schema:n.node});case"LoadingSpinner":return e(zm,{schema:n.node});default:return}}}};function qm(){const t=_a(),n=Ti(),i=m(sf),a=Xi()({state:i},"textContent");return e(Ai,{value:n,overrides:Wm,children:e(Qi,{value:a,children:e(Oi,{children:e=>e(t)})})})}const Jm={staticData:ef,selectedItem:(e=null,t)=>t.type===Tm?t.payload:e,dynamicData:tf,childLayouts:Xy};function Km(e={}){return Object.assign({staticData:null,selectedItem:null,dynamicData:null,childLayouts:{launched:{}}},e)}const Ym="INVALID_RESPONSE_OBJECT";function Zm(e,t){return st((n=>e.onEvent({name:fl.PartnerMessage.CartItemInstantPurchaseResponse,source:"partner",callback:e=>{var i;"object"==typeof(i=e)&&null!==i&&"upsellItems"in i&&Array.isArray(i.upsellItems)&&i.upsellItems.every((e=>"object"==typeof e))&&"totalUpsellPrice"in i&&"number"==typeof i.totalUpsellPrice&&"currency"in i&&"string"==typeof i.currency&&"paid"in i&&"boolean"==typeof i.paid&&"success"in i&&"boolean"==typeof i.success?n(e):t({level:kt,code:"MALFORMED_INSTANT_PURCHASE_PARTNER_DATA",message:`Malformed data received from partner\n ${e}`})}})))}function*Qm(e,t){var n;try{for(;;){const t=yield We(e);t&&(yield qe({type:Nm,payload:t}))}}catch(e){yield ze(t,{level:kt,code:"INSTANT_PURCHASE_PARTNER_CHANNEL_ERROR",message:null!==(n=e.message)&&void 0!==n?n:"Unknown error in instant-purchase partner channel"})}finally{e.close()}}function*Xm(e,t){var n;try{for(;;){const t=yield We(e);if(t){yield qe({type:_m,payload:t});break}}}catch(e){yield ze(t,{level:kt,code:"INSTANT_PURCHASE_WSDK_CHANNEL_ERROR",message:null!==(n=e.message)&&void 0!==n?n:"Unknown error in instant-purchase WSDK channel"})}finally{e.close()}}function eh(e){const t=function(e){var t,n;return null!==(n=null===(t=e.staticData)||void 0===t?void 0:t.offer.catalogItems)&&void 0!==n?n:[]}(e);return t[0]}const th="Unknown failure reason",nh=6e4;function*ih(){const e=yield Ke(eh);e&&(yield*dh(e))}function*ah(e){const{catalogItem:t}=e.payload;yield*dh(t)}function*oh(e,t,n){const{catalogItem:i,quantity:a}=n.payload,o=_s(i,a);o?(yield qe({type:tn,payload:{name:"SignalCartItemInstantPurchaseInitiated",parentGuid:i.instanceGuid,objectData:{catalogItemId:i.catalogItemId,quantity:a}}}),yield*fh("ProcessingState",1),n.payload.useInstantPurchaseExtension?yield*function*(e,t,n){const i={upsellItems:[{cartItemId:e.cartItemId,catalogItemId:e.catalogItemId,quantity:e.quantity,unitPrice:e.unitPrice,totalPrice:e.totalPrice,currency:e.currency}],totalUpsellPrice:e.totalPrice,currency:e.currency};yield Qe(ch,t,n),yield qe({type:on,payload:{name:"INITIATE_INSTANT_PURCHASE_EVENT",body:i}})}(o,e,t):yield*function*(e,t,n){yield Qe(lh,t,n),yield qe({type:on,payload:{name:"CART_ITEM_INSTANT_PURCHASE",body:{upsellItems:[e],totalUpsellPrice:e.totalPrice||0,currency:e.currency}}})}(o,e,t)):(yield ze(t,{level:kt,code:Ym,message:`Unable to translate catalog item with ID ${i.catalogItemId} to cart item for instant purchase transaction.`}),yield*mh("offerComplete",2))}function*rh(e,t){const n=yield Ke((e=>e.staticData));if(!n)return yield ze(e,{level:kt,code:"MISSING_STATIC_DATA_IN_INSTANT_PURCHASE_MODULE",message:"App state is not configured with static data."}),void(yield*yh("Error"));if(!n.offer.catalogItems)return yield ze(e,{level:kt,code:"MISSING_CATALOG_ITEMS",message:"No catalog items found within offer data."}),void(yield*yh("Error"));const i={accountId:n.offer.accountId,catalogItems:n.offer.catalogItems};let a,o;t.payload.success?(a=uh,o="Success"):(a=(e,n)=>function(e,t,n,i){return{name:"SignalCartItemInstantPurchaseFailure",parentGuid:e.instanceGuid,objectData:{catalogItemId:e.catalogItemId,quantity:t,failureReason:i.reason||th,providerId:n.accountId.toString()}}}(e,n,i,t.payload),o="Unspecified"),yield*function*(e,t,n,i){const a=[];for(const i of e.upsellItems){const e=ph(i,t.catalogItems);void 0===e?a.push(i):yield qe({type:tn,payload:n(e,i.quantity)})}a.length>0&&(yield*function*(e,t){const n=JSON.stringify(e,null,"\t").replaceAll('"',"");yield ze(t,{level:kt,code:Ym,message:`Unable to map cart items to catalog items in the instant purchase partner response: ${n}.`})}(a,i))}(t.payload,i,a,e),yield*yh(o)}function*sh(e){e.payload.response&&e.payload.response.success?yield*mh("offerComplete",1):yield*mh("offerComplete",2)}function*lh(e,t){const n=Zm(e,t),{timeout:i}=yield tt({channel:ze(Qm,n,t),timeout:nt(nh)});i&&(yield ze(t,{level:kt,code:"INSTANT_PURCHASE_PARTNER_RESPONSE_TIMEOUT",message:"Instant-purchase partner response timed out after 60000ms"}),n.close(),yield*function*(e){yield*fh("ProcessingState",0),yield qe({type:nn,payload:{event:"Dismissed",dismissalReason:e}})}("Implicit"))}function*ch(e,t){const n=function(e,t){return st((n=>e.onEvent(...["INSTANT_PURCHASE_SUCCESS","INSTANT_PURCHASE_FAILURE"].map((e=>({name:e,source:"partner",callback:e=>{var i;"object"==typeof(i=e)&&null!==i&&"timestamp"in i&&"string"==typeof i.timestamp&&"sessionId"in i&&"string"==typeof i.sessionId?n(e):t({level:kt,code:"MALFORMED_INSTANT_PURCHASE_WSDK_DATA",message:`Malformed data received from wsdk\n ${e}`})}}))))))}(e,t),{timeout:i}=yield tt({channel:ze(Xm,n,t),timeout:nt(nh)});i&&(yield ze(t,{level:kt,code:"INSTANT_PURCHASE_WSDK_RESPONSE_TIMEOUT",message:"Instant-purchase wsdk response timed out after 60000ms"}),n.close(),yield*mh("offerComplete",2))}function*dh(e){var t,n,i;yield qe({type:Tm,payload:e});const a={title:null!==(t=e.title)&&void 0!==t?t:"",description:null!==(n=e.description)&&void 0!==n?n:"",price:null!==(i=e.priceFormatted)&&void 0!==i?i:""};e.copy&&Object.entries(e.copy).forEach((([e,t])=>{a[`copy.${e}`]=t})),yield qe({type:Qy,payload:{text:a}})}function uh(e,t){return{name:"SignalCartItemInstantPurchase",parentGuid:e.instanceGuid,objectData:{catalogItemId:e.catalogItemId,quantity:t,initiatedBy:Lt.DCUI}}}function ph(e,t){return t.find((t=>t.catalogItemId===e.catalogItemId))}function*yh(e){yield*fh("ProcessingState",0),yield qe({type:nn,payload:{event:"Completed",completionReason:e}})}function*fh(e,t){yield qe({type:an,payload:{key:e,value:t}})}function*mh(e,t){yield*fh("ProcessingState",0),yield qe({type:rn,payload:{key:e,value:t}})}const hh=["Success","Unspecified","Error"],vh=["Implicit","Explicit"];function*gh(e,t){if("Checkout"!==t.payload.event)return;yield qe({type:rn,payload:{key:"checkout",value:bh(t.payload),offerPositionIndex:t.payload.offerPositionIndex}});const n=t.payload.data;if(n){const t="Completed"===n.event;if("Completed"===n.event||"Dismissed"===n.event){(t?hh.includes(n.reason):vh.includes(n.reason))||(yield ze(e,{level:kt,code:"CHECKOUT_BTN_INVALID_OFFERLIFECYCLE",message:`Misconfigured offer lifecycle payload in handleCheckoutLifecycle: ${n}.`}))}else yield ze(e,{level:kt,code:"CHECKOUT_BTN_UNKNOWN_EVENT",message:`Unknown event type in checkout lifecycle: ${JSON.stringify(n)}`})}}function bh(e){var t;return null!==(t={ViewOffer:0,ViewTransactionDetails:1,EditPayment:2,EditShipping:3,EditPaymentAndShipping:4,CostBreakdown:5,Confirmation:6,CloseOffer:7}[e.targetStep])&&void 0!==t?t:0}function*Ih(e,t){yield Ye([et(ih),Ze(Am,gh.bind(null,t)),Ze(Om,ah),Xe(xm,oh.bind(null,e,t)),Xe(Nm,rh.bind(null,t)),Xe(_m,sh.bind(null)),Ze(un,cf.bind(null,e,t)),Ze("*",Ns.bind(null,[Jt,un],e))])}Object.assign(Object.assign({},pn),{INITIATE_INSTANT_PURCHASE:xm,INSTANT_PURCHASE_PARTNER_RESPONSE:Nm,INSTANT_PURCHASE_WSDK_RESPONSE:_m});const Eh=(new Oa).withAppFactory((function(n){var i;if(n.rootElement){const o=y(n.rootElement),r=Km({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),s=function(e,t,n=Km()){const i=ot(),a=it({reducer:Jm,devTools:{name:"Instant Purchase"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(Ih,e,t),a}(n.gateway,n.logger,r);o.render(e(a.StrictMode,{children:t(Ma,{info:{referralCreativeId:(null===(i=n.offerData.creative.referralCreativeId)||void 0===i?void 0:i.toString())||"N/A"},children:[e(Pr,{}),e(v,{store:s,children:e(Dr,{settings:n,dispatch:s.dispatch,children:e(qm,{})})})]})}))}}));var Sh=Object.freeze({__proto__:null,moduleConnectorBuilder:Eh});const Ch=s(null),wh=({children:t})=>{var n;const[i,a]=c([]),[r,s]=c(0),[l,d]=c(0),u=Xi();return o((()=>{let e=0;const t=i.length,n=setInterval((()=>{e=e+1>=t?0:e+1,s(e)}),l);return()=>clearInterval(n)}),[l,i]),e(Ch.Provider,{value:{images:i,activeIndex:r,duration:l,setImages:a,setActiveIndex:s,setDuration:d},children:e(Qi,{value:u({data:{"image.title":null===(n=i[r])||void 0===n?void 0:n.title}},"creativeCopy"),children:t})})};function Oh({active:t,duration:n,containerStyles:i,indicatorStyles:a}){const s=r(null);return o((()=>{t&&s.current&&function(e,t){const n="animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype,i=[{width:0},{width:"100%"}];if(n){const n=e.animate(i,{duration:t,iterations:1});return()=>{n.finish()}}}(s.current,n)}),[t]),e("div",{style:Object.assign({position:"relative",height:"2px",width:"100%",backgroundColor:"#FFFFFF66"},i),children:e("span",{ref:s,style:Object.assign({animationIterationCount:"infinite",animationFillMode:"forwards",animationTimingFunction:"linear",position:"absolute",top:0,left:0,height:"100%",backgroundColor:"#FFF",width:t?"100%":0},a)})})}function Th(e){const t=l($a),n=[];return e.forEach((e=>{const i=t(`${e}.src`,"copy"),a=t(`${e}.title`,"copy");if(void 0===i)return;const o=function(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)}({light:i,title:a});n.push(o)})),n}function Ah({schema:n,testId:i}){const r=JSON.parse(n.data),{styles:s,duration:c,imageKeys:d}=r,u=l(Ch),p=Th(d);return o((()=>{null==u||u.setImages(p),null==u||u.setDuration(c)}),[]),t("div",{"data-testid":i,style:Object.assign({position:"relative",flexShrink:1,flexGrow:0,width:"100%"},s.elements.own),children:[a.Children.toArray(p.map(((t,n)=>e("img",{src:t.light,alt:t.title,style:Object.assign({opacity:n===(null==u?void 0:u.activeIndex)?1:0,position:0===n?"relative":"absolute",display:0===n?"block":"",top:0,width:"100%",height:"100%",maxHeight:"100%",maxWidth:"100%",transition:"opacity 300ms ease-in-out",objectFit:"contain"},s.elements.image)})))),e("div",{style:Object.assign({display:"flex",gap:"2px",width:"70%",position:"absolute",margin:"0 15%",bottom:"8px",zIndex:20,justifyContent:"center"},s.elements.indicatorWrapper),children:a.Children.toArray(p.map(((t,n)=>e(Oh,{duration:c,active:n===(null==u?void 0:u.activeIndex),containerStyles:s.elements.indicatorContainer,indicatorStyles:s.elements.indicator}))))})]})}const xh={allowedTags:["em","strong","a","br","u","p","li","ul","ol","span"],allowedAttributes:{a:["href","target"],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],span:[]},allowedSchemes:["http","https"]},Nh=new Map([["&","_;^;_"]]),_h=new RegExp(`<a *(?=${xh.allowedAttributes.a.join("|")}|>)`,"g"),Lh=new RegExp("<span*>","g"),Rh=new RegExp(`<a *(?:(?:${xh.allowedAttributes.a.filter((e=>"href"!==e)).join("|")})="[^"]*")* *href="([^"]+)"`,"g"),Dh=new RegExp("(<br *?>)|(<br *?/>)","g"),kh="<br/>";function Ph(t){const n=Xi(),i=Ra(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Rh,((e,t)=>{const n=t.replaceAll("&",Nh.get("&"));return e.replace(t,n)})).replaceAll(Dh,kh)}(e);return t===vt(t,xh)}(e))throw new Pt("FAILED_SANITISING_HTML","Invalid HTML tags");return e}),[t.schema.value,n]),{tabIndex:o,styles:r,isDisabled:s}=It(i);return a?e(Ro,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(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=a,new RegExp("</(p|ul|ol)>").test(l)?e("div",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(_h,`<a ${i.join(" ")}`).replace(Lh,`<span${(null==n?void 0:n.span)?` class=${n.span}`:""}>`)}}):e("p",{tabIndex:o,style:r,"aria-hidden":s,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(_h,`<a ${i.join(" ")}`).replace(Lh,`<span${(null==n?void 0:n.span)?` class=${n.span}`:""}>`)}});var l}}):null}function $h({schema:t}){const n=Ti(),i=mi(Ha(),oa()),o=JSON.parse(t.data),[r]=ht({loop:!1,align:"start",slidesToScroll:2,containScroll:"trimSnaps"}),{styles:s,body:{tierItems:l}}=o;if(!l||!l.length)return;const c=l.length>2;return e("div",{className:i`
137
137
  position: relative;
138
138
  `,"data-testid":"ProductTierCarousel",children:e("div",Object.assign({},c&&{ref:r},{className:i`
139
139
  width: 100%;
@@ -172,24 +172,24 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import*as i from
172
172
  background-color: ${(null===(d=null==s?void 0:s.primaryColor)||void 0===d?void 0:d.light)||"#F9FAFB"};
173
173
  color: #f9fafb;
174
174
  }
175
- `,children:a.Children.toArray(t.map((e=>n(e))))})})))})}))})}const $h=(e,t)=>`\n position: absolute;\n top: 0;\n ${t?"right: 0;":"left: 0;"}\n bottom: 0;\n opacity: 0;\n z-index: 10;\n padding: 0 16px;\n transition: opacity 200ms ease-in-out;\n pointer-events: ${e?"none":"auto"};\n background: linear-gradient(${t?"":"-"}90deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.70) 100%);\n &:hover {\n opacity: ${e?0:1};\n }\n`;function jh({disabled:t,onClick:n}){const i=hi(Wa(),ra());return e("button",{onClick:n,disabled:t,className:i`
176
- ${$h(t)}
177
- `,children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:e("path",{d:"M14.2951 18L15.7051 16.59L11.1251 12L15.7051 7.41L14.2951 6L8.29508 12L14.2951 18Z",fill:"#ffffff"})})})}function Gh({disabled:t,onClick:n}){const i=hi(Wa(),ra());return e("button",{onClick:n,disabled:t,className:i`
178
- ${$h(t,!0)}
179
- `,children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:e("path",{d:"M9.70492 6L8.29492 7.41L12.8749 12L8.29492 16.59L9.70492 18L15.7049 12L9.70492 6Z",fill:"#ffffff"})})})}function Fh(e){const t=l(ja);return e.map((e=>({src:t(`${e}.link.src`,"copy"),open:t(`${e}.link.open`,"copy")})))}function Mh(e){return{type:"StaticImage",node:{url:e,styles:{elements:{own:[{default:{border:{borderRadius:5,borderWidth:"0"},dimension:{width:{type:"percentage",value:100}}}}]}}}}}function Bh(e,t){return{type:"CreativeResponse",node:{responseKey:"positive",styles:{elements:{own:[{default:{spacing:{padding:"0"},background:{backgroundColor:{light:"#F9FAFB"}},border:{borderWidth:"0"}}}]}},children:t?[Mh(t)]:[]}}}function Uh({schema:n}){var i,r;const s=Ai(),l=hi(Wa(),ra()),d=function(e){try{return JSON.parse(e.data)}catch(e){return null}}(n),[u,p]=[Oh((null===(i=null==d?void 0:d.body)||void 0===i?void 0:i.imageKeys)||[]),Fh((null===(r=null==d?void 0:d.body)||void 0===r?void 0:r.imageKeys)||[])],y=Di(),f=y.creative.responseOptionsMap.positive,{carousel:m,styles:h}=(null==d?void 0:d.body)||{},v=(null==m?void 0:m.slidesToScroll)||3,g=(null==m?void 0:m.aspectRatio)||"1/1",b=!(null==m?void 0:m.disabled)&&Array.isArray(u)&&u.length>2,I=b?u:null==u?void 0:u.slice(0,v),[E,S]=ht({loop:!1,align:"start",slidesToScroll:v,containScroll:"trimSnaps"}),{prevBtnDisabled:w,nextBtnDisabled:C,onPrevButtonClick:O,onNextButtonClick:T}=function(e){const[t,n]=c(!0),[i,a]=c(!0);return o((()=>{if(!e)return;const t=()=>{n(!e.canScrollPrev()),a(!e.canScrollNext())};t(),e.on("reInit",t).on("select",t)}),[e]),{prevBtnDisabled:t,nextBtnDisabled:i,onPrevButtonClick:e?e.scrollPrev:void 0,onNextButtonClick:e?e.scrollNext:void 0}}(S);return d&&I&&I.length&&f?t("div",{"data-testid":"product-catalog-carousel",className:l`
175
+ `,children:a.Children.toArray(t.map((e=>n(e))))})})))})}))})}const jh=(e,t)=>`\n position: absolute;\n top: 0;\n ${t?"right: 0;":"left: 0;"}\n bottom: 0;\n opacity: 0;\n z-index: 10;\n padding: 0 16px;\n transition: opacity 200ms ease-in-out;\n pointer-events: ${e?"none":"auto"};\n background: linear-gradient(${t?"":"-"}90deg, rgba(0,0,0,0.00) 0%, rgba(0,0,0,0.70) 100%);\n &:hover {\n opacity: ${e?0:1};\n }\n`;function Gh({disabled:t,onClick:n}){const i=mi(Ha(),oa());return e("button",{onClick:n,disabled:t,className:i`
176
+ ${jh(t)}
177
+ `,children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:e("path",{d:"M14.2951 18L15.7051 16.59L11.1251 12L15.7051 7.41L14.2951 6L8.29508 12L14.2951 18Z",fill:"#ffffff"})})})}function Fh({disabled:t,onClick:n}){const i=mi(Ha(),oa());return e("button",{onClick:n,disabled:t,className:i`
178
+ ${jh(t,!0)}
179
+ `,children:e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:e("path",{d:"M9.70492 6L8.29492 7.41L12.8749 12L8.29492 16.59L9.70492 18L15.7049 12L9.70492 6Z",fill:"#ffffff"})})})}function Mh(e){const t=l($a);return e.map((e=>({src:t(`${e}.link.src`,"copy"),open:t(`${e}.link.open`,"copy")})))}function Bh(e){return{type:"StaticImage",node:{url:e,styles:{elements:{own:[{default:{border:{borderRadius:5,borderWidth:"0"},dimension:{width:{type:"percentage",value:100}}}}]}}}}}function Uh(e,t){return{type:"CreativeResponse",node:{responseKey:"positive",styles:{elements:{own:[{default:{spacing:{padding:"0"},background:{backgroundColor:{light:"#F9FAFB"}},border:{borderWidth:"0"}}}]}},children:t?[Bh(t)]:[]}}}function Vh({schema:n}){var i,r;const s=Ti(),l=mi(Ha(),oa()),d=function(e){try{return JSON.parse(e.data)}catch(e){return null}}(n),[u,p]=[Th((null===(i=null==d?void 0:d.body)||void 0===i?void 0:i.imageKeys)||[]),Mh((null===(r=null==d?void 0:d.body)||void 0===r?void 0:r.imageKeys)||[])],y=Ri(),f=y.creative.responseOptionsMap.positive,{carousel:m,styles:h}=(null==d?void 0:d.body)||{},v=(null==m?void 0:m.slidesToScroll)||3,g=(null==m?void 0:m.aspectRatio)||"1/1",b=!(null==m?void 0:m.disabled)&&Array.isArray(u)&&u.length>2,I=b?u:null==u?void 0:u.slice(0,v),[E,S]=ht({loop:!1,align:"start",slidesToScroll:v,containScroll:"trimSnaps"}),{prevBtnDisabled:C,nextBtnDisabled:w,onPrevButtonClick:O,onNextButtonClick:T}=function(e){const[t,n]=c(!0),[i,a]=c(!0);return o((()=>{if(!e)return;const t=()=>{n(!e.canScrollPrev()),a(!e.canScrollNext())};t(),e.on("reInit",t).on("select",t)}),[e]),{prevBtnDisabled:t,nextBtnDisabled:i,onPrevButtonClick:e?e.scrollPrev:void 0,onNextButtonClick:e?e.scrollNext:void 0}}(S);return d&&I&&I.length&&f?t("div",{"data-testid":"product-catalog-carousel",className:l`
180
180
  position: relative;
181
181
  margin: 8px 0;
182
182
  ${h||""}
183
- `,children:[b?e(jh,{onClick:O,disabled:w}):null,e("div",Object.assign({},b&&{ref:E},{className:l`
183
+ `,children:[b?e(Gh,{onClick:O,disabled:C}):null,e("div",Object.assign({},b&&{ref:E},{className:l`
184
184
  width: 100%;
185
185
  margin: auto;
186
186
  overflow: hidden;
187
187
  `,children:e("div",{className:l`
188
188
  display: flex;
189
189
  gap: 16px;
190
- `,children:a.Children.toArray(I.map(((t,n)=>{var i,a;const o=Object.assign(Object.assign({},f),{url:null===(i=null==p?void 0:p[n])||void 0===i?void 0:i.src}),r=Object.assign(Object.assign({},y),{creative:Object.assign(Object.assign({},y.creative),{responseOptionsMap:Object.assign(Object.assign({},y.creative.responseOptionsMap),{positive:o})})});return e(Ri,{context:r,children:e("div",{"data-testid":"carousel-item",className:l`
190
+ `,children:a.Children.toArray(I.map(((t,n)=>{var i,a;const o=Object.assign(Object.assign({},f),{url:null===(i=null==p?void 0:p[n])||void 0===i?void 0:i.src}),r=Object.assign(Object.assign({},y),{creative:Object.assign(Object.assign({},y.creative),{responseOptionsMap:Object.assign(Object.assign({},y.creative.responseOptionsMap),{positive:o})})});return e(Li,{context:r,children:e("div",{"data-testid":"carousel-item",className:l`
191
191
  min-width: 0;
192
192
  overflow: hidden;
193
193
  aspect-ratio: ${g};
194
194
  ${b?"flex: 0 0 33%;":`width: ${100/v}%;`}
195
- `,children:s((null===(a=null==p?void 0:p[n])||void 0===a?void 0:a.src)?Bh(p[n],t):Mh(t))})})})))})})),b?e(Gh,{onClick:T,disabled:C}):null]}):null}function Vh({schema:i}){const a=JSON.parse(i.data),{styles:o,content:r,smallFontSize:s,largeFontSize:l}=a,c=ea();return t(n,{children:[e("style",{children:`\n @keyframes textAnimation {\n 0% { transform: scale(1); }\n 42% { transform: scale(1.2); } /* 800ms out of 1900ms cycle */\n 60% { transform: scale(1.2); }\n 100% { transform: scale(1); }\n }\n\n .animated-text {\n font-size: ${s}px;\n animation: textAnimation 1.9s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;\n }\n `}),e("p",{style:Object.assign({},o),className:"animated-text",children:c(r)})]})}const zh={EscapeHatch:function(t){if("EscapeHatch"===t.type&&t.node.data){const n=JSON.parse(t.node.data);switch(null==n?void 0:n.type){case"ImageCarousel":return e(Th,{schema:t.node});case"RichText":return e(kh,{schema:n.node});case"ProductTierCarousel":return e(Ph,{schema:t.node});case"ProductCatalogCarousel":return e(Uh,{schema:t.node});case"TextAnimate":return e(Vh,{schema:t.node});default:return}}}};function Hh(){const t=La(),n=Ai();return e(wh,{children:e(xi,{value:n,overrides:zh,children:e(Ti,{children:e=>e(t)})})})}const Wh={staticData:tf,childLayouts:ef};function qh(e={}){return Object.assign({staticData:null,childLayouts:{launched:{}}},e)}function Jh(e){let t,n,i;return st((a=>(Promise.race([e.onClose().then((()=>"CLOSED")),new Promise((n=>{t=e.onEvent("PLUGIN_TRANSITION_OFFER_SUCCESS").subscribe((()=>{n("SUCCESS")}))})),new Promise((t=>{n=e.onEvent("PLUGIN_TRANSITION_OFFER_CLOSE").subscribe((()=>{t("UNSPECIFIED")}))})),new Promise((e=>{i=e}))]).then((e=>{"END"!==e&&(a(e),a(lt))})),()=>{null==t||t.unsubscribe(),null==n||n.unsubscribe(),i("END")})))}function*Yh(e,t){for(;;){switch(yield We(e)){case"CLOSED":t({type:an,payload:{event:"Dismissed",dismissalReason:"Implicit"}});break;case"SUCCESS":t({type:an,payload:{event:"Completed",completionReason:"Success"}});break;case"UNSPECIFIED":t({type:an,payload:{event:"Completed",completionReason:"Unspecified"}})}}}function*Kh(e,t,n){const i=Qt(n.payload)||Xt(n.payload)||Zt(n.payload)?n.payload:n.payload.responseOption;switch(i.action){case"Url":case"CaptureOnly":yield ze(e.globalDispatch.bind(e),n);break;case"Fulfillment":yield qe({type:rn,payload:{name:"OFFER_ENGAGEMENT"}}),i.isPositive&&(yield qe({type:rn,payload:{name:"POSITIVE_ENGAGEMENT"}})),yield*function*(e,t,n){if(Kt(n)){const{responseOption:i,fulfillment:a}=n;yield qe({type:nn,payload:{name:"SignalResponse",parentGuid:i.instanceGuid,responseActionPayload:{name:"Fulfillment"}}});const o=yield ze(e.createChildPlugin.bind(e),a);if("object"==typeof o&&"onClose"in o){const t=yield ze(Jh,o);if("object"==typeof t&&"take"in t)return void(yield ze(Yh,t,e.globalDispatch.bind(e)))}yield ze(t,{level:kt,code:"UNEXPECTED_NEXT_VALUE_IN_SAGA",message:'Received an unexpected input at a step in the saga "handleFullfillmentResponse" and could not continue.'})}else yield ze(t,{level:kt,code:"INVALID_FULFILLMENT_PAYLOAD",message:`Fulfillment payload is invalid, fulfillment: ${n}`})}(e,t,n.payload)}}function*Zh(e,t){yield Ke([Xe(Yt,Kh.bind(null,e,t)),Ze(pn,df.bind(null,e,t)),Ze("*",_s.bind(null,[Yt,pn],e))])}Object.assign({},yn);const Qh=(new Ta).withAppFactory((function(n){if(n.rootElement){const i=y(n.rootElement),o=qh({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),r=function(e,t,n=qh()){const i=ot(),a=it({reducer:Wh,devTools:{name:"layouts-xp-sandbox"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(Zh,e,t),a}(n.gateway,n.logger,o);i.render(e(a.StrictMode,{children:t(Ba,{info:{layoutType:"LayoutVariant",referralCreativeId:String(n.offerData.creative.referralCreativeId)||"N/A"},children:[e($r,{}),e(v,{store:r,children:e(kr,{settings:n,dispatch:r.dispatch,children:e(Hh,{})})})]})}))}}));var Xh=Object.freeze({__proto__:null,moduleConnectorBuilder:Qh});export{Ny as BehaviorSubject,By as CatchSubscriber,Yy as DisplayPreset,Ky as ErrorLevel,Ly as FirstValueFromError,Ay as Observable,_y as ReplaySubject,xy as Subject,Cy as Subscription,My as addCatchToSubscriber,Gy as combineLatest,Zy as dcuiUtils,Hy as filter,Wy as first,Ry as firstValueFrom,ky as fromEvent,Py as fromPromise,wy as init,Dy as lastValueFrom,qy as map,$y as merge,Oy as noop,Ty as normaliseToObserver,jy as of,zy as pipe,Jy as tap};
195
+ `,children:s((null===(a=null==p?void 0:p[n])||void 0===a?void 0:a.src)?Uh(p[n],t):Bh(t))})})})))})})),b?e(Fh,{onClick:T,disabled:w}):null]}):null}function zh({schema:i}){const a=JSON.parse(i.data),{styles:o,content:r,smallFontSize:s,largeFontSize:l}=a,c=Xi();return t(n,{children:[e("style",{children:`\n @keyframes textAnimation {\n 0% { transform: scale(1); }\n 42% { transform: scale(1.2); } /* 800ms out of 1900ms cycle */\n 60% { transform: scale(1.2); }\n 100% { transform: scale(1); }\n }\n\n .animated-text {\n font-size: ${s}px;\n animation: textAnimation 1.9s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;\n }\n `}),e("p",{style:Object.assign({},o),className:"animated-text",children:c(r)})]})}const Hh={EscapeHatch:function(t){if("EscapeHatch"===t.type&&t.node.data){const n=JSON.parse(t.node.data);switch(null==n?void 0:n.type){case"ImageCarousel":return e(Ah,{schema:t.node});case"RichText":return e(Ph,{schema:n.node});case"ProductTierCarousel":return e($h,{schema:t.node});case"ProductCatalogCarousel":return e(Vh,{schema:t.node});case"TextAnimate":return e(zh,{schema:t.node});default:return}}}};function Wh(){const t=_a(),n=Ti();return e(wh,{children:e(Ai,{value:n,overrides:Hh,children:e(Oi,{children:e=>e(t)})})})}const qh={staticData:ef,childLayouts:Xy};function Jh(e={}){return Object.assign({staticData:null,childLayouts:{launched:{}}},e)}function Kh(e){let t,n,i;return st((a=>(Promise.race([e.onClose().then((()=>"CLOSED")),new Promise((n=>{t=e.onEvent("PLUGIN_TRANSITION_OFFER_SUCCESS").subscribe((()=>{n("SUCCESS")}))})),new Promise((t=>{n=e.onEvent("PLUGIN_TRANSITION_OFFER_CLOSE").subscribe((()=>{t("UNSPECIFIED")}))})),new Promise((e=>{i=e}))]).then((e=>{"END"!==e&&(a(e),a(lt))})),()=>{null==t||t.unsubscribe(),null==n||n.unsubscribe(),i("END")})))}function*Yh(e,t){for(;;){switch(yield We(e)){case"CLOSED":t({type:nn,payload:{event:"Dismissed",dismissalReason:"Implicit"}});break;case"SUCCESS":t({type:nn,payload:{event:"Completed",completionReason:"Success"}});break;case"UNSPECIFIED":t({type:nn,payload:{event:"Completed",completionReason:"Unspecified"}})}}}function*Zh(e,t,n){const i=Zt(n.payload)||Qt(n.payload)||Yt(n.payload)?n.payload:n.payload.responseOption;switch(i.action){case"Url":case"CaptureOnly":yield ze(e.globalDispatch.bind(e),n);break;case"Fulfillment":yield qe({type:on,payload:{name:"OFFER_ENGAGEMENT"}}),i.isPositive&&(yield qe({type:on,payload:{name:"POSITIVE_ENGAGEMENT"}})),yield*function*(e,t,n){if(Kt(n)){const{responseOption:i,fulfillment:a}=n;yield qe({type:tn,payload:{name:"SignalResponse",parentGuid:i.instanceGuid,responseActionPayload:{name:"Fulfillment"}}});const o=yield ze(e.createChildPlugin.bind(e),a);if("object"==typeof o&&"onClose"in o){const t=yield ze(Kh,o);if("object"==typeof t&&"take"in t)return void(yield ze(Yh,t,e.globalDispatch.bind(e)))}yield ze(t,{level:Dt,code:"UNEXPECTED_NEXT_VALUE_IN_SAGA",message:'Received an unexpected input at a step in the saga "handleFullfillmentResponse" and could not continue.'})}else yield ze(t,{level:Dt,code:"INVALID_FULFILLMENT_PAYLOAD",message:`Fulfillment payload is invalid, fulfillment: ${n}`})}(e,t,n.payload)}}function*Qh(e,t){yield Ye([Xe(Jt,Zh.bind(null,e,t)),Ze(un,cf.bind(null,e,t)),Ze("*",Ns.bind(null,[Jt,un],e))])}Object.assign({},pn);const Xh=(new Oa).withAppFactory((function(n){if(n.rootElement){const i=y(n.rootElement),o=Jh({staticData:{offer:n.offerData,position:n.offerPositionIndex,schemaVersion:n.schemaVersion}}),r=function(e,t,n=Jh()){const i=ot(),a=it({reducer:qh,devTools:{name:"layouts-xp-sandbox"},preloadedState:n,middleware:e=>e({thunk:!1}).concat(i)});return i.run(Qh,e,t),a}(n.gateway,n.logger,o);i.render(e(a.StrictMode,{children:t(Ma,{info:{layoutType:"LayoutVariant",referralCreativeId:String(n.offerData.creative.referralCreativeId)||"N/A"},children:[e(Pr,{}),e(v,{store:r,children:e(Dr,{settings:n,dispatch:r.dispatch,children:e(Wh,{})})})]})}))}}));var ev=Object.freeze({__proto__:null,moduleConnectorBuilder:Xh});export{xy as BehaviorSubject,My as CatchSubscriber,Jy as DisplayPreset,Ky as ErrorLevel,_y as FirstValueFromError,Ty as Observable,Ny as ReplaySubject,Ay as Subject,Cy as Subscription,Fy as addCatchToSubscriber,jy as combineLatest,Yy as dcuiUtils,zy as filter,Hy as first,Ly as firstValueFrom,Dy as fromEvent,ky as fromPromise,Sy as init,Ry as lastValueFrom,Wy as map,Py as merge,wy as noop,Oy as normaliseToObserver,$y as of,Vy as pipe,qy as tap};