mixpanel-browser 2.69.0 → 2.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/dist/mixpanel-core.cjs.js +14 -10
- package/dist/mixpanel-recorder.js +1 -1
- package/dist/mixpanel-recorder.min.js +1 -1
- package/dist/mixpanel-recorder.min.js.map +1 -1
- package/dist/mixpanel-with-async-recorder.cjs.js +14 -10
- package/dist/mixpanel-with-recorder.js +14 -10
- package/dist/mixpanel-with-recorder.min.js +1 -1
- package/dist/mixpanel.amd.js +14 -10
- package/dist/mixpanel.cjs.js +14 -10
- package/dist/mixpanel.globals.js +14 -10
- package/dist/mixpanel.min.js +82 -81
- package/dist/mixpanel.module.js +14 -10
- package/dist/mixpanel.umd.js +14 -10
- package/package.json +6 -1
- package/src/config.js +1 -1
- package/src/flags/index.js +14 -9
package/dist/mixpanel.min.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
(function(){function Db(){function a(){a.done||(Qa=a.done=!0,Ra=!1,d.h(R,function(e){e.rd()}))}function b(){try{B.documentElement.doScroll("left")}catch(e){setTimeout(b,1);return}a()}if(B.addEventListener)"complete"===B.readyState?a():B.addEventListener("DOMContentLoaded",a,!1);else if(B.attachEvent){B.attachEvent("onreadystatechange",a);var c=!1;try{c=null===r.frameElement}catch(e){}B.documentElement.doScroll&&c&&b()}d.Tc(r,"load",a,!0)}function Eb(){E.init=function(a,b,c){if(c)return E[c]||(E[c]=
|
|
2
|
-
R[c]=ma(a,b,c),E[c].
|
|
2
|
+
R[c]=ma(a,b,c),E[c].Ba()),E[c];c=E;R.mixpanel?c=R.mixpanel:a&&(c=ma(a,b,"mixpanel"),c.Ba(),R.mixpanel=c);E=c;1===xa&&(r.mixpanel=E);Fb()}}function Fb(){d.h(R,function(a,b){"mixpanel"!==b&&(E[b]=a)});E._=d}function ya(a){a=d.j(a)?a:d.l(a)?{}:{days:a};return d.extend({},Gb,a)}function ma(a,b,c){var e="mixpanel"===c?E:E[c];if(e&&0===xa)var f=e;else{if(e&&!d.isArray(e)){z.error("You have already initialized "+c);return}f=new l}f.Xb={};f.la(a,b,c);f.people=new x;f.people.la(f);if(!f.g("skip_first_touch_marketing")){a=
|
|
3
3
|
d.info.ma(null);var g={},k=!1;d.h(a,function(h,p){(g["initial_"+p]=h)&&(k=!0)});k&&f.people.ba(g)}S=S||f.g("debug");!d.l(e)&&d.isArray(e)&&(f.Ya.call(f.people,e.people),f.Ya(e));return f}function l(){}function Hb(a){return a}function Sa(a){throw Error(a+" not available in this build.");}function T(a){this.X=null;this.Xe=a}function y(a){this.props={};this.name=a.persistence_name?"mp_"+a.persistence_name:"mp_"+a.token+"_mixpanel";var b=a.persistence;"cookie"!==b&&"localStorage"!==b&&(z.s("Unknown persistence type "+
|
|
4
|
-
b+"; falling back to cookie"),b=a.persistence="cookie");"localStorage"===b&&d.localStorage.
|
|
4
|
+
b+"; falling back to cookie"),b=a.persistence="cookie");"localStorage"===b&&d.localStorage.qa()?this.storage=d.localStorage:this.storage=d.cookie;this.load();this.ld(a);this.upgrade();this.save()}function x(){}function C(){}function M(a,b){this.Y=b.Y;this.ua=new O(a,{Y:d.bind(this.o,this),P:b.P,bd:b.bd,cd:b.cd,C:b.C,ob:b.ob});this.O=b.O;this.He=b.Ie;this.Da=b.Da;this.Ve=b.We;this.S=this.O.batch_size;this.Ja=this.O.batch_flush_interval_ms;this.stopped=!this.O.batch_autostart;this.lb=0;this.V={};this.vc=
|
|
5
5
|
b.vc||!1}function Ta(a,b){var c=[];d.h(a,function(e){var f=e.id;f in b?(f=b[f],null!==f&&(e.payload=f,c.push(e))):c.push(e)});return c}function Ua(a,b){var c=[];d.h(a,function(e){e.id&&!b[e.id]&&c.push(e)});return c}function O(a,b){b=b||{};this.ca=a;if(this.C=b.C)this.P=b.P||new fa,this.lock=new Va(a,{storage:b.bd||r.localStorage,Pb:b.cd});this.o=b.Y||d.bind(Wa.error,Wa);this.Qa=b.Qa||null;this.K=[];this.Ab=!1;this.Pd=b.ob?Ib(d.bind(this.Zb,this),b.ob):d.bind(function(c){return this.Zb([c])},this)}
|
|
6
|
-
function fa(a){this.storage=a||r.localStorage}function Va(a,b){b=b||{};this.ca=a;this.storage=b.storage||r.localStorage;this.Qc=b.Qc||100;this.Pb=b.Pb||2E3;this.Rc=b.Rc||D}function na(){this.Mc="submit"}function ba(){this.Mc="click"}function Q(){}function A(a){this.tb=a.tb;this.
|
|
6
|
+
function fa(a){this.storage=a||r.localStorage}function Va(a,b){b=b||{};this.ca=a;this.storage=b.storage||r.localStorage;this.Qc=b.Qc||100;this.Pb=b.Pb||2E3;this.Rc=b.Rc||D}function na(){this.Mc="submit"}function ba(){this.Mc="click"}function Q(){}function A(a){this.tb=a.tb;this.oa=a.Ud;this.Me=a.Le;this.wc=a.Wd;this.track=a.kf}function I(a){this.A=a}function ha(){}function Xa(a){var b=Jb,c=a.split(".");c=c[c.length-1];if(4<c.length||"com"===c||"org"===c)b=Kb;return(a=a.match(b))?a[0]:""}function za(a){var b=
|
|
7
7
|
Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return a?b.substring(0,a):b}function Ib(a,b){var c=null,e=[];return function(f){var g=this;e.push(f);c||(c=new D(function(k){setTimeout(function(){var h=a.apply(g,[e]);c=null;e=[];k(h)},b)}));return c}}function oa(a,b){return null===Aa||b?Aa=Ya(a||r.localStorage):Aa}function Ya(a){var b=!0;try{var c="__mplss_"+za(8);a.setItem(c,"xyz");"xyz"!==a.getItem(c)&&(b=!1);a.removeItem(c)}catch(e){b=!1}return b}function Za(a){a=
|
|
8
8
|
a.prototype;for(var b in a)"function"===typeof a[b]&&(a[b]=Ba(a[b]))}function Ba(a){return function(){try{return a.apply(this,arguments)}catch(b){z.s("Implementation error. Please turn on debug and contact support@mixpanel.com."),S&&z.s(b)}}}function ia(a){return{log:Ca(z.log,a),error:Ca(z.error,a),s:Ca(z.s,a)}}function Ca(a,b){return function(){arguments[0]="["+b+"] "+arguments[0];return a.apply(z,arguments)}}function pa(a,b){$a.add(a,b);Da||(Da=Lb($a.Od))}function ab(a){var b=typeof a;if(null!==
|
|
9
|
-
a&&("object"===b||"function"===b))var c=a.then;return"function"===typeof c?c:!1}function Ea(){for(var a=0;a<this.N.length;a++){var b=void 0,c=void 0,e=1===this.state?this.N[a].Ye:this.N[a].Qd,f=this.N[a];try{!1===e?f.reject(this.
|
|
10
|
-
new cb(c);try{b.call(a,function(){bb.apply(e,arguments)},function(){ja.apply(e,arguments)})}catch(f){ja.call(e,f)}}):(c.
|
|
9
|
+
a&&("object"===b||"function"===b))var c=a.then;return"function"===typeof c?c:!1}function Ea(){for(var a=0;a<this.N.length;a++){var b=void 0,c=void 0,e=1===this.state?this.N[a].Ye:this.N[a].Qd,f=this.N[a];try{!1===e?f.reject(this.sa):(c=!0===e?this.sa:e.call(void 0,this.sa),c===f.promise?f.reject(TypeError("Promise-chain cycle")):(b=ab(c))?b.call(c,f.resolve,f.reject):f.resolve(c))}catch(g){f.reject(g)}}this.N.length=0}function bb(a){var b,c=this;if(!c.xa){c.xa=!0;c.Ia&&(c=c.Ia);try{(b=ab(a))?pa(function(){var e=
|
|
10
|
+
new cb(c);try{b.call(a,function(){bb.apply(e,arguments)},function(){ja.apply(e,arguments)})}catch(f){ja.call(e,f)}}):(c.sa=a,c.state=1,0<c.N.length&&pa(Ea,c))}catch(e){ja.call(new cb(c),e)}}}function ja(a){var b=this;b.xa||(b.xa=!0,b.Ia&&(b=b.Ia),b.sa=a,b.state=2,0<b.N.length&&pa(Ea,b))}function db(a,b,c,e){for(var f=0;f<b.length;f++)(function(g){a.resolve(b[g]).then(function(k){c(g,k)},e)})(f)}function cb(a){this.Ia=a;this.xa=!1}function Mb(a){this.promise=a;this.state=0;this.xa=!1;this.N=[];this.sa=
|
|
11
11
|
void 0}function U(a){if("function"!==typeof a)throw TypeError("Not a function");if(0!==this.__NPO__)throw TypeError("Not a promise");this.__NPO__=1;var b=new Mb(this);this.then=function(c,e){var f={Ye:"function"===typeof c?c:!0,Qd:"function"===typeof e?e:!1};f.promise=new this.constructor(function(g,k){if("function"!==typeof g||"function"!==typeof k)throw TypeError("Not a function");f.resolve=g;f.reject=k});b.N.push(f);0!==b.state&&pa(Ea,b);return f.promise};this["catch"]=function(c){return this.then(void 0,
|
|
12
|
-
c)};try{a.call(void 0,function(c){bb.call(b,c)},function(c){ja.call(b,c)})}catch(c){ja.call(b,c)}}function eb(a,b,c){function e(f){z.error(b+" error: "+f)}return{
|
|
12
|
+
c)};try{a.call(void 0,function(c){bb.call(b,c)},function(c){ja.call(b,c)})}catch(c){ja.call(b,c)}}function eb(a,b,c){function e(f){z.error(b+" error: "+f)}return{qa:function(f){(f=c(a,f))||z.error(b+" unsupported");return f},error:e,get:function(f){try{return a.getItem(f)}catch(g){e(g)}return null},parse:function(f){try{return d.ga(a.getItem(f))||{}}catch(g){}return null},set:function(f,g){try{a.setItem(f,g)}catch(k){e(k)}},remove:function(f){try{a.removeItem(f)}catch(g){e(g)}}}}function Fa(a){var b=
|
|
13
13
|
{};a=fb(a).split(" ");for(var c=0;c<a.length;c++){var e=a[c];e&&(b[e]=!0)}return b}function fb(a){switch(typeof a.className){case "string":return a.className;case "object":return a.className.qf||a.getAttribute("class")||"";default:return""}}function Nb(a){if(a.previousElementSibling)return a.previousElementSibling;do a=a.previousSibling;while(a&&(!a||1!==a.nodeType));return a}function gb(a,b,c,e,f,g){var k={$classes:fb(a).split(" "),$tag_name:a.tagName.toLowerCase()},h=a.id;h&&(k.$id=h);Ga(a,b,f,
|
|
14
14
|
g)&&d.h(Ob.concat(e),function(p){if(a.hasAttribute(p)&&!c[p]){var q=a.getAttribute(p);qa(q)&&(k["$attr-"+p]=q)}});e=b=1;for(f=a;f=Nb(f);)b++,f.tagName===a.tagName&&e++;k.$nth_child=b;k.$nth_of_type=e;return k}function Pb(a,b){var c=b.Ad,e=b.Bd||[],f=b.Fd,g=b.Gd||[],k=b.Jd||!1,h=b.Id||[],p=b.Kd||!1,q={};d.h(b.Ed||[],function(v){q[v]=!0});var n=null,m="undefined"===typeof a.target?a.srcElement:a.target;m&&3===m.nodeType&&(m=m.parentNode);if(Qb(m,a)&&Ha(m,a,c,e)&&!Ia(m,a,f,g)){b=[m];for(var t=m;t.parentNode&&
|
|
15
15
|
!P(t,"body");)b.push(t.parentNode),t=t.parentNode;var w=[],u,G=!1;d.h(b,function(v){var N=Ga(v,a,c,e);q.href||"a"!==v.tagName.toLowerCase()||(u=v.getAttribute("href"),u=N&&qa(u)&&u);Ia(v,a,f,g)&&(G=!0);w.push(gb(v,a,q,h,c,e))},this);if(!G&&(b=B.documentElement,n={$event_type:a.type,$host:r.location.host,$pathname:r.location.pathname,$elements:w,$el_attr__href:u,$viewportHeight:Math.max(b.clientHeight,r.innerHeight||0),$viewportWidth:Math.max(b.clientWidth,r.innerWidth||0),$pageHeight:B.body.offsetHeight||
|
|
@@ -50,105 +50,106 @@ c.addEventListener&&!g?c.addEventListener(e,f,!!k):(e="on"+e,c[e]=a(c,f,c[e])):z
|
|
|
50
50
|
"*"==n?a(q[h]):q[h].getElementsByTagName(n),p=0;p<w.length;p++)m[g++]=w[p];q=[];n=0;switch(t){case "=":t=function(v){return v.getAttribute(u)==G};break;case "~":t=function(v){return v.getAttribute(u).match(new RegExp("\\b"+G+"\\b"))};break;case "|":t=function(v){return v.getAttribute(u).match(new RegExp("^"+G+"-?"))};break;case "^":t=function(v){return 0===v.getAttribute(u).indexOf(G)};break;case "$":t=function(v){return v.getAttribute(u).lastIndexOf(G)==v.getAttribute(u).length-G.length};break;case "*":t=
|
|
51
51
|
function(v){return-1<v.getAttribute(u).indexOf(G)};break;default:t=function(v){return v.getAttribute(u)}}q=[];for(h=n=0;h<m.length;h++)t(m[h])&&(q[n++]=m[h])}else{m=[];for(h=g=0;h<q.length;h++)for(w=q[h].getElementsByTagName(n),p=0;p<w.length;p++)m[g++]=w[p];q=m}}return q}var e=/[\t\r\n]/g;return function(f){return d.ke(f)?[f]:d.j(f)&&!d.l(f.length)?f:c.call(this,f)}}();var $b="utm_source utm_medium utm_campaign utm_content utm_term utm_id utm_source_platform utm_campaign_id utm_creative_format utm_marketing_tactic".split(" "),
|
|
52
52
|
ac="dclid fbclid gclid ko_click_id li_fat_id msclkid sccid ttclid twclid wbraid".split(" ");d.info={ma:function(a){var b="",c={};d.h($b,function(e){b=d.vb(B.URL,e);b.length?c[e]=b:void 0!==a&&(c[e]=a)});return c},nc:function(){var a="",b={};d.h(ac,function(c){a=d.vb(B.URL,c);a.length&&(b[c]=a)});return b},ue:function(){return d.extend(d.info.ma(),d.info.nc())},Ee:function(a){return 0===a.search("https?://(.*)google.([^/?]*)")?"google":0===a.search("https?://(.*)bing.com")?"bing":0===a.search("https?://(.*)yahoo.com")?
|
|
53
|
-
"yahoo":0===a.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},Fe:function(a){var b=d.info.Ee(a),c={};null!==b&&(c.$search_engine=b,a=d.vb(a,"yahoo"!=b?"q":"p"),a.length&&(c.mp_keyword=a));return c},
|
|
53
|
+
"yahoo":0===a.search("https?://(.*)duckduckgo.com")?"duckduckgo":null},Fe:function(a){var b=d.info.Ee(a),c={};null!==b&&(c.$search_engine=b,a=d.vb(a,"yahoo"!=b?"q":"p"),a.length&&(c.mp_keyword=a));return c},Ea:function(a,b,c){b=b||"";return c||d.includes(a," OPR/")?d.includes(a,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(a)?"BlackBerry":d.includes(a,"IEMobile")||d.includes(a,"WPDesktop")?"Internet Explorer Mobile":d.includes(a,"SamsungBrowser/")?"Samsung Internet":d.includes(a,
|
|
54
54
|
"Edge")||d.includes(a,"Edg/")?"Microsoft Edge":d.includes(a,"FBIOS")?"Facebook Mobile":d.includes(a,"Whale/")?"Whale Browser":d.includes(a,"Chrome")?"Chrome":d.includes(a,"CriOS")?"Chrome iOS":d.includes(a,"UCWEB")||d.includes(a,"UCBrowser")?"UC Browser":d.includes(a,"FxiOS")?"Firefox iOS":d.includes(b,"Apple")?d.includes(a,"Mobile")?"Mobile Safari":"Safari":d.includes(a,"Android")?"Android Mobile":d.includes(a,"Konqueror")?"Konqueror":d.includes(a,"Firefox")?"Firefox":d.includes(a,"MSIE")||d.includes(a,
|
|
55
55
|
"Trident/")?"Internet Explorer":d.includes(a,"Gecko")?"Mozilla":""},kb:function(a,b,c){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+)?)/,
|
|
56
|
-
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+)?)/,"Whale Browser":/Whale\/(\d+(\.\d+)?)/}[d.info.
|
|
57
|
-
"BlackBerry":/Mac/i.test(H)?"Mac OS X":/Linux/.test(H)?"Linux":/CrOS/.test(H)?"Chrome OS":""},uc: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":""},Sc:function(a){a=a.split("/");return 3<=a.length?a[2]:""},
|
|
58
|
-
$browser:d.info.
|
|
59
|
-
current_domain:r.location.hostname,current_url_path:r.location.pathname,current_url_protocol:r.location.protocol,current_url_search:r.location.search})}};var Kb=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Jb=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,da=null,ua=null;"undefined"!==typeof JSON&&(da=JSON.stringify,ua=JSON.parse);da=da||d.Vb;ua=ua||d.ga;d.info=d.info;d.info.browser=d.info.
|
|
56
|
+
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+)?)/,"Whale Browser":/Whale\/(\d+(\.\d+)?)/}[d.info.Ea(a,b,c)];return void 0===b?null:(a=a.match(b))?parseFloat(a[a.length-2]):null},Lc:function(){return/Windows/i.test(H)?/Phone/.test(H)||/WPDesktop/.test(H)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(H)?"iOS":/Android/.test(H)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(H)?
|
|
57
|
+
"BlackBerry":/Mac/i.test(H)?"Mac OS X":/Linux/.test(H)?"Linux":/CrOS/.test(H)?"Chrome OS":""},uc: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":""},Sc:function(a){a=a.split("/");return 3<=a.length?a[2]:""},Ha:function(){return r.location.href},ta:function(a){"object"!==typeof a&&(a={});return d.extend(d.da({$os:d.info.Lc(),
|
|
58
|
+
$browser:d.info.Ea(H,W.vendor,ta),$referrer:B.referrer,$referring_domain:d.info.Sc(B.referrer),$device:d.info.uc(H)}),{$current_url:d.info.Ha(),$browser_version:d.info.kb(H,W.vendor,ta),$screen_height:tb.height,$screen_width:tb.width,mp_lib:"web",$lib_version:"2.70.0",$insert_id:za(),time:d.timestamp()/1E3},d.da(a))},ze:function(){return d.extend(d.da({$os:d.info.Lc(),$browser:d.info.Ea(H,W.vendor,ta)}),{$browser_version:d.info.kb(H,W.vendor,ta)})},ve:function(){return d.da({current_page_title:B.title,
|
|
59
|
+
current_domain:r.location.hostname,current_url_path:r.location.pathname,current_url_protocol:r.location.protocol,current_url_search:r.location.search})}};var Kb=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,Jb=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,da=null,ua=null;"undefined"!==typeof JSON&&(da=JSON.stringify,ua=JSON.parse);da=da||d.Vb;ua=ua||d.ga;d.info=d.info;d.info.browser=d.info.Ea;d.info.browserVersion=d.info.kb;d.info.device=d.info.uc;d.info.properties=d.info.ta;d.isBlockedUA=d.Gc;d.isEmptyObject=d.Ma;d.isObject=
|
|
60
60
|
d.j;d.JSONDecode=d.ga;d.JSONEncode=d.Vb;d.toArray=d.ea;d.NPO=U;var Rb="clientX clientY offsetX offsetY pageX pageY screenX screenY x y".split(" "),jb=["mp-include"],Ja=["mp-no-track"],ib=Ja.concat(["mp-sensitive"]),Ob="aria-label aria-labelledby aria-describedby href name role title type".split(" "),J=ia("autocapture");kb.prototype.me=function(a,b,c){c=c||{};var e=c.threshold_px||30,f=c.timeout_ms||1E3;c=c.click_count||4;var g=Date.now(),k=this.W[this.W.length-1];if(k&&g-k.timestamp<f&&Math.sqrt(Math.pow(a-
|
|
61
61
|
k.x,2)+Math.pow(b-k.y,2))<e){if(this.W.push({x:a,y:b,timestamp:g}),this.W.length>=c)return this.W=[],!0}else this.W=[{x:a,y:b,timestamp:g}];return!1};var yb={allow_selectors:[],allow_url_regexes:[],block_attrs:[],block_element_callback:null,block_selectors:[],block_url_regexes:[],capture_extra_attrs:[],capture_text_content:!1,scroll_capture_all:!1,scroll_depth_percent_checkpoints:[25,50,75,100],click:!0,input:!0,pageview:"full-url",rage_click:!0,scroll:!0,submit:!0},va={$mp_autocapture:!0};I.prototype.B=
|
|
62
|
-
function(){try{var a=!!B.createElement("div").matches}catch(b){a=!1}a?(this.de(),this.be(),this.ce(),this.fe(),this.ge(),this.ee()):J.s("Autocapture unavailable: missing required DOM APIs")};I.prototype.ub=function(){var a=this.A.g("autocapture");return a?d.j(a)?d.extend({},yb,a):yb:{}};I.prototype.m=function(a){return this.ub()[a]};I.prototype.na=function(){var a,b=d.info.
|
|
62
|
+
function(){try{var a=!!B.createElement("div").matches}catch(b){a=!1}a?(this.de(),this.be(),this.ce(),this.fe(),this.ge(),this.ee()):J.s("Autocapture unavailable: missing required DOM APIs")};I.prototype.ub=function(){var a=this.A.g("autocapture");return a?d.j(a)?d.extend({},yb,a):yb:{}};I.prototype.m=function(a){return this.ub()[a]};I.prototype.na=function(){var a,b=d.info.Ha(),c=this.m("allow_url_regexes")||[];if(c.length){var e=!1;for(a=0;a<c.length;a++){var f=c[a];try{if(b.match(f)){e=!0;break}}catch(g){return J.s("Error while checking block URL regex: "+
|
|
63
63
|
f,g),!0}}if(!e)return!0}c=this.m("block_url_regexes")||[];if(!c||!c.length)return!1;for(a=0;a<c.length;a++)try{if(b.match(c[a]))return!0}catch(g){return J.s("Error while checking block URL regex: "+c[a],g),!0}return!1};I.prototype.Nc=function(){return this.A.g("autocapture")?this.m("pageview"):this.A.g("track_pageview")};I.prototype.Ra=function(a,b){if(!this.na()){var c=this.A.Eb()&&("$mp_click"===b&&!this.m("click")||"$mp_rage_click"===b&&!this.$a());if(a=Pb(a,{Ad:this.m("allow_element_callback"),
|
|
64
64
|
Bd:this.m("allow_selectors"),Ed:this.m("block_attrs"),Fd:this.m("block_element_callback"),Gd:this.m("block_selectors"),Id:this.m("capture_extra_attrs"),Jd:this.m("capture_text_content"),Kd:c}))d.extend(a,va),this.A.track(b,a)}};I.prototype.$a=function(){var a=this.m("rage_click");return a?!0===a?{}:"object"===typeof a?a:{}:null};I.prototype.be=function(){r.removeEventListener("click",this.oe);if(this.m("click")||this.A.g("record_heatmap_data"))J.log("Initializing click tracking"),this.oe=r.addEventListener("click",
|
|
65
65
|
function(a){(this.m("click")||this.A.Eb())&&this.Ra(a,"$mp_click")}.bind(this))};I.prototype.ce=function(){r.removeEventListener("change",this.ne);this.m("input")&&(J.log("Initializing input tracking"),this.ne=r.addEventListener("change",function(a){this.m("input")&&this.Ra(a,"$mp_input_change")}.bind(this)))};I.prototype.de=function(){r.removeEventListener("popstate",this.re);r.removeEventListener("hashchange",this.pe);r.removeEventListener("mp_locationchange",this.qe);if(this.Nc()){J.log("Initializing pageview tracking");
|
|
66
|
-
var a="",b=!1;this.na()||(b=this.A.Qb(va));b&&(a=d.info.
|
|
67
|
-
g,k){e.call(r.history,f,g,k);r.dispatchEvent(new Event("mp_locationchange"))});this.qe=r.addEventListener("mp_locationchange",Ba(function(){if(!this.na()){var f=d.info.
|
|
66
|
+
var a="",b=!1;this.na()||(b=this.A.Qb(va));b&&(a=d.info.Ha());this.re=r.addEventListener("popstate",function(){r.dispatchEvent(new Event("mp_locationchange"))});this.pe=r.addEventListener("hashchange",function(){r.dispatchEvent(new Event("mp_locationchange"))});var c=r.history.pushState;"function"===typeof c&&(r.history.pushState=function(f,g,k){c.call(r.history,f,g,k);r.dispatchEvent(new Event("mp_locationchange"))});var e=r.history.replaceState;"function"===typeof e&&(r.history.replaceState=function(f,
|
|
67
|
+
g,k){e.call(r.history,f,g,k);r.dispatchEvent(new Event("mp_locationchange"))});this.qe=r.addEventListener("mp_locationchange",Ba(function(){if(!this.na()){var f=d.info.Ha(),g=!1,k=f.split("#")[0].split("?")[0]!==a.split("#")[0].split("?")[0],h=this.Nc();"full-url"===h?g=f!==a:"url-with-path-and-query-string"===h?g=f.split("#")[0]!==a.split("#")[0]:"url-with-path"===h&&(g=k);g&&(this.A.Qb(va)&&(a=f),k&&(this.Na=0,J.log("Path change: re-initializing scroll depth checkpoints")))}}.bind(this)))}};I.prototype.ee=
|
|
68
68
|
function(){r.removeEventListener("click",this.Ic);if(this.$a()||this.A.g("record_heatmap_data"))J.log("Initializing rage click tracking"),this.ec||(this.ec=new kb),this.Ic=function(a){var b=this.$a();if(b||this.A.Eb())this.na()||this.ec.me(a.pageX,a.pageY,b)&&this.Ra(a,"$mp_rage_click")}.bind(this),r.addEventListener("click",this.Ic)};I.prototype.fe=function(){r.removeEventListener("scrollend",this.se);this.m("scroll")&&(J.log("Initializing scroll tracking"),this.Na=0,this.se=r.addEventListener("scrollend",
|
|
69
69
|
Ba(function(){if(this.m("scroll")&&!this.na()){var a=this.m("scroll_capture_all"),b=(this.m("scroll_depth_percent_checkpoints")||[]).slice().sort(function(h,p){return h-p}),c=r.scrollY,e=d.extend({$scroll_top:c},va);try{var f=B.body.scrollHeight,g=Math.round(c/(f-r.innerHeight)*100);e.$scroll_height=f;e.$scroll_percentage=g;if(g>this.Na)for(c=0;c<b.length;c++){var k=b[c];g>=k&&this.Na<k&&(this.Na=e.$scroll_checkpoint=k,a=!0)}}catch(h){J.s("Error while calculating scroll percentage",h)}a&&this.A.track("$mp_scroll",
|
|
70
70
|
e)}}.bind(this))))};I.prototype.ge=function(){r.removeEventListener("submit",this.te);this.m("submit")&&(J.log("Initializing submit tracking"),this.te=r.addEventListener("submit",function(a){this.m("submit")&&this.Ra(a,"$mp_submit")}.bind(this)))};Za(I);var bc=r.fetch,K=ia("flags"),zb={context:{}};A.prototype.B=function(){bc&&"undefined"!==typeof Promise&&"undefined"!==typeof Map&&"undefined"!==typeof Set?(this.flags=null,this.rb(),this.gd=new Set):K.s("Feature Flags unavailable: missing minimum required APIs")};
|
|
71
|
-
A.prototype.ub=function(){var a=this.
|
|
72
|
-
return!!this.flags};A.prototype.rb=function(){if(!this.Db())return Promise.resolve();var a=this.wc("distinct_id"),b=this.wc("$device_id");K.log("Fetching flags for distinct ID: "+a);a=
|
|
73
|
-
e.flags;if(!e)throw Error("No flags in API response");var f=new Map;d.h(e,function(g,k){f.set(k,{key:g.variant_key,value:g.variant_value})});this.flags=f}.bind(this)).catch(function(e){this.Fb();K.error(e)}.bind(this))}.bind(this)).catch(function(c){this.Fb();K.error(c)}.bind(this))};A.prototype.Fb=function(){this.Za?(this.bc=this.Za,this.ac=Date.now(),this.td=this.ac-this.bc,this.Za=null):K.error("Fetch in progress started time not set, cannot mark fetch complete")};
|
|
74
|
-
this.sb.then(function(){return this.wb(a,b)}.bind(this)).catch(function(c){K.error(c);return b}):new Promise(function(c){K.s("Feature Flags not initialized");c(b)})};A.prototype.wb=function(a,b){if(!this.jc())return K.log("Flags not loaded yet"),b;var c=this.flags.get(a);if(!c)return K.log('No flag found: "'+a+'"'),b;this.df(a,c);return c};A.prototype.xb=function(a,b){return this.xc(a,{value:b}).then(function(c){return c.value}).catch(function(c){K.error(c);
|
|
75
|
-
return this.xb(a,b)};A.prototype.yc=function(a,b){return this.wb(a,{value:b}).value};A.prototype.isEnabled=function(a,b){return this.xb(a).then(function(){return this.Hc(a,b)}.bind(this)).catch(function(c){K.error(c);return b})};A.prototype.Hc=function(a,b){b=b||!1;var c=this.yc(a,b);!0!==c&&!1!==c&&(K.error('Feature flag "'+
|
|
76
|
-
{"Experiment name":a,"Variant name":b.key,$experiment_type:"feature_flag","Variant fetch start time":(new Date(this.bc)).toISOString(),"Variant fetch complete time":(new Date(this.ac)).toISOString(),"Variant fetch latency (ms)":this.td}))};Za(A);A.prototype.are_flags_ready=A.prototype.jc;A.prototype.get_variant=A.prototype.xc;
|
|
77
|
-
A.prototype.is_enabled_sync=A.prototype.Hc;A.prototype.update_context=A.prototype.lf;A.prototype.get_feature_data=A.prototype.Vd;Q.prototype.
|
|
78
|
-
this,p);window.setTimeout(f.fd(e,q,p,!0),n);f.A.track(b,q,f.fd(e,q,p))})},this),!0};Q.prototype.fd=function(a,b,c,e){e=e||!1;var f=this;return function(){c.Hd||(c.Hd=!0,a&&!1===a(e,b)||f.hb(c))}};Q.prototype.
|
|
79
|
-
ba.prototype.hb=function(a){a.Jc||setTimeout(function(){window.location=a.href},0)};d.Fc(na,Q);na.prototype.pb=function(a,b,c){c.element=b;a.preventDefault()};na.prototype.hb=function(a){setTimeout(function(){a.element.submit()},0)};var cc=ia("lock");Va.prototype.Tb=function(a,b){return new this.Rc(d.bind(function(c,
|
|
80
|
-
e(X)})}function g(){u.setItem(G,q);h(k,function(){u.getItem(G)===q?f():p(function(){u.getItem(v)!==q?g():h(function(){return!u.getItem(N)},f)})})}function k(){var L=u.getItem(v);if(L&&L!==q)return!1;u.setItem(v,q);if(u.getItem(v)===q)return!0;oa(u,!0)||e(Error("localStorage support dropped while acquiring lock"));return!1}
|
|
81
|
-
g()):setTimeout(function(){try{L()}catch(X){e(X)}},t*(Math.random()+.1))}var q=b||(new Date).getTime()+"|"+Math.random(),n=(new Date).getTime(),m=this.ca,t=this.Qc,w=this.Pb,u=this.storage,G=m+":X",v=m+":Y",N=m+":Z";try{if(oa(u,!0))g();else throw Error("localStorage support check failed");}catch(L){e(L)}},this))};
|
|
82
|
-
function(a){return new D(d.bind(function(b,c){try{var e=ua(this.storage.getItem(a))}catch(f){c(f)}b(e)},this))};fa.prototype.removeItem=function(a){return new D(d.bind(function(b,c){try{this.storage.removeItem(a)}catch(e){c(e)}b()},this))};var Wa=ia("batch");O.prototype.T=function(){return this.Ab||!this.C?
|
|
83
|
-
function(a,b){a={id:za(),flushAfter:(new Date).getTime()+2*b,payload:a};if(this.C)return this.Pd(a);this.K.push(a);return D.resolve(!0)};O.prototype.Zb=function(a){var b=d.bind(function(){return this.T().then(d.bind(function(){return this.
|
|
84
|
-
c);return!1},this))};O.prototype.Rd=function(a){var b=this.K.slice(0,a);return this.C&&b.length<a?this.T().then(d.bind(function(){return this.
|
|
85
|
-
this)).
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
M.prototype.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
g){this.M(g)||(e[g]=
|
|
96
|
-
(
|
|
97
|
-
|
|
98
|
-
C.prototype.
|
|
99
|
-
|
|
100
|
-
x.prototype.
|
|
101
|
-
|
|
102
|
-
a):"$
|
|
103
|
-
|
|
104
|
-
d.isArray(a)&&a.length)for(b=function(n,m){0===n&&h.i.persistence.G("$
|
|
105
|
-
x.prototype.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
this.
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
a)};y.prototype.
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
function(b){
|
|
117
|
-
api_routes:Bb,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",api_payload_format:"base64",app_host:"https://mixpanel.com",autocapture:!1,cdn:"https://cdn.mxpnl.com",
|
|
118
|
-
|
|
119
|
-
record_block_selector:"img, video, audio",record_canvas:!1,record_collect_fonts:!1,record_heatmap_data:!1,record_idle_timeout_ms:18E5,record_mask_text_class:/^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$/,
|
|
120
|
-
else return a=ma(a,b,c),E[c]=a,a.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
71
|
+
A.prototype.ub=function(){var a=this.oa("flags");return a?d.j(a)?d.extend({},zb,a):zb:{}};A.prototype.m=function(a){return this.ub()[a]};A.prototype.Db=function(){return!!this.oa("flags")};A.prototype.lf=function(a,b){if(!this.Db())return K.s("Feature Flags not enabled, cannot update context"),Promise.resolve();var c=this.oa("flags");d.j(c)||(c={});b=b&&b.replace?{}:this.m("context");c.context=d.extend({},b,a);this.Me("flags",c);return this.rb()};A.prototype.jc=function(){this.Db()||K.error("Feature Flags not enabled");
|
|
72
|
+
return!!this.flags};A.prototype.rb=function(){if(!this.Db())return Promise.resolve();var a=this.wc("distinct_id"),b=this.wc("$device_id");K.log("Fetching flags for distinct ID: "+a);a=d.extend({distinct_id:a,device_id:b},this.m("context"));b=new URLSearchParams;b.set("context",JSON.stringify(a));b.set("token",this.oa("token"));b.set("mp_lib","web");b.set("$lib_version","2.70.0");a=this.tb()+"?"+b.toString();this.Za=Date.now();return this.sb=r.fetch(a,{method:"GET",headers:{Authorization:"Basic "+
|
|
73
|
+
btoa(this.oa("token")+":")}}).then(function(c){this.Fb();return c.json().then(function(e){e=e.flags;if(!e)throw Error("No flags in API response");var f=new Map;d.h(e,function(g,k){f.set(k,{key:g.variant_key,value:g.variant_value})});this.flags=f}.bind(this)).catch(function(e){this.Fb();K.error(e)}.bind(this))}.bind(this)).catch(function(c){this.Fb();K.error(c)}.bind(this))};A.prototype.Fb=function(){this.Za?(this.bc=this.Za,this.ac=Date.now(),this.td=this.ac-this.bc,this.Za=null):K.error("Fetch in progress started time not set, cannot mark fetch complete")};
|
|
74
|
+
A.prototype.xc=function(a,b){return this.sb?this.sb.then(function(){return this.wb(a,b)}.bind(this)).catch(function(c){K.error(c);return b}):new Promise(function(c){K.s("Feature Flags not initialized");c(b)})};A.prototype.wb=function(a,b){if(!this.jc())return K.log("Flags not loaded yet"),b;var c=this.flags.get(a);if(!c)return K.log('No flag found: "'+a+'"'),b;this.df(a,c);return c};A.prototype.xb=function(a,b){return this.xc(a,{value:b}).then(function(c){return c.value}).catch(function(c){K.error(c);
|
|
75
|
+
return b})};A.prototype.Vd=function(a,b){K.s("mixpanel.flags.get_feature_data() is deprecated and will be removed in a future release. Use mixpanel.flags.get_variant_value() instead.");return this.xb(a,b)};A.prototype.yc=function(a,b){return this.wb(a,{value:b}).value};A.prototype.isEnabled=function(a,b){return this.xb(a).then(function(){return this.Hc(a,b)}.bind(this)).catch(function(c){K.error(c);return b})};A.prototype.Hc=function(a,b){b=b||!1;var c=this.yc(a,b);!0!==c&&!1!==c&&(K.error('Feature flag "'+
|
|
76
|
+
a+'" value: '+c+" is not a boolean; returning fallback value: "+b),c=b);return c};A.prototype.df=function(a,b){this.gd.has(a)||(this.gd.add(a),this.track("$experiment_started",{"Experiment name":a,"Variant name":b.key,$experiment_type:"feature_flag","Variant fetch start time":(new Date(this.bc)).toISOString(),"Variant fetch complete time":(new Date(this.ac)).toISOString(),"Variant fetch latency (ms)":this.td}))};Za(A);A.prototype.are_flags_ready=A.prototype.jc;A.prototype.get_variant=A.prototype.xc;
|
|
77
|
+
A.prototype.get_variant_sync=A.prototype.wb;A.prototype.get_variant_value=A.prototype.xb;A.prototype.get_variant_value_sync=A.prototype.yc;A.prototype.is_enabled=A.prototype.isEnabled;A.prototype.is_enabled_sync=A.prototype.Hc;A.prototype.update_context=A.prototype.lf;A.prototype.get_feature_data=A.prototype.Vd;Q.prototype.Ga=function(){};Q.prototype.pb=function(){};Q.prototype.hb=function(){};Q.prototype.B=function(a){this.A=a;return this};Q.prototype.track=function(a,b,c,e){var f=this,g=d.Nd(a);
|
|
78
|
+
if(0===g.length)z.error("The DOM query ("+a+") returned 0 elements");else return d.h(g,function(k){d.Tc(k,this.Mc,function(h){var p={},q=f.Ga(c,this),n=f.A.g("track_links_timeout");f.pb(h,this,p);window.setTimeout(f.fd(e,q,p,!0),n);f.A.track(b,q,f.fd(e,q,p))})},this),!0};Q.prototype.fd=function(a,b,c,e){e=e||!1;var f=this;return function(){c.Hd||(c.Hd=!0,a&&!1===a(e,b)||f.hb(c))}};Q.prototype.Ga=function(a,b){return"function"===typeof a?a(b):d.extend({},a)};d.Fc(ba,Q);ba.prototype.Ga=function(a,b){var c=
|
|
79
|
+
ba.Ze.Ga.apply(this,arguments);b.href&&(c.url=b.href);return c};ba.prototype.pb=function(a,b,c){c.Jc=2===a.which||a.metaKey||a.ctrlKey||"_blank"===b.target;c.href=b.href;c.Jc||a.preventDefault()};ba.prototype.hb=function(a){a.Jc||setTimeout(function(){window.location=a.href},0)};d.Fc(na,Q);na.prototype.pb=function(a,b,c){c.element=b;a.preventDefault()};na.prototype.hb=function(a){setTimeout(function(){a.element.submit()},0)};var cc=ia("lock");Va.prototype.Tb=function(a,b){return new this.Rc(d.bind(function(c,
|
|
80
|
+
e){function f(){function L(){u.removeItem(N);u.getItem(v)===q&&u.removeItem(v);u.getItem(G)===q&&u.removeItem(G)}u.setItem(N,"1");a().then(function(X){L();c(X)}).catch(function(X){L();e(X)})}function g(){u.setItem(G,q);h(k,function(){u.getItem(G)===q?f():p(function(){u.getItem(v)!==q?g():h(function(){return!u.getItem(N)},f)})})}function k(){var L=u.getItem(v);if(L&&L!==q)return!1;u.setItem(v,q);if(u.getItem(v)===q)return!0;oa(u,!0)||e(Error("localStorage support dropped while acquiring lock"));return!1}
|
|
81
|
+
function h(L,X){L()?X():p(function(){h(L,X)})}function p(L){(new Date).getTime()-n>w?(cc.error("Timeout waiting for mutex on "+m+"; clearing lock. ["+q+"]"),u.removeItem(N),u.removeItem(v),g()):setTimeout(function(){try{L()}catch(X){e(X)}},t*(Math.random()+.1))}var q=b||(new Date).getTime()+"|"+Math.random(),n=(new Date).getTime(),m=this.ca,t=this.Qc,w=this.Pb,u=this.storage,G=m+":X",v=m+":Y",N=m+":Z";try{if(oa(u,!0))g();else throw Error("localStorage support check failed");}catch(L){e(L)}},this))};
|
|
82
|
+
fa.prototype.B=function(){return D.resolve()};fa.prototype.setItem=function(a,b){return new D(d.bind(function(c,e){try{this.storage.setItem(a,da(b))}catch(f){e(f)}c()},this))};fa.prototype.getItem=function(a){return new D(d.bind(function(b,c){try{var e=ua(this.storage.getItem(a))}catch(f){c(f)}b(e)},this))};fa.prototype.removeItem=function(a){return new D(d.bind(function(b,c){try{this.storage.removeItem(a)}catch(e){c(e)}b()},this))};var Wa=ia("batch");O.prototype.T=function(){return this.Ab||!this.C?
|
|
83
|
+
D.resolve():this.P.B().then(d.bind(function(){this.Ab=!0},this)).catch(d.bind(function(a){this.o("Error initializing queue persistence. Disabling persistence",a);this.Ab=!0;this.C=!1},this))};O.prototype.enqueue=function(a,b){a={id:za(),flushAfter:(new Date).getTime()+2*b,payload:a};if(this.C)return this.Pd(a);this.K.push(a);return D.resolve(!0)};O.prototype.Zb=function(a){var b=d.bind(function(){return this.T().then(d.bind(function(){return this.wa()},this)).then(d.bind(function(c){return this.Jb(c.concat(a))},
|
|
84
|
+
this)).then(d.bind(function(c){c&&(this.K=this.K.concat(a));return c},this)).catch(d.bind(function(c){this.o("Error enqueueing items",c,a);return!1},this))},this);return this.lock.Tb(b,this.Qa).catch(d.bind(function(c){this.o("Error acquiring storage lock",c);return!1},this))};O.prototype.Rd=function(a){var b=this.K.slice(0,a);return this.C&&b.length<a?this.T().then(d.bind(function(){return this.wa()},this)).then(d.bind(function(c){if(c.length){var e={};d.h(b,function(k){e[k.id]=!0});for(var f=0;f<
|
|
85
|
+
c.length;f++){var g=c[f];if((new Date).getTime()>g.flushAfter&&!e[g.id]&&(g.xe=!0,b.push(g),b.length>=a))break}}return b},this)):D.resolve(b)};O.prototype.Ae=function(a){var b={};d.h(a,function(e){b[e]=!0});this.K=Ua(this.K,b);if(this.C){var c=d.bind(function(){return this.T().then(d.bind(function(){return this.wa()},this)).then(d.bind(function(e){e=Ua(e,b);return this.Jb(e)},this)).then(d.bind(function(){return this.wa()},this)).then(d.bind(function(e){for(var f=0;f<e.length;f++){var g=e[f];if(g.id&&
|
|
86
|
+
b[g.id])throw Error("Item not removed from storage");}return!0},this)).catch(d.bind(function(e){this.o("Error removing items",e,a);return!1},this))},this);return this.lock.Tb(c,this.Qa).catch(d.bind(function(e){this.o("Error acquiring storage lock",e);return oa(this.lock.storage,!0)?!1:c().then(d.bind(function(f){return f?f:this.P.removeItem(this.ca).then(function(){return f})},this)).catch(d.bind(function(f){this.o("Error clearing queue",f);return!1},this))},this))}return D.resolve(!0)};O.prototype.mf=
|
|
87
|
+
function(a){this.K=Ta(this.K,a);return this.C?this.lock.Tb(d.bind(function(){return this.T().then(d.bind(function(){return this.wa()},this)).then(d.bind(function(b){b=Ta(b,a);return this.Jb(b)},this)).catch(d.bind(function(b){this.o("Error updating items",a,b);return!1},this))},this),this.Qa).catch(d.bind(function(b){this.o("Error acquiring storage lock",b);return!1},this)):D.resolve(!0)};O.prototype.wa=function(){return this.T().then(d.bind(function(){return this.P.getItem(this.ca)},this)).then(d.bind(function(a){a&&
|
|
88
|
+
!d.isArray(a)&&(this.o("Invalid storage entry:",a),a=null);return a||[]},this)).catch(d.bind(function(a){this.o("Error retrieving queue",a);return[]},this))};O.prototype.Jb=function(a){return this.T().then(d.bind(function(){return this.P.setItem(this.ca,a)},this)).then(function(){return!0}).catch(d.bind(function(b){this.o("Error saving queue",b);return!1},this))};O.prototype.clear=function(){this.K=[];return this.C?this.T().then(d.bind(function(){return this.P.removeItem(this.ca)},this)):D.resolve()};
|
|
89
|
+
var la=ia("batch");M.prototype.enqueue=function(a){return this.ua.enqueue(a,this.Ja)};M.prototype.start=function(){this.stopped=!1;this.lb=0;return this.flush()};M.prototype.stop=function(){this.stopped=!0;this.Ob&&(clearTimeout(this.Ob),this.Ob=null)};M.prototype.clear=function(){return this.ua.clear()};M.prototype.Vc=function(){this.S=this.O.batch_size};M.prototype.aa=function(){this.Xc(this.O.batch_flush_interval_ms)};M.prototype.Xc=function(a){this.Ja=a;this.stopped||(this.Ob=setTimeout(d.bind(function(){this.stopped||
|
|
90
|
+
this.flush()},this),this.Ja))};M.prototype.Je=function(a,b){return new D(d.bind(function(c){this.He(a,b,c)},this))};M.prototype.flush=function(a){if(this.Ib)return la.log("Flush: Request already in progress"),D.resolve();this.Ib=!0;a=a||{};var b=this.O.batch_request_timeout_ms,c=(new Date).getTime(),e=this.S;return this.ua.Rd(e).then(d.bind(function(f){var g=f.length===e,k=[],h={};d.h(f,function(m){var t=m.payload;this.Da&&!m.xe&&(t=this.Da(t));if(t){t.event&&t.properties&&(t.properties=d.extend({},
|
|
91
|
+
t.properties,{mp_sent_by_lib_version:"2.70.0"}));var w=!0,u=m.id;u?5<(this.V[u]||0)&&(this.o("[dupe] item ID sent too many times, not sending",{item:m,S:f.length,bf:this.V[u]}),w=!1):this.o("[dupe] found item with no ID",{item:m});w&&k.push(t)}h[m.id]=t},this);if(1>k.length)return this.Ib=!1,this.aa(),D.resolve();var p=d.bind(function(){return this.ua.Ae(d.map(f,function(m){return m.id})).then(d.bind(function(m){d.h(f,d.bind(function(t){var w=t.id;w?(this.V[w]=this.V[w]||0,this.V[w]++,5<this.V[w]&&
|
|
92
|
+
this.o("[dupe] item ID sent too many times",{item:t,S:f.length,bf:this.V[w]})):this.o("[dupe] found item with no ID while removing",{item:t})},this));if(m)return this.lb=0,this.vc&&!g?(this.aa(),D.resolve()):this.flush();5<++this.lb?(this.o("Too many queue failures; disabling batching system."),this.Ve()):this.aa();return D.resolve()},this))},this),q=d.bind(function(m){this.Ib=!1;try{if(a.jd)return this.ua.mf(h);if(d.j(m)&&"timeout"===m.error&&(new Date).getTime()-c>=b)return this.o("Network timeout; retrying"),
|
|
93
|
+
this.flush();var t;if(t=d.j(m)){var w;if(!(w=500<=m.La||429===m.La)){var u;if(u=0>=m.La){var G=r.navigator.onLine;u=!(d.l(G)||G)}w=u}t=w||"timeout"===m.error}if(t){var v=2*this.Ja;m.Wc&&(v=1E3*parseInt(m.Wc,10)||v);v=Math.min(6E5,v);this.o("Error; retry in "+v+" ms");this.Xc(v);return D.resolve()}if(d.j(m)&&413===m.La){if(1<f.length)return this.S=Math.min(this.S,Math.max(1,Math.floor(e/2)),f.length-1),this.o("413 response; reducing batch size to "+this.S),this.aa(),D.resolve();this.o("Single-event request too large; dropping",
|
|
94
|
+
f);this.Vc()}return p()}catch(N){this.o("Error handling API response",N),this.aa()}},this),n={method:"POST",nd:!0,ae:!0,ed:b};a.jd&&(n.Rb="sendBeacon");la.log("MIXPANEL REQUEST:",k);return this.Je(k,n).then(q)},this)).catch(d.bind(function(f){this.o("Error flushing request queue",f);this.aa()},this))};M.prototype.o=function(a,b){la.error.apply(la.error,arguments);if(this.Y)try{b instanceof Error||(b=Error(a)),this.Y(a,b)}catch(c){la.error(c)}};var Ab={Zc:function(a,b){var c={},e={};d.j(a)?d.h(a,function(f,
|
|
95
|
+
g){this.M(g)||(e[g]=f)},this):e[a]=b;c.$set=e;return c},kd:function(a){var b={},c=[];d.isArray(a)||(a=[a]);d.h(a,function(e){this.M(e)||c.push(e)},this);b.$unset=c;return b},ad:function(a,b){var c={},e={};d.j(a)?d.h(a,function(f,g){this.M(g)||(e[g]=f)},this):e[a]=b;c.$set_once=e;return c},hd:function(a,b){var c={},e={};d.j(a)?d.h(a,function(f,g){this.M(g)||(e[g]=d.isArray(f)?f:[f])},this):e[a]=d.isArray(b)?b:[b];c.$union=e;return c},Cd:function(a,b){var c={},e={};d.j(a)?d.h(a,function(f,g){this.M(g)||
|
|
96
|
+
(e[g]=f)},this):e[a]=b;c.$append=e;return c},Uc:function(a,b){var c={},e={};d.j(a)?d.h(a,function(f,g){this.M(g)||(e[g]=f)},this):e[a]=b;c.$remove=e;return c},rf:function(){return{$delete:""}}};d.extend(C.prototype,Ab);C.prototype.la=function(a,b,c){this.i=a;this.cb=b;this.bb=c};C.prototype.set=ca(function(a,b,c){var e=this.Zc(a,b);d.j(a)&&(c=b);return this.u(e,c)});C.prototype.ba=ca(function(a,b,c){var e=this.ad(a,b);d.j(a)&&(c=b);return this.u(e,c)});C.prototype.Sa=ca(function(a,b){a=this.kd(a);
|
|
97
|
+
return this.u(a,b)});C.prototype.ya=ca(function(a,b,c){d.j(a)&&(c=b);a=this.hd(a,b);return this.u(a,c)});C.prototype["delete"]=ca(function(a){return this.u({$delete:""},a)});C.prototype.remove=ca(function(a,b,c){a=this.Uc(a,b);return this.u(a,c)});C.prototype.u=function(a,b){a.$group_key=this.cb;a.$group_id=this.bb;a.$token=this.I("token");a=d.nb(a);return this.i.gb({type:"groups",data:a,endpoint:this.i.$("groups")+"/"+this.I("api_routes").groups,jb:this.i.H.groups},b)};C.prototype.M=function(a){return"$group_key"===
|
|
98
|
+
a||"$group_id"===a};C.prototype.I=function(a){return this.i.g(a)};C.prototype.toString=function(){return this.i.toString()+".group."+this.cb+"."+this.bb};C.prototype.remove=C.prototype.remove;C.prototype.set=C.prototype.set;C.prototype.set_once=C.prototype.ba;C.prototype.union=C.prototype.ya;C.prototype.unset=C.prototype.Sa;C.prototype.toString=C.prototype.toString;d.extend(x.prototype,Ab);x.prototype.la=function(a){this.i=a};x.prototype.set=V(function(a,b,c){var e=this.Zc(a,b);d.j(a)&&(c=b);this.I("save_referrer")&&
|
|
99
|
+
this.i.persistence.Sb(document.referrer);e.$set=d.extend({},d.info.ze(),e.$set);return this.u(e,c)});x.prototype.ba=V(function(a,b,c){var e=this.ad(a,b);d.j(a)&&(c=b);return this.u(e,c)});x.prototype.Sa=V(function(a,b){a=this.kd(a);return this.u(a,b)});x.prototype.Ec=V(function(a,b,c){var e={},f={};d.j(a)?(d.h(a,function(g,k){this.M(k)||(isNaN(parseFloat(g))?z.error("Invalid increment value passed to mixpanel.people.increment - must be a number"):f[k]=g)},this),c=b):(d.l(b)&&(b=1),f[a]=b);e.$add=
|
|
100
|
+
f;return this.u(e,c)});x.prototype.append=V(function(a,b,c){d.j(a)&&(c=b);a=this.Cd(a,b);return this.u(a,c)});x.prototype.remove=V(function(a,b,c){d.j(a)&&(c=b);a=this.Uc(a,b);return this.u(a,c)});x.prototype.ya=V(function(a,b,c){d.j(a)&&(c=b);a=this.hd(a,b);return this.u(a,c)});x.prototype.ff=V(function(){z.error("mixpanel.people.track_charge() is deprecated and no longer has any effect.")});x.prototype.lc=function(a){return this.set("$transactions",[],a)};x.prototype.tc=function(){if(this.eb()){var a=
|
|
101
|
+
{$delete:this.i.U()};return this.u(a)}z.error("mixpanel.people.delete_user() requires you to call identify() first")};x.prototype.toString=function(){return this.i.toString()+".people"};x.prototype.u=function(a,b){a.$token=this.I("token");a.$distinct_id=this.i.U();var c=this.i.F("$device_id"),e=this.i.F("$user_id"),f=this.i.F("$had_persisted_distinct_id");c&&(a.$device_id=c);e&&(a.$user_id=e);f&&(a.$had_persisted_distinct_id=f);c=d.nb(a);return this.eb()?this.i.gb({type:"people",data:c,endpoint:this.i.$("people")+
|
|
102
|
+
"/"+this.I("api_routes").engage,jb:this.i.H.Hb},b):(this.sd(a),d.l(b)||(this.I("verbose")?b({status:-1,error:null}):b(-1)),d.truncate(c,255))};x.prototype.I=function(a){return this.i.g(a)};x.prototype.eb=function(){return!0===this.i.ia.Cc};x.prototype.sd=function(a){"$set"in a?this.i.persistence.G("$set",a):"$set_once"in a?this.i.persistence.G("$set_once",a):"$unset"in a?this.i.persistence.G("$unset",a):"$add"in a?this.i.persistence.G("$add",a):"$append"in a?this.i.persistence.G("$append",a):"$remove"in
|
|
103
|
+
a?this.i.persistence.G("$remove",a):"$union"in a?this.i.persistence.G("$union",a):z.error("Invalid call to _enqueue():",a)};x.prototype.ja=function(a,b,c,e){var f=this,g=d.extend({},this.i.persistence.ra(a)),k=g;d.l(g)||!d.j(g)||d.Ma(g)||(f.i.persistence.J(a,g),f.i.persistence.save(),e&&(k=e(g)),b.call(f,k,function(h,p){0===h&&f.i.persistence.G(a,g);d.l(c)||c(h,p)}))};x.prototype.ud=function(a,b,c,e,f,g,k){var h=this;this.ja("$set",this.set,a);this.ja("$set_once",this.ba,e);this.ja("$unset",this.Sa,
|
|
104
|
+
g,function(n){return d.keys(n)});this.ja("$add",this.Ec,b);this.ja("$union",this.ya,f);a=this.i.persistence.ra("$append");if(!d.l(a)&&d.isArray(a)&&a.length)for(b=function(n,m){0===n&&h.i.persistence.G("$append",p);d.l(c)||c(n,m)},e=a.length-1;0<=e;e--){a=this.i.persistence.ra("$append");var p=a.pop();h.i.persistence.save();d.Ma(p)||h.append(p,b)}a=this.i.persistence.ra("$remove");if(!d.l(a)&&d.isArray(a)&&a.length)for(b=function(n,m){0===n&&h.i.persistence.G("$remove",q);d.l(k)||k(n,m)},e=a.length-
|
|
105
|
+
1;0<=e;e--){a=this.i.persistence.ra("$remove");var q=a.pop();h.i.persistence.save();d.Ma(q)||h.remove(q,b)}};x.prototype.M=function(a){return"$distinct_id"===a||"$token"===a||"$device_id"===a||"$user_id"===a||"$had_persisted_distinct_id"===a};x.prototype.set=x.prototype.set;x.prototype.set_once=x.prototype.ba;x.prototype.unset=x.prototype.Sa;x.prototype.increment=x.prototype.Ec;x.prototype.append=x.prototype.append;x.prototype.remove=x.prototype.remove;x.prototype.union=x.prototype.ya;x.prototype.track_charge=
|
|
106
|
+
x.prototype.ff;x.prototype.clear_charges=x.prototype.lc;x.prototype.delete_user=x.prototype.tc;x.prototype.toString=x.prototype.toString;var dc="__mps __mpso __mpus __mpa __mpap __mpr __mpu $people_distinct_id __alias __timers".split(" ");y.prototype.ta=function(){var a={};this.load();d.h(this.props,function(b,c){d.zb(dc,c)||(a[c]=b)});return a};y.prototype.load=function(){if(!this.disabled){var a=this.storage.parse(this.name);a&&(this.props=d.extend({},a))}};y.prototype.upgrade=function(){if(this.storage===
|
|
107
|
+
d.localStorage){var a=d.cookie.parse(this.name);d.cookie.remove(this.name);d.cookie.remove(this.name,!0);a&&this.L(a)}else this.storage===d.cookie&&(a=d.localStorage.parse(this.name),d.localStorage.remove(this.name),a&&this.L(a))};y.prototype.save=function(){this.disabled||this.storage.set(this.name,da(this.props),this.qb,this.mb,this.Yc,this.rc,this.Fa)};y.prototype.Oa=function(a){this.load();return this.props[a]};y.prototype.remove=function(){this.storage.remove(this.name,!1,this.Fa);this.storage.remove(this.name,
|
|
108
|
+
!0,this.Fa)};y.prototype.clear=function(){this.remove();this.props={}};y.prototype.L=function(a,b,c){return d.j(a)?("undefined"===typeof b&&(b="None"),this.qb="undefined"===typeof c?this.sc:c,this.load(),d.h(a,function(e,f){this.props.hasOwnProperty(f)&&this.props[f]!==b||(this.props[f]=e)},this),this.save(),!0):!1};y.prototype.register=function(a,b){return d.j(a)?(this.qb="undefined"===typeof b?this.sc:b,this.load(),d.extend(this.props,a),this.save(),!0):!1};y.prototype.unregister=function(a){this.load();
|
|
109
|
+
a in this.props&&(delete this.props[a],this.save())};y.prototype.md=function(a){this.register(d.info.Fe(a))};y.prototype.Sb=function(a){this.L({$initial_referrer:a||"$direct",$initial_referring_domain:d.info.Sc(a)||"$direct"},"")};y.prototype.Zd=function(){return d.da({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})};y.prototype.ld=function(a){this.sc=this.qb=a.cookie_expiration;this.$c(a.disable_persistence);this.Ne(a.cookie_domain);
|
|
110
|
+
this.Oe(a.cross_site_cookie);this.Pe(a.cross_subdomain_cookie);this.Se(a.secure_cookie)};y.prototype.$c=function(a){(this.disabled=a)?this.remove():this.save()};y.prototype.Ne=function(a){a!==this.Fa&&(this.remove(),this.Fa=a,this.save())};y.prototype.Oe=function(a){a!==this.rc&&(this.rc=a,this.remove(),this.save())};y.prototype.Pe=function(a){a!==this.mb&&(this.mb=a,this.remove(),this.save())};y.prototype.Xd=function(){return this.mb};y.prototype.Se=function(a){a!==this.Yc&&(this.Yc=a?!0:!1,this.remove(),
|
|
111
|
+
this.save())};y.prototype.G=function(a,b){var c=this.Aa(a);a=b[a];var e=this.R("$set"),f=this.R("$set_once"),g=this.R("$unset"),k=this.R("$add"),h=this.R("$union"),p=this.R("$remove",[]),q=this.R("$append",[]);"__mps"===c?(d.extend(e,a),this.J("$add",a),this.J("$union",a),this.J("$unset",a)):"__mpso"===c?(d.h(a,function(n,m){m in f||(f[m]=n)}),this.J("$unset",a)):"__mpus"===c?d.h(a,function(n){d.h([e,f,k,h],function(m){n in m&&delete m[n]});d.h(q,function(m){n in m&&delete m[n]});g[n]=!0}):"__mpa"===
|
|
112
|
+
c?(d.h(a,function(n,m){m in e?e[m]+=n:(m in k||(k[m]=0),k[m]+=n)},this),this.J("$unset",a)):"__mpu"===c?(d.h(a,function(n,m){d.isArray(n)&&(m in h||(h[m]=[]),d.h(n,function(t){d.zb(h[m],t)||h[m].push(t)}))}),this.J("$unset",a)):"__mpr"===c?(p.push(a),this.J("$append",a)):"__mpap"===c&&(q.push(a),this.J("$unset",a));z.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):");z.log(b);this.save()};y.prototype.J=function(a,b){var c=this.props[this.Aa(a)];d.l(c)||d.h(b,function(e,f){"$append"===a||"$remove"===
|
|
113
|
+
a?d.h(c,function(g){g[f]===e&&delete g[f]}):delete c[f]},this)};y.prototype.ra=function(a){return this.Oa(this.Aa(a))};y.prototype.Aa=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";z.error("Invalid queue:",a)};y.prototype.R=function(a,b){a=this.Aa(a);b=d.l(b)?{}:b;return this.props[a]||(this.props[a]=b)};y.prototype.Qe=function(a){var b=
|
|
114
|
+
(new Date).getTime(),c=this.Oa("__timers")||{};c[a]=b;this.props.__timers=c;this.save()};y.prototype.Be=function(a){var b=(this.Oa("__timers")||{})[a];d.l(b)||(delete this.props.__timers[a],this.save());return b};var ec=["mixpanelRecordingEvents","mixpanelRecordingRegistry"];T.prototype.cc=function(){return new D(function(a,b){var c=r.indexedDB.open("mixpanelBrowserDb",1);c.onerror=function(){b(c.error)};c.onsuccess=function(){a(c.result)};c.onupgradeneeded=function(e){var f=e.target.result;ec.forEach(function(g){f.createObjectStore(g)})}})};
|
|
115
|
+
T.prototype.B=function(){if(!r.indexedDB)return D.reject("indexedDB is not supported in this browser");this.X||(this.X=this.cc());return this.X.then(function(a){return a instanceof r.IDBDatabase?D.resolve():D.reject(a)})};T.prototype.Pa=function(a,b){function c(f){return new D(function(g,k){var h=f.transaction(e,a);h.oncomplete=function(){g(h)};h.onabort=h.onerror=function(){k(h.error)};b(h.objectStore(e))})}var e=this.Xe;return this.X.then(c).catch(function(f){return f&&"InvalidStateError"===f.name?
|
|
116
|
+
(this.X=this.cc(),this.X.then(c)):D.reject(f)}.bind(this))};T.prototype.setItem=function(a,b){return this.Pa("readwrite",function(c){c.put(b,a)})};T.prototype.getItem=function(a){var b;return this.Pa("readonly",function(c){b=c.get(a)}).then(function(){return b.result})};T.prototype.removeItem=function(a){return this.Pa("readwrite",function(b){b.delete(a)})};T.prototype.getAll=function(){var a;return this.Pa("readonly",function(b){a=b.getAll()}).then(function(){return a.result})};var xa,E,ea=r.XMLHttpRequest&&
|
|
117
|
+
"withCredentials"in new XMLHttpRequest,Ra=!ea&&-1===H.indexOf("MSIE")&&-1===H.indexOf("Mozilla"),wa=null;W.sendBeacon&&(wa=function(){return W.sendBeacon.apply(W,arguments)});var Bb={track:"track/",engage:"engage/",groups:"groups/",record:"record/",flags:"flags/"},Cb={api_host:"https://api-js.mixpanel.com",api_hosts:{},api_routes:Bb,api_extra_query_params:{},api_method:"POST",api_transport:"XHR",api_payload_format:"base64",app_host:"https://mixpanel.com",autocapture:!1,cdn:"https://cdn.mxpnl.com",
|
|
118
|
+
cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:ha,flags:!1,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:ha,mp_loader:null,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,stop_utm_persistence:!1,save_referrer:!0,test:!1,verbose:!1,img:!1,debug:!1,track_links_timeout:300,cookie_expiration:365,upgrade:!1,disable_persistence:!1,disable_cookie:!1,secure_cookie:!1,ip:!0,opt_out_tracking_by_default:!1,opt_out_persistence_by_default:!1,
|
|
119
|
+
opt_out_tracking_persistence_type:"localStorage",opt_out_tracking_cookie_prefix:null,property_blacklist:[],xhr_headers:{},ignore_dnt:!1,batch_requests:!0,batch_size:50,batch_flush_interval_ms:5E3,batch_request_timeout_ms:9E4,batch_autostart:!0,hooks:{},record_block_class:/^(mp-block|fs-exclude|amp-block|rr-block|ph-no-capture)$/,record_block_selector:"img, video, audio",record_canvas:!1,record_collect_fonts:!1,record_heatmap_data:!1,record_idle_timeout_ms:18E5,record_mask_text_class:/^(mp-mask|fs-mask|amp-mask|rr-mask|ph-mask)$/,
|
|
120
|
+
record_mask_text_selector:"*",record_max_ms:864E5,record_min_ms:0,record_sessions_percent:0,recorder_src:"https://cdn.mxpnl.com/libs/mixpanel-recorder.min.js"},Qa=!1;l.prototype.B=function(a,b,c){if(d.l(c))this.v("You must name your new library: init(token, config, name)");else if("mixpanel"===c)this.v("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");else return a=ma(a,b,c),E[c]=a,a.Ba(),a};l.prototype.la=function(a,b,c){b=b||{};this.__loaded=!0;this.config=
|
|
121
|
+
{};var e={};"api_payload_format"in b||(b.api_host||Cb.api_host).match(/\.mixpanel\.com/)&&(e.api_payload_format="json");this.Kb(d.extend({},Cb,e,b,{name:c,token:a,callback_fn:("mixpanel"===c?c:"mixpanel."+c)+"._jsc"}));this._jsc=ha;this.Va=[];this.Wa=[];this.Ua=[];this.ia={disable_all_events:!1,identify_called:!1};this.H={};if(this.ha=this.g("batch_requests"))if(d.localStorage.qa(!0)&&ea){if(this.he(),wa&&r.addEventListener){var f=d.bind(function(){this.H.Z.stopped||this.H.Z.flush({jd:!0})},this);
|
|
122
|
+
r.addEventListener("pagehide",function(g){g.persisted&&f()});r.addEventListener("visibilitychange",function(){"hidden"===B.visibilityState&&f()})}}else this.ha=!1,z.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),d.h(this.zc(),function(g){z.log("Clearing batch queue "+g.va);d.localStorage.remove(g.va)});this.persistence=this.cookie=new y(this.config);this.fa={};this.vd();a=d.Ta();this.U()||this.L({distinct_id:"$device:"+a,$device_id:a},"");this.flags=new A({tb:d.bind(function(){return this.$("flags")+
|
|
123
|
+
"/"+this.g("api_routes").flags},this),Ud:d.bind(this.g,this),Le:d.bind(this.Kb,this),Wd:d.bind(this.F,this),kf:d.bind(this.track,this)});this.flags.B();this.flags=this.flags;this.ib=new I(this);this.ib.B();this.wd();this.Xa()};l.prototype.wd=function(){if(this.g("disable_persistence"))z.log("Tab ID initialization skipped due to disable_persistence config");else if(d.sessionStorage.qa())try{var a=this.g("name")+"_"+this.g("token"),b="mp_tab_id_"+a,c="mp_gen_new_tab_id_"+a;!d.sessionStorage.get(c)&&
|
|
124
|
+
d.sessionStorage.get(b)||d.sessionStorage.set(b,"$tab-"+d.Ta());d.sessionStorage.set(c,"1");this.$e=d.sessionStorage.get(b);r.addEventListener("beforeunload",function(){d.sessionStorage.remove(c)})}catch(e){this.v("Error initializing tab id",e)}else this.v("Session storage is not supported, cannot keep track of unique tab ID.")};l.prototype.Bc=function(){return this.$e||null};l.prototype.xd=function(){if(this.g("disable_persistence"))return z.log("Load recorder check skipped due to disable_persistence config"),
|
|
124
125
|
Promise.resolve(!1);var a=new T("mixpanelRecordingRegistry"),b=this.Bc();return a.B().then(function(){return a.getAll()}).then(function(c){for(var e=0;e<c.length;e++){var f=c[e],g=Date.now();if(!f||g>f.maxExpires||g>f.idleExpires||c[e].tabId===b)return!0}return!1}).catch(d.bind(function(c){this.v("Error checking recording registry",c)},this))};l.prototype.Xa=Y(function(a){if(r.MutationObserver){var b=d.bind(function(e){var f=d.bind(function(){this.D=this.D||new r.__mp_recorder(this);this.D.resumeRecording(e)},
|
|
125
126
|
this);d.l(r.__mp_recorder)?Sa(this.g("recorder_src"),f):f()},this),c=0<this.g("record_sessions_percent")&&100*Math.random()<=this.g("record_sessions_percent");a||c?b(!0):this.xd().then(function(e){e&&b(!1)})}else z.s("Browser does not support MutationObserver; skipping session recording")});l.prototype.Ue=function(){this.Xa(!0)};l.prototype.Nb=function(){return this.D?this.D.stopRecording():Promise.resolve()};l.prototype.ye=function(){return this.D?this.D.pauseRecording():Promise.resolve()};l.prototype.De=
|
|
126
127
|
function(){return this.D?this.D.resumeRecording():Promise.resolve()};l.prototype.Eb=function(){return this.ab()&&this.g("record_heatmap_data")};l.prototype.Ac=function(){var a={},b=this.ab();b&&(a.$mp_replay_id=b);return a};l.prototype.$d=function(){var a=null,b=this.ab();b&&(a="https://mixpanel.com/projects/replay-redirect?"+d.Ub({replay_id:b,distinct_id:this.U(),token:this.g("token")}));return a};l.prototype.ab=function(){var a=null;this.D&&(a=this.D.replayId);return a||null};l.prototype.od=function(){return this.D};
|
|
127
|
-
l.prototype.
|
|
128
|
-
a)},this);this.
|
|
128
|
+
l.prototype.Ba=function(){this.g("loaded")(this);this.ic();this.people.ba(this.persistence.Zd());if(this.g("store_google")&&this.g("stop_utm_persistence")){var a=d.info.ma(null);d.h(a,function(b,c){this.unregister(c)}.bind(this))}};l.prototype.ic=function(){this.persistence.md(B.referrer);this.g("store_google")&&!this.g("stop_utm_persistence")&&this.register(d.info.ma());this.g("save_referrer")&&this.persistence.Sb(B.referrer)};l.prototype.rd=function(){d.h(this.Va,function(a){this.fb.apply(this,
|
|
129
|
+
a)},this);this.pa()||d.h(this.Wa,function(a){this.u.apply(this,a)},this);delete this.Va;delete this.Wa};l.prototype.fb=function(a,b){if(this.g("img"))return this.v("You can't use DOM tracking functions with img = true."),!1;if(!Qa)return this.Va.push([a,b]),!1;a=(new a).B(this);return a.track.apply(a,b)};l.prototype.dc=function(a,b){if(d.l(a))return null;if(ea)return function(g){a(g,b)};var c=this._jsc,e=""+Math.floor(1E8*Math.random()),f=this.g("callback_fn")+"["+e+"]";c[e]=function(g){delete c[e];
|
|
129
130
|
a(g,b)};return f};l.prototype.u=function(a,b,c,e){var f=!0;if(Ra)return this.Wa.push(arguments),f;var g={method:this.g("api_method"),Rb:this.g("api_transport"),nd:this.g("verbose")},k=null;e||!d.Bb(c)&&"string"!==typeof c||(e=c,c=null);c=d.extend(g,c||{});ea||(c.method="GET");g="POST"===c.method;var h=wa&&g&&"sendbeacon"===c.Rb.toLowerCase(),p=c.nd;b.verbose&&(p=!0);this.g("test")&&(b.test=1);p&&(b.verbose=1);this.g("img")&&(b.img=1);if(!ea)if(e)b.callback=e;else if(p||this.g("test"))b.callback="(function(){})";
|
|
130
131
|
b.ip=this.g("ip")?1:0;b._=(new Date).getTime().toString();g&&(k="data="+encodeURIComponent(b.data),delete b.data);d.extend(b,this.g("api_extra_query_params"));a+="?"+d.Ub(b);var q=this;if("img"in b)k=B.createElement("img"),k.src=a,B.body.appendChild(k);else if(h){try{f=wa(a,k)}catch(w){q.v(w),f=!1}try{e&&e(f?1:0)}catch(w){q.v(w)}}else if(ea)try{var n=new XMLHttpRequest;n.open(c.method,a,!0);var m=this.g("xhr_headers");g&&(m["Content-Type"]="application/x-www-form-urlencoded");d.h(m,function(w,u){n.setRequestHeader(u,
|
|
131
132
|
w)});if(c.ed&&"undefined"!==typeof n.timeout){n.timeout=c.ed;var t=(new Date).getTime()}n.withCredentials=!0;n.onreadystatechange=function(){if(4===n.readyState)if(200===n.status){if(e)if(p){try{var w=d.ga(n.responseText)}catch(u){if(q.v(u),c.ae)w=n.responseText;else return}e(w)}else e(Number(n.responseText))}else w=n.timeout&&!n.status&&(new Date).getTime()-t>=n.timeout?"timeout":"Bad HTTP status: "+n.status+" "+n.statusText,q.v(w),e&&(p?e({status:0,La:n.status,error:w,Wc:(n.responseHeaders||{})["Retry-After"]}):
|
|
132
133
|
e(0))};n.send(k)}catch(w){q.v(w),f=!1}else k=B.createElement("script"),k.type="text/javascript",k.async=!0,k.defer=!0,k.src=a,m=B.getElementsByTagName("script")[0],m.parentNode.insertBefore(k,m);return f};l.prototype.Ya=function(a){function b(k,h){d.h(k,function(p){if(d.isArray(p[0])){var q=h;d.h(p,function(n){q=q[n[0]].apply(q,n.slice(1))})}else this[p[0]].apply(this,p.slice(1))},h)}var c,e=[],f=[],g=[];d.h(a,function(k){k&&(c=k[0],d.isArray(c)?g.push(k):"function"===typeof k?k.call(this):d.isArray(k)&&
|
|
133
|
-
"alias"===c?e.push(k):d.isArray(k)&&-1!==c.indexOf("track")&&"function"===typeof this[c]?g.push(k):f.push(k))},this);b(e,this);b(f,this);b(g,this)};l.prototype.kc=function(){return!!this.H.Z};l.prototype.zc=function(){var a="__mpq_"+this.g("token");return this.Wb=this.Wb||{Z:{type:"events",
|
|
134
|
-
Y:this.g("error_reporter"),Ie:d.bind(function(e,f,g){this.u(this.$(c.
|
|
134
|
+
"alias"===c?e.push(k):d.isArray(k)&&-1!==c.indexOf("track")&&"function"===typeof this[c]?g.push(k):f.push(k))},this);b(e,this);b(f,this);b(g,this)};l.prototype.kc=function(){return!!this.H.Z};l.prototype.zc=function(){var a="__mpq_"+this.g("token");return this.Wb=this.Wb||{Z:{type:"events",Ca:"track",va:a+"_ev"},Hb:{type:"people",Ca:"engage",va:a+"_pp"},groups:{type:"groups",Ca:"groups",va:a+"_gr"}}};l.prototype.he=function(){if(!this.kc()){var a=d.bind(function(c){return new M(c.va,{O:this.config,
|
|
135
|
+
Y:this.g("error_reporter"),Ie:d.bind(function(e,f,g){this.u(this.$(c.Ca)+"/"+this.g("api_routes")[c.Ca],this.Yb(e),f,this.dc(g,e))},this),Da:d.bind(function(e){return this.hc("before_send_"+c.type,e)},this),We:d.bind(this.Mb,this),C:!0})},this),b=this.zc();this.H={Z:a(b.Z),Hb:a(b.Hb),groups:a(b.groups)}}this.g("batch_autostart")&&this.Lb()};l.prototype.Lb=function(){this.pd=!0;this.kc()&&(this.ha=!0,d.h(this.H,function(a){a.start()}))};l.prototype.Mb=function(){this.ha=!1;d.h(this.H,function(a){a.stop();
|
|
135
136
|
a.clear()})};l.prototype.push=function(a){this.Ya([a])};l.prototype.disable=function(a){"undefined"===typeof a?this.ia.Md=!0:this.Ua=this.Ua.concat(a)};l.prototype.Yb=function(a){a=da(a);"base64"===this.g("api_payload_format")&&(a=d.Dd(a));return{data:a}};l.prototype.gb=function(a,b){var c=d.truncate(a.data,255),e=a.endpoint,f=a.jb,g=a.Te,k=a.Ke||{};b=b||ha;var h=!0,p=d.bind(function(){k.dd||(c=this.hc("before_send_"+a.type,c));return c?(z.log("MIXPANEL REQUEST:"),z.log(c),this.u(e,this.Yb(c),k,this.dc(b,
|
|
136
137
|
c))):null},this);this.ha&&!g?f.enqueue(c).then(function(q){q?b(1,c):p()}):h=p();return h&&c};l.prototype.track=Y(function(a,b,c,e){e||"function"!==typeof c||(e=c,c=null);c=c||{};var f=c.transport;f&&(c.Rb=f);f=c.send_immediately;"function"!==typeof e&&(e=ha);if(d.l(a))this.v("No event name provided to mixpanel.track");else if(this.$b(a))e(0);else{b=d.extend({},b);b.token=this.g("token");var g=this.persistence.Be(a);d.l(g)||(b.$duration=parseFloat((((new Date).getTime()-g)/1E3).toFixed(3)));this.ic();
|
|
137
|
-
g=this.g("track_marketing")?d.info.ue():{};b=d.extend({},d.info.
|
|
138
|
-
return this.people.set(a,b,c)});l.prototype.yd=Y(function(a,b,c){var e=this.F(a),f={};void 0===e?(f[a]=[b],this.register(f)):-1===e.indexOf(b)&&(e.push(b),f[a]=e,this.register(f));return this.people.
|
|
138
|
+
g=this.g("track_marketing")?d.info.ue():{};b=d.extend({},d.info.ta({mp_loader:this.g("mp_loader")}),g,this.persistence.ta(),this.fa,this.Ac(),b);g=this.g("property_blacklist");d.isArray(g)?d.h(g,function(k){delete b[k]}):this.v("Invalid value for property_blacklist config: "+g);return this.gb({type:"events",data:{event:a,properties:b},endpoint:this.$("events")+"/"+this.g("api_routes").track,jb:this.H.Z,Te:f,Ke:c},e)}});l.prototype.Re=Y(function(a,b,c){d.isArray(b)||(b=[b]);var e={};e[a]=b;this.register(e);
|
|
139
|
+
return this.people.set(a,b,c)});l.prototype.yd=Y(function(a,b,c){var e=this.F(a),f={};void 0===e?(f[a]=[b],this.register(f)):-1===e.indexOf(b)&&(e.push(b),f[a]=e,this.register(f));return this.people.ya(a,b,c)});l.prototype.Ce=Y(function(a,b,c){var e=this.F(a);if(void 0!==e){var f=e.indexOf(b);-1<f&&(e.splice(f,1),this.register({sf:e}));0===e.length&&this.unregister(a)}return this.people.remove(a,b,c)});l.prototype.jf=Y(function(a,b,c,e){var f=d.extend({},b||{});d.h(c,function(g,k){null!==g&&void 0!==
|
|
139
140
|
g&&(f[k]=g)});return this.track(a,f,e)});l.prototype.qd=function(a,b){return a+"_"+JSON.stringify(b)};l.prototype.Yd=function(a,b){var c=this.qd(a,b),e=this.Xb[c];if(void 0===e||e.cb!==a||e.bb!==b)e=new C,e.la(this,a,b),this.Xb[c]=e;return e};l.prototype.Qb=Y(function(a,b){"object"!==typeof a&&(a={});b=b||{};b=b.event_name||"$mp_web_page_view";var c=d.extend(d.info.ve(),d.info.ma(),d.info.nc());a=d.extend({},c,a);return this.track(b,a)});l.prototype.hf=function(){return this.fb.call(this,ba,arguments)};
|
|
140
141
|
l.prototype.gf=function(){return this.fb.call(this,na,arguments)};l.prototype.af=function(a){d.l(a)?this.v("No event name provided to mixpanel.time_event"):this.$b(a)||this.persistence.Qe(a)};var Gb={persistent:!0};l.prototype.register=function(a,b){b=ya(b);b.persistent?this.persistence.register(a,b.days):d.extend(this.fa,a)};l.prototype.L=function(a,b,c){c=ya(c);c.persistent?this.persistence.L(a,b,c.days):("undefined"===typeof b&&(b="None"),d.h(a,function(e,f){this.fa.hasOwnProperty(f)&&this.fa[f]!==
|
|
141
142
|
b||(this.fa[f]=e)},this))};l.prototype.unregister=function(a,b){b=ya(b);b.persistent?this.persistence.unregister(a):delete this.fa[a]};l.prototype.fc=function(a,b){var c={};c[a]=b;this.register(c)};l.prototype.yb=function(a,b,c,e,f,g,k,h){var p=this.U();if(a&&p!==a){if("string"===typeof a&&0===a.indexOf("$device:"))return this.v("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:a})}this.F("$device_id")||this.L({$had_persisted_distinct_id:!0,$device_id:p},"");a!==p&&a!==this.F("__alias")&&
|
|
142
143
|
(this.unregister("__alias"),this.register({distinct_id:a}));this.ia.Cc=!0;this.people.ud(b,c,e,f,g,k,h);a!==p&&this.track("$identify",{distinct_id:a,$anon_distinct_id:p},{dd:!0});a!==p&&this.flags.rb()};l.prototype.reset=function(){this.Nb();this.persistence.clear();this.ia.Cc=!1;var a=d.Ta();this.L({distinct_id:"$device:"+a,$device_id:a},"");this.Xa()};l.prototype.U=function(){return this.F("distinct_id")};l.prototype.zd=function(a,b){if(a===this.F("$people_distinct_id"))return this.v("Attempting to create alias for existing People user - aborting."),
|
|
143
144
|
-2;var c=this;d.l(b)&&(b=this.U());if(a!==b)return this.fc("__alias",a),this.track("$create_alias",{alias:a,distinct_id:b},{dd:!0},function(){c.yb(a)});this.v("alias matches current distinct_id - skipping api call.");this.yb(a);return-1};l.prototype.we=function(a){this.fc("mp_name_tag",a)};l.prototype.Kb=function(a){d.j(a)&&(d.extend(this.config,a),a.batch_size&&d.h(this.H,function(b){b.Vc()}),this.g("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.g("disable_persistence")||
|
|
144
145
|
(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.ld(this.config),S=S||this.g("debug"),("autocapture"in a||"record_heatmap_data"in a)&&this.ib&&this.ib.B())};l.prototype.g=function(a){return this.config[a]};l.prototype.hc=function(a){var b=(this.config.hooks[a]||Hb).apply(this,aa.call(arguments,1));"undefined"===typeof b&&(this.v(a+" hook did not return a value"),b=null);return b};l.prototype.F=function(a){return this.persistence.Oa([a])};l.prototype.$=
|
|
145
|
-
function(a){return this.g("api_hosts")[a]||this.g("api_host")};l.prototype.toString=function(){var a=this.g("name");"mixpanel"!==a&&(a="mixpanel."+a);return a};l.prototype.$b=function(a){return d.Gc(H)||this.ia.Md||d.zb(this.Ua,a)};l.prototype.vd=function(){"localStorage"===this.g("opt_out_tracking_persistence_type")&&d.localStorage.
|
|
146
|
-
this.mc({persistence_type:"cookie",enable_persistence:!1}));this.
|
|
147
|
-
this.Lb()};l.prototype.ka=function(a,b){b=d.extend({track:d.bind(this.track,this),persistence_type:this.g("opt_out_tracking_persistence_type"),cookie_prefix:this.g("opt_out_tracking_cookie_prefix"),cookie_expiration:this.g("cookie_expiration"),cross_site_cookie:this.g("cross_site_cookie"),cross_subdomain_cookie:this.g("cross_subdomain_cookie"),cookie_domain:this.g("cookie_domain"),secure_cookie:this.g("secure_cookie"),ignore_dnt:this.g("ignore_dnt")},b);d.localStorage.
|
|
148
|
-
return a(this.g("token"),{track:b.track,cf:b.track_event_name,ef:b.track_properties,Pc:b.persistence_type,Oc:b.cookie_prefix,oc:b.cookie_domain,pc:b.cookie_expiration,Ld:b.cross_site_cookie,qc:b.cross_subdomain_cookie,Ge:b.secure_cookie,Dc:b.ignore_dnt})};l.prototype.Kc=function(a){a=d.extend({enable_persistence:!0},a);this.ka(Tb,a);this.
|
|
149
|
-
this.ka(Ub,a);this.
|
|
146
|
+
function(a){return this.g("api_hosts")[a]||this.g("api_host")};l.prototype.toString=function(){var a=this.g("name");"mixpanel"!==a&&(a="mixpanel."+a);return a};l.prototype.$b=function(a){return d.Gc(H)||this.ia.Md||d.zb(this.Ua,a)};l.prototype.vd=function(){"localStorage"===this.g("opt_out_tracking_persistence_type")&&d.localStorage.qa()&&(!this.Ka()&&this.Ka({persistence_type:"cookie"})&&this.Kc({enable_persistence:!1}),!this.pa()&&this.pa({persistence_type:"cookie"})&&this.Gb({clear_persistence:!1}),
|
|
147
|
+
this.mc({persistence_type:"cookie",enable_persistence:!1}));this.pa()?this.za({clear_persistence:!0}):this.Ka()||!this.g("opt_out_tracking_by_default")&&!d.cookie.get("mp_optout")||(d.cookie.remove("mp_optout"),this.Gb({clear_persistence:this.g("opt_out_persistence_by_default")}))};l.prototype.za=function(a){if(a&&a.clear_persistence)a=!0;else if(a&&a.enable_persistence)a=!1;else return;this.g("disable_persistence")||this.persistence.disabled===a||this.persistence.$c(a);a?(this.Mb(),this.Nb()):this.pd&&
|
|
148
|
+
this.Lb()};l.prototype.ka=function(a,b){b=d.extend({track:d.bind(this.track,this),persistence_type:this.g("opt_out_tracking_persistence_type"),cookie_prefix:this.g("opt_out_tracking_cookie_prefix"),cookie_expiration:this.g("cookie_expiration"),cross_site_cookie:this.g("cross_site_cookie"),cross_subdomain_cookie:this.g("cross_subdomain_cookie"),cookie_domain:this.g("cookie_domain"),secure_cookie:this.g("secure_cookie"),ignore_dnt:this.g("ignore_dnt")},b);d.localStorage.qa()||(b.persistence_type="cookie");
|
|
149
|
+
return a(this.g("token"),{track:b.track,cf:b.track_event_name,ef:b.track_properties,Pc:b.persistence_type,Oc:b.cookie_prefix,oc:b.cookie_domain,pc:b.cookie_expiration,Ld:b.cross_site_cookie,qc:b.cross_subdomain_cookie,Ge:b.secure_cookie,Dc:b.ignore_dnt})};l.prototype.Kc=function(a){a=d.extend({enable_persistence:!0},a);this.ka(Tb,a);this.za(a)};l.prototype.Gb=function(a){a=d.extend({clear_persistence:!0,delete_user:!0},a);a.delete_user&&this.people&&this.people.eb()&&(this.people.tc(),this.people.lc());
|
|
150
|
+
this.ka(Ub,a);this.za(a)};l.prototype.Ka=function(a){return this.ka(Vb,a)};l.prototype.pa=function(a){return this.ka(nb,a)};l.prototype.mc=function(a){a=d.extend({enable_persistence:!0},a);this.ka(Xb,a);this.za(a)};l.prototype.v=function(a,b){z.error.apply(z.error,arguments);try{b||a instanceof Error||(a=Error(a)),this.g("error_reporter")(a,b)}catch(c){z.error(c)}};l.prototype.init=l.prototype.B;l.prototype.reset=l.prototype.reset;l.prototype.disable=l.prototype.disable;l.prototype.time_event=l.prototype.af;
|
|
150
151
|
l.prototype.track=l.prototype.track;l.prototype.track_links=l.prototype.hf;l.prototype.track_forms=l.prototype.gf;l.prototype.track_pageview=l.prototype.Qb;l.prototype.register=l.prototype.register;l.prototype.register_once=l.prototype.L;l.prototype.unregister=l.prototype.unregister;l.prototype.identify=l.prototype.yb;l.prototype.alias=l.prototype.zd;l.prototype.name_tag=l.prototype.we;l.prototype.set_config=l.prototype.Kb;l.prototype.get_config=l.prototype.g;l.prototype.get_api_host=l.prototype.$;
|
|
151
|
-
l.prototype.get_property=l.prototype.F;l.prototype.get_distinct_id=l.prototype.U;l.prototype.toString=l.prototype.toString;l.prototype.opt_out_tracking=l.prototype.Gb;l.prototype.opt_in_tracking=l.prototype.Kc;l.prototype.has_opted_out_tracking=l.prototype.
|
|
152
|
+
l.prototype.get_property=l.prototype.F;l.prototype.get_distinct_id=l.prototype.U;l.prototype.toString=l.prototype.toString;l.prototype.opt_out_tracking=l.prototype.Gb;l.prototype.opt_in_tracking=l.prototype.Kc;l.prototype.has_opted_out_tracking=l.prototype.pa;l.prototype.has_opted_in_tracking=l.prototype.Ka;l.prototype.clear_opt_in_out_tracking=l.prototype.mc;l.prototype.get_group=l.prototype.Yd;l.prototype.set_group=l.prototype.Re;l.prototype.add_group=l.prototype.yd;l.prototype.remove_group=l.prototype.Ce;
|
|
152
153
|
l.prototype.track_with_groups=l.prototype.jf;l.prototype.start_batch_senders=l.prototype.Lb;l.prototype.stop_batch_senders=l.prototype.Mb;l.prototype.start_session_recording=l.prototype.Ue;l.prototype.stop_session_recording=l.prototype.Nb;l.prototype.pause_session_recording=l.prototype.ye;l.prototype.resume_session_recording=l.prototype.De;l.prototype.get_session_recording_properties=l.prototype.Ac;l.prototype.get_session_replay_url=l.prototype.$d;l.prototype.get_tab_id=l.prototype.Bc;l.prototype.DEFAULT_API_ROUTES=
|
|
153
|
-
Bb;l.prototype.__get_recorder=l.prototype.od;y.prototype.properties=y.prototype.
|
|
154
|
-
1.1>(E.__SV||0)?z.s("Version mismatch; please ensure you're using the latest version of the Mixpanel code snippet."):(d.h(E._i,function(b){b&&d.isArray(b)&&(R[b[b.length-1]]=ma.apply(this,b))}),Eb(),E.init(),d.h(R,function(b){b.
|
|
154
|
+
Bb;l.prototype.__get_recorder=l.prototype.od;y.prototype.properties=y.prototype.ta;y.prototype.update_search_keyword=y.prototype.md;y.prototype.update_referrer_info=y.prototype.Sb;y.prototype.get_cross_subdomain=y.prototype.Xd;y.prototype.clear=y.prototype.clear;var R={};(function(a){Sa=a;xa=1;E=r.mixpanel;d.l(E)?z.s('"mixpanel" object not initialized. Ensure you are using the latest version of the Mixpanel JS Library along with the snippet we provide.'):E.__loaded||E.config&&E.persistence?z.s("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."):
|
|
155
|
+
1.1>(E.__SV||0)?z.s("Version mismatch; please ensure you're using the latest version of the Mixpanel code snippet."):(d.h(E._i,function(b){b&&d.isArray(b)&&(R[b[b.length-1]]=ma.apply(this,b))}),Eb(),E.init(),d.h(R,function(b){b.Ba()}),Db())})(function(a,b){var c=document.createElement("script");c.type="text/javascript";c.async=!0;c.onload=b;c.src=a;document.head.appendChild(c)})})()
|
package/dist/mixpanel.module.js
CHANGED
|
@@ -14039,7 +14039,7 @@ if (typeof Promise !== 'undefined' && Promise.toString().indexOf('[native code]'
|
|
|
14039
14039
|
|
|
14040
14040
|
var Config = {
|
|
14041
14041
|
DEBUG: false,
|
|
14042
|
-
LIB_VERSION: '2.
|
|
14042
|
+
LIB_VERSION: '2.70.0'
|
|
14043
14043
|
};
|
|
14044
14044
|
|
|
14045
14045
|
/* eslint camelcase: "off", eqeqeq: "off" */
|
|
@@ -18875,17 +18875,21 @@ FeatureFlagManager.prototype.fetchFlags = function() {
|
|
|
18875
18875
|
var distinctId = this.getMpProperty('distinct_id');
|
|
18876
18876
|
var deviceId = this.getMpProperty('$device_id');
|
|
18877
18877
|
logger.log('Fetching flags for distinct ID: ' + distinctId);
|
|
18878
|
-
|
|
18879
|
-
|
|
18880
|
-
|
|
18878
|
+
|
|
18879
|
+
var context = _.extend({'distinct_id': distinctId, 'device_id': deviceId}, this.getConfig(CONFIG_CONTEXT));
|
|
18880
|
+
var searchParams = new URLSearchParams();
|
|
18881
|
+
searchParams.set('context', JSON.stringify(context));
|
|
18882
|
+
searchParams.set('token', this.getMpConfig('token'));
|
|
18883
|
+
searchParams.set('mp_lib', 'web');
|
|
18884
|
+
searchParams.set('$lib_version', Config.LIB_VERSION);
|
|
18885
|
+
var url = this.getFullApiRoute() + '?' + searchParams.toString();
|
|
18886
|
+
|
|
18881
18887
|
this._fetchInProgressStartTime = Date.now();
|
|
18882
|
-
this.fetchPromise = win['fetch'](
|
|
18883
|
-
'method': '
|
|
18888
|
+
this.fetchPromise = win['fetch'](url, {
|
|
18889
|
+
'method': 'GET',
|
|
18884
18890
|
'headers': {
|
|
18885
|
-
'Authorization': 'Basic ' + btoa(this.getMpConfig('token') + ':')
|
|
18886
|
-
|
|
18887
|
-
},
|
|
18888
|
-
'body': JSON.stringify(reqParams)
|
|
18891
|
+
'Authorization': 'Basic ' + btoa(this.getMpConfig('token') + ':')
|
|
18892
|
+
}
|
|
18889
18893
|
}).then(function(response) {
|
|
18890
18894
|
this.markFetchComplete();
|
|
18891
18895
|
return response.json().then(function(responseBody) {
|
package/dist/mixpanel.umd.js
CHANGED
|
@@ -14045,7 +14045,7 @@
|
|
|
14045
14045
|
|
|
14046
14046
|
var Config = {
|
|
14047
14047
|
DEBUG: false,
|
|
14048
|
-
LIB_VERSION: '2.
|
|
14048
|
+
LIB_VERSION: '2.70.0'
|
|
14049
14049
|
};
|
|
14050
14050
|
|
|
14051
14051
|
/* eslint camelcase: "off", eqeqeq: "off" */
|
|
@@ -18881,17 +18881,21 @@
|
|
|
18881
18881
|
var distinctId = this.getMpProperty('distinct_id');
|
|
18882
18882
|
var deviceId = this.getMpProperty('$device_id');
|
|
18883
18883
|
logger.log('Fetching flags for distinct ID: ' + distinctId);
|
|
18884
|
-
|
|
18885
|
-
|
|
18886
|
-
|
|
18884
|
+
|
|
18885
|
+
var context = _.extend({'distinct_id': distinctId, 'device_id': deviceId}, this.getConfig(CONFIG_CONTEXT));
|
|
18886
|
+
var searchParams = new URLSearchParams();
|
|
18887
|
+
searchParams.set('context', JSON.stringify(context));
|
|
18888
|
+
searchParams.set('token', this.getMpConfig('token'));
|
|
18889
|
+
searchParams.set('mp_lib', 'web');
|
|
18890
|
+
searchParams.set('$lib_version', Config.LIB_VERSION);
|
|
18891
|
+
var url = this.getFullApiRoute() + '?' + searchParams.toString();
|
|
18892
|
+
|
|
18887
18893
|
this._fetchInProgressStartTime = Date.now();
|
|
18888
|
-
this.fetchPromise = win['fetch'](
|
|
18889
|
-
'method': '
|
|
18894
|
+
this.fetchPromise = win['fetch'](url, {
|
|
18895
|
+
'method': 'GET',
|
|
18890
18896
|
'headers': {
|
|
18891
|
-
'Authorization': 'Basic ' + btoa(this.getMpConfig('token') + ':')
|
|
18892
|
-
|
|
18893
|
-
},
|
|
18894
|
-
'body': JSON.stringify(reqParams)
|
|
18897
|
+
'Authorization': 'Basic ' + btoa(this.getMpConfig('token') + ':')
|
|
18898
|
+
}
|
|
18895
18899
|
}).then(function(response) {
|
|
18896
18900
|
this.markFetchComplete();
|
|
18897
18901
|
return response.json().then(function(responseBody) {
|