@mparticle/web-rokt-kit 3.8.1 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- var RoktKit=(function(j){"use strict";const Te=["active_time_on_site_ms","billingaddress1","billingaddress2","billingcity","billingstate","billingzipcode","cartitems","ccbin","confirmationref","conversiontype","country","couponcode","currency","language","paymentserviceprovider","paymentserviceproviderattribute","paymenttype","shippingaddress1","shippingcity","shippingcountry","shippingmethod","shippingstate","shippingzipcode","totalprice"],Le=new Set(Te);function Z(i){return Le.has(i.toLowerCase())}function I(i){const e={},t=i||{},n=Object.keys(t);for(let r=0;r<n.length;r++){const s=n[r];Z(s)||(e[s]=t[s])}return e}function f(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function g(i){return typeof i=="string"}function N(i){return typeof i=="function"}function y(i){return i==null?!0:typeof i=="string"?i.length===0:typeof i=="object"?Object.keys(i).length===0:!1}function H(i){try{const e=new URL(i);return e.search="",e.toString()}catch{return i}}function ee(i){let e=5381;for(let t=0;t<i.length;t++)e=(e<<5)+e+i.charCodeAt(t),e=e&e;return e}const d="mp-rokt-kit",te="__rokt_ls_probe__";function V(){try{return window.localStorage.setItem(te,"1"),window.localStorage.removeItem(te),!0}catch{return!1}}const S=()=>window.localStorage;function W(i,e=S){try{const t=e().getItem(i);return t===null?null:JSON.parse(t)}catch{return null}}function ie(i,e,t=S){try{return t().setItem(i,JSON.stringify(e)),!0}catch{return!1}}function Oe(i,e=S){try{e().removeItem(i)}catch{}}function k(i,e,t=S){const n=W(i,t);return f(n)?n[e]:void 0}function U(i,e,t,n=S){const r=W(i,n),s=f(r)?{...r}:{};return s[e]=t,ie(i,s,n)}function K(i,e,t=S){const n=W(i,t);if(!f(n)||!(e in n))return;const r={...n};delete r[e],Object.keys(r).length===0?Oe(i,t):ie(i,r,t)}const z="pageViews",C="utmParams",ne=25,Ne=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];function re(i){return i.slice(-ne)}function se(){const i=k(d,z);return Array.isArray(i)?i:[]}function Ue(i){const e=re(i);for(let t=0;t<e.length;t++){const n=e.slice(t);if(U(d,z,n))return n.length}return 0}function oe(){K(d,z)}function Ke(i){const e=re(i);return e.map((t,n)=>{const r=t.activeTimeOnSite,s=r!==void 0&&Number.isFinite(r),c=e[n+1]?.activeTimeOnSite,u=c!==void 0&&Number.isFinite(c),l=s&&u?c-r:void 0;return{pageUrl:t.pageUrl,sourceMessageId:t.sourceMessageId,timestamp:t.timestamp,...t.pageTitle!==void 0?{pageTitle:t.pageTitle}:{},...t.canonicalUrl!==void 0?{canonicalUrl:t.canonicalUrl}:{},...s?{activeTimeOnSite:r}:{},...l!==void 0&&l>=0?{activeTimeOnPage:l}:{}}})}function Ce(i){if(k(d,C)!==void 0)return;const e=new URLSearchParams(window.location.search),t={};for(const r of Ne){const s=e.get(r);s&&(t[r]=s)}if(Object.keys(t).length===0)return;const n=Object.keys(t).join(", ");if(!U(d,C,t)){const r=V()?"quota":"ls_unavailable";i?.log({message:`Rokt Kit: Failed to persist UTM params [reason: ${r}]`,code:"UTM_CAPTURE_FAILED"});return}i?.log({message:`Rokt Kit: Captured UTM params [${n}]`,code:"UTM_CAPTURE_SUCCESS"})}function De(){const i=k(d,C);return f(i)?i:null}function ce(){K(d,C)}function Me(){const e=document.querySelector('link[rel="canonical"]')?.href;if(e)return H(e)}const $=[{accountId:"2919171670744024290",pathname:"/checkout",targetPageIdentifier:"prod.rokt.conf",attributeKeys:["email","customertype","eventvenue","firstname","lastname","member_status","billingzipcode","currency"],optionalAttributeKeys:["firstname","lastname"]},{accountId:"2550745407543340151",pathname:"/checkout",targetPageIdentifier:"RoktExperience",attributeKeys:["email","firstname","lastname","customertype","loyaltytier","paymenttype","ccbin"],optionalAttributeKeys:["loyaltytier","paymenttype","ccbin"]},{accountId:"3236704179315511296",pathname:"/check-out/pay",targetPageIdentifier:"confirmation_page",attributeKeys:["email","firstname","lastname","loyaltytier"],optionalAttributeKeys:["firstname","lastname","loyaltytier"]},{accountId:"2192288523645376337",pathname:"/checkout/*/review",targetPageIdentifier:"ppx-ad-view-prod",attributeKeys:["email","firstname","lastname"],optionalAttributeKeys:["email"]},{accountId:"2074245483568304147",pathname:"/checkout/cart",targetPageIdentifier:"new_confirmation",attributeKeys:["email"]}],Fe=6e4;function xe(i){return f(i)&&typeof i.expiresAt=="number"&&f(i.attributes)}function Ye(i,e){return`activePreselect:${i}:${e}`}function Ge(i){const e=k(d,i);return xe(e)?e:null}function je(i,e){U(d,i,{expiresAt:Date.now()+Fe,attributes:e})}const He=5*6e4;function D(){return window.sessionStorage}function Ve(i){return f(i)&&typeof i.expiresAt=="number"&&g(i.pathname)&&g(i.identifier)&&f(i.attributes)&&g(i.mpid)}function q(i){return`pendingPreselect:${i}`}function We(i){const e=q(i),t=k(d,e,D);return Ve(t)?t.expiresAt<=Date.now()?(K(d,e,D),null):t:null}function ze(i,e,t,n,r){return U(d,q(i),{expiresAt:Date.now()+He,pathname:e,identifier:t,attributes:n,mpid:r},D)}function v(i){K(d,q(i),D)}function A(i,e){const t={fired:"PRESELECT_FIRED",missed:"PRESELECT_MISSED",queued:"PRESELECT_QUEUED",skipped:"PRESELECT_SKIPPED"};return{message:`Rokt Kit: preselect ${i} [reason=${e}]`,code:t[i]}}function $e(i,e){if(!i.includes("*"))return i===e;const t=i.split("/"),n=e.split("/");return t.length!==n.length?!1:t.every((r,s)=>r==="*"?n[s]!=="":r===n[s])}function ae(i,e){if(i)return $.find(t=>t.accountId===i&&$e(t.pathname,e))}function qe(i,e){if(!(!i||!g(e)))return $.find(t=>t.accountId===i&&t.targetPageIdentifier===e)}function Je(i,e){return i?$.some(t=>t.accountId===i&&t.attributeKeys.includes(e)):!1}function Be(){return{pending:[]}}function J(i,e){const t=i.pending.findIndex(n=>n.pathname===e.pathname);if(t>=0){i.pending[t]=e;return}i.pending.push(e)}function B(i){if(!i?.getUserIdentities)return!1;const e=i.getUserIdentities().userIdentities;return e?Object.keys(e).some(t=>{const n=e[t];return g(n)&&n.length>0}):!1}function le(i){const e=i?.getMPID?.();return e==null?null:String(e)}function ue(i,e){const t=new Set((i.optionalAttributeKeys??[]).map(n=>n.toLowerCase()));return i.attributeKeys.filter(n=>!t.has(n.toLowerCase())&&y(e[n]))}function de(i,e,t){const n=i.filteredUser?.getAllUserAttributes?.()||{},r={};for(const s of t.attributeKeys){const o=i.getEventAttributeValue(e,s),c=y(o)?i.userAttributes[s]??n[s]:o;y(c)||(r[s]=c)}return{collected:r,missingKeys:ue(t,r)}}function Qe(i,e){Promise.resolve(i.selectPlacements(e)).catch(t=>{const n=t instanceof Error?t.message:String(t);i.log({message:`Rokt Kit: Preselect selectPlacements call failed: ${n}`,code:"PRESELECT_DISPATCH_FAILED"})})}function he(i,e,t,n,r,s){const o=Ye(e,t),c=Ge(o),u=!!c&&JSON.stringify(c.attributes)===JSON.stringify(r);if(c&&c.expiresAt>Date.now()&&u){i.logPlacementDiagnostic(A("skipped","active_preselection"));return}je(o,r),i.logPlacementDiagnostic(A("fired",s)),Qe(i,{attributes:r,preselect:!0,identifier:n,omitUrl:!0})}function Xe(i,e){if(!e.accountId||!e.isKitReady())return;const t=We(e.accountId);if(!t)return;if(i.pending.some(o=>o.pathname===t.pathname)){v(e.accountId);return}if(!e.isPreselectionEnabled()){v(e.accountId);return}if(!B(e.filteredUser)||(v(e.accountId),le(e.filteredUser)!==t.mpid))return;const n=ae(e.accountId,t.pathname);if(!n||n.targetPageIdentifier!==t.identifier)return;const r=I(t.attributes),s=ue(n,r);if(s.length>0){for(const o of s)e.logPlacementDiagnostic(A("missed",`missing_persisted_attribute:${o}`));return}he(e,e.accountId,t.identifier,t.identifier,r,"recovered")}function ge(i,e,t,n=window.location.pathname){const r=ae(e.accountId,n);if(!r)return;if(!e.isKitReady()){const c=[],u=le(e.filteredUser);if(e.accountId&&u&&B(e.filteredUser)){const{collected:l,missingKeys:p}=de(e,t,r);if(p.length===0){const w=I(l);ze(e.accountId,n,r.targetPageIdentifier,w,u)||c.push(A("queued","persist_failed"))}}J(i,{event:t,pathname:n,storedDiagnostics:c});return}if(!e.isPreselectionEnabled())return;if(!B(e.filteredUser)){e.logPlacementDiagnostic(A("missed","no_valid_identity")),J(i,{event:t,pathname:n});return}const{collected:s,missingKeys:o}=de(e,t,r);if(o.length>0){for(const c of o)e.logPlacementDiagnostic(A("missed",`missing_attribute:${c}`));J(i,{event:t,pathname:n});return}he(e,e.accountId||"",n,r.targetPageIdentifier,s,"fired")}function Ze(i,e,t=window.location.pathname){if(Xe(i,e),i.pending.length===0)return;const n=i.pending;i.pending=[],n.forEach(({event:r,pathname:s,storedDiagnostics:o})=>{s===t&&(e.isKitReady()&&e.isPreselectionEnabled()&&o?.forEach(c=>e.logPlacementDiagnostic(c)),ge(i,e,r,s))})}function et(){return{context:null,lifecycle:"idle",recreateInFlight:null}}function tt(i,e){i.context={accountId:e.accountId,launcherOptions:{...e.launcherOptions},legacyRoktExtensions:[...e.legacyRoktExtensions]}}function it(i){i.lifecycle="attached"}function nt(i){i.lifecycle!=="idle"&&(i.lifecycle="terminated")}function rt(i){i.lifecycle="terminated"}function st(i){i.context=null,i.lifecycle="idle",i.recreateInFlight=null}function ot(i,e,t){if(i.recreateInFlight)return i.recreateInFlight;if(i.lifecycle!=="terminated"||!i.context||!e)return;i.lifecycle="recreating";const n=i.context;return i.recreateInFlight=t(n).finally(()=>{i.recreateInFlight=null}),i.recreateInFlight}const h="Rokt",M=181,ct="selectPlacements",at="apps.roktecommerce.com",lt=.1,ut="ThankYouPageJourney",dt="rokt-launcher",ht="rokt-thank-you-element",gt="userIdentifiedInWorkspace",ft=3,pt=2,mt="page_events",Et="page_view_attributes",_t="mparticle_session_id",It="mparticle_device_id",fe=500,Q={UNKNOWN_ERROR:"UNKNOWN_ERROR",UNHANDLED_EXCEPTION:"UNHANDLED_EXCEPTION",IDENTITY_REQUEST:"IDENTITY_REQUEST",LOG_DELIVERY_FAILURE:"LOG_DELIVERY_FAILURE"},P={ERROR:"ERROR",INFO:"INFO",WARNING:"WARNING"},yt="apps.rokt-api.com",St="/v1/log",At="/v1/errors",Pt=10;function a(){return window.mParticle}function pe(i,e){const n=[F(i),"/wsdk/integrations/launcher.js"].join("");return!e||e.length===0?n:n+"?extensions="+e.join(",")}function me(i){return[F(i),"/rokt-elements/rokt-element-thank-you.js"].join("")}function F(i){const e=i!==void 0?i:yt;return e.includes("://")?e.replace(/\/+$/,""):["https://",e].join("")}function Ee(i,e,t){if(i)return i.startsWith("http://")||i.startsWith("https://")?i:"https://"+i;const r=e?.includes("://")&&!/^https?:\/\//i.test(e)?void 0:e;return F(r)+t}function _e(i,e,t){if(document.getElementById(i))return;const n=document.head||document.body,r=document.createElement("script");r.id=i,r.type="text/javascript",r.src=e,r.async=!0,r.crossOrigin="anonymous",r.fetchPriority="high",t?.onLoad&&(r.onload=t.onLoad),t?.onError&&(r.onerror=t.onError),n.appendChild(r)}function x(i){if(!i)return[];try{return JSON.parse(i.replace(/&quot;/g,'"'))}catch{console.error("Settings string contains invalid JSON")}return[]}function Ie(i){const e=i?x(i):[],t=[],n=[];let r=!1;for(let s=0;s<e.length;s++){const o=e[s].value;o==="thank-you-journey"?(r=!0,n.push(ut)):t.push(o)}return{roktExtensionsQueryParams:t,legacyRoktExtensions:n,loadThankYouElement:r}}async function bt(i,e){const t=[];if(e)for(const n of i)t.push(e.use(n));return Promise.all(t)}function ye(i){if(!i)return{};const e={};for(let t=0;t<i.length;t++){const n=i[t];e[n.jsmap]=n.value}return e}function Se(i){const e={};if(!Array.isArray(i))return e;for(let t=0;t<i.length;t++){const n=i[t];if(!n||!g(n.value)||!g(n.map))continue;const r=n.value,s=n.map;e[r]||(e[r]=[]),e[r].push({eventAttributeKey:s,conditions:Array.isArray(n.conditions)?n.conditions:[]})}return e}function Ae(i,e,t){return a().generateHash([i,e,t].join(""))}function Rt(i){let n="mParticle_wsdkv_"+a().getVersion()+"_kitv_"+"3.8.1";return i&&(n+="_"+i),n}function X(i){const e=document.createElement("iframe");e.style.display="none",e.setAttribute("sandbox","allow-scripts allow-same-origin"),e.src=i,e.onload=function(){e.onload=null,e.parentNode&&e.parentNode.removeChild(e)};const t=document.body||document.head;t&&t.appendChild(e)}function Pe(i,e){const t=ee(window.location.origin);if(b._allowedOriginHashes.indexOf(t)===-1||Math.random()>=lt)return;const r=window.__rokt_li_guid__;if(!r||i&&i.includes("://")&&!/^https:\/\//i.test(i))return;const s=window.location.href.split("?")[0].split("#")[0],o="version="+encodeURIComponent(e??"")+"&launcherInstanceGuid="+encodeURIComponent(r)+"&pageUrl="+encodeURIComponent(s),c=i?F(i):"https://apps.rokt.com";X(c+"/v1/wsdk-init/index.html?"+o),X("https://"+at+"/v1/wsdk-init/index.html?"+o+"&isControl=true")}function kt(){return typeof window<"u"&&!!window.location?.search?.toLowerCase().includes("mp_enable_logging=true")}function vt(){return typeof window<"u"?window.location?.href:void 0}function wt(){return typeof window<"u"?window.navigator?.userAgent:void 0}class be{constructor(){this._logCount={}}incrementAndCheck(e){const n=(this._logCount[e]||0)+1;return this._logCount[e]=n,n>Pt}}class Y{constructor(e,t,n,r,s){this._reporter="mp-wsdk";const o=e.isLoggingEnabled;this._integrationName=t||"",this._launcherInstanceGuid=n,this._accountId=r||null,this._rateLimiter=s||new be,this._isEnabled=kt()||o}send(e,t,n,r,s,o){if(!(!this._isEnabled||this._rateLimiter.incrementAndCheck(t)))try{const c={additionalInformation:{message:n,version:this._integrationName},severity:t,code:r||Q.UNKNOWN_ERROR,url:vt(),deviceInfo:wt(),stackTrace:s,reporter:this._reporter,integration:this._integrationName},u={Accept:"text/plain;charset=UTF-8","Content-Type":"application/json","rokt-launcher-version":this._integrationName,"rokt-wsdk-version":"joint"};this._launcherInstanceGuid&&(u["rokt-launcher-instance-guid"]=this._launcherInstanceGuid),this._accountId&&(u["rokt-account-id"]=this._accountId),fetch(e,{method:"POST",headers:u,body:JSON.stringify(c)}).then(l=>{if(!l.ok){const p=new Error("HTTP "+l.status+" from log endpoint");throw p.statusCode=l.status,p}}).catch(l=>{console.error("ReportingTransport: Failed to send log",l),o&&o(l)})}catch(c){console.error("ReportingTransport: Failed to send log",c),o&&o(c)}}}class Re{constructor(e,t,n,r,s){this._transport=new Y(e,t,n,r,s),this._errorUrl=Ee(e?.errorUrl,e?.integrationDomain,At)}report(e){if(!e)return;const t=e.severity||P.ERROR;this._transport.send(this._errorUrl,t,e.message,e.code,e.stackTrace)}}class ke{constructor(e,t,n,r,s,o){this._transport=new Y(e,n,r,s,o),this._placementDiagnosticTransport=new Y(e,n,r,s),this._loggingUrl=Ee(e?.loggingUrl,e?.integrationDomain,St),this._errorReportingService=t}log(e){e&&this._send(this._transport,e)}logPlacementDiagnostic(e){e&&this._send(this._placementDiagnosticTransport,e)}_send(e,t){e.send(this._loggingUrl,P.INFO,t.message,t.code,void 0,n=>{if(this._errorReportingService){const r=typeof n.statusCode=="number";this._errorReportingService.report({message:"LoggingService: Failed to send log: "+n.message,code:Q.LOG_DELIVERY_FAILURE,severity:r?P.ERROR:P.WARNING})}})}}function Tt(i){const e=H(window.location.href),t=i.EventAttributes?.title||document.title,n=Me(),r=i.ActiveTimeOnSite;return{pageUrl:e,sourceMessageId:i.SourceMessageId,timestamp:i.Timestamp,...t?{pageTitle:t}:{},...n!==void 0?{canonicalUrl:n}:{},...Number.isFinite(r)?{activeTimeOnSite:r}:{}}}const E=class E{constructor(){this.name=h,this.id=M,this.moduleId=M,this.isInitialized=!1,this.launcher=null,this.filters={},this.userAttributes={},this.userIdentifiedInWorkspace=!1,this.testHelpers=null,this.placementEventMappingLookup={},this.placementEventAttributeMappingLookup={},this.integrationName=null,this.errorReportingService=null,this.loggingService=null,this._thankYouElementOnLoadCallback=null,this._isThankYouElementLoaded=!1,this._workspaceSearchInFlightPromise=null,this._launcherAttachState=et(),this.accountId=null,this._preselectState=Be()}getEventAttributeValue(e,t){const n=e&&e.EventAttributes;return!n||n[t]===void 0?null:n[t]}doesEventAttributeConditionMatch(e,t){if(!e||!g(e.operator))return!1;const n=e.operator.toLowerCase(),r=e.attributeValue;return n==="exists"?t!==null:t==null?!1:n==="equals"?String(t)===String(r):n==="contains"?String(t).indexOf(String(r))!==-1:!1}doesEventMatchRule(e,t){if(!t||!g(t.eventAttributeKey))return!1;const n=t.conditions;if(!Array.isArray(n))return!1;const r=this.getEventAttributeValue(e,t.eventAttributeKey);if(n.length===0)return r!==null;for(let s=0;s<n.length;s++)if(!this.doesEventAttributeConditionMatch(n[s],r))return!1;return!0}applyPlacementEventAttributeMapping(e){const t=Object.keys(this.placementEventAttributeMappingLookup);for(let n=0;n<t.length;n++){const r=t[n],s=this.placementEventAttributeMappingLookup[r];if(y(s))continue;let o=!0;for(let c=0;c<s.length;c++)if(!this.doesEventMatchRule(e,s[c])){o=!1;break}o&&a().Rokt.setLocalSessionAttribute?.(r,!0)}}capturePageView(e){let t;try{t=H(window.location.href);const n=se(),r=Tt(e);n.push(r);const s=Math.min(n.length,ne),o=Ue(n);if(o===0){const c=V()?"quota":"ls_unavailable";this.loggingService?.log({message:`Rokt Kit: Failed to persist page view for ${t} [reason: ${c}]`,code:"PAGE_VIEW_CAPTURE_FAILED"})}else o<s&&this.loggingService?.log({message:`Rokt Kit: Page view storage reduced from ${s} to ${o} record(s) under quota pressure [reason: quota_eviction]`,code:"PAGE_VIEW_QUOTA_EVICTION"})}catch(n){const r=V()?"exception":"ls_unavailable",s=n instanceof Error?n.message:String(n);this.loggingService?.log({message:`Rokt Kit: Failed to capture page view for ${t}: ${s} [reason: ${r}]`,code:"PAGE_VIEW_CAPTURE_FAILED"})}}isPreselectionEnabled(){return this.launcher?.enablePreselection===!0}buildCacheMatchKeys(e){if(!this.isPreselectionEnabled())return;const t=qe(this.accountId,e);if(t)return t.attributeKeys}buildPreselectHost(){return{accountId:this.accountId,filteredUser:this.filters.filteredUser,userAttributes:this.userAttributes,isKitReady:()=>this.isKitReady(),isPreselectionEnabled:()=>this.isPreselectionEnabled(),getEventAttributeValue:(e,t)=>this.getEventAttributeValue(e,t),logPlacementDiagnostic:e=>this.loggingService?.logPlacementDiagnostic(e),log:e=>this.loggingService?.log(e),selectPlacements:e=>this.selectPlacements(e)}}flushPendingPreselectDispatches(){Ze(this._preselectState,this.buildPreselectHost())}isLauncherReadyToAttach(){return!!window.Rokt&&N(window.Rokt.createLauncher)}returnUserIdentities(e){if(!e||!e.getUserIdentities)return{};const t=e.getUserIdentities().userIdentities;return this.replaceOtherIdentityWithEmailsha256(t)}returnLocalSessionAttributes(){return!a().Rokt||typeof a().Rokt.getLocalSessionAttributes!="function"?{}:a().Rokt.getLocalSessionAttributes()}replaceOtherIdentityWithEmailsha256(e){const t={...e||{}},n=this._mappedEmailSha256Key;return n&&e[n]&&(t[E.EMAIL_SHA256_KEY]=e[n]),n&&delete t[n],t}logSelectPlacementsEvent(e){if(!window.mParticle||typeof a().logEvent!="function"||!f(e))return;const t=a().EventType.Other;a().logEvent(ct,t,e)}setRoktSessionId(e){if(!(!e||typeof e!="string"))try{const t=a().getInstance();t&&N(t.setIntegrationAttribute)&&t.setIntegrationAttribute(M,{roktSessionId:e})}catch{}}readMpSessionId(){const e=a()?.sessionManager,t=e?.getSessionId??e?.getSession;if(N(t))return t.call(e)||void 0}readMpDeviceId(){return a()?.getDeviceId?.()||void 0}attachLauncher(e,t,n=[]){tt(this._launcherAttachState,{accountId:e,launcherOptions:t||{},legacyRoktExtensions:n});const r={accountId:e,...t||{}};let s;return this.isPartnerInLocalLauncherTestGroup()?s=Promise.resolve(window.Rokt.createLocalLauncher(r)):s=window.Rokt.createLauncher(r),s.then(async o=>{await bt([...n],o),this.initRoktLauncher(o)}).catch(o=>{const c=this._launcherAttachState.lifecycle==="attached";if(rt(this._launcherAttachState),!c){const u=o instanceof Error?o.message:String(o);this.loggingService?.log({message:`Rokt Kit: Failed to attach Rokt launcher: ${u}`,code:"LAUNCHER_ATTACH_FAILED"})}console.error("Error creating Rokt launcher:",o)})}recreateLauncherIfTerminated(){return ot(this._launcherAttachState,this.isLauncherReadyToAttach(),e=>this.attachLauncher(e.accountId,e.launcherOptions,e.legacyRoktExtensions))}initRoktLauncher(e){window.Rokt&&(window.Rokt.currentLauncher=e),this.launcher=e,it(this._launcherAttachState);const t=a().Rokt?.filters;t?(this.filters=t,t.filteredUser?this._workspaceSearchInFlightPromise=this.search(t.filteredUser):console.warn("Rokt Kit: No filtered user has been set.")):console.warn("Rokt Kit: No filters have been set."),this.isInitialized=!0,Pe(this.domain,this.integrationName),a().Rokt.attachKit(this),this.flushPendingPreselectDispatches()}fetchOptimizely(){const e=a()._getActiveForwarders().filter(t=>t.name==="Optimizely");try{if(e.length>0&&window.optimizely){const t=window.optimizely.get("state");return!t||!t.getActiveExperimentIds?{}:t.getActiveExperimentIds().reduce((s,o)=>(s["rokt.custom.optimizely.experiment."+o+".variationId"]=t.getVariationMap()[o].id,s),{})}}catch(t){console.error("Error fetching Optimizely attributes:",t)}return{}}isKitReady(){return!!(this.isInitialized&&this.launcher)}isTargetingDisabled(){return a().Rokt?.launcherOptions?.noTargeting===!0}isPartnerInLocalLauncherTestGroup(){return!!(a().config&&a().config.isLocalLauncherEnabled&&this.isAssignedToSampleGroup())}isAssignedToSampleGroup(){return Math.random()>.5}captureTiming(e){window&&a()&&a().captureTiming&&e&&a().captureTiming(e)}init(e,t,n,r,s){const o=e,c=o.accountId;this.accountId=c||null,this.userAttributes=I(s),this._onboardingExpProvider=o.onboardingExpProvider;const u=x(o.placementEventMapping);this.placementEventMappingLookup=ye(u);const l=x(o.placementEventAttributeMapping);this.placementEventAttributeMappingLookup=Se(l),o.hashedEmailUserIdentityType&&(this._mappedEmailSha256Key=o.hashedEmailUserIdentityType.toLowerCase()),this._workspaceIdSyncApiKey=g(o.workspaceIdSyncApiKey)?o.workspaceIdSyncApiKey:void 0;const p=a().Rokt?.domain,{roktExtensionsQueryParams:w,legacyRoktExtensions:T,loadThankYouElement:G}=Ie(o.roktExtensions),_={...a().Rokt?.launcherOptions||{}};this.integrationName=Rt(_.integrationName),_.integrationName=this.integrationName,this.domain=p;const L={loggingUrl:o.loggingUrl,errorUrl:o.errorUrl,integrationDomain:p,isLoggingEnabled:a().config?.isLoggingEnabled===!0},R=new Re(L,this.integrationName,window.__rokt_li_guid__,o.accountId),O=new ke(L,R,this.integrationName,window.__rokt_li_guid__,o.accountId);if(this.errorReportingService=R,this.loggingService=O,this.isTargetingDisabled())try{oe(),ce()}catch(m){this.errorReportingService?.report({message:"Rokt Kit: Failed to clear page views when targeting is disabled",code:"PAGE_VIEW_CAPTURE_FAILED",severity:P.INFO,stackTrace:m instanceof Error?m.stack:void 0})}return a()._registerErrorReportingService&&a()._registerErrorReportingService(R),a()._registerLoggingService&&a()._registerLoggingService(O),n?(this.testHelpers={generateLauncherScript:pe,generateThankYouElementScript:me,extractRoktExtensionConfig:Ie,hashEventMessage:Ae,parseSettingsString:x,generateMappedEventLookup:ye,generateMappedEventAttributeLookup:Se,sendAdBlockMeasurementSignals:Pe,createAutoRemovedIframe:X,djb2:ee,setAllowedOriginHashes:m=>{E._allowedOriginHashes=m},ReportingTransport:Y,ErrorReportingService:Re,LoggingService:ke,RateLimiter:be,ErrorCodes:Q,WSDKErrorSeverity:P,resetLauncherAttachState:()=>st(this._launcherAttachState)},this.attachLauncher(c,_),"Successfully initialized: "+h):(G&&(a().Rokt.flushOnShoppableAdsReadyMessageQueue?.(this),_e(ht,me(p),{onLoad:()=>{this._isThankYouElementLoaded=!0,this._thankYouElementOnLoadCallback&&this._thankYouElementOnLoadCallback()},onError:m=>{console.error("Error loading Rokt Thank You Element script:",m)}})),this.isLauncherReadyToAttach()?this.attachLauncher(c,_,T):(_e(dt,pe(p,w),{onLoad:()=>{this.isLauncherReadyToAttach()?this.attachLauncher(c,_,T):console.error("Rokt object is not available after script load.")},onError:m=>{console.error("Error loading Rokt launcher script:",m)}}),this.captureTiming(E.PERFORMANCE_MARKS.RoktScriptAppended)),"Successfully initialized: "+h)}process(e){if(this.isTargetingDisabled()||(e.EventDataType===ft&&(Ce(this.loggingService),this.capturePageView(e),ge(this._preselectState,this.buildPreselectHost(),e)),e.EventDataType===pt&&(oe(),ce(),this.accountId&&v(this.accountId))),!this.isKitReady())return"Kit not ready for forwarder: "+h;if(N(a().Rokt?.setLocalSessionAttribute)&&(y(this.placementEventAttributeMappingLookup)||this.applyPlacementEventAttributeMapping(e),!y(this.placementEventMappingLookup))){const t=Ae(e.EventDataType,e.EventCategory,e.EventName??"");this.placementEventMappingLookup[String(t)]&&a().Rokt.setLocalSessionAttribute?.(this.placementEventMappingLookup[String(t)],!0)}return"Successfully sent to forwarder: "+h}setExtensionData(e){if(!this.isKitReady()){console.error("Rokt Kit: Not initialized");return}window.Rokt.setExtensionData(e)}setUserAttribute(e,t){return Z(e)||(this.userAttributes[e]=t),Je(this.accountId,e)&&this.flushPendingPreselectDispatches(),"Successfully set user attribute for forwarder: "+h}removeUserAttribute(e){return delete this.userAttributes[e],"Successfully removed user attribute for forwarder: "+h}handleIdentityComplete(e,t){return this.userAttributes=I(e.getAllUserAttributes()),"Successfully called "+t+" for forwarder: "+h}onUserIdentified(e){const t=e;this.filters.filteredUser=t,this._workspaceSearchInFlightPromise=this.search(t);const n=this.handleIdentityComplete(e,"onUserIdentified");return this.flushPendingPreselectDispatches(),n}search(e){const t=this._workspaceIdSyncApiKey;if(!t)return this.userIdentifiedInWorkspace=!1,this._workspaceLastSearchedIdentitiesKey=void 0,Promise.resolve();const n=a().Identity?.search;if(typeof n!="function")return this.userIdentifiedInWorkspace=!1,this._workspaceLastSearchedIdentitiesKey=void 0,Promise.resolve();const r=e.getUserIdentities?e.getUserIdentities().userIdentities:null,s={};if(r)for(const u of Object.keys(r)){const l=r[u];g(l)&&l.length>0&&(s[u]=l)}const o=Object.keys(s);if(o.length===0)return this.userIdentifiedInWorkspace=!1,this._workspaceLastSearchedIdentitiesKey=void 0,Promise.resolve();const c=o.sort().map(u=>`${u}=${s[u]}`).join("&");return c===this._workspaceLastSearchedIdentitiesKey?this._workspaceSearchInFlightPromise||Promise.resolve():(this.userIdentifiedInWorkspace=!1,this._workspaceLastSearchedIdentitiesKey=c,new Promise(u=>{try{n(t,s,l=>{l?.httpCode===200&&(this.userIdentifiedInWorkspace=!0),u()})}catch(l){console.error("Rokt Kit: Workspace IDSync search failed",l),this._workspaceLastSearchedIdentitiesKey=void 0,u()}}))}onLoginComplete(e,t){return this.handleIdentityComplete(e,"onLoginComplete")}onLogoutComplete(e,t){return this.userIdentifiedInWorkspace=!1,this._workspaceSearchInFlightPromise=null,this._workspaceLastSearchedIdentitiesKey=void 0,this.accountId&&v(this.accountId),this.handleIdentityComplete(e,"onLogoutComplete")}onModifyComplete(e,t){return this.handleIdentityComplete(e,"onModifyComplete")}selectPlacements(e){const t=this.recreateLauncherIfTerminated();if(t){const n=this._workspaceSearchInFlightPromise,r=n?Promise.race([n,new Promise(s=>setTimeout(s,fe))]):Promise.resolve();return Promise.all([t,r]).then(()=>this._dispatchPlacements(e))}if(this._workspaceSearchInFlightPromise){const n=this._workspaceSearchInFlightPromise;return Promise.race([n,new Promise(r=>setTimeout(r,fe))]).then(()=>this._dispatchPlacements(e))}return this._dispatchPlacements(e)}_dispatchPlacements(e){const t=e&&e.attributes||{},r={...I(this.userAttributes),...t},s=this.filters||{},o=s.userAttributeFilters||[],c=s.filteredUser||null,u=c?c.getMPID():null;let l;s?s.filterUserAttributes?l=s.filterUserAttributes(r,o):l=r:(console.warn("Rokt Kit: No filters available, using user attributes"),l=r),this.userAttributes=I(l);const p=this._onboardingExpProvider==="Optimizely"?this.fetchOptimizely():{},w=this.returnUserIdentities(c),T=this.returnLocalSessionAttributes(),G=Ke(se()),_=De(),L=this.readMpSessionId(),R=this.readMpDeviceId(),O={...w,...l,...p,...T,...G.length?{[mt]:JSON.stringify(G)}:{},..._?{[Et]:_}:{},...this.userIdentifiedInWorkspace?{[gt]:!0}:{},...L?{[_t]:L}:{},...R?{[It]:R}:{},mpid:u},m=this.buildCacheMatchKeys(typeof e.identifier=="string"?e.identifier:void 0),Nt={...e,attributes:O,...m!==void 0?{cacheMatchKeys:m}:{}},ve=this.launcher.selectPlacements(Nt),we=e.preselect===!0,Ut=()=>{we||this.logSelectPlacementsEvent(O)};return Promise.resolve(ve).then(Kt=>{if(!we)return Kt?.context?.sessionId?.then(Ct=>this.setRoktSessionId(Ct))}).catch(()=>{}).finally(Ut),ve}hashAttributes(e){return this.isKitReady()?this.launcher.hashAttributes(e):(console.error("Rokt Kit: Not initialized"),null)}use(e){return this.isKitReady()?!e||!g(e)?Promise.reject(new Error("Rokt Kit: Invalid extension name")):this.launcher.use(e):(console.error("Rokt Kit: Not initialized"),Promise.reject(new Error("Rokt Kit: Not initialized")))}terminate(){return this.isKitReady()?(nt(this._launcherAttachState),this.launcher.terminate()):(console.error("Rokt Kit: Not initialized"),Promise.resolve())}onShoppableAdsReady(e){this._isThankYouElementLoaded?e():this._thankYouElementOnLoadCallback=e}};E._allowedOriginHashes=[-553112570,549508659],E.PERFORMANCE_MARKS={RoktScriptAppended:"mp:RoktScriptAppended"},E.EMAIL_SHA256_KEY="emailsha256";let b=E;function Lt(){return M}function Ot(i){if(!i){window.console.log("You must pass a config object to register the kit "+h);return}if(!f(i)){window.console.log("'config' must be an object. You passed in a "+typeof i);return}f(i.kits)?i.kits[h]={constructor:b}:(i.kits={},i.kits[h]={constructor:b}),window.console.log("Successfully registered "+h+" to your mParticle configuration")}return typeof window<"u"&&window.mParticle&&a().addForwarder&&a().addForwarder({name:h,constructor:b,getId:Lt}),j.register=Ot,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}),j})({});
1
+ var RoktKit=(function(H){"use strict";const Ce=["active_time_on_site_ms","billingaddress1","billingaddress2","billingcity","billingstate","billingzipcode","cartitems","ccbin","confirmationref","conversiontype","country","couponcode","currency","language","paymentserviceprovider","paymentserviceproviderattribute","paymenttype","shippingaddress1","shippingcity","shippingcountry","shippingmethod","shippingstate","shippingzipcode","totalprice"],De=new Set(Ce);function ie(i){return De.has(i.toLowerCase())}function I(i){const e={},t=i||{},n=Object.keys(t);for(let r=0;r<n.length;r++){const s=n[r];ie(s)||(e[s]=t[s])}return e}function f(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function g(i){return typeof i=="string"}function N(i){return typeof i=="function"}function y(i){return i==null?!0:typeof i=="string"?i.length===0:typeof i=="object"?Object.keys(i).length===0:!1}function V(i){try{const e=new URL(i);return e.search="",e.toString()}catch{return i}}function ne(i){let e=5381;for(let t=0;t<i.length;t++)e=(e<<5)+e+i.charCodeAt(t),e=e&e;return e}const d="mp-rokt-kit",re="__rokt_ls_probe__";function W(){try{return window.localStorage.setItem(re,"1"),window.localStorage.removeItem(re),!0}catch{return!1}}const A=()=>window.localStorage;function z(i,e=A){try{const t=e().getItem(i);return t===null?null:JSON.parse(t)}catch{return null}}function se(i,e,t=A){try{return t().setItem(i,JSON.stringify(e)),!0}catch{return!1}}function Me(i,e=A){try{e().removeItem(i)}catch{}}function k(i,e,t=A){const n=z(i,t);return f(n)?n[e]:void 0}function K(i,e,t,n=A){const r=z(i,n),s=f(r)?{...r}:{};return s[e]=t,se(i,s,n)}function U(i,e,t=A){const n=z(i,t);if(!f(n)||!(e in n))return;const r={...n};delete r[e],Object.keys(r).length===0?Me(i,t):se(i,r,t)}const $="pageViews",C="utmParams",oe=25,Fe=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"];function ce(i){return i.slice(-oe)}function ae(){const i=k(d,$);return Array.isArray(i)?i:[]}function xe(i){const e=ce(i);for(let t=0;t<e.length;t++){const n=e.slice(t);if(K(d,$,n))return n.length}return 0}function le(){U(d,$)}function Ye(i){const e=ce(i);return e.map((t,n)=>{const r=t.activeTimeOnSite,s=r!==void 0&&Number.isFinite(r),c=e[n+1]?.activeTimeOnSite,u=c!==void 0&&Number.isFinite(c),l=s&&u?c-r:void 0;return{pageUrl:t.pageUrl,sourceMessageId:t.sourceMessageId,timestamp:t.timestamp,...t.pageTitle!==void 0?{pageTitle:t.pageTitle}:{},...t.canonicalUrl!==void 0?{canonicalUrl:t.canonicalUrl}:{},...s?{activeTimeOnSite:r}:{},...l!==void 0&&l>=0?{activeTimeOnPage:l}:{}}})}function je(i){if(k(d,C)!==void 0)return;const e=new URLSearchParams(window.location.search),t={};for(const r of Fe){const s=e.get(r);s&&(t[r]=s)}if(Object.keys(t).length===0)return;const n=Object.keys(t).join(", ");if(!K(d,C,t)){const r=W()?"quota":"ls_unavailable";i?.log({message:`Rokt Kit: Failed to persist UTM params [reason: ${r}]`,code:"UTM_CAPTURE_FAILED"});return}i?.log({message:`Rokt Kit: Captured UTM params [${n}]`,code:"UTM_CAPTURE_SUCCESS"})}function Ge(){const i=k(d,C);return f(i)?i:null}function ue(){U(d,C)}function He(){const e=document.querySelector('link[rel="canonical"]')?.href;if(e)return V(e)}const D=[{accountId:"2919171670744024290",pathname:"/checkout",targetPageIdentifier:"prod.rokt.conf",attributeKeys:["email","customertype","eventvenue","firstname","lastname","member_status","billingzipcode","currency"],optionalAttributeKeys:["firstname","lastname"]},{accountId:"2550745407543340151",pathname:"/checkout",targetPageIdentifier:"RoktExperience",attributeKeys:["email","firstname","lastname","customertype","loyaltytier","paymenttype","ccbin"],optionalAttributeKeys:["loyaltytier","paymenttype","ccbin"]},{accountId:"3236704179315511296",pathname:"/check-out/pay",targetPageIdentifier:"confirmation_page",attributeKeys:["email","firstname","lastname","loyaltytier"],optionalAttributeKeys:["firstname","lastname","loyaltytier"]},{accountId:"2192288523645376337",pathname:"/checkout/*/review",targetPageIdentifier:"ppx-ad-view-prod",attributeKeys:["email"],optionalAttributeKeys:["email"]},{accountId:"2074245483568304147",pathname:"/checkout/cart",targetPageIdentifier:"new_confirmation",attributeKeys:["email","showPlacement","post_purchase_variant"],optionalAttributeKeys:["showPlacement","post_purchase_variant"],preselectAttributeOverrides:{showPlacement:"rokt",post_purchase_variant:"treatment"}}],Ve=6e4;function We(i){return f(i)&&typeof i.expiresAt=="number"&&f(i.attributes)}function ze(i,e){return`activePreselect:${i}:${e}`}function $e(i){const e=k(d,i);return We(e)?e:null}function qe(i,e){K(d,i,{expiresAt:Date.now()+Ve,attributes:e})}const Je=5*6e4;function M(){return window.sessionStorage}function Be(i){return f(i)&&typeof i.expiresAt=="number"&&g(i.pathname)&&g(i.identifier)&&f(i.attributes)&&g(i.mpid)}function q(i){return`pendingPreselect:${i}`}function Qe(i){const e=q(i),t=k(d,e,M);return Be(t)?t.expiresAt<=Date.now()?(U(d,e,M),null):t:null}function Xe(i,e,t,n,r){return K(d,q(i),{expiresAt:Date.now()+Je,pathname:e,identifier:t,attributes:n,mpid:r},M)}function R(i){U(d,q(i),M)}function P(i,e){const t={fired:"PRESELECT_FIRED",missed:"PRESELECT_MISSED",queued:"PRESELECT_QUEUED",skipped:"PRESELECT_SKIPPED"};return{message:`Rokt Kit: preselect ${i} [reason=${e}]`,code:t[i]}}function Ze(i,e){if(!i.includes("*"))return i===e;const t=i.split("/"),n=e.split("/");return t.length!==n.length?!1:t.every((r,s)=>r==="*"?n[s]!=="":r===n[s])}const de={};function J(i){return i===de}function he(i,e){if(i)return D.find(t=>t.accountId===i&&Ze(t.pathname,e))}function B(i,e){if(!(!i||!g(e)))return D.find(t=>t.accountId===i&&t.targetPageIdentifier===e)}function ge(i,e){if(!e)return i;const t=new Set(Object.keys(e).map(r=>r.toLowerCase())),n={};for(const[r,s]of Object.entries(i))t.has(r.toLowerCase())||(n[r]=s);return{...n,...e}}function et(i){const e=Object.keys(i.preselectAttributeOverrides??{});return[...i.attributeKeys,...e.filter(t=>!i.attributeKeys.includes(t))]}function tt(i){return i?D.some(e=>e.accountId===i):!1}function it(i,e,t=window.location.pathname){i.pending.some(n=>n.pathname===t&&!J(n.event))||Z(i,e,de,t)}function nt(i,e){return i?D.some(t=>t.accountId===i&&t.attributeKeys.includes(e)):!1}function rt(){return{pending:[]}}function Q(i,e){const t=i.pending.findIndex(n=>n.pathname===e.pathname);if(t>=0){if(J(e.event)&&!J(i.pending[t].event))return;i.pending[t]=e;return}i.pending.push(e)}function X(i){if(!i?.getUserIdentities)return!1;const e=i.getUserIdentities().userIdentities;return e?Object.keys(e).some(t=>{const n=e[t];return g(n)&&n.length>0}):!1}function fe(i){const e=i?.getMPID?.();return e==null?null:String(e)}function pe(i,e){const t=new Set((i.optionalAttributeKeys??[]).map(n=>n.toLowerCase()));return i.attributeKeys.filter(n=>!t.has(n.toLowerCase())&&y(e[n]))}function me(i,e,t){const n=i.filteredUser?.getAllUserAttributes?.()||{},r={};for(const s of t.attributeKeys){const o=i.getEventAttributeValue(e,s),c=y(o)?i.userAttributes[s]??n[s]:o;y(c)||(r[s]=c)}return{collected:r,missingKeys:pe(t,r)}}function st(i,e){Promise.resolve(i.selectPlacements(e)).catch(t=>{const n=t instanceof Error?t.message:String(t);i.log({message:`Rokt Kit: Preselect selectPlacements call failed: ${n}`,code:"PRESELECT_DISPATCH_FAILED"})})}function Ee(i,e,t,n,r,s){const o=ze(e,t),c=$e(o),u=ge(r,B(e,n)?.preselectAttributeOverrides),l=!!c&&JSON.stringify(c.attributes)===JSON.stringify(u);if(c&&c.expiresAt>Date.now()&&l){i.logPlacementDiagnostic(P("skipped","active_preselection"));return}qe(o,u),i.logPlacementDiagnostic(P("fired",s)),st(i,{attributes:r,preselect:!0,identifier:n,omitUrl:!0})}function ot(i,e){if(!e.accountId||!e.isKitReady())return;const t=Qe(e.accountId);if(!t)return;if(i.pending.some(o=>o.pathname===t.pathname)){R(e.accountId);return}if(!e.isPreselectionEnabled()){R(e.accountId);return}if(!X(e.filteredUser)||(R(e.accountId),fe(e.filteredUser)!==t.mpid))return;const n=he(e.accountId,t.pathname);if(!n||n.targetPageIdentifier!==t.identifier)return;const r=I(t.attributes),s=pe(n,r);if(s.length>0){for(const o of s)e.logPlacementDiagnostic(P("missed",`missing_persisted_attribute:${o}`));return}Ee(e,e.accountId,t.identifier,t.identifier,r,"recovered")}function Z(i,e,t,n=window.location.pathname){const r=he(e.accountId,n);if(!r)return;if(!e.isKitReady()){const c=[],u=fe(e.filteredUser);if(e.accountId&&u&&X(e.filteredUser)){const{collected:l,missingKeys:p}=me(e,t,r);if(p.length===0){const w=I(l);Xe(e.accountId,n,r.targetPageIdentifier,w,u)||c.push(P("queued","persist_failed"))}}Q(i,{event:t,pathname:n,storedDiagnostics:c});return}if(!e.isPreselectionEnabled())return;if(!X(e.filteredUser)){e.logPlacementDiagnostic(P("missed","no_valid_identity")),Q(i,{event:t,pathname:n});return}const{collected:s,missingKeys:o}=me(e,t,r);if(o.length>0){for(const c of o)e.logPlacementDiagnostic(P("missed",`missing_attribute:${c}`));Q(i,{event:t,pathname:n});return}Ee(e,e.accountId||"",n,r.targetPageIdentifier,s,"fired")}function ct(i,e,t=window.location.pathname){if(ot(i,e),i.pending.length===0)return;const n=i.pending;i.pending=[],n.forEach(({event:r,pathname:s,storedDiagnostics:o})=>{s===t&&(e.isKitReady()&&e.isPreselectionEnabled()&&o?.forEach(c=>e.logPlacementDiagnostic(c)),Z(i,e,r,s))})}function at(){return{context:null,lifecycle:"idle",recreateInFlight:null}}function lt(i,e){i.context={accountId:e.accountId,launcherOptions:{...e.launcherOptions},legacyRoktExtensions:[...e.legacyRoktExtensions]}}function ut(i){i.lifecycle="attached"}function dt(i){i.lifecycle!=="idle"&&(i.lifecycle="terminated")}function ht(i){i.lifecycle="terminated"}function gt(i){i.context=null,i.lifecycle="idle",i.recreateInFlight=null}function ft(i,e,t){if(i.recreateInFlight)return i.recreateInFlight;if(i.lifecycle!=="terminated"||!i.context||!e)return;i.lifecycle="recreating";const n=i.context;return i.recreateInFlight=t(n).finally(()=>{i.recreateInFlight=null}),i.recreateInFlight}const h="Rokt",F=181,pt="selectPlacements",mt="apps.roktecommerce.com",Et=.1,_t="ThankYouPageJourney",It="rokt-launcher",yt="rokt-thank-you-element",At="userIdentifiedInWorkspace",Pt=3,bt=2,St="page_events",vt="page_view_attributes",kt="mparticle_session_id",Rt="mparticle_device_id",_e=500,ee={UNKNOWN_ERROR:"UNKNOWN_ERROR",UNHANDLED_EXCEPTION:"UNHANDLED_EXCEPTION",IDENTITY_REQUEST:"IDENTITY_REQUEST",LOG_DELIVERY_FAILURE:"LOG_DELIVERY_FAILURE"},b={ERROR:"ERROR",INFO:"INFO",WARNING:"WARNING"},wt="apps.rokt-api.com",Tt="/v1/log",Lt="/v1/errors",Ot=10;function a(){return window.mParticle}function Ie(i,e){const n=[x(i),"/wsdk/integrations/launcher.js"].join("");return!e||e.length===0?n:n+"?extensions="+e.join(",")}function ye(i){return[x(i),"/rokt-elements/rokt-element-thank-you.js"].join("")}function x(i){const e=i!==void 0?i:wt;return e.includes("://")?e.replace(/\/+$/,""):["https://",e].join("")}function Ae(i,e,t){if(i)return i.startsWith("http://")||i.startsWith("https://")?i:"https://"+i;const r=e?.includes("://")&&!/^https?:\/\//i.test(e)?void 0:e;return x(r)+t}function Pe(i,e,t){if(document.getElementById(i))return;const n=document.head||document.body,r=document.createElement("script");r.id=i,r.type="text/javascript",r.src=e,r.async=!0,r.crossOrigin="anonymous",r.fetchPriority="high",t?.onLoad&&(r.onload=t.onLoad),t?.onError&&(r.onerror=t.onError),n.appendChild(r)}function Y(i){if(!i)return[];try{return JSON.parse(i.replace(/&quot;/g,'"'))}catch{console.error("Settings string contains invalid JSON")}return[]}function be(i){const e=i?Y(i):[],t=[],n=[];let r=!1;for(let s=0;s<e.length;s++){const o=e[s].value;o==="thank-you-journey"?(r=!0,n.push(_t)):t.push(o)}return{roktExtensionsQueryParams:t,legacyRoktExtensions:n,loadThankYouElement:r}}async function Nt(i,e){const t=[];if(e)for(const n of i)t.push(e.use(n));return Promise.all(t)}function Se(i){if(!i)return{};const e={};for(let t=0;t<i.length;t++){const n=i[t];e[n.jsmap]=n.value}return e}function ve(i){const e={};if(!Array.isArray(i))return e;for(let t=0;t<i.length;t++){const n=i[t];if(!n||!g(n.value)||!g(n.map))continue;const r=n.value,s=n.map;e[r]||(e[r]=[]),e[r].push({eventAttributeKey:s,conditions:Array.isArray(n.conditions)?n.conditions:[]})}return e}function ke(i,e,t){return a().generateHash([i,e,t].join(""))}function Kt(i){let n="mParticle_wsdkv_"+a().getVersion()+"_kitv_"+"3.9.0";return i&&(n+="_"+i),n}function te(i){const e=document.createElement("iframe");e.style.display="none",e.setAttribute("sandbox","allow-scripts allow-same-origin"),e.src=i,e.onload=function(){e.onload=null,e.parentNode&&e.parentNode.removeChild(e)};const t=document.body||document.head;t&&t.appendChild(e)}function Re(i,e){const t=ne(window.location.origin);if(S._allowedOriginHashes.indexOf(t)===-1||Math.random()>=Et)return;const r=window.__rokt_li_guid__;if(!r||i&&i.includes("://")&&!/^https:\/\//i.test(i))return;const s=window.location.href.split("?")[0].split("#")[0],o="version="+encodeURIComponent(e??"")+"&launcherInstanceGuid="+encodeURIComponent(r)+"&pageUrl="+encodeURIComponent(s),c=i?x(i):"https://apps.rokt.com";te(c+"/v1/wsdk-init/index.html?"+o),te("https://"+mt+"/v1/wsdk-init/index.html?"+o+"&isControl=true")}function Ut(){return typeof window<"u"&&!!window.location?.search?.toLowerCase().includes("mp_enable_logging=true")}function Ct(){return typeof window<"u"?window.location?.href:void 0}function Dt(){return typeof window<"u"?window.navigator?.userAgent:void 0}class we{constructor(){this._logCount={}}incrementAndCheck(e){const n=(this._logCount[e]||0)+1;return this._logCount[e]=n,n>Ot}}class j{constructor(e,t,n,r,s){this._reporter="mp-wsdk";const o=e.isLoggingEnabled;this._integrationName=t||"",this._launcherInstanceGuid=n,this._accountId=r||null,this._rateLimiter=s||new we,this._isEnabled=Ut()||o}send(e,t,n,r,s,o){if(!(!this._isEnabled||this._rateLimiter.incrementAndCheck(t)))try{const c={additionalInformation:{message:n,version:this._integrationName},severity:t,code:r||ee.UNKNOWN_ERROR,url:Ct(),deviceInfo:Dt(),stackTrace:s,reporter:this._reporter,integration:this._integrationName},u={Accept:"text/plain;charset=UTF-8","Content-Type":"application/json","rokt-launcher-version":this._integrationName,"rokt-wsdk-version":"joint"};this._launcherInstanceGuid&&(u["rokt-launcher-instance-guid"]=this._launcherInstanceGuid),this._accountId&&(u["rokt-account-id"]=this._accountId),fetch(e,{method:"POST",headers:u,body:JSON.stringify(c)}).then(l=>{if(!l.ok){const p=new Error("HTTP "+l.status+" from log endpoint");throw p.statusCode=l.status,p}}).catch(l=>{console.error("ReportingTransport: Failed to send log",l),o&&o(l)})}catch(c){console.error("ReportingTransport: Failed to send log",c),o&&o(c)}}}class Te{constructor(e,t,n,r,s){this._transport=new j(e,t,n,r,s),this._errorUrl=Ae(e?.errorUrl,e?.integrationDomain,Lt)}report(e){if(!e)return;const t=e.severity||b.ERROR;this._transport.send(this._errorUrl,t,e.message,e.code,e.stackTrace)}}class Le{constructor(e,t,n,r,s,o){this._transport=new j(e,n,r,s,o),this._placementDiagnosticTransport=new j(e,n,r,s),this._loggingUrl=Ae(e?.loggingUrl,e?.integrationDomain,Tt),this._errorReportingService=t}log(e){e&&this._send(this._transport,e)}logPlacementDiagnostic(e){e&&this._send(this._placementDiagnosticTransport,e)}_send(e,t){e.send(this._loggingUrl,b.INFO,t.message,t.code,void 0,n=>{if(this._errorReportingService){const r=typeof n.statusCode=="number";this._errorReportingService.report({message:"LoggingService: Failed to send log: "+n.message,code:ee.LOG_DELIVERY_FAILURE,severity:r?b.ERROR:b.WARNING})}})}}function Mt(i){const e=V(window.location.href),t=i.EventAttributes?.title||document.title,n=He(),r=i.ActiveTimeOnSite;return{pageUrl:e,sourceMessageId:i.SourceMessageId,timestamp:i.Timestamp,...t?{pageTitle:t}:{},...n!==void 0?{canonicalUrl:n}:{},...Number.isFinite(r)?{activeTimeOnSite:r}:{}}}const E=class E{constructor(){this.name=h,this.id=F,this.moduleId=F,this.isInitialized=!1,this.launcher=null,this.filters={},this.userAttributes={},this.userIdentifiedInWorkspace=!1,this.testHelpers=null,this.placementEventMappingLookup={},this.placementEventAttributeMappingLookup={},this.integrationName=null,this.errorReportingService=null,this.loggingService=null,this._thankYouElementOnLoadCallback=null,this._isThankYouElementLoaded=!1,this._workspaceSearchInFlightPromise=null,this._launcherAttachState=at(),this.accountId=null,this._preselectState=rt()}getEventAttributeValue(e,t){const n=e&&e.EventAttributes;return!n||n[t]===void 0?null:n[t]}doesEventAttributeConditionMatch(e,t){if(!e||!g(e.operator))return!1;const n=e.operator.toLowerCase(),r=e.attributeValue;return n==="exists"?t!==null:t==null?!1:n==="equals"?String(t)===String(r):n==="contains"?String(t).indexOf(String(r))!==-1:!1}doesEventMatchRule(e,t){if(!t||!g(t.eventAttributeKey))return!1;const n=t.conditions;if(!Array.isArray(n))return!1;const r=this.getEventAttributeValue(e,t.eventAttributeKey);if(n.length===0)return r!==null;for(let s=0;s<n.length;s++)if(!this.doesEventAttributeConditionMatch(n[s],r))return!1;return!0}applyPlacementEventAttributeMapping(e){const t=Object.keys(this.placementEventAttributeMappingLookup);for(let n=0;n<t.length;n++){const r=t[n],s=this.placementEventAttributeMappingLookup[r];if(y(s))continue;let o=!0;for(let c=0;c<s.length;c++)if(!this.doesEventMatchRule(e,s[c])){o=!1;break}o&&a().Rokt.setLocalSessionAttribute?.(r,!0)}}capturePageView(e){let t;try{t=V(window.location.href);const n=ae(),r=Mt(e);n.push(r);const s=Math.min(n.length,oe),o=xe(n);if(o===0){const c=W()?"quota":"ls_unavailable";this.loggingService?.log({message:`Rokt Kit: Failed to persist page view for ${t} [reason: ${c}]`,code:"PAGE_VIEW_CAPTURE_FAILED"})}else o<s&&this.loggingService?.log({message:`Rokt Kit: Page view storage reduced from ${s} to ${o} record(s) under quota pressure [reason: quota_eviction]`,code:"PAGE_VIEW_QUOTA_EVICTION"})}catch(n){const r=W()?"exception":"ls_unavailable",s=n instanceof Error?n.message:String(n);this.loggingService?.log({message:`Rokt Kit: Failed to capture page view for ${t}: ${s} [reason: ${r}]`,code:"PAGE_VIEW_CAPTURE_FAILED"})}}isPreselectionEnabled(){return this.launcher?.enablePreselection===!0}buildCacheMatchKeys(e){if(!this.isPreselectionEnabled())return;const t=B(this.accountId,e);if(t)return et(t)}buildPreselectAttributeOverrides(e){if(!this.isPreselectionEnabled())return;const t=B(this.accountId,e)?.preselectAttributeOverrides,n=this.filters||{};if(!t||!n.filterUserAttributes)return t;const r=n.userAttributeFilters||[];return n.filterUserAttributes(t,r)}buildPreselectHost(){return{accountId:this.accountId,filteredUser:this.filters.filteredUser,userAttributes:this.userAttributes,isKitReady:()=>this.isKitReady(),isPreselectionEnabled:()=>this.isPreselectionEnabled(),getEventAttributeValue:(e,t)=>this.getEventAttributeValue(e,t),logPlacementDiagnostic:e=>this.loggingService?.logPlacementDiagnostic(e),log:e=>this.loggingService?.log(e),selectPlacements:e=>this.selectPlacements(e)}}flushPendingPreselectDispatches(){ct(this._preselectState,this.buildPreselectHost())}isLauncherReadyToAttach(){return!!window.Rokt&&N(window.Rokt.createLauncher)}returnUserIdentities(e){if(!e||!e.getUserIdentities)return{};const t=e.getUserIdentities().userIdentities;return this.replaceOtherIdentityWithEmailsha256(t)}returnLocalSessionAttributes(){return!a().Rokt||typeof a().Rokt.getLocalSessionAttributes!="function"?{}:a().Rokt.getLocalSessionAttributes()}replaceOtherIdentityWithEmailsha256(e){const t={...e||{}},n=this._mappedEmailSha256Key;return n&&e[n]&&(t[E.EMAIL_SHA256_KEY]=e[n]),n&&delete t[n],t}logSelectPlacementsEvent(e){if(!window.mParticle||typeof a().logEvent!="function"||!f(e))return;const t=a().EventType.Other;a().logEvent(pt,t,e)}setRoktSessionId(e){if(!(!e||typeof e!="string"))try{const t=a().getInstance();t&&N(t.setIntegrationAttribute)&&t.setIntegrationAttribute(F,{roktSessionId:e})}catch{}}readMpSessionId(){const e=a()?.sessionManager,t=e?.getSessionId??e?.getSession;if(N(t))return t.call(e)||void 0}readMpDeviceId(){return a()?.getDeviceId?.()||void 0}attachLauncher(e,t,n=[]){lt(this._launcherAttachState,{accountId:e,launcherOptions:t||{},legacyRoktExtensions:n});const r={accountId:e,...t||{}};let s;return this.isPartnerInLocalLauncherTestGroup()?s=Promise.resolve(window.Rokt.createLocalLauncher(r)):s=window.Rokt.createLauncher(r),s.then(async o=>{await Nt([...n],o),this.initRoktLauncher(o)}).catch(o=>{const c=this._launcherAttachState.lifecycle==="attached";if(ht(this._launcherAttachState),!c){const u=o instanceof Error?o.message:String(o);this.loggingService?.log({message:`Rokt Kit: Failed to attach Rokt launcher: ${u}`,code:"LAUNCHER_ATTACH_FAILED"})}console.error("Error creating Rokt launcher:",o)})}recreateLauncherIfTerminated(){return ft(this._launcherAttachState,this.isLauncherReadyToAttach(),e=>this.attachLauncher(e.accountId,e.launcherOptions,e.legacyRoktExtensions))}initRoktLauncher(e){window.Rokt&&(window.Rokt.currentLauncher=e),this.launcher=e,ut(this._launcherAttachState);const t=a().Rokt?.filters;t?(this.filters=t,t.filteredUser?this._workspaceSearchInFlightPromise=this.search(t.filteredUser):console.warn("Rokt Kit: No filtered user has been set.")):console.warn("Rokt Kit: No filters have been set."),this.isInitialized=!0,Re(this.domain,this.integrationName),a().Rokt.attachKit(this),this.flushPendingPreselectDispatches()}armPreselectPathnameTrigger(){this.onRouteChange=tt(this.accountId)?()=>this.evaluatePreselectPathname():void 0}evaluatePreselectPathname(){const e=window.location.pathname;e!==this._lastPreselectPathname&&(this.isTargetingDisabled()||(this._lastPreselectPathname=e,it(this._preselectState,this.buildPreselectHost(),e)))}fetchOptimizely(){const e=a()._getActiveForwarders().filter(t=>t.name==="Optimizely");try{if(e.length>0&&window.optimizely){const t=window.optimizely.get("state");return!t||!t.getActiveExperimentIds?{}:t.getActiveExperimentIds().reduce((s,o)=>(s["rokt.custom.optimizely.experiment."+o+".variationId"]=t.getVariationMap()[o].id,s),{})}}catch(t){console.error("Error fetching Optimizely attributes:",t)}return{}}isKitReady(){return!!(this.isInitialized&&this.launcher)}isTargetingDisabled(){return a().Rokt?.launcherOptions?.noTargeting===!0}isPartnerInLocalLauncherTestGroup(){return!!(a().config&&a().config.isLocalLauncherEnabled&&this.isAssignedToSampleGroup())}isAssignedToSampleGroup(){return Math.random()>.5}captureTiming(e){window&&a()&&a().captureTiming&&e&&a().captureTiming(e)}init(e,t,n,r,s){const o=e,c=o.accountId;this.accountId=c||null,this.userAttributes=I(s),this.armPreselectPathnameTrigger(),this._onboardingExpProvider=o.onboardingExpProvider;const u=Y(o.placementEventMapping);this.placementEventMappingLookup=Se(u);const l=Y(o.placementEventAttributeMapping);this.placementEventAttributeMappingLookup=ve(l),o.hashedEmailUserIdentityType&&(this._mappedEmailSha256Key=o.hashedEmailUserIdentityType.toLowerCase()),this._workspaceIdSyncApiKey=g(o.workspaceIdSyncApiKey)?o.workspaceIdSyncApiKey:void 0;const p=a().Rokt?.domain,{roktExtensionsQueryParams:w,legacyRoktExtensions:T,loadThankYouElement:G}=be(o.roktExtensions),_={...a().Rokt?.launcherOptions||{}};this.integrationName=Kt(_.integrationName),_.integrationName=this.integrationName,this.domain=p;const L={loggingUrl:o.loggingUrl,errorUrl:o.errorUrl,integrationDomain:p,isLoggingEnabled:a().config?.isLoggingEnabled===!0},v=new Te(L,this.integrationName,window.__rokt_li_guid__,o.accountId),O=new Le(L,v,this.integrationName,window.__rokt_li_guid__,o.accountId);if(this.errorReportingService=v,this.loggingService=O,this.isTargetingDisabled())try{le(),ue()}catch(m){this.errorReportingService?.report({message:"Rokt Kit: Failed to clear page views when targeting is disabled",code:"PAGE_VIEW_CAPTURE_FAILED",severity:b.INFO,stackTrace:m instanceof Error?m.stack:void 0})}return a()._registerErrorReportingService&&a()._registerErrorReportingService(v),a()._registerLoggingService&&a()._registerLoggingService(O),n?(this.testHelpers={generateLauncherScript:Ie,generateThankYouElementScript:ye,extractRoktExtensionConfig:be,hashEventMessage:ke,parseSettingsString:Y,generateMappedEventLookup:Se,generateMappedEventAttributeLookup:ve,sendAdBlockMeasurementSignals:Re,createAutoRemovedIframe:te,djb2:ne,setAllowedOriginHashes:m=>{E._allowedOriginHashes=m},ReportingTransport:j,ErrorReportingService:Te,LoggingService:Le,RateLimiter:we,ErrorCodes:ee,WSDKErrorSeverity:b,resetLauncherAttachState:()=>gt(this._launcherAttachState)},this.attachLauncher(c,_),"Successfully initialized: "+h):(G&&(a().Rokt.flushOnShoppableAdsReadyMessageQueue?.(this),Pe(yt,ye(p),{onLoad:()=>{this._isThankYouElementLoaded=!0,this._thankYouElementOnLoadCallback&&this._thankYouElementOnLoadCallback()},onError:m=>{console.error("Error loading Rokt Thank You Element script:",m)}})),this.isLauncherReadyToAttach()?this.attachLauncher(c,_,T):(Pe(It,Ie(p,w),{onLoad:()=>{this.isLauncherReadyToAttach()?this.attachLauncher(c,_,T):console.error("Rokt object is not available after script load.")},onError:m=>{console.error("Error loading Rokt launcher script:",m)}}),this.captureTiming(E.PERFORMANCE_MARKS.RoktScriptAppended)),"Successfully initialized: "+h)}process(e){if(this.isTargetingDisabled()||(e.EventDataType===Pt&&(je(this.loggingService),this.capturePageView(e),Z(this._preselectState,this.buildPreselectHost(),e)),e.EventDataType===bt&&(le(),ue(),this.accountId&&R(this.accountId))),!this.isKitReady())return"Kit not ready for forwarder: "+h;if(N(a().Rokt?.setLocalSessionAttribute)&&(y(this.placementEventAttributeMappingLookup)||this.applyPlacementEventAttributeMapping(e),!y(this.placementEventMappingLookup))){const t=ke(e.EventDataType,e.EventCategory,e.EventName??"");this.placementEventMappingLookup[String(t)]&&a().Rokt.setLocalSessionAttribute?.(this.placementEventMappingLookup[String(t)],!0)}return"Successfully sent to forwarder: "+h}setExtensionData(e){if(!this.isKitReady()){console.error("Rokt Kit: Not initialized");return}window.Rokt.setExtensionData(e)}setUserAttribute(e,t){return ie(e)||(this.userAttributes[e]=t),nt(this.accountId,e)&&this.flushPendingPreselectDispatches(),"Successfully set user attribute for forwarder: "+h}removeUserAttribute(e){return delete this.userAttributes[e],"Successfully removed user attribute for forwarder: "+h}handleIdentityComplete(e,t){return this.userAttributes=I(e.getAllUserAttributes()),"Successfully called "+t+" for forwarder: "+h}onUserIdentified(e){const t=e;this.filters.filteredUser=t,this._workspaceSearchInFlightPromise=this.search(t);const n=this.handleIdentityComplete(e,"onUserIdentified");return this.flushPendingPreselectDispatches(),n}search(e){const t=this._workspaceIdSyncApiKey;if(!t)return this.userIdentifiedInWorkspace=!1,this._workspaceLastSearchedIdentitiesKey=void 0,Promise.resolve();const n=a().Identity?.search;if(typeof n!="function")return this.userIdentifiedInWorkspace=!1,this._workspaceLastSearchedIdentitiesKey=void 0,Promise.resolve();const r=e.getUserIdentities?e.getUserIdentities().userIdentities:null,s={};if(r)for(const u of Object.keys(r)){const l=r[u];g(l)&&l.length>0&&(s[u]=l)}const o=Object.keys(s);if(o.length===0)return this.userIdentifiedInWorkspace=!1,this._workspaceLastSearchedIdentitiesKey=void 0,Promise.resolve();const c=o.sort().map(u=>`${u}=${s[u]}`).join("&");return c===this._workspaceLastSearchedIdentitiesKey?this._workspaceSearchInFlightPromise||Promise.resolve():(this.userIdentifiedInWorkspace=!1,this._workspaceLastSearchedIdentitiesKey=c,new Promise(u=>{try{n(t,s,l=>{l?.httpCode===200&&(this.userIdentifiedInWorkspace=!0),u()})}catch(l){console.error("Rokt Kit: Workspace IDSync search failed",l),this._workspaceLastSearchedIdentitiesKey=void 0,u()}}))}onLoginComplete(e,t){return this.handleIdentityComplete(e,"onLoginComplete")}onLogoutComplete(e,t){return this.userIdentifiedInWorkspace=!1,this._workspaceSearchInFlightPromise=null,this._workspaceLastSearchedIdentitiesKey=void 0,this.accountId&&R(this.accountId),this.handleIdentityComplete(e,"onLogoutComplete")}onModifyComplete(e,t){return this.handleIdentityComplete(e,"onModifyComplete")}selectPlacements(e){const t=this.recreateLauncherIfTerminated();if(t){const n=this._workspaceSearchInFlightPromise,r=n?Promise.race([n,new Promise(s=>setTimeout(s,_e))]):Promise.resolve();return Promise.all([t,r]).then(()=>this._dispatchPlacements(e))}if(this._workspaceSearchInFlightPromise){const n=this._workspaceSearchInFlightPromise;return Promise.race([n,new Promise(r=>setTimeout(r,_e))]).then(()=>this._dispatchPlacements(e))}return this._dispatchPlacements(e)}_dispatchPlacements(e){const t=e&&e.attributes||{},r={...I(this.userAttributes),...t},s=this.filters||{},o=s.userAttributeFilters||[],c=s.filteredUser||null,u=c?c.getMPID():null;let l;s?s.filterUserAttributes?l=s.filterUserAttributes(r,o):l=r:(console.warn("Rokt Kit: No filters available, using user attributes"),l=r),this.userAttributes=I(l);const p=this._onboardingExpProvider==="Optimizely"?this.fetchOptimizely():{},w=this.returnUserIdentities(c),T=this.returnLocalSessionAttributes(),G=Ye(ae()),_=Ge(),L=this.readMpSessionId(),v=this.readMpDeviceId(),O=typeof e.identifier=="string"?e.identifier:void 0,m=e.preselect===!0?ge(l,this.buildPreselectAttributeOverrides(O)):l,Oe={...w,...m,...p,...T,...G.length?{[St]:JSON.stringify(G)}:{},..._?{[vt]:_}:{},...this.userIdentifiedInWorkspace?{[At]:!0}:{},...L?{[kt]:L}:{},...v?{[Rt]:v}:{},mpid:u},Ne=this.buildCacheMatchKeys(O),Yt={...e,attributes:Oe,...Ne!==void 0?{cacheMatchKeys:Ne}:{}},Ke=this.launcher.selectPlacements(Yt),Ue=e.preselect===!0,jt=()=>{Ue||this.logSelectPlacementsEvent(Oe)};return Promise.resolve(Ke).then(Gt=>{if(!Ue)return Gt?.context?.sessionId?.then(Ht=>this.setRoktSessionId(Ht))}).catch(()=>{}).finally(jt),Ke}hashAttributes(e){return this.isKitReady()?this.launcher.hashAttributes(e):(console.error("Rokt Kit: Not initialized"),null)}use(e){return this.isKitReady()?!e||!g(e)?Promise.reject(new Error("Rokt Kit: Invalid extension name")):this.launcher.use(e):(console.error("Rokt Kit: Not initialized"),Promise.reject(new Error("Rokt Kit: Not initialized")))}terminate(){return this.isKitReady()?(dt(this._launcherAttachState),this.launcher.terminate()):(console.error("Rokt Kit: Not initialized"),Promise.resolve())}onShoppableAdsReady(e){this._isThankYouElementLoaded?e():this._thankYouElementOnLoadCallback=e}};E._allowedOriginHashes=[-553112570,549508659],E.PERFORMANCE_MARKS={RoktScriptAppended:"mp:RoktScriptAppended"},E.EMAIL_SHA256_KEY="emailsha256";let S=E;function Ft(){return F}function xt(i){if(!i){window.console.log("You must pass a config object to register the kit "+h);return}if(!f(i)){window.console.log("'config' must be an object. You passed in a "+typeof i);return}f(i.kits)?i.kits[h]={constructor:S}:(i.kits={},i.kits[h]={constructor:S}),window.console.log("Successfully registered "+h+" to your mParticle configuration")}return typeof window<"u"&&window.mParticle&&a().addForwarder&&a().addForwarder({name:h,constructor:S,getId:Ft}),H.register=xt,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"}),H})({});
2
2
  //# sourceMappingURL=Rokt-Kit.iife.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mparticle/web-rokt-kit",
3
- "version": "3.8.1",
3
+ "version": "3.9.0",
4
4
  "description": "mParticle integration kit for Rokt",
5
5
  "main": "dist/Rokt-Kit.common.js",
6
6
  "module": "dist/Rokt-Kit.esm.js",