rudder-sdk-js 2.52.23 → 2.53.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.
package/dist/npm/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).rudderanalytics={})}(this,function(e){"use strict";function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t.apply(null,arguments)}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function s(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&1===Object.keys(e).length?e.default:e}var i,o={exports:{}};function a(){return i||(i=1,function(e){function n(e){if(e)return function(e){return t(e,n.prototype),e._callbacks=new Map,e}(e);this._callbacks=new Map}n.prototype.on=function(e,t){const n=this._callbacks.get(e)??[];return n.push(t),this._callbacks.set(e,n),this},n.prototype.once=function(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.fn=t,this.on(e,n),this},n.prototype.off=function(e,t){if(void 0===e&&void 0===t)return this._callbacks.clear(),this;if(void 0===t)return this._callbacks.delete(e),this;const n=this._callbacks.get(e);if(n){for(const[e,r]of n.entries())if(r===t||r.fn===t){n.splice(e,1);break}0===n.length?this._callbacks.delete(e):this._callbacks.set(e,n)}return this},n.prototype.emit=function(e,...t){const n=this._callbacks.get(e);if(n){const e=[...n];for(const n of e)n.apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks.get(e)??[]},n.prototype.listenerCount=function(e){if(e)return this.listeners(e).length;let t=0;for(const e of this._callbacks.values())t+=e.length;return t},n.prototype.hasListeners=function(e){return this.listenerCount(e)>0},n.prototype.addEventListener=n.prototype.on,n.prototype.removeListener=n.prototype.off,n.prototype.removeEventListener=n.prototype.off,n.prototype.removeAllListeners=n.prototype.off,e.exports=n}(o)),o.exports}var c=r(a());function u(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function l(e){return function t(n){return 0===arguments.length||u(n)?t:e.apply(this,arguments)}}function h(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return u(n)?t:l(function(t){return e(n,t)});default:return u(n)&&u(r)?t:u(n)?l(function(t){return e(t,r)}):u(r)?l(function(t){return e(n,t)}):e(n,r)}}}function d(e){return function t(n,r,s){switch(arguments.length){case 0:return t;case 1:return u(n)?t:h(function(t,r){return e(n,t,r)});case 2:return u(n)&&u(r)?t:u(n)?h(function(t,n){return e(t,r,n)}):u(r)?h(function(t,r){return e(n,t,r)}):l(function(t){return e(n,r,t)});default:return u(n)&&u(r)&&u(s)?t:u(n)&&u(r)?h(function(t,n){return e(t,n,s)}):u(n)&&u(s)?h(function(t,n){return e(t,r,n)}):u(r)&&u(s)?h(function(t,r){return e(n,t,r)}):u(n)?l(function(t){return e(t,r,s)}):u(r)?l(function(t){return e(n,t,s)}):u(s)?l(function(t){return e(n,r,t)}):e(n,r,s)}}}function f(e,t){return Object.prototype.hasOwnProperty.call(t,e)}var p=l(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function g(e){return"[object Object]"===Object.prototype.toString.call(e)}function y(e,t,n){if(n||(n=new m),function(e){var t=typeof e;return null==e||"object"!=t&&"function"!=t}(e))return e;var r,s=function(t){var r=n.get(e);if(r)return r;for(var s in n.set(e,t),e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=y(e[s],!0,n));return t};switch(p(e)){case"Object":return s(Object.create(Object.getPrototypeOf(e)));case"Array":return s(Array(e.length));case"Date":return new Date(e.valueOf());case"RegExp":return r=e,new RegExp(r.source,r.flags?r.flags:(r.global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.sticky?"y":"")+(r.unicode?"u":"")+(r.dotAll?"s":""));case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return e.slice();default:return e}}var m=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){var n=this.hash(e),r=this.map[n];r||(this.map[n]=r=[]),r.push([e,t]),this.length+=1},e.prototype.hash=function(e){var t=[];for(var n in e)t.push(Object.prototype.toString.call(e[n]));return t.join()},e.prototype.get=function(e){if(this.length<=180)for(var t in this.map)for(var n=this.map[t],r=0;r<n.length;r+=1){if((i=n[r])[0]===e)return i[1]}else{var s=this.hash(e);if(n=this.map[s])for(r=0;r<n.length;r+=1){var i;if((i=n[r])[0]===e)return i[1]}}},e}(),v=l(function(e){return null!=e&&"function"==typeof e.clone?e.clone():y(e)}),I=d(function(e,t,n){var r,s={};for(r in n=n||{},t=t||{})f(r,t)&&(s[r]=f(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)f(r,n)&&!f(r,s)&&(s[r]=n[r]);return s}),A=d(function e(t,n,r){return I(function(n,r,s){return g(r)&&g(s)?e(t,r,s):t(n,r,s)},n,r)}),b=d(function(e,t,n){return A(function(t,n,r){return e(n,r)},t,n)});const E={HS:"HubSpot",GA:"GA",HOTJAR:"Hotjar",GOOGLEADS:"GoogleAds",VWO:"VWO",GTM:"GoogleTagManager",BRAZE:"Braze",INTERCOM:"INTERCOM",KEEN:"Keen",KISSMETRICS:"Kissmetrics",CUSTOMERIO:"CustomerIO",CHARTBEAT:"Chartbeat",FACEBOOK_PIXEL:"FacebookPixel",LOTAME:"Lotame",OPTIMIZELY:"Optimizely",BUGSNAG:"Bugsnag",FULLSTORY:"Fullstory",TVSQUARED:"TVSquared",GA4:"GA4",GA4_V2:"GA4_V2",MOENGAGE:"MoEngage",AM:"Amplitude",PENDO:"Pendo",LYTICS:"Lytics",APPCUES:"Appcues",POSTHOG:"Posthog",KLAVIYO:"Klaviyo",CLEVERTAP:"Clevertap",BINGADS:"BingAds",PINTEREST_TAG:"PinterestTag",ADOBE_ANALYTICS:"AdobeAnalytics",LINKEDIN_INSIGHT_TAG:"LinkedInInsightTag",REDDIT_PIXEL:"RedditPixel",DRIP:"Drip",HEAP:"Heap",CRITEO:"Criteo",MP:"Mixpanel",QUALTRICS:"Qualtrics",PROFITWELL:"ProfitWell",SENTRY:"Sentry",QUANTUMMETRIC:"QuantumMetric",SNAP_PIXEL:"SnapPixel",POST_AFFILIATE_PRO:"PostAffiliatePro",GOOGLE_OPTIMIZE:"GoogleOptimize",LAUNCHDARKLY:"LaunchDarkly",GA360:"GA360",ADROLL:"Adroll",DCM_FLOODLIGHT:"DCMFloodlight",MATOMO:"Matomo",VERO:"Vero",MOUSEFLOW:"Mouseflow",ROCKERBOX:"Rockerbox",CONVERTFLOW:"ConvertFlow",SNAPENGAGE:"SnapEngage",LIVECHAT:"LiveChat",SHYNET:"Shynet",WOOPRA:"Woopra",ROLLBAR:"RollBar",QUORA_PIXEL:"QuoraPixel",JUNE:"June",ENGAGE:"Engage",ITERABLE:"Iterable",YANDEX_METRICA:"YandexMetrica",REFINER:"Refiner",QUALAROO:"Qualaroo",PODSIGHTS:"Podsights",AXEPTIO:"Axeptio",SATISMETER:"Satismeter",MICROSOFT_CLARITY:"MicrosoftClarity",SENDINBLUE:"Sendinblue",OLARK:"Olark",LEMNISK:"Lemnisk",OPENAI_ADS:"OpenAIAds",TIKTOK_ADS:"TiktokAds",ACTIVE_CAMPAIGN:"ActiveCampaign",SPRIG:"Sprig",SPOTIFYPIXEL:"SpotifyPixel",COMMANDBAR:"CommandBar",NINETAILED:"Ninetailed",XPIXEL:"XPixel",GAINSIGHT_PX:"Gainsight_PX",USERPILOT:"Userpilot",COMSCORE:"Comscore"},S="ACTIVE_CAMPAIGN",k="ADOBE_ANALYTICS",w="ADROLL",T="AM",O="APPCUES",_="AXEPTIO",R="BINGADS",C="BRAZE",P="BUGSNAG",x="CHARTBEAT",D="CLEVERTAP",L="COMMANDBAR",M="COMSCORE",N="CONVERTFLOW",B="CRITEO",G="CUSTOMERIO",U="DCM_FLOODLIGHT",j="DRIP",F="ENGAGE",$="FACEBOOK_PIXEL",z="FULLSTORY",K="GA",H="GA360",Q="GA4",V="GA4_V2",q="GAINSIGHT_PX",X="GOOGLE_OPTIMIZE",W="GOOGLEADS",Y="GTM",J="HEAP",Z="HOTJAR",ee="HS",te="INTERCOM",ne="ITERABLE",re="JUNE",se="KEEN",ie="KISSMETRICS",oe="KLAVIYO",ae="LAUNCHDARKLY",ce="LEMNISK",ue="LINKEDIN_INSIGHT_TAG",le="LIVECHAT",he="LOTAME",de="LYTICS",fe="MATOMO",pe="MICROSOFT_CLARITY",ge="MOENGAGE",ye="MOUSEFLOW",me="MP",ve="NINETAILED",Ie="OLARK",Ae="OPTIMIZELY",be="PENDO",Ee="PINTEREST_TAG",Se="PODSIGHTS",ke="POST_AFFILIATE_PRO",we="POSTHOG",Te="PROFITWELL",Oe="QUALAROO",_e="QUALTRICS",Re="QUANTUMMETRIC",Ce="QUORA_PIXEL",Pe="REDDIT_PIXEL",xe="REFINER",De="ROCKERBOX",Le="ROLLBAR",Me="SATISMETER",Ne="SENDINBLUE",Be="SENTRY",Ge="SHYNET",Ue="SNAP_PIXEL",je="SNAPENGAGE",Fe="SPOTIFYPIXEL",$e="SPRIG",ze="TIKTOK_ADS",Ke="TVSQUARED",He="USERPILOT",Qe="VERO",Ve="VWO",qe="WOOPRA",Xe="XPIXEL",We="YANDEX_METRICA",Ye={"Adobe Analytics":k,ADOBEANALYTICS:k,"ADOBE ANALYTICS":k,[k]:k,AdobeAnalytics:k,adobeanalytics:k,"adobe analytics":k,"Adobe analytics":k,"adobe Analytics":k},Je={[T]:T,AMPLITUDE:T,Amplitude:T,am:T},Ze={[O]:O,Appcues:O,"App Cues":O,appcues:O},et={[R]:R,BingAds:R,bingads:R,"Bing Ads":R,"Bing ads":R,"bing Ads":R,"bing ads":R},tt={[C]:C,Braze:C,braze:C},nt={[P]:P,bugsnag:P,Bugsnag:P},rt={[x]:x,Chartbeat:x,chartbeat:x,"Chart Beat":x,"chart beat":x},st={[D]:D,Clevertap:D,clevertap:D},it={[B]:B,Criteo:B,criteo:B},ot={[G]:G,Customerio:G,"Customer.io":G,"CUSTOMER.IO":G,"customer.io":G},at={[j]:j,Drip:j,drip:j},ct={[$]:$,"FB Pixel":$,"Facebook Pixel":$,"facebook pixel":$,fbpixel:$,FBPIXEL:$,FB_PIXEL:$},ut={[z]:z,Fullstory:z,FullStory:z,"full Story":z,"Full Story":z,"Full story":z,"full story":z,fullstory:z},lt={[K]:K,"Google Analytics":K,GoogleAnalytics:K,"GOOGLE ANALYTICS":K,"google analytics":K},ht={[Q]:Q,"Google Analytics 4":Q,"Google analytics 4":Q,"google analytics 4":Q,"Google Analytics4":Q,"Google analytics4":Q,"google analytics4":Q,"Google Analytics 4 (GA4)":Q,"google analytics 4 (ga4)":Q,GoogleAnalytics4:Q},dt={[V]:V,"Google Analytics 4 V2":V,"Google analytics 4 V2":V,"google analytics 4 V2":V,"Google Analytics4 V2":V,"Google analytics4 V2":V,"google analytics4 V2":V,"Google Analytics 4 (GA4) V2":V,"google analytics 4 (ga4) V2":V,GoogleAnalytics4V2:V},ft={[W]:W,"Google Ads":W,GoogleAds:W,"GOOGLE ADS":W,"google ads":W,googleads:W},pt={[X]:X,"Google Optimize":X,GoogleOptimize:X,Googleoptimize:X,GOOGLEOPTIMIZE:X,"google optimize":X,"Google optimize":X,"GOOGLE OPTIMIZE":X},gt={[Y]:Y,"Google Tag Manager":Y,"google tag manager":Y,"googletag manager":Y,googletagmanager:Y},yt={[J]:J,Heap:J,heap:J,"Heap.io":J},mt={[Z]:Z,Hotjar:Z,hotjar:Z,"Hot Jar":Z,"hot jar":Z},vt={[ee]:ee,Hubspot:ee,HUBSPOT:ee,"hub spot":ee,"Hub Spot":ee,"Hub spot":ee},It={[te]:te,Intercom:te,intercom:te},At={[se]:se,Keen:se,"Keen.io":se,keen:se,"keen.io":se},bt={[ie]:ie,Kissmetrics:ie,kissmetrics:ie},Et={[oe]:oe,Klaviyo:oe,klaviyo:oe},St={[ae]:ae,LaunchDarkly:ae,Launch_Darkly:ae,"Launch Darkly":ae,launchDarkly:ae,"launch darkly":ae},kt={[ue]:ue,"LinkedIn Insight Tag":ue,"LinkedIn insight tag":ue,"linkedIn insight tag":ue,Linkedin_insight_tag:ue,LinkedinInsighttag:ue,LinkedinInsightTag:ue,LinkedInInsightTag:ue,Linkedininsighttag:ue,LINKEDININSIGHTTAG:ue,linkedininsighttag:ue},wt={[he]:he,Lotame:he,lotame:he},Tt={[de]:de,Lytics:de,lytics:de},Ot={[me]:me,MIXPANEL:me,Mixpanel:me,"MIX PANEL":me,"Mix panel":me,"Mix Panel":me},_t={[ge]:ge,MoEngage:ge,moengage:ge,Moengage:ge,"Mo Engage":ge,"mo engage":ge,"Mo engage":ge},Rt={[Ae]:Ae,Optimizely:Ae,optimizely:Ae},Ct={[be]:be,Pendo:be,pendo:be},Pt={[Ee]:Ee,PinterestTag:Ee,Pinterest_Tag:Ee,PINTERESTTAG:Ee,pinterest:Ee,PinterestAds:Ee,Pinterest_Ads:Ee,Pinterest:Ee,"Pinterest Tag":Ee,"Pinterest tag":Ee,"PINTEREST TAG":Ee,"pinterest tag":Ee,"Pinterest Ads":Ee,"Pinterest ads":Ee},xt={[ke]:ke,PostAffiliatePro:ke,Post_affiliate_pro:ke,"Post Affiliate Pro":ke,"Post affiliate pro":ke,"post affiliate pro":ke,postaffiliatepro:ke,POSTAFFILIATEPRO:ke},Dt={[we]:we,PostHog:we,Posthog:we,posthog:we,"Post Hog":we,"Post hog":we,"post hog":we},Lt={[Te]:Te,ProfitWell:Te,profitwell:Te,Profitwell:Te,"Profit Well":Te,"profit well":Te,"Profit well":Te},Mt={[_e]:_e,Qualtrics:_e,qualtrics:_e},Nt={[Re]:Re,"Quantum Metric":Re,"quantum Metric":Re,"quantum metric":Re,QuantumMetric:Re,quantumMetric:Re,quantummetric:Re,Quantum_Metric:Re},Bt={[Pe]:Pe,Reddit_Pixel:Pe,RedditPixel:Pe,REDDITPIXEL:Pe,redditpixel:Pe,"Reddit Pixel":Pe,"REDDIT PIXEL":Pe,"reddit pixel":Pe},Gt={[Be]:Be,sentry:Be,Sentry:Be},Ut={[Ue]:Ue,Snap_Pixel:Ue,SnapPixel:Ue,SNAPPIXEL:Ue,snappixel:Ue,"Snap Pixel":Ue,"SNAP PIXEL":Ue,"snap pixel":Ue},jt={[Ke]:Ke,TVSquared:Ke,tvsquared:Ke,tvSquared:Ke,TvSquared:Ke,Tvsquared:Ke,"TV Squared":Ke,"tv squared":Ke,"tv Squared":Ke},Ft={[Ve]:Ve,VisualWebsiteOptimizer:Ve,Visualwebsiteoptimizer:Ve,visualwebsiteoptimizer:Ve,vwo:Ve,"Visual Website Optimizer":Ve,"Visual website optimizer":Ve,"visual website optimizer":Ve},$t={[H]:H,"Google Analytics 360":H,"Google analytics 360":H,"google analytics 360":H,"Google Analytics360":H,"Google analytics360":H,"google analytics360":H,GoogleAnalytics360:H,"GA 360":H},zt={[w]:w,Adroll:w,"Ad roll":w,"ad roll":w,adroll:w},Kt={[U]:U,"DCM Floodlight":U,"dcm floodlight":U,"Dcm Floodlight":U,DCMFloodlight:U,dcmfloodlight:U,DcmFloodlight:U,dcm_floodlight:U,DCM_Floodlight:U},Ht={[fe]:fe,Matomo:fe,matomo:fe},Qt={[Qe]:Qe,Vero:Qe,vero:Qe},Vt={[ye]:ye,Mouseflow:ye,mouseflow:ye,mouseFlow:ye,MouseFlow:ye,"Mouse flow":ye,"mouse flow":ye,"mouse Flow":ye,"Mouse Flow":ye},qt={[De]:De,Rockerbox:De,rockerbox:De,RockerBox:De,"Rocker box":De,"rocker box":De,"Rocker Box":De},Xt={[N]:N,Convertflow:N,convertflow:N,convertFlow:N,ConvertFlow:N,"Convert flow":N,"convert flow":N,"convert Flow":N,"Convert Flow":N,"CONVERT FLOW":N},Wt={[je]:je,SnapEngage:je,Snap_Engage:je,snapengage:je,"SNAP ENGAGE":je,"Snap Engage":je,"snap engage":je},Yt={[le]:le,LiveChat:le,Live_Chat:le,livechat:le,"LIVE CHAT":le,"Live Chat":le,"live chat":le},Jt={[Ge]:Ge,shynet:Ge,ShyNet:Ge,shyNet:Ge,Shynet:Ge,"shy net":Ge,"Shy Net":Ge,"shy Net":Ge,"Shy net":Ge},Zt={[qe]:qe,Woopra:qe,woopra:qe},en={[Le]:Le,RollBar:Le,Roll_Bar:Le,rollbar:Le,Rollbar:Le,"ROLL BAR":Le,"Roll Bar":Le,"roll bar":Le},tn={[Ce]:Ce,"Quora Pixel":Ce,"Quora pixel":Ce,"QUORA PIXEL":Ce,QuoraPixel:Ce,Quorapixel:Ce,QUORAPIXEL:Ce,Quora_Pixel:Ce,quora_pixel:Ce,Quora:Ce},nn={[re]:re,June:re,june:re},rn={[F]:F,Engage:F,engage:F},sn={[ne]:ne,Iterable:ne,iterable:ne},on={[We]:We,Yandexmetrica:We,yandexmetrica:We,yandexMetrica:We,YandexMetrica:We},an={[xe]:xe,Refiner:xe,refiner:xe},cn={[Oe]:Oe,Qualaroo:Oe,qualaroo:Oe},un={[Se]:Se,Podsights:Se,PodSights:Se,"pod Sights":Se,"Pod Sights":Se,"pod sights":Se,"POD SIGHTS":Se,"Pod sights":Se},ln={[_]:_,Axeptio:_,axeptio:_},hn={[Me]:Me,Satismeter:Me,SatisMeter:Me},dn={[pe]:pe,"Microsoft Clarity":pe,"Microsoft clarity":pe,"microsoft clarity":pe,Microsoft_clarity:pe,MicrosoftClarity:pe,MICROSOFTCLARITY:pe,microsoftclarity:pe,microsoftClarity:pe},fn={[Ne]:Ne,Sendinblue:Ne,sendinblue:Ne,SendinBlue:Ne},pn={[Ie]:Ie,Olark:Ie,olark:Ie},gn={[ce]:ce,LEMNISK_MARKETING_AUTOMATION:ce,"Lemnisk Marketing Automation":ce,LemniskMarketingAutomation:ce,lemniskmarketingautomation:ce,lemniskMarketingAutomation:ce,lemnisk:ce,Lemnisk:ce},yn={[ze]:ze,TiktokAds:ze,"Tiktok ads":ze,"Tiktok Ads":ze,"Tik Tok Ads":ze,"tik tok ads":ze,tiktokads:ze},mn={ActiveCampaign:S,"Active Campaign":S,"ACTIVE CAMPAIGN":S,[S]:S,activecampaign:S,"active campaign":S,"Active campaign":S,"active Campaign":S,active_campaign:S},vn={[$e]:$e,Sprig:$e,sprig:$e},In={[Fe]:Fe,"Spotify Pixel":Fe,"spotify pixel":Fe,SPOTIFY_PIXEL:Fe},An={All:"All",...Ye,...Je,...Ze,...et,...tt,...nt,...{[L]:L,"Command Bar":L,Commandbar:L,COMMAND_BAR:L,commandbar:L},...rt,...st,...it,...ot,...at,...ct,...ut,...lt,...ht,...dt,...$t,...ft,...pt,...gt,...yt,...mt,...vt,...It,...At,...bt,...Et,...St,...kt,...wt,...Tt,...Ot,..._t,...{[ve]:ve,Ninetailed:ve,ninetailed:ve,NineTailed:ve},...Rt,...Ct,...Pt,...xt,...Dt,...Lt,...Mt,...Nt,...Bt,...Gt,...Ut,...jt,...Ft,...zt,...Kt,...Ht,...Qt,...Vt,...Xt,...Wt,...Yt,...Jt,...Zt,...en,...tn,...nn,...rn,...sn,...qt,...on,...an,...cn,...un,...ln,...hn,...dn,...fn,...pn,...gn,...yn,...mn,...vn,...In,...{[Xe]:Xe,XPixel:Xe,Xpixel:Xe,xpixel:Xe,xPixel:Xe},...{[q]:q,Gainsight_PX:q},...{[He]:He,userpilot:He,Userpilot:He},...{[M]:M,Comscore:M,comscore:M,comScore:M}};let bn=3;const En={setLogLevel(e){switch(e.toUpperCase()){case"INFO":bn=1;break;case"DEBUG":bn=2;break;default:bn=3}},info(...e){bn<=1&&console.info(...e)},debug(...e){bn<=2&&console.log(...e)},warn(...e){bn<=3&&console.warn(...e)},error(...e){bn<=4&&console.error(...e)}},Sn=["anonymous_id","id","sent_at","received_at","timestamp","original_timestamp","event_text","event"],kn="https://api.rudderstack.com/sourceConfig/?p=npm&v=2.52.23",wn="v1.1",Tn="js-integrations",On=`https://cdn.rudderlabs.com/${wn}/${Tn}`,_n="https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Number.isNaN%2CURL%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll%2CTextEncoder%2Cnavigator.sendBeacon",Rn=["Lax","None","Strict"],Cn=["US","EU"],Pn=["oneTrust","ketch"],xn=["library","consentManagement"],Dn=["none","default","full"],Ln={All:!0},Mn="Request failed with status:",Nn=[Mn],Bn="errorReporting",Gn=e=>{const t=window.RudderStackGlobals?.[Bn];t&&e instanceof Error&&t.notify(e)},Un=e=>{const t=[];return function(n,r){if(!e||null!=r){if("object"!=typeof r||null===r)return r;for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?(En.debug(`Circular Reference detected for key: ${n}`),"[Circular Reference]"):(t.push(r),r)}}},jn=(e,t)=>{try{return JSON.stringify(e,Un(t))}catch(e){return En.warn("Failed to convert the value to a JSON string."),null}},Fn=e=>null===e,$n=(e,t)=>{if(!Array.isArray(e)||!Array.isArray(t))return v(t);const n=v(e);return t.forEach((e,t)=>{n[t]=Array.isArray(e)||(e=>!Fn(e)&&(e=>"object"==typeof e)(e)&&!Array.isArray(e))(e)?zn(n[t],e):e}),n},zn=(e,t)=>b($n,e,t),Kn=e=>(e=>!Fn(e)&&"[object Object]"===Object.prototype.toString.call(e))(e)&&Object.keys(e).length>0,Hn=1e4,Qn=1e3,Vn="RS_JS_SDK",qn=(e,t,n)=>{let r;try{r=((e,t,n)=>{let r;try{r="string"==typeof e?e:e instanceof Error||e.message?e.message:jn(e)}catch(e){r=""}if("object"==typeof(s=e)&&null!==s&&"target"in s){if(e.target&&"script"!==e.target.localName)return"";if(e.target.dataset&&(e.target.dataset.loader!==Vn||"true"!==e.target.dataset.isnonnativesdk))return"";if(r=`error in script loading:: src:: ${e.target.src} id:: ${e.target.id}`,"ad-block"===e.target.id)return n.page("RudderJS-Initiated","ad-block page request",{path:"/ad-blocked",title:r},n.sendAdblockPageOptions),""}var s;return`[handleError]::${t||""} "${r}"`})(e,t,n)}catch(t){En.error("[handleError] Exception:: ",t),En.error("[handleError] Original error:: ",jn(e)),Gn(t)}r&&(En.error(r),(e=>!e.message||!Nn.some(t=>e.message.includes(t)))(e)&&Gn(e))};var Xn={exports:{}};var Wn,Yn={exports:{}},Jn=s(Object.freeze({__proto__:null,default:{}}));function Zn(){return Wn||(Wn=1,function(e){var t;e.exports=(t=t||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==n&&n.crypto&&(r=n.crypto),!r)try{r=Jn}catch(e){}var s=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},a=o.lib={},c=a.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=c.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,s=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<s;i++){var o=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=o<<24-(r+i)%4*8}else for(var a=0;a<s;a+=4)t[r+a>>>2]=n[a>>>2];return this.sigBytes+=s,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(s());return new u.init(t,e)}}),l=o.enc={},h=l.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],s=0;s<n;s++){var i=t[s>>>2]>>>24-s%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},d=l.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],s=0;s<n;s++){var i=t[s>>>2]>>>24-s%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},f=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,s=r.words,i=r.sigBytes,o=this.blockSize,a=i/(4*o),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,l=e.min(4*c,i);if(c){for(var h=0;h<c;h+=o)this._doProcessBlock(s,h);n=s.splice(0,c),r.sigBytes-=l}return new u.init(n,l)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=p.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}});var g=o.algo={};return o}(Math),t)}(Yn)),Yn.exports}var er,tr={exports:{}};function nr(){return er||(er=1,function(e){var t;e.exports=(t=Zn(),function(){var e=t,n=e.lib.WordArray;function r(e,t,r){for(var s=[],i=0,o=0;o<t;o++)if(o%4){var a=r[e.charCodeAt(o-1)]<<o%4*2|r[e.charCodeAt(o)]>>>6-o%4*2;s[i>>>2]|=a<<24-i%4*8,i++}return n.create(s,i)}e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var s=[],i=0;i<n;i+=3)for(var o=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<n;a++)s.push(r.charAt(o>>>6*(3-a)&63));var c=r.charAt(64);if(c)for(;s.length%4;)s.push(c);return s.join("")},parse:function(e){var t=e.length,n=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var i=0;i<n.length;i++)s[n.charCodeAt(i)]=i}var o=n.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return r(e,t,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64)}(tr)),tr.exports}var rr,sr={exports:{}};function ir(){return rr||(rr=1,function(e){var t;e.exports=(t=Zn(),function(e){var n=t,r=n.lib,s=r.WordArray,i=r.Hasher,o=n.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=o.MD5=i.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,s=e[r];e[r]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var i=this._hash.words,o=e[t+0],c=e[t+1],f=e[t+2],p=e[t+3],g=e[t+4],y=e[t+5],m=e[t+6],v=e[t+7],I=e[t+8],A=e[t+9],b=e[t+10],E=e[t+11],S=e[t+12],k=e[t+13],w=e[t+14],T=e[t+15],O=i[0],_=i[1],R=i[2],C=i[3];O=u(O,_,R,C,o,7,a[0]),C=u(C,O,_,R,c,12,a[1]),R=u(R,C,O,_,f,17,a[2]),_=u(_,R,C,O,p,22,a[3]),O=u(O,_,R,C,g,7,a[4]),C=u(C,O,_,R,y,12,a[5]),R=u(R,C,O,_,m,17,a[6]),_=u(_,R,C,O,v,22,a[7]),O=u(O,_,R,C,I,7,a[8]),C=u(C,O,_,R,A,12,a[9]),R=u(R,C,O,_,b,17,a[10]),_=u(_,R,C,O,E,22,a[11]),O=u(O,_,R,C,S,7,a[12]),C=u(C,O,_,R,k,12,a[13]),R=u(R,C,O,_,w,17,a[14]),O=l(O,_=u(_,R,C,O,T,22,a[15]),R,C,c,5,a[16]),C=l(C,O,_,R,m,9,a[17]),R=l(R,C,O,_,E,14,a[18]),_=l(_,R,C,O,o,20,a[19]),O=l(O,_,R,C,y,5,a[20]),C=l(C,O,_,R,b,9,a[21]),R=l(R,C,O,_,T,14,a[22]),_=l(_,R,C,O,g,20,a[23]),O=l(O,_,R,C,A,5,a[24]),C=l(C,O,_,R,w,9,a[25]),R=l(R,C,O,_,p,14,a[26]),_=l(_,R,C,O,I,20,a[27]),O=l(O,_,R,C,k,5,a[28]),C=l(C,O,_,R,f,9,a[29]),R=l(R,C,O,_,v,14,a[30]),O=h(O,_=l(_,R,C,O,S,20,a[31]),R,C,y,4,a[32]),C=h(C,O,_,R,I,11,a[33]),R=h(R,C,O,_,E,16,a[34]),_=h(_,R,C,O,w,23,a[35]),O=h(O,_,R,C,c,4,a[36]),C=h(C,O,_,R,g,11,a[37]),R=h(R,C,O,_,v,16,a[38]),_=h(_,R,C,O,b,23,a[39]),O=h(O,_,R,C,k,4,a[40]),C=h(C,O,_,R,o,11,a[41]),R=h(R,C,O,_,p,16,a[42]),_=h(_,R,C,O,m,23,a[43]),O=h(O,_,R,C,A,4,a[44]),C=h(C,O,_,R,S,11,a[45]),R=h(R,C,O,_,T,16,a[46]),O=d(O,_=h(_,R,C,O,f,23,a[47]),R,C,o,6,a[48]),C=d(C,O,_,R,v,10,a[49]),R=d(R,C,O,_,w,15,a[50]),_=d(_,R,C,O,y,21,a[51]),O=d(O,_,R,C,S,6,a[52]),C=d(C,O,_,R,p,10,a[53]),R=d(R,C,O,_,b,15,a[54]),_=d(_,R,C,O,c,21,a[55]),O=d(O,_,R,C,I,6,a[56]),C=d(C,O,_,R,T,10,a[57]),R=d(R,C,O,_,m,15,a[58]),_=d(_,R,C,O,k,21,a[59]),O=d(O,_,R,C,g,6,a[60]),C=d(C,O,_,R,E,10,a[61]),R=d(R,C,O,_,f,15,a[62]),_=d(_,R,C,O,A,21,a[63]),i[0]=i[0]+O|0,i[1]=i[1]+_|0,i[2]=i[2]+R|0,i[3]=i[3]+C|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,s=8*t.sigBytes;n[s>>>5]|=128<<24-s%32;var i=e.floor(r/4294967296),o=r;n[15+(s+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(s+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,c=a.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,r,s,i,o){var a=e+(t&n|~t&r)+s+o;return(a<<i|a>>>32-i)+t}function l(e,t,n,r,s,i,o){var a=e+(t&r|n&~r)+s+o;return(a<<i|a>>>32-i)+t}function h(e,t,n,r,s,i,o){var a=e+(t^n^r)+s+o;return(a<<i|a>>>32-i)+t}function d(e,t,n,r,s,i,o){var a=e+(n^(t|~r))+s+o;return(a<<i|a>>>32-i)+t}n.MD5=i._createHelper(c),n.HmacMD5=i._createHmacHelper(c)}(Math),t.MD5)}(sr)),sr.exports}var or,ar={exports:{}},cr={exports:{}};function ur(){return or||(or=1,function(e){var t,n,r,s,i,o,a,c;e.exports=(c=Zn(),n=(t=c).lib,r=n.WordArray,s=n.Hasher,i=t.algo,o=[],a=i.SHA1=s.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],s=n[1],i=n[2],a=n[3],c=n[4],u=0;u<80;u++){if(u<16)o[u]=0|e[t+u];else{var l=o[u-3]^o[u-8]^o[u-14]^o[u-16];o[u]=l<<1|l>>>31}var h=(r<<5|r>>>27)+c+o[u];h+=u<20?1518500249+(s&i|~s&a):u<40?1859775393+(s^i^a):u<60?(s&i|s&a|i&a)-1894007588:(s^i^a)-899497514,c=a,a=i,i=s<<30|s>>>2,s=r,r=h}n[0]=n[0]+r|0,n[1]=n[1]+s|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=s._createHelper(a),t.HmacSHA1=s._createHmacHelper(a),c.SHA1)}(cr)),cr.exports}var lr,hr={exports:{}};var dr;function fr(){return dr||(dr=1,function(e){var t,n,r,s,i,o,a,c;e.exports=(c=Zn(),ur(),lr||(lr=1,function(e){var t;e.exports=(t=Zn(),void function(){var e=t,n=e.lib.Base,r=e.enc.Utf8;e.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,s=4*n;t.sigBytes>s&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),a=i.words,c=o.words,u=0;u<n;u++)a[u]^=1549556828,c[u]^=909522486;i.sigBytes=o.sigBytes=s,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})}())}(hr)),n=(t=c).lib,r=n.Base,s=n.WordArray,i=t.algo,o=i.MD5,a=i.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,i=r.hasher.create(),o=s.create(),a=o.words,c=r.keySize,u=r.iterations;a.length<c;){n&&i.update(n),n=i.update(e).finalize(t),i.reset();for(var l=1;l<u;l++)n=i.finalize(n),i.reset();o.concat(n)}return o.sigBytes=4*c,o}}),t.EvpKDF=function(e,t,n){return a.create(n).compute(e,t)},c.EvpKDF)}(ar)),ar.exports}var pr,gr={exports:{}};var yr;var mr,vr=(yr||(yr=1,function(e){var t;e.exports=(t=Zn(),nr(),ir(),fr(),pr||(pr=1,function(e){var t;e.exports=(t=Zn(),fr(),void(t.lib.Cipher||function(e){var n=t,r=n.lib,s=r.Base,i=r.WordArray,o=r.BufferedBlockAlgorithm,a=n.enc;a.Utf8;var c=a.Base64,u=n.algo.EvpKDF,l=r.Cipher=o.extend({cfg:s.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?I:m}return function(t){return{encrypt:function(n,r,s){return e(r).encrypt(t,n,r,s)},decrypt:function(n,r,s){return e(r).decrypt(t,n,r,s)}}}}()});r.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var h=n.mode={},d=r.BlockCipherMode=s.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),f=h.CBC=function(){var t=d.extend();function n(t,n,r){var s,i=this._iv;i?(s=i,this._iv=e):s=this._prevBlock;for(var o=0;o<r;o++)t[n+o]^=s[o]}return t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,s=r.blockSize;n.call(this,e,t,s),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+s)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,s=r.blockSize,i=e.slice(t,t+s);r.decryptBlock(e,t),n.call(this,e,t,s),this._prevBlock=i}}),t}(),p=(n.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,s=r<<24|r<<16|r<<8|r,o=[],a=0;a<r;a+=4)o.push(s);var c=i.create(o,r);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:f,padding:p}),reset:function(){var e;l.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var g=r.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=(n.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?i.create([1398893684,1701076831]).concat(n).concat(t):t).toString(c)},parse:function(e){var t,n=c.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=i.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:t})}},m=r.SerializableCipher=s.extend({cfg:s.extend({format:y}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var s=e.createEncryptor(n,r),i=s.finalize(t),o=s.cfg;return g.create({ciphertext:i,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),v=(n.kdf={}).OpenSSL={execute:function(e,t,n,r,s){if(r||(r=i.random(8)),s)o=u.create({keySize:t+n,hasher:s}).compute(e,r);else var o=u.create({keySize:t+n}).compute(e,r);var a=i.create(o.words.slice(t),4*n);return o.sigBytes=4*t,g.create({key:o,iv:a,salt:r})}},I=r.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:v}),encrypt:function(e,t,n,r){var s=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize,r.salt,r.hasher);r.iv=s.iv;var i=m.encrypt.call(this,e,t,s.key,r);return i.mixIn(s),i},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var s=r.kdf.execute(n,e.keySize,e.ivSize,t.salt,r.hasher);return r.iv=s.iv,m.decrypt.call(this,e,t,s.key,r)}})}()))}(gr)),function(){var e=t,n=e.lib.BlockCipher,r=e.algo,s=[],i=[],o=[],a=[],c=[],u=[],l=[],h=[],d=[],f=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var p=r^r<<1^r<<2^r<<3^r<<4;p=p>>>8^255&p^99,s[n]=p,i[p]=n;var g=e[n],y=e[g],m=e[y],v=257*e[p]^16843008*p;o[n]=v<<24|v>>>8,a[n]=v<<16|v>>>16,c[n]=v<<8|v>>>24,u[n]=v,v=16843009*m^65537*y^257*g^16843008*n,l[p]=v<<24|v>>>8,h[p]=v<<16|v>>>16,d[p]=v<<8|v>>>24,f[p]=v,n?(n=g^e[e[e[m^g]]],r^=e[e[r]]):n=r=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],g=r.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),i=this._keySchedule=[],o=0;o<r;o++)o<n?i[o]=t[o]:(u=i[o-1],o%n?n>6&&o%n==4&&(u=s[u>>>24]<<24|s[u>>>16&255]<<16|s[u>>>8&255]<<8|s[255&u]):(u=s[(u=u<<8|u>>>24)>>>24]<<24|s[u>>>16&255]<<16|s[u>>>8&255]<<8|s[255&u],u^=p[o/n|0]<<24),i[o]=i[o-n]^u);for(var a=this._invKeySchedule=[],c=0;c<r;c++){if(o=r-c,c%4)var u=i[o];else u=i[o-4];a[c]=c<4||o<=4?u:l[s[u>>>24]]^h[s[u>>>16&255]]^d[s[u>>>8&255]]^f[s[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,c,u,s)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,h,d,f,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,s,i,o,a){for(var c=this._nRounds,u=e[t]^n[0],l=e[t+1]^n[1],h=e[t+2]^n[2],d=e[t+3]^n[3],f=4,p=1;p<c;p++){var g=r[u>>>24]^s[l>>>16&255]^i[h>>>8&255]^o[255&d]^n[f++],y=r[l>>>24]^s[h>>>16&255]^i[d>>>8&255]^o[255&u]^n[f++],m=r[h>>>24]^s[d>>>16&255]^i[u>>>8&255]^o[255&l]^n[f++],v=r[d>>>24]^s[u>>>16&255]^i[l>>>8&255]^o[255&h]^n[f++];u=g,l=y,h=m,d=v}g=(a[u>>>24]<<24|a[l>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^n[f++],y=(a[l>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^n[f++],m=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&l])^n[f++],v=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[l>>>8&255]<<8|a[255&h])^n[f++],e[t]=g,e[t+1]=y,e[t+2]=m,e[t+3]=v},keySize:8});e.AES=n._createHelper(g)}(),t.AES)}(Xn)),Xn.exports),Ir=r(vr),Ar={exports:{}};var br,Er,Sr,kr,wr,Tr,Or=r((mr||(mr=1,function(e){e.exports=Zn().enc.Utf8}(Ar)),Ar.exports)),_r=Object.defineProperty,Rr=(e,t)=>_r(e,"name",{value:t,configurable:!0}),Cr=Rr(e=>null!==e&&"object"==typeof e,"isObject"),Pr=Rr((e,t,n)=>"function"==typeof n.join?n.join(e):e[0]+t+e[1],"join"),xr=Rr((e,t,n)=>"function"==typeof n.split?n.split(e):e.split(t),"split"),Dr=Rr((e,t={},n)=>"function"!=typeof n?.isValid||n.isValid(e,t),"isValid"),Lr=Rr(e=>Cr(e)||"function"==typeof e,"isValidObject"),Mr=Rr((e,t,n={})=>{if(Cr(n)||(n={default:n}),!Lr(e))return void 0!==n.default?n.default:e;"number"==typeof t&&(t=String(t));const r=Array.isArray(t),s="string"==typeof t,i=n.separator||".",o=n.joinChar||("string"==typeof i?i:".");if(!s&&!r)return e;let a=e[t];if(void 0===a&&"function"==typeof e.get&&(a=e.get(t)),void 0!==a)return Dr(t,e,n)?a:n.default;const c=r?t:xr(t,i,n),u=c.length;let l=0;do{let t=c[l];for("string"!=typeof t&&(t=String(t));t&&"\\"===t.slice(-1);)t=Pr([t.slice(0,-1),c[++l]||""],o,n);if(a=e[t],void 0===a&&"function"==typeof e.get&&(a=e.get(t)),void 0!==a){if(!Dr(t,e,n))return n.default;e=a}else{let r=!1,s=l+1;for(;s<u;)if(t=Pr([t,c[s++]],o,n),a=e[t],void 0===a&&"function"==typeof e.get&&(a=e.get(t)),r=void 0!==a){if(!Dr(t,e,n))return n.default;e=a,l=s-1;break}if(!r)return n.default}}while(++l<u&&Lr(e));return l===u?e:n.default},"getValue"),Nr={exports:{}},Br={exports:{}};function Gr(){if(Er)return br;Er=1;var e=1e3,t=60*e,n=60*t,r=24*n,s=365.25*r;function i(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return br=function(o,a){a=a||{};var c=typeof o;if("string"===c&&o.length>0)return function(i){if((i=String(i)).length>100)return;var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(!o)return;var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(o);if("number"===c&&!1===isNaN(o))return a.long?function(s){return i(s,r,"day")||i(s,n,"hour")||i(s,t,"minute")||i(s,e,"second")||s+" ms"}(o):function(s){if(s>=r)return Math.round(s/r)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))},br}function Ur(){return Sr||(Sr=1,function(e,t){var n;function r(e){function r(){if(r.enabled){var e=r,s=+new Date,i=s-(n||s);e.diff=i,e.prev=n,e.curr=s,n=s;for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var c=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;c++;var s=t.formatters[r];if("function"==typeof s){var i=o[c];n=s.call(e,i),o.splice(c,1),c--}return n}),t.formatArgs.call(e,o),(r.log||t.log||console.log.bind(console)).apply(e,o)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),"function"==typeof t.init&&t.init(r),r}(t=e.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length,s=0;s<r;s++)n[s]&&("-"===(e=n[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Gr(),t.names=[],t.skips=[],t.formatters={}}(Br,Br.exports)),Br.exports}var jr,Fr,$r,zr,Kr,Hr,Qr,Vr=function(){if(Tr)return wr;Tr=1;var e=(kr||(kr=1,function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=Ur()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var s=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(s++,"%c"===e&&(i=s))}),e.splice(i,0,r)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(Nr,Nr.exports)),Nr.exports)("cookie");function t(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},s=e.split(/ *; */);if(""==s[0])return n;for(var i=0;i<s.length;++i)n[r((t=s[i].split("="))[0])]=r(t[1]);return n}(e)}function n(t){try{return encodeURIComponent(t)}catch(n){e("error `encode(%o)` - %o",t,n)}}function r(t){try{return decodeURIComponent(t)}catch(n){e("error `decode(%o)` - %o",t,n)}}return wr=function(e,r,s){switch(arguments.length){case 3:case 2:return function(e,t,r){r=r||{};var s=n(e)+"="+n(t);null==t&&(r.maxage=-1);r.maxage&&(r.expires=new Date(+new Date+r.maxage));r.path&&(s+="; path="+r.path);r.domain&&(s+="; domain="+r.domain);r.expires&&(s+="; expires="+r.expires.toUTCString());r.samesite&&(s+="; samesite="+r.samesite);r.secure&&(s+="; secure");document.cookie=s}(e,r,s);case 1:return function(e){return t()[e]}(e);default:return t()}},wr}(),qr=r(Vr),Xr={exports:{}},Wr={exports:{}},Yr={exports:{}};function Jr(){if(Fr)return jr;Fr=1;var e=1e3,t=60*e,n=60*t,r=24*n,s=365.25*r;function i(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return jr=function(o,a){a=a||{};var c=typeof o;if("string"===c&&o.length>0)return function(i){if((i=String(i)).length>100)return;var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(!o)return;var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(o);if("number"===c&&!1===isNaN(o))return a.long?function(s){return i(s,r,"day")||i(s,n,"hour")||i(s,t,"minute")||i(s,e,"second")||s+" ms"}(o):function(s){if(s>=r)return Math.round(s/r)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))},jr}function Zr(){return $r||($r=1,function(e,t){var n;function r(e){function r(){if(r.enabled){var e=r,s=+new Date,i=s-(n||s);e.diff=i,e.prev=n,e.curr=s,n=s;for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var c=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;c++;var s=t.formatters[r];if("function"==typeof s){var i=o[c];n=s.call(e,i),o.splice(c,1),c--}return n}),t.formatArgs.call(e,o),(r.log||t.log||console.log.bind(console)).apply(e,o)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),"function"==typeof t.init&&t.init(r),r}(t=e.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length,s=0;s<r;s++)n[s]&&("-"===(e=n[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Jr(),t.names=[],t.skips=[],t.formatters={}}(Yr,Yr.exports)),Yr.exports}function es(){if(Hr)return Kr;Hr=1;var e=(zr||(zr=1,function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=Zr()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var s=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(s++,"%c"===e&&(i=s))}),e.splice(i,0,r)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(Wr,Wr.exports)),Wr.exports)("cookie");function t(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},s=e.split(/ *; */);if(""==s[0])return n;for(var i=0;i<s.length;++i)n[r((t=s[i].split("="))[0])]=r(t[1]);return n}(e)}function n(t){try{return encodeURIComponent(t)}catch(n){e("error `encode(%o)` - %o",t,n)}}function r(t){try{return decodeURIComponent(t)}catch(n){e("error `decode(%o)` - %o",t,n)}}return Kr=function(e,r,s){switch(arguments.length){case 3:case 2:return function(e,t,r){r=r||{};var s=n(e)+"="+n(t);null==t&&(r.maxage=-1);r.maxage&&(r.expires=new Date(+new Date+r.maxage));r.path&&(s+="; path="+r.path);r.domain&&(s+="; domain="+r.domain);r.expires&&(s+="; expires="+r.expires.toUTCString());r.secure&&(s+="; secure");document.cookie=s}(e,r,s);case 1:return function(e){return t()[e]}(e);default:return t()}},Kr}var ts=(Qr||(Qr=1,function(e,t){var n=es();function r(e){for(var n=t.cookie,r=t.levels(e),s=0;s<r.length;++s){var i="__tld__",o=r[s],a={domain:"."+o};if(n(i,1,a),n(i))return n(i,null,a),o}return""}r.levels=function(e){var t=("function"!=typeof window.URL?function(e){const t=document.createElement("a");return t.href=e,t.hostname}(e):new URL(e).hostname).split("."),n=t[t.length-1],r=[];if(4===t.length&&n===parseInt(n,10))return r;if(t.length<=1)return r;for(var s=t.length-2;s>=0;--s)r.push(t.slice(s).join("."));return r},r.cookie=n,t=e.exports=r}(Xr,Xr.exports)),Xr.exports),ns=r(ts);const rs=new class{constructor(e){this.cOpts={},this.options(e),this.isSupportAvailable=this.checkSupportAvailability()}options(e={}){if(0===arguments.length)return this.cOpts;let t=`.${ns(window.location.href)}`;return"."===t&&(t=null),this.cOpts=zn({maxage:31536e6,path:"/",domain:t,samesite:"Lax"},e),e.sameDomainCookiesOnly&&delete this.cOpts.domain,this.cOpts}set(e,t){try{return qr(e,t,v(this.cOpts)),!0}catch(e){return En.error(e),!1}}get(e){return qr(e)}remove(e){try{return qr(e,null,v(this.cOpts)),!0}catch(e){return!1}}checkSupportAvailability(){const e="test_rudder_cookie";return this.set(e,!0),!!this.get(e)&&(this.remove(e),!0)}}({});var ss,is={exports:{}};var os=(ss||(ss=1,function(e){e.exports=function(){function e(e){return e=JSON.stringify(e),!!/^\{[\s\S]*\}$/.test(e)}function t(e){return void 0===e||"function"==typeof e?e+"":JSON.stringify(e)}function n(e){if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}}function r(e){return"[object Function]"==={}.toString.call(e)}function s(e){return"[object Array]"===Object.prototype.toString.call(e)}function i(e){var t="_Is_Incognit",n="yes";try{e||(e=window.localStorage),e.setItem(t,n),e.removeItem(t)}catch(t){var r={_data:{},setItem:function(e,t){return r._data[e]=String(t)},getItem:function(e){return r._data.hasOwnProperty(e)?r._data[e]:void 0},removeItem:function(e){return delete r._data[e]},clear:function(){return r._data={}}};e=r}finally{e.getItem(t)===n&&e.removeItem(t)}return e}var o=i();function a(){if(!(this instanceof a))return new a}a.prototype={set:function(n,r){if(n&&!e(n))o.setItem(n,t(r));else if(e(n))for(var s in n)this.set(s,n[s]);return this},get:function(e){if(void 0===e){var t={};return this.forEach(function(e,n){return t[e]=n}),t}if("?"===e.charAt(0))return this.has(e.substr(1));var r=arguments;if(r.length>1){for(var s={},i=0,a=r.length;i<a;i++){var c=n(o.getItem(r[i]));this.has(r[i])&&(s[r[i]]=c)}return s}return n(o.getItem(e))},clear:function(){return o.clear(),this},remove:function(e){var t=this.get(e);return o.removeItem(e),t},has:function(e){return{}.hasOwnProperty.call(this.get(),e)},keys:function(){var e=[];return this.forEach(function(t){e.push(t)}),e},forEach:function(e){for(var t=0,n=o.length;t<n;t++){var r=o.key(t);e(r,this.get(r))}return this},search:function(e){for(var t=this.keys(),n={},r=0,s=t.length;r<s;r++)t[r].indexOf(e)>-1&&(n[t[r]]=this.get(t[r]));return n},len:function(){return o.length}};var c=null;function u(t,n){var i=arguments,o=null;if(c||(c=a()),0===i.length)return c.get();if(1===i.length){if("string"==typeof t)return c.get(t);if(e(t))return c.set(t)}if(2===i.length&&"string"==typeof t){if(!n)return c.remove(t);if(n&&"string"==typeof n)return c.set(t,n);n&&r(n)&&(o=null,o=n(t,c.get(t)),u.set(t,o))}if(2===i.length&&s(t)&&r(n))for(var l=0,h=t.length;l<h;l++)o=n(t[l],c.get(t[l])),u.set(t[l],o);return u}for(var l in a.prototype)u[l]=a.prototype[l];return u}()}(is)),is.exports),as=r(os);const cs=new class{constructor(e){this.sOpts={},this.enabled=this.checkSupportAvailability(),this.options(e)}options(e={}){return 0===arguments.length||(this.sOpts=zn({enabled:!0},e),this.enabled=this.sOpts.enabled&&this.enabled),this.sOpts}set(e,t){return as.set(e,t)}get(e){return as.get(e)}remove(e){return as.remove(e)}checkSupportAvailability(){try{const e="test_rudder_ls";return this.set(e,!0),!!this.get(e)&&(this.remove(e),!0)}catch(e){return!1}}}({}),us=e=>(new TextDecoder).decode((e=>{const t=globalThis.atob(e).split("").map(e=>e.charCodeAt(0));return new Uint8Array(t)})(e)),ls="rl_user_id",hs="rl_trait",ds="rl_anonymous_id",fs="rl_group_id",ps="rl_group_trait",gs="rl_page_init_referrer",ys="rl_page_init_referring_domain",ms="rl_session",vs="rl_auth_token",Is="RudderEncrypt:",As="RS_ENC_v3_",bs="Rudder",Es={segment:"ajs_anonymous_id"};function Ss(e){return e.replace(/^\s+|\s+$/gm,"")}function ks(e){return e&&"string"==typeof e&&""!==Ss(e)?e.startsWith(Is)?Ir.decrypt(e.substring(Is.length),bs).toString(Or):e.startsWith(As)?us(e.substring(As.length)):e:e}const ws=new class{constructor(){rs.isSupportAvailable?this.storage=rs:(cs.enabled&&(this.storage=cs),this.storage||En.error("No storage is available :: initializing the SDK without storage"))}options(e={}){this.storage.options(e)}setItem(e,t){const n=jn(t);null!==n&&this.storage.set(e,function(e){return""===Ss(e)?e:`${Is}${Ir.encrypt(e,bs).toString()}`}(n))}setStringItem(e,t){"string"==typeof t?this.setItem(e,t):En.error(`[Storage] ${e} should be string`)}setUserId(e){this.setStringItem(ls,e)}setUserTraits(e){this.setItem(hs,e)}setGroupId(e){this.setStringItem(fs,e)}setGroupTraits(e){this.setItem(ps,e)}setAnonymousId(e){this.setStringItem(ds,e)}setInitialReferrer(e){this.setItem(gs,e)}setInitialReferringDomain(e){this.setItem(ys,e)}setSessionInfo(e){this.setItem(ms,e)}setAuthToken(e){this.setItem(vs,e)}getItem(e){try{let t=this.storage.get(e),n=ks(t);for(t=n?JSON.parse(n):null;"string"==typeof t&&(n=ks(t),n!==t);)t=JSON.parse(n);return t}catch(t){return En.error((e=>`Unable to retrieve the cookie data for ${e}. The data is dropped. This can potentially stem from using SDK v3 on other sites or web pages that can share cookies with this webpage. Please use the same SDK (v3) version everywhere as soon as possible.`)(e),t),null}}getUserId(){return this.getItem(ls)}getUserTraits(){return this.getItem(hs)}getGroupId(){return this.getItem(fs)}getGroupTraits(){return this.getItem(ps)}fetchExternalAnonymousId(e){let t;const n=e.toLowerCase();return Object.keys(Es).includes(n)&&"segment"===n?(cs.enabled&&(t=cs.get(Es[n])),!t&&rs.isSupportAvailable&&(t=rs.get(Es[n])),t):t}getAnonymousId(e){const t=this.getItem(ds);if(t)return t;const n=Mr(e,"autoCapture.source");if(!0===Mr(e,"autoCapture.enabled")&&"string"==typeof n){const e=this.fetchExternalAnonymousId(n);if(e)return e}return t}getInitialReferrer(){return this.getItem(gs)}getInitialReferringDomain(){return this.getItem(ys)}getSessionInfo(){return this.getItem(ms)}getAuthToken(){return this.getItem(vs)}removeItem(e){return this.storage.remove(e)}removeSessionInfo(){this.removeItem(ms)}clear(e){this.storage.remove(ls),this.storage.remove(hs),this.storage.remove(fs),this.storage.remove(ps),this.storage.remove(vs),e&&this.storage.remove(ds)}},Ts=(e,t,n={})=>{if(document.getElementById(e))return;const r=document.createElement("script");r.src=t,r.async=void 0===n.async||n.async,r.type="text/javascript",r.id=e,!0!==n.skipDatasetAttributes&&(r.setAttribute("data-loader",Vn),void 0!==n.isNonNativeSDK&&r.setAttribute("data-isNonNativeSDK",n.isNonNativeSDK));const s=document.getElementsByTagName("head");if(s.length>0)s[0].insertBefore(r,s[0].firstChild);else{const e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(r,e)}};for(var Os,_s=256,Rs=[];_s--;)Rs[_s]=(_s+256).toString(16).substring(1);for(var Cs,Ps=[],xs=0;xs<256;xs++)Ps[xs]=(xs+256).toString(16).substring(1);function Ds(){var e;(!Cs||xs+16>4096)&&(e=4096,Cs=crypto.getRandomValues(new Uint8Array(e)),xs=0);for(var t,n=0,r="";n<16;n++)t=Cs[xs+n],r+=6==n?Ps[15&t|64]:8==n?Ps[63&t|128]:Ps[t],1&n&&n>1&&n<11&&(r+="-");return xs+=16,r}const Ls={All:"All",GA:"Google Analytics",GOOGLEADS:"Google Ads",BRAZE:"Braze",CHARTBEAT:"Chartbeat",CUSTOMERIO:"Customer IO",DCM_Floodlight:"DCM Floodlight",FACEBOOK_PIXEL:"Facebook Pixel",GTM:"Google Tag Manager",HOTJAR:"Hotjar",HS:"HubSpot",INTERCOM:"Intercom",KEEN:"Keen",KISSMETRICS:"Kiss Metrics",LOTAME:"Lotame",VWO:"VWO",OPTIMIZELY:"Optimizely Web",FULLSTORY:"Fullstory",TVSQUARED:"TVSquared",GA4:"Google Analytics 4 (GA4)",GA4_V2:"Google Analytics 4 (GA4) V2",MOENGAGE:"MoEngage",AM:"Amplitude",PENDO:"Pendo",LYTICS:"Lytics",APPCUES:"Appcues",POSTHOG:"PostHog",PROFITWELL:"ProfitWell",KLAVIYO:"Klaviyo",CLEVERTAP:"CleverTap",BINGADS:"Bing Ads",PINTEREST_TAG:"Pinterest Tag",SNAP_PIXEL:"Snap Pixel",LINKEDIN_INSIGHT_TAG:"Linkedin Insight Tag",REDDIT_PIXEL:"Reddit Pixel",DRIP:"Drip",HEAP:"Heap.io",CRITEO:"Criteo",MP:"Mixpanel",QUALTRICS:"Qualtrics",SENTRY:"Sentry",GOOGLE_OPTIMIZE:"Google Optimize",POST_AFFILIATE_PRO:"Post Affiliate Pro",LAUNCHDARKLY:"LaunchDarkly",GA360:"Google Analytics 360",ADROLL:"Adroll",VERO:"Vero",MATOMO:"Matomo",MOUSEFLOW:"Mouseflow",ROCKERBOX:"Rockerbox",CONVERTFLOW:"ConvertFlow",SNAPENGAGE:"SnapEngage",LIVECHAT:"LiveChat",SHYNET:"Shynet",WOOPRA:"Woopra",ROLLBAR:"RollBar",QUORA_PIXEL:"Quora Pixel",JUNE:"June",ENGAGE:"Engage",ITERABLE:"Iterable",YANDEX_METRICA:"Yandex.Metrica",REFINER:"Refiner",QUALAROO:"Qualaroo",PODSIGHTS:"Podsights",AXEPTIO:"Axeptio",SATISMETER:"Satismeter",MICROSOFT_CLARITY:"Microsoft Clarity",SENDINBLUE:"Sendinblue",OLARK:"Olark",LEMNISK:"Lemnisk",TIKTOK_ADS:"TikTok Ads",ACTIVE_CAMPAIGN:"ActiveCampaign",SPRIG:"Sprig",SPOTIFYPIXEL:"Spotify Pixel",COMMANDBAR:"CommandBar",NINETAILED:"Ninetailed",XPIXEL:"XPixel",GAINSIGHT_PX:"Gainsight PX",USERPILOT:"Userpilot",COMSCORE:"Comscore"};function Ms(e){return e?.endsWith("/")?e.replace(/\/+$/,""):e}function Ns(){return window.crypto&&"function"==typeof window.crypto.getRandomValues?Ds():function(){var e,t=0,n="";if(!Os||_s+16>256){for(Os=Array(t=256);t--;)Os[t]=256*Math.random()|0;t=_s=0}for(;t<16;t++)e=Os[_s+t],n+=6==t?Rs[15&e|64]:8==t?Rs[63&e|128]:Rs[e],1&t&&t>1&&t<11&&(n+="-");return _s++,n}()}function Bs(){return(new Date).toISOString()}function Gs(e,t){Object.keys(e).forEach(n=>{e.hasOwnProperty(n)&&(t[n]&&(e[t[n]]=e[n]),"All"!==n&&void 0!==t[n]&&t[n]!==n&&delete e[n])})}function Us(e){Gs(e,An)}function js(e){Gs(e,Ls)}function Fs(e,t){const n=[];if(!t||0===t.length)return n;let r=!0;void 0!==e.All&&(r=e.All);const s=[];return"string"==typeof t[0]?t.forEach(e=>{s.push({intgName:e,intObj:e})}):"object"==typeof t[0]&&t.forEach(e=>{s.push({intgName:e.name,intObj:e})}),s.forEach(({intgName:t,intObj:s})=>{if(r){let r=!0;void 0!==e[t]&&!1===Boolean(e[t])&&(r=!1),r&&n.push(s)}else void 0!==e[t]&&!0===Boolean(e[t])&&n.push(s)}),n}const $s=e=>"string"==typeof e||null==e?e:jn(e),zs=e=>"string"==typeof e&&e.trim().length>0,Ks=(e,t,n)=>{try{const r=e.source.dataplanes||{};if(Object.keys(r).length>0){const e=(e=>{const t=e?e.residencyServer:void 0;if(t)return"string"==typeof t&&Cn.includes(t.toUpperCase())?t.toUpperCase():void En.error("Invalid residencyServer input")})(n),t=r[e]||r.US;if(t){const e=(e=>{if(Array.isArray(e)&&e.length>0){const t=e.find(e=>!0===e.default);if(t&&zs(t.url))return t.url}})(t);if(e)return e}}if(zs(t))return t;throw Error("Unable to load the SDK due to invalid data plane url")}catch(e){throw Error(e)}};function Hs(){return document?.referrer||"$direct"}function Qs(e){const t=e.split("/");return t.length>=3?t[2]:""}function Vs(){const e=document.getElementsByTagName("link");for(let t=0;e[t];t+=1){const n=e[t];if("canonical"===n.getAttribute("rel"))return n.getAttribute("href")}}function qs(){const e=Vs();let t=window.location.pathname;if(e)try{t=new URL(e).pathname}catch(e){}const{search:n,href:r}=window.location,{title:s}=document,i=function(e){const t=Vs();let n;n=t?t.includes("?")?t:t+e:window.location.href;const r=n.indexOf("#");return r>-1?n.slice(0,r):n}(n),o=r,a=Hs();return{path:t,referrer:a,referring_domain:Qs(a),search:n,title:s,url:i,tab_url:o,initial_referrer:ws.getInitialReferrer()||"",initial_referring_domain:ws.getInitialReferringDomain()||""}}class Xs{constructor(){this.name="RudderLabs JavaScript SDK",this.namespace="com.rudderlabs.javascript",this.version="2.52.23"}}class Ws{constructor(){this.name="RudderLabs JavaScript SDK",this.version="2.52.23"}}class Ys{constructor(){this.name="",this.version=""}}class Js{constructor(){this.density=0,this.width=0,this.height=0,this.innerWidth=0,this.innerHeight=0}}class Zs{constructor(){this.app=new Xs,this.traits=null,this.library=new Ws,this.userAgent=(()=>{if("undefined"==typeof navigator)return null;let{userAgent:e}=navigator;const{brave:t}=navigator;if(t&&Object.getPrototypeOf(t).isBrave){const t=e.match(/(chrome)\/([\w.]+)/i);t&&(e=`${e} Brave/${t[2]}`)}return e})(),this.device=null,this.network=null,this.os=new Ys,this.locale="undefined"==typeof navigator?null:navigator.language||navigator.browserLanguage,this.screen=(()=>{const e=new Js;return"undefined"==typeof window||(e.width=window.screen.width,e.height=window.screen.height,e.density=window.devicePixelRatio,e.innerWidth=window.innerWidth,e.innerHeight=window.innerHeight),e})(),this.timezone=(()=>{const e=/([A-Z]+[+-]\d+)/.exec((new Date).toString());return e?.[1]?e[1]:"NA"})()}}class ei{constructor(){this.channel="web",this.context=new Zs,this.type=null,this.messageId=Ns(),this.originalTimestamp=(new Date).toISOString(),this.anonymousId=null,this.userId=null,this.event=null,this.properties={}}getProperty(e){return this.properties[e]}addProperty(e,t){this.properties[e]=t}}class ti{constructor(){this.message=new ei}setType(e){this.message.type=e}setProperty(e){this.message.properties=e}setUserProperty(e){this.message.user_properties=e}setUserId(e){this.message.userId=e}setEventName(e){this.message.event=e}getElementContent(){return this.message}}class ni{constructor(){this.rudderProperty=null,this.rudderUserProperty=null,this.event=null,this.userId=null,this.type=null}setType(e){return this.type=e,this}build(){const e=new ti;return e.setUserId(this.userId),e.setType(this.type),e.setEventName(this.event),e.setProperty(this.rudderProperty),e.setUserProperty(this.rudderUserProperty),e}}var ri,si={};function ii(){if(ri)return si;ri=1;for(var e,t=256,n=[];t--;)n[t]=(t+256).toString(16).substring(1);return si.v4=function(){var r,s=0,i="";if(!e||t+16>256){for(e=Array(s=256);s--;)e[s]=256*Math.random()|0;s=t=0}for(;s<16;s++)r=e[t+s],i+=6==s?n[15&r|64]:8==s?n[63&r|128]:n[r],1&s&&s>1&&s<11&&(i+="-");return t++,i},si}var oi,ai,ci,ui,li,hi,di,fi,pi,gi={};function yi(){if(ai)return oi;ai=1;var e=Object.prototype.hasOwnProperty,t=String.prototype.charAt,n=Object.prototype.toString,r=function(e,n){return t.call(e,n)},s=function(t,n){return e.call(t,n)},i=function(e,t){t=t||s;for(var n=[],r=0,i=e.length;r<i;r+=1)t(e,r)&&n.push(String(r));return n};return oi=function(e){return null==e?[]:(t=e,"[object String]"===n.call(t)?i(e,r):function(e){return null!=e&&"function"!=typeof e&&"number"==typeof e.length}(e)?i(e,s):function(e,t){t=t||s;var n=[];for(var r in e)t(e,r)&&n.push(String(r));return n}(e));var t}}function mi(){if(ci)return gi;ci=1;var e=yi(),t=ii().v4,n={_data:{},length:0,setItem:function(t,n){return this._data[t]=n,this.length=e(this._data).length,n},getItem:function(e){return e in this._data?this._data[e]:null},removeItem:function(t){return t in this._data&&delete this._data[t],this.length=e(this._data).length,null},clear:function(){this._data={},this.length=0},key:function(t){return e(this._data)[t]}};return gi.defaultEngine=function(){try{if(!window.localStorage)return!1;var e=t();window.localStorage.setItem(e,"test_value");var n=window.localStorage.getItem(e);return window.localStorage.removeItem(e),"test_value"===n}catch(e){return!1}}()?window.localStorage:n,gi.inMemoryEngine=n,gi}function vi(){if(li)return ui;li=1;var e=yi(),t=Object.prototype.toString,n="function"==typeof Array.isArray?Array.isArray:function(e){return"[object Array]"===t.call(e)},r=function(e){return null!=e&&(n(e)||"function"!==e&&function(e){var n=typeof e;return"number"===n||"object"===n&&"[object Number]"===t.call(e)}(e.length))},s=function(e,t){for(var n=0;n<t.length&&!1!==e(t[n],n,t);n+=1);},i=function(t,n){for(var r=e(n),s=0;s<r.length&&!1!==t(n[r[s]],r[s],n);s+=1);};return ui=function(e,t){return(r(t)?s:i).call(this,e,t)}}function Ii(){if(di)return hi;di=1;var e=mi().defaultEngine,t=mi().inMemoryEngine,n=vi(),r=yi(),s=JSON;function i(t,n,r,s){this.id=n,this.name=t,this.keys=r||{},this.engine=s||e,this.originalEngine=this.engine}return i.prototype.set=function(e,t){var n=this._createValidKey(e);if(n)try{this.engine.setItem(n,function(e){try{return JSON.stringify(e,function(){const e=[];return function(t,n){if("object"!=typeof n||null===n)return n;for(;e.length>0&&e[e.length-1]!==this;)e.pop();return e.includes(n)?"[Circular Reference]":(e.push(n),n)}}())}catch(e){return null}}(t))}catch(n){(function(e){var t=!1;if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t})(n)&&(this._swapEngine(),this.set(e,t))}},i.prototype.get=function(e){try{var t=this.engine.getItem(this._createValidKey(e));return null===t?null:s.parse(t)}catch(e){return null}},i.prototype.getOriginalEngine=function(){return this.originalEngine},i.prototype.remove=function(e){this.engine.removeItem(this._createValidKey(e))},i.prototype._createValidKey=function(e){var t,s=this.name,i=this.id;return r(this.keys).length?(n(function(n){n===e&&(t=[s,i,e].join("."))},this.keys),t):[s,i,e].join(".")},i.prototype._swapEngine=function(){var e=this;n(function(n){var r=e.get(n);t.setItem([e.name,e.id,n].join("."),r),e.remove(n)},this.keys),this.engine=t},hi=i}var Ai,bi,Ei,Si,ki={exports:{}},wi={exports:{}};function Ti(){if(bi)return Ai;bi=1;var e=1e3,t=60*e,n=60*t,r=24*n,s=365.25*r;function i(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return Ai=function(o,a){a=a||{};var c=typeof o;if("string"===c&&o.length>0)return function(i){if((i=String(i)).length>100)return;var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(!o)return;var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(o);if("number"===c&&!1===isNaN(o))return a.long?function(s){return i(s,r,"day")||i(s,n,"hour")||i(s,t,"minute")||i(s,e,"second")||s+" ms"}(o):function(s){if(s>=r)return Math.round(s/r)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))},Ai}function Oi(){return Ei||(Ei=1,function(e,t){var n;function r(e){function r(){if(r.enabled){var e=r,s=+new Date,i=s-(n||s);e.diff=i,e.prev=n,e.curr=s,n=s;for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var c=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;c++;var s=t.formatters[r];if("function"==typeof s){var i=o[c];n=s.call(e,i),o.splice(c,1),c--}return n}),t.formatArgs.call(e,o),(r.log||t.log||console.log.bind(console)).apply(e,o)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),"function"==typeof t.init&&t.init(r),r}(t=e.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length,s=0;s<r;s++)n[s]&&("-"===(e=n[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Ti(),t.names=[],t.skips=[],t.formatters={}}(wi,wi.exports)),wi.exports}var _i,Ri,Ci,Pi={exports:{}};function xi(){return _i||(_i=1,function(e){function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<r.length;s++)if((n=r[s])===t||n.fn===t){r.splice(s,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var s=(n=n.slice(0)).length;r<s;++r)n[r].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}}(Pi)),Pi.exports}var Di=function(){if(Ci)return Ri;Ci=1;var e=ii().v4,t=Ii(),n=vi(),r=function(){if(pi)return fi;pi=1;var e=vi(),t={setTimeout:function(e,t){return window.setTimeout(e,t)},clearTimeout:function(e){return window.clearTimeout(e)},Date:window.Date},n=t,r={ASAP:1,RESCHEDULE:2,ABANDON:3};function s(){this.tasks={},this.nextId=1}return s.prototype.now=function(){return+new n.Date},s.prototype.run=function(e,t,s){var i=this.nextId++;return this.tasks[i]=n.setTimeout(this._handle(i,e,t,s||r.ASAP),t),i},s.prototype.cancel=function(e){this.tasks[e]&&(n.clearTimeout(this.tasks[e]),delete this.tasks[e])},s.prototype.cancelAll=function(){e(n.clearTimeout,this.tasks),this.tasks={}},s.prototype._handle=function(e,t,n,s){var i=this,o=i.now();return function(){if(delete i.tasks[e],!(s>=r.RESCHEDULE&&o+2*n<i.now()))return t();s===r.RESCHEDULE&&i.run(t,n,s)}},s.setClock=function(e){n=e},s.resetClock=function(){n=t},s.Modes=r,fi=s}(),s=(Si||(Si=1,function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=Oi()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var s=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(s++,"%c"===e&&(i=s))}),e.splice(i,0,r)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(ki,ki.exports)),ki.exports)("localstorage-retry");function i(e,t){return function(){return e.apply(t,arguments)}}function o(n,s,o){"function"==typeof s&&(o=s),this.name=n,this.id=e(),this.fn=o,this.maxItems=s.maxItems||1/0,this.maxAttempts=s.maxAttempts||1/0,this.backoff={MIN_RETRY_DELAY:s.minRetryDelay||1e3,MAX_RETRY_DELAY:s.maxRetryDelay||3e4,FACTOR:s.backoffFactor||2,JITTER:s.backoffJitter||0},this.timeouts={ACK_TIMER:1e3,RECLAIM_TIMER:3e3,RECLAIM_TIMEOUT:1e4,RECLAIM_WAIT:500},this.keys={IN_PROGRESS:"inProgress",QUEUE:"queue",RECLAIM_START:"reclaimStart",RECLAIM_END:"reclaimEnd",ACK:"ack"},this._schedule=new r,this._processId=0,this._store=new t(this.name,this.id,this.keys),this._store.set(this.keys.IN_PROGRESS,{}),this._store.set(this.keys.QUEUE,[]),this._ack=i(this._ack,this),this._checkReclaim=i(this._checkReclaim,this),this._processHead=i(this._processHead,this),this._running=!1}return xi()(o.prototype),o.prototype.start=function(){this._running&&this.stop(),this._running=!0,this._ack(),this._checkReclaim(),this._processHead()},o.prototype.stop=function(){this._schedule.cancelAll(),this._running=!1},o.prototype.shouldRetry=function(e,t){return!(t>this.maxAttempts)},o.prototype.getDelay=function(e){var t=this.backoff.MIN_RETRY_DELAY*Math.pow(this.backoff.FACTOR,e);if(this.backoff.JITTER){var n=Math.random(),r=Math.floor(n*this.backoff.JITTER*t);Math.floor(10*n)<5?t-=r:t+=r}return Number(Math.min(t,this.backoff.MAX_RETRY_DELAY).toPrecision(1))},o.prototype.addItem=function(t){this._enqueue({item:t,attemptNumber:0,time:this._schedule.now(),id:e()})},o.prototype.requeue=function(t,n,r,s){this.shouldRetry(t,n,r)?this._enqueue({item:t,attemptNumber:n,time:this._schedule.now()+this.getDelay(n),id:s||e()}):this.emit("discard",t,n)},o.prototype._enqueue=function(e){var t=this._store.get(this.keys.QUEUE)||[];(t=t.slice(-(this.maxItems-1))).push(e),t=t.sort(function(e,t){return e.time-t.time}),this._store.set(this.keys.QUEUE,t),this._running&&this._processHead()},o.prototype._processHead=function(){var t=this,i=this._store;this._schedule.cancel(this._processId);var o=i.get(this.keys.QUEUE)||[],a=i.get(this.keys.IN_PROGRESS)||{},c=this._schedule.now(),u=[];function l(e,n){u.push({item:e.item,done:function(r,s){var o=i.get(t.keys.IN_PROGRESS)||{};delete o[n],i.set(t.keys.IN_PROGRESS,o),t.emit("processed",r,s,e.item),r&&t.requeue(e.item,e.attemptNumber+1,r,e.id)}})}for(var h=Object.keys(a).length;o.length&&o[0].time<=c&&h++<t.maxItems;){var d=o.shift(),f=e();a[f]={item:d.item,attemptNumber:d.attemptNumber,time:t._schedule.now()},l(d,f)}i.set(this.keys.QUEUE,o),i.set(this.keys.IN_PROGRESS,a),n(function(e){try{t.fn(e.item,e.done)}catch(e){s("Process function threw error: "+e)}},u),o=i.get(this.keys.QUEUE)||[],this._schedule.cancel(this._processId),o.length>0&&(this._processId=this._schedule.run(this._processHead,o[0].time-c,r.Modes.ASAP))},o.prototype._ack=function(){this._store.set(this.keys.ACK,this._schedule.now()),this._store.set(this.keys.RECLAIM_START,null),this._store.set(this.keys.RECLAIM_END,null),this._schedule.run(this._ack,this.timeouts.ACK_TIMER,r.Modes.ASAP)},o.prototype._checkReclaim=function(){var e=this;n(function(t){t.id!==e.id&&(e._schedule.now()-t.get(e.keys.ACK)<e.timeouts.RECLAIM_TIMEOUT||function(t){t.set(e.keys.RECLAIM_START,e.id),t.set(e.keys.ACK,e._schedule.now()),e._schedule.run(function(){t.get(e.keys.RECLAIM_START)===e.id&&(t.set(e.keys.RECLAIM_END,e.id),e._schedule.run(function(){t.get(e.keys.RECLAIM_END)===e.id&&t.get(e.keys.RECLAIM_START)===e.id&&e._reclaim(t.id)},e.timeouts.RECLAIM_WAIT,r.Modes.ABANDON))},e.timeouts.RECLAIM_WAIT,r.Modes.ABANDON)}(t))},function(n){for(var r=[],s=e._store.getOriginalEngine(),i=0;i<s.length;i++){var o=s.key(i);if(null!==o){var a=o.split(".");3===a.length&&a[0]===n&&"ack"===a[2]&&r.push(new t(n,a[1],e.keys))}}return r}(this.name)),this._schedule.run(this._checkReclaim,this.timeouts.RECLAIM_TIMER,r.Modes.RESCHEDULE)},o.prototype._reclaim=function(r){var s=this,i=new t(this.name,r,this.keys),o={queue:this._store.get(this.keys.QUEUE)||[]},a={inProgress:i.get(this.keys.IN_PROGRESS)||{},queue:i.get(this.keys.QUEUE)||[]},c=[],u=function(t,r){n(function(t){var n=t.id||e();c.indexOf(n)>=0?s.emit("duplication",t.item,t.attemptNumber):(o.queue.push({item:t.item,attemptNumber:t.attemptNumber+r,time:s._schedule.now(),id:n}),c.push(n))},t)};u(a.queue,0),u(a.inProgress,1),o.queue=o.queue.sort(function(e,t){return e.time-t.time}),this._store.set(this.keys.QUEUE,o.queue);try{this._clearOtherQueue(i,1)}catch(e){if("NS_ERROR_STORAGE_BUSY"===e.name||"NS_ERROR_STORAGE_BUSY"===e.code||2153971713===e.code)try{this._clearOtherQueue(i,40)}catch(e){console.error(e)}else console.error(e)}this._processHead()},o.prototype._clearOtherQueue=function(e,t){setTimeout(()=>{e.remove(this.keys.IN_PROGRESS),setTimeout(()=>{e.remove(this.keys.QUEUE),setTimeout(()=>{e.remove(this.keys.RECLAIM_START),setTimeout(()=>{e.remove(this.keys.RECLAIM_END),setTimeout(()=>{e.remove(this.keys.ACK)},t)},t)},t)},t)},t)},Ri=o}(),Li=r(Di);const Mi={maxRetryDelay:36e4,minRetryDelay:1e3,backoffFactor:2,maxAttempts:10,maxItems:100};class Ni{constructor(){this.url="",this.writeKey=""}init(e,n,r){this.url=n,this.writeKey=e,r&&t(Mi,r),this.payloadQueue=new Li("rudder",Mi,(e,t)=>{e.message.sentAt=Bs(),this.processQueueElement(e.url,e.headers,e.message,3e4,(e,n)=>{if(e)return t(e);t(null,n)})}),this.payloadQueue.start()}processQueueElement(e,t,n,r,s){try{const i=new XMLHttpRequest;i.open("POST",e,!0);for(const e in t)i.setRequestHeader(e,t[e]);i.timeout=r,i.ontimeout=s,i.onerror=s,i.onreadystatechange=function(){if(4===i.readyState)if(429===i.status||i.status>=500&&i.status<600){const t=`${Mn} "${i.status}" status text: "${i.statusText}" for URL: "${e}"`,n=new Error(t);qn(n),s(n)}else s(null,i.status)};const o=jn(n,!0);o?i.send(o):En.error("Invalid payload: Event dropped")}catch(e){s(e)}}enqueue(e,t){const n={"Content-Type":"application/json",Authorization:`Basic ${btoa(`${this.writeKey}:`)}`,AnonymousId:btoa(e.anonymousId)};this.payloadQueue.addItem({url:`${this.url}/v1/${t}`,headers:n,message:e})}}const Bi="queue",Gi=64e3;class Ui{constructor(){this.storage=cs,this.maxItems=10,this.flushQueueTimeOut=void 0,this.timeOutActive=!1,this.flushQueueTimeOutInterval=6e5,this.url="",this.writekey="",this.queueName=`${Bi}.${Date.now()}`}sendQueueDataForBeacon(){this.sendDataFromQueueAndDestroyQueue()}init(e,t,n){this.url=t,this.writekey=e,n.maxItems&&(this.maxItems=n.maxItems),n.flushQueueInterval&&(this.flushQueueTimeOutInterval=n.flushQueueInterval),this.sendQueueDataForBeacon=this.sendQueueDataForBeacon.bind(this),this.attachListeners()}attachListeners(){window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.sendQueueDataForBeacon()})}getQueue(){return this.storage.get(this.queueName)}setQueue(e){this.storage.set(this.queueName,e)}enqueue(e){let t=this.getQueue()||[];t=t.slice(-(this.maxItems-1)),t.push(e);let n=t.slice(0);const r={batch:n,sentAt:Bs()},s=jn(r,!0);s&&s.length>Gi&&(n=t.slice(0,t.length-1),this.flushQueue(n),t=this.getQueue(),t.push(e)),this.setQueue(t),this.setTimer(),t.length===this.maxItems&&this.flushQueue(n)}sendDataFromQueueAndDestroyQueue(){this.sendDataFromQueue(),this.storage.remove(this.queueName)}sendDataFromQueue(){const e=this.getQueue();if(e&&e.length>0){const t=e.slice(0,e.length);this.flushQueue(t)}}flushQueue(e){if(e&&e.length>0){const t=Bs();e.forEach(e=>{e.sentAt=t});const n=jn({batch:e,sentAt:t},!0);if(null!==n){const e=new Blob([n],{type:"text/plain"}),t=`${this.url}?writeKey=${this.writekey}`;try{"function"!=typeof navigator.sendBeacon&&qn(new Error("Beacon API is not supported by browser"));navigator.sendBeacon(t,e)||qn(new Error("Unable to queue data to browser's beacon queue"))}catch(e){e.message=`${e.message} - While sending Beacon data to: ${t}`,qn(e)}}else En.error("Invalid payload: Event dropped")}this.setQueue([]),this.clearTimer()}setTimer(){this.timeOutActive||(this.flushQueueTimeOut=setTimeout(this.sendDataFromQueue.bind(this),this.flushQueueTimeOutInterval),this.timeOutActive=!0)}clearTimer(){this.timeOutActive&&(clearTimeout(this.flushQueueTimeOut),this.timeOutActive=!1)}}const ji=new class{constructor(){this.queue=void 0}initialize(e,t,n){let r={},s=Ms(t);n?.useBeacon&&navigator.sendBeacon?(n.beaconQueueOptions&&null!=n.beaconQueueOptions&&"object"==typeof n.beaconQueueOptions&&(r=n.beaconQueueOptions),s=`${s}/beacon/v1/batch`,this.queue=new Ui):(n?.useBeacon&&En.info("[EventRepository] sendBeacon feature not available in this browser :: fallback to XHR"),n?.queueOptions&&null!=n.queueOptions&&"object"==typeof n.queueOptions&&(r=n.queueOptions),this.queue=new Ni),this.queue.init(e,s,r)}enqueue(e,t){const n=e.getElementContent();n.originalTimestamp=n.originalTimestamp||Bs(),n.sentAt=Bs();const r=jn(n,!0);r&&r.length>32e3&&En.error("[EventRepository] enqueue:: message length greater 32 Kb ",n),this.queue.enqueue(n,t)}},Fi={maxRetryDelay:36e4,minRetryDelay:1e3,backoffFactor:2,maxAttempts:1/0};class $i{constructor(){this.callback=void 0,this.processQueueElements=!1}init(e,n){e&&t(Fi,e),n&&(this.callback=n),this.payloadQueue=new Li("rs_events",Fi,(e,t)=>{this.processQueueElement(e.type,e.rudderElement,(e,n)=>{if(e)return t(e);t(null,n)})}),this.payloadQueue.start()}activateProcessor(){this.processQueueElements=!0}processQueueElement(e,t,n){try{this.processQueueElements?(Object.setPrototypeOf(t,ti.prototype),this.callback(e,t),n(null)):n(new Error("The queue elements are not ready to be processed yet"))}catch(e){n(e)}}enqueue(e,t){this.payloadQueue.addItem({type:e,rudderElement:t})}}const zi=()=>navigator&&navigator.language,Ki=()=>navigator&&navigator.userAgent;function Hi(e=""){return e=e.endsWith("..")?e.substr(0,e.length-2):e,decodeURIComponent(atob(e).split("").map(e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""))}const Qi=/^[\w.-]+$/,Vi="*";function qi(e,t,n,r){const s=function(e,t){return[e,(new Date).getTimezoneOffset(),t].join(Vi)}(n,r),i=t||0;return function(e){const t=function(){const e=[];let t;for(let n=0;n<256;n++){t=n;for(let e=0;e<8;e++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();let n=-1;for(let r=0;r<e.length;r++)n=n>>>8^t[255&(n^e.charCodeAt(r))];return(-1^n)>>>0}([s,Math.floor(Date.now()/6e4)-i,e].join(Vi)).toString(36)}function Xi(e){const t=function(e){const t=e.split(Vi),n=t.length%2==0;return t.length<4||!n||1!==Number(t.shift())?null:{checksum:t.shift(),serializedIds:t.join(Vi)}}(e);if(!t)return null;const{checksum:n,serializedIds:r}=t;return function(e,t){const n=Ki(),r=zi();for(let s=0;s<=1;s+=1)if(qi(e,s,n,r)===t)return!0;return!1}(r,n)?function(e){const t={},n=e.split(Vi);for(let e=0;e<n.length;e+=2){const r=n[e];if(Qi.test(r)){const s=Hi(n[e+1]);t[r]=s}}return t}(r):null}class Wi{isInitialized=!1;constructor(){if(!window.OneTrust||!window.OnetrustActiveGroups)return void En.error("OneTrust resources are not accessible.");this.userSetConsentGroupIds=window.OnetrustActiveGroups.split(",").filter(e=>e);const e=window.OneTrust.GetDomainData().Groups;this.userSetConsentGroupNames=[],this.userDeniedConsentGroupIds=[],e.forEach(e=>{const{CustomGroupId:t,GroupName:n}=e;this.userSetConsentGroupIds.includes(t)?this.userSetConsentGroupNames.push(n.toUpperCase().trim()):this.userDeniedConsentGroupIds.push(t)}),this.userSetConsentGroupIds=this.userSetConsentGroupIds.map(e=>e.toUpperCase()),this.isInitialized=!0}isEnabled(e){try{if(!this.isInitialized)return!0;const{oneTrustCookieCategories:t}=e;if(!t)return!0;const n=t.map(e=>e.oneTrustCookieCategory).filter(e=>e);let r=!0;return r=n.every(e=>this.userSetConsentGroupIds.includes(e.toUpperCase().trim())||this.userSetConsentGroupNames.includes(e.toUpperCase().trim())),r}catch(e){return En.error(`Error during onetrust cookie consent management ${e}`),!0}}getDeniedList(){return this.isInitialized?this.userDeniedConsentGroupIds:[]}}class Yi{constructor(){if(this.userConsentedPurposes=[],this.userDeniedPurposes=[],window.updateKetchConsent=e=>{e&&(this.userConsentedPurposes=[],this.userDeniedPurposes=[],this.updatePurposes(e))},window.getKetchUserConsentedPurposes=()=>this.userConsentedPurposes.slice(),window.getKetchUserDeniedPurposes=()=>this.userDeniedPurposes.slice(),window.ketchConsent)this.updatePurposes(window.ketchConsent);else{const e=this.getConsent();this.updatePurposes(e)}}updatePurposes=e=>{e&&Object.entries(e).forEach(e=>{const t=e[0];e[1]?this.userConsentedPurposes.push(t):this.userDeniedPurposes.push(t)})};isEnabled(e){try{const{ketchConsentPurposes:t}=e;if(!t||0===t.length)return!0;const n=t.map(e=>e.purpose).filter(e=>e);let r=!0;return r=n.some(e=>this.userConsentedPurposes.includes(e.trim())),r}catch(e){return En.error(`Error occured checking ketch consent state ${e}`),!0}}getDeniedList(){return this.userDeniedPurposes}getConsent(){const e=rs.get("_ketch_consent_v1_");if(!e)return;let t;try{t=JSON.parse(atob(e))}catch(e){return void En.error(`Error occurred while parsing consent cookie ${e}`)}if(!t)return;const n={};return Object.entries(t).forEach(e=>{const t=e[0],r=e[1];r?.status&&(n[t]="granted"===r.status)}),n}}const Ji={initialize:e=>e?.oneTrust?.enabled?new Wi:e?.ketch?.enabled?new Yi:null};const Zi=new class{constructor(){this.storage=ws,this.timeout=18e5,this.sessionInfo=this.storage.getSessionInfo()||{autoTrack:!0}}initialize(e){try{if(this.sessionInfo.autoTrack=!(!1===e?.sessions?.autoTrack||this.sessionInfo.manualTrack),e?.sessions&&!isNaN(e.sessions.timeout)){const{timeout:t}=e.sessions;0===t&&(En.warn("[Session]:: Provided timeout value 0 will disable the auto session tracking feature."),this.sessionInfo.autoTrack=!1),t>0&&t<1e4&&En.warn('[Session]:: It is not advised to set "timeout" less than 10 seconds'),this.timeout=t}this.sessionInfo.autoTrack?this.startAutoTracking():!1!==this.sessionInfo.autoTrack||this.sessionInfo.manualTrack||this.end()}catch(e){qn(e)}}isValidSession(e){return e<=this.sessionInfo.expiresAt}generateSessionId(){return Date.now()}startAutoTracking(){const e=Date.now();this.isValidSession(e)||(this.sessionInfo={},this.sessionInfo.id=e,this.sessionInfo.expiresAt=e+this.timeout,this.sessionInfo.sessionStart=!0,this.sessionInfo.autoTrack=!0),this.storage.setSessionInfo(this.sessionInfo)}validateSessionId(e){if("number"==typeof e&&e%1==0){var t;if(!(((t=e)?t.toString().length:0)<10))return e;En.error('[Session]:: "sessionId" should at least be "10" digits long')}else En.error('[Session]:: "sessionId" should only be a positive integer')}start(e){const t=e?this.validateSessionId(e):this.generateSessionId();this.sessionInfo={id:t||this.generateSessionId(),sessionStart:!0,manualTrack:!0},this.storage.setSessionInfo(this.sessionInfo)}getSessionId(){return this.sessionInfo.autoTrack&&this.isValidSession(Date.now())||this.sessionInfo.manualTrack?this.sessionInfo.id:null}end(){this.sessionInfo={},this.storage.removeSessionInfo()}getSessionInfo(){const e={};if(this.sessionInfo.autoTrack||this.sessionInfo.manualTrack){if(this.sessionInfo.autoTrack){const e=Date.now();this.isValidSession(e)?this.sessionInfo.expiresAt=e+this.timeout:this.startAutoTracking()}this.sessionInfo.sessionStart&&(e.sessionStart=!0,this.sessionInfo.sessionStart=!1),e.sessionId=this.sessionInfo.id,this.storage.setSessionInfo(this.sessionInfo)}return e}reset(){const{manualTrack:e,autoTrack:t}=this.sessionInfo;t?(this.sessionInfo={},this.startAutoTracking()):e&&this.start()}},eo=["integrations","anonymousId","originalTimestamp"],to=(e,t,n)=>{let r="";if(n){if(r=Ms(n),!r){const e="CDN base URL for integrations is not valid";throw qn({message:`[Analytics] load:: ${e}`}),Error(`Failed to load Rudder SDK: ${e}`)}return r}const{sdkURL:s}=(()=>{const e=document.getElementsByTagName("script");let t;for(let n=0;n<e.length;n+=1){const r=Ms(e[n].getAttribute("src"));if(r&&r.match(/^.*rudder-analytics?(\.min)?\.js$/)){t=r;break}}return{sdkURL:t}})();return r=s?s.split("/").slice(0,-1).concat(Tn).join("/"):On,t&&(r=r.replace(wn,e)),r};const no="rs-bugsnag",ro="bugsnag",so=["Bugsnag",ro],io="0d96a60df267f4a13f808bbaa54e535c",oo=["rudder-analytics.min.js","rudder-analytics.js",...Object.keys(E).map(e=>`${E[e]}.min.js`),...Object.keys(E).map(e=>`${E[e]}.js`)],ao=()=>{const e=window.location.hostname;return e&&["www.test-host.com","localhost","127.0.0.1","[::1]"].includes(e)?"development":"production"},co=e=>{let t=e?._client?._notifier?.version;if(!t){let n=e({apiKey:io,releaseStage:"version-test",beforeSend:function(){return!1}});t=n.notifier?.version,n=void 0}return t&&"6"===t.charAt(0)},uo=e=>{so.every(e=>!function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(e),t)}(window,e))&&Ts(e,"https://d2wy8f7a9ursnm.cloudfront.net/v6/bugsnag.min.js",{isNonNativeSDK:"true",skipDatasetAttributes:!0})};class lo{constructor(e,t,n){this.pluginName=no,this.sourceId=e,this.writeKey=t,this.onClientReady=n,this.initClientOnLibReadyInterval=void 0,this.init()}init(){if(window.RudderStackGlobals?.[Bn])return;if(!!io.match(/{{.+}}/))return;uo(this.pluginName);const e=window[ro];"function"!=typeof e?(this.initClientOnLibReadyInterval=setInterval(()=>{const e=window[ro];"function"==typeof e&&(co(e)&&this.initClient(),clearInterval(this.initClientOnLibReadyInterval))},100),setTimeout(()=>{clearInterval(this.initClientOnLibReadyInterval)},Hn)):co(e)&&this.initClient()}initClient(){const e=window[ro];this.client=e({apiKey:io,appVersion:"2.52.23",metaData:{SDK:{name:"JS",installType:"npm"}},beforeSend:this.onError(),autoTrackSessions:!1,collectUserIp:!1,enabledBreadcrumbTypes:["error","log","user"],maxEvents:100,releaseStage:ao(),networkBreadcrumbsEnabled:!1,user:{id:this.writeKey}}),this.onClientReady()}onError(){const e=this.sourceId;return t=>{try{return!!(e=>{const t=Mr(e,"stacktrace.0.file");if(!t||"string"!=typeof t)return!1;const n=t.substring(t.lastIndexOf("/")+1);return oo.includes(n)})(t)&&(((e,t)=>{e.updateMetaData("source",{metadataSource:t});const{errorMessage:n}=e;e.context=n,n.includes("error in script loading")&&(e.context="Script load failures"),e.severity="error"})(t,e),!0)}catch{return!1}}}notify(e){this.client&&this.client.notify(e)}leaveBreadcrumb(e){this.client&&this.client.leaveBreadcrumb(e)}}const ho=no,fo=[no];class po{constructor(e){this.isEnabled=!1,this.providerName=ho,this.provider=void 0,this.logger=e,this.onClientReady=this.onClientReady.bind(this),this.exposeToGlobal=this.exposeToGlobal.bind(this)}init(e,t,n){e&&t?!0===(e=>Mr(e,"statsCollection.errors.enabled")||!1)(e)?(this.enable(),this.setProviderName((e=>Mr(e,"statsCollection.errors.provider"))(e)),this.initProvider(e,t,n)):this.disable():this.logger.error("[Analytics] ErrorReporting :: Invalid configuration or missing source id provided.")}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}setProviderName(e){e?!e||fo.includes(e)?this.providerName=e:this.logger.error(`[Analytics] ErrorReporting :: Invalid error reporting provider value. Value should be one of: ${fo.join(",")}`):this.providerName=ho}initProvider(e,t,n){if(this.providerName===no)this.provider=new lo(t,n,this.onClientReady)}onClientReady(){this.exposeToGlobal()}exposeToGlobal(){window.RudderStackGlobals||(window.RudderStackGlobals={}),window.RudderStackGlobals[Bn]=this}leaveBreadcrumb(e){if(this.provider)try{this.provider.leaveBreadcrumb(e)}catch(e){this.logger.error(`[Analytics] ErrorReporting :: leaveBreadcrumb method ${e.toString()}`)}}notify(e){if(this.provider)try{this.provider.notify(e)}catch(e){this.logger.error(`[Analytics] ErrorReporting :: notify method ${e.toString()}`)}}}const go=new class{constructor(){this.retryAttempt=3,this.queue=[],this.isTransformationProcessing=!1,this.authToken=null}init(e,t,n){this.dataPlaneUrl=Ms(t),this.writeKey=e,this.authToken=n||this.authToken,this.start()}enqueue(e,t,n){this.queue.push({event:e,destinationIds:t,cb:n})}sendEventForTransformation(e,t){return new Promise((n,r)=>{const s=`${this.dataPlaneUrl}/transform`,i={"Content-Type":"application/json",Authorization:`Basic ${btoa(`${this.writeKey}:`)}`};try{const o=new XMLHttpRequest;o.open("POST",s,!0),Object.keys(i).forEach(e=>o.setRequestHeader(e,i[e])),o.timeout=1e4,o.onreadystatechange=()=>{if(4===o.readyState)try{const{status:s}=o;let{response:i}=o;switch(s){case 200:return i=JSON.parse(i),void n({status:s,transformedPayload:i.transformedBatch});case 400:return void n({status:s,errorMessage:i?`${i}`:"Invalid request payload"});case 404:return void n({status:s});default:if(t>0){const s=t-1;setTimeout(()=>this.sendEventForTransformation(e,s).then(n).catch(r),500*2**(this.retryAttempt-s))}else n({status:s,errorMessage:"Retries exhausted"})}}catch(e){r(e)}};const a=jn(e,!0);a?o.send(a):En.error("Invalid payload: Event dropped")}catch(e){r(e)}})}checkQueueLengthAndProcess(){this.queue.length>0&&this.process()}process(){this.isTransformationProcessing=!0;const e=this.queue.shift(),t=(n=e.event,r=e.destinationIds,{metadata:{"Custom-Authorization":this.authToken},batch:[{orderNo:Date.now(),destinationIds:r,event:n.message}]});var n,r;this.sendEventForTransformation(t,this.retryAttempt).then(t=>{this.isTransformationProcessing=!1,e.cb(t),this.checkQueueLengthAndProcess()}).catch(t=>{qn("string"==typeof t?t:t.message),this.isTransformationProcessing=!1,e.cb({status:0}),this.checkQueueLengthAndProcess()})}start(){setInterval(()=>{this.isTransformationProcessing||this.checkQueueLengthAndProcess()},100)}setAuthToken(e){this.authToken=e}};const yo=new class{constructor(){this.initialized=!1,this.clientIntegrations=[],this.loadOnlyIntegrations={},this.clientIntegrationObjects=void 0,this.successfullyLoadedIntegration=[],this.failedToBeLoadedIntegration=[],this.toBeProcessedArray=[],this.toBeProcessedByIntegrationArray=[],this.storage=ws,this.eventRepository=ji,this.preProcessQueue=new $i,this.sendAdblockPage=!1,this.sendAdblockPageOptions={},this.clientSuppliedCallbacks={},this.readyCallbacks=[],this.methodToCallbackMapping={syncPixel:"syncPixelCallback"},this.loaded=!1,this.loadIntegration=!0,this.bufferDataPlaneEventsUntilReady=!1,this.dataPlaneEventsBufferTimeout=1e4,this.integrationsData={},this.dynamicallyLoadedIntegrations={},this.destSDKBaseURL=On,this.cookieConsentOptions={},this.logLevel=void 0,this.clientIntegrationsReady=!1,this.uSession=Zi,this.version="2.52.23",this.lockIntegrationsVersion=!1,this.errorReporting=new po(En),this.deniedConsentIds=[],this.transformationHandler=go}initializeUser(e){this.userId=this.storage.getUserId()||"",this.storage.setUserId(this.userId),this.userTraits={};const t=this.storage.getUserTraits();null===t||"object"!=typeof t||Array.isArray(t)||(this.userTraits=t),this.storage.setUserTraits(this.userTraits),this.groupId=this.storage.getGroupId()||"",this.storage.setGroupId(this.groupId),this.groupTraits={};const n=this.storage.getGroupTraits();null===n||"object"!=typeof n||Array.isArray(n)||(this.groupTraits=n),this.storage.setGroupTraits(this.groupTraits),this.anonymousId=this.getAnonymousId(e),this.storage.setAnonymousId(this.anonymousId)}setInitialPageProperties(){if(null==this.storage.getInitialReferrer()&&null==this.storage.getInitialReferringDomain()){const e=Hs();this.storage.setInitialReferrer(e),this.storage.setInitialReferringDomain(Qs(e))}}allModulesInitialized(e=0){return new Promise(t=>{this.clientIntegrations.every(e=>null!=this.dynamicallyLoadedIntegrations[`${E[e.name]}_RS`])||e>=2e4?t(this):this.pause(Qn).then(()=>this.allModulesInitialized(e+Qn).then(t))})}executeReadyCallback(){this.readyCallbacks.forEach(e=>e())}integrationSDKLoaded(e,t){return window[e]?.[t]?.prototype&&void 0!==window[e][t].prototype.constructor}processResponse(e,t){try{let e=t;try{if("string"==typeof t&&(e=JSON.parse(t)),!e||"object"!=typeof e||Array.isArray(e))return void En.error("Invalid source configuration")}catch(e){return void qn(e)}try{window.chrome?.runtime?.id||this.errorReporting.init(e.source.config,e.source.id,this.writeKey)}catch(e){qn(e)}if(this.serverUrl=Ks(e,this.serverUrl,this.options),this.eventRepository.initialize(this.writeKey,this.serverUrl,this.options),this.transformationHandler.init(this.writeKey,this.serverUrl,this.storage.getAuthToken()),e.source.destinations.forEach(function(e){e.enabled&&this.clientIntegrations.push({name:e.destinationDefinition.name,config:e.config,destinationInfo:{shouldApplyDeviceModeTransformation:e.shouldApplyDeviceModeTransformation||!1,propagateEventsUntransformedOnError:e.propagateEventsUntransformedOnError||!1,destinationId:e.id}})},this),this.clientIntegrations=Fs(this.loadOnlyIntegrations,this.clientIntegrations),Object.keys(this.cookieConsentOptions).length>0)try{const e=Ji.initialize(this.cookieConsentOptions);this.deniedConsentIds=e?.getDeniedList(),this.clientIntegrations=this.clientIntegrations.filter(t=>!e||e&&e.isEnabled(t.config))}catch(e){qn(e)}this.loaded=!0,this.options&&"function"==typeof this.options.onLoaded&&this.options.onLoaded(this),function(e){if(e.toBeProcessedArray.length>0)for(;e.toBeProcessedArray.length>0;){const t=[...e.toBeProcessedArray[0]];e.toBeProcessedArray.shift();const n=t[0];t.shift(),e[n](...t)}}(this),this.clientIntegrations=this.clientIntegrations.filter(e=>!!E[e.name]||(En.error(`[Analytics] Integration:: ${e.name} not available for initialization`),!1)),this.bufferDataPlaneEventsUntilReady&&setTimeout(()=>{this.processBufferedCloudModeEvents()},this.dataPlaneEventsBufferTimeout),this.errorReporting.leaveBreadcrumb("Starting device-mode initialization"),this.clientIntegrations.forEach(e=>{const t=E[e.name],n=`${t}_RS`,r=`${this.destSDKBaseURL}/${t}.min.js`;window.hasOwnProperty(n)||Ts(n,r,{isNonNativeSDK:!0});const s=this,i=setInterval(()=>{if(s.integrationSDKLoaded(n,t)){const r=window[n];let o;clearInterval(i);try{const i=`[Analytics] processResponse :: trying to initialize integration name:: ${n}`;this.errorReporting.leaveBreadcrumb(i),o=new r[t](e.config,s,e.destinationInfo),o.init(),s.isInitialized(o).then(()=>{s.dynamicallyLoadedIntegrations[n]=r[t]})}catch(e){const t=`[Analytics] 'integration.init()' failed :: ${n} :: ${e.message}`;qn(e,t),s.failedToBeLoadedIntegration.push(o)}}},100);setTimeout(()=>{clearInterval(i)},Hn)});const n=this;this.allModulesInitialized().then(()=>{if(!n.clientIntegrations||0===n.clientIntegrations.length)return this.clientIntegrationsReady=!0,this.executeReadyCallback(),void(this.toBeProcessedByIntegrationArray=[]);n.replayEvents(n)})}catch(e){qn(e)}}sendDataToDestination(e,t,n){try{if(e[n]){const r=v(t);e[n](r)}}catch(t){const n=`[sendToNative]:: [Destination: ${e.name}]:: `;qn(t,n)}}sendTransformedDataToDestination(e,t,n){try{js(t.message.integrations);const r=e.map(e=>e.destinationId);this.transformationHandler.enqueue(t,r,({status:r,transformedPayload:s,errorMessage:i})=>{e.forEach(e=>{try{switch(r){case 200:{const r=s.find(t=>t.id===e.destinationId),i=[];r?.payload.forEach(n=>{if("200"===n.status)i.push(n);else{const r=`[DMT]:: Event transformation unsuccessful for destination "${e.name}". Reason: `;let s="Unknown";"410"===n.status&&(s="Transformation is not available");let o="Dropping the event",a=En.error;!0===e.propagateEventsUntransformedOnError&&(o="Sending untransformed event to the destination",a=En.warn,i.push({event:t.message}));a(`${r} ${s}. ${o}.`)}}),i?.forEach(t=>{Kn(t.event)&&this.sendDataToDestination(e,{message:t.event},n)});break}case 404:En.warn("[DMT]:: Transformation server access is denied. The configuration data seems to be out of sync. Sending untransformed event to the destination."),this.sendDataToDestination(e,t,n);break;default:!0===e.propagateEventsUntransformedOnError?(En.warn(`[DMT]::[Destination: ${e.name}] :: Transformation request failed with status: ${r} ${i}. Sending untransformed event.`),this.sendDataToDestination(e,t,n)):En.error(`[DMT]::[Destination: ${e.name}] :: Transformation request failed with status: ${r} ${i}. Dropping the event.`)}}catch(t){t instanceof Error&&(t.message=`[DMT]::[Destination:${e.name}]:: ${t.message}`),qn(t)}})})}catch(e){e instanceof Error&&(e.message=`[DMT]:: ${e.message}`),qn(e)}}processAndSendEventsToDeviceMode(e,t,n){const r=[],s=[];e.forEach(e=>{try{!this.IsEventBlackListed(t.message.event,e.name)&&(e.shouldApplyDeviceModeTransformation?s.push(e):r.push(e))}catch(e){qn(e)}}),r.forEach(e=>{this.sendDataToDestination(e,t,n)}),s.length>0&&this.sendTransformedDataToDestination(s,t,n)}queueEventForDataPlane(e,t){const n=t.message.integrations||{All:!0};t.message.integrations=((e,t)=>{const n=v(e),r=Object.keys(t).filter(e=>!(!0===t[e]&&n[e])).reduce((e,n)=>(e[n]=t[n],e),{});return zn(n,r)})(this.integrationsData,n),this.eventRepository.enqueue(t,e)}processBufferedCloudModeEvents(){this.bufferDataPlaneEventsUntilReady&&this.preProcessQueue.activateProcessor()}replayEvents(e){this.errorReporting.leaveBreadcrumb("Started replaying buffered events"),e.clientIntegrationObjects=[],e.clientIntegrationObjects=e.successfullyLoadedIntegration;try{e.clientIntegrationObjects.every(e=>!e.isReady||e.isReady())&&(this.integrationsData=((e,t)=>{let n=v(e);return t.forEach(e=>{if(e.getDataForIntegrationsObject)try{n=zn(n,e.getDataForIntegrationsObject())}catch(e){En.debug("[Analytics: prepareDataForIntegrationsObj]",e)}}),n})(this.integrationsData,e.clientIntegrationObjects),e.clientIntegrationsReady=!0,e.executeReadyCallback())}catch(e){qn(e,"Replay buffered cloud mode events")}this.processBufferedCloudModeEvents(),e.toBeProcessedByIntegrationArray.forEach(t=>{const n=t[0];t.shift(),Object.keys(t[0].message.integrations).length>0&&Us(t[0].message.integrations);const r=Fs(t[0].message.integrations,e.clientIntegrationObjects);this.processAndSendEventsToDeviceMode(r,t[0],n)}),e.toBeProcessedByIntegrationArray=[]}pause(e){return new Promise(t=>{setTimeout(t,e)})}isInitialized(e,t=0){return new Promise(n=>{e.isLoaded()?(this.successfullyLoadedIntegration.push(e),n(this)):t>=Hn?(this.failedToBeLoadedIntegration.push(e),n(this)):this.pause(Qn).then(()=>this.isInitialized(e,t+Qn).then(n))})}page(e,t,n,r,s){if(this.errorReporting.leaveBreadcrumb("Page event"),!this.loaded)return void this.toBeProcessedArray.push(["page",...arguments]);"function"==typeof r&&(s=r,r=null),"function"==typeof n&&(s=n,r=n=null),"function"==typeof t&&(s=t,r=n=t=null),"function"==typeof e&&(s=e,r=n=t=e=null),"object"==typeof e&&null!=e&&null!=e&&(r=t,n=e,t=e=null),"object"==typeof t&&null!=t&&null!=t&&(r=n,n=t,t=null),"string"==typeof e&&"string"!=typeof t&&(t=e,e=null),this.sendAdblockPage&&"RudderJS-Initiated"!==e&&this.sendSampleRequest();let i=v(n);const o=v(r),a=(new ni).setType("page").build();i||(i={}),t&&(a.message.name=i.name=t),e&&(a.message.category=i.category=e),a.message.properties=this.getPageProperties(i),this.processAndSendDataToDestinations("page",a,o,s)}track(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Track event"),!this.loaded)return void this.toBeProcessedArray.push(["track",...arguments]);"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null);const s=v(t),i=v(n),o=(new ni).setType("track").build();e&&o.setEventName(e),o.setProperty(s||{}),this.processAndSendDataToDestinations("track",o,i,r)}identify(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Identify event"),!this.loaded)return void this.toBeProcessedArray.push(["identify",...arguments]);"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),"object"==typeof e&&(n=t,t=e,e=this.userId);const s=$s(e);s&&this.userId&&s!==this.userId&&this.reset(),this.userId=s,this.storage.setUserId(this.userId);const i=v(t),o=v(n);if(i){for(const e in i)this.userTraits[e]=i[e];this.storage.setUserTraits(this.userTraits)}const a=(new ni).setType("identify").build();this.processAndSendDataToDestinations("identify",a,o,r)}alias(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Alias event"),!this.loaded)return void this.toBeProcessedArray.push(["alias",...arguments]);"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),"function"==typeof e&&(r=e,n=null,t=null,e=null),"object"==typeof t&&(n=t,t=null),"object"==typeof e&&(n=e,t=null,e=null);const s=(new ni).setType("alias").build();s.message.previousId=$s(t)||(this.userId?this.userId:this.getAnonymousId()),s.message.userId=$s(e);const i=v(n);this.processAndSendDataToDestinations("alias",s,i,r)}group(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Group event"),!this.loaded)return void this.toBeProcessedArray.push(["group",...arguments]);if(0===arguments.length)return;"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),"object"==typeof e&&(n=t,t=e,e=this.groupId),"function"==typeof e&&(r=e,n=null,t=null,e=this.groupId),this.groupId=$s(e),this.storage.setGroupId(this.groupId);const s=v(t),i=v(n),o=(new ni).setType("group").build();if(s)for(const e in s)this.groupTraits[e]=s[e];else this.groupTraits={};this.storage.setGroupTraits(this.groupTraits),this.processAndSendDataToDestinations("group",o,i,r)}IsEventBlackListed(e,t){if(!e||"string"!=typeof e)return!1;const n=An[t],r=this.clientIntegrations.find(e=>e.name===n),{blacklistedEvents:s,whitelistedEvents:i,eventFilteringOption:o}=r.config;if(!o)return!1;const a=e.trim().toUpperCase();switch(o){case"disable":default:return!1;case"blacklistedEvents":return!!Array.isArray(s)&&s.some(e=>e.eventName.trim().toUpperCase()===a);case"whitelistedEvents":return!Array.isArray(i)||!i.some(e=>e.eventName.trim().toUpperCase()===a)}}shouldUseGlobalIntegrationsConfigInEvents(){return this.useGlobalIntegrationsConfigInEvents&&this.loadOnlyIntegrations&&Object.keys(this.loadOnlyIntegrations).length>0}processAndSendDataToDestinations(e,t,n,r){try{this.anonymousId||this.setAnonymousId(),this.errorReporting.leaveBreadcrumb("Started sending data to destinations"),t.message.context.traits={...this.userTraits},t.message.anonymousId=this.anonymousId,t.message.userId=t.message.userId?t.message.userId:this.userId,"group"==e&&(this.groupId&&(t.message.groupId=this.groupId),this.groupTraits&&(t.message.traits={...this.groupTraits}));try{const{sessionId:e,sessionStart:n}=this.uSession.getSessionInfo();t.message.context.sessionId=e,n&&(t.message.context.sessionStart=!0)}catch(e){qn(e)}(e=>{let t=!1;return Object.keys(e).forEach(n=>{Pn.includes(n)&&"boolean"==typeof e[n].enabled&&!0===e[n].enabled&&(t=!0)}),t})(this.cookieConsentOptions)&&(t.message.context.consentManagement={deniedConsentIds:this.deniedConsentIds||[]}),this.processOptionsParam(t,n),function(e,t){const{properties:n,traits:r,context:s}=e;n&&Object.keys(n).forEach(e=>{Sn.indexOf(e.toLowerCase())>=0&&En.error(`Warning! : Reserved keyword used in properties--\x3e ${e} with ${t} call`)}),r&&Object.keys(r).forEach(e=>{Sn.indexOf(e.toLowerCase())>=0&&En.error(`Warning! : Reserved keyword used in traits--\x3e ${e} with ${t} call`)});const i=s.traits;i&&Object.keys(i).forEach(e=>{Sn.indexOf(e.toLowerCase())>=0&&En.error(`Warning! : Reserved keyword used in traits --\x3e ${e} with ${t} call`)})}(t.message,e);let s=t.message.integrations;s?Us(s):s=this.shouldUseGlobalIntegrationsConfigInEvents()?this.loadOnlyIntegrations:Ln,t.message.integrations=s;try{t.message.context["ua-ch"]=this.uach}catch(e){qn(e)}try{if(this.clientIntegrationObjects){const n=Fs(s,this.clientIntegrationObjects);this.processAndSendEventsToDeviceMode(n,t,e)}else this.toBeProcessedByIntegrationArray.push([e,t])}catch(e){qn(e,"processAndSendEventsToDeviceMode::")}const i=v(t);js(i.message.integrations);!this.bufferDataPlaneEventsUntilReady||this.clientIntegrationObjects?this.queueEventForDataPlane(e,i):this.preProcessQueue.enqueue(e,i),r&&"function"==typeof r&&r(i)}catch(e){qn(e)}}utm(e){const t={};try{const n=new URL(e),r="utm_";n.searchParams.forEach((e,n)=>{if(n.startsWith(r)){let s=n.substring(r.length);"campaign"===s&&(s="name"),t[s]=e}})}catch(e){}return t}addCampaignInfo(e){const t=e.message.context;t&&"object"==typeof t&&(e.message.context.campaign=this.utm(window.location.href))}processOptionsParam(e,t){const{type:n,properties:r}=e.message;this.addCampaignInfo(e),e.message.context.page=this.getContextPageProperties("page"===n?r:void 0),((e,t={})=>{"object"==typeof t&&null!==t&&Object.keys(t).forEach(n=>{eo.includes(n)&&(e[n]=t[n])})})(e.message,t),e.message.context=((e,t={})=>{let{context:n}=e;return"object"!=typeof t||null===t||Object.keys(t).forEach(e=>{if(!eo.includes(e)&&!xn.includes(e))if("context"!==e)n=zn(n,{[e]:t[e]});else if("object"==typeof t[e]&&null!==t[e]){const r={};Object.keys(t[e]).forEach(n=>{xn.includes(n)||(r[n]=t[e][n])}),n=zn(n,{...r})}else En.error(`[Analytics: processOptionsParam] context passed in options ${e} is not object.`)}),n})(e.message,t)}getPageProperties(e,t){const n=qs(),r=t?.page||{};for(const t in n)void 0===e[t]&&(e[t]=r[t]||n[t]);return e}getContextPageProperties(e){const t=qs(),n={};for(const r in t)n[r]=e?.[r]?e[r]:t[r];return n}reset(e){this.errorReporting.leaveBreadcrumb(`reset API :: flag: ${e}`),this.loaded?(e&&(this.anonymousId=""),this.userId="",this.userTraits={},this.groupId="",this.groupTraits={},this.uSession.reset(),this.storage.clear(e)):this.toBeProcessedArray.push(["reset",e])}getAnonymousId(e){return this.anonymousId=this.storage.getAnonymousId(e),this.anonymousId||this.setAnonymousId(),this.anonymousId}getUserId(){return this.userId}getSessionId(){return this.uSession.getSessionId()}getUserTraits(){return this.userTraits}getGroupId(){return this.groupId}getGroupTraits(){return this.groupTraits}setAnonymousId(e,t){const n=t?Xi(t):null,r=n?n.rs_amp_id:null;this.anonymousId=e||r||Ns(),this.storage.setAnonymousId(this.anonymousId)}isValidWriteKey(e){return e&&"string"==typeof e&&e.trim().length>0}isValidServerUrl(e){return e&&"string"==typeof e&&e.trim().length>0}isDatasetAvailable(){const e=document.createElement("div");return e.setAttribute("data-a-b","c"),!!e.dataset&&"c"===e.dataset.aB}loadAfterPolyfill(e,n,r){if("object"==typeof n&&null!==n&&(r=n,n=null),r?.logLevel&&(this.logLevel=r.logLevel,En.setLogLevel(r.logLevel)),!this.isValidWriteKey(e))throw Error("Unable to load the SDK due to invalid writeKey");if(!this.storage||0===Object.keys(this.storage).length)throw Error("Cannot proceed as no storage is available");r?.cookieConsentManager&&(this.cookieConsentOptions=r.cookieConsentManager),this.writeKey=e,this.serverUrl=n,this.options=r;let s={};r?.setCookieDomain&&(s={...s,domain:r.setCookieDomain}),r&&"boolean"==typeof r.secureCookie&&(s={...s,secure:r.secureCookie}),r&&"boolean"==typeof r.sameDomainCookiesOnly&&(s={...s,sameDomainCookiesOnly:r.sameDomainCookiesOnly}),r&&-1!==Rn.indexOf(r.sameSiteCookie)&&(s={...s,samesite:r.sameSiteCookie}),this.storage.options(s);if(r&&"string"==typeof r.uaChTrackLevel&&Dn.includes(r.uaChTrackLevel)&&(this.uaChTrackLevel=r.uaChTrackLevel),navigator.userAgentData&&((e,t="none")=>{"none"===t&&e(void 0),"default"===t&&e(navigator.userAgentData),"full"===t&&navigator.userAgentData.getHighEntropyValues(["architecture","bitness","brands","mobile","model","platform","platformVersion","uaFullVersion","fullVersionList","wow64"]).then(t=>{e(t)})})(e=>{this.uach=e},this.uaChTrackLevel),r?.integrations&&(t(this.loadOnlyIntegrations,r.integrations),Us(this.loadOnlyIntegrations)),this.useGlobalIntegrationsConfigInEvents=r&&!0===r.useGlobalIntegrationsConfigInEvents,r?.sendAdblockPage&&(this.sendAdblockPage=!0),r?.sendAdblockPageOptions&&"object"==typeof r.sendAdblockPageOptions&&(this.sendAdblockPageOptions=r.sendAdblockPageOptions),this.uSession.initialize(r),r?.clientSuppliedCallbacks){const e={};Object.keys(this.methodToCallbackMapping).forEach(t=>{this.methodToCallbackMapping.hasOwnProperty(t)&&r.clientSuppliedCallbacks[this.methodToCallbackMapping[t]]&&(e[t]=r.clientSuppliedCallbacks[this.methodToCallbackMapping[t]])}),t(this.clientSuppliedCallbacks,e),this.registerCallbacks(!0)}if(null!=r?.loadIntegration&&(this.loadIntegration=!!r.loadIntegration),r&&"boolean"==typeof r.bufferDataPlaneEventsUntilReady&&(this.bufferDataPlaneEventsUntilReady=!0===r.bufferDataPlaneEventsUntilReady,this.bufferDataPlaneEventsUntilReady&&this.preProcessQueue.init(this.options,this.queueEventForDataPlane.bind(this))),r&&"number"==typeof r.dataPlaneEventsBufferTimeout&&(this.dataPlaneEventsBufferTimeout=r.dataPlaneEventsBufferTimeout),r&&void 0!==r.lockIntegrationsVersion&&(this.lockIntegrationsVersion=!0===r.lockIntegrationsVersion),this.initializeUser(r?r.anonymousIdOptions:void 0),this.setInitialPageProperties(),this.destSDKBaseURL=to(this.version,this.lockIntegrationsVersion,r?.destSDKBaseURL),r?.getSourceConfig){if("function"!=typeof r.getSourceConfig)qn(new Error('option "getSourceConfig" must be a function'));else{const e=r.getSourceConfig();e instanceof Promise?e.then(e=>this.processResponse(200,e)).catch(qn):this.processResponse(200,e)}return}let i=((e,t)=>{let n=kn;const r=[];return e&&r.push(`writeKey=${e}`),t&&r.push(`lockIntegrationsVersion=${t}`),r.length>0&&(n=kn.concat(kn.includes("?")?"&":"?"),n=n.concat(r.join("&"))),n})(e,this.lockIntegrationsVersion);r?.configUrl&&(i=function(e,t){let n=e;-1===n.indexOf("sourceConfig")&&(n=`${Ms(n)}/sourceConfig/`),n="/"===n.slice(-1)?n:`${n}/`;const r=t.split("?")[1],s=n.split("?");return n=s.length>1&&s[1]!==r?`${s[0]}?${r}`:`${n}?${r}`,n}(r.configUrl,i));try{!function(e,t,n,r){const s=r.bind(e),i=new XMLHttpRequest;i.open("GET",t,!0),i.setRequestHeader("Authorization",`Basic ${btoa(`${n}:`)}`),i.onload=function(){const{status:e,responseText:n}=i;200===e?s(200,n):(qn(new Error(`${Mn} ${e} for url: ${t}`)),s(e))},i.send()}(this,i,e,this.processResponse)}catch(e){qn(e)}}arePolyfillsRequired(e){return(!e||"boolean"!=typeof e.polyfillIfRequired||e.polyfillIfRequired)&&(!String.prototype.endsWith||!String.prototype.startsWith||!String.prototype.includes||!Array.prototype.find||!Array.prototype.includes||"function"!=typeof window.URL||"undefined"==typeof Promise||!Object.entries||!Object.values||!String.prototype.replaceAll||!this.isDatasetAvailable()||"function"!=typeof TextDecoder||"function"!=typeof TextEncoder)}load(e,t,n){if(this.loaded)return;const r=v(n);if(this.arePolyfillsRequired(r)&&_n){const n="polyfill";Ts(n,_n,{skipDatasetAttributes:!0});const s=this,i=setInterval(()=>{!window.hasOwnProperty(n)&&null===document.getElementById(n)||"undefined"==typeof Promise||(clearInterval(i),s.loadAfterPolyfill(e,t,r))},100);setTimeout(()=>{clearInterval(i)},Hn)}else this.loadAfterPolyfill(e,t,r)}ready(e){this.loaded?"function"!=typeof e?En.error("ready callback is not a function"):this.clientIntegrationsReady?e():this.readyCallbacks.push(e):this.toBeProcessedArray.push(["ready",e])}initializeCallbacks(){Object.keys(this.methodToCallbackMapping).forEach(e=>{this.methodToCallbackMapping.hasOwnProperty(e)&&this.on(e,()=>{})})}registerCallbacks(e){e||Object.keys(this.methodToCallbackMapping).forEach(e=>{this.methodToCallbackMapping.hasOwnProperty(e)&&window.rudderanalytics&&"function"==typeof window.rudderanalytics[this.methodToCallbackMapping[e]]&&(this.clientSuppliedCallbacks[e]=window.rudderanalytics[this.methodToCallbackMapping[e]])}),Object.keys(this.clientSuppliedCallbacks).forEach(e=>{this.clientSuppliedCallbacks.hasOwnProperty(e)&&this.on(e,this.clientSuppliedCallbacks[e])})}sendSampleRequest(){Ts("ad-block","//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",{isNonNativeSDK:!0})}startSession(e){this.uSession.start(e)}endSession(){this.uSession.end()}setAuthToken(e){"string"==typeof e?(this.storage.setAuthToken(e),this.transformationHandler.setAuthToken(e)):En.error("Provided input should be in string format")}};c(yo),window.addEventListener("error",e=>{qn(e,void 0,yo)},!0),yo.initializeCallbacks(),yo.registerCallbacks(!1);const mo="load",vo=window.rudderanalytics,Io=Array.isArray(vo);let Ao;if(Io){let e=0;for(;e<vo.length;){if(vo[e]&&vo[e][0]===mo){Ao=vo[e],vo.splice(e,1);break}e+=1}}!function(e){const t="ajs_trait_",n="ajs_prop_";function r(e,t){const n={};return Object.keys(e).forEach(r=>{r.startsWith(t)&&(n[r.substr(t.length)]=e[r])}),n}const s=(e=>{const t={};try{new URL(e).searchParams.forEach((e,n)=>{t[n]=e})}catch(e){}return t})(e);s.ajs_aid&&yo.toBeProcessedArray.push(["setAnonymousId",s.ajs_aid]),s.ajs_uid&&yo.toBeProcessedArray.push(["identify",s.ajs_uid,r(s,t)]),s.ajs_event&&yo.toBeProcessedArray.push(["track",s.ajs_event,r(s,n)])}(window.location.href),Io&&vo.forEach(e=>yo.toBeProcessedArray.push(e)),Ao&&Ao.length>0&&(Ao.shift(),yo[mo](...Ao));const bo=yo.ready.bind(yo),Eo=yo.identify.bind(yo),So=yo.page.bind(yo),ko=yo.track.bind(yo),wo=yo.alias.bind(yo),To=yo.group.bind(yo),Oo=yo.reset.bind(yo),_o=yo.load.bind(yo),Ro=yo.initialized=!0,Co=yo.getUserId.bind(yo),Po=yo.getSessionId.bind(yo),xo=yo.getUserTraits.bind(yo),Do=yo.getAnonymousId.bind(yo),Lo=yo.setAnonymousId.bind(yo),Mo=yo.getGroupId.bind(yo),No=yo.getGroupTraits.bind(yo),Bo=yo.startSession.bind(yo),Go=yo.endSession.bind(yo),Uo=yo.setAuthToken.bind(yo);En.error("This RudderStack JavaScript SDK package is deprecated and no longer maintained. While your events are still being tracked and delivered, we strongly recommend you to migrate to the latest [@rudderstack/analytics-js](https://www.npmjs.com/package/@rudderstack/analytics-js) package for enhanced features, security updates, and ongoing support. For more details, visit the migration guide: https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/migration-guide/."),e.alias=wo,e.endSession=Go,e.getAnonymousId=Do,e.getGroupId=Mo,e.getGroupTraits=No,e.getSessionId=Po,e.getUserId=Co,e.getUserTraits=xo,e.group=To,e.identify=Eo,e.initialized=Ro,e.load=_o,e.page=So,e.ready=bo,e.reset=Oo,e.setAnonymousId=Lo,e.setAuthToken=Uo,e.startSession=Bo,e.track=ko});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).rudderanalytics={})}(this,function(e){"use strict";function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},t.apply(null,arguments)}var n="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function s(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&1===Object.keys(e).length?e.default:e}var i,o={exports:{}};function a(){return i||(i=1,function(e){function n(e){if(e)return function(e){return t(e,n.prototype),e._callbacks=new Map,e}(e);this._callbacks=new Map}n.prototype.on=function(e,t){const n=this._callbacks.get(e)??[];return n.push(t),this._callbacks.set(e,n),this},n.prototype.once=function(e,t){const n=(...r)=>{this.off(e,n),t.apply(this,r)};return n.fn=t,this.on(e,n),this},n.prototype.off=function(e,t){if(void 0===e&&void 0===t)return this._callbacks.clear(),this;if(void 0===t)return this._callbacks.delete(e),this;const n=this._callbacks.get(e);if(n){for(const[e,r]of n.entries())if(r===t||r.fn===t){n.splice(e,1);break}0===n.length?this._callbacks.delete(e):this._callbacks.set(e,n)}return this},n.prototype.emit=function(e,...t){const n=this._callbacks.get(e);if(n){const e=[...n];for(const n of e)n.apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks.get(e)??[]},n.prototype.listenerCount=function(e){if(e)return this.listeners(e).length;let t=0;for(const e of this._callbacks.values())t+=e.length;return t},n.prototype.hasListeners=function(e){return this.listenerCount(e)>0},n.prototype.addEventListener=n.prototype.on,n.prototype.removeListener=n.prototype.off,n.prototype.removeEventListener=n.prototype.off,n.prototype.removeAllListeners=n.prototype.off,e.exports=n}(o)),o.exports}var c=r(a());function u(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function l(e){return function t(n){return 0===arguments.length||u(n)?t:e.apply(this,arguments)}}function h(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return u(n)?t:l(function(t){return e(n,t)});default:return u(n)&&u(r)?t:u(n)?l(function(t){return e(t,r)}):u(r)?l(function(t){return e(n,t)}):e(n,r)}}}function d(e){return function t(n,r,s){switch(arguments.length){case 0:return t;case 1:return u(n)?t:h(function(t,r){return e(n,t,r)});case 2:return u(n)&&u(r)?t:u(n)?h(function(t,n){return e(t,r,n)}):u(r)?h(function(t,r){return e(n,t,r)}):l(function(t){return e(n,r,t)});default:return u(n)&&u(r)&&u(s)?t:u(n)&&u(r)?h(function(t,n){return e(t,n,s)}):u(n)&&u(s)?h(function(t,n){return e(t,r,n)}):u(r)&&u(s)?h(function(t,r){return e(n,t,r)}):u(n)?l(function(t){return e(t,r,s)}):u(r)?l(function(t){return e(n,t,s)}):u(s)?l(function(t){return e(n,r,t)}):e(n,r,s)}}}function f(e,t){return Object.prototype.hasOwnProperty.call(t,e)}var p=l(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function g(e){return"[object Object]"===Object.prototype.toString.call(e)}function y(e,t,n){if(n||(n=new m),function(e){var t=typeof e;return null==e||"object"!=t&&"function"!=t}(e))return e;var r,s=function(t){var r=n.get(e);if(r)return r;for(var s in n.set(e,t),e)Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=y(e[s],!0,n));return t};switch(p(e)){case"Object":return s(Object.create(Object.getPrototypeOf(e)));case"Array":return s(Array(e.length));case"Date":return new Date(e.valueOf());case"RegExp":return r=e,new RegExp(r.source,r.flags?r.flags:(r.global?"g":"")+(r.ignoreCase?"i":"")+(r.multiline?"m":"")+(r.sticky?"y":"")+(r.unicode?"u":"")+(r.dotAll?"s":""));case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return e.slice();default:return e}}var m=function(){function e(){this.map={},this.length=0}return e.prototype.set=function(e,t){var n=this.hash(e),r=this.map[n];r||(this.map[n]=r=[]),r.push([e,t]),this.length+=1},e.prototype.hash=function(e){var t=[];for(var n in e)t.push(Object.prototype.toString.call(e[n]));return t.join()},e.prototype.get=function(e){if(this.length<=180)for(var t in this.map)for(var n=this.map[t],r=0;r<n.length;r+=1){if((i=n[r])[0]===e)return i[1]}else{var s=this.hash(e);if(n=this.map[s])for(r=0;r<n.length;r+=1){var i;if((i=n[r])[0]===e)return i[1]}}},e}(),v=l(function(e){return null!=e&&"function"==typeof e.clone?e.clone():y(e)}),I=d(function(e,t,n){var r,s={};for(r in n=n||{},t=t||{})f(r,t)&&(s[r]=f(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)f(r,n)&&!f(r,s)&&(s[r]=n[r]);return s}),A=d(function e(t,n,r){return I(function(n,r,s){return g(r)&&g(s)?e(t,r,s):t(n,r,s)},n,r)}),b=d(function(e,t,n){return A(function(t,n,r){return e(n,r)},t,n)});const E={HS:"HubSpot",GA:"GA",HOTJAR:"Hotjar",GOOGLEADS:"GoogleAds",VWO:"VWO",GTM:"GoogleTagManager",BRAZE:"Braze",INTERCOM:"INTERCOM",KEEN:"Keen",KISSMETRICS:"Kissmetrics",CUSTOMERIO:"CustomerIO",CHARTBEAT:"Chartbeat",FACEBOOK_PIXEL:"FacebookPixel",LOTAME:"Lotame",OPTIMIZELY:"Optimizely",BUGSNAG:"Bugsnag",FULLSTORY:"Fullstory",TVSQUARED:"TVSquared",GA4:"GA4",GA4_V2:"GA4_V2",MOENGAGE:"MoEngage",AM:"Amplitude",PENDO:"Pendo",LYTICS:"Lytics",APPCUES:"Appcues",POSTHOG:"Posthog",KLAVIYO:"Klaviyo",CLEVERTAP:"Clevertap",BINGADS:"BingAds",PINTEREST_TAG:"PinterestTag",ADOBE_ANALYTICS:"AdobeAnalytics",LINKEDIN_INSIGHT_TAG:"LinkedInInsightTag",REDDIT_PIXEL:"RedditPixel",DRIP:"Drip",HEAP:"Heap",CRITEO:"Criteo",MP:"Mixpanel",QUALTRICS:"Qualtrics",PROFITWELL:"ProfitWell",SENTRY:"Sentry",QUANTUMMETRIC:"QuantumMetric",SNAP_PIXEL:"SnapPixel",POST_AFFILIATE_PRO:"PostAffiliatePro",GOOGLE_OPTIMIZE:"GoogleOptimize",LAUNCHDARKLY:"LaunchDarkly",GA360:"GA360",ADROLL:"Adroll",DCM_FLOODLIGHT:"DCMFloodlight",MATOMO:"Matomo",VERO:"Vero",MOUSEFLOW:"Mouseflow",ROCKERBOX:"Rockerbox",CONVERTFLOW:"ConvertFlow",SNAPENGAGE:"SnapEngage",LIVECHAT:"LiveChat",SHYNET:"Shynet",WOOPRA:"Woopra",ROLLBAR:"RollBar",QUORA_PIXEL:"QuoraPixel",JUNE:"June",ENGAGE:"Engage",ITERABLE:"Iterable",YANDEX_METRICA:"YandexMetrica",REFINER:"Refiner",QUALAROO:"Qualaroo",PODSIGHTS:"Podsights",AXEPTIO:"Axeptio",SATISMETER:"Satismeter",MICROSOFT_CLARITY:"MicrosoftClarity",SENDINBLUE:"Sendinblue",OLARK:"Olark",LEMNISK:"Lemnisk",OPENAI_ADS:"OpenAIAds",TIKTOK_ADS:"TiktokAds",ACTIVE_CAMPAIGN:"ActiveCampaign",SPRIG:"Sprig",SPOTIFYPIXEL:"SpotifyPixel",COMMANDBAR:"CommandBar",NINETAILED:"Ninetailed",XPIXEL:"XPixel",GAINSIGHT_PX:"Gainsight_PX",USERPILOT:"Userpilot",COMSCORE:"Comscore"},S="ACTIVE_CAMPAIGN",k="ADOBE_ANALYTICS",w="ADROLL",T="AM",O="APPCUES",_="AXEPTIO",R="BINGADS",C="BRAZE",P="BUGSNAG",x="CHARTBEAT",D="CLEVERTAP",L="COMMANDBAR",M="COMSCORE",N="CONVERTFLOW",B="CRITEO",G="CUSTOMERIO",U="DCM_FLOODLIGHT",j="DRIP",F="ENGAGE",$="FACEBOOK_PIXEL",z="FULLSTORY",K="GA",H="GA360",Q="GA4",V="GA4_V2",q="GAINSIGHT_PX",X="GOOGLE_OPTIMIZE",W="GOOGLEADS",Y="GTM",J="HEAP",Z="HOTJAR",ee="HS",te="INTERCOM",ne="ITERABLE",re="JUNE",se="KEEN",ie="KISSMETRICS",oe="KLAVIYO",ae="LAUNCHDARKLY",ce="LEMNISK",ue="LINKEDIN_INSIGHT_TAG",le="LIVECHAT",he="LOTAME",de="LYTICS",fe="MATOMO",pe="MICROSOFT_CLARITY",ge="MOENGAGE",ye="MOUSEFLOW",me="MP",ve="NINETAILED",Ie="OLARK",Ae="OPTIMIZELY",be="PENDO",Ee="PINTEREST_TAG",Se="PODSIGHTS",ke="POST_AFFILIATE_PRO",we="POSTHOG",Te="PROFITWELL",Oe="QUALAROO",_e="QUALTRICS",Re="QUANTUMMETRIC",Ce="QUORA_PIXEL",Pe="REDDIT_PIXEL",xe="REFINER",De="ROCKERBOX",Le="ROLLBAR",Me="SATISMETER",Ne="SENDINBLUE",Be="SENTRY",Ge="SHYNET",Ue="SNAP_PIXEL",je="SNAPENGAGE",Fe="SPOTIFYPIXEL",$e="SPRIG",ze="TIKTOK_ADS",Ke="TVSQUARED",He="USERPILOT",Qe="VERO",Ve="VWO",qe="WOOPRA",Xe="XPIXEL",We="YANDEX_METRICA",Ye={"Adobe Analytics":k,ADOBEANALYTICS:k,"ADOBE ANALYTICS":k,[k]:k,AdobeAnalytics:k,adobeanalytics:k,"adobe analytics":k,"Adobe analytics":k,"adobe Analytics":k},Je={[T]:T,AMPLITUDE:T,Amplitude:T,am:T},Ze={[O]:O,Appcues:O,"App Cues":O,appcues:O},et={[R]:R,BingAds:R,bingads:R,"Bing Ads":R,"Bing ads":R,"bing Ads":R,"bing ads":R},tt={[C]:C,Braze:C,braze:C},nt={[P]:P,bugsnag:P,Bugsnag:P},rt={[x]:x,Chartbeat:x,chartbeat:x,"Chart Beat":x,"chart beat":x},st={[D]:D,Clevertap:D,clevertap:D},it={[B]:B,Criteo:B,criteo:B},ot={[G]:G,Customerio:G,"Customer.io":G,"CUSTOMER.IO":G,"customer.io":G},at={[j]:j,Drip:j,drip:j},ct={[$]:$,"FB Pixel":$,"Facebook Pixel":$,"facebook pixel":$,fbpixel:$,FBPIXEL:$,FB_PIXEL:$},ut={[z]:z,Fullstory:z,FullStory:z,"full Story":z,"Full Story":z,"Full story":z,"full story":z,fullstory:z},lt={[K]:K,"Google Analytics":K,GoogleAnalytics:K,"GOOGLE ANALYTICS":K,"google analytics":K},ht={[Q]:Q,"Google Analytics 4":Q,"Google analytics 4":Q,"google analytics 4":Q,"Google Analytics4":Q,"Google analytics4":Q,"google analytics4":Q,"Google Analytics 4 (GA4)":Q,"google analytics 4 (ga4)":Q,GoogleAnalytics4:Q},dt={[V]:V,"Google Analytics 4 V2":V,"Google analytics 4 V2":V,"google analytics 4 V2":V,"Google Analytics4 V2":V,"Google analytics4 V2":V,"google analytics4 V2":V,"Google Analytics 4 (GA4) V2":V,"google analytics 4 (ga4) V2":V,GoogleAnalytics4V2:V},ft={[W]:W,"Google Ads":W,GoogleAds:W,"GOOGLE ADS":W,"google ads":W,googleads:W},pt={[X]:X,"Google Optimize":X,GoogleOptimize:X,Googleoptimize:X,GOOGLEOPTIMIZE:X,"google optimize":X,"Google optimize":X,"GOOGLE OPTIMIZE":X},gt={[Y]:Y,"Google Tag Manager":Y,"google tag manager":Y,"googletag manager":Y,googletagmanager:Y},yt={[J]:J,Heap:J,heap:J,"Heap.io":J},mt={[Z]:Z,Hotjar:Z,hotjar:Z,"Hot Jar":Z,"hot jar":Z},vt={[ee]:ee,Hubspot:ee,HUBSPOT:ee,"hub spot":ee,"Hub Spot":ee,"Hub spot":ee},It={[te]:te,Intercom:te,intercom:te},At={[se]:se,Keen:se,"Keen.io":se,keen:se,"keen.io":se},bt={[ie]:ie,Kissmetrics:ie,kissmetrics:ie},Et={[oe]:oe,Klaviyo:oe,klaviyo:oe},St={[ae]:ae,LaunchDarkly:ae,Launch_Darkly:ae,"Launch Darkly":ae,launchDarkly:ae,"launch darkly":ae},kt={[ue]:ue,"LinkedIn Insight Tag":ue,"LinkedIn insight tag":ue,"linkedIn insight tag":ue,Linkedin_insight_tag:ue,LinkedinInsighttag:ue,LinkedinInsightTag:ue,LinkedInInsightTag:ue,Linkedininsighttag:ue,LINKEDININSIGHTTAG:ue,linkedininsighttag:ue},wt={[he]:he,Lotame:he,lotame:he},Tt={[de]:de,Lytics:de,lytics:de},Ot={[me]:me,MIXPANEL:me,Mixpanel:me,"MIX PANEL":me,"Mix panel":me,"Mix Panel":me},_t={[ge]:ge,MoEngage:ge,moengage:ge,Moengage:ge,"Mo Engage":ge,"mo engage":ge,"Mo engage":ge},Rt={[Ae]:Ae,Optimizely:Ae,optimizely:Ae},Ct={[be]:be,Pendo:be,pendo:be},Pt={[Ee]:Ee,PinterestTag:Ee,Pinterest_Tag:Ee,PINTERESTTAG:Ee,pinterest:Ee,PinterestAds:Ee,Pinterest_Ads:Ee,Pinterest:Ee,"Pinterest Tag":Ee,"Pinterest tag":Ee,"PINTEREST TAG":Ee,"pinterest tag":Ee,"Pinterest Ads":Ee,"Pinterest ads":Ee},xt={[ke]:ke,PostAffiliatePro:ke,Post_affiliate_pro:ke,"Post Affiliate Pro":ke,"Post affiliate pro":ke,"post affiliate pro":ke,postaffiliatepro:ke,POSTAFFILIATEPRO:ke},Dt={[we]:we,PostHog:we,Posthog:we,posthog:we,"Post Hog":we,"Post hog":we,"post hog":we},Lt={[Te]:Te,ProfitWell:Te,profitwell:Te,Profitwell:Te,"Profit Well":Te,"profit well":Te,"Profit well":Te},Mt={[_e]:_e,Qualtrics:_e,qualtrics:_e},Nt={[Re]:Re,"Quantum Metric":Re,"quantum Metric":Re,"quantum metric":Re,QuantumMetric:Re,quantumMetric:Re,quantummetric:Re,Quantum_Metric:Re},Bt={[Pe]:Pe,Reddit_Pixel:Pe,RedditPixel:Pe,REDDITPIXEL:Pe,redditpixel:Pe,"Reddit Pixel":Pe,"REDDIT PIXEL":Pe,"reddit pixel":Pe},Gt={[Be]:Be,sentry:Be,Sentry:Be},Ut={[Ue]:Ue,Snap_Pixel:Ue,SnapPixel:Ue,SNAPPIXEL:Ue,snappixel:Ue,"Snap Pixel":Ue,"SNAP PIXEL":Ue,"snap pixel":Ue},jt={[Ke]:Ke,TVSquared:Ke,tvsquared:Ke,tvSquared:Ke,TvSquared:Ke,Tvsquared:Ke,"TV Squared":Ke,"tv squared":Ke,"tv Squared":Ke},Ft={[Ve]:Ve,VisualWebsiteOptimizer:Ve,Visualwebsiteoptimizer:Ve,visualwebsiteoptimizer:Ve,vwo:Ve,"Visual Website Optimizer":Ve,"Visual website optimizer":Ve,"visual website optimizer":Ve},$t={[H]:H,"Google Analytics 360":H,"Google analytics 360":H,"google analytics 360":H,"Google Analytics360":H,"Google analytics360":H,"google analytics360":H,GoogleAnalytics360:H,"GA 360":H},zt={[w]:w,Adroll:w,"Ad roll":w,"ad roll":w,adroll:w},Kt={[U]:U,"DCM Floodlight":U,"dcm floodlight":U,"Dcm Floodlight":U,DCMFloodlight:U,dcmfloodlight:U,DcmFloodlight:U,dcm_floodlight:U,DCM_Floodlight:U},Ht={[fe]:fe,Matomo:fe,matomo:fe},Qt={[Qe]:Qe,Vero:Qe,vero:Qe},Vt={[ye]:ye,Mouseflow:ye,mouseflow:ye,mouseFlow:ye,MouseFlow:ye,"Mouse flow":ye,"mouse flow":ye,"mouse Flow":ye,"Mouse Flow":ye},qt={[De]:De,Rockerbox:De,rockerbox:De,RockerBox:De,"Rocker box":De,"rocker box":De,"Rocker Box":De},Xt={[N]:N,Convertflow:N,convertflow:N,convertFlow:N,ConvertFlow:N,"Convert flow":N,"convert flow":N,"convert Flow":N,"Convert Flow":N,"CONVERT FLOW":N},Wt={[je]:je,SnapEngage:je,Snap_Engage:je,snapengage:je,"SNAP ENGAGE":je,"Snap Engage":je,"snap engage":je},Yt={[le]:le,LiveChat:le,Live_Chat:le,livechat:le,"LIVE CHAT":le,"Live Chat":le,"live chat":le},Jt={[Ge]:Ge,shynet:Ge,ShyNet:Ge,shyNet:Ge,Shynet:Ge,"shy net":Ge,"Shy Net":Ge,"shy Net":Ge,"Shy net":Ge},Zt={[qe]:qe,Woopra:qe,woopra:qe},en={[Le]:Le,RollBar:Le,Roll_Bar:Le,rollbar:Le,Rollbar:Le,"ROLL BAR":Le,"Roll Bar":Le,"roll bar":Le},tn={[Ce]:Ce,"Quora Pixel":Ce,"Quora pixel":Ce,"QUORA PIXEL":Ce,QuoraPixel:Ce,Quorapixel:Ce,QUORAPIXEL:Ce,Quora_Pixel:Ce,quora_pixel:Ce,Quora:Ce},nn={[re]:re,June:re,june:re},rn={[F]:F,Engage:F,engage:F},sn={[ne]:ne,Iterable:ne,iterable:ne},on={[We]:We,Yandexmetrica:We,yandexmetrica:We,yandexMetrica:We,YandexMetrica:We},an={[xe]:xe,Refiner:xe,refiner:xe},cn={[Oe]:Oe,Qualaroo:Oe,qualaroo:Oe},un={[Se]:Se,Podsights:Se,PodSights:Se,"pod Sights":Se,"Pod Sights":Se,"pod sights":Se,"POD SIGHTS":Se,"Pod sights":Se},ln={[_]:_,Axeptio:_,axeptio:_},hn={[Me]:Me,Satismeter:Me,SatisMeter:Me},dn={[pe]:pe,"Microsoft Clarity":pe,"Microsoft clarity":pe,"microsoft clarity":pe,Microsoft_clarity:pe,MicrosoftClarity:pe,MICROSOFTCLARITY:pe,microsoftclarity:pe,microsoftClarity:pe},fn={[Ne]:Ne,Sendinblue:Ne,sendinblue:Ne,SendinBlue:Ne},pn={[Ie]:Ie,Olark:Ie,olark:Ie},gn={[ce]:ce,LEMNISK_MARKETING_AUTOMATION:ce,"Lemnisk Marketing Automation":ce,LemniskMarketingAutomation:ce,lemniskmarketingautomation:ce,lemniskMarketingAutomation:ce,lemnisk:ce,Lemnisk:ce},yn={[ze]:ze,TiktokAds:ze,"Tiktok ads":ze,"Tiktok Ads":ze,"Tik Tok Ads":ze,"tik tok ads":ze,tiktokads:ze},mn={ActiveCampaign:S,"Active Campaign":S,"ACTIVE CAMPAIGN":S,[S]:S,activecampaign:S,"active campaign":S,"Active campaign":S,"active Campaign":S,active_campaign:S},vn={[$e]:$e,Sprig:$e,sprig:$e},In={[Fe]:Fe,"Spotify Pixel":Fe,"spotify pixel":Fe,SPOTIFY_PIXEL:Fe},An={All:"All",...Ye,...Je,...Ze,...et,...tt,...nt,...{[L]:L,"Command Bar":L,Commandbar:L,COMMAND_BAR:L,commandbar:L},...rt,...st,...it,...ot,...at,...ct,...ut,...lt,...ht,...dt,...$t,...ft,...pt,...gt,...yt,...mt,...vt,...It,...At,...bt,...Et,...St,...kt,...wt,...Tt,...Ot,..._t,...{[ve]:ve,Ninetailed:ve,ninetailed:ve,NineTailed:ve},...Rt,...Ct,...Pt,...xt,...Dt,...Lt,...Mt,...Nt,...Bt,...Gt,...Ut,...jt,...Ft,...zt,...Kt,...Ht,...Qt,...Vt,...Xt,...Wt,...Yt,...Jt,...Zt,...en,...tn,...nn,...rn,...sn,...qt,...on,...an,...cn,...un,...ln,...hn,...dn,...fn,...pn,...gn,...yn,...mn,...vn,...In,...{[Xe]:Xe,XPixel:Xe,Xpixel:Xe,xpixel:Xe,xPixel:Xe},...{[q]:q,Gainsight_PX:q},...{[He]:He,userpilot:He,Userpilot:He},...{[M]:M,Comscore:M,comscore:M,comScore:M}};let bn=3;const En={setLogLevel(e){switch(e.toUpperCase()){case"INFO":bn=1;break;case"DEBUG":bn=2;break;default:bn=3}},info(...e){bn<=1&&console.info(...e)},debug(...e){bn<=2&&console.log(...e)},warn(...e){bn<=3&&console.warn(...e)},error(...e){bn<=4&&console.error(...e)}},Sn=["anonymous_id","id","sent_at","received_at","timestamp","original_timestamp","event_text","event"],kn="https://api.rudderstack.com/sourceConfig/?p=npm&v=2.53.0",wn="v1.1",Tn="js-integrations",On=`https://cdn.rudderlabs.com/${wn}/${Tn}`,_n="https://polyfill-fastly.io/v3/polyfill.min.js?version=3.111.0&features=Number.isNaN%2CURL%2CArray.prototype.find%2CArray.prototype.includes%2CPromise%2CString.prototype.endsWith%2CString.prototype.includes%2CString.prototype.startsWith%2CObject.entries%2CObject.values%2CElement.prototype.dataset%2CString.prototype.replaceAll%2CTextEncoder%2Cnavigator.sendBeacon",Rn=["Lax","None","Strict"],Cn=["US","EU"],Pn=["oneTrust","ketch"],xn=["library","consentManagement"],Dn=["none","default","full"],Ln={All:!0},Mn="Request failed with status:",Nn=[Mn],Bn="errorReporting",Gn=e=>{const t=window.RudderStackGlobals?.[Bn];t&&e instanceof Error&&t.notify(e)},Un=e=>{const t=[];return function(n,r){if(!e||null!=r){if("object"!=typeof r||null===r)return r;for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?(En.debug(`Circular Reference detected for key: ${n}`),"[Circular Reference]"):(t.push(r),r)}}},jn=(e,t)=>{try{return JSON.stringify(e,Un(t))}catch(e){return En.warn("Failed to convert the value to a JSON string."),null}},Fn=e=>null===e,$n=(e,t)=>{if(!Array.isArray(e)||!Array.isArray(t))return v(t);const n=v(e);return t.forEach((e,t)=>{n[t]=Array.isArray(e)||(e=>!Fn(e)&&(e=>"object"==typeof e)(e)&&!Array.isArray(e))(e)?zn(n[t],e):e}),n},zn=(e,t)=>b($n,e,t),Kn=e=>(e=>!Fn(e)&&"[object Object]"===Object.prototype.toString.call(e))(e)&&Object.keys(e).length>0,Hn=1e4,Qn=1e3,Vn="RS_JS_SDK",qn=(e,t,n)=>{let r;try{r=((e,t,n)=>{let r;try{r="string"==typeof e?e:e instanceof Error||e.message?e.message:jn(e)}catch(e){r=""}if("object"==typeof(s=e)&&null!==s&&"target"in s){if(e.target&&"script"!==e.target.localName)return"";if(e.target.dataset&&(e.target.dataset.loader!==Vn||"true"!==e.target.dataset.isnonnativesdk))return"";if(r=`error in script loading:: src:: ${e.target.src} id:: ${e.target.id}`,"ad-block"===e.target.id)return n.page("RudderJS-Initiated","ad-block page request",{path:"/ad-blocked",title:r},n.sendAdblockPageOptions),""}var s;return`[handleError]::${t||""} "${r}"`})(e,t,n)}catch(t){En.error("[handleError] Exception:: ",t),En.error("[handleError] Original error:: ",jn(e)),Gn(t)}r&&(En.error(r),(e=>!e.message||!Nn.some(t=>e.message.includes(t)))(e)&&Gn(e))};var Xn={exports:{}};var Wn,Yn={exports:{}},Jn=s(Object.freeze({__proto__:null,default:{}}));function Zn(){return Wn||(Wn=1,function(e){var t;e.exports=(t=t||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==n&&n.crypto&&(r=n.crypto),!r)try{r=Jn}catch(e){}var s=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},a=o.lib={},c=a.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=c.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,s=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<s;i++){var o=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=o<<24-(r+i)%4*8}else for(var a=0;a<s;a+=4)t[r+a>>>2]=n[a>>>2];return this.sigBytes+=s,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(s());return new u.init(t,e)}}),l=o.enc={},h=l.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],s=0;s<n;s++){var i=t[s>>>2]>>>24-s%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},d=l.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],s=0;s<n;s++){var i=t[s>>>2]>>>24-s%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},f=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,s=r.words,i=r.sigBytes,o=this.blockSize,a=i/(4*o),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*o,l=e.min(4*c,i);if(c){for(var h=0;h<c;h+=o)this._doProcessBlock(s,h);n=s.splice(0,c),r.sigBytes-=l}return new u.init(n,l)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=p.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}});var g=o.algo={};return o}(Math),t)}(Yn)),Yn.exports}var er,tr={exports:{}};function nr(){return er||(er=1,function(e){var t;e.exports=(t=Zn(),function(){var e=t,n=e.lib.WordArray;function r(e,t,r){for(var s=[],i=0,o=0;o<t;o++)if(o%4){var a=r[e.charCodeAt(o-1)]<<o%4*2|r[e.charCodeAt(o)]>>>6-o%4*2;s[i>>>2]|=a<<24-i%4*8,i++}return n.create(s,i)}e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var s=[],i=0;i<n;i+=3)for(var o=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;a<4&&i+.75*a<n;a++)s.push(r.charAt(o>>>6*(3-a)&63));var c=r.charAt(64);if(c)for(;s.length%4;)s.push(c);return s.join("")},parse:function(e){var t=e.length,n=this._map,s=this._reverseMap;if(!s){s=this._reverseMap=[];for(var i=0;i<n.length;i++)s[n.charCodeAt(i)]=i}var o=n.charAt(64);if(o){var a=e.indexOf(o);-1!==a&&(t=a)}return r(e,t,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64)}(tr)),tr.exports}var rr,sr={exports:{}};function ir(){return rr||(rr=1,function(e){var t;e.exports=(t=Zn(),function(e){var n=t,r=n.lib,s=r.WordArray,i=r.Hasher,o=n.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=o.MD5=i.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,s=e[r];e[r]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var i=this._hash.words,o=e[t+0],c=e[t+1],f=e[t+2],p=e[t+3],g=e[t+4],y=e[t+5],m=e[t+6],v=e[t+7],I=e[t+8],A=e[t+9],b=e[t+10],E=e[t+11],S=e[t+12],k=e[t+13],w=e[t+14],T=e[t+15],O=i[0],_=i[1],R=i[2],C=i[3];O=u(O,_,R,C,o,7,a[0]),C=u(C,O,_,R,c,12,a[1]),R=u(R,C,O,_,f,17,a[2]),_=u(_,R,C,O,p,22,a[3]),O=u(O,_,R,C,g,7,a[4]),C=u(C,O,_,R,y,12,a[5]),R=u(R,C,O,_,m,17,a[6]),_=u(_,R,C,O,v,22,a[7]),O=u(O,_,R,C,I,7,a[8]),C=u(C,O,_,R,A,12,a[9]),R=u(R,C,O,_,b,17,a[10]),_=u(_,R,C,O,E,22,a[11]),O=u(O,_,R,C,S,7,a[12]),C=u(C,O,_,R,k,12,a[13]),R=u(R,C,O,_,w,17,a[14]),O=l(O,_=u(_,R,C,O,T,22,a[15]),R,C,c,5,a[16]),C=l(C,O,_,R,m,9,a[17]),R=l(R,C,O,_,E,14,a[18]),_=l(_,R,C,O,o,20,a[19]),O=l(O,_,R,C,y,5,a[20]),C=l(C,O,_,R,b,9,a[21]),R=l(R,C,O,_,T,14,a[22]),_=l(_,R,C,O,g,20,a[23]),O=l(O,_,R,C,A,5,a[24]),C=l(C,O,_,R,w,9,a[25]),R=l(R,C,O,_,p,14,a[26]),_=l(_,R,C,O,I,20,a[27]),O=l(O,_,R,C,k,5,a[28]),C=l(C,O,_,R,f,9,a[29]),R=l(R,C,O,_,v,14,a[30]),O=h(O,_=l(_,R,C,O,S,20,a[31]),R,C,y,4,a[32]),C=h(C,O,_,R,I,11,a[33]),R=h(R,C,O,_,E,16,a[34]),_=h(_,R,C,O,w,23,a[35]),O=h(O,_,R,C,c,4,a[36]),C=h(C,O,_,R,g,11,a[37]),R=h(R,C,O,_,v,16,a[38]),_=h(_,R,C,O,b,23,a[39]),O=h(O,_,R,C,k,4,a[40]),C=h(C,O,_,R,o,11,a[41]),R=h(R,C,O,_,p,16,a[42]),_=h(_,R,C,O,m,23,a[43]),O=h(O,_,R,C,A,4,a[44]),C=h(C,O,_,R,S,11,a[45]),R=h(R,C,O,_,T,16,a[46]),O=d(O,_=h(_,R,C,O,f,23,a[47]),R,C,o,6,a[48]),C=d(C,O,_,R,v,10,a[49]),R=d(R,C,O,_,w,15,a[50]),_=d(_,R,C,O,y,21,a[51]),O=d(O,_,R,C,S,6,a[52]),C=d(C,O,_,R,p,10,a[53]),R=d(R,C,O,_,b,15,a[54]),_=d(_,R,C,O,c,21,a[55]),O=d(O,_,R,C,I,6,a[56]),C=d(C,O,_,R,T,10,a[57]),R=d(R,C,O,_,m,15,a[58]),_=d(_,R,C,O,k,21,a[59]),O=d(O,_,R,C,g,6,a[60]),C=d(C,O,_,R,E,10,a[61]),R=d(R,C,O,_,f,15,a[62]),_=d(_,R,C,O,A,21,a[63]),i[0]=i[0]+O|0,i[1]=i[1]+_|0,i[2]=i[2]+R|0,i[3]=i[3]+C|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,s=8*t.sigBytes;n[s>>>5]|=128<<24-s%32;var i=e.floor(r/4294967296),o=r;n[15+(s+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),n[14+(s+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,c=a.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,r,s,i,o){var a=e+(t&n|~t&r)+s+o;return(a<<i|a>>>32-i)+t}function l(e,t,n,r,s,i,o){var a=e+(t&r|n&~r)+s+o;return(a<<i|a>>>32-i)+t}function h(e,t,n,r,s,i,o){var a=e+(t^n^r)+s+o;return(a<<i|a>>>32-i)+t}function d(e,t,n,r,s,i,o){var a=e+(n^(t|~r))+s+o;return(a<<i|a>>>32-i)+t}n.MD5=i._createHelper(c),n.HmacMD5=i._createHmacHelper(c)}(Math),t.MD5)}(sr)),sr.exports}var or,ar={exports:{}},cr={exports:{}};function ur(){return or||(or=1,function(e){var t,n,r,s,i,o,a,c;e.exports=(c=Zn(),n=(t=c).lib,r=n.WordArray,s=n.Hasher,i=t.algo,o=[],a=i.SHA1=s.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],s=n[1],i=n[2],a=n[3],c=n[4],u=0;u<80;u++){if(u<16)o[u]=0|e[t+u];else{var l=o[u-3]^o[u-8]^o[u-14]^o[u-16];o[u]=l<<1|l>>>31}var h=(r<<5|r>>>27)+c+o[u];h+=u<20?1518500249+(s&i|~s&a):u<40?1859775393+(s^i^a):u<60?(s&i|s&a|i&a)-1894007588:(s^i^a)-899497514,c=a,a=i,i=s<<30|s>>>2,s=r,r=h}n[0]=n[0]+r|0,n[1]=n[1]+s|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=s._createHelper(a),t.HmacSHA1=s._createHmacHelper(a),c.SHA1)}(cr)),cr.exports}var lr,hr={exports:{}};var dr;function fr(){return dr||(dr=1,function(e){var t,n,r,s,i,o,a,c;e.exports=(c=Zn(),ur(),lr||(lr=1,function(e){var t;e.exports=(t=Zn(),void function(){var e=t,n=e.lib.Base,r=e.enc.Utf8;e.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,s=4*n;t.sigBytes>s&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),a=i.words,c=o.words,u=0;u<n;u++)a[u]^=1549556828,c[u]^=909522486;i.sigBytes=o.sigBytes=s,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})}())}(hr)),n=(t=c).lib,r=n.Base,s=n.WordArray,i=t.algo,o=i.MD5,a=i.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,i=r.hasher.create(),o=s.create(),a=o.words,c=r.keySize,u=r.iterations;a.length<c;){n&&i.update(n),n=i.update(e).finalize(t),i.reset();for(var l=1;l<u;l++)n=i.finalize(n),i.reset();o.concat(n)}return o.sigBytes=4*c,o}}),t.EvpKDF=function(e,t,n){return a.create(n).compute(e,t)},c.EvpKDF)}(ar)),ar.exports}var pr,gr={exports:{}};var yr;var mr,vr=(yr||(yr=1,function(e){var t;e.exports=(t=Zn(),nr(),ir(),fr(),pr||(pr=1,function(e){var t;e.exports=(t=Zn(),fr(),void(t.lib.Cipher||function(e){var n=t,r=n.lib,s=r.Base,i=r.WordArray,o=r.BufferedBlockAlgorithm,a=n.enc;a.Utf8;var c=a.Base64,u=n.algo.EvpKDF,l=r.Cipher=o.extend({cfg:s.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?I:m}return function(t){return{encrypt:function(n,r,s){return e(r).encrypt(t,n,r,s)},decrypt:function(n,r,s){return e(r).decrypt(t,n,r,s)}}}}()});r.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var h=n.mode={},d=r.BlockCipherMode=s.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),f=h.CBC=function(){var t=d.extend();function n(t,n,r){var s,i=this._iv;i?(s=i,this._iv=e):s=this._prevBlock;for(var o=0;o<r;o++)t[n+o]^=s[o]}return t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,s=r.blockSize;n.call(this,e,t,s),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+s)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,s=r.blockSize,i=e.slice(t,t+s);r.decryptBlock(e,t),n.call(this,e,t,s),this._prevBlock=i}}),t}(),p=(n.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,s=r<<24|r<<16|r<<8|r,o=[],a=0;a<r;a+=4)o.push(s);var c=i.create(o,r);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:f,padding:p}),reset:function(){var e;l.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var g=r.CipherParams=s.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=(n.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?i.create([1398893684,1701076831]).concat(n).concat(t):t).toString(c)},parse:function(e){var t,n=c.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=i.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:t})}},m=r.SerializableCipher=s.extend({cfg:s.extend({format:y}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var s=e.createEncryptor(n,r),i=s.finalize(t),o=s.cfg;return g.create({ciphertext:i,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),v=(n.kdf={}).OpenSSL={execute:function(e,t,n,r,s){if(r||(r=i.random(8)),s)o=u.create({keySize:t+n,hasher:s}).compute(e,r);else var o=u.create({keySize:t+n}).compute(e,r);var a=i.create(o.words.slice(t),4*n);return o.sigBytes=4*t,g.create({key:o,iv:a,salt:r})}},I=r.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:v}),encrypt:function(e,t,n,r){var s=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize,r.salt,r.hasher);r.iv=s.iv;var i=m.encrypt.call(this,e,t,s.key,r);return i.mixIn(s),i},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var s=r.kdf.execute(n,e.keySize,e.ivSize,t.salt,r.hasher);return r.iv=s.iv,m.decrypt.call(this,e,t,s.key,r)}})}()))}(gr)),function(){var e=t,n=e.lib.BlockCipher,r=e.algo,s=[],i=[],o=[],a=[],c=[],u=[],l=[],h=[],d=[],f=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var p=r^r<<1^r<<2^r<<3^r<<4;p=p>>>8^255&p^99,s[n]=p,i[p]=n;var g=e[n],y=e[g],m=e[y],v=257*e[p]^16843008*p;o[n]=v<<24|v>>>8,a[n]=v<<16|v>>>16,c[n]=v<<8|v>>>24,u[n]=v,v=16843009*m^65537*y^257*g^16843008*n,l[p]=v<<24|v>>>8,h[p]=v<<16|v>>>16,d[p]=v<<8|v>>>24,f[p]=v,n?(n=g^e[e[e[m^g]]],r^=e[e[r]]):n=r=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],g=r.AES=n.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),i=this._keySchedule=[],o=0;o<r;o++)o<n?i[o]=t[o]:(u=i[o-1],o%n?n>6&&o%n==4&&(u=s[u>>>24]<<24|s[u>>>16&255]<<16|s[u>>>8&255]<<8|s[255&u]):(u=s[(u=u<<8|u>>>24)>>>24]<<24|s[u>>>16&255]<<16|s[u>>>8&255]<<8|s[255&u],u^=p[o/n|0]<<24),i[o]=i[o-n]^u);for(var a=this._invKeySchedule=[],c=0;c<r;c++){if(o=r-c,c%4)var u=i[o];else u=i[o-4];a[c]=c<4||o<=4?u:l[s[u>>>24]]^h[s[u>>>16&255]]^d[s[u>>>8&255]]^f[s[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,c,u,s)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,h,d,f,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,s,i,o,a){for(var c=this._nRounds,u=e[t]^n[0],l=e[t+1]^n[1],h=e[t+2]^n[2],d=e[t+3]^n[3],f=4,p=1;p<c;p++){var g=r[u>>>24]^s[l>>>16&255]^i[h>>>8&255]^o[255&d]^n[f++],y=r[l>>>24]^s[h>>>16&255]^i[d>>>8&255]^o[255&u]^n[f++],m=r[h>>>24]^s[d>>>16&255]^i[u>>>8&255]^o[255&l]^n[f++],v=r[d>>>24]^s[u>>>16&255]^i[l>>>8&255]^o[255&h]^n[f++];u=g,l=y,h=m,d=v}g=(a[u>>>24]<<24|a[l>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^n[f++],y=(a[l>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^n[f++],m=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&l])^n[f++],v=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[l>>>8&255]<<8|a[255&h])^n[f++],e[t]=g,e[t+1]=y,e[t+2]=m,e[t+3]=v},keySize:8});e.AES=n._createHelper(g)}(),t.AES)}(Xn)),Xn.exports),Ir=r(vr),Ar={exports:{}};var br,Er,Sr,kr,wr,Tr,Or=r((mr||(mr=1,function(e){e.exports=Zn().enc.Utf8}(Ar)),Ar.exports)),_r=Object.defineProperty,Rr=(e,t)=>_r(e,"name",{value:t,configurable:!0}),Cr=Rr(e=>null!==e&&"object"==typeof e,"isObject"),Pr=Rr((e,t,n)=>"function"==typeof n.join?n.join(e):e[0]+t+e[1],"join"),xr=Rr((e,t,n)=>"function"==typeof n.split?n.split(e):e.split(t),"split"),Dr=Rr((e,t={},n)=>"function"!=typeof n?.isValid||n.isValid(e,t),"isValid"),Lr=Rr(e=>Cr(e)||"function"==typeof e,"isValidObject"),Mr=Rr((e,t,n={})=>{if(Cr(n)||(n={default:n}),!Lr(e))return void 0!==n.default?n.default:e;"number"==typeof t&&(t=String(t));const r=Array.isArray(t),s="string"==typeof t,i=n.separator||".",o=n.joinChar||("string"==typeof i?i:".");if(!s&&!r)return e;let a=e[t];if(void 0===a&&"function"==typeof e.get&&(a=e.get(t)),void 0!==a)return Dr(t,e,n)?a:n.default;const c=r?t:xr(t,i,n),u=c.length;let l=0;do{let t=c[l];for("string"!=typeof t&&(t=String(t));t&&"\\"===t.slice(-1);)t=Pr([t.slice(0,-1),c[++l]||""],o,n);if(a=e[t],void 0===a&&"function"==typeof e.get&&(a=e.get(t)),void 0!==a){if(!Dr(t,e,n))return n.default;e=a}else{let r=!1,s=l+1;for(;s<u;)if(t=Pr([t,c[s++]],o,n),a=e[t],void 0===a&&"function"==typeof e.get&&(a=e.get(t)),r=void 0!==a){if(!Dr(t,e,n))return n.default;e=a,l=s-1;break}if(!r)return n.default}}while(++l<u&&Lr(e));return l===u?e:n.default},"getValue"),Nr={exports:{}},Br={exports:{}};function Gr(){if(Er)return br;Er=1;var e=1e3,t=60*e,n=60*t,r=24*n,s=365.25*r;function i(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return br=function(o,a){a=a||{};var c=typeof o;if("string"===c&&o.length>0)return function(i){if((i=String(i)).length>100)return;var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(!o)return;var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(o);if("number"===c&&!1===isNaN(o))return a.long?function(s){return i(s,r,"day")||i(s,n,"hour")||i(s,t,"minute")||i(s,e,"second")||s+" ms"}(o):function(s){if(s>=r)return Math.round(s/r)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))},br}function Ur(){return Sr||(Sr=1,function(e,t){var n;function r(e){function r(){if(r.enabled){var e=r,s=+new Date,i=s-(n||s);e.diff=i,e.prev=n,e.curr=s,n=s;for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var c=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;c++;var s=t.formatters[r];if("function"==typeof s){var i=o[c];n=s.call(e,i),o.splice(c,1),c--}return n}),t.formatArgs.call(e,o),(r.log||t.log||console.log.bind(console)).apply(e,o)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),"function"==typeof t.init&&t.init(r),r}(t=e.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length,s=0;s<r;s++)n[s]&&("-"===(e=n[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Gr(),t.names=[],t.skips=[],t.formatters={}}(Br,Br.exports)),Br.exports}var jr,Fr,$r,zr,Kr,Hr,Qr,Vr=function(){if(Tr)return wr;Tr=1;var e=(kr||(kr=1,function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=Ur()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var s=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(s++,"%c"===e&&(i=s))}),e.splice(i,0,r)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(Nr,Nr.exports)),Nr.exports)("cookie");function t(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},s=e.split(/ *; */);if(""==s[0])return n;for(var i=0;i<s.length;++i)n[r((t=s[i].split("="))[0])]=r(t[1]);return n}(e)}function n(t){try{return encodeURIComponent(t)}catch(n){e("error `encode(%o)` - %o",t,n)}}function r(t){try{return decodeURIComponent(t)}catch(n){e("error `decode(%o)` - %o",t,n)}}return wr=function(e,r,s){switch(arguments.length){case 3:case 2:return function(e,t,r){r=r||{};var s=n(e)+"="+n(t);null==t&&(r.maxage=-1);r.maxage&&(r.expires=new Date(+new Date+r.maxage));r.path&&(s+="; path="+r.path);r.domain&&(s+="; domain="+r.domain);r.expires&&(s+="; expires="+r.expires.toUTCString());r.samesite&&(s+="; samesite="+r.samesite);r.secure&&(s+="; secure");document.cookie=s}(e,r,s);case 1:return function(e){return t()[e]}(e);default:return t()}},wr}(),qr=r(Vr),Xr={exports:{}},Wr={exports:{}},Yr={exports:{}};function Jr(){if(Fr)return jr;Fr=1;var e=1e3,t=60*e,n=60*t,r=24*n,s=365.25*r;function i(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return jr=function(o,a){a=a||{};var c=typeof o;if("string"===c&&o.length>0)return function(i){if((i=String(i)).length>100)return;var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(!o)return;var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(o);if("number"===c&&!1===isNaN(o))return a.long?function(s){return i(s,r,"day")||i(s,n,"hour")||i(s,t,"minute")||i(s,e,"second")||s+" ms"}(o):function(s){if(s>=r)return Math.round(s/r)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))},jr}function Zr(){return $r||($r=1,function(e,t){var n;function r(e){function r(){if(r.enabled){var e=r,s=+new Date,i=s-(n||s);e.diff=i,e.prev=n,e.curr=s,n=s;for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var c=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;c++;var s=t.formatters[r];if("function"==typeof s){var i=o[c];n=s.call(e,i),o.splice(c,1),c--}return n}),t.formatArgs.call(e,o),(r.log||t.log||console.log.bind(console)).apply(e,o)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),"function"==typeof t.init&&t.init(r),r}(t=e.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length,s=0;s<r;s++)n[s]&&("-"===(e=n[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Jr(),t.names=[],t.skips=[],t.formatters={}}(Yr,Yr.exports)),Yr.exports}function es(){if(Hr)return Kr;Hr=1;var e=(zr||(zr=1,function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=Zr()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var s=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(s++,"%c"===e&&(i=s))}),e.splice(i,0,r)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(Wr,Wr.exports)),Wr.exports)("cookie");function t(){var e;try{e=document.cookie}catch(e){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e.stack||e),{}}return function(e){var t,n={},s=e.split(/ *; */);if(""==s[0])return n;for(var i=0;i<s.length;++i)n[r((t=s[i].split("="))[0])]=r(t[1]);return n}(e)}function n(t){try{return encodeURIComponent(t)}catch(n){e("error `encode(%o)` - %o",t,n)}}function r(t){try{return decodeURIComponent(t)}catch(n){e("error `decode(%o)` - %o",t,n)}}return Kr=function(e,r,s){switch(arguments.length){case 3:case 2:return function(e,t,r){r=r||{};var s=n(e)+"="+n(t);null==t&&(r.maxage=-1);r.maxage&&(r.expires=new Date(+new Date+r.maxage));r.path&&(s+="; path="+r.path);r.domain&&(s+="; domain="+r.domain);r.expires&&(s+="; expires="+r.expires.toUTCString());r.secure&&(s+="; secure");document.cookie=s}(e,r,s);case 1:return function(e){return t()[e]}(e);default:return t()}},Kr}var ts=(Qr||(Qr=1,function(e,t){var n=es();function r(e){for(var n=t.cookie,r=t.levels(e),s=0;s<r.length;++s){var i="__tld__",o=r[s],a={domain:"."+o};if(n(i,1,a),n(i))return n(i,null,a),o}return""}r.levels=function(e){var t=("function"!=typeof window.URL?function(e){const t=document.createElement("a");return t.href=e,t.hostname}(e):new URL(e).hostname).split("."),n=t[t.length-1],r=[];if(4===t.length&&n===parseInt(n,10))return r;if(t.length<=1)return r;for(var s=t.length-2;s>=0;--s)r.push(t.slice(s).join("."));return r},r.cookie=n,t=e.exports=r}(Xr,Xr.exports)),Xr.exports),ns=r(ts);const rs=new class{constructor(e){this.cOpts={},this.options(e),this.isSupportAvailable=this.checkSupportAvailability()}options(e={}){if(0===arguments.length)return this.cOpts;let t=`.${ns(window.location.href)}`;return"."===t&&(t=null),this.cOpts=zn({maxage:31536e6,path:"/",domain:t,samesite:"Lax"},e),e.sameDomainCookiesOnly&&delete this.cOpts.domain,this.cOpts}set(e,t){try{return qr(e,t,v(this.cOpts)),!0}catch(e){return En.error(e),!1}}get(e){return qr(e)}remove(e){try{return qr(e,null,v(this.cOpts)),!0}catch(e){return!1}}checkSupportAvailability(){const e="test_rudder_cookie";return this.set(e,!0),!!this.get(e)&&(this.remove(e),!0)}}({});var ss,is={exports:{}};var os=(ss||(ss=1,function(e){e.exports=function(){function e(e){return e=JSON.stringify(e),!!/^\{[\s\S]*\}$/.test(e)}function t(e){return void 0===e||"function"==typeof e?e+"":JSON.stringify(e)}function n(e){if("string"==typeof e)try{return JSON.parse(e)}catch(t){return e}}function r(e){return"[object Function]"==={}.toString.call(e)}function s(e){return"[object Array]"===Object.prototype.toString.call(e)}function i(e){var t="_Is_Incognit",n="yes";try{e||(e=window.localStorage),e.setItem(t,n),e.removeItem(t)}catch(t){var r={_data:{},setItem:function(e,t){return r._data[e]=String(t)},getItem:function(e){return r._data.hasOwnProperty(e)?r._data[e]:void 0},removeItem:function(e){return delete r._data[e]},clear:function(){return r._data={}}};e=r}finally{e.getItem(t)===n&&e.removeItem(t)}return e}var o=i();function a(){if(!(this instanceof a))return new a}a.prototype={set:function(n,r){if(n&&!e(n))o.setItem(n,t(r));else if(e(n))for(var s in n)this.set(s,n[s]);return this},get:function(e){if(void 0===e){var t={};return this.forEach(function(e,n){return t[e]=n}),t}if("?"===e.charAt(0))return this.has(e.substr(1));var r=arguments;if(r.length>1){for(var s={},i=0,a=r.length;i<a;i++){var c=n(o.getItem(r[i]));this.has(r[i])&&(s[r[i]]=c)}return s}return n(o.getItem(e))},clear:function(){return o.clear(),this},remove:function(e){var t=this.get(e);return o.removeItem(e),t},has:function(e){return{}.hasOwnProperty.call(this.get(),e)},keys:function(){var e=[];return this.forEach(function(t){e.push(t)}),e},forEach:function(e){for(var t=0,n=o.length;t<n;t++){var r=o.key(t);e(r,this.get(r))}return this},search:function(e){for(var t=this.keys(),n={},r=0,s=t.length;r<s;r++)t[r].indexOf(e)>-1&&(n[t[r]]=this.get(t[r]));return n},len:function(){return o.length}};var c=null;function u(t,n){var i=arguments,o=null;if(c||(c=a()),0===i.length)return c.get();if(1===i.length){if("string"==typeof t)return c.get(t);if(e(t))return c.set(t)}if(2===i.length&&"string"==typeof t){if(!n)return c.remove(t);if(n&&"string"==typeof n)return c.set(t,n);n&&r(n)&&(o=null,o=n(t,c.get(t)),u.set(t,o))}if(2===i.length&&s(t)&&r(n))for(var l=0,h=t.length;l<h;l++)o=n(t[l],c.get(t[l])),u.set(t[l],o);return u}for(var l in a.prototype)u[l]=a.prototype[l];return u}()}(is)),is.exports),as=r(os);const cs=new class{constructor(e){this.sOpts={},this.enabled=this.checkSupportAvailability(),this.options(e)}options(e={}){return 0===arguments.length||(this.sOpts=zn({enabled:!0},e),this.enabled=this.sOpts.enabled&&this.enabled),this.sOpts}set(e,t){return as.set(e,t)}get(e){return as.get(e)}remove(e){return as.remove(e)}checkSupportAvailability(){try{const e="test_rudder_ls";return this.set(e,!0),!!this.get(e)&&(this.remove(e),!0)}catch(e){return!1}}}({}),us=e=>(new TextDecoder).decode((e=>{const t=globalThis.atob(e).split("").map(e=>e.charCodeAt(0));return new Uint8Array(t)})(e)),ls="rl_user_id",hs="rl_trait",ds="rl_anonymous_id",fs="rl_group_id",ps="rl_group_trait",gs="rl_page_init_referrer",ys="rl_page_init_referring_domain",ms="rl_session",vs="rl_auth_token",Is="RudderEncrypt:",As="RS_ENC_v3_",bs="Rudder",Es={segment:"ajs_anonymous_id"};function Ss(e){return e.replace(/^\s+|\s+$/gm,"")}function ks(e){return e&&"string"==typeof e&&""!==Ss(e)?e.startsWith(Is)?Ir.decrypt(e.substring(Is.length),bs).toString(Or):e.startsWith(As)?us(e.substring(As.length)):e:e}const ws=new class{constructor(){rs.isSupportAvailable?this.storage=rs:(cs.enabled&&(this.storage=cs),this.storage||En.error("No storage is available :: initializing the SDK without storage"))}options(e={}){this.storage.options(e)}setItem(e,t){const n=jn(t);null!==n&&this.storage.set(e,function(e){return""===Ss(e)?e:`${Is}${Ir.encrypt(e,bs).toString()}`}(n))}setStringItem(e,t){"string"==typeof t?this.setItem(e,t):En.error(`[Storage] ${e} should be string`)}setUserId(e){this.setStringItem(ls,e)}setUserTraits(e){this.setItem(hs,e)}setGroupId(e){this.setStringItem(fs,e)}setGroupTraits(e){this.setItem(ps,e)}setAnonymousId(e){this.setStringItem(ds,e)}setInitialReferrer(e){this.setItem(gs,e)}setInitialReferringDomain(e){this.setItem(ys,e)}setSessionInfo(e){this.setItem(ms,e)}setAuthToken(e){this.setItem(vs,e)}getItem(e){try{let t=this.storage.get(e),n=ks(t);for(t=n?JSON.parse(n):null;"string"==typeof t&&(n=ks(t),n!==t);)t=JSON.parse(n);return t}catch(t){return En.error((e=>`Unable to retrieve the cookie data for ${e}. The data is dropped. This can potentially stem from using SDK v3 on other sites or web pages that can share cookies with this webpage. Please use the same SDK (v3) version everywhere as soon as possible.`)(e),t),null}}getUserId(){return this.getItem(ls)}getUserTraits(){return this.getItem(hs)}getGroupId(){return this.getItem(fs)}getGroupTraits(){return this.getItem(ps)}fetchExternalAnonymousId(e){let t;const n=e.toLowerCase();return Object.keys(Es).includes(n)&&"segment"===n?(cs.enabled&&(t=cs.get(Es[n])),!t&&rs.isSupportAvailable&&(t=rs.get(Es[n])),t):t}getAnonymousId(e){const t=this.getItem(ds);if(t)return t;const n=Mr(e,"autoCapture.source");if(!0===Mr(e,"autoCapture.enabled")&&"string"==typeof n){const e=this.fetchExternalAnonymousId(n);if(e)return e}return t}getInitialReferrer(){return this.getItem(gs)}getInitialReferringDomain(){return this.getItem(ys)}getSessionInfo(){return this.getItem(ms)}getAuthToken(){return this.getItem(vs)}removeItem(e){return this.storage.remove(e)}removeSessionInfo(){this.removeItem(ms)}clear(e){this.storage.remove(ls),this.storage.remove(hs),this.storage.remove(fs),this.storage.remove(ps),this.storage.remove(vs),e&&this.storage.remove(ds)}},Ts=(e,t,n={})=>{if(document.getElementById(e))return;const r=document.createElement("script");r.src=t,r.async=void 0===n.async||n.async,r.type="text/javascript",r.id=e,!0!==n.skipDatasetAttributes&&(r.setAttribute("data-loader",Vn),void 0!==n.isNonNativeSDK&&r.setAttribute("data-isNonNativeSDK",n.isNonNativeSDK));const s=document.getElementsByTagName("head");if(s.length>0)s[0].insertBefore(r,s[0].firstChild);else{const e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(r,e)}};for(var Os,_s=256,Rs=[];_s--;)Rs[_s]=(_s+256).toString(16).substring(1);for(var Cs,Ps=[],xs=0;xs<256;xs++)Ps[xs]=(xs+256).toString(16).substring(1);function Ds(){var e;(!Cs||xs+16>4096)&&(e=4096,Cs=crypto.getRandomValues(new Uint8Array(e)),xs=0);for(var t,n=0,r="";n<16;n++)t=Cs[xs+n],r+=6==n?Ps[15&t|64]:8==n?Ps[63&t|128]:Ps[t],1&n&&n>1&&n<11&&(r+="-");return xs+=16,r}const Ls={All:"All",GA:"Google Analytics",GOOGLEADS:"Google Ads",BRAZE:"Braze",CHARTBEAT:"Chartbeat",CUSTOMERIO:"Customer IO",DCM_Floodlight:"DCM Floodlight",FACEBOOK_PIXEL:"Facebook Pixel",GTM:"Google Tag Manager",HOTJAR:"Hotjar",HS:"HubSpot",INTERCOM:"Intercom",KEEN:"Keen",KISSMETRICS:"Kiss Metrics",LOTAME:"Lotame",VWO:"VWO",OPTIMIZELY:"Optimizely Web",FULLSTORY:"Fullstory",TVSQUARED:"TVSquared",GA4:"Google Analytics 4 (GA4)",GA4_V2:"Google Analytics 4 (GA4) V2",MOENGAGE:"MoEngage",AM:"Amplitude",PENDO:"Pendo",LYTICS:"Lytics",APPCUES:"Appcues",POSTHOG:"PostHog",PROFITWELL:"ProfitWell",KLAVIYO:"Klaviyo",CLEVERTAP:"CleverTap",BINGADS:"Bing Ads",PINTEREST_TAG:"Pinterest Tag",SNAP_PIXEL:"Snap Pixel",LINKEDIN_INSIGHT_TAG:"Linkedin Insight Tag",REDDIT_PIXEL:"Reddit Pixel",DRIP:"Drip",HEAP:"Heap.io",CRITEO:"Criteo",MP:"Mixpanel",QUALTRICS:"Qualtrics",SENTRY:"Sentry",GOOGLE_OPTIMIZE:"Google Optimize",POST_AFFILIATE_PRO:"Post Affiliate Pro",LAUNCHDARKLY:"LaunchDarkly",GA360:"Google Analytics 360",ADROLL:"Adroll",VERO:"Vero",MATOMO:"Matomo",MOUSEFLOW:"Mouseflow",ROCKERBOX:"Rockerbox",CONVERTFLOW:"ConvertFlow",SNAPENGAGE:"SnapEngage",LIVECHAT:"LiveChat",SHYNET:"Shynet",WOOPRA:"Woopra",ROLLBAR:"RollBar",QUORA_PIXEL:"Quora Pixel",JUNE:"June",ENGAGE:"Engage",ITERABLE:"Iterable",YANDEX_METRICA:"Yandex.Metrica",REFINER:"Refiner",QUALAROO:"Qualaroo",PODSIGHTS:"Podsights",AXEPTIO:"Axeptio",SATISMETER:"Satismeter",MICROSOFT_CLARITY:"Microsoft Clarity",SENDINBLUE:"Sendinblue",OLARK:"Olark",LEMNISK:"Lemnisk",TIKTOK_ADS:"TikTok Ads",ACTIVE_CAMPAIGN:"ActiveCampaign",SPRIG:"Sprig",SPOTIFYPIXEL:"Spotify Pixel",COMMANDBAR:"CommandBar",NINETAILED:"Ninetailed",XPIXEL:"XPixel",GAINSIGHT_PX:"Gainsight PX",USERPILOT:"Userpilot",COMSCORE:"Comscore"};function Ms(e){return e?.endsWith("/")?e.replace(/\/+$/,""):e}function Ns(){return window.crypto&&"function"==typeof window.crypto.getRandomValues?Ds():function(){var e,t=0,n="";if(!Os||_s+16>256){for(Os=Array(t=256);t--;)Os[t]=256*Math.random()|0;t=_s=0}for(;t<16;t++)e=Os[_s+t],n+=6==t?Rs[15&e|64]:8==t?Rs[63&e|128]:Rs[e],1&t&&t>1&&t<11&&(n+="-");return _s++,n}()}function Bs(){return(new Date).toISOString()}function Gs(e,t){Object.keys(e).forEach(n=>{e.hasOwnProperty(n)&&(t[n]&&(e[t[n]]=e[n]),"All"!==n&&void 0!==t[n]&&t[n]!==n&&delete e[n])})}function Us(e){Gs(e,An)}function js(e){Gs(e,Ls)}function Fs(e,t){const n=[];if(!t||0===t.length)return n;let r=!0;void 0!==e.All&&(r=e.All);const s=[];return"string"==typeof t[0]?t.forEach(e=>{s.push({intgName:e,intObj:e})}):"object"==typeof t[0]&&t.forEach(e=>{s.push({intgName:e.name,intObj:e})}),s.forEach(({intgName:t,intObj:s})=>{if(r){let r=!0;void 0!==e[t]&&!1===Boolean(e[t])&&(r=!1),r&&n.push(s)}else void 0!==e[t]&&!0===Boolean(e[t])&&n.push(s)}),n}const $s=e=>"string"==typeof e||null==e?e:jn(e),zs=e=>"string"==typeof e&&e.trim().length>0,Ks=(e,t,n)=>{try{const r=e.source.dataplanes||{};if(Object.keys(r).length>0){const e=(e=>{const t=e?e.residencyServer:void 0;if(t)return"string"==typeof t&&Cn.includes(t.toUpperCase())?t.toUpperCase():void En.error("Invalid residencyServer input")})(n),t=r[e]||r.US;if(t){const e=(e=>{if(Array.isArray(e)&&e.length>0){const t=e.find(e=>!0===e.default);if(t&&zs(t.url))return t.url}})(t);if(e)return e}}if(zs(t))return t;throw Error("Unable to load the SDK due to invalid data plane url")}catch(e){throw Error(e)}};function Hs(){return document?.referrer||"$direct"}function Qs(e){const t=e.split("/");return t.length>=3?t[2]:""}function Vs(){const e=document.getElementsByTagName("link");for(let t=0;e[t];t+=1){const n=e[t];if("canonical"===n.getAttribute("rel"))return n.getAttribute("href")}}function qs(){const e=Vs();let t=window.location.pathname;if(e)try{t=new URL(e).pathname}catch(e){}const{search:n,href:r}=window.location,{title:s}=document,i=function(e){const t=Vs();let n;n=t?t.includes("?")?t:t+e:window.location.href;const r=n.indexOf("#");return r>-1?n.slice(0,r):n}(n),o=r,a=Hs();return{path:t,referrer:a,referring_domain:Qs(a),search:n,title:s,url:i,tab_url:o,initial_referrer:ws.getInitialReferrer()||"",initial_referring_domain:ws.getInitialReferringDomain()||""}}class Xs{constructor(){this.name="RudderLabs JavaScript SDK",this.namespace="com.rudderlabs.javascript",this.version="2.53.0"}}class Ws{constructor(){this.name="RudderLabs JavaScript SDK",this.version="2.53.0"}}class Ys{constructor(){this.name="",this.version=""}}class Js{constructor(){this.density=0,this.width=0,this.height=0,this.innerWidth=0,this.innerHeight=0}}class Zs{constructor(){this.app=new Xs,this.traits=null,this.library=new Ws,this.userAgent=(()=>{if("undefined"==typeof navigator)return null;let{userAgent:e}=navigator;const{brave:t}=navigator;if(t&&Object.getPrototypeOf(t).isBrave){const t=e.match(/(chrome)\/([\w.]+)/i);t&&(e=`${e} Brave/${t[2]}`)}return e})(),this.device=null,this.network=null,this.os=new Ys,this.locale="undefined"==typeof navigator?null:navigator.language||navigator.browserLanguage,this.screen=(()=>{const e=new Js;return"undefined"==typeof window||(e.width=window.screen.width,e.height=window.screen.height,e.density=window.devicePixelRatio,e.innerWidth=window.innerWidth,e.innerHeight=window.innerHeight),e})(),this.timezone=(()=>{const e=/([A-Z]+[+-]\d+)/.exec((new Date).toString());return e?.[1]?e[1]:"NA"})()}}class ei{constructor(){this.channel="web",this.context=new Zs,this.type=null,this.messageId=Ns(),this.originalTimestamp=(new Date).toISOString(),this.anonymousId=null,this.userId=null,this.event=null,this.properties={}}getProperty(e){return this.properties[e]}addProperty(e,t){this.properties[e]=t}}class ti{constructor(){this.message=new ei}setType(e){this.message.type=e}setProperty(e){this.message.properties=e}setUserProperty(e){this.message.user_properties=e}setUserId(e){this.message.userId=e}setEventName(e){this.message.event=e}getElementContent(){return this.message}}class ni{constructor(){this.rudderProperty=null,this.rudderUserProperty=null,this.event=null,this.userId=null,this.type=null}setType(e){return this.type=e,this}build(){const e=new ti;return e.setUserId(this.userId),e.setType(this.type),e.setEventName(this.event),e.setProperty(this.rudderProperty),e.setUserProperty(this.rudderUserProperty),e}}var ri,si={};function ii(){if(ri)return si;ri=1;for(var e,t=256,n=[];t--;)n[t]=(t+256).toString(16).substring(1);return si.v4=function(){var r,s=0,i="";if(!e||t+16>256){for(e=Array(s=256);s--;)e[s]=256*Math.random()|0;s=t=0}for(;s<16;s++)r=e[t+s],i+=6==s?n[15&r|64]:8==s?n[63&r|128]:n[r],1&s&&s>1&&s<11&&(i+="-");return t++,i},si}var oi,ai,ci,ui,li,hi,di,fi,pi,gi={};function yi(){if(ai)return oi;ai=1;var e=Object.prototype.hasOwnProperty,t=String.prototype.charAt,n=Object.prototype.toString,r=function(e,n){return t.call(e,n)},s=function(t,n){return e.call(t,n)},i=function(e,t){t=t||s;for(var n=[],r=0,i=e.length;r<i;r+=1)t(e,r)&&n.push(String(r));return n};return oi=function(e){return null==e?[]:(t=e,"[object String]"===n.call(t)?i(e,r):function(e){return null!=e&&"function"!=typeof e&&"number"==typeof e.length}(e)?i(e,s):function(e,t){t=t||s;var n=[];for(var r in e)t(e,r)&&n.push(String(r));return n}(e));var t}}function mi(){if(ci)return gi;ci=1;var e=yi(),t=ii().v4,n={_data:{},length:0,setItem:function(t,n){return this._data[t]=n,this.length=e(this._data).length,n},getItem:function(e){return e in this._data?this._data[e]:null},removeItem:function(t){return t in this._data&&delete this._data[t],this.length=e(this._data).length,null},clear:function(){this._data={},this.length=0},key:function(t){return e(this._data)[t]}};return gi.defaultEngine=function(){try{if(!window.localStorage)return!1;var e=t();window.localStorage.setItem(e,"test_value");var n=window.localStorage.getItem(e);return window.localStorage.removeItem(e),"test_value"===n}catch(e){return!1}}()?window.localStorage:n,gi.inMemoryEngine=n,gi}function vi(){if(li)return ui;li=1;var e=yi(),t=Object.prototype.toString,n="function"==typeof Array.isArray?Array.isArray:function(e){return"[object Array]"===t.call(e)},r=function(e){return null!=e&&(n(e)||"function"!==e&&function(e){var n=typeof e;return"number"===n||"object"===n&&"[object Number]"===t.call(e)}(e.length))},s=function(e,t){for(var n=0;n<t.length&&!1!==e(t[n],n,t);n+=1);},i=function(t,n){for(var r=e(n),s=0;s<r.length&&!1!==t(n[r[s]],r[s],n);s+=1);};return ui=function(e,t){return(r(t)?s:i).call(this,e,t)}}function Ii(){if(di)return hi;di=1;var e=mi().defaultEngine,t=mi().inMemoryEngine,n=vi(),r=yi(),s=JSON;function i(t,n,r,s){this.id=n,this.name=t,this.keys=r||{},this.engine=s||e,this.originalEngine=this.engine}return i.prototype.set=function(e,t){var n=this._createValidKey(e);if(n)try{this.engine.setItem(n,function(e){try{return JSON.stringify(e,function(){const e=[];return function(t,n){if("object"!=typeof n||null===n)return n;for(;e.length>0&&e[e.length-1]!==this;)e.pop();return e.includes(n)?"[Circular Reference]":(e.push(n),n)}}())}catch(e){return null}}(t))}catch(n){(function(e){var t=!1;if(e.code)switch(e.code){case 22:t=!0;break;case 1014:"NS_ERROR_DOM_QUOTA_REACHED"===e.name&&(t=!0)}else-2147024882===e.number&&(t=!0);return t})(n)&&(this._swapEngine(),this.set(e,t))}},i.prototype.get=function(e){try{var t=this.engine.getItem(this._createValidKey(e));return null===t?null:s.parse(t)}catch(e){return null}},i.prototype.getOriginalEngine=function(){return this.originalEngine},i.prototype.remove=function(e){this.engine.removeItem(this._createValidKey(e))},i.prototype._createValidKey=function(e){var t,s=this.name,i=this.id;return r(this.keys).length?(n(function(n){n===e&&(t=[s,i,e].join("."))},this.keys),t):[s,i,e].join(".")},i.prototype._swapEngine=function(){var e=this;n(function(n){var r=e.get(n);t.setItem([e.name,e.id,n].join("."),r),e.remove(n)},this.keys),this.engine=t},hi=i}var Ai,bi,Ei,Si,ki={exports:{}},wi={exports:{}};function Ti(){if(bi)return Ai;bi=1;var e=1e3,t=60*e,n=60*t,r=24*n,s=365.25*r;function i(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return Ai=function(o,a){a=a||{};var c=typeof o;if("string"===c&&o.length>0)return function(i){if((i=String(i)).length>100)return;var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(i);if(!o)return;var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*r;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*t;case"seconds":case"second":case"secs":case"sec":case"s":return a*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(o);if("number"===c&&!1===isNaN(o))return a.long?function(s){return i(s,r,"day")||i(s,n,"hour")||i(s,t,"minute")||i(s,e,"second")||s+" ms"}(o):function(s){if(s>=r)return Math.round(s/r)+"d";if(s>=n)return Math.round(s/n)+"h";if(s>=t)return Math.round(s/t)+"m";if(s>=e)return Math.round(s/e)+"s";return s+"ms"}(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))},Ai}function Oi(){return Ei||(Ei=1,function(e,t){var n;function r(e){function r(){if(r.enabled){var e=r,s=+new Date,i=s-(n||s);e.diff=i,e.prev=n,e.curr=s,n=s;for(var o=new Array(arguments.length),a=0;a<o.length;a++)o[a]=arguments[a];o[0]=t.coerce(o[0]),"string"!=typeof o[0]&&o.unshift("%O");var c=0;o[0]=o[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;c++;var s=t.formatters[r];if("function"==typeof s){var i=o[c];n=s.call(e,i),o.splice(c,1),c--}return n}),t.formatArgs.call(e,o),(r.log||t.log||console.log.bind(console)).apply(e,o)}}return r.namespace=e,r.enabled=t.enabled(e),r.useColors=t.useColors(),r.color=function(e){var n,r=0;for(n in e)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]}(e),"function"==typeof t.init&&t.init(r),r}(t=e.exports=r.debug=r.default=r).coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){t.enable("")},t.enable=function(e){t.save(e),t.names=[],t.skips=[];for(var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length,s=0;s<r;s++)n[s]&&("-"===(e=n[s].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){var n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=Ti(),t.names=[],t.skips=[],t.formatters={}}(wi,wi.exports)),wi.exports}var _i,Ri,Ci,Pi={exports:{}};function xi(){return _i||(_i=1,function(e){function t(e){if(e)return function(e){for(var n in t.prototype)e[n]=t.prototype[n];return e}(e)}e.exports=t,t.prototype.on=t.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},t.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},t.prototype.off=t.prototype.removeListener=t.prototype.removeAllListeners=t.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var s=0;s<r.length;s++)if((n=r[s])===t||n.fn===t){r.splice(s,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},t.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var s=(n=n.slice(0)).length;r<s;++r)n[r].apply(this,t)}return this},t.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},t.prototype.hasListeners=function(e){return!!this.listeners(e).length}}(Pi)),Pi.exports}var Di=function(){if(Ci)return Ri;Ci=1;var e=ii().v4,t=Ii(),n=vi(),r=function(){if(pi)return fi;pi=1;var e=vi(),t={setTimeout:function(e,t){return window.setTimeout(e,t)},clearTimeout:function(e){return window.clearTimeout(e)},Date:window.Date},n=t,r={ASAP:1,RESCHEDULE:2,ABANDON:3};function s(){this.tasks={},this.nextId=1}return s.prototype.now=function(){return+new n.Date},s.prototype.run=function(e,t,s){var i=this.nextId++;return this.tasks[i]=n.setTimeout(this._handle(i,e,t,s||r.ASAP),t),i},s.prototype.cancel=function(e){this.tasks[e]&&(n.clearTimeout(this.tasks[e]),delete this.tasks[e])},s.prototype.cancelAll=function(){e(n.clearTimeout,this.tasks),this.tasks={}},s.prototype._handle=function(e,t,n,s){var i=this,o=i.now();return function(){if(delete i.tasks[e],!(s>=r.RESCHEDULE&&o+2*n<i.now()))return t();s===r.RESCHEDULE&&i.run(t,n,s)}},s.setClock=function(e){n=e},s.resetClock=function(){n=t},s.Modes=r,fi=s}(),s=(Si||(Si=1,function(e,t){function n(){var e;try{e=t.storage.debug}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}(t=e.exports=Oi()).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},t.formatArgs=function(e){var n=this.useColors;if(e[0]=(n?"%c":"")+this.namespace+(n?" %c":" ")+e[0]+(n?"%c ":" ")+"+"+t.humanize(this.diff),n){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var s=0,i=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(s++,"%c"===e&&(i=s))}),e.splice(i,0,r)}},t.save=function(e){try{null==e?t.storage.removeItem("debug"):t.storage.debug=e}catch(e){}},t.load=n,t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},t.enable(n())}(ki,ki.exports)),ki.exports)("localstorage-retry");function i(e,t){return function(){return e.apply(t,arguments)}}function o(n,s,o){"function"==typeof s&&(o=s),this.name=n,this.id=e(),this.fn=o,this.maxItems=s.maxItems||1/0,this.maxAttempts=s.maxAttempts||1/0,this.backoff={MIN_RETRY_DELAY:s.minRetryDelay||1e3,MAX_RETRY_DELAY:s.maxRetryDelay||3e4,FACTOR:s.backoffFactor||2,JITTER:s.backoffJitter||0},this.timeouts={ACK_TIMER:1e3,RECLAIM_TIMER:3e3,RECLAIM_TIMEOUT:1e4,RECLAIM_WAIT:500},this.keys={IN_PROGRESS:"inProgress",QUEUE:"queue",RECLAIM_START:"reclaimStart",RECLAIM_END:"reclaimEnd",ACK:"ack"},this._schedule=new r,this._processId=0,this._store=new t(this.name,this.id,this.keys),this._store.set(this.keys.IN_PROGRESS,{}),this._store.set(this.keys.QUEUE,[]),this._ack=i(this._ack,this),this._checkReclaim=i(this._checkReclaim,this),this._processHead=i(this._processHead,this),this._running=!1}return xi()(o.prototype),o.prototype.start=function(){this._running&&this.stop(),this._running=!0,this._ack(),this._checkReclaim(),this._processHead()},o.prototype.stop=function(){this._schedule.cancelAll(),this._running=!1},o.prototype.shouldRetry=function(e,t){return!(t>this.maxAttempts)},o.prototype.getDelay=function(e){var t=this.backoff.MIN_RETRY_DELAY*Math.pow(this.backoff.FACTOR,e);if(this.backoff.JITTER){var n=Math.random(),r=Math.floor(n*this.backoff.JITTER*t);Math.floor(10*n)<5?t-=r:t+=r}return Number(Math.min(t,this.backoff.MAX_RETRY_DELAY).toPrecision(1))},o.prototype.addItem=function(t){this._enqueue({item:t,attemptNumber:0,time:this._schedule.now(),id:e()})},o.prototype.requeue=function(t,n,r,s){this.shouldRetry(t,n,r)?this._enqueue({item:t,attemptNumber:n,time:this._schedule.now()+this.getDelay(n),id:s||e()}):this.emit("discard",t,n)},o.prototype._enqueue=function(e){var t=this._store.get(this.keys.QUEUE)||[];(t=t.slice(-(this.maxItems-1))).push(e),t=t.sort(function(e,t){return e.time-t.time}),this._store.set(this.keys.QUEUE,t),this._running&&this._processHead()},o.prototype._processHead=function(){var t=this,i=this._store;this._schedule.cancel(this._processId);var o=i.get(this.keys.QUEUE)||[],a=i.get(this.keys.IN_PROGRESS)||{},c=this._schedule.now(),u=[];function l(e,n){u.push({item:e.item,done:function(r,s){var o=i.get(t.keys.IN_PROGRESS)||{};delete o[n],i.set(t.keys.IN_PROGRESS,o),t.emit("processed",r,s,e.item),r&&t.requeue(e.item,e.attemptNumber+1,r,e.id)}})}for(var h=Object.keys(a).length;o.length&&o[0].time<=c&&h++<t.maxItems;){var d=o.shift(),f=e();a[f]={item:d.item,attemptNumber:d.attemptNumber,time:t._schedule.now()},l(d,f)}i.set(this.keys.QUEUE,o),i.set(this.keys.IN_PROGRESS,a),n(function(e){try{t.fn(e.item,e.done)}catch(e){s("Process function threw error: "+e)}},u),o=i.get(this.keys.QUEUE)||[],this._schedule.cancel(this._processId),o.length>0&&(this._processId=this._schedule.run(this._processHead,o[0].time-c,r.Modes.ASAP))},o.prototype._ack=function(){this._store.set(this.keys.ACK,this._schedule.now()),this._store.set(this.keys.RECLAIM_START,null),this._store.set(this.keys.RECLAIM_END,null),this._schedule.run(this._ack,this.timeouts.ACK_TIMER,r.Modes.ASAP)},o.prototype._checkReclaim=function(){var e=this;n(function(t){t.id!==e.id&&(e._schedule.now()-t.get(e.keys.ACK)<e.timeouts.RECLAIM_TIMEOUT||function(t){t.set(e.keys.RECLAIM_START,e.id),t.set(e.keys.ACK,e._schedule.now()),e._schedule.run(function(){t.get(e.keys.RECLAIM_START)===e.id&&(t.set(e.keys.RECLAIM_END,e.id),e._schedule.run(function(){t.get(e.keys.RECLAIM_END)===e.id&&t.get(e.keys.RECLAIM_START)===e.id&&e._reclaim(t.id)},e.timeouts.RECLAIM_WAIT,r.Modes.ABANDON))},e.timeouts.RECLAIM_WAIT,r.Modes.ABANDON)}(t))},function(n){for(var r=[],s=e._store.getOriginalEngine(),i=0;i<s.length;i++){var o=s.key(i);if(null!==o){var a=o.split(".");3===a.length&&a[0]===n&&"ack"===a[2]&&r.push(new t(n,a[1],e.keys))}}return r}(this.name)),this._schedule.run(this._checkReclaim,this.timeouts.RECLAIM_TIMER,r.Modes.RESCHEDULE)},o.prototype._reclaim=function(r){var s=this,i=new t(this.name,r,this.keys),o={queue:this._store.get(this.keys.QUEUE)||[]},a={inProgress:i.get(this.keys.IN_PROGRESS)||{},queue:i.get(this.keys.QUEUE)||[]},c=[],u=function(t,r){n(function(t){var n=t.id||e();c.indexOf(n)>=0?s.emit("duplication",t.item,t.attemptNumber):(o.queue.push({item:t.item,attemptNumber:t.attemptNumber+r,time:s._schedule.now(),id:n}),c.push(n))},t)};u(a.queue,0),u(a.inProgress,1),o.queue=o.queue.sort(function(e,t){return e.time-t.time}),this._store.set(this.keys.QUEUE,o.queue);try{this._clearOtherQueue(i,1)}catch(e){if("NS_ERROR_STORAGE_BUSY"===e.name||"NS_ERROR_STORAGE_BUSY"===e.code||2153971713===e.code)try{this._clearOtherQueue(i,40)}catch(e){console.error(e)}else console.error(e)}this._processHead()},o.prototype._clearOtherQueue=function(e,t){setTimeout(()=>{e.remove(this.keys.IN_PROGRESS),setTimeout(()=>{e.remove(this.keys.QUEUE),setTimeout(()=>{e.remove(this.keys.RECLAIM_START),setTimeout(()=>{e.remove(this.keys.RECLAIM_END),setTimeout(()=>{e.remove(this.keys.ACK)},t)},t)},t)},t)},t)},Ri=o}(),Li=r(Di);const Mi={maxRetryDelay:36e4,minRetryDelay:1e3,backoffFactor:2,maxAttempts:10,maxItems:100};class Ni{constructor(){this.url="",this.writeKey=""}init(e,n,r){this.url=n,this.writeKey=e,r&&t(Mi,r),this.payloadQueue=new Li("rudder",Mi,(e,t)=>{e.message.sentAt=Bs(),this.processQueueElement(e.url,e.headers,e.message,3e4,(e,n)=>{if(e)return t(e);t(null,n)})}),this.payloadQueue.start()}processQueueElement(e,t,n,r,s){try{const i=new XMLHttpRequest;i.open("POST",e,!0);for(const e in t)i.setRequestHeader(e,t[e]);i.timeout=r,i.ontimeout=s,i.onerror=s,i.onreadystatechange=function(){if(4===i.readyState)if(429===i.status||i.status>=500&&i.status<600){const t=`${Mn} "${i.status}" status text: "${i.statusText}" for URL: "${e}"`,n=new Error(t);qn(n),s(n)}else s(null,i.status)};const o=jn(n,!0);o?i.send(o):En.error("Invalid payload: Event dropped")}catch(e){s(e)}}enqueue(e,t){const n={"Content-Type":"application/json",Authorization:`Basic ${btoa(`${this.writeKey}:`)}`,AnonymousId:btoa(e.anonymousId)};this.payloadQueue.addItem({url:`${this.url}/v1/${t}`,headers:n,message:e})}}const Bi="queue",Gi=64e3;class Ui{constructor(){this.storage=cs,this.maxItems=10,this.flushQueueTimeOut=void 0,this.timeOutActive=!1,this.flushQueueTimeOutInterval=6e5,this.url="",this.writekey="",this.queueName=`${Bi}.${Date.now()}`}sendQueueDataForBeacon(){this.sendDataFromQueueAndDestroyQueue()}init(e,t,n){this.url=t,this.writekey=e,n.maxItems&&(this.maxItems=n.maxItems),n.flushQueueInterval&&(this.flushQueueTimeOutInterval=n.flushQueueInterval),this.sendQueueDataForBeacon=this.sendQueueDataForBeacon.bind(this),this.attachListeners()}attachListeners(){window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.sendQueueDataForBeacon()})}getQueue(){return this.storage.get(this.queueName)}setQueue(e){this.storage.set(this.queueName,e)}enqueue(e){let t=this.getQueue()||[];t=t.slice(-(this.maxItems-1)),t.push(e);let n=t.slice(0);const r={batch:n,sentAt:Bs()},s=jn(r,!0);s&&s.length>Gi&&(n=t.slice(0,t.length-1),this.flushQueue(n),t=this.getQueue(),t.push(e)),this.setQueue(t),this.setTimer(),t.length===this.maxItems&&this.flushQueue(n)}sendDataFromQueueAndDestroyQueue(){this.sendDataFromQueue(),this.storage.remove(this.queueName)}sendDataFromQueue(){const e=this.getQueue();if(e&&e.length>0){const t=e.slice(0,e.length);this.flushQueue(t)}}flushQueue(e){if(e&&e.length>0){const t=Bs();e.forEach(e=>{e.sentAt=t});const n=jn({batch:e,sentAt:t},!0);if(null!==n){const e=new Blob([n],{type:"text/plain"}),t=`${this.url}?writeKey=${this.writekey}`;try{"function"!=typeof navigator.sendBeacon&&qn(new Error("Beacon API is not supported by browser"));navigator.sendBeacon(t,e)||qn(new Error("Unable to queue data to browser's beacon queue"))}catch(e){e.message=`${e.message} - While sending Beacon data to: ${t}`,qn(e)}}else En.error("Invalid payload: Event dropped")}this.setQueue([]),this.clearTimer()}setTimer(){this.timeOutActive||(this.flushQueueTimeOut=setTimeout(this.sendDataFromQueue.bind(this),this.flushQueueTimeOutInterval),this.timeOutActive=!0)}clearTimer(){this.timeOutActive&&(clearTimeout(this.flushQueueTimeOut),this.timeOutActive=!1)}}const ji=new class{constructor(){this.queue=void 0}initialize(e,t,n){let r={},s=Ms(t);n?.useBeacon&&navigator.sendBeacon?(n.beaconQueueOptions&&null!=n.beaconQueueOptions&&"object"==typeof n.beaconQueueOptions&&(r=n.beaconQueueOptions),s=`${s}/beacon/v1/batch`,this.queue=new Ui):(n?.useBeacon&&En.info("[EventRepository] sendBeacon feature not available in this browser :: fallback to XHR"),n?.queueOptions&&null!=n.queueOptions&&"object"==typeof n.queueOptions&&(r=n.queueOptions),this.queue=new Ni),this.queue.init(e,s,r)}enqueue(e,t){const n=e.getElementContent();n.originalTimestamp=n.originalTimestamp||Bs(),n.sentAt=Bs();const r=jn(n,!0);r&&r.length>32e3&&En.error("[EventRepository] enqueue:: message length greater 32 Kb ",n),this.queue.enqueue(n,t)}},Fi={maxRetryDelay:36e4,minRetryDelay:1e3,backoffFactor:2,maxAttempts:1/0};class $i{constructor(){this.callback=void 0,this.processQueueElements=!1}init(e,n){e&&t(Fi,e),n&&(this.callback=n),this.payloadQueue=new Li("rs_events",Fi,(e,t)=>{this.processQueueElement(e.type,e.rudderElement,(e,n)=>{if(e)return t(e);t(null,n)})}),this.payloadQueue.start()}activateProcessor(){this.processQueueElements=!0}processQueueElement(e,t,n){try{this.processQueueElements?(Object.setPrototypeOf(t,ti.prototype),this.callback(e,t),n(null)):n(new Error("The queue elements are not ready to be processed yet"))}catch(e){n(e)}}enqueue(e,t){this.payloadQueue.addItem({type:e,rudderElement:t})}}const zi=()=>navigator&&navigator.language,Ki=()=>navigator&&navigator.userAgent;function Hi(e=""){return e=e.endsWith("..")?e.substr(0,e.length-2):e,decodeURIComponent(atob(e).split("").map(e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`).join(""))}const Qi=/^[\w.-]+$/,Vi="*";function qi(e,t,n,r){const s=function(e,t){return[e,(new Date).getTimezoneOffset(),t].join(Vi)}(n,r),i=t||0;return function(e){const t=function(){const e=[];let t;for(let n=0;n<256;n++){t=n;for(let e=0;e<8;e++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();let n=-1;for(let r=0;r<e.length;r++)n=n>>>8^t[255&(n^e.charCodeAt(r))];return(-1^n)>>>0}([s,Math.floor(Date.now()/6e4)-i,e].join(Vi)).toString(36)}function Xi(e){const t=function(e){const t=e.split(Vi),n=t.length%2==0;return t.length<4||!n||1!==Number(t.shift())?null:{checksum:t.shift(),serializedIds:t.join(Vi)}}(e);if(!t)return null;const{checksum:n,serializedIds:r}=t;return function(e,t){const n=Ki(),r=zi();for(let s=0;s<=1;s+=1)if(qi(e,s,n,r)===t)return!0;return!1}(r,n)?function(e){const t={},n=e.split(Vi);for(let e=0;e<n.length;e+=2){const r=n[e];if(Qi.test(r)){const s=Hi(n[e+1]);t[r]=s}}return t}(r):null}class Wi{isInitialized=!1;constructor(){if(!window.OneTrust||!window.OnetrustActiveGroups)return void En.error("OneTrust resources are not accessible.");this.userSetConsentGroupIds=window.OnetrustActiveGroups.split(",").filter(e=>e);const e=window.OneTrust.GetDomainData().Groups;this.userSetConsentGroupNames=[],this.userDeniedConsentGroupIds=[],e.forEach(e=>{const{CustomGroupId:t,GroupName:n}=e;this.userSetConsentGroupIds.includes(t)?this.userSetConsentGroupNames.push(n.toUpperCase().trim()):this.userDeniedConsentGroupIds.push(t)}),this.userSetConsentGroupIds=this.userSetConsentGroupIds.map(e=>e.toUpperCase()),this.isInitialized=!0}isEnabled(e){try{if(!this.isInitialized)return!0;const{oneTrustCookieCategories:t}=e;if(!t)return!0;const n=t.map(e=>e.oneTrustCookieCategory).filter(e=>e);let r=!0;return r=n.every(e=>this.userSetConsentGroupIds.includes(e.toUpperCase().trim())||this.userSetConsentGroupNames.includes(e.toUpperCase().trim())),r}catch(e){return En.error(`Error during onetrust cookie consent management ${e}`),!0}}getDeniedList(){return this.isInitialized?this.userDeniedConsentGroupIds:[]}}class Yi{constructor(){if(this.userConsentedPurposes=[],this.userDeniedPurposes=[],window.updateKetchConsent=e=>{e&&(this.userConsentedPurposes=[],this.userDeniedPurposes=[],this.updatePurposes(e))},window.getKetchUserConsentedPurposes=()=>this.userConsentedPurposes.slice(),window.getKetchUserDeniedPurposes=()=>this.userDeniedPurposes.slice(),window.ketchConsent)this.updatePurposes(window.ketchConsent);else{const e=this.getConsent();this.updatePurposes(e)}}updatePurposes=e=>{e&&Object.entries(e).forEach(e=>{const t=e[0];e[1]?this.userConsentedPurposes.push(t):this.userDeniedPurposes.push(t)})};isEnabled(e){try{const{ketchConsentPurposes:t}=e;if(!t||0===t.length)return!0;const n=t.map(e=>e.purpose).filter(e=>e);let r=!0;return r=n.some(e=>this.userConsentedPurposes.includes(e.trim())),r}catch(e){return En.error(`Error occured checking ketch consent state ${e}`),!0}}getDeniedList(){return this.userDeniedPurposes}getConsent(){const e=rs.get("_ketch_consent_v1_");if(!e)return;let t;try{t=JSON.parse(atob(e))}catch(e){return void En.error(`Error occurred while parsing consent cookie ${e}`)}if(!t)return;const n={};return Object.entries(t).forEach(e=>{const t=e[0],r=e[1];r?.status&&(n[t]="granted"===r.status)}),n}}const Ji={initialize:e=>e?.oneTrust?.enabled?new Wi:e?.ketch?.enabled?new Yi:null};const Zi=new class{constructor(){this.storage=ws,this.timeout=18e5,this.sessionInfo=this.storage.getSessionInfo()||{autoTrack:!0}}initialize(e){try{if(this.sessionInfo.autoTrack=!(!1===e?.sessions?.autoTrack||this.sessionInfo.manualTrack),e?.sessions&&!isNaN(e.sessions.timeout)){const{timeout:t}=e.sessions;0===t&&(En.warn("[Session]:: Provided timeout value 0 will disable the auto session tracking feature."),this.sessionInfo.autoTrack=!1),t>0&&t<1e4&&En.warn('[Session]:: It is not advised to set "timeout" less than 10 seconds'),this.timeout=t}this.sessionInfo.autoTrack?this.startAutoTracking():!1!==this.sessionInfo.autoTrack||this.sessionInfo.manualTrack||this.end()}catch(e){qn(e)}}isValidSession(e){return e<=this.sessionInfo.expiresAt}generateSessionId(){return Date.now()}startAutoTracking(){const e=Date.now();this.isValidSession(e)||(this.sessionInfo={},this.sessionInfo.id=e,this.sessionInfo.expiresAt=e+this.timeout,this.sessionInfo.sessionStart=!0,this.sessionInfo.autoTrack=!0),this.storage.setSessionInfo(this.sessionInfo)}validateSessionId(e){if("number"==typeof e&&e%1==0){var t;if(!(((t=e)?t.toString().length:0)<10))return e;En.error('[Session]:: "sessionId" should at least be "10" digits long')}else En.error('[Session]:: "sessionId" should only be a positive integer')}start(e){const t=e?this.validateSessionId(e):this.generateSessionId();this.sessionInfo={id:t||this.generateSessionId(),sessionStart:!0,manualTrack:!0},this.storage.setSessionInfo(this.sessionInfo)}getSessionId(){return this.sessionInfo.autoTrack&&this.isValidSession(Date.now())||this.sessionInfo.manualTrack?this.sessionInfo.id:null}end(){this.sessionInfo={},this.storage.removeSessionInfo()}getSessionInfo(){const e={};if(this.sessionInfo.autoTrack||this.sessionInfo.manualTrack){if(this.sessionInfo.autoTrack){const e=Date.now();this.isValidSession(e)?this.sessionInfo.expiresAt=e+this.timeout:this.startAutoTracking()}this.sessionInfo.sessionStart&&(e.sessionStart=!0,this.sessionInfo.sessionStart=!1),e.sessionId=this.sessionInfo.id,this.storage.setSessionInfo(this.sessionInfo)}return e}reset(){const{manualTrack:e,autoTrack:t}=this.sessionInfo;t?(this.sessionInfo={},this.startAutoTracking()):e&&this.start()}},eo=["integrations","anonymousId","originalTimestamp"],to=(e,t,n)=>{let r="";if(n){if(r=Ms(n),!r){const e="CDN base URL for integrations is not valid";throw qn({message:`[Analytics] load:: ${e}`}),Error(`Failed to load Rudder SDK: ${e}`)}return r}const{sdkURL:s}=(()=>{const e=document.getElementsByTagName("script");let t;for(let n=0;n<e.length;n+=1){const r=Ms(e[n].getAttribute("src"));if(r&&r.match(/^.*rudder-analytics?(\.min)?\.js$/)){t=r;break}}return{sdkURL:t}})();return r=s?s.split("/").slice(0,-1).concat(Tn).join("/"):On,t&&(r=r.replace(wn,e)),r};const no="rs-bugsnag",ro="bugsnag",so=["Bugsnag",ro],io="0d96a60df267f4a13f808bbaa54e535c",oo=["rudder-analytics.min.js","rudder-analytics.js",...Object.keys(E).map(e=>`${E[e]}.min.js`),...Object.keys(E).map(e=>`${E[e]}.js`)],ao=()=>{const e=window.location.hostname;return e&&["www.test-host.com","localhost","127.0.0.1","[::1]"].includes(e)?"development":"production"},co=e=>{let t=e?._client?._notifier?.version;if(!t){let n=e({apiKey:io,releaseStage:"version-test",beforeSend:function(){return!1}});t=n.notifier?.version,n=void 0}return t&&"6"===t.charAt(0)},uo=e=>{so.every(e=>!function(e,t){if(null==e)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(e),t)}(window,e))&&Ts(e,"https://d2wy8f7a9ursnm.cloudfront.net/v6/bugsnag.min.js",{isNonNativeSDK:"true",skipDatasetAttributes:!0})};class lo{constructor(e,t,n){this.pluginName=no,this.sourceId=e,this.writeKey=t,this.onClientReady=n,this.initClientOnLibReadyInterval=void 0,this.init()}init(){if(window.RudderStackGlobals?.[Bn])return;if(!!io.match(/{{.+}}/))return;uo(this.pluginName);const e=window[ro];"function"!=typeof e?(this.initClientOnLibReadyInterval=setInterval(()=>{const e=window[ro];"function"==typeof e&&(co(e)&&this.initClient(),clearInterval(this.initClientOnLibReadyInterval))},100),setTimeout(()=>{clearInterval(this.initClientOnLibReadyInterval)},Hn)):co(e)&&this.initClient()}initClient(){const e=window[ro];this.client=e({apiKey:io,appVersion:"2.53.0",metaData:{SDK:{name:"JS",installType:"npm"}},beforeSend:this.onError(),autoTrackSessions:!1,collectUserIp:!1,enabledBreadcrumbTypes:["error","log","user"],maxEvents:100,releaseStage:ao(),networkBreadcrumbsEnabled:!1,user:{id:this.writeKey}}),this.onClientReady()}onError(){const e=this.sourceId;return t=>{try{return!!(e=>{const t=Mr(e,"stacktrace.0.file");if(!t||"string"!=typeof t)return!1;const n=t.substring(t.lastIndexOf("/")+1);return oo.includes(n)})(t)&&(((e,t)=>{e.updateMetaData("source",{metadataSource:t});const{errorMessage:n}=e;e.context=n,n.includes("error in script loading")&&(e.context="Script load failures"),e.severity="error"})(t,e),!0)}catch{return!1}}}notify(e){this.client&&this.client.notify(e)}leaveBreadcrumb(e){this.client&&this.client.leaveBreadcrumb(e)}}const ho=no,fo=[no];class po{constructor(e){this.isEnabled=!1,this.providerName=ho,this.provider=void 0,this.logger=e,this.onClientReady=this.onClientReady.bind(this),this.exposeToGlobal=this.exposeToGlobal.bind(this)}init(e,t,n){e&&t?!0===(e=>Mr(e,"statsCollection.errors.enabled")||!1)(e)?(this.enable(),this.setProviderName((e=>Mr(e,"statsCollection.errors.provider"))(e)),this.initProvider(e,t,n)):this.disable():this.logger.error("[Analytics] ErrorReporting :: Invalid configuration or missing source id provided.")}enable(){this.isEnabled=!0}disable(){this.isEnabled=!1}setProviderName(e){e?!e||fo.includes(e)?this.providerName=e:this.logger.error(`[Analytics] ErrorReporting :: Invalid error reporting provider value. Value should be one of: ${fo.join(",")}`):this.providerName=ho}initProvider(e,t,n){if(this.providerName===no)this.provider=new lo(t,n,this.onClientReady)}onClientReady(){this.exposeToGlobal()}exposeToGlobal(){window.RudderStackGlobals||(window.RudderStackGlobals={}),window.RudderStackGlobals[Bn]=this}leaveBreadcrumb(e){if(this.provider)try{this.provider.leaveBreadcrumb(e)}catch(e){this.logger.error(`[Analytics] ErrorReporting :: leaveBreadcrumb method ${e.toString()}`)}}notify(e){if(this.provider)try{this.provider.notify(e)}catch(e){this.logger.error(`[Analytics] ErrorReporting :: notify method ${e.toString()}`)}}}const go=new class{constructor(){this.retryAttempt=3,this.queue=[],this.isTransformationProcessing=!1,this.authToken=null}init(e,t,n){this.dataPlaneUrl=Ms(t),this.writeKey=e,this.authToken=n||this.authToken,this.start()}enqueue(e,t,n){this.queue.push({event:e,destinationIds:t,cb:n})}sendEventForTransformation(e,t){return new Promise((n,r)=>{const s=`${this.dataPlaneUrl}/transform`,i={"Content-Type":"application/json",Authorization:`Basic ${btoa(`${this.writeKey}:`)}`};try{const o=new XMLHttpRequest;o.open("POST",s,!0),Object.keys(i).forEach(e=>o.setRequestHeader(e,i[e])),o.timeout=1e4,o.onreadystatechange=()=>{if(4===o.readyState)try{const{status:s}=o;let{response:i}=o;switch(s){case 200:return i=JSON.parse(i),void n({status:s,transformedPayload:i.transformedBatch});case 400:return void n({status:s,errorMessage:i?`${i}`:"Invalid request payload"});case 404:return void n({status:s});default:if(t>0){const s=t-1;setTimeout(()=>this.sendEventForTransformation(e,s).then(n).catch(r),500*2**(this.retryAttempt-s))}else n({status:s,errorMessage:"Retries exhausted"})}}catch(e){r(e)}};const a=jn(e,!0);a?o.send(a):En.error("Invalid payload: Event dropped")}catch(e){r(e)}})}checkQueueLengthAndProcess(){this.queue.length>0&&this.process()}process(){this.isTransformationProcessing=!0;const e=this.queue.shift(),t=(n=e.event,r=e.destinationIds,{metadata:{"Custom-Authorization":this.authToken},batch:[{orderNo:Date.now(),destinationIds:r,event:n.message}]});var n,r;this.sendEventForTransformation(t,this.retryAttempt).then(t=>{this.isTransformationProcessing=!1,e.cb(t),this.checkQueueLengthAndProcess()}).catch(t=>{qn("string"==typeof t?t:t.message),this.isTransformationProcessing=!1,e.cb({status:0}),this.checkQueueLengthAndProcess()})}start(){setInterval(()=>{this.isTransformationProcessing||this.checkQueueLengthAndProcess()},100)}setAuthToken(e){this.authToken=e}};const yo=new class{constructor(){this.initialized=!1,this.clientIntegrations=[],this.loadOnlyIntegrations={},this.clientIntegrationObjects=void 0,this.successfullyLoadedIntegration=[],this.failedToBeLoadedIntegration=[],this.toBeProcessedArray=[],this.toBeProcessedByIntegrationArray=[],this.storage=ws,this.eventRepository=ji,this.preProcessQueue=new $i,this.sendAdblockPage=!1,this.sendAdblockPageOptions={},this.clientSuppliedCallbacks={},this.readyCallbacks=[],this.methodToCallbackMapping={syncPixel:"syncPixelCallback"},this.loaded=!1,this.loadIntegration=!0,this.bufferDataPlaneEventsUntilReady=!1,this.dataPlaneEventsBufferTimeout=1e4,this.integrationsData={},this.dynamicallyLoadedIntegrations={},this.destSDKBaseURL=On,this.cookieConsentOptions={},this.logLevel=void 0,this.clientIntegrationsReady=!1,this.uSession=Zi,this.version="2.53.0",this.lockIntegrationsVersion=!1,this.errorReporting=new po(En),this.deniedConsentIds=[],this.transformationHandler=go}initializeUser(e){this.userId=this.storage.getUserId()||"",this.storage.setUserId(this.userId),this.userTraits={};const t=this.storage.getUserTraits();null===t||"object"!=typeof t||Array.isArray(t)||(this.userTraits=t),this.storage.setUserTraits(this.userTraits),this.groupId=this.storage.getGroupId()||"",this.storage.setGroupId(this.groupId),this.groupTraits={};const n=this.storage.getGroupTraits();null===n||"object"!=typeof n||Array.isArray(n)||(this.groupTraits=n),this.storage.setGroupTraits(this.groupTraits),this.anonymousId=this.getAnonymousId(e),this.storage.setAnonymousId(this.anonymousId)}setInitialPageProperties(){if(null==this.storage.getInitialReferrer()&&null==this.storage.getInitialReferringDomain()){const e=Hs();this.storage.setInitialReferrer(e),this.storage.setInitialReferringDomain(Qs(e))}}allModulesInitialized(e=0){return new Promise(t=>{this.clientIntegrations.every(e=>null!=this.dynamicallyLoadedIntegrations[`${E[e.name]}_RS`])||e>=2e4?t(this):this.pause(Qn).then(()=>this.allModulesInitialized(e+Qn).then(t))})}executeReadyCallback(){this.readyCallbacks.forEach(e=>e())}integrationSDKLoaded(e,t){return window[e]?.[t]?.prototype&&void 0!==window[e][t].prototype.constructor}processResponse(e,t){try{let e=t;try{if("string"==typeof t&&(e=JSON.parse(t)),!e||"object"!=typeof e||Array.isArray(e))return void En.error("Invalid source configuration")}catch(e){return void qn(e)}try{window.chrome?.runtime?.id||this.errorReporting.init(e.source.config,e.source.id,this.writeKey)}catch(e){qn(e)}if(this.serverUrl=Ks(e,this.serverUrl,this.options),this.eventRepository.initialize(this.writeKey,this.serverUrl,this.options),this.transformationHandler.init(this.writeKey,this.serverUrl,this.storage.getAuthToken()),e.source.destinations.forEach(function(e){e.enabled&&this.clientIntegrations.push({name:e.destinationDefinition.name,config:e.config,destinationInfo:{shouldApplyDeviceModeTransformation:e.shouldApplyDeviceModeTransformation||!1,propagateEventsUntransformedOnError:e.propagateEventsUntransformedOnError||!1,destinationId:e.id}})},this),this.clientIntegrations=Fs(this.loadOnlyIntegrations,this.clientIntegrations),Object.keys(this.cookieConsentOptions).length>0)try{const e=Ji.initialize(this.cookieConsentOptions);this.deniedConsentIds=e?.getDeniedList(),this.clientIntegrations=this.clientIntegrations.filter(t=>!e||e&&e.isEnabled(t.config))}catch(e){qn(e)}this.loaded=!0,this.options&&"function"==typeof this.options.onLoaded&&this.options.onLoaded(this),function(e){if(e.toBeProcessedArray.length>0)for(;e.toBeProcessedArray.length>0;){const t=[...e.toBeProcessedArray[0]];e.toBeProcessedArray.shift();const n=t[0];t.shift(),e[n](...t)}}(this),this.clientIntegrations=this.clientIntegrations.filter(e=>!!E[e.name]||(En.error(`[Analytics] Integration:: ${e.name} not available for initialization`),!1)),this.bufferDataPlaneEventsUntilReady&&setTimeout(()=>{this.processBufferedCloudModeEvents()},this.dataPlaneEventsBufferTimeout),this.errorReporting.leaveBreadcrumb("Starting device-mode initialization"),this.clientIntegrations.forEach(e=>{const t=E[e.name],n=`${t}_RS`,r=`${this.destSDKBaseURL}/${t}.min.js`;window.hasOwnProperty(n)||Ts(n,r,{isNonNativeSDK:!0});const s=this,i=setInterval(()=>{if(s.integrationSDKLoaded(n,t)){const r=window[n];let o;clearInterval(i);try{const i=`[Analytics] processResponse :: trying to initialize integration name:: ${n}`;this.errorReporting.leaveBreadcrumb(i),o=new r[t](e.config,s,e.destinationInfo),o.init(),s.isInitialized(o).then(()=>{s.dynamicallyLoadedIntegrations[n]=r[t]})}catch(e){const t=`[Analytics] 'integration.init()' failed :: ${n} :: ${e.message}`;qn(e,t),s.failedToBeLoadedIntegration.push(o)}}},100);setTimeout(()=>{clearInterval(i)},Hn)});const n=this;this.allModulesInitialized().then(()=>{if(!n.clientIntegrations||0===n.clientIntegrations.length)return this.clientIntegrationsReady=!0,this.executeReadyCallback(),void(this.toBeProcessedByIntegrationArray=[]);n.replayEvents(n)})}catch(e){qn(e)}}sendDataToDestination(e,t,n){try{if(e[n]){const r=v(t);e[n](r)}}catch(t){const n=`[sendToNative]:: [Destination: ${e.name}]:: `;qn(t,n)}}sendTransformedDataToDestination(e,t,n){try{js(t.message.integrations);const r=e.map(e=>e.destinationId);this.transformationHandler.enqueue(t,r,({status:r,transformedPayload:s,errorMessage:i})=>{e.forEach(e=>{try{switch(r){case 200:{const r=s.find(t=>t.id===e.destinationId),i=[];r?.payload.forEach(n=>{if("200"===n.status)i.push(n);else{const r=`[DMT]:: Event transformation unsuccessful for destination "${e.name}". Reason: `;let s="Unknown";"410"===n.status&&(s="Transformation is not available");let o="Dropping the event",a=En.error;!0===e.propagateEventsUntransformedOnError&&(o="Sending untransformed event to the destination",a=En.warn,i.push({event:t.message}));a(`${r} ${s}. ${o}.`)}}),i?.forEach(t=>{Kn(t.event)&&this.sendDataToDestination(e,{message:t.event},n)});break}case 404:En.warn("[DMT]:: Transformation server access is denied. The configuration data seems to be out of sync. Sending untransformed event to the destination."),this.sendDataToDestination(e,t,n);break;default:!0===e.propagateEventsUntransformedOnError?(En.warn(`[DMT]::[Destination: ${e.name}] :: Transformation request failed with status: ${r} ${i}. Sending untransformed event.`),this.sendDataToDestination(e,t,n)):En.error(`[DMT]::[Destination: ${e.name}] :: Transformation request failed with status: ${r} ${i}. Dropping the event.`)}}catch(t){t instanceof Error&&(t.message=`[DMT]::[Destination:${e.name}]:: ${t.message}`),qn(t)}})})}catch(e){e instanceof Error&&(e.message=`[DMT]:: ${e.message}`),qn(e)}}processAndSendEventsToDeviceMode(e,t,n){const r=[],s=[];e.forEach(e=>{try{!this.IsEventBlackListed(t.message.event,e.name)&&(e.shouldApplyDeviceModeTransformation?s.push(e):r.push(e))}catch(e){qn(e)}}),r.forEach(e=>{this.sendDataToDestination(e,t,n)}),s.length>0&&this.sendTransformedDataToDestination(s,t,n)}queueEventForDataPlane(e,t){const n=t.message.integrations||{All:!0};t.message.integrations=((e,t)=>{const n=v(e),r=Object.keys(t).filter(e=>!(!0===t[e]&&n[e])).reduce((e,n)=>(e[n]=t[n],e),{});return zn(n,r)})(this.integrationsData,n),this.eventRepository.enqueue(t,e)}processBufferedCloudModeEvents(){this.bufferDataPlaneEventsUntilReady&&this.preProcessQueue.activateProcessor()}replayEvents(e){this.errorReporting.leaveBreadcrumb("Started replaying buffered events"),e.clientIntegrationObjects=[],e.clientIntegrationObjects=e.successfullyLoadedIntegration;try{e.clientIntegrationObjects.every(e=>!e.isReady||e.isReady())&&(this.integrationsData=((e,t)=>{let n=v(e);return t.forEach(e=>{if(e.getDataForIntegrationsObject)try{n=zn(n,e.getDataForIntegrationsObject())}catch(e){En.debug("[Analytics: prepareDataForIntegrationsObj]",e)}}),n})(this.integrationsData,e.clientIntegrationObjects),e.clientIntegrationsReady=!0,e.executeReadyCallback())}catch(e){qn(e,"Replay buffered cloud mode events")}this.processBufferedCloudModeEvents(),e.toBeProcessedByIntegrationArray.forEach(t=>{const n=t[0];t.shift(),Object.keys(t[0].message.integrations).length>0&&Us(t[0].message.integrations);const r=Fs(t[0].message.integrations,e.clientIntegrationObjects);this.processAndSendEventsToDeviceMode(r,t[0],n)}),e.toBeProcessedByIntegrationArray=[]}pause(e){return new Promise(t=>{setTimeout(t,e)})}isInitialized(e,t=0){return new Promise(n=>{e.isLoaded()?(this.successfullyLoadedIntegration.push(e),n(this)):t>=Hn?(this.failedToBeLoadedIntegration.push(e),n(this)):this.pause(Qn).then(()=>this.isInitialized(e,t+Qn).then(n))})}page(e,t,n,r,s){if(this.errorReporting.leaveBreadcrumb("Page event"),!this.loaded)return void this.toBeProcessedArray.push(["page",...arguments]);"function"==typeof r&&(s=r,r=null),"function"==typeof n&&(s=n,r=n=null),"function"==typeof t&&(s=t,r=n=t=null),"function"==typeof e&&(s=e,r=n=t=e=null),"object"==typeof e&&null!=e&&null!=e&&(r=t,n=e,t=e=null),"object"==typeof t&&null!=t&&null!=t&&(r=n,n=t,t=null),"string"==typeof e&&"string"!=typeof t&&(t=e,e=null),this.sendAdblockPage&&"RudderJS-Initiated"!==e&&this.sendSampleRequest();let i=v(n);const o=v(r),a=(new ni).setType("page").build();i||(i={}),t&&(a.message.name=i.name=t),e&&(a.message.category=i.category=e),a.message.properties=this.getPageProperties(i),this.processAndSendDataToDestinations("page",a,o,s)}track(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Track event"),!this.loaded)return void this.toBeProcessedArray.push(["track",...arguments]);"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null);const s=v(t),i=v(n),o=(new ni).setType("track").build();e&&o.setEventName(e),o.setProperty(s||{}),this.processAndSendDataToDestinations("track",o,i,r)}identify(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Identify event"),!this.loaded)return void this.toBeProcessedArray.push(["identify",...arguments]);"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),"object"==typeof e&&(n=t,t=e,e=this.userId);const s=$s(e);s&&this.userId&&s!==this.userId&&this.reset(),this.userId=s,this.storage.setUserId(this.userId);const i=v(t),o=v(n);if(i){for(const e in i)this.userTraits[e]=i[e];this.storage.setUserTraits(this.userTraits)}const a=(new ni).setType("identify").build();this.processAndSendDataToDestinations("identify",a,o,r)}alias(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Alias event"),!this.loaded)return void this.toBeProcessedArray.push(["alias",...arguments]);"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),"function"==typeof e&&(r=e,n=null,t=null,e=null),"object"==typeof t&&(n=t,t=null),"object"==typeof e&&(n=e,t=null,e=null);const s=(new ni).setType("alias").build();s.message.previousId=$s(t)||(this.userId?this.userId:this.getAnonymousId()),s.message.userId=$s(e);const i=v(n);this.processAndSendDataToDestinations("alias",s,i,r)}group(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Group event"),!this.loaded)return void this.toBeProcessedArray.push(["group",...arguments]);if(0===arguments.length)return;"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),"object"==typeof e&&(n=t,t=e,e=this.groupId),"function"==typeof e&&(r=e,n=null,t=null,e=this.groupId),this.groupId=$s(e),this.storage.setGroupId(this.groupId);const s=v(t),i=v(n),o=(new ni).setType("group").build();if(s)for(const e in s)this.groupTraits[e]=s[e];else this.groupTraits={};this.storage.setGroupTraits(this.groupTraits),this.processAndSendDataToDestinations("group",o,i,r)}IsEventBlackListed(e,t){if(!e||"string"!=typeof e)return!1;const n=An[t],r=this.clientIntegrations.find(e=>e.name===n),{blacklistedEvents:s,whitelistedEvents:i,eventFilteringOption:o}=r.config;if(!o)return!1;const a=e.trim().toUpperCase();switch(o){case"disable":default:return!1;case"blacklistedEvents":return!!Array.isArray(s)&&s.some(e=>e.eventName.trim().toUpperCase()===a);case"whitelistedEvents":return!Array.isArray(i)||!i.some(e=>e.eventName.trim().toUpperCase()===a)}}shouldUseGlobalIntegrationsConfigInEvents(){return this.useGlobalIntegrationsConfigInEvents&&this.loadOnlyIntegrations&&Object.keys(this.loadOnlyIntegrations).length>0}processAndSendDataToDestinations(e,t,n,r){try{this.anonymousId||this.setAnonymousId(),this.errorReporting.leaveBreadcrumb("Started sending data to destinations"),t.message.context.traits={...this.userTraits},t.message.anonymousId=this.anonymousId,t.message.userId=t.message.userId?t.message.userId:this.userId,"group"==e&&(this.groupId&&(t.message.groupId=this.groupId),this.groupTraits&&(t.message.traits={...this.groupTraits}));try{const{sessionId:e,sessionStart:n}=this.uSession.getSessionInfo();t.message.context.sessionId=e,n&&(t.message.context.sessionStart=!0)}catch(e){qn(e)}(e=>{let t=!1;return Object.keys(e).forEach(n=>{Pn.includes(n)&&"boolean"==typeof e[n].enabled&&!0===e[n].enabled&&(t=!0)}),t})(this.cookieConsentOptions)&&(t.message.context.consentManagement={deniedConsentIds:this.deniedConsentIds||[]}),this.processOptionsParam(t,n),function(e,t){const{properties:n,traits:r,context:s}=e;n&&Object.keys(n).forEach(e=>{Sn.indexOf(e.toLowerCase())>=0&&En.error(`Warning! : Reserved keyword used in properties--\x3e ${e} with ${t} call`)}),r&&Object.keys(r).forEach(e=>{Sn.indexOf(e.toLowerCase())>=0&&En.error(`Warning! : Reserved keyword used in traits--\x3e ${e} with ${t} call`)});const i=s.traits;i&&Object.keys(i).forEach(e=>{Sn.indexOf(e.toLowerCase())>=0&&En.error(`Warning! : Reserved keyword used in traits --\x3e ${e} with ${t} call`)})}(t.message,e);let s=t.message.integrations;s?Us(s):s=this.shouldUseGlobalIntegrationsConfigInEvents()?this.loadOnlyIntegrations:Ln,t.message.integrations=s;try{t.message.context["ua-ch"]=this.uach}catch(e){qn(e)}try{if(this.clientIntegrationObjects){const n=Fs(s,this.clientIntegrationObjects);this.processAndSendEventsToDeviceMode(n,t,e)}else this.toBeProcessedByIntegrationArray.push([e,t])}catch(e){qn(e,"processAndSendEventsToDeviceMode::")}const i=v(t);js(i.message.integrations);!this.bufferDataPlaneEventsUntilReady||this.clientIntegrationObjects?this.queueEventForDataPlane(e,i):this.preProcessQueue.enqueue(e,i),r&&"function"==typeof r&&r(i)}catch(e){qn(e)}}utm(e){const t={};try{const n=new URL(e),r="utm_";n.searchParams.forEach((e,n)=>{if(n.startsWith(r)){let s=n.substring(r.length);"campaign"===s&&(s="name"),t[s]=e}})}catch(e){}return t}addCampaignInfo(e){const t=e.message.context;t&&"object"==typeof t&&(e.message.context.campaign=this.utm(window.location.href))}processOptionsParam(e,t){const{type:n,properties:r}=e.message;this.addCampaignInfo(e),e.message.context.page=this.getContextPageProperties("page"===n?r:void 0),((e,t={})=>{"object"==typeof t&&null!==t&&Object.keys(t).forEach(n=>{eo.includes(n)&&(e[n]=t[n])})})(e.message,t),e.message.context=((e,t={})=>{let{context:n}=e;return"object"!=typeof t||null===t||Object.keys(t).forEach(e=>{if(!eo.includes(e)&&!xn.includes(e))if("context"!==e)n=zn(n,{[e]:t[e]});else if("object"==typeof t[e]&&null!==t[e]){const r={};Object.keys(t[e]).forEach(n=>{xn.includes(n)||(r[n]=t[e][n])}),n=zn(n,{...r})}else En.error(`[Analytics: processOptionsParam] context passed in options ${e} is not object.`)}),n})(e.message,t)}getPageProperties(e,t){const n=qs(),r=t?.page||{};for(const t in n)void 0===e[t]&&(e[t]=r[t]||n[t]);return e}getContextPageProperties(e){const t=qs(),n={};for(const r in t)n[r]=e?.[r]?e[r]:t[r];return n}reset(e){this.errorReporting.leaveBreadcrumb(`reset API :: flag: ${e}`),this.loaded?(e&&(this.anonymousId=""),this.userId="",this.userTraits={},this.groupId="",this.groupTraits={},this.uSession.reset(),this.storage.clear(e)):this.toBeProcessedArray.push(["reset",e])}getAnonymousId(e){return this.anonymousId=this.storage.getAnonymousId(e),this.anonymousId||this.setAnonymousId(),this.anonymousId}getUserId(){return this.userId}getSessionId(){return this.uSession.getSessionId()}getUserTraits(){return this.userTraits}getGroupId(){return this.groupId}getGroupTraits(){return this.groupTraits}setAnonymousId(e,t){const n=t?Xi(t):null,r=n?n.rs_amp_id:null;this.anonymousId=e||r||Ns(),this.storage.setAnonymousId(this.anonymousId)}isValidWriteKey(e){return e&&"string"==typeof e&&e.trim().length>0}isValidServerUrl(e){return e&&"string"==typeof e&&e.trim().length>0}isDatasetAvailable(){const e=document.createElement("div");return e.setAttribute("data-a-b","c"),!!e.dataset&&"c"===e.dataset.aB}loadAfterPolyfill(e,n,r){if("object"==typeof n&&null!==n&&(r=n,n=null),r?.logLevel&&(this.logLevel=r.logLevel,En.setLogLevel(r.logLevel)),!this.isValidWriteKey(e))throw Error("Unable to load the SDK due to invalid writeKey");if(!this.storage||0===Object.keys(this.storage).length)throw Error("Cannot proceed as no storage is available");r?.cookieConsentManager&&(this.cookieConsentOptions=r.cookieConsentManager),this.writeKey=e,this.serverUrl=n,this.options=r;let s={};r?.setCookieDomain&&(s={...s,domain:r.setCookieDomain}),r&&"boolean"==typeof r.secureCookie&&(s={...s,secure:r.secureCookie}),r&&"boolean"==typeof r.sameDomainCookiesOnly&&(s={...s,sameDomainCookiesOnly:r.sameDomainCookiesOnly}),r&&-1!==Rn.indexOf(r.sameSiteCookie)&&(s={...s,samesite:r.sameSiteCookie}),this.storage.options(s);if(r&&"string"==typeof r.uaChTrackLevel&&Dn.includes(r.uaChTrackLevel)&&(this.uaChTrackLevel=r.uaChTrackLevel),navigator.userAgentData&&((e,t="none")=>{"none"===t&&e(void 0),"default"===t&&e(navigator.userAgentData),"full"===t&&navigator.userAgentData.getHighEntropyValues(["architecture","bitness","brands","mobile","model","platform","platformVersion","uaFullVersion","fullVersionList","wow64"]).then(t=>{e(t)})})(e=>{this.uach=e},this.uaChTrackLevel),r?.integrations&&(t(this.loadOnlyIntegrations,r.integrations),Us(this.loadOnlyIntegrations)),this.useGlobalIntegrationsConfigInEvents=r&&!0===r.useGlobalIntegrationsConfigInEvents,r?.sendAdblockPage&&(this.sendAdblockPage=!0),r?.sendAdblockPageOptions&&"object"==typeof r.sendAdblockPageOptions&&(this.sendAdblockPageOptions=r.sendAdblockPageOptions),this.uSession.initialize(r),r?.clientSuppliedCallbacks){const e={};Object.keys(this.methodToCallbackMapping).forEach(t=>{this.methodToCallbackMapping.hasOwnProperty(t)&&r.clientSuppliedCallbacks[this.methodToCallbackMapping[t]]&&(e[t]=r.clientSuppliedCallbacks[this.methodToCallbackMapping[t]])}),t(this.clientSuppliedCallbacks,e),this.registerCallbacks(!0)}if(null!=r?.loadIntegration&&(this.loadIntegration=!!r.loadIntegration),r&&"boolean"==typeof r.bufferDataPlaneEventsUntilReady&&(this.bufferDataPlaneEventsUntilReady=!0===r.bufferDataPlaneEventsUntilReady,this.bufferDataPlaneEventsUntilReady&&this.preProcessQueue.init(this.options,this.queueEventForDataPlane.bind(this))),r&&"number"==typeof r.dataPlaneEventsBufferTimeout&&(this.dataPlaneEventsBufferTimeout=r.dataPlaneEventsBufferTimeout),r&&void 0!==r.lockIntegrationsVersion&&(this.lockIntegrationsVersion=!0===r.lockIntegrationsVersion),this.initializeUser(r?r.anonymousIdOptions:void 0),this.setInitialPageProperties(),this.destSDKBaseURL=to(this.version,this.lockIntegrationsVersion,r?.destSDKBaseURL),r?.getSourceConfig){if("function"!=typeof r.getSourceConfig)qn(new Error('option "getSourceConfig" must be a function'));else{const e=r.getSourceConfig();e instanceof Promise?e.then(e=>this.processResponse(200,e)).catch(qn):this.processResponse(200,e)}return}let i=((e,t)=>{let n=kn;const r=[];return e&&r.push(`writeKey=${e}`),t&&r.push(`lockIntegrationsVersion=${t}`),r.length>0&&(n=kn.concat(kn.includes("?")?"&":"?"),n=n.concat(r.join("&"))),n})(e,this.lockIntegrationsVersion);r?.configUrl&&(i=function(e,t){let n=e;-1===n.indexOf("sourceConfig")&&(n=`${Ms(n)}/sourceConfig/`),n="/"===n.slice(-1)?n:`${n}/`;const r=t.split("?")[1],s=n.split("?");return n=s.length>1&&s[1]!==r?`${s[0]}?${r}`:`${n}?${r}`,n}(r.configUrl,i));try{!function(e,t,n,r){const s=r.bind(e),i=new XMLHttpRequest;i.open("GET",t,!0),i.setRequestHeader("Authorization",`Basic ${btoa(`${n}:`)}`),i.onload=function(){const{status:e,responseText:n}=i;200===e?s(200,n):(qn(new Error(`${Mn} ${e} for url: ${t}`)),s(e))},i.send()}(this,i,e,this.processResponse)}catch(e){qn(e)}}arePolyfillsRequired(e){return(!e||"boolean"!=typeof e.polyfillIfRequired||e.polyfillIfRequired)&&(!String.prototype.endsWith||!String.prototype.startsWith||!String.prototype.includes||!Array.prototype.find||!Array.prototype.includes||"function"!=typeof window.URL||"undefined"==typeof Promise||!Object.entries||!Object.values||!String.prototype.replaceAll||!this.isDatasetAvailable()||"function"!=typeof TextDecoder||"function"!=typeof TextEncoder)}load(e,t,n){if(this.loaded)return;const r=v(n);if(this.arePolyfillsRequired(r)&&_n){const n="polyfill";Ts(n,_n,{skipDatasetAttributes:!0});const s=this,i=setInterval(()=>{!window.hasOwnProperty(n)&&null===document.getElementById(n)||"undefined"==typeof Promise||(clearInterval(i),s.loadAfterPolyfill(e,t,r))},100);setTimeout(()=>{clearInterval(i)},Hn)}else this.loadAfterPolyfill(e,t,r)}ready(e){this.loaded?"function"!=typeof e?En.error("ready callback is not a function"):this.clientIntegrationsReady?e():this.readyCallbacks.push(e):this.toBeProcessedArray.push(["ready",e])}initializeCallbacks(){Object.keys(this.methodToCallbackMapping).forEach(e=>{this.methodToCallbackMapping.hasOwnProperty(e)&&this.on(e,()=>{})})}registerCallbacks(e){e||Object.keys(this.methodToCallbackMapping).forEach(e=>{this.methodToCallbackMapping.hasOwnProperty(e)&&window.rudderanalytics&&"function"==typeof window.rudderanalytics[this.methodToCallbackMapping[e]]&&(this.clientSuppliedCallbacks[e]=window.rudderanalytics[this.methodToCallbackMapping[e]])}),Object.keys(this.clientSuppliedCallbacks).forEach(e=>{this.clientSuppliedCallbacks.hasOwnProperty(e)&&this.on(e,this.clientSuppliedCallbacks[e])})}sendSampleRequest(){Ts("ad-block","//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",{isNonNativeSDK:!0})}startSession(e){this.uSession.start(e)}endSession(){this.uSession.end()}setAuthToken(e){"string"==typeof e?(this.storage.setAuthToken(e),this.transformationHandler.setAuthToken(e)):En.error("Provided input should be in string format")}};c(yo),window.addEventListener("error",e=>{qn(e,void 0,yo)},!0),yo.initializeCallbacks(),yo.registerCallbacks(!1);const mo="load",vo=window.rudderanalytics,Io=Array.isArray(vo);let Ao;if(Io){let e=0;for(;e<vo.length;){if(vo[e]&&vo[e][0]===mo){Ao=vo[e],vo.splice(e,1);break}e+=1}}!function(e){const t="ajs_trait_",n="ajs_prop_";function r(e,t){const n={};return Object.keys(e).forEach(r=>{r.startsWith(t)&&(n[r.substr(t.length)]=e[r])}),n}const s=(e=>{const t={};try{new URL(e).searchParams.forEach((e,n)=>{t[n]=e})}catch(e){}return t})(e);s.ajs_aid&&yo.toBeProcessedArray.push(["setAnonymousId",s.ajs_aid]),s.ajs_uid&&yo.toBeProcessedArray.push(["identify",s.ajs_uid,r(s,t)]),s.ajs_event&&yo.toBeProcessedArray.push(["track",s.ajs_event,r(s,n)])}(window.location.href),Io&&vo.forEach(e=>yo.toBeProcessedArray.push(e)),Ao&&Ao.length>0&&(Ao.shift(),yo[mo](...Ao));const bo=yo.ready.bind(yo),Eo=yo.identify.bind(yo),So=yo.page.bind(yo),ko=yo.track.bind(yo),wo=yo.alias.bind(yo),To=yo.group.bind(yo),Oo=yo.reset.bind(yo),_o=yo.load.bind(yo),Ro=yo.initialized=!0,Co=yo.getUserId.bind(yo),Po=yo.getSessionId.bind(yo),xo=yo.getUserTraits.bind(yo),Do=yo.getAnonymousId.bind(yo),Lo=yo.setAnonymousId.bind(yo),Mo=yo.getGroupId.bind(yo),No=yo.getGroupTraits.bind(yo),Bo=yo.startSession.bind(yo),Go=yo.endSession.bind(yo),Uo=yo.setAuthToken.bind(yo);En.error("This RudderStack JavaScript SDK package is deprecated and no longer maintained. While your events are still being tracked and delivered, we strongly recommend you to migrate to the latest [@rudderstack/analytics-js](https://www.npmjs.com/package/@rudderstack/analytics-js) package for enhanced features, security updates, and ongoing support. For more details, visit the migration guide: https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/migration-guide/."),e.alias=wo,e.endSession=Go,e.getAnonymousId=Do,e.getGroupId=Mo,e.getGroupTraits=No,e.getSessionId=Po,e.getUserId=Co,e.getUserTraits=xo,e.group=To,e.identify=Eo,e.initialized=Ro,e.load=_o,e.page=So,e.ready=bo,e.reset=Oo,e.setAnonymousId=Lo,e.setAuthToken=Uo,e.startSession=Bo,e.track=ko});