forked from mixpanel/mixpanel-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mixpanel.min.js
103 lines (103 loc) · 50.5 KB
/
mixpanel.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
(function() {
var k=void 0,l=!0,r=null,G=!1;
(function(){function Ba(){function a(){if(!a.qc)na=a.qc=l,oa=G,c.a(H,function(a){a.dc()})}function b(){try{u.documentElement.doScroll("left")}catch(d){setTimeout(b,1);return}a()}if(u.addEventListener)"complete"===u.readyState?a():u.addEventListener("DOMContentLoaded",a,G);else if(u.attachEvent){u.attachEvent("onreadystatechange",a);var d=G;try{d=A.frameElement===r}catch(m){}u.documentElement.doScroll&&d&&b()}c.Gb(A,"load",a,l)}function Ca(){v.init=function(a,b,d){if(d)return v[d]||(v[d]=H[d]=V(a,
b,d),v[d].da()),v[d];d=v;if(H.mixpanel)d=H.mixpanel;else if(a)d=V(a,b,"mixpanel"),d.da(),H.mixpanel=d;v=d;1===da&&(A.mixpanel=v);Da()}}function Da(){c.a(H,function(a,b){"mixpanel"!==b&&(v[b]=a)});v._=c}function ea(a){a=c.e(a)?a:c.g(a)?{}:{days:a};return c.extend({},Ea,a)}function V(a,b,d){var m,f="mixpanel"===d?v:v[d];if(f&&0===da)m=f;else{if(f&&!c.isArray(f)){s.error("You have already initialized "+d);return}m=new e}m.Ya={};m.R(a,b,d);m.people=new j;m.people.R(m);K=K||m.c("debug");!c.g(f)&&c.isArray(f)&&
(m.ua.call(m.people,f.people),m.ua(f));return m}function e(){}function P(){}function Fa(a){return a}function n(a){this.props={};this.gb=G;this.name=a.persistence_name?"mp_"+a.persistence_name:"mp_"+a.token+"_mixpanel";var b=a.persistence;if("cookie"!==b&&"localStorage"!==b)s.F("Unknown persistence type "+b+"; falling back to cookie"),b=a.persistence="cookie";this.h="localStorage"===b&&c.localStorage.la()?c.localStorage:c.cookie;this.load();this.Zb(a);this.kd(a);this.save()}function j(){}function w(){}
function D(a,b){this.G=b.G;this.W=new I(a,{G:c.bind(this.j,this),h:b.h});this.A=b.A;this.Nc=b.Oc;this.ea=b.ea;this.Xc=b.Yc;this.S=this.A.batch_size;this.ia=this.A.batch_flush_interval_ms;this.oa=!this.A.batch_autostart;this.Ea=0}function pa(a,b){var d=[];c.a(a,function(a){var c=a.id;if(c in b){if(c=b[c],c!==r)a.payload=c,d.push(a)}else d.push(a)});return d}function qa(a,b){var d=[];c.a(a,function(a){a.id&&!b[a.id]&&d.push(a)});return d}function I(a,b){b=b||{};this.I=a;this.h=b.h||window.localStorage;
this.j=b.G||c.bind(ra.error,ra);this.Oa=new sa(a,{h:this.h});this.ma=b.ma||r;this.D=[]}function sa(a,b){b=b||{};this.I=a;this.h=b.h||window.localStorage;this.Eb=b.Eb||100;this.Tb=b.Tb||2E3}function W(){this.Bb="submit"}function M(){this.Bb="click"}function E(){}function ta(a){var b=Ga,d=a.split("."),d=d[d.length-1];if(4<d.length||"com"===d||"org"===d)b=Ha;return(a=a.match(b))?a[0]:""}function fa(a){var b=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return a?
b.substring(0,a):b}function X(a,b){if(ga!==r&&!b)return ga;var d=l;try{var a=a||window.localStorage,c="__mplss_"+fa(8);a.setItem(c,"xyz");"xyz"!==a.getItem(c)&&(d=G);a.removeItem(c)}catch(f){d=G}return ga=d}function ha(a){return{log:ia(s.log,a),error:ia(s.error,a),F:ia(s.F,a)}}function ia(a,b){return function(){arguments[0]="["+b+"] "+arguments[0];return a.apply(s,arguments)}}function Ia(a,b){ua(l,a,b)}function Ja(a,b){ua(G,a,b)}function Ka(a,b){return"1"===Y(b).get(Z(a,b))}function va(a,b){if(La(b))return s.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"'),
l;var d="0"===Y(b).get(Z(a,b));d&&s.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data.");return d}function Q(a){return ja(a,function(a){return this.c(a)})}function J(a){return ja(a,function(a){return this.v(a)})}function N(a){return ja(a,function(a){return this.v(a)})}function Ma(a,b){b=b||{};Y(b).remove(Z(a,b),!!b.lb,b.jb)}function Y(a){a=a||{};return"localStorage"===a.Db?c.localStorage:c.cookie}function Z(a,b){b=b||{};return(b.Cb||Na)+a}function La(a){if(a&&
a.sb)return G;var a=a&&a.window||A,b=a.navigator||{},d=G;c.a([b.doNotTrack,b.msDoNotTrack,a.doNotTrack],function(a){c.i([l,1,"1","yes"],a)&&(d=l)});return d}function ua(a,b,d){!c.Na(b)||!b.length?s.error("gdpr."+(a?"optIn":"optOut")+" called with an invalid token"):(d=d||{},Y(d).set(Z(b,d),a?1:0,c.xb(d.kb)?d.kb:r,!!d.lb,!!d.Mc,!!d.nc,d.jb),d.m&&a&&d.m(d.ad||"$opt_in",d.bd,{send_immediately:l}))}function ja(a,b){return function(){var d=G;try{var c=b.call(this,"token"),f=b.call(this,"ignore_dnt"),g=
b.call(this,"opt_out_tracking_persistence_type"),o=b.call(this,"opt_out_tracking_cookie_prefix"),h=b.call(this,"window");c&&(d=va(c,{sb:f,Db:g,Cb:o,window:h}))}catch(e){s.error("Unexpected error when checking tracking opt-out status: "+e)}if(!d)return a.apply(this,arguments);d=arguments[arguments.length-1];"function"===typeof d&&d(0)}}var K=G,A;if("undefined"===typeof window){var C={hostname:""};A={navigator:{userAgent:""},document:{location:C,referrer:""},screen:{width:0,height:0},location:C}}else A=
window;var C=Array.prototype,wa=Object.prototype,L=C.slice,R=wa.toString,$=wa.hasOwnProperty,y=A.console,F=A.navigator,u=A.document,S=A.opera,aa=A.screen,z=F.userAgent,ka=Function.prototype.bind,xa=C.forEach,ya=C.indexOf,za=C.map,C=Array.isArray,la={},c={trim:function(a){return a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},s={log:function(){if(K&&!c.g(y)&&y)try{y.log.apply(y,arguments)}catch(a){c.a(arguments,function(a){y.log(a)})}},warn:function(){if(K&&!c.g(y)&&y){var a=["Mixpanel warning:"].concat(c.J(arguments));
try{y.warn.apply(y,a)}catch(b){c.a(a,function(a){y.warn(a)})}}},error:function(){if(K&&!c.g(y)&&y){var a=["Mixpanel error:"].concat(c.J(arguments));try{y.error.apply(y,a)}catch(b){c.a(a,function(a){y.error(a)})}}},F:function(){if(!c.g(y)&&y){var a=["Mixpanel error:"].concat(c.J(arguments));try{y.error.apply(y,a)}catch(b){c.a(a,function(a){y.error(a)})}}}};c.bind=function(a,b){var d,m;if(ka&&a.bind===ka)return ka.apply(a,L.call(arguments,1));if(!c.Ma(a))throw new TypeError;d=L.call(arguments,2);return m=
function(){if(!(this instanceof m))return a.apply(b,d.concat(L.call(arguments)));var c={};c.prototype=a.prototype;var g=new c;c.prototype=r;c=a.apply(g,d.concat(L.call(arguments)));return Object(c)===c?c:g}};c.a=function(a,b,d){if(!(a===r||a===k))if(xa&&a.forEach===xa)a.forEach(b,d);else if(a.length===+a.length)for(var c=0,f=a.length;c<f&&!(c in a&&b.call(d,a[c],c,a)===la);c++);else for(c in a)if($.call(a,c)&&b.call(d,a[c],c,a)===la)break};c.extend=function(a){c.a(L.call(arguments,1),function(b){for(var d in b)b[d]!==
k&&(a[d]=b[d])});return a};c.isArray=C||function(a){return"[object Array]"===R.call(a)};c.Ma=function(a){try{return/^\s*\bfunction\b/.test(a)}catch(b){return G}};c.zc=function(a){return!(!a||!$.call(a,"callee"))};c.J=function(a){return!a?[]:a.J?a.J():c.isArray(a)||c.zc(a)?L.call(a):c.md(a)};c.map=function(a,b,d){if(za&&a.map===za)return a.map(b,d);var m=[];c.a(a,function(a){m.push(b.call(d,a))});return m};c.keys=function(a){var b=[];if(a===r)return b;c.a(a,function(a,c){b[b.length]=c});return b};
c.md=function(a){var b=[];if(a===r)return b;c.a(a,function(a){b[b.length]=a});return b};c.tb=function(a,b){var d=G;if(a===r)return d;if(ya&&a.indexOf===ya)return-1!=a.indexOf(b);c.a(a,function(a){if(d||(d=a===b))return la});return d};c.i=function(a,b){return-1!==a.indexOf(b)};c.vb=function(a,b){a.prototype=new b;a.Zc=b.prototype};c.e=function(a){return a===Object(a)&&!c.isArray(a)};c.ka=function(a){if(c.e(a)){for(var b in a)if($.call(a,b))return G;return l}return G};c.g=function(a){return a===k};
c.Na=function(a){return"[object String]"==R.call(a)};c.Ac=function(a){return"[object Date]"==R.call(a)};c.xb=function(a){return"[object Number]"==R.call(a)};c.Bc=function(a){return!!(a&&1===a.nodeType)};c.Ga=function(a){c.a(a,function(b,d){c.Ac(b)?a[d]=c.sc(b):c.e(b)&&(a[d]=c.Ga(b))});return a};c.timestamp=function(){Date.now=Date.now||function(){return+new Date};return Date.now()};c.sc=function(a){function b(a){return 10>a?"0"+a:a}return a.getUTCFullYear()+"-"+b(a.getUTCMonth()+1)+"-"+b(a.getUTCDate())+
"T"+b(a.getUTCHours())+":"+b(a.getUTCMinutes())+":"+b(a.getUTCSeconds())};c.pa=function(a){var b={};c.a(a,function(a,m){c.Na(a)&&0<a.length&&(b[m]=a)});return b};c.truncate=function(a,b){var d;"string"===typeof a?d=a.slice(0,b):c.isArray(a)?(d=[],c.a(a,function(a){d.push(c.truncate(a,b))})):c.e(a)?(d={},c.a(a,function(a,f){d[f]=c.truncate(a,b)})):d=a;return d};c.aa=function(){return function(a){function b(a,c){var g="",o=0,h=o="",h=0,e=g,p=[],t=c[a];t&&"object"===typeof t&&"function"===typeof t.toJSON&&
(t=t.toJSON(a));switch(typeof t){case "string":return d(t);case "number":return isFinite(t)?""+t:"null";case "boolean":case "null":return""+t;case "object":if(!t)return"null";g+=" ";p=[];if("[object Array]"===R.apply(t)){h=t.length;for(o=0;o<h;o+=1)p[o]=b(o,t)||"null";return h=0===p.length?"[]":g?"[\n"+g+p.join(",\n"+g)+"\n"+e+"]":"["+p.join(",")+"]"}for(o in t)$.call(t,o)&&(h=b(o,t))&&p.push(d(o)+(g?": ":":")+h);return h=0===p.length?"{}":g?"{"+p.join(",")+""+e+"}":"{"+p.join(",")+"}"}}function d(a){var b=
/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,d={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};b.lastIndex=0;return b.test(a)?'"'+a.replace(b,function(a){var b=d[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}return b("",{"":a})}}();c.M=function(){function a(){switch(h){case "t":return f("t"),f("r"),f("u"),f("e"),l;case "f":return f("f"),
f("a"),f("l"),f("s"),f("e"),G;case "n":return f("n"),f("u"),f("l"),f("l"),r}g('Unexpected "'+h+'"')}function b(){for(;h&&" ">=h;)f()}function d(){var a,b,d="",c;if('"'===h)for(;f();){if('"'===h)return f(),d;if("\\"===h)if(f(),"u"===h){for(b=c=0;4>b;b+=1){a=parseInt(f(),16);if(!isFinite(a))break;c=16*c+a}d+=String.fromCharCode(c)}else if("string"===typeof e[h])d+=e[h];else break;else d+=h}g("Bad string")}function c(){var a;a="";"-"===h&&(a="-",f("-"));for(;"0"<=h&&"9">=h;)a+=h,f();if("."===h)for(a+=
".";f()&&"0"<=h&&"9">=h;)a+=h;if("e"===h||"E"===h){a+=h;f();if("-"===h||"+"===h)a+=h,f();for(;"0"<=h&&"9">=h;)a+=h,f()}a=+a;if(isFinite(a))return a;g("Bad number")}function f(a){a&&a!==h&&g("Expected '"+a+"' instead of '"+h+"'");h=p.charAt(o);o+=1;return h}function g(a){a=new SyntaxError(a);a.nd=o;a.text=p;throw a;}var o,h,e={'"':'"',"\\":"\\","/":"/",b:"\u0008",f:"\u000c",n:"\n",r:"\r",t:"\t"},p,t;t=function(){b();switch(h){case "{":var e;a:{var o,i={};if("{"===h){f("{");b();if("}"===h){f("}");e=
i;break a}for(;h;){o=d();b();f(":");Object.hasOwnProperty.call(i,o)&&g('Duplicate key "'+o+'"');i[o]=t();b();if("}"===h){f("}");e=i;break a}f(",");b()}}g("Bad object")}return e;case "[":a:{e=[];if("["===h){f("[");b();if("]"===h){f("]");o=e;break a}for(;h;){e.push(t());b();if("]"===h){f("]");o=e;break a}f(",");b()}}g("Bad array")}return o;case '"':return d();case "-":return c();default:return"0"<=h&&"9">=h?c():a()}};return function(a){p=a;o=0;h=" ";a=t();b();h&&g("Syntax error");return a}}();c.kc=
function(a){var b,d,m,f,g=0,e=0,h="",h=[];if(!a)return a;a=c.ld(a);do b=a.charCodeAt(g++),d=a.charCodeAt(g++),m=a.charCodeAt(g++),f=b<<16|d<<8|m,b=f>>18&63,d=f>>12&63,m=f>>6&63,f&=63,h[e++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(m)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f);
while(g<a.length);h=h.join("");switch(a.length%3){case 1:h=h.slice(0,-2)+"==";break;case 2:h=h.slice(0,-1)+"="}return h};c.ld=function(a){var a=(a+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n"),b="",d,c,f=0,g;d=c=0;f=a.length;for(g=0;g<f;g++){var e=a.charCodeAt(g),h=r;128>e?c++:h=127<e&&2048>e?String.fromCharCode(e>>6|192,e&63|128):String.fromCharCode(e>>12|224,e>>6&63|128,e&63|128);h!==r&&(c>d&&(b+=a.substring(d,c)),b+=h,d=c=g+1)}c>d&&(b+=a.substring(d,a.length));return b};c.Xa=function(){function a(){function a(b,
d){var c,f=0;for(c=0;c<d.length;c++)f|=g[c]<<8*c;return b^f}var b,c,g=[],e=0;for(b=0;b<z.length;b++)c=z.charCodeAt(b),g.unshift(c&255),4<=g.length&&(e=a(e,g),g=[]);0<g.length&&(e=a(e,g));return e.toString(16)}function b(){for(var a=1*new Date,b=0;a==1*new Date;)b++;return a.toString(16)+b.toString(16)}return function(){var d=(aa.height*aa.width).toString(16);return b()+"-"+Math.random().toString(16).replace(".","")+"-"+a()+"-"+d+"-"+b()}}();var Aa="ahrefsbot,baiduspider,bingbot,bingpreview,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".split(",");
c.wb=function(a){var b,a=a.toLowerCase();for(b=0;b<Aa.length;b++)if(-1!==a.indexOf(Aa[b]))return l;return G};c.bc=function(a){var b,d,m,f=[];c.g(b)&&(b="&");c.a(a,function(a,b){d=encodeURIComponent(a.toString());m=encodeURIComponent(b);f[f.length]=m+"="+d});return f.join(b)};c.qb=function(a,b){var b=b.replace(/[[]/,"\\[").replace(/[\]]/,"\\]"),d=RegExp("[\\?&]"+b+"=([^&#]*)").exec(a);if(d===r||d&&"string"!==typeof d[1]&&d[1].length)return"";d=d[1];try{d=decodeURIComponent(d)}catch(c){s.error("Skipping decoding for malformed query param: "+
d)}return d.replace(/\+/g," ")};c.cookie={get:function(a){for(var a=a+"=",b=u.cookie.split(";"),d=0;d<b.length;d++){for(var c=b[d];" "==c.charAt(0);)c=c.substring(1,c.length);if(0===c.indexOf(a))return decodeURIComponent(c.substring(a.length,c.length))}return r},parse:function(a){var b;try{b=c.M(c.cookie.get(a))||{}}catch(d){}return b},qd:function(a,b,c,m,f,g,e){var h="",i="",p="";e?h="; domain="+e:m&&(h=(h=ta(u.location.hostname))?"; domain=."+h:"");c&&(i=new Date,i.setTime(i.getTime()+1E3*c),i=
"; expires="+i.toGMTString());g&&(f=l,p="; SameSite=None");f&&(p+="; secure");u.cookie=a+"="+encodeURIComponent(b)+i+"; path=/"+h+p},set:function(a,b,c,m,f,g,e){var h="",i="",p="";e?h="; domain="+e:m&&(h=(h=ta(u.location.hostname))?"; domain=."+h:"");c&&(i=new Date,i.setTime(i.getTime()+864E5*c),i="; expires="+i.toGMTString());g&&(f=l,p="; SameSite=None");f&&(p+="; secure");a=a+"="+encodeURIComponent(b)+i+"; path=/"+h+p;return u.cookie=a},remove:function(a,b,d){c.cookie.set(a,"",-1,b,G,G,d)}};var ga=
r;c.localStorage={la:function(a){(a=X(r,a))||s.error("localStorage unsupported; falling back to cookie store");return a},error:function(a){s.error("localStorage error: "+a)},get:function(a){try{return window.localStorage.getItem(a)}catch(b){c.localStorage.error(b)}return r},parse:function(a){try{return c.M(c.localStorage.get(a))||{}}catch(b){}return r},set:function(a,b){try{window.localStorage.setItem(a,b)}catch(d){c.localStorage.error(d)}},remove:function(a){try{window.localStorage.removeItem(a)}catch(b){c.localStorage.error(b)}}};
c.Gb=function(){function a(a,m,f){return function(g){if(g=g||b(window.event)){var e=l,h;c.Ma(f)&&(h=f(g));g=m.call(a,g);if(G===h||G===g)e=G;return e}}}function b(a){if(a)a.preventDefault=b.preventDefault,a.stopPropagation=b.stopPropagation;return a}b.preventDefault=function(){this.returnValue=G};b.stopPropagation=function(){this.cancelBubble=l};return function(b,c,f,g,e){b?b.addEventListener&&!g?b.addEventListener(c,f,!!e):(c="on"+c,b[c]=a(b,f,b[c])):s.error("No valid element provided to register_event")}}();
var Oa=/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/;c.pc=function(){function a(a,b){return 0<=(" "+a.className+" ").replace(d," ").indexOf(" "+b+" ")}function b(b){if(!u.getElementsByTagName)return[];var b=b.split(" "),d,g,e,h,i,p,t,x=[u];for(h=0;h<b.length;h++)if(d=b[h].replace(/^\s+/,"").replace(/\s+$/,""),-1<d.indexOf("#")){g=d.split("#");d=g[0];x=u.getElementById(g[1]);if(!x||d&&x.nodeName.toLowerCase()!=d)return[];x=[x]}else if(-1<d.indexOf(".")){g=d.split(".");d=g[0];var B=g[1];d||(d="*");
g=[];for(i=e=0;i<x.length;i++){t="*"==d?x[i].all?x[i].all:x[i].getElementsByTagName("*"):x[i].getElementsByTagName(d);for(p=0;p<t.length;p++)g[e++]=t[p]}x=[];for(i=d=0;i<g.length;i++)g[i].className&&c.Na(g[i].className)&&a(g[i],B)&&(x[d++]=g[i])}else if(g=d.match(Oa)){d=g[1];var q=g[2],B=g[3],j=g[4];d||(d="*");g=[];for(i=e=0;i<x.length;i++){t="*"==d?x[i].all?x[i].all:x[i].getElementsByTagName("*"):x[i].getElementsByTagName(d);for(p=0;p<t.length;p++)g[e++]=t[p]}x=[];d=0;switch(B){case "=":B=function(a){return a.getAttribute(q)==
j};break;case "~":B=function(a){return a.getAttribute(q).match(RegExp("\\b"+j+"\\b"))};break;case "|":B=function(a){return a.getAttribute(q).match(RegExp("^"+j+"-?"))};break;case "^":B=function(a){return 0===a.getAttribute(q).indexOf(j)};break;case "$":B=function(a){return a.getAttribute(q).lastIndexOf(j)==a.getAttribute(q).length-j.length};break;case "*":B=function(a){return-1<a.getAttribute(q).indexOf(j)};break;default:B=function(a){return a.getAttribute(q)}}x=[];for(i=d=0;i<g.length;i++)B(g[i])&&
(x[d++]=g[i])}else{g=[];for(i=e=0;i<x.length;i++){t=x[i].getElementsByTagName(d);for(p=0;p<t.length;p++)g[e++]=t[p]}x=g}return x}var d=/[\t\r\n]/g;return function(a){return c.Bc(a)?[a]:c.e(a)&&!c.g(a.length)?a:b.call(this,a)}}();c.info={mc:function(){var a="",b={};c.a("utm_source utm_medium utm_campaign utm_content utm_term".split(" "),function(d){a=c.qb(u.URL,d);a.length&&(b[d]=a)});return b},Kc:function(a){return 0===a.search("https?://(.*)google.([^/?]*)")?"google":0===a.search("https?://(.*)bing.com")?
"bing":0===a.search("https?://(.*)yahoo.com")?"yahoo":0===a.search("https?://(.*)duckduckgo.com")?"duckduckgo":r},Lc:function(a){var b=c.info.Kc(a),d={};if(b!==r)d.$search_engine=b,a=c.qb(a,"yahoo"!=b?"q":"p"),a.length&&(d.mp_keyword=a);return d},T:function(a,b,d){return d||c.i(a," OPR/")?c.i(a,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(a)?"BlackBerry":c.i(a,"IEMobile")||c.i(a,"WPDesktop")?"Internet Explorer Mobile":c.i(a,"SamsungBrowser/")?"Samsung Internet":c.i(a,"Edge")||c.i(a,
"Edg/")?"Microsoft Edge":c.i(a,"FBIOS")?"Facebook Mobile":c.i(a,"Chrome")?"Chrome":c.i(a,"CriOS")?"Chrome iOS":c.i(a,"UCWEB")||c.i(a,"UCBrowser")?"UC Browser":c.i(a,"FxiOS")?"Firefox iOS":c.i(b||"","Apple")?c.i(a,"Mobile")?"Mobile Safari":"Safari":c.i(a,"Android")?"Android Mobile":c.i(a,"Konqueror")?"Konqueror":c.i(a,"Firefox")?"Firefox":c.i(a,"MSIE")||c.i(a,"Trident/")?"Internet Explorer":c.i(a,"Gecko")?"Mozilla":""},Da:function(a,b,d){b={"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+)?)/}[c.info.T(a,b,d)];if(b===k)return r;a=a.match(b);return!a?r:parseFloat(a[a.length-2])},Qa:function(){return/Windows/i.test(z)?/Phone/.test(z)||/WPDesktop/.test(z)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(z)?"iOS":/Android/.test(z)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(z)?"BlackBerry":/Mac/i.test(z)?"Mac OS X":/Linux/.test(z)?"Linux":/CrOS/.test(z)?"Chrome OS":""},pb:function(a){return/Windows Phone/i.test(a)||/WPDesktop/.test(a)?"Windows Phone":/iPad/.test(a)?
"iPad":/iPod/.test(a)?"iPod Touch":/iPhone/.test(a)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(a)?"BlackBerry":/Android/.test(a)?"Android":""},Fb:function(a){a=a.split("/");return 3<=a.length?a[2]:""},V:function(){return c.extend(c.pa({$os:c.info.Qa(),$browser:c.info.T(z,F.vendor,S),$referrer:u.referrer,$referring_domain:c.info.Fb(u.referrer),$device:c.info.pb(z)}),{$current_url:A.location.href,$browser_version:c.info.Da(z,F.vendor,S),$screen_height:aa.height,$screen_width:aa.width,mp_lib:"web",
$lib_version:"2.45.0",$insert_id:fa(),time:c.timestamp()/1E3})},Gc:function(){return c.extend(c.pa({$os:c.info.Qa(),$browser:c.info.T(z,F.vendor,S)}),{$browser_version:c.info.Da(z,F.vendor,S)})},Ec:function(a){return c.pa({mp_page:a,mp_referrer:u.referrer,mp_browser:c.info.T(z,F.vendor,S),mp_platform:c.info.Qa()})}};var Ha=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Ga=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,ba=r,ca=r;if("undefined"!==typeof JSON)ba=JSON.stringify,ca=JSON.parse;ba=ba||c.aa;ca=ca||c.M;c.toArray=c.J;
c.isObject=c.e;c.JSONEncode=c.aa;c.JSONDecode=c.M;c.isBlockedUA=c.wb;c.isEmptyObject=c.ka;c.info=c.info;c.info.device=c.info.pb;c.info.browser=c.info.T;c.info.browserVersion=c.info.Da;c.info.properties=c.info.V;E.prototype.ga=function(){};E.prototype.Ia=function(){};E.prototype.Ba=function(){};E.prototype.La=function(a){this.yb=a;return this};E.prototype.m=function(a,b,d,m){var f=this,g=c.pc(a);if(0===g.length)s.error("The DOM query ("+a+") returned 0 elements");else return c.a(g,function(a){c.Gb(a,
this.Bb,function(a){var c={},g=f.ga(d,this),e=f.yb.c("track_links_timeout");f.Ia(a,this,c);window.setTimeout(f.Vb(m,g,c,l),e);f.yb.m(b,g,f.Vb(m,g,c))})},this),l};E.prototype.Vb=function(a,b,c,m){var m=m||G,f=this;return function(){if(!c.lc)c.lc=l,a&&a(m,b)===G||f.Ba(b,c,m)}};E.prototype.ga=function(a,b){return"function"===typeof a?a(b):c.extend({},a)};c.vb(M,E);M.prototype.ga=function(a,b){var c=M.Zc.ga.apply(this,arguments);if(b.href)c.url=b.href;return c};M.prototype.Ia=function(a,b,c){c.zb=2===
a.which||a.metaKey||a.ctrlKey||"_blank"===b.target;c.href=b.href;c.zb||a.preventDefault()};M.prototype.Ba=function(a,b){b.zb||setTimeout(function(){window.location=b.href},0)};c.vb(W,E);W.prototype.Ia=function(a,b,c){c.element=b;a.preventDefault()};W.prototype.Ba=function(a,b){setTimeout(function(){b.element.submit()},0)};var Pa=ha("lock");sa.prototype.Wa=function(a,b,c){function m(){q.setItem(s,"1");try{a()}finally{q.removeItem(s),q.getItem(n)===i&&q.removeItem(n),q.getItem(j)===i&&q.removeItem(j)}}
function f(){q.setItem(j,i);e(g,function(){q.getItem(j)===i?m():h(function(){q.getItem(n)!==i?f():e(function(){return!q.getItem(s)},m)})})}function g(){var a=q.getItem(n);if(a&&a!==i)return G;q.setItem(n,i);if(q.getItem(n)===i)return l;if(!X(q,l))throw Error("localStorage support dropped while acquiring lock");return G}function e(a,b){a()?b():h(function(){e(a,b)})}function h(a){(new Date).getTime()-p>B?(Pa.error("Timeout waiting for mutex on "+t+"; clearing lock. ["+i+"]"),q.removeItem(s),q.removeItem(n),
f()):setTimeout(function(){try{a()}catch(c){b&&b(c)}},x*(Math.random()+0.1))}!c&&"function"!==typeof b&&(c=b,b=r);var i=c||(new Date).getTime()+"|"+Math.random(),p=(new Date).getTime(),t=this.I,x=this.Eb,B=this.Tb,q=this.h,j=t+":X",n=t+":Y",s=t+":Z";try{if(X(q,l))f();else throw Error("localStorage support check failed");}catch(u){b&&b(u)}};var ra=ha("batch");I.prototype.Ha=function(a,b,d){var m={id:fa(),flushAfter:(new Date).getTime()+2*b,payload:a};this.Oa.Wa(c.bind(function(){var b;try{var c=this.X();
c.push(m);(b=this.Sa(c))&&this.D.push(m)}catch(e){this.j("Error enqueueing item",a),b=G}d&&d(b)},this),c.bind(function(a){this.j("Error acquiring storage lock",a);d&&d(G)},this),this.ma)};I.prototype.rc=function(a){var b=this.D.slice(0,a);if(b.length<a){var d=this.X();if(d.length){var m={};c.a(b,function(a){m[a.id]=l});for(var f=0;f<d.length;f++){var g=d[f];if((new Date).getTime()>g.flushAfter&&!m[g.id]&&(g.Dc=l,b.push(g),b.length>=a))break}}}return b};I.prototype.Hc=function(a,b){var d={};c.a(a,
function(a){d[a]=l});this.D=qa(this.D,d);var m=c.bind(function(){var b;try{var c=this.X(),c=qa(c,d);if(b=this.Sa(c))for(var c=this.X(),m=0;m<c.length;m++){var e=c[m];if(e.id&&d[e.id])return this.j("Item not removed from storage"),G}}catch(i){this.j("Error removing items",a),b=G}return b},this);this.Oa.Wa(function(){var a=m();b&&b(a)},c.bind(function(a){var c=G;this.j("Error acquiring storage lock",a);if(!X(this.h,l)&&(c=m(),!c))try{this.h.removeItem(this.I)}catch(d){this.j("Error clearing queue",
d)}b&&b(c)},this),this.ma)};I.prototype.hd=function(a){this.D=pa(this.D,a);this.Oa.Wa(c.bind(function(){try{var b=this.X(),b=pa(b,a);this.Sa(b)}catch(c){this.j("Error updating items",a)}},this),c.bind(function(a){this.j("Error acquiring storage lock",a)},this),this.ma)};I.prototype.X=function(){var a;try{if(a=this.h.getItem(this.I))a=ca(a),c.isArray(a)||(this.j("Invalid storage entry:",a),a=r)}catch(b){this.j("Error retrieving queue",b),a=r}return a||[]};I.prototype.Sa=function(a){try{return this.h.setItem(this.I,
ba(a)),l}catch(b){return this.j("Error saving queue",b),G}};I.prototype.clear=function(){this.D=[];this.h.removeItem(this.I)};var T=ha("batch");D.prototype.Ha=function(a,b){this.W.Ha(a,this.ia,b)};D.prototype.start=function(){this.oa=G;this.Ea=0;this.flush()};D.prototype.stop=function(){this.oa=l;if(this.Ta)clearTimeout(this.Ta),this.Ta=r};D.prototype.clear=function(){this.W.clear()};D.prototype.Jb=function(){this.S=this.A.batch_size};D.prototype.Y=function(){this.Kb(this.A.batch_flush_interval_ms)};
D.prototype.Kb=function(a){this.ia=a;if(!this.oa)this.Ta=setTimeout(c.bind(this.flush,this),this.ia)};D.prototype.flush=function(a){try{if(this.Ib)T.log("Flush: Request already in progress");else{var a=a||{},b=this.A.batch_request_timeout_ms,d=(new Date).getTime(),m=this.S,f=this.W.rc(m),e=[],o={};c.a(f,function(a){var b=a.payload;this.ea&&!a.Dc&&(b=this.ea(b));b&&e.push(b);o[a.id]=b},this);if(1>e.length)this.Y();else{this.Ib=l;var h=c.bind(function(e){this.Ib=G;try{var g=G;if(a.Xb)this.W.hd(o);else if(c.e(e)&&
"timeout"===e.error&&(new Date).getTime()-d>=b)this.j("Network timeout; retrying"),this.flush();else if(c.e(e)&&e.L&&(500<=e.L.status||429===e.L.status||"timeout"===e.error)){var h=2*this.ia,i=e.L.responseHeaders;if(i){var p=i["Retry-After"];p&&(h=1E3*parseInt(p,10)||h)}h=Math.min(6E5,h);this.j("Error; retry in "+h+" ms");this.Kb(h)}else if(c.e(e)&&e.L&&413===e.L.status)if(1<f.length){var j=Math.max(1,Math.floor(m/2));this.S=Math.min(this.S,j,f.length-1);this.j("413 response; reducing batch size to "+
this.S);this.Y()}else this.j("Single-event request too large; dropping",f),this.Jb(),g=l;else g=l;g&&this.W.Hc(c.map(f,function(a){return a.id}),c.bind(function(a){a?(this.Ea=0,this.flush()):(this.j("Failed to remove items from queue"),5<++this.Ea?(this.j("Too many queue failures; disabling batching system."),this.Xc()):this.Y())},this))}catch(n){this.j("Error handling API response",n),this.Y()}},this),i={method:"POST",ac:l,xc:l,Ub:b};if(a.Xb)i.Ua="sendBeacon";T.log("MIXPANEL REQUEST:",e);this.Nc(e,
i,h)}}}catch(p){this.j("Error flushing request queue",p),this.Y()}};D.prototype.j=function(a,b){T.error.apply(T.error,arguments);if(this.G)try{b instanceof Error||(b=Error(a)),this.G(a,b)}catch(c){T.error(c)}};var Na="__mp_opt_in_out_",C={Mb:function(a,b){var d={},e={};c.e(a)?c.a(a,function(a,b){this.z(b)||(e[b]=a)},this):e[a]=b;d.$set=e;return d},Yb:function(a){var b={},d=[];c.isArray(a)||(a=[a]);c.a(a,function(a){this.z(a)||d.push(a)},this);b.$unset=d;return b},Pb:function(a,b){var d={},e={};c.e(a)?
c.a(a,function(a,b){this.z(b)||(e[b]=a)},this):e[a]=b;d.$set_once=e;return d},Wb:function(a,b){var d={},e={};c.e(a)?c.a(a,function(a,b){this.z(b)||(e[b]=c.isArray(a)?a:[a])},this):e[a]=c.isArray(b)?b:[b];d.$union=e;return d},jc:function(a,b){var d={},e={};c.e(a)?c.a(a,function(a,b){this.z(b)||(e[b]=a)},this):e[a]=b;d.$append=e;return d},Hb:function(a,b){var d={},e={};c.e(a)?c.a(a,function(a,b){this.z(b)||(e[b]=a)},this):e[a]=b;d.$remove=e;return d},od:function(){return{$delete:""}}};c.extend(w.prototype,
C);w.prototype.R=function(a,b,c){this.d=a;this.xa=b;this.wa=c};w.prototype.set=N(function(a,b,d){var e=this.Mb(a,b);c.e(a)&&(d=b);return this.k(e,d)});w.prototype.na=N(function(a,b,d){var e=this.Pb(a,b);c.e(a)&&(d=b);return this.k(e,d)});w.prototype.qa=N(function(a,b){return this.k(this.Yb(a),b)});w.prototype.Z=N(function(a,b,d){c.e(a)&&(d=b);return this.k(this.Wb(a,b),d)});w.prototype["delete"]=N(function(a){return this.k({$delete:""},a)});w.prototype.remove=N(function(a,b,c){return this.k(this.Hb(a,
b),c)});w.prototype.k=function(a,b){a.$group_key=this.xa;a.$group_id=this.wa;a.$token=this.v("token");return this.d.Aa({type:"groups",data:c.Ga(a),C:this.v("api_host")+"/groups/",Ca:this.d.p.wc},b)};w.prototype.z=function(a){return"$group_key"===a||"$group_id"===a};w.prototype.v=function(a){return this.d.c(a)};w.prototype.toString=function(){return this.d.toString()+".group."+this.xa+"."+this.wa};w.prototype.remove=w.prototype.remove;w.prototype.set=w.prototype.set;w.prototype.set_once=w.prototype.na;
w.prototype.union=w.prototype.Z;w.prototype.unset=w.prototype.qa;w.prototype.toString=w.prototype.toString;c.extend(j.prototype,C);j.prototype.R=function(a){this.d=a};j.prototype.set=J(function(a,b,d){var e=this.Mb(a,b);c.e(a)&&(d=b);this.v("save_referrer")&&this.d.persistence.Va(document.referrer);e.$set=c.extend({},c.info.Gc(),this.d.persistence.vc(),e.$set);return this.k(e,d)});j.prototype.na=J(function(a,b,d){var e=this.Pb(a,b);c.e(a)&&(d=b);return this.k(e,d)});j.prototype.qa=J(function(a,b){return this.k(this.Yb(a),
b)});j.prototype.ub=J(function(a,b,d){var e={},f={};c.e(a)?(c.a(a,function(a,b){this.z(b)||(isNaN(parseFloat(a))?s.error("Invalid increment value passed to mixpanel.people.increment - must be a number"):f[b]=a)},this),d=b):(c.g(b)&&(b=1),f[a]=b);e.$add=f;return this.k(e,d)});j.prototype.append=J(function(a,b,d){c.e(a)&&(d=b);return this.k(this.jc(a,b),d)});j.prototype.remove=J(function(a,b,d){c.e(a)&&(d=b);return this.k(this.Hb(a,b),d)});j.prototype.Z=J(function(a,b,d){c.e(a)&&(d=b);return this.k(this.Wb(a,
b),d)});j.prototype.cd=J(function(a,b,d){if(!c.xb(a)&&(a=parseFloat(a),isNaN(a))){s.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",c.extend({$amount:a},b),d)});j.prototype.hb=function(a){return this.set("$transactions",[],a)};j.prototype.ob=function(){if(this.ya())return this.k({$delete:this.d.H()});s.error("mixpanel.people.delete_user() requires you to call identify() first")};j.prototype.toString=function(){return this.d.toString()+
".people"};j.prototype.k=function(a,b){a.$token=this.v("token");a.$distinct_id=this.d.H();var d=this.d.s("$device_id"),e=this.d.s("$user_id"),f=this.d.s("$had_persisted_distinct_id");d&&(a.$device_id=d);e&&(a.$user_id=e);f&&(a.$had_persisted_distinct_id=f);d=c.Ga(a);return!this.ya()?(this.ec(a),c.g(b)||(this.v("verbose")?b({status:-1,error:r}):b(-1)),c.truncate(d,255)):this.d.Aa({type:"people",data:d,C:this.v("api_host")+"/engage/",Ca:this.d.p.Fc},b)};j.prototype.v=function(a){return this.d.c(a)};
j.prototype.ya=function(){return this.d.O.rb===l};j.prototype.ec=function(a){"$set"in a?this.d.persistence.q("$set",a):"$set_once"in a?this.d.persistence.q("$set_once",a):"$unset"in a?this.d.persistence.q("$unset",a):"$add"in a?this.d.persistence.q("$add",a):"$append"in a?this.d.persistence.q("$append",a):"$remove"in a?this.d.persistence.q("$remove",a):"$union"in a?this.d.persistence.q("$union",a):s.error("Invalid call to _enqueue():",a)};j.prototype.P=function(a,b,d,e){var f=this,g=c.extend({},this.d.persistence.ca(a)),
o=g;!c.g(g)&&c.e(g)&&!c.ka(g)&&(f.d.persistence.w(a,g),e&&(o=e(g)),b.call(f,o,function(b,e){0===b&&f.d.persistence.q(a,g);c.g(d)||d(b,e)}))};j.prototype.fc=function(a,b,d,e,f,g,o){var h=this,i=this.d.persistence.ca("$append"),p=this.d.persistence.ca("$remove");this.P("$set",this.set,a);this.P("$set_once",this.na,e);this.P("$unset",this.qa,g,function(a){return c.keys(a)});this.P("$add",this.ub,b);this.P("$union",this.Z,f);if(!c.g(i)&&c.isArray(i)&&i.length){for(var j,a=function(a,b){0===a&&h.d.persistence.q("$append",
j);c.g(d)||d(a,b)},b=i.length-1;0<=b;b--)j=i.pop(),c.ka(j)||h.append(j,a);h.d.persistence.save()}if(!c.g(p)&&c.isArray(p)&&p.length){for(var n,i=function(a,b){0===a&&h.d.persistence.q("$remove",n);c.g(o)||o(a,b)},a=p.length-1;0<=a;a--)n=p.pop(),c.ka(n)||h.remove(n,i);h.d.persistence.save()}};j.prototype.z=function(a){return"$distinct_id"===a||"$token"===a||"$device_id"===a||"$user_id"===a||"$had_persisted_distinct_id"===a};j.prototype.set=j.prototype.set;j.prototype.set_once=j.prototype.na;j.prototype.unset=
j.prototype.qa;j.prototype.increment=j.prototype.ub;j.prototype.append=j.prototype.append;j.prototype.remove=j.prototype.remove;j.prototype.union=j.prototype.Z;j.prototype.track_charge=j.prototype.cd;j.prototype.clear_charges=j.prototype.hb;j.prototype.delete_user=j.prototype.ob;j.prototype.toString=j.prototype.toString;var Qa="__mps,__mpso,__mpus,__mpa,__mpap,__mpr,__mpu,$people_distinct_id,__alias,__timers".split(",");n.prototype.V=function(){var a={};c.a(this.props,function(b,d){c.tb(Qa,d)||(a[d]=
b)});return a};n.prototype.load=function(){if(!this.disabled){var a=this.h.parse(this.name);a&&(this.props=c.extend({},a))}};n.prototype.kd=function(a){var b=a.upgrade,d;if(b)d="mp_super_properties","string"===typeof b&&(d=b),b=this.h.parse(d),this.h.remove(d),this.h.remove(d,l),b&&(this.props=c.extend(this.props,b.all,b.events));if(!a.cookie_name&&"mixpanel"!==a.name&&(d="mp_"+a.token+"_"+a.name,b=this.h.parse(d)))this.h.remove(d),this.h.remove(d,l),this.u(b);this.h===c.localStorage&&(b=c.cookie.parse(this.name),
c.cookie.remove(this.name),c.cookie.remove(this.name,l),b&&this.u(b))};n.prototype.save=function(){this.disabled||this.h.set(this.name,c.aa(this.props),this.Ja,this.Fa,this.Lb,this.mb,this.fa)};n.prototype.remove=function(){this.h.remove(this.name,G,this.fa);this.h.remove(this.name,l,this.fa)};n.prototype.clear=function(){this.remove();this.props={}};n.prototype.u=function(a,b,d){return c.e(a)?("undefined"===typeof b&&(b="None"),this.Ja="undefined"===typeof d?this.nb:d,c.a(a,function(a,c){if(!this.props.hasOwnProperty(c)||
this.props[c]===b)this.props[c]=a},this),this.save(),l):G};n.prototype.o=function(a,b){return c.e(a)?(this.Ja="undefined"===typeof b?this.nb:b,c.extend(this.props,a),this.save(),l):G};n.prototype.$=function(a){a in this.props&&(delete this.props[a],this.save())};n.prototype.jd=function(){if(!this.gb)this.u(c.info.mc()),this.gb=l};n.prototype.$b=function(a){this.o(c.info.Lc(a))};n.prototype.Va=function(a){this.u({$initial_referrer:a||"$direct",$initial_referring_domain:c.info.Fb(a)||"$direct"},"")};
n.prototype.vc=function(){return c.pa({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})};n.prototype.Zb=function(a){this.nb=this.Ja=a.cookie_expiration;this.Ob(a.disable_persistence);this.Qc(a.cookie_domain);this.Rc(a.cross_site_cookie);this.Sc(a.cross_subdomain_cookie);this.Vc(a.secure_cookie)};n.prototype.Ob=function(a){(this.disabled=a)?this.remove():this.save()};n.prototype.Qc=function(a){if(a!==this.fa)this.remove(),this.fa=a,this.save()};
n.prototype.Rc=function(a){if(a!==this.mb)this.mb=a,this.remove(),this.save()};n.prototype.Sc=function(a){if(a!==this.Fa)this.Fa=a,this.remove(),this.save()};n.prototype.tc=function(){return this.Fa};n.prototype.Vc=function(a){if(a!==this.Lb)this.Lb=a?l:G,this.remove(),this.save()};n.prototype.q=function(a,b){var d=this.va(a),e=b[a],f=this.B("$set"),g=this.B("$set_once"),o=this.B("$unset"),h=this.B("$add"),i=this.B("$union"),j=this.B("$remove",[]),n=this.B("$append",[]);"__mps"===d?(c.extend(f,e),
this.w("$add",e),this.w("$union",e),this.w("$unset",e)):"__mpso"===d?(c.a(e,function(a,b){b in g||(g[b]=a)}),this.w("$unset",e)):"__mpus"===d?c.a(e,function(a){c.a([f,g,h,i],function(b){a in b&&delete b[a]});c.a(n,function(b){a in b&&delete b[a]});o[a]=l}):"__mpa"===d?(c.a(e,function(a,b){b in f?f[b]+=a:(b in h||(h[b]=0),h[b]+=a)},this),this.w("$unset",e)):"__mpu"===d?(c.a(e,function(a,b){c.isArray(a)&&(b in i||(i[b]=[]),i[b]=i[b].concat(a))}),this.w("$unset",e)):"__mpr"===d?(j.push(e),this.w("$append",
e)):"__mpap"===d&&(n.push(e),this.w("$unset",e));s.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):");s.log(b);this.save()};n.prototype.w=function(a,b){var d=this.ca(a);c.g(d)||(c.a(b,function(b,e){"$append"===a||"$remove"===a?c.a(d,function(a){a[e]===b&&delete a[e]}):delete d[e]},this),this.save())};n.prototype.va=function(a){if("$set"===a)return"__mps";if("$set_once"===a)return"__mpso";if("$unset"===a)return"__mpus";if("$add"===a)return"__mpa";if("$append"===a)return"__mpap";if("$remove"===
a)return"__mpr";if("$union"===a)return"__mpu";s.error("Invalid queue:",a)};n.prototype.ca=function(a){return this.props[this.va(a)]};n.prototype.B=function(a,b){var d=this.va(a),b=c.g(b)?{}:b;return this.props[d]||(this.props[d]=b)};n.prototype.Tc=function(a){var b=this.props.__timers||{};b[a]=(new Date).getTime();this.props.__timers=b;this.save()};n.prototype.Ic=function(a){var b=(this.props.__timers||{})[a];c.g(b)||(delete this.props.__timers[a],this.save());return b};var da,v,O=A.XMLHttpRequest&&
"withCredentials"in new XMLHttpRequest,oa=!O&&-1===z.indexOf("MSIE")&&-1===z.indexOf("Mozilla"),U=r;F.sendBeacon&&(U=function(){return F.sendBeacon.apply(F,arguments)});var ma={api_host:"https://api-js.mixpanel.com",api_method:"POST",api_transport:"XHR",api_payload_format:"base64",app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:G,cross_subdomain_cookie:l,error_reporter:P,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:P,store_google:l,
save_referrer:l,test:G,verbose:G,img:G,debug:G,track_links_timeout:300,cookie_expiration:365,upgrade:G,disable_persistence:G,disable_cookie:G,secure_cookie:G,ip:l,opt_out_tracking_by_default:G,opt_out_persistence_by_default:G,opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:r,property_blacklist:[],xhr_headers:{},ignore_dnt:G,batch_requests:l,batch_size:50,batch_flush_interval_ms:5E3,batch_request_timeout_ms:9E4,batch_autostart:l,hooks:{}},na=G;e.prototype.La=function(a,
b,d){if(c.g(d))this.l("You must name your new library: init(token, config, name)");else if("mixpanel"===d)this.l("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");else return a=V(a,b,d),v[d]=a,a.da(),a};e.prototype.R=function(a,b,d){b=b||{};this.__loaded=l;this.config={};var e={};"api_payload_format"in b||(b.api_host||ma.api_host).match(/\.mixpanel\.com$/)&&(e.api_payload_format="json");this.Nb(c.extend({},ma,e,b,{name:d,token:a,callback_fn:("mixpanel"===
d?d:"mixpanel."+d)+"._jsc"}));this._jsc=P;this.sa=[];this.ta=[];this.ra=[];this.O={disable_all_events:G,identify_called:G};this.p={};if(this.N=this.c("batch_requests"))if(!c.localStorage.la(l)||!O)this.N=G,s.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support");else if(this.yc(),U&&A.addEventListener){var f=c.bind(function(){this.p.ha.oa||this.p.ha.flush({Xb:l})},this);A.addEventListener("pagehide",function(a){a.persisted&&f()});A.addEventListener("visibilitychange",function(){"hidden"===
u.visibilityState&&f()})}this.persistence=this.cookie=new n(this.config);this.K={};this.gc();a=c.Xa();this.H()||this.u({distinct_id:a,$device_id:a},"")};e.prototype.da=function(){this.c("loaded")(this);this.eb()};e.prototype.eb=function(){this.persistence.$b(u.referrer);this.c("store_google")&&this.persistence.jd();this.c("save_referrer")&&this.persistence.Va(u.referrer)};e.prototype.dc=function(){c.a(this.sa,function(a){this.za.apply(this,a)},this);this.U()||c.a(this.ta,function(a){this.k.apply(this,
a)},this);delete this.sa;delete this.ta};e.prototype.za=function(a,b){if(this.c("img"))return this.l("You can't use DOM tracking functions with img = true."),G;if(!na)return this.sa.push([a,b]),G;var c=(new a).La(this);return c.m.apply(c,b)};e.prototype.ab=function(a,b){if(c.g(a))return r;if(O)return function(c){a(c,b)};var d=this._jsc,e=""+Math.floor(1E8*Math.random()),f=this.c("callback_fn")+"["+e+"]";d[e]=function(c){delete d[e];a(c,b)};return f};e.prototype.k=function(a,b,d,e){var f=l;if(oa)return this.ta.push(arguments),
f;var g={method:this.c("api_method"),Ua:this.c("api_transport"),ac:this.c("verbose")},o=r;if(!e&&(c.Ma(d)||"string"===typeof d))e=d,d=r;d=c.extend(g,d||{});if(!O)d.method="GET";var g="POST"===d.method,h=U&&g&&"sendbeacon"===d.Ua.toLowerCase(),i=d.ac;b.verbose&&(i=l);this.c("test")&&(b.test=1);i&&(b.verbose=1);this.c("img")&&(b.img=1);if(!O)if(e)b.callback=e;else if(i||this.c("test"))b.callback="(function(){})";b.ip=this.c("ip")?1:0;b._=(new Date).getTime().toString();b["PROJECT-TOKEN"]=this.c("token");
g&&(o="data="+encodeURIComponent(b.data),delete b.data);var a=a+("?"+c.bc(b)),j=this,n=new Blob([o],{type:"application/x-www-form-urlencoded"});if("img"in b)o=u.createElement("img"),o.src=a,u.body.appendChild(o);else if(h){try{f=(this.c("api_host")||ma.api_host).match(/\.mixpanel\.com$/)?U(a,o):U(a,n)}catch(s){j.l(s),f=G}try{e&&e(f?1:0)}catch(w){j.l(w)}}else if(O)try{var q=new XMLHttpRequest;q.open(d.method,a,l);var v=this.c("xhr_headers");g&&(v["Content-Type"]="application/x-www-form-urlencoded");
c.a(v,function(a,b){q.setRequestHeader(b,a)});if(d.Ub&&"undefined"!==typeof q.timeout){q.timeout=d.Ub;var y=(new Date).getTime()}q.withCredentials=l;q.onreadystatechange=function(){if(4===q.readyState)if(200===q.status){if(e)if(i){var a;try{a=c.M(q.responseText)}catch(b){if(j.l(b),d.xc)a=q.responseText;else return}e(a)}else e(Number(q.responseText))}else a=q.timeout&&!q.status&&(new Date).getTime()-y>=q.timeout?"timeout":"Bad HTTP status: "+q.status+" "+q.statusText,j.l(a),e&&(i?e({status:0,error:a,
L:q}):e(0))};q.send(o)}catch(z){j.l(z),f=G}else o=u.createElement("script"),o.type="text/javascript",o.async=l,o.defer=l,o.src=a,v=u.getElementsByTagName("script")[0],v.parentNode.insertBefore(o,v);return f};e.prototype.ua=function(a){function b(a,b){c.a(a,function(a){if(c.isArray(a[0])){var d=b;c.a(a,function(a){d=d[a[0]].apply(d,a.slice(1))})}else this[a[0]].apply(this,a.slice(1))},b)}var d,e=[],f=[],g=[];c.a(a,function(a){a&&(d=a[0],c.isArray(d)?g.push(a):"function"===typeof a?a.call(this):c.isArray(a)&&
"alias"===d?e.push(a):c.isArray(a)&&-1!==d.indexOf("track")&&"function"===typeof this[d]?g.push(a):f.push(a))},this);b(e,this);b(f,this);b(g,this)};e.prototype.fb=function(){return!!this.p.ha};e.prototype.yc=function(){var a=this.c("token");if(!this.fb()){var b=c.bind(function(b){return new D("__mpq_"+a+b.Ra,{A:this.config,Oc:c.bind(function(a,c,e){this.k(this.c("api_host")+b.C,this.Za(a),c,this.ab(e,a))},this),ea:c.bind(function(a){return this.cb("before_send_"+b.type,a)},this),G:this.c("error_reporter"),
Yc:c.bind(this.Sb,this)})},this);this.p={ha:b({type:"events",C:"/track/",Ra:"_ev"}),Fc:b({type:"people",C:"/engage/",Ra:"_pp"}),wc:b({type:"groups",C:"/groups/",Ra:"_gr"})}}this.c("batch_autostart")&&this.Rb()};e.prototype.Rb=function(){if(this.fb())this.N=l,c.a(this.p,function(a){a.start()})};e.prototype.Sb=function(){this.N=G;c.a(this.p,function(a){a.stop();a.clear()})};e.prototype.push=function(a){this.ua([a])};e.prototype.disable=function(a){"undefined"===typeof a?this.O.oc=l:this.ra=this.ra.concat(a)};
e.prototype.Za=function(a){a=c.aa(a);"base64"===this.c("api_payload_format")&&(a=c.kc(a));return{data:a}};e.prototype.Aa=function(a,b){var d=c.truncate(a.data,255),e=a.C,f=a.Ca,g=a.Wc,j=a.Pc||{},b=b||P,h=l,i=c.bind(function(){j.Qb||(d=this.cb("before_send_"+a.type,d));return d?(s.log("MIXPANEL REQUEST:"),s.log(d),this.k(e,this.Za(d),j,this.ab(b,d))):r},this);this.N&&!g?f.Ha(d,function(a){a?b(1,d):i()}):h=i();return h&&d};e.prototype.m=Q(function(a,b,d,e){!e&&"function"===typeof d&&(e=d,d=r);var d=
d||{},f=d.transport;if(f)d.Ua=f;f=d.send_immediately;"function"!==typeof e&&(e=P);if(c.g(a))this.l("No event name provided to mixpanel.track");else if(this.$a(a))e(0);else{b=b||{};b.token=this.c("token");var g=this.persistence.Ic(a);c.g(g)||(b.$duration=parseFloat((((new Date).getTime()-g)/1E3).toFixed(3)));this.eb();b=c.extend({},c.info.V(),this.persistence.V(),this.K,b);g=this.c("property_blacklist");c.isArray(g)?c.a(g,function(a){delete b[a]}):this.l("Invalid value for property_blacklist config: "+
g);return this.Aa({type:"events",data:{event:a,properties:b},C:this.c("api_host")+"/track/",Ca:this.p.ha,Wc:f,Pc:d},e)}});e.prototype.Uc=Q(function(a,b,d){c.isArray(b)||(b=[b]);var e={};e[a]=b;this.o(e);return this.people.set(a,b,d)});e.prototype.hc=Q(function(a,b,c){var e=this.s(a);if(e===k){var f={};f[a]=[b];this.o(f)}else-1===e.indexOf(b)&&(e.push(b),this.o(f));return this.people.Z(a,b,c)});e.prototype.Jc=Q(function(a,b,c){var e=this.s(a);if(e!==k){var f=e.indexOf(b);-1<f&&(e.splice(f,1),this.o({pd:e}));
0===e.length&&this.$(a)}return this.people.remove(a,b,c)});e.prototype.gd=Q(function(a,b,d,e){var f=c.extend({},b||{});c.a(d,function(a,b){a!==r&&a!==k&&(f[b]=a)});return this.m(a,f,e)});e.prototype.cc=function(a,b){return a+"_"+JSON.stringify(b)};e.prototype.uc=function(a,b){var c=this.cc(a,b),e=this.Ya[c];if(e===k||e.xa!==a||e.wa!==b)e=new w,e.R(this,a,b),this.Ya[c]=e;return e};e.prototype.fd=function(a){if(c.g(a))a=u.location.href;this.m("mp_page_view",c.info.Ec(a))};e.prototype.ed=function(){return this.za.call(this,
M,arguments)};e.prototype.dd=function(){return this.za.call(this,W,arguments)};e.prototype.$c=function(a){c.g(a)?this.l("No event name provided to mixpanel.time_event"):this.$a(a)||this.persistence.Tc(a)};var Ea={persistent:l};e.prototype.o=function(a,b){var d=ea(b);d.persistent?this.persistence.o(a,d.days):c.extend(this.K,a)};e.prototype.u=function(a,b,d){d=ea(d);d.persistent?this.persistence.u(a,b,d.days):("undefined"===typeof b&&(b="None"),c.a(a,function(a,c){if(!this.K.hasOwnProperty(c)||this.K[c]===
b)this.K[c]=a},this))};e.prototype.$=function(a,b){b=ea(b);b.persistent?this.persistence.$(a):delete this.K[a]};e.prototype.bb=function(a,b){var c={};c[a]=b;this.o(c)};e.prototype.Ka=function(a,b,c,e,f,g,j,h){var i=this.H();this.o({$user_id:a});this.s("$device_id")||this.u({$had_persisted_distinct_id:l,$device_id:i},"");a!==i&&a!==this.s("__alias")&&(this.$("__alias"),this.o({distinct_id:a}));this.O.rb=l;this.people.fc(b,c,e,f,g,j,h);a!==i&&this.m("$identify",{distinct_id:a,$anon_distinct_id:i},{Qb:l})};
e.prototype.reset=function(){this.persistence.clear();this.O.rb=G;var a=c.Xa();this.u({distinct_id:a,$device_id:a},"")};e.prototype.H=function(){return this.s("distinct_id")};e.prototype.ic=function(a,b){if(a===this.s("$people_distinct_id"))return this.l("Attempting to create alias for existing People user - aborting."),-2;var d=this;c.g(b)&&(b=this.H());if(a!==b)return this.bb("__alias",a),this.m("$create_alias",{alias:a,distinct_id:b},{Qb:l},function(){d.Ka(a)});this.l("alias matches current distinct_id - skipping api call.");
this.Ka(a);return-1};e.prototype.Cc=function(a){this.bb("mp_name_tag",a)};e.prototype.Nb=function(a){if(c.e(a))c.extend(this.config,a),a.batch_size&&c.a(this.p,function(a){a.Jb()}),this.c("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.c("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.Zb(this.config),K=K||this.c("debug")};e.prototype.c=function(a){return this.config[a]};e.prototype.cb=function(a){var b=
(this.config.hooks[a]||Fa).apply(this,L.call(arguments,1));"undefined"===typeof b&&(this.l(a+" hook did not return a value"),b=r);return b};e.prototype.s=function(a){return this.persistence.props[a]};e.prototype.toString=function(){var a=this.c("name");"mixpanel"!==a&&(a="mixpanel."+a);return a};e.prototype.$a=function(a){return c.wb(z)||this.O.oc||c.tb(this.ra,a)};e.prototype.gc=function(){"localStorage"===this.c("opt_out_tracking_persistence_type")&&c.localStorage.la()&&(!this.ja()&&this.ja({persistence_type:"cookie"})&&
this.Ab({enable_persistence:G}),!this.U()&&this.U({persistence_type:"cookie"})&&this.Pa({clear_persistence:G}),this.ib({persistence_type:"cookie",enable_persistence:G}));if(this.U())this.ba({clear_persistence:l});else if(!this.ja()&&(this.c("opt_out_tracking_by_default")||c.cookie.get("mp_optout")))c.cookie.remove("mp_optout"),this.Pa({clear_persistence:this.c("opt_out_persistence_by_default")})};e.prototype.ba=function(a){if(a&&a.clear_persistence)a=l;else if(a&&a.enable_persistence)a=G;else return;
!this.c("disable_persistence")&&this.persistence.disabled!==a&&this.persistence.Ob(a);a&&c.a(this.p,function(a){a.clear()})};e.prototype.Q=function(a,b){b=c.extend({track:c.bind(this.m,this),persistence_type:this.c("opt_out_tracking_persistence_type"),cookie_prefix:this.c("opt_out_tracking_cookie_prefix"),cookie_expiration:this.c("cookie_expiration"),cross_site_cookie:this.c("cross_site_cookie"),cross_subdomain_cookie:this.c("cross_subdomain_cookie"),cookie_domain:this.c("cookie_domain"),secure_cookie:this.c("secure_cookie"),
ignore_dnt:this.c("ignore_dnt")},b);c.localStorage.la()||(b.persistence_type="cookie");return a(this.c("token"),{m:b.track,ad:b.track_event_name,bd:b.track_properties,Db:b.persistence_type,Cb:b.cookie_prefix,jb:b.cookie_domain,kb:b.cookie_expiration,nc:b.cross_site_cookie,lb:b.cross_subdomain_cookie,Mc:b.secure_cookie,sb:b.ignore_dnt})};e.prototype.Ab=function(a){a=c.extend({enable_persistence:l},a);this.Q(Ia,a);this.ba(a)};e.prototype.Pa=function(a){a=c.extend({clear_persistence:l,delete_user:l},
a);a.delete_user&&this.people&&this.people.ya()&&(this.people.ob(),this.people.hb());this.Q(Ja,a);this.ba(a)};e.prototype.ja=function(a){return this.Q(Ka,a)};e.prototype.U=function(a){return this.Q(va,a)};e.prototype.ib=function(a){a=c.extend({enable_persistence:l},a);this.Q(Ma,a);this.ba(a)};e.prototype.l=function(a,b){s.error.apply(s.error,arguments);try{!b&&!(a instanceof Error)&&(a=Error(a)),this.c("error_reporter")(a,b)}catch(c){s.error(c)}};e.prototype.init=e.prototype.La;e.prototype.reset=
e.prototype.reset;e.prototype.disable=e.prototype.disable;e.prototype.time_event=e.prototype.$c;e.prototype.track=e.prototype.m;e.prototype.track_links=e.prototype.ed;e.prototype.track_forms=e.prototype.dd;e.prototype.track_pageview=e.prototype.fd;e.prototype.register=e.prototype.o;e.prototype.register_once=e.prototype.u;e.prototype.unregister=e.prototype.$;e.prototype.identify=e.prototype.Ka;e.prototype.alias=e.prototype.ic;e.prototype.name_tag=e.prototype.Cc;e.prototype.set_config=e.prototype.Nb;
e.prototype.get_config=e.prototype.c;e.prototype.get_property=e.prototype.s;e.prototype.get_distinct_id=e.prototype.H;e.prototype.toString=e.prototype.toString;e.prototype.opt_out_tracking=e.prototype.Pa;e.prototype.opt_in_tracking=e.prototype.Ab;e.prototype.has_opted_out_tracking=e.prototype.U;e.prototype.has_opted_in_tracking=e.prototype.ja;e.prototype.clear_opt_in_out_tracking=e.prototype.ib;e.prototype.get_group=e.prototype.uc;e.prototype.set_group=e.prototype.Uc;e.prototype.add_group=e.prototype.hc;
e.prototype.remove_group=e.prototype.Jc;e.prototype.track_with_groups=e.prototype.gd;e.prototype.start_batch_senders=e.prototype.Rb;e.prototype.stop_batch_senders=e.prototype.Sb;n.prototype.properties=n.prototype.V;n.prototype.update_search_keyword=n.prototype.$b;n.prototype.update_referrer_info=n.prototype.Va;n.prototype.get_cross_subdomain=n.prototype.tc;n.prototype.clear=n.prototype.clear;var H={};(function(){da=1;v=A.mixpanel;c.g(v)?s.F('"mixpanel" object not initialized. Ensure you are using the latest version of the Mixpanel JS Library along with the snippet we provide.'):
v.__loaded||v.config&&v.persistence?s.F("The Mixpanel library has already been downloaded at least once. Ensure that the Mixpanel code snippet only appears once on the page (and is not double-loaded by a tag manager) in order to avoid errors."):1.1>(v.__SV||0)?s.F("Version mismatch; please ensure you're using the latest version of the Mixpanel code snippet."):(c.a(v._i,function(a){a&&c.isArray(a)&&(H[a[a.length-1]]=V.apply(this,a))}),Ca(),v.init(),c.a(H,function(a){a.da()}),Ba())})()})();
})();