1(function(pt,B){typeof exports=="object"&&typeof module<"u"?module.exports=B():typeof define=="function"&&define.amd?define(B):(pt=typeof globalThis<"u"?globalThis:pt||self,pt.OneTrustConsentManager=B())})(this,(function(){"use strict";function pt(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var B={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},X=console,me={};Object.keys(B).forEach(function(t){me[t]=X[t]});var vt="Datadog Browser SDK:",U={debug:me.debug.bind(X,vt),log:me.log.bind(X,vt),info:me.info.bind(X,vt),warn:me.warn.bind(X,vt),error:me.error.bind(X,vt)};function Qn(t,e){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];try{return t.apply(void 0,r)}catch(i){U.error(e,i)}}}var gt;(function(t){t.PAGEHIDE="pagehide",t.FEATURE_FLAGS="feature_flags",t.RESOURCE_PAGE_STATES="resource_page_states",t.PAGE_STATES="page_states",t.COLLECT_FLUSH_REASON="collect_flush_reason",t.NO_RESOURCE_DURATION_FROZEN_STATE="no_resource_duration_frozen_state",t.SCROLLMAP="scrollmap",t.INTERACTION_TO_NEXT_PAINT="interaction_to_next_paint",t.WEB_VITALS_ATTRIBUTION="web_vitals_attribution",t.DISABLE_REPLAY_INLINE_CSS="disable_replay_inline_css"})(gt||(gt={}));var wr=new Set;function Ua(t){t.forEach(function(e){wr.add(e)})}function Xn(t){return wr.has(t)}function za(){return wr}function _r(t){return t!==0&&Math.random()*100<=t}function Sr(t){return qa(t)&&t>=0&&t<=100}function qa(t){return typeof t=="number"}var yt=1e3,be=60*yt,Ga=60*be;function mt(){return new Date().getTime()}function ce(){return mt()}function bt(){return performance.now()}function Ve(){return{relative:bt(),timeStamp:ce()}}function Ha(){return{relative:0,timeStamp:Zn()}}function Va(t,e){return e-t}function Ka(t,e){return t+e}function Wa(t){return t-Zn()}var Er;function Zn(){return Er===void 0&&(Er=performance.timing.navigationStart),Er}var le=1024,ei=1024*le,Ja=/[^\u0000-\u007F]/;function Dt(t){return Ja.test(t)?window.TextEncoder!==void 0?new TextEncoder().encode(t).length:new Blob([t]).size:t.length}function Ke(t,e){return t.indexOf(e)!==-1}function ti(t){if(Array.from)return Array.from(t);var e=[];if(t instanceof Set)t.forEach(function(n){return e.push(n)});else for(var r=0;r<t.length;r++)e.push(t[r]);return e}function $a(t,e){for(var r=0;r<t.length;r+=1){var n=t[r];if(e(n,r))return n}}function We(t){return Object.keys(t).map(function(e){return t[e]})}function Ya(t){return Object.keys(t).map(function(e){return[e,t[e]]})}function ri(t,e){return t.slice(0,e.length)===e}function Qa(t,e){return t.slice(-e.length)===e}function q(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return e.forEach(function(n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}),t}function Xa(t){return q({},t)}function Za(t,e){return Object.keys(t).some(function(r){return t[r]===e})}function ni(t){return Object.keys(t).length===0}function fe(){if(typeof globalThis=="object")return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var t=_dd_temp_;return delete Object.prototype._dd_temp_,typeof t!="object"&&(typeof self=="object"?t=self:typeof window=="object"?t=window:t={}),t}function Je(t,e){var r=fe(),n;return r.Zone&&typeof r.Zone.__symbol__=="function"&&(n=t[r.Zone.__symbol__(e)]),n||(n=t[e]),n}var es=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))},Nt,ii=!1;function ts(t){Nt=t}function rs(t){ii=t}function ns(t,e,r){var n=r.value;r.value=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var s=Nt?P(n):n;return s.apply(this,i)}}function P(t){return function(){return we(t,this,arguments)}}function we(t,e,r){try{return t.apply(e,r)}catch(n){if(Or(n),Nt)try{Nt(n)}catch(i){Or(i)}}}function Or(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];ii&&U.error.apply(U,es(["[MONITOR]"],t,!1))}function wt(t,e){return Je(fe(),"setTimeout")(P(t),e)}function oi(t){Je(fe(),"clearTimeout")(t)}function Cr(t,e){return Je(fe(),"setInterval")(P(t),e)}function ai(t){Je(fe(),"clearInterval")(t)}var G=(function(){function t(e){this.onFirstSubscribe=e,this.observers=[]}return t.prototype.subscribe=function(e){var r=this;return!this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe()||void 0),this.observers.push(e),{unsubscribe:function(){r.observers=r.observers.filter(function(n){return e!==n}),!r.observers.length&&r.onLastUnsubscribe&&r.onLastUnsubscribe()}}}
1,t.prototype.notify=function(e){this.observers.forEach(function(r){return r(e)})},t})();function si(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=new G(function(){var n=t.map(function(i){return i.subscribe(function(o){return r.notify(o)})});return function(){return n.forEach(function(i){return i.unsubscribe()})}});return r}function ui(t,e,r){var n=!1,i,o;return{throttled:function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];if(n){i=s;return}t.apply(void 0,s),n=!0,o=wt(function(){i&&t.apply(void 0,i),n=!1,i=void 0},e)},cancel:function(){oi(o),n=!1,i=void 0}}}function _t(){}function _e(t){return t?(parseInt(t,10)^Math.random()*16>>parseInt(t,10)/4).toString(16):"".concat(1e7,"-").concat(1e3,"-").concat(4e3,"-").concat(8e3,"-").concat(1e11).replace(/[018]/g,_e)}function is(t,e){var r=new RegExp("(?:^|;)\\s*".concat(e,"\\s*=\\s*([^;]+)")),n=r.exec(t);return n?n[1]:void 0}function os(t,e,r){var n=t.charCodeAt(e-1),i=n>=55296&&n<=56319,o=i?e+1:e;return t.length<=o?t:"".concat(t.slice(0,o)).concat(r)}var ci=4*Ga,li=15*be,jt;function as(){return jt??(jt=!!window.chrome||/HeadlessChrome/.test(window.navigator.userAgent))}function Ft(t,e,r,n){var i=new Date;i.setTime(i.getTime()+r);var o="expires=".concat(i.toUTCString()),s=n&&n.crossSite?"none":"strict",a=n&&n.domain?";domain=".concat(n.domain):"",u=n&&n.secure?";secure":"";document.cookie="".concat(t,"=").concat(e,";").concat(o,";path=/;samesite=").concat(s).concat(a).concat(u)}function Z(t){return is(document.cookie,t)}function xr(t,e){Ft(t,"",0,e)}function ss(t){if(document.cookie===void 0||document.cookie===null)return!1;try{var e="dd_cookie_test_".concat(_e()),r="test";Ft(e,r,be,t);var n=Z(e)===r;return xr(e,t),n}catch(i){return U.error(i),!1}}var Mr;function us(){if(Mr===void 0){for(var t="dd_site_test_".concat(_e()),e="test",r=window.location.hostname.split("."),n=r.pop();r.length&&!Z(t);)n="".concat(r.pop(),".").concat(n),Ft(t,e,yt,{domain:n});xr(t,{domain:n}),Mr=n}return Mr}var Se="_dd_s",fi=/^([a-z]+)=([a-z0-9-]+)$/,kr="&";function Tr(t){return ni(t)}function di(t){t.expire=String(mt()+li)}function hi(t){return Ya(t).map(function(e){var r=e[0],n=e[1];return"".concat(r,"=").concat(n)}).join(kr)}function pi(t){var e={};return cs(t)&&t.split(kr).forEach(function(r){var n=fi.exec(r);if(n!==null){var i=n[1],o=n[2];e[i]=o}}),e}function cs(t){return!!t&&(t.indexOf(kr)!==-1||fi.test(t))}var ls="_dd",fs="_dd_r",ds="_dd_l",hs="rum",ps="logs";function vs(t){var e=Z(Se);if(!e){var r=Z(ls),n=Z(fs),i=Z(ds),o={};r&&(o.id=r),i&&/^[01]$/.test(i)&&(o[ps]=i),n&&/^[012]$/.test(n)&&(o[hs]=n),Tr(o)||(di(o),t.persistSession(o))}}function gs(t){var e=_s(t);return ss(e)?{type:"Cookie",cookieOptions:e}:void 0}function ys(t){var e={isLockEnabled:as(),persistSession:ms(t),retrieveSession:bs,clearSession:ws(t)};return vs(e),e}function ms(t){return function(e){Ft(Se,hi(e),li,t)}}function bs(){var t=Z(Se);return pi(t)}function ws(t){return function(){xr(Se,t)}}function _s(t){var e={};return e.secure=!!t.useSecureSessionCookie||!!t.useCrossSiteSessionCookie,e.crossSite=!!t.useCrossSiteSessionCookie,t.trackSessionAcrossSubdomains&&(e.domain=us()),e}var Ss="_dd_test_";function Es(){try{var t=_e(),e="".concat(Ss).concat(t);localStorage.setItem(e,t);var r=localStorage.getItem(e);return localStorage.removeItem(e),t===r?{type:"LocalStorage"}:void 0}catch{return}}function Os(){return{isLockEnabled:!1,persistSession:Cs,retrieveSession:xs,clearSession:Ms}}function Cs(t){localStorage.setItem(Se,hi(t))}function xs(){var t=localStorage.getItem(Se);return pi(t)}function Ms(){localStorage.removeItem(Se)}var ks=10,Ts=100,vi=[],Bt;function St(t,e,r){var n;r===void 0&&(r=0);var i=e.isLockEnabled,o=e.retrieveSession,s=e.persistSession,a=e.clearSession;if(Bt||(Bt=t),t!==Bt){vi.push(t);return}if(i&&r>=Ts){gi(e);return}var u,c=o();if(i){if(c.lock){Ut(t,e,r);return}if(u=_e(),c.lock=u,s(c),c=o(),c.lock!==u){Ut(t,e,r);return}}var l=t.process(c);if(i&&(c=o(),c.lock!==u)){Ut(t,e,r);return}if(l&&(Tr(l)?a():(di(l),s(l))),i&&!(l&&Tr(l))){if(c=o(),c.lock!==u){Ut(t,e,r);return}delete c.lock,s(c),l=c}(n=t.after)===null||n===void 0||n.call(t,l||c),gi(e)}function Ut(t,e,r){wt(function(){St(t,e,r+1)},ks)}function gi(t){Bt=void 0;var e=vi.shift();e&&St(e,t)}var yi=yt;function Ls(t){var e=gs(t);return!e&&t.allowFallbackToLocalStorage&&(e=Es()),e}function As(t,e,r){var n=new G,i=new G,o=t.type==="Cookie"?ys(t.cookieOptions):Os(),s=o.clearSession,a=o.retrieveSession,u=Cr(d,yi),c=S();function l(){var b;St({process:function(E){var x=h(E);return b=p(x),x},after:function(E){b&&!g()&&m(E),c=E}},o)}function f(){St({process:function(b){return g()?h(b):void 0}},o)}function d(){St({process:function(b){return _(b)?void 0:{}},after:h},o)}function h(b){return _(b)||(b={}),g()&&(v(b)?y():c=b),b}function p(b){var E=r(b[e]),x=E.trackingType,T=E.isTracked;return b[e]=x,T&&!b.id&&(b.id=_e(),b.created=String(mt())),T}function g(){return c[e]!==void 0}function v(b){return c.id!==b.id||c[e]!==b[e]}function y(){c={},i.notify()}function m(b){c=b,n.notify()}function S(){var b=a();return _(b)?b:{}}function _(b){return(b.created===void 0||mt()-Number(b.created)<ci)&&(b.expire===void 0||mt()<Number(b.expire))}return{expandOrRenewSession:ui(l,yi).throttled,expandSession:f,getSession:function(){return c},renewObservable:n,expireObservable:i,expire:function(){s(),h({})},stop:function(){ai(u)}}}function $e(t,e,r){if(typeof t!="object"||t===null)return JSON.stringify(t);var n=Ye(Object.prototype),i=Ye(Array.prototype),o=Ye(Object.getPrototypeOf(t)),s=Ye(t);try{return JSON.stringify(t,e,r)}catch{return"<error: unable to serialize object>"}finally{n(),i(),o(),s()}}function Ye(t){var e=t,r=e.toJSON;return r?(delete e.toJSON,function(){e.toJSON=r}):_t}function zt(t){return Is(t,Rs()).href}function Is(t,e){var r=Ps();if(r)try{return e!==void 0?new r(t,e):new r(t)}catch(s){throw new Error("Failed to construct URL: ".concat(String(s)," ").concat($e({url:t,base:e})))}if(e===void 0&&!/:/.test(t))throw new Error("Invalid URL: '".concat(t,"'"));var n=document,i=n.createElement("a");if(e!==void 0){n=document.implementation.createHTMLDocument("");var o=n.createElement("base");o.href=e,n.head.appendChild(o),n.body.appendChild(i)}return i.href=t,i}var mi=URL,qt;function Ps(){if(qt===void 0)try{var t=new mi("http://test/path");qt=t.href==="http://test/path"}catch{qt=!1}return qt?mi:void 0}function Rs(){return Ds(window.location)}function Ds(t){if(t.origin&&t.origin!=="null")return t.origin;var e=t.host.replace(/(:80|:443)$/,"");return"".concat(t.protocol,"//").concat(e)}var Ns="datad0g.com",Et="datadoghq.com",js="ap1.datadoghq.com",Fs="ddog-gov.com",Bs={logs:"logs",rum:"rum",sessionReplay:"session-replay"},Us={logs:"logs",rum:"rum",sessionReplay:"replay"};function Ot(t,e,r){var n=zs(t,e);return{build:function(i,o){var s=Gs(t,e,r,i,o);return n(s)},urlPrefix:n(""),endpointType:e}}function zs(t,e){var r="/api/v2/".concat(Us[e]),n=t.proxy,i=t.proxyUrl;if(n){var o=zt(n);return function(u){return"".concat(o,"?ddforward=").concat(encodeURIComponent("".concat(r,"?").concat(u)))}}var s=qs(t,e);if(n===void 0&&i){var a=zt(i);return function(u){return"".concat(a,"?ddforward=").concat(encodeURIComponent("https://".concat(s).concat(r,"?").concat(u)))}}return function(u){return"https://".concat(s).concat(r,"?").concat(u)}}function qs(t,e){var r=t.site,n=r===void 0?Et:r,i=t.internalAnalyticsSubdomain;if(i&&n===Et)return"".concat(i,".").concat(Et);var o=n.split("."),s=o.pop(),a=n!==js?"".concat(Bs[e],"."):"";return"".concat(a,"browser-intake-").concat(o.join("-"),".").concat(s)}function Gs(t,e,r,n,i){var o=t.clientToken,s=t.internalAnalyticsSubdomain,a=i.retry,u=i.flushReason,c=i.encoding,l=["sdk_version:".concat("4.50.1"),"api:".concat(n)].concat(r);u&&Xn(gt.COLLECT_FLUSH_REASON)&&l.push("flush_reason:".concat(u)),a&&l.push("retry_count:".concat(a.count),"retry_after:".concat(a.lastFailureStatus));var f=["ddsource=browser","ddtags=".concat(encodeURIComponent(l.join(","))),"dd-api-key=".concat(o),"dd-evp-origin-version=".concat(encodeURIComponent("4.50.1")),"dd-evp-origin=browser","dd-request-id=".concat(_e())];return c&&f.push("dd-evp-encoding=".concat(c)),e==="rum"&&f.push("batch_time=".concat(ce())),s&&f.reverse(),f.join("&")}var Hs=200;function Vs(t){var e=t.env,r=t.service,n=t.version,i=t.datacenter,o=[];return e&&o.push(Gt("env",e)),r&&o.push(Gt("service",r)),n&&o.push(Gt("version",n)),i&&o.push(Gt("datacenter",i)),o}var Ks=/[^a-z0-9_:./-]/;function Gt(t,e){var r=Hs-t.length-1;(e.length>r||Ks.test(e))&&U.warn("".concat(t," value doesn't meet tag requirements and will be sanitized"));var n=e.replace(/,/g,"_");return"".concat(t,":").concat(n)}function Ws(t){var e=Vs(t),r=Js(t,e),n=We(r).map(function(o){return o.urlPrefix}),i=$s(t,n,e);return q({isIntakeUrl:function(o){return n.some(function(s){return o.indexOf(s)===0})},replica:i,site:t.site||Et},r)}function Js(t,e){return{logsEndpointBuilder:Ot(t,"logs",e),rumEndpointBuilder:Ot(t,"rum",e),sessionReplayEndpointBuilder:Ot(t,"sessionReplay",e)}}function $s(t,e,r){if(t.replica){var n=q({},t,{site:Et,clientToken:t.replica.clientToken}),i={logsEndpointBuilder:Ot(n,"logs",r),rumEndpointBuilder:Ot(n,"rum",r)};return e.push.apply(e,We(i).map(function(o){return o.urlPrefix})),q({applicationId:t.replica.applicationId},i)}}function Ys(t){var e,r,n;if(!t||!t.clientToken){U.error("Client Token is not configured, we will not send any data.");return}var i=(e=t.sessionSampleRate)!==null&&e!==void 0?e:t.sampleRate;if(i!==void 0&&!Sr(i)){U.error("Session Sample Rate should be a number between 0 and 100");return}if(t.telemetrySampleRate!==void 0&&!Sr(t.telemetrySampleRate)){U.error("Telemetry Sample Rate should be a number between 0 and 100");return}if(t.telemetryConfigurationSampleRate!==void 0&&!Sr(t.telemetryConfigurationSampleRate)){U.error("Telemetry Configuration Sample Rate should be a number between 0 and 100");return}return Array.isArray(t.enableExperimentalFeatures)&&Ua(t.enableExperimentalFeatures.filter(function(o){return Za(gt,o)})),q({beforeSend:t.beforeSend&&Qn(t.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Ls(t),sessionSampleRate:i??100,telemetrySampleRate:(r=t.telemetrySampleRate)!==null&&r!==void 0?r:20,telemetryConfigurationSampleRate:(n=t.telemetryConfigurationSampleRate)!==null&&n!==void 0?n:5,service:t.service,silentMultipleInit:!!t.silentMultipleInit,batchBytesLimit:16*le,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*yt,batchMessagesLimit:50,messageBytesLimit:256*le},Ws(t))}function Qs(t){var e,r,n=(e=t.proxy)!==null&&e!==void 0?e:t.proxyUrl;return{session_sample_rate:(r=t.sessionSampleRate)!==null&&r!==void 0?r:t.sampleRate,telemetry_sample_rate:t.telemetrySampleRate,telemetry_configuration_sample_rate:t.telemetryConfigurationSampleRate,use_before_send:!!t.beforeSend,use_cross_site_session_cookie:t.useCrossSiteSessionCookie,use_secure_session_cookie:t.useSecureSessionCookie,use_proxy:n!==void 0?!!n:void 0,silent_multiple_init:t.silentMultipleInit,track_session_across_subdomains:t.trackSessionAcrossSubdomains,track_resources:t.trackResources,track_long_task:t.trackLongTasks,allow_fallback_to_local_storage:!!t.allowFallbackToLocalStorage,store_contexts_across_pages:!!t.storeContextsAcrossPages}}var Ct="?";function oe(t){var e=[],r=Lr(t,"stack"),n=String(t);return r&&ri(r,n)&&(r=r.slice(n.length)),r&&r.split(` 2`).forEach(function(i){var o=eu(i)||ru(i)||iu(i)||su(i);o&&(!o.func&&o.line&&(o.func=Ct),e.push(o))}),{message:Lr(t,"message"),name:Lr(t,"name"),stack:e}}var bi="((?:file|https?|blob|chrome-extension|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",Qe="(?::(\\d+))",Xs=new RegExp("^\\s*at (.*?) ?\\(".concat(bi).concat(Qe,"?").concat(Qe,"?\\)?\\s*$"),"i"),Zs=new RegExp("\\((\\S*)".concat(Qe).concat(Qe,"\\)"));function eu(t){var e=Xs.exec(t);if(e){var r=e[2]&&e[2].indexOf("native")===0,n=e[2]&&e[2].indexOf("eval")===0,i=Zs.exec(e[2]);return n&&i&&(e[2]=i[1],e[3]=i[2],e[4]=i[3]),{args:r?[e[2]]:[],column:e[4]?+e[4]:void 0,func:e[1]||Ct,line:e[3]?+e[3]:void 0,url:r?void 0:e[2]}}}var tu=new RegExp("^\\s*at ?".concat(bi).concat(Qe,"?").concat(Qe,"??\\s*$"),"i");function ru(t){var e=tu.exec(t);if(e)return{args:[],column:e[3]?+e[3]:void 0,func:Ct,line:e[2]?+e[2]:void 0,url:e[1]}}var nu=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function iu(t){var e=nu.exec(t);if(e)return{args:[],column:e[4]?+e[4]:void 0,func:e[1]||Ct,line:+e[3],url:e[2]}}var ou=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,au=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function su(t){var e=ou.exec(t);if(e){var r=e[3]&&e[3].indexOf(" > eval")>-1,n=au.exec(e[3]);return r&&n&&(e[3]=n[1],e[4]=n[2],e[5]=void 0),{args:e[2]?e[2].split(","):[],column:e[5]?+e[5]:void 0,func:e[1]||Ct,line:e[4]?+e[4]:void 0,url:e[3]}}}function Lr(t,e){if(!(typeof t!="object"||!t||!(e in t))){var r=t[e];return typeof r=="string"?r:void 0}}function wi(t,e,r){var n=t[e],i=r(n),o=function(){if(typeof i=="function")return i.apply(this,arguments)};return t[e]=o,{stop:function(){t[e]===o?t[e]=n:i=n}}}function Xe(t,e,r){var n=r.before,i=r.after;return wi(t,e,function(o){return function(){var s=arguments,a;return n&&we(n,this,s),typeof o=="function"&&(a=o.apply(this,s)),i&&we(i,this,s),a}})}var uu=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function cu(t){var e=lu(t).stop,r=du(t).stop;return{stop:function(){e(),r()}}}function lu(t){return Xe(window,"onerror",{before:function(e,r,n,i,o){var s;if(o instanceof Error)s=oe(o);else{var a=[{url:r,column:i,line:n}],u=fu(e),c=u.name,l=u.message;s={name:c,message:l,stack:a}}t(s,o??e)}})}function fu(t){var e,r,n;return{}.toString.call(t)==="[object String]"&&(e=uu.exec(t),r=e[1],n=e[2]),{name:r,message:n}}function du(t){return Xe(window,"onunhandledrejection",{before:function(e){var r=e.reason||"Empty reason",n=oe(r);t(n,r)}})}var hu=220*le,pu="$",vu=3;function ae(t,e){var r;e===void 0&&(e=hu);var n=Ye(Object.prototype),i=Ye(Array.prototype),o=[],s=new WeakMap,a=Ar(t,pu,void 0,o,s),u=((r=JSON.stringify(a))===null||r===void 0?void 0:r.length)||0;if(u>e){Ir(e,"discarded",t);return}for(;o.length>0&&u<e;){var c=o.shift(),l=0;if(Array.isArray(c.source))for(var f=0;f<c.source.length;f++){var d=Ar(c.source[f],c.path,f,o,s);if(d!==void 0?u+=JSON.stringify(d).length:u+=4,u+=l,l=1,u>e){Ir(e,"truncated",t);break}c.target[f]=d}else for(var f in c.source)if(Object.prototype.hasOwnProperty.call(c.source,f)){var d=Ar(c.source[f],c.path,f,o,s);if(d!==void 0&&(u+=JSON.stringify(d).length+l+f.length+vu,l=1),u>e){Ir(e,"truncated",t);break}c.target[f]=d}}return n(),i(),a}function Ar(t,e,r,n,i){var o=mu(t);if(!o||typeof o!="object")return gu(o);var s=yu(o);if(s!=="[Object]"&&s!=="[Array]"&&s!=="[Error]")return s;var a=t;if(i.has(a))return"[Reference seen at ".concat(i.get(a),"]");var u=r!==void 0?"".concat(e,".").concat(r):e,c=Array.isArray(o)?[]:{};return i.set(a,u),n.push({source:o,target:c,path:u}),c}function gu(t){return typeof t=="bigint"?"[BigInt] ".concat(t.toString()):typeof t=="function"?"[Function] ".concat(t.name||"unknown"):typeof t=="symbol"?"[Symbol] ".concat(t.description||t.toString()):t}function yu(t){try{if(t instanceof Event)return{isTrusted:t.isTrusted};var e=Object.prototype.toString.call(t),r=e.match(/\[object (.*)\]/);if(r&&r[1])return"[".concat(r[1],"]")}catch{}return"[Unserializable]"}function mu(t){var e=t;if(e&&typeof e.toJSON=="function")try{return e.toJSON()}catch{}return t}function Ir(t,e,r){U.warn("The data provided has been ".concat(e," as it is over the limit of ").concat(t," characters:"),r)}var _i="No stack, consider using an instance of Error";function Si(t){var e=t.stackTrace,r=t.originalError,n=t.handlingStack,i=t.startClocks,o=t.nonErrorPrefix,s=t.source,a=t.handling,u=r instanceof Error,c=bu(e,u,o,r),l=wu(u,e)?Ee(e):_i,f=u?Eu(r,s):void 0,d=e?.
2name,h=Ei(r);return{startClocks:i,source:s,handling:a,handlingStack:n,originalError:r,type:d,message:c,stack:l,causes:f,fingerprint:h}}function bu(t,e,r,n){return t?.message&&t?.name?t.message:e?"Empty message":"".concat(r," ").concat($e(ae(n)))}function wu(t,e){return e===void 0?!1:t?!0:e.stack.length>0&&(e.stack.length>1||e.stack[0].url!==void 0)}function Ei(t){return t instanceof Error&&"dd_fingerprint"in t?String(t.dd_fingerprint):void 0}function Ee(t){var e=Oi(t);return t.stack.forEach(function(r){var n=r.func==="?"?"<anonymous>":r.func,i=r.args&&r.args.length>0?"(".concat(r.args.join(", "),")"):"",o=r.line?":".concat(r.line):"",s=r.line&&r.column?":".concat(r.column):"";e+=` 3 at `.concat(n).concat(i," @ ").concat(r.url).concat(o).concat(s)}),e}function _u(t){var e;return(e=/@ (.+)/.exec(t))===null||e===void 0?void 0:e[1]}function Oi(t){return"".concat(t.name||"Error",": ").concat(t.message)}function Su(){var t=2,e=new Error,r;if(!e.stack)try{throw e}catch{}return we(function(){var n=oe(e);n.stack=n.stack.slice(t),r=Ee(n)}),r}function Eu(t,e){for(var r=t,n=[];r?.cause instanceof Error&&n.length<10;){var i=oe(r.cause);n.push({message:r.cause.message,source:e,type:i?.name,stack:i&&Ee(i)}),r=r.cause}return n.length?n:void 0}var j={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function Ou(t){return cu(function(e,r){t.notify(Si({stackTrace:e,originalError:r,startClocks:Ve(),nonErrorPrefix:"Uncaught",source:j.SOURCE,handling:"unhandled"}))})}function Cu(t){var e=q({version:"4.50.1",onReady:function(r){r()}},t);return Object.defineProperty(e,"_setDebug",{get:function(){return rs},enumerable:!1}),e}function xu(t,e,r){var n=t[e];t[e]=r,n&&n.q&&n.q.forEach(function(i){return Qn(i,"onReady callback threw an error:")()})}function Ze(t,e,r,n,i){return Pr(t,e,[r],n,i)}function Pr(t,e,r,n,i){var o=i===void 0?{}:i,s=o.once,a=o.capture,u=o.passive,c=P(s?function(h){d(),n(h)}:n),l=u?{capture:a,passive:u}:a,f=Je(e,"addEventListener");r.forEach(function(h){return f.call(e,h,c,l)});function d(){var h=Je(e,"removeEventListener");r.forEach(function(p){return h.call(e,p,c,l)})}return{stop:d}}var de={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function Mu(t,e){var r=[];Ke(e,de.cspViolation)&&r.push(Tu(t));var n=e.filter(function(i){return i!==de.cspViolation});return n.length&&r.push(ku(n)),si.apply(void 0,r)}function ku(t){var e=new G(function(){if(window.ReportingObserver){var r=P(function(i,o){return i.forEach(function(s){e.notify(Lu(s))})}),n=new window.ReportingObserver(r,{types:t,buffered:!0});return n.observe(),function(){n.disconnect()}}});return e}function Tu(t){var e=new G(function(){var r=Ze(t,document,"securitypolicyviolation",function(n){e.notify(Au(n))}).stop;return r});return e}function Lu(t){var e=t.type,r=t.body;return{type:e,subtype:r.id,message:"".concat(e,": ").concat(r.message),stack:Ci(r.id,r.message,r.sourceFile,r.lineNumber,r.columnNumber)}}function Au(t){var e=de.cspViolation,r="'".concat(t.blockedURI,"' blocked by '").concat(t.effectiveDirective,"' directive");return{type:de.cspViolation,subtype:t.effectiveDirective,message:"".concat(e,": ").concat(r),stack:Ci(t.effectiveDirective,t.originalPolicy?"".concat(r,' of the policy "').concat(os(t.originalPolicy,100,"..."),'"'):"no policy",t.sourceFile,t.lineNumber,t.columnNumber)}}function Ci(t,e,r,n,i){return r?Ee({name:t,message:e,stack:[{func:"?",url:r,line:n??void 0,column:i??void 0}]}):void 0}function xi(t,e){var r=window.__ddBrowserSdkExtensionCallback;r&&r({type:t,payload:e})}function Rr(t){return t===null?"null":Array.isArray(t)?"array":typeof t}function Ht(t,e,r){if(r===void 0&&(r=Iu()),e===void 0)return t;if(typeof e!="object"||e===null)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp){var n=e.flags||[e.global?"g":"",e.ignoreCase?"i":"",e.multiline?"m":"",e.sticky?"y":"",e.unicode?"u":""].join("");return new RegExp(e.source,n)}if(!r.hasAlreadyBeenSeen(e)){if(Array.isArray(e)){for(var i=Array.isArray(t)?t:[],o=0;o<e.length;++o)i[o]=Ht(i[o],e[o],r);return i}var s=Rr(t)==="object"?t:{};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(s[a]=Ht(s[a],e[a],r));return s}}function Dr(t){return Ht(void 0,t)}function Oe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r,n=0,i=t;n<i.length;n++){var o=i[n];o!=null&&(r=Ht(r,o))}return r}function Iu(){if(typeof WeakSet<"u"){var t=new WeakSet;return{hasAlreadyBeenSeen:function(r){var n=t.has(r);return n||t.add(r),n}}}var e=[];return{hasAlreadyBeenSeen:function(r){var n=e.indexOf(r)>=0;return n||e.push(r),n}}}var Nr={log:"log",configuration:"configuration"},Pu=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Ru=[Fs],ee={maxEventsPerPage:0,sentEventCount:0,telemetryEnabled:!1,telemetryConfigurationEnabled:!1},jr;function Du(t,e){var r,n=new G;ee.telemetryEnabled=!Ke(Ru,e.site)&&_r(e.telemetrySampleRate),ee.telemetryConfigurationEnabled=ee.telemetryEnabled&&_r(e.telemetryConfigurationSampleRate);var i=Nu();jr=function(s){if(ee.telemetryEnabled){var a=o(t,s,i);n.notify(a),xi("telemetry",a)}},ts(ki),q(ee,{maxEventsPerPage:e.maxTelemetryEventsPerPage,sentEventCount:0});function o(s,a,u){return Oe({type:"telemetry",date:ce(),service:s,version:"4.50.1",source:"browser",_dd:{format_version:2},telemetry:Oe(a,{runtime_env:u}),experimental_features:ti(za())},r!==void 0?r():{})}return{setContextProvider:function(s){r=s},observable:n,enabled:ee.telemetryEnabled}}function Nu(){return{is_local_file:window.location.protocol==="file:",is_worker:"WorkerGlobalScope"in self}}function ju(t){return t.site===Ns}function Mi(t,e){Or(B.debug,t,e),Fr(q({type:Nr.log,message:t,status:"debug"},e))}function ki(t,e){Fr(q({type:Nr.log,status:"error"},Bu(t),e))}function Fu(t){ee.telemetryConfigurationEnabled&&Fr({type:Nr.configuration,configuration:t})}function Fr(t){jr&&ee.sentEventCount<ee.maxEventsPerPage&&(ee.sentEventCount+=1,jr(t))}function Bu(t){if(t instanceof Error){var e=oe(t);return{error:{kind:e.name,stack:Ee(Uu(e))},message:e.message}}return{error:{stack:_i},message:"".concat("Uncaught"," ").concat($e(t))}}function Uu(t){return t.stack=t.stack.filter(function(e){return!e.url||Pu.some(function(r){return ri(e.url,r)})}),t}var Vt=1/0,zu=be,qu=(function(){function t(e,r){var n=this;this.expireDelay=e,this.maxEntries=r,this.entries=[],this.clearOldValuesInterval=Cr(function(){return n.clearOldValues()},zu)}return t.prototype.add=function(e,r){var n=this,i={value:e,startTime:r,endTime:Vt,remove:function(){var o=n.entries.indexOf(i);o>=0&&n.entries.splice(o,1)},close:function(o){i.endTime=o}};return this.maxEntries&&this.entries.length>=this.maxEntries&&this.entries.pop(),this.entries.unshift(i),i},t.prototype.find=function(e){e===void 0&&(e=Vt);for(var r=0,n=this.entries;r<n.length;r++){var i=n[r];if(i.startTime<=e){if(e<=i.endTime)return i.value;break}}},t.prototype.closeActive=function(e){var r=this.entries[0];r&&r.endTime===Vt&&r.close(e)},t.prototype.findAll=function(e,r){e===void 0&&(e=Vt),r===void 0&&(r=0);var n=Ka(e,r);return this.entries.filter(function(i){return i.startTime<=n&&e<=i.endTime}).map(function(i){return i.value})},t.prototype.reset=function(){this.entries=[]},t.prototype.stop=function(){ai(this.clearOldValuesInterval)},t.prototype.clearOldValues=function(){for(var e=bt()-this.expireDelay;this.entries.length>0&&this.entries[this.entries.length-1].endTime<e;)this.entries.pop()},t})(),Gu=be,Hu=ci;function Vu(t,e,r){var n=As(t.sessionStoreStrategyType,e,r),i=new qu(Hu);n.renewObservable.subscribe(function(){i.add(o(),bt())}),n.expireObservable.subscribe(function(){i.closeActive(bt())}),n.expandOrRenewSession(),i.add(o(),Ha().relative),Ku(t,function(){return n.expandOrRenewSession()}),Wu(t,function(){return n.expandSession()});function o(){return{id:n.getSession().id,trackingType:n.getSession()[e]}}return{findActiveSession:function(s){return i.find(s)},renewObservable:n.renewObservable,expireObservable:n.expireObservable,expire:n.expire}}function Ku(t,e){Pr(t,window,["click","touchstart","keydown","scroll"],e,{capture:!0,passive:!0}).stop}function Wu(t,e){var r=function(){document.visibilityState==="visible"&&e()};Ze(t,document,"visibilitychange",r).stop,Cr(r,Gu)}
3function Ti(t){return t>=500}function Ju(t){try{return t.clone()}catch{return}}var $u=80*le,Yu=32,Li=3*ei,Qu=be,Ai=yt;function Ii(t,e,r,n,i){e.transportStatus===0&&e.queuedPayloads.size()===0&&e.bandwidthMonitor.canHandle(t)?Ri(t,e,r,{onSuccess:function(){return Di(0,e,r,n,i)},onFailure:function(){e.queuedPayloads.enqueue(t),Pi(e,r,n,i)}}):e.queuedPayloads.enqueue(t)}function Pi(t,e,r,n){t.transportStatus===2&&wt(function(){var i=t.queuedPayloads.first();Ri(i,t,e,{onSuccess:function(){t.queuedPayloads.dequeue(),t.currentBackoffTime=Ai,Di(1,t,e,r,n)},onFailure:function(){t.currentBackoffTime=Math.min(Qu,t.currentBackoffTime*2),Pi(t,e,r,n)}})},t.currentBackoffTime)}function Ri(t,e,r,n){var i=n.onSuccess,o=n.onFailure;e.bandwidthMonitor.add(t),r(t,function(s){e.bandwidthMonitor.remove(t),Xu(s)?(e.transportStatus=e.bandwidthMonitor.ongoingRequestCount>0?1:2,t.retry={count:t.retry?t.retry.count+1:1,lastFailureStatus:s.status},o()):(e.transportStatus=0,i())})}function Di(t,e,r,n,i){t===0&&e.queuedPayloads.isFull()&&!e.queueFullReported&&(i({message:"Reached max ".concat(n," events size queued for upload: ").concat(Li/ei,"MiB"),source:j.AGENT,startClocks:Ve()}),e.queueFullReported=!0);var o=e.queuedPayloads;for(e.queuedPayloads=Ni();o.size()>0;)Ii(o.dequeue(),e,r,n,i)}function Xu(t){return t.type!=="opaque"&&(t.status===0&&!navigator.onLine||t.status===408||t.status===429||Ti(t.status))}function Zu(){return{transportStatus:0,currentBackoffTime:Ai,bandwidthMonitor:ec(),queuedPayloads:Ni(),queueFullReported:!1}}function Ni(){var t=[];return{bytesCount:0,enqueue:function(e){this.isFull()||(t.push(e),this.bytesCount+=e.bytesCount)},first:function(){return t[0]},dequeue:function(){var e=t.shift();return e&&(this.bytesCount-=e.bytesCount),e},size:function(){return t.length},isFull:function(){return this.bytesCount>=Li}}}function ec(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(t){return this.ongoingRequestCount===0||this.ongoingByteCount+t.bytesCount<=$u&&this.ongoingRequestCount<Yu},add:function(t){this.ongoingRequestCount+=1,this.ongoingByteCount+=t.bytesCount},remove:function(t){this.ongoingRequestCount-=1,this.ongoingByteCount-=t.bytesCount}}}function tc(t,e,r,n){var i=Zu(),o=function(s,a){return ic(t,e,r,s,a)};return{send:function(s){Ii(s,i,o,e.endpointType,n)},sendOnExit:function(s){rc(t,e,r,s)}}}function rc(t,e,r,n){var i=!!navigator.sendBeacon&&n.bytesCount<r;if(i)try{var o=e.build("beacon",n),s=navigator.sendBeacon(o,n.data);if(s)return}catch(u){nc(u)}var a=e.build("xhr",n);Br(t,a,n.data)}var ji=!1;function nc(t){ji||(ji=!0,ki(t))}function ic(t,e,r,n,i){var o=oc()&&n.bytesCount<r;if(o){var s=e.build("fetch",n);fetch(s,{method:"POST",body:n.data,keepalive:!0,mode:"cors"}).then(P(function(u){return i?.({status:u.status,type:u.type})}),P(function(){var u=e.build("xhr",n);Br(t,u,n.data,i)}))}else{var a=e.build("xhr",n);Br(t,a,n.data,i)}}function oc(){try{return window.Request&&"keepalive"in new Request("http://a")}catch{return!1}}function Br(t,e,r,n){var i=new XMLHttpRequest;i.open("POST",e,!0),Ze(t,i,"loadend",function(){n?.({status:i.status})},{once:!0}),i.send(r)}function Ur(){var t=ac();if(t)return{getAllowedWebViewHosts:function(){return JSON.parse(t.getAllowedWebViewHosts())},send:function(e,r){t.send(JSON.stringify({eventType:e,event:r}))}}}function Kt(t){var e;t===void 0&&(t=(e=fe().location)===null||e===void 0?void 0:e.hostname);var r=Ur();return!!r&&r.getAllowedWebViewHosts().some(function(n){return t===n||Qa(t,".".concat(n))})}function ac(){return fe().DatadogEventBridge}var xt={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function sc(t){var e=new G(function(){var r=Xn(gt.PAGEHIDE),n=Pr(t,window,["visibilitychange","freeze","pagehide"],function(o){o.type==="pagehide"&&r?e.notify({reason:xt.PAGEHIDE}):o.type==="visibilitychange"&&document.visibilityState==="hidden"?e.notify({reason:xt.HIDDEN}):o.type==="freeze"&&e.notify({reason:xt.FROZEN})},{capture:!0}).stop,i=_t;return r||(i=Ze(t,window,"beforeunload",function(){e.notify({reason:xt.UNLOADING})}).stop),function(){n(),i()}});return e}function uc(t){return Ke(We(xt),t)}var cc=(function(){function t(e,r,n){var i=this;this.request=e,this.flushController=r,this.messageBytesLimit=n,this.pushOnlyBuffer=[],this.upsertBuffer={},this.flushSubscription=this.flushController.flushObservable.subscribe(function(o){return i.flush(o)})}return t.prototype.add=function(e){this.addOrUpdate(e)},t.prototype.upsert=function(e,r){this.addOrUpdate(e,r)},t.prototype.stop=function(){this.flushSubscription.unsubscribe()},t.prototype.flush=function(e){var r=this.pushOnlyBuffer.concat(We(this.upsertBuffer));this.pushOnlyBuffer=[],this.upsertBuffer={};var n={data:r.join(` 4`),bytesCount:e.bytesCount,flushReason:e.reason};uc(e.reason)?this.request.sendOnExit(n):this.request.send(n)},t.prototype.addOrUpdate=function(e,r){var n=this.process(e),i=n.processedMessage,o=n.messageBytesCount;if(o>=this.messageBytesLimit){U.warn("Discarded a message whose size was bigger than the maximum allowed size ".concat(this.messageBytesLimit,"KB."));return}this.hasMessageFor(r)&&this.remove(r),this.push(i,o,r)},t.prototype.process=function(e){var r=$e(e),n=Dt(r);return{processedMessage:r,messageBytesCount:n}},t.prototype.push=function(e,r,n){var i=this.flushController.messagesCount>0?1:0;this.flushController.notifyBeforeAddMessage(r+i),n!==void 0?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.flushController.notifyAfterAddMessage()},t.prototype.remove=function(e){var r=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=Dt(r),i=this.flushController.messagesCount>1?1:0;this.flushController.notifyAfterRemoveMessage(n+i)},t.prototype.hasMessageFor=function(e){return e!==void 0&&this.upsertBuffer[e]!==void 0},t})();function lc(t){var e=t.messagesLimit,r=t.bytesLimit,n=t.durationLimit,i=t.pageExitObservable,o=t.sessionExpireOb
4servable,s=i.subscribe(function(g){return f(g.reason)}),a=o.subscribe(function(){return f("session_expire")}),u=new G(function(){return function(){s.unsubscribe(),a.unsubscribe()}}),c=0,l=0;function f(g){if(l!==0){var v=l,y=c;l=0,c=0,p(),u.notify({reason:g,messagesCount:v,bytesCount:y})}}var d;function h(){d===void 0&&(d=wt(function(){f("duration_limit")},n))}function p(){oi(d),d=void 0}return{flushObservable:u,get messagesCount(){return l},notifyBeforeAddMessage:function(g){c+g>=r&&f("bytes_limit"),l+=1,c+=g,h()},notifyAfterAddMessage:function(){l>=e?f("messages_limit"):c>=r&&f("bytes_limit")},notifyAfterRemoveMessage:function(g){c-=g,l-=1,l===0&&p()}}}function Fi(t,e,r,n,i,o){var s=u(t,e.endpoint),a=r&&u(t,r.endpoint);function u(c,l){return new cc(tc(c,l,c.batchBytesLimit,n),lc({messagesLimit:c.batchMessagesLimit,bytesLimit:c.batchBytesLimit,durationLimit:c.flushTimeout,pageExitObservable:i,sessionExpireObservable:o}),c.messageBytesLimit)}return{flushObservable:s.flushController.flushObservable,add:function(c,l){l===void 0&&(l=!0),s.add(c),a&&l&&a.add(r.transformMessage?r.transformMessage(c):c)},upsert:function(c,l){s.upsert(c,l),a&&a.upsert(r.transformMessage?r.transformMessage(c):c,l)},stop:function(){s.stop(),a?.stop()}}}function fc(t){var e=new Set;return t.forEach(function(r){return e.add(r)}),ti(e)}var dc=(function(){function t(){this.callbacks={}}return t.prototype.notify=function(e,r){var n=this.callbacks[e];n&&n.forEach(function(i){return i(r)})},t.prototype.subscribe=function(e,r){var n=this;return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(r),{unsubscribe:function(){n.callbacks[e]=n.callbacks[e].filter(function(i){return r!==i})}}},t})();function hc(t,e,r){var n=0,i=!1;return{isLimitReached:function(){if(n===0&&wt(function(){n=0},be),n+=1,n<=e||i)return i=!1,!1;if(n===e+1){i=!0;try{r({message:"Reached max number of ".concat(t,"s by minute: ").concat(e),source:j.AGENT,startClocks:Ve()})}finally{i=!1}}return!0}}}var zr,qr=new WeakMap;function pc(t){return zr||(zr=vc(t)),zr}function vc(t){var e=new G(function(){var r=Xe(XMLHttpRequest.prototype,"open",{before:gc}).stop,n=Xe(XMLHttpRequest.prototype,"send",{before:function(){yc.call(this,t,e)}}).stop,i=Xe(XMLHttpRequest.prototype,"abort",{before:mc}).stop;return function(){r(),n(),i()}});return e}function gc(t,e){qr.set(this,{state:"open",method:t,url:zt(String(e))})}function yc(t,e){var r=this,n=qr.get(this);if(n){var i=n;i.state="start",i.startTime=bt(),i.startClocks=Ve(),i.isAborted=!1,i.xhr=this;var o=!1,s=Xe(this,"onreadystatechange",{before:function(){this.readyState===XMLHttpRequest.DONE&&a()}}).stop,a=function(){if(u(),s(),!o){o=!0;var c=n;c.state="complete",c.duration=Va(i.startClocks.timeStamp,ce()),c.status=r.status,e.notify(Xa(c))}},u=Ze(t,this,"loadend",a).stop;e.notify(i)}}function mc(){var t=qr.get(this);t&&(t.isAborted=!0)}var Gr;function bc(){return Gr||(Gr=wc()),Gr}function wc(){var t=new G(function(){if(window.fetch){var e=wi(window,"fetch",function(r){return function(n,i){var o,s=we(_c,null,[t,n,i]);return s?(o=r.call(this,s.input,s.init),we(Sc,null,[t,o,s])):o=r.call(this,n,i),o}}).stop;return e}});return t}function _c(t,e,r){var n=r&&r.method||e instanceof Request&&e.method||"GET",i=e instanceof Request?e.url:zt(String(e)),o=Ve(),s={state:"start",init:r,input:e,method:n,startClocks:o,url:i};return t.notify(s),s}function Sc(t,e,r){var n=function(i){var o=r;o.state="resolve","stack"in i||i instanceof Error?(o.status=0,o.isAborted=i instanceof DOMException&&i.code===DOMException.ABORT_ERR,o.error=i):"status"in i&&(o.response=i,o.responseType=i.type,o.status=i.status,o.isAborted=!1),t.notify(o)};e.then(P(n),P(n))}var Hr={};function Ec(t){var e=t.map(function(r){return Hr[r]||(Hr[r]=Oc(r)),Hr[r]});return si.apply(void 0,e)}function Oc(t){var e=new G(function(){var r=X[t];return X[t]=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];r.apply(console,n);var o=Su();we(function(){e.notify(Cc(n,t,o))})},function(){X[t]=r}});return e}function Cc(t,e,r){var n=t.map(function(a){return xc(a)}).join(" "),i,o;if(e===B.error){var s=$a(t,function(a){return a instanceof Error});i=s?Ee(oe(s)):void 0,o=Ei(s),n="console error: ".concat(n)}return{api:e,message:n,stack:i,handlingStack:r,fingerprint:o}}function xc(t){return typeof t=="string"?ae(t):t instanceof Error?Oi(oe(t)):$e(ae(t),void 0,2)}var Mc=500,kc=(function(){function t(){this.buffer=[]}return t.prototype.add=function(e){var r=this.buffer.push(e);r>Mc&&this.buffer.splice(0,1)},t.prototype.drain=function(){this.buffer.forEach(function(e){return e()}),this.buffer.length=0},t})(),et,Bi=3*le,Tc=(et={},et[0]="feature flag evaluation",et[1]="user",et[2]="global context",et[3]="logger context",et);function Lc(t,e){return t>Bi?(U.warn("The ".concat(Tc[e]," data exceeds the recommended ").concat(Bi/le,"KiB threshold. More details: https://docs.datadoghq.com/real_user_monitoring/browser/troubleshooting/#customer-data-exceeds-the-recommended-3kib-warning")),!0):!1}var Ac=200;function Wt(t,e){e===void 0&&(e=Dt);var r={},n,i=!1,o=new G,s=ui(function(u){n=e($e(u)),i||(i=Lc(n,t))},Ac).throttled,a={getBytesCount:function(){return n},get:function(){return r},add:function(u,c){r[u]=c,s(r),o.notify()},remove:function(u){delete r[u],s(r),o.notify()},set:function(u){r=u,s(r),o.notify()},getContext:function(){return Dr(r)},setContext:function(u){Rr(u)==="object"?(r=ae(u),s(r)):a.clearContext(),o.notify()},setContextProperty:function(u,c){r[u]=ae(c),s(r),o.notify()},removeContextProperty:function(u){delete r[u],s(r),o.notify()},clearContext:function(){r={},n=0,o.notify()},changeObservable:o};return a}var Ic="_dd_c",Pc=[];function Ui(t,e,r,n){n===void 0&&(n=Dt);var i=Rc(e,r),o=Wt(r,n);return s(),Pc.push(Ze(t,window,"storage",function(u){var c=u.key;i===c&&s()})),o.changeObservable.subscribe(a),o;function s(){var u=localStorage.getItem(i),c=u!==null?JSON.parse(u):{};o.setContext(c)}function a(){localStorage.setItem(i,JSON.stringify(o.getContext()))}}function Rc(t,e){return"".concat(Ic,"_").concat(t,"_").concat(e)}function Dc(t,e,r){var n=t.getReader(),i=[],o=0;s();function s(){n.read().then(P(function(u){if(u.done){a();return}i.push(u.value),o+=u.value.length,o>r.bytesLimit?a():s()}),P(function(u){return e(u)}))}
4function a(){n.cancel().catch(_t);var u,c;{var l;if(i.length===1)l=i[0];else{l=new Uint8Array(o);var f=0;i.forEach(function(d){l.set(d,f),f+=d.length})}u=l.slice(0,r.bytesLimit),c=l.length>r.bytesLimit}e(void 0,u,c)}}var Nc="datadog-synthetics-public-id",jc="datadog-synthetics-result-id",Fc="datadog-synthetics-injects-rum";function zi(){return!!(window._DATADOG_SYNTHETICS_INJECTS_RUM||Z(Fc))}function Bc(){var t=window._DATADOG_SYNTHETICS_PUBLIC_ID||Z(Nc);return typeof t=="string"?t:void 0}function Uc(){var t=window._DATADOG_SYNTHETICS_RESULT_ID||Z(jc);return typeof t=="string"?t:void 0}function qi(t){var e=q({},t),r=["id","name","email"];return r.forEach(function(n){n in e&&(e[n]=String(e[n]))}),e}function zc(t){var e=Rr(t)==="object";return e||U.error("Unsupported user:",t),e}var qc=32*le;function Gc(t){var e=Ys(t),r=Gi(t.forwardConsoleLogs,We(B),"Forward Console Logs"),n=Gi(t.forwardReports,We(de),"Forward Reports");if(!(!e||!r||!n))return t.forwardErrorsToLogs&&!Ke(r,B.error)&&r.push(B.error),q({forwardErrorsToLogs:t.forwardErrorsToLogs!==!1,forwardConsoleLogs:r,forwardReports:n,requestErrorResponseLengthLimit:qc},e)}function Gi(t,e,r){if(t===void 0)return[];if(!(t==="all"||Array.isArray(t)&&t.every(function(n){return Ke(e,n)}))){U.error("".concat(r,' should be "all" or an array with allowed values "').concat(e.join('", "'),'"'));return}return t==="all"?e:fc(t)}function Hc(t){var e=Qs(t);return q({forward_errors_to_logs:t.forwardErrorsToLogs,forward_console_logs:t.forwardConsoleLogs,forward_reports:t.forwardReports},e)}var Vc=function(t,e,r,n){var i=arguments.length,o=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(o=(i<3?s(o):i>3?s(e,r,o):s(e,r))||o);return i>3&&o&&Object.defineProperty(e,r,o),o},R={debug:"debug",error:"error",info:"info",warn:"warn"},Vr={console:"console",http:"http"},Kc=Object.keys(R),Hi=(function(){function t(e,r,n,i,o){n===void 0&&(n=Vr.http),i===void 0&&(i=R.debug),o===void 0&&(o={}),this.handleLogStrategy=e,this.handlerType=n,this.level=i,this.contextManager=Wt(3),this.contextManager.set(q({},o,r?{logger:{name:r}}:void 0))}return t.prototype.log=function(e,r,n,i){n===void 0&&(n=R.info);var o;if(n===R.error&&(o={origin:j.LOGGER}),i!=null){var s=i instanceof Error?oe(i):void 0,a=Si({stackTrace:s,originalError:i,nonErrorPrefix:"Provided",source:j.LOGGER,handling:"handled",startClocks:Ve()});o={origin:j.LOGGER,stack:a.stack,kind:a.type,message:a.message}}var u=ae(r),c=o?Oe({error:o},u):u;this.handleLogStrategy({message:ae(e),context:c,status:n},this)},t.prototype.debug=function(e,r,n){this.log(e,r,R.debug,n)},t.prototype.info=function(e,r,n){this.log(e,r,R.info,n)},t.prototype.warn=function(e,r,n){this.log(e,r,R.warn,n)},t.prototype.error=function(e,r,n){this.log(e,r,R.error,n)},t.prototype.setContext=function(e){this.contextManager.set(e)},t.prototype.getContext=function(){return this.contextManager.get()},t.prototype.addContext=function(e,r){this.contextManager.add(e,r)},t.prototype.removeContext=function(e){this.contextManager.remove(e)},t.prototype.setHandler=function(e){this.handlerType=e},t.prototype.getHandler=function(){return this.handlerType},t.prototype.setLevel=function(e){this.level=e},t.prototype.getLevel=function(){return this.level},Vc([ns],t.prototype,"log",null),t})(),Vi="logs";function Wc(t){var e=!1,r=Wt(2),n=Wt(1),i={},o=function(){},s=new kc,a=function(h,p,g,v){g===void 0&&(g=Dr(l())),v===void 0&&(v=ce()),s.add(function(){return a(h,p,g,v)})},u=function(){},c=new Hi(function(){for(var h=[],p=0;p<arguments.length;p++)h[p]=arguments[p];return a.apply(void 0,h)});function l(){return{view:{referrer:document.referrer,url:window.location.href},context:r.getContext(),user:n.getContext()}}return Cu({logger:c,init:P(function(h){var p;if(!h){U.error("Missing configuration");return}if(u=function(){return Dr(h)},Kt()&&(h=f(h)),!!d(h)){var g=Gc(h);if(g){if(h.storeContextsAcrossPages){var v=r.getContext();r=Ui(g,Vi,2),r.setContext(Oe(r.getContext(),v));var y=n.getContext();n=Ui(g,Vi,1),n.setContext(Oe(n.getContext(),y))}p=t(h,g,l,c),a=p.handleLog,o=p.getInternalContext,s.drain(),e=!0}}}),getLoggerGlobalContext:P(function(){return r.get()}),getGlobalContext:P(function(){return r.getContext()}),setLoggerGlobalContext:P(function(h){return r.set(h)}),setGlobalContext:P(function(h){return r.setContext(h)}),addLoggerGlobalContext:P(function(h,p){return r.add(h,p)}),setGlobalContextProperty:P(function(h,p){return r.setContextProperty(h,p)}),removeLoggerGlobalContext:P(function(h){return r.remove(h)}),removeGlobalContextProperty:P(function(h){return r.removeContextProperty(h)}),clearGlobalContext:P(function(){return r.clearContext()}),createLogger:P(function(h,p){return p===void 0&&(p={}),i[h]=new Hi(function(){for(var g=[],v=0;v<arguments.length;v++)g[v]=arguments[v];return a.apply(void 0,g)},ae(h),p.handler,p.level,ae(p.context)),i[h]}),getLogger:P(function(h){return i[h]}),getInitConfiguration:P(function(){return u()}),getInternalContext:P(function(h){return o(h)}),setUser:P(function(h){zc(h)&&n.setContext(qi(h))}),getUser:P(function(){return n.getContext()}),setUserProperty:P(function(h,p){var g,v=qi((g={},g[h]=p,g))[h];n.setContextProperty(h,v)}),removeUserProperty:P(function(h){return n.removeContextProperty(h)}),clearUser:P(function(){return n.clearContext()})});function f(h){return q({},h,{clientToken:"empty"})}function d(h){return e?(h.silentMultipleInit||U.error("DD_LOGS is already initialized."),!1):!0}}var Jc="logs";function $c(t){var e=Vu(t,Jc,function(r){return Qc(t,r)});return{findTrackedSession:function(r){var n=e.findActiveSession(r);return n&&n.trackingType==="1"?{id:n.id}:void 0},expireObservable:e.expireObservable}}function Yc(t){var e=Ki(t)==="1",r=e?{}:void 0;return{findTrackedSession:function(){return r},expireObservable:new G}}function Ki(t){return _r(t.sessionSampleRate)?"1":"0"}function Qc(t,e){var r=Xc(e)?e:Ki(t);return{trackingType:r,isTracked:r==="1"}}function Xc(t){return t==="0"||t==="1"}var tt,Wi=(tt={},tt[R.debug]=0,tt[R.info]=1,tt[R.warn]=2,tt[R.error]=3,tt);function Zc(t){function e(r,n,i,o){var s=r.context;Ji(r.status,Vr.console,n)&&el(r,Oe(n.getContext(),s)),t.notify(0,{rawLogsEvent:{date:o||ce(),message:r.message,status:r.status,origin:j.LOGGER},messageContext:s,savedCommonContext:i,logger:n})}return{handleLog:e}}function Ji(t,e,r){var n=r.getHandler(),i=Array.isArray(n)?n:[n];return Wi[t]>=Wi[r.getLevel()]&&Ke(i,e)}function el(t,e){me[t.status].call(X,t.message,e)}function tl(t,e,r,n,i,o){var s=Kc.concat(["custom"]),a={};
4s.forEach(function(u){a[u]=hc(u,e.eventRateLimiterThreshold,o)}),r.subscribe(0,function(u){var c,l,f,d=u.rawLogsEvent,h=u.messageContext,p=h===void 0?void 0:h,g=u.savedCommonContext,v=g===void 0?void 0:g,y=u.logger,m=y===void 0?i:y,S=Wa(d.date),_=t.findTrackedSession(S);if(_){var b=v||n(),E=Oe({service:e.service,session_id:_.id,usr:ni(b.user)?void 0:b.user,view:b.view},b.context,Jt(S),d,m.getContext(),p);!Ji(d.status,Vr.http,m)||((c=e.beforeSend)===null||c===void 0?void 0:c.call(e,E))===!1||((l=E.error)===null||l===void 0?void 0:l.origin)!==j.AGENT&&((f=a[E.status])!==null&&f!==void 0?f:a.custom).isLimitReached()||r.notify(1,E)}})}var $i=!1;function Jt(t){var e=window;if(zi()){var r=n(e.DD_RUM_SYNTHETICS);return!r&&!$i&&($i=!0,Mi("Logs sent before RUM is injected by the synthetics worker",{testId:Bc(),resultId:Uc()})),r}return n(e.DD_RUM);function n(i){if(i&&i.getInternalContext)return i.getInternalContext(t)}}var Ce,rl=(Ce={},Ce[B.log]=R.info,Ce[B.debug]=R.debug,Ce[B.info]=R.info,Ce[B.warn]=R.warn,Ce[B.error]=R.error,Ce);function nl(t,e){var r=Ec(t.forwardConsoleLogs).subscribe(function(n){e.notify(0,{rawLogsEvent:{date:ce(),message:n.message,origin:j.CONSOLE,error:n.api===B.error?{origin:j.CONSOLE,stack:n.stack,fingerprint:n.fingerprint}:void 0,status:rl[n.api]}})});return{stop:function(){r.unsubscribe()}}}var Mt,il=(Mt={},Mt[de.cspViolation]=R.error,Mt[de.intervention]=R.error,Mt[de.deprecation]=R.warn,Mt);function ol(t,e){var r=Mu(t,t.forwardReports).subscribe(function(n){var i=n.message,o=il[n.type],s;o===R.error?s={kind:n.subtype,origin:j.REPORT,stack:n.stack}:n.stack&&(i+=" Found in ".concat(_u(n.stack))),e.notify(0,{rawLogsEvent:{date:ce(),message:i,origin:j.REPORT,error:s,status:o}})});return{stop:function(){r.unsubscribe()}}}function al(t,e){if(!t.forwardErrorsToLogs)return{stop:_t};var r=pc(t).subscribe(function(o){o.state==="complete"&&i("xhr",o)}),n=bc().subscribe(function(o){o.state==="resolve"&&i("fetch",o)});function i(o,s){!t.isIntakeUrl(s.url)&&(ll(s)||Ti(s.status))&&("xhr"in s?sl(s.xhr,t,a):s.response?cl(s.response,t,a):s.error&&ul(s.error,t,a));function a(u){e.notify(0,{rawLogsEvent:{message:"".concat(fl(o)," error ").concat(s.method," ").concat(s.url),date:s.startClocks.timeStamp,error:{origin:j.NETWORK,stack:u||"Failed to load"},http:{method:s.method,status_code:s.status,url:s.url},status:R.error,origin:j.NETWORK}})}}return{stop:function(){r.unsubscribe(),n.unsubscribe()}}}function sl(t,e,r){typeof t.response=="string"?r(Kr(t.response,e)):r(t.response)}function ul(t,e,r){r(Kr(Ee(oe(t)),e))}function cl(t,e,r){var n=Ju(t);!n||!n.body?r():window.TextDecoder?dl(n.body,e.requestErrorResponseLengthLimit,function(i,o){r(i?"Unable to retrieve response: ".concat(i):o)}):n.text().then(P(function(i){return r(Kr(i,e))}),P(function(i){return r("Unable to retrieve response: ".concat(i))}))}function ll(t){return t.status===0&&t.responseType!=="opaque"}function Kr(t,e){return t.length>e.requestErrorResponseLengthLimit?"".concat(t.substring(0,e.requestErrorResponseLengthLimit),"..."):t}function fl(t){return t==="xhr"?"XHR":"Fetch"}function dl(t,e,r){Dc(t,function(n,i,o){if(n)r(n);else{var s=new TextDecoder().decode(i);o&&(s+="..."),r(void 0,s)}},{bytesLimit:e})}function hl(t,e){if(!t.forwardErrorsToLogs)return{stop:_t};var r=new G,n=Ou(r).stop,i=r.subscribe(function(o){e.notify(0,{rawLogsEvent:{message:o.message,date:o.startClocks.timeStamp,error:{kind:o.type,origin:j.SOURCE,stack:o.stack},origin:j.SOURCE,status:R.error}})});return{stop:function(){n(),i.unsubscribe()}}}var pl=dc;function vl(t,e,r,n,i){var o=Fi(t,{endpoint:t.logsEndpointBuilder},t.replica&&{endpoint:t.replica.logsEndpointBuilder},r,n,i);return e.subscribe(1,function(s){o.add(s)}),o}function gl(t){var e=Ur();t.subscribe(1,function(r){e.send("log",r)})}function yl(t){return{get:function(e){var r=t.findTrackedSession(e);if(r)return{session_id:r.id}}}}function ml(t,e,r,n){var i=new pl,o=[];i.subscribe(1,function(g){return xi("logs",g)});var s=function(g){i.notify(0,{rawLogsEvent:{message:g.message,date:g.startClocks.timeStamp,error:{origin:j.AGENT},origin:j.AGENT,status:R.error}}),Mi("Error reported to customer",{"error.message":g.message})},a=sc(e),u=e.sessionStoreStrategyType&&!Kt()&&!zi()?$c(e):Yc(e),c=bl(e,s,a,u.expireObservable),l=c.telemetry,f=c.stop;o.push(function(){return f()}),l.setContextProvider(function(){var g,v,y,m,S,_;return{application:{id:(g=Jt())===null||g===void 0?void 0:g.application_id},session:{id:(v=u.findTrackedSession())===null||v===void 0?void 0:v.id},view:{id:(m=(y=Jt())===null||y===void 0?void 0:y.view)===null||m===void 0?void 0:m.id},action:{id:(_=(S=Jt())===null||S===void 0?void 0:S.user_action)===null||_===void 0?void 0:_.id}}}),al(e,i),hl(e,i),nl(e,i),ol(e,i);var d=Zc(i).handleLog;if(tl(u,e,i,r,n,s),Kt())gl(i);else{var h=vl(e,i,s,a,u.expireObservable).stop;o.push(function(){return h()})}Fu(Hc(t));var p=yl(u);return{handleLog:d,getInternalContext:p.get,stop:function(){o.forEach(function(g){return g()})}}}function bl(t,e,r,n){var i=Du("browser-logs-sdk",t),o=[];if(Kt()){var s=Ur(),a=i.observable.subscribe(function(l){return s.send("internal_telemetry",l)});o.push(function(){return a.unsubscribe()})}else{var u=Fi(t,{endpoint:t.rumEndpointBuilder},t.replica&&{endpoint:t.replica.rumEndpointBuilder},e,r,n);o.push(function(){return u.stop()});var c=i.observable.subscribe(function(l){return u.add(l,ju(t))});o.push(function(){return c.unsubscribe()})}return{telemetry:i,stop:function(){o.forEach(function(l){return l()})}}}var wl=Wc(ml);xu(fe(),"DD_LOGS",wl);
4let L=(function(t){return t.info="info",t.warn="warn",t.error="error",t.debug="debug",t.trace="trace",t.fatal="fatal",t})({});const $t={[L.trace]:10,[L.debug]:20,[L.info]:30,[L.warn]:40,[L.error]:50,[L.fatal]:60};L.trace,L.debug,L.info,L.warn,L.error,L.fatal;var _l=class{id;logger;enabled;consoleDebug;level;constructor(t){this.id=t.id??Date.now().toString()+Math.random().toString(),this.logger=t.logger,this.enabled=t.enabled??!0,this.consoleDebug=t.consoleDebug??!1,this.level=t.level??"trace"}_sendToLogger(t){if(!this.enabled||$t[t.logLevel]<$t[this.level])return;const e=this.shipToLogger(t);if(this.consoleDebug)switch(t.logLevel){case L.info:console.info(...e);break;case L.warn:console.warn(...e);break;case L.error:console.error(...e);break;case L.trace:console.debug(...e);break;case L.debug:console.debug(...e);break;case L.fatal:console.debug(...e);break;default:console.log(...e)}}getLoggerInstance(){return this.logger}},Sl=class extends _l{shipToLogger({logLevel:t,messages:e,data:r,hasData:n}){const i=[];switch(i.push(e.join(" ")),r&&n&&i.push(r),t){case L.info:this.logger.info(...i);break;case L.warn:this.logger.warn(...i);break;case L.error:this.logger.error(...i);break;case L.trace:this.logger.debug(...i);break;case L.debug:this.logger.debug(...i);break;case L.fatal:this.logger.error(...i);break}return i}};let W=(function(t){return t.onBeforeDataOut="onBeforeDataOut",t.shouldSe
4ndToLogger="shouldSendToLogger",t.onMetadataCalled="onMetadataCalled",t.onBeforeMessageOut="onBeforeMessageOut",t.onContextCalled="onContextCalled",t})({});var El=class Fa{context={};hasContext=!1;setContext(e){if(!e){this.context={},this.hasContext=!1;return}this.context=e,this.hasContext=!0}appendContext(e){this.context={...this.context,...e},this.hasContext=!0}getContext(){return this.context}hasContextData(){return this.hasContext}onChildLoggerCreated({parentContextManager:e,childContextManager:r}){if(e.hasContextData()){const n=e.getContext();r.setContext({...n})}}clone(){const e=new Fa;return e.setContext({...this.context}),e.hasContext=this.hasContext,e}},Yi=class{err;metadata;structuredLogger;hasMetadata;pluginManager;constructor(t){this.err=null,this.metadata={},this.structuredLogger=t,this.hasMetadata=!1,this.pluginManager=t.pluginManager}withMetadata(t){const{pluginManager:e,structuredLogger:{_config:{consoleDebug:r}}}=this;if(!t)return r&&console.debug("[LogLayer] withMetadata was called with no metadata; dropping."),this;let n=t;return e.hasPlugins(W.onMetadataCalled)&&(n=e.runOnMetadataCalled(t,this.structuredLogger),!n)?(r&&console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value."),this):(this.metadata={...this.metadata,...n},this.hasMetadata=!0,this)}withError(t){return this.err=t,this}info(...t){this.structuredLogger.isLevelEnabled(L.info)&&(this.structuredLogger._formatMessage(t),this.formatLog(L.info,t))}warn(...t){this.structuredLogger.isLevelEnabled(L.warn)&&(this.structuredLogger._formatMessage(t),this.formatLog(L.warn,t))}error(...t){this.structuredLogger.isLevelEnabled(L.error)&&(this.structuredLogger._formatMessage(t),this.formatLog(L.error,t))}debug(...t){this.structuredLogger.isLevelEnabled(L.debug)&&(this.structuredLogger._formatMessage(t),this.formatLog(L.debug,t))}trace(...t){this.structuredLogger.isLevelEnabled(L.trace)&&(this.structuredLogger._formatMessage(t),this.formatLog(L.trace,t))}fatal(...t){this.structuredLogger.isLevelEnabled(L.fatal)&&(this.structuredLogger._formatMessage(t),this.formatLog(L.fatal,t))}disableLogging(){return this.structuredLogger.disableLogging(),this}enableLogging(){return this.structuredLogger.enableLogging(),this}formatLog(t,e){const{muteMetadata:r}=this.structuredLogger._config,n=r?!1:this.hasMetadata;this.structuredLogger._formatLog({logLevel:t,params:e,metadata:n?this.metadata:null,err:this.err})}};const Ol=[W.onBeforeDataOut,W.onMetadataCalled,W.shouldSendToLogger,W.onBeforeMessageOut,W.onContextCalled];var Qi=class{idToPlugin;onBeforeDataOut=[];shouldSendToLogger=[];onMetadataCalled=[];onBeforeMessageOut=[];onContextCalled=[];constructor(t){this.idToPlugin={},this.mapPlugins(t),this.indexPlugins()}mapPlugins(t){for(const e of t){if(e.id||(e.id=Date.now().toString()+Math.random().toString()),this.idToPlugin[e.id])throw new Error(`[LogLayer] Plugin with id ${e.id} already exists.`);e.registeredAt=Date.now(),this.idToPlugin[e.id]=e}}indexPlugins(){this.onBeforeDataOut=[],this.shouldSendToLogger=[],this.onMetadataCalled=[],this.onBeforeMessageOut=[],this.onContextCalled=[];const t=Object.values(this.idToPlugin).sort((e,r)=>e.registeredAt-r.registeredAt);for(const e of t){if(e.disabled)return;for(const r of Ol)e[r]&&e.id&&this[r].push(e.id)}}hasPlugins(t){return this[t].length>0}countPlugins(t){return t?this[t].length:Object.keys(this.idToPlugin).length}addPlugins(t){this.mapPlugins(t),this.indexPlugins()}enablePlugin(t){const e=this.idToPlugin[t];e&&(e.disabled=!1),this.indexPlugins()}disablePlugin(t){const e=this.idToPlugin[t];e&&(e.disabled=!0),this.indexPlugins()}removePlugin(t){delete this.idToPlugin[t],this.indexPlugins()}runOnBeforeDataOut(t,e){const r={...t};for(const n of this.onBeforeDataOut){const i=this.idToPlugin[n];if(i.onBeforeDataOut){const o=i.onBeforeDataOut({data:r.data,logLevel:r.logLevel,error:r.error,metadata:r.metadata,context:r.context},e);o&&(r.data||(r.data={}),Object.assign(r.data,o))}}return r.data}runShouldSendToLogger(t,e){return!this.shouldSendToLogger.some(r=>!this.idToPlugin[r].shouldSendToLogger?.(t,e))}runOnMetadataCalled(t,e){let r={...t};for(const n of this.onMetadataCalled){const i=this.idToPlugin[n].onMetadataCalled?.(r,e);if(i)r=i;else return null}return r}runOnBeforeMessageOut(t,e){let r=[...t.messages];for(const n of this.onBeforeMessageOut){const i=this.idToPlugin[n].onBeforeMessageOut?.({messages:r,logLevel:t.logLevel},e);i&&(r=i)}return r}runOnContextCalled(t,e){let r={...t};for(const n of this.onContextCalled){const i=this.idToPlugin[n].onContextCalled?.(r,e);if(i)r=i;else return null}return r}},Cl=class Ba{pluginManager;idToTransport;
4hasMultipleTransports;singleTransport;contextManager;logLevelEnabledStatus={info:!0,warn:!0,error:!0,debug:!0,trace:!0,fatal:!0};_config;constructor(e){this._config={...e,enabled:e.enabled??!0},this._config.enabled||this.disableLogging(),this.contextManager=new El,this.pluginManager=new Qi(e.plugins||[]),this._config.errorFieldName||(this._config.errorFieldName="err"),this._config.copyMsgOnOnlyError||(this._config.copyMsgOnOnlyError=!1),this._initializeTransports(this._config.transport)}withContextManager(e){return this.contextManager&&typeof this.contextManager[Symbol.dispose]=="function"&&this.contextManager[Symbol.dispose](),this.contextManager=e,this}getContextManager(){return this.contextManager}_initializeTransports(e){if(this.idToTransport)for(const r in this.idToTransport)this.idToTransport[r]&&typeof this.idToTransport[r][Symbol.dispose]=="function"&&this.idToTransport[r][Symbol.dispose]();this.hasMultipleTransports=Array.isArray(e)&&e.length>1,this.singleTransport=this.hasMultipleTransports?null:Array.isArray(e)?e[0]:e,Array.isArray(e)?this.idToTransport=e.reduce((r,n)=>(r[n.id]=n,r),{}):this.idToTransport={[e.id]:e}}withPrefix(e){const r=this.child();return r._config.prefix=e,r}withContext(e){let r=e;return e?this.pluginManager.hasPlugins(W.onContextCalled)&&(r=this.pluginManager.runOnContextCalled(e,this),!r)?(this._config.consoleDebug&&console.debug("[LogLayer] Context was dropped due to plugin returning falsy value."),this):(this.contextManager.appendContext(r),this):(this._config.consoleDebug&&console.debug("[LogLayer] withContext was called with no context; dropping."),this)}clearContext(){return this.contextManager.setContext(void 0),this}getContext(){return this.contextManager.getContext()}addPlugins(e){this.pluginManager.addPlugins(e)}enablePlugin(e){this.pluginManager.enablePlugin(e)}disablePlugin(e){this.pluginManager.disablePlugin(e)}removePlugin(e){this.pluginManager.removePlugin(e)}withMetadata(e){return new Yi(this).withMetadata(e)}withError(e){return new Yi(this).withError(e)}child(){const e=new Ba({...this._config,transport:Array.isArray(this._config.transport)?[...this._config.transport]:this._config.transport}).withPluginManager(this.pluginManager).withContextManager(this.contextManager.clone());return this.contextManager.onChildLoggerCreated({parentContextManager:this.contextManager,childContextManager:e.contextManager,parentLogger:this,childLogger:e}),e}withFreshTransports(e){return this._config.transport=e,this._initializeTransports(e),this}withFreshPlugins(e){return this._config.plugins=e,this.pluginManager=new Qi(e),this}withPluginManager(e){return this.pluginManager=e,this}errorOnly(e,r){const n=r?.logLevel||L.error;if(!this.isLevelEnabled(n))return;const{copyMsgOnOnlyError:i}=this._config,o={logLevel:n,err:e};(i&&r?.copyMsg!==!1||r?.copyMsg===!0)&&e?.message&&(o.params=[e.message]),this._formatLog(o)}metadataOnly(e,r=L.info){if(!this.isLevelEnabled(r))return;const{muteMetadata:n,consoleDebug:i}=this._config;if(n)return;if(!e){i&&console.debug("[LogLayer] metadataOnly was called with no metadata; dropping.");return}let o=e;if(this.pluginManager.hasPlugins(W.onMetadataCalled)&&(o=this.pluginManager.runOnMetadataCalled(e,this),!o)){i&&console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value.");return}const s={logLevel:r,metadata:o};this._formatLog(s)}info(...e){this.isLevelEnabled(L.info)&&(this._formatMessage(e),this._formatLog({logLevel:L.info,params:e}))}warn(...e){this.isLevelEnabled(L.warn)&&(this._formatMessage(e),this._formatLog({logLevel:L.warn,params:e}))}error(...e){this.isLevelEnabled(L.error)&&(this._formatMessage(e),this._formatLog({logLevel:L.error,params:e}))}debug(...e){this.isLevelEnabled(L.debug)&&(this._formatMessage(e),this._formatLog({logLevel:L.debug,params:e}))}trace(...e){this.isLevelEnabled(L.trace)&&(this._formatMessage(e),this._formatLog({logLevel:L.trace,params:e}))}fatal(...e){this.isLevelEnabled(L.fatal)&&(this._formatMessage(e),this._formatLog({logLevel:L.fatal,params:e}))}raw(e){if(!this.isLevelEnabled(e.logLevel))return;const r={logLevel:e.logLevel,params:e.messages,metadata:e.metadata,err:e.error,context:e.context};this._formatMessage(e.messages),this._formatLog(r)}disableLogging(){for(const e of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[e]=!1;return this}enableLogging(){for(const e of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[e]=!0;return this}muteContext(){return this._config.muteContext=!0,this}unMuteContext(){return this._config.muteContext=!1,this}muteMetadata(){return this._config.muteMetadata=!0,this}unMuteMetadata(){return this._config.muteMetadata=!1,this}enableIndividualLevel(e){const r=e;return r in this.logLevelEnabledStatus&&(this.logLevelEnabledStatus[r]=!0),this}disableIndividualLevel(e){const r=e;return r in this.logLevelEnabledStatus&&(this.logLevelEnabledStatus[r]=!1),this}setLevel(e){const r=$t[e];for(const n of Object.values(L)){const i=n,o=$t[n];this.logLevelEnabledStatus[i]=o>=r}return this}isLevelEnabled(e){const r=e;return this.logLevelEnabledStatus[r]}formatContext(e){const{contextFieldName:r,muteContext:n}=this._config;return e&&Object.keys(e).length>0&&!n?r?{[r]:{...e}}:{...e}:{}}formatMetadata(e=null){const{metadataFieldName:r,muteMetadata:n}=this._config;return e&&!n?r?{[r]:{...e}}:{...e}:{}}getLoggerInstance(e){const r=this.idToTransport[e];if(r)return r.getLoggerInstance()}_formatMessage(e=[]){const{prefix:r}=this._config;r&&typeof e[0]=="string"&&(e[0]=`${r} ${e[0]}`)}_formatLog({logLevel:e,params:r=[],metadata:n=null,err:i,context:o=null}){const{errorSerializer:s,errorFieldInMetadata:a,muteContext:u,contextFieldName:c,metadataFieldName:l,errorFieldName:f}=this._config,d=o!==null?o:this.contextManager.getContext();
4let h=!!n||(u?!1:o!==null?Object.keys(o).length>0:this.contextManager.hasContextData()),p={};if(h)if(c&&c===l){const g=this.formatContext(d)[c],v=this.formatMetadata(n)[l];p={[c]:{...g,...v}}}else p={...this.formatContext(d),...this.formatMetadata(n)};if(i){const g=s?s(i):i;a&&n&&l?p?.[l]?p[l][f]=g:p={...p,[l]:{[f]:g}}:a&&!n&&l?p={...p,[l]:{[f]:g}}:p={...p,[f]:g},h=!0}if(this.pluginManager.hasPlugins(W.onBeforeDataOut)&&(p=this.pluginManager.runOnBeforeDataOut({data:h?p:void 0,logLevel:e,error:i,metadata:n,context:d},this),p&&!h&&(h=!0)),this.pluginManager.hasPlugins(W.onBeforeMessageOut)&&(r=this.pluginManager.runOnBeforeMessageOut({messages:[...r],logLevel:e},this)),this.hasMultipleTransports){const g=this._config.transport.filter(v=>v.enabled).map(async v=>{if(!(this.pluginManager.hasPlugins(W.shouldSendToLogger)&&!this.pluginManager.runShouldSendToLogger({messages:[...r],data:h?p:void 0,logLevel:e,transportId:v.id,error:i,metadata:n,context:d},this)))return v._sendToLogger({logLevel:e,messages:[...r],data:h?p:void 0,hasData:h,error:i,metadata:n,context:d})});Promise.all(g).catch(v=>{this._config.consoleDebug&&console.error("[LogLayer] Error executing transports:",v)})}else{if(!this.singleTransport?.enabled||this.pluginManager.hasPlugins(W.shouldSendToLogger)&&!this.pluginManager.runShouldSendToLogger({messages:[...r],data:h?p:void 0,logLevel:e,transportId:this.singleTransport.id,error:i,metadata:n,context:d},this))return;this.singleTransport._sendToLogger({logLevel:e,messages:[...r],data:h?p:void 0,hasData:h,error:i,metadata:n,context:d})}}};const xl=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0},{property:"cause",enumerable:!1},{property:"errors",enumerable:!1}],Wr=new WeakSet,Ml=t=>{Wr.add(t);const e=t.toJSON();return Wr.delete(t),e},Xi=({from:t,seen:e,to:r,forceEnumerable:n,maxDepth:i,depth:o,useToJSON:s,serialize:a})=>{if(r||(Array.isArray(t)?r=[]:r={}),e.push(t),o>=i)return r;if(s&&typeof t.toJSON=="function"&&!Wr.has(t))return Ml(t);const u=c=>Xi({from:c,seen:[...e],forceEnumerable:n,maxDepth:i,depth:o,useToJSON:s,serialize:a});for(const[c,l]of Object.entries(t)){if(l&&l instanceof Uint8Array&&l.constructor.name==="Buffer"){r[c]="[object Buffer]";continue}if(l!==null&&typeof l=="object"&&typeof l.pipe=="function"){r[c]="[object Stream]";continue}if(typeof l!="function"){if(!l||typeof l!="object"){try{r[c]=l}catch{}continue}if(!e.includes(t[c])){o++,r[c]=u(t[c]);continue}r[c]="[Circular]"}}for(const{property:c,enumerable:l}of xl)t[c]!==void 0&&t[c]!==null&&Object.defineProperty(r,c,{value:Tl(t[c])||Array.isArray(t[c])?u(t[c]):t[c],enumerable:!0,configurable:!0,writable:!0});return r};function kl(t,e={}){const{maxDepth:r=Number.POSITIVE_INFINITY,useToJSON:n=!0}=e;return typeof t=="object"&&t!==null?Xi({from:t,seen:[],forceEnumerable:!0,maxDepth:r,depth:0,useToJSON:n,serialize:!0}):typeof t=="function"?`[Function: ${t.name||"anonymous"}]`:t}function Tl(t){return!!t&&typeof t=="object"&&typeof t.name=="string"&&typeof t.message=="string"&&typeof t.stack=="string"}function Zi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Jr,eo;function Ll(){if(eo)return Jr;eo=1;function t(){}return Jr=t,Jr}var Al=Ll();const kt=Zi(Al),to="onetrust-consent-manager";function ro(){if(typeof window<"u"){const t=window.location.hostname;return t.includes("staging")||t.includes("stg")||t.includes("dev")||t.includes("localhost")||t==="127.0.0.1"?"development":"production"}return"development"}function Il(){if(typeof window>"u")return!1;const t=window.DD_LOGS||window.datadogLogs;return!!t&&typeof t.createLogger=="function"}let Yt,no;const Pl=t=>{no=t},$r={log:kt,info:kt,warn:kt,error:kt,debug:kt},Rl={log:(...t)=>console.log(...t),info:(...t)=>console.info(...t),warn:(...t)=>console.warn(...t),error:(...t)=>console.error(...t),debug:(...t)=>console.debug(...t)},Dl=()=>{if(!Il())return ro()==="development"?Rl:$r;if(Yt)return Yt;const t=window.DD_LOGS||window.datadogLogs;return typeof t.createLogger=="function"?(Yt=t.createLogger(to),Yt):$r},Nl=["info","warn","error","debug","trace","fatal"],io=({data:t={},error:e,level:r="info",message:n,module:i})=>{const s=(c=>Nl.includes(c)?c:"info")(r),a=Dl();return a===$r?void 0:new Cl({errorSerializer:kl,transport:new Sl({logger:a})}).withError(e).withMetadata({...t,module:i,package:"onetrust-consent-manager",logger:to,application:no,environment:ro()})[s](n)},rt=t=>io({...t,module:"consent"}),xe=t=>io({...t,module:"analytics"}),oo=(t,e)=>{Pl(t)},Yr=["C0002","C0003","C0004","C0005"],ao=["C0001","C0002","C0003","C0004","C0005"];function jl(t){const e=t.trim().toLowerCase();return e==="always active"||e==="inactive landingpage"||e==="active"}function Fl(){const t=window.OneTrust?.GetDomainData?.()?.Groups??[],e=new Set;return t.forEach(r=>{const n=r.CustomGroupId||r.GroupId;n&&jl(r.Status??"")&&e.add(n)}),e}function Qr(){const t=window.OptanonActiveGroups||window.OnetrustActiveGroups||"",e=new Set(t.split(",").filter(
4Boolean));return(window.OneTrust?.IsAlertBoxClosed?.()??!1)||Fl().forEach(n=>{e.add(n)}),e}function Bl(){const t={};return window.OneTrustTCFv2?.tcString&&(t.tcfString=window.OneTrustTCFv2.tcString),window.__gpp&&window.__gpp("getGPPData",e=>{e&&(t.gpp=e.gppString,t.gppSid=e.applicableSections)}),!t.tcfString&&window.__tcfapi&&window.__tcfapi("getTCData",2,e=>{e?.tcString&&(t.tcfString=e.tcString)}),t}function Xr(t){const e={};return ao.forEach(r=>{e[r]=t.has(r)}),t.has("performance")&&(e.C0002=!0),t.has("functional")&&(e.C0003=!0),t.has("targeting")&&(e.C0004=!0),t.has("social")&&(e.C0005=!0),{categoryPreferences:e}}function Ul(){window.OneTrust?.ToggleInfoDisplay?.()}function zl(){if(typeof window>"u"||!window.OneTrust)return!1;try{return window.OneTrust.IsAlertBoxClosed?.()??!1}catch{return!1}}function so(t){if(!(typeof window>"u"||!window.OneTrust))try{const e=[];Object.entries(t.categoryPreferences).forEach(([n,i])=>{i&&e.push(n)});const r=e.join(",");window.OptanonActiveGroups=r,window.OnetrustActiveGroups=r,window.OneTrust.UpdateActiveGroups&&window.OneTrust.UpdateActiveGroups(r),window.OneTrust.SetAlertBoxClosed&&window.OneTrust.SetAlertBoxClosed(!0),window.OneTrust.TriggerGoogleAnalyticsEvent&&window.OneTrust.TriggerGoogleAnalyticsEvent(e)}catch(e){rt({level:"warn",message:"Failed to set OneTrust consent",error:e instanceof Error?e.message:e})}}function Zr(){return!!(window.OneTrust&&window.OneTrust.GetDomainData)}const nt={...{timeoutMs:1e4,retries:0,retryDelayMs:1e3}};function ql(t){t&&(typeof t.timeoutMs=="number"&&Number.isFinite(t.timeoutMs)&&t.timeoutMs>=0&&(nt.timeoutMs=t.timeoutMs),typeof t.retries=="number"&&Number.isFinite(t.retries)&&Number.isInteger(t.retries)&&t.retries>=0&&(nt.retries=t.retries),typeof t.retryDelayMs=="number"&&Number.isFinite(t.retryDelayMs)&&t.retryDelayMs>=0&&(nt.retryDelayMs=t.retryDelayMs))}function uo(t,e={}){const r=nt.timeoutMs,n=typeof e.retries=="number"&&Number.isFinite(e.retries)&&Number.isInteger(e.retries)&&e.retries>=0?e.retries:nt.retries,i=typeof e.retryDelayMs=="number"&&Number.isFinite(e.retryDelayMs)&&e.retryDelayMs>=0?e.retryDelayMs:nt.retryDelayMs,o=s=>new Promise((a,u)=>{if(Zr()){a();return}const c=Date.now();let l;const f=()=>{l!==void 0&&(clearInterval(l),l=void 0)};l=setInterval(()=>{Zr()?(f(),a()):Date.now()-c>r&&(f(),s>0?setTimeout(()=>{o(s-1).then(a).catch(u)},i):u(new Error("OneTrust failed to load within timeout")))},100)});return o(n)}const it={analytics:["Actions Amplitude","Amplitude","Hindsight","Statsig","Visual Tagger"],advertising:["Braze Cloud Mode (Actions)","Braze Web Mode (Actions)","Facebook Conversions API (Actions)","Google Tag Manager","Reddit Conversions Api","Tiktok Conversions","Facebook Pixel","Twitter Ads","LinkedIn Insight Tag","Pinterest Tag"],functional:["Webhooks"]};function co(){if(typeof document>"u")return null;try{const e=document.cookie.split(";").find(i=>i.trim().startsWith("tracking-preferences="));if(!e)return null;const r=e.split("=")[1];let n;try{n=r.replace(/%22/g,'"'),JSON.parse(n)}catch{n=decodeURIComponent(r)}return JSON.parse(n)}catch{return null}}function Gl(){if(typeof window>"u")return"";const t=window.location.hostname;if(t==="localhost"||t==="127.0.0.1")return"";if(t.includes("ouraring.com"))return"; domain=.ouraring.com";if(t.includes("ourastaging.com"))return"; domain=.ourastaging.com";const e=t.split(".");return e.length>=2?`; domain=.${e.slice(-2).join(".")}`:""}function Hl(t){if(!(typeof document>"u"))try{const r=JSON.stringify(t).replace(/"/g,"%22"),n=new Date;n.setFullYear(n.getFullYear()+1);const i=Gl();document.cookie=`tracking-preferences=${r}; expires=${n.toUTCString()}; path=/${i}; SameSite=Lax`}catch{}}function Vl(t){const e={};return[...it.analytics,...it.advertising,...it.functional].forEach(n=>{it.analytics.includes(n)?e[n]=t.categoryPreferences.C0003||!1:it.advertising.includes(n)?e[n]=t.categoryPreferences.C0004||!1:it.functional.includes(n)&&(e[n]=t.categoryPreferences.C0002||!1)}),e}function Kl(t){if(t)try{const r={version:1,destinations:{...co()?.destinations||{},...Vl(t)},custom:{functional:t.categoryPreferences.C0002||!1,marketing:t.categoryPreferences.C0003||!1,advertising:t.categoryPreferences.C0004||!1}};Hl(r)}catch{}}function Wl(){const t=co();if(!t?.custom)return null;try{return{categoryPreferences:{C0001:!0,C0002:t.custom.functional??!1,C0003:t.custom.marketing??!1,C0004:t.custom.advertising??!1,C0005:t.custom.advertising??!1}}}catch{return null}}const en={version:"2.3.0"}.version;class Jl{originalOverflow=null;modalShowHandler=null;modalHideHandler=null;keydownHandler=null;clickHandler=null;mutationObserver=null;isActive=!1;initialize(){this.isActive||typeof window>"u"||(this.isActive=!0,this.modalShowHandler=()=>this.handleModalShow(),this.modalHideHandler=()=>this.handleModalHide(),this.keydownHandler=e=>this.handleKeydown(e),this.clickHandler=e=>this.handleClick(e),window.addEventListener("OptanonOneTrustModalShow",this.modalShowHandler),window.addEventListener("OptanonOneTrustModalHide",this.modalHideHandler),document.addEventListener("keydown",this.keydownHandler),document.addEventListener("click",this.clickHandler),this.setupMutationObserver())}dispose(){!this.isActive||typeof window>"u"||(this.modalShowHandler&&(window.removeEventListener("OptanonOneTrustModalShow",this.modalShowHandler),this.modalShowHandler=null),this.modalHideHandler&&(window.removeEventListener("OptanonOneTrustModalHide",this.modalHideHandler),this.modalHideHandler=null),this.keydownHandler&&(document.removeEventListener("keydown",this.keydownHandler),this.keydownHandler=null),this.clickHandler&&(document.removeEventListener("click",this.clickHandler),this.clickHandler=null),this.mutationObserver&&(this.mutationObserver.disconnect(),this.mutationObserver=null),this.restoreBodyOverflow(),this.isActive=!1)}restoreBodyOverflow(){typeof document<"u"&&document.body&&this.originalOverflow!==null&&(document.body.style.overflow=this.originalOverflow,this.originalOverflow=null)}handleModalShow(){typeof document<"u"&&document.body&&this.originalOverflow===null&&(this.originalOverflow=document.body.style.overflow||"")}handleModalHide(){this.restoreBodyOverflow()}handleKeydown(e){e.key==="Escape"&&this.isModalVisible()&&setTimeout(()=>this.restoreBodyOverflow(),100)}handleClick(e){const r=e.target;r&&(r.matches("[data-close-modal]")||r.matches(".ot-close-icon")||r.matches('[aria-label*="Close"]')||r.closest(".ot-pc-overlay"))&&setTimeout(()=>{this.isModalVisible()||this.restoreBodyOverflow()},100)}setupMutationObserver(){typeof window>"u"||!window.MutationObserver||(this.mutationObserver=new MutationObserver(()=>{this.isModalVisible()||this.restoreBodyOverflow()}),this.mutationObserver.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["style","class"]}))}isModalVisible(){return typeof document>"u"?!1:['#onetrust-consent-sdk:not([style*="display: none"])','.ot-sdk-container:not([style*="display: none"])','[data-modal-visible="true"]'].some(r=>{const n=document.querySelector(r);return n&&getComputedStyle(n).display!=="none"})}}class lo{state={consent:null,iab:null,isReady:!1};callbacks=new Set;initialized=!1;updateConsentBound=null;debouncedNotifyCallbacks;enableSegmentCookieSync;bodyOverflowManager=null;constructor(e=!1){this.enableSegmentCookieSync=e;let r;this.debouncedNotifyCallbacks=()=>{r&&clearTimeout(r),r=setTimeout(()=>this.notifyCallbacks(),10)}}async initialize(){if(!this.initialized)try{this.initialized=!0;
4const e=this.enableSegmentCookieSync?Wl():null;e&&(this.state.consent=e,this.state.isReady=!0,typeof window<"u"&&window.OneTrust&&so(e),this.debouncedNotifyCallbacks()),await uo(),e&&so(e),this.updateConsent(),this.state.isReady=!0,this.updateConsentBound=this.updateConsent.bind(this),window.addEventListener("OneTrustGroupsUpdated",this.updateConsentBound),this.bodyOverflowManager=new Jl,this.bodyOverflowManager.initialize(),this.debouncedNotifyCallbacks()}catch(e){throw this.initialized=!1,rt({level:"error",message:"Failed to initialize consent manager",error:e}),e}}getState(){return{...this.state}}getConsent(){return this.state.consent?{...this.state.consent}:null}getIAB(){return this.state.iab?{...this.state.iab}:null}openConsentModal(){Ul()}subscribe(e){return this.callbacks.add(e),this.state.isReady&&e(this.getState()),()=>{this.callbacks.delete(e)}}isReady(){return this.state.isReady&&Zr()}getEnableSegmentCookieSync(){return this.enableSegmentCookieSync}updateConsent(){try{const e=Qr(),r=Xr(e),n=Bl(),i={...this.state,consent:r,iab:n};this.statesEqual(this.state,i)||(this.state=i,this.debouncedNotifyCallbacks())}catch(e){rt({level:"error",message:"Failed to update consent state",error:e})}}statesEqual(e,r){return JSON.stringify(e.consent)===JSON.stringify(r.consent)&&JSON.stringify(e.iab)===JSON.stringify(r.iab)&&e.isReady===r.isReady}notifyCallbacks(){const e=this.getState();try{e.consent&&zl()&&this.enableSegmentCookieSync&&Kl(e.consent),this.callbacks.forEach(r=>{try{r(e)}catch(n){rt({level:"error",message:"Error in consent callback",error:n})}})}catch(r){rt({level:"error",message:"Error in notifyCallbacks",error:r})}}dispose(){this.updateConsentBound&&(window.removeEventListener("OneTrustGroupsUpdated",this.updateConsentBound),this.updateConsentBound=null),this.bodyOverflowManager&&(this.bodyOverflowManager.dispose(),this.bodyOverflowManager=null),this.callbacks.clear(),this.initialized=!1,this.state.isReady=!1}}let Me=null;function $(t=!1){if(!Me)Me=new lo(t);else if(Me.getEnableSegmentCookieSync()!==t){const e=`OneTrust Consent Manager: Inconsistent enableSegmentCookieSync value. Manager was already created with enableSegmentCookieSync=${Me.getEnableSegmentCookieSync()}, but called with enableSegmentCookieSync=${t}. All calls within the same application must use the same value.`;throw rt({level:"error",message:"Inconsistent enableSegmentCookieSync configuration detected",data:{existingV
4alue:Me.getEnableSegmentCookieSync(),requestedValue:t,errorMessage:e}}),new Error(e)}return Me}typeof window<"u"&&(window.OneTrustConsentManager={getConsentManager:t=>$(t),OneTrustConsentManager:lo,initializeConsentManager:t=>tn(t),version:en,get instance(){return Me}});async function tn(t=!1){const e=$(t);return await e.initialize(),e}var rn=function(t,e){return rn=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},rn(t,e)};function H(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");rn(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var w=function(){return w=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},w.apply(this,arguments)};function fo(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function O(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(l){try{c(n.next(l))}catch(f){s(f)}}function u(l){try{c(n.throw(l))}catch(f){s(f)}}function c(l){l.done?o(l.value):i(l.value).then(a,u)}c((n=n.apply(t,e||[])).next())})}function C(t,e){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(l){return u([c,l])}}function u(c){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(n=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(l){c=[6,l],i=0}finally{n=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function D(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,o;n<i;n++)(o||!(n in e))&&(o||(o=Array.prototype.slice.call(e,0,n)),o[n]=e[n]);return t.concat(o||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;function nn(t,e,r){e.split&&(e=e.split("."));for(var n=0,i=e.length,o=t,s,a;n<i&&(a=""+e[n++],!(a==="__proto__"||a==="constructor"||a==="prototype"));)o=o[a]=n===i?r:typeof(s=o[a])==typeof e?s:e[n]*0!==0||~(""+e[n]).indexOf(".")?{}:[]}var $l=function(t,e){return Object.keys(t).filter(function(r){return e(r,t[r])}).reduce(function(r,n){return r[n]=t[n],r},{})},ke=(function(t){H(e,t);function e(r,n){var i=t.call(this,"".concat(r," ").concat(n))||this;return i.field=r,i}return e})(Error);function he(t){return typeof t=="string"}function on(t){return typeof t=="number"}function ot(t){return typeof t=="function"}function Yl(t){return t!=null}function V(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()==="object"}var an="is not a string",sn="is not an object",Ql="is nil";function Xl(t){if(!Yl(t))throw new ke("Event",Ql);if(typeof t!="object")throw new ke("Event",sn)}function Zl(t){if(!he(t.type))throw new ke(".type",an)}function ef(t){if(!he(t.event))throw new ke(".event",an)}function tf(t){if(!V(t.properties))throw new ke(".properties",sn)}function rf(t){if(!V(t.traits))throw new ke(".traits",sn)}function nf(t){if(!he(t.messageId))throw new ke(".messageId",an)}function of(t){Xl(t),Zl(t),nf(t),t.type==="track"&&(ef(t),tf(t)),["group","identify"].includes(t.type)&&rf(t)}var af=(function(){function t(e){var r,n;this.settings=e,this.createMessageId=e.createMessageId,this.onEventMethodCall=(r=e.onEventMethodCall)!==null&&r!==void 0?r:(function(){}),this.onFinishedEvent=(n=e.onFinishedEvent)!==null&&n!==void 0?n:(function(){})}return t})(),sf=(function(){function t(e){this.settings=new af(e)}return t.prototype.track=function(e,r,n,i){return this.settings.onEventMethodCall({type:"track",options:n}),this.normalize(w(w({},this.baseEvent()),{event:e,type:"track",properties:r??{},options:w({},n),integrations:w({},i)}))},t.prototype.page=function(e,r,n,i,o){var s;this.settings.onEventMethodCall({type:"page",options:i});var a={type:"page",properties:w({},n),options:w({},i),integrations:w({},o)};return e!==null&&(a.category=e,a.properties=(s=a.properties)!==null&&s!==void 0?s:{},a.properties.category=e),r!==null&&(a.name=r),this.normalize(w(w({},this.baseEvent()),a))},t.prototype.screen=function(e,r,n,i,o){this.settings.onEventMethodCall({type:"screen",options:i});var s={type:"screen",properties:w({},n),options:w({},i),integrations:w({},o)};return e!==null&&(s.category=e),r!==null&&(s.name=r),this.normalize(w(w({},this.baseEvent()),s))},t.prototype.identify=function(e,r,n,i){return this.settings.onEventMethodCall({type:"identify",options:n}),this.normalize(w(w({},this.baseEvent()),{type:"identify",userId:e,traits:r??{},options:w({},n),integrations:i}))},t.prototype.group=function(e,r,n,i){return this.settings.onEventMethodCall({type:"group",options:n}),this.normalize(w(w({},this.baseEvent()),{type:"group",traits:r??{},options:w({},n),integrations:w({},i),groupId:e}))},t.prototype.alias=function(e,r,n,i){this.settings.onEventMethodCall({type:"alias",options:n});var o={userId:e,type:"alias",options:w({},n),integrations:w({},i)};return r!==null&&(o.previousId=r),e===void 0?this.normalize(w(w({},o),this.baseEvent())):this.normalize(w(w({},this.baseEvent()),o))},t.prototype.baseEvent=function(){return{integrations:{},options:{}}},t.prototype.context=function(e){var r,n=["userId","anonymousId","timestamp","messageId"];delete e.integrations;var i=Object.keys(e),o=(r=e.context)!==null&&r!==void 0?r:{},s={};
vendor: 4,117 bytes, line 4
4return i.forEach(function(a){a!=="context"&&(n.includes(a)?nn(s,a,e[a]):nn(o,a,e[a]))}),[o,s]},t.prototype.normalize=function(e){var r,n,i=Object.keys((r=e.integrations)!==null&&r!==void 0?r:{}).reduce(function(d,h){var p,g;return w(w({},d),(p={},p[h]=!!(!((g=e.integrations)===null||g===void 0)&&g[h]),p))},{});e.options=$l(e.options||{},function(d,h){return h!==void 0});var o=w(w({},i),(n=e.options)===null||n===void 0?void 0:n.integrations),s=e.options?this.context(e.options):[],a=s[0],u=s[1],c=e.options,l=fo(e,["options"]),f=w(w(w(w({timestamp:new Date},l),{context:a,integrations:o}),u),{messageId:c.messageId||this.settings.createMessageId()});return this.settings.onFinishedEvent(f),of(f),f},t})();function un(t,e){return new Promise(function(r,n){var i=setTimeout(function(){n(Error("Promise timed out"))},e);t.then(function(o){return clearTimeout(i),r(o)}).catch(n)})}function uf(t){return new Promise(function(e){return setTimeout(e,t)})}function cf(t,e,r){var n=function(){try{return Promise.resolve(e(t))}catch(i){return Promise.reject(i)}};return uf(r).then(function(){return un(n(),1e3)}).catch(function(i){t?.log("warn","Callback Error",{error:i}),t?.stats.increment("callback_error")}).then(function(){return t})}var Qt=function(){var t,e,r=!1,n=new Promise(function(i,o){t=function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];r=!0,i.apply(void 0,s)},e=function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];r=!0,o.apply(void 0,s)}});return{resolve:t,reject:e,promise:n,isSettled:function(){return r}}},cn=(function(){function t(e){var r;this.callbacks={},this.warned=!1,this.maxListeners=(r=e?.maxListeners)!==null&&r!==void 0?r:10}return t.prototype.warnIfPossibleMemoryLeak=function(e){this.warned||this.maxListeners&&this.callbacks[e].length>this.maxListeners&&(console.warn("Event Emitter: Possible memory leak detected; ".concat(String(e)," has exceeded ").concat(this.maxListeners," listeners.")),this.warned=!0)},t.prototype.on=function(e,r){return this.callbacks[e]?(this.callbacks[e].push(r),this.warnIfPossibleMemoryLeak(e)):this.callbacks[e]=[r],this},t.prototype.once=function(e,r){var n=this,i=function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];n.off(e,i),r.apply(n,o)};return this.on(e,i),this},t.prototype.off=function(e,r){var n,i=(n=this.callbacks[e])!==null&&n!==void 0?n:[],o=i.filter(function(s){return s!==r});return this.callbacks[e]=o,this},t.prototype.emit=function(e){for(var r=this,n,i=[],o=1;o<arguments.length;o++)i[o-1]=arguments[o];var s=(n=this.callbacks[e])!==null&&n!==void 0?n:[];return s.forEach(function(a){a.apply(r,i)}),this},t})();function lf(t){var e=Math.random()+1,r=t.minTimeout,n=r===void 0?500:r,i=t.factor,o=i===void 0?2:i,s=t.attempt,a=t.maxTimeout,u=a===void 0?1/0:a;return Math.min(e*n*Math.pow(o,s),u)}for(var ho="onRemoveFromFuture",Xt=(function(t){H(e,t);function e(r,n,i){var o=t.call(this)||this;return o.future=[],o.maxAttempts=r,o.queue=n,o.seen=i??{},o}return e.prototype.push=function(){for(var r=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=n.map(function(s){var a=r.updateAttempts(s);return a>r.maxAttempts||r.includes(s)?!1:(r.queue.push(s),!0)});return this.queue=this.queue.sort(function(s,a){return r.getAttempts(s)-r.getAttempts(a)}),o},e.prototype.pushWithBackoff=function(r,n){var i=this;if(n===void 0&&(n=0),n==0&&this.getAttempts(r)===0)return this.push(r)[0];var o=this.updateAttempts(r);if(o>this.maxAttempts||this.includes(r))return!1;var s=lf({attempt:o-1});return n>0&&s<n&&(s=n),setTimeout(function(){i.queue.push(r),i.future=i.future.filter(function(a){return a.id!==r.id}),i.emit(ho)},s),this.future.push(r),!0},e.prototype.getAttempts=function(r){var n;return(n=this.seen[r.id])!==null&&n!==void 0?n:0},e.prototype.updateAttempts=function(r){return this.seen[r.id]=this.getAttempts(r)+1,this.getAttempts(r)},e.prototype.includes=function(r){return this.queue.includes(r)||this.future.includes(r)||!!this.queue.find(function(n){return n.id===r.id})||!!this.future.find(function(n){return n.id===r.id})},e.prototype.pop=function(){return this.queue.shift()}
vendor: 4,621 bytes, line 4
4,Object.defineProperty(e.prototype,"length",{get:function(){return this.queue.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"todo",{get:function(){return this.queue.length+this.future.length},enumerable:!1,configurable:!0}),e})(cn),Te=256,Zt=[],er;Te--;)Zt[Te]=(Te+256).toString(16).substring(1);function ln(){var t=0,e,r="";if(!er||Te+16>256){for(er=Array(t=256);t--;)er[t]=256*Math.random()|0;t=Te=0}for(;t<16;t++)e=er[Te+t],t==6?r+=Zt[e&15|64]:t==8?r+=Zt[e&63|128]:r+=Zt[e],t&1&&t>1&&t<11&&(r+="-");return Te++,r}var ff=(function(){function t(){this._logs=[]}return t.prototype.log=function(e,r,n){var i=new Date;this._logs.push({level:e,message:r,time:i,extras:n})},Object.defineProperty(t.prototype,"logs",{get:function(){return this._logs},enumerable:!1,configurable:!0}),t.prototype.flush=function(){if(this.logs.length>1){var e=this._logs.reduce(function(r,n){var i,o,s,a=w(w({},n),{json:JSON.stringify(n.extras,null," "),extras:n.extras});delete a.time;var u=(s=(o=n.time)===null||o===void 0?void 0:o.toISOString())!==null&&s!==void 0?s:"";return r[u]&&(u="".concat(u,"-").concat(Math.random())),w(w({},r),(i={},i[u]=a,i))},{});console.table?console.table(e):console.log(e)}else this.logs.forEach(function(r){var n=r.level,i=r.message,o=r.extras;n==="info"||n==="debug"?console.log(i,o??""):console[n](i,o??"")});this._logs=[]},t})(),df=function(t){var e={gauge:"g",counter:"c"};return e[t]},po=(function(){function t(){this.metrics=[]}return t.prototype.increment=function(e,r,n){r===void 0&&(r=1),this.metrics.push({metric:e,value:r,tags:n??[],type:"counter",timestamp:Date.now()})},t.prototype.gauge=function(e,r,n){this.metrics.push({metric:e,value:r,tags:n??[],type:"gauge",timestamp:Date.now()})},t.prototype.flush=function(){var e=this.metrics.map(function(r){return w(w({},r),{tags:r.tags.join(",")})});console.table?console.table(e):console.log(e),this.metrics=[]},t.prototype.serialize=function(){return this.metrics.map(function(e){return{m:e.metric,v:e.value,t:e.tags,k:df(e.type),e:e.timestamp}})},t})(),hf=(function(t){H(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.gauge=function(){},e.prototype.increment=function(){},e.prototype.flush=function(){},e.prototype.serialize=function(){return[]},e})(po),pe=(function(){function t(e){var r,n,i;this.retry=(r=e.retry)!==null&&r!==void 0?r:!0,this.type=(n=e.type)!==null&&n!==void 0?n:"plugin Error",this.reason=(i=e.reason)!==null&&i!==void 0?i:""}return t})(),tr=(function(){function t(e,r,n,i){r===void 0&&(r=ln()),n===void 0&&(n=new hf),i===void 0&&(i=new ff),this.attempts=0,this.event=e,this._id=r,this.logger=i,this.stats=n}return t.system=function(){},t.prototype.isSame=function(e){return e.id===this.id},t.prototype.cancel=function(e){throw e||new pe({reason:"Context Cancel"})},t.prototype.log=function(e,r,n){this.logger.log(e,r,n)},Object.defineProperty(t.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),t.prototype.updateEvent=function(e,r){var n;if(e.split(".")[0]==="integrations"){var i=e.split(".")[1];if(((n=this.event.integrations)===null||n===void 0?void 0:n[i])===!1)return this.event}return nn(this.event,e,r),this.event},t.prototype.failedDelivery=function(){return this._failedDelivery},t.prototype.setFailedDelivery=function(e){this._failedDelivery=e},t.prototype.logs=function(){return this.logger.logs},t.prototype.flush=function(){this.logger.flush(),this.stats.flush()},t.prototype.toJSON=function(){return{id:this._id,event:this.event,logs:this.logger.logs,metrics:this.stats.metrics}},t})();function pf(t,e){var r={};return t.forEach(function(n){var i,o=void 0;{var s=n[e];o=typeof s!="string"?JSON.stringify(s):s}o!==void 0&&(r[o]=D(D([],(i=r[o])!==null&&i!==void 0?i:[],!0),[n],!1))}),r}var vf=function(t){return typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"},gf=function(){var t,e,r=0;return{done:function(){return t},run:function(n){var i=n();return vf(i)&&(++r===1&&(t=new Promise(function(o){return e=o})),i.finally(function(){return--r===0&&e()})),i}}};function yf(t){return O(this,void 0,void 0,function(){var e;return C(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,t()];case 1:return[2,r.sent()];case 2:return e=r.sent(),[2,Promise.reject(e)];case 3:return[2]}})})}function at(t,e){t.log("debug","plugin",{plugin:e.name});var r=new Date().getTime(),n=e[t.event.type];if(n===void 0)return Promise.resolve(t);var i=yf(function(){return n.apply(e,[t])}).then(function(o){var s=new Date().getTime()-r;return o.stats.gauge("plugin_time",s,["plugin:".concat(e.name)]),o}
vendor: 4,487 bytes, line 4
4).catch(function(o){if(o instanceof pe&&o.type==="middleware_cancellation")throw o;return o instanceof pe?(t.log("warn",o.type,{plugin:e.name,error:o}),o):(t.log("error","plugin Error",{plugin:e.name,error:o}),t.stats.increment("plugin_error",1,["plugin:".concat(e.name)]),o)});return i}function mf(t,e){return at(t,e).then(function(r){if(r instanceof tr)return r;t.log("debug","Context canceled"),t.stats.increment("context_canceled"),t.cancel(r)})}var bf=(function(t){H(e,t);function e(r){var n=t.call(this)||this;return n.criticalTasks=gf(),n.plugins=[],n.failedInitializations=[],n.flushing=!1,n.queue=r,n.queue.on(ho,function(){n.scheduleFlush(0)}),n}return e.prototype.register=function(r,n,i){return O(this,void 0,void 0,function(){var o,s,a=this;return C(this,function(u){switch(u.label){case 0:return this.plugins.push(n),o=function(c){a.failedInitializations.push(n.name),a.emit("initialization_failure",n),console.warn(n.name,c),r.log("warn","Failed to load destination",{plugin:n.name,error:c}),a.plugins=a.plugins.filter(function(l){return l!==n})},n.type==="destination"&&n.name!=="Segment.io"?(n.load(r,i).catch(o),[3,4]):[3,1];case 1:return u.trys.push([1,3,,4]),[4,n.load(r,i)];case 2:return u.sent(),[3,4];case 3:return s=u.sent(),o(s),[3,4];case 4:return[2]}})})},e.prototype.deregister=function(r,n,i){return O(this,void 0,void 0,function(){var o;return C(this,function(s){switch(s.label){case 0:return s.trys.push([0,3,,4]),n.unload?[4,Promise.resolve(n.unload(r,i))]:[3,2];case 1:s.sent(),s.label=2;case 2:return this.plugins=this.plugins.filter(function(a){return a.name!==n.name}),[3,4];case 3:return o=s.sent(),r.log("warn","Failed to unload destination",{plugin:n.name,error:o}),[3,4];case 4:return[2]}})})},e.prototype.dispatch=function(r){return O(this,void 0,void 0,function(){var n;return C(this,function(i){return r.log("debug","Dispatching"),r.stats.increment("message_dispatched"),this.queue.push(r),n=this.subscribeToDelivery(r),this.scheduleFlush(0),[2,n]})})},e.prototype.subscribeToDelivery=function(r){return O(this,void 0,void 0,function(){var n=this;return C(this,function(i){return[2,new Promise(function(o){var s=function(a,u){a.isSame(r)&&(n.off("flush",s),o(a))};n.on("flush",s)})]})})},e.prototype.dispatchSingle=function(r){return O(this,void 0,void 0,function(){var n=this;return C(this,function(i){return r.log("debug","Dispatching"),r.stats.increment("message_dispatched"),this.queue.updateAttempts(r),r.attempts=1,[2,this.deliver(r).catch(function(o){var s=n.enqueuRetry(o,r);return s?n.subscribeToDelivery(r):(r.setFailedDelivery({reason:o}),r)})]})})},e.prototype.isEmpty=function(){return this.queue.length===0},e.prototype.scheduleFlush=function(r){var n=this;r===void 0&&(r=500),!this.flushing&&(this.flushing=!0,setTimeout(function(){n.flush().then(function(){setTimeout(function(){n.flushing=!1,n.queue.length&&n.scheduleFlush(0)},0)})},r))},e.prototype.deliver=function(r){return O(this,void 0,void 0,function(){var n,i,o,s;return C(this,function(a){switch(a.label){case 0:return[4,this.criticalTasks.done()];case 1:a.sent(),n=Date.now(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.flushOne(r)];case 3:return r=a.sent(),i=Date.now()-n,this.emit("delivery_success",r),r.stats.gauge("delivered",i),r.log("debug","Delivered",r.event),[2,r];case 4:throw o=a.sent(),s=o,r.log("error","Failed to deliver",s),this.emit("delivery_failure",r,s),r.stats.increment("delivery_failed"),o;case 5:return[2]}})})},e.prototype.enqueuRetry=function(r,n){var i=!(r instanceof pe)||r.retry;return i?this.queue.pushWithBackoff(n):!1},e.prototype.flush=function(){return O(this,void 0,void 0,function(){var r,n,i;return C(this,function(o){switch(o.label){case 0:if(this.queue.length===0)return[2,[]];if(r=this.queue.pop(),!r)return[2,[]];r.attempts=this.queue.getAttempts(r),o.label=1;case 1:return o.trys.push([1,3,,4]),[4,this.deliver(r)];case 2:return r=o.sent(),this.emit("flush",r,!0),[3,4];case 3:return n=o.sent(),i=this.enqueuRetry(n,r),i||(r.setFailedDelivery({reason:n}),this.emit("flush",r,!1)),[2,[]];case 4:return[2,[r]]}})})},e.prototype.isReady=function(){return!0},e.prototype.availableExtensions=function(r){var n=this.plugins.filter(function(h){var p,g,v;if(h.type!=="destination"&&h.name!=="Segment.io")return!0;var y=void 0;return(p=h.alternativeNames)===null||p===void 0||p.forEach(function(m){r[m]!==void 0&&(y=r[m])}),(v=(g=r[h.name])!==null&&g!==void 0?g:y)!==null&&v!==void 0?v:(h.name==="Segment.io"?!0:r.All)!==!1}
vendor: 6,369 bytes, line 4
4),i=pf(n,"type"),o=i.before,s=o===void 0?[]:o,a=i.enrichment,u=a===void 0?[]:a,c=i.destination,l=c===void 0?[]:c,f=i.after,d=f===void 0?[]:f;return{before:s,enrichment:u,destinations:l,after:d}},e.prototype.flushOne=function(r){var n,i;return O(this,void 0,void 0,function(){var o,s,a,u,c,l,p,f,d,h,p,g,v,y,m;return C(this,function(S){switch(S.label){case 0:if(!this.isReady())throw new Error("Not ready");r.attempts>1&&this.emit("delivery_retry",r),o=this.availableExtensions((n=r.event.integrations)!==null&&n!==void 0?n:{}),s=o.before,a=o.enrichment,u=0,c=s,S.label=1;case 1:return u<c.length?(l=c[u],[4,mf(r,l)]):[3,4];case 2:p=S.sent(),p instanceof tr&&(r=p),this.emit("message_enriched",r,l),S.label=3;case 3:return u++,[3,1];case 4:f=0,d=a,S.label=5;case 5:return f<d.length?(h=d[f],[4,at(r,h)]):[3,8];case 6:p=S.sent(),p instanceof tr&&(r=p),this.emit("message_enriched",r,h),S.label=7;case 7:return f++,[3,5];case 8:return g=this.availableExtensions((i=r.event.integrations)!==null&&i!==void 0?i:{}),v=g.destinations,y=g.after,[4,new Promise(function(_,b){setTimeout(function(){var E=v.map(function(x){return at(r,x)});Promise.all(E).then(_).catch(b)},0)})];case 9:return S.sent(),r.stats.increment("message_delivered"),this.emit("message_delivered",r),m=y.map(function(_){return at(r,_)}),[4,Promise.all(m)];case 10:return S.sent(),[2,r]}})})},e})(cn),wf=function(t,e){var r=Date.now()-t;return Math.max((e??300)-r,0)};function _f(t,e,r,n){return O(this,void 0,void 0,function(){var i,o;return C(this,function(s){switch(s.label){case 0:return r.emit("dispatch_start",t),i=Date.now(),e.isEmpty()?[4,e.dispatchSingle(t)]:[3,2];case 1:return o=s.sent(),[3,4];case 2:return[4,e.dispatch(t)];case 3:o=s.sent(),s.label=4;case 4:return n?.callback?[4,cf(o,n.callback,wf(i,n.timeout))]:[3,6];case 5:o=s.sent(),s.label=6;case 6:return n?.debug&&o.flush(),[2,o]}})})}function Sf(t,e,r,n){var i,o=[t,e,r,n],s=V(t)?t.event:t;if(!s||!he(s))throw new Error("Event missing");var a=V(t)?(i=t.properties)!==null&&i!==void 0?i:{}:V(e)?e:{},u={};ot(r)||(u=r??{}),V(t)&&!ot(e)&&(u=e??{});var c=o.find(ot);return[s,a,u,c]}function vo(t,e,r,n,i){var o,s,a=null,u=null,c=[t,e,r,n,i],l=c.filter(he);l.length===1?he(c[1])?(u=c[1],a=null):(u=l[0],a=null):l.length===2&&(typeof c[0]=="string"&&(a=c[0]),typeof c[1]=="string"&&(u=c[1]));var f=c.find(ot),d=c.filter(V);return d.length===1?V(c[2])?(s={},o=c[2]):V(c[3])?(o={},s=c[3]):(o=d[0],s={}):d.length===2&&(o=d[0],s=d[1]),[a,u,o??(o={}),s??(s={}),f]}var go=function(t){return function(){for(var e,r,n,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];for(var s={},a=["callback","options","traits","id"],u=0,c=i;u<c.length;u++){var l=c[u],f=a.pop();if(f==="id"){if(he(l)||on(l)){s.id=l.toString();continue}if(l==null)continue;f=a.pop()}if((f==="traits"||f==="options")&&(l==null||V(l))&&(s[f]=l),ot(l)){s.callback=l;break}}return[(e=s.id)!==null&&e!==void 0?e:t.id(),(r=s.traits)!==null&&r!==void 0?r:{},(n=s.options)!==null&&n!==void 0?n:{},s.callback]}};function Ef(t,e,r,n){on(t)&&(t=t.toString()),on(e)&&(e=e.toString());var i=[t,e,r,n],o=i.filter(he),s=o[0],a=s===void 0?t:s,u=o[1],c=u===void 0?null:u,l=i.filter(V)[0],f=l===void 0?{}:l,d=i.find(ot);return[a,c,f,d]}function fn(){return typeof window<"u"}function yo(){return!fn()}function mo(){return fn()?window.navigator.onLine:!0}function ve(){return!mo()}function Of(t,e){return e=e||{},new Promise(function(r,n){var i=new XMLHttpRequest,o=[],s=[],a={},u=function(){return{ok:(i.status/100|0)==2,statusText:i.statusText,status:i.status,url:i.responseURL,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([i.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return s},get:function(l){return a[l.toLowerCase()]},has:function(l){return l.toLowerCase()in a}}}};for(var c in i.open(e.method||"get",t,!0),i.onload=function(){i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(l,f,d){o.push(f=f.toLowerCase()),s.push([f,d]),a[f]=a[f]?a[f]+","+d:d}),r(u())},i.onerror=n,i.withCredentials=e.credentials=="include",e.headers)i.setRequestHeader(c,e.headers[c]);i.send(e.body||null)})}var dn=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:null},rr=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=dn();return(r&&r.fetch||Of).apply(void 0,t)},nr="1.81.1",bo="api.segment.io/v1",Cf=function(t,e,r){var n=e.reduce(function(i,o){var s=o.split(":"),a=s[0],u=s[1];return i[a]=u,i},{});return{type:"Counter",metric:t,value:1,tags:w(w({},n),{library:"analytics.js",library_version:"npm:next-".concat(nr)})}};function hn(t){console.error("Error sending segment performance metrics",t)}var xf=(function(){function t(e){var r=this,n,i,o,s,a;if(this.host=(n=e?.host)!==null&&n!==void 0?n:bo,this.sampleRate=(i=e?.sampleRate)!==null&&i!==void 0?i:1,this.flushTimer=(o=e?.flushTimer)!==null&&o!==void 0?o:30*1e3,this.maxQueueSize=(s=e?.maxQueueSize)!==null&&s!==void 0?s:20,this.protocol=(a=e?.protocol)!==null&&a!==void 0?a:"https",this.queue=[],this.sampleRate>0){var u=!1,c=function(){u||(u=!0,r.flush().catch(hn),u=!1,setTimeout(c,r.flushTimer))};c()}}return t.prototype.increment=function(e,r){if(e.includes("analytics_js.")&&r.length!==0&&!(Math.random()>this.sampleRate)&&!(this.queue.length>=this.maxQueueSize)){var n=Cf(e,r);this.queue.push(n),e.includes("error")&&this.flush().catch(hn)}},t.prototype.flush=function(){return O(this,void 0,void 0,function(){var e=this;return C(this,function(r){switch(r.label){case 0:return this.queue.length<=0?[2]:[4,this.send().catch(function(n){hn(n),e.sampleRate=0})];case 1:return r.sent(),[2]}})})},t.prototype.send=function(){return O(this,void 0,void 0,function(){var e,r,n;return C(this,function(i){return e={series:this.queue},this.queue=[],r={"Content-Type":"text/plain"},n="".concat(this.protocol,"://").concat(this.host,"/m"),[2,rr(n,{headers:r,body:JSON.stringify(e),method:"POST"})]})})},t})(),ir,wo=(function(t){H(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.initRemoteMetrics=function(r){ir=new xf(r)},e.prototype.increment=function(r,n,i){t.prototype.increment.call(this,r,n,i),ir?.increment(r,i??[])},e})(po),te=(function(t){H(e,t);
vendor: 17,711 bytes, line 4
4function e(r,n){return t.call(this,r,n,new wo)||this}return e.system=function(){return new this({type:"track",event:"system"})},e})(tr);function Mf(t){return Object.prototype.toString.call(t).slice(8,-1).toLowerCase()==="object"}var _o="bpc",So=function(t,e,r,n,i,o){return{__t:_o,c:e,p:n,u:t,s:r,t:i,r:o}},kf=Object.keys(So("","","","","",""));function Tf(t){if(!Mf(t)||t.__t!==_o)return!1;for(var e in t)if(!kf.includes(e))return!1;return!0}var Lf=function(t,e){return t.indexOf("?")>-1?t:t+e},Af=function(t){var e=t.indexOf("#");return e===-1?t:t.slice(0,e)},If=function(t){try{return new URL(t).pathname}catch{return t[0]==="/"?t:"/"+t}},Eo=function(t){var e=t.c,r=t.p,n=t.s,i=t.u,o=t.r,s=t.t,a=e?If(e):r,u=e?Lf(e,n):Af(i);return{path:a,referrer:o,search:n,title:s,url:u}},Oo=function(){var t=document.querySelector("link[rel='canonical']");return So(location.href,t&&t.getAttribute("href")||void 0,location.search,location.pathname,document.title,document.referrer)},Pf=function(){return Eo(Oo())};function Rf(t,e){return Object.assign.apply(Object,D([{}],e.map(function(r){var n;if(t&&Object.prototype.hasOwnProperty.call(t,r))return n={},n[r]=t[r],n}),!1))}var st=function(t,e){e===void 0&&(e=Pf());var r=t.context,n;t.type==="page"&&(n=t.properties&&Rf(t.properties,Object.keys(e)),t.properties=w(w(w({},e),t.properties),t.name?{name:t.name}:{})),r.page=w(w(w({},e),n),r.page)},Df=(function(t){H(e,t);function e(r){var n=t.call(this,{createMessageId:function(){return"ajs-next-".concat(Date.now(),"-").concat(ln())},onEventMethodCall:function(i){var o=i.options;n.maybeUpdateAnonId(o)},onFinishedEvent:function(i){return n.addIdentity(i),i}})||this;return n.user=r,n}return e.prototype.maybeUpdateAnonId=function(r){r?.anonymousId&&this.user.anonymousId(r.anonymousId)},e.prototype.addIdentity=function(r){this.user.id()&&(r.userId=this.user.id()),this.user.anonymousId()&&(r.anonymousId=this.user.anonymousId())},e.prototype.track=function(r,n,i,o,s){var a=t.prototype.track.call(this,r,n,i,o);return st(a,s),a},e.prototype.page=function(r,n,i,o,s,a){var u=t.prototype.page.call(this,r,n,i,o,s);return st(u,a),u},e.prototype.screen=function(r,n,i,o,s,a){var u=t.prototype.screen.call(this,r,n,i,o,s);return st(u,a),u},e.prototype.identify=function(r,n,i,o,s){var a=t.prototype.identify.call(this,r,n,i,o);return st(a,s),a},e.prototype.group=function(r,n,i,o,s){var a=t.prototype.group.call(this,r,n,i,o);return st(a,s),a},e.prototype.alias=function(r,n,i,o,s){var a=t.prototype.alias.call(this,r,n,i,o);return st(a,s),a},e})(sf),Nf=function(t){return"addMiddleware"in t&&t.type==="destination"},re={getItem:function(){},setItem:function(){},removeItem:function(){}};try{re=fn()&&window.localStorage?window.localStorage:re}catch(t){console.warn("Unable to access localStorage",t)}function Co(t){var e=re.getItem(t);return(e?JSON.parse(e):[]).map(function(r){return new te(r.event,r.id)})}function jf(t,e){var r=Co(t),n=D(D([],e,!0),r,!0),i=n.reduce(function(o,s){var a;return w(w({},o),(a={},a[s.id]=s,a))},{});re.setItem(t,JSON.stringify(Object.values(i)))}function xo(t){var e=re.getItem(t);return e?JSON.parse(e):{}}function Ff(t,e){var r=xo(t);re.setItem(t,JSON.stringify(w(w({},r),e)))}function Mo(t){re.removeItem(t)}var Bf=function(){return new Date().getTime()};function pn(t,e,r){r===void 0&&(r=0);var n=50,i="persisted-queue:v1:".concat(t,":lock"),o=function(c){return new Date().getTime()>c},s=re.getItem(i),a=s?JSON.parse(s):null,u=a===null||o(a);if(u){re.setItem(i,JSON.stringify(Bf()+n)),e(),re.removeItem(i);return}!u&&r<3?setTimeout(function(){pn(t,e,r+1)},n):console.error("Unable to retrieve lock")}var or=(function(t){H(e,t);function e(r,n){var i=t.call(this,r,[])||this,o="persisted-queue:v1:".concat(n,":items"),s="persisted-queue:v1:".concat(n,":seen"),a=[],u={};return pn(n,function(){try{a=Co(o),u=xo(s),Mo(o),Mo(s),i.queue=D(D([],a,!0),i.queue,!0),i.seen=w(w({},u),i.seen)}catch(c){console.error(c)}}),window.addEventListener("pagehide",function(){if(i.todo>0){var c=D(D([],i.queue,!0),i.future,!0);try{pn(n,function(){jf(o,c),Ff(s,i.seen)})}catch(l){console.error(l)}}}),i}return e})(Xt),Uf=(function(t){H(e,t);function e(r){return t.call(this,typeof r=="string"?new or(4,r):r)||this}return e.prototype.flush=function(){return O(this,void 0,void 0,function(){return C(this,function(r){return ve()?[2,[]]:[2,t.prototype.flush.call(this)]})})},e})(bf);function vn(t){for(var e=t.constructor.prototype,r=0,n=Object.getOwnPropertyNames(e);r<n.length;r++){var i=n[r];if(i!=="constructor"){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);o&&typeof o.value=="function"&&(t[i]=t[i].bind(t))}}return t}/*! js-cookie v3.0.1 | MIT */function ar(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)t[n]=r[n]}return t}var zf={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function gn(t,e){function r(i,o,s){if(!(typeof document>"u")){s=ar({},e,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var u in s)s[u]&&(a+="; "+u,s[u]!==!0&&(a+="="+s[u].split(";")[0]));return document.cookie=i+"="+t.write(o,i)+a}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],s={},a=0;a<o.length;a++){var u=o[a].split("="),c=u.slice(1).join("=");try{var l=decodeURIComponent(u[0]);if(s[l]=t.read(c,l),i===l)break}catch{}}return i?s[i]:s}}return Object.create({set:r,get:n,remove:function(i,o){r(i,"",ar({},o,{expires:-1}))},withAttributes:function(i){return gn(this.converter,ar({},this.attributes,i))},withConverter:function(i){return gn(ar({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var se=gn(zf,{path:"/"});function qf(t){var e=t.hostname,r=e.split("."),n=r[r.length-1],i=[];if(r.length===4&&parseInt(n,10)>0||r.length<=1)return i;for(var o=r.length-2;o>=0;--o)i.push(r.slice(o).join("."));return i}function Gf(t){try{return new URL(t)}catch{return}}function ko(t){var e=Gf(t);if(e)for(var r=qf(e),n=0;n<r.length;++n){var i="__tld__",o=r[n],s={domain:"."+o};try{if(se.set(i,"1",s),se.get(i))return se.remove(i,s),o}catch{return}}}var Hf=365,To=(function(){function t(e){e===void 0&&(e=t.defaults),this.options=w(w({},t.defaults),e)}return Object.defineProperty(t,"defaults",{get:function(){return{maxage:Hf,domain:ko(window.location.href),path:"/",sameSite:"Lax"}},enumerable:!1,configurable:!0}),t.prototype.opts=function(){return{sameSite:this.options.sameSite,expires:this.options.maxage,domain:this.options.domain,path:this.options.path,secure:this.options.secure}},t.prototype.get=function(e){var r;try{var n=se.get(e);if(n==null)return null;try{return(r=JSON.parse(n))!==null&&r!==void 0?r:null}catch{return n??null}}catch{return null}},t.prototype.set=function(e,r){typeof r=="string"?se.set(e,r,this.opts()):r===null?se.remove(e,this.opts()):se.set(e,JSON.stringify(r),this.opts())},t.prototype.remove=function(e){return se.remove(e,this.opts())},t})(),Vf=(function(){function t(){}return t.prototype.localStorageWarning=function(e,r){console.warn("Unable to access ".concat(e,", localStorage may be ").concat(r))},t.prototype.get=function(e){var r;try{var n=localStorage.getItem(e);if(n===null)return null;try{return(r=JSON.parse(n))!==null&&r!==void 0?r:null}catch{return n??null}}catch{return this.localStorageWarning(e,"unavailable"),null}},t.prototype.set=function(e,r){try{localStorage.setItem(e,JSON.stringify(r))}catch{this.localStorageWarning(e,"full")}},t.prototype.remove=function(e){try{return localStorage.removeItem(e)}catch{this.localStorageWarning(e,"unavailable")}},t})(),yn=(function(){function t(){this.cache={}}return t.prototype.get=function(e){var r;return(r=this.cache[e])!==null&&r!==void 0?r:null},t.prototype.set=function(e,r){this.cache[e]=r},t.prototype.remove=function(e){delete this.cache[e]},t})(),K={Cookie:"cookie",LocalStorage:"localStorage",Memory:"memory"};function Lo(t){return t&&t.stores&&Array.isArray(t.stores)&&t.stores.every(function(e){return Object.values(K).includes(e)})}function Kf(t){return typeof t=="object"&&t.name!==void 0}var mn=function(t,e,r,n){console.warn("".concat(t.constructor.name,": Can't ").concat(e,' key "').concat(r,'" | Err: ').concat(n))},Le=(function(){function t(e){this.stores=e}return t.prototype.get=function(e){for(var r=null,n=0,i=this.stores;n<i.length;n++){var o=i[n];try{if(r=o.get(e),r!=null)return r}catch(s){mn(o,"get",e,s)}}return null},t.prototype.set=function(e,r){this.stores.forEach(function(n){try{n.set(e,r)}catch(i){mn(n,"set",e,i)}})},t.prototype.clear=function(e){this.stores.forEach(function(r){try{r.remove(e)}catch(n){mn(r,"remove",e,n)}})},t.prototype.getAndSync=function(e){var r=this.get(e),n=typeof r=="number"?r.toString():r;return this.set(e,n),n},t})();function bn(t){var e=t.map(function(r){var n,i;switch(Kf(r)?(n=r.name,i=r.settings):n=r,n){case K.Cookie:return new To(i);case K.LocalStorage:return new Vf;case K.Memory:return new yn;default:throw new Error("Unknown Store Type: ".concat(r))}});return e}function Ao(t,e){return t.map(function(r){return e&&r===K.Cookie?{name:r,settings:e}:r})}var Ae={persist:!0,cookie:{key:"ajs_user_id",oldKey:"ajs_user"},localStorage:{key:"ajs_user_traits"}},Io=(function(){function t(e,r){e===void 0&&(e=Ae);var n=this,i,o,s,a;this.options={},this.id=function(c){if(n.options.disable)return null;var l=n.identityStore.getAndSync(n.idKey);if(c!==void 0){n.identityStore.set(n.idKey,c);var f=c!==l&&l!==null&&c!==null;f&&n.anonymousId(null)}var d=n.identityStore.getAndSync(n.idKey);if(d)return d;var h=n.legacyUserStore.get(Ae.cookie.oldKey);return h?typeof h=="object"?h.id:h:null},this.anonymousId=function(c){var l,f;if(n.options.disable)return null;if(c===void 0){var d=(l=n.identityStore.getAndSync(n.anonKey))!==null&&l!==void 0?l:(f=n.legacySIO())===null||f===void 0?void 0:f[0];if(d)return d}return c===null?(n.identityStore.set(n.anonKey,null),n.identityStore.getAndSync(n.anonKey)):(n.identityStore.set(n.anonKey,c??ln()),n.identityStore.getAndSync(n.anonKey))},this.traits=function(c){var l;if(!n.options.disable)return c===null&&(c={}),c&&n.traitsStore.set(n.traitsKey,c??{}),(l=n.traitsStore.get(n.traitsKey))!==null&&l!==void 0?l:{}},this.options=w(w({},Ae),e),this.cookieOptions=r,this.idKey=(o=(i=e.cookie)===null||i===void 0?void 0:i.key)!==null&&o!==void 0?o:Ae.cookie.key,this.traitsKey=(a=(s=e.localStorage)===null||s===void 0?void 0:s.key)!==null&&a!==void 0?a:Ae.localStorage.key,this.anonKey="ajs_anonymous_id",this.identityStore=this.createStorage(this.options,r),this.legacyUserStore=this.createStorage(this.options,r,function(c){return c===K.Cookie}),this.traitsStore=this.createStorage(this.options,r,function(c){return c!==K.Cookie});var u=this.legacyUserStore.get(Ae.cookie.oldKey);u&&typeof u=="object"&&(u.id&&this.id(u.id),u.traits&&this.traits(u.traits)),vn(this)}return t.prototype.legacySIO=function(){var e=this.legacyUserStore.get("_sio");if(!e)return null;var r=e.split("----"),n=r[0],i=r[1];return[n,i]},t.prototype.identify=function(e,r){if(!this.options.disable){r=r??{};var n=this.id();(n===null||n===e)&&(r=w(w({},this.traits()),r)),e&&this.id(e),this.traits(r)}},t.prototype.logout=function(){this.anonymousId(null),this.id(null),this.traits({})},t.prototype.reset=function(){this.logout(),this.identityStore.clear(this.idKey),this.identityStore.clear(this.anonKey),this.traitsStore.clear(this.traitsKey)},t.prototype.load=function(){return new t(this.options,this.cookieOptions)},t.prototype.save=function(){return!0},t.prototype.createStorage=function(e,r,n){var i=[K.LocalStorage,K.Cookie,K.Memory];return e.disable?new Le([]):e.persist?(e.storage!==void 0&&e.storage!==null&&Lo(e.storage)&&(i=e.storage.stores),e.localStorageFallbackDisabled&&(i=i.filter(function(o){return o!==K.LocalStorage})),n&&(i=i.filter(n)),new Le(bn(Ao(i,r)))):new Le([new yn])},t.defaults=Ae,t})(),Po={persist:!0,cookie:{key:"ajs_group_id"},localStorage:{key:"ajs_group_properties"}},Wf=(function(t){H(e,t);function e(r,n){r===void 0&&(r=Po);var i=t.call(this,w(w({},Po),r),n)||this;return i.anonymousId=function(o){},vn(i),i}return e})(Io),wn="analytics";function Ro(){return window[wn]}function Jf(t){wn=t}function $f(t){window[wn]=t}var Yf=function(t){return typeof t=="object"&&t!==null&&"then"in t&&typeof t.then=="function"},Do=function(t,e,r){r.getAndRemove(t).forEach(function(n){sr(e,n).catch(console.error)})},Qf=function(t,e){return O(void 0,void 0,void 0,function(){var r,n,i;return C(this,function(o){switch(o.label){case 0:r=0,n=e.getAndRemove("addSourceMiddleware"),o.label=1;case 1:return r<n.length?(i=n[r],[4,sr(t,i).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},Xf=function(t,e){return O(void 0,void 0,void 0,function(){var r,n,i;return C(this,function(o){switch(o.label){case 0:r=0,n=e.getAndRemove("register"),o.label=1;case 1:return r<n.length?(i=n[r],[4,sr(t,i).catch(console.error)]):[3,4];case 2:o.sent(),o.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},Zf=Do.bind(void 0,"on"),ed=Do.bind(void 0,"setAnonymousId"),td=function(t,e){Object.keys(e.calls).forEach(function(r){e.getAndRemove(r).forEach(function(n){setTimeout(function(){sr(t,n).catch(console.error)},0)})})},ut=function(t){if(No(t)){var e=t.pop();return Eo(e)}},No=function(t){var e=t[t.length-1];return Tf(e)},_n=(function(){function t(e,r,n,i){n===void 0&&(n=function(){}),i===void 0&&(i=console.error),this.method=e,this.resolve=n,this.reject=i,this.called=!1,this.args=r}return t})(),rd=(function(){function t(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];this._callMap={},this.add.apply(this,e)}return Object.defineProperty(t.prototype,"calls",{get:function(){return this._pushSnippetWindowBuffer(),this._callMap},set:function(e){this._callMap=e},enumerable:!1,configurable:!0}),t.prototype.get=function(e){var r;return(r=this.calls[e])!==null&&r!==void 0?r:[]},t.prototype.getAndRemove=function(e){var r=this.get(e);return this.calls[e]=[],r},t.prototype.add=function(){for(var e=this,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];r.forEach(function(i){var o=["track","screen","alias","group","page","identify"];o.includes(i.method)&&!No(i.args)&&(i.args=D(D([],i.args,!0),[Oo()],!1)),e.calls[i.method]?e.calls[i.method].push(i):e.calls[i.method]=[i]})},t.prototype.clear=function(){this._pushSnippetWindowBuffer(),this.calls={}},t.prototype.toArray=function(){var e;return(e=[]).concat.apply(e,Object.values(this.calls))},t.prototype._pushSnippetWindowBuffer=function(){},t})();function sr(t,e){return O(this,void 0,void 0,function(){var r,n;return C(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),e.called?[2,void 0]:(e.called=!0,r=t[e.method].apply(t,e.args),Yf(r)?[4,r]:[3,2]);case 1:i.sent(),i.label=2;case 2:return e.resolve(r),[3,4];case 3:return n=i.sent(),e.reject(n),[3,4];case 4:return[2]}})})}var nd=(function(){function t(e){var r=this;this.trackSubmit=this._createMethod("trackSubmit"),this.trackClick=this._createMethod("trackClick"),this.trackLink=this._createMethod("trackLink"),this.pageView=this._createMethod("pageview"),this.identify=this._createMethod("identify"),this.reset=this._createMethod("reset"),this.group=this._createMethod("group"),this.track=this._createMethod("track"),this.ready=this._createMethod("ready"),this.alias=this._createMethod("alias"),this.debug=this._createChainableMethod("debug"),this.page=this._createMethod("page"),this.once=this._createChainableMethod("once"),this.off=this._createChainableMethod("off"),this.on=this._createChainableMethod("on"),this.addSourceMiddleware=this._createMethod("addSourceMiddleware"),this.setAnonymousId=this._createMethod("setAnonymousId"),this.addDestinationMiddleware=this._createMethod("addDestinationMiddleware"),this.screen=this._createMethod("screen"),this.register=this._createMethod("register"),this.deregister=this._createMethod("deregister"),this.user=this._createMethod("user"),this.VERSION=nr,this._preInitBuffer=new rd,this._promise=e(this._preInitBuffer),this._promise.then(function(n){var i=n[0],o=n[1];r.instance=i,r.ctx=o}).catch(function(){})}return t.prototype.then=function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(e=this._promise).then.apply(e,r)},t.prototype.catch=function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(e=this._promise).catch.apply(e,r)},t.prototype.finally=function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return(e=this._promise).finally.apply(e,r)},t.prototype._createMethod=function(e){var r=this;return function(){for(var n,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(r.instance){var s=(n=r.instance)[e].apply(n,i);return Promise.resolve(s)}return new Promise(function(a,u){r._preInitBuffer.add(new _n(e,i,a,u))})}},t.prototype._createChainableMethod=function(e){var r=this;return function(){for(var n,i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return r.instance?((n=r.instance)[e].apply(n,i),r):(r._preInitBuffer.add(new _n(e,i)),r)}},t})(),Tt={},Ie={},ct={},Sn={exports:{}},jo;function ur(){return jo||(jo=1,(function(t){t.exports=e(r),t.exports.find=t.exports,t.exports.replace=function(a,u,c,l){return e(i).call(this,a,u,c,l),a},t.exports.del=function(a,u,c){return e(n).call(this,a,u,null,c),a};function e(a){return function(u,c,l,f){var d=f&&s(f.normalizer)?f.normalizer
4:o;c=d(c);for(var h,p=!1;!p;)g();function g(){for(h in u){var v=d(h);if(c.indexOf(v)===0){var y=c.substr(v.length);if(y.charAt(0)==="."||y.length===0){c=y.substr(1);var m=u[h];if(m==null){p=!0;return}if(!c.length){p=!0;return}u=m;return}}}h=void 0,p=!0}if(h)return u==null?u:a(u,h,l)}}function r(a,u){if(a.hasOwnProperty(u))return a[u]}function n(a,u){return a.hasOwnProperty(u)&&delete a[u],a}function i(a,u,c){return a.hasOwnProperty(u)&&(a[u]=c),a}function o(a){return a.replace(/[^a-zA-Z0-9\.]+/g,"").toLowerCase()}function s(a){return typeof a=="function"}})(Sn)),Sn.exports}var Fo;function id(){if(Fo)return ct;Fo=1;var t=ct&&ct.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ct,"__esModule",{value:!0});var e=t(ur());function r(i,o){return function(){var s=this.traits(),a=this.properties?this.properties():{};return e.default(s,"address."+i)||e.default(s,i)||(o?e.default(s,"address."+o):null)||(o?e.default(s,o):null)||e.default(a,"address."+i)||e.default(a,i)||(o?e.default(a,"address."+o):null)||(o?e.default(a,o):null)}}function n(i){i.zip=r("postalCode","zip"),i.country=r("country"),i.street=r("street"),i.state=r("state"),i.city=r("city"),i.region=r("region")}return ct.default=n,ct}var Lt={},Bo;function od(){if(Bo)return Lt;Bo=1,Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.clone=void 0;function t(e){if(typeof e!="object")return e;if(Object.prototype.toString.call(e)==="[object Object]"){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=t(e[n]));return r}else return Array.isArray(e)?e.map(t):e}return Lt.clone=t,Lt}var cr={},Uo;function ad(){if(Uo)return cr;Uo=1,Object.defineProperty(cr,"__esModule",{value:!0});var t={Salesforce:!0};function e(r){return!t[r]}return cr.default=e,cr}var lr={},zo;function qo(){if(zo)return lr;zo=1;var t=/^(\d{4})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:([ T])(\d{2}):?(\d{2})(?::?(\d{2})(?:[,\.](\d{1,}))?)?(?:(Z)|([+\-])(\d{2})(?::?(\d{2}))?)?)?$/;return lr.parse=function(e){var r=[1,5,6,7,11,12],n=t.exec(e),i=0;if(!n)return new Date(e);for(var o=0,s;s=r[o];o++)n[s]=parseInt(n[s],10)||0;n[2]=parseInt(n[2],10)||1,n[3]=parseInt(n[3],10)||1,n[2]--,n[8]=n[8]?(n[8]+"00").substring(0,3):0,n[4]===" "?i=new Date().getTimezoneOffset():n[9]!=="Z"&&n[10]&&(i=n[11]*60+n[12],n[10]==="+"&&(i=0-i));var a=Date.UTC(n[1],n[2],n[3],n[5],n[6]+i,n[7],n[8]);return new Date(a)},lr.is=function(e,r){return typeof e!="string"||r&&/^\d{4}-\d{2}-\d{2}/.test(e)===!1?!1:t.test(e)},lr}var fr={},Go;
4function sd(){if(Go)return fr;Go=1;var t=/\d{13}/;return fr.is=function(e){return t.test(e)},fr.parse=function(e){return e=parseInt(e,10),new Date(e)},fr}var dr={},Ho;function ud(){if(Ho)return dr;Ho=1;var t=/\d{10}/;return dr.is=function(e){return t.test(e)},dr.parse=function(e){var r=parseInt(e,10)*1e3;return new Date(r)},dr}var En,Vo;function On(){if(Vo)return En;Vo=1;var t=qo(),e=sd(),r=ud(),n=Object.prototype,i=n.toString;function o(u){return i.call(u)==="[object Date]"}function s(u){return i.call(u)==="[object Number]"}En=function(c){return o(c)?c:s(c)?new Date(a(c)):t.is(c)?t.parse(c):e.is(c)?e.parse(c):r.is(c)?r.parse(c):new Date(c)};function a(u){return u<315576e5?u*1e3:u}return En}var Cn,Ko;function cd(){if(Ko)return Cn;Ko=1;var t=qo();Cn=e;function e(i,o){return o===void 0&&(o=!0),i&&typeof i=="object"?r(i,o):Array.isArray(i)?n(i,o):t.is(i,o)?t.parse(i):i}function r(i,o){return Object.keys(i).forEach(function(s){i[s]=e(i[s],o)}),i}function n(i,o){return i.forEach(function(s,a){i[a]=e(s,o)}),i}return Cn}var Wo;function Pe(){if(Wo)return Ie;Wo=1;var t=Ie&&Ie.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.Facade=void 0;var e=t(id()),r=od(),n=t(ad()),i=t(On()),o=t(ur()),s=t(cd());function a(l,f){f=f||{},this.raw=r.clone(l),"clone"in f||(f.clone=!0),f.clone&&(l=r.clone(l)),"traverse"in f||(f.traverse=!0),"timestamp"in l?l.timestamp=i.default(l.timestamp):l.timestamp=new Date,f.traverse&&s.default(l),this.opts=f,this.obj=l}Ie.Facade=a;var u=a.prototype;u.proxy=function(l){var f=l.split(".");l=f.shift();var d=this[l]||this.obj[l];return d&&(typeof d=="function"&&(d=d.call(this)||{}),f.length===0?this.opts.clone?c(d):d:(d=o.default(d,f.join(".")),this.opts.clone?c(d):d))},u.field=function(l){var f=this.obj[l];return this.opts.clone?c(f):f},a.proxy=function(l){return function(){return this.proxy(l)}},a.field=function(l){return function(){return this.field(l)}},a.multi=function(l){return function(){var f=this.proxy(l+"s");if(Array.isArray(f))return f;var d=this.proxy(l);return d&&(d=[this.opts.clone?r.clone(d):d]),d||[]}},a.one=function(l){return function(){var f=this.proxy(l);if(f)return f;var d=this.proxy(l+"s");if(Array.isArray(d))return d[0]}},u.json=function(){var l=this.opts.clone?r.clone(this.obj):this.obj;return this.type&&(l.type=this.type()),l},u.rawEvent=function(){return this.raw},u.options=function(l){var f=this.obj.options||this.obj.context||{},d=this.opts.clone?r.clone(f):f;if(!l)return d;if(this.enabled(l)){var h=this.integrations(),p=h[l]||o.default(h,l);return typeof p!="object"&&(p=o.default(this.options(),l)),typeof p=="object"?p:{}}},u.context=u.options,u.enabled=function(l){var f=this.proxy("options.providers.all");typeof f!="boolean"&&(f=this.proxy("options.all")),typeof f!="boolean"&&(f=this.proxy("integrations.all")),typeof f!="boolean"&&(f=!0);var d=f&&n.default(l),h=this.integrations();if(h.providers&&h.providers.hasOwnProperty(l)&&(d=h.providers[l]),h.hasOwnProperty(l)){var p=h[l];typeof p=="boolean"?d=p:d=!0}return!!d},u.integrations=function(){return this.obj.integrations||this.proxy("options.providers")||this.options()},u.active=function(){var l=this.proxy("options.active");return l==null&&(l=!0),l},u.anonymousId=function(){return this.field("anonymousId")||this.field("sessionId")},u.sessionId=u.anonymousId,u.groupId=a.proxy("options.groupId"),u.traits=function(l){var f=this.proxy("options.traits")||{},d=this.userId();l=l||{},d&&(f.id=d);for(var h in l)if(Object.prototype.hasOwnProperty.call(l,h)){var p=this[h]==null?this.proxy("options.traits."+h):this[h]();if(p==null)continue;f[l[h]]=p,delete f[h]}return f},u.library=function(){var l=this.proxy("options.library");return l?typeof l=="string"?{name:l,version:null}:l:{name:"unknown",version:null}},u.device=function(){var l=this.proxy("context.device");(typeof l!="object"||l===null)&&(l={});var f=this.library().name;return l.type||(f.indexOf("ios")>-1&&(l.type="ios"),f.indexOf("android")>-1&&(l.type="android")),l},u.userAgent=a.proxy("context.userAgent"),u.timezone=a.proxy("context.timezone"),u.timestamp=a.field("timestamp"),u.channel=a.field("channel"),u.ip=a.proxy("context.
4ip"),u.userId=a.field("userId"),e.default(u);function c(l){return r.clone(l)}return Ie}var Re={},hr={exports:{}},Jo;function De(){return Jo||(Jo=1,typeof Object.create=="function"?hr.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:hr.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}}),hr.exports}var $o;function ld(){if($o)return Re;$o=1;var t=Re&&Re.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(Re,"__esModule",{value:!0}),Re.Alias=void 0;var e=t(De()),r=Pe();function n(i,o){r.Facade.call(this,i,o)}return Re.Alias=n,e.default(n,r.Facade),n.prototype.action=function(){return"alias"},n.prototype.type=n.prototype.action,n.prototype.previousId=function(){return this.field("previousId")||this.field("from")},n.prototype.from=n.prototype.previousId,n.prototype.userId=function(){return this.field("userId")||this.field("to")},n.prototype.to=n.prototype.userId,Re}var Ne={},pr={},Yo;function vr(){if(Yo)return pr;Yo=1,Object.defineProperty(pr,"__esModule",{value:!0});var t=/.+\@.+\..+/;function e(r){return t.test(r)}return pr.default=e,pr}var Qo;function fd(){if(Qo)return Ne;Qo=1;var t=Ne&&Ne.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.Group=void 0;var e=t(De()),r=t(vr()),n=t(On()),i=Pe();function o(a,u){i.Facade.call(this,a,u)}Ne.Group=o,e.default(o,i.Facade);var s=o.prototype;return s.action=function(){return"group"},s.type=s.action,s.groupId=i.Facade.field("groupId"),s.created=function(){var a=this.proxy("traits.createdAt")||this.proxy("traits.created")||this.proxy("properties.createdAt")||this.proxy("properties.created");if(a)return n.default(a)},s.email=function(){var a=this.proxy("traits.email");if(a)return a;var u=this.groupId();if(r.default(u))return u},s.traits=function(a){var u=this.properties(),c=this.groupId();a=a||{},c&&(u.id=c);for(var l in a)if(Object.prototype.hasOwnProperty.call(a,l)){var f=this[l]==null?this.proxy("traits."+l):this[l]();if(f==null)continue;u[a[l]]=f,delete u[l]}return u},s.name=i.Facade.proxy("traits.name"),s.industry=i.Facade.proxy("traits.industry"),s.employees=i.Facade.proxy("traits.employees"),s.properties=function(){return this.field("traits")||this.field("properties")||{}},Ne}var je={},Xo;function Zo(){if(Xo)return je;Xo=1;var t=je&&je.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(je,"__esModule",{value:!0}),je.Identify=void 0;var e=Pe(),r=t(ur()),n=t(De()),i=t(vr()),o=t(On()),s=function(c){return c.trim()};function a(c,l){e.Facade.call(this,c,l)}je.Identify=a,n.default(a,e.Facade);var u=a.prototype;return u.action=function(){return"identify"},u.type=u.action,u.traits=function(c){var l=this.field("traits")||{},f=this.userId();c=c||{},f&&(l.id=f);for(var d in c){var h=this[d]==null?this.proxy("traits."+d):this[d]();h!=null&&(l[c[d]]=h,d!==c[d]&&delete l[d])}return l},u.email=function(){var c=this.proxy("traits.email");if(c)return c;var l=this.userId();if(i.default(l))return l},u.created=function(){var c=this.proxy("traits.created")||this.proxy("traits.createdAt");if(c)return o.default(c)},u.companyCreated=function(){var c=this.proxy("traits.company.created")||this.proxy("traits.company.createdAt");if(c)return o.default(c)},u.companyName=function(){return this.proxy("traits.company.name")},u.name=function(){var c=this.proxy("traits.name");if(typeof c=="string")return s(c);var l=this.firstName(),f=this.lastName();if(l&&f)return s(l+" "+f)},u.firstName=function(){var c=this.proxy("traits.firstName");if(typeof c=="string")return s(c);var l=this.proxy("traits.name");if(typeof l=="string")return s(l).split(" ")[0]},u.lastName=function(){var c=this.proxy("traits.lastName");if(typeof c=="string")return s(c);var l=this.proxy("traits.name");if(typeof l=="string"){var f=s(l).indexOf(" ");if(f!==-1)return s(l.substr(f+1))}},u.uid=function(){return this.userId()||this.username()||this.email()},u.description=function(){return this.proxy("traits.description")||this.proxy("traits.background")},u.age=function(){var c=this.birthday(),l=r.default(this.traits(),"age");if(l!=null)return l;if(c instanceof Date){var f=new Date;return f.getFullYear()-c.getFullYear()}},u.avatar=function(){var c=this.traits();return r.default(c,"avatar")||r.default(c,"photoUrl")||r.default(c,"avatarUrl")},u.position=function(){var c=this.traits();return r.default(c,"position")||r.default(c,"jobTitle")},u.username=e.Facade.proxy("traits.username"),u.website=e.Facade.one("traits.website"),u.websites=e.Facade.multi("traits.website"),u.phone=e.Facade.one("traits.phone"),u.phones=e.Facade.multi("traits.phone"),u.address=e.Facade.proxy("traits.address"),u.gender=e.Facade.proxy("traits.gender"),u.birthday=e.Facade.proxy("traits.birthday"),je}var Fe={},ea;function xn(){if(ea)return Fe;ea=1;var t=Fe&&Fe.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};
4Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.Track=void 0;var e=t(De()),r=Pe(),n=Zo(),i=t(vr()),o=t(ur());function s(c,l){r.Facade.call(this,c,l)}Fe.Track=s,e.default(s,r.Facade);var a=s.prototype;a.action=function(){return"track"},a.type=a.action,a.event=r.Facade.field("event"),a.value=r.Facade.proxy("properties.value"),a.category=r.Facade.proxy("properties.category"),a.id=r.Facade.proxy("properties.id"),a.productId=function(){return this.proxy("properties.product_id")||this.proxy("properties.productId")},a.promotionId=function(){return this.proxy("properties.promotion_id")||this.proxy("properties.promotionId")},a.cartId=function(){return this.proxy("properties.cart_id")||this.proxy("properties.cartId")},a.checkoutId=function(){return this.proxy("properties.checkout_id")||this.proxy("properties.checkoutId")},a.paymentId=function(){return this.proxy("properties.payment_id")||this.proxy("properties.paymentId")},a.couponId=function(){return this.proxy("properties.coupon_id")||this.proxy("properties.couponId")},a.wishlistId=function(){return this.proxy("properties.wishlist_id")||this.proxy("properties.wishlistId")},a.reviewId=function(){return this.proxy("properties.review_id")||this.proxy("properties.reviewId")},a.orderId=function(){return this.proxy("properties.id")||this.proxy("properties.order_id")||this.proxy("properties.orderId")},a.sku=r.Facade.proxy("properties.sku"),a.tax=r.Facade.proxy("properties.tax"),a.name=r.Facade.proxy("properties.name"),a.price=r.Facade.proxy("properties.price"),a.total=r.Facade.proxy("properties.total"),a.repeat=r.Facade.proxy("properties.repeat"),a.coupon=r.Facade.proxy("properties.coupon"),a.shipping=r.Facade.proxy("properties.shipping"),a.discount=r.Facade.proxy("properties.discount"),a.shippingMethod=function(){return this.proxy("properties.shipping_method")||this.proxy("properties.shippingMethod")},a.paymentMethod=function(){return this.proxy("properties.payment_method")||this.proxy("properties.paymentMethod")},a.description=r.Facade.proxy("properties.description"),a.plan=r.Facade.proxy("properties.plan"),a.subtotal=function(){var c=o.default(this.properties(),"subtotal"),l=this.total()||this.revenue();if(c)return c;if(!l)return 0;if(this.total()){var f=this.tax();f&&(l-=f),f=this.shipping(),f&&(l-=f),f=this.discount(),f&&(l+=f)}return l},a.products=function(){var c=this.properties(),l=o.default(c,"products");return Array.isArray(l)?l.filter(function(f){return f!==null}):[]},a.quantity=function(){var c=this.obj.properties||{};return c.quantity||1},a.currency=function(){var c=this.obj.properties||{};return c.currency||"USD"},a.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")},a.query=r.Facade.proxy("options.query"),a.properties=function(c){var l=this.field("properties")||{};c=c||{};for(var f in c)if(Object.prototype.hasOwnProperty.call(c,f)){var d=this[f]==null?this.proxy("properties."+f):this[f]();if(d==null)continue;l[c[f]]=d,delete l[f]}return l},a.username=function(){return this.proxy("traits.username")||this.proxy("properties.username")||this.userId()||this.sessionId()},a.email=function(){var c=this.proxy("traits.email")||this.proxy("properties.email")||this.proxy("options.traits.email");if(c)return c;var l=this.userId();if(i.default(l))return l},a.revenue=function(){var c=this.proxy("properties.revenue"),l=this.event(),f=/^[ _]?completed[ _]?order[ _]?|^[ _]?order[ _]?completed[ _]?$/i;return!c&&l&&l.match(f)&&(c=this.proxy("properties.total")),u(c)},a.cents=function(){var c=this.revenue();return typeof c!="number"?this.value()||0:c*100},a.identify=function(){var c=this.json();return c.traits=this.traits(),new n.Identify(c,this.opts)};function u(c){if(c){if(typeof c=="number")return c;if(typeof c=="string"&&(c=c.replace(/\$/g,""),c=parseFloat(c),!isNaN(c)))return c}}return Fe}var Be={},ta;function ra(){if(ta)return Be;ta=1;var t=Be&&Be.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(Be,"__esModule",{value:!0}),Be.Page=void 0;var e=t(De()),r=Pe(),n=xn(),i=t(vr());function o(a,u){r.Facade.call(this,a,u)}Be.Page=o,e.default(o,r.Facade);var s=o.prototype;return s.action=function(){return"page"},s.type=s.action,s.category=r.Facade.field("category"),s.name=r.Facade.field("name"),s.title=r.Facade.proxy("properties.title"),s.path=r.Facade.proxy("properties.path"),s.url=r.Facade.proxy("properties.url"),s.referrer=function(){return this.proxy("context.referrer.url")||this.proxy("context.page.referrer")||this.proxy("properties.referrer")},s.properties=function(a){var u=this.field("properties")||{},c=this.category(),l=this.name();a=a||{},c&&(u.category=c),l&&(u.name=l);for(var f in a)if(Object.prototype.hasOwnProperty.call(a,f)){var d=this[f]==null?this.proxy("properties."+f):this[f]();if(d==null)continue;u[a[f]]=d,f!==a[f]&&delete u[f]}return u},s.email=function(){var a=this.proxy("context.traits.email")||this.proxy("properties.email");if(a)return a;var u=this.userId();if(i.default(u))return u},s.fullName=function(){var a=this.category(),u=this.name();return u&&a?a+" "+u:u},s.event=function(a){return a?"Viewed "+a+" Page":"Loaded a Page"},s.track=function(a){var u=this.json();return u.event=this.event(a),u.timestamp=this.timestamp(),u.properties=this.properties(),new n.Track(u,this.opts)},Be}var Ue={},na;function dd(){if(na)return Ue;na=1;var t=Ue&&Ue.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};
4Object.defineProperty(Ue,"__esModule",{value:!0}),Ue.Screen=void 0;var e=t(De()),r=ra(),n=xn();function i(o,s){r.Page.call(this,o,s)}return Ue.Screen=i,e.default(i,r.Page),i.prototype.action=function(){return"screen"},i.prototype.type=i.prototype.action,i.prototype.event=function(o){return o?"Viewed "+o+" Screen":"Loaded a Screen"},i.prototype.track=function(o){var s=this.json();return s.event=this.event(o),s.timestamp=this.timestamp(),s.properties=this.properties(),new n.Track(s,this.opts)},Ue}var ze={},ia;function hd(){if(ia)return ze;ia=1;var t=ze&&ze.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(ze,"__esModule",{value:!0}),ze.Delete=void 0;var e=t(De()),r=Pe();function n(i,o){r.Facade.call(this,i,o)}return ze.Delete=n,e.default(n,r.Facade),n.prototype.type=function(){return"delete"},ze}var oa;function pd(){return oa||(oa=1,(function(t){var e=Tt&&Tt.__assign||function(){return e=Object.assign||function(l){for(var f,d=1,h=arguments.length;d<h;d++){f=arguments[d];for(var p in f)Object.prototype.hasOwnProperty.call(f,p)&&(l[p]=f[p])}return l},e.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.Delete=t.Screen=t.Page=t.Track=t.Identify=t.Group=t.Alias=t.Facade=void 0;var r=Pe();Object.defineProperty(t,"Facade",{enumerable:!0,get:function(){return r.Facade}});var n=ld();Object.defineProperty(t,"Alias",{enumerable:!0,get:function(){return n.Alias}});var i=fd();Object.defineProperty(t,"Group",{enumerable:!0,get:function(){return i.Group}});var o=Zo();Object.defineProperty(t,"Identify",{enumerable:!0,get:function(){return o.Identify}});var s=xn();Object.defineProperty(t,"Track",{enumerable:!0,get:function(){return s.Track}});var a=ra();Object.defineProperty(t,"Page",{enumerable:!0,get:function(){return a.Page}});var u=dd();Object.defineProperty(t,"Screen",{enumerable:!0,get:function(){return u.Screen}});var c=hd();Object.defineProperty(t,"Delete",{enumerable:!0,get:function(){return c.Delete}}),t.default=e(e({},r.Facade),{Alias:n.Alias,Group:i.Group,Identify:o.Identify,Track:s.Track,Page:a.Page,Screen:u.Screen,Delete:c.Delete})})(Tt)),Tt}var J=pd();function gr(t,e){var r=new J.Facade(t,e);return t.type==="track"&&(r=new J.Track(t,e)),t.type==="identify"&&(r=new J.Identify(t,e)),t.type==="page"&&(r=new J.Page(t,e)),t.type==="alias"&&(r=new J.Alias(t,e)),t.type==="group"&&(r=new J.Group(t,e)),t.type==="screen"&&(r=new J.Screen(t,e)),Object.defineProperty(r,"obj",{value:t,writable:!0}),r}var vd=function(t){var e=!1;window.addEventListener("pagehide",function(){e||(e=!0,t(e))}),document.addEventListener("visibilitychange",function(){if(document.visibilityState=="hidden"){if(e)return;e=!0}else e=!1;t(e)})},aa=(function(t){H(e,t);function e(r,n){var i=t.call(this,r)||this;return i.retryTimeout=n,i.name="RateLimitError",i}return e})(Error),sa=function(t){return w({"Content-Type":"text/plain"},typeof t=="function"?t():t)},gd=500,yd=64;function Mn(t){var e=encodeURI(JSON.stringify(t)).split(/%..|./).length-1;return e/1024}function md(t){return Mn(t)>=gd-50}function bd(t){return Mn(t)>=yd-10}function wd(t){var e=[],r=0;return t.forEach(function(n){var i=Mn(e[r]);i>=64&&r++,e[r]?e[r].push(n):e[r]=[n]}),e}function _d(t,e){var r,n,i=[],o=!1,s=(r=e?.size)!==null&&r!==void 0?r:10,a=(n=e?.timeout)!==null&&n!==void 0?n:5e3,u=0;function c(p){var g;if(p.length!==0){var v=(g=p[0])===null||g===void 0?void 0:g.writeKey,y=p.map(function(m){var S=m;S.sentAt;var _=fo(S,["sentAt"]);return _});return rr("https://".concat(t,"/b"),{credentials:e?.credentials,keepalive:e?.keepalive||o,headers:sa(e?.headers),method:"post",body:JSON.stringify({writeKey:v,batch:y,sentAt:new Date().toISOString()}),priority:e?.priority}).then(function(m){var S;if(m.status>=500)throw new Error("Bad response from server: ".concat(m.status));if(m.status===429){var _=(S=m.headers)===null||S===void 0?void 0:S.get("x-ratelimit-reset"),b=typeof _=="string"?parseInt(_)*1e3:a;throw new aa("Rate limit exceeded: ".concat(m.status),b)}})}}function l(p){var g;return p===void 0&&(p=1),O(this,void 0,void 0,function(){var v;return C(this,function(y){return i.length?(v=i,i=[],[2,(g=c(v))===null||g===void 0?void 0:g.catch(function(m){var S,_=te.system();_.log("error","Error sending batch",m),p<=((S=e?.maxRetries)!==null&&S!==void 0?S:10)&&(m.name==="RateLimitError"&&(u=m.retryTimeout),i.push.apply(i,v),i.map(function(b){if("_metadata"in b){var E=b;E._metadata=w(w({},E._metadata),{retryCount:p})}}),d(p+1))})]):[2]})})}var f;function d(p){p===void 0&&(p=1),!f&&(f=setTimeout(function(){f=void 0,l(p).catch(console.error)},u||a),u=0)}vd(function(p){if(o=p,o&&i.length){var g=wd(i).map(c);Promise.all(g).catch(console.error)}});function h(p,g){return O(this,void 0,void 0,function(){var v;return C(this,function(y){return i.push(g),v=i.length>=s||md(i)||e?.keepalive&&bd(i),[2,v||o?l():d()]})})}return{dispatch:h}}function Sd(t){function e(r,n){return rr(r,{credentials:t?.credentials,keepalive:t?.keepalive,headers:sa(t?.headers),method:"post",body:JSON.stringify(n),priority:t?.priority}).then(function(i){var o;if(i.status>=500)throw new Error("Bad response from server: ".concat(i.status));if(i.status===429){var s=(o=i.headers)===null||o===void 0?void 0:o.get("x-ratelimit-reset"),a=s?parseInt(s)*1e3:5e3;throw new aa("Rate limit exceeded: ".concat(i.status),a)}})}return{dispatch:e}}function Ed(t,e,r,n,i){var o,s=t.user();delete e.options,e.writeKey=r?.apiKey,e.userId=e.userId||s.id(),e.anonymousId=e.anonymousId||s.anonymousId(),e.sentAt=new Date;var a=t.queue.failedInitializations||[];a.length>0&&(e._metadata={failedInitializations:a}),i!=null&&(i.attempts>1&&(e._metadata=w(w({},e._metadata),{retryCount:i.attempts})),i.attempts++);var u=[],c=[];for(var l in n){var f=n[l];l==="Segment.io"&&u.push(l),f.bundlingStatus==="bundled"&&u.push(l),f.bundlingStatus==="unbundled"&&c.push(l)}for(var d=0,h=r?.unbundledIntegrations||[];d<h.length;d++){var p=h[d];c.includes(p)||c.push(p)}var g=(o=r?.maybeBundledConfigIds)!==null&&o!==void 0?o:{},v=[];
vendor: 4,949 bytes, line 4
4return u.sort().forEach(function(y){var m;((m=g[y])!==null&&m!==void 0?m:[]).forEach(function(S){v.push(S)})}),r?.addBundledMetadata!==!1&&(e._metadata=w(w({},e._metadata),{bundled:u.sort(),unbundled:c.sort(),bundledIds:v})),e}var ua=function(t,e){return O(void 0,void 0,void 0,function(){var r;return C(this,function(n){return r=function(i){return O(void 0,void 0,void 0,function(){var o;return C(this,function(s){switch(s.label){case 0:return t(i)?(o=r,[4,e()]):[3,2];case 1:return[2,o.apply(void 0,[s.sent()])];case 2:return[2]}})})},[2,r(void 0)]})})};function Od(t,e){return O(this,void 0,void 0,function(){var r,n=this;return C(this,function(i){switch(i.label){case 0:return r=[],ve()?[2,e]:[4,ua(function(){return e.length>0&&!ve()},function(){return O(n,void 0,void 0,function(){var o,s,a;return C(this,function(u){switch(u.label){case 0:return o=e.pop(),o?[4,at(o,t)]:[2];case 1:return s=u.sent(),a=s instanceof te,a||r.push(o),[2]}})})})];case 1:return i.sent(),r.map(function(o){return e.pushWithBackoff(o)}),[2,e]}})})}function lt(t,e,r,n){var i=this;t||setTimeout(function(){return O(i,void 0,void 0,function(){var o,s;return C(this,function(a){switch(a.label){case 0:return o=!0,[4,Od(r,e)];case 1:return s=a.sent(),o=!1,e.todo>0&&n(o,s,r,n),[2]}})})},Math.random()*5e3)}function Cd(t,e){var r,n,i,o,s=t.user();return e.previousId=(i=(n=(r=e.previousId)!==null&&r!==void 0?r:e.from)!==null&&n!==void 0?n:s.id())!==null&&i!==void 0?i:s.anonymousId(),e.userId=(o=e.userId)!==null&&o!==void 0?o:e.to,delete e.from,delete e.to,e}var xd=function(t){return t.name==="Segment.io"};function Md(t,e,r){var n,i,o;window.addEventListener("pagehide",function(){a.push.apply(a,Array.from(u)),u.clear()});var s=(n=e?.apiKey)!==null&&n!==void 0?n:"",a=t.options.disableClientPersistence?new Xt(t.queue.queue.maxAttempts,[]):new or(t.queue.queue.maxAttempts,"".concat(s,":dest-Segment.io")),u=new Set,c=!1,l=(i=e?.apiHost)!==null&&i!==void 0?i:bo,f=(o=e?.protocol)!==null&&o!==void 0?o:"https",d="".concat(f,"://").concat(l),h=e?.deliveryStrategy,p=h&&"strategy"in h&&h.strategy==="batching"?_d(l,h.config):Sd(h?.config);function g(y){return O(this,void 0,void 0,function(){var m,S;return C(this,function(_){return ve()?(a.push(y),lt(c,a,v,lt),[2,y]):(u.add(y),m=y.event.type.charAt(0),S=gr(y.event).json(),y.event.type==="track"&&delete S.traits,y.event.type==="alias"&&(S=Cd(t,S)),a.getAttempts(y)>=a.maxAttempts?(u.delete(y),[2,y]):[2,p.dispatch("".concat(d,"/").concat(m),Ed(t,S,e,r,y)).then(function(){return y}).catch(function(b){if(y.log("error","Error sending event",b),b.name==="RateLimitError"){var E=b.retryTimeout;a.pushWithBackoff(y,E)}else a.pushWithBackoff(y);return lt(c,a,v,lt),y}).finally(function(){u.delete(y)})])})})}var v={metadata:{writeKey:s,apiHost:l,protocol:f},name:"Segment.io",type:"destination",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:g,identify:g,page:g,alias:g,group:g,screen:g};return a.todo&<(c,a,v,lt),v}var ge="This is being deprecated and will be not be available in future releases of Analytics JS",kn=dn(),Tn=kn?.analytics;function kd(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!1);var n=e?10:1,i=r?new Xt(n,[]):new or(n,t);return new Uf(i)}var Td=(function(){function t(e,r){var n;this.timeout=300,this._getSegmentPluginMetadata=function(){var o;return(o=r.plugins.find(xd))===null||o===void 0?void 0:o.metadata},this.writeKey=e.writeKey;var i={integrations:{"Segment.io":{apiKey:""}}};this.cdnSettings=(n=e.cdnSettings)!==null&&n!==void 0?n:i,this.cdnURL=e.cdnURL}return Object.defineProperty(t.prototype,"apiHost",{get:function(){var e,r;return(r=(e=this._getSegmentPluginMetadata)===null||e===void 0?void 0:e.call(this))===null||r===void 0?void 0:r.apiHost},enumerable:!1,configurable:!0}),t})();function ne(){console.warn(ge)}var ca=(function(t){H(e,t);function e(r,n,i,o,s){var a=this,u,c;a=t.call(this)||this,a._debug=!1,a.initialized=!1,a.user=function(){return a._user},a.init=a.initialize.bind(a),a.log=ne,a.addIntegrationMiddleware=ne,a.listeners=ne,a.addEventListener=ne,a.removeAllListeners=ne,a.removeListener=ne,a.removeEventListener=ne,a.hasListeners=ne,a.add=ne,a.addIntegration=ne;var l=n?.cookie,f=(u=n?.disableClientPersistence)!==null&&u!==void 0?u:!1;a.queue=i??kd("".concat(r.writeKey,":event-queue"),n?.retryQueue,f),a.settings=new Td(r,a.queue);var d=n?.storage;return a._universalStorage=a.createStore(f,d,l),a._user=o??new Io(w({persist:!f,storage:n?.storage},n?.user),l).load(),a._group=s??new Wf(w({persist:!f,storage:n?.storage},n?.group),l).load(),a.eventFactory=new Df(a._user),a.integrations=(c=n?.integrations)!==null&&c!==void 0?c:{},a.options=n??{},vn(a),a}return e.prototype.createStore=function(r,n,i){return r?new Le([new yn]):n&&Lo(n)?new Le(bn(Ao(n.stores,i))):new Le(bn([K.LocalStorage,{name:K.Cookie,settings:i},K.Memory]))},Object.defineProperty(e.prototype,"storage",{get:function(){return this._universalStorage}
vendor: 25,518 bytes, line 4
4,enumerable:!1,configurable:!0}),e.prototype.track=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return O(this,void 0,void 0,function(){var i,o,s,a,u,c,l,f=this;return C(this,function(d){return i=ut(r),o=Sf.apply(void 0,r),s=o[0],a=o[1],u=o[2],c=o[3],l=this.eventFactory.track(s,a,u,this.integrations,i),[2,this._dispatch(l,c).then(function(h){return f.emit("track",s,h.event.properties,h.event.options),h})]})})},e.prototype.page=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return O(this,void 0,void 0,function(){var i,o,s,a,u,c,l,f,d=this;return C(this,function(h){return i=ut(r),o=vo.apply(void 0,r),s=o[0],a=o[1],u=o[2],c=o[3],l=o[4],f=this.eventFactory.page(s,a,u,c,this.integrations,i),[2,this._dispatch(f,l).then(function(p){return d.emit("page",s,a,p.event.properties,p.event.options),p})]})})},e.prototype.identify=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return O(this,void 0,void 0,function(){var i,o,s,a,u,c,l,f=this;return C(this,function(d){return i=ut(r),o=go(this._user).apply(void 0,r),s=o[0],a=o[1],u=o[2],c=o[3],this._user.identify(s,a),l=this.eventFactory.identify(this._user.id(),this._user.traits(),u,this.integrations,i),[2,this._dispatch(l,c).then(function(h){return f.emit("identify",h.event.userId,h.event.traits,h.event.options),h})]})})},e.prototype.group=function(){for(var r=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=ut(n);if(n.length===0)return this._group;var s=go(this._group).apply(void 0,n),a=s[0],u=s[1],c=s[2],l=s[3];this._group.identify(a,u);var f=this._group.id(),d=this._group.traits(),h=this.eventFactory.group(f,d,c,this.integrations,o);return this._dispatch(h,l).then(function(p){return r.emit("group",p.event.groupId,p.event.traits,p.event.options),p})},e.prototype.alias=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return O(this,void 0,void 0,function(){var i,o,s,a,u,c,l,f=this;return C(this,function(d){return i=ut(r),o=Ef.apply(void 0,r),s=o[0],a=o[1],u=o[2],c=o[3],l=this.eventFactory.alias(s,a,u,this.integrations,i),[2,this._dispatch(l,c).then(function(h){return f.emit("alias",s,a,h.event.options),h})]})})},e.prototype.screen=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return O(this,void 0,void 0,function(){var i,o,s,a,u,c,l,f,d=this;return C(this,function(h){return i=ut(r),o=vo.apply(void 0,r),s=o[0],a=o[1],u=o[2],c=o[3],l=o[4],f=this.eventFactory.screen(s,a,u,c,this.integrations,i),[2,this._dispatch(f,l).then(function(p){return d.emit("screen",s,a,p.event.properties,p.event.options),p})]})})},e.prototype.trackClick=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return O(this,void 0,void 0,function(){var i,o;return C(this,function(s){switch(s.label){case 0:return[4,Promise.resolve().then(()=>br)];case 1:return i=s.sent(),[2,(o=i.link).call.apply(o,D([this],r,!1))]}})})},e.prototype.trackLink=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return O(this,void 0,void 0,function(){var i,o;return C(this,function(s){switch(s.label){case 0:return[4,Promise.resolve().then(()=>br)];case 1:return i=s.sent(),[2,(o=i.link).call.apply(o,D([this],r,!1))]}})})},e.prototype.trackSubmit=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return O(this,void 0,void 0,function(){var i,o;return C(this,function(s){switch(s.label){case 0:return[4,Promise.resolve().then(()=>br)];case 1:return i=s.sent(),[2,(o=i.form).call.apply(o,D([this],r,!1))]}})})},e.prototype.trackForm=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return O(this,void 0,void 0,function(){var i,o;return C(this,function(s){switch(s.label){case 0:return[4,Promise.resolve().then(()=>br)];case 1:return i=s.sent(),[2,(o=i.form).call.apply(o,D([this],r,!1))]}})})},e.prototype.register=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return O(this,void 0,void 0,function(){var i,o,s=this;return C(this,function(a){switch(a.label){case 0:return i=te.system(),o=r.map(function(u){return s.queue.register(i,u,s)}),[4,Promise.all(o)];case 1:return a.sent(),[2,i]}})})},e.prototype.deregister=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return O(this,void 0,void 0,function(){var i,o,s=this;return C(this,function(a){switch(a.label){case 0:return i=te.system(),o=r.map(function(u){var c=s.queue.plugins.find(function(l){return l.name===u});if(c)return s.queue.deregister(i,c,s);i.log("warn","plugin ".concat(u," not found"))}),[4,Promise.all(o)];case 1:return a.sent(),[2,i]}})})},e.prototype.debug=function(r){return r===!1&&localStorage.getItem("debug")&&localStorage.removeItem("debug"),this._debug=r,this},e.prototype.reset=function(){this._user.reset(),this._group.reset(),this.emit("reset")},e.prototype.timeout=function(r){this.settings.timeout=r},e.prototype._dispatch=function(r,n){return O(this,void 0,void 0,function(){var i;return C(this,function(o){return i=new te(r),i.stats.increment("analytics_js.invoke",1,[r.type]),ve()&&!this.options.retryQueue?[2,i]:[2,_f(i,this.queue,this,{callback:n,debug:this._debug,timeout:this.settings.timeout})]})})},e.prototype.addSourceMiddleware=function(r){return O(this,void 0,void 0,function(){var n=this;return C(this,function(i){switch(i.label){case 0:return[4,this.queue.criticalTasks.run(function(){return O(n,void 0,void 0,function(){var o,s,a;return C(this,function(u){switch(u.label){case 0:return[4,Promise.resolve().then(()=>Vd)];case 1:return o=u.sent().sourceMiddlewarePlugin,s={},this.queue.plugins.forEach(function(c){if(c.type==="destination")return s[c.name]=!0}),a=o(r,s),[4,this.register(a)];case 2:return u.sent(),[2]}})})})];case 1:return i.sent(),[2,this]}})})},e.prototype.addDestinationMiddleware=function(r){for(var n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];return this.queue.plugins.filter(Nf).forEach(function(o){(r==="*"||o.name.toLowerCase()===r.toLowerCase())&&o.addMiddleware.apply(o,n)}),Promise.resolve(this)},e.prototype.setAnonymousId=function(r){return this._user.anonymousId(r)},e.prototype.queryString=function(r){return O(this,void 0,void 0,function(){var n;return C(this,function(i){switch(i.label){case 0:return this.options.useQueryString===!1?[2,[]]:[4,Promise.resolve().then(()=>ep)];case 1:return n=i.sent().queryString,[2,n(this,r)]}})})},e.prototype.use=function(r){return r(this),this},e.prototype.ready=function(r){return r===void 0&&(r=function(n){return n}),O(this,void 0,void 0,function(){return C(this,function(n){return[2,Promise.all(this.queue.plugins.map(function(i){return i.ready?i.ready():Promise.resolve()})).then(function(i){return r(i),i})]})})},e.prototype.noConflict=function(){return console.warn(ge),$f(Tn??this),this},e.prototype.normalize=function(r){return console.warn(ge),this.eventFactory.normalize(r)},Object.defineProperty(e.prototype,"failedInitializations",{get:function(){return console.warn(ge),this.queue.failedInitializations},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"VERSION",{get:function(){return nr},enumerable:!1,configurable:!0}),e.prototype.initialize=function(r,n){return O(this,void 0,void 0,function(){return C(this,function(i){return console.warn(ge),[2,Promise.resolve(this)]})})},e.prototype.pageview=function(r){return O(this,void 0,void 0,function(){return C(this,function(n){switch(n.label){case 0:return console.warn(ge),[4,this.page({path:r})];case 1:return n.sent(),[2,this]}})})},Object.defineProperty(e.prototype,"plugins",{get:function(){var r;return console.warn(ge),(r=this._plugins)!==null&&r!==void 0?r:{}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Integrations",{get:function(){console.warn(ge);var r=this.queue.plugins.filter(function(n){return n.type==="destination"}).reduce(function(n,i){var o="".concat(i.name.toLowerCase().replace(".","").split(" ").join("-"),"Integration"),s=window[o];if(!s)return n;var a=s.Integration;return a?(n[i.name]=a,n):(n[i.name]=s,n)},{});return r},enumerable:!1,configurable:!0}),e.prototype.push=function(r){var n=this,i=r.shift();i&&!n[i]||n[i].apply(this,r)},e})(cn),la=(function(t){H(e,t);function e(){var r=t.call(this,{writeKey:""},{disableClientPersistence:!0})||this;return r.initialized=!0,r}return e})(ca);function fa(){return typeof process>"u"||!process.env?{}:process.env}var Ld=/(https:\/\/.*)\/analytics\.js\/v1\/(?:.*?)\/(?:platform|analytics.*)?/,Ad=function(){var t,e=Array.prototype.slice.call(document.querySelectorAll("script"));return e.forEach(function(r){var n,i=(n=r.getAttribute("src"))!==null&&n!==void 0?n:"",o=Ld.exec(i);o&&o[1]&&(t=o[1])}),t},yr,Id=function(){var t,e=yr??((t=Ro())===null||t===void 0?void 0:t._cdn);return e},Pd=function(t){var e=Ro();e&&(e._cdn=t),yr=t},Ln=function(){var t=Id();if(t)return t;var e=Ad();return e||"https://cdn.segment.com"},An=function(){var t=Ln();return"".concat(t,"/next-integrations")};function da(t,e){var r,n=Object.entries((r=e.integrations)!==null&&r!==void 0?r:{}).reduce(function(i,o){var s,a,u=o[0],c=o[1];return typeof c=="object"?w(w({},i),(s={},s[u]=c,s)):w(w({},i),(a={},a[u]={},a))},{});return Object.entries(t.integrations).reduce(function(i,o){var s,a=o[0],u=o[1];return w(w({},i),(s={},s[a]=w(w({},u),n[a]),s))},{})}function ha(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch{return t}}function Rd(t){return O(this,void 0,void 0,function(){var e;return C(this,function(r){return e=navigator.userAgentData,e?t?[2,e.getHighEntropyValues(t).catch(function(){return e.toJSON()})]:[2,e.toJSON()]:[2,void 0]})})}var At;function Dd(){if(At)return At;var t=ko(window.location.href);return At={expires:31536e6,secure:!1,path:"/"},t&&(At.domain=t),At}function Nd(t){var e={btid:"dataxu",urid:"millennial-media"};t.startsWith("?")&&(t=t.substring(1)),t=t.replace(/\?/g,"&");for(var r=t.split("&"),n=0,i=r;n<i.length;n++){var o=i[n],s=o.split("="),a=s[0],u=s[1];if(e[a])return{id:u,type:e[a]}}}function jd(t){return t.startsWith("?")&&(t=t.substring(1)),t=t.replace(/\?/g,"&"),t.split("&").reduce(function(e,r){var n=r.split("="),i=n[0],o=n[1],s=o===void 0?"":o;if(i.includes("utm_")&&i.length>4){var a=i.slice(4);a==="campaign"&&(a="name"),e[a]=ha(s)}return e},{})}function Fd(){var t=se.get("_ga");if(t&&t.startsWith("amp"))return t}function Bd(t,e,r){var n,i=new Le(r?[]:[new To(Dd())]),o=i.get("s:context.referrer"),s=(n=Nd(t))!==null&&n!==void 0?n:o;s&&(e&&(e.referrer=w(w({},e.referrer),s)),i.set("s:context.referrer",s))}var Ud=function(t){try{var e=new URLSearchParams;return Object.entries(t).forEach(function(r){var n=r[0],i=r[1];Array.isArray(i)?i.forEach(function(o){return e.append(n,o)}):e.append(n,i)}),e.toString()}catch{return""}},zd=(function(){function t(){var e=this;this.name="Page Enrichment",this.type="before",this.version="0.1.0",this.isLoaded=function(){return!0},this.load=function(r,n){return O(e,void 0,void 0,function(){var i;return C(this,function(o){switch(o.label){case 0:this.instance=n,o.label=1;case 1:return o.trys.push([1,3,,4]),i=this,[4,Rd(this.instance.options.highEntropyValuesClientHints)];case 2:return i.userAgentData=o.sent(),[3,4];case 3:return o.sent(),[3,4];case 4:return[2,Promise.resolve()]}})})},this.enrich=function(r){var n,i,o=r.event.context,s=o.page.search||"",a=typeof s=="object"?Ud(s):s;o.userAgent=navigator.userAgent,o.userAgentData=e.userAgentData;var u=navigator.userLanguage||navigator.language;typeof o.locale>"u"&&typeof u<"u"&&(o.locale=u),(n=o.library)!==null&&n!==void 0||(o.library={name:"analytics.js",version:"".concat("npm:next","-").concat(nr)}),a&&!o.campaign&&(o.campaign=jd(a));var c=Fd();c&&(o.amp={id:c}),Bd(a,o,(i=e.instance.options.disableClientPersistence)!==null&&i!==void 0?i:!1);try{o.timezone=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}return r},this.track=this.enrich,this.identify=this.enrich,this.page=this.enrich,this.group=this.enrich,this.alias=this.enrich,this.screen=this.enrich}return t})(),qd=new zd;function pa(t){var e=Array.prototype.slice.call(window.document.querySelectorAll("script"));return e.find(function(r){return r.src===t})}function ft(t,e){var r=pa(t);if(r!==void 0){var n=r?.getAttribute("status");if(n==="loaded")return Promise.resolve(r);if(n==="loading")return new Promise(function(i,o){r.addEventListener("load",function(){return i(r)}),r.addEventListener("error",function(s){return o(s)})})}return new Promise(function(i,o){var s,a=window.document.createElement("script");a.type="text/javascript",a.src=t,a.async=!0,a.setAttribute("status","loading");for(var u=0,c=Object.entries({});u<c.length;u++){var l=c[u],f=l[0],d=l[1];a.setAttribute(f,d)}a.onload=function(){a.onerror=a.onload=null,a.setAttribute("status","loaded"),i(a)},a.onerror=function(){a.onerror=a.onload=null,a.setAttribute("status","error"),o(new Error("Failed to load ".concat(t)))};var h=window.document.querySelector("script");h?(s=h.parentElement)===null||s===void 0||s.insertBefore(a,h):window.document.head.appendChild(a)})}function Gd(t){var e=pa(t);return e!==void 0&&e.remove(),Promise.resolve()}function In(t,e,r){return O(this,void 0,void 0,function(){function n(c,l){return O(this,void 0,void 0,function(){var f,d,h;return C(this,function(p){switch(p.label){case 0:return f=!1,d=null,[4,l({payload:gr(c,{clone:!0,traverse:!1}),integration:t,next:function(g){f=!0,g===null&&(d=null),g&&(d=g.obj)}})];case 1:return p.sent(),!f&&d!==null&&(d=d,d.integrations=w(w({},c.integrations),(h={},h[t]=!1,h))),[2,d]}})})}var i,o,s,a,u;return C(this,function(c){switch(c.label){case 0:i=gr(e,{clone:!0,traverse:!1}).rawEvent(),o=0,s=r,c.label=1;case 1:return o<s.length?(a=s[o],[4,n(i,a)]):[3,4];case 2:if(u=c.sent(),u===null)return[2,null];i=u,c.label=3;case 3:return o++,[3,1];case 4:return[2,i]}})})}function Hd(t,e){function r(n){return O(this,void 0,void 0,function(){var i;return C(this,function(o){switch(o.label){case 0:return i=!1,[4,t({payload:gr(n.event,{clone:!0,traverse:!1}),integrations:e??{},next:function(s){i=!0,s&&(n.event=s.obj)}})];case 1:if(o.sent(),!i)throw new pe({retry:!1,type:"middleware_cancellation",reason:"Middleware `next` function skipped"});return[2,n]}})})}return{name:"Source Middleware ".concat(t.name),type:"before",version:"0.1.0",isLoaded:function(){return!0},load:function(n){return Promise.resolve(n)},track:r,page:r,screen:r,identify:r,alias:r,group:r}}const Vd=Object.freeze(Object.defineProperty({__proto__:null,applyDestinationMiddleware:In,sourceMiddlewarePlugin:Hd},Symbol.toStringTag,{value:"Module"}));function ye(t,e){var r=e.methodName,n=e.integrationName,i=e.type,o=e.didError,s=o===void 0?!1:o;t.stats.increment("analytics_js.integration.invoke".concat(s?".error":""),1,["method:".concat(r),"integration_name:".concat(n),"type:".concat(i)])}var Kd=(function(){function t(e,r){this.version="1.0.0",this.alternativeNames=[],this.loadPromise=Qt(),this.middleware=[],this.alias=this._createMethod("alias"),this.group=this._createMethod("group"),this.identify=this._createMethod("identify"),this.page=this._createMethod("page"),this.screen=this._createMethod("screen"),this.track=this._createMethod("track"),this.action=r,this.name=e,this.type=r.type,this.alternativeNames.push(r.name)}return t.prototype.addMiddleware=function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];this.type==="destination"&&(e=this.middleware).push.apply(e,r)},t.prototype.transform=function(e){return O(this,void 0,void 0,function(){var r;return C(this,function(n){switch(n.label){case 0:return[4,In(this.name,e.event,this.middleware)];case 1:return r=n.sent(),r===null&&e.cancel(new pe({retry:!1,reason:"dropped by destination middleware"})),[2,new te(r)]}})})},t.prototype._createMethod=function(e){var r=this;return function(n){return O(r,void 0,void 0,function(){var i,o;return C(this,function(s){switch(s.label){case 0:return this.action[e]?(i=n,this.type!=="destination"?[3,2]:[4,this.transform(n)]):[2,n];case 1:i=s.sent(),s.label=2;case 2:return s.trys.push([2,5,,6]),[4,this.ready()];case 3:if(!s.sent())throw new Error("Something prevented the destination from getting ready");return ye(n,{integrationName:this.action.name,methodName:e,type:"action"}),[4,this.action[e](i)];case 4:return s.sent(),[3,6];case 5:throw o=s.sent(),ye(n,{integrationName:this.action.name,methodName:e,type:"action",didError:!0}),o;case 6:return[2,n]}})})}},t.prototype.isLoaded=function(){return this.action.isLoaded()},t.prototype.ready=function(){return O(this,void 0,void 0,function(){return C(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.loadPromise.promise];case 1:return e.sent(),[2,!0];case 2:return e.sent(),[2,!1];case 3:return[2]}})})},t.prototype.load=function(e,r){return O(this,void 0,void 0,function(){var n,i,o,s;return C(this,function(a){switch(a.label){case 0:if(this.loadPromise.isSettled())return[2,this.loadPromise.promise];a.label=1;case 1:return a.trys.push([1,3,,4]),ye(e,{integrationName:this.action.name,methodName:"load",type:"action"}),n=this.action.load(e,r),o=(i=this.loadPromise).resolve,[4,n];case 2:return o.apply(i,[a.sent()]),[2,n];case 3:throw s=a.sent(),ye(e,{integrationName:this.action.name,methodName:"load",type:"action",didError:!0}),this.loadPromise.reject(s),s;case 4:return[2]}})})},t.prototype.unload=function(e,r){var n,i;return(i=(n=this.action).unload)===null||i===void 0?void 0:i.call(n,e,r)},t})();function Wd(t){if(!Array.isArray(t))throw new Error("Not a valid list of plugins");var e=["load","isLoaded","name","version","type"];return t.forEach(function(r){e.forEach(function(n){var i;if(r[n]===void 0)throw new Error("Plugin: ".concat((i=r.name)!==null&&i!==void 0?i:"unknown"," missing required function ").concat(n))})}),!0}function Jd(t,e){var r=t[e.creationName],n=t[e.name];return t.All===!1&&!r&&!n||r===!1||n===!1}function $d(t,e){return O(this,void 0,void 0,function(){var r,n,i,o,s,a;return C(this,function(u){switch(u.label){case 0:if(u.trys.push([0,9,,10]),r=new RegExp("https://cdn.segment.(com|build)"),n=Ln(),!e)return[3,6];i=t.url.split("/"),o=i[i.length-2],s=t.url.replace(o,btoa(o).replace(/=/g,"")),u.label=1;case 1:return u.trys.push([1,3,,5]),[4,ft(s.replace(r,n))];case 2:return u.sent(),[3,5];case 3:return u.sent(),[4,ft(t.url.replace(r,n))];case 4:return u.sent(),[3,5];case 5:return[3,8];case 6:return[4,ft(t.url.replace(r,n))];case 7:u.sent(),u.label=8;case 8:return typeof window[t.libraryName]=="function"?[2,window[t.libraryName]]:[3,10];case 9:throw a=u.sent(),console.error("Failed to create PluginFactory",t),a;case 10:return[2]}})})}function Yd(t,e,r,n,i,o){var s,a,u;return O(this,void 0,void 0,function(){var c,l,f,d=this;return C(this,function(h){switch(h.label){case 0:return c=[],l=(a=(s=t.middlewareSettings)===null||s===void 0?void 0:s.routingRules)!==null&&a!==void 0?a:[],f=((u=t.remotePlugins)!==null&&u!==void 0?u:[]).map(function(p){return O(d,void 0,void 0,function(){var g,v,y,m,S,_,b;return C(this,function(E){switch(E.label){case 0:if(Jd(e,p))return[2];E.label=1;case 1:return E.trys.push([1,6,,7]),v=o?.find(function(x){var T=x.pluginName;return T===p.name}),v?[3,3]:[4,$d(p,n?.obfuscate)];case 2:v=E.sent(),E.label=3;case 3:return g=v,g?(y=r[p.name],[4,g(w(w({},p.settings),y))]):[3,5];case 4:m=E.sent(),S=Array.isArray(m)?m:[m],Wd(S),_=l.filter(function(x){return x.destinationName===p.creationName}),S.forEach(function(x){var T=new Kd(p.creationName,x);_.length&&i&&T.addMiddleware(i),c.push(T)}),E.label=5;case 5:return[3,7];case 6:return b=E.sent(),console.warn("Failed to load Remote Plugin",b),[3,7];case 7:return[2]}})})}),[4,Promise.all(f)];case 1:return h.sent(),[2,c.filter(Boolean)]}})})}var Pn,va,Qd=dn(),ga=(Pn=(va=Qd).__SEGMENT_INSPECTOR__)!==null&&Pn!==void 0?Pn:va.__SEGMENT_INSPECTOR__={},Xd=function(t){var e;return(e=ga.attach)===null||e===void 0?void 0:e.call(ga,t)};function Zd(t,e){return rr("".concat(e,"/v1/projects/").concat(t,"/settings")).then(function(r){return r.ok?r.json():r.text().then(function(n){throw new Error(n)})}).catch(function(r){throw console.error(r.message),r})}function eh(t){return fa().NODE_ENV!=="test"&&Object.keys(t.integrations).length>1}function th(t){var e,r,n;return fa().NODE_ENV!=="test"&&((n=(r=(e=t.middlewareSettings)===null||e===void 0?void 0:e.routingRules)===null||r===void 0?void 0:r.length)!==null&&n!==void 0?n:0)>0}function rh(t,e){ed(t,e),Zf(t,e)}function nh(t,e,r){return O(this,void 0,void 0,function(){return C(this,function(n){switch(n.label){case 0:return[4,oh(t,e)];case 1:return n.sent(),td(t,r),[2]}})})}var ih=function(){var t,e,r=(t=window.location.hash)!==null&&t!==void 0?t:"",n=(e=window.location.search)!==null&&e!==void 0?e:"",i=n.length?n:r.replace(/(?=#).*(?=\?)/,"");return i},oh=function(t,e){return O(void 0,void 0,void 0,function(){return C(this,function(r){switch(r.label){case 0:return e.includes("ajs_")?[4,t.queryString(e).catch(console.error)]:[3,2];case 1:r.sent(),r.label=2;case 2:return[2]}})})};function ah(t,e,r,n,i,o,s){var a,u,c;return i===void 0&&(i=[]),O(this,void 0,void 0,function(){var l,f,d,h,p,g,v,y,m,S,_,b,E,x,T,k=this;return C(this,function(M){switch(M.label){case 0:return rh(r,s),l=i?.filter(function(A){return typeof A=="object"}),f=i?.filter(function(A){return typeof A=="function"&&typeof A.pluginName=="string"}),th(e)?[4,Promise.resolve().then(()=>np).then(function(A){return A.tsubMiddleware(e.middlewareSettings.routingRules)})]:[3,2];case 1:return h=M.sent(),[3,3];case 2:h=void 0,M.label=3;case 3:return d=h,eh(e)||o.length>0?[4,Promise.resolve().then(()=>pp).then(function(A){return A.ajsDestinations(t,e,r.integrations,n,d,o)})]:[3,5];case 4:return g=M.sent(),[3,6];case 5:g=[],M.label=6;case 6:return p=g,e.legacyVideoPluginsEnabled?[4,Promise.resolve().then(()=>gp).then(function(A){return A.loadLegacyVideoPlugins(r)})]:[3,8];case 7:M.sent(),M.label=8;case 8:return!((a=n.plan)===null||a===void 0)&&a.track?[4,Promise.resolve().then(()=>bp).then(function(A){var I;return A.schemaFilter((I=n.plan)===null||I===void 0?void 0:I.track,e)})]:[3,10];case 9:return y=M.sent(),[3,11];case 10:y=void 0,M.label=11;case 11:return v=y,m=da(e,n),[4,Yd(e,r.integrations,m,n,d,f).catch(function(){return[]})];case 12:return S=M.sent(),_=D(D([qd],p,!0),S,!0),v&&_.push(v),b=((u=n.integrations)===null||u===void 0?void 0:u.All)===!1&&!n.integrations["Segment.io"]||n.integrations&&n.integrations["Segment.io"]===!1,b?[3,14]:(x=(E=_).push,[4,Md(r,m["Segment.io"],e.integrations)]);case 13:x.apply(E,[M.sent()]),M.label=14;case 14:return[4,r.register.apply(r,D(D([],_,!1),l,!1))];case 15:return T=M.sent(),[4,Xf(r,s)];case 16:return M.sent(),Object.entries((c=e.enabledMiddleware)!==null&&c!==void 0?c:{}).some(function(A){var I=A[1];return I})?[4,Promise.resolve().then(()=>_p).then(function(A){var I=A.remoteMiddlewares;return O(k,void 0,void 0,function(){var F,Q;return C(this,function(ie){switch(ie.label){case 0:return[4,I(T,e,n.obfuscate)];case 1:return F=ie.sent(),Q=F.map(function(He){return r.addSourceMiddleware(He)}),[2,Promise.all(Q)]}})})})]:[3,18];case 17:M.sent(),M.label=18;case 18:return[4,Qf(r,s)];case 19:return M.sent(),[2,T]}})})}function sh(t,e,r){var n,i,o,s,a,u,c,l,f;return e===void 0&&(e={}),O(this,void 0,void 0,function(){var d,h,p,g,v,y,m,S,_,b,E;return C(this,function(x){switch(x.label){case 0:return e.disable===!0?[2,[new la,te.system()]]:(e.globalAnalyticsKey&&Jf(e.globalAnalyticsKey),t.cdnURL&&Pd(t.cdnURL),e.initialPageview&&r.add(new _n("page",[])),d=ih(),h=(n=t.cdnURL)!==null&&n!==void 0?n:Ln(),(i=t.cdnSettings)!==null&&i!==void 0?(g=i,[3,3]):[3,1]);case 1:return[4,Zd(t.writeKey,h)];case 2:g=x.sent(),x.label=3;case 3:return p=g,e.updateCDNSettings&&(p=e.updateCDNSettings(p)),typeof e.disable!="function"?[3,5]:[4,e.disable(p)];case 4:if(v=x.sent(),v)return[2,[new la,te.system()]];x.label=5;case 5:return y=(s=(o=p.integrations["Segment.io"])===null||o===void 0?void 0:o.retryQueue)!==null&&s!==void 0?s:!0,e=w({retryQueue:y},e),m=new ca(w(w({},t),{cdnSettings:p,cdnURL:h}),e),Xd(m),S=(a=t.plugins)!==null&&a!==void 0?a:[],_=(u=t.classicIntegrations)!==null&&u!==void 0?u:[],b=(c=e.integrations)===null||c===void 0?void 0:c["Segment.io"],wo.initRemoteMetrics(w(w({},p.metrics),{host:(l=b?.apiHost)!==null&&l!==void 0?l:(f=p.metrics)===null||f===void 0?void 0:f.host,protocol:b?.protocol})),[4,ah(t.writeKey,p,m,e,S,_,r)];case 6:return E=x.sent(),m.initialized=!0,m.emit("initialize",t,e),[4,nh(m,d,r)];case 7:return x.sent(),[2,[m,E]]}})})}var uh=(function(t){H(e,t);function e(){var r=this,n=Qt(),i=n.promise,o=n.resolve;return r=t.call(this,function(s){return i.then(function(a){var u=a[0],c=a[1];return sh(u,c,s)})})||this,r._resolveLoadStart=function(s,a){return o([s,a])},r}return e.prototype.load=function(r,n){return n===void 0&&(n={}),this._resolveLoadStart(r,n),this},e.load=function(r,n){return n===void 0&&(n={}),new e().load(r,n)},e.standalone=function(r,n){return e.load({writeKey:r},n).then(function(i){return i[0]})},e})(nd);function Rn(t,e){window.analytics?.set&&(window.analytics.set("context.consent",t),e?.gpp&&window.analytics.set("context.gpp",e.gpp),e?.gppSid&&window.analytics.set("context.gpp_sid",e.gppSid),e?.tcfString&&window.analytics.set("context.tcfString",e.tcfString))}function ch(t){return{name:"onetrust-consent-stamper",type:"before",version:en,isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>{const{consent:r,iab:n}=t();return r?e.updateEvent("context.consent",r):console.warn("[OneTrust] Consent data missing in event context"),n?.gpp&&e.updateEvent("context.gpp",n.gpp),n?.gppSid&&e.updateEvent("context.gpp_sid",n.gppSid),n?.tcfStr
4ing&&e.updateEvent("context.tcfString",n.tcfString),e},page:function(e){return this.track?.(e)},identify:function(e){return this.track?.(e)}}}function ya(t){return function(){const e=t();return e.anonymousId=function(){return"legacy-compat-"+Math.random().toString(36).substring(2,11)},e.id=function(){return null},e.traits=function(){return{}},e}}const lh=Object.freeze(Object.defineProperty({__proto__:null,createConsentPlugin:ch,createLegacyUserObject:ya,updateAnalyticsConsent:Rn},Symbol.toStringTag,{value:"Module"})),fh=100,Dn=10,dh=25;function hh(t){return new Promise(e=>setTimeout(e,t))}let It=!1,qe=[];function ph(t){It=t,t||(qe=[])}function ma(){return It}function vh(t,e){It&&(qe.length>=fh||qe.push({method:t,args:e}))}async function gh(t){if(!It||qe.length===0)return;const e=[...qe];qe=[];for(let r=0;r<e.length;r+=Dn){const n=e.slice(r,r+Dn);for(const i of n){const o=t[i.method];if(typeof o=="function")try{o.apply(t,i.args)}catch{}}r+Dn<e.length&&await hh(dh)}}function Nn(){qe=[],It=!1}let jn=!1,Pt=[];function dt(){return()=>{}}function ht(t){return(...e)=>{vh(t,e)}}function yh(){return()=>({anonymousId:()=>"",id:()=>"",traits:()=>({})})}function mh(t){jn=!0,Pt=[];const e=t?.enableEventQueue===!0,r={track:e?ht("track"):dt(),page:e?ht("page"):dt(),identify:e?ht("identify"):dt(),group:e?ht("group"):dt(),alias:e?ht("alias"):dt(),ready:n=>{Pt.push(n)},load:n=>{r._writeKey=n},user:yh(),set:e?ht("set"):dt(),_isOneTrustStub:!0};return r}function bh(t){if(!(typeof window>"u")&&(Nn(),ph(t?.enableEventQueue===!0),!window.analytics||window.analytics?._isOneTrustStub)){const e=mh(t);window.analytics=e}}function ba(){return!!window.analytics?._isOneTrustStub}function wh(t){typeof window>"u"||!jn||(window.analytics=t,Pt.forEach(e=>{try{e()}catch(r){xe({level:"warn",message:"Error executing analytics ready callback",error:r instanceof Error?r.message:r,data:{callbackCount:Pt.length}})}}),Pt=[],ma()||Nn(),jn=!1)}async function wa(t){ma()&&(await gh(t),Nn())}let Fn=!1,Bn=!1,Un=null,zn=null,qn=0;const N={isLoading:()=>Fn,isLoaded:()=>Bn,getLoadingPromise:()=>Un,getLastError:()=>zn,getAttempts:()=>qn,setLoading:t=>{Fn=t},setLoaded:t=>{Bn=t},setLoadingPromise:t=>{Un=t},setLastError:t=>{zn=t},setAttempts:t=>{qn=t},reset:()=>{Fn=!1,Bn=!1,Un=null,zn=null,qn=0}};function Gn(t){if(!t?.categoryPreferences)return!1;const e=t.categoryPreferences||{};return Yr.some(r=>e[r]===!0)}function Hn(t){return!!t&&typeof t=="string"&&t.trim().length>0}function _a(t){return t==null?!0:typeof t=="object"}const _h=Object.freeze(Object.defineProperty({__proto__:null,hasAnalyticsConsent:Gn,isValidConsentObject:_a,isValidWriteKey:Hn},Symbol.toStringTag,{value:"Module"}));class Sh extends Error{constructor(e,r){super(r),this.name=e}}class Ge extends Sh{constructor(e,r){arguments.length===2&&(e+=` (Received: ${JSON.stringify(r)})`),super("ValidationError",`[Validation] ${e}`)}}function Rt(t,e){if(typeof t!="function")throw new Ge(`${e} is not a function`,t)}function Sa(t,e){if(t===null||typeof t!="object")throw new Ge(`${e} is not an object`,t)}function Ea(t){let e=!0;if(t&&typeof t=="object"&&!Array.isArray(t)){e=!1;for(const r in t)if(typeof t[r]!="boolean"){e=!0;break}}if(e)throw new Ge("Consent Categories should be {[categoryName: string]: boolean}",t)}function Eh(t){if(typeof t!="object"||!t)throw new Ge("Options should be an object",t);Rt(t.getCategories,"getCategories"),t.shouldLoadSegment&&Rt(t.shouldLoadSegment,"shouldLoadSegment"),t.shouldEnableIntegration&&Rt(t.shouldEnableIntegration,"shouldEnableIntegration"),t.shouldDisableSegment&&Rt(t.shouldDisableSegment,"shouldDisableSegment"),t.integrationCategoryMappings&&Sa(t.integrationCategoryMappings,"integrationCategoryMappings"),t.registerOnConsentChanged&&Rt(t.registerOnConsentChanged,"registerOnConsentChanged")}function Oh(t){if(Sa(t,"analytics"),!("load"in t&&"addSourceMiddleware"in t&&"addDestinationMiddleware"in t&&"track"in t))throw new Ge("analytics is not an Analytics instance",t)}const Oa=(t,...e)=>{const r=e.reduce((n,i)=>o=>i(n(o)),n=>n);return(...n)=>r(t(...n))};async function Ch(t,e){return new Promise((r,n)=>{if(t()){r();return}const i=()=>setTimeout(()=>{t()?r():i()},e);i()})}const xh=t=>Array.from(new Set(t)),Mh=(t,e)=>e.reduce((r,n)=>(n in t&&(r[n]=t[n]),r),{});function kh(t){throw new Error(`Unhandled discriminated union member: ${JSON.stringify(t)}`)}class Th{get debugLoggingEnabled(){return window.SEGMENT_CONSENT_WRAPPER_DEBUG_MODE===!0}enableDebugLogging(){window.SEGMENT_CONSENT_WRAPPER_DEBUG_MODE=!0}debug(...e){this.debugLoggingEnabled&&console.log("[consent wrapper debug]",...e)}}const ue=new Th;class Lh{constructor(){this.isAbortCalled=!1,this.isLoadCalled=!1,this.abortLoadOptions={loadSegmentNormally:!0},this.loadOptions={consentModel:"opt-in"}}load(e){this.isLoadCalled=!0,this.loadOptions={...this.loadOptions,...e},ue.debug("ctx.load called",this.loadOptions)}abort(e){this.isAbortCalled=!0,this.abortLoadOptions={...this.abortLoadOptions,...e},ue.debug("Abort consent wrapper",this.loadOptions)}validate(){if(this.isAbortCalled&&this.isLoadCalled)throw new Ge("both abort and load should not be called")}}const Ah=t=>async()=>{const e=new Lh;return await t?.(e),e.validate(),e},Ih=t=>{if(t&&typeof t=="object"&&"consentSettings"in t&&typeof t.consentSettings=="object"&&t.consentSettings&&"categories"in t.consentSettings&&Array.isArray(t.consentSettings.categories))return t.consentSettings.categories||void 0},Ca=t=>xh(Object.values(t).reduce((e,r)=>e.concat(r))),xa=(t,e)=>!e||e.hasUnmappedDestinations?!1:Object.keys(t).filter(r=>t[r]).every(r=>!e.allCategories.includes(r)),Ph=(t,e)=>!t||!t.length?!0:t.every(i=>e[i]),Ma=(t,e,r,n={})=>{const{integrationCategoryMappings:i,shouldEnableIntegration:o}=n,s=(i?i[t]:Ih(e.integrations[t]))??[];return o?o(s,r,{creationName:t}):Ph(s,r)},Rh=(t,e,r)=>{const{remotePlugins:n,integrations:i}=t,{integrationCategoryMappings:o,shouldEnableIntegration:s}=r,a={...t,remotePlugins:[...n||[]],integrations:{...i}},u=c=>Ma(c,t,e,{integrationCategoryMappings:o,shouldEnableIntegration:s});for(const c in i)u(c)?ue.debug(`Enabled (opt-in): ${c}`):(ue.debug(`Disabled (opt-in): ${c}`),a.remotePlugins=a.remotePlugins?.filter(l=>l.creationName!==c),delete a.integrations[c]);return a},Dh=(t,e,r)=>{const n=async({integration:o,payload:s,next:a})=>{const u=await t,c=s.obj.context.consent.categoryPreferences,l=!Ma(o,u,c,r);if(ue.debug(`Destination middleware called: ${o}`,{DROPPED:l,categoryPreferences:c,payload:s.obj,filterSettings:r}),l)return null;a(s)};e.addDestinationMiddleware("*",n);const i=async({payload:o,next:s})=>{const a=await t,u=o.obj.context.consent.categoryPreferences,c=r.integrationCategoryMappings?{hasUnmappedDestinations:!1,allCategories:Ca(r.integrationCategoryMappings)}
4:a.consentSettings,l=xa(u,c);if(ue.debug("Source middleware called",{DROPPED:l,categoryPreferences:u,payload:o.obj,filterSettings:r,consentSettings:c}),l)return null;s(o)};e.addSourceMiddleware(i)},Nh=t=>async({payload:r,next:n})=>{r.obj.context.consent={...r.obj.context.consent,categoryPreferences:await t()},n(r)},jh=(t,e)=>{if(!e.length)throw new Ge("Invariant: No consent categories defined in Segment",[]);return Mh(t,e)};class Fh{get analytics(){return Bh(this.uninitializedAnalytics)}get cdnSettings(){return this.cdnSettingsDeferred.promise}async getAllCategories(){return(this.settings.integrationCategoryMappings?Ca(this.settings.integrationCategoryMappings):(await this.cdnSettings).consentSettings?.allCategories)??[]}async getCategories(){const e=await this.settings.getCategories();return Ea(e),e}constructor(e,r){this.cdnSettingsDeferred=Qt(),this.createDisableOption=(n,i)=>i===!0?!0:o=>xa(n,o.consentSettings)||(typeof i=="function"?i(o):!1),Oh(e),this.settings=r,this.uninitializedAnalytics=e,this.ogAnalyticsLoad=e.load.bind(e)}async loadWithFilteredDeviceModeDestinations(...[e,r]){const n=await this.getCategories(),i=o=>Rh(o,n,{shouldEnableIntegration:this.settings.shouldEnableIntegration,integrationCategoryMappings:this.settings.integrationCategoryMappings});return this.load(e,{...r,updateCDNSettings:Oa(i,r?.updateCDNSettings??(o=>o)),disable:this.createDisableOption(n,r?.disable)})}load(...[e,r]){return this.ogAnalyticsLoad(e,{...r,updateCDNSettings:Oa(r?.updateCDNSettings||(n=>n),n=>(ue.debug("CDN settings loaded",n),this.cdnSettingsDeferred.resolve(n),n))})}replaceLoadMethod(e){this.analytics.load=e}page(){this.analytics.page()}configureBlockingMiddlewareForOptOut(){Dh(this.cdnSettings,this.analytics,{integrationCategoryMappings:this.settings.integrationCategoryMappings,shouldEnableIntegration:this.settings.shouldEnableIntegration})}configureConsentStampingMiddleware(){const{pruneUnmappedCategories:e}=this.settings,n=Nh(async()=>{const i=await this.getCategories();return e?jh(i,await this.getAllCategories()):i});this.analytics.addSourceMiddleware(n)}consentChange(e){ue.debug("Consent change",e);try{Ea(e)}catch(n){return console.error(n)}this.analytics.track("Segment Consent Preference Updated",void 0,{consent:{categoryPreferences:e}})}}const Bh=t=>{if(Array.isArray(t)){const r=t._loadOptions??{},n=window[r?.globalAnalyticsKey??"analytics"];if(n?.initialized)return n}return t},Uh=(...[t])=>{Eh(t);const{shouldDisableSegment:e,getCategories:r,shouldLoadSegment:n,integrationCategoryMappings:i,shouldEnableIntegration:o,registerOnConsentChanged:s,shouldLoadWrapper:a,enableDebugLogging:u}=t;return c=>{const l=new Fh(c,{integrationCategoryMappings:i,shouldEnableIntegration:o,getCategories:r});u&&ue.enableDebugLogging();const f=a?.()||Promise.resolve();f.then(()=>{s?.(h=>l.consentChange(h))});const d=async(h,p)=>{if(p?.initialPageview&&(l.page(),p={...p,initialPageview:!1}),await e?.())return;await f;const g=await Ah(n)();if(g.isAbortCalled){g.abortLoadOptions?.loadSegmentNormally===!0&&l.load(h,p);return}if(l.configureConsentStampingMiddleware(),g.loadOptions.consentModel==="opt-in"){await l.loadWithFilteredDeviceModeDestinations(h,p);return}else if(g.loadOptions.consentModel==="opt-out"){l.configureBlockingMiddlewareForOptOut(),l.load(h,p);return}else kh(g.loadOptions.consentModel)};return l.replaceLoadMethod(d),c}},zh="inactive";function qh(){const t=window.OneTrust?.GetDomainData?.()?.Groups??[],e=new Set(Yr);return t.filter(r=>e.has(r.CustomGroupId||r.GroupId)).map(r=>(r.Status??"").trim().toLowerCase()).filter(Boolean)}const mr=t=>{if(t)return t();const e=window.OneTrust?.GetDomainData?.()?.ConsentModel?.Name?.toLowerCase()??"";if(e.includes("opt-out"))return"opt-out";if(e.includes("opt-in"))return"opt-in";const r=qh();return r.length>0?r.some(i=>i===zh)?"opt-in":"opt-out":"opt-in"},ka=t=>{const e=Qr();return t==="opt-out"&&e.size===0?Xr(new Set(ao)).categoryPreferences:Xr(e).categoryPreferences},Gh=()=>{const t=Qr();return Yr.some(e=>t.has(e))},Hh=(t,e)=>{let r=null;const n=()=>e?.consentModel?e.consentModel():r!==null?r:mr(void 0);return Uh({shouldLoadWrapper:async()=>{await uo()},shouldLoadSegment:async i=>{const o=mr(e?.consentModel);return e?.consentModel||(r=o),o==="opt-out"?i.load({consentModel:"opt-out"}):(await Ch(()=>Gh(),500),i.load({consentModel:"opt-in"}))},getCategories:()=>ka(n()),registerOnConsentChanged:i=>{window.OneTrust?.OnConsentChanged?.(()=>{i(ka(n()))})},integrationCategoryMappings:e?.integrationCategoryMappings})(t)};async function Ta(t){try{const{createConsentPlugin:e}=await Promise.resolve().then(()=>lh),r=e(()=>{const n=t.getConsent(),i=t.getIAB();return{consent:n,iab:i?{gpp:i.gpp,gppSid:i.gppSid,tcfString:i.tcfString}:void 0}});window.analytics?.register?window.analytics.register(r):xe({level:"warn",message:"analytics.register not available, consent plugin not registered"})}catch(e){xe({level:"error",message:"Failed to register consent plugin",error:e instanceof Error?e.message:String(e)})}}function Vh(t){const e=new uh;return Hh(e,t)}async function Kh(t,e,r,n){if(!Hn(t)){xe({level:"error",message:"Segment not loaded: Invalid Segment write key provided",data:{writeKey:t}});return}const{hasAnalyticsConsent:i}=await Promise.resolve().then(()=>_h),o=n?.consentModel?n:(()=>{const l=mr(void 0);return{...n??{},consentModel:()=>l}})(),a=mr(o.consentModel)==="opt-out";if(!a&&!i(e)||typeof window>"u"||typeof document>"u")return;if(window.analytics&&typeof window.analytics.track=="function"&&typeof window.analytics.page=="function"&&!ba()){r&&await Ta(r),N.setLoa
4ded(!0);return}if(N.isLoading()&&N.getLoadingPromise()){await N.getLoadingPromise();return}N.setLoading(!0),N.setAttempts(0);const u=Vh(o);u._oneTrustConsentManager=!0,typeof u.user=="function"&&(u.user=ya(u.user)),wh(u);const c=Promise.resolve(u.load({writeKey:t}));N.setLoadingPromise(c);try{await c,typeof u.ready=="function"&&await u.ready(),N.setLoaded(!0),N.setLoading(!1),r&&await Ta(r);const l=e?.categoryPreferences||{};Object.keys(l).length>0&&window.analytics&&(window.analytics.consent=l);const f=window.analytics||u,d=async p=>!a&&!i(p)?!1:(await wa(f),!0),h=r?.getConsent()??e;if(!await d(h)&&r){const p=r.subscribe(async g=>{await d(g.consent)&&p()})}else r||await wa(f)}catch(l){N.setLoading(!1),N.setLoaded(!1),N.setLoadingPromise(null),xe({level:"error",message:`Failed to load Segment analytics after ${N.getAttempts()} attempts`,error:l instanceof Error?l.message:l,data:{attempts:N.getAttempts(),originalError:l}});return}}function Wh(t,e,r){if(typeof window>"u")throw new Error("Analytics initialization not supported in server-side environment");if(!Hn(t))throw new Error("Valid Segment write key is required for analytics initialization");try{bh(r?.enableEventQueue?{enableEventQueue:!0}:void 0)}catch(n){throw xe({level:"error",message:"Failed to install analytics stub",error:n instanceof Error?n.message:n}),new Error(`Analytics stub installation failed: ${n instanceof Error?n.message:n}`)}return{loadWhenConsented:async n=>{try{if(!_a(n))throw new Error("Invalid consent object provided");if(N.isLoaded()&&!Gn(n))return;await Kh(t,n,e,r)}catch(i){throw xe({level:"error",message:"Failed to load Segment after consent",error:i instanceof Error?i.message:i,data:{hasConsent:Gn(n),writeKey:t?"provided":"missing",currentlyLoading:N.isLoading(),currentlyLoaded:N.isLoaded()}}),i}},isLoaded:()=>N.isLoaded()&&!!window.analytics&&!ba(),isLoading:()=>N.isLoading()}}const z={writeKey:void 0,autoUpdateAnalytics:!0,applicationName:void 0,consentModelOverride:void 0,integrationCategoryMappings:void 0,enableEventQueueOverride:!1},Y={start:async t=>(Y.setWriteKey(t.writeKey),z.consentModelOverride=t.consentModel,z.integrationCategoryMappings=t.integrationCategoryMappings,z.enableEventQueueOverride=t.enableEventQueue??!1,(t.oneTrustLoadTimeoutMs!==void 0||t.oneTrustLoadRetries!==void 0||t.oneTrustLoadRetryDelayMs!==void 0)&&ql({timeoutMs:t.oneTrustLoadTimeoutMs,retries:t.oneTrustLoadRetries,retryDelayMs:t.oneTrustLoadRetryDelayMs}),Y.initialize(t.applicationName,t.enableSegmentCookieSync)),initialize:async(t,e=!1)=>{if(!t||typeof t!="string"||t.trim()==="")throw new Error('OneTrust Consent Manager: applicationName is required for UMD initialization. Call initialize("your-app-name") to provide proper logging context.');if(z.applicationName=t.trim(),!z.writeKey||typeof z.writeKey!="string"||z.writeKey.trim()==="")throw new Error('OneTrust Consent Manager: Segment writeKey is required for UMD initialization. Set via setWriteKey("your-segment-write-key") before calling initialize(). This package requires Segment integration as its core purpose is OneTrust-Segment bridging.');oo(t);const r=await tn(e),n=Wh(z.writeKey,r,{consentModel:z.consentModelOverride,integrationCategoryMappings:z.integrationCategoryMappings,enableEventQueue:z.enableEventQueueOverride});z.autoUpdateAnalytics&&r.subscribe(async i=>{if(i.consent){Rn(i.consent,i.iab||void 0);try{await n.loadWhenConsented(i.consent)}catch{}}})},getConsent:()=>$().getConsent(),getIAB:()=>$().getIAB(),getState:()=>$().getState(),isReady:()=>$().isReady(),openConsentModal:()=>{$().openConsentModal()},subscribe:t=>$().subscribe(t),updateAnalyticsConsent:(t,e)=>{Rn(t,e)},onConsentChange:t=>$().subscribe(r=>{t(r.consent)}),onReady:t=>{const e=$();if(e.isReady())t();else{const r=e.subscribe(n=>{n.isReady&&(t(),r())})}},config:z,setApplicationName:t=>{z.applicationName=t,oo(t)},setWriteKey:t=>{if(!t||typeof t!="string"||t.trim()==="")throw new Error("OneTrust Consent Manager: writeKey must be a non-empty string");z.writeKey=t.trim()},version:en},Jh={start:Y.start,version:Y.version};typeof window<"u"&&(window.OneTrustConsentManager={start:Y.start,initialize:t=>Y.start({applicationName:t.applicationName||"unknown",writeKey:t.segmentKey,enableSegmentCookieSync:!0,enableEventQueue:t.enableEventQueue,consentModel:t.consentModel,integrationCategoryMappings:t.integrationCategoryMappings}),getConsent:()=>{const t=Y.getConsent();return t?{functional:t.categoryPreferences.C0003||!1,analytics:t.categoryPreferences.C0002||!1,advertising:t.categoryPreferences.C0004||!1,categoryPreferences:t.categoryPreferences}:null},openConsentModal:Y.openConsentModal,isReady:Y.isReady,version:Y.version},window.OneTrustConsentManager_Internal={getConsentManager:$,initializeConsentManager:tn,fullAPI:Y});function $h(t){var e=t;return!!(e.ctrlKey||e.shiftKey||e.metaKey||e.button&&e.button==1)}function Yh(t,e){return!!(t.target==="_blank"&&e)}function Qh(t,e,r,n){var i=this,o=[];return t?(t instanceof Element?o=[t]:"toArray"in t?o=t.toArray():o=t,o.forEach(function(s){s.addEventListener("click",function(a){var u,c,l=e instanceof Function?e(s):e,f=r instanceof Function?r(s):r,d=s.getAttribute("href")||s.getAttributeNS("http://www.w3.org/1999/xlink","href")||s.getAttribute("xlink:href")||((u=s.getElementsByTagName("a")[0])===null||u===void 0?void 0:u.getAttribute("href")),h=un(i.track(l,f,n??{}),(c=i.settings.timeout)!==null&&c!==void 0?c:500);
vendor: 27,996 bytes, line 4
4!Yh(s,d)&&!$h(a)&&d&&(a.preventDefault?a.preventDefault():a.returnValue=!1,h.catch(console.error).then(function(){window.location.href=d}).catch(console.error))},!1)}),this):this}function Xh(t,e,r,n){var i=this;if(!t)return this;t instanceof HTMLFormElement&&(t=[t]);var o=t;return o.forEach(function(s){if(!(s instanceof Element))throw new TypeError("Must pass HTMLElement to trackForm/trackSubmit.");var a=function(c){var l;c.preventDefault?c.preventDefault():c.returnValue=!1;var f=e instanceof Function?e(s):e,d=r instanceof Function?r(s):r,h=un(i.track(f,d,n??{}),(l=i.settings.timeout)!==null&&l!==void 0?l:500);h.catch(console.error).then(function(){s.submit()}).catch(console.error)},u=window.jQuery||window.Zepto;u?u(s).submit(a):s.addEventListener("submit",a,!1)}),this}const br=Object.freeze(Object.defineProperty({__proto__:null,form:Xh,link:Qh},Symbol.toStringTag,{value:"Module"}));function La(t,e){return Object.keys(e).reduce(function(r,n){if(n.startsWith(t)){var i=n.substr(t.length);r[i]=e[n]}return r},{})}function Zh(t,e){var r=document.createElement("a");r.href=e;var n=r.search.slice(1),i=n.split("&").reduce(function(S,_){var b=_.split("="),E=b[0],x=b[1];return S[E]=ha(x),S},{}),o=[],s=i.ajs_uid,a=i.ajs_event,u=i.ajs_aid,c=V(t.options.useQueryString)?t.options.useQueryString:{},l=c.aid,f=l===void 0?/.+/:l,d=c.uid,h=d===void 0?/.+/:d;if(u){var p=Array.isArray(i.ajs_aid)?i.ajs_aid[0]:i.ajs_aid;f.test(p)&&t.setAnonymousId(p)}if(s){var g=Array.isArray(i.ajs_uid)?i.ajs_uid[0]:i.ajs_uid;if(h.test(g)){var v=La("ajs_trait_",i);o.push(t.identify(g,v))}}if(a){var y=Array.isArray(i.ajs_event)?i.ajs_event[0]:i.ajs_event,m=La("ajs_prop_",i);o.push(t.track(y,m))}return Promise.all(o)}const ep=Object.freeze(Object.defineProperty({__proto__:null,queryString:Zh},Symbol.toStringTag,{value:"Module"}));var Vn={exports:{}},Aa;function tp(){return Aa||(Aa=1,(function(t,e){/*! For license information please see tsub.js.LICENSE.txt */(function(r,n){t.exports=n()})(self,(function(){return(function(){var r={2870:function(o,s,a){var u=this&&this.__importDefault||function(d){return d&&d.__esModule?d:{default:d}};Object.defineProperty(s,"__esModule",{value:!0}),s.Store=s.matches=s.transform=void 0;var c=a(4303);Object.defineProperty(s,"transform",{enumerable:!0,get:function(){return u(c).default}});var l=a(2370);Object.defineProperty(s,"matches",{enumerable:!0,get:function(){return u(l).default}});var f=a(1444);Object.defineProperty(s,"Store",{enumerable:!0,get:function(){return u(f).default}})},2370:function(o,s,a){var u=this&&this.__importDefault||function(v){return v&&v.__esModule?v:{default:v}};Object.defineProperty(s,"__esModule",{value:!0});var c=u(a(7843));function l(v,y){if(!Array.isArray(v))return f(v,y)===!0;var m,S,_,b,E=v[0];switch(E){case"!":return!l(v[1],y);case"or":for(var x=1;x<v.length;x++)if(l(v[x],y))return!0;return!1;case"and":for(x=1;x<v.length;x++)if(!l(v[x],y))return!1;return!0;case"=":case"!=":return(function(k,M,A,I){switch(d(k)&&(k=l(k,I)),d(M)&&(M=l(M,I)),typeof k=="object"&&typeof M=="object"&&(k=JSON.stringify(k),M=JSON.stringify(M)),A){case"=":return k===M;case"!=":return k!==M;default:throw new Error("Invalid operator in compareItems: ".concat(A))}})(f(v[1],y),f(v[2],y),E,y);case"<=":case"<":case">":case">=":return(function(k,M,A,I){if(d(k)&&(k=l(k,I)),d(M)&&(M=l(M,I)),typeof k!="number"||typeof M!="number")return!1;switch(A){case"<=":return k<=M;case">=":return k>=M;case"<":return k<M;case">":return k>M;default:throw new Error("Invalid operator in compareNumbers: ".concat(A))}})(f(v[1],y),f(v[2],y),E,y);case"in":return(function(k,M,A){return M.find((function(I){return f(I,A)===k}))!==void 0})(f(v[1],y),f(v[2],y),y);case"contains":return _=f(v[1],y),b=f(v[2],y),typeof _=="string"&&typeof b=="string"&&_.indexOf(b)!==-1;case"match":return m=f(v[1],y),S=f(v[2],y),typeof m=="string"&&typeof S=="string"&&(function(k,M){var A,I;e:for(;k.length>0;){var F,Q;if(F=(A=h(k)).star,Q=A.chunk,k=A.pattern,F&&Q==="")return!0;var ie=p(Q,M),He=ie.t,Jn=ie.ok,$n=ie.err;if($n)return!1;if(!Jn||!(He.length===0||k.length>0)){if(F)for(var Yn=0;Yn<M.length;Yn++){if(He=(I=p(Q,M.slice(Yn+1))).t,Jn=I.ok,$n=I.err,Jn){if(k.length===0&&He.length>0)continue;M=He;continue e}if($n)return!1}return!1}M=He}return M.length===0})(S,m);case"lowercase":var T=f(v[1],y);return typeof T!="string"?null:T.toLowerCase();case"typeof":return typeof f(v[1],y);case"length":return(function(k){return k===null?0:Array.isArray(k)||typeof k=="string"?k.length:NaN})(f(v[1],y));default:throw new Error("FQL IR could not evaluate for token: ".concat(E))}}function f(v,y){return Array.isArray(v)?v:typeof v=="object"?v.value:(0,c.default)(y,v)}function d(v){return!!Array.isArray(v)&&((v[0]==="lowercase"||v[0]==="length"||v[0]==="typeof")&&v.length===2||(v[0]==="contains"||v[0]==="match")&&v.length===3)}function h(v){for(var y={star:!1,chunk:"",pattern:""};v.length>0&&v[0]==="*";)v=v.slice(1),y.star=!0;var m,S=!1;e:for(m=0;m<v.length;m++)switch(v[m]){case"\\":m+1<v.length&&m++;break;case"[":S=!0;break;case"]":S=!1;break;case"*":if(!S)break e}return y.chunk=v.slice(0,m),y.pattern=v.slice(m),y}function p(v,y){for(var m,S,_={t:"",ok:!1,err:!1};v.length>0;){if(y.length===0)return _;switch(v[0]){case"[":var b=y[0];y=y.slice(1);var E=!0;(v=v.slice(1)).length>0&&v[0]==="^"&&(E=!1,v=v.slice(1));for(var x=!1,T=0;;){if(v.length>0&&v[0]==="]"&&T>0){v=v.slice(1);break}var k,M="";if(k=(m=g(v)).char,v=m.newChunk,m.err||(M=k,v[0]==="-"&&(M=(S=g(v.slice(1))).char,v=S.newChunk,S.err)))return _;k<=b&&b<=M&&(x=!0),T++}if(x!==E)return _;break;case"?":y=y.slice(1),v=v.slice(1);break;case"\\":if((v=v.slice(1)).length===0)return _.err=!0,_;default:if(v[0]!==y[0])return _;y=y.slice(1),v=v.slice(1)}}return _.t=y,_.ok=!0,_.err=!1,_}function g(v){var y={char:"",newChunk:"",err:!1};return v.length===0||v[0]==="-"||v[0]==="]"||v[0]==="\\"&&(v=v.slice(1)).length===0?(y.err=!0,y):(y.char=v[0],y.newChunk=v.slice(1),y.newChunk.length===0&&(y.err=!0),y)}s.default=function(v,y){if(!y)throw new Error("No matcher supplied!");switch(y.type){case"all":return!0;case"fql":return(function(m,S){if(!m)return!1;try{m=JSON.parse(m)}catch(b){throw new Error('Failed to JSON.parse FQL intermediate representation "'.concat(m,'": ').concat(b))}var _=l(m,S);return typeof _=="boolean"&&_})(y.ir,v);default:throw new Error("Matcher of type ".concat(y.type," unsupported."))}}},1444:function(o,s){Object.defineProperty(s,"__esModule",{value:!0});var a=(function(){function u(c){this.rules=[],this.rules=c||[]}return u.prototype.getRulesByDestinationName=function(c){for(var l=[],f=0,d=this.rules;f<d.length;f++){var h=d[f];h.destinationName!==c&&h.destinationName!==void 0||l.push(h)}return l},u})();s.default=a},4303:function(o,s,a){var u=this&&this.__importDefault||function(_){return _&&_.__esModule?_:{default:_}};Object.defineProperty(s,"__esModule",{value:!0});var c=u(a(374)),l=u(a(7843)),f=u(a(5500)),d=a(9014),h=a(4966);function p(_,b){v(_,b.drop,(function(E,x){x.forEach((function(T){return delete E[T]}))}))}function g(_,b){v(_,b.allow,(function(E,x){Object.keys(E).forEach((function(T){x.includes(T)||delete E[T]}))}))}function v(_,b,E){Object.entries(b).forEach((function(x){var T=x[0],k=x[1],M=function(I){typeof I=="object"&&I!==null&&E(I,k)},A=T===""?_:(0,l.default)(_,T);Array.isArray(A)?A.forEach(M):M(A)}))}function y(_,b){var E=JSON.parse(JSON.stringify(_));for(var x in b.map)if(b.map.hasOwnProperty(x)){var T=b.map[x],k=x.split("."),M=void 0;if(k.length>1?(k.pop(),M=(0,l.default)(E,k.join("."))):M=_,typeof M=="object"){if(T.copy){var A=(0,l.default)(E,T.copy);A!==void 0&&(0,d.dset)(_,x,A)}else if(T.move){var I=(0,l.default)(E,T.move);I!==void 0&&(0,d.dset)(_,x,I),(0,h.unset)(_,T.move)}else T.hasOwnProperty("set")&&(0,d.dset)(_,x,T.set);if(T.to_string){var F=(0,l.default)(_,x);if(typeof F=="string"||typeof F=="object"&&F!==null)continue;F!==void 0?(0,d.dset)(_,x,JSON.stringify(F)):(0,d.dset)(_,x,"undefined")}}}}function m(_,b){return!(b.sample.percent<=0)&&(b.sample.percent>=1||(b.sample.path?(function(x,T){var k=(0,l.default)(x,T.sample.path),M=(0,c.default)(JSON.stringify(k)),A=-64,I=[];S(M.slice(0,8),I);for(var F=0,Q=0;Q<64&&I[Q]!==1;Q++)F++;if(F!==0){var ie=[];S(M.slice(9,16),ie),A-=F,I.splice(0,F),ie.splice(64-F),I=I.concat(ie)}return I[63]=I[63]===0?1:0,(0,f.default)(parseInt(I.join(""),2),A)<T.sample.percent})(_,b):(E=b.sample.percent,Math.random()<=E)));var E}function S(_,b){for(var E=0;E<8;E++)for(var x=_[E],T=128;T>=1;T/=2)x-T>=0?(x-=T,b.push(1)):b.push(0)}s.default=function(_,b){for(var E=_,x=0,T=b;x<T.length;x++){var k=T[x];switch(k.type){case"drop":return null;case"drop_properties":p(E,k.config);break;case"allow_properties":g(E,k.config);break;case"sample_event":if(m(E,k.config))break;return null;case"map_properties":y(E,k.config);break;case"hash_properties":break;default:throw new Error('Transformer of type "'.concat(k.type,'" is unsupported.'))}}return E}},4966:function(o,s,a){var u=this&&this.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(s,"__esModule",{value:!0}),s.unset=void 0;var c=u(a(7843));s.unset=function(l,f){if((0,c.default)(l,f)){for(var d=f.split("."),h=d.pop();d.length&&d[d.length-1].slice(-1)==="\\";)h=d.pop().slice(0,-1)+"."+h;for(;d.length;)l=l[f=d.shift()];return delete l[h]}return!0}},9014:function(o,s){s.dset=function(a,u,c){u.split&&(u=u.split("."));for(var l,f,d=0,h=u.length,p=a;d<h&&(f=u[d++])!=="__proto__"&&f!=="constructor"&&f!=="prototype";)p=p[f]=d===h?c:typeof(l=p[f])==typeof u?l:0*u[d]!=0||~(""+u[d]).indexOf(".")?{}:[]}},3304:function(o){var s=typeof Float64Array=="function"?Float64Array:void 0;o.exports=s},7382:function(o,s,a){var u,c=a(5569),l=a(3304),f=a(8482);u=c()?l:f,o.exports=u},8482:function(o){o.exports=function(){throw new Error("not implemented")}},6322:function(o,s,a){var u,c=a(2508),l=a(5679),f=a(882);u=c()?l:f,o.exports=u},882:function(o){o.exports=function(){throw new Error("not implemented")}},5679:function(o){var s=typeof Uint16Array=="function"?Uint16Array:void 0;o.exports=s},4773:function(o,s,a){var u,c=a(9773),l=a(3004),f=a(3078);u=c()?l:f,o.exports=u},3078:function(o){o.exports=function(){throw new Error("not implemented")}},3004:function(o){var s=typeof Uint32Array=="function"?Uint32Array:void 0;o.exports=s},7980:function(o,s,a){var u,c=a(8114),l=a(6737),f=a(3357);u=c()?l:f,o.exports=u},3357:function(o){o.exports=function(){throw new Error("not implemented")}},6737:function(o){var s=typeof Uint8Array=="function"?Uint8Array:void 0;o.exports=s},2684:function(o){var s=typeof Float64Array=="function"?Float64Array:null;o.exports=s},5569:function(o,s,a){var u=a(3876);o.exports=u},3876:function(o,s,a){var u=a(1448),c=a(2684);o.exports=function(){var l,f;if(typeof c!="function")return!1;try{f=new c([1,3.14,-3.14,NaN]),l=u(f)&&f[0]===1&&f[1]===3.14&&f[2]===-3.14&&f[3]!=f[3]}catch{l=!1}return l}},9048:function(o,s,a){var u=a(3763);o.exports=u},3763:function(o){var s=Object.prototype.hasOwnProperty;o.exports=function(a,u){return a!=null&&s.call(a,u)}},7009:function(o,s,a){var u=a(6784);o.exports=u},6784:function(o){o.exports=function(){return typeof Symbol=="function"&&typeof Symbol("foo")=="symbol"}},3123:function(o,s,a){var u=a(8481);o.exports=u},8481:function(o,s,a){var u=a(7009)();o.exports=function(){return u&&typeof Symbol.toStringTag=="symbol"}},2508:function(o,s,a){var u=a(3403);o.exports=u},3403:function(o,s,a){var u=a(768),c=a(9668),l=a(187);o.exports=function(){var f,d;if(typeof l!="function")return!1;try{d=new l(d=[1,3.14,-3.14,c+1,c+2]),f=u(d)&&d[0]===1&&d[1]===3&&d[2]===c-2&&d[3]===0&&d[4]===1}catch{f=!1}return f}},187:function(o){var s=typeof Uint16Array=="function"?Uint16Array:null;o.exports=s},9773:function(o,s,a){var u=a(2822);o.exports=u},2822:function(o,s,a){var u=a(2744),c=a(3899),l=a(746);o.exports=function(){var f,d;if(typeof l!="function")return!1;try{d=new l(d=[1,3.14,-3.14,c+1,c+2]),f=u(d)&&d[0]===1&&d[1]===3&&d[2]===c-2&&d[3]===0&&d[4]===1}catch{f=!1}return f}},746:function(o){var s=typeof Uint32Array=="function"?Uint32Array:null;o.exports=s},8114:function(o,s,a){var u=a(8066);o.exports=u},8066:function(o,s,a){var u=a(8279),c=a(3443),l=a(2731);o.exports=function(){var f,d;if(typeof l!="function")return!1;try{d=new l(d=[1,3.14,-3.14,c+1,c+2]),f=u(d)&&d[0]===1&&d[1]===3&&d[2]===c-2&&d[3]===0&&d[4]===1}catch{f=!1}return f}},2731:function(o){var s=typeof Uint8Array=="function"?Uint8Array:null;o.exports=s},1448:function(o,s,a){var u=a(1453);o.exports=u},1453:function(o,s,a){var u=a(6208),c=typeof Float64Array=="function";o.exports=function(l){return c&&l instanceof Float64Array||u(l)==="[object Float64Array]"}},9331:function(o,s,a){var u=a(7980),c={uint16:a(6322),uint8:u};o.exports=c},5902:function(o,s,a){var u=a(4106);o.exports=u},4106:function(o,s,a){var u,c,l=a(9331);(c=new l.uint16(1))[0]=4660,u=new l.uint8(c.buffer)[0]===52,o.exports=u},768:function(o,s,a){var u=a(3823);o.exports=u},3823:function(o,s,a){var u=a(6208),c=typeof Uint16Array=="function";o.exports=function(l){return c&&l instanceof Uint16Array||u(l)==="[object Uint16Array]"}},2744:function(o,s,a){var u=a(2326);o.exports=u},2326:function(o,s,a){var u=a(6208),c=typeof Uint32Array=="function";o.exports=function(l){return c&&l instanceof Uint32Array||u(l)==="[object Uint32Array]"}},8279:function(o,s,a){var u=a(208);o.exports=u},208:function(o,s,a){var u=a(6208),c=typeof Uint8Array=="function";o.exports=function(l){return c&&l instanceof Uint8Array||u(l)==="[object Uint8Array]"}},6315:function(o){o.exports=1023},1686:function(o){o.exports=2147483647},3105:function(o){o.exports=2146435072},3449:function(o){o.exports=2147483648},6988:function(o){o.exports=-1023},9777:function(o){o.exports=1023},3690:function(o){o.exports=-1074},2918:function(o,s,a){var u=a(4772).NEGATIVE_INFINITY;o.exports=u},4165:function(o){var s=Number.POSITIVE_INFINITY;o.exports=s},6488:function(o){o.exports=22250738585072014e-324},9668:function(o){o.exports=65535},3899:function(o){o.exports=4294967295},3443:function(o){o.exports=255},7011:function(o,s,a){var u=a(812);o.exports=u},812:function(o,s,a){var u=a(4165),c=a(2918);o.exports=function(l){return l===u||l===c}},1883:function(o,s,a){var u=a(1797);o.exports=u},1797:function(o){o.exports=function(s){return s!=s}},513:function(o,s,a){var u=a(5760);o.exports=u},5760:function(o){o.exports=function(s){return Math.abs(s)}},5848:function(o,s,a){var u=a(677);o.exports=u},677:function(o,s,a){var u=a(3449),c=a(1686),l=a(7838),f=a(1921),d=a(2490),h=[0,0];o.exports=function(p,g){var v,y;return l.assign(p,h,1,0),v=h[0],v&=c,y=f(g),d(v|=y&=u,h[1])}},5500:function(o,s,a){var u=a(8397);o.exports=u},8397:function(o,s,a){var u=a(4165),c=a(2918),l=a(6315),f=a(9777),d=a(6988),h=a(3690),p=a(1883),g=a(7011),v=a(5848),y=a(4948),m=a(8478),S=a(7838),_=a(2490),b=[0,0],E=[0,0];o.exports=function(x,T){var k,M;return x===0||p(x)||g(x)?x:(y(b,x),T+=b[1],(T+=m(x=b[0]))<h?v(0,x):T>f?x<0?c:u:(T<=d?(T+=52,M=2220446049250313e-31):M=1,S(E,x),k=E[0],k&=2148532223,M*_(k|=T+l<<20,E[1])))}},4772:function(o,s,a){var u=a(7548);o.exports=u},7548:function(o){o.exports=Number},8478:function(o,s,a){var u=a(4500);o.exports=u},4500:function(o,s,a){var u=a(1921),c=a(3105),l=a(6315);o.exports=function(f){var d=u(f);return(d=(d&c)>>>20)-l|0}},2490:function(o,s,a){var u=a(9639);o.exports=u},4445:function(o,s,a){var u,c,l;a(5902)===!0?(c=1,l=0):(c=0,l=1),u={HIGH:c,LOW:l},o.exports=u},9639:function(o,s,a){var u=a(4773),c=a(7382),l=a(4445),f=new c(1),d=new u(f.buffer),h=l.HIGH,p=l.LOW;o.exports=function(g,v){return d[h]=g,d[p]=v,f[0]}},5646:function(o,s,a){var u;u=a(5902)===!0?1:0,o.exports=u},1921:function(o,s,a){var u=a(6285);o.exports=u},6285:function(o,s,a){var u=a(4773),c=a(7382),l=a(5646),f=new c(1),d=new u(f.buffer);o.exports=function(h){return f[0]=h,d[l]}},9024:function(o,s,a){var u=a(6488),c=a(7011),l=a(1883),f=a(513);o.exports=function(d,h,p,g){return l(d)||c(d)?(h[g]=d,h[g+p]=0,h):d!==0&&f(d)<u?(h[g]=4503599627370496*d,h[g+p]=-52,h):(h[g]=d,h[g+p]=0,h)}},4948:function(o,s,a){var u=a(7576),c=a(9422);u(c,"assign",a(9024)),o.exports=c},9422:function(o,s,a){var u=a(9024);o.exports=function(c){return u(c,[0,0],1,0)}},5239:function(o,s,a){var u=a(4773),c=a(7382),l=a(5782),f=new c(1),d=new u(f.buffer),h=l.HIGH,p=l.LOW;o.exports=function(g,v,y,m){return f[0]=g,v[m]=d[h],v[m+y]=d[p],v}},7838:function(o,s,a){var u=a(7576),c=a(4010);u(c,"assign",a(5239)),o.exports=c},5782:function(o,s,a){var u,c,l;a(5902)===!0?(c=1,l=0):(c=0,l=1),u={HIGH:c,LOW:l},o.exports=u},4010:function(o,s,a){var u=a(5239);o.exports=function(c){return u(c,[0,0],1,0)}},7576:function(o,s,a){var u=a(7063);o.exports=u},7063:function(o,s,a){var u=a(6691);o.exports=function(c,l,f){u(c,l,{configurable:!1,enumerable:!1,writable:!1,value:f})}},2073:function(o){var s=Object.defineProperty;o.exports=s},1680:function(o){var s=typeof Object.defineProperty=="function"?Object.defineProperty:null;o.exports=s},1471:function(o,s,a){var u=a(1680);o.exports=function(){try{return u({},"x",{}),!0}catch{return!1}}},6691:function(o,s,a){var u,c=a(1471),l=a(2073),f=a(1309);u=c()?l:f,o.exports=u},1309:function(o){var s=Object.prototype,a=s.toString,u=s.__defineGetter__,c=s.__defineSetter__,l=s.__lookupGetter__,f=s.__lookupSetter__;o.exports=function(d,h,p){var g,v,y,m;if(typeof d!="object"||d===null||a.call(d)==="[object Array]")throw new TypeError("invalid argument. First argument must be an object. Value: `"+d+"`.");if(typeof p!="object"||p===null||a.call(p)==="[object Array]")throw new TypeError("invalid argument. Property descriptor must be an object. Value: `"+p+"`.");if((v="value"in p)&&(l.call(d,h)||f.call(d,h)?(g=d.__proto__,d.__proto__=s,delete d[h],d[h]=p.value,d.__proto__=g):d[h]=p.value),y="get"in p,m="set"in p,v&&(y||m))throw new Error("invalid argument. Cannot specify one or more accessors and a value or writable attribute in the property descriptor.");return y&&u&&u.call(d,h,p.get),m&&c&&c.call(d,h,p.set),d}},6208:function(o,s,a){var u,c=a(3123),l=a(7407),f=a(4210);u=c()?f:l,o.exports=u},7407:function(o,s,a){var u=a(173);o.exports=function(c){return u.call(c)}},4210:function(o,s,a){var u=a(9048),c=a(1403),l=a(173);o.exports=function(f){var d,h,p;if(f==null)return l.call(f);h=f[c],d=u(f,c);try{f[c]=void 0}catch{return l.call(f)}return p=l.call(f),d?f[c]=h:delete f[c],p}},173:function(o){var s=Object.prototype.toString;o.exports=s},1403:function(o){var s=typeof Symbol=="function"?Symbol.toStringTag:"";o.exports=s},7843:function(o){o.exports=function(s,a,u,c,l){for(a=a.split?a.split("."):a,c=0;c<a.length;c++)s=s?s[a[c]]:l;return s===l?u:s}},374:function(o,s,a){a.r(s),a.d(s,{default:function(){return l}});for(var u=[],c=0;c<64;)u[c]=0|4294967296*Math.sin(++c%Math.PI);function l(f){var d,h,p,g=[d=1732584193,h=4023233417,~d,~h],v=[],y=unescape(encodeURI(f))+"Â",m=y.length;for(f=--m/4+2|15,v[--f]=8*m;~m;)v[m>>2]|=y.charCodeAt(m)<<8*m--;for(c=y=0;c<f;c+=16){for(m=g;y<64;m=[p=m[3],d+((p=m[0]+[d&h|~d&p,p&d|~p&h,d^h^p,h^(d|~p)][m=y>>4]+u[y]+~~v[c|15&[y,5*y+1,3*y+5,7*y][m]])<<(m=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*m+y++%4])|p>>>-m),d,h])d=0|m[1],h=m[2];for(y=4;y;)g[--y]+=m[y]}for(f="";y<32;)f+=(g[y>>3]>>4*(1^y++)&15).toString(16);return f}}},n={};function i(o){var s=n[o];if(s!==void 0)return s.exports;var a=n[o]={exports:{}};return r[o].call(a.exports,a,a.exports,i),a.exports}return i.d=function(o,s){for(var a in s)i.o(s,a)&&!i.o(o,a)&&Object.defineProperty(o,a,{enumerable:!0,get:s[a]})},i.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i(2870)})()}))})(Vn)),Vn.exports}var Kn=tp(),rp=function(t){return function(e){var r=e.payload,n=e.integration,i=e.next,o=new Kn.Store(t),s=o.getRulesByDestinationName(n);s.forEach(function(a){for(var u=a.matchers,c=a.transformers,l=0;l<u.length;l++)if(Kn.matches(r.obj,u[l])&&(r.obj=Kn.transform(r.obj,c[l]),r.obj===null))return i(null)}),i(r)}};const np=Object.freeze(Object.defineProperty({__proto__:null,tsubMiddleware:rp},Symbol.toStringTag,{value:"Module"}));function Ia(t,e){var r,n;return typeof e?.enabled=="boolean"?e.enabled:(n=(r=t?.__default)===null||r===void 0?void 0:r.enabled)!==null&&n!==void 0?n:!0}function Pa(t){return t.toLowerCase().replace(".","").replace(/\s+/g,"-")}function Ra(t,e){return e===void 0&&(e=!1),e?btoa(t).replace(/=/g,""):void 0}function ip(t){return("Integration"in t?t.Integration:t).prototype.name}function op(t,e,r){var n,i;try{var o=((i=(n=window?.performance)===null||n===void 0?void 0:n.getEntriesByName(t,"resource"))!==null&&i!==void 0?i:[])[0];o&&e.stats.gauge("legacy_destination_time",Math.round(o.duration),D([r],o.duration<100?["cached"]:[],!0))}catch{}}function ap(t,e,r){var n;if("Integration"in t){var i={user:function(){return r.user()},addIntegration:function(){}};t(i),n=t.Integration}else n=t;var o=new n(e);return o.analytics=r,o}function sp(t,e,r,n){return O(this,void 0,void 0,function(){var i,o,s,a,u,c;return C(this,function(l){switch(l.label){case 0:i=Pa(e),o=Ra(i,n),s=An(),a="".concat(s,"/integrations/").concat(o??i,"/").concat(r,"/").concat(o??i,".dynamic.js.gz"),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,ft(a)];case 2:return l.sent(),op(a,t,e),[3,4];case 3:throw u=l.sent(),t.stats.gauge("legacy_destination_time",-1,["plugin:".concat(e),"failed"]),u;case 4:return c=window["".concat(i,"Deps")],[4,Promise.all(c.map(function(f){return ft(s+f+".gz")}))];case 5:return l.sent(),window["".concat(i,"Loader")](),[2,window["".concat(i,"Integration")]]}})})}function up(t,e,r){return O(this,void 0,void 0,function(){var n,i,o,s;return C(this,function(a){return n=An(),i=Pa(t),o=Ra(t,r),s="".concat(n,"/integrations/").concat(o??i,"/").concat(e,"/").concat(o??i,".dynamic.js.gz"),[2,Gd(s)]})})}function cp(t){var e,r,n,i;return(i=(r=(e=t?.versionSettings)===null||e===void 0?void 0:e.override)!==null&&r!==void 0?r:(n=t?.versionSettings)===null||n===void 0?void 0:n.version)!==null&&i!==void 0?i:"latest"}var lp=function(t,e){var r,n=e.type,i=e.bundlingStatus,o=e.versionSettings,s=i!=="unbundled"&&(n==="browser"||((r=o?.componentTypes)===null||r===void 0?void 0:r.includes("browser")));return!t.startsWith("Segment")&&t!=="Iterable"&&s},fp=function(t,e){var r=e.All===!1&&e[t]===void 0;return e[t]===!1||r};function dp(t,e){return O(this,void 0,void 0,function(){var r,n=this;return C(this,function(i){switch(i.label){case 0:return r=[],ve()?[2,e]:[4,ua(function(){return e.length>0&&mo()},function(){return O(n,void 0,void 0,function(){var o,s,a;return C(this,function(u){switch(u.label){case 0:return o=e.pop(),o?[4,at(o,t)]:[2];case 1:return s=u.sent(),a=s instanceof te,a||r.push(o),[2]}})})})];case 1:return i.sent(),r.map(function(o){return e.pushWithBackoff(o)}),[2,e]}})})}var Da=(function(){function t(e,r,n,i,o,s){i===void 0&&(i={});var a=this;this.options={},this.type="destination",this.middleware=[],this.initializePromise=Qt(),this.flushing=!1,this.name=e,this.version=r,this.settings=w({},i),this.disableAutoISOConversion=o.disableAutoISOConversion||!1,this.integrationSource=s,this.settings.type&&this.settings.type==="browser"&&delete this.settings.type,this.initializePromise.promise.then(function(u){return a._initialized=u},function(){}),this.options=o,this.buffer=o.disableClientPersistence?new Xt(4,[]):new or(4,"".concat(n,":dest-").concat(e)),this.scheduleFlush()}return t.prototype.isLoaded=function(){return!!this._ready},t.prototype.ready=function(){var e=this;return this.initializePromise.promise.then(function(){var r;return(r=e.onReady)!==null&&r!==void 0?r:Promise.resolve()})},t.prototype.load=function(e,r){var n;return O(this,void 0,void 0,function(){var i,o,s=this;return C(this,function(a){switch(a.label){case 0:return this._ready||this.onReady!==void 0?[2]:(n=this.integrationSource)!==null&&n!==void 0?(o=n,[3,3]):[3,1];case 1:return[4,sp(e,this.name,this.version,this.options.obfuscate)];case 2:o=a.sent(),a.label=3;case 3:i=o,this.integration=ap(i,this.settings,r),this.onReady=new Promise(function(u){var c=function(){s._ready=!0,u(!0)};s.integration.once("ready",c)}),this.integration.on("initialize",function(){s.initializePromise.resolve(!0)});try{ye(e,{integrationName:this.name,methodName:"initialize",type:"classic"}),this.integration.initialize()}catch(u){throw ye(e,{integrationName:this.name,methodName:"initialize",type:"classic",didError:!0}),this.initializePromise.resolve(!1),u}return[2]}})})},t.prototype.unload=function(e,r){return up(this.name,this.version,this.options.obfuscate)},t.prototype.addMiddleware=function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];this.middleware=(e=this.middleware).concat.apply(e,r)},t.prototype.shouldBuffer=function(e){return e.event.type!=="page"&&(ve()||this._ready!==!0||this._initialized!==!0)},t.prototype.send=function(e,r,n){var i,o;return O(this,void 0,void 0,function(){var s,a,u,c,l,f;return C(this,function(d){switch(d.label){case 0:return this.shouldBuffer(e)?(this.buffer.push(e),this.scheduleFlush(),[2,e]):(s=(o=(i=this.options)===null||i===void 0?void 0:i.plan)===null||o===void 0?void 0:o.track,a=e.event.event,s&&a&&this.name!=="Segment.io"&&(u=s[a],Ia(s,u)?e.updateEvent("integrations",w(w({},e.event.integrations),u?.integrations)):(e.updateEvent("integrations",w(w({},e.event.integrations),{All:!1,"Segment.io":!0})),e.cancel(new pe({retry:!1,reason:"Event ".concat(a," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"}))),u?.enabled&&u?.integrations[this.name]===!1&&e.cancel(new pe({retry:!1,reason:"Event ".concat(a," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"}))),[4,In(this.name,e.event,this.middleware)]);case 1:if(c=d.sent(),c===null)return[2,e];l=new r(c,{traverse:!this.disableAutoISOConversion}),ye(e,{integrationName:this.name,methodName:n,type:"classic"}),d.label=2;case 2:return d.trys.push([2,5,,6]),this.integration?[4,this.integration.invoke.call(this.integration,n,l)]:[3,4];case 3:d.sent(),d.label=4;case 4:return[3,6];case 5:throw f=d.sent(),ye(e,{integrationName:this.name,methodName:n,type:"classic",didError:!0}),f;case 6:return[2,e]}})})},t.prototype.track=function(e){return O(this,void 0,void 0,function(){return C(this,function(r){return[2,this.send(e,J.Track,"track")]})})},t.prototype.page=function(e){var r;return O(this,void 0,void 0,function(){return C(this,function(n){switch(n.label){case 0:return!((r=this.integration)===null||r===void 0)&&r._assumesPageview&&!this._initialized&&this.integration.initialize(),[4,this.initializePromise.promise];case 1:return n.sent(),[2,this.send(e,J.Page,"page")]}})})},t.prototype.identify=function(e){return O(this,void 0,void 0,function(){return C(this,function(r){return[2,this.send(e,J.Identify,"identify")]})})},t.prototype.alias=function(e){return O(this,void 0,void 0,function(){return C(this,function(r){return[2,this.send(e,J.Alias,"alias")]})})},t.prototype.group=function(e){return O(this,void 0,void 0,function(){return C(this,function(r){return[2,this.send(e,J.Group,"group")]})})},t.prototype.scheduleFlush=function(){var e=this;this.flushing||setTimeout(function(){return O(e,void 0,void 0,function(){var r;return C(this,function(n){switch(n.label){case 0:return ve()||this._ready!==!0||this._initialized!==!0?(this.scheduleFlush(),[2]):(this.flushing=!0,r=this,[4,dp(this,this.buffer)]);case 1:return r.buffer=n.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}})})},Math.random()*5e3)},t})();function hp(t,e,r,n,i,o){var s,a;if(r===void 0&&(r={}),n===void 0&&(n={}),yo())return[];e.plan&&(n=n??{},n.plan=e.plan);var u=(a=(s=e.middlewareSettings)===null||s===void 0?void 0:s.routingRules)!==null&&a!==void 0?a:[],c=e.integrations,l=n.integrations,f=da(e,n??{}),d=o?.reduce(function(p,g){var v;return w(w({},p),(v={},v[ip(g)]=g,v))},{}),h=new Set(D(D([],Object.keys(c).filter(function(p){return lp(p,c[p])}
4),!0),Object.keys(d||{}).filter(function(p){return V(c[p])||V(l?.[p])}),!0));return Array.from(h).filter(function(p){return!fp(p,r)}).map(function(p){var g=c[p],v=cp(g),y=new Da(p,v,t,f[p],n,d?.[p]),m=u.filter(function(S){return S.destinationName===p});return m.length>0&&i&&y.addMiddleware(i),y})}const pp=Object.freeze(Object.defineProperty({__proto__:null,LegacyDestination:Da,ajsDestinations:hp},Symbol.toStringTag,{value:"Module"}));function vp(t){return O(this,void 0,void 0,function(){var e;return C(this,function(r){switch(r.label){case 0:return[4,Promise.resolve().then(()=>Ep)];case 1:return e=r.sent(),t._plugins=e,[2]}})})}const gp=Object.freeze(Object.defineProperty({__proto__:null,loadLegacyVideoPlugins:vp},Symbol.toStringTag,{value:"Module"}));function yp(t,e){var r,n;if(!t||!Object.keys(t))return{};var i=t.integrations?Object.keys(t.integrations).filter(function(s){return t.integrations[s]===!1}):[],o=[];return((r=e.remotePlugins)!==null&&r!==void 0?r:[]).forEach(function(s){i.forEach(function(a){s.creationName==a&&o.push(s.name)})}),((n=e.remotePlugins)!==null&&n!==void 0?n:[]).reduce(function(s,a){return a.settings.subscriptions&&o.includes(a.name)&&a.settings.subscriptions.forEach(function(u){return s["".concat(a.name," ").concat(u.partnerAction)]=!1}),s},{})}function mp(t,e){function r(n){var i=t,o=n.event.event;if(i&&o){var s=i[o];if(Ia(i,s)){var a=yp(s,e);n.updateEvent("integrations",w(w(w({},n.event.integrations),s?.integrations),a))}else return n.updateEvent("integrations",w(w({},n.event.integrations),{All:!1,"Segment.io":!0})),n}return n}return{name:"Schema Filter",version:"0.1.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},type:"before",page:r,alias:r,track:r,identify:r,group:r}}const bp=Object.freeze(Object.defineProperty({__proto__:null,schemaFilter:mp},Symbol.toStringTag,{value:"Module"}));function wp(t,e,r){var n;return O(this,void 0,void 0,function(){var i,o,s,a,u,c=this;return C(this,function(l){switch(l.label){case 0:return yo()?[2,[]]:(i=An(),o=(n=e.enabledMiddleware)!==null&&n!==void 0?n:{},s=Object.entries(o).filter(function(f){f[0];var d=f[1];return d}).map(function(f){var d=f[0];return d}),a=s.map(function(f){return O(c,void 0,void 0,function(){var d,h,p,g;return C(this,function(v){switch(v.label){case 0:d=f.replace("@segment/",""),h=d,r&&(h=btoa(d).replace(/=/g,"")),p="".concat(i,"/middleware/").concat(h,"/latest/").concat(h,".js.gz"),v.label=1;case 1:return v.trys.push([1,3,,4]),[4,ft(p)];case 2:return v.sent(),[2,window["".concat(d,"Middleware")]];case 3:return g=v.sent(),t.log("error",g),t.stats.increment("failed_remote_middleware"),[3,4];case 4:return[2]}})})}),[4,Promise.all(a)]);case 1:return u=l.sent(),u=u.filter(Boolean),[2,u]}})})}const _p=Object.freeze(Object.defineProperty({__proto__:null,remoteMiddlewares:wp},Symbol.toStringTag,{value:"Module"}));var Wn={exports:{}},Na;function Sp(){return Na||(Na=1,(function(t,e){(function(r,n){t.exports=n()})(window,(function(){return(function(r){var n={};function i(o){if(n[o])return n[o].exports;var s=n[o]={i:o,l:!1,exports:{}};return r[o].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=r,i.c=n,i.d=function(o,s,a){i.o(o,s)||Object.defineProperty(o,s,{enumerable:!0,get:a})},i.r=function(o){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})},i.t=function(o,s){if(1&s&&(o=i(o)),8&s||4&s&&typeof o=="object"&&o&&o.__esModule)return o;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:o}),2&s&&typeof o!="string")for(var u in o)i.d(a,u,(function(c){return o[c]}).bind(null,u));return a},i.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return i.d(s,"a",s),s},i.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},i.p="",i(i.s=2)})([function(r,n,i){i.r(n);var o=typeof fetch=="function"?fetch.bind():function(s,a){return a=a||{},new Promise((function(u,c){var l=new XMLHttpRequest;for(var f in l.open(a.method||"get",s,!0),a.headers)l.setRequestHeader(f,a.headers[f]);function d(){var h,p=[],g=[],v={};return l.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(y,m,S){p.push(m=m.toLowerCase()),g.push([m,S]),h=v[m],v[m]=h?h+","+S:S}
4)),{ok:(l.status/100|0)==2,status:l.status,statusText:l.statusText,url:l.responseURL,clone:d,text:function(){return Promise.resolve(l.responseText)},json:function(){return Promise.resolve(l.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([l.response]))},headers:{keys:function(){return p},entries:function(){return g},get:function(y){return v[y.toLowerCase()]},has:function(y){return y.toLowerCase()in v}}}}l.withCredentials=a.credentials=="include",l.onload=function(){u(d())},l.onerror=c,l.send(a.body)}))};n.default=o},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var o=(function(){function a(u,c){for(var l=0;l<c.length;l++){var f=c[l];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(u,f.key,f)}}return function(u,c,l){return c&&a(u.prototype,c),l&&a(u,l),u}})(),s=(function(){function a(u,c){(function(l,f){if(!(l instanceof f))throw new TypeError("Cannot call a class as a function")})(this,a),this.pluginName=u}return o(a,[{key:"track",value:function(u,c){window.analytics.track(u,c,{integration:{name:this.pluginName}})}}]),a})();n.default=s},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0}),n.YouTubeAnalytics=n.VimeoAnalytics=void 0;var o=a(i(3)),s=a(i(4));function a(u){return u&&u.__esModule?u:{default:u}}n.VimeoAnalytics=o.default,n.YouTubeAnalytics=s.default},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var o=(function(){function c(l,f){for(var d=0;d<f.length;d++){var h=f[d];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(l,h.key,h)}}return function(l,f,d){return f&&c(l.prototype,f),d&&c(l,d),l}})(),s=a(i(0));function a(c){return c&&c.__esModule?c:{default:c}}var u=(function(c){function l(f,d){(function(p,g){if(!(p instanceof g))throw new TypeError("Cannot call a class as a function")})(this,l);var h=(function(p,g){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!g||typeof g!="object"&&typeof g!="function"?p:g})(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,"VimeoAnalytics"));return h.authToken=d,h.player=f,h.metadata={content:{},playback:{videoPlayer:"Vimeo"}},h.mostRecentHeartbeat=0,h.isPaused=!1,h}return(function(f,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);f.prototype=Object.create(d&&d.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(f,d):f.__proto__=d)})(l,c),o(l,[{key:"initialize",value:function(){var f=this,d={loaded:this.retrieveMetadata,play:this.trackPlay,pause:this.trackPause,ended:this.trackEnded,timeupdate:this.trackHeartbeat};for(var h in d)this.registerHandler(h,d[h]);this.player.getVideoId().then((function(p){f.retrieveMetadata({id:p})})).catch(console.error)}},{key:"registerHandler",value:function(f,d){var h=this;this.player.on(f,(function(p){h.updateMetadata(p),d.call(h,p)}))}},{key:"trackPlay",value:function(){this.isPaused?(this.track("Video Playback Resumed",this.metadata.playback),this.isPaused=!1):(this.track("Video Playback Started",this.metadata.playback),this.track("Video Content Started",this.metadata.content))}},{key:"trackEnded",value:function(){this.track("Video Playback Completed",this.metadata.playback),this.track("Video Content Completed",this.metadata.content)}},{key:"trackHeartbeat",value:function(){var f=this.mostRecentHeartbeat,d=this.metadata.playback.position;d!==f&&d-f>=10&&(this.track("Video Content Playing",this.metadata.content),this.mostRecentHeartbeat=Math.floor(d))}},{key:"trackPause",value:function(){this.isPaused=!0,this.track("Video Playback Paused",this.metadata.playback)}},{key:"retrieveMetadata",value:function(f){var d=this;return new Promise((function(h,p){var g=f.id;(0,s.default)("https://api.vimeo.com/videos/"+g,{headers:{Authorization:"Bearer "+d.authToken}}).then((function(v){return v.ok?v.json():p(v)})).then((function(v){d.metadata.content.title=v.name,d.metadata.content.description=v.description,d.metadata.content.publisher=v.user.name,d.metadata.playback.position=0,d.metadata.playback.totalLength=v.duration}
4)).catch((function(v){return console.error("Request to Vimeo API Failed with: ",v),p(v)}))}))}},{key:"updateMetadata",value:function(f){var d=this;return new Promise((function(h,p){d.player.getVolume().then((function(g){g&&(d.metadata.playback.sound=100*g),d.metadata.playback.position=f.seconds,h()})).catch(p)}))}}]),l})(a(i(1)).default);n.default=u},function(r,n,i){Object.defineProperty(n,"__esModule",{value:!0});var o=(function(){function f(d,h){for(var p=0;p<h.length;p++){var g=h[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(d,g.key,g)}}return function(d,h,p){return h&&f(d.prototype,h),p&&f(d,p),d}})(),s=u(i(0)),a=u(i(1));function u(f){return f&&f.__esModule?f:{default:f}}var c=(function(f){function d(h,p){(function(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")})(this,d);var g=(function(v,y){if(!v)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!y||typeof y!="object"&&typeof y!="function"?v:y})(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,"YoutubeAnalytics"));return g.player=h,g.apiKey=p,g.playerLoaded=!1,g.playbackStarted=!1,g.contentStarted=!1,g.isPaused=!1,g.isBuffering=!1,g.isSeeking=!1,g.lastRecordedTime={timeReported:Date.now(),timeElapsed:0},g.metadata=[{playback:{video_player:"youtube"},content:{}}],g.playlistIndex=0,g}return(function(h,p){if(typeof p!="function"&&p!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof p);h.prototype=Object.create(p&&p.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),p&&(Object.setPrototypeOf?Object.setPrototypeOf(h,p):h.__proto__=p)})(d,f),o(d,[{key:"initialize",value:function(){window.segmentYoutubeOnStateChange=this.onPlayerStateChange.bind(this),window.segmentYoutubeOnReady=this.onPlayerReady.bind(this),this.player.addEventListener("onReady","segmentYoutubeOnReady"),this.player.addEventListener("onStateChange","segmentYoutubeOnStateChange")}},{key:"onPlayerReady",value:function(h){this.retrieveMetadata()}},{key:"onPlayerStateChange",value:function(h){var p=this.player.getCurrentTime();switch(this.metadata[this.playlistIndex]&&(this.metadata[this.playlistIndex].playback.position=this.metadata[this.playlistIndex].content.position=p,this.metadata[this.playlistIndex].playback.quality=this.player.getPlaybackQuality(),this.metadata[this.playlistIndex].playback.sound=this.player.isMuted()?0:this.player.getVolume()),h.data){case-1:if(this.playerLoaded)break;this.retrieveMetadata(),this.playerLoaded=!0;break;case YT.PlayerState.BUFFERING:this.handleBuffer();break;case YT.PlayerState.PLAYING:this.handlePlay();break;case YT.PlayerState.PAUSED:this.handlePause();break;case YT.PlayerState.ENDED:this.handleEnd()}this.lastRecordedTime={timeReported:Date.now(),timeElapsed:1e3*this.player.getCurrentTime()}}},{key:"retrieveMetadata",value:function(){var h=this;return new Promise((function(p,g){var v=h.player.getVideoData(),y=h.player.getPlaylist()||[v.video_id],m=y.join();(0,s.default)("https://www.googleapis.com/youtube/v3/videos?id="+m+"&part=snippet,contentDetails&key="+h.apiKey).then((function(S){if(!S.ok){var _=new Error("Segment request to Youtube API failed (likely due to a bad API Key. Events will still be sent but will not contain video metadata)");throw _.response=S,_}return S.json()})).then((function(S){h.metadata=[];for(var _=0,b=0;b<y.length;b++){var E=S.items[b];h.metadata.push({content:{title:E.snippet.title,description:E.snippet.description,keywords:E.snippet.tags,channel:E.snippet.channelTitle,airdate:E.snippet.publishedAt}}),_+=l(E.contentDetails.duration)}for(b=0;b<y.length;b++)h.metadata[b].playback={total_length:_,video_player:"youtube"};p()})).catch((function(S){h.metadata=y.map((function(_){return{playback:{video_player:"youtube"},content:{}}})),g(S)}))}))}},{key:"handleBuffer",value:function(){var h=this.determineSeek();this.playbackStarted||(this.playbackStarted=!0,this.track("Video Playback Started",this.metadata[this.playlistIndex].playback)),h&&!this.isSeeking&&(this.isSeeking=!0,this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback)),this.isSeeking&&(this.track("Video Playback Seek Completed",this.metadata[this.playlistIndex].playback),this.isSeeking=!1);var p=this.player.getPlaylist();p&&this.player.getCurrentTime()===0&&this.player.getPlaylistIndex()!==this.playlistIndex&&(this.contentStarted=!1,this.playlistIndex===p.length-1&&this.player.getPlaylistIndex()===0&&(this.track("Video Playback Completed",this.metadata[this.player.getPlaylistIndex()].playback),this.track("Video Playback Started",this.metadata[this.player.getPlaylistIndex()].playback))),this.track("Video Playback Buffer Started",this.metadata[this.playlistIndex].playback),this.isBuffering=!0}},{key:"handlePlay",value:function(){this.contentStarted||(this.playlistIndex=this.player.getPlaylistIndex(),this.playlistIndex===-1&&(this.playlistIndex=0),this.track("Video Content Started",this.metadata[this.playlistIndex].content),this.contentStarted=!0),this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused&&(this.track("Video Playback Resumed",this.metadata[this.playlistIndex].playback),this.isPaused=!1)}},{key:"handlePause",value:function(){var h=this.determineSeek();this.isBuffering&&(this.track("Video Playback Buffer Completed",this.metadata[this.playlistIndex].playback),this.isBuffering=!1),this.isPaused||(h?(this.track("Video Playback Seek Started",this.metadata[this.playlistIndex].playback),this.isSeeking=!0):(this.track("Video Playback Paused",this.metadata[this.playlistIndex].playback),this.isPaused=!0))}},{key:"handleEnd",value:function(){this.track("Video Content Completed",this.metadata[this.playlistIndex].content),this.contentStarted=!1;var h=this.player.getPlaylistIndex(),p=this.player.getPlaylist();(p&&h===p.length-1||h===-1)&&(this.track("Video Playback Completed",this.metadata[this.playlistIndex].playback),this.playbackStarted=!1)}},{key:"determineSeek",value:function(){var h=this.isPaused||this.isBuffering?0:Date.now()-this.lastRecordedTime.timeReported,p=1e3*this.player.getCurrentTime()-this.lastRecordedTime.timeElapsed;return Math.abs(h-p)>2e3}}]),d})(a.default);function l(f){var d=f.match(/PT(\d+H)?(\d+M)?(\d+S)?/);return d=d.slice(1).map((function(h){if(h!=null)return h.replace(/\D/,"")})),3600*(parseInt(d[0])||0)+60*(parseInt(d[1])||0)+(parseInt(d[2])||0)}n.default=c}])}))})(Wn)),Wn.exports}var ja=Sp();const Ep=pt({__proto__:null,default:Zi(ja)},[ja]);return Jh})); 5//# sourceMappingURL=onetrust-consent-manager-2.3.0.umd.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.