amplitude / Amplitude-JavaScript

JavaScript SDK for Amplitude
MIT License
315 stars 133 forks source link

Failed to find a valid digest in the 'integrity' attribute #281

Open enriquesalceda opened 4 years ago

enriquesalceda commented 4 years ago

Amplitude is working fine in my local machine, when I deploy to one of our test environments I'm not able to see the event details (they just appear as test events), or to identify the users.

script type="text/javascript">
  (function(e,t){var n=e.amplitude||{_q:[],_iq:{}};var r=t.createElement("script")
  ;r.type="text/javascript"
  ;r.integrity="sha384-cukXwabQy+j/QA1+RqiXSzxhgQg5Rrn3zVszlwH3pWj/bXJxlA8Ge7NhcD6vP2Ik"
  ;r.crossOrigin="anonymous";r.async=true
  ;r.src="https://cdn.amplitude.com/libs/amplitude-7.1.0-min.gz.js"
  ;r.onload=function(){if(!e.amplitude.runQueuedFunctions){
  console.log("[Amplitude] Error: could not load SDK")}}
  ;var i=t.getElementsByTagName("script")[0];i.parentNode.insertBefore(r,i)
  ;function s(e,t){e.prototype[t]=function(){
  this._q.push([t].concat(Array.prototype.slice.call(arguments,0)));return this}}
  var o=function(){this._q=[];return this}
  ;var a=["add","append","clearAll","prepend","set","setOnce","unset"]
  ;for(var c=0;c<a.length;c++){s(o,a[c])}n.Identify=o;var u=function(){this._q=[]
  ;return this}
  ;var l=["setProductId","setQuantity","setPrice","setRevenueType","setEventProperties"]
  ;for(var p=0;p<l.length;p++){s(u,l[p])}n.Revenue=u
  ;var d=["init","logEvent","logRevenue","setUserId","setUserProperties","setOptOut","setVersionName","setDomain","setDeviceId","enableTracking","setGlobalUserProperties","identify","clearUserProperties","setGroup","logRevenueV2","regenerateDeviceId","groupIdentify","onInit","logEventWithTimestamp","logEventWithGroups","setSessionId","resetSessionId"]
  ;function v(e){function t(t){e[t]=function(){
  e._q.push([t].concat(Array.prototype.slice.call(arguments,0)))}}
  for(var n=0;n<d.length;n++){t(d[n])}}v(n);n.getInstance=function(e){
  e=(!e||e.length===0?"$default_instance":e).toLowerCase()
  ;if(!n._iq.hasOwnProperty(e)){n._iq[e]={_q:[]};v(n._iq[e])}return n._iq[e]}
  ;e.amplitude=n})(window,document);

  amplitude.getInstance().init('<%= Rails.application.credentials.amplitude[:api_key] %>');

I have made sure my API key is there.

Charlslum commented 4 years ago

var amplitude=function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(e){o(t,e,n[e])})}return t}var g={DEFAULT_INSTANCE:"$default_instance",API_VERSION:2,MAX_STRING_LENGTH:4096,MAX_PROPERTY_KEYS:1e3,IDENTIFY_EVENT:"$identify",GROUP_IDENTIFY_EVENT:"$groupidentify",LAST_EVENT_ID:"amplitude_lastEventId",LAST_EVENT_TIME:"amplitude_lastEventTime",LAST_IDENTIFY_ID:"amplitude_lastIdentifyId",LAST_SEQUENCE_NUMBER:"amplitude_lastSequenceNumber",SESSION_ID:"amplitude_sessionId",DEVICE_ID:"amplitude_deviceId",OPT_OUT:"amplitude_optOut",USER_ID:"amplitude_userId",COOKIE_TEST_PREFIX:"amp_cookie_test",COOKIE_PREFIX:"amp",REVENUE_EVENT:"revenue_amount",REVENUE_PRODUCT_ID:"$productId",REVENUE_QUANTITY:"$quantity",REVENUE_PRICE:"$price",REVENUE_REVENUE_TYPE:"$revenueType",AMP_DEVICE_ID_PARAM:"amp_device_id",REFERRER:"referrer",UTM_SOURCE:"utm_source",UTM_MEDIUM:"utm_medium",UTM_CAMPAIGN:"utm_campaign",UTM_TERM:"utm_term",UTM_CONTENT:"utm_content"},p=function(e){for(var t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):(127<i&&i<2048?t+=String.fromCharCode(i>>6|192):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128)),t+=String.fromCharCode(63&i|128))}return t},c=function(e){for(var t="",n=0,i=0,o=0,r=0;n<e.length;)(i=e.charCodeAt(n))<128?(t+=String.fromCharCode(i),n++):191<i&&i<224?(o=e.charCodeAt(n+1),t+=String.fromCharCode((31&i)<<6|63&o),n+=2):(o=e.charCodeAt(n+1),r=e.charCodeAt(n+2),t+=String.fromCharCode((15&i)<<12|(63&o)<<6|63&r),n+=3);return t},l={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){try{if(window.btoa&&window.atob)return window.btoa(unescape(encodeURIComponent(e)))}catch(e){}return l._encode(e)},_encode:function(e){var t,n,i,o,r,s,a,u="",c=0;for(e=p(e);c<e.length;)o=(t=e.charCodeAt(c++))>>2,r=(3&t)<<4|(n=e.charCodeAt(c++))>>4,s=(15&n)<<2|(i=e.charCodeAt(c++))>>6,a=63&i,isNaN(n)?s=a=64:isNaN(i)&&(a=64),u=u+l._keyStr.charAt(o)+l._keyStr.charAt(r)+l._keyStr.charAt(s)+l._keyStr.charAt(a);return u},decode:function(e){try{if(window.btoa&&window.atob)return decodeURIComponent(escape(window.atob(e)))}catch(e){}return l._decode(e)},_decode:function(e){var t,n,i,o,r,s,a="",u=0;for(e=e.replace(/[^A-Za-z0-9+\/\=]/g,"");u<e.length;)t=l._keyStr.indexOf(e.charAt(u++))<<2|(o=l._keyStr.indexOf(e.charAt(u++)))>>4,n=(15&o)<<4|(r=l._keyStr.indexOf(e.charAt(u++)))>>2,i=(3&r)<<6|(s=l._keyStr.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!==r&&(a+=String.fromCharCode(n)),64!==s&&(a+=String.fromCharCode(i));return a=c(a)}},n=Object.prototype.toString;function m(e){switch(n.call(e)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return null===e?"null":void 0===e?"undefined":e!=e?"nan":e&&1===e.nodeType?"element":"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e)?"buffer":t(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e))}var e,r={DISABLE:0,ERROR:1,WARN:2,INFO:3},s=r.WARN,u={error:function(e){s>=r.ERROR&&a(e)},warn:function(e){s>=r.WARN&&a(e)},info:function(e){s>=r.INFO&&a(e)}},a=function(e){try{console.log("[Amplitude] "+e)}catch(e){}},d=function(e){return"string"===m(e)&&e.length>g.MAX_STRING_LENGTH?e.substring(0,g.MAX_STRING_LENGTH):e},h=function(e){var t=m(e);if("object"!==t)return u.error("Error: invalid properties format. Expecting Javascript object, received "+t+", ignoring"),{};if(Object.keys(e).length>g.MAX_PROPERTYKEYS)return u.error("Error: too many properties (more than 1000), ignoring"),{};var n={};for(var i in e)if(e.hasOwnProperty(i)){var o=i,r=m(o);"string"!==r&&(o=String(o),u.warn("WARNING: Non-string property key, received type "+r+', coercing to string "'+o+'"'));var s=y(o,e[i]);null!==s&&(n[o]=s)}return n},f=["nan","function","arguments","regexp","element"],y=function e(t,n){var i=m(n);if(-1!==f.indexOf(i))u.warn('WARNING: Property key "'+t+'" with invalid value type '+i+", ignoring"),n=null;else if("undefined"===i)n=null;else if("error"===i)n=String(n),u.warn('WARNING: Property key "'+t+'" with value type error, coercing to '+n);else if("array"===i){for(var o=[],r=0;r<n.length;r++){var s=n[r],a=m(s);"array"!==a?"object"===a?o.push(h(s)):o.push(e(t,s)):u.warn("WARNING: Cannot have "+a+" nested in an array property value, skipping")}n=o}else"object"===i&&(n=h(n));return n},=function(e,t){var n=m(t);if("string"===n)return t;if("date"===n||"number"===n||"boolean"===n)return t=String(t),u.warn("WARNING: Non-string groupName, received type "+n+', coercing to string "'+t+'"'),t;if("array"===n){for(var i=[],o=0;o<t.length;o++){var r=t[o],s=m(r);"array"!==s&&"object"!==s?"string"===s?i.push(r):"date"!==s&&"number"!==s&&"boolean"!==s||(r=String(r),u.warn("WARNING: Non-string groupName, received type "+s+', coercing to string "'+r+'"'),i.push(r)):u.warn("WARNING: Skipping nested "+s+" in array groupName")}return i}u.warn("WARNING: Non-string groupName, received type "+n+". Please use strings or array of strings for groupName")},w=function(e){r.hasOwnProperty(e)&&(s=r[e])},I=u,b=function(e){return!e||0===e.length},E=function(e,t){e=e.replace(/[[]/,"\[").replace(/[]]/,"\]");var n=new RegExp("[\?&]"+e+"=([^&#])").exec(t);return null===n?void 0:decodeURIComponent(n[1].replace(/+/g," "))},S=function e(t){if("array"===m(t))for(var n=0;n<t.length;n++)t[n]=e(t[n]);else if("object"===m(t))for(var i in t)t.hasOwnProperty(i)&&(t[i]=e(t[i]));else t=d(t);return t},N=function(e){var t=m(e);if("object"!==t)return u.error("Error: invalid groups format. Expecting Javascript object, received "+t+", ignoring"),{};var n={};for(var i in e)if(e.hasOwnProperty(i)){var o=i,r=m(o);"string"!==r&&(o=String(o),u.warn("WARNING: Non-string groupType, received type "+r+', coercing to string "'+o+'"'));var s=(o,e[i]);null!==s&&(n[o]=s)}return n},T=function(e,t,n){return m(e)===n||(u.error("Invalid "+t+" input type. Expected "+n+" but received "+m(e)),!1)},O=h,k=function(){return window.location},A=function(){for(var e="",t=0;t<22;++t)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-".charAt(Math.floor(64Math.random()));return e},x=function(e){try{for(var t=document.cookie.split(";"),n=null,i=0;i<t.length;i++){for(var o=t[i];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(e)){n=o.substring(e.length,o.length);break}}return n}catch(e){return null}},R=function(e,t,n){var i=null!==t?n.expirationDays:-1;if(i){var o=new Date;o.setTime(o.getTime()+24i60601e3),i=o}var r=e+"="+t;i&&(r+="; expires="+i.toUTCString()),r+="; path=/",n.domain&&(r+="; domain="+n.domain),n.secure&&(r+="; Secure"),n.sameSite&&(r+="; SameSite="+n.sameSite),document.cookie=r},C=R,P=x,U=function(){var e=String(new Date);try{var t=g.COOKIE_TEST+A();R(t,e,{});var n=x(t+"=")===e;return R(t,null,{}),n}catch(e){}return!1},D=function(e){var t=document.createElement("a");return t.href=e,t.hostname||location.hostname},q=function(e){for(var t=D(e).split("."),n=[],i="tldtest"+A(),o=t.length-2;0<=o;--o)n.push(t.slice(o).join("."));for(var r=0;r<n.length;++r){var s=n[r],a={domain:"."+s};if(C(i,1,a),P(i))return C(i,null,a),s}return""},M={expirationDays:void 0,domain:void 0},j=function(e){var t="";return M.domain&&(t="."===M.domain.charAt(0)?M.domain.substring(1):M.domain),e+t},V=function(e){var t=j(e)+"=",n=P(t);try{if(n)return JSON.parse(l.decode(n))}catch(e){return null}return null},K=function(e,t){try{return C(j(e),l.encode(JSON.stringify(t)),M),!0}catch(e){return!1}},F=function(e){try{return C(j(e),null,M),!0}catch(e){return!1}},G={reset:function(){M={expirationDays:void 0,domain:void 0}},options:function(e){if(0===arguments.length)return M;e=e||{},M.expirationDays=e.expirationDays,M.secure=e.secure,M.sameSite=e.sameSite;var t=b(e.domain)?"."+q(k().href):e.domain,n=Math.random();M.domain=t,K("amplitude_test",n);var i=V("amplitude_test");return i&&i===n||(t=null),F("amplitude_test"),M.domain=t,M},get:V,set:K,remove:F,setRaw:function(e,t){try{return C(j(e),t,M),!0}catch(e){return!1}},getRaw:function(e){var t=j(e)+"=";return P(t)}};if(function(){var e,t=new Date;try{return window.localStorage.setItem(t,t),e=window.localStorage.getItem(t)===String(t),window.localStorage.removeItem(t),e}catch(e){}return!1}())e=window.localStorage;else if(window.globalStorage)try{e=window.globalStorage[window.location.hostname]}catch(e){}else if("undefined"!=typeof document){var z=document.createElement("div"),L="localStorage";z.style.display="none",document.getElementsByTagName("head")[0].appendChild(z),z.addBehavior&&(z.addBehavior("#default#userdata"),e={length:0,setItem:function(e,t){z.load(L),z.getAttribute(e)||this.length++,z.setAttribute(e,t),z.save(L)},getItem:function(e){return z.load(L),z.getAttribute(e)},removeItem:function(e){z.load(L),z.getAttribute(e)&&this.length--,z.removeAttribute(e),z.save(L)},clear:function(){z.load(L);for(var e,t=0;e=z.XMLDocument.documentElement.attributes[t++];)z.removeAttribute(e.name);z.save(L),this.length=0},key:function(e){return z.load(L),z.XMLDocument.documentElement.attributes[e]}},z.load(L),e.length=z.XMLDocument.documentElement.attributes.length)}e||(e={length:0,setItem:function(e,t){},getItem:function(e){},removeItem:function(e){},clear:function(){},key:function(e){}});var B=e,W=function(){this.storage=null};W.prototype.getStorage=function(){if(null!==this.storage)return this.storage;if(U())this.storage=G;else{var n="ampcookiestore";this.storage={_options:{expirationDays:void 0,domain:void 0,secure:!1},reset:function(){this._options={expirationDays:void 0,domain:void 0,secure:!1}},options:function(e){return 0===arguments.length?this._options:(e=e||{},this._options.expirationDays=e.expirationDays||this._options.expirationDays,this._options.domain=e.domain||this._options.domain||window&&window.location&&window.location.hostname,this.options.secure=e.secure||!1)},get:function(e){try{return JSON.parse(B.getItem(n+e))}catch(e){}return null},set:function(e,t){try{return B.setItem(n+e,JSON.stringify(t)),!0}catch(e){}return!1},remove:function(e){try{B.removeItem(n+e)}catch(e){return!1}}}}return this.storage};var X=function(){function u(e){var t=e.storageKey,n=e.disableCookies,i=e.domain,o=e.secure,r=e.sameSite,s=e.expirationDays;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),this.storageKey=t,this.disableCookieStorage=!U()||n,this.domain=i,this.secure=o,this.sameSite=r,this.expirationDays=s,this.cookieDomain="";var a=q(k().href);this.cookieDomain=i||(a?"."+a:null)}var e,t,n;return e=u,(t=[{key:"getCookieStorageKey",value:function(){if(!this.domain)return this.storageKey;var e="."===this.domain.charAt(0)?this.domain.substring(1):this.domain;return"".concat(this.storageKey).concat(e?"".concat(e):"")}},{key:"save",value:function(e){var t=e.deviceId,n=e.userId,i=e.optOut,o=e.sessionId,r=e.lastEventTime,s=e.eventId,a=e.identifyId,u=e.sequenceNumber,c=[t,l.encode(n||""),i?"1":"",o?o.toString(32):"0",r?r.toString(32):"0",s?s.toString(32):"0",a?a.toString(32):"0",u?u.toString(32):"0"].join(".");this.disableCookieStorage?B.setItem(this.storageKey,c):C(this.getCookieStorageKey(),c,{domain:this.cookieDomain,secure:this.secure,sameSite:this.sameSite,expirationDays:this.expirationDays})}},{key:"load",value:function(){var e;if(this.disableCookieStorage||(e=P(this.getCookieStorageKey()+"=")),e||(e=B.getItem(this.storageKey)),!e)return null;var t=e.split("."),n=null;if(t[1])try{n=l.decode(t[1])}catch(e){n=null}return{deviceId:t[0],userId:n,optOut:"1"===t[2],sessionId:parseInt(t[3],32),lastEventTime:parseInt(t[4],32),eventId:parseInt(t[5],32),identifyId:parseInt(t[6],32),sequenceNumber:parseInt(t[7],32)}}}])&&i(e.prototype,t),n&&i(e,n),u}(),Y="$clearAll",$=function(){this.userPropertiesOperations={},this.properties=[]};$.prototype.add=function(e,t){return"number"===m(t)||"string"===m(t)?this._addOperation("$add",e,t):I.error("Unsupported type for value: "+m(t)+", expecting number or string"),this},$.prototype.append=function(e,t){return this._addOperation("$append",e,t),this},$.prototype.clearAll=function(){return 0<Object.keys(this.userPropertiesOperations).length?this.userPropertiesOperations.hasOwnProperty(Y)||I.error("Need to send $clearAll on its own Identify object without any other operations, skipping $clearAll"):this.userPropertiesOperations[Y]="-",this},$.prototype.prepend=function(e,t){return this._addOperation("$prepend",e,t),this},$.prototype.set=function(e,t){return this._addOperation("$set",e,t),this},$.prototype.setOnce=function(e,t){return this._addOperation("$setOnce",e,t),this},$.prototype.unset=function(e){return this._addOperation("$unset",e,"-"),this},$.prototype.addOperation=function(e,t,n){this.userPropertiesOperations.hasOwnProperty(Y)?I.error("This identify already contains a $clearAll operation, skipping operation "+e):-1===this.properties.indexOf(t)?(this.userPropertiesOperations.hasOwnProperty(e)||(this.userPropertiesOperations[e]={}),this.userPropertiesOperations[e][t]=n,this.properties.push(t)):I.error('User property "'+t+'" already used in this identify, skipping operation '+e)};var Q="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function J(e,t){return e(t={exports:{}},t.exports),t.exports}var H=J(function(s){!function(e){function l(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function a(e,t,n,i,o,r){return l((s=l(l(t,e),l(i,r)))<<(a=o)|s>>>32-a,n);var s,a}function d(e,t,n,i,o,r,s){return a(t&n|~t&i,e,t,o,r,s)}function h(e,t,n,i,o,r,s){return a(t&i|n&~i,e,t,o,r,s)}function f(e,t,n,i,o,r,s){return a(t^n^i,e,t,o,r,s)}function v(e,t,n,i,o,r,s){return a(n^(t|~i),e,t,o,r,s)}function u(e,t){var n,i,o,r,s;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var a=1732584193,u=-271733879,c=-1732584194,p=271733878;for(n=0;n<e.length;n+=16)u=v(u=v(u=v(u=v(u=f(u=f(u=f(u=f(u=h(u=h(u=h(u=h(u=d(u=d(u=d(u=d(o=u,c=d(r=c,p=d(s=p,a=d(i=a,u,c,p,e[n],7,-680876936),u,c,e[n+1],12,-389564586),a,u,e[n+2],17,606105819),p,a,e[n+3],22,-1044525330),c=d(c,p=d(p,a=d(a,u,c,p,e[n+4],7,-176418897),u,c,e[n+5],12,1200080426),a,u,e[n+6],17,-1473231341),p,a,e[n+7],22,-45705983),c=d(c,p=d(p,a=d(a,u,c,p,e[n+8],7,1770035416),u,c,e[n+9],12,-1958414417),a,u,e[n+10],17,-42063),p,a,e[n+11],22,-1990404162),c=d(c,p=d(p,a=d(a,u,c,p,e[n+12],7,1804603682),u,c,e[n+13],12,-40341101),a,u,e[n+14],17,-1502002290),p,a,e[n+15],22,1236535329),c=h(c,p=h(p,a=h(a,u,c,p,e[n+1],5,-165796510),u,c,e[n+6],9,-1069501632),a,u,e[n+11],14,643717713),p,a,e[n],20,-373897302),c=h(c,p=h(p,a=h(a,u,c,p,e[n+5],5,-701558691),u,c,e[n+10],9,38016083),a,u,e[n+15],14,-660478335),p,a,e[n+4],20,-405537848),c=h(c,p=h(p,a=h(a,u,c,p,e[n+9],5,568446438),u,c,e[n+14],9,-1019803690),a,u,e[n+3],14,-187363961),p,a,e[n+8],20,1163531501),c=h(c,p=h(p,a=h(a,u,c,p,e[n+13],5,-1444681467),u,c,e[n+2],9,-51403784),a,u,e[n+7],14,1735328473),p,a,e[n+12],20,-1926607734),c=f(c,p=f(p,a=f(a,u,c,p,e[n+5],4,-378558),u,c,e[n+8],11,-2022574463),a,u,e[n+11],16,1839030562),p,a,e[n+14],23,-35309556),c=f(c,p=f(p,a=f(a,u,c,p,e[n+1],4,-1530992060),u,c,e[n+4],11,1272893353),a,u,e[n+7],16,-155497632),p,a,e[n+10],23,-1094730640),c=f(c,p=f(p,a=f(a,u,c,p,e[n+13],4,681279174),u,c,e[n],11,-358537222),a,u,e[n+3],16,-722521979),p,a,e[n+6],23,76029189),c=f(c,p=f(p,a=f(a,u,c,p,e[n+9],4,-640364487),u,c,e[n+12],11,-421815835),a,u,e[n+15],16,530742520),p,a,e[n+2],23,-995338651),c=v(c,p=v(p,a=v(a,u,c,p,e[n],6,-198630844),u,c,e[n+7],10,1126891415),a,u,e[n+14],15,-1416354905),p,a,e[n+5],21,-57434055),c=v(c,p=v(p,a=v(a,u,c,p,e[n+12],6,1700485571),u,c,e[n+3],10,-1894986606),a,u,e[n+10],15,-1051523),p,a,e[n+1],21,-2054922799),c=v(c,p=v(p,a=v(a,u,c,p,e[n+8],6,1873313359),u,c,e[n+15],10,-30611744),a,u,e[n+6],15,-1560198380),p,a,e[n+13],21,1309151649),c=v(c,p=v(p,a=v(a,u,c,p,e[n+4],6,-145523070),u,c,e[n+11],10,-1120210379),a,u,e[n+2],15,718787259),p,a,e[n+9],21,-343485551),a=l(a,i),u=l(u,o),c=l(c,r),p=l(p,s);return[a,u,c,p]}function c(e){var t,n="",i=32e.length;for(t=0;t<i;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n}function p(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;var i=8e.length;for(t=0;t<i;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function i(e){var t,n,i="0123456789abcdef",o="";for(n=0;n<e.length;n+=1)t=e.charCodeAt(n),o+=i.charAt(t>>>4&15)+i.charAt(15&t);return o}function n(e){return unescape(encodeURIComponent(e))}function o(e){return c(u(p(t=n(e)),8t.length));var t}function r(e,t){return function(e,t){var n,i,o=p(e),r=[],s=[];for(r[15]=s[15]=void 0,16<o.length&&(o=u(o,8e.length)),n=0;n<16;n+=1)r[n]=909522486^o[n],s[n]=1549556828^o[n];return i=u(r.concat(p(t)),512+8t.length),c(u(s.concat(i),640))}(n(e),n(t))}function t(e,t,n){return t?n?r(t,e):i(r(t,e)):n?o(e):i(o(e))}s.exports?s.exports=t:e.md5=t}(Q)}),Z=function(e){return encodeURIComponent(e).replace(/[!'()]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})},ee=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable;var ie=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t[""+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,i,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),r=1;r<arguments.length;r++){for(var s in n=Object(arguments[r]))te.call(n,s)&&(o[s]=n[s]);if(ee){i=ee(n);for(var a=0;a<i.length;a++)ne.call(n,i[a])&&(o[i[a]]=n[i[a]])}}return o},oe="%[a-f0-9]{2}";new RegExp(oe,"gi"),new RegExp("("+oe+")+","gi");function re(e,t){return t.encode?t.strict?Z(e):encodeURIComponent(e):e}var se=function(i,o){!1===(o=ie({encode:!0,strict:!0,arrayFormat:"none"},o)).sort&&(o.sort=function(){});var r=function(i){switch(i.arrayFormat){case"index":return function(e,t,n){return null===t?[re(e,i),"[",n,"]"].join(""):[re(e,i),"[",re(n,i),"]=",re(t,i)].join("")};case"bracket":return function(e,t){return null===t?re(e,i):[re(e,i),"[]=",re(t,i)].join("")};default:return function(e,t){return null===t?re(e,i):[re(e,i),"=",re(t,i)].join("")}}}(o);return i?Object.keys(i).sort(o.sort).map(function(t){var e=i[t];if(void 0===e)return"";if(null===e)return re(t,o);if(Array.isArray(e)){var n=[];return e.slice().forEach(function(e){void 0!==e&&n.push(r(t,e,n.length))}),n.join("&")}return re(t,o)+"="+re(e,o)}).filter(function(e){return 0<e.length}).join("&"):""},ae=function(e,t){this.url=e,this.data=t||{}};ae.prototype.send=function(e){if(!!window.XDomainRequest){var t=new window.XDomainRequest;t.open("POST",this.url,!0),t.onload=function(){e(200,t.responseText)},t.onerror=function(){"Request Entity Too Large"===t.responseText?e(413,t.responseText):e(500,t.responseText)},t.ontimeout=function(){},t.onprogress=function(){},t.send(se(this.data))}else{var n=new XMLHttpRequest;n.open("POST",this.url,!0),n.onreadystatechange=function(){4===n.readyState&&e(n.status,n.responseText)},n.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),n.send(se(this.data))}};var ue=function(){this._price=null,this._productId=null,this._quantity=1,this._revenueType=null,this._properties=null};ue.prototype.setProductId=function(e){return"string"!==m(e)?I.error("Unsupported type for productId: "+m(e)+", expecting string"):b(e)?I.error("Invalid empty productId"):this._productId=e,this},ue.prototype.setQuantity=function(e){return"number"!==m(e)?I.error("Unsupported type for quantity: "+m(e)+", expecting number"):this._quantity=parseInt(e),this},ue.prototype.setPrice=function(e){return"number"!==m(e)?I.error("Unsupported type for price: "+m(e)+", expecting number"):this._price=e,this},ue.prototype.setRevenueType=function(e){return"string"!==m(e)?I.error("Unsupported type for revenueType: "+m(e)+", expecting string"):this._revenueType=e,this},ue.prototype.setEventProperties=function(e){return"object"!==m(e)?I.error("Unsupported type for eventProperties: "+m(e)+", expecting object"):this._properties=O(e),this},ue.prototype._isValidRevenue=function(){return"number"===m(this._price)||(I.error("Invalid revenue, need to set price field"),!1)},ue.prototype._toJSONObject=function(){var e="object"===m(this._properties)?this._properties:{};return null!==this._productId&&(e[g.REVENUE_PRODUCT_ID]=this._productId),null!==this._quantity&&(e[g.REVENUE_QUANTITY]=this._quantity),null!==this._price&&(e[g.REVENUE_PRICE]=this._price),null!==this._revenueType&&(e[g.REVENUE_REVENUE_TYPE]=this._revenueType),e};var ce,pe=J(function(I,b){!function(o,l){var d="function",e="model",t="name",n="type",i="vendor",r="version",s="architecture",a="console",u="mobile",c="tablet",p="smarttv",h="wearable",f={extend:function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2==0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d.]/g,"").split(".")[0]:l},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},v={rgx:function(e,t){for(var n,i,o,r,s,a,u=0;u<t.length&&!s;){var c=t[u],p=t[u+1];for(n=i=0;n<c.length&&!s;)if(s=c[n++].exec(e))for(o=0;o<p.length;o++)a=s[++i],"object"==typeof(r=p[o])&&0<r.length?2==r.length?typeof r[1]==d?this[r[0]]=r[1].call(this,a):this[r[0]]=r[1]:3==r.length?typeof r[1]!==d||r[1].exec&&r[1].test?this[r[0]]=a?a.replace(r[1],r[2]):l:this[r[0]]=a?r[1].call(this,a,r[2]):l:4==r.length&&(this[r[0]]=a?r[3].call(this,a.replace(r[1],r[2])):l):this[r]=a||l;u+=2}},str:function(e,t){for(var n in t)if("object"==typeof t[n]&&0<t[n].length){for(var i=0;i<t[n].length;i++)if(f.has(t[n][i],e))return"?"===n?l:n}else if(f.has(t[n],e))return"?"===n?l:n;return e}},g={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},m={browser:[[/(opera\smini)\/([\w.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w.-]+)/i,/(opera).+version\/([\w.]+)/i,/(opera)[\/\s]+([\w.]+)/i],[t,r],[/(opios)[\/\s]+([\w.]+)/i],[[t,"Opera Mini"],r],[/\s(opr)\/([\w.]+)/i],[[t,"Opera"],r],[/(kindle)\/([\w.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w.])/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w.])/i,/(bidubrowser|baidubrowser)[\/\s]?([\w.]+)/i,/(?:ms|()(ie)\s([\w.]+)/i,/(rekonq)\/([\w.])/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w.-]+)/i],[t,r],[/(konqueror)\/([\w.]+)/i],[[t,"Konqueror"],r],[/(trident).+rv:\s.+like\sgecko/i],[[t,"IE"],r],[/(edge|edgios|edga|edg)\/((\d+)?[\w.]+)/i],[[t,"Edge"],r],[/(yabrowser)\/([\w.]+)/i],[[t,"Yandex"],r],[/(Avast)\/([\w.]+)/i],[[t,"Avast Secure Browser"],r],[/(AVG)\/([\w.]+)/i],[[t,"AVG Secure Browser"],r],[/(puffin)\/([\w.]+)/i],[[t,"Puffin"],r],[/(focus)\/([\w.]+)/i],[[t,"Firefox Focus"],r],[/(opt)\/([\w.]+)/i],[[t,"Opera Touch"],r],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w.]+)/i],[[t,"UCBrowser"],r],[/(comododragon)\/([\w.]+)/i],[[t,//g," "],r],[/(windowswechat qbcore)\/([\w.]+)/i],[[t,"WeChat(Win) Desktop"],r],[/(micromessenger)\/([\w.]+)/i],[[t,"WeChat"],r],[/(brave)\/([\w.]+)/i],[[t,"Brave"],r],[/(qqbrowserlite)\/([\w.]+)/i],[t,r],[/(QQ)\/([\d.]+)/i],[t,r],[/m?(qqbrowser)[\/\s]?([\w.]+)/i],[t,r],[/(baiduboxapp)[\/\s]?([\w.]+)/i],[t,r],[/(2345Explorer)[\/\s]?([\w.]+)/i],[t,r],[/(MetaSr)[\/\s]?([\w.]+)/i],[t],[/(LBBROWSER)/i],[t],[/xiaomi\/miuibrowser\/([\w.]+)/i],[r,[t,"MIUI Browser"]],[/;fbav\/([\w.]+);/i],[r,[t,"Facebook"]],[/safari\s(line)\/([\w.]+)/i,/android.+(line)\/([\w.]+)\/iab/i],[t,r],[/headlesschrome(?:\/([\w.]+)|\s)/i],[r,[t,"Chrome Headless"]],[/\swv).+(chrome)\/([\w.]+)/i],[[t,/(.+)/,"$1 WebView"],r],[/((?:oculus|samsung)browser)\/([\w.]+)/i],[[t,/(.+(?:g|us))(.+)/,"$1 $2"],r],[/((?:android.+)crmo|crios)\/([\w.]+)/i,/android.+(chrome)\/([\w.]+)\s+(?:mobile\s?safari)/i],[[t,"Chrome Mobile"],r],[/android.+version\/([\w.]+)\s+(?:mobile\s?safari|safari)/i],[r,[t,"Android Browser"]],[/(sailfishbrowser)\/([\w.]+)/i],[[t,"Sailfish Browser"],r],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w.]+)/i],[t,r],[/(dolfin)\/([\w.]+)/i],[[t,"Dolphin"],r],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[t,"360 Browser"]],[/(coast)\/([\w.]+)/i],[[t,"Opera Coast"],r],[/fxios\/([\w.-]+)/i],[r,[t,"Firefox"]],[/version\/([\w.]+).+?mobile\/\w+\s(safari)/i],[r,[t,"Mobile Safari"]],[/version\/([\w.]+).+?(mobile\s?safari|safari)/i],[r,t],[/webkit.+?(gsa)\/([\w.]+).+?(mobile\s?safari|safari)(\/[\w.]+)/i],[[t,"GSA"],r],[/webkit.+?(mobile\s?safari|safari)(\/[\w.]+)/i],[t,[r,v.str,g.browser.oldsafari.version]],[/(webkit|khtml)\/([\w.]+)/i],[t,r],[/(navigator|netscape)\/([\w.-]+)/i],[[t,"Netscape"],r],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w.+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w.-]+)/i,/(mozilla)\/([\w.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w.]+)/i,/(links)\s(([\w.]+)/i,/(gobrowser)\/?([\w.])/i,/(ice\s?browser)\/v?([\w.]+)/i,/(mosaic)\/\s/i],[t,r]],cpu:[[/(?:(amd|x(?:(?:86|64)[-])?|wow|win)64)[;)]/i],[[s,"amd64"]],[/(ia32(?=;))/i],[[s,f.lowerize]],[/((?:i[346]|x)86)[;)]/i],[[s,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[s,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|))/i],[[s,/ower/,"",f.lowerize]],[/(sun4\w)[;)]/i],[[s,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[s,f.lowerize]]],device:[[/((ipad|playbook);[\w\s),;-]+(rim|apple)/i],[e,i,[n,c]],[/applecoremedia\/[\w.]+ ((ipad)/],[e,[i,"Apple"],[n,c]],[/(apple\s{0,1}tv)/i],[[e,"Apple TV"],[i,"Apple"],[n,p]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d][\dko])/i],[i,e,[n,c]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[e,[i,"Amazon"],[n,c]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[e,v.str,g.device.amazon.model],[i,"Amazon"],[n,u]],[/android.+aft([bms])\sbuild/i],[e,[i,"Amazon"],[n,p]],[/((ip[honed|\s\w]+);.+(apple)/i],[e,i,[n,u]],[/((ip[honed|\s\w]+);/i],[e,[i,"Apple"],[n,u]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[i,e,[n,u]],[/(bb10;\s(\w+)/i],[e,[i,"BlackBerry"],[n,u]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[e,[i,"Asus"],[n,c]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[i,"Sony"],[e,"Xperia Tablet"],[n,c]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|).+chrome\/(?![1-6]{0,1}\d.))/i],[e,[i,"Sony"],[n,u]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[i,e,[n,a]],[/android.+;\s(shield)\sbuild/i],[e,[i,"Nvidia"],[n,a]],[/(playstation\s[34portablevi]+)/i],[e,[i,"Sony"],[n,a]],[/(sprint\s(\w+))/i],[[i,v.str,g.device.sprint.vendor],[e,v.str,g.device.sprint.model],[n,u]],[/(htc)[;\s-]+([\w\s]+(?=)|\sbuild)|\w+)/i,/(zte)-(\w)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-])/i],[i,[e,//g," "],[n,u]],[/(nexus\s9)/i],[e,[i,"HTC"],[n,c]],[/d\/huawei([\w\s-]+)[;)]/i,/(nexus\s6p|vog-l29|ane-lx1|eml-l29)/i],[e,[i,"Huawei"],[n,u]],[/android.+(bah2?-a?[lw]\d{2})/i],[e,[i,"Huawei"],[n,c]],[/(microsoft);\s(lumia[\s\w]+)/i],[i,e,[n,u]],[/\s(;[\s);]/i],[e,[i,"Microsoft"],[n,a]],[/(kin.[onetw]{3})/i],[[e,/./g," "],[i,"Microsoft"],[n,u]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[e,[i,"Motorola"],[n,u]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[e,[i,"Motorola"],[n,c]],[/hbbtv\/\d+.\d+.\d+\s+([\w\s];\s(\w[^;]);([^;])/i],[[i,f.trim],[e,f.trim],[n,p]],[/hbbtv.+maple;(\d+)/i],[[e,/^/,"SmartTV"],[i,"Samsung"],[n,p]],[/(dtv[);].+(aquos)/i],[e,[i,"Sharp"],[n,p]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[i,"Samsung"],e,[n,c]],[/smart-tv.+(samsung)/i],[i,[n,p],e],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung])[\s-](\w+-?[\w-])/i,/sec-((sgh\w+))/i],[[i,"Samsung"],e,[n,u]],[/sie-(\w)/i],[e,[i,"Siemens"],[n,u]],[/(maemo|nokia).(n900|lumia\s\d+)/i,/(nokia)[\s-]?([\w-])/i],[[i,"Nokia"],e,[n,u]],[/android[x\d.\s;]+\s([ab][1-7]-?[0178a]\d\d?)/i],[e,[i,"Acer"],[n,c]],[/android.+([vl]k-?\d{3})\s+build/i],[e,[i,"LG"],[n,c]],[/android\s3.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[i,"LG"],e,[n,c]],[/(lg) netcast.tv/i],[i,e,[n,p]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w)/i,/android.+lg(-?[\d\w]+)\s+build/i],[e,[i,"LG"],[n,u]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[i,e,[n,c]],[/android.+(ideatab[a-z0-9-\s]+)/i],[e,[i,"Lenovo"],[n,c]],[/(lenovo)[\s-]?([\w-]+)/i],[i,e,[n,u]],[/linux;.+((jolla));/i],[i,e,[n,u]],[/((pebble))app\/[\d.]+\s/i],[i,e,[n,h]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[i,e,[n,u]],[/crkey/i],[[e,"Chromecast"],[i,"Google"],[n,p]],[/android.+;\s(glass)\s\d/i],[e,[i,"Google"],[n,h]],[/android.+;\s(pixel c)[\s)]/i],[e,[i,"Google"],[n,c]],[/android.+;\s(pixel( [23])?( xl)?)[\s)]/i],[e,[i,"Google"],[n,u]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s-]note?[\s_](?:\d\w)?)\s+build/i,/android.+(mi[\s-]*(?:a\d|one|one[\s]plus|note lte)?[\s]*(?:\d?\w?)[\s](?:plus)?)\s+build/i,/android.+(redmi[\s-_](?:note)?(?:[\s]*[\w\s]+))\s+build/i],[[e,//g," "],[i,"Xiaomi"],[n,u]],[/android.+(mi[\s-]*(?:pad)(?:[\s][\w\s]+))\s+build/i],[[e,/_/g," "],[i,"Xiaomi"],[n,c]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[e,[i,"Meizu"],[n,u]],[/(mz)-([\w-]{2,})/i],[[i,"Meizu"],e,[n,u]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[e,[i,"OnePlus"],[n,u]],[/android.+[;\/]\s(RCT[\d\w]+)\s+build/i],[e,[i,"RCA"],[n,c]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[e,[i,"Dell"],[n,c]],[/android.+[;\/]\s(Q[T|M][\d\w]+)\s+build/i],[e,[i,"Verizon"],[n,c]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.)\s+build/i],[[i,"Barnes & Noble"],e,[n,c]],[/android.+[;\/]\s+(TM\d{3}.\b)\s+build/i],[e,[i,"NuVision"],[n,c]],[/android.+;\s(k88)\sbuild/i],[e,[i,"ZTE"],[n,c]],[/android.+[;\/]\s(gen\d{3})\s+build.49h/i],[e,[i,"Swiss"],[n,u]],[/android.+[;\/]\s(zur\d{3})\s+build/i],[e,[i,"Swiss"],[n,c]],[/android.+[;\/]\s((Zeki)?TB.\b)\s+build/i],[e,[i,"Zeki"],[n,c]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[i,"Dragon Touch"],e,[n,c]],[/android.+[;\/]\s(NS-?\w{0,9})\sbuild/i],[e,[i,"Insignia"],[n,c]],[/android.+[;\/]\s((NX|Next)-?\w{0,9})\s+build/i],[e,[i,"NextBook"],[n,c]],[/android.+[;\/]\s(Xtreme_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[i,"Voice"],e,[n,u]],[/android.+[;\/]\s(LVTEL-)?(V1[12])\s+build/i],[[i,"LvTel"],e,[n,u]],[/android.+;\s(PH-1)\s/i],[e,[i,"Essential"],[n,u]],[/android.+[;\/]\s(V(100MD|700NA|7011|917G).\b)\s+build/i],[e,[i,"Envizen"],[n,c]],[/android.+[;\/]\s(Le[\s-]+Pan)[\s-]+(\w{1,9})\s+build/i],[i,e,[n,c]],[/android.+[;\/]\s(Trio[\s-].)\s+build/i],[e,[i,"MachSpeed"],[n,c]],[/android.+[;\/]\s(Trinity)[-\s](T\d{3})\s+build/i],[i,e,[n,c]],[/android.+[;\/]\sTU_(1491)\s+build/i],[e,[i,"Rotor"],[n,c]],[/android.+(KS(.+))\s+build/i],[e,[i,"Amazon"],[n,c]],[/android.+(Gigaset)[\s-]+(Q\w{1,9})\s+build/i],[i,e,[n,c]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[n,f.lowerize],i,e],[/\s\/([;)]/i],[[n,p]],[/(android[\w.\s-]{0,9});.+build/i],[e,[i,"Generic"]]],engine:[[/windows.+\sedge\/([\w.]+)/i],[r,[t,"EdgeHTML"]],[/webkit\/537.36.+chrome\/(?!27)([\w.]+)/i],[r,[t,"Blink"]],[/(presto)\/([\w.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w.]+)/i,/(khtml|tasman|links)[\/\s](?([\w.]+)/i,/(icab)\/\s/i],[t,r],[/rv\:([\w.]{1,9}).+(gecko)/i],[r,t]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[t,r],[/(windows)\snt\s6.2;\s(arm)/i,/(windows\sphone(?:\sos))[\s\/]?([\d.\s\w])/i,/(windows\smobile|windows)[\s\/]?([ntce\d.\s]+\w)/i],[[t,v.str,g.os.windows.name],[r,v.str,g.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d.]+)/i],[[t,"Windows"],[r,v.str,g.os.windows.version]],[/((bb)(10);/i],[[t,"BlackBerry"],r],[/(blackberry)\w\/?([\w.])/i,/(tizen|kaios)\/\s/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w.])/i],[t,r],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w.])/i],[[t,"Symbian"],r],[/((series40);/i],[t],[/mozilla.+(mobile;.+gecko.+firefox/i],[[t,"Firefox OS"],r],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s(]?(\w)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w.-])/i,/(hurd|linux)\s?([\w.])/i,/(gnu)\s?([\w.])/i],[[t,"Linux"],r],[/(cros)\s[\w]+\s([\w.]+\w)/i],[[t,"Chromium OS"],r],[/(sunos)\s?([\w.\d])/i],[[t,"Solaris"],r],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w.])/i],[[t,"Linux"],r],[/(iphone)(?:.os\s([\w])\slike\smac|;\sopera)/i],[[t,"iPhone"],[r,//g,"."]],[/(ipad)(?:.os\s([\w]*)\slike\smac|;\sopera)/i],[[t,"iPad"],[r,//g,"."]],[/(haiku)\s(\w+)/i],[t,r],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.os\s([\w]+)\slike\smac|;\sopera)/i],[[r,/_/g,"."],[t,"iOS"]],[/(mac\sos\sx)\s?([\w\s.])/i,/(macintosh|mac(?=powerpc)\s)/i],[[t,"Mac"],[r,//g,"."]],[/((?:open)?solaris)[\/\s-]?([\w.])/i,/(aix)\s((\d)(?=.|)|\s)[\w.])/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w.]*)/i],[t,r]]},y=function(e,t){if("object"==typeof e&&(t=e,e=l),!(this instanceof y))return new y(e,t).getResult();var n=e||(o&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),i=t?f.extend(m,t):m;return this.getBrowser=function(){var e={name:l,version:l};return v.rgx.call(e,n,i.browser),e.major=f.major(e.version),e},this.getCPU=function(){var e={architecture:l};return v.rgx.call(e,n,i.cpu),e},this.getDevice=function(){var e={vendor:l,model:l,type:l};return v.rgx.call(e,n,i.device),e},this.getEngine=function(){var e={name:l,version:l};return v.rgx.call(e,n,i.engine),e},this.getOS=function(){var e={name:l,version:l};return v.rgx.call(e,n,i.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,this},this};y.VERSION="0.7.21",y.BROWSER={NAME:t,MAJOR:"major",VERSION:r},y.CPU={ARCHITECTURE:s},y.DEVICE={MODEL:e,VENDOR:i,TYPE:n,CONSOLE:a,MOBILE:u,SMARTTV:p,TABLET:c,WEARABLE:h,EMBEDDED:"embedded"},y.ENGINE={NAME:t,VERSION:r},y.OS={NAME:t,VERSION:r},I.exports&&(b=I.exports=y),b.UAParser=y;var =o&&(o.jQuery||o.Zepto);if(&&!.ua){var w=new y;.ua=w.getResult(),.ua.get=function(){return w.getUA()},.ua.set=function(e){w.setUA(e);var t=w.getResult();for(var n in t)_.ua[n]=t[n]}}}("object"==typeof window?window:Q)}),le=(pe.UAParser,"7.1.0"),de={apiEndpoint:"api.amplitude.com",batchEvents:!1,cookieExpiration:3650,cookieName:"amplitude_id",sameSiteCookie:"Lax",cookieForceUpgrade:!1,deferInitialization:!1,disableCookies:!1,deviceIdFromUrlParam:!1,domain:"",eventUploadPeriodMillis:3e4,eventUploadThreshold:30,forceHttps:!0,includeGclid:!1,includeReferrer:!1,includeUtm:!1,language:function(){return navigator&&(navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage)||""}(),logLevel:"WARN",optOut:!1,onError:function(){},platform:"Web",savedMaxCount:1e3,saveEvents:!0,saveParamsReferrerOncePerSession:!0,secureCookie:!1,sessionTimeout:18e5,trackingOptions:{city:!0,country:!0,carrier:!0,device_manufacturer:!0,device_model:!0,dma:!0,ip_address:!0,language:!0,os_name:!0,os_version:!0,platform:!0,region:!0,version_name:!0},unsetParamsReferrerOnNewSession:!1,unsentKey:"amplitude_unsent",unsentIdentifyKey:"amplitude_unsent_identify",uploadBatchSize:100},he=function(e){this._instanceName=b(e)?g.DEFAULT_INSTANCE:e.toLowerCase(),this._unsentEvents=[],this._unsentIdentifys=[],this._ua=new pe(navigator.userAgent).getResult(),this.options=v({},de,{trackingOptions:v({},de.trackingOptions)}),this.cookieStorage=(new W).getStorage(),this._q=[],this._sending=!1,this._updateScheduled=!1,this._onInit=[],this._eventId=0,this._identifyId=0,this._lastEventTime=null,this._newSession=!1,this._sequenceNumber=0,this._sessionId=null,this._isInitialized=!1,this._userAgent=navigator&&navigator.userAgent||null};he.prototype.Identify=$,he.prototype.Revenue=ue,he.prototype.init=function(e,i,o,t){var r=this;if("string"!==m(e)||b(e))I.error("Invalid apiKey. Please re-initialize with a valid apiKey");else try{ve(this.options,o),this.options.cookieName!==de.cookieName&&I.warn("The cookieName option is deprecated. We will be ignoring it for newer cookies"),this.options.apiKey=e,this.storageSuffix=""+e+(this._instanceName===g.DEFAULTINSTANCE?"":""+this._instanceName),this._storageSuffixV5=e.slice(0,6),this._oldCookiename=this.options.cookieName+this._storageSuffix,this._unsentKey=this.options.unsentKey+this._storageSuffix,this._unsentIdentifyKey=this.options.unsentIdentifyKey+this._storageSuffix,this._cookieName=g.COOKIEPREFIX+""+this._storageSuffixV5,this.cookieStorage.options({expirationDays:this.options.cookieExpiration,domain:this.options.domain,secure:this.options.secureCookie,sameSite:this.options.sameSiteCookie}),this._metadataStorage=new X({storageKey:this._cookieName,disableCookies:this.options.disableCookies,expirationDays:this.options.cookieExpiration,domain:this.options.domain,secure:this.options.secureCookie,sameSite:this.options.sameSiteCookie});var n=!!this.cookieStorage.get(this._oldCookiename),s=!!this._metadataStorage.load();this._useOldCookie=!s&&n&&!this.options.cookieForceUpgrade;var a=s||n;if(this.options.domain=this.cookieStorage.options().domain,this.options.deferInitialization&&!a)return void this._deferInitialization(e,i,o,t);"string"===m(this.options.logLevel)&&w(this.options.logLevel);var u=Ee(this);this._apiPropertiesTrackingOptions=0<Object.keys(u).length?{tracking_options:u}:{},this.options.cookieForceUpgrade&&n&&(s||me(this),this.cookieStorage.remove(this._oldCookiename)),ge(this),this._pendingReadStorage=!0;var c=function(e){r.options.deviceId=r._getInitialDeviceId(o&&o.deviceId,e),r.options.userId="string"===m(i)&&!b(i)&&i||"number"===m(i)&&i.toString()||r.options.userId||null;var t=(new Date).getTime();(!r._sessionId||!r._lastEventTime||t-r._lastEventTime>r.options.sessionTimeout)&&(r.options.unsetParamsReferrerOnNewSession&&r._unsetUTMParams(),r._newSession=!0,r._sessionId=t,r.options.saveParamsReferrerOncePerSession&&r._trackParamsAndReferrer()),r.options.saveParamsReferrerOncePerSession||r._trackParamsAndReferrer(),r.options.saveEvents&&(fe(r._unsentEvents),fe(r._unsentIdentifys)),r._lastEventTime=t,_e(r),r._pendingReadStorage=!1,r._sendEventsIfReady();for(var n=0;n<r._onInit.length;n++)r._onInitn;r._onInit=[],r._isInitialized=!0};this.options.saveEvents&&(this._unsentEvents=this._loadSavedUnsentEvents(this.options.unsentKey).map(function(e){return{event:e}}).concat(this._unsentEvents),this._unsentIdentifys=this._loadSavedUnsentEvents(this.options.unsentIdentifyKey).map(function(e){return{event:e}}).concat(this._unsentIdentifys)),c(),this.runQueuedFunctions(),"function"===m(t)&&t(this)}catch(e){I.error(e),this.options.onError(e)}},he.prototype.deleteLowerLevelDomainCookies=function(){var e=D(),t=this.options.domain&&"."===this.options.domain[0]?this.options.domain.slice(1):this.options.domain;if(t&&e!==t&&new RegExp(t+"$").test(e)){for(var n=e.split("."),i=t.split("."),o=n.length;o>i.length;--o){var r=n.slice(n.length-o).join(".");C(this._cookieName,null,{domain:"."+r})}C(this._cookieName,null,{})}},he.prototype._getInitialDeviceId=function(e,t){return e||(this.options.deviceIdFromUrlParam?this._getDeviceIdFromUrlParam(this._getUrlParams()):this.options.deviceId?this.options.deviceId:t||A())};var fe=function(e){for(var t=0;t<e.length;t++){var n=e[t].event.user_properties,i=e[t].event.event_properties,o=e[t].event.groups;e[t].event.user_properties=O(n),e[t].event.event_properties=O(i),e[t].event.groups=N(o)}};he.prototype._migrateUnsentEvents=function(e){var r=this;Promise.all([ce.getItem(this.options.unsentKey),ce.getItem(this.options.unsentIdentifyKey)]).then(function(e){if(r.options.saveEvents){var t=e[0],n=e[1],i=[],o=[];t&&(i.push(ce.setItem(r.options.unsentKey+r._storageSuffix,JSON.stringify(t))),o.push(ce.removeItem(r.options.unsentKey))),n&&(i.push(ce.setItem(r.options.unsentIdentifyKey+r._storageSuffix,JSON.stringify(n))),o.push(ce.removeItem(r.options.unsentIdentifyKey))),0<i.length&&Promise.all(i).then(function(){}).catch(function(e){r.options.onError(e)})}}).then(e).catch(function(e){r.options.onError(e)})},he.prototype._trackParamsAndReferrer=function(){this.options.includeUtm&&this._initUtmData(),this.options.includeReferrer&&this._saveReferrer(this._getReferrer()),this.options.includeGclid&&this._saveGclid(this._getUrlParams())};var ve=function i(o,r){if("object"===m(r)){var e=function(e){if(o.hasOwnProperty(e)){var t=r[e],n=m(o[e]);T(t,e+" option",n)&&("boolean"===n?o[e]=!!t:"string"===n&&!b(t)||"number"===n&&0<t?o[e]=t:"object"===n&&i(o[e],t))}};for(var t in r)r.hasOwnProperty(t)&&e(t)}};he.prototype.runQueuedFunctions=function(){var e=this._q;this._q=[];for(var t=0;t<e.length;t++){var n=this[e[t][0]];"function"===m(n)&&n.apply(this,e[t].slice(1))}},he.prototype._apiKeySet=function(e){return!b(this.options.apiKey)||(I.error("Invalid apiKey. Please set a valid apiKey with init() before calling "+e),!1)},he.prototype._loadSavedUnsentEvents=function(e){var t=this._getFromStorage(B,e),n=this._parseSavedUnsentEventsString(t,e);return this._setInStorage(B,e,JSON.stringify(n)),n},he.prototype._parseSavedUnsentEventsString=function(e,t){if(b(e))return[];if("string"===m(e))try{var n=JSON.parse(e);if("array"===m(n))return n}catch(e){}return I.error("Unable to load "+t+" events. Restart with a new empty queue."),[]},he.prototype.isNewSession=function(){return this._newSession},he.prototype.onInit=function(e){this._isInitialized?e():this._onInit.push(e)},he.prototype.getSessionId=function(){return this._sessionId},he.prototype.nextEventId=function(){return this._eventId++,this._eventId},he.prototype.nextIdentifyId=function(){return this._identifyId++,this._identifyId},he.prototype.nextSequenceNumber=function(){return this._sequenceNumber++,this._sequenceNumber},he.prototype._unsentCount=function(){return this._unsentEvents.length+this._unsentIdentifys.length},he.prototype._sendEventsIfReady=function(){return 0!==this._unsentCount()&&(this.options.batchEvents?this._unsentCount()>=this.options.eventUploadThreshold?(this.sendEvents(),!0):(this._updateScheduled||(this._updateScheduled=!0,setTimeout(function(){this._updateScheduled=!1,this.sendEvents()}.bind(this),this.options.eventUploadPeriodMillis)),!1):(this.sendEvents(),!0))},he.prototype._getFromStorage=function(e,t){return e.getItem(t+this._storageSuffix)},he.prototype._setInStorage=function(e,t,n){e.setItem(t+this._storageSuffix,n)};var ge=function(e){if(e._useOldCookie){var t=e.cookieStorage.get(e._oldCookiename);"object"!==m(t)||ye(e,t)}else{var n=e._metadataStorage.load();"object"===m(n)&&ye(e,n)}},me=function(e){var t=e.cookieStorage.get(e._oldCookiename);"object"===m(t)&&(ye(e,t),_e(e))},ye=function(e,t){t.deviceId&&(e.options.deviceId=t.deviceId),t.userId&&(e.options.userId=t.userId),null!==t.optOut&&void 0!==t.optOut&&!1!==t.optOut&&(e.options.optOut=t.optOut),t.sessionId&&(e._sessionId=parseInt(t.sessionId,10)),t.lastEventTime&&(e._lastEventTime=parseInt(t.lastEventTime,10)),t.eventId&&(e._eventId=parseInt(t.eventId,10)),t.identifyId&&(e._identifyId=parseInt(t.identifyId,10)),t.sequenceNumber&&(e._sequenceNumber=parseInt(t.sequenceNumber,10))},_e=function(e){var t={deviceId:e.options.deviceId,userId:e.options.userId,optOut:e.options.optOut,sessionId:e._sessionId,lastEventTime:e._lastEventTime,eventId:e._eventId,identifyId:e._identifyId,sequenceNumber:e._sequenceNumber};e._useOldCookie?e.cookieStorage.set(e.options.cookieName+e._storageSuffix,t):e._metadataStorage.save(t)};he.prototype._initUtmData=function(e,t){e=e||this._getUrlParams(),t=t||this.cookieStorage.get("__utmz");var n,i,o,r,s,a,u,c,p,l,d,h=(i=e,o=(n=t)?"?"+n.split(".").slice(-1)[0].replace(/|/g,"&"):"",s=(r=function(e,t,n,i){return E(e,t)||E(n,i)})(g.UTM_SOURCE,i,"utmcsr",o),a=r(g.UTM_MEDIUM,i,"utmcmd",o),u=r(g.UTM_CAMPAIGN,i,"utmccn",o),c=r(g.UTM_TERM,i,"utmctr",o),p=r(g.UTM_CONTENT,i,"utmcct",o),l={},(d=function(e,t){b(t)||(l[e]=t)})(g.UTM_SOURCE,s),d(g.UTM_MEDIUM,a),d(g.UTM_CAMPAIGN,u),d(g.UTM_TERM,c),d(g.UTM_CONTENT,p),l);we(this,h)},he.prototype._unsetUTMParams=function(){var e=new $;e.unset(g.REFERRER),e.unset(g.UTM_SOURCE),e.unset(g.UTM_MEDIUM),e.unset(g.UTM_CAMPAIGN),e.unset(g.UTM_TERM),e.unset(g.UTMCONTENT),this.identify(e)};var we=function(e,t){if("object"===m(t)&&0!==Object.keys(t).length){var n=new $;for(var i in t)t.hasOwnProperty(i)&&(n.setOnce("initial"+i,t[i]),n.set(i,t[i]));e.identify(n)}};he.prototype._getReferrer=function(){return document.referrer},he.prototype._getUrlParams=function(){return location.search},he.prototype._saveGclid=function(e){var t=E("gclid",e);b(t)||we(this,{gclid:t})},he.prototype._getDeviceIdFromUrlParam=function(e){return E(g.AMP_DEVICE_ID_PARAM,e)},he.prototype._getReferringDomain=function(e){if(b(e))return null;var t=e.split("/");return 3<=t.length?t[2]:null},he.prototype._saveReferrer=function(e){if(!b(e)){var t={referrer:e,referring_domain:this._getReferringDomain(e)};we(this,t)}},he.prototype.saveEvents=function(){try{var e=JSON.stringify(this._unsentEvents.map(function(e){return e.event}));this._setInStorage(B,this.options.unsentKey,e)}catch(e){}try{var t=JSON.stringify(this._unsentIdentifys.map(function(e){return e.event}));this._setInStorage(B,this.options.unsentIdentifyKey,t)}catch(e){}},he.prototype.setDomain=function(e){if(this._shouldDeferCall())return this._q.push(["setDomain"].concat(Array.prototype.slice.call(arguments,0)));if(T(e,"domain","string"))try{this.cookieStorage.options({expirationDays:this.options.cookieExpiration,secure:this.options.secureCookie,domain:e,sameSite:this.options.sameSiteCookie}),this.options.domain=this.cookieStorage.options().domain,ge(this),_e(this)}catch(e){I.error(e)}},he.prototype.setUserId=function(e){if(this._shouldDeferCall())return this._q.push(["setUserId"].concat(Array.prototype.slice.call(arguments,0)));try{this.options.userId=null!=e&&""+e||null,_e(this)}catch(e){I.error(e)}},he.prototype.setGroup=function(e,t){if(this._shouldDeferCall())return this._q.push(["setGroup"].concat(Array.prototype.slice.call(arguments,0)));if(this._apiKeySet("setGroup()")&&T(e,"groupType","string")&&!b(e)){var n={};n[e]=t;var i=(new $).set(e,t);this._logEvent(g.IDENTIFY_EVENT,null,null,i.userPropertiesOperations,n,null,null,null)}},he.prototype.setOptOut=function(e){if(this._shouldDeferCall())return this._q.push(["setOptOut"].concat(Array.prototype.slice.call(arguments,0)));if(T(e,"enable","boolean"))try{this.options.optOut=e,_e(this)}catch(e){I.error(e)}},he.prototype.setSessionId=function(e){if(T(e,"sessionId","number"))try{this._sessionId=e,_e(this)}catch(e){I.error(e)}},he.prototype.resetSessionId=function(){this.setSessionId((new Date).getTime())},he.prototype.regenerateDeviceId=function(){if(this._shouldDeferCall())return this._q.push(["regenerateDeviceId"].concat(Array.prototype.slice.call(arguments,0)));this.setDeviceId(A())},he.prototype.setDeviceId=function(e){if(this._shouldDeferCall())return this._q.push(["setDeviceId"].concat(Array.prototype.slice.call(arguments,0)));if(T(e,"deviceId","string"))try{b(e)||(this.options.deviceId=""+e,_e(this))}catch(e){I.error(e)}},he.prototype.setUserProperties=function(e){if(this._shouldDeferCall())return this._q.push(["setUserProperties"].concat(Array.prototype.slice.call(arguments,0)));if(this._apiKeySet("setUserProperties()")&&T(e,"userProperties","object")){var t=S(O(e));if(0!==Object.keys(t).length){var n=new $;for(var i in t)t.hasOwnProperty(i)&&n.set(i,t[i]);this.identify(n)}}},he.prototype.clearUserProperties=function(){if(this._shouldDeferCall())return this._q.push(["clearUserProperties"].concat(Array.prototype.slice.call(arguments,0)));if(this._apiKeySet("clearUserProperties()")){var e=new $;e.clearAll(),this.identify(e)}};var Ie=function(e,t){for(var n=0;n<t._q.length;n++){var i=e[t._q[n][0]];"function"===m(i)&&i.apply(e,t._q[n].slice(1))}return e};he.prototype.identify=function(e,t){if(this._shouldDeferCall())return this._q.push(["identify"].concat(Array.prototype.slice.call(arguments,0)));if(this._apiKeySet("identify()"))if("object"===m(e)&&e.hasOwnProperty("_q")&&(e=Ie(new $,e)),e instanceof $){if(0<Object.keys(e.userPropertiesOperations).length)return this._logEvent(g.IDENTIFY_EVENT,null,null,e.userPropertiesOperations,null,null,null,t);"function"===m(t)&&t(0,"No request sent",{reason:"No user property operations"})}else I.error("Invalid identify input type. Expected Identify object but saw "+m(e)),"function"===m(t)&&t(0,"No request sent",{reason:"Invalid identify input type"});else"function"===m(t)&&t(0,"No request sent",{reason:"API key is not set"})},he.prototype.groupIdentify=function(e,t,n,i){if(this._shouldDeferCall())return this._q.push(["groupIdentify"].concat(Array.prototype.slice.call(arguments,0)));if(this._apiKeySet("groupIdentify()"))if(T(e,"group_type","string")&&!b(e))if(null!=t)if("object"===m(n)&&n.hasOwnProperty("_q")&&(n=Ie(new $,n)),n instanceof $){if(0<Object.keys(n.userPropertiesOperations).length)return this._logEvent(g.GROUP_IDENTIFY_EVENT,null,null,null,o({},e,t),n.userPropertiesOperations,null,i);"function"===m(i)&&i(0,"No request sent",{reason:"No group property operations"})}else I.error("Invalid identify input type. Expected Identify object but saw "+m(n)),"function"===m(i)&&i(0,"No request sent",{reason:"Invalid identify input type"});else"function"===m(i)&&i(0,"No request sent",{reason:"Invalid group name"});else"function"===m(i)&&i(0,"No request sent",{reason:"Invalid group type"});else"function"===m(i)&&i(0,"No request sent",{reason:"API key is not set"})},he.prototype.setVersionName=function(e){if(this._shouldDeferCall())return this._q.push(["setVersionName"].concat(Array.prototype.slice.call(arguments,0)));T(e,"versionName","string")&&(this.options.versionName=e)},he.prototype._logEvent=function(e,t,n,i,o,r,s,a){if(ge(this),e)if(this.options.optOut)"function"===m(a)&&a(0,"No request sent",{reason:"optOut is set to true"});else try{var u;u=e===g.IDENTIFY_EVENT||e===g.GROUP_IDENTIFY_EVENT?this.nextIdentifyId():this.nextEventId();var c=this.nextSequenceNumber(),p="number"===m(s)?s:(new Date).getTime();(!this._sessionId||!this._lastEventTime||p-this._lastEventTime>this.options.sessionTimeout)&&(this._sessionId=p),this._lastEventTime=p,_e(this);var l=this._ua.browser.name,d=this._ua.browser.major,h=this._ua.os.name;i=i||{},n=v({},n||{},v({},this._apiPropertiesTrackingOptions)),t=t||{},o=o||{},r=r||{};var f={device_id:this.options.deviceId,user_id:this.options.userId,timestamp:p,event_id:u,session_id:this._sessionId||-1,event_type:e,version_name:be(this,"version_name")&&this.options.versionName||null,platform:be(this,"platform")?this.options.platform:null,os_name:be(this,"os_name")&&l||null,os_version:be(this,"os_version")&&d||null,device_model:be(this,"device_model")&&h||null,device_manufacturer:(be(this,"device_manufacturer"),null),language:be(this,"language")?this.options.language:null,carrier:(be(this,"carrier"),null),api_properties:n,event_properties:S(O(t)),user_properties:S(O(i)),uuid:function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)}(),library:{name:"amplitude-js",version:le},sequence_number:c,groups:S(N(o)),group_properties:S(O(r)),user_agent:this._userAgent};return e===g.IDENTIFY_EVENT||e===g.GROUP_IDENTIFY_EVENT?(this._unsentIdentifys.push({event:f,callback:a}),this._limitEventsQueued(this._unsentIdentifys)):(this._unsentEvents.push({event:f,callback:a}),this._limitEventsQueued(this._unsentEvents)),this.options.saveEvents&&this.saveEvents(),this._sendEventsIfReady(a),u}catch(e){I.error(e)}else"function"===m(a)&&a(0,"No request sent",{reason:"Missing eventType"})};var be=function(e,t){return!!e.options.trackingOptions[t]},Ee=function(e){for(var t=["city","country","dma","ip_address","region"],n={},i=0;i<t.length;i++){var o=t[i];be(e,o)||(n[o]=!1)}return n};he.prototype._limitEventsQueued=function(e){e.length>this.options.savedMaxCount&&e.splice(0,e.length-this.options.savedMaxCount)},he.prototype.logEvent=function(e,t,n){return this._shouldDeferCall()?this._q.push(["logEvent"].concat(Array.prototype.slice.call(arguments,0))):this.logEventWithTimestamp(e,t,null,n)},he.prototype.logEventWithTimestamp=function(e,t,n,i){return this._shouldDeferCall()?this._q.push(["logEventWithTimestamp"].concat(Array.prototype.slice.call(arguments,0))):this._apiKeySet("logEvent()")?T(e,"eventType","string")?b(e)?("function"===m(i)&&i(0,"No request sent",{reason:"Missing eventType"}),-1):this._logEvent(e,t,null,null,null,null,n,i):("function"===m(i)&&i(0,"No request sent",{reason:"Invalid type for eventType"}),-1):("function"===m(i)&&i(0,"No request sent",{reason:"API key not set"}),-1)},he.prototype.logEventWithGroups=function(e,t,n,i){return this._shouldDeferCall()?this._q.push(["logEventWithGroups"].concat(Array.prototype.slice.call(arguments,0))):this._apiKeySet("logEventWithGroups()")?T(e,"eventType","string")?this._logEvent(e,t,null,null,n,null,null,i):("function"===m(i)&&i(0,"No request sent",{reason:"Invalid type for eventType"}),-1):("function"===m(i)&&i(0,"No request sent",{reason:"API key not set"}),-1)};var Se=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};he.prototype.logRevenueV2=function(e){if(this._shouldDeferCall())return this._q.push(["logRevenueV2"].concat(Array.prototype.slice.call(arguments,0)));if(this._apiKeySet("logRevenueV2()"))if("object"===m(e)&&e.hasOwnProperty("_q")&&(e=Ie(new ue,e)),e instanceof ue){if(e&&e._isValidRevenue())return this.logEvent(g.REVENUE_EVENT,e._toJSONObject())}else I.error("Invalid revenue input type. Expected Revenue object but saw "+m(e))},he.prototype.logRevenue=function(e,t,n){return this._shouldDeferCall()?this._q.push(["logRevenue"].concat(Array.prototype.slice.call(arguments,0))):this._apiKeySet("logRevenue()")&&Se(e)&&(void 0===t||Se(t))?this._logEvent(g.REVENUE_EVENT,{},{productId:n,special:"revenue_amount",quantity:t||1,price:e},null,null,null,null,null):-1},he.prototype.removeEvents=function(e,t,n,i){Ne(this,"_unsentEvents",e,n,i),Ne(this,"_unsentIdentifys",t,n,i)};var Ne=function(e,t,n,i,o){if(!(n<0)){for(var r=[],s=0;s<e[t].length;s++){var a=e[t][s];a.event.event_id>n?r.push(a):a.callback&&a.callback(i,o)}e[t]=r}};he.prototype.sendEvents=function(){if(this._apiKeySet("sendEvents()")){if(this.options.optOut)this.removeEvents(1/0,1/0,0,"No request sent",{reason:"Opt out is set to true"});else if(0!==this._unsentCount()&&!this._sending){this._sending=!0;var e=(this.options.forceHttps?"https":"https:"===window.location.protocol?"https":"http")+"://"+this.options.apiEndpoint,n=Math.min(this._unsentCount(),this.options.uploadBatchSize),t=this._mergeEventsAndIdentifys(n),i=t.maxEventId,o=t.maxIdentifyId,r=JSON.stringify(t.eventsToSend.map(function(e){return e.event})),s=(new Date).getTime(),a={client:this.options.apiKey,e:r,v:g.API_VERSION,upload_time:s,checksum:H(g.API_VERSION+this.options.apiKey+r+s)},u=this;new ae(e,a).send(function(e,t){u._sending=!1;try{200===e&&"success"===t?(u.removeEvents(i,o,e,t),u.options.saveEvents&&u.saveEvents(),u._sendEventsIfReady()):413===e&&(1===u.options.uploadBatchSize&&u.removeEvents(i,o,e,t),u.options.uploadBatchSize=Math.ceil(n/2),u.sendEvents())}catch(e){}})}}else this.removeEvents(1/0,1/0,0,"No request sent",{reason:"API key not set"})},he.prototype._mergeEventsAndIdentifys=function(e){for(var t=[],n=0,i=-1,o=0,r=-1;t.length<e;){var s=void 0,a=o>=this._unsentIdentifys.length,u=n>=this._unsentEvents.length;if(u&&a){I.error("Merging Events and Identifys, less events and identifys than expected");break}a?i=(s=this._unsentEvents[n++]).event.event_id:u?r=(s=this._unsentIdentifys[o++]).event.event_id:!("sequence_number"in this._unsentEvents[n].event)||this._unsentEvents[n].event.sequence_number<this._unsentIdentifys[o].event.sequence_number?i=(s=this._unsentEvents[n++]).event.event_id:r=(s=this._unsentIdentifys[o++]).event.event_id,t.push(s)}return{eventsToSend:t,maxEventId:i,maxIdentifyId:r}},he.prototype.setGlobalUserProperties=function(e){this.setUserProperties(e)},he.prototype.VERSION=le,he.prototype._shouldDeferCall=function(){return this._pendingReadStorage||this._initializationDeferred},he.prototype._deferInitialization=function(){this._initializationDeferred=!0,this._q.push(["init"].concat(Array.prototype.slice.call(arguments,0)))},he.prototype.enableTracking=function(){this._initializationDeferred=!1,_e(this),this.runQueuedFunctions()};var Te=function(){this.options=v({},de),this._q=[],this._instances={}};Te.prototype.Identify=$,Te.prototype.Revenue=ue,Te.prototype.getInstance=function(e){e=b(e)?g.DEFAULT_INSTANCE:e.toLowerCase();var t=this._instances[e];return void 0===t&&(t=new he(e),this._instances[e]=t),t},Te.prototype.runQueuedFunctions=function(){for(var e=0;e<this._q.length;e++){var t=this[this._q[e][0]];"function"===m(t)&&t.apply(this,this._q[e].slice(1))}for(var n in this._q=[],this._instances)this._instances.hasOwnProperty(n)&&this._instances[n].runQueuedFunctions()},Te.prototype.init=function(e,t,n,i){this.getInstance().init(e,t,n,function(e){this.options=e.options,"function"===m(i)&&i(e)}.bind(this))},Te.prototype.isNewSession=function(){return this.getInstance().isNewSession()},Te.prototype.getSessionId=function(){return this.getInstance().getSessionId()},Te.prototype.nextEventId=function(){return this.getInstance().nextEventId()},Te.prototype.nextIdentifyId=function(){return this.getInstance().nextIdentifyId()},Te.prototype.nextSequenceNumber=function(){return this.getInstance().nextSequenceNumber()},Te.prototype.saveEvents=function(){this.getInstance().saveEvents()},Te.prototype.setDomain=function(e){this.getInstance().setDomain(e)},Te.prototype.setUserId=function(e){this.getInstance().setUserId(e)},Te.prototype.setGroup=function(e,t){this.getInstance().setGroup(e,t)},Te.prototype.setOptOut=function(e){this.getInstance().setOptOut(e)},Te.prototype.regenerateDeviceId=function(){this.getInstance().regenerateDeviceId()},Te.prototype.setDeviceId=function(e){this.getInstance().setDeviceId(e)},Te.prototype.setUserProperties=function(e){this.getInstance().setUserProperties(e)},Te.prototype.clearUserProperties=function(){this.getInstance().clearUserProperties()},Te.prototype.identify=function(e,t){this.getInstance().identify(e,t)},Te.prototype.setVersionName=function(e){this.getInstance().setVersionName(e)},Te.prototype.logEvent=function(e,t,n){return this.getInstance().logEvent(e,t,n)},Te.prototype.logEventWithGroups=function(e,t,n,i){return this.getInstance().logEventWithGroups(e,t,n,i)},Te.prototype.logRevenueV2=function(e){return this.getInstance().logRevenueV2(e)},Te.prototype.logRevenue=function(e,t,n){return this.getInstance().logRevenue(e,t,n)},Te.prototype.removeEvents=function(e,t){this.getInstance().removeEvents(e,t)},Te.prototype.sendEvents=function(e){this.getInstance().sendEvents(e)},Te.prototype.setGlobalUserProperties=function(e){this.getInstance().setUserProperties(e)},Te.prototype.VERSION=le;var Oe=window.amplitude||{},ke=new Te;for(var Ae in ke._q=Oe._q||[],Oe._iq)Oe._iq.hasOwnProperty(Ae)&&(ke.getInstance(Ae)._q=Oe._iq[Ae]._q||[]);return ke.runQueuedFunctions(),ke}();var amplitude=function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),i.forEach(function(e){o(t,e,n[e])})}return t}var g={DEFAULT_INSTANCE:"$default_instance",API_VERSION:2,MAX_STRING_LENGTH:4096,MAX_PROPERTY_KEYS:1e3,IDENTIFY_EVENT:"$identify",GROUP_IDENTIFY_EVENT:"$groupidentify",LAST_EVENT_ID:"amplitude_lastEventId",LAST_EVENT_TIME:"amplitude_lastEventTime",LAST_IDENTIFY_ID:"amplitude_lastIdentifyId",LAST_SEQUENCE_NUMBER:"amplitude_lastSequenceNumber",SESSION_ID:"amplitude_sessionId",DEVICE_ID:"amplitude_deviceId",OPT_OUT:"amplitude_optOut",USER_ID:"amplitude_userId",COOKIE_TEST_PREFIX:"amp_cookie_test",COOKIE_PREFIX:"amp",REVENUE_EVENT:"revenue_amount",REVENUE_PRODUCT_ID:"$productId",REVENUE_QUANTITY:"$quantity",REVENUE_PRICE:"$price",REVENUE_REVENUE_TYPE:"$revenueType",AMP_DEVICE_ID_PARAM:"amp_device_id",REFERRER:"referrer",UTM_SOURCE:"utm_source",UTM_MEDIUM:"utm_medium",UTM_CAMPAIGN:"utm_campaign",UTM_TERM:"utm_term",UTM_CONTENT:"utm_content"},p=function(e){for(var t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);i<128?t+=String.fromCharCode(i):(127<i&&i<2048?t+=String.fromCharCode(i>>6|192):(t+=String.fromCharCode(i>>12|224),t+=String.fromCharCode(i>>6&63|128)),t+=String.fromCharCode(63&i|128))}return t},c=function(e){for(var t="",n=0,i=0,o=0,r=0;n<e.length;)(i=e.charCodeAt(n))<128?(t+=String.fromCharCode(i),n++):191<i&&i<224?(o=e.charCodeAt(n+1),t+=String.fromCharCode((31&i)<<6|63&o),n+=2):(o=e.charCodeAt(n+1),r=e.charCodeAt(n+2),t+=String.fromCharCode((15&i)<<12|(63&o)<<6|63&r),n+=3);return t},l={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){try{if(window.btoa&&window.atob)return window.btoa(unescape(encodeURIComponent(e)))}catch(e){}return l._encode(e)},_encode:function(e){var t,n,i,o,r,s,a,u="",c=0;for(e=p(e);c<e.length;)o=(t=e.charCodeAt(c++))>>2,r=(3&t)<<4|(n=e.charCodeAt(c++))>>4,s=(15&n)<<2|(i=e.charCodeAt(c++))>>6,a=63&i,isNaN(n)?s=a=64:isNaN(i)&&(a=64),u=u+l._keyStr.charAt(o)+l._keyStr.charAt(r)+l._keyStr.charAt(s)+l._keyStr.charAt(a);return u},decode:function(e){try{if(window.btoa&&window.atob)return decodeURIComponent(escape(window.atob(e)))}catch(e){}return l._decode(e)},_decode:function(e){var t,n,i,o,r,s,a="",u=0;for(e=e.replace(/[^A-Za-z0-9+\/\=]/g,"");u<e.length;)t=l._keyStr.indexOf(e.charAt(u++))<<2|(o=l._keyStr.indexOf(e.charAt(u++)))>>4,n=(15&o)<<4|(r=l._keyStr.indexOf(e.charAt(u++)))>>2,i=(3&r)<<6|(s=l._keyStr.indexOf(e.charAt(u++))),a+=String.fromCharCode(t),64!==r&&(a+=String.fromCharCode(n)),64!==s&&(a+=String.fromCharCode(i));return a=c(a)}},n=Object.prototype.toString;function m(e){switch(n.call(e)){case"[object Date]":return"date";case"[object RegExp]":return"regexp";case"[object Arguments]":return"arguments";case"[object Array]":return"array";case"[object Error]":return"error"}return null===e?"null":void 0===e?"undefined":e!=e?"nan":e&&1===e.nodeType?"element":"undefined"!=typeof Buffer&&"function"==typeof Buffer.isBuffer&&Buffer.isBuffer(e)?"buffer":t(e=e.valueOf?e.valueOf():Object.prototype.valueOf.apply(e))}var e,r={DISABLE:0,ERROR:1,WARN:2,INFO:3},s=r.WARN,u={error:function(e){s>=r.ERROR&&a(e)},warn:function(e){s>=r.WARN&&a(e)},info:function(e){s>=r.INFO&&a(e)}},a=function(e){try{console.log("[Amplitude] "+e)}catch(e){}},d=function(e){return"string"===m(e)&&e.length>g.MAX_STRING_LENGTH?e.substring(0,g.MAX_STRING_LENGTH):e},h=function(e){var t=m(e);if("object"!==t)return u.error("Error: invalid properties format. Expecting Javascript object, received "+t+", ignoring"),{};if(Object.keys(e).length>g.MAX_PROPERTYKEYS)return u.error("Error: too many properties (more than 1000), ignoring"),{};var n={};for(var i in e)if(e.hasOwnProperty(i)){var o=i,r=m(o);"string"!==r&&(o=String(o),u.warn("WARNING: Non-string property key, received type "+r+', coercing to string "'+o+'"'));var s=y(o,e[i]);null!==s&&(n[o]=s)}return n},f=["nan","function","arguments","regexp","element"],y=function e(t,n){var i=m(n);if(-1!==f.indexOf(i))u.warn('WARNING: Property key "'+t+'" with invalid value type '+i+", ignoring"),n=null;else if("undefined"===i)n=null;else if("error"===i)n=String(n),u.warn('WARNING: Property key "'+t+'" with value type error, coercing to '+n);else if("array"===i){for(var o=[],r=0;r<n.length;r++){var s=n[r],a=m(s);"array"!==a?"object"===a?o.push(h(s)):o.push(e(t,s)):u.warn("WARNING: Cannot have "+a+" nested in an array property value, skipping")}n=o}else"object"===i&&(n=h(n));return n},=function(e,t){var n=m(t);if("string"===n)return t;if("date"===n||"number"===n||"boolean"===n)return t=String(t),u.warn("WARNING: Non-string groupName, received type "+n+', coercing to string "'+t+'"'),t;if("array"===n){for(var i=[],o=0;o<t.length;o++){var r=t[o],s=m(r);"array"!==s&&"object"!==s?"string"===s?i.push(r):"date"!==s&&"number"!==s&&"boolean"!==s||(r=String(r),u.warn("WARNING: Non-string groupName, received type "+s+', coercing to string "'+r+'"'),i.push(r)):u.warn("WARNING: Skipping nested "+s+" in array groupName")}return i}u.warn("WARNING: Non-string groupName, received type "+n+". Please use strings or array of strings for groupName")},w=function(e){r.hasOwnProperty(e)&&(s=r[e])},I=u,b=function(e){return!e||0===e.length},E=function(e,t){e=e.replace(/[[]/,"\[").replace(/[]]/,"\]");var n=new RegExp("[\?&]"+e+"=([^&#])").exec(t);return null===n?void 0:decodeURIComponent(n[1].replace(/+/g," "))},S=function e(t){if("array"===m(t))for(var n=0;n<t.length;n++)t[n]=e(t[n]);else if("object"===m(t))for(var i in t)t.hasOwnProperty(i)&&(t[i]=e(t[i]));else t=d(t);return t},N=function(e){var t=m(e);if("object"!==t)return u.error("Error: invalid groups format. Expecting Javascript object, received "+t+", ignoring"),{};var n={};for(var i in e)if(e.hasOwnProperty(i)){var o=i,r=m(o);"string"!==r&&(o=String(o),u.warn("WARNING: Non-string groupType, received type "+r+', coercing to string "'+o+'"'));var s=(o,e[i]);null!==s&&(n[o]=s)}return n},T=function(e,t,n){return m(e)===n||(u.error("Invalid "+t+" input type. Expected "+n+" but received "+m(e)),!1)},O=h,k=function(){return window.location},A=function(){for(var e="",t=0;t<22;++t)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-".charAt(Math.floor(64Math.random()));return e},x=function(e){try{for(var t=document.cookie.split(";"),n=null,i=0;i<t.length;i++){for(var o=t[i];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(e)){n=o.substring(e.length,o.length);break}}return n}catch(e){return null}},R=function(e,t,n){var i=null!==t?n.expirationDays:-1;if(i){var o=new Date;o.setTime(o.getTime()+24i60601e3),i=o}var r=e+"="+t;i&&(r+="; expires="+i.toUTCString()),r+="; path=/",n.domain&&(r+="; domain="+n.domain),n.secure&&(r+="; Secure"),n.sameSite&&(r+="; SameSite="+n.sameSite),document.cookie=r},C=R,P=x,U=function(){var e=String(new Date);try{var t=g.COOKIE_TEST+A();R(t,e,{});var n=x(t+"=")===e;return R(t,null,{}),n}catch(e){}return!1},D=function(e){var t=document.createElement("a");return t.href=e,t.hostname||location.hostname},q=function(e){for(var t=D(e).split("."),n=[],i="tldtest"+A(),o=t.length-2;0<=o;--o)n.push(t.slice(o).join("."));for(var r=0;r<n.length;++r){var s=n[r],a={domain:"."+s};if(C(i,1,a),P(i))return C(i,null,a),s}return""},M={expirationDays:void 0,domain:void 0},j=function(e){var t="";return M.domain&&(t="."===M.domain.charAt(0)?M.domain.substring(1):M.domain),e+t},V=function(e){var t=j(e)+"=",n=P(t);try{if(n)return JSON.parse(l.decode(n))}catch(e){return null}return null},K=function(e,t){try{return C(j(e),l.encode(JSON.stringify(t)),M),!0}catch(e){return!1}},F=function(e){try{return C(j(e),null,M),!0}catch(e){return!1}},G={reset:function(){M={expirationDays:void 0,domain:void 0}},options:function(e){if(0===arguments.length)return M;e=e||{},M.expirationDays=e.expirationDays,M.secure=e.secure,M.sameSite=e.sameSite;var t=b(e.domain)?"."+q(k().href):e.domain,n=Math.random();M.domain=t,K("amplitude_test",n);var i=V("amplitude_test");return i&&i===n||(t=null),F("amplitude_test"),M.domain=t,M},get:V,set:K,remove:F,setRaw:function(e,t){try{return C(j(e),t,M),!0}catch(e){return!1}},getRaw:function(e){var t=j(e)+"=";return P(t)}};if(function(){var e,t=new Date;try{return window.localStorage.setItem(t,t),e=window.localStorage.getItem(t)===String(t),window.localStorage.removeItem(t),e}catch(e){}return!1}())e=window.localStorage;else if(window.globalStorage)try{e=window.globalStorage[window.location.hostname]}catch(e){}else if("undefined"!=typeof document){var z=document.createElement("div"),L="localStorage";z.style.display="none",document.getElementsByTagName("head")[0].appendChild(z),z.addBehavior&&(z.addBehavior("#default#userdata"),e={length:0,setItem:function(e,t){z.load(L),z.getAttribute(e)||this.length++,z.setAttribute(e,t),z.save(L)},getItem:function(e){return z.load(L),z.getAttribute(e)},removeItem:function(e){z.load(L),z.getAttribute(e)&&this.length--,z.removeAttribute(e),z.save(L)},clear:function(){z.load(L);for(var e,t=0;e=z.XMLDocument.documentElement.attributes[t++];)z.removeAttribute(e.name);z.save(L),this.length=0},key:function(e){return z.load(L),z.XMLDocument.documentElement.attributes[e]}},z.load(L),e.length=z.XMLDocument.documentElement.attributes.length)}e||(e={length:0,setItem:function(e,t){},getItem:function(e){},removeItem:function(e){},clear:function(){},key:function(e){}});var B=e,W=function(){this.storage=null};W.prototype.getStorage=function(){if(null!==this.storage)return this.storage;if(U())this.storage=G;else{var n="ampcookiestore";this.storage={_options:{expirationDays:void 0,domain:void 0,secure:!1},reset:function(){this._options={expirationDays:void 0,domain:void 0,secure:!1}},options:function(e){return 0===arguments.length?this._options:(e=e||{},this._options.expirationDays=e.expirationDays||this._options.expirationDays,this._options.domain=e.domain||this._options.domain||window&&window.location&&window.location.hostname,this.options.secure=e.secure||!1)},get:function(e){try{return JSON.parse(B.getItem(n+e))}catch(e){}return null},set:function(e,t){try{return B.setItem(n+e,JSON.stringify(t)),!0}catch(e){}return!1},remove:function(e){try{B.removeItem(n+e)}catch(e){return!1}}}}return this.storage};var X=function(){function u(e){var t=e.storageKey,n=e.disableCookies,i=e.domain,o=e.secure,r=e.sameSite,s=e.expirationDays;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),this.storageKey=t,this.disableCookieStorage=!U()||n,this.domain=i,this.secure=o,this.sameSite=r,this.expirationDays=s,this.cookieDomain="";var a=q(k().href);this.cookieDomain=i||(a?"."+a:null)}var e,t,n;return e=u,(t=[{key:"getCookieStorageKey",value:function(){if(!this.domain)return this.storageKey;var e="."===this.domain.charAt(0)?this.domain.substring(1):this.domain;return"".concat(this.storageKey).concat(e?"".concat(e):"")}},{key:"save",value:function(e){var t=e.deviceId,n=e.userId,i=e.optOut,o=e.sessionId,r=e.lastEventTime,s=e.eventId,a=e.identifyId,u=e.sequenceNumber,c=[t,l.encode(n||""),i?"1":"",o?o.toString(32):"0",r?r.toString(32):"0",s?s.toString(32):"0",a?a.toString(32):"0",u?u.toString(32):"0"].join(".");this.disableCookieStorage?B.setItem(this.storageKey,c):C(this.getCookieStorageKey(),c,{domain:this.cookieDomain,secure:this.secure,sameSite:this.sameSite,expirationDays:this.expirationDays})}},{key:"load",value:function(){var e;if(this.disableCookieStorage||(e=P(this.getCookieStorageKey()+"=")),e||(e=B.getItem(this.storageKey)),!e)return null;var t=e.split("."),n=null;if(t[1])try{n=l.decode(t[1])}catch(e){n=null}return{deviceId:t[0],userId:n,optOut:"1"===t[2],sessionId:parseInt(t[3],32),lastEventTime:parseInt(t[4],32),eventId:parseInt(t[5],32),identifyId:parseInt(t[6],32),sequenceNumber:parseInt(t[7],32)}}}])&&i(e.prototype,t),n&&i(e,n),u}(),Y="$clearAll",$=function(){this.userPropertiesOperations={},this.properties=[]};$.prototype.add=function(e,t){return"number"===m(t)||"string"===m(t)?this._addOperation("$add",e,t):I.error("Unsupported type for value: "+m(t)+", expecting number or string"),this},$.prototype.append=function(e,t){return this._addOperation("$append",e,t),this},$.prototype.clearAll=function(){return 0<Object.keys(this.userPropertiesOperations).length?this.userPropertiesOperations.hasOwnProperty(Y)||I.error("Need to send $clearAll on its own Identify object without any other operations, skipping $clearAll"):this.userPropertiesOperations[Y]="-",this},$.prototype.prepend=function(e,t){return this._addOperation("$prepend",e,t),this},$.prototype.set=function(e,t){return this._addOperation("$set",e,t),this},$.prototype.setOnce=function(e,t){return this._addOperation("$setOnce",e,t),this},$.prototype.unset=function(e){return this._addOperation("$unset",e,"-"),this},$.prototype.addOperation=function(e,t,n){this.userPropertiesOperations.hasOwnProperty(Y)?I.error("This identify already contains a $clearAll operation, skipping operation "+e):-1===this.properties.indexOf(t)?(this.userPropertiesOperations.hasOwnProperty(e)||(this.userPropertiesOperations[e]={}),this.userPropertiesOperations[e][t]=n,this.properties.push(t)):I.error('User property "'+t+'" already used in this identify, skipping operation '+e)};var Q="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function J(e,t){return e(t={exports:{}},t.exports),t.exports}var H=J(function(s){!function(e){function l(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function a(e,t,n,i,o,r){return l((s=l(l(t,e),l(i,r)))<<(a=o)|s>>>32-a,n);var s,a}function d(e,t,n,i,o,r,s){return a(t&n|~t&i,e,t,o,r,s)}function h(e,t,n,i,o,r,s){return a(t&i|n&~i,e,t,o,r,s)}function f(e,t,n,i,o,r,s){return a(t^n^i,e,t,o,r,s)}function v(e,t,n,i,o,r,s){return a(n^(t|~i),e,t,o,r,s)}function u(e,t){var n,i,o,r,s;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var a=1732584193,u=-271733879,c=-1732584194,p=271733878;for(n=0;n<e.length;n+=16)u=v(u=v(u=v(u=v(u=f(u=f(u=f(u=f(u=h(u=h(u=h(u=h(u=d(u=d(u=d(u=d(o=u,c=d(r=c,p=d(s=p,a=d(i=a,u,c,p,e[n],7,-680876936),u,c,e[n+1],12,-389564586),a,u,e[n+2],17,606105819),p,a,e[n+3],22,-1044525330),c=d(c,p=d(p,a=d(a,u,c,p,e[n+4],7,-176418897),u,c,e[n+5],12,1200080426),a,u,e[n+6],17,-1473231341),p,a,e[n+7],22,-45705983),c=d(c,p=d(p,a=d(a,u,c,p,e[n+8],7,1770035416),u,c,e[n+9],12,-1958414417),a,u,e[n+10],17,-42063),p,a,e[n+11],22,-1990404162),c=d(c,p=d(p,a=d(a,u,c,p,e[n+12],7,1804603682),u,c,e[n+13],12,-40341101),a,u,e[n+14],17,-1502002290),p,a,e[n+15],22,1236535329),c=h(c,p=h(p,a=h(a,u,c,p,e[n+1],5,-165796510),u,c,e[n+6],9,-1069501632),a,u,e[n+11],14,643717713),p,a,e[n],20,-373897302),c=h(c,p=h(p,a=h(a,u,c,p,e[n+5],5,-701558691),u,c,e[n+10],9,38016083),a,u,e[n+15],14,-660478335),p,a,e[n+4],20,-405537848),c=h(c,p=h(p,a=h(a,u,c,p,e[n+9],5,568446438),u,c,e[n+14],9,-1019803690),a,u,e[n+3],14,-187363961),p,a,e[n+8],20,1163531501),c=h(c,p=h(p,a=h(a,u,c,p,e[n+13],5,-1444681467),u,c,e[n+2],9,-51403784),a,u,e[n+7],14,1735328473),p,a,e[n+12],20,-1926607734),c=f(c,p=f(p,a=f(a,u,c,p,e[n+5],4,-378558),u,c,e[n+8],11,-2022574463),a,u,e[n+11],16,1839030562),p,a,e[n+14],23,-35309556),c=f(c,p=f(p,a=f(a,u,c,p,e[n+1],4,-1530992060),u,c,e[n+4],11,1272893353),a,u,e[n+7],16,-155497632),p,a,e[n+10],23,-1094730640),c=f(c,p=f(p,a=f(a,u,c,p,e[n+13],4,681279174),u,c,e[n],11,-358537222),a,u,e[n+3],16,-722521979),p,a,e[n+6],23,76029189),c=f(c,p=f(p,a=f(a,u,c,p,e[n+9],4,-640364487),u,c,e[n+12],11,-421815835),a,u,e[n+15],16,530742520),p,a,e[n+2],23,-995338651),c=v(c,p=v(p,a=v(a,u,c,p,e[n],6,-198630844),u,c,e[n+7],10,1126891415),a,u,e[n+14],15,-1416354905),p,a,e[n+5],21,-57434055),c=v(c,p=v(p,a=v(a,u,c,p,e[n+12],6,1700485571),u,c,e[n+3],10,-1894986606),a,u,e[n+10],15,-1051523),p,a,e[n+1],21,-2054922799),c=v(c,p=v(p,a=v(a,u,c,p,e[n+8],6,1873313359),u,c,e[n+15],10,-30611744),a,u,e[n+6],15,-1560198380),p,a,e[n+13],21,1309151649),c=v(c,p=v(p,a=v(a,u,c,p,e[n+4],6,-145523070),u,c,e[n+11],10,-1120210379),a,u,e[n+2],15,718787259),p,a,e[n+9],21,-343485551),a=l(a,i),u=l(u,o),c=l(c,r),p=l(p,s);return[a,u,c,p]}function c(e){var t,n="",i=32e.length;for(t=0;t<i;t+=8)n+=String.fromCharCode(e[t>>5]>>>t%32&255);return n}function p(e){var t,n=[];for(n[(e.length>>2)-1]=void 0,t=0;t<n.length;t+=1)n[t]=0;var i=8e.length;for(t=0;t<i;t+=8)n[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return n}function i(e){var t,n,i="0123456789abcdef",o="";for(n=0;n<e.length;n+=1)t=e.charCodeAt(n),o+=i.charAt(t>>>4&15)+i.charAt(15&t);return o}function n(e){return unescape(encodeURIComponent(e))}function o(e){return c(u(p(t=n(e)),8t.length));var t}function r(e,t){return function(e,t){var n,i,o=p(e),r=[],s=[];for(r[15]=s[15]=void 0,16<o.length&&(o=u(o,8e.length)),n=0;n<16;n+=1)r[n]=909522486^o[n],s[n]=1549556828^o[n];return i=u(r.concat(p(t)),512+8t.length),c(u(s.concat(i),640))}(n(e),n(t))}function t(e,t,n){return t?n?r(t,e):i(r(t,e)):n?o(e):i(o(e))}s.exports?s.exports=t:e.md5=t}(Q)}),Z=function(e){return encodeURIComponent(e).replace(/[!'()]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})},ee=Object.getOwnPropertySymbols,te=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable;var ie=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t[""+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,i,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),r=1;r<arguments.length;r++){for(var s in n=Object(arguments[r]))te.call(n,s)&&(o[s]=n[s]);if(ee){i=ee(n);for(var a=0;a<i.length;a++)ne.call(n,i[a])&&(o[i[a]]=n[i[a]])}}return o},oe="%[a-f0-9]{2}";new RegExp(oe,"gi"),new RegExp("("+oe+")+","gi");function re(e,t){return t.encode?t.strict?Z(e):encodeURIComponent(e):e}var se=function(i,o){!1===(o=ie({encode:!0,strict:!0,arrayFormat:"none"},o)).sort&&(o.sort=function(){});var r=function(i){switch(i.arrayFormat){case"index":return function(e,t,n){return null===t?[re(e,i),"[",n,"]"].join(""):[re(e,i),"[",re(n,i),"]=",re(t,i)].join("")};case"bracket":return function(e,t){return null===t?re(e,i):[re(e,i),"[]=",re(t,i)].join("")};default:return function(e,t){return null===t?re(e,i):[re(e,i),"=",re(t,i)].join("")}}}(o);return i?Object.keys(i).sort(o.sort).map(function(t){var e=i[t];if(void 0===e)return"";if(null===e)return re(t,o);if(Array.isArray(e)){var n=[];return e.slice().forEach(function(e){void 0!==e&&n.push(r(t,e,n.length))}),n.join("&")}return re(t,o)+"="+re(e,o)}).filter(function(e){return 0<e.length}).join("&"):""},ae=function(e,t){this.url=e,this.data=t||{}};ae.prototype.send=function(e){if(!!window.XDomainRequest){var t=new window.XDomainRequest;t.open("POST",this.url,!0),t.onload=function(){e(200,t.responseText)},t.onerror=function(){"Request Entity Too Large"===t.responseText?e(413,t.responseText):e(500,t.responseText)},t.ontimeout=function(){},t.onprogress=function(){},t.send(se(this.data))}else{var n=new XMLHttpRequest;n.open("POST",this.url,!0),n.onreadystatechange=function(){4===n.readyState&&e(n.status,n.responseText)},n.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),n.send(se(this.data))}};var ue=function(){this._price=null,this._productId=null,this._quantity=1,this._revenueType=null,this._properties=null};ue.prototype.setProductId=function(e){return"string"!==m(e)?I.error("Unsupported type for productId: "+m(e)+", expecting string"):b(e)?I.error("Invalid empty productId"):this._productId=e,this},ue.prototype.setQuantity=function(e){return"number"!==m(e)?I.error("Unsupported type for quantity: "+m(e)+", expecting number"):this._quantity=parseInt(e),this},ue.prototype.setPrice=function(e){return"number"!==m(e)?I.error("Unsupported type for price: "+m(e)+", expecting number"):this._price=e,this},ue.prototype.setRevenueType=function(e){return"string"!==m(e)?I.error("Unsupported type for revenueType: "+m(e)+", expecting string"):this._revenueType=e,this},ue.prototype.setEventProperties=function(e){return"object"!==m(e)?I.error("Unsupported type for eventProperties: "+m(e)+", expecting object"):this._properties=O(e),this},ue.prototype._isValidRevenue=function(){return"number"===m(this._price)||(I.error("Invalid revenue, need to set price field"),!1)},ue.prototype._toJSONObject=function(){var e="object"===m(this._properties)?this._properties:{};return null!==this._productId&&(e[g.REVENUE_PRODUCT_ID]=this._productId),null!==this._quantity&&(e[g.REVENUE_QUANTITY]=this._quantity),null!==this._price&&(e[g.REVENUE_PRICE]=this._price),null!==this._revenueType&&(e[g.REVENUE_REVENUE_TYPE]=this._revenueType),e};var ce,pe=J(function(I,b){!function(o,l){var d="function",e="model",t="name",n="type",i="vendor",r="version",s="architecture",a="console",u="mobile",c="tablet",p="smarttv",h="wearable",f={extend:function(e,t){var n={};for(var i in e)t[i]&&t[i].length%2==0?n[i]=t[i].concat(e[i]):n[i]=e[i];return n},has:function(e,t){return"string"==typeof e&&-1!==t.toLowerCase().indexOf(e.toLowerCase())},lowerize:function(e){return e.toLowerCase()},major:function(e){return"string"==typeof e?e.replace(/[^\d.]/g,"").split(".")[0]:l},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}},v={rgx:function(e,t){for(var n,i,o,r,s,a,u=0;u<t.length&&!s;){var c=t[u],p=t[u+1];for(n=i=0;n<c.length&&!s;)if(s=c[n++].exec(e))for(o=0;o<p.length;o++)a=s[++i],"object"==typeof(r=p[o])&&0<r.length?2==r.length?typeof r[1]==d?this[r[0]]=r[1].call(this,a):this[r[0]]=r[1]:3==r.length?typeof r[1]!==d||r[1].exec&&r[1].test?this[r[0]]=a?a.replace(r[1],r[2]):l:this[r[0]]=a?r[1].call(this,a,r[2]):l:4==r.length&&(this[r[0]]=a?r[3].call(this,a.replace(r[1],r[2])):l):this[r]=a||l;u+=2}},str:function(e,t){for(var n in t)if("object"==typeof t[n]&&0<t[n].length){for(var i=0;i<t[n].length;i++)if(f.has(t[n][i],e))return"?"===n?l:n}else if(f.has(t[n],e))return"?"===n?l:n;return e}},g={browser:{oldsafari:{version:{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}}},device:{amazon:{model:{"Fire Phone":["SD","KF"]}},sprint:{model:{"Evo Shift 4G":"7373KT"},vendor:{HTC:"APA",Sprint:"Sprint"}}},os:{windows:{version:{ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"}}}},m={browser:[[/(opera\smini)\/([\w.-]+)/i,/(opera\s[mobiletab]+).+version\/([\w.-]+)/i,/(opera).+version\/([\w.]+)/i,/(opera)[\/\s]+([\w.]+)/i],[t,r],[/(opios)[\/\s]+([\w.]+)/i],[[t,"Opera Mini"],r],[/\s(opr)\/([\w.]+)/i],[[t,"Opera"],r],[/(kindle)\/([\w.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?([\w.])/i,/(avant\s|iemobile|slim)(?:browser)?[\/\s]?([\w.])/i,/(bidubrowser|baidubrowser)[\/\s]?([\w.]+)/i,/(?:ms|()(ie)\s([\w.]+)/i,/(rekonq)\/([\w.])/i,/(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon)\/([\w.-]+)/i],[t,r],[/(konqueror)\/([\w.]+)/i],[[t,"Konqueror"],r],[/(trident).+rv:\s.+like\sgecko/i],[[t,"IE"],r],[/(edge|edgios|edga|edg)\/((\d+)?[\w.]+)/i],[[t,"Edge"],r],[/(yabrowser)\/([\w.]+)/i],[[t,"Yandex"],r],[/(Avast)\/([\w.]+)/i],[[t,"Avast Secure Browser"],r],[/(AVG)\/([\w.]+)/i],[[t,"AVG Secure Browser"],r],[/(puffin)\/([\w.]+)/i],[[t,"Puffin"],r],[/(focus)\/([\w.]+)/i],[[t,"Firefox Focus"],r],[/(opt)\/([\w.]+)/i],[[t,"Opera Touch"],r],[/((?:[\s\/])uc?\s?browser|(?:juc.+)ucweb)[\/\s]?([\w.]+)/i],[[t,"UCBrowser"],r],[/(comododragon)\/([\w.]+)/i],[[t,//g," "],r],[/(windowswechat qbcore)\/([\w.]+)/i],[[t,"WeChat(Win) Desktop"],r],[/(micromessenger)\/([\w.]+)/i],[[t,"WeChat"],r],[/(brave)\/([\w.]+)/i],[[t,"Brave"],r],[/(qqbrowserlite)\/([\w.]+)/i],[t,r],[/(QQ)\/([\d.]+)/i],[t,r],[/m?(qqbrowser)[\/\s]?([\w.]+)/i],[t,r],[/(baiduboxapp)[\/\s]?([\w.]+)/i],[t,r],[/(2345Explorer)[\/\s]?([\w.]+)/i],[t,r],[/(MetaSr)[\/\s]?([\w.]+)/i],[t],[/(LBBROWSER)/i],[t],[/xiaomi\/miuibrowser\/([\w.]+)/i],[r,[t,"MIUI Browser"]],[/;fbav\/([\w.]+);/i],[r,[t,"Facebook"]],[/safari\s(line)\/([\w.]+)/i,/android.+(line)\/([\w.]+)\/iab/i],[t,r],[/headlesschrome(?:\/([\w.]+)|\s)/i],[r,[t,"Chrome Headless"]],[/\swv).+(chrome)\/([\w.]+)/i],[[t,/(.+)/,"$1 WebView"],r],[/((?:oculus|samsung)browser)\/([\w.]+)/i],[[t,/(.+(?:g|us))(.+)/,"$1 $2"],r],[/((?:android.+)crmo|crios)\/([\w.]+)/i,/android.+(chrome)\/([\w.]+)\s+(?:mobile\s?safari)/i],[[t,"Chrome Mobile"],r],[/android.+version\/([\w.]+)\s+(?:mobile\s?safari|safari)/i],[r,[t,"Android Browser"]],[/(sailfishbrowser)\/([\w.]+)/i],[[t,"Sailfish Browser"],r],[/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?([\w.]+)/i],[t,r],[/(dolfin)\/([\w.]+)/i],[[t,"Dolphin"],r],[/(qihu|qhbrowser|qihoobrowser|360browser)/i],[[t,"360 Browser"]],[/(coast)\/([\w.]+)/i],[[t,"Opera Coast"],r],[/fxios\/([\w.-]+)/i],[r,[t,"Firefox"]],[/version\/([\w.]+).+?mobile\/\w+\s(safari)/i],[r,[t,"Mobile Safari"]],[/version\/([\w.]+).+?(mobile\s?safari|safari)/i],[r,t],[/webkit.+?(gsa)\/([\w.]+).+?(mobile\s?safari|safari)(\/[\w.]+)/i],[[t,"GSA"],r],[/webkit.+?(mobile\s?safari|safari)(\/[\w.]+)/i],[t,[r,v.str,g.browser.oldsafari.version]],[/(webkit|khtml)\/([\w.]+)/i],[t,r],[/(navigator|netscape)\/([\w.-]+)/i],[[t,"Netscape"],r],[/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?([\w.+]+)/i,/(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([\w.-]+)/i,/(mozilla)\/([\w.]+).+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir)[\/\s]?([\w.]+)/i,/(links)\s(([\w.]+)/i,/(gobrowser)\/?([\w.])/i,/(ice\s?browser)\/v?([\w.]+)/i,/(mosaic)\/\s/i],[t,r]],cpu:[[/(?:(amd|x(?:(?:86|64)[-])?|wow|win)64)[;)]/i],[[s,"amd64"]],[/(ia32(?=;))/i],[[s,f.lowerize]],[/((?:i[346]|x)86)[;)]/i],[[s,"ia32"]],[/windows\s(ce|mobile);\sppc;/i],[[s,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?:\smac|;|))/i],[[s,/ower/,"",f.lowerize]],[/(sun4\w)[;)]/i],[[s,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=))|arm(?:64|(?=v\d+[;l]))|(?=atmel\s)avr|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],[[s,f.lowerize]]],device:[[/((ipad|playbook);[\w\s),;-]+(rim|apple)/i],[e,i,[n,c]],[/applecoremedia\/[\w.]+ ((ipad)/],[e,[i,"Apple"],[n,c]],[/(apple\s{0,1}tv)/i],[[e,"Apple TV"],[i,"Apple"],[n,p]],[/(archos)\s(gamepad2?)/i,/(hp).+(touchpad)/i,/(hp).+(tablet)/i,/(kindle)\/([\w.]+)/i,/\s(nook)[\w\s]+build\/(\w+)/i,/(dell)\s(strea[kpr\s\d][\dko])/i],[i,e,[n,c]],[/(kf[A-z]+)\sbuild\/.+silk\//i],[e,[i,"Amazon"],[n,c]],[/(sd|kf)[0349hijorstuw]+\sbuild\/.+silk\//i],[[e,v.str,g.device.amazon.model],[i,"Amazon"],[n,u]],[/android.+aft([bms])\sbuild/i],[e,[i,"Amazon"],[n,p]],[/((ip[honed|\s\w]+);.+(apple)/i],[e,i,[n,u]],[/((ip[honed|\s\w]+);/i],[e,[i,"Apple"],[n,u]],[/(blackberry)[\s-]?(\w+)/i,/(blackberry|benq|palm(?=-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[\s-]?([\w-]*)/i,/(hp)\s([\w\s]+\w)/i,/(asus)-?(\w+)/i],[i,e,[n,u]],[/(bb10;\s(\w+)/i],[e,[i,"BlackBerry"],[n,u]],[/android.+(transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+|nexus 7|padfone|p00c)/i],[e,[i,"Asus"],[n,c]],[/(sony)\s(tablet\s[ps])\sbuild\//i,/(sony)?(?:sgp.+)\sbuild\//i],[[i,"Sony"],[e,"Xperia Tablet"],[n,c]],[/android.+\s([c-g]\d{4}|so[-l]\w+)(?=\sbuild\/|).+chrome\/(?![1-6]{0,1}\d.))/i],[e,[i,"Sony"],[n,u]],[/\s(ouya)\s/i,/(nintendo)\s([wids3u]+)/i],[i,e,[n,a]],[/android.+;\s(shield)\sbuild/i],[e,[i,"Nvidia"],[n,a]],[/(playstation\s[34portablevi]+)/i],[e,[i,"Sony"],[n,a]],[/(sprint\s(\w+))/i],[[i,v.str,g.device.sprint.vendor],[e,v.str,g.device.sprint.model],[n,u]],[/(htc)[;\s-]+([\w\s]+(?=)|\sbuild)|\w+)/i,/(zte)-(\w)/i,/(alcatel|geeksphone|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-])/i],[i,[e,//g," "],[n,u]],[/(nexus\s9)/i],[e,[i,"HTC"],[n,c]],[/d\/huawei([\w\s-]+)[;)]/i,/(nexus\s6p|vog-l29|ane-lx1|eml-l29)/i],[e,[i,"Huawei"],[n,u]],[/android.+(bah2?-a?[lw]\d{2})/i],[e,[i,"Huawei"],[n,c]],[/(microsoft);\s(lumia[\s\w]+)/i],[i,e,[n,u]],[/\s(;[\s);]/i],[e,[i,"Microsoft"],[n,a]],[/(kin.[onetw]{3})/i],[[e,/./g," "],[i,"Microsoft"],[n,u]],[/\s(milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?:?(\s4g)?)[\w\s]+build\//i,/mot[\s-]?(\w)/i,/(XT\d{3,4}) build\//i,/(nexus\s6)/i],[e,[i,"Motorola"],[n,u]],[/android.+\s(mz60\d|xoom[\s2]{0,2})\sbuild\//i],[e,[i,"Motorola"],[n,c]],[/hbbtv\/\d+.\d+.\d+\s+([\w\s];\s(\w[^;]);([^;])/i],[[i,f.trim],[e,f.trim],[n,p]],[/hbbtv.+maple;(\d+)/i],[[e,/^/,"SmartTV"],[i,"Samsung"],[n,p]],[/(dtv[);].+(aquos)/i],[e,[i,"Sharp"],[n,p]],[/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n\d+|sgh-t8[56]9|nexus 10))/i,/((SM-T\w+))/i],[[i,"Samsung"],e,[n,c]],[/smart-tv.+(samsung)/i],[i,[n,p],e],[/((s[cgp]h-\w+|gt-\w+|galaxy\snexus|sm-\w[\w\d]+))/i,/(sam[sung])[\s-](\w+-?[\w-])/i,/sec-((sgh\w+))/i],[[i,"Samsung"],e,[n,u]],[/sie-(\w)/i],[e,[i,"Siemens"],[n,u]],[/(maemo|nokia).(n900|lumia\s\d+)/i,/(nokia)[\s-]?([\w-])/i],[[i,"Nokia"],e,[n,u]],[/android[x\d.\s;]+\s([ab][1-7]-?[0178a]\d\d?)/i],[e,[i,"Acer"],[n,c]],[/android.+([vl]k-?\d{3})\s+build/i],[e,[i,"LG"],[n,c]],[/android\s3.[\s\w;-]{10}(lg?)-([06cv9]{3,4})/i],[[i,"LG"],e,[n,c]],[/(lg) netcast.tv/i],[i,e,[n,p]],[/(nexus\s[45])/i,/lg[e;\s\/-]+(\w)/i,/android.+lg(-?[\d\w]+)\s+build/i],[e,[i,"LG"],[n,u]],[/(lenovo)\s?(s(?:5000|6000)(?:[\w-]+)|tab(?:[\s\w]+))/i],[i,e,[n,c]],[/android.+(ideatab[a-z0-9-\s]+)/i],[e,[i,"Lenovo"],[n,c]],[/(lenovo)[\s-]?([\w-]+)/i],[i,e,[n,u]],[/linux;.+((jolla));/i],[i,e,[n,u]],[/((pebble))app\/[\d.]+\s/i],[i,e,[n,h]],[/android.+;\s(oppo)\s?([\w\s]+)\sbuild/i],[i,e,[n,u]],[/crkey/i],[[e,"Chromecast"],[i,"Google"],[n,p]],[/android.+;\s(glass)\s\d/i],[e,[i,"Google"],[n,h]],[/android.+;\s(pixel c)[\s)]/i],[e,[i,"Google"],[n,c]],[/android.+;\s(pixel( [23])?( xl)?)[\s)]/i],[e,[i,"Google"],[n,u]],[/android.+;\s(\w+)\s+build\/hm\1/i,/android.+(hm[\s-]note?[\s_](?:\d\w)?)\s+build/i,/android.+(mi[\s-]*(?:a\d|one|one[\s]plus|note lte)?[\s]*(?:\d?\w?)[\s](?:plus)?)\s+build/i,/android.+(redmi[\s-_](?:note)?(?:[\s]*[\w\s]+))\s+build/i],[[e,//g," "],[i,"Xiaomi"],[n,u]],[/android.+(mi[\s-]*(?:pad)(?:[\s][\w\s]+))\s+build/i],[[e,/_/g," "],[i,"Xiaomi"],[n,c]],[/android.+;\s(m[1-5]\snote)\sbuild/i],[e,[i,"Meizu"],[n,u]],[/(mz)-([\w-]{2,})/i],[[i,"Meizu"],e,[n,u]],[/android.+a000(1)\s+build/i,/android.+oneplus\s(a\d{4})[\s)]/i],[e,[i,"OnePlus"],[n,u]],[/android.+[;\/]\s(RCT[\d\w]+)\s+build/i],[e,[i,"RCA"],[n,c]],[/android.+[;\/\s]+(Venue[\d\s]{2,7})\s+build/i],[e,[i,"Dell"],[n,c]],[/android.+[;\/]\s(Q[T|M][\d\w]+)\s+build/i],[e,[i,"Verizon"],[n,c]],[/android.+[;\/]\s+(Barnes[&\s]+Noble\s+|BN[RT])(V?.)\s+build/i],[[i,"Barnes & Noble"],e,[n,c]],[/android.+[;\/]\s+(TM\d{3}.\b)\s+build/i],[e,[i,"NuVision"],[n,c]],[/android.+;\s(k88)\sbuild/i],[e,[i,"ZTE"],[n,c]],[/android.+[;\/]\s(gen\d{3})\s+build.49h/i],[e,[i,"Swiss"],[n,u]],[/android.+[;\/]\s(zur\d{3})\s+build/i],[e,[i,"Swiss"],[n,c]],[/android.+[;\/]\s((Zeki)?TB.\b)\s+build/i],[e,[i,"Zeki"],[n,c]],[/(android).+[;\/]\s+([YR]\d{2})\s+build/i,/android.+[;\/]\s+(Dragon[-\s]+Touch\s+|DT)(\w{5})\sbuild/i],[[i,"Dragon Touch"],e,[n,c]],[/android.+[;\/]\s(NS-?\w{0,9})\sbuild/i],[e,[i,"Insignia"],[n,c]],[/android.+[;\/]\s((NX|Next)-?\w{0,9})\s+build/i],[e,[i,"NextBook"],[n,c]],[/android.+[;\/]\s(Xtreme_)?(V(1[045]|2[015]|30|40|60|7[05]|90))\s+build/i],[[i,"Voice"],e,[n,u]],[/android.+[;\/]\s(LVTEL-)?(V1[12])\s+build/i],[[i,"LvTel"],e,[n,u]],[/android.+;\s(PH-1)\s/i],[e,[i,"Essential"],[n,u]],[/android.+[;\/]\s(V(100MD|700NA|7011|917G).\b)\s+build/i],[e,[i,"Envizen"],[n,c]],[/android.+[;\/]\s(Le[\s-]+Pan)[\s-]+(\w{1,9})\s+build/i],[i,e,[n,c]],[/android.+[;\/]\s(Trio[\s-].)\s+build/i],[e,[i,"MachSpeed"],[n,c]],[/android.+[;\/]\s(Trinity)[-\s](T\d{3})\s+build/i],[i,e,[n,c]],[/android.+[;\/]\sTU_(1491)\s+build/i],[e,[i,"Rotor"],[n,c]],[/android.+(KS(.+))\s+build/i],[e,[i,"Amazon"],[n,c]],[/android.+(Gigaset)[\s-]+(Q\w{1,9})\s+build/i],[i,e,[n,c]],[/\s(tablet|tab)[;\/]/i,/\s(mobile)(?:[;\/]|\ssafari)/i],[[n,f.lowerize],i,e],[/\s\/([;)]/i],[[n,p]],[/(android[\w.\s-]{0,9});.+build/i],[e,[i,"Generic"]]],engine:[[/windows.+\sedge\/([\w.]+)/i],[r,[t,"EdgeHTML"]],[/webkit\/537.36.+chrome\/(?!27)([\w.]+)/i],[r,[t,"Blink"]],[/(presto)\/([\w.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w.]+)/i,/(khtml|tasman|links)[\/\s](?([\w.]+)/i,/(icab)\/\s/i],[t,r],[/rv\:([\w.]{1,9}).+(gecko)/i],[r,t]],os:[[/microsoft\s(windows)\s(vista|xp)/i],[t,r],[/(windows)\snt\s6.2;\s(arm)/i,/(windows\sphone(?:\sos))[\s\/]?([\d.\s\w])/i,/(windows\smobile|windows)[\s\/]?([ntce\d.\s]+\w)/i],[[t,v.str,g.os.windows.name],[r,v.str,g.os.windows.version]],[/(win(?=3|9|n)|win\s9x\s)([nt\d.]+)/i],[[t,"Windows"],[r,v.str,g.os.windows.version]],[/((bb)(10);/i],[[t,"BlackBerry"],r],[/(blackberry)\w\/?([\w.])/i,/(tizen|kaios)\/\s/i,/(android|webos|palm\sos|qnx|bada|rim\stablet\sos|meego|sailfish|contiki)[\/\s-]?([\w.])/i],[t,r],[/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w.])/i],[[t,"Symbian"],r],[/((series40);/i],[t],[/mozilla.+(mobile;.+gecko.+firefox/i],[[t,"Firefox OS"],r],[/(nintendo|playstation)\s([wids34portablevu]+)/i,/(mint)[\/\s(]?(\w)/i,/(mageia|vectorlinux)[;\s]/i,/(joli|[kxln]?ubuntu|debian|suse|opensuse|gentoo|(?=\s)arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk|linpus)[\/\s-]?(?!chrom)([\w.-])/i,/(hurd|linux)\s?([\w.])/i,/(gnu)\s?([\w.])/i],[[t,"Linux"],r],[/(cros)\s[\w]+\s([\w.]+\w)/i],[[t,"Chromium OS"],r],[/(sunos)\s?([\w.\d])/i],[[t,"Solaris"],r],[/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w.])/i],[[t,"Linux"],r],[/(iphone)(?:.os\s([\w])\slike\smac|;\sopera)/i],[[t,"iPhone"],[r,//g,"."]],[/(ipad)(?:.os\s([\w]*)\slike\smac|;\sopera)/i],[[t,"iPad"],[r,//g,"."]],[/(haiku)\s(\w+)/i],[t,r],[/cfnetwork\/.+darwin/i,/ip[honead]{2,4}(?:.os\s([\w]+)\slike\smac|;\sopera)/i],[[r,/_/g,"."],[t,"iOS"]],[/(mac\sos\sx)\s?([\w\s.])/i,/(macintosh|mac(?=powerpc)\s)/i],[[t,"Mac"],[r,//g,"."]],[/((?:open)?solaris)[\/\s-]?([\w.])/i,/(aix)\s((\d)(?=.|)|\s)[\w.])/i,/(plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos|openvms|fuchsia)/i,/(unix)\s?([\w.]*)/i],[t,r]]},y=function(e,t){if("object"==typeof e&&(t=e,e=l),!(this instanceof y))return new y(e,t).getResult();var n=e||(o&&o.navigator&&o.navigator.userAgent?o.navigator.userAgent:""),i=t?f.extend(m,t):m;return this.getBrowser=function(){var e={name:l,version:l};return v.rgx.call(e,n,i.browser),e.major=f.major(e.version),e},this.getCPU=function(){var e={architecture:l};return v.rgx.call(e,n,i.cpu),e},this.getDevice=function(){var e={vendor:l,model:l,type:l};return v.rgx.call(e,n,i.device),e},this.getEngine=function(){var e={name:l,version:l};return v.rgx.call(e,n,i.engine),e},this.getOS=function(){var e={name:l,version:l};return v.rgx.call(e,n,i.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=e,this},this};y.VERSION="0.7.21",y.BROWSER={NAME:t,MAJOR:"major",VERSION:r},y.CPU={ARCHITECTURE:s},y.DEVICE={MODEL:e,VENDOR:i,TYPE:n,CONSOLE:a,MOBILE:u,SMARTTV:p,TABLET:c,WEARABLE:h,EMBEDDED:"embedded"},y.ENGINE={NAME:t,VERSION:r},y.OS={NAME:t,VERSION:r},I.exports&&(b=I.exports=y),b.UAParser=y;var =o&&(o.jQuery||o.Zepto);if(&&!.ua){var w=new y;.ua=w.getResult(),.ua.get=function(){return w.getUA()},.ua.set=function(e){w.setUA(e);var t=w.getResult();for(var n in t)_.ua[n]=t[n]}}}("object"==typeof window?window:Q)}),le=(pe.UAParser,"7.1.0"),de={apiEndpoint:"api.amplitude.com",batchEvents:!1,cookieExpiration:3650,cookieName:"amplitude_id",sameSiteCookie:"Lax",cookieForceUpgrade:!1,deferInitialization:!1,disableCookies:!1,deviceIdFromUrlParam:!1,domain:"",eventUploadPeriodMillis:3e4,eventUploadThreshold:30,forceHttps:!0,includeGclid:!1,includeReferrer:!1,includeUtm:!1,language:function(){return navigator&&(navigator.languages&&navigator.languages[0]||navigator.language||navigator.userLanguage)||""}(),logLevel:"WARN",optOut:!1,onError:function(){},platform:"Web",savedMaxCount:1e3,saveEvents:!0,saveParamsReferrerOncePerSession:!0,secureCookie:!1,sessionTimeout:18e5,trackingOptions:{city:!0,country:!0,carrier:!0,device_manufacturer:!0,device_model:!0,dma:!0,ip_address:!0,language:!0,os_name:!0,os_version:!0,platform:!0,region:!0,version_name:!0},unsetParamsReferrerOnNewSession:!1,unsentKey:"amplitude_unsent",unsentIdentifyKey:"amplitude_unsent_identify",uploadBatchSize:100},he=function(e){this._instanceName=b(e)?g.DEFAULT_INSTANCE:e.toLowerCase(),this._unsentEvents=[],this._unsentIdentifys=[],this._ua=new pe(navigator.userAgent).getResult(),this.options=v({},de,{trackingOptions:v({},de.trackingOptions)}),this.cookieStorage=(new W).getStorage(),this._q=[],this._sending=!1,this._updateScheduled=!1,this._onInit=[],this._eventId=0,this._identifyId=0,this._lastEventTime=null,this._newSession=!1,this._sequenceNumber=0,this._sessionId=null,this._isInitialized=!1,this._userAgent=navigator&&navigator.userAgent||null};he.prototype.Identify=$,he.prototype.Revenue=ue,he.prototype.init=function(e,i,o,t){var r=this;if("string"!==m(e)||b(e))I.error("Invalid apiKey. Please re-initialize with a valid apiKey");else try{ve(this.options,o),this.options.cookieName!==de.cookieName&&I.warn("The cookieName option is deprecated. We will be ignoring it for newer cookies"),this.options.apiKey=e,this.storageSuffix=""+e+(this._instanceName===g.DEFAULTINSTANCE?"":""+this._instanceName),this._storageSuffixV5=e.slice(0,6),this._oldCookiename=this.options.cookieName+this._storageSuffix,this._unsentKey=this.options.unsentKey+this._storageSuffix,this._unsentIdentifyKey=this.options.unsentIdentifyKey+this._storageSuffix,this._cookieName=g.COOKIEPREFIX+""+this._storageSuffixV5,this.cookieStorage.options({expirationDays:this.options.cookieExpiration,domain:this.options.domain,secure:this.options.secureCookie,sameSite:this.options.sameSiteCookie}),this._metadataStorage=new X({storageKey:this._cookieName,disableCookies:this.options.disableCookies,expirationDays:this.options.cookieExpiration,domain:this.options.domain,secure:this.options.secureCookie,sameSite:this.options.sameSiteCookie});var n=!!this.cookieStorage.get(this._oldCookiename),s=!!this._metadataStorage.load();this._useOldCookie=!s&&n&&!this.options.cookieForceUpgrade;var a=s||n;if(this.options.domain=this.cookieStorage.options().domain,this.options.deferInitialization&&!a)return void this._deferInitialization(e,i,o,t);"string"===m(this.options.logLevel)&&w(this.options.logLevel);var u=Ee(this);this._apiPropertiesTrackingOptions=0<Object.keys(u).length?{tracking_options:u}:{},this.options.cookieForceUpgrade&&n&&(s||me(this),this.cookieStorage.remove(this._oldCookiename)),ge(this),this._pendingReadStorage=!0;var c=function(e){r.options.deviceId=r._getInitialDeviceId(o&&o.deviceId,e),r.options.userId="string"===m(i)&&!b(i)&&i||"number"===m(i)&&i.toString()||r.options.userId||null;var t=(new Date).getTime();(!r._sessionId||!r._lastEventTime||t-r._lastEventTime>r.options.sessionTimeout)&&(r.options.unsetParamsReferrerOnNewSession&&r._unsetUTMParams(),r._newSession=!0,r._sessionId=t,r.options.saveParamsReferrerOncePerSession&&r._trackParamsAndReferrer()),r.options.saveParamsReferrerOncePerSession||r._trackParamsAndReferrer(),r.options.saveEvents&&(fe(r._unsentEvents),fe(r._unsentIdentifys)),r._lastEventTime=t,_e(r),r._pendingReadStorage=!1,r._sendEventsIfReady();for(var n=0;n<r._onInit.length;n++)r._onInitn;r._onInit=[],r._isInitialized=!0};this.options.saveEvents&&(this._unsentEvents=this._loadSavedUnsentEvents(this.options.unsentKey).map(function(e){return{event:e}}).concat(this._unsentEvents),this._unsentIdentifys=this._loadSavedUnsentEvents(this.options.unsentIdentifyKey).map(function(e){return{event:e}}).concat(this._unsentIdentifys)),c(),this.runQueuedFunctions(),"function"===m(t)&&t(this)}catch(e){I.error(e),this.options.onError(e)}},he.prototype.deleteLowerLevelDomainCookies=function(){var e=D(),t=this.options.domain&&"."===this.options.domain[0]?this.options.domain.slice(1):this.options.domain;if(t&&e!==t&&new RegExp(t+"$").test(e)){for(var n=e.split("."),i=t.split("."),o=n.length;o>i.length;--o){var r=n.slice(n.length-o).join(".");C(this._cookieName,null,{domain:"."+r})}C(this._cookieName,null,{})}},he.prototype._getInitialDeviceId=function(e,t){return e||(this.options.deviceIdFromUrlParam?this._getDeviceIdFromUrlParam(this._getUrlParams()):this.options.deviceId?this.options.deviceId:t||A())};var fe=function(e){for(var t=0;t<e.length;t++){var n=e[t].event.user_properties,i=e[t].event.event_properties,o=e[t].event.groups;e[t].event.user_properties=O(n),e[t].event.event_properties=O(i),e[t].event.groups=N(o)}};he.prototype._migrateUnsentEvents=function(e){var r=this;Promise.all([ce.getItem(this.options.unsentKey),ce.getItem(this.options.unsentIdentifyKey)]).then(function(e){if(r.options.saveEvents){var t=e[0],n=e[1],i=[],o=[];t&&(i.push(ce.setItem(r.options.unsentKey+r._storageSuffix,JSON.stringify(t))),o.push(ce.removeItem(r.options.unsentKey))),n&&(i.push(ce.setItem(r.options.unsentIdentifyKey+r._storageSuffix,JSON.stringify(n))),o.push(ce.removeItem(r.options.unsentIdentifyKey))),0<i.length&&Promise.all(i).then(function(){}).catch(function(e){r.options.onError(e)})}}).then(e).catch(function(e){r.options.onError(e)})},he.prototype._trackParamsAndReferrer=function(){this.options.includeUtm&&this._initUtmData(),this.options.includeReferrer&&this._saveReferrer(this._getReferrer()),this.options.includeGclid&&this._saveGclid(this._getUrlParams())};var ve=function i(o,r){if("object"===m(r)){var e=function(e){if(o.hasOwnProperty(e)){var t=r[e],n=m(o[e]);T(t,e+" option",n)&&("boolean"===n?o[e]=!!t:"string"===n&&!b(t)||"number"===n&&0<t?o[e]=t:"object"===n&&i(o[e],t))}};for(var t in r)r.hasOwnProperty(t)&&e(t)}};he.prototype.runQueuedFunctions=function(){var e=this._q;this._q=[];for(var t=0;t<e.length;t++){var n=this[e[t][0]];"function"===m(n)&&n.apply(this,e[t].slice(1))}},he.prototype._apiKeySet=function(e){return!b(this.options.apiKey)||(I.error("Invalid apiKey. Please set a valid apiKey with init() before calling "+e),!1)},he.prototype._loadSavedUnsentEvents=function(e){var t=this._getFromStorage(B,e),n=this._parseSavedUnsentEventsString(t,e);return this._setInStorage(B,e,JSON.stringify(n)),n},he.prototype._parseSavedUnsentEventsString=function(e,t){if(b(e))return[];if("string"===m(e))try{var n=JSON.parse(e);if("array"===m(n))return n}catch(e){}return I.error("Unable to load "+t+" events. Restart with a new empty queue."),[]},he.prototype.isNewSession=function(){return this._newSession},he.prototype.onInit=function(e){this._isInitialized?e():this._onInit.push(e)},he.prototype.getSessionId=function(){return this._sessionId},he.prototype.nextEventId=function(){return this._eventId++,this._eventId},he.prototype.nextIdentifyId=function(){return this._identifyId++,this._identifyId},he.prototype.nextSequenceNumber=function(){return this._sequenceNumber++,this._sequenceNumber},he.prototype._unsentCount=function(){return this._unsentEvents.length+this._unsentIdentifys.length},he.prototype._sendEventsIfReady=function(){return 0!==this._unsentCount()&&(this.options.batchEvents?this._unsentCount()>=this.options.eventUploadThreshold?(this.sendEvents(),!0):(this._updateScheduled||(this._updateScheduled=!0,setTimeout(function(){this._updateScheduled=!1,this.sendEvents()}.bind(this),this.options.eventUploadPeriodMillis)),!1):(this.sendEvents(),!0))},he.prototype._getFromStorage=function(e,t){return e.getItem(t+this._storageSuffix)},he.prototype._setInStorage=function(e,t,n){e.setItem(t+this._storageSuffix,n)};var ge=function(e){if(e._useOldCookie){var t=e.cookieStorage.get(e._oldCookiename);"object"!==m(t)||ye(e,t)}else{var n=e._metadataStorage.load();"object"===m(n)&&ye(e,n)}},me=function(e){var t=e.cookieStorage.get(e._oldCookiename);"object"===m(t)&&(ye(e,t),_e(e))},ye=function(e,t){t.deviceId&&(e.options.deviceId=t.deviceId),t.userId&&(e.options.userId=t.userId),null!==t.optOut&&void 0!==t.optOut&&!1!==t.optOut&&(e.options.optOut=t.optOut),t.sessionId&&(e._sessionId=parseInt(t.sessionId,10)),t.lastEventTime&&(e._lastEventTime=parseInt(t.lastEventTime,10)),t.eventId&&(e._eventId=parseInt(t.eventId,10)),t.identifyId&&(e._identifyId=parseInt(t.identifyId,10)),t.sequenceNumber&&(e._sequenceNumber=parseInt(t.sequenceNumber,10))},_e=function(e){var t={deviceId:e.options.deviceId,userId:e.options.userId,optOut:e.options.optOut,sessionId:e._sessionId,lastEventTime:e._lastEventTime,eventId:e._eventId,identifyId:e._identifyId,sequenceNumber:e._sequenceNumber};e._useOldCookie?e.cookieStorage.set(e.options.cookieName+e._storageSuffix,t):e._metadataStorage.save(t)};he.prototype._initUtmData=function(e,t){e=e||this._getUrlParams(),t=t||this.cookieStorage.get("__utmz");var n,i,o,r,s,a,u,c,p,l,d,h=(i=e,o=(n=t)?"?"+n.split(".").slice(-1)[0].replace(/|/g,"&"):"",s=(r=function(e,t,n,i){return E(e,t)||E(n,i)})(g.UTM_SOURCE,i,"utmcsr",o),a=r(g.UTM_MEDIUM,i,"utmcmd",o),u=r(g.UTM_CAMPAIGN,i,"utmccn",o),c=r(g.UTM_TERM,i,"utmctr",o),p=r(g.UTM_CONTENT,i,"utmcct",o),l={},(d=function(e,t){b(t)||(l[e]=t)})(g.UTM_SOURCE,s),d(g.UTM_MEDIUM,a),d(g.UTM_CAMPAIGN,u),d(g.UTM_TERM,c),d(g.UTM_CONTENT,p),l);we(this,h)},he.prototype._unsetUTMParams=function(){var e=new $;e.unset(g.REFERRER),e.unset(g.UTM_SOURCE),e.unset(g.UTM_MEDIUM),e.unset(g.UTM_CAMPAIGN),e.unset(g.UTM_TERM),e.unset(g.UTMCONTENT),this.identify(e)};var we=function(e,t){if("object"===m(t)&&0!==Object.keys(t).length){var n=new $;for(var i in t)t.hasOwnProperty(i)&&(n.setOnce("initial"+i,t[i]),n.set(i,t[i]));e.identify(n)}};he.prototype._getReferrer=function(){return document.referrer},he.prototype._getUrlParams=function(){return location.search},he.prototype._saveGclid=function(e){var t=E("gclid",e);b(t)||we(this,{gclid:t})},he.prototype._getDeviceIdFromUrlParam=function(e){return E(g.AMP_DEVICE_ID_PARAM,e)},he.prototype._getReferringDomain=function(e){if(b(e))return null;var t=e.split("/");return 3<=t.length?t[2]:null},he.prototype._saveReferrer=function(e){if(!b(e)){var t={referrer:e,referring_domain:this._getReferringDomain(e)};we(this,t)}},he.prototype.saveEvents=function(){try{var e=JSON.stringify(this._unsentEvents.map(function(e){return e.event}));this._setInStorage(B,this.options.unsentKey,e)}catch(e){}try{var t=JSON.stringify(this._unsentIdentifys.map(function(e){return e.event}));this._setInStorage(B,this.options.unsentIdentifyKey,t)}catch(e){}},he.prototype.setDomain=function(e){if(this._shouldDeferCall())return this._q.push(["setDomain"].concat(Array.prototype.slice.call(arguments,0)));if(T(e,"domain","string"))try{this.cookieStorage.options({expirationDays:this.options.cookieExpiration,secure:this.options.secureCookie,domain:e,sameSite:this.options.sameSiteCookie}),this.options.domain=this.cookieStorage.options().domain,ge(this),_e(this)}catch(e){I.error(e)}},he.prototype.setUserId=function(e){if(this._shouldDeferCall())return this._q.push(["setUserId"].concat(Array.prototype.slice.call(arguments,0)));try{this.options.userId=null!=e&&""+e||null,_e(this)}catch(e){I.error(e)}},he.prototype.setGroup=function(e,t){if(this._shouldDeferCall())return this._q.push(["setGroup"].concat(Array.prototype.slice.call(arguments,0)));if(this._apiKeySet("setGroup()")&&T(e,"groupType","string")&&!b(e)){var n={};n[e]=t;var i=(new $).set(e,t);this._logEvent(g.IDENTIFY_EVENT,null,null,i.userPropertiesOperations,n,null,null,null)}},he.prototype.setOptOut=function(e){if(this._shouldDeferCall())return this._q.push(["setOptOut"].concat(Array.prototype.slice.call(arguments,0)));if(T(e,"enable","boolean"))try{this.options.optOut=e,_e(this)}catch(e){I.error(e)}},he.prototype.setSessionId=function(e){if(T(e,"sessionId","number"))try{this._sessionId=e,_e(this)}catch(e){I.error(e)}},he.prototype.resetSessionId=function(){this.setSessionId((new Date).getTime())},he.prototype.regenerateDeviceId=function(){if(this._shouldDeferCall())return this._q.push(["regenerateDeviceId"].concat(Array.prototype.slice.call(arguments,0)));this.setDeviceId(A())},he.prototype.setDeviceId=function(e){if(this._shouldDeferCall())return this._q.push(["setDeviceId"].concat(Array.prototype.slice.call(arguments,0)));if(T(e,"deviceId","string"))try{b(e)||(this.options.deviceId=""+e,_e(this))}catch(e){I.error(e)}},he.prototype.setUserProperties=function(e){if(this._shouldDeferCall())return this._q.push(["setUserProperties"].concat(Array.prototype.slice.call(arguments,0)));if(this._apiKeySet("setUserProperties()")&&T(e,"userProperties","object")){var t=S(O(e));if(0!==Object.keys(t).length){var n=new $;for(var i in t)t.hasOwnProperty(i)&&n.set(i,t[i]);this.identify(n)}}},he.prototype.clearUserProperties=function(){if(this._shouldDeferCall())return this._q.push(["clearUserProperties"].concat(Array.prototype.slice.call(arguments,0)));if(this._apiKeySet("clearUserProperties()")){var e=new $;e.clearAll(),this.identify(e)}};var Ie=function(e,t){for(var n=0;n<t._q.length;n++){var i=e[t._q[n][0]];"function"===m(i)&&i.apply(e,t._q[n].slice(1))}return e};he.prototype.identify=function(e,t){if(this._shouldDeferCall())return this._q.push(["identify"].concat(Array.prototype.slice.call(arguments,0)));if(this._apiKeySet("identify()"))if("object"===m(e)&&e.hasOwnProperty("_q")&&(e=Ie(new $,e)),e instanceof $){if(0<Object.keys(e.userPropertiesOperations).length)return this._logEvent(g.IDENTIFY_EVENT,null,null,e.userPropertiesOperations,null,null,null,t);"function"===m(t)&&t(0,"No request sent",{reason:"No user property operations"})}else I.error("Invalid identify input type. Expected Identify object but saw "+m(e)),"function"===m(t)&&t(0,"No request sent",{reason:"Invalid identify input type"});else"function"===m(t)&&t(0,"No request sent",{reason:"API key is not set"})},he.prototype.groupIdentify=function(e,t,n,i){if(this._shouldDeferCall())return this._q.push(["groupIdentify"].concat(Array.prototype.slice.call(arguments,0)));if(this._apiKeySet("groupIdentify()"))if(T(e,"group_type","string")&&!b(e))if(null!=t)if("object"===m(n)&&n.hasOwnProperty("_q")&&(n=Ie(new $,n)),n instanceof $){if(0<Object.keys(n.userPropertiesOperations).length)return this._logEvent(g.GROUP_IDENTIFY_EVENT,null,null,null,o({},e,t),n.userPropertiesOperations,null,i);"function"===m(i)&&i(0,"No request sent",{reason:"No group property operations"})}else I.error("Invalid identify input type. Expected Identify object but saw "+m(n)),"function"===m(i)&&i(0,"No request sent",{reason:"Invalid identify input type"});else"function"===m(i)&&i(0,"No request sent",{reason:"Invalid group name"});else"function"===m(i)&&i(0,"No request sent",{reason:"Invalid group type"});else"function"===m(i)&&i(0,"No request sent",{reason:"API key is not set"})},he.prototype.setVersionName=function(e){if(this._shouldDeferCall())return this._q.push(["setVersionName"].concat(Array.prototype.slice.call(arguments,0)));T(e,"versionName","string")&&(this.options.versionName=e)},he.prototype._logEvent=function(e,t,n,i,o,r,s,a){if(ge(this),e)if(this.options.optOut)"function"===m(a)&&a(0,"No request sent",{reason:"optOut is set to true"});else try{var u;u=e===g.IDENTIFY_EVENT||e===g.GROUP_IDENTIFY_EVENT?this.nextIdentifyId():this.nextEventId();var c=this.nextSequenceNumber(),p="number"===m(s)?s:(new Date).getTime();(!this._sessionId||!this._lastEventTime||p-this._lastEventTime>this.options.sessionTimeout)&&(this._sessionId=p),this._lastEventTime=p,_e(this);var l=this._ua.browser.name,d=this._ua.browser.major,h=this._ua.os.name;i=i||{},n=v({},n||{},v({},this._apiPropertiesTrackingOptions)),t=t||{},o=o||{},r=r||{};var f={device_id:this.options.deviceId,user_id:this.options.userId,timestamp:p,event_id:u,session_id:this._sessionId||-1,event_type:e,version_name:be(this,"version_name")&&this.options.versionName||null,platform:be(this,"platform")?this.options.platform:null,os_name:be(this,"os_name")&&l||null,os_version:be(this,"os_version")&&d||null,device_model:be(this,"device_model")&&h||null,device_manufacturer:(be(this,"device_manufacturer"),null),language:be(this,"language")?this.options.language:null,carrier:(be(this,"carrier"),null),api_properties:n,event_properties:S(O(t)),user_properties:S(O(i)),uuid:function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)}(),library:{name:"amplitude-js",version:le},sequence_number:c,groups:S(N(o)),group_properties:S(O(r)),user_agent:this._userAgent};return e===g.IDENTIFY_EVENT||e===g.GROUP_IDENTIFY_EVENT?(this._unsentIdentifys.push({event:f,callback:a}),this._limitEventsQueued(this._unsentIdentifys)):(this._unsentEvents.push({event:f,callback:a}),this._limitEventsQueued(this._unsentEvents)),this.options.saveEvents&&this.saveEvents(),this._sendEventsIfReady(a),u}catch(e){I.error(e)}else"function"===m(a)&&a(0,"No request sent",{reason:"Missing eventType"})};var be=function(e,t){return!!e.options.trackingOptions[t]},Ee=function(e){for(var t=["city","country","dma","ip_address","region"],n={},i=0;i<t.length;i++){var o=t[i];be(e,o)||(n[o]=!1)}return n};he.prototype._limitEventsQueued=function(e){e.length>this.options.savedMaxCount&&e.splice(0,e.length-this.options.savedMaxCount)},he.prototype.logEvent=function(e,t,n){return this._shouldDeferCall()?this._q.push(["logEvent"].concat(Array.prototype.slice.call(arguments,0))):this.logEventWithTimestamp(e,t,null,n)},he.prototype.logEventWithTimestamp=function(e,t,n,i){return this._shouldDeferCall()?this._q.push(["logEventWithTimestamp"].concat(Array.prototype.slice.call(arguments,0))):this._apiKeySet("logEvent()")?T(e,"eventType","string")?b(e)?("function"===m(i)&&i(0,"No request sent",{reason:"Missing eventType"}),-1):this._logEvent(e,t,null,null,null,null,n,i):("function"===m(i)&&i(0,"No request sent",{reason:"Invalid type for eventType"}),-1):("function"===m(i)&&i(0,"No request sent",{reason:"API key not set"}),-1)},he.prototype.logEventWithGroups=function(e,t,n,i){return this._shouldDeferCall()?this._q.push(["logEventWithGroups"].concat(Array.prototype.slice.call(arguments,0))):this._apiKeySet("logEventWithGroups()")?T(e,"eventType","string")?this._logEvent(e,t,null,null,n,null,null,i):("function"===m(i)&&i(0,"No request sent",{reason:"Invalid type for eventType"}),-1):("function"===m(i)&&i(0,"No request sent",{reason:"API key not set"}),-1)};var Se=function(e){return!isNaN(parseFloat(e))&&isFinite(e)};he.prototype.logRevenueV2=function(e){if(this._shouldDeferCall())return this._q.push(["logRevenueV2"].concat(Array.prototype.slice.call(arguments,0)));if(this._apiKeySet("logRevenueV2()"))if("object"===m(e)&&e.hasOwnProperty("_q")&&(e=Ie(new ue,e)),e instanceof ue){if(e&&e._isValidRevenue())return this.logEvent(g.REVENUE_EVENT,e._toJSONObject())}else I.error("Invalid revenue input type. Expected Revenue object but saw "+m(e))},he.prototype.logRevenue=function(e,t,n){return this._shouldDeferCall()?this._q.push(["logRevenue"].concat(Array.prototype.slice.call(arguments,0))):this._apiKeySet("logRevenue()")&&Se(e)&&(void 0===t||Se(t))?this._logEvent(g.REVENUE_EVENT,{},{productId:n,special:"revenue_amount",quantity:t||1,price:e},null,null,null,null,null):-1},he.prototype.removeEvents=function(e,t,n,i){Ne(this,"_unsentEvents",e,n,i),Ne(this,"_unsentIdentifys",t,n,i)};var Ne=function(e,t,n,i,o){if(!(n<0)){for(var r=[],s=0;s<e[t].length;s++){var a=e[t][s];a.event.event_id>n?r.push(a):a.callback&&a.callback(i,o)}e[t]=r}};he.prototype.sendEvents=function(){if(this._apiKeySet("sendEvents()")){if(this.options.optOut)this.removeEvents(1/0,1/0,0,"No request sent",{reason:"Opt out is set to true"});else if(0!==this._unsentCount()&&!this._sending){this._sending=!0;var e=(this.options.forceHttps?"https":"https:"===window.location.protocol?"https":"http")+"://"+this.options.apiEndpoint,n=Math.min(this._unsentCount(),this.options.uploadBatchSize),t=this._mergeEventsAndIdentifys(n),i=t.maxEventId,o=t.maxIdentifyId,r=JSON.stringify(t.eventsToSend.map(function(e){return e.event})),s=(new Date).getTime(),a={client:this.options.apiKey,e:r,v:g.API_VERSION,upload_time:s,checksum:H(g.API_VERSION+this.options.apiKey+r+s)},u=this;new ae(e,a).send(function(e,t){u._sending=!1;try{200===e&&"success"===t?(u.removeEvents(i,o,e,t),u.options.saveEvents&&u.saveEvents(),u._sendEventsIfReady()):413===e&&(1===u.options.uploadBatchSize&&u.removeEvents(i,o,e,t),u.options.uploadBatchSize=Math.ceil(n/2),u.sendEvents())}catch(e){}})}}else this.removeEvents(1/0,1/0,0,"No request sent",{reason:"API key not set"})},he.prototype._mergeEventsAndIdentifys=function(e){for(var t=[],n=0,i=-1,o=0,r=-1;t.length<e;){var s=void 0,a=o>=this._unsentIdentifys.length,u=n>=this._unsentEvents.length;if(u&&a){I.error("Merging Events and Identifys, less events and identifys than expected");break}a?i=(s=this._unsentEvents[n++]).event.event_id:u?r=(s=this._unsentIdentifys[o++]).event.event_id:!("sequence_number"in this._unsentEvents[n].event)||this._unsentEvents[n].event.sequence_number<this._unsentIdentifys[o].event.sequence_number?i=(s=this._unsentEvents[n++]).event.event_id:r=(s=this._unsentIdentifys[o++]).event.event_id,t.push(s)}return{eventsToSend:t,maxEventId:i,maxIdentifyId:r}},he.prototype.setGlobalUserProperties=function(e){this.setUserProperties(e)},he.prototype.VERSION=le,he.prototype._shouldDeferCall=function(){return this._pendingReadStorage||this._initializationDeferred},he.prototype._deferInitialization=function(){this._initializationDeferred=!0,this._q.push(["init"].concat(Array.prototype.slice.call(arguments,0)))},he.prototype.enableTracking=function(){this._initializationDeferred=!1,_e(this),this.runQueuedFunctions()};var Te=function(){this.options=v({},de),this._q=[],this._instances={}};Te.prototype.Identify=$,Te.prototype.Revenue=ue,Te.prototype.getInstance=function(e){e=b(e)?g.DEFAULT_INSTANCE:e.toLowerCase();var t=this._instances[e];return void 0===t&&(t=new he(e),this._instances[e]=t),t},Te.prototype.runQueuedFunctions=function(){for(var e=0;e<this._q.length;e++){var t=this[this._q[e][0]];"function"===m(t)&&t.apply(this,this._q[e].slice(1))}for(var n in this._q=[],this._instances)this._instances.hasOwnProperty(n)&&this._instances[n].runQueuedFunctions()},Te.prototype.init=function(e,t,n,i){this.getInstance().init(e,t,n,function(e){this.options=e.options,"function"===m(i)&&i(e)}.bind(this))},Te.prototype.isNewSession=function(){return this.getInstance().isNewSession()},Te.prototype.getSessionId=function(){return this.getInstance().getSessionId()},Te.prototype.nextEventId=function(){return this.getInstance().nextEventId()},Te.prototype.nextIdentifyId=function(){return this.getInstance().nextIdentifyId()},Te.prototype.nextSequenceNumber=function(){return this.getInstance().nextSequenceNumber()},Te.prototype.saveEvents=function(){this.getInstance().saveEvents()},Te.prototype.setDomain=function(e){this.getInstance().setDomain(e)},Te.prototype.setUserId=function(e){this.getInstance().setUserId(e)},Te.prototype.setGroup=function(e,t){this.getInstance().setGroup(e,t)},Te.prototype.setOptOut=function(e){this.getInstance().setOptOut(e)},Te.prototype.regenerateDeviceId=function(){this.getInstance().regenerateDeviceId()},Te.prototype.setDeviceId=function(e){this.getInstance().setDeviceId(e)},Te.prototype.setUserProperties=function(e){this.getInstance().setUserProperties(e)},Te.prototype.clearUserProperties=function(){this.getInstance().clearUserProperties()},Te.prototype.identify=function(e,t){this.getInstance().identify(e,t)},Te.prototype.setVersionName=function(e){this.getInstance().setVersionName(e)},Te.prototype.logEvent=function(e,t,n){return this.getInstance().logEvent(e,t,n)},Te.prototype.logEventWithGroups=function(e,t,n,i){return this.getInstance().logEventWithGroups(e,t,n,i)},Te.prototype.logRevenueV2=function(e){return this.getInstance().logRevenueV2(e)},Te.prototype.logRevenue=function(e,t,n){return this.getInstance().logRevenue(e,t,n)},Te.prototype.removeEvents=function(e,t){this.getInstance().removeEvents(e,t)},Te.prototype.sendEvents=function(e){this.getInstance().sendEvents(e)},Te.prototype.setGlobalUserProperties=function(e){this.getInstance().setUserProperties(e)},Te.prototype.VERSION=le;var Oe=window.amplitude||{},ke=new Te;for(var Ae in ke._q=Oe._q||[],Oe._iq)Oe._iq.hasOwnProperty(Ae)&&(ke.getInstance(Ae)._q=Oe._iq[Ae]._q||[]);return ke.runQueuedFunctions(),ke}();

moshie commented 2 years ago

I am also experiencing the same error:

Failed to find a valid digest in the 'integrity' attribute for resource 'https://cdn.amplitude.com/libs/amplitude-8.16.0-min.gz.js' with computed SHA-384 integrity 'G5p3YHHIMhqDroi1wiIRIEJZZCcdNsFWb90cB5FCjJEkCV1NN5gal4aaJRDHU6Qy'. The resource has been blocked.