(function() { var j=void 0,l=!0,r=null,B=!1; (function(){function Ua(){function a(){if(!a.Rc)ua=a.Rc=l,va=B,c.a(G,function(a){a.Ec()})}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,B);else if(t.attachEvent){t.attachEvent("onreadystatechange",a);var d=B;try{d=p.frameElement===r}catch(f){}t.documentElement.doScroll&&d&&b()}c.gc(p,"load",a,l)}function Va(){x.init=function(a,b,d){if(d)return x[d]||(x[d]=G[d]=W(a, b,d),x[d].ra()),x[d];d=x;if(G.mixpanel)d=G.mixpanel;else if(a)d=W(a,b,"mixpanel"),d.ra(),G.mixpanel=d;x=d;1===ia&&(p.mixpanel=x);Wa()}}function Wa(){c.a(G,function(a,b){"mixpanel"!==b&&(x[b]=a)});x._=c}function ja(a){a=c.g(a)?a:c.e(a)?{}:{days:a};return c.extend({},Xa,a)}function W(a,b,d){var f,g="mixpanel"===d?x:x[d];if(g&&0===ia)f=g;else{if(g&&!c.isArray(g)){o.error("You have already initialized "+d);return}f=new e}f.vb={};f.ba(a,b,d);f.people=new q;f.people.ba(f);if(!f.c("skip_first_touch_marketing")){var a= c.info.ca(r),h={},v=B;c.a(a,function(a,b){(h["initial_"+b]=a)&&(v=l)});v&&f.people.S(h)}L=L||f.c("debug");!c.e(g)&&c.isArray(g)&&(f.Ia.call(f.people,g.people),f.Ia(g));return f}function e(){}function R(){}function Ya(a){return a}function wa(a){throw Error(a+" not available in this build.");}function m(a){this.props={};this.Ud=B;this.name=a.persistence_name?"mp_"+a.persistence_name:"mp_"+a.token+"_mixpanel";var b=a.persistence;if("cookie"!==b&&"localStorage"!==b)o.D("Unknown persistence type "+b+"; falling back to cookie"), b=a.persistence="cookie";this.l="localStorage"===b&&c.localStorage.Ba()?c.localStorage:c.cookie;this.load();this.zc(a);this.Qd();this.save()}function q(){}function u(){}function D(a,b){this.O=b.O;this.ha=new E(a,{O:c.bind(this.h,this),v:b.v,qc:b.qc,q:b.q});this.F=b.F;this.rd=b.sd;this.sa=b.sa;this.Cd=b.Dd;this.I=this.F.batch_size;this.xa=this.F.batch_flush_interval_ms;this.ka=!this.F.batch_autostart;this.Ra=0;this.M={};this.Ob=b.Ob||B}function xa(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 ya(a,b){var d=[];c.a(a,function(a){a.id&&!b[a.id]&&d.push(a)});return d}function E(a,b){b=b||{};this.T=a;if(this.q=b.q)this.v=b.v||new S,this.fb=new za(a,{l:b.qc||window.localStorage}),this.v.Q();this.h=b.O||c.bind(Aa.error,Aa);this.Da=b.Da||r;this.G=[];this.bb=B}function S(a){this.l=a||localStorage}function za(a,b){b=b||{};this.T=a;this.l=b.l||window.localStorage;this.dc=b.dc||100;this.tc=b.tc||2E3;this.ec=b.ec||y}function X(){this.ac= "submit"}function O(){this.ac="click"}function F(){}function Ba(a){var b=Za,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.la=function(a){var b={};c.a(a,function(a,f){c.eb(a)&&0=i;)g()}function c(){var a,b,d="",f;if('"'===i)for(;g();){if('"'===i)return g(),d;if("\\"===i)if(g(),"u"===i){for(b=f=0;4>b;b+=1){a=parseInt(g(),16);if(!isFinite(a))break;f=16*f+a}d+=String.fromCharCode(f)}else if("string"===typeof k[i])d+=k[i];else break;else d+=i}h("Bad string")}function f(){var a;a="";"-"===i&&(a="-",g("-")); for(;"0"<=i&&"9">=i;)a+=i,g();if("."===i)for(a+=".";g()&&"0"<=i&&"9">=i;)a+=i;if("e"===i||"E"===i){a+=i;g();if("-"===i||"+"===i)a+=i,g();for(;"0"<=i&&"9">=i;)a+=i,g()}a=+a;if(isFinite(a))return a;h("Bad number")}function g(a){a&&a!==i&&h("Expected '"+a+"' instead of '"+i+"'");i=n.charAt(e);e+=1;return i}function h(a){a=new SyntaxError(a);a.Td=e;a.text=n;throw a;}var e,i,k={'"':'"',"\\":"\\","/":"/",b:"\u0008",f:"\u000c",n:"\n",r:"\r",t:"\t"},n,s;s=function(){b();switch(i){case "{":var e;a:{var v, k={};if("{"===i){g("{");b();if("}"===i){g("}");e=k;break a}for(;i;){v=c();b();g(":");Object.hasOwnProperty.call(k,v)&&h('Duplicate key "'+v+'"');k[v]=s();b();if("}"===i){g("}");e=k;break a}g(",");b()}}h("Bad object")}return e;case "[":a:{e=[];if("["===i){g("[");b();if("]"===i){g("]");v=e;break a}for(;i;){e.push(s());b();if("]"===i){g("]");v=e;break a}g(",");b()}}h("Bad array")}return v;case '"':return c();case "-":return f();default:return"0"<=i&&"9">=i?f():a()}};return function(a){n=a;e=0;i=" "; a=s();b();i&&h("Syntax error");return a}}();c.Mc=function(a){var b,d,f,g,h=0,e=0,i="",i=[];if(!a)return a;a=c.Rd(a);do b=a.charCodeAt(h++),d=a.charCodeAt(h++),f=a.charCodeAt(h++),g=b<<16|d<<8|f,b=g>>18&63,d=g>>12&63,f=g>>6&63,g&=63,i[e++]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(b)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(d)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(f)+"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".charAt(g); while(he?f++:i=127e?String.fromCharCode(e>>6|192,e&63|128):String.fromCharCode(e>>12|224,e>>6&63|128,e&63|128);i!==r&&(f>c&&(b+=a.substring(c,f)),b+=i,c=f=h+1)}f>c&&(b+=a.substring(c,a.length));return b};c.tb=function(){function a(){function a(b, c){var d,f=0;for(d=0;dq?(mb.error("Timeout waiting for mutex on "+w+"; clearing lock. ["+n+"]"),m.removeItem(u),m.removeItem(t), e()):setTimeout(function(){try{a()}catch(b){f(b)}},C*(Math.random()+0.1))}var n=b||(new Date).getTime()+"|"+Math.random(),p=(new Date).getTime(),w=this.T,C=this.dc,q=this.tc,m=this.l,o=w+":X",t=w+":Y",u=w+":Z";try{if(Y(m,l))e();else throw Error("localStorage support check failed");}catch(x){f(x)}},this))};S.prototype.Q=function(){return y.resolve()};S.prototype.setItem=function(a,b){return new y(c.bind(function(c,f){try{this.l.setItem(a,b)}catch(g){f(g)}c()},this))};S.prototype.getItem=function(a){return new y(c.bind(function(b, c){var f;try{f=this.l.getItem(a)}catch(g){c(g)}b(f)},this))};S.prototype.removeItem=function(a){return new y(c.bind(function(b,c){try{this.l.removeItem(a)}catch(f){c(f)}b()},this))};var Aa=ma("batch");E.prototype.K=function(){return this.bb?y.resolve():this.v.Q().then(c.bind(function(){this.bb=l},this)).catch(c.bind(function(a){this.h("Error initializing queue persistence. Disabling persistence",a);this.bb=l;this.q=B},this))};E.prototype.Va=function(a,b){var d={id:ka(),flushAfter:(new Date).getTime()+ 2*b,payload:a};if(this.q)return this.fb.rb(c.bind(function(){return this.K().then(c.bind(function(){return this.ja()},this)).then(c.bind(function(a){a.push(d);return this.kb(a)},this)).then(c.bind(function(a){a&&this.G.push(d);return a},this)).catch(c.bind(function(b){this.h("Error enqueueing item",b,a);return B},this))},this),this.Da).catch(c.bind(function(a){this.h("Error acquiring storage lock",a);return B},this));this.G.push(d);return y.resolve(l)};E.prototype.Uc=function(a){var b=this.G.slice(0, a);return this.q&&b.lengthe.flushAfter&&!f[e.id]&&(e.jd=l,b.push(e),b.length>=a))break}}return b},this)):y.resolve(b)};E.prototype.ld=function(a){var b={};c.a(a,function(a){b[a]=l});this.G=ya(this.G,b);if(this.q){var d=c.bind(function(){return this.K().then(c.bind(function(){return this.ja()},this)).then(c.bind(function(a){a= ya(a,b);return this.kb(a)},this)).then(c.bind(function(){return this.ja()},this)).then(c.bind(function(a){for(var c=0;cv.length)return this.jb=B,this.R(),y.resolve();var k=c.bind(function(){return this.ha.ld(c.map(g, function(a){return a.id})).then(c.bind(function(a){c.a(g,c.bind(function(a){var b=a.id;b?(this.M[b]=this.M[b]||0,this.M[b]++,5=b)return this.h("Network timeout; retrying"),this.flush();var h;if(h=c.g(e)){var v;if(!(v=500<=e.za)){var n;if(!(n=429===e.za)){var m;if(m=0>=e.za){var q=p.navigator.onLine;m=!(c.e(q)||q)}n=m||"timeout"===e.error}v=n}h=v}if(h){var s=2*this.xa;e.jc&&(s=1E3*parseInt(e.jc,10)||s);s=Math.min(6E5,s);this.h("Error; retry in "+s+" ms");this.kc(s);return y.resolve()}if(c.g(e)&&413===e.za){if(1=o.timeout?"timeout":"Bad HTTP status: "+o.status+" "+o.statusText,n.k(a),e&&(k?e({status:0,za:o.status,error:a,jc:(o.responseHeaders||{})["Retry-After"]}):e(0))};o.send(m)}catch(y){n.k(y),g=B}else m=t.createElement("script"),m.type="text/javascript",m.async=l,m.defer=l,m.src=a,u=t.getElementsByTagName("script")[0],u.parentNode.insertBefore(m,u);return g};e.prototype.Ia=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=[],g=[],h=[];c.a(a,function(a){a&&(d=a[0],c.isArray(d)?h.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]?h.push(a):g.push(a))},this);b(e,this);b(g,this);b(h,this)};e.prototype.Db=function(){return!!this.w.P};e.prototype.Pb=function(){var a="__mpq_"+this.c("token"), b=this.c("api_routes");return this.ub=this.ub||{P:{type:"events",J:"/"+b.track,ia:a+"_ev"},hb:{type:"people",J:"/"+b.engage,ia:a+"_pp"},Za:{type:"groups",J:"/"+b.groups,ia:a+"_gr"}}};e.prototype.bd=function(){if(!this.Db()){var a=c.bind(function(a){return new D(a.ia,{F:this.config,O:this.c("error_reporter"),sd:c.bind(function(b,c,e){this.j(this.c("api_host")+a.J,this.wb(b),c,this.zb(e,b))},this),sa:c.bind(function(b){return this.Bb("before_send_"+a.type,b)},this),Dd:c.bind(this.mb,this),q:l})},this), b=this.Pb();this.w={P:a(b.P),hb:a(b.hb),Za:a(b.Za)}}this.c("batch_autostart")&&this.lb()};e.prototype.lb=function(){this.Cc=l;if(this.Db())this.Y=l,c.a(this.w,function(a){a.start()})};e.prototype.mb=function(){this.Y=B;c.a(this.w,function(a){a.stop();a.clear()})};e.prototype.push=function(a){this.Ia([a])};e.prototype.disable=function(a){"undefined"===typeof a?this.Z.Pc=l:this.Fa=this.Fa.concat(a)};e.prototype.wb=function(a){a=c.oa(a);"base64"===this.c("api_payload_format")&&(a=c.Mc(a));return{data:a}}; e.prototype.Na=function(a,b){var d=c.truncate(a.data,255),e=a.J,g=a.Pa,h=a.Bd,m=a.ud||{},b=b||R,i=l,k=c.bind(function(){m.rc||(d=this.Bb("before_send_"+a.type,d));return d?(o.log("MIXPANEL REQUEST:"),o.log(d),this.j(e,this.wb(d),m,this.zb(b,d))):r},this);this.Y&&!h?g.Va(d).then(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=r);var d=d||{},g=d.transport;if(g)d.pb=g;g=d.send_immediately;"function"!==typeof e&&(e=R);if(c.e(a))this.k("No event name provided to mixpanel.track"); else if(this.xb(a))e(0);else{b=c.extend({},b);b.token=this.c("token");var h=this.persistence.md(a);c.e(h)||(b.$duration=parseFloat((((new Date).getTime()-h)/1E3).toFixed(3)));this.Cb();h=this.c("track_marketing")?c.info.fd():{};b=c.extend({},c.info.ga({mp_loader:this.c("mp_loader")}),h,this.persistence.ga(),this.V,this.Qb(),b);h=this.c("property_blacklist");c.isArray(h)?c.a(h,function(a){delete b[a]}):this.k("Invalid value for property_blacklist config: "+h);return this.Na({type:"events",data:{event:a, properties:b},J:this.c("api_host")+"/"+this.c("api_routes").track,Pa:this.w.P,Bd:g,ud:d},e)}});e.prototype.zd=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.Jc=M(function(a,b,c){var e=this.u(a),g={};e===j?(g[a]=[b],this.m(g)):-1===e.indexOf(b)&&(e.push(b),g[a]=e,this.m(g));return this.people.na(a,b,c)});e.prototype.nd=M(function(a,b,c){var e=this.u(a);if(e!==j){var g=e.indexOf(b);-1(x.__SV||0)?o.D("Version mismatch; please ensure you're using the latest version of the Mixpanel code snippet."):(c.a(x._i,function(a){a&&c.isArray(a)&&(G[a[a.length-1]]=W.apply(this,a))}),Va(),x.init(),c.a(G,function(a){a.ra()}),Ua())})(function(a,b){var c= document.createElement("script");c.type="text/javascript";c.async=l;c.onload=b;c.src=a;document.head.appendChild(c)})})(); })();