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