@reservamos/browser-analytics 1.1.5-alpha.0 → 1.1.6-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -1
- package/README.md +5 -5
- package/dist/browser-analytics.cjs +1 -1
- package/dist/browser-analytics.cjs.map +1 -1
- package/dist/browser-analytics.d.ts +12 -12
- package/dist/browser-analytics.esm.js +5 -5
- package/dist/browser-analytics.esm.js.map +1 -1
- package/dist/browser-analytics.iife.js +1 -1
- package/dist/browser-analytics.iife.js.map +1 -1
- package/package.json +1 -1
- package/src/events/purchaseConfirmation/purchaseConfirmation.test.ts +36 -23
- package/src/events/purchaseConfirmation/purchaseConfirmationSchema.ts +4 -4
|
@@ -27,5 +27,5 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
27
27
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
28
28
|
PERFORMANCE OF THIS SOFTWARE.
|
|
29
29
|
***************************************************************************** */
|
|
30
|
-
function __awaiter2(r,i,s,a){return new(s||(s=Promise))((function(i,h){function fulfilled(r){try{step(a.next(r))}catch(i){h(i)}}function rejected(r){try{step(a.throw(r))}catch(i){h(i)}}function step(r){r.done?i(r.value):function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}(r.value).then(fulfilled,rejected)}step((a=a.apply(r,[])).next())}))}for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i="undefined"==typeof Uint8Array?[]:new Uint8Array(256),s=0;s<64;s++)i[r.charCodeAt(s)]=s;var encode2=function(i){var s,a=new Uint8Array(i),h=a.length,f="";for(s=0;s<h;s+=3)f+=r[a[s]>>2],f+=r[(3&a[s])<<4|a[s+1]>>4],f+=r[(15&a[s+1])<<2|a[s+2]>>6],f+=r[63&a[s+2]];return h%3==2?f=f.substring(0,f.length-1)+"=":h%3==1&&(f=f.substring(0,f.length-2)+"=="),f};const a=new Map,h=new Map;const f=self;f.onmessage=function(r){return __awaiter2(this,0,void 0,(function*(){if(!("OffscreenCanvas"in globalThis))return f.postMessage({id:r.data.id});{const{id:i,bitmap:s,width:_,height:v,dataURLOptions:b}=r.data,S=function getTransparentBlobFor(r,i,s){return __awaiter2(this,0,void 0,(function*(){const a=`${r}-${i}`;if("OffscreenCanvas"in globalThis){if(h.has(a))return h.get(a);const f=new OffscreenCanvas(r,i);f.getContext("2d");const _=yield f.convertToBlob(s),v=yield _.arrayBuffer(),b=encode2(v);return h.set(a,b),b}return""}))}(_,v,b),k=new OffscreenCanvas(_,v);k.getContext("2d").drawImage(s,0,0),s.close();const I=yield k.convertToBlob(b),C=I.type,T=yield I.arrayBuffer(),O=encode2(T);if(!a.has(i)&&(yield S)===O)return a.set(i,O),f.postMessage({id:i});if(a.get(i)===O)return f.postMessage({id:i});f.postMessage({id:i,type:C,base64:O,width:_,height:v}),a.set(i,O)}}))}}()}));class CanvasManager{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(r){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(r,i)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(r)||this.pendingCanvasMutations.set(r,[]),this.pendingCanvasMutations.get(r).push(i)};const{sampling:i="all",win:s,blockClass:a,blockSelector:h,recordCanvas:f,dataURLOptions:_}=r;this.mutationCb=r.mutationCb,this.mirror=r.mirror,f&&"all"===i&&this.initCanvasMutationObserver(s,a,h),f&&"number"==typeof i&&this.initCanvasFPSObserver(i,s,a,h,{dataURLOptions:_})}initCanvasFPSObserver(r,i,s,a,h){const f=initCanvasContextObserver(i,s,a,!0),_=new Map,v=new vr;v.onmessage=r=>{const{id:i}=r.data;if(_.set(i,!1),!("base64"in r.data))return;const{base64:s,type:a,width:h,height:f}=r.data;this.mutationCb({id:i,type:ur["2D"],commands:[{property:"clearRect",args:[0,0,h,f]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:s}],type:a}]},0,0]}]})};const b=1e3/r;let S,k=0;const takeCanvasSnapshots=r=>{k&&r-k<b||(k=r,(()=>{const r=[];return i.document.querySelectorAll("canvas").forEach((i=>{isBlocked(i,s,a,!0)||r.push(i)})),r})().forEach((r=>__awaiter(this,0,void 0,(function*(){var i;const s=this.mirror.getId(r);if(_.get(s))return;if(0===r.width||0===r.height)return;if(_.set(s,!0),["webgl","webgl2"].includes(r.__context)){const s=r.getContext(r.__context);!1===(null===(i=null==s?void 0:s.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&s.clear(s.COLOR_BUFFER_BIT)}const a=yield createImageBitmap(r);v.postMessage({id:s,bitmap:a,width:r.width,height:r.height,dataURLOptions:h.dataURLOptions},[a])}))))),S=requestAnimationFrame(takeCanvasSnapshots)};S=requestAnimationFrame(takeCanvasSnapshots),this.resetObservers=()=>{f(),cancelAnimationFrame(S)}}initCanvasMutationObserver(r,i,s){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const a=initCanvasContextObserver(r,i,s,!1),h=function initCanvas2DMutationObserver(r,i,s,a){const h=[],f=Object.getOwnPropertyNames(i.CanvasRenderingContext2D.prototype);for(const v of f)try{if("function"!=typeof i.CanvasRenderingContext2D.prototype[v])continue;const f=patch(i.CanvasRenderingContext2D.prototype,v,(function(h){return function(...f){return isBlocked(this.canvas,s,a,!0)||setTimeout((()=>{const s=serializeArgs(f,i,this);r(this.canvas,{type:ur["2D"],property:v,args:s})}),0),h.apply(this,f)}}));h.push(f)}catch(_){const s=hookSetter(i.CanvasRenderingContext2D.prototype,v,{set(i){r(this.canvas,{type:ur["2D"],property:v,args:[i],setter:!0})}});h.push(s)}return()=>{h.forEach((r=>r()))}}(this.processMutation.bind(this),r,i,s),f=function initCanvasWebGLMutationObserver(r,i,s,a,h){const f=[];return f.push(...patchGLPrototype(i.WebGLRenderingContext.prototype,ur.WebGL,r,s,a,0,i)),void 0!==i.WebGL2RenderingContext&&f.push(...patchGLPrototype(i.WebGL2RenderingContext.prototype,ur.WebGL2,r,s,a,0,i)),()=>{f.forEach((r=>r()))}}(this.processMutation.bind(this),r,i,s,this.mirror);this.resetObservers=()=>{a(),h(),f()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const setLatestRAFTimestamp=r=>{this.rafStamps.latestId=r,requestAnimationFrame(setLatestRAFTimestamp)};requestAnimationFrame(setLatestRAFTimestamp)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((r,i)=>{const s=this.mirror.getId(i);this.flushPendingCanvasMutationFor(i,s)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(r,i){if(this.frozen||this.locked)return;const s=this.pendingCanvasMutations.get(r);if(!s||-1===i)return;const a=s.map((r=>{const i=function __rest(r,i){var s={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&i.indexOf(a)<0&&(s[a]=r[a]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var h=0;for(a=Object.getOwnPropertySymbols(r);h<a.length;h++)i.indexOf(a[h])<0&&Object.prototype.propertyIsEnumerable.call(r,a[h])&&(s[a[h]]=r[a[h]])}return s}(r,["type"]);return i})),{type:h}=s[0];this.mutationCb({id:i,type:h,commands:a}),this.pendingCanvasMutations.delete(r)}}class StylesheetManager{constructor(r){this.trackedLinkElements=new WeakSet,this.styleMirror=new StyleSheetMirror,this.mutationCb=r.mutationCb,this.adoptedStyleSheetCb=r.adoptedStyleSheetCb}attachLinkElement(r,i){"_cssText"in i.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:i.id,attributes:i.attributes}]}),this.trackLinkElement(r)}trackLinkElement(r){this.trackedLinkElements.has(r)||(this.trackedLinkElements.add(r),this.trackStylesheetInLinkElement(r))}adoptStyleSheets(r,i){if(0===r.length)return;const s={id:i,styleIds:[]},a=[];for(const h of r){let r;this.styleMirror.has(h)?r=this.styleMirror.getId(h):(r=this.styleMirror.add(h),a.push({styleId:r,rules:Array.from(h.rules||CSSRule,((r,i)=>({rule:stringifyRule(r),index:i})))})),s.styleIds.push(r)}a.length>0&&(s.styles=a),this.adoptedStyleSheetCb(s)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(r){}}class ProcessedNodeManager{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame((()=>{this.clear(),this.loop&&this.periodicallyClear()}))}inOtherBuffer(r,i){const s=this.nodeMap.get(r);return s&&Array.from(s).some((r=>r!==i))}add(r,i){this.nodeMap.set(r,(this.nodeMap.get(r)||new Set).add(i))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function wrapEvent(r){return Object.assign(Object.assign({},r),{timestamp:or()})}let br,Sr,kr,wr=!1;const Ir=function createMirror(){return new Mirror}();function record(r={}){const{emit:i,checkoutEveryNms:s,checkoutEveryNth:a,blockClass:h="rr-block",blockSelector:f=null,ignoreClass:_="rr-ignore",ignoreSelector:v=null,maskTextClass:b="rr-mask",maskTextSelector:S=null,inlineStylesheet:k=!0,maskAllInputs:I,maskInputOptions:C,slimDOMOptions:T,maskInputFn:O,maskTextFn:R,hooks:M,packFn:N,sampling:P={},dataURLOptions:D={},mousemoveWait:A,recordDOM:Z=!0,recordCanvas:L=!1,recordCrossOriginIframes:q=!1,recordAfter:$=("DOMContentLoaded"===r.recordAfter?r.recordAfter:"load"),userTriggeredOnInput:U=!1,collectFonts:z=!1,inlineImages:W=!1,plugins:G,keepIframeSrcFn:K=()=>!1,ignoreCSSAttributes:H=new Set([]),errorHandler:Y}=r;!function registerErrorHandler(r){lr=r}(Y);const J=!q||window.parent===window;let X=!1;if(!J)try{window.parent.document&&(X=!1)}catch(ae){X=!0}if(J&&!i)throw new Error("emit function is required");void 0!==A&&void 0===P.mousemove&&(P.mousemove=A),Ir.reset();const Q=!0===I?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==C?C:{password:!0},ee=!0===T||"all"===T?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===T,headMetaDescKeywords:"all"===T}:T||{};let te;!function polyfill(r=window){"NodeList"in r&&!r.NodeList.prototype.forEach&&(r.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in r&&!r.DOMTokenList.prototype.forEach&&(r.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...r)=>{let i=r[0];if(!(0 in r))throw new TypeError("1 argument is required");do{if(this===i)return!0}while(i=i&&i.parentNode);return!1})}();let re=0;const eventProcessor=r=>{for(const i of G||[])i.eventProcessor&&(r=i.eventProcessor(r));return N&&!X&&(r=N(r)),r};br=(r,h)=>{var f;if(!(null===(f=pr[0])||void 0===f?void 0:f.isFrozen())||r.type===sr.FullSnapshot||r.type===sr.IncrementalSnapshot&&r.data.source===ar.Mutation||pr.forEach((r=>r.unfreeze())),J)null==i||i(eventProcessor(r),h);else if(X){const i={type:"rrweb",event:eventProcessor(r),origin:window.location.origin,isCheckout:h};window.parent.postMessage(i,"*")}if(r.type===sr.FullSnapshot)te=r,re=0;else if(r.type===sr.IncrementalSnapshot){if(r.data.source===ar.Mutation&&r.data.isAttachIframe)return;re++;const i=a&&re>=a,h=s&&r.timestamp-te.timestamp>s;(i||h)&&Sr(!0)}};const wrappedMutationEmit=r=>{br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.Mutation},r)}))},wrappedScrollEmit=r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.Scroll},r)})),wrappedCanvasMutationEmit=r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.CanvasMutation},r)})),ne=new StylesheetManager({mutationCb:wrappedMutationEmit,adoptedStyleSheetCb:r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.AdoptedStyleSheet},r)}))}),ie=new IframeManager({mirror:Ir,mutationCb:wrappedMutationEmit,stylesheetManager:ne,recordCrossOriginIframes:q,wrappedEmit:br});for(const ce of G||[])ce.getMirror&&ce.getMirror({nodeMirror:Ir,crossOriginIframeMirror:ie.crossOriginIframeMirror,crossOriginIframeStyleMirror:ie.crossOriginIframeStyleMirror});const oe=new ProcessedNodeManager;kr=new CanvasManager({recordCanvas:L,mutationCb:wrappedCanvasMutationEmit,win:window,blockClass:h,blockSelector:f,mirror:Ir,sampling:P.canvas,dataURLOptions:D});const se=new ShadowDomManager({mutationCb:wrappedMutationEmit,scrollCb:wrappedScrollEmit,bypassOptions:{blockClass:h,blockSelector:f,maskTextClass:b,maskTextSelector:S,inlineStylesheet:k,maskInputOptions:Q,dataURLOptions:D,maskTextFn:R,maskInputFn:O,recordCanvas:L,inlineImages:W,sampling:P,slimDOMOptions:ee,iframeManager:ie,stylesheetManager:ne,canvasManager:kr,keepIframeSrcFn:K,processedNodeManager:oe},mirror:Ir});Sr=(r=!1)=>{if(!Z)return;br(wrapEvent({type:sr.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),r),ne.reset(),se.init(),pr.forEach((r=>r.lock()));const i=function snapshot(r,i){const{mirror:s=new Mirror,blockClass:a="rr-block",blockSelector:h=null,maskTextClass:f="rr-mask",maskTextSelector:_=null,inlineStylesheet:v=!0,inlineImages:b=!1,recordCanvas:S=!1,maskAllInputs:k=!1,maskTextFn:I,maskInputFn:C,slimDOM:T=!1,dataURLOptions:O,preserveWhiteSpace:R,onSerialize:M,onIframeLoad:N,iframeLoadTimeout:P,onStylesheetLoad:D,stylesheetLoadTimeout:A,keepIframeSrcFn:Z=()=>!1}=i||{};return serializeNodeWithId(r,{doc:r,mirror:s,blockClass:a,blockSelector:h,maskTextClass:f,maskTextSelector:_,skipChild:!1,inlineStylesheet:v,maskInputOptions:!0===k?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===k?{password:!0}:k,maskTextFn:I,maskInputFn:C,slimDOMOptions:!0===T||"all"===T?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===T,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===T?{}:T,dataURLOptions:O,inlineImages:b,recordCanvas:S,preserveWhiteSpace:R,onSerialize:M,onIframeLoad:N,iframeLoadTimeout:P,onStylesheetLoad:D,stylesheetLoadTimeout:A,keepIframeSrcFn:Z,newlyAddedElement:!1})}(document,{mirror:Ir,blockClass:h,blockSelector:f,maskTextClass:b,maskTextSelector:S,inlineStylesheet:k,maskAllInputs:Q,maskTextFn:R,slimDOM:ee,dataURLOptions:D,recordCanvas:L,inlineImages:W,onSerialize:r=>{isSerializedIframe(r,Ir)&&ie.addIframe(r),isSerializedStylesheet(r,Ir)&&ne.trackLinkElement(r),hasShadowRoot(r)&&se.addShadowRoot(r.shadowRoot,document)},onIframeLoad:(r,i)=>{ie.attachIframe(r,i),se.observeAttachShadow(r)},onStylesheetLoad:(r,i)=>{ne.attachLinkElement(r,i)},keepIframeSrcFn:K});if(!i)return console.warn("Failed to snapshot the document");br(wrapEvent({type:sr.FullSnapshot,data:{node:i,initialOffset:getWindowScroll(window)}}),r),pr.forEach((r=>r.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ne.adoptStyleSheets(document.adoptedStyleSheets,Ir.getId(document))};try{const r=[],observe=r=>{var i;return callbackWrapper(initObservers)({mutationCb:wrappedMutationEmit,mousemoveCb:(r,i)=>br(wrapEvent({type:sr.IncrementalSnapshot,data:{source:i,positions:r}})),mouseInteractionCb:r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.MouseInteraction},r)})),scrollCb:wrappedScrollEmit,viewportResizeCb:r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.ViewportResize},r)})),inputCb:r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.Input},r)})),mediaInteractionCb:r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.MediaInteraction},r)})),styleSheetRuleCb:r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.StyleSheetRule},r)})),styleDeclarationCb:r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.StyleDeclaration},r)})),canvasMutationCb:wrappedCanvasMutationEmit,fontCb:r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.Font},r)})),selectionCb:r=>{br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.Selection},r)}))},customElementCb:r=>{br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.CustomElement},r)}))},blockClass:h,ignoreClass:_,ignoreSelector:v,maskTextClass:b,maskTextSelector:S,maskInputOptions:Q,inlineStylesheet:k,sampling:P,recordDOM:Z,recordCanvas:L,inlineImages:W,userTriggeredOnInput:U,collectFonts:z,doc:r,maskInputFn:O,maskTextFn:R,keepIframeSrcFn:K,blockSelector:f,slimDOMOptions:ee,dataURLOptions:D,mirror:Ir,iframeManager:ie,stylesheetManager:ne,shadowDomManager:se,processedNodeManager:oe,canvasManager:kr,ignoreCSSAttributes:H,plugins:(null===(i=null==G?void 0:G.filter((r=>r.observer)))||void 0===i?void 0:i.map((r=>({observer:r.observer,options:r.options,callback:i=>br(wrapEvent({type:sr.Plugin,data:{plugin:r.name,payload:i}}))}))))||[]},M)};ie.addLoadListener((i=>{try{r.push(observe(i.contentDocument))}catch(Ar){console.warn(Ar)}}));const init2=()=>{Sr(),r.push(observe(document)),wr=!0};return"interactive"===document.readyState||"complete"===document.readyState?init2():(r.push(on("DOMContentLoaded",(()=>{br(wrapEvent({type:sr.DomContentLoaded,data:{}})),"DOMContentLoaded"===$&&init2()}))),r.push(on("load",(()=>{br(wrapEvent({type:sr.Load,data:{}})),"load"===$&&init2()}),window))),()=>{r.forEach((r=>r())),oe.destroy(),wr=!1,function unregisterErrorHandler(){lr=void 0}()}}catch(Ar){console.warn(Ar)}}record.addCustomEvent=(r,i)=>{if(!wr)throw new Error("please add custom event after start recording");br(wrapEvent({type:sr.Custom,data:{tag:r,payload:i}}))},record.freezePage=()=>{pr.forEach((r=>r.freeze()))},record.takeFullSnapshot=r=>{if(!wr)throw new Error("please take full snapshot after start recording");Sr(r)},record.mirror=Ir;var Er,xr=(r=>(r[r.DomContentLoaded=0]="DomContentLoaded",r[r.Load=1]="Load",r[r.FullSnapshot=2]="FullSnapshot",r[r.IncrementalSnapshot=3]="IncrementalSnapshot",r[r.Meta=4]="Meta",r[r.Custom=5]="Custom",r[r.Plugin=6]="Plugin",r))(xr||{}),Cr=(r=>(r[r.Mutation=0]="Mutation",r[r.MouseMove=1]="MouseMove",r[r.MouseInteraction=2]="MouseInteraction",r[r.Scroll=3]="Scroll",r[r.ViewportResize=4]="ViewportResize",r[r.Input=5]="Input",r[r.TouchMove=6]="TouchMove",r[r.MediaInteraction=7]="MediaInteraction",r[r.StyleSheetRule=8]="StyleSheetRule",r[r.CanvasMutation=9]="CanvasMutation",r[r.Font=10]="Font",r[r.Log=11]="Log",r[r.Drag=12]="Drag",r[r.StyleDeclaration=13]="StyleDeclaration",r[r.Selection=14]="Selection",r[r.AdoptedStyleSheet=15]="AdoptedStyleSheet",r[r.CustomElement=16]="CustomElement",r))(Cr||{}),Tr={DEBUG:!1,LIB_VERSION:"2.55.1"};if("undefined"==typeof window){var Or={hostname:""};Er={navigator:{userAgent:"",onLine:!0},document:{location:Or,referrer:""},screen:{width:0,height:0},location:Or}}else Er=window;var Rr,Mr,Nr,Pr,Dr,Ar,Zr,Lr,jr,Fr,qr=864e5,$r=8e3,Ur=Array.prototype,Br=Function.prototype,zr=Object.prototype,Vr=Ur.slice,Wr=zr.toString,Gr=zr.hasOwnProperty,Kr=Er.console,Hr=Er.navigator,Yr=Er.document,Jr=Er.opera,Xr=Er.screen,Qr=Hr.userAgent,en=Br.bind,tn=Ur.forEach,rn=Ur.indexOf,nn=Ur.map,sn=Array.isArray,an={},cn={trim:function(r){return r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},dn={log:function(){if(Tr.DEBUG&&!cn.isUndefined(Kr)&&Kr)try{Kr.log.apply(Kr,arguments)}catch(r){cn.each(arguments,(function(r){Kr.log(r)}))}},warn:function(){if(Tr.DEBUG&&!cn.isUndefined(Kr)&&Kr){var r=["Mixpanel warning:"].concat(cn.toArray(arguments));try{Kr.warn.apply(Kr,r)}catch(i){cn.each(r,(function(r){Kr.warn(r)}))}}},error:function(){if(Tr.DEBUG&&!cn.isUndefined(Kr)&&Kr){var r=["Mixpanel error:"].concat(cn.toArray(arguments));try{Kr.error.apply(Kr,r)}catch(i){cn.each(r,(function(r){Kr.error(r)}))}}},critical:function(){if(!cn.isUndefined(Kr)&&Kr){var r=["Mixpanel error:"].concat(cn.toArray(arguments));try{Kr.error.apply(Kr,r)}catch(i){cn.each(r,(function(r){Kr.error(r)}))}}}},log_func_with_prefix=function(r,i){return function(){return arguments[0]="["+i+"] "+arguments[0],r.apply(dn,arguments)}},console_with_prefix=function(r){return{log:log_func_with_prefix(dn.log,r),error:log_func_with_prefix(dn.error,r),critical:log_func_with_prefix(dn.critical,r)}};cn.bind=function(r,i){var s,a;if(en&&r.bind===en)return en.apply(r,Vr.call(arguments,1));if(!cn.isFunction(r))throw new TypeError;return s=Vr.call(arguments,2),a=function(){if(!(this instanceof a))return r.apply(i,s.concat(Vr.call(arguments)));var h={};h.prototype=r.prototype;var f=new h;h.prototype=null;var _=r.apply(f,s.concat(Vr.call(arguments)));return Object(_)===_?_:f},a},cn.each=function(r,i,s){if(null!=r)if(tn&&r.forEach===tn)r.forEach(i,s);else if(r.length===+r.length){for(var a=0,h=r.length;a<h;a++)if(a in r&&i.call(s,r[a],a,r)===an)return}else for(var f in r)if(Gr.call(r,f)&&i.call(s,r[f],f,r)===an)return},cn.extend=function(r){return cn.each(Vr.call(arguments,1),(function(i){for(var s in i)void 0!==i[s]&&(r[s]=i[s])})),r},cn.isArray=sn||function(r){return"[object Array]"===Wr.call(r)},cn.isFunction=function(r){try{return/^\s*\bfunction\b/.test(r)}catch(i){return!1}},cn.isArguments=function(r){return!(!r||!Gr.call(r,"callee"))},cn.toArray=function(r){return r?r.toArray?r.toArray():cn.isArray(r)||cn.isArguments(r)?Vr.call(r):cn.values(r):[]},cn.map=function(r,i,s){if(nn&&r.map===nn)return r.map(i,s);var a=[];return cn.each(r,(function(r){a.push(i.call(s,r))})),a},cn.keys=function(r){var i=[];return null===r||cn.each(r,(function(r,s){i[i.length]=s})),i},cn.values=function(r){var i=[];return null===r||cn.each(r,(function(r){i[i.length]=r})),i},cn.include=function(r,i){var s=!1;return null===r?s:rn&&r.indexOf===rn?-1!=r.indexOf(i):(cn.each(r,(function(r){if(s||(s=r===i))return an})),s)},cn.includes=function(r,i){return-1!==r.indexOf(i)},cn.inherit=function(r,i){return r.prototype=new i,r.prototype.constructor=r,r.superclass=i.prototype,r},cn.isObject=function(r){return r===Object(r)&&!cn.isArray(r)},cn.isEmptyObject=function(r){if(cn.isObject(r)){for(var i in r)if(Gr.call(r,i))return!1;return!0}return!1},cn.isUndefined=function(r){return void 0===r},cn.isString=function(r){return"[object String]"==Wr.call(r)},cn.isDate=function(r){return"[object Date]"==Wr.call(r)},cn.isNumber=function(r){return"[object Number]"==Wr.call(r)},cn.isElement=function(r){return!(!r||1!==r.nodeType)},cn.encodeDates=function(r){return cn.each(r,(function(i,s){cn.isDate(i)?r[s]=cn.formatDate(i):cn.isObject(i)&&(r[s]=cn.encodeDates(i))})),r},cn.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},cn.formatDate=function(r){function pad(r){return r<10?"0"+r:r}return r.getUTCFullYear()+"-"+pad(r.getUTCMonth()+1)+"-"+pad(r.getUTCDate())+"T"+pad(r.getUTCHours())+":"+pad(r.getUTCMinutes())+":"+pad(r.getUTCSeconds())},cn.strip_empty_properties=function(r){var i={};return cn.each(r,(function(r,s){cn.isString(r)&&r.length>0&&(i[s]=r)})),i},cn.truncate=function(r,i){var s;return"string"==typeof r?s=r.slice(0,i):cn.isArray(r)?(s=[],cn.each(r,(function(r){s.push(cn.truncate(r,i))}))):cn.isObject(r)?(s={},cn.each(r,(function(r,a){s[a]=cn.truncate(r,i)}))):s=r,s},cn.JSONEncode=function(){return function(r){var quote=function(r){var i=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return i.lastIndex=0,i.test(r)?'"'+r.replace(i,(function(r){var i=s[r];return"string"==typeof i?i:"\\u"+("0000"+r.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+r+'"'},str=function(r,i){var s="",a=0,h="",f="",_=0,v=s,b=[],S=i[r];switch(S&&"object"==typeof S&&"function"==typeof S.toJSON&&(S=S.toJSON(r)),typeof S){case"string":return quote(S);case"number":return isFinite(S)?String(S):"null";case"boolean":case"null":return String(S);case"object":if(!S)return"null";if(s+=" ",b=[],"[object Array]"===Wr.apply(S)){for(_=S.length,a=0;a<_;a+=1)b[a]=str(a,S)||"null";return f=0===b.length?"[]":s?"[\n"+s+b.join(",\n"+s)+"\n"+v+"]":"["+b.join(",")+"]",s=v,f}for(h in S)Gr.call(S,h)&&(f=str(h,S))&&b.push(quote(h)+(s?": ":":")+f);return f=0===b.length?"{}":s?"{"+b.join(",")+v+"}":"{"+b.join(",")+"}",s=v,f}};return str("",{"":r})}}(),cn.JSONDecode=(Dr={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},Ar=function(r){var i=new SyntaxError(r);throw i.at=Rr,i.text=Nr,i},Zr=function(r){return r&&r!==Mr&&Ar("Expected '"+r+"' instead of '"+Mr+"'"),Mr=Nr.charAt(Rr),Rr+=1,Mr},Lr=function(){var r,i="";for("-"===Mr&&(i="-",Zr("-"));Mr>="0"&&Mr<="9";)i+=Mr,Zr();if("."===Mr)for(i+=".";Zr()&&Mr>="0"&&Mr<="9";)i+=Mr;if("e"===Mr||"E"===Mr)for(i+=Mr,Zr(),"-"!==Mr&&"+"!==Mr||(i+=Mr,Zr());Mr>="0"&&Mr<="9";)i+=Mr,Zr();if(r=+i,isFinite(r))return r;Ar("Bad number")},jr=function(){var r,i,s,a="";if('"'===Mr)for(;Zr();){if('"'===Mr)return Zr(),a;if("\\"===Mr)if(Zr(),"u"===Mr){for(s=0,i=0;i<4&&(r=parseInt(Zr(),16),isFinite(r));i+=1)s=16*s+r;a+=String.fromCharCode(s)}else{if("string"!=typeof Dr[Mr])break;a+=Dr[Mr]}else a+=Mr}Ar("Bad string")},Fr=function(){for(;Mr&&Mr<=" ";)Zr()},Pr=function(){switch(Fr(),Mr){case"{":return function(){var r,i={};if("{"===Mr){if(Zr("{"),Fr(),"}"===Mr)return Zr("}"),i;for(;Mr;){if(r=jr(),Fr(),Zr(":"),Object.hasOwnProperty.call(i,r)&&Ar('Duplicate key "'+r+'"'),i[r]=Pr(),Fr(),"}"===Mr)return Zr("}"),i;Zr(","),Fr()}}Ar("Bad object")}();case"[":return function(){var r=[];if("["===Mr){if(Zr("["),Fr(),"]"===Mr)return Zr("]"),r;for(;Mr;){if(r.push(Pr()),Fr(),"]"===Mr)return Zr("]"),r;Zr(","),Fr()}}Ar("Bad array")}();case'"':return jr();case"-":return Lr();default:return Mr>="0"&&Mr<="9"?Lr():function(){switch(Mr){case"t":return Zr("t"),Zr("r"),Zr("u"),Zr("e"),!0;case"f":return Zr("f"),Zr("a"),Zr("l"),Zr("s"),Zr("e"),!1;case"n":return Zr("n"),Zr("u"),Zr("l"),Zr("l"),null}Ar('Unexpected "'+Mr+'"')}()}},function(r){var i;return Nr=r,Rr=0,Mr=" ",i=Pr(),Fr(),Mr&&Ar("Syntax error"),i}),cn.base64Encode=function(r){var i,s,a,h,f,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",v=0,b=0,S="",k=[];if(!r)return r;r=cn.utf8Encode(r);do{i=(f=r.charCodeAt(v++)<<16|r.charCodeAt(v++)<<8|r.charCodeAt(v++))>>18&63,s=f>>12&63,a=f>>6&63,h=63&f,k[b++]=_.charAt(i)+_.charAt(s)+_.charAt(a)+_.charAt(h)}while(v<r.length);switch(S=k.join(""),r.length%3){case 1:S=S.slice(0,-2)+"==";break;case 2:S=S.slice(0,-1)+"="}return S},cn.utf8Encode=function(r){var i,s,a,h,f="";for(i=s=0,a=(r=(r+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,h=0;h<a;h++){var _=r.charCodeAt(h),v=null;_<128?s++:v=_>127&&_<2048?String.fromCharCode(_>>6|192,63&_|128):String.fromCharCode(_>>12|224,_>>6&63|128,63&_|128),null!==v&&(s>i&&(f+=r.substring(i,s)),f+=v,i=s=h+1)}return s>i&&(f+=r.substring(i,r.length)),f},cn.UUID=function(){var T2=function(){var r,i=1*new Date;if(Er.performance&&Er.performance.now)r=Er.performance.now();else for(r=0;i==1*new Date;)r++;return i.toString(16)+Math.floor(r).toString(16)};return function(){var r=(Xr.height*Xr.width).toString(16);return T2()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var r,i,s=Qr,a=[],h=0;function xor(r,i){var s,h=0;for(s=0;s<i.length;s++)h|=a[s]<<8*s;return r^h}for(r=0;r<s.length;r++)i=s.charCodeAt(r),a.unshift(255&i),a.length>=4&&(h=xor(h,a),a=[]);return a.length>0&&(h=xor(h,a)),h.toString(16)}()+"-"+r+"-"+T2()}}();var un=["ahrefsbot","ahrefssiteaudit","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];cn.isBlockedUA=function(r){var i;for(r=r.toLowerCase(),i=0;i<un.length;i++)if(-1!==r.indexOf(un[i]))return!0;return!1},cn.HTTPBuildQuery=function(r,i){var s,a,h=[];return cn.isUndefined(i)&&(i="&"),cn.each(r,(function(r,i){s=encodeURIComponent(r.toString()),a=encodeURIComponent(i),h[h.length]=a+"="+s})),h.join(i)},cn.getQueryParam=function(r,i){i=i.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var s=new RegExp("[\\?&]"+i+"=([^&#]*)").exec(r);if(null===s||s&&"string"!=typeof s[1]&&s[1].length)return"";var a=s[1];try{a=decodeURIComponent(a)}catch(h){dn.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},cn.cookie={get:function(r){for(var i=r+"=",s=Yr.cookie.split(";"),a=0;a<s.length;a++){for(var h=s[a];" "==h.charAt(0);)h=h.substring(1,h.length);if(0===h.indexOf(i))return decodeURIComponent(h.substring(i.length,h.length))}return null},parse:function(r){var i;try{i=cn.JSONDecode(cn.cookie.get(r))||{}}catch(s){}return i},set_seconds:function(r,i,s,a,h,f,_){var v="",b="",S="";if(_)v="; domain="+_;else if(a){var k=extract_domain(Yr.location.hostname);v=k?"; domain=."+k:""}if(s){var I=new Date;I.setTime(I.getTime()+1e3*s),b="; expires="+I.toGMTString()}f&&(h=!0,S="; SameSite=None"),h&&(S+="; secure"),Yr.cookie=r+"="+encodeURIComponent(i)+b+"; path=/"+v+S},set:function(r,i,s,a,h,f,_){var v="",b="",S="";if(_)v="; domain="+_;else if(a){var k=extract_domain(Yr.location.hostname);v=k?"; domain=."+k:""}if(s){var I=new Date;I.setTime(I.getTime()+24*s*60*60*1e3),b="; expires="+I.toGMTString()}f&&(h=!0,S="; SameSite=None"),h&&(S+="; secure");var C=r+"="+encodeURIComponent(i)+b+"; path=/"+v+S;return Yr.cookie=C,C},remove:function(r,i,s){cn.cookie.set(r,"",-1,i,!1,!1,s)}};var ln=null,localStorageSupported=function(r,i){if(null!==ln&&!i)return ln;var s=!0;try{r=r||window.localStorage;var a="__mplss_"+cheap_guid(8);r.setItem(a,"xyz"),"xyz"!==r.getItem(a)&&(s=!1),r.removeItem(a)}catch(h){s=!1}return ln=s,s};cn.localStorage={is_supported:function(r){var i=localStorageSupported(null,r);return i||dn.error("localStorage unsupported; falling back to cookie store"),i},error:function(r){dn.error("localStorage error: "+r)},get:function(r){try{return window.localStorage.getItem(r)}catch(i){cn.localStorage.error(i)}return null},parse:function(r){try{return cn.JSONDecode(cn.localStorage.get(r))||{}}catch(i){}return null},set:function(r,i){try{window.localStorage.setItem(r,i)}catch(s){cn.localStorage.error(s)}},remove:function(r){try{window.localStorage.removeItem(r)}catch(i){cn.localStorage.error(i)}}},cn.register_event=function(){function fixEvent(r){return r&&(r.preventDefault=fixEvent.preventDefault,r.stopPropagation=fixEvent.stopPropagation),r}return fixEvent.preventDefault=function(){this.returnValue=!1},fixEvent.stopPropagation=function(){this.cancelBubble=!0},function(r,i,s,a,h){if(r)if(r.addEventListener&&!a)r.addEventListener(i,s,!!h);else{var f="on"+i,_=r[f];r[f]=function makeHandler(r,i,s){var handler=function(a){if(a=a||fixEvent(window.event)){var h,f,_=!0;return cn.isFunction(s)&&(h=s(a)),f=i.call(r,a),!1!==h&&!1!==f||(_=!1),_}};return handler}(r,s,_)}else dn.error("No valid element provided to register_event")}}();var pn=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');cn.dom_query=function(){function getAllChildren(r){return r.all?r.all:r.getElementsByTagName("*")}var r=/[\t\r\n]/g;function hasClass(i,s){var a=" "+s+" ";return(" "+i.className+" ").replace(r," ").indexOf(a)>=0}function getElementsBySelector(r){if(!Yr.getElementsByTagName)return[];var i,s,a,h,f,_,v,b,S,k,I=r.split(" "),C=[Yr];for(_=0;_<I.length;_++)if((i=I[_].replace(/^\s+/,"").replace(/\s+$/,"")).indexOf("#")>-1){a=(s=i.split("#"))[0];var T=s[1],O=Yr.getElementById(T);if(!O||a&&O.nodeName.toLowerCase()!=a)return[];C=[O]}else if(i.indexOf(".")>-1){a=(s=i.split("."))[0];var R=s[1];for(a||(a="*"),h=[],f=0,v=0;v<C.length;v++)for(S="*"==a?getAllChildren(C[v]):C[v].getElementsByTagName(a),b=0;b<S.length;b++)h[f++]=S[b];for(C=[],k=0,v=0;v<h.length;v++)h[v].className&&cn.isString(h[v].className)&&hasClass(h[v],R)&&(C[k++]=h[v])}else{var M=i.match(pn);if(M){a=M[1];var N,P=M[2],D=M[3],A=M[4];for(a||(a="*"),h=[],f=0,v=0;v<C.length;v++)for(S="*"==a?getAllChildren(C[v]):C[v].getElementsByTagName(a),b=0;b<S.length;b++)h[f++]=S[b];switch(C=[],k=0,D){case"=":N=function(r){return r.getAttribute(P)==A};break;case"~":N=function(r){return r.getAttribute(P).match(new RegExp("\\b"+A+"\\b"))};break;case"|":N=function(r){return r.getAttribute(P).match(new RegExp("^"+A+"-?"))};break;case"^":N=function(r){return 0===r.getAttribute(P).indexOf(A)};break;case"$":N=function(r){return r.getAttribute(P).lastIndexOf(A)==r.getAttribute(P).length-A.length};break;case"*":N=function(r){return r.getAttribute(P).indexOf(A)>-1};break;default:N=function(r){return r.getAttribute(P)}}for(C=[],k=0,v=0;v<h.length;v++)N(h[v])&&(C[k++]=h[v])}else{for(a=i,h=[],f=0,v=0;v<C.length;v++)for(S=C[v].getElementsByTagName(a),b=0;b<S.length;b++)h[f++]=S[b];C=h}}return C}return function(r){return cn.isElement(r)?[r]:cn.isObject(r)&&!cn.isUndefined(r.length)?r:getElementsBySelector.call(this,r)}}();var hn=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],fn=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];cn.info={campaignParams:function(r){var i="",s={};return cn.each(hn,(function(a){(i=cn.getQueryParam(Yr.URL,a)).length?s[a]=i:void 0!==r&&(s[a]=r)})),s},clickParams:function(){var r="",i={};return cn.each(fn,(function(s){(r=cn.getQueryParam(Yr.URL,s)).length&&(i[s]=r)})),i},marketingParams:function(){return cn.extend(cn.info.campaignParams(),cn.info.clickParams())},searchEngine:function(r){return 0===r.search("https?://(.*)google.([^/?]*)")?"google":0===r.search("https?://(.*)bing.com")?"bing":0===r.search("https?://(.*)yahoo.com")?"yahoo":0===r.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(r){var i=cn.info.searchEngine(r),s="yahoo"!=i?"q":"p",a={};if(null!==i){a.$search_engine=i;var h=cn.getQueryParam(r,s);h.length&&(a.mp_keyword=h)}return a},browser:function(r,i,s){return i=i||"",s||cn.includes(r," OPR/")?cn.includes(r,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(r)?"BlackBerry":cn.includes(r,"IEMobile")||cn.includes(r,"WPDesktop")?"Internet Explorer Mobile":cn.includes(r,"SamsungBrowser/")?"Samsung Internet":cn.includes(r,"Edge")||cn.includes(r,"Edg/")?"Microsoft Edge":cn.includes(r,"FBIOS")?"Facebook Mobile":cn.includes(r,"Chrome")?"Chrome":cn.includes(r,"CriOS")?"Chrome iOS":cn.includes(r,"UCWEB")||cn.includes(r,"UCBrowser")?"UC Browser":cn.includes(r,"FxiOS")?"Firefox iOS":cn.includes(i,"Apple")?cn.includes(r,"Mobile")?"Mobile Safari":"Safari":cn.includes(r,"Android")?"Android Mobile":cn.includes(r,"Konqueror")?"Konqueror":cn.includes(r,"Firefox")?"Firefox":cn.includes(r,"MSIE")||cn.includes(r,"Trident/")?"Internet Explorer":cn.includes(r,"Gecko")?"Mozilla":""},browserVersion:function(r,i,s){var a={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[cn.info.browser(r,i,s)];if(void 0===a)return null;var h=r.match(a);return h?parseFloat(h[h.length-2]):null},os:function(){var r=Qr;return/Windows/i.test(r)?/Phone/.test(r)||/WPDesktop/.test(r)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(r)?"iOS":/Android/.test(r)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(r)?"BlackBerry":/Mac/i.test(r)?"Mac OS X":/Linux/.test(r)?"Linux":/CrOS/.test(r)?"Chrome OS":""},device:function(r){return/Windows Phone/i.test(r)||/WPDesktop/.test(r)?"Windows Phone":/iPad/.test(r)?"iPad":/iPod/.test(r)?"iPod Touch":/iPhone/.test(r)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(r)?"BlackBerry":/Android/.test(r)?"Android":""},referringDomain:function(r){var i=r.split("/");return i.length>=3?i[2]:""},currentUrl:function(){return Er.location.href},properties:function(r){return"object"!=typeof r&&(r={}),cn.extend(cn.strip_empty_properties({$os:cn.info.os(),$browser:cn.info.browser(Qr,Hr.vendor,Jr),$referrer:Yr.referrer,$referring_domain:cn.info.referringDomain(Yr.referrer),$device:cn.info.device(Qr)}),{$current_url:cn.info.currentUrl(),$browser_version:cn.info.browserVersion(Qr,Hr.vendor,Jr),$screen_height:Xr.height,$screen_width:Xr.width,mp_lib:"web",$lib_version:Tr.LIB_VERSION,$insert_id:cheap_guid(),time:cn.timestamp()/1e3},cn.strip_empty_properties(r))},people_properties:function(){return cn.extend(cn.strip_empty_properties({$os:cn.info.os(),$browser:cn.info.browser(Qr,Hr.vendor,Jr)}),{$browser_version:cn.info.browserVersion(Qr,Hr.vendor,Jr)})},mpPageViewProperties:function(){return cn.strip_empty_properties({current_page_title:Yr.title,current_domain:Er.location.hostname,current_url_path:Er.location.pathname,current_url_protocol:Er.location.protocol,current_url_search:Er.location.search})}};var cheap_guid=function(r){var i=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return r?i.substring(0,r):i},mn=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,gn=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,extract_domain=function(r){var i=gn,s=r.split("."),a=s[s.length-1];(a.length>4||"com"===a||"org"===a)&&(i=mn);var h=r.match(i);return h?h[0]:""},_n=null,yn=null;"undefined"!=typeof JSON&&(_n=JSON.stringify,yn=JSON.parse),_n=_n||cn.JSONEncode,yn=yn||cn.JSONDecode,cn.toArray=cn.toArray,cn.isObject=cn.isObject,cn.JSONEncode=cn.JSONEncode,cn.JSONDecode=cn.JSONDecode,cn.isBlockedUA=cn.isBlockedUA,cn.isEmptyObject=cn.isEmptyObject,cn.info=cn.info,cn.info.device=cn.info.device,cn.info.browser=cn.info.browser,cn.info.browserVersion=cn.info.browserVersion,cn.info.properties=cn.info.properties;var vn="__mp_opt_in_out_";function optIn(r,i){_optInOut(!0,r,i)}function optOut(r,i){_optInOut(!1,r,i)}function hasOptedIn(r,i){return"1"===_getStorageValue(r,i)}function hasOptedOut(r,i){if(function _hasDoNotTrackFlagOn(r){if(r&&r.ignoreDnt)return!1;var i=r&&r.window||Er,s=i.navigator||{},a=!1;return cn.each([s.doNotTrack,s.msDoNotTrack,i.doNotTrack],(function(r){cn.includes([!0,1,"1","yes"],r)&&(a=!0)})),a}(i))return dn.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var s="0"===_getStorageValue(r,i);return s&&dn.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),s}function addOptOutCheckMixpanelLib(r){return _addOptOutCheck(r,(function(r){return this.get_config(r)}))}function addOptOutCheckMixpanelPeople(r){return _addOptOutCheck(r,(function(r){return this._get_config(r)}))}function addOptOutCheckMixpanelGroup(r){return _addOptOutCheck(r,(function(r){return this._get_config(r)}))}function clearOptInOut(r,i){_getStorage(i=i||{}).remove(_getStorageKey(r,i),!!i.crossSubdomainCookie,i.cookieDomain)}function _getStorage(r){return"localStorage"===(r=r||{}).persistenceType?cn.localStorage:cn.cookie}function _getStorageKey(r,i){return((i=i||{}).persistencePrefix||vn)+r}function _getStorageValue(r,i){return _getStorage(i).get(_getStorageKey(r,i))}function _optInOut(r,i,s){cn.isString(i)&&i.length?(_getStorage(s=s||{}).set(_getStorageKey(i,s),r?1:0,cn.isNumber(s.cookieExpiration)?s.cookieExpiration:null,!!s.crossSubdomainCookie,!!s.secureCookie,!!s.crossSiteCookie,s.cookieDomain),s.track&&r&&s.track(s.trackEventName||"$opt_in",s.trackProperties,{send_immediately:!0})):dn.error("gdpr."+(r?"optIn":"optOut")+" called with an invalid token")}function _addOptOutCheck(r,i){return function(){var s=!1;try{var a=i.call(this,"token"),h=i.call(this,"ignore_dnt"),f=i.call(this,"opt_out_tracking_persistence_type"),_=i.call(this,"opt_out_tracking_cookie_prefix"),v=i.call(this,"window");a&&(s=hasOptedOut(a,{ignoreDnt:h,persistenceType:f,persistencePrefix:_,window:v}))}catch(S){dn.error("Unexpected error when checking tracking opt-out status: "+S)}if(!s)return r.apply(this,arguments);var b=arguments[arguments.length-1];"function"==typeof b&&b(0)}}var bn=console_with_prefix("lock"),SharedLock=function(r,i){i=i||{},this.storageKey=r,this.storage=i.storage||window.localStorage,this.pollIntervalMS=i.pollIntervalMS||100,this.timeoutMS=i.timeoutMS||2e3};SharedLock.prototype.withLock=function(r,i,s){s||"function"==typeof i||(s=i,i=null);var a=s||(new Date).getTime()+"|"+Math.random(),h=(new Date).getTime(),f=this.storageKey,_=this.pollIntervalMS,v=this.timeoutMS,b=this.storage,S=f+":X",k=f+":Y",I=f+":Z",reportError=function(r){i&&i(r)},delay=function(r){if((new Date).getTime()-h>v)return bn.error("Timeout waiting for mutex on "+f+"; clearing lock. ["+a+"]"),b.removeItem(I),b.removeItem(k),void loop();setTimeout((function(){try{r()}catch(i){reportError(i)}}),_*(Math.random()+.1))},waitFor=function(r,i){r()?i():delay((function(){waitFor(r,i)}))},getSetY=function(){var r=b.getItem(k);if(r&&r!==a)return!1;if(b.setItem(k,a),b.getItem(k)===a)return!0;if(!localStorageSupported(b,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},loop=function(){b.setItem(S,a),waitFor(getSetY,(function(){b.getItem(S)!==a?delay((function(){b.getItem(k)===a?waitFor((function(){return!b.getItem(I)}),criticalSection):loop()})):criticalSection()}))},criticalSection=function(){b.setItem(I,"1");try{r()}finally{b.removeItem(I),b.getItem(k)===a&&b.removeItem(k),b.getItem(S)===a&&b.removeItem(S)}};try{if(!localStorageSupported(b,!0))throw new Error("localStorage support check failed");loop()}catch(C){reportError(C)}};var Sn=console_with_prefix("batch"),RequestQueue=function(r,i){i=i||{},this.storageKey=r,this.storage=i.storage||window.localStorage,this.reportError=i.errorReporter||cn.bind(Sn.error,Sn),this.lock=new SharedLock(r,{storage:this.storage}),this.usePersistence=i.usePersistence,this.pid=i.pid||null,this.memQueue=[]};RequestQueue.prototype.enqueue=function(r,i,s){var a={id:cheap_guid(),flushAfter:(new Date).getTime()+2*i,payload:r};this.usePersistence?this.lock.withLock(cn.bind((function lockAcquired(){var i;try{var h=this.readFromStorage();h.push(a),(i=this.saveToStorage(h))&&this.memQueue.push(a)}catch(f){this.reportError("Error enqueueing item",r),i=!1}s&&s(i)}),this),cn.bind((function lockFailure(r){this.reportError("Error acquiring storage lock",r),s&&s(!1)}),this),this.pid):(this.memQueue.push(a),s&&s(!0))},RequestQueue.prototype.fillBatch=function(r){var i=this.memQueue.slice(0,r);if(this.usePersistence&&i.length<r){var s=this.readFromStorage();if(s.length){var a={};cn.each(i,(function(r){a[r.id]=!0}));for(var h=0;h<s.length;h++){var f=s[h];if((new Date).getTime()>f.flushAfter&&!a[f.id]&&(f.orphaned=!0,i.push(f),i.length>=r))break}}}return i};var filterOutIDsAndInvalid=function(r,i){var s=[];return cn.each(r,(function(r){r.id&&!i[r.id]&&s.push(r)})),s};RequestQueue.prototype.removeItemsByID=function(r,i){var s={};if(cn.each(r,(function(r){s[r]=!0})),this.memQueue=filterOutIDsAndInvalid(this.memQueue,s),this.usePersistence){var a=cn.bind((function(){var i;try{var a=this.readFromStorage();if(a=filterOutIDsAndInvalid(a,s),i=this.saveToStorage(a)){a=this.readFromStorage();for(var h=0;h<a.length;h++){var f=a[h];if(f.id&&s[f.id])return this.reportError("Item not removed from storage"),!1}}}catch(_){this.reportError("Error removing items",r),i=!1}return i}),this);this.lock.withLock((function lockAcquired(){var r=a();i&&i(r)}),cn.bind((function lockFailure(r){var s=!1;if(this.reportError("Error acquiring storage lock",r),!localStorageSupported(this.storage,!0)&&!(s=a()))try{this.storage.removeItem(this.storageKey)}catch(h){this.reportError("Error clearing queue",h)}i&&i(s)}),this),this.pid)}else i&&i(!0)};var updatePayloads=function(r,i){var s=[];return cn.each(r,(function(r){var a=r.id;if(a in i){var h=i[a];null!==h&&(r.payload=h,s.push(r))}else s.push(r)})),s};RequestQueue.prototype.updatePayloads=function(r,i){this.memQueue=updatePayloads(this.memQueue,r),this.usePersistence?this.lock.withLock(cn.bind((function lockAcquired(){var s;try{var a=this.readFromStorage();a=updatePayloads(a,r),s=this.saveToStorage(a)}catch(h){this.reportError("Error updating items",r),s=!1}i&&i(s)}),this),cn.bind((function lockFailure(r){this.reportError("Error acquiring storage lock",r),i&&i(!1)}),this),this.pid):i&&i(!0)},RequestQueue.prototype.readFromStorage=function(){var r;try{(r=this.storage.getItem(this.storageKey))&&(r=yn(r),cn.isArray(r)||(this.reportError("Invalid storage entry:",r),r=null))}catch(i){this.reportError("Error retrieving queue",i),r=null}return r||[]},RequestQueue.prototype.saveToStorage=function(r){try{return this.storage.setItem(this.storageKey,_n(r)),!0}catch(i){return this.reportError("Error saving queue",i),!1}},RequestQueue.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var kn=console_with_prefix("batch"),RequestBatcher=function(r,i){this.errorReporter=i.errorReporter,this.queue=new RequestQueue(r,{errorReporter:cn.bind(this.reportError,this),storage:i.storage,usePersistence:i.usePersistence}),this.libConfig=i.libConfig,this.sendRequest=i.sendRequestFunc,this.beforeSendHook=i.beforeSendHook,this.stopAllBatching=i.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=i.flushOnlyOnInterval||!1};RequestBatcher.prototype.enqueue=function(r,i){this.queue.enqueue(r,this.flushInterval,i)},RequestBatcher.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},RequestBatcher.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},RequestBatcher.prototype.clear=function(){this.queue.clear()},RequestBatcher.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},RequestBatcher.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},RequestBatcher.prototype.scheduleFlush=function(r){this.flushInterval=r,this.stopped||(this.timeoutID=setTimeout(cn.bind((function(){this.stopped||this.flush()}),this),this.flushInterval))},RequestBatcher.prototype.flush=function(r){try{if(this.requestInProgress)return void kn.log("Flush: Request already in progress");r=r||{};var i=this.libConfig.batch_request_timeout_ms,s=(new Date).getTime(),a=this.batchSize,h=this.queue.fillBatch(a),f=h.length===a,_=[],v={};if(cn.each(h,(function(r){var i=r.payload;if(this.beforeSendHook&&!r.orphaned&&(i=this.beforeSendHook(i)),i){i.event&&i.properties&&(i.properties=cn.extend({},i.properties,{mp_sent_by_lib_version:Tr.LIB_VERSION}));var s=!0,a=r.id;a?(this.itemIdsSentSuccessfully[a]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:r,batchSize:h.length,timesSent:this.itemIdsSentSuccessfully[a]}),s=!1):this.reportError("[dupe] found item with no ID",{item:r}),s&&_.push(i)}v[r.id]=i}),this),_.length<1)return void this.resetFlush();this.requestInProgress=!0;var b=cn.bind((function(_){this.requestInProgress=!1;try{var b=!1;if(r.unloading)this.queue.updatePayloads(v);else if(cn.isObject(_)&&"timeout"===_.error&&(new Date).getTime()-s>=i)this.reportError("Network timeout; retrying"),this.flush();else if(cn.isObject(_)&&(_.httpStatusCode>=500||429===_.httpStatusCode||_.httpStatusCode<=0&&(I=Er.navigator.onLine,!cn.isUndefined(I)&&!I)||"timeout"===_.error)){var S=2*this.flushInterval;_.retryAfter&&(S=1e3*parseInt(_.retryAfter,10)||S),S=Math.min(6e5,S),this.reportError("Error; retry in "+S+" ms"),this.scheduleFlush(S)}else if(cn.isObject(_)&&413===_.httpStatusCode)if(h.length>1){var k=Math.max(1,Math.floor(a/2));this.batchSize=Math.min(this.batchSize,k,h.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",h),this.resetBatchSize(),b=!0;else b=!0;b&&(this.queue.removeItemsByID(cn.map(h,(function(r){return r.id})),cn.bind((function(r){r?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!f?this.resetFlush():this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())}),this)),cn.each(h,cn.bind((function(r){var i=r.id;i?(this.itemIdsSentSuccessfully[i]=this.itemIdsSentSuccessfully[i]||0,this.itemIdsSentSuccessfully[i]++,this.itemIdsSentSuccessfully[i]>5&&this.reportError("[dupe] item ID sent too many times",{item:r,batchSize:h.length,timesSent:this.itemIdsSentSuccessfully[i]})):this.reportError("[dupe] found item with no ID while removing",{item:r})}),this)))}catch(C){this.reportError("Error handling API response",C),this.resetFlush()}var I}),this),S={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:i};r.unloading&&(S.transport="sendBeacon"),kn.log("MIXPANEL REQUEST:",_),this.sendRequest(_,S,b)}catch(k){this.reportError("Error flushing request queue",k),this.resetFlush()}},RequestBatcher.prototype.reportError=function(r,i){if(kn.error.apply(kn.error,arguments),this.errorReporter)try{i instanceof Error||(i=new Error(r)),this.errorReporter(r,i)}catch(s){kn.error(s)}};var wn=console_with_prefix("recorder"),In=Er.CompressionStream,En={batch_size:1e3,batch_flush_interval_ms:1e4,batch_request_timeout_ms:9e4,batch_autostart:!0},xn=new Set([Cr.MouseMove,Cr.MouseInteraction,Cr.Scroll,Cr.ViewportResize,Cr.Input,Cr.TouchMove,Cr.MediaInteraction,Cr.Drag,Cr.Selection]);var MixpanelRecorder=function(r){this._mixpanel=r,this._stopRecording=null,this.recEvents=[],this.seqNo=0,this.replayId=null,this.replayStartTime=null,this.sendBatchId=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=qr,this.recordMinMs=0,this._initBatcher()};MixpanelRecorder.prototype._initBatcher=function(){this.batcher=new RequestBatcher("__mprec",{libConfig:En,sendRequestFunc:cn.bind(this.flushEventsWithOptOut,this),errorReporter:cn.bind(this.reportError,this),flushOnlyOnInterval:!0,usePersistence:!1})},MixpanelRecorder.prototype.get_config=function(r){return this._mixpanel.get_config(r)},MixpanelRecorder.prototype.startRecording=function(r){if(null===this._stopRecording){this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>qr&&(this.recordMaxMs=qr,wn.critical("record_max_ms cannot be greater than "+qr+"ms. Capping value.")),this.recordMinMs=this.get_config("record_min_ms"),this.recordMinMs>$r&&(this.recordMinMs=$r,wn.critical("record_min_ms cannot be greater than 8000ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.replayStartTime=(new Date).getTime(),this.replayId=cn.UUID(),r||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var i=cn.bind((function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(cn.bind((function(){wn.log("Idle timeout reached, restarting recording."),this.resetRecording()}),this),this.get_config("record_idle_timeout_ms"))}),this),s=this.get_config("record_block_selector");""!==s&&null!==s||(s=void 0),this._stopRecording=record({emit:cn.bind((function(r){this.batcher.enqueue(r),function isUserEvent(r){return r.type===xr.IncrementalSnapshot&&xn.has(r.data.source)}(r)&&(this.batcher.stopped&&(new Date).getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),i())}),this),blockClass:this.get_config("record_block_class"),blockSelector:s,collectFonts:this.get_config("record_collect_fonts"),inlineImages:this.get_config("record_inline_images"),maskAllInputs:!0,maskTextClass:this.get_config("record_mask_text_class"),maskTextSelector:this.get_config("record_mask_text_selector")}),i(),this.maxTimeoutId=setTimeout(cn.bind(this.resetRecording,this),this.recordMaxMs)}else wn.log("Recording already in progress, skipping startRecording.")},MixpanelRecorder.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},MixpanelRecorder.prototype.stopRecording=function(){null!==this._stopRecording&&(this._stopRecording(),this._stopRecording=null),this.batcher.stopped?this.batcher.clear():(this.batcher.flush(),this.batcher.stop()),this.replayId=null,clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)},MixpanelRecorder.prototype.flushEventsWithOptOut=function(r,i,s){this._flushEvents(r,i,s,cn.bind(this._onOptOut,this))},MixpanelRecorder.prototype._onOptOut=function(r){0===r&&(this.recEvents=[],this.stopRecording())},MixpanelRecorder.prototype._sendRequest=function(r,i,s,a){var h=cn.bind((function(i,s){200===i.status&&this.replayId===r&&this.seqNo++,a({status:0,httpStatusCode:i.status,responseBody:s,retryAfter:i.headers.get("Retry-After")})}),this);Er.fetch(this.get_config("api_host")+"/"+this.get_config("api_routes").record+"?"+new URLSearchParams(i),{method:"POST",headers:{Authorization:"Basic "+btoa(this.get_config("token")+":"),"Content-Type":"application/octet-stream"},body:s}).then((function(r){r.json().then((function(i){h(r,i)})).catch((function(r){a({error:r})}))})).catch((function(r){a({error:r,httpStatusCode:0})}))},MixpanelRecorder.prototype._flushEvents=addOptOutCheckMixpanelLib((function(r,i,s){const a=r.length;if(a>0){var h=this.replayId,f=r[0].timestamp;0!==this.seqNo&&this.replayStartTime||(0!==this.seqNo&&this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=f);var _=r[a-1].timestamp-this.replayStartTime,v={distinct_id:String(this._mixpanel.get_distinct_id()),seq:this.seqNo,batch_start_time:f/1e3,replay_id:h,replay_length_ms:_,replay_start_time:this.replayStartTime/1e3},b=cn.JSONEncode(r),S=this._mixpanel.get_property("$device_id");S&&(v.$device_id=S);var k=this._mixpanel.get_property("$user_id");if(k&&(v.$user_id=k),In){var I=new Blob([b],{type:"application/json"}).stream().pipeThrough(new In("gzip"));new Response(I).blob().then(cn.bind((function(r){v.format="gzip",this._sendRequest(h,v,r,s)}),this))}else v.format="body",this._sendRequest(h,v,b,s)}})),MixpanelRecorder.prototype.reportError=function(r,i){wn.error.apply(wn.error,arguments);try{i||r instanceof Error||(r=new Error(r)),this.get_config("error_reporter")(r,i)}catch(s){wn.error(s)}},Er.__mp_recorder=MixpanelRecorder;var DomTracker=function(){};DomTracker.prototype.create_properties=function(){},DomTracker.prototype.event_handler=function(){},DomTracker.prototype.after_track_handler=function(){},DomTracker.prototype.init=function(r){return this.mp=r,this},DomTracker.prototype.track=function(r,i,s,a){var h=this,f=cn.dom_query(r);if(0!==f.length)return cn.each(f,(function(r){cn.register_event(r,this.override_event,(function(r){var f={},_=h.create_properties(s,this),v=h.mp.get_config("track_links_timeout");h.event_handler(r,this,f),window.setTimeout(h.track_callback(a,_,f,!0),v),h.mp.track(i,_,h.track_callback(a,_,f))}))}),this),!0;dn.error("The DOM query ("+r+") returned 0 elements")},DomTracker.prototype.track_callback=function(r,i,s,a){a=a||!1;var h=this;return function(){s.callback_fired||(s.callback_fired=!0,r&&!1===r(a,i)||h.after_track_handler(i,s,a))}},DomTracker.prototype.create_properties=function(r,i){return"function"==typeof r?r(i):cn.extend({},r)};var LinkTracker=function(){this.override_event="click"};cn.inherit(LinkTracker,DomTracker),LinkTracker.prototype.create_properties=function(r,i){var s=LinkTracker.superclass.create_properties.apply(this,arguments);return i.href&&(s.url=i.href),s},LinkTracker.prototype.event_handler=function(r,i,s){s.new_tab=2===r.which||r.metaKey||r.ctrlKey||"_blank"===i.target,s.href=i.href,s.new_tab||r.preventDefault()},LinkTracker.prototype.after_track_handler=function(r,i){i.new_tab||setTimeout((function(){window.location=i.href}),0)};var FormTracker=function(){this.override_event="submit"};cn.inherit(FormTracker,DomTracker),FormTracker.prototype.event_handler=function(r,i,s){s.element=i,r.preventDefault()},FormTracker.prototype.after_track_handler=function(r,i){setTimeout((function(){i.element.submit()}),0)};var Cn="$set",Tn="$set_once",On="$unset",Rn="$add",Mn="$append",Nn="$union",Pn="$remove",Dn={set_action:function(r,i){var s={},a={};return cn.isObject(r)?cn.each(r,(function(r,i){this._is_reserved_property(i)||(a[i]=r)}),this):a[r]=i,s[Cn]=a,s},unset_action:function(r){var i={},s=[];return cn.isArray(r)||(r=[r]),cn.each(r,(function(r){this._is_reserved_property(r)||s.push(r)}),this),i[On]=s,i},set_once_action:function(r,i){var s={},a={};return cn.isObject(r)?cn.each(r,(function(r,i){this._is_reserved_property(i)||(a[i]=r)}),this):a[r]=i,s[Tn]=a,s},union_action:function(r,i){var s={},a={};return cn.isObject(r)?cn.each(r,(function(r,i){this._is_reserved_property(i)||(a[i]=cn.isArray(r)?r:[r])}),this):a[r]=cn.isArray(i)?i:[i],s[Nn]=a,s},append_action:function(r,i){var s={},a={};return cn.isObject(r)?cn.each(r,(function(r,i){this._is_reserved_property(i)||(a[i]=r)}),this):a[r]=i,s[Mn]=a,s},remove_action:function(r,i){var s={},a={};return cn.isObject(r)?cn.each(r,(function(r,i){this._is_reserved_property(i)||(a[i]=r)}),this):a[r]=i,s[Pn]=a,s},delete_action:function(){var r={$delete:""};return r}},MixpanelGroup=function(){};cn.extend(MixpanelGroup.prototype,Dn),MixpanelGroup.prototype._init=function(r,i,s){this._mixpanel=r,this._group_key=i,this._group_id=s},MixpanelGroup.prototype.set=addOptOutCheckMixpanelGroup((function(r,i,s){var a=this.set_action(r,i);return cn.isObject(r)&&(s=i),this._send_request(a,s)})),MixpanelGroup.prototype.set_once=addOptOutCheckMixpanelGroup((function(r,i,s){var a=this.set_once_action(r,i);return cn.isObject(r)&&(s=i),this._send_request(a,s)})),MixpanelGroup.prototype.unset=addOptOutCheckMixpanelGroup((function(r,i){var s=this.unset_action(r);return this._send_request(s,i)})),MixpanelGroup.prototype.union=addOptOutCheckMixpanelGroup((function(r,i,s){cn.isObject(r)&&(s=i);var a=this.union_action(r,i);return this._send_request(a,s)})),MixpanelGroup.prototype.delete=addOptOutCheckMixpanelGroup((function(r){var i=this.delete_action();return this._send_request(i,r)})),MixpanelGroup.prototype.remove=addOptOutCheckMixpanelGroup((function(r,i,s){var a=this.remove_action(r,i);return this._send_request(a,s)})),MixpanelGroup.prototype._send_request=function(r,i){r.$group_key=this._group_key,r.$group_id=this._group_id,r.$token=this._get_config("token");var s=cn.encodeDates(r);return this._mixpanel._track_or_batch({type:"groups",data:s,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},i)},MixpanelGroup.prototype._is_reserved_property=function(r){return"$group_key"===r||"$group_id"===r},MixpanelGroup.prototype._get_config=function(r){return this._mixpanel.get_config(r)},MixpanelGroup.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},MixpanelGroup.prototype.remove=MixpanelGroup.prototype.remove,MixpanelGroup.prototype.set=MixpanelGroup.prototype.set,MixpanelGroup.prototype.set_once=MixpanelGroup.prototype.set_once,MixpanelGroup.prototype.union=MixpanelGroup.prototype.union,MixpanelGroup.prototype.unset=MixpanelGroup.prototype.unset,MixpanelGroup.prototype.toString=MixpanelGroup.prototype.toString;var MixpanelPeople=function(){};cn.extend(MixpanelPeople.prototype,Dn),MixpanelPeople.prototype._init=function(r){this._mixpanel=r},MixpanelPeople.prototype.set=addOptOutCheckMixpanelPeople((function(r,i,s){var a=this.set_action(r,i);return cn.isObject(r)&&(s=i),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),a[Cn]=cn.extend({},cn.info.people_properties(),a[Cn]),this._send_request(a,s)})),MixpanelPeople.prototype.set_once=addOptOutCheckMixpanelPeople((function(r,i,s){var a=this.set_once_action(r,i);return cn.isObject(r)&&(s=i),this._send_request(a,s)})),MixpanelPeople.prototype.unset=addOptOutCheckMixpanelPeople((function(r,i){var s=this.unset_action(r);return this._send_request(s,i)})),MixpanelPeople.prototype.increment=addOptOutCheckMixpanelPeople((function(r,i,s){var a={},h={};return cn.isObject(r)?(cn.each(r,(function(r,i){if(!this._is_reserved_property(i)){if(isNaN(parseFloat(r)))return void dn.error("Invalid increment value passed to mixpanel.people.increment - must be a number");h[i]=r}}),this),s=i):(cn.isUndefined(i)&&(i=1),h[r]=i),a[Rn]=h,this._send_request(a,s)})),MixpanelPeople.prototype.append=addOptOutCheckMixpanelPeople((function(r,i,s){cn.isObject(r)&&(s=i);var a=this.append_action(r,i);return this._send_request(a,s)})),MixpanelPeople.prototype.remove=addOptOutCheckMixpanelPeople((function(r,i,s){cn.isObject(r)&&(s=i);var a=this.remove_action(r,i);return this._send_request(a,s)})),MixpanelPeople.prototype.union=addOptOutCheckMixpanelPeople((function(r,i,s){cn.isObject(r)&&(s=i);var a=this.union_action(r,i);return this._send_request(a,s)})),MixpanelPeople.prototype.track_charge=addOptOutCheckMixpanelPeople((function(r,i,s){if(cn.isNumber(r)||(r=parseFloat(r),!isNaN(r)))return this.append("$transactions",cn.extend({$amount:r},i),s);dn.error("Invalid value passed to mixpanel.people.track_charge - must be a number")})),MixpanelPeople.prototype.clear_charges=function(r){return this.set("$transactions",[],r)},MixpanelPeople.prototype.delete_user=function(){if(this._identify_called()){var r={$delete:this._mixpanel.get_distinct_id()};return this._send_request(r)}dn.error("mixpanel.people.delete_user() requires you to call identify() first")},MixpanelPeople.prototype.toString=function(){return this._mixpanel.toString()+".people"},MixpanelPeople.prototype._send_request=function(r,i){r.$token=this._get_config("token"),r.$distinct_id=this._mixpanel.get_distinct_id();var s=this._mixpanel.get_property("$device_id"),a=this._mixpanel.get_property("$user_id"),h=this._mixpanel.get_property("$had_persisted_distinct_id");s&&(r.$device_id=s),a&&(r.$user_id=a),h&&(r.$had_persisted_distinct_id=h);var f=cn.encodeDates(r);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:f,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},i):(this._enqueue(r),cn.isUndefined(i)||(this._get_config("verbose")?i({status:-1,error:null}):i(-1)),cn.truncate(f,255))},MixpanelPeople.prototype._get_config=function(r){return this._mixpanel.get_config(r)},MixpanelPeople.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},MixpanelPeople.prototype._enqueue=function(r){Cn in r?this._mixpanel.persistence._add_to_people_queue(Cn,r):Tn in r?this._mixpanel.persistence._add_to_people_queue(Tn,r):On in r?this._mixpanel.persistence._add_to_people_queue(On,r):Rn in r?this._mixpanel.persistence._add_to_people_queue(Rn,r):Mn in r?this._mixpanel.persistence._add_to_people_queue(Mn,r):Pn in r?this._mixpanel.persistence._add_to_people_queue(Pn,r):Nn in r?this._mixpanel.persistence._add_to_people_queue(Nn,r):dn.error("Invalid call to _enqueue():",r)},MixpanelPeople.prototype._flush_one_queue=function(r,i,s,a){var h=this,f=cn.extend({},this._mixpanel.persistence.load_queue(r)),_=f;cn.isUndefined(f)||!cn.isObject(f)||cn.isEmptyObject(f)||(h._mixpanel.persistence._pop_from_people_queue(r,f),h._mixpanel.persistence.save(),a&&(_=a(f)),i.call(h,_,(function(i,a){0===i&&h._mixpanel.persistence._add_to_people_queue(r,f),cn.isUndefined(s)||s(i,a)})))},MixpanelPeople.prototype._flush=function(r,i,s,a,h,f,_){var v=this;this._flush_one_queue(Cn,this.set,r),this._flush_one_queue(Tn,this.set_once,a),this._flush_one_queue(On,this.unset,f,(function(r){return cn.keys(r)})),this._flush_one_queue(Rn,this.increment,i),this._flush_one_queue(Nn,this.union,h);var b=this._mixpanel.persistence.load_queue(Mn);if(!cn.isUndefined(b)&&cn.isArray(b)&&b.length)for(var S,append_callback=function(r,i){0===r&&v._mixpanel.persistence._add_to_people_queue(Mn,S),cn.isUndefined(s)||s(r,i)},k=b.length-1;k>=0;k--)b=this._mixpanel.persistence.load_queue(Mn),S=b.pop(),v._mixpanel.persistence.save(),cn.isEmptyObject(S)||v.append(S,append_callback);var I=this._mixpanel.persistence.load_queue(Pn);if(!cn.isUndefined(I)&&cn.isArray(I)&&I.length)for(var C,remove_callback=function(r,i){0===r&&v._mixpanel.persistence._add_to_people_queue(Pn,C),cn.isUndefined(_)||_(r,i)},T=I.length-1;T>=0;T--)I=this._mixpanel.persistence.load_queue(Pn),C=I.pop(),v._mixpanel.persistence.save(),cn.isEmptyObject(C)||v.remove(C,remove_callback)},MixpanelPeople.prototype._is_reserved_property=function(r){return"$distinct_id"===r||"$token"===r||"$device_id"===r||"$user_id"===r||"$had_persisted_distinct_id"===r},MixpanelPeople.prototype.set=MixpanelPeople.prototype.set,MixpanelPeople.prototype.set_once=MixpanelPeople.prototype.set_once,MixpanelPeople.prototype.unset=MixpanelPeople.prototype.unset,MixpanelPeople.prototype.increment=MixpanelPeople.prototype.increment,MixpanelPeople.prototype.append=MixpanelPeople.prototype.append,MixpanelPeople.prototype.remove=MixpanelPeople.prototype.remove,MixpanelPeople.prototype.union=MixpanelPeople.prototype.union,MixpanelPeople.prototype.track_charge=MixpanelPeople.prototype.track_charge,MixpanelPeople.prototype.clear_charges=MixpanelPeople.prototype.clear_charges,MixpanelPeople.prototype.delete_user=MixpanelPeople.prototype.delete_user,MixpanelPeople.prototype.toString=MixpanelPeople.prototype.toString;var An,Zn="__mps",Ln="__mpso",jn="__mpus",Fn="__mpa",qn="__mpap",$n="__mpr",Un="__mpu",Bn="$people_distinct_id",zn="__alias",Vn="__timers",Wn=[Zn,Ln,jn,Fn,qn,$n,Un,Bn,zn,Vn],MixpanelPersistence=function(r){this.props={},this.campaign_params_saved=!1,r.persistence_name?this.name="mp_"+r.persistence_name:this.name="mp_"+r.token+"_mixpanel";var i=r.persistence;"cookie"!==i&&"localStorage"!==i&&(dn.critical("Unknown persistence type "+i+"; falling back to cookie"),i=r.persistence="cookie"),"localStorage"===i&&cn.localStorage.is_supported()?this.storage=cn.localStorage:this.storage=cn.cookie,this.load(),this.update_config(r),this.upgrade(),this.save()};MixpanelPersistence.prototype.properties=function(){var r={};return this.load(),cn.each(this.props,(function(i,s){cn.include(Wn,s)||(r[s]=i)})),r},MixpanelPersistence.prototype.load=function(){if(!this.disabled){var r=this.storage.parse(this.name);r&&(this.props=cn.extend({},r))}},MixpanelPersistence.prototype.upgrade=function(){var r,i;this.storage===cn.localStorage?(r=cn.cookie.parse(this.name),cn.cookie.remove(this.name),cn.cookie.remove(this.name,!0),r&&this.register_once(r)):this.storage===cn.cookie&&(i=cn.localStorage.parse(this.name),cn.localStorage.remove(this.name),i&&this.register_once(i))},MixpanelPersistence.prototype.save=function(){this.disabled||this.storage.set(this.name,cn.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},MixpanelPersistence.prototype.load_prop=function(r){return this.load(),this.props[r]},MixpanelPersistence.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},MixpanelPersistence.prototype.clear=function(){this.remove(),this.props={}},MixpanelPersistence.prototype.register_once=function(r,i,s){return!!cn.isObject(r)&&(void 0===i&&(i="None"),this.expire_days=void 0===s?this.default_expiry:s,this.load(),cn.each(r,(function(r,s){this.props.hasOwnProperty(s)&&this.props[s]!==i||(this.props[s]=r)}),this),this.save(),!0)},MixpanelPersistence.prototype.register=function(r,i){return!!cn.isObject(r)&&(this.expire_days=void 0===i?this.default_expiry:i,this.load(),cn.extend(this.props,r),this.save(),!0)},MixpanelPersistence.prototype.unregister=function(r){this.load(),r in this.props&&(delete this.props[r],this.save())},MixpanelPersistence.prototype.update_search_keyword=function(r){this.register(cn.info.searchInfo(r))},MixpanelPersistence.prototype.update_referrer_info=function(r){this.register_once({$initial_referrer:r||"$direct",$initial_referring_domain:cn.info.referringDomain(r)||"$direct"},"")},MixpanelPersistence.prototype.get_referrer_info=function(){return cn.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},MixpanelPersistence.prototype.update_config=function(r){this.default_expiry=this.expire_days=r.cookie_expiration,this.set_disabled(r.disable_persistence),this.set_cookie_domain(r.cookie_domain),this.set_cross_site(r.cross_site_cookie),this.set_cross_subdomain(r.cross_subdomain_cookie),this.set_secure(r.secure_cookie)},MixpanelPersistence.prototype.set_disabled=function(r){this.disabled=r,this.disabled?this.remove():this.save()},MixpanelPersistence.prototype.set_cookie_domain=function(r){r!==this.cookie_domain&&(this.remove(),this.cookie_domain=r,this.save())},MixpanelPersistence.prototype.set_cross_site=function(r){r!==this.cross_site&&(this.cross_site=r,this.remove(),this.save())},MixpanelPersistence.prototype.set_cross_subdomain=function(r){r!==this.cross_subdomain&&(this.cross_subdomain=r,this.remove(),this.save())},MixpanelPersistence.prototype.get_cross_subdomain=function(){return this.cross_subdomain},MixpanelPersistence.prototype.set_secure=function(r){r!==this.secure&&(this.secure=!!r,this.remove(),this.save())},MixpanelPersistence.prototype._add_to_people_queue=function(r,i){var s=this._get_queue_key(r),a=i[r],h=this._get_or_create_queue(Cn),f=this._get_or_create_queue(Tn),_=this._get_or_create_queue(On),v=this._get_or_create_queue(Rn),b=this._get_or_create_queue(Nn),S=this._get_or_create_queue(Pn,[]),k=this._get_or_create_queue(Mn,[]);s===Zn?(cn.extend(h,a),this._pop_from_people_queue(Rn,a),this._pop_from_people_queue(Nn,a),this._pop_from_people_queue(On,a)):s===Ln?(cn.each(a,(function(r,i){i in f||(f[i]=r)})),this._pop_from_people_queue(On,a)):s===jn?cn.each(a,(function(r){cn.each([h,f,v,b],(function(i){r in i&&delete i[r]})),cn.each(k,(function(i){r in i&&delete i[r]})),_[r]=!0})):s===Fn?(cn.each(a,(function(r,i){i in h?h[i]+=r:(i in v||(v[i]=0),v[i]+=r)}),this),this._pop_from_people_queue(On,a)):s===Un?(cn.each(a,(function(r,i){cn.isArray(r)&&(i in b||(b[i]=[]),b[i]=b[i].concat(r))})),this._pop_from_people_queue(On,a)):s===$n?(S.push(a),this._pop_from_people_queue(Mn,a)):s===qn&&(k.push(a),this._pop_from_people_queue(On,a)),dn.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),dn.log(i),this.save()},MixpanelPersistence.prototype._pop_from_people_queue=function(r,i){var s=this.props[this._get_queue_key(r)];cn.isUndefined(s)||cn.each(i,(function(i,a){r===Mn||r===Pn?cn.each(s,(function(r){r[a]===i&&delete r[a]})):delete s[a]}),this)},MixpanelPersistence.prototype.load_queue=function(r){return this.load_prop(this._get_queue_key(r))},MixpanelPersistence.prototype._get_queue_key=function(r){return r===Cn?Zn:r===Tn?Ln:r===On?jn:r===Rn?Fn:r===Mn?qn:r===Pn?$n:r===Nn?Un:void dn.error("Invalid queue:",r)},MixpanelPersistence.prototype._get_or_create_queue=function(r,i){var s=this._get_queue_key(r);return i=cn.isUndefined(i)?{}:i,this.props[s]||(this.props[s]=i)},MixpanelPersistence.prototype.set_event_timer=function(r,i){var s=this.load_prop(Vn)||{};s[r]=i,this.props[Vn]=s,this.save()},MixpanelPersistence.prototype.remove_event_timer=function(r){var i=(this.load_prop(Vn)||{})[r];return cn.isUndefined(i)||(delete this.props[Vn][r],this.save()),i};var Gn,load_extra_bundle=function(r,i){throw new Error(r+" not available in this build.")},IDENTITY_FUNC=function(r){return r},NOOP_FUNC=function(){},Kn="mixpanel",Hn="base64",Yn="$device:",Jn=Er.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Xn=!Jn&&-1===Qr.indexOf("MSIE")&&-1===Qr.indexOf("Mozilla"),Qn=null;Hr.sendBeacon&&(Qn=function(){return Hr.sendBeacon.apply(Hr,arguments)});var ei={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},ti={api_host:"https://api-js.mixpanel.com",api_routes:ei,api_method:"POST",api_transport:"XHR",api_payload_format:Hn,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:NOOP_FUNC,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:NOOP_FUNC,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_collect_fonts:!1,record_idle_timeout_ms:18e5,record_inline_images:!1,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:qr,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},ri=!1,MixpanelLib=function(){},create_mplib=function(r,i,s){var a,h=s===Kn?Gn:Gn[s];if(h&&0===An)a=h;else{if(h&&!cn.isArray(h))return void dn.error("You have already initialized "+s);a=new MixpanelLib}if(a._cached_groups={},a._init(r,i,s),a.people=new MixpanelPeople,a.people._init(a),!a.get_config("skip_first_touch_marketing")){var f=cn.info.campaignParams(null),_={},v=!1;cn.each(f,(function(r,i){_["initial_"+i]=r,r&&(v=!0)})),v&&a.people.set_once(_)}return Tr.DEBUG=Tr.DEBUG||a.get_config("debug"),!cn.isUndefined(h)&&cn.isArray(h)&&(a._execute_array.call(a.people,h.people),a._execute_array(h)),a};MixpanelLib.prototype.init=function(r,i,s){if(cn.isUndefined(s))this.report_error("You must name your new library: init(token, config, name)");else{if(s!==Kn){var a=create_mplib(r,i,s);return Gn[s]=a,a._loaded(),a}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},MixpanelLib.prototype._init=function(r,i,s){i=i||{},this.__loaded=!0,this.config={};var a={};"api_payload_format"in i||(i.api_host||ti.api_host).match(/\.mixpanel\.com/)&&(a.api_payload_format="json");if(this.set_config(cn.extend({},ti,a,i,{name:s,token:r,callback_fn:(s===Kn?s:Kn+"."+s)+"._jsc"})),this._jsc=NOOP_FUNC,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests)if(cn.localStorage.is_supported(!0)&&Jn){if(this.init_batchers(),Qn&&Er.addEventListener){var h=cn.bind((function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})}),this);Er.addEventListener("pagehide",(function(r){r.persisted&&h()})),Er.addEventListener("visibilitychange",(function(){"hidden"===Yr.visibilityState&&h()}))}}else this._batch_requests=!1,dn.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),cn.each(this.get_batcher_configs(),(function(r){dn.log("Clearing batch queue "+r.queue_key),cn.localStorage.remove(r.queue_key)}));this.persistence=this.cookie=new MixpanelPersistence(this.config),this.unpersisted_superprops={},this._gdpr_init();var f=cn.UUID();this.get_distinct_id()||this.register_once({distinct_id:Yn+f,$device_id:f},"");var _=this.get_config("track_pageview");_&&this._init_url_change_tracking(_),this.get_config("record_sessions_percent")>0&&100*Math.random()<=this.get_config("record_sessions_percent")&&this.start_session_recording()},MixpanelLib.prototype.start_session_recording=addOptOutCheckMixpanelLib((function(){if(Er.MutationObserver){var r=cn.bind((function(){this._recorder=this._recorder||new Er.__mp_recorder(this),this._recorder.startRecording()}),this);cn.isUndefined(Er.__mp_recorder)?load_extra_bundle(this.get_config("recorder_src"),r):r()}else dn.critical("Browser does not support MutationObserver; skipping session recording")})),MixpanelLib.prototype.stop_session_recording=function(){this._recorder?this._recorder.stopRecording():dn.critical("Session recorder module not loaded")},MixpanelLib.prototype.get_session_recording_properties=function(){var r={};if(this._recorder){var i=this._recorder.replayId;i&&(r.$mp_replay_id=i)}return r},MixpanelLib.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var r=cn.info.campaignParams(null);cn.each(r,function(r,i){this.unregister(i)}.bind(this))}},MixpanelLib.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(Yr.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(cn.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(Yr.referrer)},MixpanelLib.prototype._dom_loaded=function(){cn.each(this.__dom_loaded_queue,(function(r){this._track_dom.apply(this,r)}),this),this.has_opted_out_tracking()||cn.each(this.__request_queue,(function(r){this._send_request.apply(this,r)}),this),delete this.__dom_loaded_queue,delete this.__request_queue},MixpanelLib.prototype._track_dom=function(r,i){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!ri)return this.__dom_loaded_queue.push([r,i]),!1;var s=(new r).init(this);return s.track.apply(s,i)},MixpanelLib.prototype._init_url_change_tracking=function(r){var i="";if(this.track_pageview()&&(i=cn.info.currentUrl()),cn.include(["full-url","url-with-path-and-query-string","url-with-path"],r)){Er.addEventListener("popstate",(function(){Er.dispatchEvent(new Event("mp_locationchange"))})),Er.addEventListener("hashchange",(function(){Er.dispatchEvent(new Event("mp_locationchange"))}));var s=Er.history.pushState;"function"==typeof s&&(Er.history.pushState=function(r,i,a){s.call(Er.history,r,i,a),Er.dispatchEvent(new Event("mp_locationchange"))});var a=Er.history.replaceState;"function"==typeof a&&(Er.history.replaceState=function(r,i,s){a.call(Er.history,r,i,s),Er.dispatchEvent(new Event("mp_locationchange"))}),Er.addEventListener("mp_locationchange",function(){var s=cn.info.currentUrl(),a=!1;("full-url"===r?a=s!==i:"url-with-path-and-query-string"===r?a=s.split("#")[0]!==i.split("#")[0]:"url-with-path"===r&&(a=s.split("#")[0].split("?")[0]!==i.split("#")[0].split("?")[0]),a)&&(this.track_pageview()&&(i=s))}.bind(this))}},MixpanelLib.prototype._prepare_callback=function(r,i){if(cn.isUndefined(r))return null;if(Jn){return function(s){r(s,i)}}var s=this._jsc,a=""+Math.floor(1e8*Math.random()),h=this.get_config("callback_fn")+"["+a+"]";return s[a]=function(h){delete s[a],r(h,i)},h},MixpanelLib.prototype._send_request=function(r,i,s,a){var h=!0;if(Xn)return this.__request_queue.push(arguments),h;var f={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},_=null;a||!cn.isFunction(s)&&"string"!=typeof s||(a=s,s=null),s=cn.extend(f,s||{}),Jn||(s.method="GET");var v="POST"===s.method,b=Qn&&v&&"sendbeacon"===s.transport.toLowerCase(),S=s.verbose;i.verbose&&(S=!0),this.get_config("test")&&(i.test=1),S&&(i.verbose=1),this.get_config("img")&&(i.img=1),Jn||(a?i.callback=a:(S||this.get_config("test"))&&(i.callback="(function(){})")),i.ip=this.get_config("ip")?1:0,i._=(new Date).getTime().toString(),v&&(_="data="+encodeURIComponent(i.data),delete i.data),r+="?"+cn.HTTPBuildQuery(i);var k=this;if("img"in i){var I=Yr.createElement("img");I.src=r,Yr.body.appendChild(I)}else if(b){try{h=Qn(r,_)}catch(N){k.report_error(N),h=!1}try{a&&a(h?1:0)}catch(N){k.report_error(N)}}else if(Jn)try{var C=new XMLHttpRequest;C.open(s.method,r,!0);var T=this.get_config("xhr_headers");if(v&&(T["Content-Type"]="application/x-www-form-urlencoded"),cn.each(T,(function(r,i){C.setRequestHeader(i,r)})),s.timeout_ms&&void 0!==C.timeout){C.timeout=s.timeout_ms;var O=(new Date).getTime()}C.withCredentials=!0,C.onreadystatechange=function(){var r;if(4===C.readyState)if(200===C.status){if(a)if(S){var i;try{i=cn.JSONDecode(C.responseText)}catch(N){if(k.report_error(N),!s.ignore_json_errors)return;i=C.responseText}a(i)}else a(Number(C.responseText))}else if(r=C.timeout&&!C.status&&(new Date).getTime()-O>=C.timeout?"timeout":"Bad HTTP status: "+C.status+" "+C.statusText,k.report_error(r),a)if(S){var h=C.responseHeaders||{};a({status:0,httpStatusCode:C.status,error:r,retryAfter:h["Retry-After"]})}else a(0)},C.send(_)}catch(N){k.report_error(N),h=!1}else{var R=Yr.createElement("script");R.type="text/javascript",R.async=!0,R.defer=!0,R.src=r;var M=Yr.getElementsByTagName("script")[0];M.parentNode.insertBefore(R,M)}return h},MixpanelLib.prototype._execute_array=function(r){var i,s=[],a=[],h=[];cn.each(r,(function(r){r&&(i=r[0],cn.isArray(i)?h.push(r):"function"==typeof r?r.call(this):cn.isArray(r)&&"alias"===i?s.push(r):cn.isArray(r)&&-1!==i.indexOf("track")&&"function"==typeof this[i]?h.push(r):a.push(r))}),this);var execute=function(r,i){cn.each(r,(function(r){if(cn.isArray(r[0])){var s=i;cn.each(r,(function(r){s=s[r[0]].apply(s,r.slice(1))}))}else this[r[0]].apply(this,r.slice(1))}),i)};execute(s,this),execute(a,this),execute(h,this)},MixpanelLib.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},MixpanelLib.prototype.get_batcher_configs=function(){var r="__mpq_"+this.get_config("token"),i=this.get_config("api_routes");return this._batcher_configs=this._batcher_configs||{events:{type:"events",endpoint:"/"+i.track,queue_key:r+"_ev"},people:{type:"people",endpoint:"/"+i.engage,queue_key:r+"_pp"},groups:{type:"groups",endpoint:"/"+i.groups,queue_key:r+"_gr"}},this._batcher_configs},MixpanelLib.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var r=cn.bind((function(r){return new RequestBatcher(r.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:cn.bind((function(i,s,a){this._send_request(this.get_config("api_host")+r.endpoint,this._encode_data_for_request(i),s,this._prepare_callback(a,i))}),this),beforeSendHook:cn.bind((function(i){return this._run_hook("before_send_"+r.type,i)}),this),stopAllBatchingFunc:cn.bind(this.stop_batch_senders,this),usePersistence:!0})}),this),i=this.get_batcher_configs();this.request_batchers={events:r(i.events),people:r(i.people),groups:r(i.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},MixpanelLib.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,cn.each(this.request_batchers,(function(r){r.start()})))},MixpanelLib.prototype.stop_batch_senders=function(){this._batch_requests=!1,cn.each(this.request_batchers,(function(r){r.stop(),r.clear()}))},MixpanelLib.prototype.push=function(r){this._execute_array([r])},MixpanelLib.prototype.disable=function(r){void 0===r?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(r)},MixpanelLib.prototype._encode_data_for_request=function(r){var i=cn.JSONEncode(r);return this.get_config("api_payload_format")===Hn&&(i=cn.base64Encode(i)),{data:i}},MixpanelLib.prototype._track_or_batch=function(r,i){var s=cn.truncate(r.data,255),a=r.endpoint,h=r.batcher,f=r.should_send_immediately,_=r.send_request_options||{};i=i||NOOP_FUNC;var v=!0,b=cn.bind((function(){return _.skip_hooks||(s=this._run_hook("before_send_"+r.type,s)),s?(dn.log("MIXPANEL REQUEST:"),dn.log(s),this._send_request(a,this._encode_data_for_request(s),_,this._prepare_callback(i,s))):null}),this);return this._batch_requests&&!f?h.enqueue(s,(function(r){r?i(1,s):b()})):v=b(),v&&s},MixpanelLib.prototype.track=addOptOutCheckMixpanelLib((function(r,i,s,a){a||"function"!=typeof s||(a=s,s=null);var h=(s=s||{}).transport;h&&(s.transport=h);var f=s.send_immediately;if("function"!=typeof a&&(a=NOOP_FUNC),cn.isUndefined(r))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(r)){(i=cn.extend({},i)).token=this.get_config("token");var _=this.persistence.remove_event_timer(r);if(!cn.isUndefined(_)){var v=(new Date).getTime()-_;i.$duration=parseFloat((v/1e3).toFixed(3))}this._set_default_superprops();var b=this.get_config("track_marketing")?cn.info.marketingParams():{};i=cn.extend({},cn.info.properties({mp_loader:this.get_config("mp_loader")}),b,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),i);var S=this.get_config("property_blacklist");cn.isArray(S)?cn.each(S,(function(r){delete i[r]})):this.report_error("Invalid value for property_blacklist config: "+S);var k={event:r,properties:i};return this._track_or_batch({type:"events",data:k,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:f,send_request_options:s},a)}a(0)}})),MixpanelLib.prototype.set_group=addOptOutCheckMixpanelLib((function(r,i,s){cn.isArray(i)||(i=[i]);var a={};return a[r]=i,this.register(a),this.people.set(r,i,s)})),MixpanelLib.prototype.add_group=addOptOutCheckMixpanelLib((function(r,i,s){var a=this.get_property(r),h={};return void 0===a?(h[r]=[i],this.register(h)):-1===a.indexOf(i)&&(a.push(i),h[r]=a,this.register(h)),this.people.union(r,i,s)})),MixpanelLib.prototype.remove_group=addOptOutCheckMixpanelLib((function(r,i,s){var a=this.get_property(r);if(void 0!==a){var h=a.indexOf(i);h>-1&&(a.splice(h,1),this.register({group_key:a})),0===a.length&&this.unregister(r)}return this.people.remove(r,i,s)})),MixpanelLib.prototype.track_with_groups=addOptOutCheckMixpanelLib((function(r,i,s,a){var h=cn.extend({},i||{});return cn.each(s,(function(r,i){null!=r&&(h[i]=r)})),this.track(r,h,a)})),MixpanelLib.prototype._create_map_key=function(r,i){return r+"_"+JSON.stringify(i)},MixpanelLib.prototype._remove_group_from_cache=function(r,i){delete this._cached_groups[this._create_map_key(r,i)]},MixpanelLib.prototype.get_group=function(r,i){var s=this._create_map_key(r,i),a=this._cached_groups[s];return void 0!==a&&a._group_key===r&&a._group_id===i||((a=new MixpanelGroup)._init(this,r,i),this._cached_groups[s]=a),a},MixpanelLib.prototype.track_pageview=addOptOutCheckMixpanelLib((function(r,i){"object"!=typeof r&&(r={});var s=(i=i||{}).event_name||"$mp_web_page_view",a=cn.extend(cn.info.mpPageViewProperties(),cn.info.campaignParams(),cn.info.clickParams()),h=cn.extend({},a,r);return this.track(s,h)})),MixpanelLib.prototype.track_links=function(){return this._track_dom.call(this,LinkTracker,arguments)},MixpanelLib.prototype.track_forms=function(){return this._track_dom.call(this,FormTracker,arguments)},MixpanelLib.prototype.time_event=function(r){cn.isUndefined(r)?this.report_error("No event name provided to mixpanel.time_event"):this._event_is_disabled(r)||this.persistence.set_event_timer(r,(new Date).getTime())};var ni={persistent:!0},options_for_register=function(r){var i;return i=cn.isObject(r)?r:cn.isUndefined(r)?{}:{days:r},cn.extend({},ni,i)};MixpanelLib.prototype.register=function(r,i){var s=options_for_register(i);s.persistent?this.persistence.register(r,s.days):cn.extend(this.unpersisted_superprops,r)},MixpanelLib.prototype.register_once=function(r,i,s){var a=options_for_register(s);a.persistent?this.persistence.register_once(r,i,a.days):(void 0===i&&(i="None"),cn.each(r,(function(r,s){this.unpersisted_superprops.hasOwnProperty(s)&&this.unpersisted_superprops[s]!==i||(this.unpersisted_superprops[s]=r)}),this))},MixpanelLib.prototype.unregister=function(r,i){(i=options_for_register(i)).persistent?this.persistence.unregister(r):delete this.unpersisted_superprops[r]},MixpanelLib.prototype._register_single=function(r,i){var s={};s[r]=i,this.register(s)},MixpanelLib.prototype.identify=function(r,i,s,a,h,f,_,v){var b=this.get_distinct_id();if(r&&b!==r){if("string"==typeof r&&0===r.indexOf(Yn))return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:r})}if(!this.get_property("$device_id")){var S=b;this.register_once({$had_persisted_distinct_id:!0,$device_id:S},"")}r!==b&&r!==this.get_property(zn)&&(this.unregister(zn),this.register({distinct_id:r})),this._flags.identify_called=!0,this.people._flush(i,s,a,h,f,_,v),r!==b&&this.track("$identify",{distinct_id:r,$anon_distinct_id:b},{skip_hooks:!0})},MixpanelLib.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var r=cn.UUID();this.register_once({distinct_id:Yn+r,$device_id:r},"")},MixpanelLib.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},MixpanelLib.prototype.alias=function(r,i){if(r===this.get_property(Bn))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var s=this;return cn.isUndefined(i)&&(i=this.get_distinct_id()),r!==i?(this._register_single(zn,r),this.track("$create_alias",{alias:r,distinct_id:i},{skip_hooks:!0},(function(){s.identify(r)}))):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(r),-1)},MixpanelLib.prototype.name_tag=function(r){this._register_single("mp_name_tag",r)},MixpanelLib.prototype.set_config=function(r){cn.isObject(r)&&(cn.extend(this.config,r),r.batch_size&&cn.each(this.request_batchers,(function(r){r.resetBatchSize()})),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),Tr.DEBUG=Tr.DEBUG||this.get_config("debug"))},MixpanelLib.prototype.get_config=function(r){return this.config[r]},MixpanelLib.prototype._run_hook=function(r){var i=(this.config.hooks[r]||IDENTITY_FUNC).apply(this,Vr.call(arguments,1));return void 0===i&&(this.report_error(r+" hook did not return a value"),i=null),i},MixpanelLib.prototype.get_property=function(r){return this.persistence.load_prop([r])},MixpanelLib.prototype.toString=function(){var r=this.get_config("name");return r!==Kn&&(r=Kn+"."+r),r},MixpanelLib.prototype._event_is_disabled=function(r){return cn.isBlockedUA(Qr)||this._flags.disable_all_events||cn.include(this.__disabled_events,r)},MixpanelLib.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&cn.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_tracking()||!this.get_config("opt_out_tracking_by_default")&&!cn.cookie.get("mp_optout")||(cn.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},MixpanelLib.prototype._gdpr_update_persistence=function(r){var i;if(r&&r.clear_persistence)i=!0;else{if(!r||!r.enable_persistence)return;i=!1}this.get_config("disable_persistence")||this.persistence.disabled===i||this.persistence.set_disabled(i),i?this.stop_batch_senders():this._batchers_were_started&&this.start_batch_senders()},MixpanelLib.prototype._gdpr_call_func=function(r,i){return i=cn.extend({track:cn.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},i),cn.localStorage.is_supported()||(i.persistence_type="cookie"),r(this.get_config("token"),{track:i.track,trackEventName:i.track_event_name,trackProperties:i.track_properties,persistenceType:i.persistence_type,persistencePrefix:i.cookie_prefix,cookieDomain:i.cookie_domain,cookieExpiration:i.cookie_expiration,crossSiteCookie:i.cross_site_cookie,crossSubdomainCookie:i.cross_subdomain_cookie,secureCookie:i.secure_cookie,ignoreDnt:i.ignore_dnt})},MixpanelLib.prototype.opt_in_tracking=function(r){r=cn.extend({enable_persistence:!0},r),this._gdpr_call_func(optIn,r),this._gdpr_update_persistence(r)},MixpanelLib.prototype.opt_out_tracking=function(r){(r=cn.extend({clear_persistence:!0,delete_user:!0},r)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(optOut,r),this._gdpr_update_persistence(r)},MixpanelLib.prototype.has_opted_in_tracking=function(r){return this._gdpr_call_func(hasOptedIn,r)},MixpanelLib.prototype.has_opted_out_tracking=function(r){return this._gdpr_call_func(hasOptedOut,r)},MixpanelLib.prototype.clear_opt_in_out_tracking=function(r){r=cn.extend({enable_persistence:!0},r),this._gdpr_call_func(clearOptInOut,r),this._gdpr_update_persistence(r)},MixpanelLib.prototype.report_error=function(r,i){dn.error.apply(dn.error,arguments);try{i||r instanceof Error||(r=new Error(r)),this.get_config("error_reporter")(r,i)}catch(s){dn.error(s)}},MixpanelLib.prototype.init=MixpanelLib.prototype.init,MixpanelLib.prototype.reset=MixpanelLib.prototype.reset,MixpanelLib.prototype.disable=MixpanelLib.prototype.disable,MixpanelLib.prototype.time_event=MixpanelLib.prototype.time_event,MixpanelLib.prototype.track=MixpanelLib.prototype.track,MixpanelLib.prototype.track_links=MixpanelLib.prototype.track_links,MixpanelLib.prototype.track_forms=MixpanelLib.prototype.track_forms,MixpanelLib.prototype.track_pageview=MixpanelLib.prototype.track_pageview,MixpanelLib.prototype.register=MixpanelLib.prototype.register,MixpanelLib.prototype.register_once=MixpanelLib.prototype.register_once,MixpanelLib.prototype.unregister=MixpanelLib.prototype.unregister,MixpanelLib.prototype.identify=MixpanelLib.prototype.identify,MixpanelLib.prototype.alias=MixpanelLib.prototype.alias,MixpanelLib.prototype.name_tag=MixpanelLib.prototype.name_tag,MixpanelLib.prototype.set_config=MixpanelLib.prototype.set_config,MixpanelLib.prototype.get_config=MixpanelLib.prototype.get_config,MixpanelLib.prototype.get_property=MixpanelLib.prototype.get_property,MixpanelLib.prototype.get_distinct_id=MixpanelLib.prototype.get_distinct_id,MixpanelLib.prototype.toString=MixpanelLib.prototype.toString,MixpanelLib.prototype.opt_out_tracking=MixpanelLib.prototype.opt_out_tracking,MixpanelLib.prototype.opt_in_tracking=MixpanelLib.prototype.opt_in_tracking,MixpanelLib.prototype.has_opted_out_tracking=MixpanelLib.prototype.has_opted_out_tracking,MixpanelLib.prototype.has_opted_in_tracking=MixpanelLib.prototype.has_opted_in_tracking,MixpanelLib.prototype.clear_opt_in_out_tracking=MixpanelLib.prototype.clear_opt_in_out_tracking,MixpanelLib.prototype.get_group=MixpanelLib.prototype.get_group,MixpanelLib.prototype.set_group=MixpanelLib.prototype.set_group,MixpanelLib.prototype.add_group=MixpanelLib.prototype.add_group,MixpanelLib.prototype.remove_group=MixpanelLib.prototype.remove_group,MixpanelLib.prototype.track_with_groups=MixpanelLib.prototype.track_with_groups,MixpanelLib.prototype.start_batch_senders=MixpanelLib.prototype.start_batch_senders,MixpanelLib.prototype.stop_batch_senders=MixpanelLib.prototype.stop_batch_senders,MixpanelLib.prototype.start_session_recording=MixpanelLib.prototype.start_session_recording,MixpanelLib.prototype.stop_session_recording=MixpanelLib.prototype.stop_session_recording,MixpanelLib.prototype.get_session_recording_properties=MixpanelLib.prototype.get_session_recording_properties,MixpanelLib.prototype.DEFAULT_API_ROUTES=ei,MixpanelPersistence.prototype.properties=MixpanelPersistence.prototype.properties,MixpanelPersistence.prototype.update_search_keyword=MixpanelPersistence.prototype.update_search_keyword,MixpanelPersistence.prototype.update_referrer_info=MixpanelPersistence.prototype.update_referrer_info,MixpanelPersistence.prototype.get_cross_subdomain=MixpanelPersistence.prototype.get_cross_subdomain,MixpanelPersistence.prototype.clear=MixpanelPersistence.prototype.clear;var ii={},override_mp_init_func=function(){Gn.init=function(r,i,s){if(s)return Gn[s]||(Gn[s]=ii[s]=create_mplib(r,i,s),Gn[s]._loaded()),Gn[s];var a=Gn;ii[Kn]?a=ii[Kn]:r&&((a=create_mplib(r,i,Kn))._loaded(),ii[Kn]=a),Gn=a,1===An&&(Er[Kn]=Gn),cn.each(ii,(function(r,i){i!==Kn&&(Gn[i]=r)})),Gn._=cn}};var oi=function init_as_module(r){return load_extra_bundle=r,An=0,Gn=new MixpanelLib,override_mp_init_func(),Gn.init(),function(){function dom_loaded_handler(){dom_loaded_handler.done||(dom_loaded_handler.done=!0,ri=!0,Xn=!1,cn.each(ii,(function(r){r._dom_loaded()})))}if(Yr.addEventListener)"complete"===Yr.readyState?dom_loaded_handler():Yr.addEventListener("DOMContentLoaded",dom_loaded_handler,!1);else if(Yr.attachEvent){Yr.attachEvent("onreadystatechange",dom_loaded_handler);var r=!1;try{r=null===Er.frameElement}catch(i){}Yr.documentElement.doScroll&&r&&function do_scroll_check(){try{Yr.documentElement.doScroll("left")}catch(i){return void setTimeout(do_scroll_check,1)}dom_loaded_handler()}()}cn.register_event(Er,"load",dom_loaded_handler,!0)}(),Gn}((function loadNoop(r,i){i()}));const si="mp_distinct_id",ai={"Event Source":"sdk"};function isReady(){return void 0!==window.mixpanel}function updateCachedDistinctId(r){localStorage.setItem(si,r)}const ci={init:function init$2(r,i=!1,s){return new Promise((a=>{oi.init(r,{debug:i,loaded:()=>{window.mixpanel=oi,oi.register({...ai}),a()},...s&&{api_host:s}})}))},isReady:isReady,track:function track(r,i){isReady()&&oi.track(r,{...i,"Reservamos Version":"1.1.5-alpha.0"})},identify:function identify$1(r,i){oi.identify(r),updateCachedDistinctId(r),oi.people.set(i)},attachProperty:function attachProperty(r,i){isReady()&&oi.people.union(r,[i])},setPeopleProperties:function setPeopleProperties(r){isReady()&&oi.people.set(r)},getMixpanelDistinctId:()=>{const r=localStorage.getItem(si);if(oi&&oi.get_distinct_id){const r=oi.get_distinct_id();return updateCachedDistinctId(r),r}return r||null}},di=Oe.object({"Selected City":Oe.string().min(1,"Selected city is required"),"Selected Country Code":Oe.string().min(1,"Selected Country Code is required")});const ui=Oe.object({firstName:Oe.string().optional(),lastName:Oe.string().optional(),email:Oe.string().email().optional(),phone:Oe.string().optional()}),li=["web","web-mobile","ios","android","app"],pi=Oe.enum(li).refine((r=>li.includes(r)),{message:`Product must be one of: ${li.join(", ")}`}),hi=Oe.object({product:pi});const dateValidation=r=>!(!/^\d{4}-\d{2}-\d{2}$/.test(r)&&!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/.test(r))||!(!/^\d{4}-\d{2}-\d{2}/.test(r)||isNaN(Date.parse(r))),stringField=r=>Oe.string().refine((r=>r),{message:`${r} must be a string`}),numberField=r=>Oe.number().refine((r=>r),{message:`${r} must be a number`}),intField=r=>Oe.number().int().refine((r=>r),{message:`${r} must be an integer`}),dateField=r=>Oe.string().refine(dateValidation,{message:`Invalid ${r} datetime format`}),arrayField=(r,i,s)=>Oe.array(r).min(s,`${i} must have at least ${s} items`),fi=Oe.object({Origin:stringField("Origin").optional(),Destination:stringField("Destination").optional(),Departure:dateField("Departure").optional(),Return:dateField("Return").optional(),"Departure Date":stringField("Departure Date").optional(),product:pi});const mi=Oe.object({"Passenger Birthdate":dateField("Passenger Birthdate"),"Passenger Seat":stringField("Passenger Seat"),"Passenger Name":stringField("Passenger Name"),"Passenger Document Type":stringField("Document Type"),"Passenger Document Id":stringField("Document ID")}).strict(),gi=Oe.object({"Departure Arrival":dateField("Departure Arrival"),"Departure Destination":stringField("Departure Destination"),"Departure Destination Terminal":stringField("Departure Destination Terminal"),"Departure Line":stringField("Departure Line"),"Departure Origin":stringField("Departure Origin"),"Departure Origin Terminal":stringField("Departure Origin Terminal"),"Departure Price":numberField("Departure Price"),"Departure Route":stringField("Departure Route"),"Departure Stops":intField("Departure Stops"),"Departure Time":dateField("Departure Time"),"Departure Transport Type":stringField("Departure Transport Type"),"Departure Transporter":stringField("Departure Transporter"),"Return Arrival":dateField("Return Arrival").optional(),"Return Destination":stringField("Return Destination").optional(),"Return Destination Terminal":stringField("Return Destination Terminal").optional(),"Return Line":stringField("Return Line").optional(),"Return Origin":stringField("Return Origin").optional(),"Return Origin Terminal":stringField("Return Origin Terminal").optional(),"Return Price":numberField("Return Price").optional(),"Return Route":stringField("Return Route").optional(),"Return Stops":intField("Return Stops").optional(),"Return Time":dateField("Return Time").optional(),"Return Transport Type":stringField("Return Transport Type").optional(),"Return Transporter":stringField("Return Transporter").optional(),"Recommended Trip":Oe.boolean(),"Recommended Trip Type":stringField("Recommended Trip Type").optional()}),_i=Oe.object({Trips:arrayField(gi,"Trips",1),"Passenger Count":intField("Passenger Count"),"Trip Count":intField("Trip Count").optional(),Total:numberField("Total"),product:pi,Passengers:arrayField(mi,"Passengers",1).optional()}).strict();const yi=Oe.object({"Operation Id":stringField("Operation Id").optional(),Trips:arrayField(gi,"Trips",1),"Passenger Count":intField("Passenger Count"),"Trip Count":intField("Trip Count"),"Payment Type":Oe.string().min(1,"Payment Type is required"),Total:numberField("Total"),product:pi,Passengers:arrayField(mi,"Passengers",1).optional(),Insurance:(vi="Insurance",Oe.boolean({required_error:`${vi} is required`,invalid_type_error:`${vi} must be a boolean`})).optional(),Coupon:stringField("Coupon").optional(),"User Status":stringField("User Status").optional()}).strict();var vi;const bi=Oe.object({Arrival:Oe.string().refine(dateValidation,{message:"Invalid arrival datetime format"}),Departure:Oe.string().refine(dateValidation,{message:"Invalid departure datetime format"}),Destination:Oe.string().min(1,"Destination is required"),"Destination Terminal":Oe.string().min(1,"Destination terminal is required"),Line:Oe.string().min(1,"Line is required").optional(),Origin:Oe.string().min(1,"Origin is required"),"Origin Terminal":Oe.string().min(1,"Origin terminal is required"),Price:Oe.number().positive("Price must be a positive number"),"Result Position":Oe.number().int("Result Position must be an integer"),Route:Oe.string().min(1,"Route is required"),Stops:Oe.number().int("Stops must be an integer").nonnegative("Stops must be non-negative"),"Transport Type":Oe.string().min(1,"Transport Type is required"),Transporter:Oe.string().min(1,"Transporter is required"),product:pi,"Recommended Trip":Oe.boolean(),"Recommended Trip Type":Oe.string().optional(),"Trip Type":Oe.string().min(1,"Trip Type is required"),"Bus Type":Oe.string().min(1,"Bus Type is required")});const Si=Oe.object({"Operation Id":stringField("Operation Id").optional(),Trips:arrayField(gi,"Trips",1),"Passenger Count":intField("Passenger Count"),"Trip Count":intField("Trip Count"),Total:numberField("Total"),product:pi,Passengers:arrayField(mi,"Passengers",1).optional()}).strict();const ki=Oe.object({order_number:Oe.string().min(1,"order_number is required"),payment_status:Oe.enum(["confirmed","pending_pix"]),payment_type:Oe.string().optional(),total:Oe.number().optional()}).strict();const wi=Oe.object({Departure:Oe.string().refine(dateValidation,{message:"Invalid departure date or datetime format. Must include at least YYYY-MM-DD"}),"Departure Delta":Oe.number().int("Departure Delta must be an integer"),Destination:Oe.string().min(1,"Destination is required"),"Destination Terminal":Oe.string().min(1,"Destination terminal is required"),Origin:Oe.string().min(1,"Origin is required"),"Origin Terminal":Oe.string().min(1,"Origin terminal is required"),Passengers:Oe.number().int("Passenger count must be an integer"),Return:Oe.string().refine(dateValidation,{message:"Invalid Return date or datetime format. Must include at least YYYY-MM-DD"}).optional(),Route:Oe.string().min(1,"Route is required"),"Trip Length":Oe.number().positive().optional(),Categories:Oe.array(Oe.string()).optional(),product:pi});const Ii=Oe.object({Arrival:Oe.string().refine(dateValidation,{message:"Invalid arrival date or datetime format. Must include at least YYYY-MM-DD"}),Departure:Oe.string().refine(dateValidation,{message:"Invalid departure date or datetime format. Must include at least YYYY-MM-DD"}),Destination:Oe.string().min(1,"Destination is required"),"Destination Terminal":Oe.string().min(1,"Destination Terminal is required"),Line:Oe.string().min(1,"Line is required").optional(),Origin:Oe.string().min(1,"Origin is required"),"Origin Terminal":Oe.string().min(1,"Origin Terminal is required"),Price:Oe.number().positive("Price must be a positive number"),Route:Oe.string().min(1,"Route is required"),Stops:Oe.number().int("Stops must be an integer").nonnegative().optional(),Tickets:Oe.number().int("Tickets must be an integer").positive(),Transporter:Oe.string().min(1,"Transporter is required"),Way:Oe.enum(["Departure","Return"],{description:"Way must be either 'Departure' or 'Return'"}),product:pi});const Ei=Oe.object({"Bus count":Oe.number().int("Bus count must be an integer"),Departure:Oe.string().refine(dateValidation,{message:"Invalid departure datetime format"}),"Departure Delta":Oe.number().int("Departure Delta must be an integer").optional(),Destination:Oe.string().min(1,"Destination is required").optional(),"Destination Terminal":Oe.string().min(1,"Destination terminal is required").optional(),"Has Frequent Buses":Oe.boolean().default(!1).optional(),Origin:Oe.string().min(1,"Origin is required"),"Origin Terminal":Oe.string().min(1,"Origin terminal is required"),Route:Oe.string().min(1,"Route is required"),product:pi}),xi=Oe.object({mixpanelToken:Oe.string().min(1,"Mixpanel token is required"),debug:Oe.boolean().optional(),identificationKey:Oe.string().min(1,"Identification key is required"),isSandbox:Oe.boolean().optional(),mixpanelProxyUrl:Oe.string().optional(),identifyProxyUrl:Oe.string().optional(),appName:Oe.string().min(1,"App name cannot be empty").optional()}),SchemaErrorFormatter=r=>r.issues.map((r=>{let i="INVALID_FIELD",s="",a="",h="";return"invalid_type"===r.code?(i="TYPE_MISMATCH",s=r.expected,a=r.received,h=`Expected ${s} but received ${a}. Please provide a value of type ${s}.`):"too_small"===r.code?(i="VALUE_TOO_SMALL",h=`Increase the value to at least ${r.minimum}.`):"too_big"===r.code?(i="VALUE_TOO_BIG",h=`Reduce the value to no more than ${r.maximum}.`):(i="INVALID_FIELD",h="Ensure the field matches the expected format and value type."),{field:r.path.join("."),error_type:i,expected:s,received:a,message:r.message,suggestion:h}})),Ci={Search:wi,"Seat Change":Ii,"Interest In Home":hi,"Passengers Created":_i,"Payment Attempt":yi,"Interest In Search":fi,"View Results":Ei,"Purchase Attempt":Si,"Picked Departure":bi,"Geolocation Selected":di,"Purchase Confirmation Viewed":ki};function validateProps(r,i){try{i.parse(r)}catch(Ar){if(Ar instanceof ZodError){throw{message:"Schema validation failed",errors:SchemaErrorFormatter(Ar)}}throw{message:"Unknown validation error"}}}const Ti={parseEventProps:function parseEventProps(r,i){const s=Ci[r]||Me;try{s.parse(i)}catch(Ar){if(Ar instanceof ZodError){throw{message:"Schema validation failed",errors:SchemaErrorFormatter(Ar)}}throw{message:"Unknown validation error"}}},parseInitProps:function parseInitProps(r){validateProps(r,xi)},parseIdentifyProps:function parseIdentifyProps(r){validateProps(r,ui)},validateProps:validateProps};function isTrackerReady(){return ci.isReady()}let Oi=null,Ri=null;const Mi="geolocationPermissionTimestamp",Ni="geolocationCache",Pi="Geolocation Requested",Di=36e5,Ai={enableHighAccuracy:!0,timeout:1e4,maximumAge:0};function safeGetItem(r){try{return localStorage.getItem(r)}catch{return null}}function safeSetItem(r,i){try{localStorage.setItem(r,i)}catch{}}function loadCoordinatesFromStorage(){const r=safeGetItem(Ni);if(!r)return null;try{const i=JSON.parse(r);return function isGeolocationCache(r){if("object"!=typeof r||null===r)return!1;const i=r;return"number"==typeof i.lat&&"number"==typeof i.long&&"string"==typeof i.updatedAt&&(void 0===i.accuracy||"number"==typeof i.accuracy)}(i)?i:null}catch{return null}}function repairLegacyGeolocationStorage(){safeGetItem(Mi)&&(loadCoordinatesFromStorage()||function safeRemoveItem(r){try{localStorage.removeItem(r)}catch{}}(Mi))}function syncGeolocationToMixpanel(r){if(!isTrackerReady())return;const i=function buildGeolocationEventProperties(r){const i={"Geolocation Updated At":r.updatedAt,"Geolocation Status":r.status};return void 0!==r.accuracy&&(i["Geolocation Accuracy"]=r.accuracy),void 0!==r.errorCode&&(i["Geolocation Error Code"]=r.errorCode),"granted"!==r.status&&"skipped_cache"!==r.status||void 0===r.lat||void 0===r.long||(i.latitude=r.lat,i.longitude=r.long),void 0!==r.source&&(i.geolocation_source=r.source),i}(r),s=function buildGeolocationProfileProperties(r){const i={"Geolocation Updated At":r.updatedAt,"Geolocation Status":r.status};return"granted"!==r.status&&"skipped_cache"!==r.status||void 0===r.lat||void 0===r.long||(i.latitude=r.lat,i.longitude=r.long),void 0!==r.source&&(i.geolocation_source=r.source),i}(r);trackCustomEvent(Pi,i),ci.setPeopleProperties(s)}const Zi={init:function init(){return repairLegacyGeolocationStorage(),function restoreCoordinatesFromStorage(){const r=loadCoordinatesFromStorage();r&&(Oi={lat:r.lat,long:r.long},Ri="browser")}(),new Promise((r=>{var i;if(function isPermissionTimestampValid(r){return!!r&&Date.now()-parseInt(r,10)<Di}(safeGetItem(Mi))){const i=loadCoordinatesFromStorage();if(i)return syncGeolocationToMixpanel({status:"skipped_cache",updatedAt:i.updatedAt,lat:i.lat,long:i.long,accuracy:i.accuracy,source:"browser"}),void r(Oi)}const s=Date.now(),a=function toISO(r){return new Date(r).toISOString()}(s);if(!(null==(i=navigator.geolocation)?void 0:i.getCurrentPosition))return syncGeolocationToMixpanel({status:"error",updatedAt:a}),void r(null);navigator.geolocation.getCurrentPosition((i=>{const{latitude:h,longitude:f,accuracy:_}=i.coords;Oi={lat:h,long:f},Ri="browser",function saveCoordinatesToStorage(r,i,s){safeSetItem(Ni,JSON.stringify({lat:r.lat,long:r.long,updatedAt:i,...void 0!==s&&{accuracy:s}}))}(Oi,a,_),function updatePermissionTimestamp(r){safeSetItem(Mi,r.toString())}(s),syncGeolocationToMixpanel({status:"granted",updatedAt:a,lat:h,long:f,accuracy:_,source:"browser"}),r(Oi)}),(i=>{const s=function getGeolocationStatus(r){return r.code===r.PERMISSION_DENIED?"denied":"error"}(i);syncGeolocationToMixpanel({status:s,updatedAt:a,errorCode:i.code}),r(null)}),Ai)}))},getCoordinates:function getCoordinates(){return Oi},getGeolocationSource:function getGeolocationSource(){return Ri}},Li=["Search","View Results"],ji={utm_brand:"UTM Brand",utm_kxconfig:"UTM KXConfig",gad_source:"GAD Source",gclid:"GCLID"};function trackEventError(r,i,s){tryTrackEvent((async()=>{try{ci.track("Track Event Error",{"Failed Event Name":r,"Error Message":(null==i?void 0:i.message)??"Failed to track event","Validation Errors":(null==i?void 0:i.errors)||[],"Event Payload":s})}catch(a){console.error("Failed to track error event:",a)}}))}async function tryTrackEvent(r){ci.isReady()?await r():window.addEventListener("Tracker Ready",(async()=>{await r()}))}async function trackEvent(r,i,s={}){if(!ci.isReady())throw new Error("Mixpanel is not initialized.");try{Ti.parseEventProps(r,i);const a=!Li.includes(r);ci.getMixpanelDistinctId();const h=await wt.getFingerprint(a),f={},_=Zi.getCoordinates(),v=Zi.getGeolocationSource();_&&(f.latitude=_.lat,f.longitude=_.long),v&&(f.geolocation_source=v);const b={"User Fingerprint":h},S=function extractTrackingParams(){try{const r=new URLSearchParams(window.location.search),i={};return Object.entries(ji).forEach((([s,a])=>{const h=r.get(s);h&&(i[a]=h)})),i}catch(Ar){return console.error("Error extracting tracking parameters:",Ar),{}}}(),k=function flattenEventData(r){return Object.entries(r).reduce(((r,[i,s])=>Array.isArray(s)?Array.isArray(s)&&s.every((r=>"string"==typeof r||"number"==typeof r||"boolean"==typeof r))?(r[i]=s,r):(s.forEach((i=>{"object"==typeof i&&null!==i&&Object.entries(i).forEach((([i,s])=>{r[i]?r[i].push(s):r[i]=[s]}))})),r):(r[i]=s,r)),{})}(i),I={...b,...k,...S,...f,...s};ci.track(r,I)}catch(Ar){console.error(`Error tracking event '${r}':`,Ar),trackEventError(r,Ar,i)}}function trackCustomEvent(r,i={},s={}){try{Ne.parse(r),trackEvent(r,i,s)}catch(Ar){console.error("Error trackCustomEvent:",Ar),trackEventError(r,Ar,i)}}const Fi=Oe.object({email:Oe.string().email().optional(),phone:Oe.string().optional(),cpf:Oe.string().optional(),passport:Oe.string().optional(),rg:Oe.string().optional(),firstName:Oe.string().optional(),lastName:Oe.string().optional()}).refine((r=>r.email||r.phone),{message:"At least one of 'email' or 'phone' must be provided"});async function createAnonymousProfile(r){try{Ti.validateProps(r,Fi);const i=[],s=wt.getCachedFingerprint(),a=ci.getMixpanelDistinctId();s&&i.push({key:"fingerprint",value:s}),a&&i.push({key:"distinct_id",value:a});const h=function getAnonymousProfilePayload(r,i){let s="phone",a=r.phone||"";const h=[],f={};r.email&&(s="email",a=r.email);const _=["cpf","passport","rg","email","phone","salesforceid"],v=["name","firstName","lastName"];return Object.entries(r).forEach((([r,i])=>{r=function isCamelCase(r){return!(!r||r.includes(" ")||r[0]!==r[0].toLowerCase()||/[^a-zA-Z]/.test(r)||!/[A-Z]/.test(r))}(r)?r:r.toLocaleLowerCase(),_.includes(r)&&i?r!==s&&h.push({key:r,value:i}):v.includes(r)&&i&&(f[r]=i)})),i.length&&i.forEach((r=>h.push(r))),{identifier_key:s,identifier_value:a,details:f,identifiers:h}}(r,i);return await Lt.profiles.createAnonymousProfile(h)}catch(Ar){return void console.error("Could not create anonymous profile:",Ar)}}const qi=["firstName","lastName","email","phone"];Oe.object({"Operation Id":stringField("Operation Id"),Trips:arrayField(gi,"Trips",1).optional(),"Passenger Count":numberField("Passenger Count").optional(),Total:numberField("Total").optional(),"Trip Count":numberField("Trip Count").optional(),product:pi,Passengers:arrayField(mi,"Passengers",1).optional()});const $i=Oe.object({id:Oe.number(),first_name:Oe.string(),last_name:Oe.string(),second_last_name:Oe.string(),category:Oe.string(),bus_category:Oe.string(),gender:Oe.string(),email:Oe.string()}),Ui=Oe.object({passengers:Oe.array($i).min(1)});const Bi=Oe.object({category:Oe.string(),number:Oe.string().optional(),occupied:Oe.boolean().optional(),adjacent_seats:Oe.null().optional()}),zi=Oe.object({bus:Oe.array(Oe.array(Oe.array(Bi)))}),Vi=Oe.object({bus_type:Oe.string(),selected_seats:Oe.string(),bus_scheme:zi});const Wi=Oe.object({passengerId:Oe.string()}).refine((r=>r.passengerId),{message:"A 'passengerId' must be provided"});const Gi=Oe.object({category:Oe.string(),number:Oe.string().optional(),occupied:Oe.boolean().optional(),adjacent_seats:Oe.null().optional()}),Ki=Oe.object({bus:Oe.array(Oe.array(Oe.array(Gi)))}),Hi=Oe.object({bus_scheme:Ki,total_seats:Oe.number()});const Yi=Oe.object({searchId:Oe.number().min(1,"SearchId is required")});const Ji={init:async function init$1(r){Ti.parseInitProps(r);const{mixpanelToken:i,debug:s=!1,identificationKey:a,isSandbox:h=!1,mixpanelProxyUrl:f,identifyProxyUrl:_,appName:v}=r;await ci.init(i,s,f);try{await wt.initFingerprint(a,_)}catch(Ar){console.error("Error initializing identification service:",Ar)}await Zi.init(),Ut.setEnvironment(h?"sandbox":"prod"),v&&Ut.setAppName(v),Lt.setConfig(Ut.getCoreAPIConfig()),function onLoaded(){window.dispatchEvent(new CustomEvent("Tracker Ready"))}()},isReady:isTrackerReady,identify:async function identify(r,i={}){tryTrackEvent((async()=>{try{if(Ti.parseIdentifyProps(i),!r)throw console.error("User ID is required for identification."),new Error("User ID is required for identification.");const s=await createAnonymousProfile(i);s&&(i.reservamos_one_id=s.id);const a=function mapProperties(r){return{$first_name:null==r?void 0:r.firstName,$last_name:null==r?void 0:r.lastName,$email:null==r?void 0:r.email,$phone:null==r?void 0:r.phone,...Object.keys(r).reduce(((i,s)=>(qi.includes(s)||(i[s]=r[s]),i)),{})}}(i);ci.identify(r,a);const h=await wt.getFingerprint();h&&ci.attachProperty("Known Fingerprints",h)}catch(Ar){console.error("Error identifying user",Ar),trackEventError("Identify",Ar,{userId:r,properties:i})}finally{(async(r,i)=>{var s,a,h;try{const f=Zi.getCoordinates();if(!f)return;i.first_name=i.firstName,i.last_name=i.lastName,i.latitude=f.lat,i.longitude=f.long,i.ip="0",i.name=`${i.firstName} ${i.lastName}`,delete i.firstName,delete i.lastName;const _=Ut.getCoreAPIConfig();fetch(`${_.baseUrl}/v1/datalake/identify`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:(null==(s=_.defaultHeaders)?void 0:s.Authorization)||"",Origin:(null==(a=_.defaultHeaders)?void 0:a.Origin)||"",...(null==(h=_.defaultHeaders)?void 0:h["x-app-name"])?{"x-app-name":_.defaultHeaders["x-app-name"]}:{}},body:JSON.stringify({profile_params:{...i,distinct_id:r}})})}catch(Ar){console.error("Error identifying user-service",Ar)}})(r,i)}}))},identifiers:{getFingerprintId:wt.getCachedFingerprint,getDistinctId:ci.getMixpanelDistinctId},profiles:{createAnonymousProfile:createAnonymousProfile},recommendations:{getRecommendedPlaces:async function getRecommendedPlaces(){const r=ci.getMixpanelDistinctId();if(!r)throw new Error("No distinct ID found");const i=await Lt.recommendations.createRecommendedPlaces({distinct_id:r});if(!i)throw new Error("No response received");return await(async r=>new Promise(((i,s)=>{const{state:a,polling_id:h}=r;"finished"!==a?Lt.recommendations.pollRecommendedPlaces(h,{start:!0,watch:"state",expect:"finished",onEachResponse:r=>{"finished"!==r.status?"failed"!==r.status||s(r):i(r)}}):i(r)})))(i)},createRecommendedSeats:async function createRecommendedSeats$1(r){try{Ti.validateProps(r,Vi);const i=ci.getMixpanelDistinctId(),s=wt.getCachedFingerprint();if(!i)throw new Error("No distinct ID found");return await Lt.recommendations.createRecommendedSeats({...r,distinct_id:i,device_fingerprint:s||""})}catch(Ar){throw console.error("Could not create recommended seats:",Ar),new Error(Ar instanceof Error?Ar.message:String(Ar))}},getRecommendedSeats:async function createRecommendedSeats(r){try{Ti.validateProps(r,Hi);const i=ci.getMixpanelDistinctId();if(!i)throw new Error("No distinct ID found");return await Lt.recommendations.getRecommendedSeats({...r,distinct_id:i})}catch(Ar){throw console.error("Could not create recommended seats:",Ar),new Error(Ar instanceof Error?Ar.message:String(Ar))}},getRecommendedTrips:async function getRecommendedTrips({searchId:r}){try{Ti.validateProps({searchId:r},Yi);const i=wt.getCachedFingerprint()||ci.getMixpanelDistinctId();if(!i)throw new Error("No identifier id");return await Lt.recommendations.getRecommendedTrips({searchId:r,userIdentifier:String(i)})}catch(Ar){throw console.error("Could not get recommended trips:",Ar),new Error(Ar instanceof Error?Ar.message:String(Ar))}},createFrequentPassengers:async function createFrequentPassengers(r){try{Ti.validateProps(r,Ui);const i=ci.getMixpanelDistinctId(),s=wt.getCachedFingerprint();if(!i)throw new Error("No distinct ID found");return await Lt.recommendations.createFrequentPassengers({...r,distinct_id:i,device_fingerprint:s||""})}catch(Ar){throw new Error(Ar instanceof Error?Ar.message:String(Ar))}},getFrequentPassengers:async function getFrequentPassengers(){try{const r=ci.getMixpanelDistinctId();if(!r)throw new Error("No distinct ID found");return await Lt.recommendations.getFrequentPassengers(r)}catch(Ar){throw new Error(Ar instanceof Error?Ar.message:String(Ar))}},deleteFrequentPassenger:async function deleteFrequentPassengers(r){try{Ti.validateProps(r,Wi);const i=ci.getMixpanelDistinctId();if(!i)throw new Error("No distinct ID found");return await Lt.recommendations.deleteFrequentPassenger(i,r.passengerId)}catch(Ar){throw new Error(Ar instanceof Error?Ar.message:String(Ar))}}},track:{search:function trackSearch(r,i={}){trackEvent("Search",r,i)},seatChange:function trackSeatChange(r,i={}){trackEvent("Seat Change",r,i)},interestInHome:function trackInterestInHome(r,i={}){trackEvent("Interest In Home",r,i)},interestInSearch:function trackInterestInSearch(r,i={}){trackEvent("Interest In Search",r,i)},viewResults:function trackViewResults(r,i={}){trackEvent("View Results",r,i)},passengersCreated:function trackPassengersCreated(r,i={}){trackEvent("Passengers Created",r,i)},paymentAttempt:async(r,i={})=>{trackEvent("Payment Attempt",r,i)},purchaseAttempt:function trackPurchaseAttempt(r,i={}){trackEvent("Purchase Attempt",r,i)},pickedDeparture:function trackSearch$1(r,i={}){trackEvent("Picked Departure",r,i)},customEvent:trackCustomEvent,purchaseCanceled:function trackPurchaseCanceled(r,i={}){trackEvent("Purchase Canceled",r,i)},geolocationSelected:function trackGeolocationSelected(r,i={}){trackEvent("Geolocation Selected",r,i),ci.setPeopleProperties(r)},purchaseConfirmation:function trackPurchaseConfirmation(r,i={}){trackEvent("Purchase Confirmation Viewed",r,i)}}};module.exports=Ji;
|
|
30
|
+
function __awaiter2(r,i,s,a){return new(s||(s=Promise))((function(i,h){function fulfilled(r){try{step(a.next(r))}catch(i){h(i)}}function rejected(r){try{step(a.throw(r))}catch(i){h(i)}}function step(r){r.done?i(r.value):function adopt(r){return r instanceof s?r:new s((function(i){i(r)}))}(r.value).then(fulfilled,rejected)}step((a=a.apply(r,[])).next())}))}for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i="undefined"==typeof Uint8Array?[]:new Uint8Array(256),s=0;s<64;s++)i[r.charCodeAt(s)]=s;var encode2=function(i){var s,a=new Uint8Array(i),h=a.length,f="";for(s=0;s<h;s+=3)f+=r[a[s]>>2],f+=r[(3&a[s])<<4|a[s+1]>>4],f+=r[(15&a[s+1])<<2|a[s+2]>>6],f+=r[63&a[s+2]];return h%3==2?f=f.substring(0,f.length-1)+"=":h%3==1&&(f=f.substring(0,f.length-2)+"=="),f};const a=new Map,h=new Map;const f=self;f.onmessage=function(r){return __awaiter2(this,0,void 0,(function*(){if(!("OffscreenCanvas"in globalThis))return f.postMessage({id:r.data.id});{const{id:i,bitmap:s,width:_,height:v,dataURLOptions:b}=r.data,S=function getTransparentBlobFor(r,i,s){return __awaiter2(this,0,void 0,(function*(){const a=`${r}-${i}`;if("OffscreenCanvas"in globalThis){if(h.has(a))return h.get(a);const f=new OffscreenCanvas(r,i);f.getContext("2d");const _=yield f.convertToBlob(s),v=yield _.arrayBuffer(),b=encode2(v);return h.set(a,b),b}return""}))}(_,v,b),k=new OffscreenCanvas(_,v);k.getContext("2d").drawImage(s,0,0),s.close();const I=yield k.convertToBlob(b),C=I.type,T=yield I.arrayBuffer(),O=encode2(T);if(!a.has(i)&&(yield S)===O)return a.set(i,O),f.postMessage({id:i});if(a.get(i)===O)return f.postMessage({id:i});f.postMessage({id:i,type:C,base64:O,width:_,height:v}),a.set(i,O)}}))}}()}));class CanvasManager{reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(r){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(r,i)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(r)||this.pendingCanvasMutations.set(r,[]),this.pendingCanvasMutations.get(r).push(i)};const{sampling:i="all",win:s,blockClass:a,blockSelector:h,recordCanvas:f,dataURLOptions:_}=r;this.mutationCb=r.mutationCb,this.mirror=r.mirror,f&&"all"===i&&this.initCanvasMutationObserver(s,a,h),f&&"number"==typeof i&&this.initCanvasFPSObserver(i,s,a,h,{dataURLOptions:_})}initCanvasFPSObserver(r,i,s,a,h){const f=initCanvasContextObserver(i,s,a,!0),_=new Map,v=new vr;v.onmessage=r=>{const{id:i}=r.data;if(_.set(i,!1),!("base64"in r.data))return;const{base64:s,type:a,width:h,height:f}=r.data;this.mutationCb({id:i,type:ur["2D"],commands:[{property:"clearRect",args:[0,0,h,f]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:s}],type:a}]},0,0]}]})};const b=1e3/r;let S,k=0;const takeCanvasSnapshots=r=>{k&&r-k<b||(k=r,(()=>{const r=[];return i.document.querySelectorAll("canvas").forEach((i=>{isBlocked(i,s,a,!0)||r.push(i)})),r})().forEach((r=>__awaiter(this,0,void 0,(function*(){var i;const s=this.mirror.getId(r);if(_.get(s))return;if(0===r.width||0===r.height)return;if(_.set(s,!0),["webgl","webgl2"].includes(r.__context)){const s=r.getContext(r.__context);!1===(null===(i=null==s?void 0:s.getContextAttributes())||void 0===i?void 0:i.preserveDrawingBuffer)&&s.clear(s.COLOR_BUFFER_BIT)}const a=yield createImageBitmap(r);v.postMessage({id:s,bitmap:a,width:r.width,height:r.height,dataURLOptions:h.dataURLOptions},[a])}))))),S=requestAnimationFrame(takeCanvasSnapshots)};S=requestAnimationFrame(takeCanvasSnapshots),this.resetObservers=()=>{f(),cancelAnimationFrame(S)}}initCanvasMutationObserver(r,i,s){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const a=initCanvasContextObserver(r,i,s,!1),h=function initCanvas2DMutationObserver(r,i,s,a){const h=[],f=Object.getOwnPropertyNames(i.CanvasRenderingContext2D.prototype);for(const v of f)try{if("function"!=typeof i.CanvasRenderingContext2D.prototype[v])continue;const f=patch(i.CanvasRenderingContext2D.prototype,v,(function(h){return function(...f){return isBlocked(this.canvas,s,a,!0)||setTimeout((()=>{const s=serializeArgs(f,i,this);r(this.canvas,{type:ur["2D"],property:v,args:s})}),0),h.apply(this,f)}}));h.push(f)}catch(_){const s=hookSetter(i.CanvasRenderingContext2D.prototype,v,{set(i){r(this.canvas,{type:ur["2D"],property:v,args:[i],setter:!0})}});h.push(s)}return()=>{h.forEach((r=>r()))}}(this.processMutation.bind(this),r,i,s),f=function initCanvasWebGLMutationObserver(r,i,s,a,h){const f=[];return f.push(...patchGLPrototype(i.WebGLRenderingContext.prototype,ur.WebGL,r,s,a,0,i)),void 0!==i.WebGL2RenderingContext&&f.push(...patchGLPrototype(i.WebGL2RenderingContext.prototype,ur.WebGL2,r,s,a,0,i)),()=>{f.forEach((r=>r()))}}(this.processMutation.bind(this),r,i,s,this.mirror);this.resetObservers=()=>{a(),h(),f()}}startPendingCanvasMutationFlusher(){requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}startRAFTimestamping(){const setLatestRAFTimestamp=r=>{this.rafStamps.latestId=r,requestAnimationFrame(setLatestRAFTimestamp)};requestAnimationFrame(setLatestRAFTimestamp)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach(((r,i)=>{const s=this.mirror.getId(i);this.flushPendingCanvasMutationFor(i,s)})),requestAnimationFrame((()=>this.flushPendingCanvasMutations()))}flushPendingCanvasMutationFor(r,i){if(this.frozen||this.locked)return;const s=this.pendingCanvasMutations.get(r);if(!s||-1===i)return;const a=s.map((r=>{const i=function __rest(r,i){var s={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&i.indexOf(a)<0&&(s[a]=r[a]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var h=0;for(a=Object.getOwnPropertySymbols(r);h<a.length;h++)i.indexOf(a[h])<0&&Object.prototype.propertyIsEnumerable.call(r,a[h])&&(s[a[h]]=r[a[h]])}return s}(r,["type"]);return i})),{type:h}=s[0];this.mutationCb({id:i,type:h,commands:a}),this.pendingCanvasMutations.delete(r)}}class StylesheetManager{constructor(r){this.trackedLinkElements=new WeakSet,this.styleMirror=new StyleSheetMirror,this.mutationCb=r.mutationCb,this.adoptedStyleSheetCb=r.adoptedStyleSheetCb}attachLinkElement(r,i){"_cssText"in i.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:i.id,attributes:i.attributes}]}),this.trackLinkElement(r)}trackLinkElement(r){this.trackedLinkElements.has(r)||(this.trackedLinkElements.add(r),this.trackStylesheetInLinkElement(r))}adoptStyleSheets(r,i){if(0===r.length)return;const s={id:i,styleIds:[]},a=[];for(const h of r){let r;this.styleMirror.has(h)?r=this.styleMirror.getId(h):(r=this.styleMirror.add(h),a.push({styleId:r,rules:Array.from(h.rules||CSSRule,((r,i)=>({rule:stringifyRule(r),index:i})))})),s.styleIds.push(r)}a.length>0&&(s.styles=a),this.adoptedStyleSheetCb(s)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(r){}}class ProcessedNodeManager{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame((()=>{this.clear(),this.loop&&this.periodicallyClear()}))}inOtherBuffer(r,i){const s=this.nodeMap.get(r);return s&&Array.from(s).some((r=>r!==i))}add(r,i){this.nodeMap.set(r,(this.nodeMap.get(r)||new Set).add(i))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}function wrapEvent(r){return Object.assign(Object.assign({},r),{timestamp:or()})}let br,Sr,kr,wr=!1;const Ir=function createMirror(){return new Mirror}();function record(r={}){const{emit:i,checkoutEveryNms:s,checkoutEveryNth:a,blockClass:h="rr-block",blockSelector:f=null,ignoreClass:_="rr-ignore",ignoreSelector:v=null,maskTextClass:b="rr-mask",maskTextSelector:S=null,inlineStylesheet:k=!0,maskAllInputs:I,maskInputOptions:C,slimDOMOptions:T,maskInputFn:O,maskTextFn:R,hooks:M,packFn:N,sampling:P={},dataURLOptions:D={},mousemoveWait:A,recordDOM:Z=!0,recordCanvas:L=!1,recordCrossOriginIframes:q=!1,recordAfter:$=("DOMContentLoaded"===r.recordAfter?r.recordAfter:"load"),userTriggeredOnInput:U=!1,collectFonts:z=!1,inlineImages:W=!1,plugins:G,keepIframeSrcFn:K=()=>!1,ignoreCSSAttributes:H=new Set([]),errorHandler:Y}=r;!function registerErrorHandler(r){lr=r}(Y);const J=!q||window.parent===window;let X=!1;if(!J)try{window.parent.document&&(X=!1)}catch(ae){X=!0}if(J&&!i)throw new Error("emit function is required");void 0!==A&&void 0===P.mousemove&&(P.mousemove=A),Ir.reset();const Q=!0===I?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==C?C:{password:!0},ee=!0===T||"all"===T?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===T,headMetaDescKeywords:"all"===T}:T||{};let te;!function polyfill(r=window){"NodeList"in r&&!r.NodeList.prototype.forEach&&(r.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in r&&!r.DOMTokenList.prototype.forEach&&(r.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...r)=>{let i=r[0];if(!(0 in r))throw new TypeError("1 argument is required");do{if(this===i)return!0}while(i=i&&i.parentNode);return!1})}();let re=0;const eventProcessor=r=>{for(const i of G||[])i.eventProcessor&&(r=i.eventProcessor(r));return N&&!X&&(r=N(r)),r};br=(r,h)=>{var f;if(!(null===(f=pr[0])||void 0===f?void 0:f.isFrozen())||r.type===sr.FullSnapshot||r.type===sr.IncrementalSnapshot&&r.data.source===ar.Mutation||pr.forEach((r=>r.unfreeze())),J)null==i||i(eventProcessor(r),h);else if(X){const i={type:"rrweb",event:eventProcessor(r),origin:window.location.origin,isCheckout:h};window.parent.postMessage(i,"*")}if(r.type===sr.FullSnapshot)te=r,re=0;else if(r.type===sr.IncrementalSnapshot){if(r.data.source===ar.Mutation&&r.data.isAttachIframe)return;re++;const i=a&&re>=a,h=s&&r.timestamp-te.timestamp>s;(i||h)&&Sr(!0)}};const wrappedMutationEmit=r=>{br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.Mutation},r)}))},wrappedScrollEmit=r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.Scroll},r)})),wrappedCanvasMutationEmit=r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.CanvasMutation},r)})),ne=new StylesheetManager({mutationCb:wrappedMutationEmit,adoptedStyleSheetCb:r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.AdoptedStyleSheet},r)}))}),ie=new IframeManager({mirror:Ir,mutationCb:wrappedMutationEmit,stylesheetManager:ne,recordCrossOriginIframes:q,wrappedEmit:br});for(const ce of G||[])ce.getMirror&&ce.getMirror({nodeMirror:Ir,crossOriginIframeMirror:ie.crossOriginIframeMirror,crossOriginIframeStyleMirror:ie.crossOriginIframeStyleMirror});const oe=new ProcessedNodeManager;kr=new CanvasManager({recordCanvas:L,mutationCb:wrappedCanvasMutationEmit,win:window,blockClass:h,blockSelector:f,mirror:Ir,sampling:P.canvas,dataURLOptions:D});const se=new ShadowDomManager({mutationCb:wrappedMutationEmit,scrollCb:wrappedScrollEmit,bypassOptions:{blockClass:h,blockSelector:f,maskTextClass:b,maskTextSelector:S,inlineStylesheet:k,maskInputOptions:Q,dataURLOptions:D,maskTextFn:R,maskInputFn:O,recordCanvas:L,inlineImages:W,sampling:P,slimDOMOptions:ee,iframeManager:ie,stylesheetManager:ne,canvasManager:kr,keepIframeSrcFn:K,processedNodeManager:oe},mirror:Ir});Sr=(r=!1)=>{if(!Z)return;br(wrapEvent({type:sr.Meta,data:{href:window.location.href,width:getWindowWidth(),height:getWindowHeight()}}),r),ne.reset(),se.init(),pr.forEach((r=>r.lock()));const i=function snapshot(r,i){const{mirror:s=new Mirror,blockClass:a="rr-block",blockSelector:h=null,maskTextClass:f="rr-mask",maskTextSelector:_=null,inlineStylesheet:v=!0,inlineImages:b=!1,recordCanvas:S=!1,maskAllInputs:k=!1,maskTextFn:I,maskInputFn:C,slimDOM:T=!1,dataURLOptions:O,preserveWhiteSpace:R,onSerialize:M,onIframeLoad:N,iframeLoadTimeout:P,onStylesheetLoad:D,stylesheetLoadTimeout:A,keepIframeSrcFn:Z=()=>!1}=i||{};return serializeNodeWithId(r,{doc:r,mirror:s,blockClass:a,blockSelector:h,maskTextClass:f,maskTextSelector:_,skipChild:!1,inlineStylesheet:v,maskInputOptions:!0===k?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===k?{password:!0}:k,maskTextFn:I,maskInputFn:C,slimDOMOptions:!0===T||"all"===T?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===T,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===T?{}:T,dataURLOptions:O,inlineImages:b,recordCanvas:S,preserveWhiteSpace:R,onSerialize:M,onIframeLoad:N,iframeLoadTimeout:P,onStylesheetLoad:D,stylesheetLoadTimeout:A,keepIframeSrcFn:Z,newlyAddedElement:!1})}(document,{mirror:Ir,blockClass:h,blockSelector:f,maskTextClass:b,maskTextSelector:S,inlineStylesheet:k,maskAllInputs:Q,maskTextFn:R,slimDOM:ee,dataURLOptions:D,recordCanvas:L,inlineImages:W,onSerialize:r=>{isSerializedIframe(r,Ir)&&ie.addIframe(r),isSerializedStylesheet(r,Ir)&&ne.trackLinkElement(r),hasShadowRoot(r)&&se.addShadowRoot(r.shadowRoot,document)},onIframeLoad:(r,i)=>{ie.attachIframe(r,i),se.observeAttachShadow(r)},onStylesheetLoad:(r,i)=>{ne.attachLinkElement(r,i)},keepIframeSrcFn:K});if(!i)return console.warn("Failed to snapshot the document");br(wrapEvent({type:sr.FullSnapshot,data:{node:i,initialOffset:getWindowScroll(window)}}),r),pr.forEach((r=>r.unlock())),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ne.adoptStyleSheets(document.adoptedStyleSheets,Ir.getId(document))};try{const r=[],observe=r=>{var i;return callbackWrapper(initObservers)({mutationCb:wrappedMutationEmit,mousemoveCb:(r,i)=>br(wrapEvent({type:sr.IncrementalSnapshot,data:{source:i,positions:r}})),mouseInteractionCb:r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.MouseInteraction},r)})),scrollCb:wrappedScrollEmit,viewportResizeCb:r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.ViewportResize},r)})),inputCb:r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.Input},r)})),mediaInteractionCb:r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.MediaInteraction},r)})),styleSheetRuleCb:r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.StyleSheetRule},r)})),styleDeclarationCb:r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.StyleDeclaration},r)})),canvasMutationCb:wrappedCanvasMutationEmit,fontCb:r=>br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.Font},r)})),selectionCb:r=>{br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.Selection},r)}))},customElementCb:r=>{br(wrapEvent({type:sr.IncrementalSnapshot,data:Object.assign({source:ar.CustomElement},r)}))},blockClass:h,ignoreClass:_,ignoreSelector:v,maskTextClass:b,maskTextSelector:S,maskInputOptions:Q,inlineStylesheet:k,sampling:P,recordDOM:Z,recordCanvas:L,inlineImages:W,userTriggeredOnInput:U,collectFonts:z,doc:r,maskInputFn:O,maskTextFn:R,keepIframeSrcFn:K,blockSelector:f,slimDOMOptions:ee,dataURLOptions:D,mirror:Ir,iframeManager:ie,stylesheetManager:ne,shadowDomManager:se,processedNodeManager:oe,canvasManager:kr,ignoreCSSAttributes:H,plugins:(null===(i=null==G?void 0:G.filter((r=>r.observer)))||void 0===i?void 0:i.map((r=>({observer:r.observer,options:r.options,callback:i=>br(wrapEvent({type:sr.Plugin,data:{plugin:r.name,payload:i}}))}))))||[]},M)};ie.addLoadListener((i=>{try{r.push(observe(i.contentDocument))}catch(Ar){console.warn(Ar)}}));const init2=()=>{Sr(),r.push(observe(document)),wr=!0};return"interactive"===document.readyState||"complete"===document.readyState?init2():(r.push(on("DOMContentLoaded",(()=>{br(wrapEvent({type:sr.DomContentLoaded,data:{}})),"DOMContentLoaded"===$&&init2()}))),r.push(on("load",(()=>{br(wrapEvent({type:sr.Load,data:{}})),"load"===$&&init2()}),window))),()=>{r.forEach((r=>r())),oe.destroy(),wr=!1,function unregisterErrorHandler(){lr=void 0}()}}catch(Ar){console.warn(Ar)}}record.addCustomEvent=(r,i)=>{if(!wr)throw new Error("please add custom event after start recording");br(wrapEvent({type:sr.Custom,data:{tag:r,payload:i}}))},record.freezePage=()=>{pr.forEach((r=>r.freeze()))},record.takeFullSnapshot=r=>{if(!wr)throw new Error("please take full snapshot after start recording");Sr(r)},record.mirror=Ir;var Er,xr=(r=>(r[r.DomContentLoaded=0]="DomContentLoaded",r[r.Load=1]="Load",r[r.FullSnapshot=2]="FullSnapshot",r[r.IncrementalSnapshot=3]="IncrementalSnapshot",r[r.Meta=4]="Meta",r[r.Custom=5]="Custom",r[r.Plugin=6]="Plugin",r))(xr||{}),Cr=(r=>(r[r.Mutation=0]="Mutation",r[r.MouseMove=1]="MouseMove",r[r.MouseInteraction=2]="MouseInteraction",r[r.Scroll=3]="Scroll",r[r.ViewportResize=4]="ViewportResize",r[r.Input=5]="Input",r[r.TouchMove=6]="TouchMove",r[r.MediaInteraction=7]="MediaInteraction",r[r.StyleSheetRule=8]="StyleSheetRule",r[r.CanvasMutation=9]="CanvasMutation",r[r.Font=10]="Font",r[r.Log=11]="Log",r[r.Drag=12]="Drag",r[r.StyleDeclaration=13]="StyleDeclaration",r[r.Selection=14]="Selection",r[r.AdoptedStyleSheet=15]="AdoptedStyleSheet",r[r.CustomElement=16]="CustomElement",r))(Cr||{}),Tr={DEBUG:!1,LIB_VERSION:"2.55.1"};if("undefined"==typeof window){var Or={hostname:""};Er={navigator:{userAgent:"",onLine:!0},document:{location:Or,referrer:""},screen:{width:0,height:0},location:Or}}else Er=window;var Rr,Mr,Nr,Pr,Dr,Ar,Zr,Lr,jr,Fr,qr=864e5,$r=8e3,Ur=Array.prototype,Br=Function.prototype,zr=Object.prototype,Vr=Ur.slice,Wr=zr.toString,Gr=zr.hasOwnProperty,Kr=Er.console,Hr=Er.navigator,Yr=Er.document,Jr=Er.opera,Xr=Er.screen,Qr=Hr.userAgent,en=Br.bind,tn=Ur.forEach,rn=Ur.indexOf,nn=Ur.map,sn=Array.isArray,an={},cn={trim:function(r){return r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},dn={log:function(){if(Tr.DEBUG&&!cn.isUndefined(Kr)&&Kr)try{Kr.log.apply(Kr,arguments)}catch(r){cn.each(arguments,(function(r){Kr.log(r)}))}},warn:function(){if(Tr.DEBUG&&!cn.isUndefined(Kr)&&Kr){var r=["Mixpanel warning:"].concat(cn.toArray(arguments));try{Kr.warn.apply(Kr,r)}catch(i){cn.each(r,(function(r){Kr.warn(r)}))}}},error:function(){if(Tr.DEBUG&&!cn.isUndefined(Kr)&&Kr){var r=["Mixpanel error:"].concat(cn.toArray(arguments));try{Kr.error.apply(Kr,r)}catch(i){cn.each(r,(function(r){Kr.error(r)}))}}},critical:function(){if(!cn.isUndefined(Kr)&&Kr){var r=["Mixpanel error:"].concat(cn.toArray(arguments));try{Kr.error.apply(Kr,r)}catch(i){cn.each(r,(function(r){Kr.error(r)}))}}}},log_func_with_prefix=function(r,i){return function(){return arguments[0]="["+i+"] "+arguments[0],r.apply(dn,arguments)}},console_with_prefix=function(r){return{log:log_func_with_prefix(dn.log,r),error:log_func_with_prefix(dn.error,r),critical:log_func_with_prefix(dn.critical,r)}};cn.bind=function(r,i){var s,a;if(en&&r.bind===en)return en.apply(r,Vr.call(arguments,1));if(!cn.isFunction(r))throw new TypeError;return s=Vr.call(arguments,2),a=function(){if(!(this instanceof a))return r.apply(i,s.concat(Vr.call(arguments)));var h={};h.prototype=r.prototype;var f=new h;h.prototype=null;var _=r.apply(f,s.concat(Vr.call(arguments)));return Object(_)===_?_:f},a},cn.each=function(r,i,s){if(null!=r)if(tn&&r.forEach===tn)r.forEach(i,s);else if(r.length===+r.length){for(var a=0,h=r.length;a<h;a++)if(a in r&&i.call(s,r[a],a,r)===an)return}else for(var f in r)if(Gr.call(r,f)&&i.call(s,r[f],f,r)===an)return},cn.extend=function(r){return cn.each(Vr.call(arguments,1),(function(i){for(var s in i)void 0!==i[s]&&(r[s]=i[s])})),r},cn.isArray=sn||function(r){return"[object Array]"===Wr.call(r)},cn.isFunction=function(r){try{return/^\s*\bfunction\b/.test(r)}catch(i){return!1}},cn.isArguments=function(r){return!(!r||!Gr.call(r,"callee"))},cn.toArray=function(r){return r?r.toArray?r.toArray():cn.isArray(r)||cn.isArguments(r)?Vr.call(r):cn.values(r):[]},cn.map=function(r,i,s){if(nn&&r.map===nn)return r.map(i,s);var a=[];return cn.each(r,(function(r){a.push(i.call(s,r))})),a},cn.keys=function(r){var i=[];return null===r||cn.each(r,(function(r,s){i[i.length]=s})),i},cn.values=function(r){var i=[];return null===r||cn.each(r,(function(r){i[i.length]=r})),i},cn.include=function(r,i){var s=!1;return null===r?s:rn&&r.indexOf===rn?-1!=r.indexOf(i):(cn.each(r,(function(r){if(s||(s=r===i))return an})),s)},cn.includes=function(r,i){return-1!==r.indexOf(i)},cn.inherit=function(r,i){return r.prototype=new i,r.prototype.constructor=r,r.superclass=i.prototype,r},cn.isObject=function(r){return r===Object(r)&&!cn.isArray(r)},cn.isEmptyObject=function(r){if(cn.isObject(r)){for(var i in r)if(Gr.call(r,i))return!1;return!0}return!1},cn.isUndefined=function(r){return void 0===r},cn.isString=function(r){return"[object String]"==Wr.call(r)},cn.isDate=function(r){return"[object Date]"==Wr.call(r)},cn.isNumber=function(r){return"[object Number]"==Wr.call(r)},cn.isElement=function(r){return!(!r||1!==r.nodeType)},cn.encodeDates=function(r){return cn.each(r,(function(i,s){cn.isDate(i)?r[s]=cn.formatDate(i):cn.isObject(i)&&(r[s]=cn.encodeDates(i))})),r},cn.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},cn.formatDate=function(r){function pad(r){return r<10?"0"+r:r}return r.getUTCFullYear()+"-"+pad(r.getUTCMonth()+1)+"-"+pad(r.getUTCDate())+"T"+pad(r.getUTCHours())+":"+pad(r.getUTCMinutes())+":"+pad(r.getUTCSeconds())},cn.strip_empty_properties=function(r){var i={};return cn.each(r,(function(r,s){cn.isString(r)&&r.length>0&&(i[s]=r)})),i},cn.truncate=function(r,i){var s;return"string"==typeof r?s=r.slice(0,i):cn.isArray(r)?(s=[],cn.each(r,(function(r){s.push(cn.truncate(r,i))}))):cn.isObject(r)?(s={},cn.each(r,(function(r,a){s[a]=cn.truncate(r,i)}))):s=r,s},cn.JSONEncode=function(){return function(r){var quote=function(r){var i=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return i.lastIndex=0,i.test(r)?'"'+r.replace(i,(function(r){var i=s[r];return"string"==typeof i?i:"\\u"+("0000"+r.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+r+'"'},str=function(r,i){var s="",a=0,h="",f="",_=0,v=s,b=[],S=i[r];switch(S&&"object"==typeof S&&"function"==typeof S.toJSON&&(S=S.toJSON(r)),typeof S){case"string":return quote(S);case"number":return isFinite(S)?String(S):"null";case"boolean":case"null":return String(S);case"object":if(!S)return"null";if(s+=" ",b=[],"[object Array]"===Wr.apply(S)){for(_=S.length,a=0;a<_;a+=1)b[a]=str(a,S)||"null";return f=0===b.length?"[]":s?"[\n"+s+b.join(",\n"+s)+"\n"+v+"]":"["+b.join(",")+"]",s=v,f}for(h in S)Gr.call(S,h)&&(f=str(h,S))&&b.push(quote(h)+(s?": ":":")+f);return f=0===b.length?"{}":s?"{"+b.join(",")+v+"}":"{"+b.join(",")+"}",s=v,f}};return str("",{"":r})}}(),cn.JSONDecode=(Dr={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},Ar=function(r){var i=new SyntaxError(r);throw i.at=Rr,i.text=Nr,i},Zr=function(r){return r&&r!==Mr&&Ar("Expected '"+r+"' instead of '"+Mr+"'"),Mr=Nr.charAt(Rr),Rr+=1,Mr},Lr=function(){var r,i="";for("-"===Mr&&(i="-",Zr("-"));Mr>="0"&&Mr<="9";)i+=Mr,Zr();if("."===Mr)for(i+=".";Zr()&&Mr>="0"&&Mr<="9";)i+=Mr;if("e"===Mr||"E"===Mr)for(i+=Mr,Zr(),"-"!==Mr&&"+"!==Mr||(i+=Mr,Zr());Mr>="0"&&Mr<="9";)i+=Mr,Zr();if(r=+i,isFinite(r))return r;Ar("Bad number")},jr=function(){var r,i,s,a="";if('"'===Mr)for(;Zr();){if('"'===Mr)return Zr(),a;if("\\"===Mr)if(Zr(),"u"===Mr){for(s=0,i=0;i<4&&(r=parseInt(Zr(),16),isFinite(r));i+=1)s=16*s+r;a+=String.fromCharCode(s)}else{if("string"!=typeof Dr[Mr])break;a+=Dr[Mr]}else a+=Mr}Ar("Bad string")},Fr=function(){for(;Mr&&Mr<=" ";)Zr()},Pr=function(){switch(Fr(),Mr){case"{":return function(){var r,i={};if("{"===Mr){if(Zr("{"),Fr(),"}"===Mr)return Zr("}"),i;for(;Mr;){if(r=jr(),Fr(),Zr(":"),Object.hasOwnProperty.call(i,r)&&Ar('Duplicate key "'+r+'"'),i[r]=Pr(),Fr(),"}"===Mr)return Zr("}"),i;Zr(","),Fr()}}Ar("Bad object")}();case"[":return function(){var r=[];if("["===Mr){if(Zr("["),Fr(),"]"===Mr)return Zr("]"),r;for(;Mr;){if(r.push(Pr()),Fr(),"]"===Mr)return Zr("]"),r;Zr(","),Fr()}}Ar("Bad array")}();case'"':return jr();case"-":return Lr();default:return Mr>="0"&&Mr<="9"?Lr():function(){switch(Mr){case"t":return Zr("t"),Zr("r"),Zr("u"),Zr("e"),!0;case"f":return Zr("f"),Zr("a"),Zr("l"),Zr("s"),Zr("e"),!1;case"n":return Zr("n"),Zr("u"),Zr("l"),Zr("l"),null}Ar('Unexpected "'+Mr+'"')}()}},function(r){var i;return Nr=r,Rr=0,Mr=" ",i=Pr(),Fr(),Mr&&Ar("Syntax error"),i}),cn.base64Encode=function(r){var i,s,a,h,f,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",v=0,b=0,S="",k=[];if(!r)return r;r=cn.utf8Encode(r);do{i=(f=r.charCodeAt(v++)<<16|r.charCodeAt(v++)<<8|r.charCodeAt(v++))>>18&63,s=f>>12&63,a=f>>6&63,h=63&f,k[b++]=_.charAt(i)+_.charAt(s)+_.charAt(a)+_.charAt(h)}while(v<r.length);switch(S=k.join(""),r.length%3){case 1:S=S.slice(0,-2)+"==";break;case 2:S=S.slice(0,-1)+"="}return S},cn.utf8Encode=function(r){var i,s,a,h,f="";for(i=s=0,a=(r=(r+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,h=0;h<a;h++){var _=r.charCodeAt(h),v=null;_<128?s++:v=_>127&&_<2048?String.fromCharCode(_>>6|192,63&_|128):String.fromCharCode(_>>12|224,_>>6&63|128,63&_|128),null!==v&&(s>i&&(f+=r.substring(i,s)),f+=v,i=s=h+1)}return s>i&&(f+=r.substring(i,r.length)),f},cn.UUID=function(){var T2=function(){var r,i=1*new Date;if(Er.performance&&Er.performance.now)r=Er.performance.now();else for(r=0;i==1*new Date;)r++;return i.toString(16)+Math.floor(r).toString(16)};return function(){var r=(Xr.height*Xr.width).toString(16);return T2()+"-"+Math.random().toString(16).replace(".","")+"-"+function(){var r,i,s=Qr,a=[],h=0;function xor(r,i){var s,h=0;for(s=0;s<i.length;s++)h|=a[s]<<8*s;return r^h}for(r=0;r<s.length;r++)i=s.charCodeAt(r),a.unshift(255&i),a.length>=4&&(h=xor(h,a),a=[]);return a.length>0&&(h=xor(h,a)),h.toString(16)}()+"-"+r+"-"+T2()}}();var un=["ahrefsbot","ahrefssiteaudit","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];cn.isBlockedUA=function(r){var i;for(r=r.toLowerCase(),i=0;i<un.length;i++)if(-1!==r.indexOf(un[i]))return!0;return!1},cn.HTTPBuildQuery=function(r,i){var s,a,h=[];return cn.isUndefined(i)&&(i="&"),cn.each(r,(function(r,i){s=encodeURIComponent(r.toString()),a=encodeURIComponent(i),h[h.length]=a+"="+s})),h.join(i)},cn.getQueryParam=function(r,i){i=i.replace(/[[]/g,"\\[").replace(/[\]]/g,"\\]");var s=new RegExp("[\\?&]"+i+"=([^&#]*)").exec(r);if(null===s||s&&"string"!=typeof s[1]&&s[1].length)return"";var a=s[1];try{a=decodeURIComponent(a)}catch(h){dn.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},cn.cookie={get:function(r){for(var i=r+"=",s=Yr.cookie.split(";"),a=0;a<s.length;a++){for(var h=s[a];" "==h.charAt(0);)h=h.substring(1,h.length);if(0===h.indexOf(i))return decodeURIComponent(h.substring(i.length,h.length))}return null},parse:function(r){var i;try{i=cn.JSONDecode(cn.cookie.get(r))||{}}catch(s){}return i},set_seconds:function(r,i,s,a,h,f,_){var v="",b="",S="";if(_)v="; domain="+_;else if(a){var k=extract_domain(Yr.location.hostname);v=k?"; domain=."+k:""}if(s){var I=new Date;I.setTime(I.getTime()+1e3*s),b="; expires="+I.toGMTString()}f&&(h=!0,S="; SameSite=None"),h&&(S+="; secure"),Yr.cookie=r+"="+encodeURIComponent(i)+b+"; path=/"+v+S},set:function(r,i,s,a,h,f,_){var v="",b="",S="";if(_)v="; domain="+_;else if(a){var k=extract_domain(Yr.location.hostname);v=k?"; domain=."+k:""}if(s){var I=new Date;I.setTime(I.getTime()+24*s*60*60*1e3),b="; expires="+I.toGMTString()}f&&(h=!0,S="; SameSite=None"),h&&(S+="; secure");var C=r+"="+encodeURIComponent(i)+b+"; path=/"+v+S;return Yr.cookie=C,C},remove:function(r,i,s){cn.cookie.set(r,"",-1,i,!1,!1,s)}};var ln=null,localStorageSupported=function(r,i){if(null!==ln&&!i)return ln;var s=!0;try{r=r||window.localStorage;var a="__mplss_"+cheap_guid(8);r.setItem(a,"xyz"),"xyz"!==r.getItem(a)&&(s=!1),r.removeItem(a)}catch(h){s=!1}return ln=s,s};cn.localStorage={is_supported:function(r){var i=localStorageSupported(null,r);return i||dn.error("localStorage unsupported; falling back to cookie store"),i},error:function(r){dn.error("localStorage error: "+r)},get:function(r){try{return window.localStorage.getItem(r)}catch(i){cn.localStorage.error(i)}return null},parse:function(r){try{return cn.JSONDecode(cn.localStorage.get(r))||{}}catch(i){}return null},set:function(r,i){try{window.localStorage.setItem(r,i)}catch(s){cn.localStorage.error(s)}},remove:function(r){try{window.localStorage.removeItem(r)}catch(i){cn.localStorage.error(i)}}},cn.register_event=function(){function fixEvent(r){return r&&(r.preventDefault=fixEvent.preventDefault,r.stopPropagation=fixEvent.stopPropagation),r}return fixEvent.preventDefault=function(){this.returnValue=!1},fixEvent.stopPropagation=function(){this.cancelBubble=!0},function(r,i,s,a,h){if(r)if(r.addEventListener&&!a)r.addEventListener(i,s,!!h);else{var f="on"+i,_=r[f];r[f]=function makeHandler(r,i,s){var handler=function(a){if(a=a||fixEvent(window.event)){var h,f,_=!0;return cn.isFunction(s)&&(h=s(a)),f=i.call(r,a),!1!==h&&!1!==f||(_=!1),_}};return handler}(r,s,_)}else dn.error("No valid element provided to register_event")}}();var pn=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');cn.dom_query=function(){function getAllChildren(r){return r.all?r.all:r.getElementsByTagName("*")}var r=/[\t\r\n]/g;function hasClass(i,s){var a=" "+s+" ";return(" "+i.className+" ").replace(r," ").indexOf(a)>=0}function getElementsBySelector(r){if(!Yr.getElementsByTagName)return[];var i,s,a,h,f,_,v,b,S,k,I=r.split(" "),C=[Yr];for(_=0;_<I.length;_++)if((i=I[_].replace(/^\s+/,"").replace(/\s+$/,"")).indexOf("#")>-1){a=(s=i.split("#"))[0];var T=s[1],O=Yr.getElementById(T);if(!O||a&&O.nodeName.toLowerCase()!=a)return[];C=[O]}else if(i.indexOf(".")>-1){a=(s=i.split("."))[0];var R=s[1];for(a||(a="*"),h=[],f=0,v=0;v<C.length;v++)for(S="*"==a?getAllChildren(C[v]):C[v].getElementsByTagName(a),b=0;b<S.length;b++)h[f++]=S[b];for(C=[],k=0,v=0;v<h.length;v++)h[v].className&&cn.isString(h[v].className)&&hasClass(h[v],R)&&(C[k++]=h[v])}else{var M=i.match(pn);if(M){a=M[1];var N,P=M[2],D=M[3],A=M[4];for(a||(a="*"),h=[],f=0,v=0;v<C.length;v++)for(S="*"==a?getAllChildren(C[v]):C[v].getElementsByTagName(a),b=0;b<S.length;b++)h[f++]=S[b];switch(C=[],k=0,D){case"=":N=function(r){return r.getAttribute(P)==A};break;case"~":N=function(r){return r.getAttribute(P).match(new RegExp("\\b"+A+"\\b"))};break;case"|":N=function(r){return r.getAttribute(P).match(new RegExp("^"+A+"-?"))};break;case"^":N=function(r){return 0===r.getAttribute(P).indexOf(A)};break;case"$":N=function(r){return r.getAttribute(P).lastIndexOf(A)==r.getAttribute(P).length-A.length};break;case"*":N=function(r){return r.getAttribute(P).indexOf(A)>-1};break;default:N=function(r){return r.getAttribute(P)}}for(C=[],k=0,v=0;v<h.length;v++)N(h[v])&&(C[k++]=h[v])}else{for(a=i,h=[],f=0,v=0;v<C.length;v++)for(S=C[v].getElementsByTagName(a),b=0;b<S.length;b++)h[f++]=S[b];C=h}}return C}return function(r){return cn.isElement(r)?[r]:cn.isObject(r)&&!cn.isUndefined(r.length)?r:getElementsBySelector.call(this,r)}}();var hn=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic"],fn=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","sccid","ttclid","twclid","wbraid"];cn.info={campaignParams:function(r){var i="",s={};return cn.each(hn,(function(a){(i=cn.getQueryParam(Yr.URL,a)).length?s[a]=i:void 0!==r&&(s[a]=r)})),s},clickParams:function(){var r="",i={};return cn.each(fn,(function(s){(r=cn.getQueryParam(Yr.URL,s)).length&&(i[s]=r)})),i},marketingParams:function(){return cn.extend(cn.info.campaignParams(),cn.info.clickParams())},searchEngine:function(r){return 0===r.search("https?://(.*)google.([^/?]*)")?"google":0===r.search("https?://(.*)bing.com")?"bing":0===r.search("https?://(.*)yahoo.com")?"yahoo":0===r.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},searchInfo:function(r){var i=cn.info.searchEngine(r),s="yahoo"!=i?"q":"p",a={};if(null!==i){a.$search_engine=i;var h=cn.getQueryParam(r,s);h.length&&(a.mp_keyword=h)}return a},browser:function(r,i,s){return i=i||"",s||cn.includes(r," OPR/")?cn.includes(r,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(r)?"BlackBerry":cn.includes(r,"IEMobile")||cn.includes(r,"WPDesktop")?"Internet Explorer Mobile":cn.includes(r,"SamsungBrowser/")?"Samsung Internet":cn.includes(r,"Edge")||cn.includes(r,"Edg/")?"Microsoft Edge":cn.includes(r,"FBIOS")?"Facebook Mobile":cn.includes(r,"Chrome")?"Chrome":cn.includes(r,"CriOS")?"Chrome iOS":cn.includes(r,"UCWEB")||cn.includes(r,"UCBrowser")?"UC Browser":cn.includes(r,"FxiOS")?"Firefox iOS":cn.includes(i,"Apple")?cn.includes(r,"Mobile")?"Mobile Safari":"Safari":cn.includes(r,"Android")?"Android Mobile":cn.includes(r,"Konqueror")?"Konqueror":cn.includes(r,"Firefox")?"Firefox":cn.includes(r,"MSIE")||cn.includes(r,"Trident/")?"Internet Explorer":cn.includes(r,"Gecko")?"Mozilla":""},browserVersion:function(r,i,s){var a={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/}[cn.info.browser(r,i,s)];if(void 0===a)return null;var h=r.match(a);return h?parseFloat(h[h.length-2]):null},os:function(){var r=Qr;return/Windows/i.test(r)?/Phone/.test(r)||/WPDesktop/.test(r)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(r)?"iOS":/Android/.test(r)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(r)?"BlackBerry":/Mac/i.test(r)?"Mac OS X":/Linux/.test(r)?"Linux":/CrOS/.test(r)?"Chrome OS":""},device:function(r){return/Windows Phone/i.test(r)||/WPDesktop/.test(r)?"Windows Phone":/iPad/.test(r)?"iPad":/iPod/.test(r)?"iPod Touch":/iPhone/.test(r)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(r)?"BlackBerry":/Android/.test(r)?"Android":""},referringDomain:function(r){var i=r.split("/");return i.length>=3?i[2]:""},currentUrl:function(){return Er.location.href},properties:function(r){return"object"!=typeof r&&(r={}),cn.extend(cn.strip_empty_properties({$os:cn.info.os(),$browser:cn.info.browser(Qr,Hr.vendor,Jr),$referrer:Yr.referrer,$referring_domain:cn.info.referringDomain(Yr.referrer),$device:cn.info.device(Qr)}),{$current_url:cn.info.currentUrl(),$browser_version:cn.info.browserVersion(Qr,Hr.vendor,Jr),$screen_height:Xr.height,$screen_width:Xr.width,mp_lib:"web",$lib_version:Tr.LIB_VERSION,$insert_id:cheap_guid(),time:cn.timestamp()/1e3},cn.strip_empty_properties(r))},people_properties:function(){return cn.extend(cn.strip_empty_properties({$os:cn.info.os(),$browser:cn.info.browser(Qr,Hr.vendor,Jr)}),{$browser_version:cn.info.browserVersion(Qr,Hr.vendor,Jr)})},mpPageViewProperties:function(){return cn.strip_empty_properties({current_page_title:Yr.title,current_domain:Er.location.hostname,current_url_path:Er.location.pathname,current_url_protocol:Er.location.protocol,current_url_search:Er.location.search})}};var cheap_guid=function(r){var i=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return r?i.substring(0,r):i},mn=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,gn=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,extract_domain=function(r){var i=gn,s=r.split("."),a=s[s.length-1];(a.length>4||"com"===a||"org"===a)&&(i=mn);var h=r.match(i);return h?h[0]:""},_n=null,yn=null;"undefined"!=typeof JSON&&(_n=JSON.stringify,yn=JSON.parse),_n=_n||cn.JSONEncode,yn=yn||cn.JSONDecode,cn.toArray=cn.toArray,cn.isObject=cn.isObject,cn.JSONEncode=cn.JSONEncode,cn.JSONDecode=cn.JSONDecode,cn.isBlockedUA=cn.isBlockedUA,cn.isEmptyObject=cn.isEmptyObject,cn.info=cn.info,cn.info.device=cn.info.device,cn.info.browser=cn.info.browser,cn.info.browserVersion=cn.info.browserVersion,cn.info.properties=cn.info.properties;var vn="__mp_opt_in_out_";function optIn(r,i){_optInOut(!0,r,i)}function optOut(r,i){_optInOut(!1,r,i)}function hasOptedIn(r,i){return"1"===_getStorageValue(r,i)}function hasOptedOut(r,i){if(function _hasDoNotTrackFlagOn(r){if(r&&r.ignoreDnt)return!1;var i=r&&r.window||Er,s=i.navigator||{},a=!1;return cn.each([s.doNotTrack,s.msDoNotTrack,i.doNotTrack],(function(r){cn.includes([!0,1,"1","yes"],r)&&(a=!0)})),a}(i))return dn.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var s="0"===_getStorageValue(r,i);return s&&dn.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),s}function addOptOutCheckMixpanelLib(r){return _addOptOutCheck(r,(function(r){return this.get_config(r)}))}function addOptOutCheckMixpanelPeople(r){return _addOptOutCheck(r,(function(r){return this._get_config(r)}))}function addOptOutCheckMixpanelGroup(r){return _addOptOutCheck(r,(function(r){return this._get_config(r)}))}function clearOptInOut(r,i){_getStorage(i=i||{}).remove(_getStorageKey(r,i),!!i.crossSubdomainCookie,i.cookieDomain)}function _getStorage(r){return"localStorage"===(r=r||{}).persistenceType?cn.localStorage:cn.cookie}function _getStorageKey(r,i){return((i=i||{}).persistencePrefix||vn)+r}function _getStorageValue(r,i){return _getStorage(i).get(_getStorageKey(r,i))}function _optInOut(r,i,s){cn.isString(i)&&i.length?(_getStorage(s=s||{}).set(_getStorageKey(i,s),r?1:0,cn.isNumber(s.cookieExpiration)?s.cookieExpiration:null,!!s.crossSubdomainCookie,!!s.secureCookie,!!s.crossSiteCookie,s.cookieDomain),s.track&&r&&s.track(s.trackEventName||"$opt_in",s.trackProperties,{send_immediately:!0})):dn.error("gdpr."+(r?"optIn":"optOut")+" called with an invalid token")}function _addOptOutCheck(r,i){return function(){var s=!1;try{var a=i.call(this,"token"),h=i.call(this,"ignore_dnt"),f=i.call(this,"opt_out_tracking_persistence_type"),_=i.call(this,"opt_out_tracking_cookie_prefix"),v=i.call(this,"window");a&&(s=hasOptedOut(a,{ignoreDnt:h,persistenceType:f,persistencePrefix:_,window:v}))}catch(S){dn.error("Unexpected error when checking tracking opt-out status: "+S)}if(!s)return r.apply(this,arguments);var b=arguments[arguments.length-1];"function"==typeof b&&b(0)}}var bn=console_with_prefix("lock"),SharedLock=function(r,i){i=i||{},this.storageKey=r,this.storage=i.storage||window.localStorage,this.pollIntervalMS=i.pollIntervalMS||100,this.timeoutMS=i.timeoutMS||2e3};SharedLock.prototype.withLock=function(r,i,s){s||"function"==typeof i||(s=i,i=null);var a=s||(new Date).getTime()+"|"+Math.random(),h=(new Date).getTime(),f=this.storageKey,_=this.pollIntervalMS,v=this.timeoutMS,b=this.storage,S=f+":X",k=f+":Y",I=f+":Z",reportError=function(r){i&&i(r)},delay=function(r){if((new Date).getTime()-h>v)return bn.error("Timeout waiting for mutex on "+f+"; clearing lock. ["+a+"]"),b.removeItem(I),b.removeItem(k),void loop();setTimeout((function(){try{r()}catch(i){reportError(i)}}),_*(Math.random()+.1))},waitFor=function(r,i){r()?i():delay((function(){waitFor(r,i)}))},getSetY=function(){var r=b.getItem(k);if(r&&r!==a)return!1;if(b.setItem(k,a),b.getItem(k)===a)return!0;if(!localStorageSupported(b,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},loop=function(){b.setItem(S,a),waitFor(getSetY,(function(){b.getItem(S)!==a?delay((function(){b.getItem(k)===a?waitFor((function(){return!b.getItem(I)}),criticalSection):loop()})):criticalSection()}))},criticalSection=function(){b.setItem(I,"1");try{r()}finally{b.removeItem(I),b.getItem(k)===a&&b.removeItem(k),b.getItem(S)===a&&b.removeItem(S)}};try{if(!localStorageSupported(b,!0))throw new Error("localStorage support check failed");loop()}catch(C){reportError(C)}};var Sn=console_with_prefix("batch"),RequestQueue=function(r,i){i=i||{},this.storageKey=r,this.storage=i.storage||window.localStorage,this.reportError=i.errorReporter||cn.bind(Sn.error,Sn),this.lock=new SharedLock(r,{storage:this.storage}),this.usePersistence=i.usePersistence,this.pid=i.pid||null,this.memQueue=[]};RequestQueue.prototype.enqueue=function(r,i,s){var a={id:cheap_guid(),flushAfter:(new Date).getTime()+2*i,payload:r};this.usePersistence?this.lock.withLock(cn.bind((function lockAcquired(){var i;try{var h=this.readFromStorage();h.push(a),(i=this.saveToStorage(h))&&this.memQueue.push(a)}catch(f){this.reportError("Error enqueueing item",r),i=!1}s&&s(i)}),this),cn.bind((function lockFailure(r){this.reportError("Error acquiring storage lock",r),s&&s(!1)}),this),this.pid):(this.memQueue.push(a),s&&s(!0))},RequestQueue.prototype.fillBatch=function(r){var i=this.memQueue.slice(0,r);if(this.usePersistence&&i.length<r){var s=this.readFromStorage();if(s.length){var a={};cn.each(i,(function(r){a[r.id]=!0}));for(var h=0;h<s.length;h++){var f=s[h];if((new Date).getTime()>f.flushAfter&&!a[f.id]&&(f.orphaned=!0,i.push(f),i.length>=r))break}}}return i};var filterOutIDsAndInvalid=function(r,i){var s=[];return cn.each(r,(function(r){r.id&&!i[r.id]&&s.push(r)})),s};RequestQueue.prototype.removeItemsByID=function(r,i){var s={};if(cn.each(r,(function(r){s[r]=!0})),this.memQueue=filterOutIDsAndInvalid(this.memQueue,s),this.usePersistence){var a=cn.bind((function(){var i;try{var a=this.readFromStorage();if(a=filterOutIDsAndInvalid(a,s),i=this.saveToStorage(a)){a=this.readFromStorage();for(var h=0;h<a.length;h++){var f=a[h];if(f.id&&s[f.id])return this.reportError("Item not removed from storage"),!1}}}catch(_){this.reportError("Error removing items",r),i=!1}return i}),this);this.lock.withLock((function lockAcquired(){var r=a();i&&i(r)}),cn.bind((function lockFailure(r){var s=!1;if(this.reportError("Error acquiring storage lock",r),!localStorageSupported(this.storage,!0)&&!(s=a()))try{this.storage.removeItem(this.storageKey)}catch(h){this.reportError("Error clearing queue",h)}i&&i(s)}),this),this.pid)}else i&&i(!0)};var updatePayloads=function(r,i){var s=[];return cn.each(r,(function(r){var a=r.id;if(a in i){var h=i[a];null!==h&&(r.payload=h,s.push(r))}else s.push(r)})),s};RequestQueue.prototype.updatePayloads=function(r,i){this.memQueue=updatePayloads(this.memQueue,r),this.usePersistence?this.lock.withLock(cn.bind((function lockAcquired(){var s;try{var a=this.readFromStorage();a=updatePayloads(a,r),s=this.saveToStorage(a)}catch(h){this.reportError("Error updating items",r),s=!1}i&&i(s)}),this),cn.bind((function lockFailure(r){this.reportError("Error acquiring storage lock",r),i&&i(!1)}),this),this.pid):i&&i(!0)},RequestQueue.prototype.readFromStorage=function(){var r;try{(r=this.storage.getItem(this.storageKey))&&(r=yn(r),cn.isArray(r)||(this.reportError("Invalid storage entry:",r),r=null))}catch(i){this.reportError("Error retrieving queue",i),r=null}return r||[]},RequestQueue.prototype.saveToStorage=function(r){try{return this.storage.setItem(this.storageKey,_n(r)),!0}catch(i){return this.reportError("Error saving queue",i),!1}},RequestQueue.prototype.clear=function(){this.memQueue=[],this.usePersistence&&this.storage.removeItem(this.storageKey)};var kn=console_with_prefix("batch"),RequestBatcher=function(r,i){this.errorReporter=i.errorReporter,this.queue=new RequestQueue(r,{errorReporter:cn.bind(this.reportError,this),storage:i.storage,usePersistence:i.usePersistence}),this.libConfig=i.libConfig,this.sendRequest=i.sendRequestFunc,this.beforeSendHook=i.beforeSendHook,this.stopAllBatching=i.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={},this.flushOnlyOnInterval=i.flushOnlyOnInterval||!1};RequestBatcher.prototype.enqueue=function(r,i){this.queue.enqueue(r,this.flushInterval,i)},RequestBatcher.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()},RequestBatcher.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)},RequestBatcher.prototype.clear=function(){this.queue.clear()},RequestBatcher.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size},RequestBatcher.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)},RequestBatcher.prototype.scheduleFlush=function(r){this.flushInterval=r,this.stopped||(this.timeoutID=setTimeout(cn.bind((function(){this.stopped||this.flush()}),this),this.flushInterval))},RequestBatcher.prototype.flush=function(r){try{if(this.requestInProgress)return void kn.log("Flush: Request already in progress");r=r||{};var i=this.libConfig.batch_request_timeout_ms,s=(new Date).getTime(),a=this.batchSize,h=this.queue.fillBatch(a),f=h.length===a,_=[],v={};if(cn.each(h,(function(r){var i=r.payload;if(this.beforeSendHook&&!r.orphaned&&(i=this.beforeSendHook(i)),i){i.event&&i.properties&&(i.properties=cn.extend({},i.properties,{mp_sent_by_lib_version:Tr.LIB_VERSION}));var s=!0,a=r.id;a?(this.itemIdsSentSuccessfully[a]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:r,batchSize:h.length,timesSent:this.itemIdsSentSuccessfully[a]}),s=!1):this.reportError("[dupe] found item with no ID",{item:r}),s&&_.push(i)}v[r.id]=i}),this),_.length<1)return void this.resetFlush();this.requestInProgress=!0;var b=cn.bind((function(_){this.requestInProgress=!1;try{var b=!1;if(r.unloading)this.queue.updatePayloads(v);else if(cn.isObject(_)&&"timeout"===_.error&&(new Date).getTime()-s>=i)this.reportError("Network timeout; retrying"),this.flush();else if(cn.isObject(_)&&(_.httpStatusCode>=500||429===_.httpStatusCode||_.httpStatusCode<=0&&(I=Er.navigator.onLine,!cn.isUndefined(I)&&!I)||"timeout"===_.error)){var S=2*this.flushInterval;_.retryAfter&&(S=1e3*parseInt(_.retryAfter,10)||S),S=Math.min(6e5,S),this.reportError("Error; retry in "+S+" ms"),this.scheduleFlush(S)}else if(cn.isObject(_)&&413===_.httpStatusCode)if(h.length>1){var k=Math.max(1,Math.floor(a/2));this.batchSize=Math.min(this.batchSize,k,h.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",h),this.resetBatchSize(),b=!0;else b=!0;b&&(this.queue.removeItemsByID(cn.map(h,(function(r){return r.id})),cn.bind((function(r){r?(this.consecutiveRemovalFailures=0,this.flushOnlyOnInterval&&!f?this.resetFlush():this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())}),this)),cn.each(h,cn.bind((function(r){var i=r.id;i?(this.itemIdsSentSuccessfully[i]=this.itemIdsSentSuccessfully[i]||0,this.itemIdsSentSuccessfully[i]++,this.itemIdsSentSuccessfully[i]>5&&this.reportError("[dupe] item ID sent too many times",{item:r,batchSize:h.length,timesSent:this.itemIdsSentSuccessfully[i]})):this.reportError("[dupe] found item with no ID while removing",{item:r})}),this)))}catch(C){this.reportError("Error handling API response",C),this.resetFlush()}var I}),this),S={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:i};r.unloading&&(S.transport="sendBeacon"),kn.log("MIXPANEL REQUEST:",_),this.sendRequest(_,S,b)}catch(k){this.reportError("Error flushing request queue",k),this.resetFlush()}},RequestBatcher.prototype.reportError=function(r,i){if(kn.error.apply(kn.error,arguments),this.errorReporter)try{i instanceof Error||(i=new Error(r)),this.errorReporter(r,i)}catch(s){kn.error(s)}};var wn=console_with_prefix("recorder"),In=Er.CompressionStream,En={batch_size:1e3,batch_flush_interval_ms:1e4,batch_request_timeout_ms:9e4,batch_autostart:!0},xn=new Set([Cr.MouseMove,Cr.MouseInteraction,Cr.Scroll,Cr.ViewportResize,Cr.Input,Cr.TouchMove,Cr.MediaInteraction,Cr.Drag,Cr.Selection]);var MixpanelRecorder=function(r){this._mixpanel=r,this._stopRecording=null,this.recEvents=[],this.seqNo=0,this.replayId=null,this.replayStartTime=null,this.sendBatchId=null,this.idleTimeoutId=null,this.maxTimeoutId=null,this.recordMaxMs=qr,this.recordMinMs=0,this._initBatcher()};MixpanelRecorder.prototype._initBatcher=function(){this.batcher=new RequestBatcher("__mprec",{libConfig:En,sendRequestFunc:cn.bind(this.flushEventsWithOptOut,this),errorReporter:cn.bind(this.reportError,this),flushOnlyOnInterval:!0,usePersistence:!1})},MixpanelRecorder.prototype.get_config=function(r){return this._mixpanel.get_config(r)},MixpanelRecorder.prototype.startRecording=function(r){if(null===this._stopRecording){this.recordMaxMs=this.get_config("record_max_ms"),this.recordMaxMs>qr&&(this.recordMaxMs=qr,wn.critical("record_max_ms cannot be greater than "+qr+"ms. Capping value.")),this.recordMinMs=this.get_config("record_min_ms"),this.recordMinMs>$r&&(this.recordMinMs=$r,wn.critical("record_min_ms cannot be greater than 8000ms. Capping value.")),this.recEvents=[],this.seqNo=0,this.replayStartTime=(new Date).getTime(),this.replayId=cn.UUID(),r||this.recordMinMs>0?this.batcher.stop():this.batcher.start();var i=cn.bind((function(){clearTimeout(this.idleTimeoutId),this.idleTimeoutId=setTimeout(cn.bind((function(){wn.log("Idle timeout reached, restarting recording."),this.resetRecording()}),this),this.get_config("record_idle_timeout_ms"))}),this),s=this.get_config("record_block_selector");""!==s&&null!==s||(s=void 0),this._stopRecording=record({emit:cn.bind((function(r){this.batcher.enqueue(r),function isUserEvent(r){return r.type===xr.IncrementalSnapshot&&xn.has(r.data.source)}(r)&&(this.batcher.stopped&&(new Date).getTime()-this.replayStartTime>=this.recordMinMs&&this.batcher.start(),i())}),this),blockClass:this.get_config("record_block_class"),blockSelector:s,collectFonts:this.get_config("record_collect_fonts"),inlineImages:this.get_config("record_inline_images"),maskAllInputs:!0,maskTextClass:this.get_config("record_mask_text_class"),maskTextSelector:this.get_config("record_mask_text_selector")}),i(),this.maxTimeoutId=setTimeout(cn.bind(this.resetRecording,this),this.recordMaxMs)}else wn.log("Recording already in progress, skipping startRecording.")},MixpanelRecorder.prototype.resetRecording=function(){this.stopRecording(),this.startRecording(!0)},MixpanelRecorder.prototype.stopRecording=function(){null!==this._stopRecording&&(this._stopRecording(),this._stopRecording=null),this.batcher.stopped?this.batcher.clear():(this.batcher.flush(),this.batcher.stop()),this.replayId=null,clearTimeout(this.idleTimeoutId),clearTimeout(this.maxTimeoutId)},MixpanelRecorder.prototype.flushEventsWithOptOut=function(r,i,s){this._flushEvents(r,i,s,cn.bind(this._onOptOut,this))},MixpanelRecorder.prototype._onOptOut=function(r){0===r&&(this.recEvents=[],this.stopRecording())},MixpanelRecorder.prototype._sendRequest=function(r,i,s,a){var h=cn.bind((function(i,s){200===i.status&&this.replayId===r&&this.seqNo++,a({status:0,httpStatusCode:i.status,responseBody:s,retryAfter:i.headers.get("Retry-After")})}),this);Er.fetch(this.get_config("api_host")+"/"+this.get_config("api_routes").record+"?"+new URLSearchParams(i),{method:"POST",headers:{Authorization:"Basic "+btoa(this.get_config("token")+":"),"Content-Type":"application/octet-stream"},body:s}).then((function(r){r.json().then((function(i){h(r,i)})).catch((function(r){a({error:r})}))})).catch((function(r){a({error:r,httpStatusCode:0})}))},MixpanelRecorder.prototype._flushEvents=addOptOutCheckMixpanelLib((function(r,i,s){const a=r.length;if(a>0){var h=this.replayId,f=r[0].timestamp;0!==this.seqNo&&this.replayStartTime||(0!==this.seqNo&&this.reportError("Replay start time not set but seqNo is not 0. Using current batch start time as a fallback."),this.replayStartTime=f);var _=r[a-1].timestamp-this.replayStartTime,v={distinct_id:String(this._mixpanel.get_distinct_id()),seq:this.seqNo,batch_start_time:f/1e3,replay_id:h,replay_length_ms:_,replay_start_time:this.replayStartTime/1e3},b=cn.JSONEncode(r),S=this._mixpanel.get_property("$device_id");S&&(v.$device_id=S);var k=this._mixpanel.get_property("$user_id");if(k&&(v.$user_id=k),In){var I=new Blob([b],{type:"application/json"}).stream().pipeThrough(new In("gzip"));new Response(I).blob().then(cn.bind((function(r){v.format="gzip",this._sendRequest(h,v,r,s)}),this))}else v.format="body",this._sendRequest(h,v,b,s)}})),MixpanelRecorder.prototype.reportError=function(r,i){wn.error.apply(wn.error,arguments);try{i||r instanceof Error||(r=new Error(r)),this.get_config("error_reporter")(r,i)}catch(s){wn.error(s)}},Er.__mp_recorder=MixpanelRecorder;var DomTracker=function(){};DomTracker.prototype.create_properties=function(){},DomTracker.prototype.event_handler=function(){},DomTracker.prototype.after_track_handler=function(){},DomTracker.prototype.init=function(r){return this.mp=r,this},DomTracker.prototype.track=function(r,i,s,a){var h=this,f=cn.dom_query(r);if(0!==f.length)return cn.each(f,(function(r){cn.register_event(r,this.override_event,(function(r){var f={},_=h.create_properties(s,this),v=h.mp.get_config("track_links_timeout");h.event_handler(r,this,f),window.setTimeout(h.track_callback(a,_,f,!0),v),h.mp.track(i,_,h.track_callback(a,_,f))}))}),this),!0;dn.error("The DOM query ("+r+") returned 0 elements")},DomTracker.prototype.track_callback=function(r,i,s,a){a=a||!1;var h=this;return function(){s.callback_fired||(s.callback_fired=!0,r&&!1===r(a,i)||h.after_track_handler(i,s,a))}},DomTracker.prototype.create_properties=function(r,i){return"function"==typeof r?r(i):cn.extend({},r)};var LinkTracker=function(){this.override_event="click"};cn.inherit(LinkTracker,DomTracker),LinkTracker.prototype.create_properties=function(r,i){var s=LinkTracker.superclass.create_properties.apply(this,arguments);return i.href&&(s.url=i.href),s},LinkTracker.prototype.event_handler=function(r,i,s){s.new_tab=2===r.which||r.metaKey||r.ctrlKey||"_blank"===i.target,s.href=i.href,s.new_tab||r.preventDefault()},LinkTracker.prototype.after_track_handler=function(r,i){i.new_tab||setTimeout((function(){window.location=i.href}),0)};var FormTracker=function(){this.override_event="submit"};cn.inherit(FormTracker,DomTracker),FormTracker.prototype.event_handler=function(r,i,s){s.element=i,r.preventDefault()},FormTracker.prototype.after_track_handler=function(r,i){setTimeout((function(){i.element.submit()}),0)};var Cn="$set",Tn="$set_once",On="$unset",Rn="$add",Mn="$append",Nn="$union",Pn="$remove",Dn={set_action:function(r,i){var s={},a={};return cn.isObject(r)?cn.each(r,(function(r,i){this._is_reserved_property(i)||(a[i]=r)}),this):a[r]=i,s[Cn]=a,s},unset_action:function(r){var i={},s=[];return cn.isArray(r)||(r=[r]),cn.each(r,(function(r){this._is_reserved_property(r)||s.push(r)}),this),i[On]=s,i},set_once_action:function(r,i){var s={},a={};return cn.isObject(r)?cn.each(r,(function(r,i){this._is_reserved_property(i)||(a[i]=r)}),this):a[r]=i,s[Tn]=a,s},union_action:function(r,i){var s={},a={};return cn.isObject(r)?cn.each(r,(function(r,i){this._is_reserved_property(i)||(a[i]=cn.isArray(r)?r:[r])}),this):a[r]=cn.isArray(i)?i:[i],s[Nn]=a,s},append_action:function(r,i){var s={},a={};return cn.isObject(r)?cn.each(r,(function(r,i){this._is_reserved_property(i)||(a[i]=r)}),this):a[r]=i,s[Mn]=a,s},remove_action:function(r,i){var s={},a={};return cn.isObject(r)?cn.each(r,(function(r,i){this._is_reserved_property(i)||(a[i]=r)}),this):a[r]=i,s[Pn]=a,s},delete_action:function(){var r={$delete:""};return r}},MixpanelGroup=function(){};cn.extend(MixpanelGroup.prototype,Dn),MixpanelGroup.prototype._init=function(r,i,s){this._mixpanel=r,this._group_key=i,this._group_id=s},MixpanelGroup.prototype.set=addOptOutCheckMixpanelGroup((function(r,i,s){var a=this.set_action(r,i);return cn.isObject(r)&&(s=i),this._send_request(a,s)})),MixpanelGroup.prototype.set_once=addOptOutCheckMixpanelGroup((function(r,i,s){var a=this.set_once_action(r,i);return cn.isObject(r)&&(s=i),this._send_request(a,s)})),MixpanelGroup.prototype.unset=addOptOutCheckMixpanelGroup((function(r,i){var s=this.unset_action(r);return this._send_request(s,i)})),MixpanelGroup.prototype.union=addOptOutCheckMixpanelGroup((function(r,i,s){cn.isObject(r)&&(s=i);var a=this.union_action(r,i);return this._send_request(a,s)})),MixpanelGroup.prototype.delete=addOptOutCheckMixpanelGroup((function(r){var i=this.delete_action();return this._send_request(i,r)})),MixpanelGroup.prototype.remove=addOptOutCheckMixpanelGroup((function(r,i,s){var a=this.remove_action(r,i);return this._send_request(a,s)})),MixpanelGroup.prototype._send_request=function(r,i){r.$group_key=this._group_key,r.$group_id=this._group_id,r.$token=this._get_config("token");var s=cn.encodeDates(r);return this._mixpanel._track_or_batch({type:"groups",data:s,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},i)},MixpanelGroup.prototype._is_reserved_property=function(r){return"$group_key"===r||"$group_id"===r},MixpanelGroup.prototype._get_config=function(r){return this._mixpanel.get_config(r)},MixpanelGroup.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id},MixpanelGroup.prototype.remove=MixpanelGroup.prototype.remove,MixpanelGroup.prototype.set=MixpanelGroup.prototype.set,MixpanelGroup.prototype.set_once=MixpanelGroup.prototype.set_once,MixpanelGroup.prototype.union=MixpanelGroup.prototype.union,MixpanelGroup.prototype.unset=MixpanelGroup.prototype.unset,MixpanelGroup.prototype.toString=MixpanelGroup.prototype.toString;var MixpanelPeople=function(){};cn.extend(MixpanelPeople.prototype,Dn),MixpanelPeople.prototype._init=function(r){this._mixpanel=r},MixpanelPeople.prototype.set=addOptOutCheckMixpanelPeople((function(r,i,s){var a=this.set_action(r,i);return cn.isObject(r)&&(s=i),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),a[Cn]=cn.extend({},cn.info.people_properties(),a[Cn]),this._send_request(a,s)})),MixpanelPeople.prototype.set_once=addOptOutCheckMixpanelPeople((function(r,i,s){var a=this.set_once_action(r,i);return cn.isObject(r)&&(s=i),this._send_request(a,s)})),MixpanelPeople.prototype.unset=addOptOutCheckMixpanelPeople((function(r,i){var s=this.unset_action(r);return this._send_request(s,i)})),MixpanelPeople.prototype.increment=addOptOutCheckMixpanelPeople((function(r,i,s){var a={},h={};return cn.isObject(r)?(cn.each(r,(function(r,i){if(!this._is_reserved_property(i)){if(isNaN(parseFloat(r)))return void dn.error("Invalid increment value passed to mixpanel.people.increment - must be a number");h[i]=r}}),this),s=i):(cn.isUndefined(i)&&(i=1),h[r]=i),a[Rn]=h,this._send_request(a,s)})),MixpanelPeople.prototype.append=addOptOutCheckMixpanelPeople((function(r,i,s){cn.isObject(r)&&(s=i);var a=this.append_action(r,i);return this._send_request(a,s)})),MixpanelPeople.prototype.remove=addOptOutCheckMixpanelPeople((function(r,i,s){cn.isObject(r)&&(s=i);var a=this.remove_action(r,i);return this._send_request(a,s)})),MixpanelPeople.prototype.union=addOptOutCheckMixpanelPeople((function(r,i,s){cn.isObject(r)&&(s=i);var a=this.union_action(r,i);return this._send_request(a,s)})),MixpanelPeople.prototype.track_charge=addOptOutCheckMixpanelPeople((function(r,i,s){if(cn.isNumber(r)||(r=parseFloat(r),!isNaN(r)))return this.append("$transactions",cn.extend({$amount:r},i),s);dn.error("Invalid value passed to mixpanel.people.track_charge - must be a number")})),MixpanelPeople.prototype.clear_charges=function(r){return this.set("$transactions",[],r)},MixpanelPeople.prototype.delete_user=function(){if(this._identify_called()){var r={$delete:this._mixpanel.get_distinct_id()};return this._send_request(r)}dn.error("mixpanel.people.delete_user() requires you to call identify() first")},MixpanelPeople.prototype.toString=function(){return this._mixpanel.toString()+".people"},MixpanelPeople.prototype._send_request=function(r,i){r.$token=this._get_config("token"),r.$distinct_id=this._mixpanel.get_distinct_id();var s=this._mixpanel.get_property("$device_id"),a=this._mixpanel.get_property("$user_id"),h=this._mixpanel.get_property("$had_persisted_distinct_id");s&&(r.$device_id=s),a&&(r.$user_id=a),h&&(r.$had_persisted_distinct_id=h);var f=cn.encodeDates(r);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:f,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},i):(this._enqueue(r),cn.isUndefined(i)||(this._get_config("verbose")?i({status:-1,error:null}):i(-1)),cn.truncate(f,255))},MixpanelPeople.prototype._get_config=function(r){return this._mixpanel.get_config(r)},MixpanelPeople.prototype._identify_called=function(){return!0===this._mixpanel._flags.identify_called},MixpanelPeople.prototype._enqueue=function(r){Cn in r?this._mixpanel.persistence._add_to_people_queue(Cn,r):Tn in r?this._mixpanel.persistence._add_to_people_queue(Tn,r):On in r?this._mixpanel.persistence._add_to_people_queue(On,r):Rn in r?this._mixpanel.persistence._add_to_people_queue(Rn,r):Mn in r?this._mixpanel.persistence._add_to_people_queue(Mn,r):Pn in r?this._mixpanel.persistence._add_to_people_queue(Pn,r):Nn in r?this._mixpanel.persistence._add_to_people_queue(Nn,r):dn.error("Invalid call to _enqueue():",r)},MixpanelPeople.prototype._flush_one_queue=function(r,i,s,a){var h=this,f=cn.extend({},this._mixpanel.persistence.load_queue(r)),_=f;cn.isUndefined(f)||!cn.isObject(f)||cn.isEmptyObject(f)||(h._mixpanel.persistence._pop_from_people_queue(r,f),h._mixpanel.persistence.save(),a&&(_=a(f)),i.call(h,_,(function(i,a){0===i&&h._mixpanel.persistence._add_to_people_queue(r,f),cn.isUndefined(s)||s(i,a)})))},MixpanelPeople.prototype._flush=function(r,i,s,a,h,f,_){var v=this;this._flush_one_queue(Cn,this.set,r),this._flush_one_queue(Tn,this.set_once,a),this._flush_one_queue(On,this.unset,f,(function(r){return cn.keys(r)})),this._flush_one_queue(Rn,this.increment,i),this._flush_one_queue(Nn,this.union,h);var b=this._mixpanel.persistence.load_queue(Mn);if(!cn.isUndefined(b)&&cn.isArray(b)&&b.length)for(var S,append_callback=function(r,i){0===r&&v._mixpanel.persistence._add_to_people_queue(Mn,S),cn.isUndefined(s)||s(r,i)},k=b.length-1;k>=0;k--)b=this._mixpanel.persistence.load_queue(Mn),S=b.pop(),v._mixpanel.persistence.save(),cn.isEmptyObject(S)||v.append(S,append_callback);var I=this._mixpanel.persistence.load_queue(Pn);if(!cn.isUndefined(I)&&cn.isArray(I)&&I.length)for(var C,remove_callback=function(r,i){0===r&&v._mixpanel.persistence._add_to_people_queue(Pn,C),cn.isUndefined(_)||_(r,i)},T=I.length-1;T>=0;T--)I=this._mixpanel.persistence.load_queue(Pn),C=I.pop(),v._mixpanel.persistence.save(),cn.isEmptyObject(C)||v.remove(C,remove_callback)},MixpanelPeople.prototype._is_reserved_property=function(r){return"$distinct_id"===r||"$token"===r||"$device_id"===r||"$user_id"===r||"$had_persisted_distinct_id"===r},MixpanelPeople.prototype.set=MixpanelPeople.prototype.set,MixpanelPeople.prototype.set_once=MixpanelPeople.prototype.set_once,MixpanelPeople.prototype.unset=MixpanelPeople.prototype.unset,MixpanelPeople.prototype.increment=MixpanelPeople.prototype.increment,MixpanelPeople.prototype.append=MixpanelPeople.prototype.append,MixpanelPeople.prototype.remove=MixpanelPeople.prototype.remove,MixpanelPeople.prototype.union=MixpanelPeople.prototype.union,MixpanelPeople.prototype.track_charge=MixpanelPeople.prototype.track_charge,MixpanelPeople.prototype.clear_charges=MixpanelPeople.prototype.clear_charges,MixpanelPeople.prototype.delete_user=MixpanelPeople.prototype.delete_user,MixpanelPeople.prototype.toString=MixpanelPeople.prototype.toString;var An,Zn="__mps",Ln="__mpso",jn="__mpus",Fn="__mpa",qn="__mpap",$n="__mpr",Un="__mpu",Bn="$people_distinct_id",zn="__alias",Vn="__timers",Wn=[Zn,Ln,jn,Fn,qn,$n,Un,Bn,zn,Vn],MixpanelPersistence=function(r){this.props={},this.campaign_params_saved=!1,r.persistence_name?this.name="mp_"+r.persistence_name:this.name="mp_"+r.token+"_mixpanel";var i=r.persistence;"cookie"!==i&&"localStorage"!==i&&(dn.critical("Unknown persistence type "+i+"; falling back to cookie"),i=r.persistence="cookie"),"localStorage"===i&&cn.localStorage.is_supported()?this.storage=cn.localStorage:this.storage=cn.cookie,this.load(),this.update_config(r),this.upgrade(),this.save()};MixpanelPersistence.prototype.properties=function(){var r={};return this.load(),cn.each(this.props,(function(i,s){cn.include(Wn,s)||(r[s]=i)})),r},MixpanelPersistence.prototype.load=function(){if(!this.disabled){var r=this.storage.parse(this.name);r&&(this.props=cn.extend({},r))}},MixpanelPersistence.prototype.upgrade=function(){var r,i;this.storage===cn.localStorage?(r=cn.cookie.parse(this.name),cn.cookie.remove(this.name),cn.cookie.remove(this.name,!0),r&&this.register_once(r)):this.storage===cn.cookie&&(i=cn.localStorage.parse(this.name),cn.localStorage.remove(this.name),i&&this.register_once(i))},MixpanelPersistence.prototype.save=function(){this.disabled||this.storage.set(this.name,cn.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)},MixpanelPersistence.prototype.load_prop=function(r){return this.load(),this.props[r]},MixpanelPersistence.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)},MixpanelPersistence.prototype.clear=function(){this.remove(),this.props={}},MixpanelPersistence.prototype.register_once=function(r,i,s){return!!cn.isObject(r)&&(void 0===i&&(i="None"),this.expire_days=void 0===s?this.default_expiry:s,this.load(),cn.each(r,(function(r,s){this.props.hasOwnProperty(s)&&this.props[s]!==i||(this.props[s]=r)}),this),this.save(),!0)},MixpanelPersistence.prototype.register=function(r,i){return!!cn.isObject(r)&&(this.expire_days=void 0===i?this.default_expiry:i,this.load(),cn.extend(this.props,r),this.save(),!0)},MixpanelPersistence.prototype.unregister=function(r){this.load(),r in this.props&&(delete this.props[r],this.save())},MixpanelPersistence.prototype.update_search_keyword=function(r){this.register(cn.info.searchInfo(r))},MixpanelPersistence.prototype.update_referrer_info=function(r){this.register_once({$initial_referrer:r||"$direct",$initial_referring_domain:cn.info.referringDomain(r)||"$direct"},"")},MixpanelPersistence.prototype.get_referrer_info=function(){return cn.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})},MixpanelPersistence.prototype.update_config=function(r){this.default_expiry=this.expire_days=r.cookie_expiration,this.set_disabled(r.disable_persistence),this.set_cookie_domain(r.cookie_domain),this.set_cross_site(r.cross_site_cookie),this.set_cross_subdomain(r.cross_subdomain_cookie),this.set_secure(r.secure_cookie)},MixpanelPersistence.prototype.set_disabled=function(r){this.disabled=r,this.disabled?this.remove():this.save()},MixpanelPersistence.prototype.set_cookie_domain=function(r){r!==this.cookie_domain&&(this.remove(),this.cookie_domain=r,this.save())},MixpanelPersistence.prototype.set_cross_site=function(r){r!==this.cross_site&&(this.cross_site=r,this.remove(),this.save())},MixpanelPersistence.prototype.set_cross_subdomain=function(r){r!==this.cross_subdomain&&(this.cross_subdomain=r,this.remove(),this.save())},MixpanelPersistence.prototype.get_cross_subdomain=function(){return this.cross_subdomain},MixpanelPersistence.prototype.set_secure=function(r){r!==this.secure&&(this.secure=!!r,this.remove(),this.save())},MixpanelPersistence.prototype._add_to_people_queue=function(r,i){var s=this._get_queue_key(r),a=i[r],h=this._get_or_create_queue(Cn),f=this._get_or_create_queue(Tn),_=this._get_or_create_queue(On),v=this._get_or_create_queue(Rn),b=this._get_or_create_queue(Nn),S=this._get_or_create_queue(Pn,[]),k=this._get_or_create_queue(Mn,[]);s===Zn?(cn.extend(h,a),this._pop_from_people_queue(Rn,a),this._pop_from_people_queue(Nn,a),this._pop_from_people_queue(On,a)):s===Ln?(cn.each(a,(function(r,i){i in f||(f[i]=r)})),this._pop_from_people_queue(On,a)):s===jn?cn.each(a,(function(r){cn.each([h,f,v,b],(function(i){r in i&&delete i[r]})),cn.each(k,(function(i){r in i&&delete i[r]})),_[r]=!0})):s===Fn?(cn.each(a,(function(r,i){i in h?h[i]+=r:(i in v||(v[i]=0),v[i]+=r)}),this),this._pop_from_people_queue(On,a)):s===Un?(cn.each(a,(function(r,i){cn.isArray(r)&&(i in b||(b[i]=[]),b[i]=b[i].concat(r))})),this._pop_from_people_queue(On,a)):s===$n?(S.push(a),this._pop_from_people_queue(Mn,a)):s===qn&&(k.push(a),this._pop_from_people_queue(On,a)),dn.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),dn.log(i),this.save()},MixpanelPersistence.prototype._pop_from_people_queue=function(r,i){var s=this.props[this._get_queue_key(r)];cn.isUndefined(s)||cn.each(i,(function(i,a){r===Mn||r===Pn?cn.each(s,(function(r){r[a]===i&&delete r[a]})):delete s[a]}),this)},MixpanelPersistence.prototype.load_queue=function(r){return this.load_prop(this._get_queue_key(r))},MixpanelPersistence.prototype._get_queue_key=function(r){return r===Cn?Zn:r===Tn?Ln:r===On?jn:r===Rn?Fn:r===Mn?qn:r===Pn?$n:r===Nn?Un:void dn.error("Invalid queue:",r)},MixpanelPersistence.prototype._get_or_create_queue=function(r,i){var s=this._get_queue_key(r);return i=cn.isUndefined(i)?{}:i,this.props[s]||(this.props[s]=i)},MixpanelPersistence.prototype.set_event_timer=function(r,i){var s=this.load_prop(Vn)||{};s[r]=i,this.props[Vn]=s,this.save()},MixpanelPersistence.prototype.remove_event_timer=function(r){var i=(this.load_prop(Vn)||{})[r];return cn.isUndefined(i)||(delete this.props[Vn][r],this.save()),i};var Gn,load_extra_bundle=function(r,i){throw new Error(r+" not available in this build.")},IDENTITY_FUNC=function(r){return r},NOOP_FUNC=function(){},Kn="mixpanel",Hn="base64",Yn="$device:",Jn=Er.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,Xn=!Jn&&-1===Qr.indexOf("MSIE")&&-1===Qr.indexOf("Mozilla"),Qn=null;Hr.sendBeacon&&(Qn=function(){return Hr.sendBeacon.apply(Hr,arguments)});var ei={track:"track/",engage:"engage/",groups:"groups/",record:"record/"},ti={api_host:"https://api-js.mixpanel.com",api_routes:ei,api_method:"POST",api_transport:"XHR",api_payload_format:Hn,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:NOOP_FUNC,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:NOOP_FUNC,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5e3,batch_request_timeout_ms:9e4,batch_autostart:!0,hooks:{},record_block_class:new RegExp("^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$"),record_block_selector:"img, video",record_collect_fonts:!1,record_idle_timeout_ms:18e5,record_inline_images:!1,record_mask_text_class:new RegExp("^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$"),record_mask_text_selector:"*",record_max_ms:qr,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},ri=!1,MixpanelLib=function(){},create_mplib=function(r,i,s){var a,h=s===Kn?Gn:Gn[s];if(h&&0===An)a=h;else{if(h&&!cn.isArray(h))return void dn.error("You have already initialized "+s);a=new MixpanelLib}if(a._cached_groups={},a._init(r,i,s),a.people=new MixpanelPeople,a.people._init(a),!a.get_config("skip_first_touch_marketing")){var f=cn.info.campaignParams(null),_={},v=!1;cn.each(f,(function(r,i){_["initial_"+i]=r,r&&(v=!0)})),v&&a.people.set_once(_)}return Tr.DEBUG=Tr.DEBUG||a.get_config("debug"),!cn.isUndefined(h)&&cn.isArray(h)&&(a._execute_array.call(a.people,h.people),a._execute_array(h)),a};MixpanelLib.prototype.init=function(r,i,s){if(cn.isUndefined(s))this.report_error("You must name your new library: init(token, config, name)");else{if(s!==Kn){var a=create_mplib(r,i,s);return Gn[s]=a,a._loaded(),a}this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet")}},MixpanelLib.prototype._init=function(r,i,s){i=i||{},this.__loaded=!0,this.config={};var a={};"api_payload_format"in i||(i.api_host||ti.api_host).match(/\.mixpanel\.com/)&&(a.api_payload_format="json");if(this.set_config(cn.extend({},ti,a,i,{name:s,token:r,callback_fn:(s===Kn?s:Kn+"."+s)+"._jsc"})),this._jsc=NOOP_FUNC,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests)if(cn.localStorage.is_supported(!0)&&Jn){if(this.init_batchers(),Qn&&Er.addEventListener){var h=cn.bind((function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})}),this);Er.addEventListener("pagehide",(function(r){r.persisted&&h()})),Er.addEventListener("visibilitychange",(function(){"hidden"===Yr.visibilityState&&h()}))}}else this._batch_requests=!1,dn.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),cn.each(this.get_batcher_configs(),(function(r){dn.log("Clearing batch queue "+r.queue_key),cn.localStorage.remove(r.queue_key)}));this.persistence=this.cookie=new MixpanelPersistence(this.config),this.unpersisted_superprops={},this._gdpr_init();var f=cn.UUID();this.get_distinct_id()||this.register_once({distinct_id:Yn+f,$device_id:f},"");var _=this.get_config("track_pageview");_&&this._init_url_change_tracking(_),this.get_config("record_sessions_percent")>0&&100*Math.random()<=this.get_config("record_sessions_percent")&&this.start_session_recording()},MixpanelLib.prototype.start_session_recording=addOptOutCheckMixpanelLib((function(){if(Er.MutationObserver){var r=cn.bind((function(){this._recorder=this._recorder||new Er.__mp_recorder(this),this._recorder.startRecording()}),this);cn.isUndefined(Er.__mp_recorder)?load_extra_bundle(this.get_config("recorder_src"),r):r()}else dn.critical("Browser does not support MutationObserver; skipping session recording")})),MixpanelLib.prototype.stop_session_recording=function(){this._recorder?this._recorder.stopRecording():dn.critical("Session recorder module not loaded")},MixpanelLib.prototype.get_session_recording_properties=function(){var r={};if(this._recorder){var i=this._recorder.replayId;i&&(r.$mp_replay_id=i)}return r},MixpanelLib.prototype._loaded=function(){if(this.get_config("loaded")(this),this._set_default_superprops(),this.people.set_once(this.persistence.get_referrer_info()),this.get_config("store_google")&&this.get_config("stop_utm_persistence")){var r=cn.info.campaignParams(null);cn.each(r,function(r,i){this.unregister(i)}.bind(this))}},MixpanelLib.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(Yr.referrer),this.get_config("store_google")&&!this.get_config("stop_utm_persistence")&&this.register(cn.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(Yr.referrer)},MixpanelLib.prototype._dom_loaded=function(){cn.each(this.__dom_loaded_queue,(function(r){this._track_dom.apply(this,r)}),this),this.has_opted_out_tracking()||cn.each(this.__request_queue,(function(r){this._send_request.apply(this,r)}),this),delete this.__dom_loaded_queue,delete this.__request_queue},MixpanelLib.prototype._track_dom=function(r,i){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!ri)return this.__dom_loaded_queue.push([r,i]),!1;var s=(new r).init(this);return s.track.apply(s,i)},MixpanelLib.prototype._init_url_change_tracking=function(r){var i="";if(this.track_pageview()&&(i=cn.info.currentUrl()),cn.include(["full-url","url-with-path-and-query-string","url-with-path"],r)){Er.addEventListener("popstate",(function(){Er.dispatchEvent(new Event("mp_locationchange"))})),Er.addEventListener("hashchange",(function(){Er.dispatchEvent(new Event("mp_locationchange"))}));var s=Er.history.pushState;"function"==typeof s&&(Er.history.pushState=function(r,i,a){s.call(Er.history,r,i,a),Er.dispatchEvent(new Event("mp_locationchange"))});var a=Er.history.replaceState;"function"==typeof a&&(Er.history.replaceState=function(r,i,s){a.call(Er.history,r,i,s),Er.dispatchEvent(new Event("mp_locationchange"))}),Er.addEventListener("mp_locationchange",function(){var s=cn.info.currentUrl(),a=!1;("full-url"===r?a=s!==i:"url-with-path-and-query-string"===r?a=s.split("#")[0]!==i.split("#")[0]:"url-with-path"===r&&(a=s.split("#")[0].split("?")[0]!==i.split("#")[0].split("?")[0]),a)&&(this.track_pageview()&&(i=s))}.bind(this))}},MixpanelLib.prototype._prepare_callback=function(r,i){if(cn.isUndefined(r))return null;if(Jn){return function(s){r(s,i)}}var s=this._jsc,a=""+Math.floor(1e8*Math.random()),h=this.get_config("callback_fn")+"["+a+"]";return s[a]=function(h){delete s[a],r(h,i)},h},MixpanelLib.prototype._send_request=function(r,i,s,a){var h=!0;if(Xn)return this.__request_queue.push(arguments),h;var f={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},_=null;a||!cn.isFunction(s)&&"string"!=typeof s||(a=s,s=null),s=cn.extend(f,s||{}),Jn||(s.method="GET");var v="POST"===s.method,b=Qn&&v&&"sendbeacon"===s.transport.toLowerCase(),S=s.verbose;i.verbose&&(S=!0),this.get_config("test")&&(i.test=1),S&&(i.verbose=1),this.get_config("img")&&(i.img=1),Jn||(a?i.callback=a:(S||this.get_config("test"))&&(i.callback="(function(){})")),i.ip=this.get_config("ip")?1:0,i._=(new Date).getTime().toString(),v&&(_="data="+encodeURIComponent(i.data),delete i.data),r+="?"+cn.HTTPBuildQuery(i);var k=this;if("img"in i){var I=Yr.createElement("img");I.src=r,Yr.body.appendChild(I)}else if(b){try{h=Qn(r,_)}catch(N){k.report_error(N),h=!1}try{a&&a(h?1:0)}catch(N){k.report_error(N)}}else if(Jn)try{var C=new XMLHttpRequest;C.open(s.method,r,!0);var T=this.get_config("xhr_headers");if(v&&(T["Content-Type"]="application/x-www-form-urlencoded"),cn.each(T,(function(r,i){C.setRequestHeader(i,r)})),s.timeout_ms&&void 0!==C.timeout){C.timeout=s.timeout_ms;var O=(new Date).getTime()}C.withCredentials=!0,C.onreadystatechange=function(){var r;if(4===C.readyState)if(200===C.status){if(a)if(S){var i;try{i=cn.JSONDecode(C.responseText)}catch(N){if(k.report_error(N),!s.ignore_json_errors)return;i=C.responseText}a(i)}else a(Number(C.responseText))}else if(r=C.timeout&&!C.status&&(new Date).getTime()-O>=C.timeout?"timeout":"Bad HTTP status: "+C.status+" "+C.statusText,k.report_error(r),a)if(S){var h=C.responseHeaders||{};a({status:0,httpStatusCode:C.status,error:r,retryAfter:h["Retry-After"]})}else a(0)},C.send(_)}catch(N){k.report_error(N),h=!1}else{var R=Yr.createElement("script");R.type="text/javascript",R.async=!0,R.defer=!0,R.src=r;var M=Yr.getElementsByTagName("script")[0];M.parentNode.insertBefore(R,M)}return h},MixpanelLib.prototype._execute_array=function(r){var i,s=[],a=[],h=[];cn.each(r,(function(r){r&&(i=r[0],cn.isArray(i)?h.push(r):"function"==typeof r?r.call(this):cn.isArray(r)&&"alias"===i?s.push(r):cn.isArray(r)&&-1!==i.indexOf("track")&&"function"==typeof this[i]?h.push(r):a.push(r))}),this);var execute=function(r,i){cn.each(r,(function(r){if(cn.isArray(r[0])){var s=i;cn.each(r,(function(r){s=s[r[0]].apply(s,r.slice(1))}))}else this[r[0]].apply(this,r.slice(1))}),i)};execute(s,this),execute(a,this),execute(h,this)},MixpanelLib.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events},MixpanelLib.prototype.get_batcher_configs=function(){var r="__mpq_"+this.get_config("token"),i=this.get_config("api_routes");return this._batcher_configs=this._batcher_configs||{events:{type:"events",endpoint:"/"+i.track,queue_key:r+"_ev"},people:{type:"people",endpoint:"/"+i.engage,queue_key:r+"_pp"},groups:{type:"groups",endpoint:"/"+i.groups,queue_key:r+"_gr"}},this._batcher_configs},MixpanelLib.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var r=cn.bind((function(r){return new RequestBatcher(r.queue_key,{libConfig:this.config,errorReporter:this.get_config("error_reporter"),sendRequestFunc:cn.bind((function(i,s,a){this._send_request(this.get_config("api_host")+r.endpoint,this._encode_data_for_request(i),s,this._prepare_callback(a,i))}),this),beforeSendHook:cn.bind((function(i){return this._run_hook("before_send_"+r.type,i)}),this),stopAllBatchingFunc:cn.bind(this.stop_batch_senders,this),usePersistence:!0})}),this),i=this.get_batcher_configs();this.request_batchers={events:r(i.events),people:r(i.people),groups:r(i.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()},MixpanelLib.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,cn.each(this.request_batchers,(function(r){r.start()})))},MixpanelLib.prototype.stop_batch_senders=function(){this._batch_requests=!1,cn.each(this.request_batchers,(function(r){r.stop(),r.clear()}))},MixpanelLib.prototype.push=function(r){this._execute_array([r])},MixpanelLib.prototype.disable=function(r){void 0===r?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(r)},MixpanelLib.prototype._encode_data_for_request=function(r){var i=cn.JSONEncode(r);return this.get_config("api_payload_format")===Hn&&(i=cn.base64Encode(i)),{data:i}},MixpanelLib.prototype._track_or_batch=function(r,i){var s=cn.truncate(r.data,255),a=r.endpoint,h=r.batcher,f=r.should_send_immediately,_=r.send_request_options||{};i=i||NOOP_FUNC;var v=!0,b=cn.bind((function(){return _.skip_hooks||(s=this._run_hook("before_send_"+r.type,s)),s?(dn.log("MIXPANEL REQUEST:"),dn.log(s),this._send_request(a,this._encode_data_for_request(s),_,this._prepare_callback(i,s))):null}),this);return this._batch_requests&&!f?h.enqueue(s,(function(r){r?i(1,s):b()})):v=b(),v&&s},MixpanelLib.prototype.track=addOptOutCheckMixpanelLib((function(r,i,s,a){a||"function"!=typeof s||(a=s,s=null);var h=(s=s||{}).transport;h&&(s.transport=h);var f=s.send_immediately;if("function"!=typeof a&&(a=NOOP_FUNC),cn.isUndefined(r))this.report_error("No event name provided to mixpanel.track");else{if(!this._event_is_disabled(r)){(i=cn.extend({},i)).token=this.get_config("token");var _=this.persistence.remove_event_timer(r);if(!cn.isUndefined(_)){var v=(new Date).getTime()-_;i.$duration=parseFloat((v/1e3).toFixed(3))}this._set_default_superprops();var b=this.get_config("track_marketing")?cn.info.marketingParams():{};i=cn.extend({},cn.info.properties({mp_loader:this.get_config("mp_loader")}),b,this.persistence.properties(),this.unpersisted_superprops,this.get_session_recording_properties(),i);var S=this.get_config("property_blacklist");cn.isArray(S)?cn.each(S,(function(r){delete i[r]})):this.report_error("Invalid value for property_blacklist config: "+S);var k={event:r,properties:i};return this._track_or_batch({type:"events",data:k,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:f,send_request_options:s},a)}a(0)}})),MixpanelLib.prototype.set_group=addOptOutCheckMixpanelLib((function(r,i,s){cn.isArray(i)||(i=[i]);var a={};return a[r]=i,this.register(a),this.people.set(r,i,s)})),MixpanelLib.prototype.add_group=addOptOutCheckMixpanelLib((function(r,i,s){var a=this.get_property(r),h={};return void 0===a?(h[r]=[i],this.register(h)):-1===a.indexOf(i)&&(a.push(i),h[r]=a,this.register(h)),this.people.union(r,i,s)})),MixpanelLib.prototype.remove_group=addOptOutCheckMixpanelLib((function(r,i,s){var a=this.get_property(r);if(void 0!==a){var h=a.indexOf(i);h>-1&&(a.splice(h,1),this.register({group_key:a})),0===a.length&&this.unregister(r)}return this.people.remove(r,i,s)})),MixpanelLib.prototype.track_with_groups=addOptOutCheckMixpanelLib((function(r,i,s,a){var h=cn.extend({},i||{});return cn.each(s,(function(r,i){null!=r&&(h[i]=r)})),this.track(r,h,a)})),MixpanelLib.prototype._create_map_key=function(r,i){return r+"_"+JSON.stringify(i)},MixpanelLib.prototype._remove_group_from_cache=function(r,i){delete this._cached_groups[this._create_map_key(r,i)]},MixpanelLib.prototype.get_group=function(r,i){var s=this._create_map_key(r,i),a=this._cached_groups[s];return void 0!==a&&a._group_key===r&&a._group_id===i||((a=new MixpanelGroup)._init(this,r,i),this._cached_groups[s]=a),a},MixpanelLib.prototype.track_pageview=addOptOutCheckMixpanelLib((function(r,i){"object"!=typeof r&&(r={});var s=(i=i||{}).event_name||"$mp_web_page_view",a=cn.extend(cn.info.mpPageViewProperties(),cn.info.campaignParams(),cn.info.clickParams()),h=cn.extend({},a,r);return this.track(s,h)})),MixpanelLib.prototype.track_links=function(){return this._track_dom.call(this,LinkTracker,arguments)},MixpanelLib.prototype.track_forms=function(){return this._track_dom.call(this,FormTracker,arguments)},MixpanelLib.prototype.time_event=function(r){cn.isUndefined(r)?this.report_error("No event name provided to mixpanel.time_event"):this._event_is_disabled(r)||this.persistence.set_event_timer(r,(new Date).getTime())};var ni={persistent:!0},options_for_register=function(r){var i;return i=cn.isObject(r)?r:cn.isUndefined(r)?{}:{days:r},cn.extend({},ni,i)};MixpanelLib.prototype.register=function(r,i){var s=options_for_register(i);s.persistent?this.persistence.register(r,s.days):cn.extend(this.unpersisted_superprops,r)},MixpanelLib.prototype.register_once=function(r,i,s){var a=options_for_register(s);a.persistent?this.persistence.register_once(r,i,a.days):(void 0===i&&(i="None"),cn.each(r,(function(r,s){this.unpersisted_superprops.hasOwnProperty(s)&&this.unpersisted_superprops[s]!==i||(this.unpersisted_superprops[s]=r)}),this))},MixpanelLib.prototype.unregister=function(r,i){(i=options_for_register(i)).persistent?this.persistence.unregister(r):delete this.unpersisted_superprops[r]},MixpanelLib.prototype._register_single=function(r,i){var s={};s[r]=i,this.register(s)},MixpanelLib.prototype.identify=function(r,i,s,a,h,f,_,v){var b=this.get_distinct_id();if(r&&b!==r){if("string"==typeof r&&0===r.indexOf(Yn))return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:r})}if(!this.get_property("$device_id")){var S=b;this.register_once({$had_persisted_distinct_id:!0,$device_id:S},"")}r!==b&&r!==this.get_property(zn)&&(this.unregister(zn),this.register({distinct_id:r})),this._flags.identify_called=!0,this.people._flush(i,s,a,h,f,_,v),r!==b&&this.track("$identify",{distinct_id:r,$anon_distinct_id:b},{skip_hooks:!0})},MixpanelLib.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var r=cn.UUID();this.register_once({distinct_id:Yn+r,$device_id:r},"")},MixpanelLib.prototype.get_distinct_id=function(){return this.get_property("distinct_id")},MixpanelLib.prototype.alias=function(r,i){if(r===this.get_property(Bn))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var s=this;return cn.isUndefined(i)&&(i=this.get_distinct_id()),r!==i?(this._register_single(zn,r),this.track("$create_alias",{alias:r,distinct_id:i},{skip_hooks:!0},(function(){s.identify(r)}))):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(r),-1)},MixpanelLib.prototype.name_tag=function(r){this._register_single("mp_name_tag",r)},MixpanelLib.prototype.set_config=function(r){cn.isObject(r)&&(cn.extend(this.config,r),r.batch_size&&cn.each(this.request_batchers,(function(r){r.resetBatchSize()})),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),Tr.DEBUG=Tr.DEBUG||this.get_config("debug"))},MixpanelLib.prototype.get_config=function(r){return this.config[r]},MixpanelLib.prototype._run_hook=function(r){var i=(this.config.hooks[r]||IDENTITY_FUNC).apply(this,Vr.call(arguments,1));return void 0===i&&(this.report_error(r+" hook did not return a value"),i=null),i},MixpanelLib.prototype.get_property=function(r){return this.persistence.load_prop([r])},MixpanelLib.prototype.toString=function(){var r=this.get_config("name");return r!==Kn&&(r=Kn+"."+r),r},MixpanelLib.prototype._event_is_disabled=function(r){return cn.isBlockedUA(Qr)||this._flags.disable_all_events||cn.include(this.__disabled_events,r)},MixpanelLib.prototype._gdpr_init=function(){"localStorage"===this.get_config("opt_out_tracking_persistence_type")&&cn.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):this.has_opted_in_tracking()||!this.get_config("opt_out_tracking_by_default")&&!cn.cookie.get("mp_optout")||(cn.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))},MixpanelLib.prototype._gdpr_update_persistence=function(r){var i;if(r&&r.clear_persistence)i=!0;else{if(!r||!r.enable_persistence)return;i=!1}this.get_config("disable_persistence")||this.persistence.disabled===i||this.persistence.set_disabled(i),i?this.stop_batch_senders():this._batchers_were_started&&this.start_batch_senders()},MixpanelLib.prototype._gdpr_call_func=function(r,i){return i=cn.extend({track:cn.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},i),cn.localStorage.is_supported()||(i.persistence_type="cookie"),r(this.get_config("token"),{track:i.track,trackEventName:i.track_event_name,trackProperties:i.track_properties,persistenceType:i.persistence_type,persistencePrefix:i.cookie_prefix,cookieDomain:i.cookie_domain,cookieExpiration:i.cookie_expiration,crossSiteCookie:i.cross_site_cookie,crossSubdomainCookie:i.cross_subdomain_cookie,secureCookie:i.secure_cookie,ignoreDnt:i.ignore_dnt})},MixpanelLib.prototype.opt_in_tracking=function(r){r=cn.extend({enable_persistence:!0},r),this._gdpr_call_func(optIn,r),this._gdpr_update_persistence(r)},MixpanelLib.prototype.opt_out_tracking=function(r){(r=cn.extend({clear_persistence:!0,delete_user:!0},r)).delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(optOut,r),this._gdpr_update_persistence(r)},MixpanelLib.prototype.has_opted_in_tracking=function(r){return this._gdpr_call_func(hasOptedIn,r)},MixpanelLib.prototype.has_opted_out_tracking=function(r){return this._gdpr_call_func(hasOptedOut,r)},MixpanelLib.prototype.clear_opt_in_out_tracking=function(r){r=cn.extend({enable_persistence:!0},r),this._gdpr_call_func(clearOptInOut,r),this._gdpr_update_persistence(r)},MixpanelLib.prototype.report_error=function(r,i){dn.error.apply(dn.error,arguments);try{i||r instanceof Error||(r=new Error(r)),this.get_config("error_reporter")(r,i)}catch(s){dn.error(s)}},MixpanelLib.prototype.init=MixpanelLib.prototype.init,MixpanelLib.prototype.reset=MixpanelLib.prototype.reset,MixpanelLib.prototype.disable=MixpanelLib.prototype.disable,MixpanelLib.prototype.time_event=MixpanelLib.prototype.time_event,MixpanelLib.prototype.track=MixpanelLib.prototype.track,MixpanelLib.prototype.track_links=MixpanelLib.prototype.track_links,MixpanelLib.prototype.track_forms=MixpanelLib.prototype.track_forms,MixpanelLib.prototype.track_pageview=MixpanelLib.prototype.track_pageview,MixpanelLib.prototype.register=MixpanelLib.prototype.register,MixpanelLib.prototype.register_once=MixpanelLib.prototype.register_once,MixpanelLib.prototype.unregister=MixpanelLib.prototype.unregister,MixpanelLib.prototype.identify=MixpanelLib.prototype.identify,MixpanelLib.prototype.alias=MixpanelLib.prototype.alias,MixpanelLib.prototype.name_tag=MixpanelLib.prototype.name_tag,MixpanelLib.prototype.set_config=MixpanelLib.prototype.set_config,MixpanelLib.prototype.get_config=MixpanelLib.prototype.get_config,MixpanelLib.prototype.get_property=MixpanelLib.prototype.get_property,MixpanelLib.prototype.get_distinct_id=MixpanelLib.prototype.get_distinct_id,MixpanelLib.prototype.toString=MixpanelLib.prototype.toString,MixpanelLib.prototype.opt_out_tracking=MixpanelLib.prototype.opt_out_tracking,MixpanelLib.prototype.opt_in_tracking=MixpanelLib.prototype.opt_in_tracking,MixpanelLib.prototype.has_opted_out_tracking=MixpanelLib.prototype.has_opted_out_tracking,MixpanelLib.prototype.has_opted_in_tracking=MixpanelLib.prototype.has_opted_in_tracking,MixpanelLib.prototype.clear_opt_in_out_tracking=MixpanelLib.prototype.clear_opt_in_out_tracking,MixpanelLib.prototype.get_group=MixpanelLib.prototype.get_group,MixpanelLib.prototype.set_group=MixpanelLib.prototype.set_group,MixpanelLib.prototype.add_group=MixpanelLib.prototype.add_group,MixpanelLib.prototype.remove_group=MixpanelLib.prototype.remove_group,MixpanelLib.prototype.track_with_groups=MixpanelLib.prototype.track_with_groups,MixpanelLib.prototype.start_batch_senders=MixpanelLib.prototype.start_batch_senders,MixpanelLib.prototype.stop_batch_senders=MixpanelLib.prototype.stop_batch_senders,MixpanelLib.prototype.start_session_recording=MixpanelLib.prototype.start_session_recording,MixpanelLib.prototype.stop_session_recording=MixpanelLib.prototype.stop_session_recording,MixpanelLib.prototype.get_session_recording_properties=MixpanelLib.prototype.get_session_recording_properties,MixpanelLib.prototype.DEFAULT_API_ROUTES=ei,MixpanelPersistence.prototype.properties=MixpanelPersistence.prototype.properties,MixpanelPersistence.prototype.update_search_keyword=MixpanelPersistence.prototype.update_search_keyword,MixpanelPersistence.prototype.update_referrer_info=MixpanelPersistence.prototype.update_referrer_info,MixpanelPersistence.prototype.get_cross_subdomain=MixpanelPersistence.prototype.get_cross_subdomain,MixpanelPersistence.prototype.clear=MixpanelPersistence.prototype.clear;var ii={},override_mp_init_func=function(){Gn.init=function(r,i,s){if(s)return Gn[s]||(Gn[s]=ii[s]=create_mplib(r,i,s),Gn[s]._loaded()),Gn[s];var a=Gn;ii[Kn]?a=ii[Kn]:r&&((a=create_mplib(r,i,Kn))._loaded(),ii[Kn]=a),Gn=a,1===An&&(Er[Kn]=Gn),cn.each(ii,(function(r,i){i!==Kn&&(Gn[i]=r)})),Gn._=cn}};var oi=function init_as_module(r){return load_extra_bundle=r,An=0,Gn=new MixpanelLib,override_mp_init_func(),Gn.init(),function(){function dom_loaded_handler(){dom_loaded_handler.done||(dom_loaded_handler.done=!0,ri=!0,Xn=!1,cn.each(ii,(function(r){r._dom_loaded()})))}if(Yr.addEventListener)"complete"===Yr.readyState?dom_loaded_handler():Yr.addEventListener("DOMContentLoaded",dom_loaded_handler,!1);else if(Yr.attachEvent){Yr.attachEvent("onreadystatechange",dom_loaded_handler);var r=!1;try{r=null===Er.frameElement}catch(i){}Yr.documentElement.doScroll&&r&&function do_scroll_check(){try{Yr.documentElement.doScroll("left")}catch(i){return void setTimeout(do_scroll_check,1)}dom_loaded_handler()}()}cn.register_event(Er,"load",dom_loaded_handler,!0)}(),Gn}((function loadNoop(r,i){i()}));const si="mp_distinct_id",ai={"Event Source":"sdk"};function isReady(){return void 0!==window.mixpanel}function updateCachedDistinctId(r){localStorage.setItem(si,r)}const ci={init:function init$2(r,i=!1,s){return new Promise((a=>{oi.init(r,{debug:i,loaded:()=>{window.mixpanel=oi,oi.register({...ai}),a()},...s&&{api_host:s}})}))},isReady:isReady,track:function track(r,i){isReady()&&oi.track(r,{...i,"Reservamos Version":"1.1.6-alpha.0"})},identify:function identify$1(r,i){oi.identify(r),updateCachedDistinctId(r),oi.people.set(i)},attachProperty:function attachProperty(r,i){isReady()&&oi.people.union(r,[i])},setPeopleProperties:function setPeopleProperties(r){isReady()&&oi.people.set(r)},getMixpanelDistinctId:()=>{const r=localStorage.getItem(si);if(oi&&oi.get_distinct_id){const r=oi.get_distinct_id();return updateCachedDistinctId(r),r}return r||null}},di=Oe.object({"Selected City":Oe.string().min(1,"Selected city is required"),"Selected Country Code":Oe.string().min(1,"Selected Country Code is required")});const ui=Oe.object({firstName:Oe.string().optional(),lastName:Oe.string().optional(),email:Oe.string().email().optional(),phone:Oe.string().optional()}),li=["web","web-mobile","ios","android","app"],pi=Oe.enum(li).refine((r=>li.includes(r)),{message:`Product must be one of: ${li.join(", ")}`}),hi=Oe.object({product:pi});const dateValidation=r=>!(!/^\d{4}-\d{2}-\d{2}$/.test(r)&&!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}$/.test(r))||!(!/^\d{4}-\d{2}-\d{2}/.test(r)||isNaN(Date.parse(r))),stringField=r=>Oe.string().refine((r=>r),{message:`${r} must be a string`}),numberField=r=>Oe.number().refine((r=>r),{message:`${r} must be a number`}),intField=r=>Oe.number().int().refine((r=>r),{message:`${r} must be an integer`}),dateField=r=>Oe.string().refine(dateValidation,{message:`Invalid ${r} datetime format`}),arrayField=(r,i,s)=>Oe.array(r).min(s,`${i} must have at least ${s} items`),fi=Oe.object({Origin:stringField("Origin").optional(),Destination:stringField("Destination").optional(),Departure:dateField("Departure").optional(),Return:dateField("Return").optional(),"Departure Date":stringField("Departure Date").optional(),product:pi});const mi=Oe.object({"Passenger Birthdate":dateField("Passenger Birthdate"),"Passenger Seat":stringField("Passenger Seat"),"Passenger Name":stringField("Passenger Name"),"Passenger Document Type":stringField("Document Type"),"Passenger Document Id":stringField("Document ID")}).strict(),gi=Oe.object({"Departure Arrival":dateField("Departure Arrival"),"Departure Destination":stringField("Departure Destination"),"Departure Destination Terminal":stringField("Departure Destination Terminal"),"Departure Line":stringField("Departure Line"),"Departure Origin":stringField("Departure Origin"),"Departure Origin Terminal":stringField("Departure Origin Terminal"),"Departure Price":numberField("Departure Price"),"Departure Route":stringField("Departure Route"),"Departure Stops":intField("Departure Stops"),"Departure Time":dateField("Departure Time"),"Departure Transport Type":stringField("Departure Transport Type"),"Departure Transporter":stringField("Departure Transporter"),"Return Arrival":dateField("Return Arrival").optional(),"Return Destination":stringField("Return Destination").optional(),"Return Destination Terminal":stringField("Return Destination Terminal").optional(),"Return Line":stringField("Return Line").optional(),"Return Origin":stringField("Return Origin").optional(),"Return Origin Terminal":stringField("Return Origin Terminal").optional(),"Return Price":numberField("Return Price").optional(),"Return Route":stringField("Return Route").optional(),"Return Stops":intField("Return Stops").optional(),"Return Time":dateField("Return Time").optional(),"Return Transport Type":stringField("Return Transport Type").optional(),"Return Transporter":stringField("Return Transporter").optional(),"Recommended Trip":Oe.boolean(),"Recommended Trip Type":stringField("Recommended Trip Type").optional()}),_i=Oe.object({Trips:arrayField(gi,"Trips",1),"Passenger Count":intField("Passenger Count"),"Trip Count":intField("Trip Count").optional(),Total:numberField("Total"),product:pi,Passengers:arrayField(mi,"Passengers",1).optional()}).strict();const yi=Oe.object({"Operation Id":stringField("Operation Id").optional(),Trips:arrayField(gi,"Trips",1),"Passenger Count":intField("Passenger Count"),"Trip Count":intField("Trip Count"),"Payment Type":Oe.string().min(1,"Payment Type is required"),Total:numberField("Total"),product:pi,Passengers:arrayField(mi,"Passengers",1).optional(),Insurance:(vi="Insurance",Oe.boolean({required_error:`${vi} is required`,invalid_type_error:`${vi} must be a boolean`})).optional(),Coupon:stringField("Coupon").optional(),"User Status":stringField("User Status").optional()}).strict();var vi;const bi=Oe.object({Arrival:Oe.string().refine(dateValidation,{message:"Invalid arrival datetime format"}),Departure:Oe.string().refine(dateValidation,{message:"Invalid departure datetime format"}),Destination:Oe.string().min(1,"Destination is required"),"Destination Terminal":Oe.string().min(1,"Destination terminal is required"),Line:Oe.string().min(1,"Line is required").optional(),Origin:Oe.string().min(1,"Origin is required"),"Origin Terminal":Oe.string().min(1,"Origin terminal is required"),Price:Oe.number().positive("Price must be a positive number"),"Result Position":Oe.number().int("Result Position must be an integer"),Route:Oe.string().min(1,"Route is required"),Stops:Oe.number().int("Stops must be an integer").nonnegative("Stops must be non-negative"),"Transport Type":Oe.string().min(1,"Transport Type is required"),Transporter:Oe.string().min(1,"Transporter is required"),product:pi,"Recommended Trip":Oe.boolean(),"Recommended Trip Type":Oe.string().optional(),"Trip Type":Oe.string().min(1,"Trip Type is required"),"Bus Type":Oe.string().min(1,"Bus Type is required")});const Si=Oe.object({"Operation Id":stringField("Operation Id").optional(),Trips:arrayField(gi,"Trips",1),"Passenger Count":intField("Passenger Count"),"Trip Count":intField("Trip Count"),Total:numberField("Total"),product:pi,Passengers:arrayField(mi,"Passengers",1).optional()}).strict();const ki=Oe.object({"Operation Id":Oe.string().min(1,"Operation Id is required"),"Payment Status":Oe.enum(["confirmed","pending_pix"]),"Payment Type":Oe.string().optional(),Total:Oe.number().optional()}).strict();const wi=Oe.object({Departure:Oe.string().refine(dateValidation,{message:"Invalid departure date or datetime format. Must include at least YYYY-MM-DD"}),"Departure Delta":Oe.number().int("Departure Delta must be an integer"),Destination:Oe.string().min(1,"Destination is required"),"Destination Terminal":Oe.string().min(1,"Destination terminal is required"),Origin:Oe.string().min(1,"Origin is required"),"Origin Terminal":Oe.string().min(1,"Origin terminal is required"),Passengers:Oe.number().int("Passenger count must be an integer"),Return:Oe.string().refine(dateValidation,{message:"Invalid Return date or datetime format. Must include at least YYYY-MM-DD"}).optional(),Route:Oe.string().min(1,"Route is required"),"Trip Length":Oe.number().positive().optional(),Categories:Oe.array(Oe.string()).optional(),product:pi});const Ii=Oe.object({Arrival:Oe.string().refine(dateValidation,{message:"Invalid arrival date or datetime format. Must include at least YYYY-MM-DD"}),Departure:Oe.string().refine(dateValidation,{message:"Invalid departure date or datetime format. Must include at least YYYY-MM-DD"}),Destination:Oe.string().min(1,"Destination is required"),"Destination Terminal":Oe.string().min(1,"Destination Terminal is required"),Line:Oe.string().min(1,"Line is required").optional(),Origin:Oe.string().min(1,"Origin is required"),"Origin Terminal":Oe.string().min(1,"Origin Terminal is required"),Price:Oe.number().positive("Price must be a positive number"),Route:Oe.string().min(1,"Route is required"),Stops:Oe.number().int("Stops must be an integer").nonnegative().optional(),Tickets:Oe.number().int("Tickets must be an integer").positive(),Transporter:Oe.string().min(1,"Transporter is required"),Way:Oe.enum(["Departure","Return"],{description:"Way must be either 'Departure' or 'Return'"}),product:pi});const Ei=Oe.object({"Bus count":Oe.number().int("Bus count must be an integer"),Departure:Oe.string().refine(dateValidation,{message:"Invalid departure datetime format"}),"Departure Delta":Oe.number().int("Departure Delta must be an integer").optional(),Destination:Oe.string().min(1,"Destination is required").optional(),"Destination Terminal":Oe.string().min(1,"Destination terminal is required").optional(),"Has Frequent Buses":Oe.boolean().default(!1).optional(),Origin:Oe.string().min(1,"Origin is required"),"Origin Terminal":Oe.string().min(1,"Origin terminal is required"),Route:Oe.string().min(1,"Route is required"),product:pi}),xi=Oe.object({mixpanelToken:Oe.string().min(1,"Mixpanel token is required"),debug:Oe.boolean().optional(),identificationKey:Oe.string().min(1,"Identification key is required"),isSandbox:Oe.boolean().optional(),mixpanelProxyUrl:Oe.string().optional(),identifyProxyUrl:Oe.string().optional(),appName:Oe.string().min(1,"App name cannot be empty").optional()}),SchemaErrorFormatter=r=>r.issues.map((r=>{let i="INVALID_FIELD",s="",a="",h="";return"invalid_type"===r.code?(i="TYPE_MISMATCH",s=r.expected,a=r.received,h=`Expected ${s} but received ${a}. Please provide a value of type ${s}.`):"too_small"===r.code?(i="VALUE_TOO_SMALL",h=`Increase the value to at least ${r.minimum}.`):"too_big"===r.code?(i="VALUE_TOO_BIG",h=`Reduce the value to no more than ${r.maximum}.`):(i="INVALID_FIELD",h="Ensure the field matches the expected format and value type."),{field:r.path.join("."),error_type:i,expected:s,received:a,message:r.message,suggestion:h}})),Ci={Search:wi,"Seat Change":Ii,"Interest In Home":hi,"Passengers Created":_i,"Payment Attempt":yi,"Interest In Search":fi,"View Results":Ei,"Purchase Attempt":Si,"Picked Departure":bi,"Geolocation Selected":di,"Purchase Confirmation Viewed":ki};function validateProps(r,i){try{i.parse(r)}catch(Ar){if(Ar instanceof ZodError){throw{message:"Schema validation failed",errors:SchemaErrorFormatter(Ar)}}throw{message:"Unknown validation error"}}}const Ti={parseEventProps:function parseEventProps(r,i){const s=Ci[r]||Me;try{s.parse(i)}catch(Ar){if(Ar instanceof ZodError){throw{message:"Schema validation failed",errors:SchemaErrorFormatter(Ar)}}throw{message:"Unknown validation error"}}},parseInitProps:function parseInitProps(r){validateProps(r,xi)},parseIdentifyProps:function parseIdentifyProps(r){validateProps(r,ui)},validateProps:validateProps};function isTrackerReady(){return ci.isReady()}let Oi=null,Ri=null;const Mi="geolocationPermissionTimestamp",Ni="geolocationCache",Pi="Geolocation Requested",Di=36e5,Ai={enableHighAccuracy:!0,timeout:1e4,maximumAge:0};function safeGetItem(r){try{return localStorage.getItem(r)}catch{return null}}function safeSetItem(r,i){try{localStorage.setItem(r,i)}catch{}}function loadCoordinatesFromStorage(){const r=safeGetItem(Ni);if(!r)return null;try{const i=JSON.parse(r);return function isGeolocationCache(r){if("object"!=typeof r||null===r)return!1;const i=r;return"number"==typeof i.lat&&"number"==typeof i.long&&"string"==typeof i.updatedAt&&(void 0===i.accuracy||"number"==typeof i.accuracy)}(i)?i:null}catch{return null}}function repairLegacyGeolocationStorage(){safeGetItem(Mi)&&(loadCoordinatesFromStorage()||function safeRemoveItem(r){try{localStorage.removeItem(r)}catch{}}(Mi))}function syncGeolocationToMixpanel(r){if(!isTrackerReady())return;const i=function buildGeolocationEventProperties(r){const i={"Geolocation Updated At":r.updatedAt,"Geolocation Status":r.status};return void 0!==r.accuracy&&(i["Geolocation Accuracy"]=r.accuracy),void 0!==r.errorCode&&(i["Geolocation Error Code"]=r.errorCode),"granted"!==r.status&&"skipped_cache"!==r.status||void 0===r.lat||void 0===r.long||(i.latitude=r.lat,i.longitude=r.long),void 0!==r.source&&(i.geolocation_source=r.source),i}(r),s=function buildGeolocationProfileProperties(r){const i={"Geolocation Updated At":r.updatedAt,"Geolocation Status":r.status};return"granted"!==r.status&&"skipped_cache"!==r.status||void 0===r.lat||void 0===r.long||(i.latitude=r.lat,i.longitude=r.long),void 0!==r.source&&(i.geolocation_source=r.source),i}(r);trackCustomEvent(Pi,i),ci.setPeopleProperties(s)}const Zi={init:function init(){return repairLegacyGeolocationStorage(),function restoreCoordinatesFromStorage(){const r=loadCoordinatesFromStorage();r&&(Oi={lat:r.lat,long:r.long},Ri="browser")}(),new Promise((r=>{var i;if(function isPermissionTimestampValid(r){return!!r&&Date.now()-parseInt(r,10)<Di}(safeGetItem(Mi))){const i=loadCoordinatesFromStorage();if(i)return syncGeolocationToMixpanel({status:"skipped_cache",updatedAt:i.updatedAt,lat:i.lat,long:i.long,accuracy:i.accuracy,source:"browser"}),void r(Oi)}const s=Date.now(),a=function toISO(r){return new Date(r).toISOString()}(s);if(!(null==(i=navigator.geolocation)?void 0:i.getCurrentPosition))return syncGeolocationToMixpanel({status:"error",updatedAt:a}),void r(null);navigator.geolocation.getCurrentPosition((i=>{const{latitude:h,longitude:f,accuracy:_}=i.coords;Oi={lat:h,long:f},Ri="browser",function saveCoordinatesToStorage(r,i,s){safeSetItem(Ni,JSON.stringify({lat:r.lat,long:r.long,updatedAt:i,...void 0!==s&&{accuracy:s}}))}(Oi,a,_),function updatePermissionTimestamp(r){safeSetItem(Mi,r.toString())}(s),syncGeolocationToMixpanel({status:"granted",updatedAt:a,lat:h,long:f,accuracy:_,source:"browser"}),r(Oi)}),(i=>{const s=function getGeolocationStatus(r){return r.code===r.PERMISSION_DENIED?"denied":"error"}(i);syncGeolocationToMixpanel({status:s,updatedAt:a,errorCode:i.code}),r(null)}),Ai)}))},getCoordinates:function getCoordinates(){return Oi},getGeolocationSource:function getGeolocationSource(){return Ri}},Li=["Search","View Results"],ji={utm_brand:"UTM Brand",utm_kxconfig:"UTM KXConfig",gad_source:"GAD Source",gclid:"GCLID"};function trackEventError(r,i,s){tryTrackEvent((async()=>{try{ci.track("Track Event Error",{"Failed Event Name":r,"Error Message":(null==i?void 0:i.message)??"Failed to track event","Validation Errors":(null==i?void 0:i.errors)||[],"Event Payload":s})}catch(a){console.error("Failed to track error event:",a)}}))}async function tryTrackEvent(r){ci.isReady()?await r():window.addEventListener("Tracker Ready",(async()=>{await r()}))}async function trackEvent(r,i,s={}){if(!ci.isReady())throw new Error("Mixpanel is not initialized.");try{Ti.parseEventProps(r,i);const a=!Li.includes(r);ci.getMixpanelDistinctId();const h=await wt.getFingerprint(a),f={},_=Zi.getCoordinates(),v=Zi.getGeolocationSource();_&&(f.latitude=_.lat,f.longitude=_.long),v&&(f.geolocation_source=v);const b={"User Fingerprint":h},S=function extractTrackingParams(){try{const r=new URLSearchParams(window.location.search),i={};return Object.entries(ji).forEach((([s,a])=>{const h=r.get(s);h&&(i[a]=h)})),i}catch(Ar){return console.error("Error extracting tracking parameters:",Ar),{}}}(),k=function flattenEventData(r){return Object.entries(r).reduce(((r,[i,s])=>Array.isArray(s)?Array.isArray(s)&&s.every((r=>"string"==typeof r||"number"==typeof r||"boolean"==typeof r))?(r[i]=s,r):(s.forEach((i=>{"object"==typeof i&&null!==i&&Object.entries(i).forEach((([i,s])=>{r[i]?r[i].push(s):r[i]=[s]}))})),r):(r[i]=s,r)),{})}(i),I={...b,...k,...S,...f,...s};ci.track(r,I)}catch(Ar){console.error(`Error tracking event '${r}':`,Ar),trackEventError(r,Ar,i)}}function trackCustomEvent(r,i={},s={}){try{Ne.parse(r),trackEvent(r,i,s)}catch(Ar){console.error("Error trackCustomEvent:",Ar),trackEventError(r,Ar,i)}}const Fi=Oe.object({email:Oe.string().email().optional(),phone:Oe.string().optional(),cpf:Oe.string().optional(),passport:Oe.string().optional(),rg:Oe.string().optional(),firstName:Oe.string().optional(),lastName:Oe.string().optional()}).refine((r=>r.email||r.phone),{message:"At least one of 'email' or 'phone' must be provided"});async function createAnonymousProfile(r){try{Ti.validateProps(r,Fi);const i=[],s=wt.getCachedFingerprint(),a=ci.getMixpanelDistinctId();s&&i.push({key:"fingerprint",value:s}),a&&i.push({key:"distinct_id",value:a});const h=function getAnonymousProfilePayload(r,i){let s="phone",a=r.phone||"";const h=[],f={};r.email&&(s="email",a=r.email);const _=["cpf","passport","rg","email","phone","salesforceid"],v=["name","firstName","lastName"];return Object.entries(r).forEach((([r,i])=>{r=function isCamelCase(r){return!(!r||r.includes(" ")||r[0]!==r[0].toLowerCase()||/[^a-zA-Z]/.test(r)||!/[A-Z]/.test(r))}(r)?r:r.toLocaleLowerCase(),_.includes(r)&&i?r!==s&&h.push({key:r,value:i}):v.includes(r)&&i&&(f[r]=i)})),i.length&&i.forEach((r=>h.push(r))),{identifier_key:s,identifier_value:a,details:f,identifiers:h}}(r,i);return await Lt.profiles.createAnonymousProfile(h)}catch(Ar){return void console.error("Could not create anonymous profile:",Ar)}}const qi=["firstName","lastName","email","phone"];Oe.object({"Operation Id":stringField("Operation Id"),Trips:arrayField(gi,"Trips",1).optional(),"Passenger Count":numberField("Passenger Count").optional(),Total:numberField("Total").optional(),"Trip Count":numberField("Trip Count").optional(),product:pi,Passengers:arrayField(mi,"Passengers",1).optional()});const $i=Oe.object({id:Oe.number(),first_name:Oe.string(),last_name:Oe.string(),second_last_name:Oe.string(),category:Oe.string(),bus_category:Oe.string(),gender:Oe.string(),email:Oe.string()}),Ui=Oe.object({passengers:Oe.array($i).min(1)});const Bi=Oe.object({category:Oe.string(),number:Oe.string().optional(),occupied:Oe.boolean().optional(),adjacent_seats:Oe.null().optional()}),zi=Oe.object({bus:Oe.array(Oe.array(Oe.array(Bi)))}),Vi=Oe.object({bus_type:Oe.string(),selected_seats:Oe.string(),bus_scheme:zi});const Wi=Oe.object({passengerId:Oe.string()}).refine((r=>r.passengerId),{message:"A 'passengerId' must be provided"});const Gi=Oe.object({category:Oe.string(),number:Oe.string().optional(),occupied:Oe.boolean().optional(),adjacent_seats:Oe.null().optional()}),Ki=Oe.object({bus:Oe.array(Oe.array(Oe.array(Gi)))}),Hi=Oe.object({bus_scheme:Ki,total_seats:Oe.number()});const Yi=Oe.object({searchId:Oe.number().min(1,"SearchId is required")});const Ji={init:async function init$1(r){Ti.parseInitProps(r);const{mixpanelToken:i,debug:s=!1,identificationKey:a,isSandbox:h=!1,mixpanelProxyUrl:f,identifyProxyUrl:_,appName:v}=r;await ci.init(i,s,f);try{await wt.initFingerprint(a,_)}catch(Ar){console.error("Error initializing identification service:",Ar)}await Zi.init(),Ut.setEnvironment(h?"sandbox":"prod"),v&&Ut.setAppName(v),Lt.setConfig(Ut.getCoreAPIConfig()),function onLoaded(){window.dispatchEvent(new CustomEvent("Tracker Ready"))}()},isReady:isTrackerReady,identify:async function identify(r,i={}){tryTrackEvent((async()=>{try{if(Ti.parseIdentifyProps(i),!r)throw console.error("User ID is required for identification."),new Error("User ID is required for identification.");const s=await createAnonymousProfile(i);s&&(i.reservamos_one_id=s.id);const a=function mapProperties(r){return{$first_name:null==r?void 0:r.firstName,$last_name:null==r?void 0:r.lastName,$email:null==r?void 0:r.email,$phone:null==r?void 0:r.phone,...Object.keys(r).reduce(((i,s)=>(qi.includes(s)||(i[s]=r[s]),i)),{})}}(i);ci.identify(r,a);const h=await wt.getFingerprint();h&&ci.attachProperty("Known Fingerprints",h)}catch(Ar){console.error("Error identifying user",Ar),trackEventError("Identify",Ar,{userId:r,properties:i})}finally{(async(r,i)=>{var s,a,h;try{const f=Zi.getCoordinates();if(!f)return;i.first_name=i.firstName,i.last_name=i.lastName,i.latitude=f.lat,i.longitude=f.long,i.ip="0",i.name=`${i.firstName} ${i.lastName}`,delete i.firstName,delete i.lastName;const _=Ut.getCoreAPIConfig();fetch(`${_.baseUrl}/v1/datalake/identify`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:(null==(s=_.defaultHeaders)?void 0:s.Authorization)||"",Origin:(null==(a=_.defaultHeaders)?void 0:a.Origin)||"",...(null==(h=_.defaultHeaders)?void 0:h["x-app-name"])?{"x-app-name":_.defaultHeaders["x-app-name"]}:{}},body:JSON.stringify({profile_params:{...i,distinct_id:r}})})}catch(Ar){console.error("Error identifying user-service",Ar)}})(r,i)}}))},identifiers:{getFingerprintId:wt.getCachedFingerprint,getDistinctId:ci.getMixpanelDistinctId},profiles:{createAnonymousProfile:createAnonymousProfile},recommendations:{getRecommendedPlaces:async function getRecommendedPlaces(){const r=ci.getMixpanelDistinctId();if(!r)throw new Error("No distinct ID found");const i=await Lt.recommendations.createRecommendedPlaces({distinct_id:r});if(!i)throw new Error("No response received");return await(async r=>new Promise(((i,s)=>{const{state:a,polling_id:h}=r;"finished"!==a?Lt.recommendations.pollRecommendedPlaces(h,{start:!0,watch:"state",expect:"finished",onEachResponse:r=>{"finished"!==r.status?"failed"!==r.status||s(r):i(r)}}):i(r)})))(i)},createRecommendedSeats:async function createRecommendedSeats$1(r){try{Ti.validateProps(r,Vi);const i=ci.getMixpanelDistinctId(),s=wt.getCachedFingerprint();if(!i)throw new Error("No distinct ID found");return await Lt.recommendations.createRecommendedSeats({...r,distinct_id:i,device_fingerprint:s||""})}catch(Ar){throw console.error("Could not create recommended seats:",Ar),new Error(Ar instanceof Error?Ar.message:String(Ar))}},getRecommendedSeats:async function createRecommendedSeats(r){try{Ti.validateProps(r,Hi);const i=ci.getMixpanelDistinctId();if(!i)throw new Error("No distinct ID found");return await Lt.recommendations.getRecommendedSeats({...r,distinct_id:i})}catch(Ar){throw console.error("Could not create recommended seats:",Ar),new Error(Ar instanceof Error?Ar.message:String(Ar))}},getRecommendedTrips:async function getRecommendedTrips({searchId:r}){try{Ti.validateProps({searchId:r},Yi);const i=wt.getCachedFingerprint()||ci.getMixpanelDistinctId();if(!i)throw new Error("No identifier id");return await Lt.recommendations.getRecommendedTrips({searchId:r,userIdentifier:String(i)})}catch(Ar){throw console.error("Could not get recommended trips:",Ar),new Error(Ar instanceof Error?Ar.message:String(Ar))}},createFrequentPassengers:async function createFrequentPassengers(r){try{Ti.validateProps(r,Ui);const i=ci.getMixpanelDistinctId(),s=wt.getCachedFingerprint();if(!i)throw new Error("No distinct ID found");return await Lt.recommendations.createFrequentPassengers({...r,distinct_id:i,device_fingerprint:s||""})}catch(Ar){throw new Error(Ar instanceof Error?Ar.message:String(Ar))}},getFrequentPassengers:async function getFrequentPassengers(){try{const r=ci.getMixpanelDistinctId();if(!r)throw new Error("No distinct ID found");return await Lt.recommendations.getFrequentPassengers(r)}catch(Ar){throw new Error(Ar instanceof Error?Ar.message:String(Ar))}},deleteFrequentPassenger:async function deleteFrequentPassengers(r){try{Ti.validateProps(r,Wi);const i=ci.getMixpanelDistinctId();if(!i)throw new Error("No distinct ID found");return await Lt.recommendations.deleteFrequentPassenger(i,r.passengerId)}catch(Ar){throw new Error(Ar instanceof Error?Ar.message:String(Ar))}}},track:{search:function trackSearch(r,i={}){trackEvent("Search",r,i)},seatChange:function trackSeatChange(r,i={}){trackEvent("Seat Change",r,i)},interestInHome:function trackInterestInHome(r,i={}){trackEvent("Interest In Home",r,i)},interestInSearch:function trackInterestInSearch(r,i={}){trackEvent("Interest In Search",r,i)},viewResults:function trackViewResults(r,i={}){trackEvent("View Results",r,i)},passengersCreated:function trackPassengersCreated(r,i={}){trackEvent("Passengers Created",r,i)},paymentAttempt:async(r,i={})=>{trackEvent("Payment Attempt",r,i)},purchaseAttempt:function trackPurchaseAttempt(r,i={}){trackEvent("Purchase Attempt",r,i)},pickedDeparture:function trackSearch$1(r,i={}){trackEvent("Picked Departure",r,i)},customEvent:trackCustomEvent,purchaseCanceled:function trackPurchaseCanceled(r,i={}){trackEvent("Purchase Canceled",r,i)},geolocationSelected:function trackGeolocationSelected(r,i={}){trackEvent("Geolocation Selected",r,i),ci.setPeopleProperties(r)},purchaseConfirmation:function trackPurchaseConfirmation(r,i={}){trackEvent("Purchase Confirmation Viewed",r,i)}}};module.exports=Ji;
|
|
31
31
|
//# sourceMappingURL=browser-analytics.cjs.map
|