rudder-sdk-js 2.52.21 → 2.52.23

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(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,f(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=d(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function o(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(){return s=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},s.apply(null,arguments)}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,s,a=[],u=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t);else for(;!(u=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){c=!0,i=e}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||d(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function d(e,n){if(e){if("string"==typeof e)return t(e,n);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}var p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function y(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&1===Object.keys(e).length?e.default:e}var v,m={exports:{}};function b(){return v||(v=1,function(e){function t(e){if(e)return function(e){return s(e,t.prototype),e._callbacks=new Map,e}(e);this._callbacks=new Map}t.prototype.on=function(e,t){var n,r=null!==(n=this._callbacks.get(e))&&void 0!==n?n:[];return r.push(t),this._callbacks.set(e,r),this},t.prototype.once=function(e,t){var n=this,r=function(){n.off(e,r);for(var i=arguments.length,o=new Array(i),s=0;s<i;s++)o[s]=arguments[s];t.apply(n,o)};return r.fn=t,this.on(e,r),this},t.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;var n=this._callbacks.get(e);if(n){var r,o=i(n.entries());try{for(o.s();!(r=o.n()).done;){var s=c(r.value,2),a=s[0],u=s[1];if(u===t||u.fn===t){n.splice(a,1);break}}}catch(e){o.e(e)}finally{o.f()}0===n.length?this._callbacks.delete(e):this._callbacks.set(e,n)}return this},t.prototype.emit=function(e){var t=this._callbacks.get(e);if(t){for(var n=l(t),r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];var a,u=i(n);try{for(u.s();!(a=u.n()).done;){a.value.apply(this,o)}}catch(e){u.e(e)}finally{u.f()}}return this},t.prototype.listeners=function(e){var t;return null!==(t=this._callbacks.get(e))&&void 0!==t?t:[]},t.prototype.listenerCount=function(e){if(e)return this.listeners(e).length;var t,n=0,r=i(this._callbacks.values());try{for(r.s();!(t=r.n()).done;){n+=t.value.length}}catch(e){r.e(e)}finally{r.f()}return n},t.prototype.hasListeners=function(e){return this.listenerCount(e)>0},t.prototype.addEventListener=t.prototype.on,t.prototype.removeListener=t.prototype.off,t.prototype.removeEventListener=t.prototype.off,t.prototype.removeAllListeners=t.prototype.off,e.exports=t}(m)),m.exports}var I=g(b());function A(e){return null!=e&&"object"===h(e)&&!0===e["@@functional/placeholder"]}function k(e){return function t(n){return 0===arguments.length||A(n)?t:e.apply(this,arguments)}}function E(e){return function t(n,r){switch(arguments.length){case 0:return t;case 1:return A(n)?t:k(function(t){return e(n,t)});default:return A(n)&&A(r)?t:A(n)?k(function(t){return e(t,r)}):A(r)?k(function(t){return e(n,t)}):e(n,r)}}}function S(e){return function t(n,r,i){switch(arguments.length){case 0:return t;case 1:return A(n)?t:E(function(t,r){return e(n,t,r)});case 2:return A(n)&&A(r)?t:A(n)?E(function(t,n){return e(t,r,n)}):A(r)?E(function(t,r){return e(n,t,r)}):k(function(t){return e(n,r,t)});default:return A(n)&&A(r)&&A(i)?t:A(n)&&A(r)?E(function(t,n){return e(t,n,i)}):A(n)&&A(i)?E(function(t,n){return e(t,r,n)}):A(r)&&A(i)?E(function(t,r){return e(n,t,r)}):A(n)?k(function(t){return e(t,r,i)}):A(r)?k(function(t){return e(n,t,i)}):A(i)?k(function(t){return e(n,r,t)}):e(n,r,i)}}}function w(e,t){return Object.prototype.hasOwnProperty.call(t,e)}var O=k(function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)});function T(e){return"[object Object]"===Object.prototype.toString.call(e)}function _(e,t,n){if(n||(n=new P),function(e){var t=h(e);return null==e||"object"!=t&&"function"!=t}(e))return e;var r,i=function(t){var r=n.get(e);if(r)return r;for(var i in n.set(e,t),e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=_(e[i],!0,n));return t};switch(O(e)){case"Object":return i(Object.create(Object.getPrototypeOf(e)));case"Array":return i(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 C,R,P=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((o=n[r])[0]===e)return o[1]}else{var i=this.hash(e);if(n=this.map[i])for(r=0;r<n.length;r+=1){var o;if((o=n[r])[0]===e)return o[1]}}},e}(),D=k(function(e){return null!=e&&"function"==typeof e.clone?e.clone():_(e)}),x=S(function(e,t,n){var r,i={};for(r in n=n||{},t=t||{})w(r,t)&&(i[r]=w(r,n)?e(r,t[r],n[r]):t[r]);for(r in n)w(r,n)&&!w(r,i)&&(i[r]=n[r]);return i}),L=S(function e(t,n,r){return x(function(n,r,i){return T(r)&&T(i)?e(t,r,i):t(n,r,i)},n,r)}),M=S(function(e,t,n){return L(function(t,n,r){return e(n,r)},t,n)}),N={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"},B="ACTIVE_CAMPAIGN",G="ADOBE_ANALYTICS",U="ADROLL",j="AM",F="APPCUES",K="AXEPTIO",z="BINGADS",H="BRAZE",Q="BUGSNAG",V="CHARTBEAT",q="CLEVERTAP",X="COMMANDBAR",W="COMSCORE",Y="CONVERTFLOW",J="CRITEO",$="CUSTOMERIO",Z="DCM_FLOODLIGHT",ee="DRIP",te="ENGAGE",ne="FACEBOOK_PIXEL",re="FULLSTORY",ie="GA",oe="GA360",se="GA4",ae="GA4_V2",ue="GAINSIGHT_PX",ce="GOOGLE_OPTIMIZE",le="GOOGLEADS",fe="GTM",he="HEAP",de="HOTJAR",pe="HS",ge="INTERCOM",ye="ITERABLE",ve="JUNE",me="KEEN",be="KISSMETRICS",Ie="KLAVIYO",Ae="LAUNCHDARKLY",ke="LEMNISK",Ee="LINKEDIN_INSIGHT_TAG",Se="LIVECHAT",we="LOTAME",Oe="LYTICS",Te="MATOMO",_e="MICROSOFT_CLARITY",Ce="MOENGAGE",Re="MOUSEFLOW",Pe="MP",De="NINETAILED",xe="OLARK",Le="OPTIMIZELY",Me="PENDO",Ne="PINTEREST_TAG",Be="PODSIGHTS",Ge="POST_AFFILIATE_PRO",Ue="POSTHOG",je="PROFITWELL",Fe="QUALAROO",Ke="QUALTRICS",ze="QUANTUMMETRIC",He="QUORA_PIXEL",Qe="REDDIT_PIXEL",Ve="REFINER",qe="ROCKERBOX",Xe="ROLLBAR",We="SATISMETER",Ye="SENDINBLUE",Je="SENTRY",$e="SHYNET",Ze="SNAP_PIXEL",et="SNAPENGAGE",tt="SPOTIFYPIXEL",nt="SPRIG",rt="TIKTOK_ADS",it="TVSQUARED",ot="USERPILOT",st="VERO",at="VWO",ut="WOOPRA",ct="XPIXEL",lt="YANDEX_METRICA",ft=o(o(o(o(o(o({"Adobe Analytics":G,ADOBEANALYTICS:G,"ADOBE ANALYTICS":G},G,G),"AdobeAnalytics",G),"adobeanalytics",G),"adobe analytics",G),"Adobe analytics",G),"adobe Analytics",G),ht=o(o(o(o({},j,j),"AMPLITUDE",j),"Amplitude",j),"am",j),dt=o(o(o(o({},F,F),"Appcues",F),"App Cues",F),"appcues",F),pt=o(o(o(o(o(o(o({},z,z),"BingAds",z),"bingads",z),"Bing Ads",z),"Bing ads",z),"bing Ads",z),"bing ads",z),gt=o(o(o({},H,H),"Braze",H),"braze",H),yt=o(o(o({},Q,Q),"bugsnag",Q),"Bugsnag",Q),vt=o(o(o(o(o({},V,V),"Chartbeat",V),"chartbeat",V),"Chart Beat",V),"chart beat",V),mt=o(o(o({},q,q),"Clevertap",q),"clevertap",q),bt=o(o(o({},J,J),"Criteo",J),"criteo",J),It=o(o(o(o(o({},$,$),"Customerio",$),"Customer.io",$),"CUSTOMER.IO",$),"customer.io",$),At=o(o(o({},ee,ee),"Drip",ee),"drip",ee),kt=o(o(o(o(o(o(o({},ne,ne),"FB Pixel",ne),"Facebook Pixel",ne),"facebook pixel",ne),"fbpixel",ne),"FBPIXEL",ne),"FB_PIXEL",ne),Et=o(o(o(o(o(o(o(o({},re,re),"Fullstory",re),"FullStory",re),"full Story",re),"Full Story",re),"Full story",re),"full story",re),"fullstory",re),St=o(o(o(o(o({},ie,ie),"Google Analytics",ie),"GoogleAnalytics",ie),"GOOGLE ANALYTICS",ie),"google analytics",ie),wt=o(o(o(o(o(o(o(o(o(o({},se,se),"Google Analytics 4",se),"Google analytics 4",se),"google analytics 4",se),"Google Analytics4",se),"Google analytics4",se),"google analytics4",se),"Google Analytics 4 (GA4)",se),"google analytics 4 (ga4)",se),"GoogleAnalytics4",se),Ot=o(o(o(o(o(o(o(o(o(o({},ae,ae),"Google Analytics 4 V2",ae),"Google analytics 4 V2",ae),"google analytics 4 V2",ae),"Google Analytics4 V2",ae),"Google analytics4 V2",ae),"google analytics4 V2",ae),"Google Analytics 4 (GA4) V2",ae),"google analytics 4 (ga4) V2",ae),"GoogleAnalytics4V2",ae),Tt=o(o(o(o(o(o({},le,le),"Google Ads",le),"GoogleAds",le),"GOOGLE ADS",le),"google ads",le),"googleads",le),_t=o(o(o(o(o(o(o(o({},ce,ce),"Google Optimize",ce),"GoogleOptimize",ce),"Googleoptimize",ce),"GOOGLEOPTIMIZE",ce),"google optimize",ce),"Google optimize",ce),"GOOGLE OPTIMIZE",ce),Ct=o(o(o(o(o({},fe,fe),"Google Tag Manager",fe),"google tag manager",fe),"googletag manager",fe),"googletagmanager",fe),Rt=o(o(o(o({},he,he),"Heap",he),"heap",he),"Heap.io",he),Pt=o(o(o(o(o({},de,de),"Hotjar",de),"hotjar",de),"Hot Jar",de),"hot jar",de),Dt=o(o(o(o(o(o({},pe,pe),"Hubspot",pe),"HUBSPOT",pe),"hub spot",pe),"Hub Spot",pe),"Hub spot",pe),xt=o(o(o({},ge,ge),"Intercom",ge),"intercom",ge),Lt=o(o(o(o(o({},me,me),"Keen",me),"Keen.io",me),"keen",me),"keen.io",me),Mt=o(o(o({},be,be),"Kissmetrics",be),"kissmetrics",be),Nt=o(o(o({},Ie,Ie),"Klaviyo",Ie),"klaviyo",Ie),Bt=o(o(o(o(o(o({},Ae,Ae),"LaunchDarkly",Ae),"Launch_Darkly",Ae),"Launch Darkly",Ae),"launchDarkly",Ae),"launch darkly",Ae),Gt=(o(o(o(o(o(o(o(o(o(o(C={},Ee,Ee),"LinkedIn Insight Tag",Ee),"LinkedIn insight tag",Ee),"linkedIn insight tag",Ee),"Linkedin_insight_tag",Ee),"LinkedinInsighttag",Ee),"LinkedinInsightTag",Ee),"LinkedInInsightTag",Ee),"Linkedininsighttag",Ee),"LINKEDININSIGHTTAG",Ee),o(C,"linkedininsighttag",Ee)),Ut=o(o(o({},we,we),"Lotame",we),"lotame",we),jt=o(o(o({},Oe,Oe),"Lytics",Oe),"lytics",Oe),Ft=o(o(o(o(o(o({},Pe,Pe),"MIXPANEL",Pe),"Mixpanel",Pe),"MIX PANEL",Pe),"Mix panel",Pe),"Mix Panel",Pe),Kt=o(o(o(o(o(o(o({},Ce,Ce),"MoEngage",Ce),"moengage",Ce),"Moengage",Ce),"Mo Engage",Ce),"mo engage",Ce),"Mo engage",Ce),zt=o(o(o({},Le,Le),"Optimizely",Le),"optimizely",Le),Ht=o(o(o({},Me,Me),"Pendo",Me),"pendo",Me),Qt=(o(o(o(o(o(o(o(o(o(o(R={},Ne,Ne),"PinterestTag",Ne),"Pinterest_Tag",Ne),"PINTERESTTAG",Ne),"pinterest",Ne),"PinterestAds",Ne),"Pinterest_Ads",Ne),"Pinterest",Ne),"Pinterest Tag",Ne),"Pinterest tag",Ne),o(o(o(o(R,"PINTEREST TAG",Ne),"pinterest tag",Ne),"Pinterest Ads",Ne),"Pinterest ads",Ne)),Vt=o(o(o(o(o(o(o(o({},Ge,Ge),"PostAffiliatePro",Ge),"Post_affiliate_pro",Ge),"Post Affiliate Pro",Ge),"Post affiliate pro",Ge),"post affiliate pro",Ge),"postaffiliatepro",Ge),"POSTAFFILIATEPRO",Ge),qt=o(o(o(o(o(o(o({},Ue,Ue),"PostHog",Ue),"Posthog",Ue),"posthog",Ue),"Post Hog",Ue),"Post hog",Ue),"post hog",Ue),Xt=o(o(o(o(o(o(o({},je,je),"ProfitWell",je),"profitwell",je),"Profitwell",je),"Profit Well",je),"profit well",je),"Profit well",je),Wt=o(o(o({},Ke,Ke),"Qualtrics",Ke),"qualtrics",Ke),Yt=o(o(o(o(o(o(o(o({},ze,ze),"Quantum Metric",ze),"quantum Metric",ze),"quantum metric",ze),"QuantumMetric",ze),"quantumMetric",ze),"quantummetric",ze),"Quantum_Metric",ze),Jt=o(o(o(o(o(o(o(o({},Qe,Qe),"Reddit_Pixel",Qe),"RedditPixel",Qe),"REDDITPIXEL",Qe),"redditpixel",Qe),"Reddit Pixel",Qe),"REDDIT PIXEL",Qe),"reddit pixel",Qe),$t=o(o(o({},Je,Je),"sentry",Je),"Sentry",Je),Zt=o(o(o(o(o(o(o(o({},Ze,Ze),"Snap_Pixel",Ze),"SnapPixel",Ze),"SNAPPIXEL",Ze),"snappixel",Ze),"Snap Pixel",Ze),"SNAP PIXEL",Ze),"snap pixel",Ze),en=o(o(o(o(o(o(o(o(o({},it,it),"TVSquared",it),"tvsquared",it),"tvSquared",it),"TvSquared",it),"Tvsquared",it),"TV Squared",it),"tv squared",it),"tv Squared",it),tn=o(o(o(o(o(o(o(o({},at,at),"VisualWebsiteOptimizer",at),"Visualwebsiteoptimizer",at),"visualwebsiteoptimizer",at),"vwo",at),"Visual Website Optimizer",at),"Visual website optimizer",at),"visual website optimizer",at),nn=o(o(o(o(o(o(o(o(o({},oe,oe),"Google Analytics 360",oe),"Google analytics 360",oe),"google analytics 360",oe),"Google Analytics360",oe),"Google analytics360",oe),"google analytics360",oe),"GoogleAnalytics360",oe),"GA 360",oe),rn=o(o(o(o(o({},U,U),"Adroll",U),"Ad roll",U),"ad roll",U),"adroll",U),on=o(o(o(o(o(o(o(o(o({},Z,Z),"DCM Floodlight",Z),"dcm floodlight",Z),"Dcm Floodlight",Z),"DCMFloodlight",Z),"dcmfloodlight",Z),"DcmFloodlight",Z),"dcm_floodlight",Z),"DCM_Floodlight",Z),sn=o(o(o({},Te,Te),"Matomo",Te),"matomo",Te),an=o(o(o({},st,st),"Vero",st),"vero",st),un=o(o(o(o(o(o(o(o(o({},Re,Re),"Mouseflow",Re),"mouseflow",Re),"mouseFlow",Re),"MouseFlow",Re),"Mouse flow",Re),"mouse flow",Re),"mouse Flow",Re),"Mouse Flow",Re),cn=o(o(o(o(o(o(o({},qe,qe),"Rockerbox",qe),"rockerbox",qe),"RockerBox",qe),"Rocker box",qe),"rocker box",qe),"Rocker Box",qe),ln=o(o(o(o(o(o(o(o(o(o({},Y,Y),"Convertflow",Y),"convertflow",Y),"convertFlow",Y),"ConvertFlow",Y),"Convert flow",Y),"convert flow",Y),"convert Flow",Y),"Convert Flow",Y),"CONVERT FLOW",Y),fn=o(o(o(o(o(o(o({},et,et),"SnapEngage",et),"Snap_Engage",et),"snapengage",et),"SNAP ENGAGE",et),"Snap Engage",et),"snap engage",et),hn=o(o(o(o(o(o(o({},Se,Se),"LiveChat",Se),"Live_Chat",Se),"livechat",Se),"LIVE CHAT",Se),"Live Chat",Se),"live chat",Se),dn=o(o(o(o(o(o(o(o(o({},$e,$e),"shynet",$e),"ShyNet",$e),"shyNet",$e),"Shynet",$e),"shy net",$e),"Shy Net",$e),"shy Net",$e),"Shy net",$e),pn=o(o(o({},ut,ut),"Woopra",ut),"woopra",ut),gn=o(o(o(o(o(o(o(o({},Xe,Xe),"RollBar",Xe),"Roll_Bar",Xe),"rollbar",Xe),"Rollbar",Xe),"ROLL BAR",Xe),"Roll Bar",Xe),"roll bar",Xe),yn=o(o(o(o(o(o(o(o(o(o({},He,He),"Quora Pixel",He),"Quora pixel",He),"QUORA PIXEL",He),"QuoraPixel",He),"Quorapixel",He),"QUORAPIXEL",He),"Quora_Pixel",He),"quora_pixel",He),"Quora",He),vn=o(o(o({},ve,ve),"June",ve),"june",ve),mn=o(o(o({},te,te),"Engage",te),"engage",te),bn=o(o(o({},ye,ye),"Iterable",ye),"iterable",ye),In=o(o(o(o(o({},lt,lt),"Yandexmetrica",lt),"yandexmetrica",lt),"yandexMetrica",lt),"YandexMetrica",lt),An=o(o(o({},Ve,Ve),"Refiner",Ve),"refiner",Ve),kn=o(o(o({},Fe,Fe),"Qualaroo",Fe),"qualaroo",Fe),En=o(o(o(o(o(o(o(o({},Be,Be),"Podsights",Be),"PodSights",Be),"pod Sights",Be),"Pod Sights",Be),"pod sights",Be),"POD SIGHTS",Be),"Pod sights",Be),Sn=o(o(o({},K,K),"Axeptio",K),"axeptio",K),wn=o(o(o({},We,We),"Satismeter",We),"SatisMeter",We),On=o(o(o(o(o(o(o(o(o({},_e,_e),"Microsoft Clarity",_e),"Microsoft clarity",_e),"microsoft clarity",_e),"Microsoft_clarity",_e),"MicrosoftClarity",_e),"MICROSOFTCLARITY",_e),"microsoftclarity",_e),"microsoftClarity",_e),Tn=o(o(o(o({},Ye,Ye),"Sendinblue",Ye),"sendinblue",Ye),"SendinBlue",Ye),_n=o(o(o({},xe,xe),"Olark",xe),"olark",xe),Cn=o(o(o(o(o(o(o(o({},ke,ke),"LEMNISK_MARKETING_AUTOMATION",ke),"Lemnisk Marketing Automation",ke),"LemniskMarketingAutomation",ke),"lemniskmarketingautomation",ke),"lemniskMarketingAutomation",ke),"lemnisk",ke),"Lemnisk",ke),Rn=o(o(o(o(o(o(o({},rt,rt),"TiktokAds",rt),"Tiktok ads",rt),"Tiktok Ads",rt),"Tik Tok Ads",rt),"tik tok ads",rt),"tiktokads",rt),Pn=o(o(o(o(o(o({ActiveCampaign:B,"Active Campaign":B,"ACTIVE CAMPAIGN":B},B,B),"activecampaign",B),"active campaign",B),"Active campaign",B),"active Campaign",B),"active_campaign",B),Dn=o(o(o({},nt,nt),"Sprig",nt),"sprig",nt),xn=o(o(o(o({},tt,tt),"Spotify Pixel",tt),"spotify pixel",tt),"SPOTIFY_PIXEL",tt),Ln=o(o(o(o(o({},X,X),"Command Bar",X),"Commandbar",X),"COMMAND_BAR",X),"commandbar",X),Mn=o(o(o(o({},De,De),"Ninetailed",De),"ninetailed",De),"NineTailed",De),Nn=o(o(o(o(o({},ct,ct),"XPixel",ct),"Xpixel",ct),"xpixel",ct),"xPixel",ct),Bn=o(o({},ue,ue),"Gainsight_PX",ue),Gn=o(o(o({},ot,ot),"userpilot",ot),"Userpilot",ot);o({},"Comscore","Comscore");var Un=o(o(o(o({},W,W),"Comscore",W),"comscore",W),"comScore",W),jn=u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u({All:"All"},ft),ht),dt),pt),gt),yt),Ln),vt),mt),bt),It),At),kt),Et),St),wt),Ot),nn),Tt),_t),Ct),Rt),Pt),Dt),xt),Lt),Mt),Nt),Bt),Gt),Ut),jt),Ft),Kt),Mn),zt),Ht),Qt),Vt),qt),Xt),Wt),Yt),Jt),$t),Zt),en),tn),rn),on),sn),an),un),ln),fn),hn),dn),pn),gn),yn),vn),mn),bn),cn),In),An),kn),En),Sn),wn),On),Tn),_n),Cn),Rn),Pn),Dn),xn),Nn),Bn),Gn),Un),Fn=3,Kn={setLogLevel:function(e){switch(e.toUpperCase()){case"INFO":Fn=1;break;case"DEBUG":Fn=2;break;default:Fn=3}},info:function(){var e;Fn<=1&&(e=console).info.apply(e,arguments)},debug:function(){var e;Fn<=2&&(e=console).log.apply(e,arguments)},warn:function(){var e;Fn<=3&&(e=console).warn.apply(e,arguments)},error:function(){var e;Fn<=4&&(e=console).error.apply(e,arguments)}},zn=["anonymous_id","id","sent_at","received_at","timestamp","original_timestamp","event_text","event"],Hn="https://api.rudderstack.com/sourceConfig/?p=npm&v=2.52.21",Qn="v1.1",Vn="js-integrations",qn="".concat("https://cdn.rudderlabs.com","/").concat(Qn,"/").concat(Vn),Xn="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",Wn=["Lax","None","Strict"],Yn=["US","EU"],Jn=["oneTrust","ketch"],$n=["library","consentManagement"],Zn=["none","default","full"],er={All:!0},tr="Request failed with status:",nr=[tr],rr="errorReporting",ir=function(e){var t,n=null===(t=window.RudderStackGlobals)||void 0===t?void 0:t[rr];n&&e instanceof Error&&n.notify(e)},or=function(e,t){try{return JSON.stringify(e,function(e){var t=[];return function(n,r){if(!e||null!=r){if("object"!==h(r)||null===r)return r;for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(r)?(Kn.debug("Circular Reference detected for key: ".concat(n)),"[Circular Reference]"):(t.push(r),r)}}}(t))}catch(e){return Kn.warn("Failed to convert the value to a JSON string."),null}},sr=function(e){return null===e},ar=function(e){return!sr(e)&&function(e){return"object"===h(e)}(e)&&!Array.isArray(e)},ur=function(e,t){if(!Array.isArray(e)||!Array.isArray(t))return D(t);var n=D(e);return t.forEach(function(e,t){n[t]=Array.isArray(e)||ar(e)?cr(n[t],e):e}),n},cr=function(e,t){return M(ur,e,t)},lr=function(e){return function(e){return!sr(e)&&"[object Object]"===Object.prototype.toString.call(e)}(e)&&Object.keys(e).length>0},fr=1e4,hr=1e3,dr="RS_JS_SDK",pr=function(e,t,n){var r,i;try{r="string"==typeof e?e:e instanceof Error||e.message?e.message:or(e)}catch(e){r=""}if("object"===h(i=e)&&null!==i&&"target"in i){if(e.target&&"script"!==e.target.localName)return"";if(e.target.dataset&&(e.target.dataset.loader!==dr||"true"!==e.target.dataset.isnonnativesdk))return"";if(r="error in script loading:: src:: ".concat(e.target.src," id:: ").concat(e.target.id),"ad-block"===e.target.id)return n.page("RudderJS-Initiated","ad-block page request",{path:"/ad-blocked",title:r},n.sendAdblockPageOptions),""}return"[handleError]::".concat(t||"",' "').concat(r,'"')},gr=function(e,t,n){var r;try{r=pr(e,t,n)}catch(t){Kn.error("[handleError] Exception:: ",t),Kn.error("[handleError] Original error:: ",or(e)),ir(t)}r&&(Kn.error(r),function(e){return!e.message||!nr.some(function(t){return e.message.includes(t)})}(e)&&ir(e))},yr={exports:{}};var vr,mr={exports:{}},br=y(Object.freeze({__proto__:null,default:{}}));function Ir(){return vr||(vr=1,function(e){var t;e.exports=(t=t||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==p&&p.crypto&&(n=p.crypto),!n)try{n=br}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.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={},s=o.lib={},a=s.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=s.WordArray=a.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var s=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=s<<24-(r+o)%4*8}else for(var a=0;a<i;a+=4)t[r+a>>>2]=n[a>>>2];return this.sigBytes+=i,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=a.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(r());return new u.init(t,e)}}),c=o.enc={},l=c.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).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)}},f=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}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)}},h=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},d=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,s=this.blockSize,a=o/(4*s),c=(a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0))*s,l=e.min(4*c,o);if(c){for(var f=0;f<c;f+=s)this._doProcessBlock(i,f);n=i.splice(0,c),r.sigBytes-=l}return new u.init(n,l)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});s.Hasher=d.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.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)}(mr)),mr.exports}var Ar,kr={exports:{}};function Er(){return Ar||(Ar=1,function(e){var t;e.exports=(t=Ir(),function(){var e=t,n=e.lib.WordArray;function r(e,t,r){for(var i=[],o=0,s=0;s<t;s++)if(s%4){var a=r[e.charCodeAt(s-1)]<<s%4*2|r[e.charCodeAt(s)]>>>6-s%4*2;i[o>>>2]|=a<<24-o%4*8,o++}return n.create(i,o)}e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],o=0;o<n;o+=3)for(var s=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a<n;a++)i.push(r.charAt(s>>>6*(3-a)&63));var u=r.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<n.length;o++)i[n.charCodeAt(o)]=o}var s=n.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(t=a)}return r(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64)}(kr)),kr.exports}var Sr,wr={exports:{}};function Or(){return Sr||(Sr=1,function(e){var t;e.exports=(t=Ir(),function(e){var n=t,r=n.lib,i=r.WordArray,o=r.Hasher,s=n.algo,a=[];!function(){for(var t=0;t<64;t++)a[t]=4294967296*e.abs(e.sin(t+1))|0}();var u=s.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,s=e[t+0],u=e[t+1],d=e[t+2],p=e[t+3],g=e[t+4],y=e[t+5],v=e[t+6],m=e[t+7],b=e[t+8],I=e[t+9],A=e[t+10],k=e[t+11],E=e[t+12],S=e[t+13],w=e[t+14],O=e[t+15],T=o[0],_=o[1],C=o[2],R=o[3];T=c(T,_,C,R,s,7,a[0]),R=c(R,T,_,C,u,12,a[1]),C=c(C,R,T,_,d,17,a[2]),_=c(_,C,R,T,p,22,a[3]),T=c(T,_,C,R,g,7,a[4]),R=c(R,T,_,C,y,12,a[5]),C=c(C,R,T,_,v,17,a[6]),_=c(_,C,R,T,m,22,a[7]),T=c(T,_,C,R,b,7,a[8]),R=c(R,T,_,C,I,12,a[9]),C=c(C,R,T,_,A,17,a[10]),_=c(_,C,R,T,k,22,a[11]),T=c(T,_,C,R,E,7,a[12]),R=c(R,T,_,C,S,12,a[13]),C=c(C,R,T,_,w,17,a[14]),T=l(T,_=c(_,C,R,T,O,22,a[15]),C,R,u,5,a[16]),R=l(R,T,_,C,v,9,a[17]),C=l(C,R,T,_,k,14,a[18]),_=l(_,C,R,T,s,20,a[19]),T=l(T,_,C,R,y,5,a[20]),R=l(R,T,_,C,A,9,a[21]),C=l(C,R,T,_,O,14,a[22]),_=l(_,C,R,T,g,20,a[23]),T=l(T,_,C,R,I,5,a[24]),R=l(R,T,_,C,w,9,a[25]),C=l(C,R,T,_,p,14,a[26]),_=l(_,C,R,T,b,20,a[27]),T=l(T,_,C,R,S,5,a[28]),R=l(R,T,_,C,d,9,a[29]),C=l(C,R,T,_,m,14,a[30]),T=f(T,_=l(_,C,R,T,E,20,a[31]),C,R,y,4,a[32]),R=f(R,T,_,C,b,11,a[33]),C=f(C,R,T,_,k,16,a[34]),_=f(_,C,R,T,w,23,a[35]),T=f(T,_,C,R,u,4,a[36]),R=f(R,T,_,C,g,11,a[37]),C=f(C,R,T,_,m,16,a[38]),_=f(_,C,R,T,A,23,a[39]),T=f(T,_,C,R,S,4,a[40]),R=f(R,T,_,C,s,11,a[41]),C=f(C,R,T,_,p,16,a[42]),_=f(_,C,R,T,v,23,a[43]),T=f(T,_,C,R,I,4,a[44]),R=f(R,T,_,C,E,11,a[45]),C=f(C,R,T,_,O,16,a[46]),T=h(T,_=f(_,C,R,T,d,23,a[47]),C,R,s,6,a[48]),R=h(R,T,_,C,m,10,a[49]),C=h(C,R,T,_,w,15,a[50]),_=h(_,C,R,T,y,21,a[51]),T=h(T,_,C,R,E,6,a[52]),R=h(R,T,_,C,p,10,a[53]),C=h(C,R,T,_,A,15,a[54]),_=h(_,C,R,T,u,21,a[55]),T=h(T,_,C,R,b,6,a[56]),R=h(R,T,_,C,O,10,a[57]),C=h(C,R,T,_,v,15,a[58]),_=h(_,C,R,T,S,21,a[59]),T=h(T,_,C,R,g,6,a[60]),R=h(R,T,_,C,k,10,a[61]),C=h(C,R,T,_,d,15,a[62]),_=h(_,C,R,T,I,21,a[63]),o[0]=o[0]+T|0,o[1]=o[1]+_|0,o[2]=o[2]+C|0,o[3]=o[3]+R|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var o=e.floor(r/4294967296),s=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),t.sigBytes=4*(n.length+1),this._process();for(var a=this._hash,u=a.words,c=0;c<4;c++){var l=u[c];u[c]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function c(e,t,n,r,i,o,s){var a=e+(t&n|~t&r)+i+s;return(a<<o|a>>>32-o)+t}function l(e,t,n,r,i,o,s){var a=e+(t&r|n&~r)+i+s;return(a<<o|a>>>32-o)+t}function f(e,t,n,r,i,o,s){var a=e+(t^n^r)+i+s;return(a<<o|a>>>32-o)+t}function h(e,t,n,r,i,o,s){var a=e+(n^(t|~r))+i+s;return(a<<o|a>>>32-o)+t}n.MD5=o._createHelper(u),n.HmacMD5=o._createHmacHelper(u)}(Math),t.MD5)}(wr)),wr.exports}var Tr,_r={exports:{}},Cr={exports:{}};function Rr(){return Tr||(Tr=1,function(e){var t,n,r,i,o,s,a,u;e.exports=(u=Ir(),n=(t=u).lib,r=n.WordArray,i=n.Hasher,o=t.algo,s=[],a=o.SHA1=i.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],i=n[1],o=n[2],a=n[3],u=n[4],c=0;c<80;c++){if(c<16)s[c]=0|e[t+c];else{var l=s[c-3]^s[c-8]^s[c-14]^s[c-16];s[c]=l<<1|l>>>31}var f=(r<<5|r>>>27)+u+s[c];f+=c<20?1518500249+(i&o|~i&a):c<40?1859775393+(i^o^a):c<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,u=a,a=o,o=i<<30|i>>>2,i=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+u|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=i.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=i._createHelper(a),t.HmacSHA1=i._createHmacHelper(a),u.SHA1)}(Cr)),Cr.exports}var Pr,Dr={exports:{}};var xr;function Lr(){return xr||(xr=1,function(e){var t,n,r,i,o,s,a,u;e.exports=(u=Ir(),Rr(),Pr||(Pr=1,function(e){var t;e.exports=(t=Ir(),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,i=4*n;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),s=this._iKey=t.clone(),a=o.words,u=s.words,c=0;c<n;c++)a[c]^=1549556828,u[c]^=909522486;o.sigBytes=s.sigBytes=i,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))}})}())}(Dr)),n=(t=u).lib,r=n.Base,i=n.WordArray,o=t.algo,s=o.MD5,a=o.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,o=r.hasher.create(),s=i.create(),a=s.words,u=r.keySize,c=r.iterations;a.length<u;){n&&o.update(n),n=o.update(e).finalize(t),o.reset();for(var l=1;l<c;l++)n=o.finalize(n),o.reset();s.concat(n)}return s.sigBytes=4*u,s}}),t.EvpKDF=function(e,t,n){return a.create(n).compute(e,t)},u.EvpKDF)}(_r)),_r.exports}var Mr,Nr={exports:{}};var Br;var Gr,Ur=(Br||(Br=1,function(e){var t;e.exports=(t=Ir(),Er(),Or(),Lr(),Mr||(Mr=1,function(e){var t;e.exports=(t=Ir(),Lr(),void(t.lib.Cipher||function(e){var n=t,r=n.lib,i=r.Base,o=r.WordArray,s=r.BufferedBlockAlgorithm,a=n.enc;a.Utf8;var u=a.Base64,c=n.algo.EvpKDF,l=r.Cipher=s.extend({cfg:i.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(){s.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?b:v}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()});r.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var f=n.mode={},h=r.BlockCipherMode=i.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}}),d=f.CBC=function(){var t=h.extend();function n(t,n,r){var i,o=this._iv;o?(i=o,this._iv=e):i=this._prevBlock;for(var s=0;s<r;s++)t[n+s]^=i[s]}return t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,o=e.slice(t,t+i);r.decryptBlock(e,t),n.call(this,e,t,i),this._prevBlock=o}}),t}(),p=(n.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,s=[],a=0;a<r;a+=4)s.push(i);var u=o.create(s,r);e.concat(u)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:d,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=i.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?o.create([1398893684,1701076831]).concat(n).concat(t):t).toString(u)},parse:function(e){var t,n=u.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=o.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:t})}},v=r.SerializableCipher=i.extend({cfg:i.extend({format:y}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),o=i.finalize(t),s=i.cfg;return g.create({ciphertext:o,key:n,iv:s.iv,algorithm:e,mode:s.mode,padding:s.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}}),m=(n.kdf={}).OpenSSL={execute:function(e,t,n,r,i){if(r||(r=o.random(8)),i)s=c.create({keySize:t+n,hasher:i}).compute(e,r);else var s=c.create({keySize:t+n}).compute(e,r);var a=o.create(s.words.slice(t),4*n);return s.sigBytes=4*t,g.create({key:s,iv:a,salt:r})}},b=r.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:m}),encrypt:function(e,t,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize,r.salt,r.hasher);r.iv=i.iv;var o=v.encrypt.call(this,e,t,i.key,r);return o.mixIn(i),o},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt,r.hasher);return r.iv=i.iv,v.decrypt.call(this,e,t,i.key,r)}})}()))}(Nr)),function(){var e=t,n=e.lib.BlockCipher,r=e.algo,i=[],o=[],s=[],a=[],u=[],c=[],l=[],f=[],h=[],d=[];!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,i[n]=p,o[p]=n;var g=e[n],y=e[g],v=e[y],m=257*e[p]^16843008*p;s[n]=m<<24|m>>>8,a[n]=m<<16|m>>>16,u[n]=m<<8|m>>>24,c[n]=m,m=16843009*v^65537*y^257*g^16843008*n,l[p]=m<<24|m>>>8,f[p]=m<<16|m>>>16,h[p]=m<<8|m>>>24,d[p]=m,n?(n=g^e[e[e[v^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),o=this._keySchedule=[],s=0;s<r;s++)s<n?o[s]=t[s]:(c=o[s-1],s%n?n>6&&s%n==4&&(c=i[c>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c]):(c=i[(c=c<<8|c>>>24)>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c],c^=p[s/n|0]<<24),o[s]=o[s-n]^c);for(var a=this._invKeySchedule=[],u=0;u<r;u++){if(s=r-u,u%4)var c=o[s];else c=o[s-4];a[u]=u<4||s<=4?c:l[i[c>>>24]]^f[i[c>>>16&255]]^h[i[c>>>8&255]]^d[i[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,s,a,u,c,i)},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,f,h,d,o),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,o,s,a){for(var u=this._nRounds,c=e[t]^n[0],l=e[t+1]^n[1],f=e[t+2]^n[2],h=e[t+3]^n[3],d=4,p=1;p<u;p++){var g=r[c>>>24]^i[l>>>16&255]^o[f>>>8&255]^s[255&h]^n[d++],y=r[l>>>24]^i[f>>>16&255]^o[h>>>8&255]^s[255&c]^n[d++],v=r[f>>>24]^i[h>>>16&255]^o[c>>>8&255]^s[255&l]^n[d++],m=r[h>>>24]^i[c>>>16&255]^o[l>>>8&255]^s[255&f]^n[d++];c=g,l=y,f=v,h=m}g=(a[c>>>24]<<24|a[l>>>16&255]<<16|a[f>>>8&255]<<8|a[255&h])^n[d++],y=(a[l>>>24]<<24|a[f>>>16&255]<<16|a[h>>>8&255]<<8|a[255&c])^n[d++],v=(a[f>>>24]<<24|a[h>>>16&255]<<16|a[c>>>8&255]<<8|a[255&l])^n[d++],m=(a[h>>>24]<<24|a[c>>>16&255]<<16|a[l>>>8&255]<<8|a[255&f])^n[d++],e[t]=g,e[t+1]=y,e[t+2]=v,e[t+3]=m},keySize:8});e.AES=n._createHelper(g)}(),t.AES)}(yr)),yr.exports),jr=g(Ur),Fr={exports:{}};var Kr,zr,Hr,Qr,Vr,qr,Xr=g((Gr||(Gr=1,function(e){e.exports=Ir().enc.Utf8}(Fr)),Fr.exports)),Wr=Object.defineProperty,Yr=function(e,t){return Wr(e,"name",{value:t,configurable:!0})},Jr=Yr(function(e){return null!==e&&"object"===h(e)},"isObject"),$r=Yr(function(e,t,n){return"function"==typeof n.join?n.join(e):e[0]+t+e[1]},"join"),Zr=Yr(function(e,t,n){return"function"==typeof n.split?n.split(e):e.split(t)},"split"),ei=Yr(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return"function"!=typeof(null==n?void 0:n.isValid)||n.isValid(e,t)},"isValid"),ti=Yr(function(e){return Jr(e)||"function"==typeof e},"isValidObject"),ni=Yr(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Jr(n)||(n={default:n}),!ti(e))return void 0!==n.default?n.default:e;"number"==typeof t&&(t=String(t));var r=Array.isArray(t),i="string"==typeof t,o=n.separator||".",s=n.joinChar||("string"==typeof o?o:".");if(!i&&!r)return e;var a=e[t];if(void 0===a&&"function"==typeof e.get&&(a=e.get(t)),void 0!==a)return ei(t,e,n)?a:n.default;var u=r?t:Zr(t,o,n),c=u.length,l=0;do{var f=u[l];for("string"!=typeof f&&(f=String(f));f&&"\\"===f.slice(-1);)f=$r([f.slice(0,-1),u[++l]||""],s,n);if(void 0===(a=e[f])&&"function"==typeof e.get&&(a=e.get(f)),void 0!==a){if(!ei(f,e,n))return n.default;e=a}else{for(var h=!1,d=l+1;d<c;)if(void 0===(a=e[f=$r([f,u[d++]],s,n)])&&"function"==typeof e.get&&(a=e.get(f)),h=void 0!==a){if(!ei(f,e,n))return n.default;e=a,l=d-1;break}if(!h)return n.default}}while(++l<c&&ti(e));return l===c?e:n.default},"getValue"),ri=ni,ii={exports:{}},oi={exports:{}};function si(){if(zr)return Kr;zr=1;var e=1e3,t=60*e,n=60*t,r=24*n,i=365.25*r;function o(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return Kr=function(s,a){a=a||{};var u=h(s);if("string"===u&&s.length>0)return function(o){if((o=String(o)).length>100)return;var s=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(o);if(!s)return;var a=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*i;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}}(s);if("number"===u&&!1===isNaN(s))return a.long?function(i){return o(i,r,"day")||o(i,n,"hour")||o(i,t,"minute")||o(i,e,"second")||i+" ms"}(s):function(i){if(i>=r)return Math.round(i/r)+"d";if(i>=n)return Math.round(i/n)+"h";if(i>=t)return Math.round(i/t)+"m";if(i>=e)return Math.round(i/e)+"s";return i+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))},Kr}function ai(){return Hr||(Hr=1,function(e,t){var n;function r(e){function r(){if(r.enabled){var e=r,i=+new Date,o=i-(n||i);e.diff=o,e.prev=n,e.curr=i,n=i;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var u=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;u++;var i=t.formatters[r];if("function"==typeof i){var o=s[u];n=i.call(e,o),s.splice(u,1),u--}return n}),t.formatArgs.call(e,s),(r.log||t.log||console.log.bind(console)).apply(e,s)}}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,i=0;i<r;i++)n[i]&&("-"===(e=n[i].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=si(),t.names=[],t.skips=[],t.formatters={}}(oi,oi.exports)),oi.exports}var ui,ci,li,fi,hi,di,pi,gi=function(){if(qr)return Vr;qr=1;var e=(Qr||(Qr=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=ai()).log=function(){return"object"===("undefined"==typeof console?"undefined":h(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 i=0,o=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(i++,"%c"===e&&(o=i))}),e.splice(o,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())}(ii,ii.exports)),ii.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={},i=e.split(/ *; */);if(""==i[0])return n;for(var o=0;o<i.length;++o)n[r((t=i[o].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 Vr=function(e,r,i){switch(arguments.length){case 3:case 2:return function(e,t,r){r=r||{};var i=n(e)+"="+n(t);null==t&&(r.maxage=-1);r.maxage&&(r.expires=new Date(+new Date+r.maxage));r.path&&(i+="; path="+r.path);r.domain&&(i+="; domain="+r.domain);r.expires&&(i+="; expires="+r.expires.toUTCString());r.samesite&&(i+="; samesite="+r.samesite);r.secure&&(i+="; secure");document.cookie=i}(e,r,i);case 1:return function(e){return t()[e]}(e);default:return t()}},Vr}(),yi=g(gi),vi={exports:{}},mi={exports:{}},bi={exports:{}};function Ii(){if(ci)return ui;ci=1;var e=1e3,t=60*e,n=60*t,r=24*n,i=365.25*r;function o(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return ui=function(s,a){a=a||{};var u=h(s);if("string"===u&&s.length>0)return function(o){if((o=String(o)).length>100)return;var s=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(o);if(!s)return;var a=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*i;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}}(s);if("number"===u&&!1===isNaN(s))return a.long?function(i){return o(i,r,"day")||o(i,n,"hour")||o(i,t,"minute")||o(i,e,"second")||i+" ms"}(s):function(i){if(i>=r)return Math.round(i/r)+"d";if(i>=n)return Math.round(i/n)+"h";if(i>=t)return Math.round(i/t)+"m";if(i>=e)return Math.round(i/e)+"s";return i+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))},ui}function Ai(){return li||(li=1,function(e,t){var n;function r(e){function r(){if(r.enabled){var e=r,i=+new Date,o=i-(n||i);e.diff=o,e.prev=n,e.curr=i,n=i;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var u=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;u++;var i=t.formatters[r];if("function"==typeof i){var o=s[u];n=i.call(e,o),s.splice(u,1),u--}return n}),t.formatArgs.call(e,s),(r.log||t.log||console.log.bind(console)).apply(e,s)}}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,i=0;i<r;i++)n[i]&&("-"===(e=n[i].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=Ii(),t.names=[],t.skips=[],t.formatters={}}(bi,bi.exports)),bi.exports}function ki(){if(di)return hi;di=1;var e=(fi||(fi=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=Ai()).log=function(){return"object"===("undefined"==typeof console?"undefined":h(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 i=0,o=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(i++,"%c"===e&&(o=i))}),e.splice(o,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())}(mi,mi.exports)),mi.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={},i=e.split(/ *; */);if(""==i[0])return n;for(var o=0;o<i.length;++o)n[r((t=i[o].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 hi=function(e,r,i){switch(arguments.length){case 3:case 2:return function(e,t,r){r=r||{};var i=n(e)+"="+n(t);null==t&&(r.maxage=-1);r.maxage&&(r.expires=new Date(+new Date+r.maxage));r.path&&(i+="; path="+r.path);r.domain&&(i+="; domain="+r.domain);r.expires&&(i+="; expires="+r.expires.toUTCString());r.secure&&(i+="; secure");document.cookie=i}(e,r,i);case 1:return function(e){return t()[e]}(e);default:return t()}},hi}var Ei,Si=(pi||(pi=1,function(e,t){var n=ki();function r(e){for(var n=t.cookie,r=t.levels(e),i=0;i<r.length;++i){var o="__tld__",s=r[i],a={domain:"."+s};if(n(o,1,a),n(o))return n(o,null,a),s}return""}r.levels=function(e){var t,n,r=("function"!=typeof window.URL?(t=e,(n=document.createElement("a")).href=t,n.hostname):new URL(e).hostname).split("."),i=r[r.length-1],o=[];if(4===r.length&&i===parseInt(i,10))return o;if(r.length<=1)return o;for(var s=r.length-2;s>=0;--s)o.push(r.slice(s).join("."));return o},r.cookie=n,t=e.exports=r}(vi,vi.exports)),vi.exports),wi=g(Si),Oi=function(){return r(function e(t){n(this,e),this.cOpts={},this.options(t),this.isSupportAvailable=this.checkSupportAvailability()},[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(0===arguments.length)return this.cOpts;var t=".".concat(wi(window.location.href));return"."===t&&(t=null),this.cOpts=cr({maxage:31536e6,path:"/",domain:t,samesite:"Lax"},e),e.sameDomainCookiesOnly&&delete this.cOpts.domain,this.cOpts}},{key:"set",value:function(e,t){try{return yi(e,t,D(this.cOpts)),!0}catch(e){return Kn.error(e),!1}}},{key:"get",value:function(e){return yi(e)}},{key:"remove",value:function(e){try{return yi(e,null,D(this.cOpts)),!0}catch(e){return!1}}},{key:"checkSupportAvailability",value:function(){var e="test_rudder_cookie";return this.set(e,!0),!!this.get(e)&&(this.remove(e),!0)}}])}(),Ti=new Oi({}),_i={exports:{}};var Ci=(Ei||(Ei=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 i(e){return"[object Array]"===Object.prototype.toString.call(e)}function o(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 s=o();function a(){if(!(this instanceof a))return new a}a.prototype={set:function(n,r){if(n&&!e(n))s.setItem(n,t(r));else if(e(n))for(var i in n)this.set(i,n[i]);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 i={},o=0,a=r.length;o<a;o++){var u=n(s.getItem(r[o]));this.has(r[o])&&(i[r[o]]=u)}return i}return n(s.getItem(e))},clear:function(){return s.clear(),this},remove:function(e){var t=this.get(e);return s.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=s.length;t<n;t++){var r=s.key(t);e(r,this.get(r))}return this},search:function(e){for(var t=this.keys(),n={},r=0,i=t.length;r<i;r++)t[r].indexOf(e)>-1&&(n[t[r]]=this.get(t[r]));return n},len:function(){return s.length}};var u=null;function c(t,n){var o=arguments,s=null;if(u||(u=a()),0===o.length)return u.get();if(1===o.length){if("string"==typeof t)return u.get(t);if(e(t))return u.set(t)}if(2===o.length&&"string"==typeof t){if(!n)return u.remove(t);if(n&&"string"==typeof n)return u.set(t,n);n&&r(n)&&(s=null,s=n(t,u.get(t)),c.set(t,s))}if(2===o.length&&i(t)&&r(n))for(var l=0,f=t.length;l<f;l++)s=n(t[l],u.get(t[l])),c.set(t[l],s);return c}for(var l in a.prototype)c[l]=a.prototype[l];return c}()}(_i)),_i.exports),Ri=g(Ci),Pi=function(){return r(function e(t){n(this,e),this.sOpts={},this.enabled=this.checkSupportAvailability(),this.options(t)},[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 0===arguments.length||(this.sOpts=cr({enabled:!0},e),this.enabled=this.sOpts.enabled&&this.enabled),this.sOpts}},{key:"set",value:function(e,t){return Ri.set(e,t)}},{key:"get",value:function(e){return Ri.get(e)}},{key:"remove",value:function(e){return Ri.remove(e)}},{key:"checkSupportAvailability",value:function(){try{var e="test_rudder_ls";return this.set(e,!0),!!this.get(e)&&(this.remove(e),!0)}catch(e){return!1}}}])}(),Di=new Pi({}),xi=function(e){return(new TextDecoder).decode((t=e,n=globalThis.atob(t).split("").map(function(e){return e.charCodeAt(0)}),new Uint8Array(n)));var t,n},Li="rl_user_id",Mi="rl_trait",Ni="rl_anonymous_id",Bi="rl_group_id",Gi="rl_group_trait",Ui="rl_page_init_referrer",ji="rl_page_init_referring_domain",Fi="rl_session",Ki="rl_auth_token",zi="RudderEncrypt:",Hi="RS_ENC_v3_",Qi="Rudder",Vi={segment:"ajs_anonymous_id"};function qi(e){return e.replace(/^\s+|\s+$/gm,"")}function Xi(e){return e&&"string"==typeof e&&""!==qi(e)?e.startsWith(zi)?jr.decrypt(e.substring(zi.length),Qi).toString(Xr):e.startsWith(Hi)?xi(e.substring(Hi.length)):e:e}for(var Wi,Yi=function(){return r(function e(){n(this,e),Ti.isSupportAvailable?this.storage=Ti:(Di.enabled&&(this.storage=Di),this.storage||Kn.error("No storage is available :: initializing the SDK without storage"))},[{key:"options",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.storage.options(e)}},{key:"setItem",value:function(e,t){var n=or(t);null!==n&&this.storage.set(e,function(e){return""===qi(e)?e:"".concat(zi).concat(jr.encrypt(e,Qi).toString())}(n))}},{key:"setStringItem",value:function(e,t){"string"==typeof t?this.setItem(e,t):Kn.error("[Storage] ".concat(e," should be string"))}},{key:"setUserId",value:function(e){this.setStringItem(Li,e)}},{key:"setUserTraits",value:function(e){this.setItem(Mi,e)}},{key:"setGroupId",value:function(e){this.setStringItem(Bi,e)}},{key:"setGroupTraits",value:function(e){this.setItem(Gi,e)}},{key:"setAnonymousId",value:function(e){this.setStringItem(Ni,e)}},{key:"setInitialReferrer",value:function(e){this.setItem(Ui,e)}},{key:"setInitialReferringDomain",value:function(e){this.setItem(ji,e)}},{key:"setSessionInfo",value:function(e){this.setItem(Fi,e)}},{key:"setAuthToken",value:function(e){this.setItem(Ki,e)}},{key:"getItem",value:function(e){try{var t=this.storage.get(e),n=Xi(t);for(t=n?JSON.parse(n):null;"string"==typeof t&&(n=Xi(t))!==t;)t=JSON.parse(n);return t}catch(t){return Kn.error(function(e){return"Unable to retrieve the cookie data for ".concat(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}}},{key:"getUserId",value:function(){return this.getItem(Li)}},{key:"getUserTraits",value:function(){return this.getItem(Mi)}},{key:"getGroupId",value:function(){return this.getItem(Bi)}},{key:"getGroupTraits",value:function(){return this.getItem(Gi)}},{key:"fetchExternalAnonymousId",value:function(e){var t,n=e.toLowerCase();return Object.keys(Vi).includes(n)&&"segment"===n?(Di.enabled&&(t=Di.get(Vi[n])),!t&&Ti.isSupportAvailable&&(t=Ti.get(Vi[n])),t):t}},{key:"getAnonymousId",value:function(e){var t=this.getItem(Ni);if(t)return t;var n=ri(e,"autoCapture.source");if(!0===ri(e,"autoCapture.enabled")&&"string"==typeof n){var r=this.fetchExternalAnonymousId(n);if(r)return r}return t}},{key:"getInitialReferrer",value:function(){return this.getItem(Ui)}},{key:"getInitialReferringDomain",value:function(){return this.getItem(ji)}},{key:"getSessionInfo",value:function(){return this.getItem(Fi)}},{key:"getAuthToken",value:function(){return this.getItem(Ki)}},{key:"removeItem",value:function(e){return this.storage.remove(e)}},{key:"removeSessionInfo",value:function(){this.removeItem(Fi)}},{key:"clear",value:function(e){this.storage.remove(Li),this.storage.remove(Mi),this.storage.remove(Bi),this.storage.remove(Gi),this.storage.remove(Ki),e&&this.storage.remove(Ni)}}])}(),Ji=new Yi,$i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!document.getElementById(e)){var 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",dr),void 0!==n.isNonNativeSDK&&r.setAttribute("data-isNonNativeSDK",n.isNonNativeSDK));var i=document.getElementsByTagName("head");if(i.length>0)i[0].insertBefore(r,i[0].firstChild);else{var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(r,o)}}},Zi=256,eo=[];Zi--;)eo[Zi]=(Zi+256).toString(16).substring(1);for(var to,no=[],ro=0;ro<256;ro++)no[ro]=(ro+256).toString(16).substring(1);function io(){var e;(!to||ro+16>4096)&&(e=4096,to=crypto.getRandomValues(new Uint8Array(e)),ro=0);for(var t,n=0,r="";n<16;n++)t=to[ro+n],r+=6==n?no[15&t|64]:8==n?no[63&t|128]:no[t],1&n&&n>1&&n<11&&(r+="-");return ro+=16,r}var oo={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 so(e){return null!=e&&e.endsWith("/")?e.replace(/\/+$/,""):e}function ao(){return window.crypto&&"function"==typeof window.crypto.getRandomValues?io():function(){var e,t=0,n="";if(!Wi||Zi+16>256){for(Wi=Array(t=256);t--;)Wi[t]=256*Math.random()|0;t=Zi=0}for(;t<16;t++)e=Wi[Zi+t],n+=6==t?eo[15&e|64]:8==t?eo[63&e|128]:eo[e],1&t&&t>1&&t<11&&(n+="-");return Zi++,n}()}function uo(){return(new Date).toISOString()}function co(e,t){Object.keys(e).forEach(function(n){e.hasOwnProperty(n)&&(t[n]&&(e[t[n]]=e[n]),"All"!==n&&void 0!==t[n]&&t[n]!==n&&delete e[n])})}function lo(e){co(e,jn)}function fo(e){co(e,oo)}function ho(e,t){var n=[];if(!t||0===t.length)return n;var r=!0;void 0!==e.All&&(r=e.All);var i=[];return"string"==typeof t[0]?t.forEach(function(e){i.push({intgName:e,intObj:e})}):"object"===h(t[0])&&t.forEach(function(e){i.push({intgName:e.name,intObj:e})}),i.forEach(function(t){var i=t.intgName,o=t.intObj;if(r){var s=!0;void 0!==e[i]&&!1===Boolean(e[i])&&(s=!1),s&&n.push(o)}else void 0!==e[i]&&!0===Boolean(e[i])&&n.push(o)}),n}var po=function(e){return"string"==typeof e||null==e?e:or(e)},go=function(e){return"string"==typeof e&&e.trim().length>0},yo=function(e,t,n){try{var r=e.source.dataplanes||{};if(Object.keys(r).length>0){var i=function(e){var t=e?e.residencyServer:void 0;if(t)return"string"==typeof t&&Yn.includes(t.toUpperCase())?t.toUpperCase():void Kn.error("Invalid residencyServer input")}(n),o=r[i]||r.US;if(o){var s=function(e){if(Array.isArray(e)&&e.length>0){var t=e.find(function(e){return!0===e.default});if(t&&go(t.url))return t.url}}(o);if(s)return s}}if(go(t))return t;throw Error("Unable to load the SDK due to invalid data plane url")}catch(e){throw Error(e)}};function vo(){var e;return(null===(e=document)||void 0===e?void 0:e.referrer)||"$direct"}function mo(e){var t=e.split("/");return t.length>=3?t[2]:""}function bo(){for(var e=document.getElementsByTagName("link"),t=0;e[t];t+=1){var n=e[t];if("canonical"===n.getAttribute("rel"))return n.getAttribute("href")}}function Io(){var e=bo(),t=window.location.pathname;if(e)try{t=new URL(e).pathname}catch(e){}var n=window.location,r=n.search,i=n.href,o=document.title,s=function(e){var t,n=bo(),r=(t=n?n.includes("?")?n:n+e:window.location.href).indexOf("#");return r>-1?t.slice(0,r):t}(r),a=i,u=vo();return{path:t,referrer:u,referring_domain:mo(u),search:r,title:o,url:s,tab_url:a,initial_referrer:Ji.getInitialReferrer()||"",initial_referring_domain:Ji.getInitialReferringDomain()||""}}var Ao,ko=r(function e(){n(this,e),this.name="RudderLabs JavaScript SDK",this.namespace="com.rudderlabs.javascript",this.version="2.52.21"}),Eo=r(function e(){n(this,e),this.name="RudderLabs JavaScript SDK",this.version="2.52.21"}),So=r(function e(){n(this,e),this.name="",this.version=""}),wo=r(function e(){n(this,e),this.density=0,this.width=0,this.height=0,this.innerWidth=0,this.innerHeight=0}),Oo=r(function e(){var t,r;n(this,e),this.app=new ko,this.traits=null,this.library=new Eo,this.userAgent=function(){if("undefined"==typeof navigator)return null;var e=navigator.userAgent,t=navigator.brave;if(t&&Object.getPrototypeOf(t).isBrave){var n=e.match(/(chrome)\/([\w.]+)/i);n&&(e="".concat(e," Brave/").concat(n[2]))}return e}(),this.device=null,this.network=null,this.os=new So,this.locale="undefined"==typeof navigator?null:navigator.language||navigator.browserLanguage,this.screen=(t=new wo,"undefined"==typeof window||(t.width=window.screen.width,t.height=window.screen.height,t.density=window.devicePixelRatio,t.innerWidth=window.innerWidth,t.innerHeight=window.innerHeight),t),this.timezone=null!=(r=/([A-Z]+[+-]\d+)/.exec((new Date).toString()))&&r[1]?r[1]:"NA"}),To=function(){return r(function e(){n(this,e),this.channel="web",this.context=new Oo,this.type=null,this.messageId=ao(),this.originalTimestamp=(new Date).toISOString(),this.anonymousId=null,this.userId=null,this.event=null,this.properties={}},[{key:"getProperty",value:function(e){return this.properties[e]}},{key:"addProperty",value:function(e,t){this.properties[e]=t}}])}(),_o=function(){return r(function e(){n(this,e),this.message=new To},[{key:"setType",value:function(e){this.message.type=e}},{key:"setProperty",value:function(e){this.message.properties=e}},{key:"setUserProperty",value:function(e){this.message.user_properties=e}},{key:"setUserId",value:function(e){this.message.userId=e}},{key:"setEventName",value:function(e){this.message.event=e}},{key:"getElementContent",value:function(){return this.message}}])}(),Co=function(){return r(function e(){n(this,e),this.rudderProperty=null,this.rudderUserProperty=null,this.event=null,this.userId=null,this.type=null},[{key:"setType",value:function(e){return this.type=e,this}},{key:"build",value:function(){var e=new _o;return e.setUserId(this.userId),e.setType(this.type),e.setEventName(this.event),e.setProperty(this.rudderProperty),e.setUserProperty(this.rudderUserProperty),e}}])}(),Ro={};function Po(){if(Ao)return Ro;Ao=1;for(var e,t=256,n=[];t--;)n[t]=(t+256).toString(16).substring(1);return Ro.v4=function(){var r,i=0,o="";if(!e||t+16>256){for(e=Array(i=256);i--;)e[i]=256*Math.random()|0;i=t=0}for(;i<16;i++)r=e[t+i],o+=6==i?n[15&r|64]:8==i?n[63&r|128]:n[r],1&i&&i>1&&i<11&&(o+="-");return t++,o},Ro}var Do,xo,Lo,Mo,No,Bo,Go,Uo,jo,Fo={};function Ko(){if(xo)return Do;xo=1;var e=Object.prototype.hasOwnProperty,t=String.prototype.charAt,n=Object.prototype.toString,r=function(e,n){return t.call(e,n)},i=function(t,n){return e.call(t,n)},o=function(e,t){t=t||i;for(var n=[],r=0,o=e.length;r<o;r+=1)t(e,r)&&n.push(String(r));return n};return Do=function(e){return null==e?[]:(t=e,"[object String]"===n.call(t)?o(e,r):function(e){return null!=e&&"function"!=typeof e&&"number"==typeof e.length}(e)?o(e,i):function(e,t){t=t||i;var n=[];for(var r in e)t(e,r)&&n.push(String(r));return n}(e));var t}}function zo(){if(Lo)return Fo;Lo=1;var e=Ko(),t=Po().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 Fo.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,Fo.inMemoryEngine=n,Fo}function Ho(){if(No)return Mo;No=1;var e=Ko(),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=h(e);return"number"===n||"object"===n&&"[object Number]"===t.call(e)}(e.length))},i=function(e,t){for(var n=0;n<t.length&&!1!==e(t[n],n,t);n+=1);},o=function(t,n){for(var r=e(n),i=0;i<r.length&&!1!==t(n[r[i]],r[i],n);i+=1);};return Mo=function(e,t){return(r(t)?i:o).call(this,e,t)}}function Qo(){if(Go)return Bo;Go=1;var e=zo().defaultEngine,t=zo().inMemoryEngine,n=Ho(),r=Ko(),i=JSON;function o(e){try{return JSON.stringify(e,(t=[],function(e,n){if("object"!==h(n)||null===n)return n;for(;t.length>0&&t[t.length-1]!==this;)t.pop();return t.includes(n)?"[Circular Reference]":(t.push(n),n)}))}catch(e){return null}var t}function s(t,n,r,i){this.id=n,this.name=t,this.keys=r||{},this.engine=i||e,this.originalEngine=this.engine}return s.prototype.set=function(e,t){var n=this._createValidKey(e);if(n)try{this.engine.setItem(n,o(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))}},s.prototype.get=function(e){try{var t=this.engine.getItem(this._createValidKey(e));return null===t?null:i.parse(t)}catch(e){return null}},s.prototype.getOriginalEngine=function(){return this.originalEngine},s.prototype.remove=function(e){this.engine.removeItem(this._createValidKey(e))},s.prototype._createValidKey=function(e){var t,i=this.name,o=this.id;return r(this.keys).length?(n(function(n){n===e&&(t=[i,o,e].join("."))},this.keys),t):[i,o,e].join(".")},s.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},Bo=s}var Vo,qo,Xo,Wo,Yo={exports:{}},Jo={exports:{}};function $o(){if(qo)return Vo;qo=1;var e=1e3,t=60*e,n=60*t,r=24*n,i=365.25*r;function o(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}return Vo=function(s,a){a=a||{};var u=h(s);if("string"===u&&s.length>0)return function(o){if((o=String(o)).length>100)return;var s=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(o);if(!s)return;var a=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*i;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}}(s);if("number"===u&&!1===isNaN(s))return a.long?function(i){return o(i,r,"day")||o(i,n,"hour")||o(i,t,"minute")||o(i,e,"second")||i+" ms"}(s):function(i){if(i>=r)return Math.round(i/r)+"d";if(i>=n)return Math.round(i/n)+"h";if(i>=t)return Math.round(i/t)+"m";if(i>=e)return Math.round(i/e)+"s";return i+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))},Vo}function Zo(){return Xo||(Xo=1,function(e,t){var n;function r(e){function r(){if(r.enabled){var e=r,i=+new Date,o=i-(n||i);e.diff=o,e.prev=n,e.curr=i,n=i;for(var s=new Array(arguments.length),a=0;a<s.length;a++)s[a]=arguments[a];s[0]=t.coerce(s[0]),"string"!=typeof s[0]&&s.unshift("%O");var u=0;s[0]=s[0].replace(/%([a-zA-Z%])/g,function(n,r){if("%%"===n)return n;u++;var i=t.formatters[r];if("function"==typeof i){var o=s[u];n=i.call(e,o),s.splice(u,1),u--}return n}),t.formatArgs.call(e,s),(r.log||t.log||console.log.bind(console)).apply(e,s)}}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,i=0;i<r;i++)n[i]&&("-"===(e=n[i].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=$o(),t.names=[],t.skips=[],t.formatters={}}(Jo,Jo.exports)),Jo.exports}var es,ts,ns,rs={exports:{}};function is(){return es||(es=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 i=0;i<r.length;i++)if((n=r[i])===t||n.fn===t){r.splice(i,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 i=(n=n.slice(0)).length;r<i;++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}}(rs)),rs.exports}var os=function(){if(ns)return ts;ns=1;var e=Po().v4,t=Qo(),n=Ho(),r=function(){if(jo)return Uo;jo=1;var e=Ho(),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 i(){this.tasks={},this.nextId=1}return i.prototype.now=function(){return+new n.Date},i.prototype.run=function(e,t,i){var o=this.nextId++;return this.tasks[o]=n.setTimeout(this._handle(o,e,t,i||r.ASAP),t),o},i.prototype.cancel=function(e){this.tasks[e]&&(n.clearTimeout(this.tasks[e]),delete this.tasks[e])},i.prototype.cancelAll=function(){e(n.clearTimeout,this.tasks),this.tasks={}},i.prototype._handle=function(e,t,n,i){var o=this,s=o.now();return function(){if(delete o.tasks[e],!(i>=r.RESCHEDULE&&s+2*n<o.now()))return t();i===r.RESCHEDULE&&o.run(t,n,i)}},i.setClock=function(e){n=e},i.resetClock=function(){n=t},i.Modes=r,Uo=i}(),i=(Wo||(Wo=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=Zo()).log=function(){return"object"===("undefined"==typeof console?"undefined":h(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 i=0,o=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(i++,"%c"===e&&(o=i))}),e.splice(o,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())}(Yo,Yo.exports)),Yo.exports)("localstorage-retry");function o(e,t){return function(){return e.apply(t,arguments)}}function s(n,i,s){"function"==typeof i&&(s=i),this.name=n,this.id=e(),this.fn=s,this.maxItems=i.maxItems||1/0,this.maxAttempts=i.maxAttempts||1/0,this.backoff={MIN_RETRY_DELAY:i.minRetryDelay||1e3,MAX_RETRY_DELAY:i.maxRetryDelay||3e4,FACTOR:i.backoffFactor||2,JITTER:i.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=o(this._ack,this),this._checkReclaim=o(this._checkReclaim,this),this._processHead=o(this._processHead,this),this._running=!1}return is()(s.prototype),s.prototype.start=function(){this._running&&this.stop(),this._running=!0,this._ack(),this._checkReclaim(),this._processHead()},s.prototype.stop=function(){this._schedule.cancelAll(),this._running=!1},s.prototype.shouldRetry=function(e,t){return!(t>this.maxAttempts)},s.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))},s.prototype.addItem=function(t){this._enqueue({item:t,attemptNumber:0,time:this._schedule.now(),id:e()})},s.prototype.requeue=function(t,n,r,i){this.shouldRetry(t,n,r)?this._enqueue({item:t,attemptNumber:n,time:this._schedule.now()+this.getDelay(n),id:i||e()}):this.emit("discard",t,n)},s.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()},s.prototype._processHead=function(){var t=this,o=this._store;this._schedule.cancel(this._processId);var s=o.get(this.keys.QUEUE)||[],a=o.get(this.keys.IN_PROGRESS)||{},u=this._schedule.now(),c=[];function l(e,n){c.push({item:e.item,done:function(r,i){var s=o.get(t.keys.IN_PROGRESS)||{};delete s[n],o.set(t.keys.IN_PROGRESS,s),t.emit("processed",r,i,e.item),r&&t.requeue(e.item,e.attemptNumber+1,r,e.id)}})}for(var f=Object.keys(a).length;s.length&&s[0].time<=u&&f++<t.maxItems;){var h=s.shift(),d=e();a[d]={item:h.item,attemptNumber:h.attemptNumber,time:t._schedule.now()},l(h,d)}o.set(this.keys.QUEUE,s),o.set(this.keys.IN_PROGRESS,a),n(function(e){try{t.fn(e.item,e.done)}catch(e){i("Process function threw error: "+e)}},c),s=o.get(this.keys.QUEUE)||[],this._schedule.cancel(this._processId),s.length>0&&(this._processId=this._schedule.run(this._processHead,s[0].time-u,r.Modes.ASAP))},s.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)},s.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=[],i=e._store.getOriginalEngine(),o=0;o<i.length;o++){var s=i.key(o);if(null!==s){var a=s.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)},s.prototype._reclaim=function(r){var i=this,o=new t(this.name,r,this.keys),s={queue:this._store.get(this.keys.QUEUE)||[]},a={inProgress:o.get(this.keys.IN_PROGRESS)||{},queue:o.get(this.keys.QUEUE)||[]},u=[],c=function(t,r){n(function(t){var n=t.id||e();u.indexOf(n)>=0?i.emit("duplication",t.item,t.attemptNumber):(s.queue.push({item:t.item,attemptNumber:t.attemptNumber+r,time:i._schedule.now(),id:n}),u.push(n))},t)};c(a.queue,0),c(a.inProgress,1),s.queue=s.queue.sort(function(e,t){return e.time-t.time}),this._store.set(this.keys.QUEUE,s.queue);try{this._clearOtherQueue(o,1)}catch(e){if("NS_ERROR_STORAGE_BUSY"===e.name||"NS_ERROR_STORAGE_BUSY"===e.code||2153971713===e.code)try{this._clearOtherQueue(o,40)}catch(e){console.error(e)}else console.error(e)}this._processHead()},s.prototype._clearOtherQueue=function(e,t){var n=this;setTimeout(function(){e.remove(n.keys.IN_PROGRESS),setTimeout(function(){e.remove(n.keys.QUEUE),setTimeout(function(){e.remove(n.keys.RECLAIM_START),setTimeout(function(){e.remove(n.keys.RECLAIM_END),setTimeout(function(){e.remove(n.keys.ACK)},t)},t)},t)},t)},t)},ts=s}(),ss=g(os),as={maxRetryDelay:36e4,minRetryDelay:1e3,backoffFactor:2,maxAttempts:10,maxItems:100},us=function(){return r(function e(){n(this,e),this.url="",this.writeKey=""},[{key:"init",value:function(e,t,n){var r=this;this.url=t,this.writeKey=e,n&&s(as,n),this.payloadQueue=new ss("rudder",as,function(e,t){e.message.sentAt=uo(),r.processQueueElement(e.url,e.headers,e.message,3e4,function(e,n){if(e)return t(e);t(null,n)})}),this.payloadQueue.start()}},{key:"processQueueElement",value:function(e,t,n,r,i){try{var o=new XMLHttpRequest;for(var s in o.open("POST",e,!0),t)o.setRequestHeader(s,t[s]);o.timeout=r,o.ontimeout=i,o.onerror=i,o.onreadystatechange=function(){if(4===o.readyState)if(429===o.status||o.status>=500&&o.status<600){var t="".concat(tr,' "').concat(o.status,'" status text: "').concat(o.statusText,'" for URL: "').concat(e,'"'),n=new Error(t);gr(n),i(n)}else i(null,o.status)};var a=or(n,!0);a?o.send(a):Kn.error("Invalid payload: Event dropped")}catch(e){i(e)}}},{key:"enqueue",value:function(e,t){var n={"Content-Type":"application/json",Authorization:"Basic ".concat(btoa("".concat(this.writeKey,":"))),AnonymousId:btoa(e.anonymousId)};this.payloadQueue.addItem({url:"".concat(this.url,"/v1/").concat(t),headers:n,message:e})}}])}(),cs="queue",ls=64e3,fs=function(){return r(function e(){n(this,e),this.storage=Di,this.maxItems=10,this.flushQueueTimeOut=void 0,this.timeOutActive=!1,this.flushQueueTimeOutInterval=6e5,this.url="",this.writekey="",this.queueName="".concat(cs,".").concat(Date.now())},[{key:"sendQueueDataForBeacon",value:function(){this.sendDataFromQueueAndDestroyQueue()}},{key:"init",value:function(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()}},{key:"attachListeners",value:function(){var e=this;window.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&e.sendQueueDataForBeacon()})}},{key:"getQueue",value:function(){return this.storage.get(this.queueName)}},{key:"setQueue",value:function(e){this.storage.set(this.queueName,e)}},{key:"enqueue",value:function(e){var t=this.getQueue()||[];(t=t.slice(-(this.maxItems-1))).push(e);var n=t.slice(0),r={batch:n,sentAt:uo()},i=or(r,!0);i&&i.length>ls&&(n=t.slice(0,t.length-1),this.flushQueue(n),(t=this.getQueue()).push(e)),this.setQueue(t),this.setTimer(),t.length===this.maxItems&&this.flushQueue(n)}},{key:"sendDataFromQueueAndDestroyQueue",value:function(){this.sendDataFromQueue(),this.storage.remove(this.queueName)}},{key:"sendDataFromQueue",value:function(){var e=this.getQueue();if(e&&e.length>0){var t=e.slice(0,e.length);this.flushQueue(t)}}},{key:"flushQueue",value:function(e){if(e&&e.length>0){var t=uo();e.forEach(function(e){e.sentAt=t});var n=or({batch:e,sentAt:t},!0);if(null!==n){var r=new Blob([n],{type:"text/plain"}),i="".concat(this.url,"?writeKey=").concat(this.writekey);try{"function"!=typeof navigator.sendBeacon&&gr(new Error("Beacon API is not supported by browser")),navigator.sendBeacon(i,r)||gr(new Error("Unable to queue data to browser's beacon queue"))}catch(e){e.message="".concat(e.message," - While sending Beacon data to: ").concat(i),gr(e)}}else Kn.error("Invalid payload: Event dropped")}this.setQueue([]),this.clearTimer()}},{key:"setTimer",value:function(){this.timeOutActive||(this.flushQueueTimeOut=setTimeout(this.sendDataFromQueue.bind(this),this.flushQueueTimeOutInterval),this.timeOutActive=!0)}},{key:"clearTimer",value:function(){this.timeOutActive&&(clearTimeout(this.flushQueueTimeOut),this.timeOutActive=!1)}}])}(),hs=function(){return r(function e(){n(this,e),this.queue=void 0},[{key:"initialize",value:function(e,t,n){var r={},i=so(t);null!=n&&n.useBeacon&&navigator.sendBeacon?(n.beaconQueueOptions&&null!=n.beaconQueueOptions&&"object"===h(n.beaconQueueOptions)&&(r=n.beaconQueueOptions),i="".concat(i,"/beacon/v1/batch"),this.queue=new fs):(null!=n&&n.useBeacon&&Kn.info("[EventRepository] sendBeacon feature not available in this browser :: fallback to XHR"),null!=n&&n.queueOptions&&null!=n.queueOptions&&"object"===h(n.queueOptions)&&(r=n.queueOptions),this.queue=new us),this.queue.init(e,i,r)}},{key:"enqueue",value:function(e,t){var n=e.getElementContent();n.originalTimestamp=n.originalTimestamp||uo(),n.sentAt=uo();var r=or(n,!0);r&&r.length>32e3&&Kn.error("[EventRepository] enqueue:: message length greater 32 Kb ",n),this.queue.enqueue(n,t)}}])}(),ds=new hs,ps={maxRetryDelay:36e4,minRetryDelay:1e3,backoffFactor:2,maxAttempts:1/0},gs=function(){return r(function e(){n(this,e),this.callback=void 0,this.processQueueElements=!1},[{key:"init",value:function(e,t){var n=this;e&&s(ps,e),t&&(this.callback=t),this.payloadQueue=new ss("rs_events",ps,function(e,t){n.processQueueElement(e.type,e.rudderElement,function(e,n){if(e)return t(e);t(null,n)})}),this.payloadQueue.start()}},{key:"activateProcessor",value:function(){this.processQueueElements=!0}},{key:"processQueueElement",value:function(e,t,n){try{this.processQueueElements?(Object.setPrototypeOf(t,_o.prototype),this.callback(e,t),n(null)):n(new Error("The queue elements are not ready to be processed yet"))}catch(e){n(e)}}},{key:"enqueue",value:function(e,t){this.payloadQueue.addItem({type:e,rudderElement:t})}}])}(),ys=function(){return navigator&&navigator.language},vs=function(){return navigator&&navigator.userAgent};function ms(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=e.endsWith("..")?e.substr(0,e.length-2):e,decodeURIComponent(atob(e).split("").map(function(e){return"%".concat("00".concat(e.charCodeAt(0).toString(16)).slice(-2))}).join(""))}var bs=/^[\w.-]+$/,Is="*";function As(e,t,n,r){var i=function(e,t){return[e,(new Date).getTimezoneOffset(),t].join(Is)}(n,r),o=t||0,s=function(e){for(var t=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}(),n=-1,r=0;r<e.length;r++)n=n>>>8^t[255&(n^e.charCodeAt(r))];return(-1^n)>>>0}([i,Math.floor(Date.now()/6e4)-o,e].join(Is));return s.toString(36)}function ks(e){var t=function(e){var t=e.split(Is),n=t.length%2==0;return t.length<4||!n||1!==Number(t.shift())?null:{checksum:t.shift(),serializedIds:t.join(Is)}}(e);if(!t)return null;var n=t.checksum,r=t.serializedIds;return function(e,t){for(var n=vs(),r=ys(),i=0;i<=1;i+=1)if(As(e,i,n,r)===t)return!0;return!1}(r,n)?function(e){for(var t={},n=e.split(Is),r=0;r<n.length;r+=2){var i=n[r];if(bs.test(i)){var o=ms(n[r+1]);t[i]=o}}return t}(r):null}var Es=function(){return r(function e(){var t=this;if(n(this,e),o(this,"isInitialized",!1),window.OneTrust&&window.OnetrustActiveGroups){this.userSetConsentGroupIds=window.OnetrustActiveGroups.split(",").filter(function(e){return e});var r=window.OneTrust.GetDomainData().Groups;this.userSetConsentGroupNames=[],this.userDeniedConsentGroupIds=[],r.forEach(function(e){var n=e.CustomGroupId,r=e.GroupName;t.userSetConsentGroupIds.includes(n)?t.userSetConsentGroupNames.push(r.toUpperCase().trim()):t.userDeniedConsentGroupIds.push(n)}),this.userSetConsentGroupIds=this.userSetConsentGroupIds.map(function(e){return e.toUpperCase()}),this.isInitialized=!0}else Kn.error("OneTrust resources are not accessible.")},[{key:"isEnabled",value:function(e){var t=this;try{if(!this.isInitialized)return!0;var n=e.oneTrustCookieCategories;if(!n)return!0;var r=n.map(function(e){return e.oneTrustCookieCategory}).filter(function(e){return e});return r.every(function(e){return t.userSetConsentGroupIds.includes(e.toUpperCase().trim())||t.userSetConsentGroupNames.includes(e.toUpperCase().trim())})}catch(e){return Kn.error("Error during onetrust cookie consent management ".concat(e)),!0}}},{key:"getDeniedList",value:function(){return this.isInitialized?this.userDeniedConsentGroupIds:[]}}])}(),Ss=function(){return r(function e(){var t=this;if(n(this,e),o(this,"updatePurposes",function(e){e&&Object.entries(e).forEach(function(e){var n=e[0];e[1]?t.userConsentedPurposes.push(n):t.userDeniedPurposes.push(n)})}),this.userConsentedPurposes=[],this.userDeniedPurposes=[],window.updateKetchConsent=function(e){e&&(t.userConsentedPurposes=[],t.userDeniedPurposes=[],t.updatePurposes(e))},window.getKetchUserConsentedPurposes=function(){return t.userConsentedPurposes.slice()},window.getKetchUserDeniedPurposes=function(){return t.userDeniedPurposes.slice()},window.ketchConsent)this.updatePurposes(window.ketchConsent);else{var r=this.getConsent();this.updatePurposes(r)}},[{key:"isEnabled",value:function(e){var t=this;try{var n=e.ketchConsentPurposes;if(!n||0===n.length)return!0;var r=n.map(function(e){return e.purpose}).filter(function(e){return e});return r.some(function(e){return t.userConsentedPurposes.includes(e.trim())})}catch(e){return Kn.error("Error occured checking ketch consent state ".concat(e)),!0}}},{key:"getDeniedList",value:function(){return this.userDeniedPurposes}},{key:"getConsent",value:function(){var e=Ti.get("_ketch_consent_v1_");if(e){var t;try{t=JSON.parse(atob(e))}catch(e){return void Kn.error("Error occurred while parsing consent cookie ".concat(e))}if(t){var n={};return Object.entries(t).forEach(function(e){var t=e[0],r=e[1];null!=r&&r.status&&(n[t]="granted"===r.status)}),n}}}}])}(),ws=function(e){var t,n;return null!=e&&null!==(t=e.oneTrust)&&void 0!==t&&t.enabled?new Es:null!=e&&null!==(n=e.ketch)&&void 0!==n&&n.enabled?new Ss:null},Os=function(){return r(function e(){n(this,e),this.storage=Ji,this.timeout=18e5,this.sessionInfo=this.storage.getSessionInfo()||{autoTrack:!0}},[{key:"initialize",value:function(e){try{var t;if(this.sessionInfo.autoTrack=!(!1===(null==e||null===(t=e.sessions)||void 0===t?void 0:t.autoTrack)||this.sessionInfo.manualTrack),null!=e&&e.sessions&&!isNaN(e.sessions.timeout)){var n=e.sessions.timeout;0===n&&(Kn.warn("[Session]:: Provided timeout value 0 will disable the auto session tracking feature."),this.sessionInfo.autoTrack=!1),n>0&&n<1e4&&Kn.warn('[Session]:: It is not advised to set "timeout" less than 10 seconds'),this.timeout=n}this.sessionInfo.autoTrack?this.startAutoTracking():!1!==this.sessionInfo.autoTrack||this.sessionInfo.manualTrack||this.end()}catch(e){gr(e)}}},{key:"isValidSession",value:function(e){return e<=this.sessionInfo.expiresAt}},{key:"generateSessionId",value:function(){return Date.now()}},{key:"startAutoTracking",value:function(){var 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)}},{key:"validateSessionId",value:function(e){if("number"==typeof e&&e%1==0){var t;if(!(((t=e)?t.toString().length:0)<10))return e;Kn.error('[Session]:: "sessionId" should at least be "'.concat(10,'" digits long'))}else Kn.error('[Session]:: "sessionId" should only be a positive integer')}},{key:"start",value:function(e){var t=e?this.validateSessionId(e):this.generateSessionId();this.sessionInfo={id:t||this.generateSessionId(),sessionStart:!0,manualTrack:!0},this.storage.setSessionInfo(this.sessionInfo)}},{key:"getSessionId",value:function(){return this.sessionInfo.autoTrack&&this.isValidSession(Date.now())||this.sessionInfo.manualTrack?this.sessionInfo.id:null}},{key:"end",value:function(){this.sessionInfo={},this.storage.removeSessionInfo()}},{key:"getSessionInfo",value:function(){var e={};if(this.sessionInfo.autoTrack||this.sessionInfo.manualTrack){if(this.sessionInfo.autoTrack){var t=Date.now();this.isValidSession(t)?this.sessionInfo.expiresAt=t+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}},{key:"reset",value:function(){var e=this.sessionInfo,t=e.manualTrack;e.autoTrack?(this.sessionInfo={},this.startAutoTracking()):t&&this.start()}}])}(),Ts=new Os,_s=["integrations","anonymousId","originalTimestamp"],Cs=function(e,t,n){var r="";if(n){if(!(r=so(n))){var i="CDN base URL for integrations is not valid";throw gr({message:"[Analytics] load:: ".concat(i)}),Error("Failed to load Rudder SDK: ".concat(i))}return r}var o=function(){for(var e,t=document.getElementsByTagName("script"),n=0;n<t.length;n+=1){var r=so(t[n].getAttribute("src"));if(r&&r.match(/^.*rudder-analytics?(\.min)?\.js$/)){e=r;break}}return{sdkURL:e}}(),s=o.sdkURL;return r=s?s.split("/").slice(0,-1).concat(Vn).join("/"):qn,t&&(r=r.replace(Qn,e)),r},Rs="rs-bugsnag",Ps="bugsnag",Ds=["Bugsnag",Ps],xs="0d96a60df267f4a13f808bbaa54e535c",Ls=["rudder-analytics.min.js","rudder-analytics.js"].concat(l(Object.keys(N).map(function(e){return"".concat(N[e],".min.js")})),l(Object.keys(N).map(function(e){return"".concat(N[e],".js")}))),Ms=function(e){var t,n=null==e||null===(t=e._client)||void 0===t||null===(t=t._notifier)||void 0===t?void 0:t.version;if(!n){var r,i=e({apiKey:xs,releaseStage:"version-test",beforeSend:function(){return!1}});n=null===(r=i.notifier)||void 0===r?void 0:r.version,i=void 0}return n&&"6"===n.charAt(0)},Ns=function(e){Ds.every(function(e){return!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)})&&$i(e,"https://d2wy8f7a9ursnm.cloudfront.net/v6/bugsnag.min.js",{isNonNativeSDK:"true",skipDatasetAttributes:!0})},Bs=function(){return r(function e(t,r,i){n(this,e),this.pluginName=Rs,this.sourceId=t,this.writeKey=r,this.onClientReady=i,this.initClientOnLibReadyInterval=void 0,this.init()},[{key:"init",value:function(){var e,t=this;if(null===(e=window.RudderStackGlobals)||void 0===e||!e[rr]){if(!xs.match(/{{.+}}/)){Ns(this.pluginName);var n=window[Ps];"function"!=typeof n?(this.initClientOnLibReadyInterval=setInterval(function(){var e=window[Ps];"function"==typeof e&&(Ms(e)&&t.initClient(),clearInterval(t.initClientOnLibReadyInterval))},100),setTimeout(function(){clearInterval(t.initClientOnLibReadyInterval)},fr)):Ms(n)&&this.initClient()}}}},{key:"initClient",value:function(){var e,t=window[Ps];this.client=t({apiKey:xs,appVersion:"2.52.21",metaData:{SDK:{name:"JS",installType:"npm"}},beforeSend:this.onError(),autoTrackSessions:!1,collectUserIp:!1,enabledBreadcrumbTypes:["error","log","user"],maxEvents:100,releaseStage:(e=window.location.hostname,e&&["www.test-host.com","localhost","127.0.0.1","[::1]"].includes(e)?"development":"production"),networkBreadcrumbsEnabled:!1,user:{id:this.writeKey}}),this.onClientReady()}},{key:"onError",value:function(){var e=this.sourceId;return function(t){try{return!!function(e){var t=ri(e,"stacktrace.0.file");if(!t||"string"!=typeof t)return!1;var n=t.substring(t.lastIndexOf("/")+1);return Ls.includes(n)}(t)&&(function(e,t){e.updateMetaData("source",{metadataSource:t});var n=e.errorMessage;e.context=n,n.includes("error in script loading")&&(e.context="Script load failures"),e.severity="error"}(t,e),!0)}catch(e){return!1}}}},{key:"notify",value:function(e){this.client&&this.client.notify(e)}},{key:"leaveBreadcrumb",value:function(e){this.client&&this.client.leaveBreadcrumb(e)}}])}(),Gs=Rs,Us=[Rs],js=function(){return r(function e(t){n(this,e),this.isEnabled=!1,this.providerName=Gs,this.provider=void 0,this.logger=t,this.onClientReady=this.onClientReady.bind(this),this.exposeToGlobal=this.exposeToGlobal.bind(this)},[{key:"init",value:function(e,t,n){e&&t?!0===function(e){return ri(e,"statsCollection.errors.enabled")||!1}(e)?(this.enable(),this.setProviderName(function(e){return ri(e,"statsCollection.errors.provider")}(e)),this.initProvider(e,t,n)):this.disable():this.logger.error("[Analytics] ErrorReporting :: Invalid configuration or missing source id provided.")}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1}},{key:"setProviderName",value:function(e){e?!e||Us.includes(e)?this.providerName=e:this.logger.error("[Analytics] ErrorReporting :: Invalid error reporting provider value. Value should be one of: ".concat(Us.join(","))):this.providerName=Gs}},{key:"initProvider",value:function(e,t,n){if(this.providerName===Rs)this.provider=new Bs(t,n,this.onClientReady)}},{key:"onClientReady",value:function(){this.exposeToGlobal()}},{key:"exposeToGlobal",value:function(){window.RudderStackGlobals||(window.RudderStackGlobals={}),window.RudderStackGlobals[rr]=this}},{key:"leaveBreadcrumb",value:function(e){if(this.provider)try{this.provider.leaveBreadcrumb(e)}catch(e){this.logger.error("[Analytics] ErrorReporting :: leaveBreadcrumb method ".concat(e.toString()))}}},{key:"notify",value:function(e){if(this.provider)try{this.provider.notify(e)}catch(e){this.logger.error("[Analytics] ErrorReporting :: notify method ".concat(e.toString()))}}}])}(),Fs=new(function(){return r(function e(){n(this,e),this.retryAttempt=3,this.queue=[],this.isTransformationProcessing=!1,this.authToken=null},[{key:"init",value:function(e,t,n){this.dataPlaneUrl=so(t),this.writeKey=e,this.authToken=n||this.authToken,this.start()}},{key:"enqueue",value:function(e,t,n){this.queue.push({event:e,destinationIds:t,cb:n})}},{key:"sendEventForTransformation",value:function(e,t){var n=this;return new Promise(function(r,i){var o="".concat(n.dataPlaneUrl,"/transform"),s={"Content-Type":"application/json",Authorization:"Basic ".concat(btoa("".concat(n.writeKey,":")))};try{var a=new XMLHttpRequest;a.open("POST",o,!0),Object.keys(s).forEach(function(e){return a.setRequestHeader(e,s[e])}),a.timeout=1e4,a.onreadystatechange=function(){if(4===a.readyState)try{var o=a.status,s=a.response;switch(o){case 200:return s=JSON.parse(s),void r({status:o,transformedPayload:s.transformedBatch});case 400:var u=s?"".concat(s):"Invalid request payload";return void r({status:o,errorMessage:u});case 404:return void r({status:o});default:if(t>0){var c=t-1;setTimeout(function(){return n.sendEventForTransformation(e,c).then(r).catch(i)},500*Math.pow(2,n.retryAttempt-c))}else r({status:o,errorMessage:"Retries exhausted"})}}catch(e){i(e)}};var u=or(e,!0);u?a.send(u):Kn.error("Invalid payload: Event dropped")}catch(e){i(e)}})}},{key:"checkQueueLengthAndProcess",value:function(){this.queue.length>0&&this.process()}},{key:"process",value:function(){var e=this;this.isTransformationProcessing=!0;var t,n,r=this.queue.shift(),i=(t=r.event,n=r.destinationIds,{metadata:{"Custom-Authorization":this.authToken},batch:[{orderNo:Date.now(),destinationIds:n,event:t.message}]});this.sendEventForTransformation(i,this.retryAttempt).then(function(t){e.isTransformationProcessing=!1,r.cb(t),e.checkQueueLengthAndProcess()}).catch(function(t){gr("string"==typeof t?t:t.message),e.isTransformationProcessing=!1,r.cb({status:0}),e.checkQueueLengthAndProcess()})}},{key:"start",value:function(){var e=this;setInterval(function(){e.isTransformationProcessing||e.checkQueueLengthAndProcess()},100)}},{key:"setAuthToken",value:function(e){this.authToken=e}}])}()),Ks=function(){return r(function e(){n(this,e),this.initialized=!1,this.clientIntegrations=[],this.loadOnlyIntegrations={},this.clientIntegrationObjects=void 0,this.successfullyLoadedIntegration=[],this.failedToBeLoadedIntegration=[],this.toBeProcessedArray=[],this.toBeProcessedByIntegrationArray=[],this.storage=Ji,this.eventRepository=ds,this.preProcessQueue=new gs,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=qn,this.cookieConsentOptions={},this.logLevel=void 0,this.clientIntegrationsReady=!1,this.uSession=Ts,this.version="2.52.21",this.lockIntegrationsVersion=!1,this.errorReporting=new js(Kn),this.deniedConsentIds=[],this.transformationHandler=Fs},[{key:"initializeUser",value:function(e){this.userId=this.storage.getUserId()||"",this.storage.setUserId(this.userId),this.userTraits={};var t=this.storage.getUserTraits();null===t||"object"!==h(t)||Array.isArray(t)||(this.userTraits=t),this.storage.setUserTraits(this.userTraits),this.groupId=this.storage.getGroupId()||"",this.storage.setGroupId(this.groupId),this.groupTraits={};var n=this.storage.getGroupTraits();null===n||"object"!==h(n)||Array.isArray(n)||(this.groupTraits=n),this.storage.setGroupTraits(this.groupTraits),this.anonymousId=this.getAnonymousId(e),this.storage.setAnonymousId(this.anonymousId)}},{key:"setInitialPageProperties",value:function(){if(null==this.storage.getInitialReferrer()&&null==this.storage.getInitialReferringDomain()){var e=vo();this.storage.setInitialReferrer(e),this.storage.setInitialReferringDomain(mo(e))}}},{key:"allModulesInitialized",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Promise(function(n){e.clientIntegrations.every(function(t){return null!=e.dynamicallyLoadedIntegrations["".concat(N[t.name]).concat("_RS")]})||t>=2e4?n(e):e.pause(hr).then(function(){return e.allModulesInitialized(t+hr).then(n)})})}},{key:"executeReadyCallback",value:function(){this.readyCallbacks.forEach(function(e){return e()})}},{key:"integrationSDKLoaded",value:function(e,t){var n;return(null===(n=window[e])||void 0===n||null===(n=n[t])||void 0===n?void 0:n.prototype)&&void 0!==window[e][t].prototype.constructor}},{key:"processResponse",value:function(e,t){var n,r=this;try{var i=t;try{if("string"==typeof t&&(i=JSON.parse(t)),!i||"object"!==h(i)||Array.isArray(i))return void Kn.error("Invalid source configuration")}catch(e){return void gr(e)}try{null!==(n=window.chrome)&&void 0!==n&&null!==(n=n.runtime)&&void 0!==n&&n.id||this.errorReporting.init(i.source.config,i.source.id,this.writeKey)}catch(e){gr(e)}if(this.serverUrl=yo(i,this.serverUrl,this.options),this.eventRepository.initialize(this.writeKey,this.serverUrl,this.options),this.transformationHandler.init(this.writeKey,this.serverUrl,this.storage.getAuthToken()),i.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=ho(this.loadOnlyIntegrations,this.clientIntegrations),Object.keys(this.cookieConsentOptions).length>0)try{var o=ws(this.cookieConsentOptions);this.deniedConsentIds=null==o?void 0:o.getDeniedList(),this.clientIntegrations=this.clientIntegrations.filter(function(e){return!o||o&&o.isEnabled(e.config)})}catch(e){gr(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;){var t=l(e.toBeProcessedArray[0]);e.toBeProcessedArray.shift();var n=t[0];t.shift(),e[n].apply(e,l(t))}}(this),this.clientIntegrations=this.clientIntegrations.filter(function(e){return!!N[e.name]||(Kn.error("[Analytics] Integration:: ".concat(e.name," not available for initialization")),!1)}),this.bufferDataPlaneEventsUntilReady&&setTimeout(function(){r.processBufferedCloudModeEvents()},this.dataPlaneEventsBufferTimeout),this.errorReporting.leaveBreadcrumb("Starting device-mode initialization"),this.clientIntegrations.forEach(function(e){var t=N[e.name],n="".concat(t).concat("_RS"),i="".concat(r.destSDKBaseURL,"/").concat(t,".min.js");window.hasOwnProperty(n)||$i(n,i,{isNonNativeSDK:!0});var o=r,s=setInterval(function(){if(o.integrationSDKLoaded(n,t)){var i,a=window[n];clearInterval(s);try{var u="[Analytics] processResponse :: trying to initialize integration name:: ".concat(n);r.errorReporting.leaveBreadcrumb(u),(i=new a[t](e.config,o,e.destinationInfo)).init(),o.isInitialized(i).then(function(){o.dynamicallyLoadedIntegrations[n]=a[t]})}catch(e){var c="[Analytics] 'integration.init()' failed :: ".concat(n," :: ").concat(e.message);gr(e,c),o.failedToBeLoadedIntegration.push(i)}}},100);setTimeout(function(){clearInterval(s)},fr)});var s=this;this.allModulesInitialized().then(function(){if(!s.clientIntegrations||0===s.clientIntegrations.length)return r.clientIntegrationsReady=!0,r.executeReadyCallback(),void(r.toBeProcessedByIntegrationArray=[]);s.replayEvents(s)})}catch(e){gr(e)}}},{key:"sendDataToDestination",value:function(e,t,n){try{if(e[n]){var r=D(t);e[n](r)}}catch(t){var i="[sendToNative]:: [Destination: ".concat(e.name,"]:: ");gr(t,i)}}},{key:"sendTransformedDataToDestination",value:function(e,t,n){var r=this;try{fo(t.message.integrations);var i=e.map(function(e){return e.destinationId});this.transformationHandler.enqueue(t,i,function(i){var o=i.status,s=i.transformedPayload,a=i.errorMessage;e.forEach(function(e){try{switch(o){case 200:var i=s.find(function(t){return t.id===e.destinationId}),u=[];null==i||i.payload.forEach(function(n){if("200"===n.status)u.push(n);else{var r='[DMT]:: Event transformation unsuccessful for destination "'.concat(e.name,'". Reason: '),i="Unknown";"410"===n.status&&(i="Transformation is not available");var o="Dropping the event",s=Kn.error;!0===e.propagateEventsUntransformedOnError&&(o="Sending untransformed event to the destination",s=Kn.warn,u.push({event:t.message})),s("".concat(r," ").concat(i,". ").concat(o,"."))}}),null==u||u.forEach(function(t){lr(t.event)&&r.sendDataToDestination(e,{message:t.event},n)});break;case 404:Kn.warn("[DMT]:: Transformation server access is denied. The configuration data seems to be out of sync. Sending untransformed event to the destination."),r.sendDataToDestination(e,t,n);break;default:!0===e.propagateEventsUntransformedOnError?(Kn.warn("[DMT]::[Destination: ".concat(e.name,"] :: Transformation request failed with status: ").concat(o," ").concat(a,". Sending untransformed event.")),r.sendDataToDestination(e,t,n)):Kn.error("[DMT]::[Destination: ".concat(e.name,"] :: Transformation request failed with status: ").concat(o," ").concat(a,". Dropping the event."))}}catch(t){t instanceof Error&&(t.message="[DMT]::[Destination:".concat(e.name,"]:: ").concat(t.message)),gr(t)}})})}catch(e){e instanceof Error&&(e.message="[DMT]:: ".concat(e.message)),gr(e)}}},{key:"processAndSendEventsToDeviceMode",value:function(e,t,n){var r=this,i=[],o=[];e.forEach(function(e){try{!r.IsEventBlackListed(t.message.event,e.name)&&(e.shouldApplyDeviceModeTransformation?o.push(e):i.push(e))}catch(e){gr(e)}}),i.forEach(function(e){r.sendDataToDestination(e,t,n)}),o.length>0&&this.sendTransformedDataToDestination(o,t,n)}},{key:"queueEventForDataPlane",value:function(e,t){var n=t.message.integrations||{All:!0};t.message.integrations=function(e,t){var n=D(e),r=Object.keys(t).filter(function(e){return!(!0===t[e]&&n[e])}).reduce(function(e,n){return e[n]=t[n],e},{});return cr(n,r)}(this.integrationsData,n),this.eventRepository.enqueue(t,e)}},{key:"processBufferedCloudModeEvents",value:function(){this.bufferDataPlaneEventsUntilReady&&this.preProcessQueue.activateProcessor()}},{key:"replayEvents",value:function(e){var t,n,r,i=this;this.errorReporting.leaveBreadcrumb("Started replaying buffered events"),e.clientIntegrationObjects=[],e.clientIntegrationObjects=e.successfullyLoadedIntegration;try{e.clientIntegrationObjects.every(function(e){return!e.isReady||e.isReady()})&&(this.integrationsData=(t=this.integrationsData,n=e.clientIntegrationObjects,r=D(t),n.forEach(function(e){if(e.getDataForIntegrationsObject)try{r=cr(r,e.getDataForIntegrationsObject())}catch(e){Kn.debug("[Analytics: prepareDataForIntegrationsObj]",e)}}),r),e.clientIntegrationsReady=!0,e.executeReadyCallback())}catch(e){gr(e,"Replay buffered cloud mode events")}this.processBufferedCloudModeEvents(),e.toBeProcessedByIntegrationArray.forEach(function(t){var n=t[0];t.shift(),Object.keys(t[0].message.integrations).length>0&&lo(t[0].message.integrations);var r=ho(t[0].message.integrations,e.clientIntegrationObjects);i.processAndSendEventsToDeviceMode(r,t[0],n)}),e.toBeProcessedByIntegrationArray=[]}},{key:"pause",value:function(e){return new Promise(function(t){setTimeout(t,e)})}},{key:"isInitialized",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return new Promise(function(r){e.isLoaded()?(t.successfullyLoadedIntegration.push(e),r(t)):n>=fr?(t.failedToBeLoadedIntegration.push(e),r(t)):t.pause(hr).then(function(){return t.isInitialized(e,n+hr).then(r)})})}},{key:"page",value:function(e,t,n,r,i){if(this.errorReporting.leaveBreadcrumb("Page event"),this.loaded){"function"==typeof r&&(i=r,r=null),"function"==typeof n&&(i=n,r=n=null),"function"==typeof t&&(i=t,r=n=t=null),"function"==typeof e&&(i=e,r=n=t=e=null),"object"===h(e)&&null!=e&&null!=e&&(r=t,n=e,t=e=null),"object"===h(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();var o=D(n),s=D(r),a=(new Co).setType("page").build();o||(o={}),t&&(a.message.name=o.name=t),e&&(a.message.category=o.category=e),a.message.properties=this.getPageProperties(o),this.processAndSendDataToDestinations("page",a,s,i)}else this.toBeProcessedArray.push(["page"].concat(Array.prototype.slice.call(arguments)))}},{key:"track",value:function(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Track event"),this.loaded){"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null);var i=D(t),o=D(n),s=(new Co).setType("track").build();e&&s.setEventName(e),s.setProperty(i||{}),this.processAndSendDataToDestinations("track",s,o,r)}else this.toBeProcessedArray.push(["track"].concat(Array.prototype.slice.call(arguments)))}},{key:"identify",value:function(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Identify event"),this.loaded){"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),"object"===h(e)&&(n=t,t=e,e=this.userId);var i=po(e);i&&this.userId&&i!==this.userId&&this.reset(),this.userId=i,this.storage.setUserId(this.userId);var o=D(t),s=D(n);if(o){for(var a in o)this.userTraits[a]=o[a];this.storage.setUserTraits(this.userTraits)}var u=(new Co).setType("identify").build();this.processAndSendDataToDestinations("identify",u,s,r)}else this.toBeProcessedArray.push(["identify"].concat(Array.prototype.slice.call(arguments)))}},{key:"alias",value:function(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Alias event"),this.loaded){"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"===h(t)&&(n=t,t=null),"object"===h(e)&&(n=e,t=null,e=null);var i=(new Co).setType("alias").build();i.message.previousId=po(t)||(this.userId?this.userId:this.getAnonymousId()),i.message.userId=po(e);var o=D(n);this.processAndSendDataToDestinations("alias",i,o,r)}else this.toBeProcessedArray.push(["alias"].concat(Array.prototype.slice.call(arguments)))}},{key:"group",value:function(e,t,n,r){if(this.errorReporting.leaveBreadcrumb("Group event"),this.loaded){if(0!==arguments.length){"function"==typeof n&&(r=n,n=null),"function"==typeof t&&(r=t,n=null,t=null),"object"===h(e)&&(n=t,t=e,e=this.groupId),"function"==typeof e&&(r=e,n=null,t=null,e=this.groupId),this.groupId=po(e),this.storage.setGroupId(this.groupId);var i=D(t),o=D(n),s=(new Co).setType("group").build();if(i)for(var a in i)this.groupTraits[a]=i[a];else this.groupTraits={};this.storage.setGroupTraits(this.groupTraits),this.processAndSendDataToDestinations("group",s,o,r)}}else this.toBeProcessedArray.push(["group"].concat(Array.prototype.slice.call(arguments)))}},{key:"IsEventBlackListed",value:function(e,t){if(!e||"string"!=typeof e)return!1;var n=jn[t],r=this.clientIntegrations.find(function(e){return e.name===n}).config,i=r.blacklistedEvents,o=r.whitelistedEvents,s=r.eventFilteringOption;if(!s)return!1;var a=e.trim().toUpperCase();switch(s){case"disable":default:return!1;case"blacklistedEvents":return!!Array.isArray(i)&&i.some(function(e){return e.eventName.trim().toUpperCase()===a});case"whitelistedEvents":return!Array.isArray(o)||!o.some(function(e){return e.eventName.trim().toUpperCase()===a})}}},{key:"shouldUseGlobalIntegrationsConfigInEvents",value:function(){return this.useGlobalIntegrationsConfigInEvents&&this.loadOnlyIntegrations&&Object.keys(this.loadOnlyIntegrations).length>0}},{key:"processAndSendDataToDestinations",value:function(e,t,n,r){try{this.anonymousId||this.setAnonymousId(),this.errorReporting.leaveBreadcrumb("Started sending data to destinations"),t.message.context.traits=u({},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=u({},this.groupTraits)));try{var i=this.uSession.getSessionInfo(),o=i.sessionId,s=i.sessionStart;t.message.context.sessionId=o,s&&(t.message.context.sessionStart=!0)}catch(e){gr(e)}f=this.cookieConsentOptions,h=!1,Object.keys(f).forEach(function(e){Jn.includes(e)&&"boolean"==typeof f[e].enabled&&!0===f[e].enabled&&(h=!0)}),h&&(t.message.context.consentManagement={deniedConsentIds:this.deniedConsentIds||[]}),this.processOptionsParam(t,n),function(e,t){var n=e.properties,r=e.traits,i=e.context;n&&Object.keys(n).forEach(function(e){zn.indexOf(e.toLowerCase())>=0&&Kn.error("Warning! : Reserved keyword used in properties--\x3e ".concat(e," with ").concat(t," call"))}),r&&Object.keys(r).forEach(function(e){zn.indexOf(e.toLowerCase())>=0&&Kn.error("Warning! : Reserved keyword used in traits--\x3e ".concat(e," with ").concat(t," call"))});var o=i.traits;o&&Object.keys(o).forEach(function(e){zn.indexOf(e.toLowerCase())>=0&&Kn.error("Warning! : Reserved keyword used in traits --\x3e ".concat(e," with ").concat(t," call"))})}(t.message,e);var a=t.message.integrations;a?lo(a):a=this.shouldUseGlobalIntegrationsConfigInEvents()?this.loadOnlyIntegrations:er,t.message.integrations=a;try{t.message.context["ua-ch"]=this.uach}catch(e){gr(e)}try{if(this.clientIntegrationObjects){var c=ho(a,this.clientIntegrationObjects);this.processAndSendEventsToDeviceMode(c,t,e)}else this.toBeProcessedByIntegrationArray.push([e,t])}catch(e){gr(e,"processAndSendEventsToDeviceMode::")}var l=D(t);fo(l.message.integrations),!this.bufferDataPlaneEventsUntilReady||this.clientIntegrationObjects?this.queueEventForDataPlane(e,l):this.preProcessQueue.enqueue(e,l),r&&"function"==typeof r&&r(l)}catch(e){gr(e)}var f,h}},{key:"utm",value:function(e){var t={};try{var n=new URL(e),r="utm_";n.searchParams.forEach(function(e,n){if(n.startsWith(r)){var i=n.substring(4);"campaign"===i&&(i="name"),t[i]=e}})}catch(e){}return t}},{key:"addCampaignInfo",value:function(e){var t=e.message.context;t&&"object"===h(t)&&(e.message.context.campaign=this.utm(window.location.href))}},{key:"processOptionsParam",value:function(e,t){var n=e.message,r=n.type,i=n.properties;this.addCampaignInfo(e),e.message.context.page=this.getContextPageProperties("page"===r?i:void 0),function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"object"===h(t)&&null!==t&&Object.keys(t).forEach(function(n){_s.includes(n)&&(e[n]=t[n])})}(e.message,t),e.message.context=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.context;return"object"!==h(t)||null===t||Object.keys(t).forEach(function(e){if(!_s.includes(e)&&!$n.includes(e))if("context"!==e)n=cr(n,o({},e,t[e]));else if("object"===h(t[e])&&null!==t[e]){var r={};Object.keys(t[e]).forEach(function(n){$n.includes(n)||(r[n]=t[e][n])}),n=cr(n,u({},r))}else Kn.error("[Analytics: processOptionsParam] context passed in options ".concat(e," is not object."))}),n}(e.message,t)}},{key:"getPageProperties",value:function(e,t){var n=Io(),r=(null==t?void 0:t.page)||{};for(var i in n)void 0===e[i]&&(e[i]=r[i]||n[i]);return e}},{key:"getContextPageProperties",value:function(e){var t=Io(),n={};for(var r in t)n[r]=null!=e&&e[r]?e[r]:t[r];return n}},{key:"reset",value:function(e){this.errorReporting.leaveBreadcrumb("reset API :: flag: ".concat(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])}},{key:"getAnonymousId",value:function(e){return this.anonymousId=this.storage.getAnonymousId(e),this.anonymousId||this.setAnonymousId(),this.anonymousId}},{key:"getUserId",value:function(){return this.userId}},{key:"getSessionId",value:function(){return this.uSession.getSessionId()}},{key:"getUserTraits",value:function(){return this.userTraits}},{key:"getGroupId",value:function(){return this.groupId}},{key:"getGroupTraits",value:function(){return this.groupTraits}},{key:"setAnonymousId",value:function(e,t){var n=t?ks(t):null,r=n?n.rs_amp_id:null;this.anonymousId=e||r||ao(),this.storage.setAnonymousId(this.anonymousId)}},{key:"isValidWriteKey",value:function(e){return e&&"string"==typeof e&&e.trim().length>0}},{key:"isValidServerUrl",value:function(e){return e&&"string"==typeof e&&e.trim().length>0}},{key:"isDatasetAvailable",value:function(){var e=document.createElement("div");return e.setAttribute("data-a-b","c"),!!e.dataset&&"c"===e.dataset.aB}},{key:"loadAfterPolyfill",value:function(e,t,n){var r,i,o,a,c,l,f,d,p,g,y,v=this;if("object"===h(t)&&null!==t&&(n=t,t=null),null!==(r=n)&&void 0!==r&&r.logLevel&&(this.logLevel=n.logLevel,Kn.setLogLevel(n.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");null!==(i=n)&&void 0!==i&&i.cookieConsentManager&&(this.cookieConsentOptions=n.cookieConsentManager),this.writeKey=e,this.serverUrl=t,this.options=n;var m={};if(null!==(o=n)&&void 0!==o&&o.setCookieDomain&&(m=u(u({},m),{},{domain:n.setCookieDomain})),n&&"boolean"==typeof n.secureCookie&&(m=u(u({},m),{},{secure:n.secureCookie})),n&&"boolean"==typeof n.sameDomainCookiesOnly&&(m=u(u({},m),{},{sameDomainCookiesOnly:n.sameDomainCookiesOnly})),n&&-1!==Wn.indexOf(n.sameSiteCookie)&&(m=u(u({},m),{},{samesite:n.sameSiteCookie})),this.storage.options(m),n&&"string"==typeof n.uaChTrackLevel&&Zn.includes(n.uaChTrackLevel)&&(this.uaChTrackLevel=n.uaChTrackLevel),navigator.userAgentData&&function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"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(function(t){e(t)})}(function(e){v.uach=e},this.uaChTrackLevel),null!==(a=n)&&void 0!==a&&a.integrations&&(s(this.loadOnlyIntegrations,n.integrations),lo(this.loadOnlyIntegrations)),this.useGlobalIntegrationsConfigInEvents=n&&!0===n.useGlobalIntegrationsConfigInEvents,null!==(c=n)&&void 0!==c&&c.sendAdblockPage&&(this.sendAdblockPage=!0),null!==(l=n)&&void 0!==l&&l.sendAdblockPageOptions&&"object"===h(n.sendAdblockPageOptions)&&(this.sendAdblockPageOptions=n.sendAdblockPageOptions),this.uSession.initialize(n),null!==(f=n)&&void 0!==f&&f.clientSuppliedCallbacks){var b={};Object.keys(this.methodToCallbackMapping).forEach(function(e){v.methodToCallbackMapping.hasOwnProperty(e)&&n.clientSuppliedCallbacks[v.methodToCallbackMapping[e]]&&(b[e]=n.clientSuppliedCallbacks[v.methodToCallbackMapping[e]])}),s(this.clientSuppliedCallbacks,b),this.registerCallbacks(!0)}if(null!=(null===(d=n)||void 0===d?void 0:d.loadIntegration)&&(this.loadIntegration=!!n.loadIntegration),n&&"boolean"==typeof n.bufferDataPlaneEventsUntilReady&&(this.bufferDataPlaneEventsUntilReady=!0===n.bufferDataPlaneEventsUntilReady,this.bufferDataPlaneEventsUntilReady&&this.preProcessQueue.init(this.options,this.queueEventForDataPlane.bind(this))),n&&"number"==typeof n.dataPlaneEventsBufferTimeout&&(this.dataPlaneEventsBufferTimeout=n.dataPlaneEventsBufferTimeout),n&&void 0!==n.lockIntegrationsVersion&&(this.lockIntegrationsVersion=!0===n.lockIntegrationsVersion),this.initializeUser(n?n.anonymousIdOptions:void 0),this.setInitialPageProperties(),this.destSDKBaseURL=Cs(this.version,this.lockIntegrationsVersion,null===(p=n)||void 0===p?void 0:p.destSDKBaseURL),null!==(g=n)&&void 0!==g&&g.getSourceConfig)if("function"!=typeof n.getSourceConfig)gr(new Error('option "getSourceConfig" must be a function'));else{var I=n.getSourceConfig();I instanceof Promise?I.then(function(e){return v.processResponse(200,e)}).catch(gr):this.processResponse(200,I)}else{var A=function(e,t){var n=Hn,r=[];return e&&r.push("writeKey=".concat(e)),t&&r.push("lockIntegrationsVersion=".concat(t)),r.length>0&&(n=(n=Hn.concat(Hn.includes("?")?"&":"?")).concat(r.join("&"))),n}(e,this.lockIntegrationsVersion);null!==(y=n)&&void 0!==y&&y.configUrl&&(A=function(e,t){var n=e;-1===n.indexOf("sourceConfig")&&(n="".concat(so(n),"/sourceConfig/")),n="/"===n.slice(-1)?n:"".concat(n,"/");var r=t.split("?")[1],i=n.split("?");return i.length>1&&i[1]!==r?"".concat(i[0],"?").concat(r):"".concat(n,"?").concat(r)}(n.configUrl,A));try{!function(e,t,n,r){var i=r.bind(e),o=new XMLHttpRequest;o.open("GET",t,!0),o.setRequestHeader("Authorization","Basic ".concat(btoa("".concat(n,":")))),o.onload=function(){var e=o.status,n=o.responseText;200===e?i(200,n):(gr(new Error("".concat(tr," ").concat(e," for url: ").concat(t))),i(e))},o.send()}(this,A,e,this.processResponse)}catch(e){gr(e)}}}},{key:"arePolyfillsRequired",value:function(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)}},{key:"load",value:function(e,t,n){if(!this.loaded){var r=D(n);if(this.arePolyfillsRequired(r)&&Xn){var i="polyfill";$i(i,Xn,{skipDatasetAttributes:!0});var o=this,s=setInterval(function(){!window.hasOwnProperty(i)&&null===document.getElementById(i)||"undefined"==typeof Promise||(clearInterval(s),o.loadAfterPolyfill(e,t,r))},100);setTimeout(function(){clearInterval(s)},fr)}else this.loadAfterPolyfill(e,t,r)}}},{key:"ready",value:function(e){this.loaded?"function"!=typeof e?Kn.error("ready callback is not a function"):this.clientIntegrationsReady?e():this.readyCallbacks.push(e):this.toBeProcessedArray.push(["ready",e])}},{key:"initializeCallbacks",value:function(){var e=this;Object.keys(this.methodToCallbackMapping).forEach(function(t){e.methodToCallbackMapping.hasOwnProperty(t)&&e.on(t,function(){})})}},{key:"registerCallbacks",value:function(e){var t=this;e||Object.keys(this.methodToCallbackMapping).forEach(function(e){t.methodToCallbackMapping.hasOwnProperty(e)&&window.rudderanalytics&&"function"==typeof window.rudderanalytics[t.methodToCallbackMapping[e]]&&(t.clientSuppliedCallbacks[e]=window.rudderanalytics[t.methodToCallbackMapping[e]])}),Object.keys(this.clientSuppliedCallbacks).forEach(function(e){t.clientSuppliedCallbacks.hasOwnProperty(e)&&t.on(e,t.clientSuppliedCallbacks[e])})}},{key:"sendSampleRequest",value:function(){$i("ad-block","//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js",{isNonNativeSDK:!0})}},{key:"startSession",value:function(e){this.uSession.start(e)}},{key:"endSession",value:function(){this.uSession.end()}},{key:"setAuthToken",value:function(e){"string"==typeof e?(this.storage.setAuthToken(e),this.transformationHandler.setAuthToken(e)):Kn.error("Provided input should be in string format")}}])}(),zs=new Ks;I(zs),window.addEventListener("error",function(e){gr(e,void 0,zs)},!0),zs.initializeCallbacks(),zs.registerCallbacks(!1);var Hs,Qs="load",Vs=window.rudderanalytics,qs=Array.isArray(Vs);if(qs)for(var Xs=0;Xs<Vs.length;){if(Vs[Xs]&&Vs[Xs][0]===Qs){Hs=Vs[Xs],Vs.splice(Xs,1);break}Xs+=1}!function(e){var t="ajs_trait_",n="ajs_prop_";function r(e,t){var n={};return Object.keys(e).forEach(function(r){r.startsWith(t)&&(n[r.substr(t.length)]=e[r])}),n}var i=function(e){var t={};try{new URL(e).searchParams.forEach(function(e,n){t[n]=e})}catch(e){}return t}(e);i.ajs_aid&&zs.toBeProcessedArray.push(["setAnonymousId",i.ajs_aid]),i.ajs_uid&&zs.toBeProcessedArray.push(["identify",i.ajs_uid,r(i,t)]),i.ajs_event&&zs.toBeProcessedArray.push(["track",i.ajs_event,r(i,n)])}(window.location.href),qs&&Vs.forEach(function(e){return zs.toBeProcessedArray.push(e)}),Hs&&Hs.length>0&&(Hs.shift(),zs[Qs].apply(zs,l(Hs)));var Ws=zs.ready.bind(zs),Ys=zs.identify.bind(zs),Js=zs.page.bind(zs),$s=zs.track.bind(zs),Zs=zs.alias.bind(zs),ea=zs.group.bind(zs),ta=zs.reset.bind(zs),na=zs.load.bind(zs),ra=zs.initialized=!0,ia=zs.getUserId.bind(zs),oa=zs.getSessionId.bind(zs),sa=zs.getUserTraits.bind(zs),aa=zs.getAnonymousId.bind(zs),ua=zs.setAnonymousId.bind(zs),ca=zs.getGroupId.bind(zs),la=zs.getGroupTraits.bind(zs),fa=zs.startSession.bind(zs),ha=zs.endSession.bind(zs),da=zs.setAuthToken.bind(zs);Kn.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=Zs,e.endSession=ha,e.getAnonymousId=aa,e.getGroupId=ca,e.getGroupTraits=la,e.getSessionId=oa,e.getUserId=ia,e.getUserTraits=sa,e.group=ea,e.identify=Ys,e.initialized=ra,e.load=na,e.page=Js,e.ready=Ws,e.reset=ta,e.setAnonymousId=ua,e.setAuthToken=da,e.startSession=fa,e.track=$s});
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});