import{r as ot}from"./@babel-Dv-xQaqJ.js";var C={DEBUG:!1,LIB_VERSION:"2.48.1"},x;if(typeof window>"u"){var $e={hostname:""};x={navigator:{userAgent:""},document:{location:$e,referrer:""},screen:{width:0,height:0},location:$e}}else x=window;var he=Array.prototype,st=Function.prototype,Ge=Object.prototype,L=he.slice,oe=Ge.toString,le=Ge.hasOwnProperty,q=x.console,j=x.navigator,E=x.document,se=x.opera,ae=x.screen,U=j.userAgent,ge=st.bind,Me=he.forEach,Be=he.indexOf,Re=he.map,at=Array.isArray,me={},i={trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},b={log:function(){if(C.DEBUG&&!i.isUndefined(q)&&q)try{q.log.apply(q,arguments)}catch{i.each(arguments,function(t){q.log(t)})}},warn:function(){if(C.DEBUG&&!i.isUndefined(q)&&q){var e=["Mixpanel warning:"].concat(i.toArray(arguments));try{q.warn.apply(q,e)}catch{i.each(e,function(r){q.warn(r)})}}},error:function(){if(C.DEBUG&&!i.isUndefined(q)&&q){var e=["Mixpanel error:"].concat(i.toArray(arguments));try{q.error.apply(q,e)}catch{i.each(e,function(r){q.error(r)})}}},critical:function(){if(!i.isUndefined(q)&&q){var e=["Mixpanel error:"].concat(i.toArray(arguments));try{q.error.apply(q,e)}catch{i.each(e,function(r){q.error(r)})}}}},ve=function(e,t){return function(){return arguments[0]="["+t+"] "+arguments[0],e.apply(b,arguments)}},be=function(e){return{log:ve(b.log,e),error:ve(b.error,e),critical:ve(b.critical,e)}};i.bind=function(e,t){var r,n;if(ge&&e.bind===ge)return ge.apply(e,L.call(arguments,1));if(!i.isFunction(e))throw new TypeError;return r=L.call(arguments,2),n=function(){if(!(this instanceof n))return e.apply(t,r.concat(L.call(arguments)));var o={};o.prototype=e.prototype;var s=new o;o.prototype=null;var a=e.apply(s,r.concat(L.call(arguments)));return Object(a)===a?a:s},n};i.each=function(e,t,r){if(e!=null){if(Me&&e.forEach===Me)e.forEach(t,r);else if(e.length===+e.length){for(var n=0,o=e.length;n<o;n++)if(n in e&&t.call(r,e[n],n,e)===me)return}else for(var s in e)if(le.call(e,s)&&t.call(r,e[s],s,e)===me)return}};i.extend=function(e){return i.each(L.call(arguments,1),function(t){for(var r in t)t[r]!==void 0&&(e[r]=t[r])}),e};i.isArray=at||function(e){return oe.call(e)==="[object Array]"};i.isFunction=function(e){try{return/^\s*\bfunction\b/.test(e)}catch{return!1}};i.isArguments=function(e){return!!(e&&le.call(e,"callee"))};i.toArray=function(e){return e?e.toArray?e.toArray():i.isArray(e)||i.isArguments(e)?L.call(e):i.values(e):[]};i.map=function(e,t,r){if(Re&&e.map===Re)return e.map(t,r);var n=[];return i.each(e,function(o){n.push(t.call(r,o))}),n};i.keys=function(e){var t=[];return e===null||i.each(e,function(r,n){t[t.length]=n}),t};i.values=function(e){var t=[];return e===null||i.each(e,function(r){t[t.length]=r}),t};i.include=function(e,t){var r=!1;return e===null?r:Be&&e.indexOf===Be?e.indexOf(t)!=-1:(i.each(e,function(n){if(r||(r=n===t))return me}),r)};i.includes=function(e,t){return e.indexOf(t)!==-1};i.inherit=function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e};i.isObject=function(e){return e===Object(e)&&!i.isArray(e)};i.isEmptyObject=function(e){if(i.isObject(e)){for(var t in e)if(le.call(e,t))return!1;return!0}return!1};i.isUndefined=function(e){return e===void 0};i.isString=function(e){return oe.call(e)=="[object String]"};i.isDate=function(e){return oe.call(e)=="[object Date]"};i.isNumber=function(e){return oe.call(e)=="[object Number]"};i.isElement=function(e){return!!(e&&e.nodeType===1)};i.encodeDates=function(e){return i.each(e,function(t,r){i.isDate(t)?e[r]=i.formatDate(t):i.isObject(t)&&(e[r]=i.encodeDates(t))}),e};i.timestamp=function(){return Date.now=Date.now||function(){return+new Date},Date.now()};i.formatDate=function(e){function t(r){return r<10?"0"+r:r}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())};i.strip_empty_properties=function(e){var t={};return i.each(e,function(r,n){i.isString(r)&&r.length>0&&(t[n]=r)}),t};i.truncate=function(e,t){var r;return typeof e=="string"?r=e.slice(0,t):i.isArray(e)?(r=[],i.each(e,function(n){r.push(i.truncate(n,t))})):i.isObject(e)?(r={},i.each(e,function(n,o){r[o]=i.truncate(n,t)})):r=e,r};i.JSONEncode=function(){return function(e){var t=e,r=function(o){var s=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return s.lastIndex=0,s.test(o)?'"'+o.replace(s,function(_){var c=a[_];return typeof c=="string"?c:"\\u"+("0000"+_.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+o+'"'},n=function(o,s){var a="",_="    ",c=0,f="",h="",g=0,p=a,l=[],d=s[o];switch(d&&typeof d=="object"&&typeof d.toJSON=="function"&&(d=d.toJSON(o)),typeof d){case"string":return r(d);case"number":return isFinite(d)?String(d):"null";case"boolean":case"null":return String(d);case"object":if(!d)return"null";if(a+=_,l=[],oe.apply(d)==="[object Array]"){for(g=d.length,c=0;c<g;c+=1)l[c]=n(c,d)||"null";return h=l.length===0?"[]":a?`[
`+a+l.join(`,
`+a)+`
`+p+"]":"["+l.join(",")+"]",a=p,h}for(f in d)le.call(d,f)&&(h=n(f,d),h&&l.push(r(f)+(a?": ":":")+h));return h=l.length===0?"{}":a?"{"+l.join(",")+p+"}":"{"+l.join(",")+"}",a=p,h}};return n("",{"":t})}}();i.JSONDecode=function(){var e,t,r={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
`,r:"\r",t:"	"},n,o=function(l){var d=new SyntaxError(l);throw d.at=e,d.text=n,d},s=function(l){return l&&l!==t&&o("Expected '"+l+"' instead of '"+t+"'"),t=n.charAt(e),e+=1,t},a=function(){var l,d="";for(t==="-"&&(d="-",s("-"));t>="0"&&t<="9";)d+=t,s();if(t===".")for(d+=".";s()&&t>="0"&&t<="9";)d+=t;if(t==="e"||t==="E")for(d+=t,s(),(t==="-"||t==="+")&&(d+=t,s());t>="0"&&t<="9";)d+=t,s();if(l=+d,!isFinite(l))o("Bad number");else return l},_=function(){var l,d,k="",v;if(t==='"')for(;s();){if(t==='"')return s(),k;if(t==="\\")if(s(),t==="u"){for(v=0,d=0;d<4&&(l=parseInt(s(),16),!!isFinite(l));d+=1)v=v*16+l;k+=String.fromCharCode(v)}else if(typeof r[t]=="string")k+=r[t];else break;else k+=t}o("Bad string")},c=function(){for(;t&&t<=" ";)s()},f=function(){switch(t){case"t":return s("t"),s("r"),s("u"),s("e"),!0;case"f":return s("f"),s("a"),s("l"),s("s"),s("e"),!1;case"n":return s("n"),s("u"),s("l"),s("l"),null}o('Unexpected "'+t+'"')},h,g=function(){var l=[];if(t==="["){if(s("["),c(),t==="]")return s("]"),l;for(;t;){if(l.push(h()),c(),t==="]")return s("]"),l;s(","),c()}}o("Bad array")},p=function(){var l,d={};if(t==="{"){if(s("{"),c(),t==="}")return s("}"),d;for(;t;){if(l=_(),c(),s(":"),Object.hasOwnProperty.call(d,l)&&o('Duplicate key "'+l+'"'),d[l]=h(),c(),t==="}")return s("}"),d;s(","),c()}}o("Bad object")};return h=function(){switch(c(),t){case"{":return p();case"[":return g();case'"':return _();case"-":return a();default:return t>="0"&&t<="9"?a():f()}},function(l){var d;return n=l,e=0,t=" ",d=h(),c(),t&&o("Syntax error"),d}}();i.base64Encode=function(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r,n,o,s,a,_,c,f,h=0,g=0,p="",l=[];if(!e)return e;e=i.utf8Encode(e);do r=e.charCodeAt(h++),n=e.charCodeAt(h++),o=e.charCodeAt(h++),f=r<<16|n<<8|o,s=f>>18&63,a=f>>12&63,_=f>>6&63,c=f&63,l[g++]=t.charAt(s)+t.charAt(a)+t.charAt(_)+t.charAt(c);while(h<e.length);switch(p=l.join(""),e.length%3){case 1:p=p.slice(0,-2)+"==";break;case 2:p=p.slice(0,-1)+"=";break}return p};i.utf8Encode=function(e){e=(e+"").replace(/\r\n/g,`
`).replace(/\r/g,`
`);var t="",r,n,o=0,s;for(r=n=0,o=e.length,s=0;s<o;s++){var a=e.charCodeAt(s),_=null;a<128?n++:a>127&&a<2048?_=String.fromCharCode(a>>6|192,a&63|128):_=String.fromCharCode(a>>12|224,a>>6&63|128,a&63|128),_!==null&&(n>r&&(t+=e.substring(r,n)),t+=_,r=n=s+1)}return n>r&&(t+=e.substring(r,e.length)),t};i.UUID=function(){var e=function(){var n=1*new Date,o;if(x.performance&&x.performance.now)o=x.performance.now();else for(o=0;n==1*new Date;)o++;return n.toString(16)+Math.floor(o).toString(16)},t=function(){return Math.random().toString(16).replace(".","")},r=function(){var n=U,o,s,a=[],_=0;function c(f,h){var g,p=0;for(g=0;g<h.length;g++)p|=a[g]<<g*8;return f^p}for(o=0;o<n.length;o++)s=n.charCodeAt(o),a.unshift(s&255),a.length>=4&&(_=c(_,a),a=[]);return a.length>0&&(_=c(_,a)),_.toString(16)};return function(){var n=(ae.height*ae.width).toString(16);return e()+"-"+t()+"-"+r()+"-"+n+"-"+e()}}();var Fe=["ahrefsbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","facebookexternal","petalbot","pinterest","screaming frog","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google"];i.isBlockedUA=function(e){var t;for(e=e.toLowerCase(),t=0;t<Fe.length;t++)if(e.indexOf(Fe[t])!==-1)return!0;return!1};i.HTTPBuildQuery=function(e,t){var r,n,o=[];return i.isUndefined(t)&&(t="&"),i.each(e,function(s,a){r=encodeURIComponent(s.toString()),n=encodeURIComponent(a),o[o.length]=n+"="+r}),o.join(t)};i.getQueryParam=function(e,t){t=t.replace(/[[]/,"\\[").replace(/[\]]/,"\\]");var r="[\\?&]"+t+"=([^&#]*)",n=new RegExp(r),o=n.exec(e);if(o===null||o&&typeof o[1]!="string"&&o[1].length)return"";var s=o[1];try{s=decodeURIComponent(s)}catch{b.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")};i.cookie={get:function(e){for(var t=e+"=",r=E.cookie.split(";"),n=0;n<r.length;n++){for(var o=r[n];o.charAt(0)==" ";)o=o.substring(1,o.length);if(o.indexOf(t)===0)return decodeURIComponent(o.substring(t.length,o.length))}return null},parse:function(e){var t;try{t=i.JSONDecode(i.cookie.get(e))||{}}catch{}return t},set_seconds:function(e,t,r,n,o,s,a){var _="",c="",f="";if(a)_="; domain="+a;else if(n){var h=Le(E.location.hostname);_=h?"; domain=."+h:""}if(r){var g=new Date;g.setTime(g.getTime()+r*1e3),c="; expires="+g.toGMTString()}s&&(o=!0,f="; SameSite=None"),o&&(f+="; secure"),E.cookie=e+"="+encodeURIComponent(t)+c+"; path=/"+_+f},set:function(e,t,r,n,o,s,a){var _="",c="",f="";if(a)_="; domain="+a;else if(n){var h=Le(E.location.hostname);_=h?"; domain=."+h:""}if(r){var g=new Date;g.setTime(g.getTime()+r*24*60*60*1e3),c="; expires="+g.toGMTString()}s&&(o=!0,f="; SameSite=None"),o&&(f+="; secure");var p=e+"="+encodeURIComponent(t)+c+"; path=/"+_+f;return E.cookie=p,p},remove:function(e,t,r){i.cookie.set(e,"",-1,t,!1,!1,r)}};var ye=null,ue=function(e,t){if(ye!==null&&!t)return ye;var r=!0;try{e=e||window.localStorage;var n="__mplss_"+Ee(8),o="xyz";e.setItem(n,o),e.getItem(n)!==o&&(r=!1),e.removeItem(n)}catch{r=!1}return ye=r,r};i.localStorage={is_supported:function(e){var t=ue(null,e);return t||b.error("localStorage unsupported; falling back to cookie store"),t},error:function(e){b.error("localStorage error: "+e)},get:function(e){try{return window.localStorage.getItem(e)}catch(t){i.localStorage.error(t)}return null},parse:function(e){try{return i.JSONDecode(i.localStorage.get(e))||{}}catch{}return null},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){i.localStorage.error(r)}},remove:function(e){try{window.localStorage.removeItem(e)}catch(t){i.localStorage.error(t)}}};i.register_event=function(){var e=function(n,o,s,a,_){if(!n){b.error("No valid element provided to register_event");return}if(n.addEventListener&&!a)n.addEventListener(o,s,!!_);else{var c="on"+o,f=n[c];n[c]=t(n,s,f)}};function t(n,o,s){var a=function(_){if(_=_||r(window.event),!!_){var c=!0,f,h;return i.isFunction(s)&&(f=s(_)),h=o.call(n,_),(f===!1||h===!1)&&(c=!1),c}};return a}function r(n){return n&&(n.preventDefault=r.preventDefault,n.stopPropagation=r.stopPropagation),n}return r.preventDefault=function(){this.returnValue=!1},r.stopPropagation=function(){this.cancelBubble=!0},e}();var ut=new RegExp('^(\\w*)\\[(\\w+)([=~\\|\\^\\$\\*]?)=?"?([^\\]"]*)"?\\]$');i.dom_query=function(){function e(o){return o.all?o.all:o.getElementsByTagName("*")}var t=/[\t\r\n]/g;function r(o,s){var a=" "+s+" ";return(" "+o.className+" ").replace(t," ").indexOf(a)>=0}function n(o){if(!E.getElementsByTagName)return[];var s=o.split(" "),a,_,c,f,h,g,p,l,d,k,v=[E];for(g=0;g<s.length;g++){if(a=s[g].replace(/^\s+/,"").replace(/\s+$/,""),a.indexOf("#")>-1){_=a.split("#"),c=_[0];var O=_[1],w=E.getElementById(O);if(!w||c&&w.nodeName.toLowerCase()!=c)return[];v=[w];continue}if(a.indexOf(".")>-1){_=a.split("."),c=_[0];var B=_[1];for(c||(c="*"),f=[],h=0,p=0;p<v.length;p++)for(c=="*"?d=e(v[p]):d=v[p].getElementsByTagName(c),l=0;l<d.length;l++)f[h++]=d[l];for(v=[],k=0,p=0;p<f.length;p++)f[p].className&&i.isString(f[p].className)&&r(f[p],B)&&(v[k++]=f[p]);continue}var te=a.match(ut);if(te){c=te[1];var R=te[2],nt=te[3],G=te[4];for(c||(c="*"),f=[],h=0,p=0;p<v.length;p++)for(c=="*"?d=e(v[p]):d=v[p].getElementsByTagName(c),l=0;l<d.length;l++)f[h++]=d[l];v=[],k=0;var F;switch(nt){case"=":F=function(A){return A.getAttribute(R)==G};break;case"~":F=function(A){return A.getAttribute(R).match(new RegExp("\\b"+G+"\\b"))};break;case"|":F=function(A){return A.getAttribute(R).match(new RegExp("^"+G+"-?"))};break;case"^":F=function(A){return A.getAttribute(R).indexOf(G)===0};break;case"$":F=function(A){return A.getAttribute(R).lastIndexOf(G)==A.getAttribute(R).length-G.length};break;case"*":F=function(A){return A.getAttribute(R).indexOf(G)>-1};break;default:F=function(A){return A.getAttribute(R)}}for(v=[],k=0,p=0;p<f.length;p++)F(f[p])&&(v[k++]=f[p]);continue}for(c=a,f=[],h=0,p=0;p<v.length;p++)for(d=v[p].getElementsByTagName(c),l=0;l<d.length;l++)f[h++]=d[l];v=f}return v}return function(o){return i.isElement(o)?[o]:i.isObject(o)&&!i.isUndefined(o.length)?o:n.call(this,o)}}();var ct=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],pt=["dclid","fbclid","gclid","ko_click_id","li_fat_id","msclkid","ttclid","twclid","wbraid"];i.info={campaignParams:function(e){var t="",r={};return i.each(ct,function(n){t=i.getQueryParam(E.URL,n),t.length?r[n]=t:e!==void 0&&(r[n]=e)}),r},clickParams:function(){var e="",t={};return i.each(pt,function(r){e=i.getQueryParam(E.URL,r),e.length&&(t[r]=e)}),t},marketingParams:function(){return i.extend(i.info.campaignParams(),i.info.clickParams())},searchEngine:function(e){return e.search("https?://(.*)google.([^/?]*)")===0?"google":e.search("https?://(.*)bing.com")===0?"bing":e.search("https?://(.*)yahoo.com")===0?"yahoo":e.search("https?://(.*)duckduckgo.com")===0?"duckduckgo":null},searchInfo:function(e){var t=i.info.searchEngine(e),r=t!="yahoo"?"q":"p",n={};if(t!==null){n.$search_engine=t;var o=i.getQueryParam(e,r);o.length&&(n.mp_keyword=o)}return n},browser:function(e,t,r){return t=t||"",r||i.includes(e," OPR/")?i.includes(e,"Mini")?"Opera Mini":"Opera":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":i.includes(e,"IEMobile")||i.includes(e,"WPDesktop")?"Internet Explorer Mobile":i.includes(e,"SamsungBrowser/")?"Samsung Internet":i.includes(e,"Edge")||i.includes(e,"Edg/")?"Microsoft Edge":i.includes(e,"FBIOS")?"Facebook Mobile":i.includes(e,"Chrome")?"Chrome":i.includes(e,"CriOS")?"Chrome iOS":i.includes(e,"UCWEB")||i.includes(e,"UCBrowser")?"UC Browser":i.includes(e,"FxiOS")?"Firefox iOS":i.includes(t,"Apple")?i.includes(e,"Mobile")?"Mobile Safari":"Safari":i.includes(e,"Android")?"Android Mobile":i.includes(e,"Konqueror")?"Konqueror":i.includes(e,"Firefox")?"Firefox":i.includes(e,"MSIE")||i.includes(e,"Trident/")?"Internet Explorer":i.includes(e,"Gecko")?"Mozilla":""},browserVersion:function(e,t,r){var n=i.info.browser(e,t,r),o={"Internet Explorer Mobile":/rv:(\d+(\.\d+)?)/,"Microsoft Edge":/Edge?\/(\d+(\.\d+)?)/,Chrome:/Chrome\/(\d+(\.\d+)?)/,"Chrome iOS":/CriOS\/(\d+(\.\d+)?)/,"UC Browser":/(UCBrowser|UCWEB)\/(\d+(\.\d+)?)/,Safari:/Version\/(\d+(\.\d+)?)/,"Mobile Safari":/Version\/(\d+(\.\d+)?)/,Opera:/(Opera|OPR)\/(\d+(\.\d+)?)/,Firefox:/Firefox\/(\d+(\.\d+)?)/,"Firefox iOS":/FxiOS\/(\d+(\.\d+)?)/,Konqueror:/Konqueror:(\d+(\.\d+)?)/,BlackBerry:/BlackBerry (\d+(\.\d+)?)/,"Android Mobile":/android\s(\d+(\.\d+)?)/,"Samsung Internet":/SamsungBrowser\/(\d+(\.\d+)?)/,"Internet Explorer":/(rv:|MSIE )(\d+(\.\d+)?)/,Mozilla:/rv:(\d+(\.\d+)?)/},s=o[n];if(s===void 0)return null;var a=e.match(s);return a?parseFloat(a[a.length-2]):null},os:function(){var e=U;return/Windows/i.test(e)?/Phone/.test(e)||/WPDesktop/.test(e)?"Windows Phone":"Windows":/(iPhone|iPad|iPod)/.test(e)?"iOS":/Android/.test(e)?"Android":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Mac/i.test(e)?"Mac OS X":/Linux/.test(e)?"Linux":/CrOS/.test(e)?"Chrome OS":""},device:function(e){return/Windows Phone/i.test(e)||/WPDesktop/.test(e)?"Windows Phone":/iPad/.test(e)?"iPad":/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(BlackBerry|PlayBook|BB10)/i.test(e)?"BlackBerry":/Android/.test(e)?"Android":""},referringDomain:function(e){var t=e.split("/");return t.length>=3?t[2]:""},properties:function(){return i.extend(i.strip_empty_properties({$os:i.info.os(),$browser:i.info.browser(U,j.vendor,se),$referrer:E.referrer,$referring_domain:i.info.referringDomain(E.referrer),$device:i.info.device(U)}),{$current_url:x.location.href,$browser_version:i.info.browserVersion(U,j.vendor,se),$screen_height:ae.height,$screen_width:ae.width,mp_lib:"web",$lib_version:C.LIB_VERSION,$insert_id:Ee(),time:i.timestamp()/1e3})},people_properties:function(){return i.extend(i.strip_empty_properties({$os:i.info.os(),$browser:i.info.browser(U,j.vendor,se)}),{$browser_version:i.info.browserVersion(U,j.vendor,se)})},mpPageViewProperties:function(){return i.strip_empty_properties({current_page_title:E.title,current_domain:x.location.hostname,current_url_path:x.location.pathname,current_url_protocol:x.location.protocol,current_url_search:x.location.search})}};var Ee=function(e){var t=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);return e?t.substring(0,e):t},ft=/[a-z0-9][a-z0-9-]*\.[a-z]+$/i,_t=/[a-z0-9][a-z0-9-]+\.[a-z.]{2,6}$/i,Le=function(e){var t=_t,r=e.split("."),n=r[r.length-1];(n.length>4||n==="com"||n==="org")&&(t=ft);var o=e.match(t);return o?o[0]:""},ce=null,pe=null;typeof JSON<"u"&&(ce=JSON.stringify,pe=JSON.parse);ce=ce||i.JSONEncode;pe=pe||i.JSONDecode;i.toArray=i.toArray;i.isObject=i.isObject;i.JSONEncode=i.JSONEncode;i.JSONDecode=i.JSONDecode;i.isBlockedUA=i.isBlockedUA;i.isEmptyObject=i.isEmptyObject;i.info=i.info;i.info.device=i.info.device;i.info.browser=i.info.browser;i.info.browserVersion=i.info.browserVersion;i.info.properties=i.info.properties;var M=function(){};M.prototype.create_properties=function(){};M.prototype.event_handler=function(){};M.prototype.after_track_handler=function(){};M.prototype.init=function(e){return this.mp=e,this};M.prototype.track=function(e,t,r,n){var o=this,s=i.dom_query(e);if(s.length===0){b.error("The DOM query ("+e+") returned 0 elements");return}return i.each(s,function(a){i.register_event(a,this.override_event,function(_){var c={},f=o.create_properties(r,this),h=o.mp.get_config("track_links_timeout");o.event_handler(_,this,c),window.setTimeout(o.track_callback(n,f,c,!0),h),o.mp.track(t,f,o.track_callback(n,f,c))})},this),!0};M.prototype.track_callback=function(e,t,r,n){n=n||!1;var o=this;return function(){r.callback_fired||(r.callback_fired=!0,!(e&&e(n,t)===!1)&&o.after_track_handler(t,r,n))}};M.prototype.create_properties=function(e,t){var r;return typeof e=="function"?r=e(t):r=i.extend({},e),r};var W=function(){this.override_event="click"};i.inherit(W,M);W.prototype.create_properties=function(e,t){var r=W.superclass.create_properties.apply(this,arguments);return t.href&&(r.url=t.href),r};W.prototype.event_handler=function(e,t,r){r.new_tab=e.which===2||e.metaKey||e.ctrlKey||t.target==="_blank",r.href=t.href,r.new_tab||e.preventDefault()};W.prototype.after_track_handler=function(e,t){t.new_tab||setTimeout(function(){window.location=t.href},0)};var de=function(){this.override_event="submit"};i.inherit(de,M);de.prototype.event_handler=function(e,t,r){r.element=t,e.preventDefault()};de.prototype.after_track_handler=function(e,t){setTimeout(function(){t.element.submit()},0)};var ht=be("lock"),Je=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.pollIntervalMS=t.pollIntervalMS||100,this.timeoutMS=t.timeoutMS||2e3};Je.prototype.withLock=function(e,t,r){!r&&typeof t!="function"&&(r=t,t=null);var n=r||new Date().getTime()+"|"+Math.random(),o=new Date().getTime(),s=this.storageKey,a=this.pollIntervalMS,_=this.timeoutMS,c=this.storage,f=s+":X",h=s+":Y",g=s+":Z",p=function(w){t&&t(w)},l=function(w){if(new Date().getTime()-o>_){ht.error("Timeout waiting for mutex on "+s+"; clearing lock. ["+n+"]"),c.removeItem(g),c.removeItem(h),v();return}setTimeout(function(){try{w()}catch(B){p(B)}},a*(Math.random()+.1))},d=function(w,B){w()?B():l(function(){d(w,B)})},k=function(){var w=c.getItem(h);if(w&&w!==n)return!1;if(c.setItem(h,n),c.getItem(h)===n)return!0;if(!ue(c,!0))throw new Error("localStorage support dropped while acquiring lock");return!1},v=function(){c.setItem(f,n),d(k,function(){if(c.getItem(f)===n){O();return}l(function(){if(c.getItem(h)!==n){v();return}d(function(){return!c.getItem(g)},O)})})},O=function(){c.setItem(g,"1");try{e()}finally{c.removeItem(g),c.getItem(h)===n&&c.removeItem(h),c.getItem(f)===n&&c.removeItem(f)}};try{if(ue(c,!0))v();else throw new Error("localStorage support check failed")}catch(w){p(w)}};var je=be("batch"),Y=function(e,t){t=t||{},this.storageKey=e,this.storage=t.storage||window.localStorage,this.reportError=t.errorReporter||i.bind(je.error,je),this.lock=new Je(e,{storage:this.storage}),this.pid=t.pid||null,this.memQueue=[]};Y.prototype.enqueue=function(e,t,r){var n={id:Ee(),flushAfter:new Date().getTime()+t*2,payload:e};this.lock.withLock(i.bind(function(){var s;try{var a=this.readFromStorage();a.push(n),s=this.saveToStorage(a),s&&this.memQueue.push(n)}catch{this.reportError("Error enqueueing item",e),s=!1}r&&r(s)},this),i.bind(function(s){this.reportError("Error acquiring storage lock",s),r&&r(!1)},this),this.pid)};Y.prototype.fillBatch=function(e){var t=this.memQueue.slice(0,e);if(t.length<e){var r=this.readFromStorage();if(r.length){var n={};i.each(t,function(a){n[a.id]=!0});for(var o=0;o<r.length;o++){var s=r[o];if(new Date().getTime()>s.flushAfter&&!n[s.id]&&(s.orphaned=!0,t.push(s),t.length>=e))break}}}return t};var Ke=function(e,t){var r=[];return i.each(e,function(n){n.id&&!t[n.id]&&r.push(n)}),r};Y.prototype.removeItemsByID=function(e,t){var r={};i.each(e,function(o){r[o]=!0}),this.memQueue=Ke(this.memQueue,r);var n=i.bind(function(){var o;try{var s=this.readFromStorage();if(s=Ke(s,r),o=this.saveToStorage(s),o){s=this.readFromStorage();for(var a=0;a<s.length;a++){var _=s[a];if(_.id&&r[_.id])return this.reportError("Item not removed from storage"),!1}}}catch{this.reportError("Error removing items",e),o=!1}return o},this);this.lock.withLock(function(){var s=n();t&&t(s)},i.bind(function(s){var a=!1;if(this.reportError("Error acquiring storage lock",s),!ue(this.storage,!0)&&(a=n(),!a))try{this.storage.removeItem(this.storageKey)}catch(_){this.reportError("Error clearing queue",_)}t&&t(a)},this),this.pid)};var Ye=function(e,t){var r=[];return i.each(e,function(n){var o=n.id;if(o in t){var s=t[o];s!==null&&(n.payload=s,r.push(n))}else r.push(n)}),r};Y.prototype.updatePayloads=function(e,t){this.memQueue=Ye(this.memQueue,e),this.lock.withLock(i.bind(function(){var n;try{var o=this.readFromStorage();o=Ye(o,e),n=this.saveToStorage(o)}catch{this.reportError("Error updating items",e),n=!1}t&&t(n)},this),i.bind(function(n){this.reportError("Error acquiring storage lock",n),t&&t(!1)},this),this.pid)};Y.prototype.readFromStorage=function(){var e;try{e=this.storage.getItem(this.storageKey),e&&(e=pe(e),i.isArray(e)||(this.reportError("Invalid storage entry:",e),e=null))}catch(t){this.reportError("Error retrieving queue",t),e=null}return e||[]};Y.prototype.saveToStorage=function(e){try{return this.storage.setItem(this.storageKey,ce(e)),!0}catch(t){return this.reportError("Error saving queue",t),!1}};Y.prototype.clear=function(){this.memQueue=[],this.storage.removeItem(this.storageKey)};var lt=10*60*1e3,re=be("batch"),N=function(e,t){this.errorReporter=t.errorReporter,this.queue=new Y(e,{errorReporter:i.bind(this.reportError,this),storage:t.storage}),this.libConfig=t.libConfig,this.sendRequest=t.sendRequestFunc,this.beforeSendHook=t.beforeSendHook,this.stopAllBatching=t.stopAllBatchingFunc,this.batchSize=this.libConfig.batch_size,this.flushInterval=this.libConfig.batch_flush_interval_ms,this.stopped=!this.libConfig.batch_autostart,this.consecutiveRemovalFailures=0,this.itemIdsSentSuccessfully={}};N.prototype.enqueue=function(e,t){this.queue.enqueue(e,this.flushInterval,t)};N.prototype.start=function(){this.stopped=!1,this.consecutiveRemovalFailures=0,this.flush()};N.prototype.stop=function(){this.stopped=!0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=null)};N.prototype.clear=function(){this.queue.clear()};N.prototype.resetBatchSize=function(){this.batchSize=this.libConfig.batch_size};N.prototype.resetFlush=function(){this.scheduleFlush(this.libConfig.batch_flush_interval_ms)};N.prototype.scheduleFlush=function(e){this.flushInterval=e,this.stopped||(this.timeoutID=setTimeout(i.bind(this.flush,this),this.flushInterval))};N.prototype.flush=function(e){try{if(this.requestInProgress){re.log("Flush: Request already in progress");return}e=e||{};var t=this.libConfig.batch_request_timeout_ms,r=new Date().getTime(),n=this.batchSize,o=this.queue.fillBatch(n),s=[],a={};if(i.each(o,function(f){var h=f.payload;if(this.beforeSendHook&&!f.orphaned&&(h=this.beforeSendHook(h)),h){h.event&&h.properties&&(h.properties=i.extend({},h.properties,{mp_sent_by_lib_version:C.LIB_VERSION}));var g=!0,p=f.id;p?(this.itemIdsSentSuccessfully[p]||0)>5&&(this.reportError("[dupe] item ID sent too many times, not sending",{item:f,batchSize:o.length,timesSent:this.itemIdsSentSuccessfully[p]}),g=!1):this.reportError("[dupe] found item with no ID",{item:f}),g&&s.push(h)}a[f.id]=h},this),s.length<1){this.resetFlush();return}this.requestInProgress=!0;var _=i.bind(function(f){this.requestInProgress=!1;try{var h=!1;if(e.unloading)this.queue.updatePayloads(a);else if(i.isObject(f)&&f.error==="timeout"&&new Date().getTime()-r>=t)this.reportError("Network timeout; retrying"),this.flush();else if(i.isObject(f)&&f.xhr_req&&(f.xhr_req.status>=500||f.xhr_req.status===429||f.error==="timeout")){var g=this.flushInterval*2,p=f.xhr_req.responseHeaders;if(p){var l=p["Retry-After"];l&&(g=parseInt(l,10)*1e3||g)}g=Math.min(lt,g),this.reportError("Error; retry in "+g+" ms"),this.scheduleFlush(g)}else if(i.isObject(f)&&f.xhr_req&&f.xhr_req.status===413)if(o.length>1){var d=Math.max(1,Math.floor(n/2));this.batchSize=Math.min(this.batchSize,d,o.length-1),this.reportError("413 response; reducing batch size to "+this.batchSize),this.resetFlush()}else this.reportError("Single-event request too large; dropping",o),this.resetBatchSize(),h=!0;else h=!0;h&&(this.queue.removeItemsByID(i.map(o,function(k){return k.id}),i.bind(function(k){k?(this.consecutiveRemovalFailures=0,this.flush()):(this.reportError("Failed to remove items from queue"),++this.consecutiveRemovalFailures>5?(this.reportError("Too many queue failures; disabling batching system."),this.stopAllBatching()):this.resetFlush())},this)),i.each(o,i.bind(function(k){var v=k.id;v?(this.itemIdsSentSuccessfully[v]=this.itemIdsSentSuccessfully[v]||0,this.itemIdsSentSuccessfully[v]++,this.itemIdsSentSuccessfully[v]>5&&this.reportError("[dupe] item ID sent too many times",{item:k,batchSize:o.length,timesSent:this.itemIdsSentSuccessfully[v]})):this.reportError("[dupe] found item with no ID while removing",{item:k})},this)))}catch(k){this.reportError("Error handling API response",k),this.resetFlush()}},this),c={method:"POST",verbose:!0,ignore_json_errors:!0,timeout_ms:t};e.unloading&&(c.transport="sendBeacon"),re.log("MIXPANEL REQUEST:",s),this.sendRequest(s,c,_)}catch(f){this.reportError("Error flushing request queue",f),this.resetFlush()}};N.prototype.reportError=function(e,t){if(re.error.apply(re.error,arguments),this.errorReporter)try{t instanceof Error||(t=new Error(e)),this.errorReporter(e,t)}catch(r){re.error(r)}};var dt="__mp_opt_in_out_";function gt(e,t){Qe(!0,e,t)}function vt(e,t){Qe(!1,e,t)}function yt(e,t){return Xe(e,t)==="1"}function He(e,t){if(kt(t))return b.warn('This browser has "Do Not Track" enabled. This will prevent the Mixpanel SDK from sending any data. To ignore the "Do Not Track" browser setting, initialize the Mixpanel instance with the config "ignore_dnt: true"'),!0;var r=Xe(e,t)==="0";return r&&b.warn("You are opted out of Mixpanel tracking. This will prevent the Mixpanel SDK from sending any data."),r}function Z(e){return we(e,function(t){return this.get_config(t)})}function z(e){return we(e,function(t){return this._get_config(t)})}function ee(e){return we(e,function(t){return this._get_config(t)})}function mt(e,t){t=t||{},Se(t).remove(xe(e,t),!!t.crossSubdomainCookie,t.cookieDomain)}function Se(e){return e=e||{},e.persistenceType==="localStorage"?i.localStorage:i.cookie}function xe(e,t){return t=t||{},(t.persistencePrefix||dt)+e}function Xe(e,t){return Se(t).get(xe(e,t))}function kt(e){if(e&&e.ignoreDnt)return!1;var t=e&&e.window||x,r=t.navigator||{},n=!1;return i.each([r.doNotTrack,r.msDoNotTrack,t.doNotTrack],function(o){i.includes([!0,1,"1","yes"],o)&&(n=!0)}),n}function Qe(e,t,r){if(!i.isString(t)||!t.length){b.error("gdpr."+(e?"optIn":"optOut")+" called with an invalid token");return}r=r||{},Se(r).set(xe(t,r),e?1:0,i.isNumber(r.cookieExpiration)?r.cookieExpiration:null,!!r.crossSubdomainCookie,!!r.secureCookie,!!r.crossSiteCookie,r.cookieDomain),r.track&&e&&r.track(r.trackEventName||"$opt_in",r.trackProperties,{send_immediately:!0})}function we(e,t){return function(){var r=!1;try{var n=t.call(this,"token"),o=t.call(this,"ignore_dnt"),s=t.call(this,"opt_out_tracking_persistence_type"),a=t.call(this,"opt_out_tracking_cookie_prefix"),_=t.call(this,"window");n&&(r=He(n,{ignoreDnt:o,persistenceType:s,persistencePrefix:a,window:_}))}catch(f){b.error("Unexpected error when checking tracking opt-out status: "+f)}if(!r)return e.apply(this,arguments);var c=arguments[arguments.length-1];typeof c=="function"&&c(0)}}var K="$set",V="$set_once",D="$unset",J="$add",P="$append",H="$union",$="$remove",bt="$delete",We={set_action:function(e,t){var r={},n={};return i.isObject(e)?i.each(e,function(o,s){this._is_reserved_property(s)||(n[s]=o)},this):n[e]=t,r[K]=n,r},unset_action:function(e){var t={},r=[];return i.isArray(e)||(e=[e]),i.each(e,function(n){this._is_reserved_property(n)||r.push(n)},this),t[D]=r,t},set_once_action:function(e,t){var r={},n={};return i.isObject(e)?i.each(e,function(o,s){this._is_reserved_property(s)||(n[s]=o)},this):n[e]=t,r[V]=n,r},union_action:function(e,t){var r={},n={};return i.isObject(e)?i.each(e,function(o,s){this._is_reserved_property(s)||(n[s]=i.isArray(o)?o:[o])},this):n[e]=i.isArray(t)?t:[t],r[H]=n,r},append_action:function(e,t){var r={},n={};return i.isObject(e)?i.each(e,function(o,s){this._is_reserved_property(s)||(n[s]=o)},this):n[e]=t,r[P]=n,r},remove_action:function(e,t){var r={},n={};return i.isObject(e)?i.each(e,function(o,s){this._is_reserved_property(s)||(n[s]=o)},this):n[e]=t,r[$]=n,r},delete_action:function(){var e={};return e[bt]="",e}},S=function(){};i.extend(S.prototype,We);S.prototype._init=function(e,t,r){this._mixpanel=e,this._group_key=t,this._group_id=r};S.prototype.set=ee(function(e,t,r){var n=this.set_action(e,t);return i.isObject(e)&&(r=t),this._send_request(n,r)});S.prototype.set_once=ee(function(e,t,r){var n=this.set_once_action(e,t);return i.isObject(e)&&(r=t),this._send_request(n,r)});S.prototype.unset=ee(function(e,t){var r=this.unset_action(e);return this._send_request(r,t)});S.prototype.union=ee(function(e,t,r){i.isObject(e)&&(r=t);var n=this.union_action(e,t);return this._send_request(n,r)});S.prototype.delete=ee(function(e){var t=this.delete_action();return this._send_request(t,e)});S.prototype.remove=ee(function(e,t,r){var n=this.remove_action(e,t);return this._send_request(n,r)});S.prototype._send_request=function(e,t){e.$group_key=this._group_key,e.$group_id=this._group_id,e.$token=this._get_config("token");var r=i.encodeDates(e);return this._mixpanel._track_or_batch({type:"groups",data:r,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").groups,batcher:this._mixpanel.request_batchers.groups},t)};S.prototype._is_reserved_property=function(e){return e==="$group_key"||e==="$group_id"};S.prototype._get_config=function(e){return this._mixpanel.get_config(e)};S.prototype.toString=function(){return this._mixpanel.toString()+".group."+this._group_key+"."+this._group_id};S.prototype.remove=S.prototype.remove;S.prototype.set=S.prototype.set;S.prototype.set_once=S.prototype.set_once;S.prototype.union=S.prototype.union;S.prototype.unset=S.prototype.unset;S.prototype.toString=S.prototype.toString;var y=function(){};i.extend(y.prototype,We);y.prototype._init=function(e){this._mixpanel=e};y.prototype.set=z(function(e,t,r){var n=this.set_action(e,t);return i.isObject(e)&&(r=t),this._get_config("save_referrer")&&this._mixpanel.persistence.update_referrer_info(document.referrer),n[K]=i.extend({},i.info.people_properties(),this._mixpanel.persistence.get_referrer_info(),n[K]),this._send_request(n,r)});y.prototype.set_once=z(function(e,t,r){var n=this.set_once_action(e,t);return i.isObject(e)&&(r=t),this._send_request(n,r)});y.prototype.unset=z(function(e,t){var r=this.unset_action(e);return this._send_request(r,t)});y.prototype.increment=z(function(e,t,r){var n={},o={};return i.isObject(e)?(i.each(e,function(s,a){if(!this._is_reserved_property(a))if(isNaN(parseFloat(s))){b.error("Invalid increment value passed to mixpanel.people.increment - must be a number");return}else o[a]=s},this),r=t):(i.isUndefined(t)&&(t=1),o[e]=t),n[J]=o,this._send_request(n,r)});y.prototype.append=z(function(e,t,r){i.isObject(e)&&(r=t);var n=this.append_action(e,t);return this._send_request(n,r)});y.prototype.remove=z(function(e,t,r){i.isObject(e)&&(r=t);var n=this.remove_action(e,t);return this._send_request(n,r)});y.prototype.union=z(function(e,t,r){i.isObject(e)&&(r=t);var n=this.union_action(e,t);return this._send_request(n,r)});y.prototype.track_charge=z(function(e,t,r){if(!i.isNumber(e)&&(e=parseFloat(e),isNaN(e))){b.error("Invalid value passed to mixpanel.people.track_charge - must be a number");return}return this.append("$transactions",i.extend({$amount:e},t),r)});y.prototype.clear_charges=function(e){return this.set("$transactions",[],e)};y.prototype.delete_user=function(){if(!this._identify_called()){b.error("mixpanel.people.delete_user() requires you to call identify() first");return}var e={$delete:this._mixpanel.get_distinct_id()};return this._send_request(e)};y.prototype.toString=function(){return this._mixpanel.toString()+".people"};y.prototype._send_request=function(e,t){e.$token=this._get_config("token"),e.$distinct_id=this._mixpanel.get_distinct_id();var r=this._mixpanel.get_property("$device_id"),n=this._mixpanel.get_property("$user_id"),o=this._mixpanel.get_property("$had_persisted_distinct_id");r&&(e.$device_id=r),n&&(e.$user_id=n),o&&(e.$had_persisted_distinct_id=o);var s=i.encodeDates(e);return this._identify_called()?this._mixpanel._track_or_batch({type:"people",data:s,endpoint:this._get_config("api_host")+"/"+this._get_config("api_routes").engage,batcher:this._mixpanel.request_batchers.people},t):(this._enqueue(e),i.isUndefined(t)||(this._get_config("verbose")?t({status:-1,error:null}):t(-1)),i.truncate(s,255))};y.prototype._get_config=function(e){return this._mixpanel.get_config(e)};y.prototype._identify_called=function(){return this._mixpanel._flags.identify_called===!0};y.prototype._enqueue=function(e){K in e?this._mixpanel.persistence._add_to_people_queue(K,e):V in e?this._mixpanel.persistence._add_to_people_queue(V,e):D in e?this._mixpanel.persistence._add_to_people_queue(D,e):J in e?this._mixpanel.persistence._add_to_people_queue(J,e):P in e?this._mixpanel.persistence._add_to_people_queue(P,e):$ in e?this._mixpanel.persistence._add_to_people_queue($,e):H in e?this._mixpanel.persistence._add_to_people_queue(H,e):b.error("Invalid call to _enqueue():",e)};y.prototype._flush_one_queue=function(e,t,r,n){var o=this,s=i.extend({},this._mixpanel.persistence.load_queue(e)),a=s;!i.isUndefined(s)&&i.isObject(s)&&!i.isEmptyObject(s)&&(o._mixpanel.persistence._pop_from_people_queue(e,s),o._mixpanel.persistence.save(),n&&(a=n(s)),t.call(o,a,function(_,c){_===0&&o._mixpanel.persistence._add_to_people_queue(e,s),i.isUndefined(r)||r(_,c)}))};y.prototype._flush=function(e,t,r,n,o,s,a){var _=this;this._flush_one_queue(K,this.set,e),this._flush_one_queue(V,this.set_once,n),this._flush_one_queue(D,this.unset,s,function(v){return i.keys(v)}),this._flush_one_queue(J,this.increment,t),this._flush_one_queue(H,this.union,o);var c=this._mixpanel.persistence.load_queue(P);if(!i.isUndefined(c)&&i.isArray(c)&&c.length)for(var f,h=function(v,O){v===0&&_._mixpanel.persistence._add_to_people_queue(P,f),i.isUndefined(r)||r(v,O)},g=c.length-1;g>=0;g--)c=this._mixpanel.persistence.load_queue(P),f=c.pop(),_._mixpanel.persistence.save(),i.isEmptyObject(f)||_.append(f,h);var p=this._mixpanel.persistence.load_queue($);if(!i.isUndefined(p)&&i.isArray(p)&&p.length)for(var l,d=function(v,O){v===0&&_._mixpanel.persistence._add_to_people_queue($,l),i.isUndefined(a)||a(v,O)},k=p.length-1;k>=0;k--)p=this._mixpanel.persistence.load_queue($),l=p.pop(),_._mixpanel.persistence.save(),i.isEmptyObject(l)||_.remove(l,d)};y.prototype._is_reserved_property=function(e){return e==="$distinct_id"||e==="$token"||e==="$device_id"||e==="$user_id"||e==="$had_persisted_distinct_id"};y.prototype.set=y.prototype.set;y.prototype.set_once=y.prototype.set_once;y.prototype.unset=y.prototype.unset;y.prototype.increment=y.prototype.increment;y.prototype.append=y.prototype.append;y.prototype.remove=y.prototype.remove;y.prototype.union=y.prototype.union;y.prototype.track_charge=y.prototype.track_charge;y.prototype.clear_charges=y.prototype.clear_charges;y.prototype.delete_user=y.prototype.delete_user;y.prototype.toString=y.prototype.toString;var Oe="__mps",qe="__mpso",Ie="__mpus",Ae="__mpa",Te="__mpap",De="__mpr",Ue="__mpu",Ve="$people_distinct_id",fe="__alias",ie="__timers",Et=[Oe,qe,Ie,Ae,Te,De,Ue,Ve,fe,ie],m=function(e){this.props={},this.campaign_params_saved=!1,e.persistence_name?this.name="mp_"+e.persistence_name:this.name="mp_"+e.token+"_mixpanel";var t=e.persistence;t!=="cookie"&&t!=="localStorage"&&(b.critical("Unknown persistence type "+t+"; falling back to cookie"),t=e.persistence="cookie"),t==="localStorage"&&i.localStorage.is_supported()?this.storage=i.localStorage:this.storage=i.cookie,this.load(),this.update_config(e),this.upgrade(e),this.save()};m.prototype.properties=function(){var e={};return this.load(),i.each(this.props,function(t,r){i.include(Et,r)||(e[r]=t)}),e};m.prototype.load=function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=i.extend({},e))}};m.prototype.upgrade=function(e){var t=e.upgrade,r,n;t&&(r="mp_super_properties",typeof t=="string"&&(r=t),n=this.storage.parse(r),this.storage.remove(r),this.storage.remove(r,!0),n&&(this.props=i.extend(this.props,n.all,n.events))),!e.cookie_name&&e.name!=="mixpanel"&&(r="mp_"+e.token+"_"+e.name,n=this.storage.parse(r),n&&(this.storage.remove(r),this.storage.remove(r,!0),this.register_once(n))),this.storage===i.localStorage&&(n=i.cookie.parse(this.name),i.cookie.remove(this.name),i.cookie.remove(this.name,!0),n&&this.register_once(n))};m.prototype.save=function(){this.disabled||this.storage.set(this.name,i.JSONEncode(this.props),this.expire_days,this.cross_subdomain,this.secure,this.cross_site,this.cookie_domain)};m.prototype.load_prop=function(e){return this.load(),this.props[e]};m.prototype.remove=function(){this.storage.remove(this.name,!1,this.cookie_domain),this.storage.remove(this.name,!0,this.cookie_domain)};m.prototype.clear=function(){this.remove(),this.props={}};m.prototype.register_once=function(e,t,r){return i.isObject(e)?(typeof t>"u"&&(t="None"),this.expire_days=typeof r>"u"?this.default_expiry:r,this.load(),i.each(e,function(n,o){(!this.props.hasOwnProperty(o)||this.props[o]===t)&&(this.props[o]=n)},this),this.save(),!0):!1};m.prototype.register=function(e,t){return i.isObject(e)?(this.expire_days=typeof t>"u"?this.default_expiry:t,this.load(),i.extend(this.props,e),this.save(),!0):!1};m.prototype.unregister=function(e){this.load(),e in this.props&&(delete this.props[e],this.save())};m.prototype.update_search_keyword=function(e){this.register(i.info.searchInfo(e))};m.prototype.update_referrer_info=function(e){this.register_once({$initial_referrer:e||"$direct",$initial_referring_domain:i.info.referringDomain(e)||"$direct"},"")};m.prototype.get_referrer_info=function(){return i.strip_empty_properties({$initial_referrer:this.props.$initial_referrer,$initial_referring_domain:this.props.$initial_referring_domain})};m.prototype.update_config=function(e){this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cookie_domain(e.cookie_domain),this.set_cross_site(e.cross_site_cookie),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie)};m.prototype.set_disabled=function(e){this.disabled=e,this.disabled?this.remove():this.save()};m.prototype.set_cookie_domain=function(e){e!==this.cookie_domain&&(this.remove(),this.cookie_domain=e,this.save())};m.prototype.set_cross_site=function(e){e!==this.cross_site&&(this.cross_site=e,this.remove(),this.save())};m.prototype.set_cross_subdomain=function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())};m.prototype.get_cross_subdomain=function(){return this.cross_subdomain};m.prototype.set_secure=function(e){e!==this.secure&&(this.secure=!!e,this.remove(),this.save())};m.prototype._add_to_people_queue=function(e,t){var r=this._get_queue_key(e),n=t[e],o=this._get_or_create_queue(K),s=this._get_or_create_queue(V),a=this._get_or_create_queue(D),_=this._get_or_create_queue(J),c=this._get_or_create_queue(H),f=this._get_or_create_queue($,[]),h=this._get_or_create_queue(P,[]);r===Oe?(i.extend(o,n),this._pop_from_people_queue(J,n),this._pop_from_people_queue(H,n),this._pop_from_people_queue(D,n)):r===qe?(i.each(n,function(g,p){p in s||(s[p]=g)}),this._pop_from_people_queue(D,n)):r===Ie?i.each(n,function(g){i.each([o,s,_,c],function(p){g in p&&delete p[g]}),i.each(h,function(p){g in p&&delete p[g]}),a[g]=!0}):r===Ae?(i.each(n,function(g,p){p in o?o[p]+=g:(p in _||(_[p]=0),_[p]+=g)},this),this._pop_from_people_queue(D,n)):r===Ue?(i.each(n,function(g,p){i.isArray(g)&&(p in c||(c[p]=[]),c[p]=c[p].concat(g))}),this._pop_from_people_queue(D,n)):r===De?(f.push(n),this._pop_from_people_queue(P,n)):r===Te&&(h.push(n),this._pop_from_people_queue(D,n)),b.log("MIXPANEL PEOPLE REQUEST (QUEUED, PENDING IDENTIFY):"),b.log(t),this.save()};m.prototype._pop_from_people_queue=function(e,t){var r=this.props[this._get_queue_key(e)];i.isUndefined(r)||i.each(t,function(n,o){e===P||e===$?i.each(r,function(s){s[o]===n&&delete s[o]}):delete r[o]},this)};m.prototype.load_queue=function(e){return this.load_prop(this._get_queue_key(e))};m.prototype._get_queue_key=function(e){if(e===K)return Oe;if(e===V)return qe;if(e===D)return Ie;if(e===J)return Ae;if(e===P)return Te;if(e===$)return De;if(e===H)return Ue;b.error("Invalid queue:",e)};m.prototype._get_or_create_queue=function(e,t){var r=this._get_queue_key(e);return t=i.isUndefined(t)?{}:t,this.props[r]||(this.props[r]=t)};m.prototype.set_event_timer=function(e,t){var r=this.load_prop(ie)||{};r[e]=t,this.props[ie]=r,this.save()};m.prototype.remove_event_timer=function(e){var t=this.load_prop(ie)||{},r=t[e];return i.isUndefined(r)||(delete this.props[ie][e],this.save()),r};var Pe,I,Ze=0,St=1,xt=function(e){return e},ne=function(){},T="mixpanel",et="base64",wt="json",Ne="$device:",Q=x.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,tt=!Q&&U.indexOf("MSIE")===-1&&U.indexOf("Mozilla")===-1,_e=null;j.sendBeacon&&(_e=function(){return j.sendBeacon.apply(j,arguments)});var rt={track:"track/",engage:"engage/",groups:"groups/"},ze={api_host:"https://api-js.mixpanel.com",api_routes:rt,api_method:"POST",api_transport:"XHR",api_payload_format:et,app_host:"https://mixpanel.com",cdn:"https://cdn.mxpnl.com",cross_site_cookie:!1,cross_subdomain_cookie:!0,error_reporter:ne,persistence:"cookie",persistence_name:"",cookie_domain:"",cookie_name:"",loaded:ne,track_marketing:!0,track_pageview:!1,skip_first_touch_marketing:!1,store_google:!0,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,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:{}},it=!1,u=function(){},ke=function(e,t,r){var n,o=r===T?I:I[r];if(o&&Pe===Ze)n=o;else{if(o&&!i.isArray(o)){b.error("You have already initialized "+r);return}n=new u}if(n._cached_groups={},n._init(e,t,r),n.people=new y,n.people._init(n),!n.get_config("skip_first_touch_marketing")){var s=i.info.campaignParams(null),a={},_=!1;i.each(s,function(c,f){a["initial_"+f]=c,c&&(_=!0)}),_&&n.people.set_once(a)}return C.DEBUG=C.DEBUG||n.get_config("debug"),!i.isUndefined(o)&&i.isArray(o)&&(n._execute_array.call(n.people,o.people),n._execute_array(o)),n};u.prototype.init=function(e,t,r){if(i.isUndefined(r)){this.report_error("You must name your new library: init(token, config, name)");return}if(r===T){this.report_error("You must initialize the main mixpanel object right after you include the Mixpanel js snippet");return}var n=ke(e,t,r);return I[r]=n,n._loaded(),n};u.prototype._init=function(e,t,r){t=t||{},this.__loaded=!0,this.config={};var n={};if(!("api_payload_format"in t)){var o=t.api_host||ze.api_host;o.match(/\.mixpanel\.com/)&&(n.api_payload_format=wt)}if(this.set_config(i.extend({},ze,n,t,{name:r,token:e,callback_fn:(r===T?r:T+"."+r)+"._jsc"})),this._jsc=ne,this.__dom_loaded_queue=[],this.__request_queue=[],this.__disabled_events=[],this._flags={disable_all_events:!1,identify_called:!1},this.request_batchers={},this._batch_requests=this.get_config("batch_requests"),this._batch_requests){if(!i.localStorage.is_supported(!0)||!Q)this._batch_requests=!1,b.log("Turning off Mixpanel request-queueing; needs XHR and localStorage support"),i.each(this.get_batcher_configs(),function(_){b.log("Clearing batch queue "+_.queue_key),i.localStorage.remove(_.queue_key)});else if(this.init_batchers(),_e&&x.addEventListener){var s=i.bind(function(){this.request_batchers.events.stopped||this.request_batchers.events.flush({unloading:!0})},this);x.addEventListener("pagehide",function(_){_.persisted&&s()}),x.addEventListener("visibilitychange",function(){E.visibilityState==="hidden"&&s()})}}this.persistence=this.cookie=new m(this.config),this.unpersisted_superprops={},this._gdpr_init();var a=i.UUID();this.get_distinct_id()||this.register_once({distinct_id:Ne+a,$device_id:a},""),this.get_config("track_pageview")&&this.track_pageview()};u.prototype._loaded=function(){this.get_config("loaded")(this),this._set_default_superprops()};u.prototype._set_default_superprops=function(){this.persistence.update_search_keyword(E.referrer),this.get_config("store_google")&&this.register(i.info.campaignParams()),this.get_config("save_referrer")&&this.persistence.update_referrer_info(E.referrer)};u.prototype._dom_loaded=function(){i.each(this.__dom_loaded_queue,function(e){this._track_dom.apply(this,e)},this),this.has_opted_out_tracking()||i.each(this.__request_queue,function(e){this._send_request.apply(this,e)},this),delete this.__dom_loaded_queue,delete this.__request_queue};u.prototype._track_dom=function(e,t){if(this.get_config("img"))return this.report_error("You can't use DOM tracking functions with img = true."),!1;if(!it)return this.__dom_loaded_queue.push([e,t]),!1;var r=new e().init(this);return r.track.apply(r,t)};u.prototype._prepare_callback=function(e,t){if(i.isUndefined(e))return null;if(Q){var r=function(a){e(a,t)};return r}else{var n=this._jsc,o=""+Math.floor(Math.random()*1e8),s=this.get_config("callback_fn")+"["+o+"]";return n[o]=function(a){delete n[o],e(a,t)},s}};u.prototype._send_request=function(e,t,r,n){var o=!0;if(tt)return this.__request_queue.push(arguments),o;var s={method:this.get_config("api_method"),transport:this.get_config("api_transport"),verbose:this.get_config("verbose")},a=null;!n&&(i.isFunction(r)||typeof r=="string")&&(n=r,r=null),r=i.extend(s,r||{}),Q||(r.method="GET");var _=r.method==="POST",c=_e&&_&&r.transport.toLowerCase()==="sendbeacon",f=r.verbose;t.verbose&&(f=!0),this.get_config("test")&&(t.test=1),f&&(t.verbose=1),this.get_config("img")&&(t.img=1),Q||(n?t.callback=n:(f||this.get_config("test"))&&(t.callback="(function(){})")),t.ip=this.get_config("ip")?1:0,t._=new Date().getTime().toString(),_&&(a="data="+encodeURIComponent(t.data),delete t.data),e+="?"+i.HTTPBuildQuery(t);var h=this;if("img"in t){var g=E.createElement("img");g.src=e,E.body.appendChild(g)}else if(c){try{o=_e(e,a)}catch(O){h.report_error(O),o=!1}try{n&&n(o?1:0)}catch(O){h.report_error(O)}}else if(Q)try{var p=new XMLHttpRequest;p.open(r.method,e,!0);var l=this.get_config("xhr_headers");if(_&&(l["Content-Type"]="application/x-www-form-urlencoded"),i.each(l,function(O,w){p.setRequestHeader(w,O)}),r.timeout_ms&&typeof p.timeout<"u"){p.timeout=r.timeout_ms;var d=new Date().getTime()}p.withCredentials=!0,p.onreadystatechange=function(){if(p.readyState===4)if(p.status===200){if(n)if(f){var O;try{O=i.JSONDecode(p.responseText)}catch(B){if(h.report_error(B),r.ignore_json_errors)O=p.responseText;else return}n(O)}else n(Number(p.responseText))}else{var w;p.timeout&&!p.status&&new Date().getTime()-d>=p.timeout?w="timeout":w="Bad HTTP status: "+p.status+" "+p.statusText,h.report_error(w),n&&n(f?{status:0,error:w,xhr_req:p}:0)}},p.send(a)}catch(O){h.report_error(O),o=!1}else{var k=E.createElement("script");k.type="text/javascript",k.async=!0,k.defer=!0,k.src=e;var v=E.getElementsByTagName("script")[0];v.parentNode.insertBefore(k,v)}return o};u.prototype._execute_array=function(e){var t,r=[],n=[],o=[];i.each(e,function(a){a&&(t=a[0],i.isArray(t)?o.push(a):typeof a=="function"?a.call(this):i.isArray(a)&&t==="alias"?r.push(a):i.isArray(a)&&t.indexOf("track")!==-1&&typeof this[t]=="function"?o.push(a):n.push(a))},this);var s=function(a,_){i.each(a,function(c){if(i.isArray(c[0])){var f=_;i.each(c,function(h){f=f[h[0]].apply(f,h.slice(1))})}else this[c[0]].apply(this,c.slice(1))},_)};s(r,this),s(n,this),s(o,this)};u.prototype.are_batchers_initialized=function(){return!!this.request_batchers.events};u.prototype.get_batcher_configs=function(){var e="__mpq_"+this.get_config("token"),t=this.get_config("api_routes");return this._batcher_configs=this._batcher_configs||{events:{type:"events",endpoint:"/"+t.track,queue_key:e+"_ev"},people:{type:"people",endpoint:"/"+t.engage,queue_key:e+"_pp"},groups:{type:"groups",endpoint:"/"+t.groups,queue_key:e+"_gr"}},this._batcher_configs};u.prototype.init_batchers=function(){if(!this.are_batchers_initialized()){var e=i.bind(function(r){return new N(r.queue_key,{libConfig:this.config,sendRequestFunc:i.bind(function(n,o,s){this._send_request(this.get_config("api_host")+r.endpoint,this._encode_data_for_request(n),o,this._prepare_callback(s,n))},this),beforeSendHook:i.bind(function(n){return this._run_hook("before_send_"+r.type,n)},this),errorReporter:this.get_config("error_reporter"),stopAllBatchingFunc:i.bind(this.stop_batch_senders,this)})},this),t=this.get_batcher_configs();this.request_batchers={events:e(t.events),people:e(t.people),groups:e(t.groups)}}this.get_config("batch_autostart")&&this.start_batch_senders()};u.prototype.start_batch_senders=function(){this._batchers_were_started=!0,this.are_batchers_initialized()&&(this._batch_requests=!0,i.each(this.request_batchers,function(e){e.start()}))};u.prototype.stop_batch_senders=function(){this._batch_requests=!1,i.each(this.request_batchers,function(e){e.stop(),e.clear()})};u.prototype.push=function(e){this._execute_array([e])};u.prototype.disable=function(e){typeof e>"u"?this._flags.disable_all_events=!0:this.__disabled_events=this.__disabled_events.concat(e)};u.prototype._encode_data_for_request=function(e){var t=i.JSONEncode(e);return this.get_config("api_payload_format")===et&&(t=i.base64Encode(t)),{data:t}};u.prototype._track_or_batch=function(e,t){var r=i.truncate(e.data,255),n=e.endpoint,o=e.batcher,s=e.should_send_immediately,a=e.send_request_options||{};t=t||ne;var _=!0,c=i.bind(function(){return a.skip_hooks||(r=this._run_hook("before_send_"+e.type,r)),r?(b.log("MIXPANEL REQUEST:"),b.log(r),this._send_request(n,this._encode_data_for_request(r),a,this._prepare_callback(t,r))):null},this);return this._batch_requests&&!s?o.enqueue(r,function(f){f?t(1,r):c()}):_=c(),_&&r};u.prototype.track=Z(function(e,t,r,n){!n&&typeof r=="function"&&(n=r,r=null),r=r||{};var o=r.transport;o&&(r.transport=o);var s=r.send_immediately;if(typeof n!="function"&&(n=ne),i.isUndefined(e)){this.report_error("No event name provided to mixpanel.track");return}if(this._event_is_disabled(e)){n(0);return}t=i.extend({},t),t.token=this.get_config("token");var a=this.persistence.remove_event_timer(e);if(!i.isUndefined(a)){var _=new Date().getTime()-a;t.$duration=parseFloat((_/1e3).toFixed(3))}this._set_default_superprops();var c=this.get_config("track_marketing")?i.info.marketingParams():{};t=i.extend({},i.info.properties(),c,this.persistence.properties(),this.unpersisted_superprops,t);var f=this.get_config("property_blacklist");i.isArray(f)?i.each(f,function(p){delete t[p]}):this.report_error("Invalid value for property_blacklist config: "+f);var h={event:e,properties:t},g=this._track_or_batch({type:"events",data:h,endpoint:this.get_config("api_host")+"/"+this.get_config("api_routes").track,batcher:this.request_batchers.events,should_send_immediately:s,send_request_options:r},n);return g});u.prototype.set_group=Z(function(e,t,r){i.isArray(t)||(t=[t]);var n={};return n[e]=t,this.register(n),this.people.set(e,t,r)});u.prototype.add_group=Z(function(e,t,r){var n=this.get_property(e),o={};return n===void 0?(o[e]=[t],this.register(o)):n.indexOf(t)===-1&&(n.push(t),o[e]=n,this.register(o)),this.people.union(e,t,r)});u.prototype.remove_group=Z(function(e,t,r){var n=this.get_property(e);if(n!==void 0){var o=n.indexOf(t);o>-1&&(n.splice(o,1),this.register({group_key:n})),n.length===0&&this.unregister(e)}return this.people.remove(e,t,r)});u.prototype.track_with_groups=Z(function(e,t,r,n){var o=i.extend({},t||{});return i.each(r,function(s,a){s!=null&&(o[a]=s)}),this.track(e,o,n)});u.prototype._create_map_key=function(e,t){return e+"_"+JSON.stringify(t)};u.prototype._remove_group_from_cache=function(e,t){delete this._cached_groups[this._create_map_key(e,t)]};u.prototype.get_group=function(e,t){var r=this._create_map_key(e,t),n=this._cached_groups[r];return(n===void 0||n._group_key!==e||n._group_id!==t)&&(n=new S,n._init(this,e,t),this._cached_groups[r]=n),n};u.prototype.track_pageview=Z(function(e,t){typeof e!="object"&&(e={}),t=t||{};var r=t.event_name||"$mp_web_page_view",n=i.extend(i.info.mpPageViewProperties(),i.info.campaignParams(),i.info.clickParams()),o=i.extend({},n,e);return this.track(r,o)});u.prototype.track_links=function(){return this._track_dom.call(this,W,arguments)};u.prototype.track_forms=function(){return this._track_dom.call(this,de,arguments)};u.prototype.time_event=function(e){if(i.isUndefined(e)){this.report_error("No event name provided to mixpanel.time_event");return}this._event_is_disabled(e)||this.persistence.set_event_timer(e,new Date().getTime())};var Ot={persistent:!0},Ce=function(e){var t;return i.isObject(e)?t=e:i.isUndefined(e)?t={}:t={days:e},i.extend({},Ot,t)};u.prototype.register=function(e,t){var r=Ce(t);r.persistent?this.persistence.register(e,r.days):i.extend(this.unpersisted_superprops,e)};u.prototype.register_once=function(e,t,r){var n=Ce(r);n.persistent?this.persistence.register_once(e,t,n.days):(typeof t>"u"&&(t="None"),i.each(e,function(o,s){(!this.unpersisted_superprops.hasOwnProperty(s)||this.unpersisted_superprops[s]===t)&&(this.unpersisted_superprops[s]=o)},this))};u.prototype.unregister=function(e,t){t=Ce(t),t.persistent?this.persistence.unregister(e):delete this.unpersisted_superprops[e]};u.prototype._register_single=function(e,t){var r={};r[e]=t,this.register(r)};u.prototype.identify=function(e,t,r,n,o,s,a,_){var c=this.get_distinct_id();if(e&&c!==e){if(typeof e=="string"&&e.indexOf(Ne)===0)return this.report_error("distinct_id cannot have $device: prefix"),-1;this.register({$user_id:e})}if(!this.get_property("$device_id")){var f=c;this.register_once({$had_persisted_distinct_id:!0,$device_id:f},"")}e!==c&&e!==this.get_property(fe)&&(this.unregister(fe),this.register({distinct_id:e})),this._flags.identify_called=!0,this.people._flush(t,r,n,o,s,a,_),e!==c&&this.track("$identify",{distinct_id:e,$anon_distinct_id:c},{skip_hooks:!0})};u.prototype.reset=function(){this.persistence.clear(),this._flags.identify_called=!1;var e=i.UUID();this.register_once({distinct_id:Ne+e,$device_id:e},"")};u.prototype.get_distinct_id=function(){return this.get_property("distinct_id")};u.prototype.alias=function(e,t){if(e===this.get_property(Ve))return this.report_error("Attempting to create alias for existing People user - aborting."),-2;var r=this;return i.isUndefined(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(fe,e),this.track("$create_alias",{alias:e,distinct_id:t},{skip_hooks:!0},function(){r.identify(e)})):(this.report_error("alias matches current distinct_id - skipping api call."),this.identify(e),-1)};u.prototype.name_tag=function(e){this._register_single("mp_name_tag",e)};u.prototype.set_config=function(e){if(i.isObject(e)){i.extend(this.config,e);var t=e.batch_size;t&&i.each(this.request_batchers,function(r){r.resetBatchSize()}),this.get_config("persistence_name")||(this.config.persistence_name=this.config.cookie_name),this.get_config("disable_persistence")||(this.config.disable_persistence=this.config.disable_cookie),this.persistence&&this.persistence.update_config(this.config),C.DEBUG=C.DEBUG||this.get_config("debug")}};u.prototype.get_config=function(e){return this.config[e]};u.prototype._run_hook=function(e){var t=(this.config.hooks[e]||xt).apply(this,L.call(arguments,1));return typeof t>"u"&&(this.report_error(e+" hook did not return a value"),t=null),t};u.prototype.get_property=function(e){return this.persistence.load_prop([e])};u.prototype.toString=function(){var e=this.get_config("name");return e!==T&&(e=T+"."+e),e};u.prototype._event_is_disabled=function(e){return i.isBlockedUA(U)||this._flags.disable_all_events||i.include(this.__disabled_events,e)};u.prototype._gdpr_init=function(){var e=this.get_config("opt_out_tracking_persistence_type")==="localStorage";e&&i.localStorage.is_supported()&&(!this.has_opted_in_tracking()&&this.has_opted_in_tracking({persistence_type:"cookie"})&&this.opt_in_tracking({enable_persistence:!1}),!this.has_opted_out_tracking()&&this.has_opted_out_tracking({persistence_type:"cookie"})&&this.opt_out_tracking({clear_persistence:!1}),this.clear_opt_in_out_tracking({persistence_type:"cookie",enable_persistence:!1})),this.has_opted_out_tracking()?this._gdpr_update_persistence({clear_persistence:!0}):!this.has_opted_in_tracking()&&(this.get_config("opt_out_tracking_by_default")||i.cookie.get("mp_optout"))&&(i.cookie.remove("mp_optout"),this.opt_out_tracking({clear_persistence:this.get_config("opt_out_persistence_by_default")}))};u.prototype._gdpr_update_persistence=function(e){var t;if(e&&e.clear_persistence)t=!0;else if(e&&e.enable_persistence)t=!1;else return;!this.get_config("disable_persistence")&&this.persistence.disabled!==t&&this.persistence.set_disabled(t),t?this.stop_batch_senders():this._batchers_were_started&&this.start_batch_senders()};u.prototype._gdpr_call_func=function(e,t){return t=i.extend({track:i.bind(this.track,this),persistence_type:this.get_config("opt_out_tracking_persistence_type"),cookie_prefix:this.get_config("opt_out_tracking_cookie_prefix"),cookie_expiration:this.get_config("cookie_expiration"),cross_site_cookie:this.get_config("cross_site_cookie"),cross_subdomain_cookie:this.get_config("cross_subdomain_cookie"),cookie_domain:this.get_config("cookie_domain"),secure_cookie:this.get_config("secure_cookie"),ignore_dnt:this.get_config("ignore_dnt")},t),i.localStorage.is_supported()||(t.persistence_type="cookie"),e(this.get_config("token"),{track:t.track,trackEventName:t.track_event_name,trackProperties:t.track_properties,persistenceType:t.persistence_type,persistencePrefix:t.cookie_prefix,cookieDomain:t.cookie_domain,cookieExpiration:t.cookie_expiration,crossSiteCookie:t.cross_site_cookie,crossSubdomainCookie:t.cross_subdomain_cookie,secureCookie:t.secure_cookie,ignoreDnt:t.ignore_dnt})};u.prototype.opt_in_tracking=function(e){e=i.extend({enable_persistence:!0},e),this._gdpr_call_func(gt,e),this._gdpr_update_persistence(e)};u.prototype.opt_out_tracking=function(e){e=i.extend({clear_persistence:!0,delete_user:!0},e),e.delete_user&&this.people&&this.people._identify_called()&&(this.people.delete_user(),this.people.clear_charges()),this._gdpr_call_func(vt,e),this._gdpr_update_persistence(e)};u.prototype.has_opted_in_tracking=function(e){return this._gdpr_call_func(yt,e)};u.prototype.has_opted_out_tracking=function(e){return this._gdpr_call_func(He,e)};u.prototype.clear_opt_in_out_tracking=function(e){e=i.extend({enable_persistence:!0},e),this._gdpr_call_func(mt,e),this._gdpr_update_persistence(e)};u.prototype.report_error=function(e,t){b.error.apply(b.error,arguments);try{!t&&!(e instanceof Error)&&(e=new Error(e)),this.get_config("error_reporter")(e,t)}catch(r){b.error(r)}};u.prototype.init=u.prototype.init;u.prototype.reset=u.prototype.reset;u.prototype.disable=u.prototype.disable;u.prototype.time_event=u.prototype.time_event;u.prototype.track=u.prototype.track;u.prototype.track_links=u.prototype.track_links;u.prototype.track_forms=u.prototype.track_forms;u.prototype.track_pageview=u.prototype.track_pageview;u.prototype.register=u.prototype.register;u.prototype.register_once=u.prototype.register_once;u.prototype.unregister=u.prototype.unregister;u.prototype.identify=u.prototype.identify;u.prototype.alias=u.prototype.alias;u.prototype.name_tag=u.prototype.name_tag;u.prototype.set_config=u.prototype.set_config;u.prototype.get_config=u.prototype.get_config;u.prototype.get_property=u.prototype.get_property;u.prototype.get_distinct_id=u.prototype.get_distinct_id;u.prototype.toString=u.prototype.toString;u.prototype.opt_out_tracking=u.prototype.opt_out_tracking;u.prototype.opt_in_tracking=u.prototype.opt_in_tracking;u.prototype.has_opted_out_tracking=u.prototype.has_opted_out_tracking;u.prototype.has_opted_in_tracking=u.prototype.has_opted_in_tracking;u.prototype.clear_opt_in_out_tracking=u.prototype.clear_opt_in_out_tracking;u.prototype.get_group=u.prototype.get_group;u.prototype.set_group=u.prototype.set_group;u.prototype.add_group=u.prototype.add_group;u.prototype.remove_group=u.prototype.remove_group;u.prototype.track_with_groups=u.prototype.track_with_groups;u.prototype.start_batch_senders=u.prototype.start_batch_senders;u.prototype.stop_batch_senders=u.prototype.stop_batch_senders;u.prototype.DEFAULT_API_ROUTES=rt;m.prototype.properties=m.prototype.properties;m.prototype.update_search_keyword=m.prototype.update_search_keyword;m.prototype.update_referrer_info=m.prototype.update_referrer_info;m.prototype.get_cross_subdomain=m.prototype.get_cross_subdomain;m.prototype.clear=m.prototype.clear;var X={},qt=function(){i.each(X,function(e,t){t!==T&&(I[t]=e)}),I._=i},It=function(){I.init=function(e,t,r){if(r)return I[r]||(I[r]=X[r]=ke(e,t,r),I[r]._loaded()),I[r];var n=I;X[T]?n=X[T]:e&&(n=ke(e,t,T),n._loaded(),X[T]=n),I=n,Pe===St&&(x[T]=I),qt()}},At=function(){function e(){e.done||(e.done=!0,it=!0,tt=!1,i.each(X,function(n){n._dom_loaded()}))}function t(){try{E.documentElement.doScroll("left")}catch{setTimeout(t,1);return}e()}if(E.addEventListener)E.readyState==="complete"?e():E.addEventListener("DOMContentLoaded",e,!1);else if(E.attachEvent){E.attachEvent("onreadystatechange",e);var r=!1;try{r=x.frameElement===null}catch{}E.documentElement.doScroll&&r&&t()}i.register_event(x,"load",e,!0)};function Tt(){return Pe=Ze,I=new u,It(),I.init(),At(),I}var Dt=Tt(),Ut=Dt;const Nt=ot(Ut);export{Nt as m};
