New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

analytics

Package Overview
Dependencies
Maintainers
2
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

analytics - npm Package Compare versions

Comparing version 0.7.1 to 0.7.2

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

## [0.7.2](https://github.com/DavidWells/analytics/compare/analytics@0.7.1...analytics@0.7.2) (2021-02-01)
**Note:** Version bump only for package analytics
## [0.7.1](https://github.com/DavidWells/analytics/compare/analytics@0.7.0...analytics@0.7.1) (2021-02-01)

@@ -8,0 +16,0 @@

2

dist/analytics.min.js

@@ -1,1 +0,1 @@

var _analytics=function(t){"use strict";var r=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};function o(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}var e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(n,!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e};function W(t,e,n,r,o){for(e=e.split?e.split("."):e,r=0;r<e.length;r++)t=t?t[e[r]]:o;return t===o?n:t}function n(t,e,n,r,o,i){if("undefined"!=typeof window)return 1<arguments.length?document.cookie=t+"="+encodeURIComponent(e)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(r?"; path="+r:"")+(o?"; domain="+o:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+t+"=")[1]||"").split(";")[0])}var u=n,c=n;function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(e){var n;try{void 0===(n=JSON.parse(e))&&(n=e),"true"===n&&(n=!0),"false"===n&&(n=!1),parseFloat(n)===n&&"object"!==i(n)&&(n=parseFloat(n))}catch(t){n=e}return n}var K="object"===("undefined"==typeof self?"undefined":i(self))&&self.self===self&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global.global===global&&global||void 0,l="localStorage",f="cookie",p="global",a=!1,d=function(){try{n("_c_","1");var t=-1!==document.cookie.indexOf("_c_");return n("_c_","",-1),t}catch(t){return!1}}();function h(t){return"string"==typeof t?t:t.storage}function y(t){return a&&(!t||t===l)}function g(t){return d&&(!t||t===f)}var m={getItem:function(t){if(!t)return null;var e,n=h(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});if("all"===n)return{cookie:s(u(e=t)),localStorage:s(localStorage.getItem(e)),global:K[e]||null};if(y(n)){var r=localStorage.getItem(t);if(r||n===l)return s(r)}if(g(n)){var o=u(t);if(o||n===f)return s(o)}return K[t]||null},setItem:function(t,e){if(!t||!e)return!1;var n=h(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}),r=JSON.stringify(e);if(y(n)){var o=s(localStorage.getItem(t));return localStorage.setItem(t,r),{value:e,oldValue:o,location:l}}if(g(n)){var i=s(u(t));return c(t,r),{value:e,oldValue:i,location:f}}var a=K[t];return{value:K[t]=e,oldValue:a,location:p}},removeItem:function(t){if(!t)return!1;var e=h(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});return y(e)?(localStorage.removeItem(t),l):g(e)?(n(t,"",-1),f):(K[t]=void 0,p)}};function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Q(t){return"function"==typeof t}function Z(t){return"string"==typeof t}function tt(t){if("object"===v(t)&&null!==t){for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}}function b(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}var et="undefined"!=typeof document;function nt(t){return function(t){var e,n={},r=/([^&=]+)=?([^&]*)/g;for(;e=r.exec(t);){var o=b(e[1]),i=b(e[2]);"[]"===o.substring(o.length-2)?(o=o.substring(0,o.length-2),(n[o]||(n[o]=[])).push(i)):n[o]=""===i||i}for(var a in n){var u=a.split("[");1<u.length&&(function(t,e,n){for(var r=e.length-1,o=0;o<r;++o){var i=e[o];i in t||(t[i]={}),t=t[i]}t[e[r]]=n}(n,u.map(function(t){return t.replace(/[?[\]\\ ]/g,"")}),n[a]),delete n[a])}return n}(function(t){if(t){var e=t.match(/\?(.*)/);return e&&e[1]?e[1].split("#")[0]:""}return et&&window.location.search.substring(1)}(t))}function rt(){for(var t="",e=0,n=4294967295*Math.random()|0;e++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[e-1],o=15&n;t+="-"==r||"4"==r?r:("x"==r?o:3&o|8).toString(16),n=e%8==0?4294967295*Math.random()|0:n>>4}return t}var w=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}};var x=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var S=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var ot=function(t){return w(t)||x(t)||S()};function E(t,e){return t(e={exports:{}},e.exports),e.exports}var it=E(function(e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(t){return n(t)}:e.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(t)}e.exports=r}),at=E(function(t){var e=function(a){var f,t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function i(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i,a,u,c,o=e&&e.prototype instanceof v?e:v,s=Object.create(o.prototype),l=new k(r||[]);return s._invoke=(i=t,a=n,u=l,c=d,function(t,e){if(c===y)throw new Error("Generator is already running");if(c===g){if("throw"===t)throw e;return _()}for(u.method=t,u.arg=e;;){var n=u.delegate;if(n){var r=function t(e,n){var r=e.iterator[n.method];if(r===f){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=f,t(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=p(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=f),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}(n,u);if(r){if(r===m)continue;return r}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(c===d)throw c=g,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c=y;var o=p(i,a,u);if("normal"===o.type){if(c=u.done?g:h,o.arg===m)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c=g,u.method="throw",u.arg=o.arg)}}),s}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var d="suspendedStart",h="suspendedYield",y="executing",g="completed",m={};function v(){}function c(){}function s(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,x=w&&w(w(j([])));x&&x!==t&&l.call(x,o)&&(b=x);var S=s.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function I(c,s){var e;this._invoke=function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,o){var i=p(c[t],c,n);if("throw"!==i.type){var a=i.arg,u=a.value;return u&&"object"==typeof u&&l.call(u,"__await")?s.resolve(u.__await).then(function(t){e("next",t,r,o)},function(t){e("throw",t,r,o)}):s.resolve(u).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,o)})}o(i.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function j(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=f,t.done=!0,t};return r.next=r}}return{next:_}}function _(){return{value:f,done:!0}}return((c.prototype=S.constructor=s).constructor=c).displayName=i(s,r,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===c||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,i(t,r,"GeneratorFunction")),t.prototype=Object.create(S),t},a.awrap=function(t){return{__await:t}},E(I.prototype),I.prototype[n]=function(){return this},a.AsyncIterator=I,a.async=function(t,e,n,r,o){void 0===o&&(o=Promise);var i=new I(u(t,e,n,r),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},E(S),i(S,r,"Generator"),S[o]=function(){return this},S.toString=function(){return"[object Generator]"},a.keys=function(n){var r=[];for(var t in n)r.push(t);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=j,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=f,this.done=!1,this.delegate=null,this.method="next",this.arg=f,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=f)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return i.type="throw",i.arg=n,r.next=t,e&&(r.method="next",r.arg=f),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=l.call(o,"catchLoc"),u=l.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r,o=n.completion;return"throw"===o.type&&(r=o.arg,P(n)),r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:j(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=f),m}},a}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});function I(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}var ut=function(u){return function(){var t=this,a=arguments;return new Promise(function(e,n){var r=u.apply(t,a);function o(t){I(r,e,n,o,i,"next",t)}function i(t){I(r,e,n,o,i,"throw",t)}o(void 0)})}};var O=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};function P(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}var ct=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(n,!0).forEach(function(t){O(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e},k="function",j="undefined",_="reducer",A="@@redux/",N=A+"INIT",T=A+Math.random().toString(36),L=function(){return("undefined"==typeof Symbol?"undefined":it(Symbol))===k&&Symbol.observable||"@@observable"}(),z=" != "+k;function st(t,e,n){if(it(e)===k&&it(n)===j&&(n=e,e=void 0),it(n)!==j){if(it(n)!==k)throw new Error("enhancer"+z);return n(st)(t,e)}if(it(t)!==k)throw new Error(_+z);var r=t,o=e,i=[],a=i,u=!1;function c(){a===i&&(a=i.slice())}function s(){return o}function l(e){if(it(e)!==k)throw new Error("Listener"+z);var n=!0;return c(),a.push(e),function(){var t;n&&(n=!1,c(),t=a.indexOf(e),a.splice(t,1))}}function f(t){if(!tt(t))throw new Error("Act != obj");if(it(t.type)===j)throw new Error("ActType "+j);if(u)throw new Error("Dispatch in "+_);try{u=!0,o=r(o,t)}finally{u=!1}for(var e=i=a,n=0;n<e.length;n++){(0,e[n])()}return t}return f({type:N}),O({dispatch:f,subscribe:l,getState:s,replaceReducer:function(t){if(it(t)!==k)throw new Error("next "+_+z);r=t,f({type:N})}},L,function(){var n=l;return O({subscribe:function(t){if("object"!==it(t))throw new TypeError("Observer != obj");function e(){t.next&&t.next(o)}return e(),{unsubscribe:n(e)}}},L,function(){return this})})}function lt(t){for(var e=Object.keys(t),y={},n=0;n<e.length;n++){var r=e[n];it(t[r])===k&&(y[r]=t[r])}var g,o,m=Object.keys(y);try{o=y,Object.keys(o).forEach(function(t){var e=o[t],n=e(void 0,{type:N});if(it(n)===j||it(e(void 0,{type:T}))===j)throw new Error(_+" "+t+" "+j)})}catch(t){g=t}return function(t,e){var n=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length?e:void 0;if(g)throw g;for(var o,i,a,u=!1,c={},s=0;s<m.length;s++){var l=m[s],f=y[l],p=n[l],d=f(p,r);if(it(d)===j){var h=(o=l,a=void 0,"action "+((a=(i=r)&&i.type)&&a.toString()||"?")+_+" "+o+" returns "+j);throw new Error(h)}c[l]=d,u=u||d!==p}return u?c:n}}function ft(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce(function(t,e){return function(){return t(e.apply(void 0,arguments))}})}var pt=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],dt=["name","EVENTS","config","loaded"],ht=pt.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:".concat(t)},pluginReadyType:function(t){return"ready:".concat(t)}});var M="analytics",yt="userId",gt="anonymousId",mt="https://lytics.dev/errors/",D="__",vt=D+"anon_id",bt=D+"user_id",wt=D+"user_traits",C=Object.freeze({ANON_ID:vt,USER_ID:bt,USER_TRAITS:wt}),xt=/^utm_/,St=/^an_prop_/,Et=/^an_trait_/;function It(t){return{userId:t.getItem(bt),anonymousId:t.getItem(vt),traits:t.getItem(wt)||{}}}var Ot=function(t){return D+"TEMP"+D+t};var q={};function R(t,e){q[t]&&Q(q[t])&&(q[t](e),delete q[t])}function V(o,i,a){return new Promise(function(e,n){return i()?e(o):a<1?n(ct(ct({},o),{},{queue:!0})):(r=10,new Promise(function(t){return setTimeout(t,r)}).then(function(t){return V(o,i,a-10).then(e,n)}));var r})}function U(u,t,c){var n,e,s=t(),r=u.getState(),l=r.plugins,o=r.context,f=r.queue,p=r.user;!o.offline&&f&&f.actions&&f.actions.length&&((n=f.actions.reduce(function(t,e,n){return l[e.plugin].loaded?(t.process.push(e),t.processIndex.push(n)):(t.requeue.push(e),t.requeueIndex.push(n)),t},{processIndex:[],process:[],requeue:[],requeueIndex:[]})).processIndex&&n.processIndex.length&&(n.processIndex.forEach(function(t){var e,n,r=f.actions[t],o=r.plugin,i=r.payload.type,a=s[o][i];a&&Q(a)&&(a({payload:e=function(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return[yt,gt].reduce(function(t,e){return n.hasOwnProperty(e)&&r[e]&&r[e]!==n[e]&&(t[e]=r[e]),t},n)}(r.payload,p),config:l[o].config,instance:c}),n="".concat(i,":").concat(o),u.dispatch(ct(ct({},e),{},{type:n,_:{called:n,from:"queueDrain"}})))}),e=f.actions.filter(function(t,e){return!~n.processIndex.indexOf(e)}),f.actions=e))}var F=function(t){if(Array.isArray(t))return t};var G=function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n};var $=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var B=function(t,e){return F(t)||G(t,e)||$()};var J=/Start$/,X=/^bootstrap/,Y=/^ready/;function H(){return(H=ut(at.mark(function t(n,e,r,o,i){var a,u,c,s,l,f,p,d,h,y,g;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=Q(e)?e():e,u=n.type,c=u.replace(J,""),n._&&n._.called)return t.abrupt("return",n);t.next=5;break;case 5:return s=r.getState(),l=function(e,t,n){var r=1<arguments.length&&void 0!==t?t:{},o=2<arguments.length&&void 0!==n?n:{};return Object.keys(e).filter(function(t){var e=o.plugins||{};return"boolean"==typeof e[t]?e[t]:!1!==e.all&&(!r[t]||!1!==r[t].enabled)}).map(function(t){return e[t]})}(a,s.plugins,n.options),u===ht.initializeStart&&n.fromEnable&&(l=Object.keys(s.plugins).filter(function(t){var e=s.plugins[t];return n.plugins.includes(t)&&!e.initialized}).map(function(t){return a[t]})),f=l.map(function(t){return t.name}),p=function(c,s){var t=Nt(c).map(function(t){return At(t,s)});return s.reduce(function(t,e){var n=e.name,r=Nt(c,n).map(function(t){return At(t,s)}),o=B(r,3),i=o[0],a=o[1],u=o[2];return i.length&&(t.beforeNS[n]=i),a.length&&(t.duringNS[n]=a),u.length&&(t.afterNS[n]=u),t},{before:t[0],beforeNS:{},during:t[1],duringNS:{},after:t[2],afterNS:{}})}(u,l),t.next=12,Pt({action:n,data:{exact:p.before,namespaced:p.beforeNS},state:s,allPlugins:a,allMatches:p,instance:r,store:o,EVENTS:i});case 12:if(Lt(d=t.sent,f.length))return t.abrupt("return",d);t.next=15;break;case 15:if(u!==c){t.next=19;break}h=d,t.next=22;break;case 19:return t.next=21,Pt({action:ct(ct({},d),{},{type:c}),data:{exact:p.during,namespaced:p.duringNS},state:s,allPlugins:a,allMatches:p,instance:r,store:o,EVENTS:i});case 21:h=t.sent;case 22:if(u.match(J))return y="".concat(c,"End"),t.next=26,Pt({action:ct(ct({},h),{},{type:y}),data:{exact:p.after,namespaced:p.afterNS},state:s,allPlugins:a,allMatches:p,instance:r,store:o,EVENTS:i});t.next=28;break;case 26:(g=t.sent).meta&&g.meta.hasCallback&&R(g.meta.rid,{payload:g});case 28:return t.abrupt("return",d);case 29:case"end":return t.stop()}},t)}))).apply(this,arguments)}function Pt(){return kt.apply(this,arguments)}function kt(){return(kt=ut(at.mark(function t(e){var g,a,m,n,v,r,b,o,w,i,x,S,u,E,I,O,c,s;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return g=e.data,a=e.action,m=e.instance,n=e.state,v=e.allPlugins,r=e.allMatches,b=e.store,o=e.EVENTS,w=n.plugins,i=n.context,x=a.type,S=x.match(J),u=g.exact.map(function(t){return t.pluginName}),S&&(u=r.during.map(function(t){return t.pluginName})),E=function(y,g){return function(t,e,n){var r=e.config,o=e.name,i="".concat(o,".").concat(t.type);n&&(i=n.event);var a,u,c,s,l,f,p,d,h=t.type.match(J)?(c=o,s=i,l=g,f=n,p=t,function(t,e){var n=f?f.name:c,r=e&&zt(e)?e:l;if(f&&(!(r=e&&zt(e)?e:[c]).includes(c)||1!==r.length))throw new Error("Method ".concat(s," can only abort ").concat(c," plugin. ").concat(JSON.stringify(r)," input valid"));return ct(ct({},p),{},{abort:{reason:t,plugins:r,caller:s,_:n}})}):(a=t,u=i,function(){throw new Error(a.type+" action not cancellable. Remove abort in "+u)});return{payload:(d=t,Object.keys(d).reduce(function(t,e){return"type"===e||(tt(d[e])?t[e]=Object.assign({},d[e]):t[e]=d[e]),t},{})),instance:y,config:r||{},abort:h}}}(m,u),I=g.exact.reduce(function(t,e){var n=e.pluginName,r=e.methodName,o=!1;return r.match(/^initialize/)||r.match(/^reset/)||(o=!w[n].loaded),i.offline&&r.match(/^(page|track|identify)/)&&(o=!0),t["".concat(n)]=o,t},{}),t.next=10,g.exact.reduce(function(){var r=ut(at.mark(function t(e,n,r){var c,o,i;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return c=n.pluginName,t.next=3,e;case 3:if(o=t.sent,g.namespaced&&g.namespaced[c])return t.next=7,g.namespaced[c].reduce(function(){var r=ut(at.mark(function t(e,n,r){var o,i,a,u;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=function(r,o,i){return function(t,e){var n=i||o;return ct(ct({},r),{},{abort:{reason:t,plugins:e||[o],caller:x,from:n}})}},t.next=3,e;case 3:if(o=t.sent,n.method&&Q(n.method)){t.next=6;break}return t.abrupt("return",o);case 6:return function(t,e){var n=Dt(t);if(n&&n.name===e){var r=Dt(n.method),o=r?"or "+r.method:"";throw new Error([e+" plugin is calling method "+t,"Plugins cant call self","Use ".concat(n.method," ").concat(o," in ").concat(e," plugin insteadof ").concat(t)].join("\n"))}}(n.methodName,n.pluginName),t.next=9,n.method({payload:o,instance:m,abort:i(o,c,n.pluginName),config:_t(n.pluginName,w,v),plugins:w});case 9:return a=t.sent,u=tt(a)?a:{},t.abrupt("return",Promise.resolve(ct(ct({},o),u)));case 12:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve(a));t.next=11;break;case 7:i=t.sent,o[c]=i,t.next=12;break;case 11:o[c]=a;case 12:return t.abrupt("return",Promise.resolve(o));case 13:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve({}));case 10:return O=t.sent,t.next=13,g.exact.reduce(function(){var r=ut(at.mark(function t(e,n,r){var o,i,a,u,c,s,l,f,p,d,h,y;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=g.exact.length===r+1,i=n.pluginName,a=v[i],t.next=5,e;case 5:if(u=t.sent,c=O[i]?O[i]:{},S&&(c=u),Tt(c,i))return jt({data:c,method:x,instance:m,pluginName:i,store:b}),t.abrupt("return",Promise.resolve(u));t.next=11;break;case 11:if(Tt(u,i))return o&&jt({data:u,method:x,instance:m,store:b}),t.abrupt("return",Promise.resolve(u));t.next=14;break;case 14:if(I.hasOwnProperty(i)&&!0===I[i])return b.dispatch({type:"queue",plugin:i,payload:c,_:{called:"queue",from:"queueMechanism"}}),t.abrupt("return",Promise.resolve(u));t.next=17;break;case 17:return s=E(O[i],v[i]),t.next=20,a[x]({abort:s.abort,payload:c,instance:m,config:_t(i,w,v),plugins:w});case 20:return l=t.sent,f=tt(l)?l:{},p=ct(ct({},u),f),Tt(d=O[i],i)?jt({data:d,method:x,instance:m,pluginName:i,store:b}):(h="".concat(x,":").concat(i),(h.match(/:/g)||[]).length<2&&!x.match(X)&&!x.match(Y)&&(y=S?p:c,m.dispatch(ct(ct({},y),{},{type:h,_:{called:h,from:"submethod"}})))),t.abrupt("return",Promise.resolve(p));case 26:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve(a));case 13:if(c=t.sent,x.match(J)||x.match(/^registerPlugin/)||x.match(Y)||x.match(X)||x.match(/^params/)||x.match(/^userIdChanged/)){t.next=21;break}if(o.plugins.includes(x),c._&&c._.originalAction===x)return t.abrupt("return",c);t.next=18;break;case 18:s=ct(ct({},c),{_:{originalAction:c.type,called:c.type,from:"engineEnd"}}),Lt(c,g.exact.length)&&!x.match(/End$/)&&(s=ct(ct({},s),{type:c.type+"Aborted"})),b.dispatch(s);case 21:return t.abrupt("return",c);case 22:case"end":return t.stop()}},t)}))).apply(this,arguments)}function jt(t){var e=t.data,n=t.method,r=(t.instance,t.pluginName),o=n+"Aborted"+(r?":"+r:"");t.store.dispatch(ct(ct({},e),{},{type:o,_:{called:o,from:"abort"}}))}function _t(t,e,n){var r=e[t]||n[t];return r&&r.config?r.config:{}}function At(n,t){return t.reduce(function(t,e){return e[n]?t.concat({methodName:n,pluginName:e.name,method:e[n]}):t},[])}function Nt(t,e){var n=t.replace(J,""),r=e?":".concat(e):"";return["".concat(t).concat(r),"".concat(n).concat(r),"".concat(n,"End").concat(r)]}function Tt(t,e){var n=t.abort;return n&&(!0===n||(Mt(n,e)||n&&Mt(n.plugins,e)))}function Lt(t,e){var n=t.abort;if(n){if(!0===n||Z(n))return 1;var r=n.plugins;return zt(n)&&n.length===e||zt(r)&&r.length===e}}function zt(t){return Array.isArray(t)}function Mt(t,e){return!(!t||!zt(t))&&t.includes(e)}function Dt(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function Ct(g,m,v){var b={};return function(y){return function(h){return function(){var e=ut(at.mark(function t(e){var n,r,o,i,a,u,c,s,l,f,p,d;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.type,r=e.abort,o=e.plugins,i=e,r)return t.abrupt("return",h(e));t.next=4;break;case 4:if(n===ht.enablePlugin&&y.dispatch({type:ht.initializeStart,plugins:o,disabled:[],fromEnable:!0,meta:e.meta}),n===ht.disablePlugin&&setTimeout(function(){return R(e.meta.rid,{payload:e})},0),n===ht.initializeEnd&&(a=m(),u=Object.keys(a),c=u.filter(function(t){return o.includes(t)}).map(function(t){return a[t]}),s=[],l=[],f=e.disabled,p=c.map(function(e){var t=e.loaded,n=e.name;return V(e,t,1e4).then(function(t){return b[n]||(y.dispatch({type:ht.pluginReadyType(n),name:n,events:Object.keys(e).filter(function(t){return!dt.includes(t)})}),b[n]=!0),s=s.concat(n),e}).catch(function(t){if(t instanceof Error)throw new Error(t);return l=l.concat(t.name),t})}),Promise.all(p).then(function(t){var e={plugins:s,failed:l,disabled:f};setTimeout(function(){u.length===p.length+f.length&&y.dispatch(ct(ct({},{type:ht.ready}),e))},0)})),n!==ht.bootstrap)return/^ready:([^:]*)$/.test(n)&&setTimeout(function(){return U(y,m,g)},0),t.next=11,function(t,e,n,r,o){return H.apply(this,arguments)}(e,m,g,y,v);t.next=13;break;case 11:return d=t.sent,t.abrupt("return",h(d));case 13:return t.abrupt("return",h(i));case 14:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}()}}}var qt,Rt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Vt=function t(){var a=this;Rt(this,t),O(this,"before",[]),O(this,"after",[]),O(this,"addMiddleware",function(t,e){a[e]=a[e].concat(t)}),O(this,"removeMiddleware",function(e,t){var n=a[t].findIndex(function(t){return t===e});-1!==n&&(a[t]=[].concat(ot(a[t].slice(0,n)),ot(a[t].slice(n+1))))}),O(this,"dynamicMiddlewares",function(i){return function(o){return function(r){return function(t){var e={getState:o.getState,dispatch:function(t){return o.dispatch(t)}},n=a[i].map(function(t){return t(e)});return ft.apply(void 0,ot(n))(r)(t)}}}})};function Ut(t,e){return t.substring(e.length+1,t.length)}function Ft(t,n,r){return t.reduce(function(t,e){return t[e]=ct(ct({},r[e]),{enabled:n}),t},r)}var Gt={initialized:!(qt={}),sessionId:rt(),app:null,version:null,debug:!1,offline:!!et&&!navigator.onLine,os:{name:"na"},userAgent:et?navigator.userAgent:"node",library:{name:M,version:"0.10.0"},timezone:void 0,locale:void 0,campaign:{},referrer:qt};function $t(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Gt,e=1<arguments.length?arguments[1]:void 0,n=t.initialized,r=e.type,o=e.campaign;switch(r){case ht.campaign:return ct(ct({},t),{campaign:o});case ht.offline:return ct(ct({},t),{offline:!0});case ht.online:return ct(ct({},t),{offline:!1});default:return n?t:ct(ct(ct({},Gt),t),{initialized:!0})}}var Bt=["plugins","reducers","storage"];function Jt(t){var e=t;try{e=JSON.parse(JSON.stringify(t))}catch(t){}return e}var Xt=/#.*$/;function Yt(t){var e=function(){if(et)for(var t,e=document.getElementsByTagName("link"),n=0;t=e[n];n++)if("canonical"===t.getAttribute("rel"))return t.getAttribute("href")}();return e?e.match(/\?/)?e:e+t:window.location.href.replace(Xt,"")}var Ht=function(t){var e=0<arguments.length&&void 0!==t?t:{};if(!et)return e;var n,r=document,o=r.title,i=r.referrer,a=window,u=a.location,c=a.innerWidth,s=a.innerHeight,l=u.hash,f=u.search,p=Yt(f),d={title:o,url:p,path:"/"+((n=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(p))&&n[3]?n[3].split("?")[0].replace(Xt,""):""),hash:l,search:f,width:c,height:s};return i&&""!==i&&(d.referrer=i),ct(ct({},d),e)},Wt={last:{},history:[]};function Kt(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Wt,e=1<arguments.length?arguments[1]:void 0,n=e.properties,r=e.options,o=e.meta;switch(e.type){case ht.page:var i=Jt(ct({properties:n,meta:o},Object.keys(r).length&&{options:r}));return ct(ct({},t),{last:i,history:t.history.concat(i)});default:return t}}var Qt={last:{},history:[]};function Zt(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Qt,e=1<arguments.length?arguments[1]:void 0,n=e.type,r=e.meta,o=e.options,i=e.event,a=e.properties;switch(n){case ht.track:var u=Jt(ct(ct({event:i,properties:a},Object.keys(o).length&&{options:o}),{},{meta:r}));return ct(ct({},t),{last:u,history:t.history.concat(u)});default:return t}}var te={actions:[]};function ee(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:te,e=1<arguments.length?arguments[1]:void 0,n=e.type,r=e.payload;switch(n){case"queue":var o=r&&r.type&&r.type===ht.identify?[e].concat(t.actions):t.actions.concat(e);return ct(ct({},t),{},{actions:o});case"dequeue":return[];default:return t}}function ne(){var a=D+M+D;return K[a]=[],function(i){return function(t,e,n){var r=i(t,e,n),o=r.dispatch;return Object.assign(r,{dispatch:function(t){var e=t.action||t;return K[a].push(e),o(t)}})}}}function re(){return function(){return ft(ft.apply(null,arguments),ne())}}function oe(t){return t?(e=t,Array.isArray(e)?t:[t]):[];var e}function ie(t,e,n){var r,o,i=0<arguments.length&&void 0!==t?t:{},a=1<arguments.length?e:void 0,u=2<arguments.length?n:void 0,c=rt();return a&&(q[c]=(r=a,o=function(t){return(t||Array.prototype.slice.call(arguments)).reduce(function(t,e){return t||(Q(e)?e:t)},!1)}(u),function(t){o&&o(t),r(t)})),ct(ct({},i),{},{rid:c,ts:(new Date).getTime()},a?{hasCallback:!0}:{})}function ae(t){function e(){return s}function u(){throw new Error("Abort disabled inListener")}var i,n=0<arguments.length&&void 0!==t?t:{},r=n.reducers||{},o=n.initialUser||{},a=(n.plugins||[]).reduce(function(t,n){if(Q(n))return t.middlewares=t.middlewares.concat(n),t;if(n.NAMESPACE&&(n.name=n.NAMESPACE),!n.name)throw new Error(mt+"1");var e=n.EVENTS?Object.keys(n.EVENTS).map(function(t){return n.EVENTS[t]}):[],r=!(!1===n.enabled),o=!(n.config&&!1===n.config.enabled);t.pluginEnabled[n.name]=r&&o,delete n.enabled,n.methods&&(t.methods[n.name]=Object.keys(n.methods).reduce(function(t,e){var r;return t[e]=(r=n.methods[e],function(){var n=Array.prototype.slice.call(arguments),t=Array.apply(null,Array(r.length)).map(function(){}).map(function(t,e){if(n[e]||!1===n[e]||null===n[e])return n[e]}).concat(C);return r.apply({instance:C},t)}),t},{}),delete n.methods);var i=Object.keys(n).concat(e),a=new Set(t.events.concat(i));if(t.events=Array.from(a),t.pluginsArray=t.pluginsArray.concat(n),t.plugins[n.name])throw new Error(n.name+"AlreadyLoaded");return t.plugins[n.name]=n,t.plugins[n.name].loaded||(t.plugins[n.name].loaded=function(){return!0}),t},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),c=n.storage?n.storage:{getItem:function(t){return K[t]},setItem:function(t,e){return K[t]=e},removeItem:function(t){return K[t]=void 0}},l=(i=c,function(t,e,n){var r=e.getState("user")[t];if(r)return r;if(n&&tt(n)&&n[t])return n[t];var o=It(i)[t];return o||(K[Ot(t)]?K[Ot(t)]:null)}),s=a.plugins,f=a.events.filter(function(t){return!dt.includes(t)}),p=new Set(f.concat(pt).filter(function(t){return!dt.includes(t)})),d=Array.from(p).sort(),h=f.sort(),y=new Vt,g=y.addMiddleware,m=y.removeMiddleware,v=y.dynamicMiddlewares,b=nt(),w=It(c),x=ct(ct(ct(ct({},w),o),b.an_uid?{userId:b.an_uid}:{}),b.an_aid?{anonymousId:b.an_aid}:{});x.anonymousId||(x.anonymousId=rt());var S,E,I,O,P,k,j,_,A,N,T,L,z,M,D=ct({enable:function(e,n){return new Promise(function(t){J.dispatch({type:ht.enablePlugin,plugins:oe(e),_:{originalAction:ht.enablePlugin}},t,[n])})},disable:function(e,n){return new Promise(function(t){J.dispatch({type:ht.disablePlugin,plugins:oe(e),_:{originalAction:ht.disablePlugin}},t,[n])})}},a.methods),C={identify:(I=ut(at.mark(function t(e,n,r,o){var i,a,u,c,s;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=Z(e)?e:null,a=tt(e)?e:n,u=r||{},c=C.user(),K[Ot(yt)]=i,s=i||a.userId||l(yt,C,a),t.abrupt("return",new Promise(function(t){J.dispatch(ct({type:ht.identifyStart,userId:s,traits:a||{},options:u,anonymousId:c.anonymousId},c.id&&c.id!==i&&{previousId:c.id}),t,[n,r,o])}));case 7:case"end":return t.stop()}},t)})),function(t,e,n,r){return I.apply(this,arguments)}),track:(E=ut(at.mark(function t(e,n,r,o){var i,a,u;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if((i=tt(e)?e.event:e)&&Z(i)){t.next=3;break}throw new Error("EventMissing");case 3:return a=tt(e)?e:n||{},u=tt(r)?r:{},t.abrupt("return",new Promise(function(t){J.dispatch({type:ht.trackStart,event:i,properties:a,options:u,userId:l(yt,C,n),anonymousId:l(gt,C,n)},t,[n,r,o])}));case 6:case"end":return t.stop()}},t)})),function(t,e,n,r){return E.apply(this,arguments)}),page:(S=ut(at.mark(function t(n,r,o){var i,a;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=tt(n)?n:{},a=tt(r)?r:{},t.abrupt("return",new Promise(function(t,e){J.dispatch({type:ht.pageStart,properties:Ht(i),options:a,userId:l(yt,C,i),anonymousId:l(gt,C,i)},t,[n,r,o])}));case 3:case"end":return t.stop()}},t)})),function(t,e,n){return S.apply(this,arguments)}),user:function(t){if(t===yt||"id"===t)return l(yt,C);if(t===gt||"anonId"===t)return l(gt,C);var e=C.getState("user");return t?W(e,t):e},reset:function(n){return new Promise(function(t,e){J.dispatch({type:ht.resetStart},t,n)})},ready:function(t){return C.on(ht.ready,t)},on:function(n,r){if(!n||!Q(r))return!1;if(n===ht.bootstrap)throw new Error(".on disabled for "+n);var o=/Start$|Start:/;if("*"===n){var t=function(){return function(e){return function(t){return t.type.match(o)&&r({payload:t,instance:C,plugins:s}),e(t)}}},e=function(){return function(e){return function(t){return t.type.match(o)||r({payload:t,instance:C,plugins:s}),e(t)}}};return g(t,ue),g(e,ce),function(){m(t,ue),m(e,ce)}}function i(){return function(e){return function(t){return t.type===n&&r({payload:t,instance:C,plugins:s,abort:u}),e(t)}}}var a=n.match(o)?ue:ce;return g(i,a),function(){return m(i,a)}},once:function(t,n){if(!t||!Q(n))return!1;if(t===ht.bootstrap)throw new Error(".once disabled for "+t);var r=C.on(t,function(t){var e=t.payload;n({payload:e,instance:C,plugins:s,abort:u}),r()});return r},getState:function(t){var e=J.getState();return t?W(e,t):Object.assign({},e)},dispatch:function(t){var e,n=Z(t)?{type:t}:t;if(e=n.type,pt.includes(e))throw new Error("reserved action "+n.type);var r=t._||{},o=ct(ct({},n),{},{_:ct({originalAction:n.type},r)});J.dispatch(o)},enablePlugin:D.enable,disablePlugin:D.disable,plugins:D,storage:{getItem:c.getItem,setItem:function(t,e,n){J.dispatch({type:ht.setItemStart,key:t,value:e,options:n})},removeItem:function(t,e){J.dispatch({type:ht.removeItemStart,key:t,options:e})}},setAnonymousId:function(t,e){C.storage.setItem(vt,t,e)},events:{all:d,core:pt,plugins:h}},q=a.middlewares.concat([function(){return function(e){return function(t){return t.meta||(t.meta=ie()),e(t)}}},v(ue),Ct(C,e,{all:d,plugins:h}),(T=c,function(t){return function(i){return function(t){var e=t.type,n=t.key,r=t.value,o=t.options;if(e===ht.setItem||e===ht.removeItem){if(t.abort)return i(t);e===ht.setItem?T.setItem(n,r,o):T.removeItem(n,o)}return i(t)}}}),(A=(_=C).storage,N=A.setItem,A.getItem,function(s){return function(c){return function(t){var o,e,n,r,i,a,u;return t.type===ht.bootstrap&&(o=t.params,e=t.user,(n=t.persistedUser).anonymousId!==e.anonymousId&&N(vt,e.anonymousId),n.userId!==e.userId&&N(bt,e.userId),(r=Object.keys(t.params)).length&&(i=o.an_uid,a=o.an_event,u=r.reduce(function(t,e){var n,r;return(e.match(xt)||e.match(/^(d|g)clid/))&&(r="campaign"===(n=e.replace(xt,""))?"name":n,t.campaign[r]=o[e]),e.match(St)&&(t.props[e.replace(St,"")]=o[e]),e.match(Et)&&(t.traits[e.replace(Et,"")]=o[e]),t},{campaign:{},props:{},traits:{}}),s.dispatch(ct(ct({type:ht.params,raw:o},u),i?{userId:i}:{})),i&&setTimeout(function(){return _.identify(i,u.traits)},0),a&&setTimeout(function(){return _.track(a,u.props)},0),Object.keys(u.campaign).length&&s.dispatch({type:ht.campaign,campaign:u.campaign}))),c(t)}}}),(O=C.storage,P=O.setItem,k=O.removeItem,j=O.getItem,function(u){return function(a){return function(t){var e,n,r=t.userId,o=t.traits,i=t.options;return t.type===ht.reset&&([bt,wt,vt].forEach(function(t){k(t)}),[yt,gt,"traits"].forEach(function(t){K[Ot(t)]=void 0})),t.type===ht.identify&&(j(vt)||P(vt,rt()),e=j(bt),n=j(wt)||{},e&&e!==r&&u.dispatch({type:ht.userIdChanged,old:{userId:e,traits:n},new:{userId:r,traits:o},options:i}),r&&P(bt,r),o&&P(wt,ct(ct({},n),o))),a(t)}}}),v(ce)]),R={context:$t,user:(z=c,function(t,e){var n=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length&&void 0!==e?e:{};if(r.type===ht.setItemEnd){if(r.key===vt)return ct(ct({},n),{anonymousId:r.value});if(r.key===bt)return ct(ct({},n),{userId:r.value})}switch(r.type){case ht.identify:return Object.assign({},n,{userId:r.userId,traits:ct(ct({},n.traits),r.traits)});case ht.reset:return[bt,vt,wt].forEach(function(t){z.removeItem(t)}),Object.assign({},n,{userId:null,anonymousId:null,traits:{}});default:return n}}),page:Kt,track:Zt,plugins:(L=e,function(t,e){var n=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length?e:void 0,o={};if("initialize:aborted"===r.type)return n;if(/^registerPlugin:([^:]*)$/.test(r.type)){var i=Ut(r.type,"registerPlugin"),a=L()[i];if(!a||!i)return n;var u=r.enabled;return o[i]={enabled:u,initialized:!!u&&Boolean(!a.initialize),loaded:!!u&&Boolean(a.loaded()),config:a.config||{}},ct(ct({},n),o)}if(/^initialize:([^:]*)$/.test(r.type)){var c=Ut(r.type,ht.initialize),s=L()[c];return s&&c?(o[c]=ct(ct({},n[c]),{initialized:!0,loaded:Boolean(s.loaded())}),ct(ct({},n),o)):n}if(/^ready:([^:]*)$/.test(r.type))return o[r.name]=ct(ct({},n[r.name]),{loaded:!0}),ct(ct({},n),o);switch(r.type){case ht.disablePlugin:return ct(ct({},n),Ft(r.plugins,!1,n));case ht.enablePlugin:return ct(ct({},n),Ft(r.plugins,!0,n));default:return n}}),queue:ee},V=ft,U=ft;et&&n.debug&&((M=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)&&(V=M({trace:!0,traceLimit:25})),U=function(t){return 0===arguments.length?ne():tt(it(t))?re():re().apply(null,arguments)});var F,G,$=(F=n,Object.keys(F).reduce(function(t,e){return Bt.includes(e)||(t[e]=F[e]),t},{})),B={context:$,user:x,plugins:a.pluginsArray.reduce(function(t,e){var n=e.name,r=e.config,o=e.loaded,i=a.pluginEnabled[n];return t[n]={enabled:i,initialized:!!i&&Boolean(!e.initialize),loaded:Boolean(o()),config:r||{}},t},{})},J=st(lt(ct(ct({},R),r)),B,U(V(function(){for(var t=arguments.length,c=new Array(t),e=0;e<t;e++)c[e]=arguments[e];return function(u){return function(t,e,n){var r=u(t,e,n),o=r.dispatch,i={getState:r.getState,dispatch:function(t){return o(t)}},a=c.map(function(t){return t(i)}),o=ft.apply(void 0,ot(a))(r.dispatch);return ct(ct({},r),{},{dispatch:o})}}}.apply(void 0,ot(q)))));J.dispatch=(G=J.dispatch,function(t,e,n){var r=ie(t.meta,e,oe(n)),o=ct(ct({},t),{meta:r});return G.apply(null,[o])});var X=Object.keys(s);J.dispatch({type:ht.bootstrap,plugins:X,config:$,params:b,user:x,persistedUser:w});var Y=X.filter(function(t){return a.pluginEnabled[t]}),H=X.filter(function(t){return!a.pluginEnabled[t]});return J.dispatch({type:ht.registerPlugins,plugins:X,enabled:a.pluginEnabled}),a.pluginsArray.map(function(t,e){var n=t.bootstrap,r=t.config,o=t.name;n&&Q(n)&&n({instance:C,config:r,payload:t}),J.dispatch({type:ht.registerPluginType(o),name:o,enabled:a.pluginEnabled[o],plugin:t}),a.pluginsArray.length===e+1&&J.dispatch({type:ht.initializeStart,plugins:Y,disabled:H})}),C}var ue="before",ce="after";function se(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return ae(e(e({},{storage:m}),t))}return t.default=se,t.init=se,t.Analytics=se,t.EVENTS=ht,t.CONSTANTS=C,t}({});
var _analytics=function(t){"use strict";var r=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};function o(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}var e=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(n,!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e};function W(t,e,n,r,o){for(e=e.split?e.split("."):e,r=0;r<e.length;r++)t=t?t[e[r]]:o;return t===o?n:t}function n(t,e,n,r,o,i){if("undefined"!=typeof window)return 1<arguments.length?document.cookie=t+"="+encodeURIComponent(e)+(n?"; expires="+new Date(+new Date+1e3*n).toUTCString()+(r?"; path="+r:"")+(o?"; domain="+o:"")+(i?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+t+"=")[1]||"").split(";")[0])}var u=n,c=n;function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function s(e){var n;try{void 0===(n=JSON.parse(e))&&(n=e),"true"===n&&(n=!0),"false"===n&&(n=!1),parseFloat(n)===n&&"object"!==i(n)&&(n=parseFloat(n))}catch(t){n=e}return n}var K="object"===("undefined"==typeof self?"undefined":i(self))&&self.self===self&&self||"object"===("undefined"==typeof global?"undefined":i(global))&&global.global===global&&global||void 0,l="localStorage",f="cookie",p="global",a=!1,d=function(){try{n("_c_","1");var t=-1!==document.cookie.indexOf("_c_");return n("_c_","",-1),t}catch(t){return!1}}();function h(t){return"string"==typeof t?t:t.storage}function y(t){return a&&(!t||t===l)}function g(t){return d&&(!t||t===f)}var m={getItem:function(t){if(!t)return null;var e,n=h(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});if("all"===n)return{cookie:s(u(e=t)),localStorage:s(localStorage.getItem(e)),global:K[e]||null};if(y(n)){var r=localStorage.getItem(t);if(r||n===l)return s(r)}if(g(n)){var o=u(t);if(o||n===f)return s(o)}return K[t]||null},setItem:function(t,e){if(!t||!e)return!1;var n=h(2<arguments.length&&void 0!==arguments[2]?arguments[2]:{}),r=JSON.stringify(e);if(y(n)){var o=s(localStorage.getItem(t));return localStorage.setItem(t,r),{value:e,oldValue:o,location:l}}if(g(n)){var i=s(u(t));return c(t,r),{value:e,oldValue:i,location:f}}var a=K[t];return{value:K[t]=e,oldValue:a,location:p}},removeItem:function(t){if(!t)return!1;var e=h(1<arguments.length&&void 0!==arguments[1]?arguments[1]:{});return y(e)?(localStorage.removeItem(t),l):g(e)?(n(t,"",-1),f):(K[t]=void 0,p)}};function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Q(t){return"function"==typeof t}function Z(t){return"string"==typeof t}function tt(t){if("object"===v(t)&&null!==t){for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}}function b(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}var et="undefined"!=typeof document;function nt(t){return function(t){var e,n={},r=/([^&=]+)=?([^&]*)/g;for(;e=r.exec(t);){var o=b(e[1]),i=b(e[2]);"[]"===o.substring(o.length-2)?(o=o.substring(0,o.length-2),(n[o]||(n[o]=[])).push(i)):n[o]=""===i||i}for(var a in n){var u=a.split("[");1<u.length&&(function(t,e,n){for(var r=e.length-1,o=0;o<r;++o){var i=e[o];i in t||(t[i]={}),t=t[i]}t[e[r]]=n}(n,u.map(function(t){return t.replace(/[?[\]\\ ]/g,"")}),n[a]),delete n[a])}return n}(function(t){if(t){var e=t.match(/\?(.*)/);return e&&e[1]?e[1].split("#")[0]:""}return et&&window.location.search.substring(1)}(t))}function rt(){for(var t="",e=0,n=4294967295*Math.random()|0;e++<36;){var r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"[e-1],o=15&n;t+="-"==r||"4"==r?r:("x"==r?o:3&o|8).toString(16),n=e%8==0?4294967295*Math.random()|0:n>>4}return t}var w=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}};var x=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var S=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")};var ot=function(t){return w(t)||x(t)||S()};function E(t,e){return t(e={exports:{}},e.exports),e.exports}var it=E(function(e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=r=function(t){return n(t)}:e.exports=r=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},r(t)}e.exports=r}),at=E(function(t){var e=function(a){var f,t=Object.prototype,l=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function i(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i,a,u,c,o=e&&e.prototype instanceof v?e:v,s=Object.create(o.prototype),l=new k(r||[]);return s._invoke=(i=t,a=n,u=l,c=d,function(t,e){if(c===y)throw new Error("Generator is already running");if(c===g){if("throw"===t)throw e;return _()}for(u.method=t,u.arg=e;;){var n=u.delegate;if(n){var r=function t(e,n){var r=e.iterator[n.method];if(r===f){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=f,t(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=p(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=f),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}(n,u);if(r){if(r===m)continue;return r}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(c===d)throw c=g,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c=y;var o=p(i,a,u);if("normal"===o.type){if(c=u.done?g:h,o.arg===m)continue;return{value:o.arg,done:u.done}}"throw"===o.type&&(c=g,u.method="throw",u.arg=o.arg)}}),s}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}a.wrap=u;var d="suspendedStart",h="suspendedYield",y="executing",g="completed",m={};function v(){}function c(){}function s(){}var b={};b[o]=function(){return this};var w=Object.getPrototypeOf,x=w&&w(w(j([])));x&&x!==t&&l.call(x,o)&&(b=x);var S=s.prototype=v.prototype=Object.create(b);function E(t){["next","throw","return"].forEach(function(e){i(t,e,function(t){return this._invoke(e,t)})})}function I(c,s){var e;this._invoke=function(n,r){function t(){return new s(function(t,e){!function e(t,n,r,o){var i=p(c[t],c,n);if("throw"!==i.type){var a=i.arg,u=a.value;return u&&"object"==typeof u&&l.call(u,"__await")?s.resolve(u.__await).then(function(t){e("next",t,r,o)},function(t){e("throw",t,r,o)}):s.resolve(u).then(function(t){a.value=t,r(a)},function(t){return e("throw",t,r,o)})}o(i.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function j(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(l.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=f,t.done=!0,t};return r.next=r}}return{next:_}}function _(){return{value:f,done:!0}}return((c.prototype=S.constructor=s).constructor=c).displayName=i(s,r,"GeneratorFunction"),a.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===c||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,s):(t.__proto__=s,i(t,r,"GeneratorFunction")),t.prototype=Object.create(S),t},a.awrap=function(t){return{__await:t}},E(I.prototype),I.prototype[n]=function(){return this},a.AsyncIterator=I,a.async=function(t,e,n,r,o){void 0===o&&(o=Promise);var i=new I(u(t,e,n,r),o);return a.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},E(S),i(S,r,"Generator"),S[o]=function(){return this},S.toString=function(){return"[object Generator]"},a.keys=function(n){var r=[];for(var t in n)r.push(t);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},a.values=j,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=f,this.done=!1,this.delegate=null,this.method="next",this.arg=f,this.tryEntries.forEach(P),!t)for(var e in this)"t"===e.charAt(0)&&l.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=f)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var r=this;function t(t,e){return i.type="throw",i.arg=n,r.next=t,e&&(r.method="next",r.arg=f),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],i=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var a=l.call(o,"catchLoc"),u=l.call(o,"finallyLoc");if(a&&u){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return t(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&l.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),m},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),m}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r,o=n.completion;return"throw"===o.type&&(r=o.arg,P(n)),r}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:j(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=f),m}},a}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});function I(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}var ut=function(u){return function(){var t=this,a=arguments;return new Promise(function(e,n){var r=u.apply(t,a);function o(t){I(r,e,n,o,i,"next",t)}function i(t){I(r,e,n,o,i,"throw",t)}o(void 0)})}};var O=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};function P(e,t){var n,r=Object.keys(e);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(e),t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)),r}var ct=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(n,!0).forEach(function(t){O(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e},k="function",j="undefined",_="reducer",A="@@redux/",N=A+"INIT",T=A+Math.random().toString(36),L=function(){return("undefined"==typeof Symbol?"undefined":it(Symbol))===k&&Symbol.observable||"@@observable"}(),z=" != "+k;function st(t,e,n){if(it(e)===k&&it(n)===j&&(n=e,e=void 0),it(n)!==j){if(it(n)!==k)throw new Error("enhancer"+z);return n(st)(t,e)}if(it(t)!==k)throw new Error(_+z);var r=t,o=e,i=[],a=i,u=!1;function c(){a===i&&(a=i.slice())}function s(){return o}function l(e){if(it(e)!==k)throw new Error("Listener"+z);var n=!0;return c(),a.push(e),function(){var t;n&&(n=!1,c(),t=a.indexOf(e),a.splice(t,1))}}function f(t){if(!tt(t))throw new Error("Act != obj");if(it(t.type)===j)throw new Error("ActType "+j);if(u)throw new Error("Dispatch in "+_);try{u=!0,o=r(o,t)}finally{u=!1}for(var e=i=a,n=0;n<e.length;n++){(0,e[n])()}return t}return f({type:N}),O({dispatch:f,subscribe:l,getState:s,replaceReducer:function(t){if(it(t)!==k)throw new Error("next "+_+z);r=t,f({type:N})}},L,function(){var n=l;return O({subscribe:function(t){if("object"!==it(t))throw new TypeError("Observer != obj");function e(){t.next&&t.next(o)}return e(),{unsubscribe:n(e)}}},L,function(){return this})})}function lt(t){for(var e=Object.keys(t),y={},n=0;n<e.length;n++){var r=e[n];it(t[r])===k&&(y[r]=t[r])}var g,o,m=Object.keys(y);try{o=y,Object.keys(o).forEach(function(t){var e=o[t],n=e(void 0,{type:N});if(it(n)===j||it(e(void 0,{type:T}))===j)throw new Error(_+" "+t+" "+j)})}catch(t){g=t}return function(t,e){var n=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length?e:void 0;if(g)throw g;for(var o,i,a,u=!1,c={},s=0;s<m.length;s++){var l=m[s],f=y[l],p=n[l],d=f(p,r);if(it(d)===j){var h=(o=l,a=void 0,"action "+((a=(i=r)&&i.type)&&a.toString()||"?")+_+" "+o+" returns "+j);throw new Error(h)}c[l]=d,u=u||d!==p}return u?c:n}}function ft(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return 0===e.length?function(t){return t}:1===e.length?e[0]:e.reduce(function(t,e){return function(){return t(e.apply(void 0,arguments))}})}var pt=["bootstrap","params","campaign","initializeStart","initialize","initializeEnd","ready","resetStart","reset","resetEnd","pageStart","page","pageEnd","pageAborted","trackStart","track","trackEnd","trackAborted","identifyStart","identify","identifyEnd","identifyAborted","userIdChanged","registerPlugins","enablePlugin","disablePlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],dt=["name","EVENTS","config","loaded"],ht=pt.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:".concat(t)},pluginReadyType:function(t){return"ready:".concat(t)}});var M="analytics",yt="userId",gt="anonymousId",mt="https://lytics.dev/errors/",D="__",vt=D+"anon_id",bt=D+"user_id",wt=D+"user_traits",C=Object.freeze({ANON_ID:vt,USER_ID:bt,USER_TRAITS:wt}),xt=/^utm_/,St=/^an_prop_/,Et=/^an_trait_/;function It(t){return{userId:t.getItem(bt),anonymousId:t.getItem(vt),traits:t.getItem(wt)||{}}}var Ot=function(t){return D+"TEMP"+D+t};var q={};function R(t,e){q[t]&&Q(q[t])&&(q[t](e),delete q[t])}function V(o,i,a){return new Promise(function(e,n){return i()?e(o):a<1?n(ct(ct({},o),{},{queue:!0})):(r=10,new Promise(function(t){return setTimeout(t,r)}).then(function(t){return V(o,i,a-10).then(e,n)}));var r})}function U(u,t,c){var n,e,s=t(),r=u.getState(),l=r.plugins,o=r.context,f=r.queue,p=r.user;!o.offline&&f&&f.actions&&f.actions.length&&((n=f.actions.reduce(function(t,e,n){return l[e.plugin].loaded?(t.process.push(e),t.processIndex.push(n)):(t.requeue.push(e),t.requeueIndex.push(n)),t},{processIndex:[],process:[],requeue:[],requeueIndex:[]})).processIndex&&n.processIndex.length&&(n.processIndex.forEach(function(t){var e,n,r=f.actions[t],o=r.plugin,i=r.payload.type,a=s[o][i];a&&Q(a)&&(a({payload:e=function(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return[yt,gt].reduce(function(t,e){return n.hasOwnProperty(e)&&r[e]&&r[e]!==n[e]&&(t[e]=r[e]),t},n)}(r.payload,p),config:l[o].config,instance:c}),n="".concat(i,":").concat(o),u.dispatch(ct(ct({},e),{},{type:n,_:{called:n,from:"queueDrain"}})))}),e=f.actions.filter(function(t,e){return!~n.processIndex.indexOf(e)}),f.actions=e))}var F=function(t){if(Array.isArray(t))return t};var G=function(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n};var $=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var B=function(t,e){return F(t)||G(t,e)||$()};var J=/Start$/,X=/^bootstrap/,Y=/^ready/;function H(){return(H=ut(at.mark(function t(n,e,r,o,i){var a,u,c,s,l,f,p,d,h,y,g;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=Q(e)?e():e,u=n.type,c=u.replace(J,""),n._&&n._.called)return t.abrupt("return",n);t.next=5;break;case 5:return s=r.getState(),l=function(e,t,n){var r=1<arguments.length&&void 0!==t?t:{},o=2<arguments.length&&void 0!==n?n:{};return Object.keys(e).filter(function(t){var e=o.plugins||{};return"boolean"==typeof e[t]?e[t]:!1!==e.all&&(!r[t]||!1!==r[t].enabled)}).map(function(t){return e[t]})}(a,s.plugins,n.options),u===ht.initializeStart&&n.fromEnable&&(l=Object.keys(s.plugins).filter(function(t){var e=s.plugins[t];return n.plugins.includes(t)&&!e.initialized}).map(function(t){return a[t]})),f=l.map(function(t){return t.name}),p=function(c,s){var t=Nt(c).map(function(t){return At(t,s)});return s.reduce(function(t,e){var n=e.name,r=Nt(c,n).map(function(t){return At(t,s)}),o=B(r,3),i=o[0],a=o[1],u=o[2];return i.length&&(t.beforeNS[n]=i),a.length&&(t.duringNS[n]=a),u.length&&(t.afterNS[n]=u),t},{before:t[0],beforeNS:{},during:t[1],duringNS:{},after:t[2],afterNS:{}})}(u,l),t.next=12,Pt({action:n,data:{exact:p.before,namespaced:p.beforeNS},state:s,allPlugins:a,allMatches:p,instance:r,store:o,EVENTS:i});case 12:if(Lt(d=t.sent,f.length))return t.abrupt("return",d);t.next=15;break;case 15:if(u!==c){t.next=19;break}h=d,t.next=22;break;case 19:return t.next=21,Pt({action:ct(ct({},d),{},{type:c}),data:{exact:p.during,namespaced:p.duringNS},state:s,allPlugins:a,allMatches:p,instance:r,store:o,EVENTS:i});case 21:h=t.sent;case 22:if(u.match(J))return y="".concat(c,"End"),t.next=26,Pt({action:ct(ct({},h),{},{type:y}),data:{exact:p.after,namespaced:p.afterNS},state:s,allPlugins:a,allMatches:p,instance:r,store:o,EVENTS:i});t.next=28;break;case 26:(g=t.sent).meta&&g.meta.hasCallback&&R(g.meta.rid,{payload:g});case 28:return t.abrupt("return",d);case 29:case"end":return t.stop()}},t)}))).apply(this,arguments)}function Pt(){return kt.apply(this,arguments)}function kt(){return(kt=ut(at.mark(function t(e){var g,a,m,n,v,r,b,o,w,i,x,S,u,E,I,O,c,s;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return g=e.data,a=e.action,m=e.instance,n=e.state,v=e.allPlugins,r=e.allMatches,b=e.store,o=e.EVENTS,w=n.plugins,i=n.context,x=a.type,S=x.match(J),u=g.exact.map(function(t){return t.pluginName}),S&&(u=r.during.map(function(t){return t.pluginName})),E=function(y,g){return function(t,e,n){var r=e.config,o=e.name,i="".concat(o,".").concat(t.type);n&&(i=n.event);var a,u,c,s,l,f,p,d,h=t.type.match(J)?(c=o,s=i,l=g,f=n,p=t,function(t,e){var n=f?f.name:c,r=e&&zt(e)?e:l;if(f&&(!(r=e&&zt(e)?e:[c]).includes(c)||1!==r.length))throw new Error("Method ".concat(s," can only abort ").concat(c," plugin. ").concat(JSON.stringify(r)," input valid"));return ct(ct({},p),{},{abort:{reason:t,plugins:r,caller:s,_:n}})}):(a=t,u=i,function(){throw new Error(a.type+" action not cancellable. Remove abort in "+u)});return{payload:(d=t,Object.keys(d).reduce(function(t,e){return"type"===e||(tt(d[e])?t[e]=Object.assign({},d[e]):t[e]=d[e]),t},{})),instance:y,config:r||{},abort:h}}}(m,u),I=g.exact.reduce(function(t,e){var n=e.pluginName,r=e.methodName,o=!1;return r.match(/^initialize/)||r.match(/^reset/)||(o=!w[n].loaded),i.offline&&r.match(/^(page|track|identify)/)&&(o=!0),t["".concat(n)]=o,t},{}),t.next=10,g.exact.reduce(function(){var r=ut(at.mark(function t(e,n,r){var c,o,i;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return c=n.pluginName,t.next=3,e;case 3:if(o=t.sent,g.namespaced&&g.namespaced[c])return t.next=7,g.namespaced[c].reduce(function(){var r=ut(at.mark(function t(e,n,r){var o,i,a,u;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=function(r,o,i){return function(t,e){var n=i||o;return ct(ct({},r),{},{abort:{reason:t,plugins:e||[o],caller:x,from:n}})}},t.next=3,e;case 3:if(o=t.sent,n.method&&Q(n.method)){t.next=6;break}return t.abrupt("return",o);case 6:return function(t,e){var n=Dt(t);if(n&&n.name===e){var r=Dt(n.method),o=r?"or "+r.method:"";throw new Error([e+" plugin is calling method "+t,"Plugins cant call self","Use ".concat(n.method," ").concat(o," in ").concat(e," plugin insteadof ").concat(t)].join("\n"))}}(n.methodName,n.pluginName),t.next=9,n.method({payload:o,instance:m,abort:i(o,c,n.pluginName),config:_t(n.pluginName,w,v),plugins:w});case 9:return a=t.sent,u=tt(a)?a:{},t.abrupt("return",Promise.resolve(ct(ct({},o),u)));case 12:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve(a));t.next=11;break;case 7:i=t.sent,o[c]=i,t.next=12;break;case 11:o[c]=a;case 12:return t.abrupt("return",Promise.resolve(o));case 13:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve({}));case 10:return O=t.sent,t.next=13,g.exact.reduce(function(){var r=ut(at.mark(function t(e,n,r){var o,i,a,u,c,s,l,f,p,d,h,y;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=g.exact.length===r+1,i=n.pluginName,a=v[i],t.next=5,e;case 5:if(u=t.sent,c=O[i]?O[i]:{},S&&(c=u),Tt(c,i))return jt({data:c,method:x,instance:m,pluginName:i,store:b}),t.abrupt("return",Promise.resolve(u));t.next=11;break;case 11:if(Tt(u,i))return o&&jt({data:u,method:x,instance:m,store:b}),t.abrupt("return",Promise.resolve(u));t.next=14;break;case 14:if(I.hasOwnProperty(i)&&!0===I[i])return b.dispatch({type:"queue",plugin:i,payload:c,_:{called:"queue",from:"queueMechanism"}}),t.abrupt("return",Promise.resolve(u));t.next=17;break;case 17:return s=E(O[i],v[i]),t.next=20,a[x]({abort:s.abort,payload:c,instance:m,config:_t(i,w,v),plugins:w});case 20:return l=t.sent,f=tt(l)?l:{},p=ct(ct({},u),f),Tt(d=O[i],i)?jt({data:d,method:x,instance:m,pluginName:i,store:b}):(h="".concat(x,":").concat(i),(h.match(/:/g)||[]).length<2&&!x.match(X)&&!x.match(Y)&&(y=S?p:c,m.dispatch(ct(ct({},y),{},{type:h,_:{called:h,from:"submethod"}})))),t.abrupt("return",Promise.resolve(p));case 26:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve(a));case 13:if(c=t.sent,x.match(J)||x.match(/^registerPlugin/)||x.match(Y)||x.match(X)||x.match(/^params/)||x.match(/^userIdChanged/)){t.next=21;break}if(o.plugins.includes(x),c._&&c._.originalAction===x)return t.abrupt("return",c);t.next=18;break;case 18:s=ct(ct({},c),{_:{originalAction:c.type,called:c.type,from:"engineEnd"}}),Lt(c,g.exact.length)&&!x.match(/End$/)&&(s=ct(ct({},s),{type:c.type+"Aborted"})),b.dispatch(s);case 21:return t.abrupt("return",c);case 22:case"end":return t.stop()}},t)}))).apply(this,arguments)}function jt(t){var e=t.data,n=t.method,r=(t.instance,t.pluginName),o=n+"Aborted"+(r?":"+r:"");t.store.dispatch(ct(ct({},e),{},{type:o,_:{called:o,from:"abort"}}))}function _t(t,e,n){var r=e[t]||n[t];return r&&r.config?r.config:{}}function At(n,t){return t.reduce(function(t,e){return e[n]?t.concat({methodName:n,pluginName:e.name,method:e[n]}):t},[])}function Nt(t,e){var n=t.replace(J,""),r=e?":".concat(e):"";return["".concat(t).concat(r),"".concat(n).concat(r),"".concat(n,"End").concat(r)]}function Tt(t,e){var n=t.abort;return n&&(!0===n||(Mt(n,e)||n&&Mt(n.plugins,e)))}function Lt(t,e){var n=t.abort;if(n){if(!0===n||Z(n))return 1;var r=n.plugins;return zt(n)&&n.length===e||zt(r)&&r.length===e}}function zt(t){return Array.isArray(t)}function Mt(t,e){return!(!t||!zt(t))&&t.includes(e)}function Dt(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function Ct(g,m,v){var b={};return function(y){return function(h){return function(){var e=ut(at.mark(function t(e){var n,r,o,i,a,u,c,s,l,f,p,d;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.type,r=e.abort,o=e.plugins,i=e,r)return t.abrupt("return",h(e));t.next=4;break;case 4:if(n===ht.enablePlugin&&y.dispatch({type:ht.initializeStart,plugins:o,disabled:[],fromEnable:!0,meta:e.meta}),n===ht.disablePlugin&&setTimeout(function(){return R(e.meta.rid,{payload:e})},0),n===ht.initializeEnd&&(a=m(),u=Object.keys(a),c=u.filter(function(t){return o.includes(t)}).map(function(t){return a[t]}),s=[],l=[],f=e.disabled,p=c.map(function(e){var t=e.loaded,n=e.name;return V(e,t,1e4).then(function(t){return b[n]||(y.dispatch({type:ht.pluginReadyType(n),name:n,events:Object.keys(e).filter(function(t){return!dt.includes(t)})}),b[n]=!0),s=s.concat(n),e}).catch(function(t){if(t instanceof Error)throw new Error(t);return l=l.concat(t.name),t})}),Promise.all(p).then(function(t){var e={plugins:s,failed:l,disabled:f};setTimeout(function(){u.length===p.length+f.length&&y.dispatch(ct(ct({},{type:ht.ready}),e))},0)})),n!==ht.bootstrap)return/^ready:([^:]*)$/.test(n)&&setTimeout(function(){return U(y,m,g)},0),t.next=11,function(t,e,n,r,o){return H.apply(this,arguments)}(e,m,g,y,v);t.next=13;break;case 11:return d=t.sent,t.abrupt("return",h(d));case 13:return t.abrupt("return",h(i));case 14:case"end":return t.stop()}},t)}));return function(t){return e.apply(this,arguments)}}()}}}var qt,Rt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},Vt=function t(){var a=this;Rt(this,t),O(this,"before",[]),O(this,"after",[]),O(this,"addMiddleware",function(t,e){a[e]=a[e].concat(t)}),O(this,"removeMiddleware",function(e,t){var n=a[t].findIndex(function(t){return t===e});-1!==n&&(a[t]=[].concat(ot(a[t].slice(0,n)),ot(a[t].slice(n+1))))}),O(this,"dynamicMiddlewares",function(i){return function(o){return function(r){return function(t){var e={getState:o.getState,dispatch:function(t){return o.dispatch(t)}},n=a[i].map(function(t){return t(e)});return ft.apply(void 0,ot(n))(r)(t)}}}})};function Ut(t,e){return t.substring(e.length+1,t.length)}function Ft(t,n,r){return t.reduce(function(t,e){return t[e]=ct(ct({},r[e]),{enabled:n}),t},r)}var Gt={initialized:!(qt={}),sessionId:rt(),app:null,version:null,debug:!1,offline:!!et&&!navigator.onLine,os:{name:"na"},userAgent:et?navigator.userAgent:"node",library:{name:M,version:"0.10.1"},timezone:void 0,locale:void 0,campaign:{},referrer:qt};function $t(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Gt,e=1<arguments.length?arguments[1]:void 0,n=t.initialized,r=e.type,o=e.campaign;switch(r){case ht.campaign:return ct(ct({},t),{campaign:o});case ht.offline:return ct(ct({},t),{offline:!0});case ht.online:return ct(ct({},t),{offline:!1});default:return n?t:ct(ct(ct({},Gt),t),{initialized:!0})}}var Bt=["plugins","reducers","storage"];function Jt(t){var e=t;try{e=JSON.parse(JSON.stringify(t))}catch(t){}return e}var Xt=/#.*$/;function Yt(t){var e=function(){if(et)for(var t,e=document.getElementsByTagName("link"),n=0;t=e[n];n++)if("canonical"===t.getAttribute("rel"))return t.getAttribute("href")}();return e?e.match(/\?/)?e:e+t:window.location.href.replace(Xt,"")}var Ht=function(t){var e=0<arguments.length&&void 0!==t?t:{};if(!et)return e;var n,r=document,o=r.title,i=r.referrer,a=window,u=a.location,c=a.innerWidth,s=a.innerHeight,l=u.hash,f=u.search,p=Yt(f),d={title:o,url:p,path:"/"+((n=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(p))&&n[3]?n[3].split("?")[0].replace(Xt,""):""),hash:l,search:f,width:c,height:s};return i&&""!==i&&(d.referrer=i),ct(ct({},d),e)},Wt={last:{},history:[]};function Kt(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Wt,e=1<arguments.length?arguments[1]:void 0,n=e.properties,r=e.options,o=e.meta;switch(e.type){case ht.page:var i=Jt(ct({properties:n,meta:o},Object.keys(r).length&&{options:r}));return ct(ct({},t),{last:i,history:t.history.concat(i)});default:return t}}var Qt={last:{},history:[]};function Zt(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Qt,e=1<arguments.length?arguments[1]:void 0,n=e.type,r=e.meta,o=e.options,i=e.event,a=e.properties;switch(n){case ht.track:var u=Jt(ct(ct({event:i,properties:a},Object.keys(o).length&&{options:o}),{},{meta:r}));return ct(ct({},t),{last:u,history:t.history.concat(u)});default:return t}}var te={actions:[]};function ee(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:te,e=1<arguments.length?arguments[1]:void 0,n=e.type,r=e.payload;switch(n){case"queue":var o=r&&r.type&&r.type===ht.identify?[e].concat(t.actions):t.actions.concat(e);return ct(ct({},t),{},{actions:o});case"dequeue":return[];default:return t}}function ne(){var a=D+M+D;return K[a]=[],function(i){return function(t,e,n){var r=i(t,e,n),o=r.dispatch;return Object.assign(r,{dispatch:function(t){var e=t.action||t;return K[a].push(e),o(t)}})}}}function re(){return function(){return ft(ft.apply(null,arguments),ne())}}function oe(t){return t?(e=t,Array.isArray(e)?t:[t]):[];var e}function ie(t,e,n){var r,o,i=0<arguments.length&&void 0!==t?t:{},a=1<arguments.length?e:void 0,u=2<arguments.length?n:void 0,c=rt();return a&&(q[c]=(r=a,o=function(t){return(t||Array.prototype.slice.call(arguments)).reduce(function(t,e){return t||(Q(e)?e:t)},!1)}(u),function(t){o&&o(t),r(t)})),ct(ct({},i),{},{rid:c,ts:(new Date).getTime()},a?{hasCallback:!0}:{})}function ae(t){function e(){return s}function u(){throw new Error("Abort disabled inListener")}var i,n=0<arguments.length&&void 0!==t?t:{},r=n.reducers||{},o=n.initialUser||{},a=(n.plugins||[]).reduce(function(t,n){if(Q(n))return t.middlewares=t.middlewares.concat(n),t;if(n.NAMESPACE&&(n.name=n.NAMESPACE),!n.name)throw new Error(mt+"1");var e=n.EVENTS?Object.keys(n.EVENTS).map(function(t){return n.EVENTS[t]}):[],r=!(!1===n.enabled),o=!(n.config&&!1===n.config.enabled);t.pluginEnabled[n.name]=r&&o,delete n.enabled,n.methods&&(t.methods[n.name]=Object.keys(n.methods).reduce(function(t,e){var r;return t[e]=(r=n.methods[e],function(){var n=Array.prototype.slice.call(arguments),t=Array.apply(null,Array(r.length)).map(function(){}).map(function(t,e){if(n[e]||!1===n[e]||null===n[e])return n[e]}).concat(C);return r.apply({instance:C},t)}),t},{}),delete n.methods);var i=Object.keys(n).concat(e),a=new Set(t.events.concat(i));if(t.events=Array.from(a),t.pluginsArray=t.pluginsArray.concat(n),t.plugins[n.name])throw new Error(n.name+"AlreadyLoaded");return t.plugins[n.name]=n,t.plugins[n.name].loaded||(t.plugins[n.name].loaded=function(){return!0}),t},{plugins:{},pluginEnabled:{},methods:{},pluginsArray:[],middlewares:[],events:[]}),c=n.storage?n.storage:{getItem:function(t){return K[t]},setItem:function(t,e){return K[t]=e},removeItem:function(t){return K[t]=void 0}},l=(i=c,function(t,e,n){var r=e.getState("user")[t];if(r)return r;if(n&&tt(n)&&n[t])return n[t];var o=It(i)[t];return o||(K[Ot(t)]?K[Ot(t)]:null)}),s=a.plugins,f=a.events.filter(function(t){return!dt.includes(t)}),p=new Set(f.concat(pt).filter(function(t){return!dt.includes(t)})),d=Array.from(p).sort(),h=f.sort(),y=new Vt,g=y.addMiddleware,m=y.removeMiddleware,v=y.dynamicMiddlewares,b=nt(),w=It(c),x=ct(ct(ct(ct({},w),o),b.an_uid?{userId:b.an_uid}:{}),b.an_aid?{anonymousId:b.an_aid}:{});x.anonymousId||(x.anonymousId=rt());var S,E,I,O,P,k,j,_,A,N,T,L,z,M,D=ct({enable:function(e,n){return new Promise(function(t){J.dispatch({type:ht.enablePlugin,plugins:oe(e),_:{originalAction:ht.enablePlugin}},t,[n])})},disable:function(e,n){return new Promise(function(t){J.dispatch({type:ht.disablePlugin,plugins:oe(e),_:{originalAction:ht.disablePlugin}},t,[n])})}},a.methods),C={identify:(I=ut(at.mark(function t(e,n,r,o){var i,a,u,c,s;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=Z(e)?e:null,a=tt(e)?e:n,u=r||{},c=C.user(),K[Ot(yt)]=i,s=i||a.userId||l(yt,C,a),t.abrupt("return",new Promise(function(t){J.dispatch(ct({type:ht.identifyStart,userId:s,traits:a||{},options:u,anonymousId:c.anonymousId},c.id&&c.id!==i&&{previousId:c.id}),t,[n,r,o])}));case 7:case"end":return t.stop()}},t)})),function(t,e,n,r){return I.apply(this,arguments)}),track:(E=ut(at.mark(function t(e,n,r,o){var i,a,u;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if((i=tt(e)?e.event:e)&&Z(i)){t.next=3;break}throw new Error("EventMissing");case 3:return a=tt(e)?e:n||{},u=tt(r)?r:{},t.abrupt("return",new Promise(function(t){J.dispatch({type:ht.trackStart,event:i,properties:a,options:u,userId:l(yt,C,n),anonymousId:l(gt,C,n)},t,[n,r,o])}));case 6:case"end":return t.stop()}},t)})),function(t,e,n,r){return E.apply(this,arguments)}),page:(S=ut(at.mark(function t(n,r,o){var i,a;return at.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=tt(n)?n:{},a=tt(r)?r:{},t.abrupt("return",new Promise(function(t,e){J.dispatch({type:ht.pageStart,properties:Ht(i),options:a,userId:l(yt,C,i),anonymousId:l(gt,C,i)},t,[n,r,o])}));case 3:case"end":return t.stop()}},t)})),function(t,e,n){return S.apply(this,arguments)}),user:function(t){if(t===yt||"id"===t)return l(yt,C);if(t===gt||"anonId"===t)return l(gt,C);var e=C.getState("user");return t?W(e,t):e},reset:function(n){return new Promise(function(t,e){J.dispatch({type:ht.resetStart},t,n)})},ready:function(t){return C.on(ht.ready,t)},on:function(n,r){if(!n||!Q(r))return!1;if(n===ht.bootstrap)throw new Error(".on disabled for "+n);var o=/Start$|Start:/;if("*"===n){var t=function(){return function(e){return function(t){return t.type.match(o)&&r({payload:t,instance:C,plugins:s}),e(t)}}},e=function(){return function(e){return function(t){return t.type.match(o)||r({payload:t,instance:C,plugins:s}),e(t)}}};return g(t,ue),g(e,ce),function(){m(t,ue),m(e,ce)}}function i(){return function(e){return function(t){return t.type===n&&r({payload:t,instance:C,plugins:s,abort:u}),e(t)}}}var a=n.match(o)?ue:ce;return g(i,a),function(){return m(i,a)}},once:function(t,n){if(!t||!Q(n))return!1;if(t===ht.bootstrap)throw new Error(".once disabled for "+t);var r=C.on(t,function(t){var e=t.payload;n({payload:e,instance:C,plugins:s,abort:u}),r()});return r},getState:function(t){var e=J.getState();return t?W(e,t):Object.assign({},e)},dispatch:function(t){var e,n=Z(t)?{type:t}:t;if(e=n.type,pt.includes(e))throw new Error("reserved action "+n.type);var r=t._||{},o=ct(ct({},n),{},{_:ct({originalAction:n.type},r)});J.dispatch(o)},enablePlugin:D.enable,disablePlugin:D.disable,plugins:D,storage:{getItem:c.getItem,setItem:function(t,e,n){J.dispatch({type:ht.setItemStart,key:t,value:e,options:n})},removeItem:function(t,e){J.dispatch({type:ht.removeItemStart,key:t,options:e})}},setAnonymousId:function(t,e){C.storage.setItem(vt,t,e)},events:{all:d,core:pt,plugins:h}},q=a.middlewares.concat([function(){return function(e){return function(t){return t.meta||(t.meta=ie()),e(t)}}},v(ue),Ct(C,e,{all:d,plugins:h}),(T=c,function(t){return function(i){return function(t){var e=t.type,n=t.key,r=t.value,o=t.options;if(e===ht.setItem||e===ht.removeItem){if(t.abort)return i(t);e===ht.setItem?T.setItem(n,r,o):T.removeItem(n,o)}return i(t)}}}),(A=(_=C).storage,N=A.setItem,A.getItem,function(s){return function(c){return function(t){var o,e,n,r,i,a,u;return t.type===ht.bootstrap&&(o=t.params,e=t.user,(n=t.persistedUser).anonymousId!==e.anonymousId&&N(vt,e.anonymousId),n.userId!==e.userId&&N(bt,e.userId),(r=Object.keys(t.params)).length&&(i=o.an_uid,a=o.an_event,u=r.reduce(function(t,e){var n,r;return(e.match(xt)||e.match(/^(d|g)clid/))&&(r="campaign"===(n=e.replace(xt,""))?"name":n,t.campaign[r]=o[e]),e.match(St)&&(t.props[e.replace(St,"")]=o[e]),e.match(Et)&&(t.traits[e.replace(Et,"")]=o[e]),t},{campaign:{},props:{},traits:{}}),s.dispatch(ct(ct({type:ht.params,raw:o},u),i?{userId:i}:{})),i&&setTimeout(function(){return _.identify(i,u.traits)},0),a&&setTimeout(function(){return _.track(a,u.props)},0),Object.keys(u.campaign).length&&s.dispatch({type:ht.campaign,campaign:u.campaign}))),c(t)}}}),(O=C.storage,P=O.setItem,k=O.removeItem,j=O.getItem,function(u){return function(a){return function(t){var e,n,r=t.userId,o=t.traits,i=t.options;return t.type===ht.reset&&([bt,wt,vt].forEach(function(t){k(t)}),[yt,gt,"traits"].forEach(function(t){K[Ot(t)]=void 0})),t.type===ht.identify&&(j(vt)||P(vt,rt()),e=j(bt),n=j(wt)||{},e&&e!==r&&u.dispatch({type:ht.userIdChanged,old:{userId:e,traits:n},new:{userId:r,traits:o},options:i}),r&&P(bt,r),o&&P(wt,ct(ct({},n),o))),a(t)}}}),v(ce)]),R={context:$t,user:(z=c,function(t,e){var n=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length&&void 0!==e?e:{};if(r.type===ht.setItemEnd){if(r.key===vt)return ct(ct({},n),{anonymousId:r.value});if(r.key===bt)return ct(ct({},n),{userId:r.value})}switch(r.type){case ht.identify:return Object.assign({},n,{userId:r.userId,traits:ct(ct({},n.traits),r.traits)});case ht.reset:return[bt,vt,wt].forEach(function(t){z.removeItem(t)}),Object.assign({},n,{userId:null,anonymousId:null,traits:{}});default:return n}}),page:Kt,track:Zt,plugins:(L=e,function(t,e){var n=0<arguments.length&&void 0!==t?t:{},r=1<arguments.length?e:void 0,o={};if("initialize:aborted"===r.type)return n;if(/^registerPlugin:([^:]*)$/.test(r.type)){var i=Ut(r.type,"registerPlugin"),a=L()[i];if(!a||!i)return n;var u=r.enabled;return o[i]={enabled:u,initialized:!!u&&Boolean(!a.initialize),loaded:!!u&&Boolean(a.loaded()),config:a.config||{}},ct(ct({},n),o)}if(/^initialize:([^:]*)$/.test(r.type)){var c=Ut(r.type,ht.initialize),s=L()[c];return s&&c?(o[c]=ct(ct({},n[c]),{initialized:!0,loaded:Boolean(s.loaded())}),ct(ct({},n),o)):n}if(/^ready:([^:]*)$/.test(r.type))return o[r.name]=ct(ct({},n[r.name]),{loaded:!0}),ct(ct({},n),o);switch(r.type){case ht.disablePlugin:return ct(ct({},n),Ft(r.plugins,!1,n));case ht.enablePlugin:return ct(ct({},n),Ft(r.plugins,!0,n));default:return n}}),queue:ee},V=ft,U=ft;et&&n.debug&&((M=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__)&&(V=M({trace:!0,traceLimit:25})),U=function(t){return 0===arguments.length?ne():tt(it(t))?re():re().apply(null,arguments)});var F,G,$=(F=n,Object.keys(F).reduce(function(t,e){return Bt.includes(e)||(t[e]=F[e]),t},{})),B={context:$,user:x,plugins:a.pluginsArray.reduce(function(t,e){var n=e.name,r=e.config,o=e.loaded,i=a.pluginEnabled[n];return t[n]={enabled:i,initialized:!!i&&Boolean(!e.initialize),loaded:Boolean(o()),config:r||{}},t},{})},J=st(lt(ct(ct({},R),r)),B,U(V(function(){for(var t=arguments.length,c=new Array(t),e=0;e<t;e++)c[e]=arguments[e];return function(u){return function(t,e,n){var r=u(t,e,n),o=r.dispatch,i={getState:r.getState,dispatch:function(t){return o(t)}},a=c.map(function(t){return t(i)}),o=ft.apply(void 0,ot(a))(r.dispatch);return ct(ct({},r),{},{dispatch:o})}}}.apply(void 0,ot(q)))));J.dispatch=(G=J.dispatch,function(t,e,n){var r=ie(t.meta,e,oe(n)),o=ct(ct({},t),{meta:r});return G.apply(null,[o])});var X=Object.keys(s);J.dispatch({type:ht.bootstrap,plugins:X,config:$,params:b,user:x,persistedUser:w});var Y=X.filter(function(t){return a.pluginEnabled[t]}),H=X.filter(function(t){return!a.pluginEnabled[t]});return J.dispatch({type:ht.registerPlugins,plugins:X,enabled:a.pluginEnabled}),a.pluginsArray.map(function(t,e){var n=t.bootstrap,r=t.config,o=t.name;n&&Q(n)&&n({instance:C,config:r,payload:t}),J.dispatch({type:ht.registerPluginType(o),name:o,enabled:a.pluginEnabled[o],plugin:t}),a.pluginsArray.length===e+1&&J.dispatch({type:ht.initializeStart,plugins:Y,disabled:H})}),C}var ue="before",ce="after";function se(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return ae(e(e({},{storage:m}),t))}return t.default=se,t.init=se,t.Analytics=se,t.EVENTS=ht,t.CONSTANTS=C,t}({});

@@ -490,3 +490,3 @@ declare module "analytics" {

? Record<string, unknown>
: Record<T, Hook> & Record<string, unknown>;
: Record<T, unknown> & Record<string, unknown>;

@@ -493,0 +493,0 @@

{
"name": "analytics",
"version": "0.7.1",
"version": "0.7.2",
"description": "Lightweight analytics library for tracking events, page views, & identifying users. Works with any third party analytics provider via an extendable plugin system.",

@@ -58,3 +58,3 @@ "keywords": [

"dependencies": {
"@analytics/core": "^0.10.1",
"@analytics/core": "^0.10.2",
"@analytics/storage-utils": "^0.2.4"

@@ -90,3 +90,3 @@ },

},
"gitHead": "f9633269d1487617cc9fb9b72f244c77370de1e8"
"gitHead": "7966cbb80d42f6843b1db5b100f45707b286eba5"
}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc