(function() { var k=void 0,l=!0,q=null,F=!1; (function(){function Aa(){function a(){if(!a.qc)la=a.qc=l,ma=F,c.a(G,function(a){a.dc()})}function b(){try{t.documentElement.doScroll("left")}catch(d){setTimeout(b,1);return}a()}if(t.addEventListener)"complete"===t.readyState?a():t.addEventListener("DOMContentLoaded",a,F);else if(t.attachEvent){t.attachEvent("onreadystatechange",a);var d=F;try{d=A.frameElement===q}catch(n){}t.documentElement.doScroll&&d&&b()}c.Gb(A,"load",a,l)}function Ba(){w.init=function(a,b,d){if(d)return w[d]||(w[d]=G[d]=T(a, b,d),w[d].da()),w[d];d=w;if(G.mixpanel)d=G.mixpanel;else if(a)d=T(a,b,"mixpanel"),d.da(),G.mixpanel=d;w=d;1===ca&&(A.mixpanel=w);Ca()}}function Ca(){c.a(G,function(a,b){"mixpanel"!==b&&(w[b]=a)});w._=c}function da(a){a=c.e(a)?a:c.g(a)?{}:{days:a};return c.extend({},Da,a)}function T(a,b,d){var n,f="mixpanel"===d?w:w[d];if(f&&0===ca)n=f;else{if(f&&!c.isArray(f)){p.error("You have already initialized "+d);return}n=new e}n.Ya={};n.R(a,b,d);n.people=new i;n.people.R(n);J=J||n.c("debug");!c.g(f)&&c.isArray(f)&& (n.ua.call(n.people,f.people),n.ua(f));return n}function e(){}function O(){}function Ea(a){return a}function m(a){this.props={};this.gb=F;this.name=a.persistence_name?"mp_"+a.persistence_name:"mp_"+a.token+"_mixpanel";var b=a.persistence;if("cookie"!==b&&"localStorage"!==b)p.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 i(){}function s(){} function C(a,b){this.G=b.G;this.W=new H(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 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,b){var d=[];c.a(a,function(a){a.id&&!b[a.id]&&d.push(a)});return d}function H(a,b){b=b||{};this.I=a;this.h=b.h||window.localStorage; this.j=b.G||c.bind(pa.error,pa);this.Oa=new qa(a,{h:this.h});this.ma=b.ma||q;this.D=[]}function qa(a,b){b=b||{};this.I=a;this.h=b.h||window.localStorage;this.Eb=b.Eb||100;this.Tb=b.Tb||2E3}function U(){this.Bb="submit"}function L(){this.Bb="click"}function D(){}function ra(a){var b=Fa,d=a.split("."),d=d[d.length-1];if(4a?"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,n){c.Na(a)&&0=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 j[h])d+=j[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=o.charAt(e);e+=1;return h}function g(a){a=new SyntaxError(a);a.nd=e;a.text=o;throw a;}var e,h,j={'"':'"',"\\":"\\","/":"/",b:"\u0008",f:"\u000c",n:"\n",r:"\r",t:"\t"},o,r;r=function(){b();switch(h){case "{":var e;a:{var y,j={};if("{"===h){f("{");b();if("}"===h){f("}");e= j;break a}for(;h;){y=d();b();f(":");Object.hasOwnProperty.call(j,y)&&g('Duplicate key "'+y+'"');j[y]=r();b();if("}"===h){f("}");e=j;break a}f(",");b()}}g("Bad object")}return e;case "[":a:{e=[];if("["===h){f("[");b();if("]"===h){f("]");y=e;break a}for(;h;){e.push(r());b();if("]"===h){f("]");y=e;break a}f(",");b()}}g("Bad array")}return y;case '"':return d();case "-":return c();default:return"0"<=h&&"9">=h?c():a()}};return function(a){o=a;e=0;h=" ";a=r();b();h&&g("Syntax error");return a}}();c.kc= function(a){var b,d,n,f,g=0,e=0,h="",h=[];if(!a)return a;a=c.ld(a);do b=a.charCodeAt(g++),d=a.charCodeAt(g++),n=a.charCodeAt(g++),f=b<<16|d<<8|n,b=f>>18&63,d=f>>12&63,n=f>>6&63,f&=63,h[e++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(n)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f); while(ge?c++:h=127e?String.fromCharCode(e>>6|192,e&63|128):String.fromCharCode(e>>12|224,e>>6&63|128,e&63|128);h!==q&&(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;cu?(Oa.error("Timeout waiting for mutex on "+r+"; clearing lock. ["+j+"]"),i.removeItem(t),i.removeItem(p),f()):setTimeout(function(){try{a()}catch(c){b&& b(c)}},v*(Math.random()+0.1))}!c&&"function"!==typeof b&&(c=b,b=q);var j=c||(new Date).getTime()+"|"+Math.random(),o=(new Date).getTime(),r=this.I,v=this.Eb,u=this.Tb,i=this.h,m=r+":X",p=r+":Y",t=r+":Z";try{if(V(i,l))f();else throw Error("localStorage support check failed");}catch(s){b&&b(s)}};var pa=ga("batch");H.prototype.Ha=function(a,b,d){var n={id:ea(),flushAfter:(new Date).getTime()+2*b,payload:a};this.Oa.Wa(c.bind(function(){var b;try{var c=this.X();c.push(n);(b=this.Sa(c))&&this.D.push(n)}catch(e){this.j("Error enqueueing item", a),b=F}d&&d(b)},this),c.bind(function(a){this.j("Error acquiring storage lock",a);d&&d(F)},this),this.ma)};H.prototype.rc=function(a){var b=this.D.slice(0,a);if(b.lengthg.flushAfter&&!n[g.id]&&(g.Dc=l,b.push(g),b.length>=a))break}}}return b};H.prototype.Hc=function(a,b){var d={};c.a(a,function(a){d[a]=l});this.D=oa(this.D,d);var n=c.bind(function(){var b;try{var c= this.X(),c=oa(c,d);if(b=this.Sa(c))for(var c=this.X(),n=0;ne.length)this.Y();else{this.Ib=l;var h=c.bind(function(e){this.Ib=F;try{var g=F;if(a.Xb)this.W.hd(i);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,j=e.L.responseHeaders;if(j){var o=j["Retry-After"];o&&(h=1E3*parseInt(o,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=u.timeout?"timeout":"Bad HTTP status: "+u.status+" "+u.statusText,o.l(a),e&&(j?e({status:0,error:a,L:u}):e(0))};u.send(i)}catch(x){o.l(x),f=F}else i=t.createElement("script"),i.type="text/javascript",i.async=l,i.defer=l,i.src=a,s=t.getElementsByTagName("script")[0],s.parentNode.insertBefore(i,s);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 C("__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=F;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,i=a.Pc||{},b=b||O,h=l,j=c.bind(function(){i.Qb||(d=this.cb("before_send_"+a.type,d));return d?(p.log("MIXPANEL REQUEST:"),p.log(d),this.k(e,this.Za(d),i,this.ab(b,d))):q},this);this.N&& !g?f.Ha(d,function(a){a?b(1,d):j()}):h=j();return h&&d};e.prototype.m=P(function(a,b,d,e){!e&&"function"===typeof d&&(e=d,d=q);var d=d||{},f=d.transport;if(f)d.Ua=f;f=d.send_immediately;"function"!==typeof e&&(e=O);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=P(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=P(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=P(function(a,b,c){var e=this.s(a);if(e!==k){var f=e.indexOf(b);-1(w.__SV||0)? p.F("Version mismatch; please ensure you're using the latest version of the Mixpanel code snippet."):(c.a(w._i,function(a){a&&c.isArray(a)&&(G[a[a.length-1]]=T.apply(this,a))}),Ba(),w.init(),c.a(G,function(a){a.da()}),Aa())})()})(); })();