@rokt/dcui-orchestrator 1.2.1-rc.44 → 1.2.1-rc.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom/client"),i=require("react-redux"),a=require("ramda"),o=require("@emotion/css"),r=require("redux-saga/effects"),s=require("redux-saga"),l=require("@reduxjs/toolkit"),c=require("@redux-saga/core/effects"),d=require("embla-carousel-react"),u=require("insane"),p=require("@emotion/css/create-instance"),f=require("embla-carousel-autoplay"),h=require("embla-carousel-fade");function v(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var y,m,C=v(t);function g(e){const t=["elements","own"],n=["default","dimension","width","type"],i=["default","dimension","width","value"],o=["default","dimension","minWidth"],r=a.path(t,e);return r&&Array.isArray(r)&&r.length?a.assocPath(t,r.map(a.when(a.allPass([a.hasPath(n),a.complement(a.hasPath(o)),a.pathEq("fixed",n)]),(e=>a.assocPath(o,a.path(i,e),e)))),e):e}function b(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function E(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function I(){return"ontouchstart"in document.documentElement}function x(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function L(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function D(e){return L(e)&&"Fulfillment"===e.action}function w(e){return L(e)&&"Url"===e.action}function S(e){return L(e)&&"CaptureOnly"===e.action}function A(e){return L(e)&&"ExternalPaymentTrigger"===e.action}function O(e){return(D(e)||w(e))&&"RealTime"===e.conversionType&&"rclid"in e}function T(e){return(D(e)||w(e))&&"RealTimeReferral"===e.conversionType&&"rclid"in e}function j(e){switch(e){case"SignalGatedResponse":return"SignalGatedResponse";case"SignalOptInResponse":return"SignalOptInResponse";case"SignalOptOutResponse":return"SignalOptOutResponse";default:return"SignalResponse"}}function k(e){return e.slice(e.lastIndexOf(":")+1)}function M(e){return{oldCartItem:null,cartItem:{cartItemId:e,catalogItemId:"",name:"",description:"",quantity:0,unitPrice:0,totalPrice:0,currency:"",providerData:""}}}!function(e){e.Unknown="Unknown",e.InStock="InStock",e.OutOfStock="OutOfStock"}(y||(y={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.Other=1]="Other",e[e.Card=2]="Card",e[e.PayPal=3]="PayPal",e[e.ApplePay=4]="ApplePay",e[e.GooglePay=5]="GooglePay",e[e.Afterpay=6]="Afterpay"}(m||(m={}));const R="FAILED_TO_PROCESS_PARTNER_UPDATE_CART_ITEM";function V(e){return null!==e&&"object"==typeof e&&"cartItemId"in e&&"string"==typeof e.cartItemId&&"quantity"in e&&"number"==typeof e.quantity&&!("unitPrice"in e)}const P={pluginId:"shared",pageInstanceGuid:"N/A"},H="offerComplete",_="checkout",N="layoutMinimized";function F(e){return e.registrationCount>0}function $(e){return e.validated&&!e.valid&&e.errorVisible}function Z(e,t=[]){const n=0===e.trim().length;for(const i of t){if(n&&"Required"!==i.type)continue;const t=G(e,i);if(t)return t}return""}function G(e,t){switch(t.type){case"Required":return 0===e.trim().length?t.value.message:"";case"MinLength":return e.length<t.value.length?t.value.message:"";case"MaxLength":return e.length>t.value.length?t.value.message:"";case"Pattern":return function(e,t){try{return new RegExp(t).test(e)}catch(e){return!0}}(e,t.value.pattern)?"":t.value.message;default:return""}}function B(e,t){return t.flatMap((t=>{var n;const i=t.indexOf(".");if(-1===i){const i=null!==(n=e[t])&&void 0!==n?n:{};return Object.entries(i).filter((([,e])=>F(e))).map((([e])=>({formKey:t,fieldKey:e})))}return[{formKey:t.slice(0,i),fieldKey:t.slice(i+1)}]}))}var U;!function(e){e.DCUI="DCUI",e.Partner="partner"}(U||(U={}));const z=["SignalCartItemQuantitySelected","SignalProductItemResponse","SignalUserInteraction","SignalOptInResponse","SignalOptOutResponse"],q="ERROR",K="INFO",W="WARNING";class Y extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const J=["V2_CART_ITEM_UPDATED","UPDATE_CART_ITEM_MESSAGE","CART_ITEM_INSTANT_PURCHASE","UPSELL_ITEM_INSTANT_PURCHASE","DELIVERY_DETAILS_SENT","OFFER_ENGAGEMENT","POSITIVE_ENGAGEMENT","UPSELL_CREATIVE_SENT","REALTIME_OFFER_FULFILLMENT_REFERRAL","REALTIME_OFFER_FULFILLMENT_CONVERSION","REALTIME_OFFER_FULFILLMENT_SUCCESS","INITIATE_INSTANT_PURCHASE_EVENT","INSTANT_PURCHASE_INITIATE_TAX_AND_SHIPPING_EVENT","INITIATE_CART_ITEM_EVENT","PREPARE_DEVICE_PAY_EVENT","INITIATE_DEVICE_PAY_EVENT","ABORT_DEVICE_PAY_EVENT","COMPLETE_DEVICE_PAY_EVENT","LEAD_CAPTURE_SUBMITTED","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];function X(e,t){const n=null==e?void 0:e.creative.responseOptionsMap[t];return"positive"===t&&w(n)&&n.isPositive&&"string"==typeof n.url&&n.url.trim()&&"SignalSecondaryResponse"!==n.signalType&&(void 0===n.conversionType||"Default"===n.conversionType)?n:void 0}function Q(e,t){const n=null==e?void 0:e.creative.responseOptionsMap[t];if(n&&Boolean(n.isPositive)===("positive"===t)&&"SignalSecondaryResponse"!==n.signalType)return S(n)?n:!w(n)||"negative"!==t||void 0!==n.conversionType&&"Default"!==n.conversionType?X(e,t):n}const ee=(e,t)=>a.concat(e,a.slice(e.length,t.length,t)),te=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?ee(t,e):t,i=t.length>e.length?ee(e,t):e;return a.zipWith(re,i,n)}return t},ne=e=>null==e,ie=e=>!ne(e),ae=(e,t)=>ne(t)?e:t,oe=(e,t)=>{throw new Y("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function re(e,t){return a.cond([[(e,t)=>ie(e)&&ie(t)&&a.type(e)!==a.type(t)&&("Object"===a.type(e)||"Object"===a.type(t)),oe],[(e,t)=>ne(e)||ne(t),ae],[(e,t)=>"Object"===a.type(e),a.mergeDeepWith(re)],[(e,t)=>"Array"===a.type(e),te],[a.T,a.flip(a.unary(a.identity))]])(e,t)}function se(e,t){return re(e,t)}function le(e=0){return`breakpoint-${e}px`}function ce(e,t){return t?`${t}-child${e}`:void 0}const de="GLOBAL/RAISE_METRIC",ue="GLOBAL/OFFER_ENGAGEMENT";function pe(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&D(e.responseOption)&&"fulfillment"in e&&x(e.fulfillment)}function fe(e){return A(e)}function he(e){return w(e)}function ve(e){return S(e)}function ye(e){return!!(O(e)||"responseOption"in e&&O(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function me(e){return!!(T(e)||"responseOption"in e&&T(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function Ce(e){return"string"==typeof e&&""!==e?{adID:e}:{}}function ge(e,t,n){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(x(n))return Object.assign({fulfillment:n,responseOption:t,creativeInstanceGuid:e.creative.instanceGuid,accountID:e.accountId,referralCreativeID:e.creative.referralCreativeId},Ce(e.adId));throw new Error(`Invalid Fulfillment: ${n} with referralCreativeID: ${e.creative.referralCreativeId}`)}case"Url":return Object.assign(Object.assign(Object.assign(Object.assign({},t),{accountID:e.accountId,creativeInstanceGuid:e.creative.instanceGuid,referralCreativeID:e.creative.referralCreativeId}),Ce(e.adId)),{urlBehavior:n&&"internally"===n.toLowerCase()?"self":t.urlBehavior});default:return Object.assign(Object.assign({},t),{creativeInstanceGuid:e.creative.instanceGuid})}}const be="GLOBAL/RAISE_SIGNAL",Ee="GLOBAL/OFFER_LIFECYCLE",Ie=new Set(["__proto__","constructor","prototype"]);function xe(e){return"string"==typeof e&&e.length>0&&!Ie.has(e)}const Le="GLOBAL/SET_CUSTOM_STATE";const De="ProcessingState",we="DevicePayErrorState",Se="PayPalDevicePayErrorState",Ae="applePayUnavailable",Oe="GLOBAL/SEND_PARTNER",Te="GLOBAL/SET_DOMAIN_STATE",je="GLOBAL/LAYOUT_EVENT",ke="GLOBAL/PREPARE_SIGNAL",Me="GLOBAL/OPEN_LINK",Re="GLOBAL/SET_PARTNER_VALIDATION_STATUS",Ve="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",Pe="GLOBAL/LAUNCH_CHILD_LAYOUT",He="GLOBAL/CART_ITEM_EVENT/INITIATE",_e="GLOBAL/CART_ITEM_EVENT/RESPONSE",Ne="OVERLAY/DISMISS_OVERLAY",Fe="plugin-overlay",$e="GLOBAL/TRIGGER_ACTION";const Ze="ERROR/REPORT",Ge="GLOBAL/REGISTER_FORM_FIELD",Be="GLOBAL/UNREGISTER_FORM_FIELD",Ue="GLOBAL/SET_FORM_FIELD_VALUE",ze="GLOBAL/SET_FORM_FIELD_TOUCHED",qe="GLOBAL/VALIDATE_FORM_FIELDS";function Ke(e){const{formKey:t,fieldKey:n}=null!=e?e:{};return xe(t)&&xe(n)}const We={RAISE_METRIC:de,PREPARE_SIGNAL:ke,OFFER_ENGAGEMENT:ue,RAISE_SIGNAL:be,OFFER_LIFECYCLE:Ee,SEND_PARTNER:Oe,SET_CUSTOM_STATE:Le,SET_DOMAIN_STATE:Te,LAYOUT_EVENT:je,OPEN_LINK:Me,SET_PARTNER_VALIDATION_STATUS:Re,SET_GLOBAL_OFFER_DATA_CART:Ve,LAUNCH_CHILD_LAYOUT:Pe,INITIATE_CART_ITEM_EVENT:He,CART_ITEM_RESPONSE:_e,DISMISS_OVERLAY:Ne,TRIGGER_ACTION:$e,REGISTER_FORM_FIELD:Ge,UNREGISTER_FORM_FIELD:Be,SET_FORM_FIELD_VALUE:Ue,SET_FORM_FIELD_TOUCHED:ze,VALIDATE_FORM_FIELDS:qe,REPORT_ERROR:Ze},Ye="CHILD_LAYOUT/DISPATCH_BEHAVIOR",Je="CHILD_LAYOUT/STATE_SYNC",Xe="CHILD_LAYOUT/READY",Qe="CHILD_LAYOUT/REQUEST_DEVICE_PAY";function et(e){return xe(e)&&!e.includes("%^")}const tt={[$e]:function(e){const{action:t}=null!=e?e:{};return"object"==typeof t&&null!==t},[Le]:function(e){const{key:t,value:n}=null!=e?e:{};return xe(t)&&"number"==typeof n&&isFinite(n)},[Ge]:function(e){const{formKey:t,fieldKey:n,defaultValue:i,validations:a}=null!=e?e:{};return xe(t)&&xe(n)&&"string"==typeof i&&Array.isArray(a)},[Be]:Ke,[Ue]:function(e){const{formKey:t,fieldKey:n,value:i,validate:a}=null!=e?e:{};return xe(t)&&xe(n)&&"string"==typeof i&&"boolean"==typeof a},[ze]:Ke,[qe]:function(e){const{entries:t}=null!=e?e:{};return Array.isArray(t)&&t.every((e=>"string"==typeof e))}};function nt(e){return"object"==typeof e&&null!==e&&1===e.version&&"payload"in e}const it="stage"===(at="undefined"==typeof __environment?void 0:__environment.ENVIRONMENT)||"uat"===at||"prod"===at;var at;const ot="CONTINUOUS_CHILD/READY",rt="CONTINUOUS_CHILD/PRESENTATION",st="CONTINUOUS_CHILD/APPLIED",lt="CONTINUOUS_CHILD/REQUEST",ct="CONTINUOUS_CHILD/EXPOSURE";function dt(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ut=e=>"string"==typeof e&&e.trim().length>0&&e.length<=256;function pt(e){return dt(e)&&ut(e.sessionId)&&ut(e.creativeInstanceGuid)&&(void 0===e.childInstanceGuid||ut(e.childInstanceGuid))&&Number.isSafeInteger(e.revision)&&Number(e.revision)>0&&Number.isSafeInteger(e.position)&&Number(e.position)>=0}function ft(e,t){return e.sessionId===t.sessionId&&e.revision===t.revision&&e.position===t.position&&e.creativeInstanceGuid===t.creativeInstanceGuid&&e.childInstanceGuid===t.childInstanceGuid}const ht="data-open-in-app",vt="data-click-signal-context";function yt(e,n){function i(e){var t;if(!(e.target&&e.target instanceof HTMLElement))return;const i=null===(t=e.target)||void 0===t?void 0:t.closest("a");if(i){const t=i.getAttribute("href"),a=i.getAttribute(vt);if(a&&n({type:be,payload:{name:"SignalUserInteraction",action:"Click",context:a}}),t){e.preventDefault();let a="newTab";i.hasAttribute(ht)?a="inApp":"_top"===i.getAttribute("target")&&(a="self"),n({type:Me,payload:{url:t,urlBehaviour:a}})}}}t.useEffect((()=>null!==e?(e.addEventListener("click",i),()=>{e.removeEventListener("click",i)}):()=>{}),[e])}function mt(){const e=t.useRef(null);return t.useEffect((()=>{const t=t=>{"Tab"===t.key&&Ct(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const Ct=(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()},gt="both",bt="linear",Et={hasOverflow:!1,atStart:!0,atEnd:!0};function It(e,t){if("horizontal"===t){const t=e.scrollWidth-e.clientWidth;return{hasOverflow:t>0,atStart:e.scrollLeft<=0,atEnd:e.scrollLeft>=t}}const n=function(e){if("undefined"==typeof window)return e.scrollHeight;const t=window.getComputedStyle(e),n=t.webkitLineClamp;if(!n||"none"===n||"normal"===n)return e.scrollHeight;const i=e.style,a={webkitLineClamp:i.webkitLineClamp,display:i.display,overflow:i.overflow,maxHeight:i.maxHeight};i.setProperty("-webkit-line-clamp","unset"),i.display="block",i.overflow="visible",i.maxHeight="none";const o=e.scrollHeight;return i.webkitLineClamp=a.webkitLineClamp,i.display=a.display,i.overflow=a.overflow,i.maxHeight=a.maxHeight,o}(e),i=n-e.clientHeight;return{hasOverflow:i>0,atStart:e.scrollTop<=0,atEnd:e.scrollTop>=i}}function xt(e,n){const i=t.useRef(null),[a,o]=t.useState(null),[r,s]=t.useState(Et),l=t.useCallback((e=>{i.current=e,o(e)}),[]),c=!!n;t.useEffect((()=>{if(!a||!c)return;const t=()=>s(It(a,e));let n;return t(),a.addEventListener("scroll",t,{passive:!0}),"undefined"!=typeof ResizeObserver&&(n=new ResizeObserver(t),n.observe(a),Array.from(a.children).forEach((e=>null==n?void 0:n.observe(e)))),()=>{a.removeEventListener("scroll",t),null==n||n.disconnect()}}),[a,e,c]);const d=t.useMemo((()=>function(e,t,{hasOverflow:n,atStart:i,atEnd:a}){var o,r,s,l,c,d;if(!t||!n)return{};const u=null!==(o=t.edges)&&void 0!==o?o:gt,p=null!==(r=t.easing)&&void 0!==r?r:bt,f=null!==(s=t.size)&&void 0!==s?s:36,h=null!==(l=t.startSize)&&void 0!==l?l:f,v=null!==(c=t.endSize)&&void 0!==c?c:f,y=("start"===u||"both"===u)&&!i,m=("end"===u||"both"===u)&&!a;if(!y&&!m)return{};const C="horizontal"===e?"to right":"to bottom",g=`linear-gradient(${C},${E=y?function(e,t){switch(e){case"ease-in":return["transparent 0",`transparent ${.3*t}px`,`black ${t}px`];case"ease-out":return["transparent 0",`black ${.7*t}px`,`black ${t}px`];case"ease-in-out":return["transparent 0",`rgba(0,0,0,0.5) ${.5*t}px`,`black ${t}px`];default:return["transparent 0",`black ${t}px`]}}(p,h):["black 0"],I=m?function(e,t){switch(e){case"ease-in":return[`black calc(100% - ${t}px)`,`transparent calc(100% - ${.3*t}px)`,"transparent 100%"];case"ease-out":return[`black calc(100% - ${t}px)`,`black calc(100% - ${.7*t}px)`,"transparent 100%"];case"ease-in-out":return[`black calc(100% - ${t}px)`,`rgba(0,0,0,0.5) calc(100% - ${.5*t}px)`,"transparent 100%"];default:return[`black calc(100% - ${t}px)`,"transparent 100%"]}}(p,v):["black 100%"],[...E,...I].join(",")})`,b=null!==(d=t.clip)&&void 0!==d?d:"border-box";var E,I;return{maskImage:g,WebkitMaskImage:g,maskMode:"alpha",WebkitMaskMode:"alpha",maskRepeat:"no-repeat",WebkitMaskRepeat:"no-repeat",maskClip:b,WebkitMaskClip:b}}(e,n,r)),[e,n,r]);return Object.assign({ref:i,setRef:l,maskStyle:d},r)}function Lt(e){var t,n,i,a,o,r;return null!==(r=null===(o=null===(a=null===(i=null===(n=null===(t=null==e?void 0:e.elements)||void 0===t?void 0:t.own)||void 0===n?void 0:n[0])||void 0===i?void 0:i.default)||void 0===a?void 0:a.container)||void 0===o?void 0:o.scrollMask)&&void 0!==r?r:null}const Dt=a.sortBy(a.prop(1)),wt=a.map(a.prop(0)),St="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function At(e,t){return t?"false"!==St.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${le(e)} ${t.trim()}`:`#app-container.${le(e)} & {${t}}`:"";var n}const Ot={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"},Tt={selected:'[data-selected="true"]',errored:'[data-errored="true"]'};function jt(e){return function(e){return Object.keys(Ot).indexOf(e)>-1}(e)?Ot[e]:function(e){return Object.keys(Tt).indexOf(e)>-1}(e)?Tt[e]:""}const kt={container:{justifyContent:"justify-content",alignItems:"align-items",shadow:"box-shadow",gap:"gap",overflow:"overflow",scrollMask:"",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 Mt(e,t){if(!kt[e]||!kt[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return kt[e][t]}function Rt(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function Vt(...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 Pt(e,t){return`${e}:${t};`}function Ht(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class _t extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function Nt(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 _t(n,JSON.stringify(t));return!0}function Ft(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function $t(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 Zt(e){if(null==e||""===e)return"value must not be omitted"}function Gt(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 Bt(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 Ut(e){if(null!=e&&""!==e)return"value must not be specified"}function zt(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 qt(...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||Ft(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function Kt(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 Wt(e){if("string"!=typeof e)return"value must be a string"}const Yt=a.is(Object);function Jt(e){const t=Object.entries(e);return n=>Yt(n)&&!Array.isArray(n)?t.reduce(((e,[t,i])=>e||i(n[t])),void 0):`Input value (${e}) must be an object`}function Xt(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function Qt(e,t,n){return Nt(Ft,n)?Pt(Mt(e,t),`${n}`):""}function en(e){return(t,n,i)=>Nt($t(Object.keys(e)),i)?Pt(Mt(t,n),`${e[i]}`):""}function tn(e){return Nt(Zt,e)?Rt({light:t(Bt,!1),dark:t(Kt(Ut,Bt),!0)},Vt("\n "))(e):"";function t(e,t){return n=>{if(Nt(e,n)&&n){const e=Pt("background-image",`url("${n}")`);return t?Ht(e):e}return""}}}function nn(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),Nt(Kt(Ut,$t(Object.keys(t))),e)&&e?Pt("background-size",t[e]):""}const an=a.cond([[a.equals("top-left"),a.always("top left")],[a.equals("top-right"),a.always("top right")],[a.equals("bottom-left"),a.always("bottom left")],[a.equals("bottom-right"),a.always("bottom right")],[a.T,a.identity]]);function on(e){const t="string"==typeof e?e.toLowerCase():e;return Nt(Kt(Ut,$t(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?Pt("background-position",an(t)):""}function rn(e,t,n){return Nt(Kt(Ft,qt(2,3,4)),n)?Pt(Mt(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function sn(e){return(t,n,i)=>Nt(zt({fit:$t(e),percentage:Ft,fixed:Ft}),i)?Pt(Mt(t,n),ln(i)):""}function ln(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]}}const cn=Jt({light:Gt,dark:Kt(Ut,Gt)});function dn(e,t,n){return i=>{if(i){const a=Pt(Mt(e,t),pn(String(i)));return n?Ht(a):a}return""}}function un(e,t,n){return Nt(cn,n)?Rt({light:dn(e,t,!1),dark:dn(e,t,!0)},Vt("\n "))(n):""}function pn(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 fn=Jt({offsetX:Kt(Ut,Ft),offsetY:Kt(Ut,Ft),blurRadius:Kt(Ut,Ft),spreadRadius:Kt(Ut,Ft),color:cn}),hn=e=>t=>null!=t?String(t):e,vn=a.compose(a.concat(a.__,"px"),hn("0")),yn=e=>t=>"string"==typeof t?e(t):t,mn=a.compose(yn(a.concat(a.__,"px")),hn(void 0)),Cn=a.compose(yn(pn),a.prop("dark"));function gn(e,t,n){return Pt(e,Rt({offsetX:vn,offsetY:vn,blurRadius:t.spreadRadius?vn:mn,spreadRadius:mn,color:n},Vt(" "))(t))}const bn=Jt({edges:Kt(Ut,$t(["start","end","both"])),size:Kt(Ut,Ft),startSize:Kt(Ut,Ft),endSize:Kt(Ut,Ft),easing:Kt(Ut,$t(["linear","ease-in","ease-out","ease-in-out"])),clip:Kt(Ut,$t(["border-box","padding-box","content-box"]))});const En={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},In={container:{justifyContent:en(En),alignItems:en(En),shadow:function(e,t,n){var i,o,r;if(Nt(fn,n)){const s=Mt(e,t);return Vt("\n")(gn(s,n,(o="light",r="#80000000",a.compose(pn,a.propOr(r,o)))),(null===(i=n.color)||void 0===i?void 0:i.dark)?Ht(gn(s,n,Cn)):"")}return""},gap:rn,overflow:en({hidden:"hidden",visible:"visible"}),scrollMask:function(e,t,n){return null==n||Nt(bn,n),""},blur:function(e,t,n){return Nt(Xt,n)?Pt(Mt(e,t),`blur(${n.toString()}px)`):""},opacity:Qt},text:{textColor:un,fontSize:rn,fontFamily:function(e,t,n){return Nt(Wt,n)?Pt(Mt(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:en({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:en({normal:"normal",italic:"italic"}),lineHeight:rn,lineLimit:function(e,t,n){return Nt(Ft,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:rn,baselineTextAlign:en({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:en({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:en({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:en({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:un,backgroundImage:function(e,t,n){return Nt(Zt,n)?Rt({url:tn,position:on,scale:nn},Vt)(n):""}},dimension:{width:sn(["wrap-content","fit-width"]),maxWidth:rn,minWidth:rn,height:sn(["wrap-content","fit-height"]),maxHeight:rn,minHeight:rn,rotateZ:(xn="Z",(e,t,n)=>{const i=`rotate${xn}`;return Nt(Ft,n)?Pt(Mt(e,t),`${i}(${n.toString()}deg)`):""})},flexChild:{alignSelf:en(En),weight:Qt,order:Qt},spacing:{margin:rn,padding:rn,offset:function(e,t,n){return Nt(qt(2),n)?`transform:translate(${n.split(" ").join("px, ")}px);`:""}},border:{borderColor:un,borderRadius:rn,borderWidth:rn,borderStyle:en({solid:"solid",dashed:"dashed"})}};var xn;function Ln(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((i=>{if(!In[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const a=In[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 Dn="FAILED_TEMPLATING_DATA",wn="UNRESOLVED_FORM_VALIDATION_TARGET",Sn=new Map;function An(e){return String.fromCharCode(97+e)}function On(e,t,n){const i=`${e||P.pluginId}-${void 0!==t?String(t):"outer"}`,a=Sn.get(i);if(a&&a.sheet.container.isConnected)return a;const o=function(e,t){const n={key:void 0!==e?`inner-css-${An(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),p(n)}(t,n);return Sn.set(i,o),o}function Tn(e,t,n){return On(e,t,n).css}function jn(e,t,n){return On(e,t,n).cx}const kn="%%%OWN_CLASS_REF%%%",Mn={placeholderText:"::placeholder"},Rn=a.memoizeWith(((e,t,n,i)=>`${String(e)}-${t}-${n}`),Vn);function Vn(e,t,n,i){const a=Tn(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]:Pn(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(kn,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 Pn(e,t,n,i,a){return e.map(function(e,t,n){var i;const a=null!==(i=Mn[n])&&void 0!==i?i:"";return i=>Object.entries(i).map((([i,o])=>{const r=o?Ln(o):"";switch(!0){case"default"===i:return r?a?`\n &${a} {\n${r}\n}\n`:`\n${r}\n`:"";case Boolean(e):return`\n .${e}${jt(i)} &${a} {\n${r}\n}\n`;case t&&"own"!==n:return`\n .${kn}${jt(i)} &${a} {\n${r}\n}\n`;default:return`\n &${jt(i)}${a} {\n${r}\n}\n`}})).join("")}(t,n,i)).reduce(((e,t,n)=>{const i=a[n];return void 0!==i?e+(0===n?t:`${At(i,t)}\n`):e}),"")}const Hn=t.createContext(a.always(void 0)),_n=()=>t.useContext(Hn),Nn=t.createContext(null);function Fn(e,n){var i;const a=t.useContext(Nn);return a&&null!==(i=n(a))&&void 0!==i?i:e}const $n=t.createContext((()=>{throw Error("Node Mapper Context does not have a mapper. Use the NodeMapperProvider with the default nodeMapper as a value before you consume this mapper")})),Zn=$n.Consumer,Gn=()=>t.useContext($n),Bn=t=>e.jsx($n.Provider,{value:(e,n,i,a)=>t.value(e,null!=n?n:t.overrides,i,a),children:t.children}),Un=t.createContext(null),zn=()=>t.useContext(Un),qn=t.createContext({get(){throw Error("Offer context has not been set")}}),Kn=t=>e.jsx(qn.Provider,{value:{get:()=>t.context},children:t.children}),Wn=()=>t.useContext(qn).get(),Yn=()=>{try{return t.useContext(qn).get().creative.copy}catch(e){return}},Jn=t.createContext((()=>{})),Xn=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),Qn=a.compose(a.not,a.isEmpty),ei=a.where({url:Qn,title:Qn});function ti(e,t,n){return t.reduce(((t,n)=>{const i=n.indexOf("["),a=-1===i?n.slice(0,-1):n.slice(0,i),o=-1===i?"":n.slice(i+1,-1),r="append"===a?[o]:o?o.split(","):[];if(!a)throw new Error(ii(e,"This Meta Attribute could not be parsed."));return function(e,t,n,i){switch(t){case"openLinks":return function(e,t,n){ni(t,e,"openLinks",1,2);const i=ai(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),a=oi(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===i)return n.replace(Xn,((e,t)=>`<a ${ht} ${a?`${vt}="${a}" `:""}${t}`));return n}(e,n,i);case"sliceText":return function(e,t,n){ni(t,e,"sliceText",2,2);const i=ai(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),a=ai(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>)");return e.startsWith("<a")?e.replace(n,(e=>e.slice(0,-4).slice(0,t+1)+"</a>")):e.slice(0,t)}(n,a);throw Error(ii(e,`Unknown "SliceBy" value. ${i}`))}(e,n,i);case"timerFormat":return function(e,t,n){var i;ni(t,e,"timerFormat",1,1);const a=null!==(i=t[0])&&void 0!==i?i:"";return function(e,t){const n=/(?:^|[^\\])hh?/.test(t),i=/(?:^|[^\\])mm?/.test(t),a=n?Math.floor(e/3600):0,o=e-3600*a,r=i?n?Math.floor(o/60):Math.floor(e/60):0,s=i?o-60*r:n?o:e,l=[[/hh/,String(a).padStart(2,"0")],[/h/,String(a)],[/mm/,String(r).padStart(2,"0")],[/m/,String(r)],[/ss/,String(s).padStart(2,"0")],[/s/,String(s)]];let c="",d=0;for(;d<t.length;){if("\\"===t[d]&&d+1<t.length){c+=t[d+1],d+=2;continue}let e=!1;for(const[n,i]of l){const a=t.slice(d).match(n);if(a&&0===a.index){c+=i,d+=a[0].length,e=!0;break}}e||(c+=t[d],d++)}return c}(Math.max(0,Math.floor(Number(n)||0)),a)}(e,n,i);case"append":return function(e,t,n){if(1!==t.length)throw new Error(ii(e,`append meta attribute takes 1 argument; received ${t.length}.`));return n+t[0]}(e,n,i);default:throw new Error(ii(e,`Unknown Meta Attribute '${t}'.`))}}(e,a,r,t)}),n)}function ni(e,t,n,i,a){const o=new Error(ii(t,`${n} meta attribute takes ${i!=a?`between ${i} and ${a}`:i} ${1===(a||i)?"argument":"arguments"}; received ${e.length}.`));if(a&&(e.length<i||e.length>a))throw o;if(!a&&e.length!==i)throw o}function ii(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function ai(e,t,n,i,a){const o=oi(e,n,i);if(null!==o)return o;throw Error(ii(t,a||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function oi(e,t,n){return n(e[t])}const ri="DATA",si="STATE",li="ATTRIBUTE",ci=new RegExp(`^(${`${ri}|${si}|${li}`})\\.`),di=new RegExp(`^${li}`),ui=new RegExp(`%\\^(?:(?:${ri}|${si})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*|${li}\\.[a-zA-Z0-9][a-zA-Z0-9\\._-]*)(?:\\:(?:append\\[[^\\]\\[|:]*\\]|[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,:\\\\ -]*\\]))*(?:\\|.*?)?\\^%`,"g");function pi(e){const t=`${li}.`;if(!e.startsWith(t))return e;return`${t}${e.slice(t.length).toLowerCase().replace(/^rokt\./,"").replace(/[_-]/g,"")}`}function fi(e){const t=new Map,n=new Map,i=new Set;for(const[a,o]of e){if("string"!=typeof o)continue;if(!a.startsWith(`${li}.`))continue;const e=pi(a),r=n.get(e);void 0===r||r===o?(n.set(e,o),e!==a&&t.set(e,o)):i.add(e)}for(const e of i)t.delete(e);return t}const hi=Symbol("invalid");function vi(e,t="creativeCopy"){const n=yi({data:e},t),i=new Map;return function e(t,n){if("string"!=typeof t){const i=yi(t,n,this.dataMap),a="attribute"in t;return e.bind({dataMap:i,attributeAliases:a?fi(i):this.attributeAliases,hasAttributeData:this.hasAttributeData||a})}let i=!1;const o=t,r=a.pipe(a.slice(2,-2),a.split("|"),(e=>a.reduce(((e,t)=>{var n;let i;if(ci.test(t)){const o=function(e){const t=[];let n="",i=0;for(const a of e)"["===a?i++:"]"===a&&i--,":"===a&&0===i?(t.push(n),n=""):n+=a;return t.push(n),t}(t),r=o[0];if(r){if(i=null!==(n=this.dataMap.get(r))&&void 0!==n?n:this.attributeAliases.get(pi(r)),i&&i===hi)throw new Y(Dn,`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(o.length>1&&i)try{i=ti(r,o.slice(1),i)}catch(e){throw new Y(Dn,`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 i?a.reduced({provided:!0,value:i}):e}return a.reduced({provided:!0,value:t})}),{provided:!1,value:""},e))),s=a.replace(ui,(e=>{const t=di.test(e.slice(2));if(t&&!this.hasAttributeData)return e;const n=r(e);return n.provided?n.value:t?e:(i=!0,n.value)}),o);return!1===i?s:""}.bind({dataMap:n,attributeAliases:i,hasAttributeData:!1})}function yi(e,t,n){const i=new Map(n);return"data"in e&&o(e.data,`${ri}${t?"."+t:""}`),"state"in e&&o(e.state,`${si}${t?"."+t:""}`),"attribute"in e&&o(e.attribute,`${li}${t?"."+t:""}`),i;function o(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,hi),e&&"object"==typeof e&&a.forEachObjIndexed(((e,n)=>o(e,`${t}.${n}`)),e)}}const mi=t.createContext(vi({})),Ci=mi.Consumer,gi=mi.Provider,bi=()=>t.useContext(mi),Ei=t.createContext(null),Ii=Ei.Provider,xi=t.createContext("OUTER"),Li=()=>"VARIANT"===t.useContext(xi),Di=t.createContext(void 0),wi=()=>t.useContext(Di);var Si,Ai,Oi,Ti,ji,ki,Mi,Ri=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())}))},Vi=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)},Pi=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};class Hi{constructor(e,t,n,i,o,r,s,l){Si.set(this,void 0),Ai.set(this,void 0),Oi.set(this,new Set),Ti.set(this,void 0),ji.set(this,void 0),ki.set(this,void 0),Mi.set(this,void 0),l&&(this.launchContinuousChild=e=>l.launch(n,e),this.registerContinuousResponseHandler=e=>{const t=l.register(n,e),i=()=>{t(),Vi(this,Oi,"f").delete(i)};return Vi(this,Oi,"f").add(i),i}),Pi(this,Si,a.partial(e.subscribe.bind(e),[n]),"f"),Pi(this,Ai,a.partial(e.dispatch.bind(e),[n]),"f"),Pi(this,Ti,t,"f"),Pi(this,ji,i,"f"),Pi(this,ki,o,"f"),Pi(this,Mi,r,"f"),this.scrollHostToViewportOffset=s,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=Vi(this,Si,"f").call(this,e),n=()=>{t(),Vi(this,Oi,"f").delete(n)};return Vi(this,Oi,"f").add(n),n}onInteractivityChange(e){return Vi(this,ji,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=Vi(this,ki,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),Vi(this,Oi,"f").delete(n)};return Vi(this,Oi,"f").add(n),n}globalDispatch(e){Vi(this,Ai,"f").call(this,e)}dispose(){Vi(this,Oi,"f").forEach((e=>e())),Pi(this,Oi,new Set,"f"),Vi(this,ji,"f").clear()}createChildPlugin(e){return"dcui-child"===e.name&&Vi(this,Mi,"f")&&e.config?Vi(this,Ti,"f").call(this,Object.assign(Object.assign({},e),{config:Object.assign(Object.assign({},e.config),{fonts:Vi(this,Mi,"f").call(this)})})):Vi(this,Ti,"f").call(this,e)}}Si=new WeakMap,Ai=new WeakMap,Oi=new WeakMap,Ti=new WeakMap,ji=new WeakMap,ki=new WeakMap,Mi=new WeakMap;class _i{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>Ri(this,void 0,void 0,(function*(){})),onClose:()=>Ri(this,void 0,void 0,(function*(){})),putConfig:()=>Ri(this,void 0,void 0,(function*(){})),send:()=>Ri(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var Ni,Fi,$i=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},Zi=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 Gi{constructor(e){Ni.set(this,void 0),Fi.set(this,new Set),$i(this,Ni,e,"f")}subscribe(e){return Zi(this,Fi,"f").add(e),!0===e(Zi(this,Ni,"f"))&&Zi(this,Fi,"f").delete(e),()=>{Zi(this,Fi,"f").delete(e)}}publish(e){$i(this,Ni,e,"f"),Zi(this,Fi,"f").forEach((e=>{!0===e(Zi(this,Ni,"f"))&&Zi(this,Fi,"f").delete(e)}))}clear(){Zi(this,Fi,"f").clear()}}Ni=new WeakMap,Fi=new WeakMap;var Bi=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)},Ui=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 zi="breakpoint-0px";class qi{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,f,h,v,y,m,C,g,b,E,I,x,L,D,w,S;const A=this.appFactory,O=this.logger,T=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new _i;return S=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint","measurement-occluded"]}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,!1),s.set(this,(()=>null)),l.set(this,!1),c.set(this,null),d.set(this,null),u.set(this,null),p.set(this,null),f.set(this,null),h.set(this,null),v.set(this,!1),y.set(this,null),m.set(this,null);const e=this.attachShadow({mode:"open"});Ui(this,a,document.createElement("div"),"f"),Bi(this,a,"f").id="app-container",Bi(this,a,"f").classList.add("default"),e.appendChild(Bi(this,a,"f"))}attributeChangedCallback(e,a,o){if(o!==a)switch(e){case"visible":Bi(this,n,"f").call(this,"true"===o);break;case"interactivity":"ENABLED"!==o&&"DISABLED"!==o||Bi(this,i,"f").call(this,o);break;case"measurement-occluded":Bi(this,s,"f").call(this);break;case"active-breakpoint":Bi(this,t,"m",C).call(this,o,a)}}makeInteractivityUpdateHandler(e){Ui(this,i,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,i,a){const o="true"===this.getAttribute("visible"),l=this.getAttribute("slotInstanceGuid");if(Ui(this,r,"true"===this.getAttribute("continuous-measurement"),"f"),Bi(this,r,"f")){let o=!1;const r=()=>{const n="true"===this.getAttribute("visible"),r="true"===this.getAttribute("measurement-occluded");if(n&&!o&&(o=!0,0===e&&a.globalDispatch({type:Ee,payload:{event:"Interactive"}}),l&&a.globalDispatch({type:be,payload:{name:"SignalImpression",parentGuid:l}})),!n||r)return Bi(this,t,"m",I).call(this,i,a),void Bi(this,t,"m",E).call(this);i&&a.globalDispatch({type:be,payload:{name:"SignalImpression",parentGuid:i}}),i&&Bi(this,t,"m",w).call(this,i,a)};return Ui(this,s,r,"f"),Ui(this,n,r,"f"),void r()}Ui(this,n,(o=>{o?(Ui(this,n,(()=>null),"f"),0===e&&a.globalDispatch({type:Ee,payload:{event:"Interactive"}}),i&&(a.globalDispatch({type:be,payload:{name:"SignalImpression",parentGuid:i}}),Bi(this,t,"m",w).call(this,i,a)),l&&a.globalDispatch({type:be,payload:{name:"SignalImpression",parentGuid:l}})):Bi(this,t,"m",E).call(this)}),"f"),Bi(this,n,"f").call(this,o)}getOfferPositionAttr(){const e=this.getAttribute("offerPositionIndex"),t=Number(e);return(null==e||isNaN(t)||t<0)&&j(`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){j(`Invalid JSON attribute ${e}: ${n}`)}}disconnectedCallback(){Bi(this,t,"m",E).call(this)}connectedCallback(){var e,t,n;const i=this.getAttribute("container"),o=this.getAttribute("plugin-id");Bi(this,a,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===i?"column":"row"));const r=this.getOfferPositionAttr(),s=this.getJSONAttr("layoutSchema"),{layoutSchema:l,variantTimers:c}=function(e){var t;return"LayoutVariantRoot"===e.type?{layoutSchema:e.node.layout,variantTimers:null!==(t=e.node.timers)&&void 0!==t?t:void 0}:{layoutSchema:e}}(s),d=this.getJSONAttr("childLayouts","[]"),u=this.getJSONAttr("offerData"),p=new Gi("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),f=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"",h=this.getJSONAttr("offerState","{}");A||j("Cannot create app without factory. Please build the connector withAppFactory.");const v=T({offerPositionIndex:r,creativeInstanceGuid:null===(t=null==u?void 0:u.creative)||void 0===t?void 0:t.instanceGuid},p);this.makeInteractivityUpdateHandler(p),A({rootElement:Bi(this,a,"f"),gateway:v,logger:O,offerPositionIndex:r,offerData:u,layoutSchema:l,childLayouts:d,schemaVersion:f,pluginId:o||P.pluginId,offerState:h,variantTimers:c}),this.makeVisbilityUpdateHandler(r,null===(n=null==u?void 0:u.creative)||void 0===n?void 0:n.instanceGuid,v)}},n=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,r=new WeakMap,s=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,h=new WeakMap,v=new WeakMap,y=new WeakMap,m=new WeakMap,t=new WeakSet,C=function(e,t){Bi(this,a,"f").classList.remove(t||zi),Bi(this,a,"f").classList.add(e||zi)},g=function(){Bi(this,p,"f")&&(clearTimeout(Bi(this,p,"f")),Ui(this,p,null,"f"))},b=function(e){Bi(this,t,"m",g).call(this),Ui(this,p,window.setTimeout(e,1e3),"f")},E=function(){Bi(this,t,"m",g).call(this),Bi(this,t,"m",L).call(this),Bi(this,u,"f")&&(Bi(this,u,"f").disconnect(),Ui(this,u,null,"f")),Bi(this,f,"f")&&(document.removeEventListener("visibilitychange",Bi(this,f,"f")),Ui(this,f,null,"f")),Bi(this,y,"f")&&(window.removeEventListener("beforeunload",Bi(this,y,"f")),Ui(this,y,null,"f")),Bi(this,m,"f")&&(Bi(this,a,"f").removeEventListener("click",Bi(this,m,"f")),Ui(this,m,null,"f")),Ui(this,v,!1,"f"),Ui(this,h,null,"f")},I=function(e,t){if(!Bi(this,v,"f")||null==Bi(this,h,"f"))return;const n=Bi(this,h,"f"),i=Date.now();if(i<=n)return Ui(this,v,!1,"f"),void Ui(this,h,null,"f");t.globalDispatch({type:be,payload:{name:"SignalUserInteraction",parentGuid:e,action:"ViewabilityDurationTracking",context:"Offer Visibility Duration",objectData:{startTimestamp:n.toString(),endTimestamp:i.toString()}}}),Ui(this,v,!1,"f"),Ui(this,h,null,"f")},x=function(e,n){Bi(this,l,"f")||Bi(this,c,"f")||!("ResizeObserver"in window)||(Ui(this,c,new ResizeObserver((i=>{var a;if(Bi(this,l,"f"))return;const o=i[0];if(!o)return;const r=null===(a=o.borderBoxSize)||void 0===a?void 0:a[0],s=r?r.inlineSize:o.contentRect.width,c=r?r.blockSize:o.contentRect.height;0!==s&&0!==c&&(Bi(this,t,"m",D).call(this),Ui(this,d,window.setTimeout((()=>{Ui(this,l,!0,"f"),Bi(this,t,"m",L).call(this),window.requestAnimationFrame((()=>{n.globalDispatch({type:be,payload:{name:"SignalRenderGeometry",parentGuid:e,objectData:{widthPx:Math.round(s),heightPx:Math.round(c)}}})}))}),250),"f"))})),"f"),Bi(this,c,"f").observe(Bi(this,a,"f")))},L=function(){Bi(this,t,"m",D).call(this),Bi(this,c,"f")&&(Bi(this,c,"f").disconnect(),Ui(this,c,null,"f"))},D=function(){Bi(this,d,"f")&&(clearTimeout(Bi(this,d,"f")),Ui(this,d,null,"f"))},w=function(e,n){if(Bi(this,o,"f")&&!Bi(this,r,"f"))return;const i=this.getAttribute("slotInstanceGuid");i&&Bi(this,t,"m",x).call(this,i,n);const s=Bi(this,r,"f")&&"true"===this.getAttribute("expanded-owns-viewability");if(!("IntersectionObserver"in window)){if(s||Bi(this,o,"f"))return;return n.globalDispatch({type:be,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!1,inferred:!1}}),void Ui(this,o,!0,"f")}Bi(this,u,"f")||(Ui(this,u,new IntersectionObserver((i=>{i.forEach((i=>{(!Bi(this,r,"f")||"true"!==this.getAttribute("measurement-occluded")&&"true"===this.getAttribute("visible")&&"hidden"!==document.visibilityState)&&(i.isIntersecting&&i.intersectionRatio>=.5?(s||Bi(this,o,"f")||Bi(this,t,"m",b).call(this,(()=>{Bi(this,o,"f")||Bi(this,r,"f")&&("true"===this.getAttribute("measurement-occluded")||"true"!==this.getAttribute("visible")||"hidden"===document.visibilityState)||(n.globalDispatch({type:be,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!1}}),Ui(this,o,!0,"f"))})),Bi(this,v,"f")||(Ui(this,h,Date.now(),"f"),Ui(this,v,!0,"f"))):(Bi(this,t,"m",g).call(this),Bi(this,v,"f")&&Bi(this,t,"m",I).call(this,e,n)))}))}),{threshold:.5}),"f"),Bi(this,u,"f").observe(Bi(this,a,"f")),Ui(this,m,(()=>{(!Bi(this,r,"f")||"true"!==this.getAttribute("measurement-occluded")&&"true"===this.getAttribute("visible")&&"hidden"!==document.visibilityState)&&(s||Bi(this,o,"f")||(n.globalDispatch({type:be,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!0}}),Ui(this,o,!0,"f"),Bi(this,t,"m",g).call(this)),Bi(this,v,"f")&&Bi(this,t,"m",I).call(this,e,n))}),"f"),Bi(this,a,"f").addEventListener("click",Bi(this,m,"f")),Ui(this,f,(()=>{Bi(this,u,"f")&&("hidden"===document.visibilityState?(Bi(this,t,"m",g).call(this),Bi(this,v,"f")&&Bi(this,t,"m",I).call(this,e,n),Bi(this,u,"f").unobserve(Bi(this,a,"f"))):"visible"===document.visibilityState&&Bi(this,u,"f").observe(Bi(this,a,"f")))}),"f"),document.addEventListener("visibilitychange",Bi(this,f,"f")),Ui(this,y,(()=>{Bi(this,v,"f")&&Bi(this,t,"m",I).call(this,e,n)}),"f"),window.addEventListener("beforeunload",Bi(this,y,"f")))},S;function j(e){throw O({level:q,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const Ki=t.createContext({get:()=>new _i}),Wi=t=>e.jsx(Ki.Provider,{value:{get:()=>t.context},children:t.children});const Yi=t.createContext({get(){throw Error("Layout Schema context has not been set")}}),Ji=t=>e.jsx(Yi.Provider,{value:{get:()=>t.context},children:t.children}),Xi=()=>t.useContext(Yi).get(),Qi=t.createContext("ENABLED"),ea=()=>t.useContext(Qi);function ta(e){const t=ia(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:ia(t,this.dataMap)});if(!n)throw new Y("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");const i=t;return a.path([n,i],this.dataMap)}.bind({dataMap:t})}const na={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function ia(e,t=na){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 aa=t.createContext(ta({}));aa.Consumer;const oa=aa.Provider,ra=e=>{const n=t.useContext(aa),i=e.split("|");for(const e of i){const t=n(e.trim(),"images");if(t)return t}},sa=()=>t.useContext(aa),la=t.createContext({});function ca({info:n,children:i}){const a=t.useContext(la);return e.jsx(la.Provider,{value:Object.assign(Object.assign({},a),n),children:i})}const da=t.createContext({get(){throw Error("Catalog Item context has not been set")}}),ua=t=>e.jsx(da.Provider,{value:{get:()=>t.context},children:t.children}),pa=()=>t.useContext(da).get(),fa=t.createContext(""),ha=()=>t.useContext(fa),va=t.createContext(""),ya=t.createContext(void 0);function ma({children:n}){const i=t.useMemo((()=>{const e=document.createElement("div");return e.inert=!0,{inert:!0===e.inert}}),[]);return e.jsx(ya.Provider,{value:i,children:n})}const Ca=t.createContext(!0),ga=t.createContext(null),ba=ga.Provider,Ea=t.createContext(null);function Ia(n){const[i,a]=t.useState({}),o=t.useRef([]),r=t.useContext(Ki).get().scrollHostToViewportOffset;function s(e){if(e in i)return[e];const t=`${e}-`;return Object.keys(i).filter((e=>e.startsWith(t)))}return e.jsx(Ea.Provider,{value:{registerValidators:function(e,t,n){a((i=>Object.assign(Object.assign({},i),{[e]:{validators:t,isValid:!0,element:n}})))},validateFieldKeys:function(e){const t={},n=[];let r=!0;const l=e.flatMap(s);if(0===l.length)return o.current=[],!1;for(const e of l){const a=i[e];if(a){const i=Object.assign({},a),o=a.validators.every((e=>e()));o!==i.isValid&&(t[e]=Object.assign(Object.assign({},i),{isValid:o})),!o&&a.element&&n.push(a.element),r&&(r=o)}else r=!1}return o.current=n,Object.values(t).length>0&&a((e=>Object.assign(Object.assign({},e),t))),r},getFieldKeyValidity:function(e){const t=s(e);return 0!==t.length&&t.every((e=>{var t,n;return null!==(n=null===(t=i[e])||void 0===t?void 0:t.isValid)&&void 0!==n&&n}))},focusFirstInvalidField:function(){var e;const t=o.current.filter((e=>e.isConnected)).sort(((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))[0];if(t){if(null===(e=t.scrollIntoView)||void 0===e||e.call(t,{behavior:r?"instant":"smooth",block:"center"}),r){const e=t.getBoundingClientRect();r(e.top+e.height/2)}t.focus({preventScroll:!0})}}},children:n.children})}function xa(){const e=t.useContext(Ea);if(!e)throw new Error("useValidator must be used within a ValidatorProvider");return e}function La(e,n,i){const a=xa();t.useEffect((()=>{var t;e&&a.registerValidators(e,n,null!==(t=null==i?void 0:i.current)&&void 0!==t?t:void 0)}),[e,n.length,i])}function Da(e,t){return t?t.validators.map((t=>e[t])).filter((e=>void 0!==e)):[]}const wa=a.compose(a.anyPass([a.isEmpty,a.all(a.isEmpty)]),a.flatten,a.map(a.values),a.map(a.ifElse(a.isNil,a.always({}),a.identity)),a.values,a.propOr({},"value")),Sa=a.compose(a.isEmpty,a.prop("predicates"));function Aa(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const Oa=a.curry(((e,{duration:t,predicates:n,styles:i})=>{return{predicates:n,classname:e(Ln(i)),transitionBaseClassname:e(Aa(t,(o=i,a.toPairs(o).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?a.keys(n).map((e=>Mt(t,e))):[]})))))};var o})),Ta=a.anyPass([wa,Sa]);function ja(e){return e.value!==e.defaultValue}function ka(e,t){const n=function(e,t){return B(t,[e]).flatMap((({formKey:e,fieldKey:n})=>{var i;const a=null===(i=t[e])||void 0===i?void 0:i[n];return a&&F(a)?a:[]}))}(e.key,t);switch(e.state){case"is-valid":return n.length>0&&n.every((e=>e.validated&&e.valid));case"is-invalid":return n.some($);case"is-touched":return n.some((e=>e.touched));case"is-untouched":return n.every((e=>!e.touched));case"is-dirty":return n.some(ja);case"is-pristine":return n.every((e=>!ja(e)));default:return!1}}const Ma={is:a.equals,"is-not":a.compose(a.not,a.equals),"is-below":a.lt,"is-above":a.gt};function Ra(e,t){return e.includes(t)}const Va={is:a.equals,"is-not":a.compose(a.not,a.equals),exists:Ra,"not-exists":a.compose(a.not,Ra)},Pa={exists:a.compose(a.not,a.either(a.isNil,a.isEmpty)),"not-exists":a.either(a.isNil,a.isEmpty)},Ha={"is-true":a.equals(!0),"is-false":a.equals(!1)},_a={is:a.equals,"is-not":a.compose(a.not,a.equals)};function Na(e){return(t,n)=>n[e]}const Fa=a.cond([[(e,t)=>a.equals("Breakpoint",e),Na("activeBreakpoint")],[(e,t)=>a.equals("Progression",e),Na("progressionIndex")],[(e,t)=>a.equals("Position",e),Na("positionIndex")]]);function $a(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const Za=a.cond([[(e,t,n)=>a.equals("Breakpoint",e),(e,t,n)=>{const i=a.lensPath(["breakpoints",t]);return a.pipe(a.over(i,Number),a.view(i))(n)}],[(e,t,n)=>a.equals("Progression",e),(e,t,n)=>a.cond([[a.gt(0),a.add(n.totalGroups)],[a.lte(0),a.identity]])(Number(t))],[(e,t,n)=>a.equals("Position",e),(e,t,n)=>a.cond([[a.gt(0),a.add(n.totalOffers)],[a.lte(0),a.identity]])(Number(t))]]),Ga=a.compose(a.not,isNaN);function Ba(e,t){return e.map((e=>{var n,i,a,o;switch(e.type){case"StaticString":return(0,_a[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,Pa[e.predicate.condition])($a(t,e.predicate.value));case"StaticBoolean":return(0,Ha[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,Ma[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,Ma[e.predicate.condition])(null!==(i=t.domainStates[e.predicate.key])&&void 0!==i?i:0,e.predicate.value);case"OnFirstEvent":return null!==(a=t.firedEvents[e.predicate.event])&&void 0!==a&&a;case"FormState":return ka(e.predicate,t.formStates);case"DarkMode":throw new Error("DarkMode has not yet been implemented.");case"Placeholder":return function(e){switch(e.predicate.type){case"TextValue":return(0,Va[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,Ma[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"NumericCompare":{const{left:t,right:n,condition:i}=e.predicate.content;if(!t.trim()||!n.trim())return!1;const a=Number(t),o=Number(n);return!(!Number.isFinite(a)||!Number.isFinite(o))&&Ma[i](a,o)}case"Numeric":return(0,Ma[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=Ma[e.predicate.condition],i=null!==(o=Fa(e.type,t))&&void 0!==o?o:NaN,a=Za(e.type,e.predicate.value,t);return!!Ga(i)&&n(i,a)}}}))}function Ua(e){return a.pathOr(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const za={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{},firedEvents:{},formStates:{}};function qa(e,t,n,i){const o=t.map((e=>"Progression"===e.type?Object.assign(Object.assign({},e),{type:i?"Position":e.type}):e)),{cached:r,uncached:s}=o.reduce(((t,i)=>function(e,t,n,i){if("FormState"===e.type)return a.evolve({cached:a.append(ka(e.predicate,t.formStates))},i);const o=function(e,t){var n;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:${$a(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":if("NumericCompare"===e.predicate.type){const{left:t,right:n,condition:i}=e.predicate.content;return`${e.type}:${e.predicate.type}:${i}:data:${t}:${n}`}return`${e.type}:${e.predicate.type}:${e.predicate.content.condition}:data:${e.predicate.content.input}:${e.predicate.content.value}`;case"OnFirstEvent":return`${e.type}:${e.predicate.event}:state:${null!==(n=t.firedEvents[e.predicate.event])&&void 0!==n&&n}`;case"FormState":throw new Error("FormState predicates bypass the When result cache (see groupByCache)");default:return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${Fa(e.type,t)}:${t.totalGroups}`}}(e,t),r=n.current.get(o);return a.evolve(Ka(r)?{cached:a.append(r)}:{uncached:a.append({key:o,predicate:e})},i)}(i,n,e,t)),{cached:[],uncached:[]}),l=Ba(s.map((({predicate:e})=>e)),n);return a.zip(s,l).forEach((([{key:t},n])=>{e.current.set(t,n)})),r.concat(l)}const Ka=a.is(Boolean);const Wa=a.curry(((e,t,n)=>{var i,a,o,r,s,l;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:Ua(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,firedEvents:n.firedEvents,formStates:n.formStates,positionIndex:e,creativeCopy:t}})),Ya=a.lensPath(["predicate","content","input"]),Ja=a.lensPath(["predicate","content","value"]),Xa=a.lensPath(["predicate","key"]);function Qa(e,t){const n=a.over(Ya,(t=>t?e(t):"")),i=a.over(Ja,(t=>"string"==typeof t?e(t):t)),o=a.compose(n,i),r=a.over(Xa,(t=>t?e(t):""));return t.map((t=>{switch(t.type){case"Placeholder":if("NumericCompare"===t.predicate.type){const{content:n}=t.predicate;return Object.assign(Object.assign({},t),{predicate:Object.assign(Object.assign({},t.predicate),{content:Object.assign(Object.assign({},n),{left:e(n.left),right:e(n.right)})})})}return"TextValue"===t.predicate.type?o(t):n(t);case"CustomState":return r(t);default:return t}}))}const eo=a.all(a.equals(!0));function to(e){const n=Li(),i=wi(),a=t.useRef(new Map),o=Yn(),r=Fn(za,Wa(i,o)),s=Qa(bi(),e);return t.useMemo((()=>eo(qa(a,s,r,n))),[a,s,r,n])}function no(e){const n=Li(),i=wi(),o=t.useRef(new Map),r=Yn(),s=Fn(za,Wa(i,r)),l=bi();return t.useMemo((()=>a.mapObjIndexed((e=>{const t=Qa(l,e);return eo(qa(o,t,s,n))}),e)),[o,e,s,n,l])}function io(e){e&&(e.style.display="")}function ao(e){e&&(e.style.display="none")}function oo(e){return e.settings.duration}const ro=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],so=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function lo(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const i=t?ro:so,a=e.animate(i,{duration:n,iterations:1});return a.onfinish=()=>{t?io(e):ao(e)},a.oncancel=()=>{t?io(e):ao(e)},()=>{a.finish()}}return t?io(e):ao(e),()=>{}}function co({inTransitions:n,outTransitions:i,visible:a,children:o,containerClassName:r}){const s=t.useRef(null);return t.useEffect((()=>a&&n?n.forEach((e=>{s.current&&function(e,t,n,i){if("FadeIn"===i)lo(e,t,n)}(s.current,a,oo(e),e.type)})):!a&&i?i.forEach((e=>{s.current&&function(e,t,n,i){if("FadeOut"===i)lo(e,t,n)}(s.current,a,oo(e),e.type)})):()=>{}),[a]),e.jsx("div",{ref:s,style:{display:"none"},className:r,children:o})}function uo(n){const i=Gn(),a=to(n.schema.predicates),o=t.Children.toArray(n.schema.children.map(((e,t)=>i(e,void 0,n.testId?`${n.testId}-child${t}`:void 0))));return n.schema.transition?e.jsx(co,{inTransitions:n.schema.transition.inTransition,outTransitions:n.schema.transition.outTransition,visible:a,children:o}):"functionally"===n.schema.hide?e.jsx(Qi.Provider,{value:a?"ENABLED":"DISABLED",children:o}):a?e.jsx(e.Fragment,{children:o}):null}const po=a.mergeWith(((e,t)=>`${e||""} ${t||""}`.trim())),fo=e=>{var n;const i=t.useContext(Ei),o=wi(),r=zn()||document.head,s=ha(),l=Tn(s,o,r),c=t.useCallback(Rn,[]),d=Fn([],(e=>Object.values(e.breakpoint.breakpoints))),u=i||c(d,s,o,r),p=e.styles?u(e.styles):{},f=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=Oa(e);return a.mapObjIndexed((e=>Ta(t)||!e?null:n({predicates:t.predicates,duration:t.duration,styles:e})),t.value)}(l,null===(n=e.styles)||void 0===n?void 0:n.conditionalTransitions):void 0,h=no(f?a.mapObjIndexed(a.propOr([],"predicates"),f):{}),v=a.mapObjIndexed(((e,t)=>e?function(e,t){var n;if(e&&t in e)return null===(n=e[t])||void 0===n?void 0:n.classname}(f,t):void 0),h),y=f?a.mapObjIndexed(a.prop("transitionBaseClassname"),f):{},m=e.styles?((e,t,n)=>po(po(e,t),n))(p,v,y):void 0;return e.children({classnames:m,mapperRef:u})};function ho(n){const i=Gn();return e.jsx(fo,{styles:n.schema.styles,children:({classnames:a})=>{var o;return e.jsx("div",{className:a?a.own:void 0,"data-testid":n.testId,"data-e2e-item":n.e2eItemId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(o=n.schema.a11yLabel)&&void 0!==o?o:void 0,children:t.Children.toArray(n.schema.children.map(((e,t)=>i(e,void 0,ce(t,n.testId)))))})}})}function vo(n){const i=Gn();return e.jsx(fo,{styles:n.schema.styles,children:({classnames:a})=>{var o;return e.jsx("div",{className:a?a.own:void 0,"data-testid":n.testId,"data-e2e-item":n.e2eItemId,style:{display:"flex",flexDirection:"row"},"aria-label":null!==(o=n.schema.a11yLabel)&&void 0!==o?o:void 0,children:t.Children.toArray(n.schema.children.map(((e,t)=>i(e,void 0,ce(t,n.testId)))))})}})}const yo={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",ht,vt],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},mo=new Map([["&","_;^;_"]]),Co=new RegExp(`<a *(?=${yo.allowedAttributes.a.join("|")}|>)`,"g"),go=new RegExp('<a [^>]*href="([^"]+)"',"g"),bo=new RegExp("(<br *?>)|(<br *?/>)","g"),Eo="<br/>";function Io(n){const i=bi(),a=ea(),o=t.useMemo((()=>{const e=i(n.schema.value);if(!function(e){const t=function(e){return e.replaceAll(go,((e,t)=>{const n=t.replaceAll("&",mo.get("&"));return e.replace(t,n)})).replaceAll(bo,Eo)}(e);return t===u(t,yo)}(e))throw new Y("FAILED_SANITISING_HTML","Invalid HTML tags");return e.trim()?e:""}),[n.schema.value,i]),{tabIndex:r,styles:s,isDisabled:l}=b(a),{setRef:c,maskStyle:d}=xt("vertical",Lt(n.schema.styles));return o?e.jsx(fo,{styles:n.schema.styles,children:({classnames:t})=>{const i=[(null==t?void 0:t.link)?`class = "${null==t?void 0:t.link}"`:"",l?'tabindex="-1"':"",l?"style=\"pointer-events: 'none'; user-select: none;\"":"",l?'aria-disabled="true"':""].filter((e=>e.length>0)),a=Object.assign(Object.assign({},s),d);return u=o,new RegExp("</(p|ul|ol)>").test(u)?e.jsx("div",{ref:c,tabIndex:r,style:a,"aria-hidden":l,className:null==t?void 0:t.own,"data-testid":n.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:o.replace(Co,`<a ${i.join(" ")}`)}}):e.jsx("p",{ref:c,tabIndex:r,style:a,"aria-hidden":l,className:null==t?void 0:t.own,"data-testid":n.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:o.replace(Co,`<a ${i.join(" ")}`)}});var u}}):null}function xo(t){const n=bi()(t.schema.value),i=ea(),{tabIndex:a,styles:o,isDisabled:r}=b(i);return n?e.jsx(fo,{styles:t.schema.styles,children:({classnames:i})=>{const s={tabIndex:a,"aria-hidden":r,className:null==i?void 0:i.own,"data-testid":t.testId,"data-e2e":"BasicText"};return t.isInline?e.jsx("span",Object.assign({style:o},s,{children:n})):e.jsx("p",Object.assign({style:o},s,{children:n}))}}):null}function Lo(t,n,i){if("BasicText"===t.type)return e.jsx(xo,{schema:t.node,testId:n,isInline:null!=i&&i})}function Do(t,n,i,a,o){return e.jsx(Ii,{value:i(n),children:wo(t,a,o)})}function wo(e,n,i){return t.Children.toArray(e.map(((e,t)=>n(e,void 0,ce(t,i)))))}function So(n){const i=_n(),a=Gn(),o=Wn(),r=bi(),s=wi(),l=ea(),c=o.creative.responseOptionsMap[n.schema.responseKey],d=t.useRef(null),u=t.useRef(!1),p=t.useCallback((()=>{u.current||(d.current=Date.now())}),[]),f=t.useCallback((()=>{const e=d.current;if(null===e)return;const t=Date.now(),a="positive"===n.schema.responseKey?"-Positive":"-Negative";t>e&&i({type:be,payload:{name:"SignalUserInteraction",action:"Hover",context:`CreativeResponse${a}`,parentGuid:o.creative.instanceGuid,objectData:{startTimestamp:e.toString(),endTimestamp:t.toString()}}}),u.current=!1,d.current=null}),[i,o.creative.instanceGuid,n.schema.responseKey]),h=A(c);t.useEffect((()=>{h&&i(function(e){if(e.paymentTriggerConfig)return{type:ke,payload:{criteria:{key:"PAYMENT_OFFER_SELECTED"},signal:{name:j(e.signalType),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,i,h]);const v=c?r({data:c},"creativeResponse"):r,{tabIndex:y,styles:m,isDisabled:C}=b(l);return L(c)&&!h&&void 0!==s?e.jsx(fo,{styles:n.schema.styles,children:({classnames:t,mapperRef:r})=>e.jsx("button",{type:"button",tabIndex:y,"aria-disabled":C,"aria-label":n.schema.a11yLabel?v(n.schema.a11yLabel):void 0,style:Object.assign({cursor:"pointer"},m),"data-testid":n.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":n.schema.responseKey,onMouseOver:p,onMouseLeave:f,onClick:e=>{e.preventDefault(),f();const t=ge(o,c,n.schema.openLinks);i({type:ue,payload:t})},className:null==t?void 0:t.own,disabled:C,children:e.jsx(gi,{value:v,children:(null==t?void 0:t.own)?Do(n.schema.children,t.own,r,a,n.testId):wo(n.schema.children,a,n.testId)})})}):null}function Ao(t){const n=ea(),{styles:i,isDisabled:a}=b(n);return t.schema.url.light?e.jsx(fo,{styles:g(t.schema.styles),children:({classnames:n})=>e.jsx("img",{"aria-hidden":a,style:Object.assign(Object.assign({},i),{display:"inline-block"}),alt:a?void 0:t.schema.alt||void 0,title:t.schema.title||void 0,className:n?n.own:void 0,"data-testid":t.testId,"data-e2e":"StaticImage",src:t.schema.url.light})}):null}function Oo(t){const n=ea(),{styles:i,isDisabled:a}=b(n),o=ra(t.schema.imageKey);return null!=(r=o)&&"object"==typeof r&&"light"in r&&"string"==typeof r.light?e.jsx(fo,{styles:g(t.schema.styles),children:({classnames:n})=>e.jsx("img",{"aria-hidden":a,style:Object.assign(Object.assign({},i),{display:"inline-block"}),alt:o.alt,title:o.title,className:n?n.own:void 0,"data-testid":t.testId,"data-e2e":"DataImage",src:o.light})}):null;var r}const To={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function jo(t){const n=t.schema.name,i=t.schema.description,a=t.schema.styles?se(To,t.schema.styles):To,o=ea(),{styles:r,isDisabled:s}=b(o);return n?e.jsx(fo,{styles:a,children:({classnames:a})=>e.jsx("span",Object.assign({style:Object.assign(Object.assign({},r),{display:"inline-block"}),className:"rokt-icon"+((null==a?void 0:a.own)?" "+a.own:""),"data-testid":t.testId,"data-e2e":`StaticIcon-${n}`},!s&&i?{title:i}:{"aria-hidden":"true"},{children:n}))}):null}function ko(t,n){if("StaticIcon"===t.type)return e.jsx(jo,{schema:t.node,testId:n})}const Mo={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class Ro extends t.Component{constructor(e){super(e),this.state={errorMessage:""}}static getDerivedStateFromError(e){return{errorMessage:e.message}}componentDidUpdate(e){this.state.errorMessage&&JSON.stringify(e.schema)!==JSON.stringify(this.props.schema)&&this.setState({errorMessage:""})}componentDidCatch(e,t){var n;this.props.reporter&&"true"===St.REPORT_RENDER_ERRORS&&this.props.reporter({level:q,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"===St.DISPLAY_ERRORS?e.jsxs("pre",{style:Mo,children:[e.jsx("strong",{children:"Error:"})," [",e.jsx("em",{children:this.props.schema.type}),"]"," ",this.state.errorMessage]}):void 0:this.props.children}}Ro.contextType=la;const Vo={internally:"_top",externally:"_blank"};function Po(t,n,i,a,o){return e.jsx(Ii,{value:i(n),children:Ho(t,a,o)})}function Ho(e,n,i){return t.Children.toArray(e.map(((e,t)=>n(e,void 0,i?`${i}-child${t}`:void 0))))}function _o(t){var n;const i=Vo[t.schema.open],a=Gn(),o=ea(),{tabIndex:r,styles:s,isDisabled:l}=b(o);return(null===(n=t.schema.children)||void 0===n?void 0:n.length)>0?e.jsx(fo,{styles:t.schema.styles,children:({classnames:n,mapperRef:o})=>{var c;return e.jsx("a",{href:t.schema.src,"data-testid":t.testId,"data-e2e":"StaticLink",target:null!=i?i:"_blank",tabIndex:r,"aria-disabled":l,"aria-label":null!==(c=t.schema.a11yLabel)&&void 0!==c?c:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:t.isInline?"inline":"block"},s),className:null==n?void 0:n.own,children:(null==n?void 0:n.own)?Po(t.schema.children,null==n?void 0:n.own,o,a,t.testId):Ho(t.schema.children,a,t.testId)})}}):null}function No(t,n,i){if("StaticLink"===t.type)return e.jsx(_o,{schema:t.node,testId:n,isInline:null!=i&&i})}const Fo={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function $o(n){const i=(a=n.schema.iconKey,t.useContext(aa)(a,"icons"));var a;const o=null==i?void 0:i.name,r=n.schema.styles?se(Fo,n.schema.styles):Fo,s=ea(),{styles:l}=b(s);return o?e.jsx(fo,{styles:r,children:({classnames:t})=>e.jsx("span",{style:Object.assign(Object.assign({},l),{display:"inline-block"}),"aria-hidden":"true",className:"rokt-icon"+((null==t?void 0:t.own)?" "+t.own:""),"data-testid":n.testId,"data-e2e":`DataIcon-${o}`,children:o})}):null}function Zo(n){const i=Gn(),a=t.useRef(null),r=ha(),s=wi(),l=zn(),c=(l?Tn(r,s,l):o.css)`
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("react-dom/client"),i=require("react-redux"),a=require("ramda"),o=require("@emotion/css"),r=require("redux-saga/effects"),s=require("redux-saga"),l=require("@reduxjs/toolkit"),c=require("@redux-saga/core/effects"),d=require("embla-carousel-react"),u=require("insane"),p=require("@emotion/css/create-instance"),f=require("embla-carousel-autoplay"),h=require("embla-carousel-fade");function v(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var y,m,C=v(t);function g(e){const t=["elements","own"],n=["default","dimension","width","type"],i=["default","dimension","width","value"],o=["default","dimension","minWidth"],r=a.path(t,e);return r&&Array.isArray(r)&&r.length?a.assocPath(t,r.map(a.when(a.allPass([a.hasPath(n),a.complement(a.hasPath(o)),a.pathEq("fixed",n)]),(e=>a.assocPath(o,a.path(i,e),e)))),e):e}function b(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function E(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function I(){return"ontouchstart"in document.documentElement}function x(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function L(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function D(e){return L(e)&&"Fulfillment"===e.action}function w(e){return L(e)&&"Url"===e.action}function S(e){return L(e)&&"CaptureOnly"===e.action}function A(e){return L(e)&&"ExternalPaymentTrigger"===e.action}function O(e){return(D(e)||w(e))&&"RealTime"===e.conversionType&&"rclid"in e}function T(e){return(D(e)||w(e))&&"RealTimeReferral"===e.conversionType&&"rclid"in e}function j(e){switch(e){case"SignalGatedResponse":return"SignalGatedResponse";case"SignalOptInResponse":return"SignalOptInResponse";case"SignalOptOutResponse":return"SignalOptOutResponse";default:return"SignalResponse"}}function k(e){return e.slice(e.lastIndexOf(":")+1)}function M(e){return{oldCartItem:null,cartItem:{cartItemId:e,catalogItemId:"",name:"",description:"",quantity:0,unitPrice:0,totalPrice:0,currency:"",providerData:""}}}!function(e){e.Unknown="Unknown",e.InStock="InStock",e.OutOfStock="OutOfStock"}(y||(y={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.Other=1]="Other",e[e.Card=2]="Card",e[e.PayPal=3]="PayPal",e[e.ApplePay=4]="ApplePay",e[e.GooglePay=5]="GooglePay",e[e.Afterpay=6]="Afterpay"}(m||(m={}));const R="FAILED_TO_PROCESS_PARTNER_UPDATE_CART_ITEM";function V(e){return null!==e&&"object"==typeof e&&"cartItemId"in e&&"string"==typeof e.cartItemId&&"quantity"in e&&"number"==typeof e.quantity&&!("unitPrice"in e)}const P={pluginId:"shared",pageInstanceGuid:"N/A"},H="offerComplete",_="checkout",N="layoutMinimized";function F(e){return e.registrationCount>0}function $(e){return e.validated&&!e.valid&&e.errorVisible}function Z(e,t=[]){const n=0===e.trim().length;for(const i of t){if(n&&"Required"!==i.type)continue;const t=G(e,i);if(t)return t}return""}function G(e,t){switch(t.type){case"Required":return 0===e.trim().length?t.value.message:"";case"MinLength":return e.length<t.value.length?t.value.message:"";case"MaxLength":return e.length>t.value.length?t.value.message:"";case"Pattern":return function(e,t){try{return new RegExp(t).test(e)}catch(e){return!0}}(e,t.value.pattern)?"":t.value.message;default:return""}}function B(e,t){return t.flatMap((t=>{var n;const i=t.indexOf(".");if(-1===i){const i=null!==(n=e[t])&&void 0!==n?n:{};return Object.entries(i).filter((([,e])=>F(e))).map((([e])=>({formKey:t,fieldKey:e})))}return[{formKey:t.slice(0,i),fieldKey:t.slice(i+1)}]}))}var U;!function(e){e.DCUI="DCUI",e.Partner="partner"}(U||(U={}));const z=["SignalCartItemQuantitySelected","SignalProductItemResponse","SignalUserInteraction","SignalOptInResponse","SignalOptOutResponse"],q="ERROR",K="INFO",W="WARNING";class Y extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const J=["V2_CART_ITEM_UPDATED","UPDATE_CART_ITEM_MESSAGE","CART_ITEM_INSTANT_PURCHASE","UPSELL_ITEM_INSTANT_PURCHASE","DELIVERY_DETAILS_SENT","OFFER_ENGAGEMENT","POSITIVE_ENGAGEMENT","UPSELL_CREATIVE_SENT","REALTIME_OFFER_FULFILLMENT_REFERRAL","REALTIME_OFFER_FULFILLMENT_CONVERSION","REALTIME_OFFER_FULFILLMENT_SUCCESS","INITIATE_INSTANT_PURCHASE_EVENT","INSTANT_PURCHASE_INITIATE_TAX_AND_SHIPPING_EVENT","INITIATE_CART_ITEM_EVENT","PREPARE_DEVICE_PAY_EVENT","INITIATE_DEVICE_PAY_EVENT","ABORT_DEVICE_PAY_EVENT","COMPLETE_DEVICE_PAY_EVENT","LEAD_CAPTURE_SUBMITTED","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];function X(e,t){const n=null==e?void 0:e.creative.responseOptionsMap[t];return"positive"===t&&w(n)&&n.isPositive&&"string"==typeof n.url&&n.url.trim()&&"SignalSecondaryResponse"!==n.signalType&&(void 0===n.conversionType||"Default"===n.conversionType)?n:void 0}function Q(e,t){const n=null==e?void 0:e.creative.responseOptionsMap[t];if(n&&Boolean(n.isPositive)===("positive"===t)&&"SignalSecondaryResponse"!==n.signalType)return S(n)?n:!w(n)||"negative"!==t||void 0!==n.conversionType&&"Default"!==n.conversionType?X(e,t):n}const ee=(e,t)=>a.concat(e,a.slice(e.length,t.length,t)),te=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?ee(t,e):t,i=t.length>e.length?ee(e,t):e;return a.zipWith(re,i,n)}return t},ne=e=>null==e,ie=e=>!ne(e),ae=(e,t)=>ne(t)?e:t,oe=(e,t)=>{throw new Y("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function re(e,t){return a.cond([[(e,t)=>ie(e)&&ie(t)&&a.type(e)!==a.type(t)&&("Object"===a.type(e)||"Object"===a.type(t)),oe],[(e,t)=>ne(e)||ne(t),ae],[(e,t)=>"Object"===a.type(e),a.mergeDeepWith(re)],[(e,t)=>"Array"===a.type(e),te],[a.T,a.flip(a.unary(a.identity))]])(e,t)}function se(e,t){return re(e,t)}function le(e=0){return`breakpoint-${e}px`}function ce(e,t){return t?`${t}-child${e}`:void 0}const de="GLOBAL/RAISE_METRIC",ue="GLOBAL/OFFER_ENGAGEMENT";function pe(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&D(e.responseOption)&&"fulfillment"in e&&x(e.fulfillment)}function fe(e){return A(e)}function he(e){return w(e)}function ve(e){return S(e)}function ye(e){return!!(O(e)||"responseOption"in e&&O(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function me(e){return!!(T(e)||"responseOption"in e&&T(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function Ce(e){return"string"==typeof e&&""!==e?{adID:e}:{}}function ge(e,t,n){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(x(n))return Object.assign({fulfillment:n,responseOption:t,creativeInstanceGuid:e.creative.instanceGuid,accountID:e.accountId,referralCreativeID:e.creative.referralCreativeId},Ce(e.adId));throw new Error(`Invalid Fulfillment: ${n} with referralCreativeID: ${e.creative.referralCreativeId}`)}case"Url":return Object.assign(Object.assign(Object.assign(Object.assign({},t),{accountID:e.accountId,creativeInstanceGuid:e.creative.instanceGuid,referralCreativeID:e.creative.referralCreativeId}),Ce(e.adId)),{urlBehavior:n&&"internally"===n.toLowerCase()?"self":t.urlBehavior});default:return Object.assign(Object.assign({},t),{creativeInstanceGuid:e.creative.instanceGuid})}}const be="GLOBAL/RAISE_SIGNAL",Ee="GLOBAL/OFFER_LIFECYCLE",Ie=new Set(["__proto__","constructor","prototype"]);function xe(e){return"string"==typeof e&&e.length>0&&!Ie.has(e)}const Le="GLOBAL/SET_CUSTOM_STATE";const De="ProcessingState",we="DevicePayErrorState",Se="PayPalDevicePayErrorState",Ae="applePayUnavailable",Oe="GLOBAL/SEND_PARTNER",Te="GLOBAL/SET_DOMAIN_STATE",je="GLOBAL/LAYOUT_EVENT",ke="GLOBAL/PREPARE_SIGNAL",Me="GLOBAL/OPEN_LINK",Re="GLOBAL/SET_PARTNER_VALIDATION_STATUS",Ve="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",Pe="GLOBAL/LAUNCH_CHILD_LAYOUT",He="GLOBAL/CART_ITEM_EVENT/INITIATE",_e="GLOBAL/CART_ITEM_EVENT/RESPONSE",Ne="OVERLAY/DISMISS_OVERLAY",Fe="plugin-overlay",$e="GLOBAL/TRIGGER_ACTION";const Ze="ERROR/REPORT",Ge="GLOBAL/REGISTER_FORM_FIELD",Be="GLOBAL/UNREGISTER_FORM_FIELD",Ue="GLOBAL/SET_FORM_FIELD_VALUE",ze="GLOBAL/SET_FORM_FIELD_TOUCHED",qe="GLOBAL/VALIDATE_FORM_FIELDS";function Ke(e){const{formKey:t,fieldKey:n}=null!=e?e:{};return xe(t)&&xe(n)}const We={RAISE_METRIC:de,PREPARE_SIGNAL:ke,OFFER_ENGAGEMENT:ue,RAISE_SIGNAL:be,OFFER_LIFECYCLE:Ee,SEND_PARTNER:Oe,SET_CUSTOM_STATE:Le,SET_DOMAIN_STATE:Te,LAYOUT_EVENT:je,OPEN_LINK:Me,SET_PARTNER_VALIDATION_STATUS:Re,SET_GLOBAL_OFFER_DATA_CART:Ve,LAUNCH_CHILD_LAYOUT:Pe,INITIATE_CART_ITEM_EVENT:He,CART_ITEM_RESPONSE:_e,DISMISS_OVERLAY:Ne,TRIGGER_ACTION:$e,REGISTER_FORM_FIELD:Ge,UNREGISTER_FORM_FIELD:Be,SET_FORM_FIELD_VALUE:Ue,SET_FORM_FIELD_TOUCHED:ze,VALIDATE_FORM_FIELDS:qe,REPORT_ERROR:Ze},Ye="CHILD_LAYOUT/DISPATCH_BEHAVIOR",Je="CHILD_LAYOUT/STATE_SYNC",Xe="CHILD_LAYOUT/READY",Qe="CHILD_LAYOUT/REQUEST_DEVICE_PAY";function et(e){return xe(e)&&!e.includes("%^")}const tt={[$e]:function(e){const{action:t}=null!=e?e:{};return"object"==typeof t&&null!==t},[Le]:function(e){const{key:t,value:n}=null!=e?e:{};return xe(t)&&"number"==typeof n&&isFinite(n)},[Ge]:function(e){const{formKey:t,fieldKey:n,defaultValue:i,validations:a}=null!=e?e:{};return xe(t)&&xe(n)&&"string"==typeof i&&Array.isArray(a)},[Be]:Ke,[Ue]:function(e){const{formKey:t,fieldKey:n,value:i,validate:a}=null!=e?e:{};return xe(t)&&xe(n)&&"string"==typeof i&&"boolean"==typeof a},[ze]:Ke,[qe]:function(e){const{entries:t}=null!=e?e:{};return Array.isArray(t)&&t.every((e=>"string"==typeof e))}};function nt(e){return"object"==typeof e&&null!==e&&1===e.version&&"payload"in e}const it="stage"===(at="undefined"==typeof __environment?void 0:__environment.ENVIRONMENT)||"uat"===at||"prod"===at;var at;const ot="CONTINUOUS_CHILD/READY",rt="CONTINUOUS_CHILD/PRESENTATION",st="CONTINUOUS_CHILD/APPLIED",lt="CONTINUOUS_CHILD/REQUEST",ct="CONTINUOUS_CHILD/EXPOSURE";function dt(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const ut=e=>"string"==typeof e&&e.trim().length>0&&e.length<=256;function pt(e){return dt(e)&&ut(e.sessionId)&&ut(e.creativeInstanceGuid)&&(void 0===e.childInstanceGuid||ut(e.childInstanceGuid))&&Number.isSafeInteger(e.revision)&&Number(e.revision)>0&&Number.isSafeInteger(e.position)&&Number(e.position)>=0}function ft(e,t){return e.sessionId===t.sessionId&&e.revision===t.revision&&e.position===t.position&&e.creativeInstanceGuid===t.creativeInstanceGuid&&e.childInstanceGuid===t.childInstanceGuid}const ht="data-open-in-app",vt="data-click-signal-context";function yt(e,n){function i(e){var t;if(!(e.target&&e.target instanceof HTMLElement))return;const i=null===(t=e.target)||void 0===t?void 0:t.closest("a");if(i){const t=i.getAttribute("href"),a=i.getAttribute(vt);if(a&&n({type:be,payload:{name:"SignalUserInteraction",action:"Click",context:a}}),t){e.preventDefault();let a="newTab";i.hasAttribute(ht)?a="inApp":"_top"===i.getAttribute("target")&&(a="self"),n({type:Me,payload:{url:t,urlBehaviour:a}})}}}t.useEffect((()=>null!==e?(e.addEventListener("click",i),()=>{e.removeEventListener("click",i)}):()=>{}),[e])}function mt(){const e=t.useRef(null);return t.useEffect((()=>{const t=t=>{"Tab"===t.key&&Ct(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const Ct=(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()},gt="both",bt="linear",Et={hasOverflow:!1,atStart:!0,atEnd:!0};function It(e,t){if("horizontal"===t){const t=e.scrollWidth-e.clientWidth;return{hasOverflow:t>0,atStart:e.scrollLeft<=0,atEnd:e.scrollLeft>=t}}const n=function(e){if("undefined"==typeof window)return e.scrollHeight;const t=window.getComputedStyle(e),n=t.webkitLineClamp;if(!n||"none"===n||"normal"===n)return e.scrollHeight;const i=e.style,a={webkitLineClamp:i.webkitLineClamp,display:i.display,overflow:i.overflow,maxHeight:i.maxHeight};i.setProperty("-webkit-line-clamp","unset"),i.display="block",i.overflow="visible",i.maxHeight="none";const o=e.scrollHeight;return i.webkitLineClamp=a.webkitLineClamp,i.display=a.display,i.overflow=a.overflow,i.maxHeight=a.maxHeight,o}(e),i=n-e.clientHeight;return{hasOverflow:i>0,atStart:e.scrollTop<=0,atEnd:e.scrollTop>=i}}function xt(e,n){const i=t.useRef(null),[a,o]=t.useState(null),[r,s]=t.useState(Et),l=t.useCallback((e=>{i.current=e,o(e)}),[]),c=!!n;t.useEffect((()=>{if(!a||!c)return;const t=()=>s(It(a,e));let n;return t(),a.addEventListener("scroll",t,{passive:!0}),"undefined"!=typeof ResizeObserver&&(n=new ResizeObserver(t),n.observe(a),Array.from(a.children).forEach((e=>null==n?void 0:n.observe(e)))),()=>{a.removeEventListener("scroll",t),null==n||n.disconnect()}}),[a,e,c]);const d=t.useMemo((()=>function(e,t,{hasOverflow:n,atStart:i,atEnd:a}){var o,r,s,l,c,d;if(!t||!n)return{};const u=null!==(o=t.edges)&&void 0!==o?o:gt,p=null!==(r=t.easing)&&void 0!==r?r:bt,f=null!==(s=t.size)&&void 0!==s?s:36,h=null!==(l=t.startSize)&&void 0!==l?l:f,v=null!==(c=t.endSize)&&void 0!==c?c:f,y=("start"===u||"both"===u)&&!i,m=("end"===u||"both"===u)&&!a;if(!y&&!m)return{};const C="horizontal"===e?"to right":"to bottom",g=`linear-gradient(${C},${E=y?function(e,t){switch(e){case"ease-in":return["transparent 0",`transparent ${.3*t}px`,`black ${t}px`];case"ease-out":return["transparent 0",`black ${.7*t}px`,`black ${t}px`];case"ease-in-out":return["transparent 0",`rgba(0,0,0,0.5) ${.5*t}px`,`black ${t}px`];default:return["transparent 0",`black ${t}px`]}}(p,h):["black 0"],I=m?function(e,t){switch(e){case"ease-in":return[`black calc(100% - ${t}px)`,`transparent calc(100% - ${.3*t}px)`,"transparent 100%"];case"ease-out":return[`black calc(100% - ${t}px)`,`black calc(100% - ${.7*t}px)`,"transparent 100%"];case"ease-in-out":return[`black calc(100% - ${t}px)`,`rgba(0,0,0,0.5) calc(100% - ${.5*t}px)`,"transparent 100%"];default:return[`black calc(100% - ${t}px)`,"transparent 100%"]}}(p,v):["black 100%"],[...E,...I].join(",")})`,b=null!==(d=t.clip)&&void 0!==d?d:"border-box";var E,I;return{maskImage:g,WebkitMaskImage:g,maskMode:"alpha",WebkitMaskMode:"alpha",maskRepeat:"no-repeat",WebkitMaskRepeat:"no-repeat",maskClip:b,WebkitMaskClip:b}}(e,n,r)),[e,n,r]);return Object.assign({ref:i,setRef:l,maskStyle:d},r)}function Lt(e){var t,n,i,a,o,r;return null!==(r=null===(o=null===(a=null===(i=null===(n=null===(t=null==e?void 0:e.elements)||void 0===t?void 0:t.own)||void 0===n?void 0:n[0])||void 0===i?void 0:i.default)||void 0===a?void 0:a.container)||void 0===o?void 0:o.scrollMask)&&void 0!==r?r:null}const Dt=a.sortBy(a.prop(1)),wt=a.map(a.prop(0)),St="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function At(e,t){return t?"false"!==St.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${le(e)} ${t.trim()}`:`#app-container.${le(e)} & {${t}}`:"";var n}const Ot={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"},Tt={selected:'[data-selected="true"]',errored:'[data-errored="true"]'};function jt(e){return function(e){return Object.keys(Ot).indexOf(e)>-1}(e)?Ot[e]:function(e){return Object.keys(Tt).indexOf(e)>-1}(e)?Tt[e]:""}const kt={container:{justifyContent:"justify-content",alignItems:"align-items",shadow:"box-shadow",gap:"gap",overflow:"overflow",scrollMask:"",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 Mt(e,t){if(!kt[e]||!kt[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return kt[e][t]}function Rt(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function Vt(...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 Pt(e,t){return`${e}:${t};`}function Ht(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class _t extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function Nt(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 _t(n,JSON.stringify(t));return!0}function Ft(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function $t(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 Zt(e){if(null==e||""===e)return"value must not be omitted"}function Gt(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 Bt(e){const t=new RegExp(/^(?:(?:data:image\/[^;"\\\n\r\f]+;base64[^"\\\n\r\f#]+)|(?:(?: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}(?:\?[^"\\\n\r\f#]*)?)(?:#[^"\\\n\r\f]*)?$/);if("string"!=typeof e||!t.test(e))return"value must be a valid CSS URL string"}function Ut(e){if(null!=e&&""!==e)return"value must not be specified"}function zt(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 qt(...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||Ft(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function Kt(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 Wt(e){if("string"!=typeof e)return"value must be a string"}const Yt=a.is(Object);function Jt(e){const t=Object.entries(e);return n=>Yt(n)&&!Array.isArray(n)?t.reduce(((e,[t,i])=>e||i(n[t])),void 0):`Input value (${e}) must be an object`}function Xt(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function Qt(e,t,n){return Nt(Ft,n)?Pt(Mt(e,t),`${n}`):""}function en(e){return(t,n,i)=>Nt($t(Object.keys(e)),i)?Pt(Mt(t,n),`${e[i]}`):""}function tn(e){return Nt(Zt,e)?Rt({light:t(Bt,!1),dark:t(Kt(Ut,Bt),!0)},Vt("\n "))(e):"";function t(e,t){return n=>{if(Nt(e,n)&&n){const e=Pt("background-image",`url("${i=n,i.replace(/["\\\n\r\f:;]/g,(e=>'"'===e||"\\"===e?`\\${e}`:`\\${e.charCodeAt(0).toString(16)} `))}")`);return t?Ht(e):e}var i;return""}}}function nn(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),Nt(Kt(Ut,$t(Object.keys(t))),e)&&e?Pt("background-size",t[e]):""}const an=a.cond([[a.equals("top-left"),a.always("top left")],[a.equals("top-right"),a.always("top right")],[a.equals("bottom-left"),a.always("bottom left")],[a.equals("bottom-right"),a.always("bottom right")],[a.T,a.identity]]);function on(e){const t="string"==typeof e?e.toLowerCase():e;return Nt(Kt(Ut,$t(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?Pt("background-position",an(t)):""}function rn(e,t,n){return Nt(Kt(Ft,qt(2,3,4)),n)?Pt(Mt(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function sn(e){return(t,n,i)=>Nt(zt({fit:$t(e),percentage:Ft,fixed:Ft}),i)?Pt(Mt(t,n),ln(i)):""}function ln(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]}}const cn=Jt({light:Gt,dark:Kt(Ut,Gt)});function dn(e,t,n){return i=>{if(i){const a=Pt(Mt(e,t),pn(String(i)));return n?Ht(a):a}return""}}function un(e,t,n){return Nt(cn,n)?Rt({light:dn(e,t,!1),dark:dn(e,t,!0)},Vt("\n "))(n):""}function pn(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 fn=Jt({offsetX:Kt(Ut,Ft),offsetY:Kt(Ut,Ft),blurRadius:Kt(Ut,Ft),spreadRadius:Kt(Ut,Ft),color:cn}),hn=e=>t=>null!=t?String(t):e,vn=a.compose(a.concat(a.__,"px"),hn("0")),yn=e=>t=>"string"==typeof t?e(t):t,mn=a.compose(yn(a.concat(a.__,"px")),hn(void 0)),Cn=a.compose(yn(pn),a.prop("dark"));function gn(e,t,n){return Pt(e,Rt({offsetX:vn,offsetY:vn,blurRadius:t.spreadRadius?vn:mn,spreadRadius:mn,color:n},Vt(" "))(t))}const bn=Jt({edges:Kt(Ut,$t(["start","end","both"])),size:Kt(Ut,Ft),startSize:Kt(Ut,Ft),endSize:Kt(Ut,Ft),easing:Kt(Ut,$t(["linear","ease-in","ease-out","ease-in-out"])),clip:Kt(Ut,$t(["border-box","padding-box","content-box"]))});const En={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},In={container:{justifyContent:en(En),alignItems:en(En),shadow:function(e,t,n){var i,o,r;if(Nt(fn,n)){const s=Mt(e,t);return Vt("\n")(gn(s,n,(o="light",r="#80000000",a.compose(pn,a.propOr(r,o)))),(null===(i=n.color)||void 0===i?void 0:i.dark)?Ht(gn(s,n,Cn)):"")}return""},gap:rn,overflow:en({hidden:"hidden",visible:"visible"}),scrollMask:function(e,t,n){return null==n||Nt(bn,n),""},blur:function(e,t,n){return Nt(Xt,n)?Pt(Mt(e,t),`blur(${n.toString()}px)`):""},opacity:Qt},text:{textColor:un,fontSize:rn,fontFamily:function(e,t,n){return Nt(Wt,n)?Pt(Mt(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:en({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:en({normal:"normal",italic:"italic"}),lineHeight:rn,lineLimit:function(e,t,n){return Nt(Ft,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:rn,baselineTextAlign:en({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:en({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:en({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:en({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:un,backgroundImage:function(e,t,n){return Nt(Zt,n)?Rt({url:tn,position:on,scale:nn},Vt)(n):""}},dimension:{width:sn(["wrap-content","fit-width"]),maxWidth:rn,minWidth:rn,height:sn(["wrap-content","fit-height"]),maxHeight:rn,minHeight:rn,rotateZ:(xn="Z",(e,t,n)=>{const i=`rotate${xn}`;return Nt(Ft,n)?Pt(Mt(e,t),`${i}(${n.toString()}deg)`):""})},flexChild:{alignSelf:en(En),weight:Qt,order:Qt},spacing:{margin:rn,padding:rn,offset:function(e,t,n){return Nt(qt(2),n)?`transform:translate(${n.split(" ").join("px, ")}px);`:""}},border:{borderColor:un,borderRadius:rn,borderWidth:rn,borderStyle:en({solid:"solid",dashed:"dashed"})}};var xn;function Ln(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((i=>{if(!In[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const a=In[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 Dn="FAILED_TEMPLATING_DATA",wn="UNRESOLVED_FORM_VALIDATION_TARGET",Sn=new Map;function An(e){return String.fromCharCode(97+e)}function On(e,t,n){const i=`${e||P.pluginId}-${void 0!==t?String(t):"outer"}`,a=Sn.get(i);if(a&&a.sheet.container.isConnected)return a;const o=function(e,t){const n={key:void 0!==e?`inner-css-${An(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),p(n)}(t,n);return Sn.set(i,o),o}function Tn(e,t,n){return On(e,t,n).css}function jn(e,t,n){return On(e,t,n).cx}const kn="%%%OWN_CLASS_REF%%%",Mn={placeholderText:"::placeholder"},Rn=a.memoizeWith(((e,t,n,i)=>`${String(e)}-${t}-${n}`),Vn);function Vn(e,t,n,i){const a=Tn(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]:Pn(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(kn,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 Pn(e,t,n,i,a){return e.map(function(e,t,n){var i;const a=null!==(i=Mn[n])&&void 0!==i?i:"";return i=>Object.entries(i).map((([i,o])=>{const r=o?Ln(o):"";switch(!0){case"default"===i:return r?a?`\n &${a} {\n${r}\n}\n`:`\n${r}\n`:"";case Boolean(e):return`\n .${e}${jt(i)} &${a} {\n${r}\n}\n`;case t&&"own"!==n:return`\n .${kn}${jt(i)} &${a} {\n${r}\n}\n`;default:return`\n &${jt(i)}${a} {\n${r}\n}\n`}})).join("")}(t,n,i)).reduce(((e,t,n)=>{const i=a[n];return void 0!==i?e+(0===n?t:`${At(i,t)}\n`):e}),"")}const Hn=t.createContext(a.always(void 0)),_n=()=>t.useContext(Hn),Nn=t.createContext(null);function Fn(e,n){var i;const a=t.useContext(Nn);return a&&null!==(i=n(a))&&void 0!==i?i:e}const $n=t.createContext((()=>{throw Error("Node Mapper Context does not have a mapper. Use the NodeMapperProvider with the default nodeMapper as a value before you consume this mapper")})),Zn=$n.Consumer,Gn=()=>t.useContext($n),Bn=t=>e.jsx($n.Provider,{value:(e,n,i,a)=>t.value(e,null!=n?n:t.overrides,i,a),children:t.children}),Un=t.createContext(null),zn=()=>t.useContext(Un),qn=t.createContext({get(){throw Error("Offer context has not been set")}}),Kn=t=>e.jsx(qn.Provider,{value:{get:()=>t.context},children:t.children}),Wn=()=>t.useContext(qn).get(),Yn=()=>{try{return t.useContext(qn).get().creative.copy}catch(e){return}},Jn=t.createContext((()=>{})),Xn=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),Qn=a.compose(a.not,a.isEmpty),ei=a.where({url:Qn,title:Qn});function ti(e,t,n){return t.reduce(((t,n)=>{const i=n.indexOf("["),a=-1===i?n.slice(0,-1):n.slice(0,i),o=-1===i?"":n.slice(i+1,-1),r="append"===a?[o]:o?o.split(","):[];if(!a)throw new Error(ii(e,"This Meta Attribute could not be parsed."));return function(e,t,n,i){switch(t){case"openLinks":return function(e,t,n){ni(t,e,"openLinks",1,2);const i=ai(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),a=oi(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===i)return n.replace(Xn,((e,t)=>`<a ${ht} ${a?`${vt}="${a}" `:""}${t}`));return n}(e,n,i);case"sliceText":return function(e,t,n){ni(t,e,"sliceText",2,2);const i=ai(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),a=ai(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>)");return e.startsWith("<a")?e.replace(n,(e=>e.slice(0,-4).slice(0,t+1)+"</a>")):e.slice(0,t)}(n,a);throw Error(ii(e,`Unknown "SliceBy" value. ${i}`))}(e,n,i);case"timerFormat":return function(e,t,n){var i;ni(t,e,"timerFormat",1,1);const a=null!==(i=t[0])&&void 0!==i?i:"";return function(e,t){const n=/(?:^|[^\\])hh?/.test(t),i=/(?:^|[^\\])mm?/.test(t),a=n?Math.floor(e/3600):0,o=e-3600*a,r=i?n?Math.floor(o/60):Math.floor(e/60):0,s=i?o-60*r:n?o:e,l=[[/hh/,String(a).padStart(2,"0")],[/h/,String(a)],[/mm/,String(r).padStart(2,"0")],[/m/,String(r)],[/ss/,String(s).padStart(2,"0")],[/s/,String(s)]];let c="",d=0;for(;d<t.length;){if("\\"===t[d]&&d+1<t.length){c+=t[d+1],d+=2;continue}let e=!1;for(const[n,i]of l){const a=t.slice(d).match(n);if(a&&0===a.index){c+=i,d+=a[0].length,e=!0;break}}e||(c+=t[d],d++)}return c}(Math.max(0,Math.floor(Number(n)||0)),a)}(e,n,i);case"append":return function(e,t,n){if(1!==t.length)throw new Error(ii(e,`append meta attribute takes 1 argument; received ${t.length}.`));return n+t[0]}(e,n,i);default:throw new Error(ii(e,`Unknown Meta Attribute '${t}'.`))}}(e,a,r,t)}),n)}function ni(e,t,n,i,a){const o=new Error(ii(t,`${n} meta attribute takes ${i!=a?`between ${i} and ${a}`:i} ${1===(a||i)?"argument":"arguments"}; received ${e.length}.`));if(a&&(e.length<i||e.length>a))throw o;if(!a&&e.length!==i)throw o}function ii(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function ai(e,t,n,i,a){const o=oi(e,n,i);if(null!==o)return o;throw Error(ii(t,a||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function oi(e,t,n){return n(e[t])}const ri="DATA",si="STATE",li="ATTRIBUTE",ci=new RegExp(`^(${`${ri}|${si}|${li}`})\\.`),di=new RegExp(`^${li}`),ui=new RegExp(`%\\^(?:(?:${ri}|${si})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*|${li}\\.[a-zA-Z0-9][a-zA-Z0-9\\._-]*)(?:\\:(?:append\\[[^\\]\\[|:]*\\]|[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,:\\\\ -]*\\]))*(?:\\|.*?)?\\^%`,"g");function pi(e){const t=`${li}.`;if(!e.startsWith(t))return e;return`${t}${e.slice(t.length).toLowerCase().replace(/^rokt\./,"").replace(/[_-]/g,"")}`}function fi(e){const t=new Map,n=new Map,i=new Set;for(const[a,o]of e){if("string"!=typeof o)continue;if(!a.startsWith(`${li}.`))continue;const e=pi(a),r=n.get(e);void 0===r||r===o?(n.set(e,o),e!==a&&t.set(e,o)):i.add(e)}for(const e of i)t.delete(e);return t}const hi=Symbol("invalid");function vi(e,t="creativeCopy"){const n=yi({data:e},t),i=new Map;return function e(t,n){if("string"!=typeof t){const i=yi(t,n,this.dataMap),a="attribute"in t;return e.bind({dataMap:i,attributeAliases:a?fi(i):this.attributeAliases,hasAttributeData:this.hasAttributeData||a})}let i=!1;const o=t,r=a.pipe(a.slice(2,-2),a.split("|"),(e=>a.reduce(((e,t)=>{var n;let i;if(ci.test(t)){const o=function(e){const t=[];let n="",i=0;for(const a of e)"["===a?i++:"]"===a&&i--,":"===a&&0===i?(t.push(n),n=""):n+=a;return t.push(n),t}(t),r=o[0];if(r){if(i=null!==(n=this.dataMap.get(r))&&void 0!==n?n:this.attributeAliases.get(pi(r)),i&&i===hi)throw new Y(Dn,`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(o.length>1&&i)try{i=ti(r,o.slice(1),i)}catch(e){throw new Y(Dn,`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 i?a.reduced({provided:!0,value:i}):e}return a.reduced({provided:!0,value:t})}),{provided:!1,value:""},e))),s=a.replace(ui,(e=>{const t=di.test(e.slice(2));if(t&&!this.hasAttributeData)return e;const n=r(e);return n.provided?n.value:t?e:(i=!0,n.value)}),o);return!1===i?s:""}.bind({dataMap:n,attributeAliases:i,hasAttributeData:!1})}function yi(e,t,n){const i=new Map(n);return"data"in e&&o(e.data,`${ri}${t?"."+t:""}`),"state"in e&&o(e.state,`${si}${t?"."+t:""}`),"attribute"in e&&o(e.attribute,`${li}${t?"."+t:""}`),i;function o(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,hi),e&&"object"==typeof e&&a.forEachObjIndexed(((e,n)=>o(e,`${t}.${n}`)),e)}}const mi=t.createContext(vi({})),Ci=mi.Consumer,gi=mi.Provider,bi=()=>t.useContext(mi),Ei=t.createContext(null),Ii=Ei.Provider,xi=t.createContext("OUTER"),Li=()=>"VARIANT"===t.useContext(xi),Di=t.createContext(void 0),wi=()=>t.useContext(Di);var Si,Ai,Oi,Ti,ji,ki,Mi,Ri=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())}))},Vi=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)},Pi=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};class Hi{constructor(e,t,n,i,o,r,s,l){Si.set(this,void 0),Ai.set(this,void 0),Oi.set(this,new Set),Ti.set(this,void 0),ji.set(this,void 0),ki.set(this,void 0),Mi.set(this,void 0),l&&(this.launchContinuousChild=e=>l.launch(n,e),this.registerContinuousResponseHandler=e=>{const t=l.register(n,e),i=()=>{t(),Vi(this,Oi,"f").delete(i)};return Vi(this,Oi,"f").add(i),i}),Pi(this,Si,a.partial(e.subscribe.bind(e),[n]),"f"),Pi(this,Ai,a.partial(e.dispatch.bind(e),[n]),"f"),Pi(this,Ti,t,"f"),Pi(this,ji,i,"f"),Pi(this,ki,o,"f"),Pi(this,Mi,r,"f"),this.scrollHostToViewportOffset=s,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=Vi(this,Si,"f").call(this,e),n=()=>{t(),Vi(this,Oi,"f").delete(n)};return Vi(this,Oi,"f").add(n),n}onInteractivityChange(e){return Vi(this,ji,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=Vi(this,ki,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),Vi(this,Oi,"f").delete(n)};return Vi(this,Oi,"f").add(n),n}globalDispatch(e){Vi(this,Ai,"f").call(this,e)}dispose(){Vi(this,Oi,"f").forEach((e=>e())),Pi(this,Oi,new Set,"f"),Vi(this,ji,"f").clear()}createChildPlugin(e){return"dcui-child"===e.name&&Vi(this,Mi,"f")&&e.config?Vi(this,Ti,"f").call(this,Object.assign(Object.assign({},e),{config:Object.assign(Object.assign({},e.config),{fonts:Vi(this,Mi,"f").call(this)})})):Vi(this,Ti,"f").call(this,e)}}Si=new WeakMap,Ai=new WeakMap,Oi=new WeakMap,Ti=new WeakMap,ji=new WeakMap,ki=new WeakMap,Mi=new WeakMap;class _i{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>Ri(this,void 0,void 0,(function*(){})),onClose:()=>Ri(this,void 0,void 0,(function*(){})),putConfig:()=>Ri(this,void 0,void 0,(function*(){})),send:()=>Ri(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var Ni,Fi,$i=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},Zi=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 Gi{constructor(e){Ni.set(this,void 0),Fi.set(this,new Set),$i(this,Ni,e,"f")}subscribe(e){return Zi(this,Fi,"f").add(e),!0===e(Zi(this,Ni,"f"))&&Zi(this,Fi,"f").delete(e),()=>{Zi(this,Fi,"f").delete(e)}}publish(e){$i(this,Ni,e,"f"),Zi(this,Fi,"f").forEach((e=>{!0===e(Zi(this,Ni,"f"))&&Zi(this,Fi,"f").delete(e)}))}clear(){Zi(this,Fi,"f").clear()}}Ni=new WeakMap,Fi=new WeakMap;var Bi=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)},Ui=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 zi="breakpoint-0px";class qi{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,f,h,v,y,m,C,g,b,E,I,x,L,D,w,S;const A=this.appFactory,O=this.logger,T=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new _i;return S=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint","measurement-occluded"]}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,!1),s.set(this,(()=>null)),l.set(this,!1),c.set(this,null),d.set(this,null),u.set(this,null),p.set(this,null),f.set(this,null),h.set(this,null),v.set(this,!1),y.set(this,null),m.set(this,null);const e=this.attachShadow({mode:"open"});Ui(this,a,document.createElement("div"),"f"),Bi(this,a,"f").id="app-container",Bi(this,a,"f").classList.add("default"),e.appendChild(Bi(this,a,"f"))}attributeChangedCallback(e,a,o){if(o!==a)switch(e){case"visible":Bi(this,n,"f").call(this,"true"===o);break;case"interactivity":"ENABLED"!==o&&"DISABLED"!==o||Bi(this,i,"f").call(this,o);break;case"measurement-occluded":Bi(this,s,"f").call(this);break;case"active-breakpoint":Bi(this,t,"m",C).call(this,o,a)}}makeInteractivityUpdateHandler(e){Ui(this,i,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,i,a){const o="true"===this.getAttribute("visible"),l=this.getAttribute("slotInstanceGuid");if(Ui(this,r,"true"===this.getAttribute("continuous-measurement"),"f"),Bi(this,r,"f")){let o=!1;const r=()=>{const n="true"===this.getAttribute("visible"),r="true"===this.getAttribute("measurement-occluded");if(n&&!o&&(o=!0,0===e&&a.globalDispatch({type:Ee,payload:{event:"Interactive"}}),l&&a.globalDispatch({type:be,payload:{name:"SignalImpression",parentGuid:l}})),!n||r)return Bi(this,t,"m",I).call(this,i,a),void Bi(this,t,"m",E).call(this);i&&a.globalDispatch({type:be,payload:{name:"SignalImpression",parentGuid:i}}),i&&Bi(this,t,"m",w).call(this,i,a)};return Ui(this,s,r,"f"),Ui(this,n,r,"f"),void r()}Ui(this,n,(o=>{o?(Ui(this,n,(()=>null),"f"),0===e&&a.globalDispatch({type:Ee,payload:{event:"Interactive"}}),i&&(a.globalDispatch({type:be,payload:{name:"SignalImpression",parentGuid:i}}),Bi(this,t,"m",w).call(this,i,a)),l&&a.globalDispatch({type:be,payload:{name:"SignalImpression",parentGuid:l}})):Bi(this,t,"m",E).call(this)}),"f"),Bi(this,n,"f").call(this,o)}getOfferPositionAttr(){const e=this.getAttribute("offerPositionIndex"),t=Number(e);return(null==e||isNaN(t)||t<0)&&j(`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){j(`Invalid JSON attribute ${e}: ${n}`)}}disconnectedCallback(){Bi(this,t,"m",E).call(this)}connectedCallback(){var e,t,n;const i=this.getAttribute("container"),o=this.getAttribute("plugin-id");Bi(this,a,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===i?"column":"row"));const r=this.getOfferPositionAttr(),s=this.getJSONAttr("layoutSchema"),{layoutSchema:l,variantTimers:c}=function(e){var t;return"LayoutVariantRoot"===e.type?{layoutSchema:e.node.layout,variantTimers:null!==(t=e.node.timers)&&void 0!==t?t:void 0}:{layoutSchema:e}}(s),d=this.getJSONAttr("childLayouts","[]"),u=this.getJSONAttr("offerData"),p=new Gi("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),f=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"",h=this.getJSONAttr("offerState","{}");A||j("Cannot create app without factory. Please build the connector withAppFactory.");const v=T({offerPositionIndex:r,creativeInstanceGuid:null===(t=null==u?void 0:u.creative)||void 0===t?void 0:t.instanceGuid},p);this.makeInteractivityUpdateHandler(p),A({rootElement:Bi(this,a,"f"),gateway:v,logger:O,offerPositionIndex:r,offerData:u,layoutSchema:l,childLayouts:d,schemaVersion:f,pluginId:o||P.pluginId,offerState:h,variantTimers:c}),this.makeVisbilityUpdateHandler(r,null===(n=null==u?void 0:u.creative)||void 0===n?void 0:n.instanceGuid,v)}},n=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,r=new WeakMap,s=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,p=new WeakMap,f=new WeakMap,h=new WeakMap,v=new WeakMap,y=new WeakMap,m=new WeakMap,t=new WeakSet,C=function(e,t){Bi(this,a,"f").classList.remove(t||zi),Bi(this,a,"f").classList.add(e||zi)},g=function(){Bi(this,p,"f")&&(clearTimeout(Bi(this,p,"f")),Ui(this,p,null,"f"))},b=function(e){Bi(this,t,"m",g).call(this),Ui(this,p,window.setTimeout(e,1e3),"f")},E=function(){Bi(this,t,"m",g).call(this),Bi(this,t,"m",L).call(this),Bi(this,u,"f")&&(Bi(this,u,"f").disconnect(),Ui(this,u,null,"f")),Bi(this,f,"f")&&(document.removeEventListener("visibilitychange",Bi(this,f,"f")),Ui(this,f,null,"f")),Bi(this,y,"f")&&(window.removeEventListener("beforeunload",Bi(this,y,"f")),Ui(this,y,null,"f")),Bi(this,m,"f")&&(Bi(this,a,"f").removeEventListener("click",Bi(this,m,"f")),Ui(this,m,null,"f")),Ui(this,v,!1,"f"),Ui(this,h,null,"f")},I=function(e,t){if(!Bi(this,v,"f")||null==Bi(this,h,"f"))return;const n=Bi(this,h,"f"),i=Date.now();if(i<=n)return Ui(this,v,!1,"f"),void Ui(this,h,null,"f");t.globalDispatch({type:be,payload:{name:"SignalUserInteraction",parentGuid:e,action:"ViewabilityDurationTracking",context:"Offer Visibility Duration",objectData:{startTimestamp:n.toString(),endTimestamp:i.toString()}}}),Ui(this,v,!1,"f"),Ui(this,h,null,"f")},x=function(e,n){Bi(this,l,"f")||Bi(this,c,"f")||!("ResizeObserver"in window)||(Ui(this,c,new ResizeObserver((i=>{var a;if(Bi(this,l,"f"))return;const o=i[0];if(!o)return;const r=null===(a=o.borderBoxSize)||void 0===a?void 0:a[0],s=r?r.inlineSize:o.contentRect.width,c=r?r.blockSize:o.contentRect.height;0!==s&&0!==c&&(Bi(this,t,"m",D).call(this),Ui(this,d,window.setTimeout((()=>{Ui(this,l,!0,"f"),Bi(this,t,"m",L).call(this),window.requestAnimationFrame((()=>{n.globalDispatch({type:be,payload:{name:"SignalRenderGeometry",parentGuid:e,objectData:{widthPx:Math.round(s),heightPx:Math.round(c)}}})}))}),250),"f"))})),"f"),Bi(this,c,"f").observe(Bi(this,a,"f")))},L=function(){Bi(this,t,"m",D).call(this),Bi(this,c,"f")&&(Bi(this,c,"f").disconnect(),Ui(this,c,null,"f"))},D=function(){Bi(this,d,"f")&&(clearTimeout(Bi(this,d,"f")),Ui(this,d,null,"f"))},w=function(e,n){if(Bi(this,o,"f")&&!Bi(this,r,"f"))return;const i=this.getAttribute("slotInstanceGuid");i&&Bi(this,t,"m",x).call(this,i,n);const s=Bi(this,r,"f")&&"true"===this.getAttribute("expanded-owns-viewability");if(!("IntersectionObserver"in window)){if(s||Bi(this,o,"f"))return;return n.globalDispatch({type:be,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!1,inferred:!1}}),void Ui(this,o,!0,"f")}Bi(this,u,"f")||(Ui(this,u,new IntersectionObserver((i=>{i.forEach((i=>{(!Bi(this,r,"f")||"true"!==this.getAttribute("measurement-occluded")&&"true"===this.getAttribute("visible")&&"hidden"!==document.visibilityState)&&(i.isIntersecting&&i.intersectionRatio>=.5?(s||Bi(this,o,"f")||Bi(this,t,"m",b).call(this,(()=>{Bi(this,o,"f")||Bi(this,r,"f")&&("true"===this.getAttribute("measurement-occluded")||"true"!==this.getAttribute("visible")||"hidden"===document.visibilityState)||(n.globalDispatch({type:be,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!1}}),Ui(this,o,!0,"f"))})),Bi(this,v,"f")||(Ui(this,h,Date.now(),"f"),Ui(this,v,!0,"f"))):(Bi(this,t,"m",g).call(this),Bi(this,v,"f")&&Bi(this,t,"m",I).call(this,e,n)))}))}),{threshold:.5}),"f"),Bi(this,u,"f").observe(Bi(this,a,"f")),Ui(this,m,(()=>{(!Bi(this,r,"f")||"true"!==this.getAttribute("measurement-occluded")&&"true"===this.getAttribute("visible")&&"hidden"!==document.visibilityState)&&(s||Bi(this,o,"f")||(n.globalDispatch({type:be,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!0}}),Ui(this,o,!0,"f"),Bi(this,t,"m",g).call(this)),Bi(this,v,"f")&&Bi(this,t,"m",I).call(this,e,n))}),"f"),Bi(this,a,"f").addEventListener("click",Bi(this,m,"f")),Ui(this,f,(()=>{Bi(this,u,"f")&&("hidden"===document.visibilityState?(Bi(this,t,"m",g).call(this),Bi(this,v,"f")&&Bi(this,t,"m",I).call(this,e,n),Bi(this,u,"f").unobserve(Bi(this,a,"f"))):"visible"===document.visibilityState&&Bi(this,u,"f").observe(Bi(this,a,"f")))}),"f"),document.addEventListener("visibilitychange",Bi(this,f,"f")),Ui(this,y,(()=>{Bi(this,v,"f")&&Bi(this,t,"m",I).call(this,e,n)}),"f"),window.addEventListener("beforeunload",Bi(this,y,"f")))},S;function j(e){throw O({level:q,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const Ki=t.createContext({get:()=>new _i}),Wi=t=>e.jsx(Ki.Provider,{value:{get:()=>t.context},children:t.children});const Yi=t.createContext({get(){throw Error("Layout Schema context has not been set")}}),Ji=t=>e.jsx(Yi.Provider,{value:{get:()=>t.context},children:t.children}),Xi=()=>t.useContext(Yi).get(),Qi=t.createContext("ENABLED"),ea=()=>t.useContext(Qi);function ta(e){const t=ia(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:ia(t,this.dataMap)});if(!n)throw new Y("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");const i=t;return a.path([n,i],this.dataMap)}.bind({dataMap:t})}const na={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function ia(e,t=na){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 aa=t.createContext(ta({}));aa.Consumer;const oa=aa.Provider,ra=e=>{const n=t.useContext(aa),i=e.split("|");for(const e of i){const t=n(e.trim(),"images");if(t)return t}},sa=()=>t.useContext(aa),la=t.createContext({});function ca({info:n,children:i}){const a=t.useContext(la);return e.jsx(la.Provider,{value:Object.assign(Object.assign({},a),n),children:i})}const da=t.createContext({get(){throw Error("Catalog Item context has not been set")}}),ua=t=>e.jsx(da.Provider,{value:{get:()=>t.context},children:t.children}),pa=()=>t.useContext(da).get(),fa=t.createContext(""),ha=()=>t.useContext(fa),va=t.createContext(""),ya=t.createContext(void 0);function ma({children:n}){const i=t.useMemo((()=>{const e=document.createElement("div");return e.inert=!0,{inert:!0===e.inert}}),[]);return e.jsx(ya.Provider,{value:i,children:n})}const Ca=t.createContext(!0),ga=t.createContext(null),ba=ga.Provider,Ea=t.createContext(null);function Ia(n){const[i,a]=t.useState({}),o=t.useRef([]),r=t.useContext(Ki).get().scrollHostToViewportOffset;function s(e){if(e in i)return[e];const t=`${e}-`;return Object.keys(i).filter((e=>e.startsWith(t)))}return e.jsx(Ea.Provider,{value:{registerValidators:function(e,t,n){a((i=>Object.assign(Object.assign({},i),{[e]:{validators:t,isValid:!0,element:n}})))},validateFieldKeys:function(e){const t={},n=[];let r=!0;const l=e.flatMap(s);if(0===l.length)return o.current=[],!1;for(const e of l){const a=i[e];if(a){const i=Object.assign({},a),o=a.validators.every((e=>e()));o!==i.isValid&&(t[e]=Object.assign(Object.assign({},i),{isValid:o})),!o&&a.element&&n.push(a.element),r&&(r=o)}else r=!1}return o.current=n,Object.values(t).length>0&&a((e=>Object.assign(Object.assign({},e),t))),r},getFieldKeyValidity:function(e){const t=s(e);return 0!==t.length&&t.every((e=>{var t,n;return null!==(n=null===(t=i[e])||void 0===t?void 0:t.isValid)&&void 0!==n&&n}))},focusFirstInvalidField:function(){var e;const t=o.current.filter((e=>e.isConnected)).sort(((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))[0];if(t){if(null===(e=t.scrollIntoView)||void 0===e||e.call(t,{behavior:r?"instant":"smooth",block:"center"}),r){const e=t.getBoundingClientRect();r(e.top+e.height/2)}t.focus({preventScroll:!0})}}},children:n.children})}function xa(){const e=t.useContext(Ea);if(!e)throw new Error("useValidator must be used within a ValidatorProvider");return e}function La(e,n,i){const a=xa();t.useEffect((()=>{var t;e&&a.registerValidators(e,n,null!==(t=null==i?void 0:i.current)&&void 0!==t?t:void 0)}),[e,n.length,i])}function Da(e,t){return t?t.validators.map((t=>e[t])).filter((e=>void 0!==e)):[]}const wa=a.compose(a.anyPass([a.isEmpty,a.all(a.isEmpty)]),a.flatten,a.map(a.values),a.map(a.ifElse(a.isNil,a.always({}),a.identity)),a.values,a.propOr({},"value")),Sa=a.compose(a.isEmpty,a.prop("predicates"));function Aa(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const Oa=a.curry(((e,{duration:t,predicates:n,styles:i})=>{return{predicates:n,classname:e(Ln(i)),transitionBaseClassname:e(Aa(t,(o=i,a.toPairs(o).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?a.keys(n).map((e=>Mt(t,e))):[]})))))};var o})),Ta=a.anyPass([wa,Sa]);function ja(e){return e.value!==e.defaultValue}function ka(e,t){const n=function(e,t){return B(t,[e]).flatMap((({formKey:e,fieldKey:n})=>{var i;const a=null===(i=t[e])||void 0===i?void 0:i[n];return a&&F(a)?a:[]}))}(e.key,t);switch(e.state){case"is-valid":return n.length>0&&n.every((e=>e.validated&&e.valid));case"is-invalid":return n.some($);case"is-touched":return n.some((e=>e.touched));case"is-untouched":return n.every((e=>!e.touched));case"is-dirty":return n.some(ja);case"is-pristine":return n.every((e=>!ja(e)));default:return!1}}const Ma={is:a.equals,"is-not":a.compose(a.not,a.equals),"is-below":a.lt,"is-above":a.gt};function Ra(e,t){return e.includes(t)}const Va={is:a.equals,"is-not":a.compose(a.not,a.equals),exists:Ra,"not-exists":a.compose(a.not,Ra)},Pa={exists:a.compose(a.not,a.either(a.isNil,a.isEmpty)),"not-exists":a.either(a.isNil,a.isEmpty)},Ha={"is-true":a.equals(!0),"is-false":a.equals(!1)},_a={is:a.equals,"is-not":a.compose(a.not,a.equals)};function Na(e){return(t,n)=>n[e]}const Fa=a.cond([[(e,t)=>a.equals("Breakpoint",e),Na("activeBreakpoint")],[(e,t)=>a.equals("Progression",e),Na("progressionIndex")],[(e,t)=>a.equals("Position",e),Na("positionIndex")]]);function $a(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const Za=a.cond([[(e,t,n)=>a.equals("Breakpoint",e),(e,t,n)=>{const i=a.lensPath(["breakpoints",t]);return a.pipe(a.over(i,Number),a.view(i))(n)}],[(e,t,n)=>a.equals("Progression",e),(e,t,n)=>a.cond([[a.gt(0),a.add(n.totalGroups)],[a.lte(0),a.identity]])(Number(t))],[(e,t,n)=>a.equals("Position",e),(e,t,n)=>a.cond([[a.gt(0),a.add(n.totalOffers)],[a.lte(0),a.identity]])(Number(t))]]),Ga=a.compose(a.not,isNaN);function Ba(e,t){return e.map((e=>{var n,i,a,o;switch(e.type){case"StaticString":return(0,_a[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,Pa[e.predicate.condition])($a(t,e.predicate.value));case"StaticBoolean":return(0,Ha[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,Ma[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,Ma[e.predicate.condition])(null!==(i=t.domainStates[e.predicate.key])&&void 0!==i?i:0,e.predicate.value);case"OnFirstEvent":return null!==(a=t.firedEvents[e.predicate.event])&&void 0!==a&&a;case"FormState":return ka(e.predicate,t.formStates);case"DarkMode":throw new Error("DarkMode has not yet been implemented.");case"Placeholder":return function(e){switch(e.predicate.type){case"TextValue":return(0,Va[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,Ma[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"NumericCompare":{const{left:t,right:n,condition:i}=e.predicate.content;if(!t.trim()||!n.trim())return!1;const a=Number(t),o=Number(n);return!(!Number.isFinite(a)||!Number.isFinite(o))&&Ma[i](a,o)}case"Numeric":return(0,Ma[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=Ma[e.predicate.condition],i=null!==(o=Fa(e.type,t))&&void 0!==o?o:NaN,a=Za(e.type,e.predicate.value,t);return!!Ga(i)&&n(i,a)}}}))}function Ua(e){return a.pathOr(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const za={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{},firedEvents:{},formStates:{}};function qa(e,t,n,i){const o=t.map((e=>"Progression"===e.type?Object.assign(Object.assign({},e),{type:i?"Position":e.type}):e)),{cached:r,uncached:s}=o.reduce(((t,i)=>function(e,t,n,i){if("FormState"===e.type)return a.evolve({cached:a.append(ka(e.predicate,t.formStates))},i);const o=function(e,t){var n;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:${$a(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":if("NumericCompare"===e.predicate.type){const{left:t,right:n,condition:i}=e.predicate.content;return`${e.type}:${e.predicate.type}:${i}:data:${t}:${n}`}return`${e.type}:${e.predicate.type}:${e.predicate.content.condition}:data:${e.predicate.content.input}:${e.predicate.content.value}`;case"OnFirstEvent":return`${e.type}:${e.predicate.event}:state:${null!==(n=t.firedEvents[e.predicate.event])&&void 0!==n&&n}`;case"FormState":throw new Error("FormState predicates bypass the When result cache (see groupByCache)");default:return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${Fa(e.type,t)}:${t.totalGroups}`}}(e,t),r=n.current.get(o);return a.evolve(Ka(r)?{cached:a.append(r)}:{uncached:a.append({key:o,predicate:e})},i)}(i,n,e,t)),{cached:[],uncached:[]}),l=Ba(s.map((({predicate:e})=>e)),n);return a.zip(s,l).forEach((([{key:t},n])=>{e.current.set(t,n)})),r.concat(l)}const Ka=a.is(Boolean);const Wa=a.curry(((e,t,n)=>{var i,a,o,r,s,l;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:Ua(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,firedEvents:n.firedEvents,formStates:n.formStates,positionIndex:e,creativeCopy:t}})),Ya=a.lensPath(["predicate","content","input"]),Ja=a.lensPath(["predicate","content","value"]),Xa=a.lensPath(["predicate","key"]);function Qa(e,t){const n=a.over(Ya,(t=>t?e(t):"")),i=a.over(Ja,(t=>"string"==typeof t?e(t):t)),o=a.compose(n,i),r=a.over(Xa,(t=>t?e(t):""));return t.map((t=>{switch(t.type){case"Placeholder":if("NumericCompare"===t.predicate.type){const{content:n}=t.predicate;return Object.assign(Object.assign({},t),{predicate:Object.assign(Object.assign({},t.predicate),{content:Object.assign(Object.assign({},n),{left:e(n.left),right:e(n.right)})})})}return"TextValue"===t.predicate.type?o(t):n(t);case"CustomState":return r(t);default:return t}}))}const eo=a.all(a.equals(!0));function to(e){const n=Li(),i=wi(),a=t.useRef(new Map),o=Yn(),r=Fn(za,Wa(i,o)),s=Qa(bi(),e);return t.useMemo((()=>eo(qa(a,s,r,n))),[a,s,r,n])}function no(e){const n=Li(),i=wi(),o=t.useRef(new Map),r=Yn(),s=Fn(za,Wa(i,r)),l=bi();return t.useMemo((()=>a.mapObjIndexed((e=>{const t=Qa(l,e);return eo(qa(o,t,s,n))}),e)),[o,e,s,n,l])}function io(e){e&&(e.style.display="")}function ao(e){e&&(e.style.display="none")}function oo(e){return e.settings.duration}const ro=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],so=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function lo(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const i=t?ro:so,a=e.animate(i,{duration:n,iterations:1});return a.onfinish=()=>{t?io(e):ao(e)},a.oncancel=()=>{t?io(e):ao(e)},()=>{a.finish()}}return t?io(e):ao(e),()=>{}}function co({inTransitions:n,outTransitions:i,visible:a,children:o,containerClassName:r}){const s=t.useRef(null);return t.useEffect((()=>a&&n?n.forEach((e=>{s.current&&function(e,t,n,i){if("FadeIn"===i)lo(e,t,n)}(s.current,a,oo(e),e.type)})):!a&&i?i.forEach((e=>{s.current&&function(e,t,n,i){if("FadeOut"===i)lo(e,t,n)}(s.current,a,oo(e),e.type)})):()=>{}),[a]),e.jsx("div",{ref:s,style:{display:"none"},className:r,children:o})}function uo(n){const i=Gn(),a=to(n.schema.predicates),o=t.Children.toArray(n.schema.children.map(((e,t)=>i(e,void 0,n.testId?`${n.testId}-child${t}`:void 0))));return n.schema.transition?e.jsx(co,{inTransitions:n.schema.transition.inTransition,outTransitions:n.schema.transition.outTransition,visible:a,children:o}):"functionally"===n.schema.hide?e.jsx(Qi.Provider,{value:a?"ENABLED":"DISABLED",children:o}):a?e.jsx(e.Fragment,{children:o}):null}const po=a.mergeWith(((e,t)=>`${e||""} ${t||""}`.trim())),fo=e=>{var n;const i=t.useContext(Ei),o=wi(),r=zn()||document.head,s=ha(),l=Tn(s,o,r),c=t.useCallback(Rn,[]),d=Fn([],(e=>Object.values(e.breakpoint.breakpoints))),u=i||c(d,s,o,r),p=e.styles?u(e.styles):{},f=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=Oa(e);return a.mapObjIndexed((e=>Ta(t)||!e?null:n({predicates:t.predicates,duration:t.duration,styles:e})),t.value)}(l,null===(n=e.styles)||void 0===n?void 0:n.conditionalTransitions):void 0,h=no(f?a.mapObjIndexed(a.propOr([],"predicates"),f):{}),v=a.mapObjIndexed(((e,t)=>e?function(e,t){var n;if(e&&t in e)return null===(n=e[t])||void 0===n?void 0:n.classname}(f,t):void 0),h),y=f?a.mapObjIndexed(a.prop("transitionBaseClassname"),f):{},m=e.styles?((e,t,n)=>po(po(e,t),n))(p,v,y):void 0;return e.children({classnames:m,mapperRef:u})};function ho(n){const i=Gn();return e.jsx(fo,{styles:n.schema.styles,children:({classnames:a})=>{var o;return e.jsx("div",{className:a?a.own:void 0,"data-testid":n.testId,"data-e2e-item":n.e2eItemId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(o=n.schema.a11yLabel)&&void 0!==o?o:void 0,children:t.Children.toArray(n.schema.children.map(((e,t)=>i(e,void 0,ce(t,n.testId)))))})}})}function vo(n){const i=Gn();return e.jsx(fo,{styles:n.schema.styles,children:({classnames:a})=>{var o;return e.jsx("div",{className:a?a.own:void 0,"data-testid":n.testId,"data-e2e-item":n.e2eItemId,style:{display:"flex",flexDirection:"row"},"aria-label":null!==(o=n.schema.a11yLabel)&&void 0!==o?o:void 0,children:t.Children.toArray(n.schema.children.map(((e,t)=>i(e,void 0,ce(t,n.testId)))))})}})}const yo={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",ht,vt],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},mo=new Map([["&","_;^;_"]]),Co=new RegExp(`<a *(?=${yo.allowedAttributes.a.join("|")}|>)`,"g"),go=new RegExp('<a [^>]*href="([^"]+)"',"g"),bo=new RegExp("(<br *?>)|(<br *?/>)","g"),Eo="<br/>";function Io(n){const i=bi(),a=ea(),o=t.useMemo((()=>{const e=i(n.schema.value);if(!function(e){const t=function(e){return e.replaceAll(go,((e,t)=>{const n=t.replaceAll("&",mo.get("&"));return e.replace(t,n)})).replaceAll(bo,Eo)}(e);return t===u(t,yo)}(e))throw new Y("FAILED_SANITISING_HTML","Invalid HTML tags");return e.trim()?e:""}),[n.schema.value,i]),{tabIndex:r,styles:s,isDisabled:l}=b(a),{setRef:c,maskStyle:d}=xt("vertical",Lt(n.schema.styles));return o?e.jsx(fo,{styles:n.schema.styles,children:({classnames:t})=>{const i=[(null==t?void 0:t.link)?`class = "${null==t?void 0:t.link}"`:"",l?'tabindex="-1"':"",l?"style=\"pointer-events: 'none'; user-select: none;\"":"",l?'aria-disabled="true"':""].filter((e=>e.length>0)),a=Object.assign(Object.assign({},s),d);return u=o,new RegExp("</(p|ul|ol)>").test(u)?e.jsx("div",{ref:c,tabIndex:r,style:a,"aria-hidden":l,className:null==t?void 0:t.own,"data-testid":n.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:o.replace(Co,`<a ${i.join(" ")}`)}}):e.jsx("p",{ref:c,tabIndex:r,style:a,"aria-hidden":l,className:null==t?void 0:t.own,"data-testid":n.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:o.replace(Co,`<a ${i.join(" ")}`)}});var u}}):null}function xo(t){const n=bi()(t.schema.value),i=ea(),{tabIndex:a,styles:o,isDisabled:r}=b(i);return n?e.jsx(fo,{styles:t.schema.styles,children:({classnames:i})=>{const s={tabIndex:a,"aria-hidden":r,className:null==i?void 0:i.own,"data-testid":t.testId,"data-e2e":"BasicText"};return t.isInline?e.jsx("span",Object.assign({style:o},s,{children:n})):e.jsx("p",Object.assign({style:o},s,{children:n}))}}):null}function Lo(t,n,i){if("BasicText"===t.type)return e.jsx(xo,{schema:t.node,testId:n,isInline:null!=i&&i})}function Do(t,n,i,a,o){return e.jsx(Ii,{value:i(n),children:wo(t,a,o)})}function wo(e,n,i){return t.Children.toArray(e.map(((e,t)=>n(e,void 0,ce(t,i)))))}function So(n){const i=_n(),a=Gn(),o=Wn(),r=bi(),s=wi(),l=ea(),c=o.creative.responseOptionsMap[n.schema.responseKey],d=t.useRef(null),u=t.useRef(!1),p=t.useCallback((()=>{u.current||(d.current=Date.now())}),[]),f=t.useCallback((()=>{const e=d.current;if(null===e)return;const t=Date.now(),a="positive"===n.schema.responseKey?"-Positive":"-Negative";t>e&&i({type:be,payload:{name:"SignalUserInteraction",action:"Hover",context:`CreativeResponse${a}`,parentGuid:o.creative.instanceGuid,objectData:{startTimestamp:e.toString(),endTimestamp:t.toString()}}}),u.current=!1,d.current=null}),[i,o.creative.instanceGuid,n.schema.responseKey]),h=A(c);t.useEffect((()=>{h&&i(function(e){if(e.paymentTriggerConfig)return{type:ke,payload:{criteria:{key:"PAYMENT_OFFER_SELECTED"},signal:{name:j(e.signalType),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,i,h]);const v=c?r({data:c},"creativeResponse"):r,{tabIndex:y,styles:m,isDisabled:C}=b(l);return L(c)&&!h&&void 0!==s?e.jsx(fo,{styles:n.schema.styles,children:({classnames:t,mapperRef:r})=>e.jsx("button",{type:"button",tabIndex:y,"aria-disabled":C,"aria-label":n.schema.a11yLabel?v(n.schema.a11yLabel):void 0,style:Object.assign({cursor:"pointer"},m),"data-testid":n.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":n.schema.responseKey,onMouseOver:p,onMouseLeave:f,onClick:e=>{e.preventDefault(),f();const t=ge(o,c,n.schema.openLinks);i({type:ue,payload:t})},className:null==t?void 0:t.own,disabled:C,children:e.jsx(gi,{value:v,children:(null==t?void 0:t.own)?Do(n.schema.children,t.own,r,a,n.testId):wo(n.schema.children,a,n.testId)})})}):null}function Ao(t){const n=ea(),{styles:i,isDisabled:a}=b(n);return t.schema.url.light?e.jsx(fo,{styles:g(t.schema.styles),children:({classnames:n})=>e.jsx("img",{"aria-hidden":a,style:Object.assign(Object.assign({},i),{display:"inline-block"}),alt:a?void 0:t.schema.alt||void 0,title:t.schema.title||void 0,className:n?n.own:void 0,"data-testid":t.testId,"data-e2e":"StaticImage",src:t.schema.url.light})}):null}function Oo(t){const n=ea(),{styles:i,isDisabled:a}=b(n),o=ra(t.schema.imageKey);return null!=(r=o)&&"object"==typeof r&&"light"in r&&"string"==typeof r.light?e.jsx(fo,{styles:g(t.schema.styles),children:({classnames:n})=>e.jsx("img",{"aria-hidden":a,style:Object.assign(Object.assign({},i),{display:"inline-block"}),alt:o.alt,title:o.title,className:n?n.own:void 0,"data-testid":t.testId,"data-e2e":"DataImage",src:o.light})}):null;var r}const To={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function jo(t){const n=t.schema.name,i=t.schema.description,a=t.schema.styles?se(To,t.schema.styles):To,o=ea(),{styles:r,isDisabled:s}=b(o);return n?e.jsx(fo,{styles:a,children:({classnames:a})=>e.jsx("span",Object.assign({style:Object.assign(Object.assign({},r),{display:"inline-block"}),className:"rokt-icon"+((null==a?void 0:a.own)?" "+a.own:""),"data-testid":t.testId,"data-e2e":`StaticIcon-${n}`},!s&&i?{title:i}:{"aria-hidden":"true"},{children:n}))}):null}function ko(t,n){if("StaticIcon"===t.type)return e.jsx(jo,{schema:t.node,testId:n})}const Mo={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class Ro extends t.Component{constructor(e){super(e),this.state={errorMessage:""}}static getDerivedStateFromError(e){return{errorMessage:e.message}}componentDidUpdate(e){this.state.errorMessage&&JSON.stringify(e.schema)!==JSON.stringify(this.props.schema)&&this.setState({errorMessage:""})}componentDidCatch(e,t){var n;this.props.reporter&&"true"===St.REPORT_RENDER_ERRORS&&this.props.reporter({level:q,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"===St.DISPLAY_ERRORS?e.jsxs("pre",{style:Mo,children:[e.jsx("strong",{children:"Error:"})," [",e.jsx("em",{children:this.props.schema.type}),"]"," ",this.state.errorMessage]}):void 0:this.props.children}}Ro.contextType=la;const Vo={internally:"_top",externally:"_blank"};function Po(t,n,i,a,o){return e.jsx(Ii,{value:i(n),children:Ho(t,a,o)})}function Ho(e,n,i){return t.Children.toArray(e.map(((e,t)=>n(e,void 0,i?`${i}-child${t}`:void 0))))}function _o(t){var n;const i=Vo[t.schema.open],a=Gn(),o=ea(),{tabIndex:r,styles:s,isDisabled:l}=b(o);return(null===(n=t.schema.children)||void 0===n?void 0:n.length)>0?e.jsx(fo,{styles:t.schema.styles,children:({classnames:n,mapperRef:o})=>{var c;return e.jsx("a",{href:t.schema.src,"data-testid":t.testId,"data-e2e":"StaticLink",target:null!=i?i:"_blank",tabIndex:r,"aria-disabled":l,"aria-label":null!==(c=t.schema.a11yLabel)&&void 0!==c?c:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:t.isInline?"inline":"block"},s),className:null==n?void 0:n.own,children:(null==n?void 0:n.own)?Po(t.schema.children,null==n?void 0:n.own,o,a,t.testId):Ho(t.schema.children,a,t.testId)})}}):null}function No(t,n,i){if("StaticLink"===t.type)return e.jsx(_o,{schema:t.node,testId:n,isInline:null!=i&&i})}const Fo={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function $o(n){const i=(a=n.schema.iconKey,t.useContext(aa)(a,"icons"));var a;const o=null==i?void 0:i.name,r=n.schema.styles?se(Fo,n.schema.styles):Fo,s=ea(),{styles:l}=b(s);return o?e.jsx(fo,{styles:r,children:({classnames:t})=>e.jsx("span",{style:Object.assign(Object.assign({},l),{display:"inline-block"}),"aria-hidden":"true",className:"rokt-icon"+((null==t?void 0:t.own)?" "+t.own:""),"data-testid":n.testId,"data-e2e":`DataIcon-${o}`,children:o})}):null}function Zo(n){const i=Gn(),a=t.useRef(null),r=ha(),s=wi(),l=zn(),c=(l?Tn(r,s,l):o.css)`
2
2
  display: flex;
3
3
  position: relative;
4
4
  overflow: hidden;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import*as i from"react";import a,{useEffect as o,useRef as r,useState as l,useCallback as s,useMemo as d,createContext as c,useContext as u,useLayoutEffect as p,forwardRef as h,useSyncExternalStore as f,useId as v}from"react";import{createRoot as y}from"react-dom/client";import{useDispatch as m,useSelector as C,connect as g,useStore as b,Provider as I}from"react-redux";import{path as E,assocPath as L,when as D,allPass as w,hasPath as S,complement as A,pathEq as x,cond as T,mergeDeepWith as O,T as M,flip as k,type as V,unary as H,identity as _,concat as P,zipWith as N,slice as R,compose as F,findIndex as j,equals as $,map as Z,sortBy as G,toPairs as B,pathOr as U,prop as z,is as q,always as K,propOr as W,__ as Y,memoizeWith as J,mapObjIndexed as X,where as Q,not as ee,isEmpty as te,forEachObjIndexed as ne,pipe as ie,split as ae,replace as oe,reduce as re,reduced as le,partial as se,curry as de,anyPass as ce,keys as ue,all as pe,flatten as he,values as fe,ifElse as ve,isNil as ye,over as me,lensPath as Ce,zip as ge,evolve as be,append as Ie,gt as Ee,lt as Le,either as De,view as we,add as Se,lte as Ae,mergeWith as xe,omit as Te,indexBy as Oe,reject as Me,whereEq as ke,uniqBy as Ve,mergeRight as He,lensProp as _e,defaultTo as Pe,find as Ne,has as Re,assoc as Fe,gte as je,clone as $e,mergeDeepRight as Ze,isNotEmpty as Ge,F as Be}from"ramda";import{css as Ue,cx as ze,keyframes as qe}from"@emotion/css";import{call as Ke,put as We,actionChannel as Ye,take as Je,cancelled as Xe,select as Qe,all as et,takeEvery as tt,spawn as nt,fork as it,takeLatest as at,race as ot,delay as rt,takeLeading as lt}from"redux-saga/effects";import st,{buffers as dt,eventChannel as ct,END as ut}from"redux-saga";import{configureStore as pt,combineReducers as ht}from"@reduxjs/toolkit";import{all as ft,takeLatest as vt,select as yt,call as mt,spawn as Ct,takeEvery as gt,put as bt,take as It,delay as Et}from"@redux-saga/core/effects";import Lt from"embla-carousel-react";import Dt from"insane";import wt from"@emotion/css/create-instance";import St from"embla-carousel-autoplay";import At from"embla-carousel-fade";function xt(e){const t=["elements","own"],n=["default","dimension","width","type"],i=["default","dimension","width","value"],a=["default","dimension","minWidth"],o=E(t,e);return o&&Array.isArray(o)&&o.length?L(t,o.map(D(w([S(n),A(S(a)),x("fixed",n)]),(e=>L(a,E(i,e),e)))),e):e}function Tt(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function Ot(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function Mt(){return"ontouchstart"in document.documentElement}function kt(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function Vt(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function Ht(e){return Vt(e)&&"Fulfillment"===e.action}function _t(e){return Vt(e)&&"Url"===e.action}function Pt(e){return Vt(e)&&"CaptureOnly"===e.action}function Nt(e){return Vt(e)&&"ExternalPaymentTrigger"===e.action}function Rt(e){return(Ht(e)||_t(e))&&"RealTime"===e.conversionType&&"rclid"in e}function Ft(e){return(Ht(e)||_t(e))&&"RealTimeReferral"===e.conversionType&&"rclid"in e}function jt(e){switch(e){case"SignalGatedResponse":return"SignalGatedResponse";case"SignalOptInResponse":return"SignalOptInResponse";case"SignalOptOutResponse":return"SignalOptOutResponse";default:return"SignalResponse"}}var $t,Zt;function Gt(e){return e.slice(e.lastIndexOf(":")+1)}function Bt(e){return{oldCartItem:null,cartItem:{cartItemId:e,catalogItemId:"",name:"",description:"",quantity:0,unitPrice:0,totalPrice:0,currency:"",providerData:""}}}!function(e){e.Unknown="Unknown",e.InStock="InStock",e.OutOfStock="OutOfStock"}($t||($t={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.Other=1]="Other",e[e.Card=2]="Card",e[e.PayPal=3]="PayPal",e[e.ApplePay=4]="ApplePay",e[e.GooglePay=5]="GooglePay",e[e.Afterpay=6]="Afterpay"}(Zt||(Zt={}));const Ut="FAILED_TO_PROCESS_PARTNER_UPDATE_CART_ITEM";function zt(e){return null!==e&&"object"==typeof e&&"cartItemId"in e&&"string"==typeof e.cartItemId&&"quantity"in e&&"number"==typeof e.quantity&&!("unitPrice"in e)}const qt={pluginId:"shared",pageInstanceGuid:"N/A"},Kt="offerComplete",Wt="checkout",Yt="layoutMinimized";function Jt(e){return e.registrationCount>0}function Xt(e){return e.validated&&!e.valid&&e.errorVisible}function Qt(e,t=[]){const n=0===e.trim().length;for(const i of t){if(n&&"Required"!==i.type)continue;const t=en(e,i);if(t)return t}return""}function en(e,t){switch(t.type){case"Required":return 0===e.trim().length?t.value.message:"";case"MinLength":return e.length<t.value.length?t.value.message:"";case"MaxLength":return e.length>t.value.length?t.value.message:"";case"Pattern":return function(e,t){try{return new RegExp(t).test(e)}catch(e){return!0}}(e,t.value.pattern)?"":t.value.message;default:return""}}function tn(e,t){return t.flatMap((t=>{var n;const i=t.indexOf(".");if(-1===i){const i=null!==(n=e[t])&&void 0!==n?n:{};return Object.entries(i).filter((([,e])=>Jt(e))).map((([e])=>({formKey:t,fieldKey:e})))}return[{formKey:t.slice(0,i),fieldKey:t.slice(i+1)}]}))}var nn;!function(e){e.DCUI="DCUI",e.Partner="partner"}(nn||(nn={}));const an=["SignalCartItemQuantitySelected","SignalProductItemResponse","SignalUserInteraction","SignalOptInResponse","SignalOptOutResponse"],on="ERROR",rn="INFO",ln="WARNING";class sn extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const dn=["V2_CART_ITEM_UPDATED","UPDATE_CART_ITEM_MESSAGE","CART_ITEM_INSTANT_PURCHASE","UPSELL_ITEM_INSTANT_PURCHASE","DELIVERY_DETAILS_SENT","OFFER_ENGAGEMENT","POSITIVE_ENGAGEMENT","UPSELL_CREATIVE_SENT","REALTIME_OFFER_FULFILLMENT_REFERRAL","REALTIME_OFFER_FULFILLMENT_CONVERSION","REALTIME_OFFER_FULFILLMENT_SUCCESS","INITIATE_INSTANT_PURCHASE_EVENT","INSTANT_PURCHASE_INITIATE_TAX_AND_SHIPPING_EVENT","INITIATE_CART_ITEM_EVENT","PREPARE_DEVICE_PAY_EVENT","INITIATE_DEVICE_PAY_EVENT","ABORT_DEVICE_PAY_EVENT","COMPLETE_DEVICE_PAY_EVENT","LEAD_CAPTURE_SUBMITTED","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];function cn(e,t){const n=null==e?void 0:e.creative.responseOptionsMap[t];return"positive"===t&&_t(n)&&n.isPositive&&"string"==typeof n.url&&n.url.trim()&&"SignalSecondaryResponse"!==n.signalType&&(void 0===n.conversionType||"Default"===n.conversionType)?n:void 0}function un(e,t){const n=null==e?void 0:e.creative.responseOptionsMap[t];if(n&&Boolean(n.isPositive)===("positive"===t)&&"SignalSecondaryResponse"!==n.signalType)return Pt(n)?n:!_t(n)||"negative"!==t||void 0!==n.conversionType&&"Default"!==n.conversionType?cn(e,t):n}const pn=(e,t)=>P(e,R(e.length,t.length,t)),hn=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?pn(t,e):t,i=t.length>e.length?pn(e,t):e;return N(Cn,i,n)}return t},fn=e=>null==e,vn=e=>!fn(e),yn=(e,t)=>fn(t)?e:t,mn=(e,t)=>{throw new sn("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function Cn(e,t){return T([[(e,t)=>vn(e)&&vn(t)&&V(e)!==V(t)&&("Object"===V(e)||"Object"===V(t)),mn],[(e,t)=>fn(e)||fn(t),yn],[(e,t)=>"Object"===V(e),O(Cn)],[(e,t)=>"Array"===V(e),hn],[M,k(H(_))]])(e,t)}function gn(e,t){return Cn(e,t)}function bn(e=0){return`breakpoint-${e}px`}function In(e,t){return t?`${t}-child${e}`:void 0}const En="GLOBAL/RAISE_METRIC",Ln="GLOBAL/OFFER_ENGAGEMENT";function Dn(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&Ht(e.responseOption)&&"fulfillment"in e&&kt(e.fulfillment)}function wn(e){return Nt(e)}function Sn(e){return _t(e)}function An(e){return Pt(e)}function xn(e){return!!(Rt(e)||"responseOption"in e&&Rt(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function Tn(e){return!!(Ft(e)||"responseOption"in e&&Ft(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function On(e){return"string"==typeof e&&""!==e?{adID:e}:{}}function Mn(e,t,n){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(kt(n))return Object.assign({fulfillment:n,responseOption:t,creativeInstanceGuid:e.creative.instanceGuid,accountID:e.accountId,referralCreativeID:e.creative.referralCreativeId},On(e.adId));throw new Error(`Invalid Fulfillment: ${n} with referralCreativeID: ${e.creative.referralCreativeId}`)}case"Url":return Object.assign(Object.assign(Object.assign(Object.assign({},t),{accountID:e.accountId,creativeInstanceGuid:e.creative.instanceGuid,referralCreativeID:e.creative.referralCreativeId}),On(e.adId)),{urlBehavior:n&&"internally"===n.toLowerCase()?"self":t.urlBehavior});default:return Object.assign(Object.assign({},t),{creativeInstanceGuid:e.creative.instanceGuid})}}const kn="GLOBAL/RAISE_SIGNAL",Vn="GLOBAL/OFFER_LIFECYCLE",Hn=new Set(["__proto__","constructor","prototype"]);function _n(e){return"string"==typeof e&&e.length>0&&!Hn.has(e)}const Pn="GLOBAL/SET_CUSTOM_STATE";const Nn="ProcessingState",Rn="DevicePayErrorState",Fn="PayPalDevicePayErrorState",jn="applePayUnavailable",$n="GLOBAL/SEND_PARTNER",Zn="GLOBAL/SET_DOMAIN_STATE",Gn="GLOBAL/LAYOUT_EVENT",Bn="GLOBAL/PREPARE_SIGNAL",Un="GLOBAL/OPEN_LINK",zn="GLOBAL/SET_PARTNER_VALIDATION_STATUS",qn="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",Kn="GLOBAL/LAUNCH_CHILD_LAYOUT",Wn="GLOBAL/CART_ITEM_EVENT/INITIATE",Yn="GLOBAL/CART_ITEM_EVENT/RESPONSE",Jn="OVERLAY/DISMISS_OVERLAY",Xn="plugin-overlay",Qn="GLOBAL/TRIGGER_ACTION";const ei="ERROR/REPORT",ti="GLOBAL/REGISTER_FORM_FIELD",ni="GLOBAL/UNREGISTER_FORM_FIELD",ii="GLOBAL/SET_FORM_FIELD_VALUE",ai="GLOBAL/SET_FORM_FIELD_TOUCHED",oi="GLOBAL/VALIDATE_FORM_FIELDS";function ri(e){const{formKey:t,fieldKey:n}=null!=e?e:{};return _n(t)&&_n(n)}const li={RAISE_METRIC:En,PREPARE_SIGNAL:Bn,OFFER_ENGAGEMENT:Ln,RAISE_SIGNAL:kn,OFFER_LIFECYCLE:Vn,SEND_PARTNER:$n,SET_CUSTOM_STATE:Pn,SET_DOMAIN_STATE:Zn,LAYOUT_EVENT:Gn,OPEN_LINK:Un,SET_PARTNER_VALIDATION_STATUS:zn,SET_GLOBAL_OFFER_DATA_CART:qn,LAUNCH_CHILD_LAYOUT:Kn,INITIATE_CART_ITEM_EVENT:Wn,CART_ITEM_RESPONSE:Yn,DISMISS_OVERLAY:Jn,TRIGGER_ACTION:Qn,REGISTER_FORM_FIELD:ti,UNREGISTER_FORM_FIELD:ni,SET_FORM_FIELD_VALUE:ii,SET_FORM_FIELD_TOUCHED:ai,VALIDATE_FORM_FIELDS:oi,REPORT_ERROR:ei},si="CHILD_LAYOUT/DISPATCH_BEHAVIOR",di="CHILD_LAYOUT/STATE_SYNC",ci="CHILD_LAYOUT/READY",ui="CHILD_LAYOUT/REQUEST_DEVICE_PAY";function pi(e){return _n(e)&&!e.includes("%^")}const hi={[Qn]:function(e){const{action:t}=null!=e?e:{};return"object"==typeof t&&null!==t},[Pn]:function(e){const{key:t,value:n}=null!=e?e:{};return _n(t)&&"number"==typeof n&&isFinite(n)},[ti]:function(e){const{formKey:t,fieldKey:n,defaultValue:i,validations:a}=null!=e?e:{};return _n(t)&&_n(n)&&"string"==typeof i&&Array.isArray(a)},[ni]:ri,[ii]:function(e){const{formKey:t,fieldKey:n,value:i,validate:a}=null!=e?e:{};return _n(t)&&_n(n)&&"string"==typeof i&&"boolean"==typeof a},[ai]:ri,[oi]:function(e){const{entries:t}=null!=e?e:{};return Array.isArray(t)&&t.every((e=>"string"==typeof e))}};function fi(e){return"object"==typeof e&&null!==e&&1===e.version&&"payload"in e}const vi="stage"===(yi="undefined"==typeof __environment?void 0:__environment.ENVIRONMENT)||"uat"===yi||"prod"===yi;var yi;const mi="CONTINUOUS_CHILD/READY",Ci="CONTINUOUS_CHILD/PRESENTATION",gi="CONTINUOUS_CHILD/APPLIED",bi="CONTINUOUS_CHILD/REQUEST",Ii="CONTINUOUS_CHILD/EXPOSURE";function Ei(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Li=e=>"string"==typeof e&&e.trim().length>0&&e.length<=256;function Di(e){return Ei(e)&&Li(e.sessionId)&&Li(e.creativeInstanceGuid)&&(void 0===e.childInstanceGuid||Li(e.childInstanceGuid))&&Number.isSafeInteger(e.revision)&&Number(e.revision)>0&&Number.isSafeInteger(e.position)&&Number(e.position)>=0}function wi(e,t){return e.sessionId===t.sessionId&&e.revision===t.revision&&e.position===t.position&&e.creativeInstanceGuid===t.creativeInstanceGuid&&e.childInstanceGuid===t.childInstanceGuid}const Si="data-open-in-app",Ai="data-click-signal-context";function xi(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(Ai);if(a&&t({type:kn,payload:{name:"SignalUserInteraction",action:"Click",context:a}}),n){e.preventDefault();let a="newTab";i.hasAttribute(Si)?a="inApp":"_top"===i.getAttribute("target")&&(a="self"),t({type:Un,payload:{url:n,urlBehaviour:a}})}}}o((()=>null!==e?(e.addEventListener("click",n),()=>{e.removeEventListener("click",n)}):()=>{}),[e])}function Ti(){const e=r(null);return o((()=>{const t=t=>{"Tab"===t.key&&Oi(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const Oi=(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()},Mi="both",ki="linear",Vi={hasOverflow:!1,atStart:!0,atEnd:!0};function Hi(e,t){if("horizontal"===t){const t=e.scrollWidth-e.clientWidth;return{hasOverflow:t>0,atStart:e.scrollLeft<=0,atEnd:e.scrollLeft>=t}}const n=function(e){if("undefined"==typeof window)return e.scrollHeight;const t=window.getComputedStyle(e),n=t.webkitLineClamp;if(!n||"none"===n||"normal"===n)return e.scrollHeight;const i=e.style,a={webkitLineClamp:i.webkitLineClamp,display:i.display,overflow:i.overflow,maxHeight:i.maxHeight};i.setProperty("-webkit-line-clamp","unset"),i.display="block",i.overflow="visible",i.maxHeight="none";const o=e.scrollHeight;return i.webkitLineClamp=a.webkitLineClamp,i.display=a.display,i.overflow=a.overflow,i.maxHeight=a.maxHeight,o}(e),i=n-e.clientHeight;return{hasOverflow:i>0,atStart:e.scrollTop<=0,atEnd:e.scrollTop>=i}}function _i(e,t){const n=r(null),[i,a]=l(null),[c,u]=l(Vi),p=s((e=>{n.current=e,a(e)}),[]),h=!!t;o((()=>{if(!i||!h)return;const t=()=>u(Hi(i,e));let n;return t(),i.addEventListener("scroll",t,{passive:!0}),"undefined"!=typeof ResizeObserver&&(n=new ResizeObserver(t),n.observe(i),Array.from(i.children).forEach((e=>null==n?void 0:n.observe(e)))),()=>{i.removeEventListener("scroll",t),null==n||n.disconnect()}}),[i,e,h]);const f=d((()=>function(e,t,{hasOverflow:n,atStart:i,atEnd:a}){var o,r,l,s,d,c;if(!t||!n)return{};const u=null!==(o=t.edges)&&void 0!==o?o:Mi,p=null!==(r=t.easing)&&void 0!==r?r:ki,h=null!==(l=t.size)&&void 0!==l?l:36,f=null!==(s=t.startSize)&&void 0!==s?s:h,v=null!==(d=t.endSize)&&void 0!==d?d:h,y=("start"===u||"both"===u)&&!i,m=("end"===u||"both"===u)&&!a;if(!y&&!m)return{};const C="horizontal"===e?"to right":"to bottom",g=`linear-gradient(${C},${I=y?function(e,t){switch(e){case"ease-in":return["transparent 0",`transparent ${.3*t}px`,`black ${t}px`];case"ease-out":return["transparent 0",`black ${.7*t}px`,`black ${t}px`];case"ease-in-out":return["transparent 0",`rgba(0,0,0,0.5) ${.5*t}px`,`black ${t}px`];default:return["transparent 0",`black ${t}px`]}}(p,f):["black 0"],E=m?function(e,t){switch(e){case"ease-in":return[`black calc(100% - ${t}px)`,`transparent calc(100% - ${.3*t}px)`,"transparent 100%"];case"ease-out":return[`black calc(100% - ${t}px)`,`black calc(100% - ${.7*t}px)`,"transparent 100%"];case"ease-in-out":return[`black calc(100% - ${t}px)`,`rgba(0,0,0,0.5) calc(100% - ${.5*t}px)`,"transparent 100%"];default:return[`black calc(100% - ${t}px)`,"transparent 100%"]}}(p,v):["black 100%"],[...I,...E].join(",")})`,b=null!==(c=t.clip)&&void 0!==c?c:"border-box";var I,E;return{maskImage:g,WebkitMaskImage:g,maskMode:"alpha",WebkitMaskMode:"alpha",maskRepeat:"no-repeat",WebkitMaskRepeat:"no-repeat",maskClip:b,WebkitMaskClip:b}}(e,t,c)),[e,t,c]);return Object.assign({ref:n,setRef:p,maskStyle:f},c)}function Pi(e){var t,n,i,a,o,r;return null!==(r=null===(o=null===(a=null===(i=null===(n=null===(t=null==e?void 0:e.elements)||void 0===t?void 0:t.own)||void 0===n?void 0:n[0])||void 0===i?void 0:i.default)||void 0===a?void 0:a.container)||void 0===o?void 0:o.scrollMask)&&void 0!==r?r:null}const Ni=G(z(1)),Ri=Z(z(0)),Fi="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function ji(e,t){return t?"false"!==Fi.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${bn(e)} ${t.trim()}`:`#app-container.${bn(e)} & {${t}}`:"";var n}const $i={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"},Zi={selected:'[data-selected="true"]',errored:'[data-errored="true"]'};function Gi(e){return function(e){return Object.keys($i).indexOf(e)>-1}(e)?$i[e]:function(e){return Object.keys(Zi).indexOf(e)>-1}(e)?Zi[e]:""}const Bi={container:{justifyContent:"justify-content",alignItems:"align-items",shadow:"box-shadow",gap:"gap",overflow:"overflow",scrollMask:"",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 Ui(e,t){if(!Bi[e]||!Bi[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return Bi[e][t]}function zi(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function qi(...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 Ki(e,t){return`${e}:${t};`}function Wi(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class Yi extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function Ji(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 Yi(n,JSON.stringify(t));return!0}function Xi(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function Qi(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 ea(e){if(null==e||""===e)return"value must not be omitted"}function ta(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 na(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 ia(e){if(null!=e&&""!==e)return"value must not be specified"}function aa(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 oa(...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||Xi(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function ra(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 la(e){if("string"!=typeof e)return"value must be a string"}const sa=q(Object);function da(e){const t=Object.entries(e);return n=>sa(n)&&!Array.isArray(n)?t.reduce(((e,[t,i])=>e||i(n[t])),void 0):`Input value (${e}) must be an object`}function ca(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function ua(e,t,n){return Ji(Xi,n)?Ki(Ui(e,t),`${n}`):""}function pa(e){return(t,n,i)=>Ji(Qi(Object.keys(e)),i)?Ki(Ui(t,n),`${e[i]}`):""}function ha(e){return Ji(ea,e)?zi({light:t(na,!1),dark:t(ra(ia,na),!0)},qi("\n "))(e):"";function t(e,t){return n=>{if(Ji(e,n)&&n){const e=Ki("background-image",`url("${n}")`);return t?Wi(e):e}return""}}}function fa(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),Ji(ra(ia,Qi(Object.keys(t))),e)&&e?Ki("background-size",t[e]):""}const va=T([[$("top-left"),K("top left")],[$("top-right"),K("top right")],[$("bottom-left"),K("bottom left")],[$("bottom-right"),K("bottom right")],[M,_]]);function ya(e){const t="string"==typeof e?e.toLowerCase():e;return Ji(ra(ia,Qi(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?Ki("background-position",va(t)):""}function ma(e,t,n){return Ji(ra(Xi,oa(2,3,4)),n)?Ki(Ui(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function Ca(e){return(t,n,i)=>Ji(aa({fit:Qi(e),percentage:Xi,fixed:Xi}),i)?Ki(Ui(t,n),ga(i)):""}function ga(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]}}const ba=da({light:ta,dark:ra(ia,ta)});function Ia(e,t,n){return i=>{if(i){const a=Ki(Ui(e,t),La(String(i)));return n?Wi(a):a}return""}}function Ea(e,t,n){return Ji(ba,n)?zi({light:Ia(e,t,!1),dark:Ia(e,t,!0)},qi("\n "))(n):""}function La(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 Da=da({offsetX:ra(ia,Xi),offsetY:ra(ia,Xi),blurRadius:ra(ia,Xi),spreadRadius:ra(ia,Xi),color:ba}),wa=e=>t=>null!=t?String(t):e,Sa=F(P(Y,"px"),wa("0")),Aa=e=>t=>"string"==typeof t?e(t):t,xa=F(Aa(P(Y,"px")),wa(void 0)),Ta=F(Aa(La),z("dark"));function Oa(e,t,n){return Ki(e,zi({offsetX:Sa,offsetY:Sa,blurRadius:t.spreadRadius?Sa:xa,spreadRadius:xa,color:n},qi(" "))(t))}const Ma=da({edges:ra(ia,Qi(["start","end","both"])),size:ra(ia,Xi),startSize:ra(ia,Xi),endSize:ra(ia,Xi),easing:ra(ia,Qi(["linear","ease-in","ease-out","ease-in-out"])),clip:ra(ia,Qi(["border-box","padding-box","content-box"]))});const ka={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},Va={container:{justifyContent:pa(ka),alignItems:pa(ka),shadow:function(e,t,n){var i;if(Ji(Da,n)){const a=Ui(e,t);return qi("\n")(Oa(a,n,F(La,W("#80000000","light"))),(null===(i=n.color)||void 0===i?void 0:i.dark)?Wi(Oa(a,n,Ta)):"")}return""},gap:ma,overflow:pa({hidden:"hidden",visible:"visible"}),scrollMask:function(e,t,n){return null==n||Ji(Ma,n),""},blur:function(e,t,n){return Ji(ca,n)?Ki(Ui(e,t),`blur(${n.toString()}px)`):""},opacity:ua},text:{textColor:Ea,fontSize:ma,fontFamily:function(e,t,n){return Ji(la,n)?Ki(Ui(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:pa({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:pa({normal:"normal",italic:"italic"}),lineHeight:ma,lineLimit:function(e,t,n){return Ji(Xi,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:ma,baselineTextAlign:pa({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:pa({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:pa({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:pa({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:Ea,backgroundImage:function(e,t,n){return Ji(ea,n)?zi({url:ha,position:ya,scale:fa},qi)(n):""}},dimension:{width:Ca(["wrap-content","fit-width"]),maxWidth:ma,minWidth:ma,height:Ca(["wrap-content","fit-height"]),maxHeight:ma,minHeight:ma,rotateZ:(Ha="Z",(e,t,n)=>{const i=`rotate${Ha}`;return Ji(Xi,n)?Ki(Ui(e,t),`${i}(${n.toString()}deg)`):""})},flexChild:{alignSelf:pa(ka),weight:ua,order:ua},spacing:{margin:ma,padding:ma,offset:function(e,t,n){return Ji(oa(2),n)?`transform:translate(${n.split(" ").join("px, ")}px);`:""}},border:{borderColor:Ea,borderRadius:ma,borderWidth:ma,borderStyle:pa({solid:"solid",dashed:"dashed"})}};var Ha;function _a(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((i=>{if(!Va[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const a=Va[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 Pa="FAILED_TEMPLATING_DATA",Na="UNRESOLVED_FORM_VALIDATION_TARGET",Ra=new Map;function Fa(e){return String.fromCharCode(97+e)}function ja(e,t,n){const i=`${e||qt.pluginId}-${void 0!==t?String(t):"outer"}`,a=Ra.get(i);if(a&&a.sheet.container.isConnected)return a;const o=function(e,t){const n={key:void 0!==e?`inner-css-${Fa(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),wt(n)}(t,n);return Ra.set(i,o),o}function $a(e,t,n){return ja(e,t,n).css}function Za(e,t,n){return ja(e,t,n).cx}const Ga="%%%OWN_CLASS_REF%%%",Ba={placeholderText:"::placeholder"},Ua=J(((e,t,n,i)=>`${String(e)}-${t}-${n}`),za);function za(e,t,n,i){const a=$a(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 l=n,s=this.scopeClass,d=Object.entries(null!==(r=l.elements)&&void 0!==r?r:{});try{const t=d.reduce(((t,[n,a])=>Object.assign(Object.assign({},t),{[n]:qa(a,s,i,String(n),e)})),{}),n=Object.entries(t),r=i?"parent-"+o++:"",l=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(Ga,r);return Object.assign(Object.assign({},e),{[t]:i?a(i):""})}),{own:`${l}${l&&r?" ":""}${r}`})}catch(e){const t=e;throw t.code="FAILED_PARSING_STYLES",t}}.bind({})}function qa(e,t,n,i,a){return e.map(function(e,t,n){var i;const a=null!==(i=Ba[n])&&void 0!==i?i:"";return i=>Object.entries(i).map((([i,o])=>{const r=o?_a(o):"";switch(!0){case"default"===i:return r?a?`\n &${a} {\n${r}\n}\n`:`\n${r}\n`:"";case Boolean(e):return`\n .${e}${Gi(i)} &${a} {\n${r}\n}\n`;case t&&"own"!==n:return`\n .${Ga}${Gi(i)} &${a} {\n${r}\n}\n`;default:return`\n &${Gi(i)}${a} {\n${r}\n}\n`}})).join("")}(t,n,i)).reduce(((e,t,n)=>{const i=a[n];return void 0!==i?e+(0===n?t:`${ji(i,t)}\n`):e}),"")}const Ka=c(K(void 0)),Wa=()=>u(Ka),Ya=c(null);function Ja(e,t){var n;const i=u(Ya);return i&&null!==(n=t(i))&&void 0!==n?n:e}const Xa=c((()=>{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")})),Qa=Xa.Consumer,eo=()=>u(Xa),to=t=>e(Xa.Provider,{value:(e,n,i,a)=>t.value(e,null!=n?n:t.overrides,i,a),children:t.children}),no=c(null),io=()=>u(no),ao=c({get(){throw Error("Offer context has not been set")}}),oo=t=>e(ao.Provider,{value:{get:()=>t.context},children:t.children}),ro=()=>u(ao).get(),lo=()=>{try{return u(ao).get().creative.copy}catch(e){return}},so=c((()=>{})),co=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),uo=F(ee,te),po=Q({url:uo,title:uo});function ho(e,t,n){return t.reduce(((t,n)=>{const i=n.indexOf("["),a=-1===i?n.slice(0,-1):n.slice(0,i),o=-1===i?"":n.slice(i+1,-1),r="append"===a?[o]:o?o.split(","):[];if(!a)throw new Error(vo(e,"This Meta Attribute could not be parsed."));return function(e,t,n,i){switch(t){case"openLinks":return function(e,t,n){fo(t,e,"openLinks",1,2);const i=yo(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),a=mo(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===i)return n.replace(co,((e,t)=>`<a ${Si} ${a?`${Ai}="${a}" `:""}${t}`));return n}(e,n,i);case"sliceText":return function(e,t,n){fo(t,e,"sliceText",2,2);const i=yo(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),a=yo(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>)");return e.startsWith("<a")?e.replace(n,(e=>e.slice(0,-4).slice(0,t+1)+"</a>")):e.slice(0,t)}(n,a);throw Error(vo(e,`Unknown "SliceBy" value. ${i}`))}(e,n,i);case"timerFormat":return function(e,t,n){var i;fo(t,e,"timerFormat",1,1);const a=null!==(i=t[0])&&void 0!==i?i:"";return function(e,t){const n=/(?:^|[^\\])hh?/.test(t),i=/(?:^|[^\\])mm?/.test(t),a=n?Math.floor(e/3600):0,o=e-3600*a,r=i?n?Math.floor(o/60):Math.floor(e/60):0,l=i?o-60*r:n?o:e,s=[[/hh/,String(a).padStart(2,"0")],[/h/,String(a)],[/mm/,String(r).padStart(2,"0")],[/m/,String(r)],[/ss/,String(l).padStart(2,"0")],[/s/,String(l)]];let d="",c=0;for(;c<t.length;){if("\\"===t[c]&&c+1<t.length){d+=t[c+1],c+=2;continue}let e=!1;for(const[n,i]of s){const a=t.slice(c).match(n);if(a&&0===a.index){d+=i,c+=a[0].length,e=!0;break}}e||(d+=t[c],c++)}return d}(Math.max(0,Math.floor(Number(n)||0)),a)}(e,n,i);case"append":return function(e,t,n){if(1!==t.length)throw new Error(vo(e,`append meta attribute takes 1 argument; received ${t.length}.`));return n+t[0]}(e,n,i);default:throw new Error(vo(e,`Unknown Meta Attribute '${t}'.`))}}(e,a,r,t)}),n)}function fo(e,t,n,i,a){const o=new Error(vo(t,`${n} meta attribute takes ${i!=a?`between ${i} and ${a}`:i} ${1===(a||i)?"argument":"arguments"}; received ${e.length}.`));if(a&&(e.length<i||e.length>a))throw o;if(!a&&e.length!==i)throw o}function vo(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function yo(e,t,n,i,a){const o=mo(e,n,i);if(null!==o)return o;throw Error(vo(t,a||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function mo(e,t,n){return n(e[t])}const Co="DATA",go="STATE",bo="ATTRIBUTE",Io=new RegExp(`^(${`${Co}|${go}|${bo}`})\\.`),Eo=new RegExp(`^${bo}`),Lo=new RegExp(`%\\^(?:(?:${Co}|${go})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*|${bo}\\.[a-zA-Z0-9][a-zA-Z0-9\\._-]*)(?:\\:(?:append\\[[^\\]\\[|:]*\\]|[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,:\\\\ -]*\\]))*(?:\\|.*?)?\\^%`,"g");function Do(e){const t=`${bo}.`;if(!e.startsWith(t))return e;return`${t}${e.slice(t.length).toLowerCase().replace(/^rokt\./,"").replace(/[_-]/g,"")}`}function wo(e){const t=new Map,n=new Map,i=new Set;for(const[a,o]of e){if("string"!=typeof o)continue;if(!a.startsWith(`${bo}.`))continue;const e=Do(a),r=n.get(e);void 0===r||r===o?(n.set(e,o),e!==a&&t.set(e,o)):i.add(e)}for(const e of i)t.delete(e);return t}const So=Symbol("invalid");function Ao(e,t="creativeCopy"){const n=xo({data:e},t),i=new Map;return function e(t,n){if("string"!=typeof t){const i=xo(t,n,this.dataMap),a="attribute"in t;return e.bind({dataMap:i,attributeAliases:a?wo(i):this.attributeAliases,hasAttributeData:this.hasAttributeData||a})}let i=!1;const a=t,o=ie(R(2,-2),ae("|"),(e=>re(((e,t)=>{var n;let i;if(Io.test(t)){const a=function(e){const t=[];let n="",i=0;for(const a of e)"["===a?i++:"]"===a&&i--,":"===a&&0===i?(t.push(n),n=""):n+=a;return t.push(n),t}(t),o=a[0];if(o){if(i=null!==(n=this.dataMap.get(o))&&void 0!==n?n:this.attributeAliases.get(Do(o)),i&&i===So)throw new sn(Pa,`Invalid template key referenced: "${t}" is an object but expected a string, boolean, number or empty. \nDid you mean to reference a child property of ${t}?`);if(a.length>1&&i)try{i=ho(o,a.slice(1),i)}catch(e){throw new sn(Pa,`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 i?le({provided:!0,value:i}):e}return le({provided:!0,value:t})}),{provided:!1,value:""},e))),r=oe(Lo,(e=>{const t=Eo.test(e.slice(2));if(t&&!this.hasAttributeData)return e;const n=o(e);return n.provided?n.value:t?e:(i=!0,n.value)}),a);return!1===i?r:""}.bind({dataMap:n,attributeAliases:i,hasAttributeData:!1})}function xo(e,t,n){const i=new Map(n);return"data"in e&&a(e.data,`${Co}${t?"."+t:""}`),"state"in e&&a(e.state,`${go}${t?"."+t:""}`),"attribute"in e&&a(e.attribute,`${bo}${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,So),e&&"object"==typeof e&&ne(((e,n)=>a(e,`${t}.${n}`)),e)}}const To=c(Ao({})),Oo=To.Consumer,Mo=To.Provider,ko=()=>u(To),Vo=c(null),Ho=Vo.Provider,_o=c("OUTER"),Po=()=>"VARIANT"===u(_o),No=c(void 0),Ro=()=>u(No);var Fo,jo,$o,Zo,Go,Bo,Uo,zo=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,l)}s((i=i.apply(e,t||[])).next())}))},qo=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)},Ko=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};class Wo{constructor(e,t,n,i,a,o,r,l){Fo.set(this,void 0),jo.set(this,void 0),$o.set(this,new Set),Zo.set(this,void 0),Go.set(this,void 0),Bo.set(this,void 0),Uo.set(this,void 0),l&&(this.launchContinuousChild=e=>l.launch(n,e),this.registerContinuousResponseHandler=e=>{const t=l.register(n,e),i=()=>{t(),qo(this,$o,"f").delete(i)};return qo(this,$o,"f").add(i),i}),Ko(this,Fo,se(e.subscribe.bind(e),[n]),"f"),Ko(this,jo,se(e.dispatch.bind(e),[n]),"f"),Ko(this,Zo,t,"f"),Ko(this,Go,i,"f"),Ko(this,Bo,a,"f"),Ko(this,Uo,o,"f"),this.scrollHostToViewportOffset=r,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=qo(this,Fo,"f").call(this,e),n=()=>{t(),qo(this,$o,"f").delete(n)};return qo(this,$o,"f").add(n),n}onInteractivityChange(e){return qo(this,Go,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=qo(this,Bo,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),qo(this,$o,"f").delete(n)};return qo(this,$o,"f").add(n),n}globalDispatch(e){qo(this,jo,"f").call(this,e)}dispose(){qo(this,$o,"f").forEach((e=>e())),Ko(this,$o,new Set,"f"),qo(this,Go,"f").clear()}createChildPlugin(e){return"dcui-child"===e.name&&qo(this,Uo,"f")&&e.config?qo(this,Zo,"f").call(this,Object.assign(Object.assign({},e),{config:Object.assign(Object.assign({},e.config),{fonts:qo(this,Uo,"f").call(this)})})):qo(this,Zo,"f").call(this,e)}}Fo=new WeakMap,jo=new WeakMap,$o=new WeakMap,Zo=new WeakMap,Go=new WeakMap,Bo=new WeakMap,Uo=new WeakMap;class Yo{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>zo(this,void 0,void 0,(function*(){})),onClose:()=>zo(this,void 0,void 0,(function*(){})),putConfig:()=>zo(this,void 0,void 0,(function*(){})),send:()=>zo(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var Jo,Xo,Qo=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},er=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 tr{constructor(e){Jo.set(this,void 0),Xo.set(this,new Set),Qo(this,Jo,e,"f")}subscribe(e){return er(this,Xo,"f").add(e),!0===e(er(this,Jo,"f"))&&er(this,Xo,"f").delete(e),()=>{er(this,Xo,"f").delete(e)}}publish(e){Qo(this,Jo,e,"f"),er(this,Xo,"f").forEach((e=>{!0===e(er(this,Jo,"f"))&&er(this,Xo,"f").delete(e)}))}clear(){er(this,Xo,"f").clear()}}Jo=new WeakMap,Xo=new WeakMap;var nr=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)},ir=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 ar="breakpoint-0px";class or{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,l,s,d,c,u,p,h,f,v,y,m,C,g,b,I,E,L,D,w,S,A;const x=this.appFactory,T=this.logger,O=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new Yo;return A=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint","measurement-occluded"]}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,!1),l.set(this,(()=>null)),s.set(this,!1),d.set(this,null),c.set(this,null),u.set(this,null),p.set(this,null),h.set(this,null),f.set(this,null),v.set(this,!1),y.set(this,null),m.set(this,null);const e=this.attachShadow({mode:"open"});ir(this,a,document.createElement("div"),"f"),nr(this,a,"f").id="app-container",nr(this,a,"f").classList.add("default"),e.appendChild(nr(this,a,"f"))}attributeChangedCallback(e,a,o){if(o!==a)switch(e){case"visible":nr(this,n,"f").call(this,"true"===o);break;case"interactivity":"ENABLED"!==o&&"DISABLED"!==o||nr(this,i,"f").call(this,o);break;case"measurement-occluded":nr(this,l,"f").call(this);break;case"active-breakpoint":nr(this,t,"m",C).call(this,o,a)}}makeInteractivityUpdateHandler(e){ir(this,i,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,i,a){const o="true"===this.getAttribute("visible"),s=this.getAttribute("slotInstanceGuid");if(ir(this,r,"true"===this.getAttribute("continuous-measurement"),"f"),nr(this,r,"f")){let o=!1;const r=()=>{const n="true"===this.getAttribute("visible"),r="true"===this.getAttribute("measurement-occluded");if(n&&!o&&(o=!0,0===e&&a.globalDispatch({type:Vn,payload:{event:"Interactive"}}),s&&a.globalDispatch({type:kn,payload:{name:"SignalImpression",parentGuid:s}})),!n||r)return nr(this,t,"m",E).call(this,i,a),void nr(this,t,"m",I).call(this);i&&a.globalDispatch({type:kn,payload:{name:"SignalImpression",parentGuid:i}}),i&&nr(this,t,"m",S).call(this,i,a)};return ir(this,l,r,"f"),ir(this,n,r,"f"),void r()}ir(this,n,(o=>{o?(ir(this,n,(()=>null),"f"),0===e&&a.globalDispatch({type:Vn,payload:{event:"Interactive"}}),i&&(a.globalDispatch({type:kn,payload:{name:"SignalImpression",parentGuid:i}}),nr(this,t,"m",S).call(this,i,a)),s&&a.globalDispatch({type:kn,payload:{name:"SignalImpression",parentGuid:s}})):nr(this,t,"m",I).call(this)}),"f"),nr(this,n,"f").call(this,o)}getOfferPositionAttr(){const e=this.getAttribute("offerPositionIndex"),t=Number(e);return(null==e||isNaN(t)||t<0)&&M(`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){M(`Invalid JSON attribute ${e}: ${n}`)}}disconnectedCallback(){nr(this,t,"m",I).call(this)}connectedCallback(){var e,t,n;const i=this.getAttribute("container"),o=this.getAttribute("plugin-id");nr(this,a,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===i?"column":"row"));const r=this.getOfferPositionAttr(),l=this.getJSONAttr("layoutSchema"),{layoutSchema:s,variantTimers:d}=function(e){var t;return"LayoutVariantRoot"===e.type?{layoutSchema:e.node.layout,variantTimers:null!==(t=e.node.timers)&&void 0!==t?t:void 0}:{layoutSchema:e}}(l),c=this.getJSONAttr("childLayouts","[]"),u=this.getJSONAttr("offerData"),p=new tr("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),h=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"",f=this.getJSONAttr("offerState","{}");x||M("Cannot create app without factory. Please build the connector withAppFactory.");const v=O({offerPositionIndex:r,creativeInstanceGuid:null===(t=null==u?void 0:u.creative)||void 0===t?void 0:t.instanceGuid},p);this.makeInteractivityUpdateHandler(p),x({rootElement:nr(this,a,"f"),gateway:v,logger:T,offerPositionIndex:r,offerData:u,layoutSchema:s,childLayouts:c,schemaVersion:h,pluginId:o||qt.pluginId,offerState:f,variantTimers:d}),this.makeVisbilityUpdateHandler(r,null===(n=null==u?void 0:u.creative)||void 0===n?void 0:n.instanceGuid,v)}},n=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,r=new WeakMap,l=new WeakMap,s=new WeakMap,d=new WeakMap,c=new WeakMap,u=new WeakMap,p=new WeakMap,h=new WeakMap,f=new WeakMap,v=new WeakMap,y=new WeakMap,m=new WeakMap,t=new WeakSet,C=function(e,t){nr(this,a,"f").classList.remove(t||ar),nr(this,a,"f").classList.add(e||ar)},g=function(){nr(this,p,"f")&&(clearTimeout(nr(this,p,"f")),ir(this,p,null,"f"))},b=function(e){nr(this,t,"m",g).call(this),ir(this,p,window.setTimeout(e,1e3),"f")},I=function(){nr(this,t,"m",g).call(this),nr(this,t,"m",D).call(this),nr(this,u,"f")&&(nr(this,u,"f").disconnect(),ir(this,u,null,"f")),nr(this,h,"f")&&(document.removeEventListener("visibilitychange",nr(this,h,"f")),ir(this,h,null,"f")),nr(this,y,"f")&&(window.removeEventListener("beforeunload",nr(this,y,"f")),ir(this,y,null,"f")),nr(this,m,"f")&&(nr(this,a,"f").removeEventListener("click",nr(this,m,"f")),ir(this,m,null,"f")),ir(this,v,!1,"f"),ir(this,f,null,"f")},E=function(e,t){if(!nr(this,v,"f")||null==nr(this,f,"f"))return;const n=nr(this,f,"f"),i=Date.now();if(i<=n)return ir(this,v,!1,"f"),void ir(this,f,null,"f");t.globalDispatch({type:kn,payload:{name:"SignalUserInteraction",parentGuid:e,action:"ViewabilityDurationTracking",context:"Offer Visibility Duration",objectData:{startTimestamp:n.toString(),endTimestamp:i.toString()}}}),ir(this,v,!1,"f"),ir(this,f,null,"f")},L=function(e,n){nr(this,s,"f")||nr(this,d,"f")||!("ResizeObserver"in window)||(ir(this,d,new ResizeObserver((i=>{var a;if(nr(this,s,"f"))return;const o=i[0];if(!o)return;const r=null===(a=o.borderBoxSize)||void 0===a?void 0:a[0],l=r?r.inlineSize:o.contentRect.width,d=r?r.blockSize:o.contentRect.height;0!==l&&0!==d&&(nr(this,t,"m",w).call(this),ir(this,c,window.setTimeout((()=>{ir(this,s,!0,"f"),nr(this,t,"m",D).call(this),window.requestAnimationFrame((()=>{n.globalDispatch({type:kn,payload:{name:"SignalRenderGeometry",parentGuid:e,objectData:{widthPx:Math.round(l),heightPx:Math.round(d)}}})}))}),250),"f"))})),"f"),nr(this,d,"f").observe(nr(this,a,"f")))},D=function(){nr(this,t,"m",w).call(this),nr(this,d,"f")&&(nr(this,d,"f").disconnect(),ir(this,d,null,"f"))},w=function(){nr(this,c,"f")&&(clearTimeout(nr(this,c,"f")),ir(this,c,null,"f"))},S=function(e,n){if(nr(this,o,"f")&&!nr(this,r,"f"))return;const i=this.getAttribute("slotInstanceGuid");i&&nr(this,t,"m",L).call(this,i,n);const l=nr(this,r,"f")&&"true"===this.getAttribute("expanded-owns-viewability");if(!("IntersectionObserver"in window)){if(l||nr(this,o,"f"))return;return n.globalDispatch({type:kn,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!1,inferred:!1}}),void ir(this,o,!0,"f")}nr(this,u,"f")||(ir(this,u,new IntersectionObserver((i=>{i.forEach((i=>{(!nr(this,r,"f")||"true"!==this.getAttribute("measurement-occluded")&&"true"===this.getAttribute("visible")&&"hidden"!==document.visibilityState)&&(i.isIntersecting&&i.intersectionRatio>=.5?(l||nr(this,o,"f")||nr(this,t,"m",b).call(this,(()=>{nr(this,o,"f")||nr(this,r,"f")&&("true"===this.getAttribute("measurement-occluded")||"true"!==this.getAttribute("visible")||"hidden"===document.visibilityState)||(n.globalDispatch({type:kn,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!1}}),ir(this,o,!0,"f"))})),nr(this,v,"f")||(ir(this,f,Date.now(),"f"),ir(this,v,!0,"f"))):(nr(this,t,"m",g).call(this),nr(this,v,"f")&&nr(this,t,"m",E).call(this,e,n)))}))}),{threshold:.5}),"f"),nr(this,u,"f").observe(nr(this,a,"f")),ir(this,m,(()=>{(!nr(this,r,"f")||"true"!==this.getAttribute("measurement-occluded")&&"true"===this.getAttribute("visible")&&"hidden"!==document.visibilityState)&&(l||nr(this,o,"f")||(n.globalDispatch({type:kn,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!0}}),ir(this,o,!0,"f"),nr(this,t,"m",g).call(this)),nr(this,v,"f")&&nr(this,t,"m",E).call(this,e,n))}),"f"),nr(this,a,"f").addEventListener("click",nr(this,m,"f")),ir(this,h,(()=>{nr(this,u,"f")&&("hidden"===document.visibilityState?(nr(this,t,"m",g).call(this),nr(this,v,"f")&&nr(this,t,"m",E).call(this,e,n),nr(this,u,"f").unobserve(nr(this,a,"f"))):"visible"===document.visibilityState&&nr(this,u,"f").observe(nr(this,a,"f")))}),"f"),document.addEventListener("visibilitychange",nr(this,h,"f")),ir(this,y,(()=>{nr(this,v,"f")&&nr(this,t,"m",E).call(this,e,n)}),"f"),window.addEventListener("beforeunload",nr(this,y,"f")))},A;function M(e){throw T({level:on,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const rr=c({get:()=>new Yo}),lr=t=>e(rr.Provider,{value:{get:()=>t.context},children:t.children});const sr=c({get(){throw Error("Layout Schema context has not been set")}}),dr=t=>e(sr.Provider,{value:{get:()=>t.context},children:t.children}),cr=()=>u(sr).get(),ur=c("ENABLED"),pr=()=>u(ur);function hr(e){const t=vr(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:vr(t,this.dataMap)});if(!n)throw new sn("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");return E([n,t],this.dataMap)}.bind({dataMap:t})}const fr={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function vr(e,t=fr){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 yr=c(hr({}));yr.Consumer;const mr=yr.Provider,Cr=e=>{const t=u(yr),n=e.split("|");for(const e of n){const n=t(e.trim(),"images");if(n)return n}},gr=()=>u(yr),br=c({});function Ir({info:t,children:n}){const i=u(br);return e(br.Provider,{value:Object.assign(Object.assign({},i),t),children:n})}const Er=c({get(){throw Error("Catalog Item context has not been set")}}),Lr=t=>e(Er.Provider,{value:{get:()=>t.context},children:t.children}),Dr=()=>u(Er).get(),wr=c(""),Sr=()=>u(wr),Ar=c(""),xr=c(void 0);function Tr({children:t}){const n=d((()=>{const e=document.createElement("div");return e.inert=!0,{inert:!0===e.inert}}),[]);return e(xr.Provider,{value:n,children:t})}const Or=c(!0),Mr=c(null),kr=Mr.Provider,Vr=c(null);function Hr(t){const[n,i]=l({}),a=r([]),o=u(rr).get().scrollHostToViewportOffset;function s(e){if(e in n)return[e];const t=`${e}-`;return Object.keys(n).filter((e=>e.startsWith(t)))}return e(Vr.Provider,{value:{registerValidators:function(e,t,n){i((i=>Object.assign(Object.assign({},i),{[e]:{validators:t,isValid:!0,element:n}})))},validateFieldKeys:function(e){const t={},o=[];let r=!0;const l=e.flatMap(s);if(0===l.length)return a.current=[],!1;for(const e of l){const i=n[e];if(i){const n=Object.assign({},i),a=i.validators.every((e=>e()));a!==n.isValid&&(t[e]=Object.assign(Object.assign({},n),{isValid:a})),!a&&i.element&&o.push(i.element),r&&(r=a)}else r=!1}return a.current=o,Object.values(t).length>0&&i((e=>Object.assign(Object.assign({},e),t))),r},getFieldKeyValidity:function(e){const t=s(e);return 0!==t.length&&t.every((e=>{var t,i;return null!==(i=null===(t=n[e])||void 0===t?void 0:t.isValid)&&void 0!==i&&i}))},focusFirstInvalidField:function(){var e;const t=a.current.filter((e=>e.isConnected)).sort(((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))[0];if(t){if(null===(e=t.scrollIntoView)||void 0===e||e.call(t,{behavior:o?"instant":"smooth",block:"center"}),o){const e=t.getBoundingClientRect();o(e.top+e.height/2)}t.focus({preventScroll:!0})}}},children:t.children})}function _r(){const e=u(Vr);if(!e)throw new Error("useValidator must be used within a ValidatorProvider");return e}function Pr(e,t,n){const i=_r();o((()=>{var a;e&&i.registerValidators(e,t,null!==(a=null==n?void 0:n.current)&&void 0!==a?a:void 0)}),[e,t.length,n])}function Nr(e,t){return t?t.validators.map((t=>e[t])).filter((e=>void 0!==e)):[]}const Rr=F(ce([te,pe(te)]),he,Z(fe),Z(ve(ye,K({}),_)),fe,W({},"value")),Fr=F(te,z("predicates"));function jr(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const $r=de(((e,{duration:t,predicates:n,styles:i})=>{return{predicates:n,classname:e(_a(i)),transitionBaseClassname:e(jr(t,(a=i,B(a).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?ue(n).map((e=>Ui(t,e))):[]})))))};var a})),Zr=ce([Rr,Fr]);function Gr(e){return e.value!==e.defaultValue}function Br(e,t){const n=function(e,t){return tn(t,[e]).flatMap((({formKey:e,fieldKey:n})=>{var i;const a=null===(i=t[e])||void 0===i?void 0:i[n];return a&&Jt(a)?a:[]}))}(e.key,t);switch(e.state){case"is-valid":return n.length>0&&n.every((e=>e.validated&&e.valid));case"is-invalid":return n.some(Xt);case"is-touched":return n.some((e=>e.touched));case"is-untouched":return n.every((e=>!e.touched));case"is-dirty":return n.some(Gr);case"is-pristine":return n.every((e=>!Gr(e)));default:return!1}}const Ur={is:$,"is-not":F(ee,$),"is-below":Le,"is-above":Ee};function zr(e,t){return e.includes(t)}const qr={is:$,"is-not":F(ee,$),exists:zr,"not-exists":F(ee,zr)},Kr={exists:F(ee,De(ye,te)),"not-exists":De(ye,te)},Wr={"is-true":$(!0),"is-false":$(!1)},Yr={is:$,"is-not":F(ee,$)};function Jr(e){return(t,n)=>n[e]}const Xr=T([[(e,t)=>$("Breakpoint",e),Jr("activeBreakpoint")],[(e,t)=>$("Progression",e),Jr("progressionIndex")],[(e,t)=>$("Position",e),Jr("positionIndex")]]);function Qr(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const el=T([[(e,t,n)=>$("Breakpoint",e),(e,t,n)=>{const i=Ce(["breakpoints",t]);return ie(me(i,Number),we(i))(n)}],[(e,t,n)=>$("Progression",e),(e,t,n)=>T([[Ee(0),Se(n.totalGroups)],[Ae(0),_]])(Number(t))],[(e,t,n)=>$("Position",e),(e,t,n)=>T([[Ee(0),Se(n.totalOffers)],[Ae(0),_]])(Number(t))]]),tl=F(ee,isNaN);function nl(e,t){return e.map((e=>{var n,i,a,o;switch(e.type){case"StaticString":return(0,Yr[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,Kr[e.predicate.condition])(Qr(t,e.predicate.value));case"StaticBoolean":return(0,Wr[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,Ur[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,Ur[e.predicate.condition])(null!==(i=t.domainStates[e.predicate.key])&&void 0!==i?i:0,e.predicate.value);case"OnFirstEvent":return null!==(a=t.firedEvents[e.predicate.event])&&void 0!==a&&a;case"FormState":return Br(e.predicate,t.formStates);case"DarkMode":throw new Error("DarkMode has not yet been implemented.");case"Placeholder":return function(e){switch(e.predicate.type){case"TextValue":return(0,qr[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,Ur[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"NumericCompare":{const{left:t,right:n,condition:i}=e.predicate.content;if(!t.trim()||!n.trim())return!1;const a=Number(t),o=Number(n);return!(!Number.isFinite(a)||!Number.isFinite(o))&&Ur[i](a,o)}case"Numeric":return(0,Ur[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=Ur[e.predicate.condition],i=null!==(o=Xr(e.type,t))&&void 0!==o?o:NaN,a=el(e.type,e.predicate.value,t);return!!tl(i)&&n(i,a)}}}))}function il(e){return U(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const al={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{},firedEvents:{},formStates:{}};function ol(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){if("FormState"===e.type)return be({cached:Ie(Br(e.predicate,t.formStates))},i);const a=function(e,t){var n;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:${Qr(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":if("NumericCompare"===e.predicate.type){const{left:t,right:n,condition:i}=e.predicate.content;return`${e.type}:${e.predicate.type}:${i}:data:${t}:${n}`}return`${e.type}:${e.predicate.type}:${e.predicate.content.condition}:data:${e.predicate.content.input}:${e.predicate.content.value}`;case"OnFirstEvent":return`${e.type}:${e.predicate.event}:state:${null!==(n=t.firedEvents[e.predicate.event])&&void 0!==n&&n}`;case"FormState":throw new Error("FormState predicates bypass the When result cache (see groupByCache)");default:return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${Xr(e.type,t)}:${t.totalGroups}`}}(e,t),o=n.current.get(a);return be(rl(o)?{cached:Ie(o)}:{uncached:Ie({key:a,predicate:e})},i)}(i,n,e,t)),{cached:[],uncached:[]}),l=nl(r.map((({predicate:e})=>e)),n);return ge(r,l).forEach((([{key:t},n])=>{e.current.set(t,n)})),o.concat(l)}const rl=q(Boolean);const ll=de(((e,t,n)=>{var i,a,o,r,l,s;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:il(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!==(s=null===(l=n.progression)||void 0===l?void 0:l.totalGroups)&&void 0!==s?s:0,customStates:n.customStates,domainStates:n.domainStates,firedEvents:n.firedEvents,formStates:n.formStates,positionIndex:e,creativeCopy:t}})),sl=Ce(["predicate","content","input"]),dl=Ce(["predicate","content","value"]),cl=Ce(["predicate","key"]);function ul(e,t){const n=me(sl,(t=>t?e(t):"")),i=me(dl,(t=>"string"==typeof t?e(t):t)),a=F(n,i),o=me(cl,(t=>t?e(t):""));return t.map((t=>{switch(t.type){case"Placeholder":if("NumericCompare"===t.predicate.type){const{content:n}=t.predicate;return Object.assign(Object.assign({},t),{predicate:Object.assign(Object.assign({},t.predicate),{content:Object.assign(Object.assign({},n),{left:e(n.left),right:e(n.right)})})})}return"TextValue"===t.predicate.type?a(t):n(t);case"CustomState":return o(t);default:return t}}))}const pl=pe($(!0));function hl(e){const t=Po(),n=Ro(),i=r(new Map),a=lo(),o=Ja(al,ll(n,a)),l=ul(ko(),e);return d((()=>pl(ol(i,l,o,t))),[i,l,o,t])}function fl(e){const t=Po(),n=Ro(),i=r(new Map),a=lo(),o=Ja(al,ll(n,a)),l=ko();return d((()=>X((e=>{const n=ul(l,e);return pl(ol(i,n,o,t))}),e)),[i,e,o,t,l])}function vl(e){e&&(e.style.display="")}function yl(e){e&&(e.style.display="none")}function ml(e){return e.settings.duration}const Cl=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],gl=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function bl(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const i=t?Cl:gl,a=e.animate(i,{duration:n,iterations:1});return a.onfinish=()=>{t?vl(e):yl(e)},a.oncancel=()=>{t?vl(e):yl(e)},()=>{a.finish()}}return t?vl(e):yl(e),()=>{}}function Il({inTransitions:t,outTransitions:n,visible:i,children:a,containerClassName:l}){const s=r(null);return o((()=>i&&t?t.forEach((e=>{s.current&&function(e,t,n,i){if("FadeIn"===i)bl(e,t,n)}(s.current,i,ml(e),e.type)})):!i&&n?n.forEach((e=>{s.current&&function(e,t,n,i){if("FadeOut"===i)bl(e,t,n)}(s.current,i,ml(e),e.type)})):()=>{}),[i]),e("div",{ref:s,style:{display:"none"},className:l,children:a})}function El(n){const i=eo(),o=hl(n.schema.predicates),r=a.Children.toArray(n.schema.children.map(((e,t)=>i(e,void 0,n.testId?`${n.testId}-child${t}`:void 0))));return n.schema.transition?e(Il,{inTransitions:n.schema.transition.inTransition,outTransitions:n.schema.transition.outTransition,visible:o,children:r}):"functionally"===n.schema.hide?e(ur.Provider,{value:o?"ENABLED":"DISABLED",children:r}):o?e(t,{children:r}):null}const Ll=xe(((e,t)=>`${e||""} ${t||""}`.trim())),Dl=e=>{var t;const n=u(Vo),i=Ro(),a=io()||document.head,o=Sr(),r=$a(o,i,a),l=s(Ua,[]),d=Ja([],(e=>Object.values(e.breakpoint.breakpoints))),c=n||l(d,o,i,a),p=e.styles?c(e.styles):{},h=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=$r(e);return X((e=>Zr(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=fl(h?X(W([],"predicates"),h):{}),v=X(((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}(h,t):void 0),f),y=h?X(z("transitionBaseClassname"),h):{},m=e.styles?((e,t,n)=>Ll(Ll(e,t),n))(p,v,y):void 0;return e.children({classnames:m,mapperRef:c})};function wl(t){const n=eo();return e(Dl,{styles:t.schema.styles,children:({classnames:i})=>{var o;return e("div",{className:i?i.own:void 0,"data-testid":t.testId,"data-e2e-item":t.e2eItemId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(o=t.schema.a11yLabel)&&void 0!==o?o:void 0,children:a.Children.toArray(t.schema.children.map(((e,i)=>n(e,void 0,In(i,t.testId)))))})}})}function Sl(t){const n=eo();return e(Dl,{styles:t.schema.styles,children:({classnames:i})=>{var o;return e("div",{className:i?i.own:void 0,"data-testid":t.testId,"data-e2e-item":t.e2eItemId,style:{display:"flex",flexDirection:"row"},"aria-label":null!==(o=t.schema.a11yLabel)&&void 0!==o?o:void 0,children:a.Children.toArray(t.schema.children.map(((e,i)=>n(e,void 0,In(i,t.testId)))))})}})}const Al={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",Si,Ai],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},xl=new Map([["&","_;^;_"]]),Tl=new RegExp(`<a *(?=${Al.allowedAttributes.a.join("|")}|>)`,"g"),Ol=new RegExp('<a [^>]*href="([^"]+)"',"g"),Ml=new RegExp("(<br *?>)|(<br *?/>)","g"),kl="<br/>";function Vl(t){const n=ko(),i=pr(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Ol,((e,t)=>{const n=t.replaceAll("&",xl.get("&"));return e.replace(t,n)})).replaceAll(Ml,kl)}(e);return t===Dt(t,Al)}(e))throw new sn("FAILED_SANITISING_HTML","Invalid HTML tags");return e.trim()?e:""}),[t.schema.value,n]),{tabIndex:o,styles:r,isDisabled:l}=Tt(i),{setRef:s,maskStyle:c}=_i("vertical",Pi(t.schema.styles));return a?e(Dl,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(null==n?void 0:n.link)?`class = "${null==n?void 0:n.link}"`:"",l?'tabindex="-1"':"",l?"style=\"pointer-events: 'none'; user-select: none;\"":"",l?'aria-disabled="true"':""].filter((e=>e.length>0)),d=Object.assign(Object.assign({},r),c);return u=a,new RegExp("</(p|ul|ol)>").test(u)?e("div",{ref:s,tabIndex:o,style:d,"aria-hidden":l,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(Tl,`<a ${i.join(" ")}`)}}):e("p",{ref:s,tabIndex:o,style:d,"aria-hidden":l,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(Tl,`<a ${i.join(" ")}`)}});var u}}):null}function Hl(t){const n=ko()(t.schema.value),i=pr(),{tabIndex:a,styles:o,isDisabled:r}=Tt(i);return n?e(Dl,{styles:t.schema.styles,children:({classnames:i})=>{const l={tabIndex:a,"aria-hidden":r,className:null==i?void 0:i.own,"data-testid":t.testId,"data-e2e":"BasicText"};return t.isInline?e("span",Object.assign({style:o},l,{children:n})):e("p",Object.assign({style:o},l,{children:n}))}}):null}function _l(t,n,i){if("BasicText"===t.type)return e(Hl,{schema:t.node,testId:n,isInline:null!=i&&i})}function Pl(t,n,i,a,o){return e(Ho,{value:i(n),children:Nl(t,a,o)})}function Nl(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,In(i,n)))))}function Rl(t){const n=Wa(),i=eo(),a=ro(),l=ko(),d=Ro(),c=pr(),u=a.creative.responseOptionsMap[t.schema.responseKey],p=r(null),h=r(!1),f=s((()=>{h.current||(p.current=Date.now())}),[]),v=s((()=>{const e=p.current;if(null===e)return;const i=Date.now(),o="positive"===t.schema.responseKey?"-Positive":"-Negative";i>e&&n({type:kn,payload:{name:"SignalUserInteraction",action:"Hover",context:`CreativeResponse${o}`,parentGuid:a.creative.instanceGuid,objectData:{startTimestamp:e.toString(),endTimestamp:i.toString()}}}),h.current=!1,p.current=null}),[n,a.creative.instanceGuid,t.schema.responseKey]),y=Nt(u);o((()=>{y&&n(function(e){if(e.paymentTriggerConfig)return{type:Bn,payload:{criteria:{key:"PAYMENT_OFFER_SELECTED"},signal:{name:jt(e.signalType),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}`)}(u))}),[u,n,y]);const m=u?l({data:u},"creativeResponse"):l,{tabIndex:C,styles:g,isDisabled:b}=Tt(c);return Vt(u)&&!y&&void 0!==d?e(Dl,{styles:t.schema.styles,children:({classnames:o,mapperRef:r})=>e("button",{type:"button",tabIndex:C,"aria-disabled":b,"aria-label":t.schema.a11yLabel?m(t.schema.a11yLabel):void 0,style:Object.assign({cursor:"pointer"},g),"data-testid":t.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":t.schema.responseKey,onMouseOver:f,onMouseLeave:v,onClick:e=>{e.preventDefault(),v();const i=Mn(a,u,t.schema.openLinks);n({type:Ln,payload:i})},className:null==o?void 0:o.own,disabled:b,children:e(Mo,{value:m,children:(null==o?void 0:o.own)?Pl(t.schema.children,o.own,r,i,t.testId):Nl(t.schema.children,i,t.testId)})})}):null}function Fl(t){const n=pr(),{styles:i,isDisabled:a}=Tt(n);return t.schema.url.light?e(Dl,{styles:xt(t.schema.styles),children:({classnames:n})=>e("img",{"aria-hidden":a,style:Object.assign(Object.assign({},i),{display:"inline-block"}),alt:a?void 0:t.schema.alt||void 0,title:t.schema.title||void 0,className:n?n.own:void 0,"data-testid":t.testId,"data-e2e":"StaticImage",src:t.schema.url.light})}):null}function jl(t){const n=pr(),{styles:i,isDisabled:a}=Tt(n),o=Cr(t.schema.imageKey);return null!=(r=o)&&"object"==typeof r&&"light"in r&&"string"==typeof r.light?e(Dl,{styles:xt(t.schema.styles),children:({classnames:n})=>e("img",{"aria-hidden":a,style:Object.assign(Object.assign({},i),{display:"inline-block"}),alt:o.alt,title:o.title,className:n?n.own:void 0,"data-testid":t.testId,"data-e2e":"DataImage",src:o.light})}):null;var r}const $l={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Zl(t){const n=t.schema.name,i=t.schema.description,a=t.schema.styles?gn($l,t.schema.styles):$l,o=pr(),{styles:r,isDisabled:l}=Tt(o);return n?e(Dl,{styles:a,children:({classnames:a})=>e("span",Object.assign({style:Object.assign(Object.assign({},r),{display:"inline-block"}),className:"rokt-icon"+((null==a?void 0:a.own)?" "+a.own:""),"data-testid":t.testId,"data-e2e":`StaticIcon-${n}`},!l&&i?{title:i}:{"aria-hidden":"true"},{children:n}))}):null}function Gl(t,n){if("StaticIcon"===t.type)return e(Zl,{schema:t.node,testId:n})}const Bl={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class Ul 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"===Fi.REPORT_RENDER_ERRORS&&this.props.reporter({level:on,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"===Fi.DISPLAY_ERRORS?n("pre",{style:Bl,children:[e("strong",{children:"Error:"})," [",e("em",{children:this.props.schema.type}),"]"," ",this.state.errorMessage]}):void 0:this.props.children}}Ul.contextType=br;const zl={internally:"_top",externally:"_blank"};function ql(t,n,i,a,o){return e(Ho,{value:i(n),children:Kl(t,a,o)})}function Kl(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Wl(t){var n;const i=zl[t.schema.open],a=eo(),o=pr(),{tabIndex:r,styles:l,isDisabled:s}=Tt(o);return(null===(n=t.schema.children)||void 0===n?void 0:n.length)>0?e(Dl,{styles:t.schema.styles,children:({classnames:n,mapperRef:o})=>{var d;return e("a",{href:t.schema.src,"data-testid":t.testId,"data-e2e":"StaticLink",target:null!=i?i:"_blank",tabIndex:r,"aria-disabled":s,"aria-label":null!==(d=t.schema.a11yLabel)&&void 0!==d?d:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:t.isInline?"inline":"block"},l),className:null==n?void 0:n.own,children:(null==n?void 0:n.own)?ql(t.schema.children,null==n?void 0:n.own,o,a,t.testId):Kl(t.schema.children,a,t.testId)})}}):null}function Yl(t,n,i){if("StaticLink"===t.type)return e(Wl,{schema:t.node,testId:n,isInline:null!=i&&i})}const Jl={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Xl(t){const n=(i=t.schema.iconKey,u(yr)(i,"icons"));var i;const a=null==n?void 0:n.name,o=t.schema.styles?gn(Jl,t.schema.styles):Jl,r=pr(),{styles:l}=Tt(r);return a?e(Dl,{styles:o,children:({classnames:n})=>e("span",{style:Object.assign(Object.assign({},l),{display:"inline-block"}),"aria-hidden":"true",className:"rokt-icon"+((null==n?void 0:n.own)?" "+n.own:""),"data-testid":t.testId,"data-e2e":`DataIcon-${a}`,children:a})}):null}function Ql(t){const n=eo(),i=r(null),l=Sr(),s=Ro(),d=io(),c=(d?$a(l,s,d):Ue)`
1
+ import{jsx as e,Fragment as t,jsxs as n}from"react/jsx-runtime";import*as i from"react";import a,{useEffect as o,useRef as r,useState as l,useCallback as s,useMemo as d,createContext as c,useContext as u,useLayoutEffect as p,forwardRef as h,useSyncExternalStore as f,useId as v}from"react";import{createRoot as y}from"react-dom/client";import{useDispatch as m,useSelector as C,connect as g,useStore as b,Provider as I}from"react-redux";import{path as E,assocPath as L,when as D,allPass as w,hasPath as S,complement as A,pathEq as x,cond as T,mergeDeepWith as O,T as M,flip as k,type as V,unary as H,identity as _,concat as P,zipWith as N,slice as R,compose as F,findIndex as j,equals as $,map as Z,sortBy as G,toPairs as B,pathOr as U,prop as z,is as q,always as K,propOr as W,__ as Y,memoizeWith as J,mapObjIndexed as X,where as Q,not as ee,isEmpty as te,forEachObjIndexed as ne,pipe as ie,split as ae,replace as oe,reduce as re,reduced as le,partial as se,curry as de,anyPass as ce,keys as ue,all as pe,flatten as he,values as fe,ifElse as ve,isNil as ye,over as me,lensPath as Ce,zip as ge,evolve as be,append as Ie,gt as Ee,lt as Le,either as De,view as we,add as Se,lte as Ae,mergeWith as xe,omit as Te,indexBy as Oe,reject as Me,whereEq as ke,uniqBy as Ve,mergeRight as He,lensProp as _e,defaultTo as Pe,find as Ne,has as Re,assoc as Fe,gte as je,clone as $e,mergeDeepRight as Ze,isNotEmpty as Ge,F as Be}from"ramda";import{css as Ue,cx as ze,keyframes as qe}from"@emotion/css";import{call as Ke,put as We,actionChannel as Ye,take as Je,cancelled as Xe,select as Qe,all as et,takeEvery as tt,spawn as nt,fork as it,takeLatest as at,race as ot,delay as rt,takeLeading as lt}from"redux-saga/effects";import st,{buffers as dt,eventChannel as ct,END as ut}from"redux-saga";import{configureStore as pt,combineReducers as ht}from"@reduxjs/toolkit";import{all as ft,takeLatest as vt,select as yt,call as mt,spawn as Ct,takeEvery as gt,put as bt,take as It,delay as Et}from"@redux-saga/core/effects";import Lt from"embla-carousel-react";import Dt from"insane";import wt from"@emotion/css/create-instance";import St from"embla-carousel-autoplay";import At from"embla-carousel-fade";function xt(e){const t=["elements","own"],n=["default","dimension","width","type"],i=["default","dimension","width","value"],a=["default","dimension","minWidth"],o=E(t,e);return o&&Array.isArray(o)&&o.length?L(t,o.map(D(w([S(n),A(S(a)),x("fixed",n)]),(e=>L(a,E(i,e),e)))),e):e}function Tt(e){const t="DISABLED"===e;return{tabIndex:t?-1:void 0,styles:t?{pointerEvents:"none",userSelect:"none"}:void 0,isDisabled:t}}function Ot(e,t){if("EscapeHatch"===t.type)try{return JSON.parse(t.node.data).type===e}catch(e){return!1}return!1}function Mt(){return"ontouchstart"in document.documentElement}function kt(e){return null!=e&&"object"==typeof e&&("url"in e||"name"in e)&&"config"in e}function Vt(e){return null!=e&&"object"==typeof e&&"id"in e&&"action"in e&&"instanceGuid"in e&&"signalType"in e}function Ht(e){return Vt(e)&&"Fulfillment"===e.action}function _t(e){return Vt(e)&&"Url"===e.action}function Pt(e){return Vt(e)&&"CaptureOnly"===e.action}function Nt(e){return Vt(e)&&"ExternalPaymentTrigger"===e.action}function Rt(e){return(Ht(e)||_t(e))&&"RealTime"===e.conversionType&&"rclid"in e}function Ft(e){return(Ht(e)||_t(e))&&"RealTimeReferral"===e.conversionType&&"rclid"in e}function jt(e){switch(e){case"SignalGatedResponse":return"SignalGatedResponse";case"SignalOptInResponse":return"SignalOptInResponse";case"SignalOptOutResponse":return"SignalOptOutResponse";default:return"SignalResponse"}}var $t,Zt;function Gt(e){return e.slice(e.lastIndexOf(":")+1)}function Bt(e){return{oldCartItem:null,cartItem:{cartItemId:e,catalogItemId:"",name:"",description:"",quantity:0,unitPrice:0,totalPrice:0,currency:"",providerData:""}}}!function(e){e.Unknown="Unknown",e.InStock="InStock",e.OutOfStock="OutOfStock"}($t||($t={})),function(e){e[e.Unspecified=0]="Unspecified",e[e.Other=1]="Other",e[e.Card=2]="Card",e[e.PayPal=3]="PayPal",e[e.ApplePay=4]="ApplePay",e[e.GooglePay=5]="GooglePay",e[e.Afterpay=6]="Afterpay"}(Zt||(Zt={}));const Ut="FAILED_TO_PROCESS_PARTNER_UPDATE_CART_ITEM";function zt(e){return null!==e&&"object"==typeof e&&"cartItemId"in e&&"string"==typeof e.cartItemId&&"quantity"in e&&"number"==typeof e.quantity&&!("unitPrice"in e)}const qt={pluginId:"shared",pageInstanceGuid:"N/A"},Kt="offerComplete",Wt="checkout",Yt="layoutMinimized";function Jt(e){return e.registrationCount>0}function Xt(e){return e.validated&&!e.valid&&e.errorVisible}function Qt(e,t=[]){const n=0===e.trim().length;for(const i of t){if(n&&"Required"!==i.type)continue;const t=en(e,i);if(t)return t}return""}function en(e,t){switch(t.type){case"Required":return 0===e.trim().length?t.value.message:"";case"MinLength":return e.length<t.value.length?t.value.message:"";case"MaxLength":return e.length>t.value.length?t.value.message:"";case"Pattern":return function(e,t){try{return new RegExp(t).test(e)}catch(e){return!0}}(e,t.value.pattern)?"":t.value.message;default:return""}}function tn(e,t){return t.flatMap((t=>{var n;const i=t.indexOf(".");if(-1===i){const i=null!==(n=e[t])&&void 0!==n?n:{};return Object.entries(i).filter((([,e])=>Jt(e))).map((([e])=>({formKey:t,fieldKey:e})))}return[{formKey:t.slice(0,i),fieldKey:t.slice(i+1)}]}))}var nn;!function(e){e.DCUI="DCUI",e.Partner="partner"}(nn||(nn={}));const an=["SignalCartItemQuantitySelected","SignalProductItemResponse","SignalUserInteraction","SignalOptInResponse","SignalOptOutResponse"],on="ERROR",rn="INFO",ln="WARNING";class sn extends Error{constructor(e,t){super(t),this.code=null!=e?e:"UNHANDLED_EXCEPTION"}toString(){return`CodedError (${this.code}): ${this.message}`}}const dn=["V2_CART_ITEM_UPDATED","UPDATE_CART_ITEM_MESSAGE","CART_ITEM_INSTANT_PURCHASE","UPSELL_ITEM_INSTANT_PURCHASE","DELIVERY_DETAILS_SENT","OFFER_ENGAGEMENT","POSITIVE_ENGAGEMENT","UPSELL_CREATIVE_SENT","REALTIME_OFFER_FULFILLMENT_REFERRAL","REALTIME_OFFER_FULFILLMENT_CONVERSION","REALTIME_OFFER_FULFILLMENT_SUCCESS","INITIATE_INSTANT_PURCHASE_EVENT","INSTANT_PURCHASE_INITIATE_TAX_AND_SHIPPING_EVENT","INITIATE_CART_ITEM_EVENT","PREPARE_DEVICE_PAY_EVENT","INITIATE_DEVICE_PAY_EVENT","ABORT_DEVICE_PAY_EVENT","COMPLETE_DEVICE_PAY_EVENT","LEAD_CAPTURE_SUBMITTED","PLACEMENT_CLOSED","PLACEMENT_COMPLETED","PLACEMENT_INTERACTIVE","PLACEMENT_FAILURE"];function cn(e,t){const n=null==e?void 0:e.creative.responseOptionsMap[t];return"positive"===t&&_t(n)&&n.isPositive&&"string"==typeof n.url&&n.url.trim()&&"SignalSecondaryResponse"!==n.signalType&&(void 0===n.conversionType||"Default"===n.conversionType)?n:void 0}function un(e,t){const n=null==e?void 0:e.creative.responseOptionsMap[t];if(n&&Boolean(n.isPositive)===("positive"===t)&&"SignalSecondaryResponse"!==n.signalType)return Pt(n)?n:!_t(n)||"negative"!==t||void 0!==n.conversionType&&"Default"!==n.conversionType?cn(e,t):n}const pn=(e,t)=>P(e,R(e.length,t.length,t)),hn=(e,t)=>{if(Array.isArray(e)&&Array.isArray(t)){const n=e.length>t.length?pn(t,e):t,i=t.length>e.length?pn(e,t):e;return N(Cn,i,n)}return t},fn=e=>null==e,vn=e=>!fn(e),yn=(e,t)=>fn(t)?e:t,mn=(e,t)=>{throw new sn("MERGE_TYPE_INCONSISTENCY",`Unable to merge values for inconsistent types, left = ${e}, right = ${t}`)};function Cn(e,t){return T([[(e,t)=>vn(e)&&vn(t)&&V(e)!==V(t)&&("Object"===V(e)||"Object"===V(t)),mn],[(e,t)=>fn(e)||fn(t),yn],[(e,t)=>"Object"===V(e),O(Cn)],[(e,t)=>"Array"===V(e),hn],[M,k(H(_))]])(e,t)}function gn(e,t){return Cn(e,t)}function bn(e=0){return`breakpoint-${e}px`}function In(e,t){return t?`${t}-child${e}`:void 0}const En="GLOBAL/RAISE_METRIC",Ln="GLOBAL/OFFER_ENGAGEMENT";function Dn(e){return null!=e&&"object"==typeof e&&"responseOption"in e&&Ht(e.responseOption)&&"fulfillment"in e&&kt(e.fulfillment)}function wn(e){return Nt(e)}function Sn(e){return _t(e)}function An(e){return Pt(e)}function xn(e){return!!(Rt(e)||"responseOption"in e&&Rt(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function Tn(e){return!!(Ft(e)||"responseOption"in e&&Ft(e.responseOption))&&(!!e.accountID&&!!e.referralCreativeID)}function On(e){return"string"==typeof e&&""!==e?{adID:e}:{}}function Mn(e,t,n){switch(t.action){case"Fulfillment":{const n=e.creative.fulfillment;if(kt(n))return Object.assign({fulfillment:n,responseOption:t,creativeInstanceGuid:e.creative.instanceGuid,accountID:e.accountId,referralCreativeID:e.creative.referralCreativeId},On(e.adId));throw new Error(`Invalid Fulfillment: ${n} with referralCreativeID: ${e.creative.referralCreativeId}`)}case"Url":return Object.assign(Object.assign(Object.assign(Object.assign({},t),{accountID:e.accountId,creativeInstanceGuid:e.creative.instanceGuid,referralCreativeID:e.creative.referralCreativeId}),On(e.adId)),{urlBehavior:n&&"internally"===n.toLowerCase()?"self":t.urlBehavior});default:return Object.assign(Object.assign({},t),{creativeInstanceGuid:e.creative.instanceGuid})}}const kn="GLOBAL/RAISE_SIGNAL",Vn="GLOBAL/OFFER_LIFECYCLE",Hn=new Set(["__proto__","constructor","prototype"]);function _n(e){return"string"==typeof e&&e.length>0&&!Hn.has(e)}const Pn="GLOBAL/SET_CUSTOM_STATE";const Nn="ProcessingState",Rn="DevicePayErrorState",Fn="PayPalDevicePayErrorState",jn="applePayUnavailable",$n="GLOBAL/SEND_PARTNER",Zn="GLOBAL/SET_DOMAIN_STATE",Gn="GLOBAL/LAYOUT_EVENT",Bn="GLOBAL/PREPARE_SIGNAL",Un="GLOBAL/OPEN_LINK",zn="GLOBAL/SET_PARTNER_VALIDATION_STATUS",qn="GLOBAL/SET_GLOBAL_OFFER_DATA_CART",Kn="GLOBAL/LAUNCH_CHILD_LAYOUT",Wn="GLOBAL/CART_ITEM_EVENT/INITIATE",Yn="GLOBAL/CART_ITEM_EVENT/RESPONSE",Jn="OVERLAY/DISMISS_OVERLAY",Xn="plugin-overlay",Qn="GLOBAL/TRIGGER_ACTION";const ei="ERROR/REPORT",ti="GLOBAL/REGISTER_FORM_FIELD",ni="GLOBAL/UNREGISTER_FORM_FIELD",ii="GLOBAL/SET_FORM_FIELD_VALUE",ai="GLOBAL/SET_FORM_FIELD_TOUCHED",oi="GLOBAL/VALIDATE_FORM_FIELDS";function ri(e){const{formKey:t,fieldKey:n}=null!=e?e:{};return _n(t)&&_n(n)}const li={RAISE_METRIC:En,PREPARE_SIGNAL:Bn,OFFER_ENGAGEMENT:Ln,RAISE_SIGNAL:kn,OFFER_LIFECYCLE:Vn,SEND_PARTNER:$n,SET_CUSTOM_STATE:Pn,SET_DOMAIN_STATE:Zn,LAYOUT_EVENT:Gn,OPEN_LINK:Un,SET_PARTNER_VALIDATION_STATUS:zn,SET_GLOBAL_OFFER_DATA_CART:qn,LAUNCH_CHILD_LAYOUT:Kn,INITIATE_CART_ITEM_EVENT:Wn,CART_ITEM_RESPONSE:Yn,DISMISS_OVERLAY:Jn,TRIGGER_ACTION:Qn,REGISTER_FORM_FIELD:ti,UNREGISTER_FORM_FIELD:ni,SET_FORM_FIELD_VALUE:ii,SET_FORM_FIELD_TOUCHED:ai,VALIDATE_FORM_FIELDS:oi,REPORT_ERROR:ei},si="CHILD_LAYOUT/DISPATCH_BEHAVIOR",di="CHILD_LAYOUT/STATE_SYNC",ci="CHILD_LAYOUT/READY",ui="CHILD_LAYOUT/REQUEST_DEVICE_PAY";function pi(e){return _n(e)&&!e.includes("%^")}const hi={[Qn]:function(e){const{action:t}=null!=e?e:{};return"object"==typeof t&&null!==t},[Pn]:function(e){const{key:t,value:n}=null!=e?e:{};return _n(t)&&"number"==typeof n&&isFinite(n)},[ti]:function(e){const{formKey:t,fieldKey:n,defaultValue:i,validations:a}=null!=e?e:{};return _n(t)&&_n(n)&&"string"==typeof i&&Array.isArray(a)},[ni]:ri,[ii]:function(e){const{formKey:t,fieldKey:n,value:i,validate:a}=null!=e?e:{};return _n(t)&&_n(n)&&"string"==typeof i&&"boolean"==typeof a},[ai]:ri,[oi]:function(e){const{entries:t}=null!=e?e:{};return Array.isArray(t)&&t.every((e=>"string"==typeof e))}};function fi(e){return"object"==typeof e&&null!==e&&1===e.version&&"payload"in e}const vi="stage"===(yi="undefined"==typeof __environment?void 0:__environment.ENVIRONMENT)||"uat"===yi||"prod"===yi;var yi;const mi="CONTINUOUS_CHILD/READY",Ci="CONTINUOUS_CHILD/PRESENTATION",gi="CONTINUOUS_CHILD/APPLIED",bi="CONTINUOUS_CHILD/REQUEST",Ii="CONTINUOUS_CHILD/EXPOSURE";function Ei(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const Li=e=>"string"==typeof e&&e.trim().length>0&&e.length<=256;function Di(e){return Ei(e)&&Li(e.sessionId)&&Li(e.creativeInstanceGuid)&&(void 0===e.childInstanceGuid||Li(e.childInstanceGuid))&&Number.isSafeInteger(e.revision)&&Number(e.revision)>0&&Number.isSafeInteger(e.position)&&Number(e.position)>=0}function wi(e,t){return e.sessionId===t.sessionId&&e.revision===t.revision&&e.position===t.position&&e.creativeInstanceGuid===t.creativeInstanceGuid&&e.childInstanceGuid===t.childInstanceGuid}const Si="data-open-in-app",Ai="data-click-signal-context";function xi(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(Ai);if(a&&t({type:kn,payload:{name:"SignalUserInteraction",action:"Click",context:a}}),n){e.preventDefault();let a="newTab";i.hasAttribute(Si)?a="inApp":"_top"===i.getAttribute("target")&&(a="self"),t({type:Un,payload:{url:n,urlBehaviour:a}})}}}o((()=>null!==e?(e.addEventListener("click",n),()=>{e.removeEventListener("click",n)}):()=>{}),[e])}function Ti(){const e=r(null);return o((()=>{const t=t=>{"Tab"===t.key&&Oi(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)}),[e]),e}const Oi=(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()},Mi="both",ki="linear",Vi={hasOverflow:!1,atStart:!0,atEnd:!0};function Hi(e,t){if("horizontal"===t){const t=e.scrollWidth-e.clientWidth;return{hasOverflow:t>0,atStart:e.scrollLeft<=0,atEnd:e.scrollLeft>=t}}const n=function(e){if("undefined"==typeof window)return e.scrollHeight;const t=window.getComputedStyle(e),n=t.webkitLineClamp;if(!n||"none"===n||"normal"===n)return e.scrollHeight;const i=e.style,a={webkitLineClamp:i.webkitLineClamp,display:i.display,overflow:i.overflow,maxHeight:i.maxHeight};i.setProperty("-webkit-line-clamp","unset"),i.display="block",i.overflow="visible",i.maxHeight="none";const o=e.scrollHeight;return i.webkitLineClamp=a.webkitLineClamp,i.display=a.display,i.overflow=a.overflow,i.maxHeight=a.maxHeight,o}(e),i=n-e.clientHeight;return{hasOverflow:i>0,atStart:e.scrollTop<=0,atEnd:e.scrollTop>=i}}function _i(e,t){const n=r(null),[i,a]=l(null),[c,u]=l(Vi),p=s((e=>{n.current=e,a(e)}),[]),h=!!t;o((()=>{if(!i||!h)return;const t=()=>u(Hi(i,e));let n;return t(),i.addEventListener("scroll",t,{passive:!0}),"undefined"!=typeof ResizeObserver&&(n=new ResizeObserver(t),n.observe(i),Array.from(i.children).forEach((e=>null==n?void 0:n.observe(e)))),()=>{i.removeEventListener("scroll",t),null==n||n.disconnect()}}),[i,e,h]);const f=d((()=>function(e,t,{hasOverflow:n,atStart:i,atEnd:a}){var o,r,l,s,d,c;if(!t||!n)return{};const u=null!==(o=t.edges)&&void 0!==o?o:Mi,p=null!==(r=t.easing)&&void 0!==r?r:ki,h=null!==(l=t.size)&&void 0!==l?l:36,f=null!==(s=t.startSize)&&void 0!==s?s:h,v=null!==(d=t.endSize)&&void 0!==d?d:h,y=("start"===u||"both"===u)&&!i,m=("end"===u||"both"===u)&&!a;if(!y&&!m)return{};const C="horizontal"===e?"to right":"to bottom",g=`linear-gradient(${C},${I=y?function(e,t){switch(e){case"ease-in":return["transparent 0",`transparent ${.3*t}px`,`black ${t}px`];case"ease-out":return["transparent 0",`black ${.7*t}px`,`black ${t}px`];case"ease-in-out":return["transparent 0",`rgba(0,0,0,0.5) ${.5*t}px`,`black ${t}px`];default:return["transparent 0",`black ${t}px`]}}(p,f):["black 0"],E=m?function(e,t){switch(e){case"ease-in":return[`black calc(100% - ${t}px)`,`transparent calc(100% - ${.3*t}px)`,"transparent 100%"];case"ease-out":return[`black calc(100% - ${t}px)`,`black calc(100% - ${.7*t}px)`,"transparent 100%"];case"ease-in-out":return[`black calc(100% - ${t}px)`,`rgba(0,0,0,0.5) calc(100% - ${.5*t}px)`,"transparent 100%"];default:return[`black calc(100% - ${t}px)`,"transparent 100%"]}}(p,v):["black 100%"],[...I,...E].join(",")})`,b=null!==(c=t.clip)&&void 0!==c?c:"border-box";var I,E;return{maskImage:g,WebkitMaskImage:g,maskMode:"alpha",WebkitMaskMode:"alpha",maskRepeat:"no-repeat",WebkitMaskRepeat:"no-repeat",maskClip:b,WebkitMaskClip:b}}(e,t,c)),[e,t,c]);return Object.assign({ref:n,setRef:p,maskStyle:f},c)}function Pi(e){var t,n,i,a,o,r;return null!==(r=null===(o=null===(a=null===(i=null===(n=null===(t=null==e?void 0:e.elements)||void 0===t?void 0:t.own)||void 0===n?void 0:n[0])||void 0===i?void 0:i.default)||void 0===a?void 0:a.container)||void 0===o?void 0:o.scrollMask)&&void 0!==r?r:null}const Ni=G(z(1)),Ri=Z(z(0)),Fi="undefined"!=typeof __environment?__environment:{ENVIRONMENT:"local",DISPLAY_ERRORS:"true",REPORT_RENDER_ERRORS:"true",USE_MEDIA_QUERY_NESTING:"true"};function ji(e,t){return t?"false"!==Fi.USE_MEDIA_QUERY_NESTING?`${n=e,`@media (min-width: ${n}px)`} {${t}}`:t.includes(" & ")?`#app-container.${bn(e)} ${t.trim()}`:`#app-container.${bn(e)} & {${t}}`:"";var n}const $i={hovered:":hover",pressed:":active",focussed:":focus",disabled:":disabled"},Zi={selected:'[data-selected="true"]',errored:'[data-errored="true"]'};function Gi(e){return function(e){return Object.keys($i).indexOf(e)>-1}(e)?$i[e]:function(e){return Object.keys(Zi).indexOf(e)>-1}(e)?Zi[e]:""}const Bi={container:{justifyContent:"justify-content",alignItems:"align-items",shadow:"box-shadow",gap:"gap",overflow:"overflow",scrollMask:"",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 Ui(e,t){if(!Bi[e]||!Bi[e][t])throw new Error(`No CSS property mapping exists for styling property: ${e}.${t.toString()}`);return Bi[e][t]}function zi(e,t){return n=>t(...Object.keys(e).map((t=>e[t](n[t]))))}function qi(...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 Ki(e,t){return`${e}:${t};`}function Wi(e){return function(e,t){return`@media (${e}) {${t}}\n`}("prefers-color-scheme: dark",e)}class Yi extends Error{constructor(e,t){super(`Invalid styling value '${t}': ${e}.`),this.name=this.constructor.name}}function Ji(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 Yi(n,JSON.stringify(t));return!0}function Xi(e){if(isNaN(e)||"number"!=typeof e&&"string"!=typeof e)return"value must be a number"}function Qi(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 ea(e){if(null==e||""===e)return"value must not be omitted"}function ta(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 na(e){const t=new RegExp(/^(?:(?:data:image\/[^;"\\\n\r\f]+;base64[^"\\\n\r\f#]+)|(?:(?: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}(?:\?[^"\\\n\r\f#]*)?)(?:#[^"\\\n\r\f]*)?$/);if("string"!=typeof e||!t.test(e))return"value must be a valid CSS URL string"}function ia(e){if(null!=e&&""!==e)return"value must not be specified"}function aa(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 oa(...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||Xi(t)),void 0))return}}return`value must be a space separated list of numbers, of one of the following lengths: ${e.join(" ,")}`}}function ra(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 la(e){if("string"!=typeof e)return"value must be a string"}const sa=q(Object);function da(e){const t=Object.entries(e);return n=>sa(n)&&!Array.isArray(n)?t.reduce(((e,[t,i])=>e||i(n[t])),void 0):`Input value (${e}) must be an object`}function ca(e){if("number"!=typeof e&&"string"!=typeof e||isNaN(e)||!(e>=0))return"value must be a positive number"}function ua(e,t,n){return Ji(Xi,n)?Ki(Ui(e,t),`${n}`):""}function pa(e){return(t,n,i)=>Ji(Qi(Object.keys(e)),i)?Ki(Ui(t,n),`${e[i]}`):""}function ha(e){return Ji(ea,e)?zi({light:t(na,!1),dark:t(ra(ia,na),!0)},qi("\n "))(e):"";function t(e,t){return n=>{if(Ji(e,n)&&n){const e=Ki("background-image",`url("${i=n,i.replace(/["\\\n\r\f:;]/g,(e=>'"'===e||"\\"===e?`\\${e}`:`\\${e.charCodeAt(0).toString(16)} `))}")`);return t?Wi(e):e}var i;return""}}}function fa(e){const t={crop:"auto",fit:"contain",fill:"cover"};return"string"==typeof e&&(e=e.toLowerCase()),Ji(ra(ia,Qi(Object.keys(t))),e)&&e?Ki("background-size",t[e]):""}const va=T([[$("top-left"),K("top left")],[$("top-right"),K("top right")],[$("bottom-left"),K("bottom left")],[$("bottom-right"),K("bottom right")],[M,_]]);function ya(e){const t="string"==typeof e?e.toLowerCase():e;return Ji(ra(ia,Qi(["top","right","bottom","left","center","top-left","top-right","bottom-left","bottom-right"])),t)&&t?Ki("background-position",va(t)):""}function ma(e,t,n){return Ji(ra(Xi,oa(2,3,4)),n)?Ki(Ui(e,t),n.toString().split(" ").map((e=>`${e}px`)).join(" ")):""}function Ca(e){return(t,n,i)=>Ji(aa({fit:Qi(e),percentage:Xi,fixed:Xi}),i)?Ki(Ui(t,n),ga(i)):""}function ga(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]}}const ba=da({light:ta,dark:ra(ia,ta)});function Ia(e,t,n){return i=>{if(i){const a=Ki(Ui(e,t),La(String(i)));return n?Wi(a):a}return""}}function Ea(e,t,n){return Ji(ba,n)?zi({light:Ia(e,t,!1),dark:Ia(e,t,!0)},qi("\n "))(n):""}function La(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 Da=da({offsetX:ra(ia,Xi),offsetY:ra(ia,Xi),blurRadius:ra(ia,Xi),spreadRadius:ra(ia,Xi),color:ba}),wa=e=>t=>null!=t?String(t):e,Sa=F(P(Y,"px"),wa("0")),Aa=e=>t=>"string"==typeof t?e(t):t,xa=F(Aa(P(Y,"px")),wa(void 0)),Ta=F(Aa(La),z("dark"));function Oa(e,t,n){return Ki(e,zi({offsetX:Sa,offsetY:Sa,blurRadius:t.spreadRadius?Sa:xa,spreadRadius:xa,color:n},qi(" "))(t))}const Ma=da({edges:ra(ia,Qi(["start","end","both"])),size:ra(ia,Xi),startSize:ra(ia,Xi),endSize:ra(ia,Xi),easing:ra(ia,Qi(["linear","ease-in","ease-out","ease-in-out"])),clip:ra(ia,Qi(["border-box","padding-box","content-box"]))});const ka={center:"center","flex-end":"flex-end","flex-start":"flex-start",stretch:"stretch"},Va={container:{justifyContent:pa(ka),alignItems:pa(ka),shadow:function(e,t,n){var i;if(Ji(Da,n)){const a=Ui(e,t);return qi("\n")(Oa(a,n,F(La,W("#80000000","light"))),(null===(i=n.color)||void 0===i?void 0:i.dark)?Wi(Oa(a,n,Ta)):"")}return""},gap:ma,overflow:pa({hidden:"hidden",visible:"visible"}),scrollMask:function(e,t,n){return null==n||Ji(Ma,n),""},blur:function(e,t,n){return Ji(ca,n)?Ki(Ui(e,t),`blur(${n.toString()}px)`):""},opacity:ua},text:{textColor:Ea,fontSize:ma,fontFamily:function(e,t,n){return Ji(la,n)?Ki(Ui(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:pa({100:100,200:200,300:300,400:400,500:500,600:600,700:700,800:800,900:900}),fontStyle:pa({normal:"normal",italic:"italic"}),lineHeight:ma,lineLimit:function(e,t,n){return Ji(Xi,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:ma,baselineTextAlign:pa({super:"super",sub:"sub",baseline:"baseline"}),horizontalTextAlign:pa({left:"left",right:"right",center:"center",start:"start",end:"end",justify:"justify"}),textDecoration:pa({underline:"underline","strike-through":"line-through",none:"none"}),textTransform:pa({capitalize:"capitalize",uppercase:"uppercase",lowercase:"lowercase",none:"none"})},background:{backgroundColor:Ea,backgroundImage:function(e,t,n){return Ji(ea,n)?zi({url:ha,position:ya,scale:fa},qi)(n):""}},dimension:{width:Ca(["wrap-content","fit-width"]),maxWidth:ma,minWidth:ma,height:Ca(["wrap-content","fit-height"]),maxHeight:ma,minHeight:ma,rotateZ:(Ha="Z",(e,t,n)=>{const i=`rotate${Ha}`;return Ji(Xi,n)?Ki(Ui(e,t),`${i}(${n.toString()}deg)`):""})},flexChild:{alignSelf:pa(ka),weight:ua,order:ua},spacing:{margin:ma,padding:ma,offset:function(e,t,n){return Ji(oa(2),n)?`transform:translate(${n.split(" ").join("px, ")}px);`:""}},border:{borderColor:Ea,borderRadius:ma,borderWidth:ma,borderStyle:pa({solid:"solid",dashed:"dashed"})}};var Ha;function _a(e){return Object.keys(e).reduce(((t,n)=>(n&&e[n]&&Object.keys(e[n]).forEach((i=>{if(!Va[n])throw new Error(`No styling transformers exist for styling category key: ${n}`);const a=Va[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 Pa="FAILED_TEMPLATING_DATA",Na="UNRESOLVED_FORM_VALIDATION_TARGET",Ra=new Map;function Fa(e){return String.fromCharCode(97+e)}function ja(e,t,n){const i=`${e||qt.pluginId}-${void 0!==t?String(t):"outer"}`,a=Ra.get(i);if(a&&a.sheet.container.isConnected)return a;const o=function(e,t){const n={key:void 0!==e?`inner-css-${Fa(e)}`:"outer-css",container:t};return t&&t.parentElement&&(n.container=t.parentElement),wt(n)}(t,n);return Ra.set(i,o),o}function $a(e,t,n){return ja(e,t,n).css}function Za(e,t,n){return ja(e,t,n).cx}const Ga="%%%OWN_CLASS_REF%%%",Ba={placeholderText:"::placeholder"},Ua=J(((e,t,n,i)=>`${String(e)}-${t}-${n}`),za);function za(e,t,n,i){const a=$a(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 l=n,s=this.scopeClass,d=Object.entries(null!==(r=l.elements)&&void 0!==r?r:{});try{const t=d.reduce(((t,[n,a])=>Object.assign(Object.assign({},t),{[n]:qa(a,s,i,String(n),e)})),{}),n=Object.entries(t),r=i?"parent-"+o++:"",l=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(Ga,r);return Object.assign(Object.assign({},e),{[t]:i?a(i):""})}),{own:`${l}${l&&r?" ":""}${r}`})}catch(e){const t=e;throw t.code="FAILED_PARSING_STYLES",t}}.bind({})}function qa(e,t,n,i,a){return e.map(function(e,t,n){var i;const a=null!==(i=Ba[n])&&void 0!==i?i:"";return i=>Object.entries(i).map((([i,o])=>{const r=o?_a(o):"";switch(!0){case"default"===i:return r?a?`\n &${a} {\n${r}\n}\n`:`\n${r}\n`:"";case Boolean(e):return`\n .${e}${Gi(i)} &${a} {\n${r}\n}\n`;case t&&"own"!==n:return`\n .${Ga}${Gi(i)} &${a} {\n${r}\n}\n`;default:return`\n &${Gi(i)}${a} {\n${r}\n}\n`}})).join("")}(t,n,i)).reduce(((e,t,n)=>{const i=a[n];return void 0!==i?e+(0===n?t:`${ji(i,t)}\n`):e}),"")}const Ka=c(K(void 0)),Wa=()=>u(Ka),Ya=c(null);function Ja(e,t){var n;const i=u(Ya);return i&&null!==(n=t(i))&&void 0!==n?n:e}const Xa=c((()=>{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")})),Qa=Xa.Consumer,eo=()=>u(Xa),to=t=>e(Xa.Provider,{value:(e,n,i,a)=>t.value(e,null!=n?n:t.overrides,i,a),children:t.children}),no=c(null),io=()=>u(no),ao=c({get(){throw Error("Offer context has not been set")}}),oo=t=>e(ao.Provider,{value:{get:()=>t.context},children:t.children}),ro=()=>u(ao).get(),lo=()=>{try{return u(ao).get().creative.copy}catch(e){return}},so=c((()=>{})),co=new RegExp("<a ([^>]*>((?!</a>).)*</a>)","g"),uo=F(ee,te),po=Q({url:uo,title:uo});function ho(e,t,n){return t.reduce(((t,n)=>{const i=n.indexOf("["),a=-1===i?n.slice(0,-1):n.slice(0,i),o=-1===i?"":n.slice(i+1,-1),r="append"===a?[o]:o?o.split(","):[];if(!a)throw new Error(vo(e,"This Meta Attribute could not be parsed."));return function(e,t,n,i){switch(t){case"openLinks":return function(e,t,n){fo(t,e,"openLinks",1,2);const i=yo(t,e,0,(e=>"InApp"===e?"InApp":null),"openLinks meta attribute can only open InApp"),a=mo(t,1,(e=>"string"==typeof e&&e.length?e:null));if("InApp"===i)return n.replace(co,((e,t)=>`<a ${Si} ${a?`${Ai}="${a}" `:""}${t}`));return n}(e,n,i);case"sliceText":return function(e,t,n){fo(t,e,"sliceText",2,2);const i=yo(t,e,0,(e=>"Chars"===e?"Chars":null),"sliceText meta attribute can only slice by Chars"),a=yo(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>)");return e.startsWith("<a")?e.replace(n,(e=>e.slice(0,-4).slice(0,t+1)+"</a>")):e.slice(0,t)}(n,a);throw Error(vo(e,`Unknown "SliceBy" value. ${i}`))}(e,n,i);case"timerFormat":return function(e,t,n){var i;fo(t,e,"timerFormat",1,1);const a=null!==(i=t[0])&&void 0!==i?i:"";return function(e,t){const n=/(?:^|[^\\])hh?/.test(t),i=/(?:^|[^\\])mm?/.test(t),a=n?Math.floor(e/3600):0,o=e-3600*a,r=i?n?Math.floor(o/60):Math.floor(e/60):0,l=i?o-60*r:n?o:e,s=[[/hh/,String(a).padStart(2,"0")],[/h/,String(a)],[/mm/,String(r).padStart(2,"0")],[/m/,String(r)],[/ss/,String(l).padStart(2,"0")],[/s/,String(l)]];let d="",c=0;for(;c<t.length;){if("\\"===t[c]&&c+1<t.length){d+=t[c+1],c+=2;continue}let e=!1;for(const[n,i]of s){const a=t.slice(c).match(n);if(a&&0===a.index){d+=i,c+=a[0].length,e=!0;break}}e||(d+=t[c],c++)}return d}(Math.max(0,Math.floor(Number(n)||0)),a)}(e,n,i);case"append":return function(e,t,n){if(1!==t.length)throw new Error(vo(e,`append meta attribute takes 1 argument; received ${t.length}.`));return n+t[0]}(e,n,i);default:throw new Error(vo(e,`Unknown Meta Attribute '${t}'.`))}}(e,a,r,t)}),n)}function fo(e,t,n,i,a){const o=new Error(vo(t,`${n} meta attribute takes ${i!=a?`between ${i} and ${a}`:i} ${1===(a||i)?"argument":"arguments"}; received ${e.length}.`));if(a&&(e.length<i||e.length>a))throw o;if(!a&&e.length!==i)throw o}function vo(e,t){return`Malformed Meta Attribute: '${e}' - ${t}`}function yo(e,t,n,i,a){const o=mo(e,n,i);if(null!==o)return o;throw Error(vo(t,a||`Could not parse meta attribute argument at index ${n} from arguments ${JSON.stringify(e)}`))}function mo(e,t,n){return n(e[t])}const Co="DATA",go="STATE",bo="ATTRIBUTE",Io=new RegExp(`^(${`${Co}|${go}|${bo}`})\\.`),Eo=new RegExp(`^${bo}`),Lo=new RegExp(`%\\^(?:(?:${Co}|${go})\\.[a-zA-Z0-9]+[a-zA-Z0-9\\.]*|${bo}\\.[a-zA-Z0-9][a-zA-Z0-9\\._-]*)(?:\\:(?:append\\[[^\\]\\[|:]*\\]|[a-zA-Z0-9]+\\[[a-zA-Z0-9\\.,:\\\\ -]*\\]))*(?:\\|.*?)?\\^%`,"g");function Do(e){const t=`${bo}.`;if(!e.startsWith(t))return e;return`${t}${e.slice(t.length).toLowerCase().replace(/^rokt\./,"").replace(/[_-]/g,"")}`}function wo(e){const t=new Map,n=new Map,i=new Set;for(const[a,o]of e){if("string"!=typeof o)continue;if(!a.startsWith(`${bo}.`))continue;const e=Do(a),r=n.get(e);void 0===r||r===o?(n.set(e,o),e!==a&&t.set(e,o)):i.add(e)}for(const e of i)t.delete(e);return t}const So=Symbol("invalid");function Ao(e,t="creativeCopy"){const n=xo({data:e},t),i=new Map;return function e(t,n){if("string"!=typeof t){const i=xo(t,n,this.dataMap),a="attribute"in t;return e.bind({dataMap:i,attributeAliases:a?wo(i):this.attributeAliases,hasAttributeData:this.hasAttributeData||a})}let i=!1;const a=t,o=ie(R(2,-2),ae("|"),(e=>re(((e,t)=>{var n;let i;if(Io.test(t)){const a=function(e){const t=[];let n="",i=0;for(const a of e)"["===a?i++:"]"===a&&i--,":"===a&&0===i?(t.push(n),n=""):n+=a;return t.push(n),t}(t),o=a[0];if(o){if(i=null!==(n=this.dataMap.get(o))&&void 0!==n?n:this.attributeAliases.get(Do(o)),i&&i===So)throw new sn(Pa,`Invalid template key referenced: "${t}" is an object but expected a string, boolean, number or empty. \nDid you mean to reference a child property of ${t}?`);if(a.length>1&&i)try{i=ho(o,a.slice(1),i)}catch(e){throw new sn(Pa,`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 i?le({provided:!0,value:i}):e}return le({provided:!0,value:t})}),{provided:!1,value:""},e))),r=oe(Lo,(e=>{const t=Eo.test(e.slice(2));if(t&&!this.hasAttributeData)return e;const n=o(e);return n.provided?n.value:t?e:(i=!0,n.value)}),a);return!1===i?r:""}.bind({dataMap:n,attributeAliases:i,hasAttributeData:!1})}function xo(e,t,n){const i=new Map(n);return"data"in e&&a(e.data,`${Co}${t?"."+t:""}`),"state"in e&&a(e.state,`${go}${t?"."+t:""}`),"attribute"in e&&a(e.attribute,`${bo}${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,So),e&&"object"==typeof e&&ne(((e,n)=>a(e,`${t}.${n}`)),e)}}const To=c(Ao({})),Oo=To.Consumer,Mo=To.Provider,ko=()=>u(To),Vo=c(null),Ho=Vo.Provider,_o=c("OUTER"),Po=()=>"VARIANT"===u(_o),No=c(void 0),Ro=()=>u(No);var Fo,jo,$o,Zo,Go,Bo,Uo,zo=function(e,t,n,i){return new(n||(n=Promise))((function(a,o){function r(e){try{s(i.next(e))}catch(e){o(e)}}function l(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?a(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(r,l)}s((i=i.apply(e,t||[])).next())}))},qo=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)},Ko=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};class Wo{constructor(e,t,n,i,a,o,r,l){Fo.set(this,void 0),jo.set(this,void 0),$o.set(this,new Set),Zo.set(this,void 0),Go.set(this,void 0),Bo.set(this,void 0),Uo.set(this,void 0),l&&(this.launchContinuousChild=e=>l.launch(n,e),this.registerContinuousResponseHandler=e=>{const t=l.register(n,e),i=()=>{t(),qo(this,$o,"f").delete(i)};return qo(this,$o,"f").add(i),i}),Ko(this,Fo,se(e.subscribe.bind(e),[n]),"f"),Ko(this,jo,se(e.dispatch.bind(e),[n]),"f"),Ko(this,Zo,t,"f"),Ko(this,Go,i,"f"),Ko(this,Bo,a,"f"),Ko(this,Uo,o,"f"),this.scrollHostToViewportOffset=r,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=qo(this,Fo,"f").call(this,e),n=()=>{t(),qo(this,$o,"f").delete(n)};return qo(this,$o,"f").add(n),n}onInteractivityChange(e){return qo(this,Go,"f").subscribe(e)}onEvent(...e){const t=e.reduce(((e,t)=>{if("partner"===t.source||"*"===t.source){const n=qo(this,Bo,"f").call(this,t.name).subscribe(t.callback);return[...e,()=>n.unsubscribe()]}return e}),[]),n=()=>{t.forEach((e=>{e()})),qo(this,$o,"f").delete(n)};return qo(this,$o,"f").add(n),n}globalDispatch(e){qo(this,jo,"f").call(this,e)}dispose(){qo(this,$o,"f").forEach((e=>e())),Ko(this,$o,new Set,"f"),qo(this,Go,"f").clear()}createChildPlugin(e){return"dcui-child"===e.name&&qo(this,Uo,"f")&&e.config?qo(this,Zo,"f").call(this,Object.assign(Object.assign({},e),{config:Object.assign(Object.assign({},e.config),{fonts:qo(this,Uo,"f").call(this)})})):qo(this,Zo,"f").call(this,e)}}Fo=new WeakMap,jo=new WeakMap,$o=new WeakMap,Zo=new WeakMap,Go=new WeakMap,Bo=new WeakMap,Uo=new WeakMap;class Yo{onGlobalStateChange(){return()=>{}}onInteractivityChange(){return()=>{}}onEvent(){return()=>{}}globalDispatch(){}dispose(){}createChildPlugin(){return{close:()=>zo(this,void 0,void 0,(function*(){})),onClose:()=>zo(this,void 0,void 0,(function*(){})),putConfig:()=>zo(this,void 0,void 0,(function*(){})),send:()=>zo(this,void 0,void 0,(function*(){})),onEvent:()=>({subscribe:()=>({unsubscribe:()=>{}})})}}}var Jo,Xo,Qo=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},er=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 tr{constructor(e){Jo.set(this,void 0),Xo.set(this,new Set),Qo(this,Jo,e,"f")}subscribe(e){return er(this,Xo,"f").add(e),!0===e(er(this,Jo,"f"))&&er(this,Xo,"f").delete(e),()=>{er(this,Xo,"f").delete(e)}}publish(e){Qo(this,Jo,e,"f"),er(this,Xo,"f").forEach((e=>{!0===e(er(this,Jo,"f"))&&er(this,Xo,"f").delete(e)}))}clear(){er(this,Xo,"f").clear()}}Jo=new WeakMap,Xo=new WeakMap;var nr=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)},ir=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 ar="breakpoint-0px";class or{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,l,s,d,c,u,p,h,f,v,y,m,C,g,b,I,E,L,D,w,S,A;const x=this.appFactory,T=this.logger,O=null!==(e=this.gatewayFactory)&&void 0!==e?e:()=>new Yo;return A=class extends HTMLElement{static get observedAttributes(){return["visible","interactivity","active-breakpoint","measurement-occluded"]}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,!1),l.set(this,(()=>null)),s.set(this,!1),d.set(this,null),c.set(this,null),u.set(this,null),p.set(this,null),h.set(this,null),f.set(this,null),v.set(this,!1),y.set(this,null),m.set(this,null);const e=this.attachShadow({mode:"open"});ir(this,a,document.createElement("div"),"f"),nr(this,a,"f").id="app-container",nr(this,a,"f").classList.add("default"),e.appendChild(nr(this,a,"f"))}attributeChangedCallback(e,a,o){if(o!==a)switch(e){case"visible":nr(this,n,"f").call(this,"true"===o);break;case"interactivity":"ENABLED"!==o&&"DISABLED"!==o||nr(this,i,"f").call(this,o);break;case"measurement-occluded":nr(this,l,"f").call(this);break;case"active-breakpoint":nr(this,t,"m",C).call(this,o,a)}}makeInteractivityUpdateHandler(e){ir(this,i,(t=>{e.publish(t)}),"f")}makeVisbilityUpdateHandler(e,i,a){const o="true"===this.getAttribute("visible"),s=this.getAttribute("slotInstanceGuid");if(ir(this,r,"true"===this.getAttribute("continuous-measurement"),"f"),nr(this,r,"f")){let o=!1;const r=()=>{const n="true"===this.getAttribute("visible"),r="true"===this.getAttribute("measurement-occluded");if(n&&!o&&(o=!0,0===e&&a.globalDispatch({type:Vn,payload:{event:"Interactive"}}),s&&a.globalDispatch({type:kn,payload:{name:"SignalImpression",parentGuid:s}})),!n||r)return nr(this,t,"m",E).call(this,i,a),void nr(this,t,"m",I).call(this);i&&a.globalDispatch({type:kn,payload:{name:"SignalImpression",parentGuid:i}}),i&&nr(this,t,"m",S).call(this,i,a)};return ir(this,l,r,"f"),ir(this,n,r,"f"),void r()}ir(this,n,(o=>{o?(ir(this,n,(()=>null),"f"),0===e&&a.globalDispatch({type:Vn,payload:{event:"Interactive"}}),i&&(a.globalDispatch({type:kn,payload:{name:"SignalImpression",parentGuid:i}}),nr(this,t,"m",S).call(this,i,a)),s&&a.globalDispatch({type:kn,payload:{name:"SignalImpression",parentGuid:s}})):nr(this,t,"m",I).call(this)}),"f"),nr(this,n,"f").call(this,o)}getOfferPositionAttr(){const e=this.getAttribute("offerPositionIndex"),t=Number(e);return(null==e||isNaN(t)||t<0)&&M(`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){M(`Invalid JSON attribute ${e}: ${n}`)}}disconnectedCallback(){nr(this,t,"m",I).call(this)}connectedCallback(){var e,t,n;const i=this.getAttribute("container"),o=this.getAttribute("plugin-id");nr(this,a,"f").setAttribute("style","width:100%;display:flex;flex-direction:"+("column"===i?"column":"row"));const r=this.getOfferPositionAttr(),l=this.getJSONAttr("layoutSchema"),{layoutSchema:s,variantTimers:d}=function(e){var t;return"LayoutVariantRoot"===e.type?{layoutSchema:e.node.layout,variantTimers:null!==(t=e.node.timers)&&void 0!==t?t:void 0}:{layoutSchema:e}}(l),c=this.getJSONAttr("childLayouts","[]"),u=this.getJSONAttr("offerData"),p=new tr("DISABLED"===this.getAttribute("interactivity")?"DISABLED":"ENABLED"),h=null!==(e=this.getAttribute("schemaVersion"))&&void 0!==e?e:"",f=this.getJSONAttr("offerState","{}");x||M("Cannot create app without factory. Please build the connector withAppFactory.");const v=O({offerPositionIndex:r,creativeInstanceGuid:null===(t=null==u?void 0:u.creative)||void 0===t?void 0:t.instanceGuid},p);this.makeInteractivityUpdateHandler(p),x({rootElement:nr(this,a,"f"),gateway:v,logger:T,offerPositionIndex:r,offerData:u,layoutSchema:s,childLayouts:c,schemaVersion:h,pluginId:o||qt.pluginId,offerState:f,variantTimers:d}),this.makeVisbilityUpdateHandler(r,null===(n=null==u?void 0:u.creative)||void 0===n?void 0:n.instanceGuid,v)}},n=new WeakMap,i=new WeakMap,a=new WeakMap,o=new WeakMap,r=new WeakMap,l=new WeakMap,s=new WeakMap,d=new WeakMap,c=new WeakMap,u=new WeakMap,p=new WeakMap,h=new WeakMap,f=new WeakMap,v=new WeakMap,y=new WeakMap,m=new WeakMap,t=new WeakSet,C=function(e,t){nr(this,a,"f").classList.remove(t||ar),nr(this,a,"f").classList.add(e||ar)},g=function(){nr(this,p,"f")&&(clearTimeout(nr(this,p,"f")),ir(this,p,null,"f"))},b=function(e){nr(this,t,"m",g).call(this),ir(this,p,window.setTimeout(e,1e3),"f")},I=function(){nr(this,t,"m",g).call(this),nr(this,t,"m",D).call(this),nr(this,u,"f")&&(nr(this,u,"f").disconnect(),ir(this,u,null,"f")),nr(this,h,"f")&&(document.removeEventListener("visibilitychange",nr(this,h,"f")),ir(this,h,null,"f")),nr(this,y,"f")&&(window.removeEventListener("beforeunload",nr(this,y,"f")),ir(this,y,null,"f")),nr(this,m,"f")&&(nr(this,a,"f").removeEventListener("click",nr(this,m,"f")),ir(this,m,null,"f")),ir(this,v,!1,"f"),ir(this,f,null,"f")},E=function(e,t){if(!nr(this,v,"f")||null==nr(this,f,"f"))return;const n=nr(this,f,"f"),i=Date.now();if(i<=n)return ir(this,v,!1,"f"),void ir(this,f,null,"f");t.globalDispatch({type:kn,payload:{name:"SignalUserInteraction",parentGuid:e,action:"ViewabilityDurationTracking",context:"Offer Visibility Duration",objectData:{startTimestamp:n.toString(),endTimestamp:i.toString()}}}),ir(this,v,!1,"f"),ir(this,f,null,"f")},L=function(e,n){nr(this,s,"f")||nr(this,d,"f")||!("ResizeObserver"in window)||(ir(this,d,new ResizeObserver((i=>{var a;if(nr(this,s,"f"))return;const o=i[0];if(!o)return;const r=null===(a=o.borderBoxSize)||void 0===a?void 0:a[0],l=r?r.inlineSize:o.contentRect.width,d=r?r.blockSize:o.contentRect.height;0!==l&&0!==d&&(nr(this,t,"m",w).call(this),ir(this,c,window.setTimeout((()=>{ir(this,s,!0,"f"),nr(this,t,"m",D).call(this),window.requestAnimationFrame((()=>{n.globalDispatch({type:kn,payload:{name:"SignalRenderGeometry",parentGuid:e,objectData:{widthPx:Math.round(l),heightPx:Math.round(d)}}})}))}),250),"f"))})),"f"),nr(this,d,"f").observe(nr(this,a,"f")))},D=function(){nr(this,t,"m",w).call(this),nr(this,d,"f")&&(nr(this,d,"f").disconnect(),ir(this,d,null,"f"))},w=function(){nr(this,c,"f")&&(clearTimeout(nr(this,c,"f")),ir(this,c,null,"f"))},S=function(e,n){if(nr(this,o,"f")&&!nr(this,r,"f"))return;const i=this.getAttribute("slotInstanceGuid");i&&nr(this,t,"m",L).call(this,i,n);const l=nr(this,r,"f")&&"true"===this.getAttribute("expanded-owns-viewability");if(!("IntersectionObserver"in window)){if(l||nr(this,o,"f"))return;return n.globalDispatch({type:kn,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!1,inferred:!1}}),void ir(this,o,!0,"f")}nr(this,u,"f")||(ir(this,u,new IntersectionObserver((i=>{i.forEach((i=>{(!nr(this,r,"f")||"true"!==this.getAttribute("measurement-occluded")&&"true"===this.getAttribute("visible")&&"hidden"!==document.visibilityState)&&(i.isIntersecting&&i.intersectionRatio>=.5?(l||nr(this,o,"f")||nr(this,t,"m",b).call(this,(()=>{nr(this,o,"f")||nr(this,r,"f")&&("true"===this.getAttribute("measurement-occluded")||"true"!==this.getAttribute("visible")||"hidden"===document.visibilityState)||(n.globalDispatch({type:kn,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!1}}),ir(this,o,!0,"f"))})),nr(this,v,"f")||(ir(this,f,Date.now(),"f"),ir(this,v,!0,"f"))):(nr(this,t,"m",g).call(this),nr(this,v,"f")&&nr(this,t,"m",E).call(this,e,n)))}))}),{threshold:.5}),"f"),nr(this,u,"f").observe(nr(this,a,"f")),ir(this,m,(()=>{(!nr(this,r,"f")||"true"!==this.getAttribute("measurement-occluded")&&"true"===this.getAttribute("visible")&&"hidden"!==document.visibilityState)&&(l||nr(this,o,"f")||(n.globalDispatch({type:kn,payload:{name:"SignalViewed",parentGuid:e,supportedByBrowser:!0,inferred:!0}}),ir(this,o,!0,"f"),nr(this,t,"m",g).call(this)),nr(this,v,"f")&&nr(this,t,"m",E).call(this,e,n))}),"f"),nr(this,a,"f").addEventListener("click",nr(this,m,"f")),ir(this,h,(()=>{nr(this,u,"f")&&("hidden"===document.visibilityState?(nr(this,t,"m",g).call(this),nr(this,v,"f")&&nr(this,t,"m",E).call(this,e,n),nr(this,u,"f").unobserve(nr(this,a,"f"))):"visible"===document.visibilityState&&nr(this,u,"f").observe(nr(this,a,"f")))}),"f"),document.addEventListener("visibilitychange",nr(this,h,"f")),ir(this,y,(()=>{nr(this,v,"f")&&nr(this,t,"m",E).call(this,e,n)}),"f"),window.addEventListener("beforeunload",nr(this,y,"f")))},A;function M(e){throw T({level:on,code:"MODULE_BUILDER/FAILED_TO_BUILD_MODULE",message:e}),Error(e)}}}const rr=c({get:()=>new Yo}),lr=t=>e(rr.Provider,{value:{get:()=>t.context},children:t.children});const sr=c({get(){throw Error("Layout Schema context has not been set")}}),dr=t=>e(sr.Provider,{value:{get:()=>t.context},children:t.children}),cr=()=>u(sr).get(),ur=c("ENABLED"),pr=()=>u(ur);function hr(e){const t=vr(e);return function e(t,n){if("string"!=typeof t)return e.bind({dataMap:vr(t,this.dataMap)});if(!n)throw new sn("FAILED_TO_MAP_STATIC_DATA","No namespace submitted to StaticData Mapper");return E([n,t],this.dataMap)}.bind({dataMap:t})}const fr={images:{},links:{},icons:{},copy:{},responseOptionsMap:{}};function vr(e,t=fr){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 yr=c(hr({}));yr.Consumer;const mr=yr.Provider,Cr=e=>{const t=u(yr),n=e.split("|");for(const e of n){const n=t(e.trim(),"images");if(n)return n}},gr=()=>u(yr),br=c({});function Ir({info:t,children:n}){const i=u(br);return e(br.Provider,{value:Object.assign(Object.assign({},i),t),children:n})}const Er=c({get(){throw Error("Catalog Item context has not been set")}}),Lr=t=>e(Er.Provider,{value:{get:()=>t.context},children:t.children}),Dr=()=>u(Er).get(),wr=c(""),Sr=()=>u(wr),Ar=c(""),xr=c(void 0);function Tr({children:t}){const n=d((()=>{const e=document.createElement("div");return e.inert=!0,{inert:!0===e.inert}}),[]);return e(xr.Provider,{value:n,children:t})}const Or=c(!0),Mr=c(null),kr=Mr.Provider,Vr=c(null);function Hr(t){const[n,i]=l({}),a=r([]),o=u(rr).get().scrollHostToViewportOffset;function s(e){if(e in n)return[e];const t=`${e}-`;return Object.keys(n).filter((e=>e.startsWith(t)))}return e(Vr.Provider,{value:{registerValidators:function(e,t,n){i((i=>Object.assign(Object.assign({},i),{[e]:{validators:t,isValid:!0,element:n}})))},validateFieldKeys:function(e){const t={},o=[];let r=!0;const l=e.flatMap(s);if(0===l.length)return a.current=[],!1;for(const e of l){const i=n[e];if(i){const n=Object.assign({},i),a=i.validators.every((e=>e()));a!==n.isValid&&(t[e]=Object.assign(Object.assign({},n),{isValid:a})),!a&&i.element&&o.push(i.element),r&&(r=a)}else r=!1}return a.current=o,Object.values(t).length>0&&i((e=>Object.assign(Object.assign({},e),t))),r},getFieldKeyValidity:function(e){const t=s(e);return 0!==t.length&&t.every((e=>{var t,i;return null!==(i=null===(t=n[e])||void 0===t?void 0:t.isValid)&&void 0!==i&&i}))},focusFirstInvalidField:function(){var e;const t=a.current.filter((e=>e.isConnected)).sort(((e,t)=>e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1))[0];if(t){if(null===(e=t.scrollIntoView)||void 0===e||e.call(t,{behavior:o?"instant":"smooth",block:"center"}),o){const e=t.getBoundingClientRect();o(e.top+e.height/2)}t.focus({preventScroll:!0})}}},children:t.children})}function _r(){const e=u(Vr);if(!e)throw new Error("useValidator must be used within a ValidatorProvider");return e}function Pr(e,t,n){const i=_r();o((()=>{var a;e&&i.registerValidators(e,t,null!==(a=null==n?void 0:n.current)&&void 0!==a?a:void 0)}),[e,t.length,n])}function Nr(e,t){return t?t.validators.map((t=>e[t])).filter((e=>void 0!==e)):[]}const Rr=F(ce([te,pe(te)]),he,Z(fe),Z(ve(ye,K({}),_)),fe,W({},"value")),Fr=F(te,z("predicates"));function jr(e,t){return`transition: ${t.map((t=>`${t} ${e}ms`)).join(", ")};`}const $r=de(((e,{duration:t,predicates:n,styles:i})=>{return{predicates:n,classname:e(_a(i)),transitionBaseClassname:e(jr(t,(a=i,B(a).flatMap((e=>{const[t,n]=null!=e?e:[];return n&&t?ue(n).map((e=>Ui(t,e))):[]})))))};var a})),Zr=ce([Rr,Fr]);function Gr(e){return e.value!==e.defaultValue}function Br(e,t){const n=function(e,t){return tn(t,[e]).flatMap((({formKey:e,fieldKey:n})=>{var i;const a=null===(i=t[e])||void 0===i?void 0:i[n];return a&&Jt(a)?a:[]}))}(e.key,t);switch(e.state){case"is-valid":return n.length>0&&n.every((e=>e.validated&&e.valid));case"is-invalid":return n.some(Xt);case"is-touched":return n.some((e=>e.touched));case"is-untouched":return n.every((e=>!e.touched));case"is-dirty":return n.some(Gr);case"is-pristine":return n.every((e=>!Gr(e)));default:return!1}}const Ur={is:$,"is-not":F(ee,$),"is-below":Le,"is-above":Ee};function zr(e,t){return e.includes(t)}const qr={is:$,"is-not":F(ee,$),exists:zr,"not-exists":F(ee,zr)},Kr={exists:F(ee,De(ye,te)),"not-exists":De(ye,te)},Wr={"is-true":$(!0),"is-false":$(!1)},Yr={is:$,"is-not":F(ee,$)};function Jr(e){return(t,n)=>n[e]}const Xr=T([[(e,t)=>$("Breakpoint",e),Jr("activeBreakpoint")],[(e,t)=>$("Progression",e),Jr("progressionIndex")],[(e,t)=>$("Position",e),Jr("positionIndex")]]);function Qr(e,t){return e.creativeCopy&&"string"==typeof e.creativeCopy[t]?e.creativeCopy[t]:void 0}const el=T([[(e,t,n)=>$("Breakpoint",e),(e,t,n)=>{const i=Ce(["breakpoints",t]);return ie(me(i,Number),we(i))(n)}],[(e,t,n)=>$("Progression",e),(e,t,n)=>T([[Ee(0),Se(n.totalGroups)],[Ae(0),_]])(Number(t))],[(e,t,n)=>$("Position",e),(e,t,n)=>T([[Ee(0),Se(n.totalOffers)],[Ae(0),_]])(Number(t))]]),tl=F(ee,isNaN);function nl(e,t){return e.map((e=>{var n,i,a,o;switch(e.type){case"StaticString":return(0,Yr[e.predicate.condition])(e.predicate.input,e.predicate.value);case"CreativeCopy":return(0,Kr[e.predicate.condition])(Qr(t,e.predicate.value));case"StaticBoolean":return(0,Wr[e.predicate.condition])(e.predicate.value);case"CustomState":return(0,Ur[e.predicate.condition])(null!==(n=t.customStates[e.predicate.key])&&void 0!==n?n:0,e.predicate.value);case"DomainState":return(0,Ur[e.predicate.condition])(null!==(i=t.domainStates[e.predicate.key])&&void 0!==i?i:0,e.predicate.value);case"OnFirstEvent":return null!==(a=t.firedEvents[e.predicate.event])&&void 0!==a&&a;case"FormState":return Br(e.predicate,t.formStates);case"DarkMode":throw new Error("DarkMode has not yet been implemented.");case"Placeholder":return function(e){switch(e.predicate.type){case"TextValue":return(0,qr[e.predicate.content.condition])(e.predicate.content.input,e.predicate.content.value);case"TextLength":return(0,Ur[e.predicate.content.condition])(e.predicate.content.input.length,e.predicate.content.value);case"NumericCompare":{const{left:t,right:n,condition:i}=e.predicate.content;if(!t.trim()||!n.trim())return!1;const a=Number(t),o=Number(n);return!(!Number.isFinite(a)||!Number.isFinite(o))&&Ur[i](a,o)}case"Numeric":return(0,Ur[e.predicate.content.condition])(Number(e.predicate.content.input),e.predicate.content.value);default:return!1}}(e);default:{const n=Ur[e.predicate.condition],i=null!==(o=Xr(e.type,t))&&void 0!==o?o:NaN,a=el(e.type,e.predicate.value,t);return!!tl(i)&&n(i,a)}}}))}function il(e){return U(0,["breakpoint","breakpoints",e.breakpoint.activeBreakpoint],e)}const al={breakpoints:{},activeBreakpoint:NaN,progressionIndex:NaN,positionIndex:NaN,totalOffers:NaN,totalGroups:NaN,creativeCopy:{},customStates:{},domainStates:{},firedEvents:{},formStates:{}};function ol(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){if("FormState"===e.type)return be({cached:Ie(Br(e.predicate,t.formStates))},i);const a=function(e,t){var n;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:${Qr(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":if("NumericCompare"===e.predicate.type){const{left:t,right:n,condition:i}=e.predicate.content;return`${e.type}:${e.predicate.type}:${i}:data:${t}:${n}`}return`${e.type}:${e.predicate.type}:${e.predicate.content.condition}:data:${e.predicate.content.input}:${e.predicate.content.value}`;case"OnFirstEvent":return`${e.type}:${e.predicate.event}:state:${null!==(n=t.firedEvents[e.predicate.event])&&void 0!==n&&n}`;case"FormState":throw new Error("FormState predicates bypass the When result cache (see groupByCache)");default:return`${e.type}:${e.predicate.condition}:${e.predicate.value}:state:${Xr(e.type,t)}:${t.totalGroups}`}}(e,t),o=n.current.get(a);return be(rl(o)?{cached:Ie(o)}:{uncached:Ie({key:a,predicate:e})},i)}(i,n,e,t)),{cached:[],uncached:[]}),l=nl(r.map((({predicate:e})=>e)),n);return ge(r,l).forEach((([{key:t},n])=>{e.current.set(t,n)})),o.concat(l)}const rl=q(Boolean);const ll=de(((e,t,n)=>{var i,a,o,r,l,s;return{breakpoints:n.breakpoint.breakpoints,activeBreakpoint:il(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!==(s=null===(l=n.progression)||void 0===l?void 0:l.totalGroups)&&void 0!==s?s:0,customStates:n.customStates,domainStates:n.domainStates,firedEvents:n.firedEvents,formStates:n.formStates,positionIndex:e,creativeCopy:t}})),sl=Ce(["predicate","content","input"]),dl=Ce(["predicate","content","value"]),cl=Ce(["predicate","key"]);function ul(e,t){const n=me(sl,(t=>t?e(t):"")),i=me(dl,(t=>"string"==typeof t?e(t):t)),a=F(n,i),o=me(cl,(t=>t?e(t):""));return t.map((t=>{switch(t.type){case"Placeholder":if("NumericCompare"===t.predicate.type){const{content:n}=t.predicate;return Object.assign(Object.assign({},t),{predicate:Object.assign(Object.assign({},t.predicate),{content:Object.assign(Object.assign({},n),{left:e(n.left),right:e(n.right)})})})}return"TextValue"===t.predicate.type?a(t):n(t);case"CustomState":return o(t);default:return t}}))}const pl=pe($(!0));function hl(e){const t=Po(),n=Ro(),i=r(new Map),a=lo(),o=Ja(al,ll(n,a)),l=ul(ko(),e);return d((()=>pl(ol(i,l,o,t))),[i,l,o,t])}function fl(e){const t=Po(),n=Ro(),i=r(new Map),a=lo(),o=Ja(al,ll(n,a)),l=ko();return d((()=>X((e=>{const n=ul(l,e);return pl(ol(i,n,o,t))}),e)),[i,e,o,t,l])}function vl(e){e&&(e.style.display="")}function yl(e){e&&(e.style.display="none")}function ml(e){return e.settings.duration}const Cl=[{opacity:0,display:"none"},{opacity:0,display:"block",offset:.5},{opacity:0,display:"block",offset:.625},{opacity:1,display:"block"}],gl=[{opacity:1},{opacity:0,offset:.75},{opacity:0}];function bl(e,t,n){if("animate"in e&&"onfinish"in Animation.prototype&&"oncancel"in Animation.prototype&&"finish"in Animation.prototype){const i=t?Cl:gl,a=e.animate(i,{duration:n,iterations:1});return a.onfinish=()=>{t?vl(e):yl(e)},a.oncancel=()=>{t?vl(e):yl(e)},()=>{a.finish()}}return t?vl(e):yl(e),()=>{}}function Il({inTransitions:t,outTransitions:n,visible:i,children:a,containerClassName:l}){const s=r(null);return o((()=>i&&t?t.forEach((e=>{s.current&&function(e,t,n,i){if("FadeIn"===i)bl(e,t,n)}(s.current,i,ml(e),e.type)})):!i&&n?n.forEach((e=>{s.current&&function(e,t,n,i){if("FadeOut"===i)bl(e,t,n)}(s.current,i,ml(e),e.type)})):()=>{}),[i]),e("div",{ref:s,style:{display:"none"},className:l,children:a})}function El(n){const i=eo(),o=hl(n.schema.predicates),r=a.Children.toArray(n.schema.children.map(((e,t)=>i(e,void 0,n.testId?`${n.testId}-child${t}`:void 0))));return n.schema.transition?e(Il,{inTransitions:n.schema.transition.inTransition,outTransitions:n.schema.transition.outTransition,visible:o,children:r}):"functionally"===n.schema.hide?e(ur.Provider,{value:o?"ENABLED":"DISABLED",children:r}):o?e(t,{children:r}):null}const Ll=xe(((e,t)=>`${e||""} ${t||""}`.trim())),Dl=e=>{var t;const n=u(Vo),i=Ro(),a=io()||document.head,o=Sr(),r=$a(o,i,a),l=s(Ua,[]),d=Ja([],(e=>Object.values(e.breakpoint.breakpoints))),c=n||l(d,o,i,a),p=e.styles?c(e.styles):{},h=e.styles&&e.styles.conditionalTransitions?function(e,t){const n=$r(e);return X((e=>Zr(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=fl(h?X(W([],"predicates"),h):{}),v=X(((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}(h,t):void 0),f),y=h?X(z("transitionBaseClassname"),h):{},m=e.styles?((e,t,n)=>Ll(Ll(e,t),n))(p,v,y):void 0;return e.children({classnames:m,mapperRef:c})};function wl(t){const n=eo();return e(Dl,{styles:t.schema.styles,children:({classnames:i})=>{var o;return e("div",{className:i?i.own:void 0,"data-testid":t.testId,"data-e2e-item":t.e2eItemId,style:{display:"flex",flexDirection:"column"},"aria-label":null!==(o=t.schema.a11yLabel)&&void 0!==o?o:void 0,children:a.Children.toArray(t.schema.children.map(((e,i)=>n(e,void 0,In(i,t.testId)))))})}})}function Sl(t){const n=eo();return e(Dl,{styles:t.schema.styles,children:({classnames:i})=>{var o;return e("div",{className:i?i.own:void 0,"data-testid":t.testId,"data-e2e-item":t.e2eItemId,style:{display:"flex",flexDirection:"row"},"aria-label":null!==(o=t.schema.a11yLabel)&&void 0!==o?o:void 0,children:a.Children.toArray(t.schema.children.map(((e,i)=>n(e,void 0,In(i,t.testId)))))})}})}const Al={allowedTags:["em","strong","a","br","u","p","li","ul","ol","s"],allowedAttributes:{a:["href","target",Si,Ai],strong:[],em:[],br:[],u:[],p:[],ol:[],ul:[],li:[],s:[]},allowedSchemes:["http","https"]},xl=new Map([["&","_;^;_"]]),Tl=new RegExp(`<a *(?=${Al.allowedAttributes.a.join("|")}|>)`,"g"),Ol=new RegExp('<a [^>]*href="([^"]+)"',"g"),Ml=new RegExp("(<br *?>)|(<br *?/>)","g"),kl="<br/>";function Vl(t){const n=ko(),i=pr(),a=d((()=>{const e=n(t.schema.value);if(!function(e){const t=function(e){return e.replaceAll(Ol,((e,t)=>{const n=t.replaceAll("&",xl.get("&"));return e.replace(t,n)})).replaceAll(Ml,kl)}(e);return t===Dt(t,Al)}(e))throw new sn("FAILED_SANITISING_HTML","Invalid HTML tags");return e.trim()?e:""}),[t.schema.value,n]),{tabIndex:o,styles:r,isDisabled:l}=Tt(i),{setRef:s,maskStyle:c}=_i("vertical",Pi(t.schema.styles));return a?e(Dl,{styles:t.schema.styles,children:({classnames:n})=>{const i=[(null==n?void 0:n.link)?`class = "${null==n?void 0:n.link}"`:"",l?'tabindex="-1"':"",l?"style=\"pointer-events: 'none'; user-select: none;\"":"",l?'aria-disabled="true"':""].filter((e=>e.length>0)),d=Object.assign(Object.assign({},r),c);return u=a,new RegExp("</(p|ul|ol)>").test(u)?e("div",{ref:s,tabIndex:o,style:d,"aria-hidden":l,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(Tl,`<a ${i.join(" ")}`)}}):e("p",{ref:s,tabIndex:o,style:d,"aria-hidden":l,className:null==n?void 0:n.own,"data-testid":t.testId,"data-e2e":"RichText",dangerouslySetInnerHTML:{__html:a.replace(Tl,`<a ${i.join(" ")}`)}});var u}}):null}function Hl(t){const n=ko()(t.schema.value),i=pr(),{tabIndex:a,styles:o,isDisabled:r}=Tt(i);return n?e(Dl,{styles:t.schema.styles,children:({classnames:i})=>{const l={tabIndex:a,"aria-hidden":r,className:null==i?void 0:i.own,"data-testid":t.testId,"data-e2e":"BasicText"};return t.isInline?e("span",Object.assign({style:o},l,{children:n})):e("p",Object.assign({style:o},l,{children:n}))}}):null}function _l(t,n,i){if("BasicText"===t.type)return e(Hl,{schema:t.node,testId:n,isInline:null!=i&&i})}function Pl(t,n,i,a,o){return e(Ho,{value:i(n),children:Nl(t,a,o)})}function Nl(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,In(i,n)))))}function Rl(t){const n=Wa(),i=eo(),a=ro(),l=ko(),d=Ro(),c=pr(),u=a.creative.responseOptionsMap[t.schema.responseKey],p=r(null),h=r(!1),f=s((()=>{h.current||(p.current=Date.now())}),[]),v=s((()=>{const e=p.current;if(null===e)return;const i=Date.now(),o="positive"===t.schema.responseKey?"-Positive":"-Negative";i>e&&n({type:kn,payload:{name:"SignalUserInteraction",action:"Hover",context:`CreativeResponse${o}`,parentGuid:a.creative.instanceGuid,objectData:{startTimestamp:e.toString(),endTimestamp:i.toString()}}}),h.current=!1,p.current=null}),[n,a.creative.instanceGuid,t.schema.responseKey]),y=Nt(u);o((()=>{y&&n(function(e){if(e.paymentTriggerConfig)return{type:Bn,payload:{criteria:{key:"PAYMENT_OFFER_SELECTED"},signal:{name:jt(e.signalType),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}`)}(u))}),[u,n,y]);const m=u?l({data:u},"creativeResponse"):l,{tabIndex:C,styles:g,isDisabled:b}=Tt(c);return Vt(u)&&!y&&void 0!==d?e(Dl,{styles:t.schema.styles,children:({classnames:o,mapperRef:r})=>e("button",{type:"button",tabIndex:C,"aria-disabled":b,"aria-label":t.schema.a11yLabel?m(t.schema.a11yLabel):void 0,style:Object.assign({cursor:"pointer"},g),"data-testid":t.testId,"data-e2e":"CreativeResponse","data-e2e-response-type":t.schema.responseKey,onMouseOver:f,onMouseLeave:v,onClick:e=>{e.preventDefault(),v();const i=Mn(a,u,t.schema.openLinks);n({type:Ln,payload:i})},className:null==o?void 0:o.own,disabled:b,children:e(Mo,{value:m,children:(null==o?void 0:o.own)?Pl(t.schema.children,o.own,r,i,t.testId):Nl(t.schema.children,i,t.testId)})})}):null}function Fl(t){const n=pr(),{styles:i,isDisabled:a}=Tt(n);return t.schema.url.light?e(Dl,{styles:xt(t.schema.styles),children:({classnames:n})=>e("img",{"aria-hidden":a,style:Object.assign(Object.assign({},i),{display:"inline-block"}),alt:a?void 0:t.schema.alt||void 0,title:t.schema.title||void 0,className:n?n.own:void 0,"data-testid":t.testId,"data-e2e":"StaticImage",src:t.schema.url.light})}):null}function jl(t){const n=pr(),{styles:i,isDisabled:a}=Tt(n),o=Cr(t.schema.imageKey);return null!=(r=o)&&"object"==typeof r&&"light"in r&&"string"==typeof r.light?e(Dl,{styles:xt(t.schema.styles),children:({classnames:n})=>e("img",{"aria-hidden":a,style:Object.assign(Object.assign({},i),{display:"inline-block"}),alt:o.alt,title:o.title,className:n?n.own:void 0,"data-testid":t.testId,"data-e2e":"DataImage",src:o.light})}):null;var r}const $l={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Zl(t){const n=t.schema.name,i=t.schema.description,a=t.schema.styles?gn($l,t.schema.styles):$l,o=pr(),{styles:r,isDisabled:l}=Tt(o);return n?e(Dl,{styles:a,children:({classnames:a})=>e("span",Object.assign({style:Object.assign(Object.assign({},r),{display:"inline-block"}),className:"rokt-icon"+((null==a?void 0:a.own)?" "+a.own:""),"data-testid":t.testId,"data-e2e":`StaticIcon-${n}`},!l&&i?{title:i}:{"aria-hidden":"true"},{children:n}))}):null}function Gl(t,n){if("StaticIcon"===t.type)return e(Zl,{schema:t.node,testId:n})}const Bl={backgroundColor:"#FFEEEE",color:"#FF0000",fontSize:"10px",padding:"4px",border:"1px solid #FF0000",margin:0,whiteSpace:"normal"};class Ul 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"===Fi.REPORT_RENDER_ERRORS&&this.props.reporter({level:on,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"===Fi.DISPLAY_ERRORS?n("pre",{style:Bl,children:[e("strong",{children:"Error:"})," [",e("em",{children:this.props.schema.type}),"]"," ",this.state.errorMessage]}):void 0:this.props.children}}Ul.contextType=br;const zl={internally:"_top",externally:"_blank"};function ql(t,n,i,a,o){return e(Ho,{value:i(n),children:Kl(t,a,o)})}function Kl(e,t,n){return a.Children.toArray(e.map(((e,i)=>t(e,void 0,n?`${n}-child${i}`:void 0))))}function Wl(t){var n;const i=zl[t.schema.open],a=eo(),o=pr(),{tabIndex:r,styles:l,isDisabled:s}=Tt(o);return(null===(n=t.schema.children)||void 0===n?void 0:n.length)>0?e(Dl,{styles:t.schema.styles,children:({classnames:n,mapperRef:o})=>{var d;return e("a",{href:t.schema.src,"data-testid":t.testId,"data-e2e":"StaticLink",target:null!=i?i:"_blank",tabIndex:r,"aria-disabled":s,"aria-label":null!==(d=t.schema.a11yLabel)&&void 0!==d?d:void 0,style:Object.assign({cursor:"pointer",textDecoration:"none",display:t.isInline?"inline":"block"},l),className:null==n?void 0:n.own,children:(null==n?void 0:n.own)?ql(t.schema.children,null==n?void 0:n.own,o,a,t.testId):Kl(t.schema.children,a,t.testId)})}}):null}function Yl(t,n,i){if("StaticLink"===t.type)return e(Wl,{schema:t.node,testId:n,isInline:null!=i&&i})}const Jl={elements:{own:[{default:{text:{fontFamily:"rokt-icons"}}}]}};function Xl(t){const n=(i=t.schema.iconKey,u(yr)(i,"icons"));var i;const a=null==n?void 0:n.name,o=t.schema.styles?gn(Jl,t.schema.styles):Jl,r=pr(),{styles:l}=Tt(r);return a?e(Dl,{styles:o,children:({classnames:n})=>e("span",{style:Object.assign(Object.assign({},l),{display:"inline-block"}),"aria-hidden":"true",className:"rokt-icon"+((null==n?void 0:n.own)?" "+n.own:""),"data-testid":t.testId,"data-e2e":`DataIcon-${a}`,children:a})}):null}function Ql(t){const n=eo(),i=r(null),l=Sr(),s=Ro(),d=io(),c=(d?$a(l,s,d):Ue)`
2
2
  display: flex;
3
3
  position: relative;
4
4
  overflow: hidden;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Escapes the characters that can end or escape a double-quoted CSS string:
3
+ * a double quote and a backslash get a backslash in front, and a CSS newline
4
+ * (LF, CR, FF) becomes its hex escape with a space terminator. A value written
5
+ * into url("...") then stays inside the quotes even when the validator in
6
+ * front of it lets one of them through.
7
+ *
8
+ * A colon and a semicolon become their hex escapes too. The css writer
9
+ * (Emotion) scans the whole style string for `label:<name>` and appends the
10
+ * name to the class it inserts, and the rule's own closing `");` ends a
11
+ * label that the value starts (the `")` is read into the name, the `;` ends
12
+ * it), so a label read out of the value would turn that class into a
13
+ * selector list that reaches the host page. The colon is escaped so the word
14
+ * label can never be followed by one, and the semicolon so a raw one cannot
15
+ * end such a label. The browser decodes both back to the same url.
16
+ */
17
+ export declare function escapeCSSString(value: string): string;
@@ -1,4 +1,5 @@
1
1
  export * from './apply-from-spec';
2
+ export * from './escape-css-string';
2
3
  export * from './join';
3
4
  export * from './join-to-css-rule';
4
5
  export * from './join-to-media-query';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rokt/dcui-orchestrator",
3
- "version": "1.2.1-rc.44",
3
+ "version": "1.2.1-rc.45",
4
4
  "description": "Rokt's DCUI rendering process",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",