Comparing version 0.3.2 to 0.3.4
@@ -6,2 +6,18 @@ # Change Log | ||
## [0.3.4](https://github.com/DavidWells/analytics/compare/analytics@0.3.3...analytics@0.3.4) (2020-04-16) | ||
**Note:** Version bump only for package analytics | ||
## [0.3.3](https://github.com/DavidWells/analytics/compare/analytics@0.3.2...analytics@0.3.3) (2020-04-16) | ||
**Note:** Version bump only for package analytics | ||
## [0.3.2](https://github.com/DavidWells/analytics/compare/analytics@0.3.1...analytics@0.3.2) (2020-04-10) | ||
@@ -8,0 +24,0 @@ |
@@ -1,1 +0,1 @@ | ||
var _analytics=function(t){"use strict";var e=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 n=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var r=function(){throw new TypeError("")};var U=function(t){return e(t)||n(t)||r()};function o(t,e){return t(e={exports:{}},e.exports),e.exports}var G=o(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});var d=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 a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var $=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(n,!0).forEach(function(t){d(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e},i="object"==typeof global&&global&&global.Object===Object&&global,c="object"==typeof self&&self&&self.Object===Object&&self,u=(i||c||Function("return this")()).Symbol,s=Object.prototype,l=s.hasOwnProperty,f=s.toString,p=u?u.toStringTag:void 0;var h=Object.prototype.toString;var y="[object Null]",m="[object Undefined]",v=u?u.toStringTag:void 0;function g(t){return null==t?void 0===t?m:y:v&&v in Object(t)?function(t){var e=l.call(t,p),n=t[p];try{var r=!(t[p]=void 0)}catch(t){}var o=f.call(t);return r&&(e?t[p]=n:delete t[p]),o}(t):(e=t,h.call(e));var e}var b,w,x=(b=Object.getPrototypeOf,w=Object,function(t){return b(w(t))});var I,S="[object Object]",E=Function.prototype,O=Object.prototype,j=E.toString,k=O.hasOwnProperty,P=j.call(Object);I="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")();var _,N,A=("function"==typeof(N=I.Symbol)?N.observable?_=N.observable:(_=N("observable"),N.observable=_):_="@@observable",_),T={INIT:"@@redux/INIT"};function B(t,e,n){var r;if("function"==typeof e&&void 0===n&&(n=e,e=void 0),void 0!==n){if("function"!=typeof n)throw new Error("");return n(B)(t,e)}if("function"!=typeof t)throw new Error("");var o=t,a=e,i=[],c=i,u=!1;function s(){c===i&&(c=i.slice())}function l(){return a}function f(e){if("function"!=typeof e)throw new Error("");var n=!0;return s(),c.push(e),function(){if(n){n=!1,s();var t=c.indexOf(e);c.splice(t,1)}}}function p(t){if(!function(t){if(null==(e=t)||"object"!=typeof e||g(t)!=S)return!1;var e,n=x(t);if(null===n)return!0;var r=k.call(n,"constructor")&&n.constructor;return"function"==typeof r&&r instanceof r&&j.call(r)==P}(t))throw new Error("");if(void 0===t.type)throw new Error('');if(u)throw new Error("");try{u=!0,a=o(a,t)}finally{u=!1}for(var e=i=c,n=0;n<e.length;n++){(0,e[n])()}return t}return p({type:T.INIT}),(r={dispatch:p,subscribe:f,getState:l,replaceReducer:function(t){if("function"!=typeof t)throw new Error("");o=t,p({type:T.INIT})}})[A]=function(){var t,n=f;return(t={subscribe:function(t){if("object"!=typeof t)throw new TypeError("");function e(){t.next&&t.next(l())}return e(),{unsubscribe:n(e)}}})[A]=function(){return this},t},r}function W(t){for(var e=Object.keys(t),d={},n=0;n<e.length;n++){var r=e[n];"function"==typeof t[r]&&(d[r]=t[r])}var o,h=Object.keys(d),y=void 0;try{o=d,Object.keys(o).forEach(function(t){var e=o[t];if(void 0===e(void 0,{type:T.INIT}))throw new Error('Reducer "'+t+"\"");if(void 0===e(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" "+T.INIT+' ')})}catch(t){y=t}return function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];if(y)throw y;for(var n,r,o,a=!1,i={},c=0;c<h.length;c++){var u=h[c],s=d[u],l=t[u],f=s(l,e);if(void 0===f){var p=(n=u,o=void 0,"Given action "+((o=(r=e)&&r.type)&&'"'+o.toString()+'"'||"an action")+', reducer "'+n+'" ');throw new Error(p)}i[u]=f,a=a||f!==l}return a?i:t}}function X(){for(var t=arguments.length,e=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 Y=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t};function L(t,e,n,r,o,a){if("undefined"!=typeof window)return 1<arguments.length?document.cookie="".concat(t,"=").concat(encodeURIComponent(e)).concat(n?"; expires=".concat(new Date(+new Date+1e3*n).toUTCString()):"").concat(r?"; path=".concat(r):"").concat(o?"; domain=".concat(o):"").concat(a?"; secure":""):decodeURIComponent(("; ".concat(document.cookie).split("; ".concat(t,"="))[1]||"").split(";")[0])}var M=L,z=L;function R(t){return(R="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 D(e){var n;try{void 0===(n=JSON.parse(e))&&(n=e),"true"===n&&(n=!0),"false"===n&&(n=!1),parseFloat(n)===n&&"object"!==R(n)&&(n=parseFloat(n))}catch(t){n=e}return n}function C(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==this?this:{}}var F="localStorage",V="cookie",q=!1,H=function(){try{var t="___c";L(t,"1");var e=-1!==document.cookie.indexOf(t);return L(t,"",-1),e}catch(t){return!1}}();function J(t){return"string"==typeof t?t:t.storage}function K(t){return q&&(!t||t===F)}function Z(t){return H&&(!t||t===V)}var Q={getItem:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!t)return null;var n,r=J(e);if("all"===r)return{cookie:D(M(n=t)),localStorage:D(localStorage.getItem(n)),global:C[n]||null};if(K(r)){var o=localStorage.getItem(t);if(o||r===F)return D(o)}if(Z(r)){var a=M(t);if(a||r===V)return D(a)}return C[t]||null},setItem:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(!t||!e)return!1;var r=J(n),o=JSON.stringify(e);if(K(r)){var a=D(localStorage.getItem(t));return localStorage.setItem(t,o),{value:e,oldValue:a,location:F}}if(Z(r)){var i=D(M(t));return z(t,o),{value:e,oldValue:i,location:V}}var c=C[t];return{value:C[t]=e,oldValue:c,location:"global"}},removeItem:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!t)return!1;var n=J(e);return K(n)?(localStorage.removeItem(t),F):Z(n)?(L(t,"",-1),V):(C[t]=null,"global")}};function tt(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}var et="undefined"!=typeof window;function nt(t){var e=function(t){if(t){var e=t.match(/\?(.*)/);return e&&e[1]?e[1].split("#")[0]:""}return et&&window.location.search.substring(1)}(t);return e?function(t){var e,n=/([^&=]+)=?([^&]*)/g,r={};for(;e=n.exec(t);){var o=tt(e[1]),a=tt(e[2]);if("[]"===o.substring(o.length-2))o=o.substring(0,o.length-2),(r[o]||(r[o]=[])).push(a);else{var i=""===a||a;r[o]=i}}for(var c in r){var u=c.split("[");if(1<u.length){var s=[];u.forEach(function(t,e){var n=t.replace(/[?[\]\\ ]/g,"");s.push(n)}),rt(r,s,r[c]),delete r[c]}}return r}(e):{}}function rt(t,e,n){for(var r=e.length-1,o=0;o<r;++o){var a=e[o];a in t||(t[a]={}),t=t[a]}t[e[r]]=n}function ot(){for(var t,e,n,r,o=[],a=0;a<256;a++)o[a]=(a<16?"0":"")+a.toString(16);return t=at(),e=at(),n=at(),r=at(),"".concat(o[255&t]+o[t>>8&255]+o[t>>16&255]+o[t>>24&255],"-").concat(o[255&e]).concat(o[e>>8&255],"-").concat(o[e>>16&15|64]).concat(o[e>>24&255],"-").concat(o[63&n|128]).concat(o[n>>8&255],"-").concat(o[n>>16&255]).concat(o[n>>24&255]).concat(o[255&r]).concat(o[r>>8&255]).concat(o[r>>16&255]).concat(o[r>>24&255])}function at(){return 4294967295*Math.random()|0}var it=["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","loadPlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],ct=["name","EVENTS","config","loaded"],ut=it.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:".concat(t)},pluginReadyType:function(t){return"ready:".concat(t)}});var st="__anon_id",lt="__user_id",ft="__user_traits",pt=Object.freeze({ANON_ID:st,USER_ID:lt,USER_TRAITS:ft}),dt=/^utm_/,ht=/^an_prop_/,yt=/^an_trait_/;function mt(t){return"function"==typeof t}var vt=o(function(t){var e=function(a){var u,t=Object.prototype,s=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function i(t,e,n,r){var a,i,c,u,o=e&&e.prototype instanceof v?e:v,s=Object.create(o.prototype),l=new k(r||[]);return s._invoke=(a=t,i=n,c=l,u=p,function(t,e){if(u===h)throw new Error("");if(u===y){if("throw"===t)throw e;return _()}for(c.method=t,c.arg=e;;){var n=c.delegate;if(n){var r=E(n,c);if(r){if(r===m)continue;return r}}if("next"===c.method)c.sent=c._sent=c.arg;else if("throw"===c.method){if(u===p)throw u=y,c.arg;c.dispatchException(c.arg)}else"return"===c.method&&c.abrupt("return",c.arg);u=h;var o=f(a,i,c);if("normal"===o.type){if(u=c.done?y:d,o.arg===m)continue;return{value:o.arg,done:c.done}}"throw"===o.type&&(u=y,c.method="throw",c.arg=o.arg)}}),s}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}a.wrap=i;var p="suspendedStart",d="suspendedYield",h="executing",y="completed",m={};function v(){}function c(){}function l(){}var g={};g[o]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(P([])));w&&w!==t&&s.call(w,o)&&(g=w);var x=l.prototype=v.prototype=Object.create(g);function I(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function S(u){var e;this._invoke=function(n,r){function t(){return new Promise(function(t,e){!function e(t,n,r,o){var a=f(u[t],u,n);if("throw"!==a.type){var i=a.arg,c=i.value;return c&&"object"==typeof c&&s.call(c,"__await")?Promise.resolve(c.__await).then(function(t){e("next",t,r,o)},function(t){e("throw",t,r,o)}):Promise.resolve(c).then(function(t){i.value=t,r(i)},function(t){return e("throw",t,r,o)})}o(a.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}}function E(t,e){var n=t.iterator[e.method];if(n===u){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=u,E(t,e),"throw"===e.method))return m;e.method="throw",e.arg=new TypeError("")}return m}var r=f(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,m;var o=r.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=u),e.delegate=null,m):o:(e.method="throw",e.arg=new TypeError(""),e.delegate=null,m)}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 j(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 P(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(s.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=u,t.done=!0,t};return r.next=r}}return{next:_}}function _(){return{value:u,done:!0}}return c.prototype=x.constructor=l,l.constructor=c,l[r]=c.displayName="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,l):(t.__proto__=l,r in t||(t[r]="GeneratorFunction")),t.prototype=Object.create(x),t},a.awrap=function(t){return{__await:t}},I(S.prototype),S.prototype[n]=function(){return this},a.AsyncIterator=S,a.async=function(t,e,n,r){var o=new S(i(t,e,n,r));return a.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},I(x),x[r]="Generator",x[o]=function(){return this},x.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=P,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=u,this.done=!1,this.delegate=null,this.method="next",this.arg=u,this.tryEntries.forEach(j),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=u)},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 a.type="throw",a.arg=n,r.next=t,e&&(r.method="next",r.arg=u),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var o=this.tryEntries[e],a=o.completion;if("root"===o.tryLoc)return t("end");if(o.tryLoc<=this.prev){var i=s.call(o,"catchLoc"),c=s.call(o,"finallyLoc");if(i&&c){if(this.prev<o.catchLoc)return t(o.catchLoc,!0);if(this.prev<o.finallyLoc)return t(o.finallyLoc)}else if(i){if(this.prev<o.catchLoc)return t(o.catchLoc,!0)}else{if(!c)throw new Error("");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&&s.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 a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,m):this.complete(a)},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),j(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=n.completion;if("throw"===r.type){var o=r.arg;j(n)}return o}}throw new Error("")},delegateYield:function(t,e,n){return this.delegate={iterator:P(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=u),m}},a}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});function gt(t,e,n,r,o,a,i){try{var c=t[a](i),u=c.value}catch(t){return void n(t)}c.done?e(u):Promise.resolve(u).then(r,o)}var bt=function(c){return function(){var t=this,i=arguments;return new Promise(function(e,n){var r=c.apply(t,i);function o(t){gt(r,e,n,o,a,"next",t)}function a(t){gt(r,e,n,o,a,"throw",t)}o(void 0)})}};function wt(o,a,i){return new Promise(function(e,n){return a()?e(o):i<1?n($({},o,{queue:!0})):(r=10,new Promise(function(t){return setTimeout(t,r)})).then(function(t){return wt(o,a,i-10).then(e,n)});var r})}var xt="userId",It="anonymousId";function St(c,t,u){var s=t(),e=c.getState(),l=e.plugins,n=e.context,f=e.queue,p=e.user;if(!n.offline&&f&&f.actions&&f.actions.length){var r=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:[]});if(r.processIndex&&r.processIndex.length){r.processIndex.forEach(function(t){var e=f.actions[t],n=e.plugin,r=e.payload.type,o=s[n][r];if(o&&mt(o)){var a=function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return[xt,It].reduce(function(t,e){return function(t,e,n){if(t.hasOwnProperty(n)&&!t[n]&&e[n])return Object.assign({},t,d({},"".concat(n),e[n]));return t}(t,n,e)},t)}(e.payload,p);o({payload:a,config:l[n].config,instance:u});var i="".concat(r,":").concat(n);c.dispatch($({},a,{type:i,_:{called:i,from:"queueDrain"}}))}});var o=f.actions.filter(function(t,e){return!~r.processIndex.indexOf(e)});f.actions=o}}}var Et=function(t){if(Array.isArray(t))return t};var Ot=function(t,e){var n=[],r=!0,o=!1,a=void 0;try{for(var i,c=t[Symbol.iterator]();!(r=(i=c.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){o=!0,a=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw a}}return n};var jt=function(){throw new TypeError("")};var kt=function(t,e){return Et(t)||Ot(t,e)||jt()};function Pt(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(e).filter(function(t){var e=r.plugins||{};return!1!==e[t]&&(!0===e[t]||(!n[t]||!1!==n[t].enabled))}).map(function(t){return e[t]})}function _t(t){return"object"===G(t)}function Nt(t){return"string"==typeof t}var At=/Start$/,Tt=/^bootstrap/,Lt=/^ready/;function Mt(t,e,n,r,o){return zt.apply(this,arguments)}function zt(){return(zt=bt(vt.mark(function t(e,n,r,o,a){var i,c,u,s,l,f,p,d,h,y,m,v;return vt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=mt(n)?n():n,c=e.type,u=c.replace(At,""),e._&&e._.called)return t.abrupt("return",e);t.next=5;break;case 5:return s=r.getState(),l=Pt(i,s.plugins,e.options),f=l.map(function(t){return t.name}),p=Gt(c,l,i),t.next=11,Dt({action:e,data:{exact:p.before,namespaced:p.beforeNS},state:s,allPlugins:i,allMatches:p,instance:r,store:o,EVENTS:a});case 11:if(Bt(d=t.sent,f.length))return t.abrupt("return",d);t.next=14;break;case 14:if(c!==u){t.next=18;break}h=d,t.next=21;break;case 18:return t.next=20,Dt({action:$({},d,{type:u}),data:{exact:p.during,namespaced:p.duringNS},state:s,allPlugins:i,allMatches:p,instance:r,store:o,EVENTS:a});case 20:h=t.sent;case 21:if(c.match(At))return y="".concat(u,"End"),t.next=25,Dt({action:$({},h,{type:y}),data:{exact:p.after,namespaced:p.afterNS},state:s,allPlugins:i,allMatches:p,instance:r,store:o,EVENTS:a});t.next=28;break;case 25:m=t.sent,(v=Rt(m))&&v({payload:m});case 28:return t.abrupt("return",d);case 29:case"end":return t.stop()}},t)}))).apply(this,arguments)}function Rt(r){return!!r.meta&&Object.keys(r.meta).reduce(function(t,e){var n=r.meta[e];return mt(n)?n:t},!1)}function Dt(t){return Ct.apply(this,arguments)}function Ct(){return(Ct=bt(vt.mark(function t(e){var m,i,v,n,g,r,b,o,w,a,x,I,c,S,E,O,u,s;return vt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return m=e.data,i=e.action,v=e.instance,n=e.state,g=e.allPlugins,r=e.allMatches,b=e.store,o=e.EVENTS,w=n.plugins,a=n.context,x=i.type,I=x.match(At),c=m.exact.map(function(t){return t.pluginName}),I&&(c=r.during.map(function(t){return t.pluginName})),S=Yt(v,c),E=m.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),a.offline&&(r.match(/^page/)||r.match(/^track/)||r.match(/^identify/))&&(o=!0),t["".concat(n)]=o,t},{}),t.next=10,m.exact.reduce(function(){var r=bt(vt.mark(function t(e,n,r){var u,o,a;return vt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return u=n.pluginName,t.next=3,e;case 3:if(o=t.sent,m.namespaced&&m.namespaced[u])return t.next=7,m.namespaced[u].reduce(function(){var r=bt(vt.mark(function t(e,n,r){var o,a,i,c;return vt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return a=function(n,r,o){return function(t,e){return $({},n,{abort:{reason:t,plugins:e||[r],caller:x,from:o||r}})}},t.next=3,e;case 3:if(o=t.sent,n.method&&mt(n.method)){t.next=6;break}return t.abrupt("return",o);case 6:return Ht(n.methodName,n.pluginName),t.next=9,n.method({payload:o,instance:v,abort:a(o,u,n.pluginName),config:Vt(n.pluginName,w,g),plugins:w});case 9:return i=t.sent,c=_t(i)?i:{},t.abrupt("return",Promise.resolve($({},o,{},c)));case 12:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve(i));t.next=11;break;case 7:a=t.sent,o[u]=a,t.next=12;break;case 11:o[u]=i;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,m.exact.reduce(function(){var r=bt(vt.mark(function t(e,n,r){var o,a,i,c,u,s,l,f,p,d,h,y;return vt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=m.exact.length===r+1,a=n.pluginName,i=g[a],t.next=5,e;case 5:if(c=t.sent,u=O[a]?O[a]:{},I&&(u=c),$t(u,a))return Ft({data:u,method:x,instance:v,pluginName:a,store:b}),t.abrupt("return",Promise.resolve(c));t.next=11;break;case 11:if($t(c,a))return o&&Ft({data:c,method:x,instance:v,store:b}),t.abrupt("return",Promise.resolve(c));t.next=14;break;case 14:if(E.hasOwnProperty(a)&&!0===E[a])return b.dispatch({type:"queue",plugin:a,payload:u,_:{called:"queue",from:"queueMechanism"}}),t.abrupt("return",Promise.resolve(c));t.next=17;break;case 17:return s=S(O[a],g[a]),t.next=20,i[x]({hello:a,abort:s.abort,payload:u,instance:v,config:Vt(a,w,g),plugins:w});case 20:return l=t.sent,f=_t(l)?l:{},p=$({},c,{},f),$t(d=O[a],a)?Ft({data:d,method:x,instance:v,pluginName:a,store:b}):(h="".concat(x,":").concat(a),(h.match(/:/g)||[]).length<2&&!x.match(Tt)&&!x.match(Lt)&&(y=I?p:u,v.dispatch($({},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(i));case 13:if(u=t.sent,x.match(At)||x.match(/^registerPlugin/)||x.match(Lt)||x.match(Tt)||x.match(/^params/)||x.match(/^userIdChanged/)){t.next=21;break}if(o.plugins.includes(x),u._&&u._.originalAction===x)return t.abrupt("return",u);t.next=18;break;case 18:s=$({},u,{},{_:{originalAction:u.type,called:u.type,from:"engineEnd"}}),Bt(u,m.exact.length)&&!x.match(/End$/)&&(s=$({},s,{},{type:"".concat(u.type,"Aborted")})),b.dispatch(s);case 21:return t.abrupt("return",u);case 22:case"end":return t.stop()}},t)}))).apply(this,arguments)}function Ft(t){var e=t.data,n=t.method,r=(t.instance,t.pluginName),o=t.store,a=r?":".concat(r):"",i="".concat(n,"Aborted").concat(a);o.dispatch($({},e,{type:i,_:{called:i,from:"abort"}}))}function Vt(t,e,n){var r=e[t]||n[t];return r&&r.config?r.config:{}}function qt(n,t){return t.reduce(function(t,e){return e[n]?t.concat({methodName:n,pluginName:e.name,method:e[n]}):t},[])}function Ut(t,e){var n=t.replace(At,""),r=e?":".concat(e):"";return["".concat(t).concat(r),"".concat(n).concat(r),"".concat(n,"End").concat(r)]}function Gt(u,s,t){var e=Ut(u).map(function(t){return qt(t,s)});return s.reduce(function(t,e){var n=e.name,r=Ut(u,n).map(function(t){return qt(t,s)}),o=kt(r,3),a=o[0],i=o[1],c=o[2];return a.length&&(t.beforeNS[n]=a),i.length&&(t.duringNS[n]=i),c.length&&(t.afterNS[n]=c),t},{before:e[0],beforeNS:{},during:e[1],duringNS:{},after:e[2],afterNS:{}})}function $t(t,e){var n=t.abort;return!!n&&(!0===n||(Xt(n,e)||n&&Xt(n.plugins,e)))}function Bt(t,e){var n=t.abort;if(!n)return!1;if(!0===n||Nt(n))return!0;var r=n.plugins;return Wt(n)&&n.length===e||Wt(r)&&r.length===e}function Wt(t){return Array.isArray(t)}function Xt(t,e){return!(!t||!Wt(t))&&t.includes(e)}function Yt(y,m){return function(t,e,n){var r=e.config,o=e.name,a="".concat(o,".").concat(t.type);n&&(a=n.event);var i,c,u,s,l,f,p,d,h=t.type.match(At)?(u=o,s=a,l=m,f=n,p=t,function(t,e){var n=f?f.name:u,r=e&&Wt(e)?e:l;if(f&&(!(r=e&&Wt(e)?e:[u]).includes(u)||1!==r.length))throw new Error("Method ".concat(s," can only abort ").concat(u," plugin. ").concat(JSON.stringify(r)," input valid"));return $({},p,{abort:{reason:t,plugins:r,caller:s,_:n}})}):(i=t,c=a,function(){throw new Error("Action ".concat(i.type," not cancellable. Remove abort in ").concat(c))});return{payload:(d=t,Object.keys(d).reduce(function(t,e){return"type"===e||(_t(d[e])?t[e]=Object.assign({},d[e]):t[e]=d[e]),t},{})),instance:y,config:r||{},abort:h}}}function Ht(t,e){var n=Jt(t);if(n&&n.name===e){var r=Jt(n.method),o=r?"or ".concat(r.method):"";throw new Error(["Plugin ".concat(e," is calling method [").concat(t,"]"),"Plugins can't call their own name","Use ".concat(n.method," ").concat(o," in ").concat(e," plugin instead of ").concat(t)].join("\n"))}}function Jt(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function Kt(){return(new Date).getTime()}var Zt=function(t,e){if(!(t instanceof e))throw new TypeError("")},Qt=function t(){var i=this;Zt(this,t),d(this,"before",[]),d(this,"after",[]),d(this,"addMiddleware",function(t,e){i[e]=i[e].concat(t)}),d(this,"removeMiddleware",function(e,t){var n=i[t].findIndex(function(t){return t===e});-1!==n&&(i[t]=[].concat(U(i[t].slice(0,n)),U(i[t].slice(n+1))))}),d(this,"resetMiddlewares",function(t){t?i[t]=[]:(i.before=[],i.after=[])}),d(this,"dynamicMiddlewares",function(a){return function(o){return function(r){return function(t){var e={getState:o.getState,dispatch:function(t){return o.dispatch(t)}},n=i[a].map(function(t){return t(e)});return X.apply(void 0,U(n))(r)(t)}}}})},te={};var ee,ne,re,oe,ae="undefined"!=typeof window;ee=function(){if(!ae)return!1;var t=navigator.appVersion;return~t.indexOf("Win")?"Windows":~t.indexOf("Mac")?"MacOS":~t.indexOf("X11")?"UNIX":~t.indexOf("Linux")?"Linux":"Unknown OS"}(),ne=document.referrer,re=function(){if(!et)return null;var t=navigator,e=t.language,n=t.languages,r=t.userLanguage;return n&&n.length?n[0]:r||e}(),oe="undefined"==typeof Intl||"function"!=typeof Intl.DateTimeFormat||"function"!=typeof Intl.DateTimeFormat().resolvedOptions?null:Intl.DateTimeFormat().resolvedOptions().timeZone;var ie={initialized:!1,sessionId:ot(),app:null,version:null,debug:!1,offline:!!ae&&!navigator.onLine,os:{name:ee},userAgent:ae?navigator.userAgent:"node",library:{name:"analytics",version:"0.3.1"},timezone:oe,locale:re,campaign:{},referrer:ne};function ce(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:ie,e=1<arguments.length?arguments[1]:void 0,n=t.initialized,r=e.type,o=e.campaign;switch(r){case ut.campaign:return $({},t,{},{campaign:o});case ut.offline:return $({},t,{},{offline:!0});case ut.online:return $({},t,{},{offline:!1});default:return n?t:$({},ie,{},t,{},{initialized:!0})}}var ue=/#.*$/;function se(t){var e=function(){if(ae)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:"".concat(e).concat(t):window.location.href.replace(ue,"")}var le=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(!ae)return t;var e,n,r,o=document,a=o.title,i=o.referrer,c=window,u=c.location,s=c.innerWidth,l=c.innerHeight,f=u.hash,p=u.search,d=se(p),h={title:a,url:d,path:(e=d,n=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e),r=n&&n[3]?n[3].split("?")[0].replace(ue,""):"","/".concat(r)),hash:f,search:p,width:s,height:l};return i&&""!==i&&(h.referrer=i),$({},h,{},t)},fe=le();function pe(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:fe,e=1<arguments.length?arguments[1]:void 0;switch(e.type){case ut.page:return Object.assign({},t,e.properties);default:return t}}var de={event:{},lastEvent:null,history:[]};function he(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:de,e=1<arguments.length?arguments[1]:void 0,n=e.type,r=e.payload,o=e.options,a=e.eventName;switch(n){case ut.track:return $({},t,{},{event:{eventName:a,payload:r,options:o},lastEvent:e.eventName,history:t.history.concat(e)});default:return t}}var ye={actions:[]};function me(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:ye,e=1<arguments.length?arguments[1]:void 0,n=e.type,r=(e.data,e.timestamp,e.payload);switch(n){case"queue":var o;return o=r&&r.type&&r.type===ut.identify?[e].concat(t.actions):t.actions.concat(e),$({},t,{actions:o});case"dequeue":return[];default:return t}}var ve="object"===("undefined"==typeof self?"undefined":G(self))&&self.self===self&&self||"object"===("undefined"==typeof global?"undefined":G(global))&&global.global===global&&global||void 0;function ge(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=1<arguments.length?arguments[1]:void 0;if(e&&e.type===ut.setItemEnd&&e.key===st)return Object.assign({},t,{anonymousId:e.value});switch(e.type){case ut.identify:return Object.assign({},t,{userId:e.userId,traits:$({},t.traits,{},e.traits)});case ut.reset:return[xt,It,"traits"].map(function(t){ve[we(t)]=null}),[lt,st,ft].map(function(t){Q.removeItem(t)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}function be(t){return{userId:Q.getItem(lt)||t.an_uid,anonymousId:Q.getItem(st)||t.an_aid||ot(),traits:Q.getItem(ft)||{}}}var we=function(t){return"__TEMP__".concat(t)};function xe(t,e,n){var r=e.getState("user")[t];if(r)return r;if(n&&_t(n)&&n[t])return n[t];var o=be({})[t];return o||(ve[we(t)]?ve[we(t)]:null)}function Ie(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 Se(e){var n=function(t,e,n){if(!ae)return!1;var r=window[(n?"add":"remove")+"EventListener"];t.split(" ").forEach(function(t){r(t,e)})}.bind(null,"online offline",function(t){return Promise.resolve(!navigator.onLine).then(e)});return n(!0),function(t){return n(!1)}}function Ee(){return Array.prototype.slice.call(arguments).reduce(function(t,e){return t||(mt(e)?e:t)},!1)}function Oe(){var i="__ANALYTICS_HISTORY__";return ve[i]=[],function(a){return function(t,e,n){var r=a(t,e,n),o=r.dispatch;return Object.assign(r,{dispatch:function(t){var e=t.action||t;return ve[i].push(e),o(t)}})}}}function je(t){return function(){return X(X.apply(null,arguments),Oe())}}var ke=function(t,e,n){return{type:ut.setItemStart,timestamp:Kt(),key:t,value:e,options:n}},Pe=function(t,e){return{type:ut.removeItemStart,timestamp:Kt(),key:t,options:e}},_e=function(t,e){return Q.getItem(t,e)};function Ne(){var t,e,s,l,f,p,b,w,x,I,c,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},r=n.reducers||{},a=(n.plugins||[]).reduce(function(t,e){if(mt(e))return t.middlewares=t.middlewares.concat(e),t;if(e.NAMESPACE&&(e.name=e.NAMESPACE),!e.name)throw new Error("".concat("https://lytics.dev/errors/","1"));var n=e.EVENTS?Object.keys(e.EVENTS).map(function(t){return e.EVENTS[t]}):[],r=Object.keys(e).concat(n),o=new Set(t.events.concat(r));if(t.events=Array.from(o),t.pluginsArray=t.pluginsArray.concat(e),t.plugins[e.name])throw new Error('"'.concat(e.name,'" plugin loaded twice'));return t.plugins[e.name]=e,t.plugins[e.name].loaded||(t.plugins[e.name].loaded=function(){return!0}),t},{plugins:{},pluginsArray:[],middlewares:[],events:[]}),u=a.plugins,o=a.events.filter(function(t){return!ct.includes(t)}),i=new Set(o.concat(it).filter(function(t){return!ct.includes(t)})),d=Array.from(i).sort(),h=o.sort(),y=function(){return u},m=new Qt,v=m.addMiddleware,g=m.removeMiddleware,S=m.dynamicMiddlewares,E=function(){throw new Error("Abort disabled in listener")},O=function(e,n){return function(t){n&&n(t),e(t)}},j=nt(),k=be(j),P={identify:function(t,n,r,o){var a=Nt(t)?t:null,i=_t(t)?t:n,c=r||{},u=P.user(),s=(ve[we(xt)]=a)||i.userId||xe(xt,P,i);return new Promise(function(t,e){V.dispatch($({type:ut.identifyStart,userId:s,traits:i||{},options:c,anonymousId:u.anonymousId},u.id&&u.id!==a&&{previousId:u.id},{meta:{timestamp:Kt(),callback:O(t,Ee(n,r,o))}}))})},track:function(t,n,r,o){var a=_t(t)?t.event:t;if(!a||!Nt(a))throw new Error("Event missing");var i=_t(t)?t:n||{},c=_t(r)?r:{};return new Promise(function(t,e){V.dispatch({type:ut.trackStart,event:a,properties:i,options:c,userId:xe(xt,P,n),anonymousId:xe(It,P,n),meta:{timestamp:Kt(),callback:O(t,Ee(n,r,o))}})})},page:function(n,r,o){var a=_t(n)?n:{},i=_t(r)?r:{};return new Promise(function(t,e){V.dispatch({type:ut.pageStart,properties:le(a),options:i,userId:xe(xt,P,a),anonymousId:xe(It,P,a),meta:{timestamp:Kt(),callback:O(t,Ee(n,r,o))}})})},user:function(t){if(t===xt||"id"===t)return xe(xt,P);var e=P.getState("user");return t?Ie(e,t):e},reset:function(n){return new Promise(function(t,e){V.dispatch({type:ut.resetStart,timestamp:Kt(),callback:O(t,n)})})},ready:function(t){return P.on(ut.ready,t)},on:function(n,r){if(!n||!mt(r))return!1;if(n===ut.bootstrap)throw new Error(".on disabled for ".concat(n));var o=/Start$|Start:/;if("*"===n){var t=function(t){return function(e){return function(t){return t.type.match(o)&&r({payload:t,instance:P,plugins:u}),e(t)}}},e=function(t){return function(e){return function(t){return t.type.match(o)||r({payload:t,instance:P,plugins:u}),e(t)}}};return v(t,Ae),v(e,Te),function(){g(t,Ae),g(e,Te)}}var a=n.match(o)?Ae:Te,i=function(t){return function(e){return function(t){return t.type===n&&r({payload:t,instance:P,plugins:u,abort:E}),e(t)}}};return v(i,a),function(){return g(i,a)}},once:function(t,n){if(!t||!mt(n))return!1;if(t===ut.bootstrap)throw new Error(".once disabled for ".concat(t));var r=P.on(t,function(t){var e=t.payload;n({payload:e,instance:P,plugins:u,abort:E}),r()});return r},getState:function(t){var e=V.getState();return t?Ie(e,t):Object.assign({},e)},dispatch:function(t){var e,n=Nt(t)?{type:t}:t;if(e=n.type,it.includes(e))throw new Error('reserved action "'.concat(n.type,'"'));var r=n.meta||{},o=t._||{},a=$({},n,{meta:$({timestamp:Kt()},r),_:$({originalAction:n.type},o)});V.dispatch(a)},enablePlugin:function(t,e){var n,r;V.dispatch((n=t,r=e,{type:ut.enablePlugin,name:n,callback:r,_:{originalAction:ut.enablePlugin}}))},disablePlugin:function(t,e){var n,r;V.dispatch((n=t,r=e,{type:ut.disablePlugin,name:n,callback:r,_:{originalAction:ut.disablePlugin}}))},loadPlugin:function(t){V.dispatch({type:ut.loadPlugin,plugins:t?[t]:Object.keys(y())})},storage:{getItem:_e,setItem:function(t,e,n){V.dispatch(ke(t,e,n))},removeItem:function(t,e){V.dispatch(Pe(t,e))}},setAnonymousId:function(t,e){P.storage.setItem(st,t,e)},events:{all:d,core:it,plugins:h}},_=a.middlewares.concat([S(Ae),(b=P,w=y,x={all:d,plugins:h},I={},function(g){return function(v){return e=bt(vt.mark(function t(e){var n,r,o,a,i,c,u,s,l,f,p,d,h,y,m;return vt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.type,r=e.name,o=e.callback,(a=e).abort)return t.abrupt("return",v(e));t.next=4;break;case 4:if(n!==ut.disablePlugin&&n!==ut.enablePlugin||mt(o)&&o(r),n===ut.loadPlugin)return i=w(),c=Object.keys(i).filter(function(t){return e.plugins.includes(t)}).reduce(function(t,e){return t[e]=i[e],t},{}),u={type:ut.initializeStart,plugins:e.plugins},t.next=11,Mt(u,c,b,g,x);t.next=13;break;case 11:return s=t.sent,t.abrupt("return",v(s));case 13:if(n===ut.initializeEnd&&(l=w(),f=Object.keys(l),p=f.filter(function(t){return e.plugins.includes(t)}).map(function(t){return l[t]}),d=[],h=[],y=p.map(function(e){var t=e.loaded,n=e.name;return wt(e,t,1e4).then(function(t){I[n]||(g.dispatch({type:ut.pluginReadyType(n),name:n,events:Object.keys(e).filter(function(t){return!ct.includes(t)})}),I[n]=!0),d=d.concat(n)}).catch(function(t){if(t instanceof Error)throw new Error(t);return h=h.concat(t.name),t})}),Promise.all(y).then(function(t){setTimeout(function(){f.length===y.length&&g.dispatch({type:ut.ready,plugins:d,failed:h})},0)})),n!==ut.bootstrap)return/^ready:([^:]*)$/.test(n)&&setTimeout(function(){return St(g,w,b)},0),t.next=18,Mt(e,w,b,g,x);t.next=20;break;case 18:return m=t.sent,t.abrupt("return",v(m));case 20:return t.abrupt("return",v(a));case 21:case"end":return t.stop()}},t)})),function(t){return e.apply(this,arguments)};var e}}),function(t){return function(a){return function(t){var e=t.type,n=t.key,r=t.value,o=t.options;if(e===ut.setItem||e===ut.removeItem){if(t.abort)return a(t);e===ut.setItem?Q.setItem(n,r,o):Q.removeItem(n,o)}return a(t)}}},(p=P,function(u){return function(c){return function(t){if(t.type===ut.bootstrap){var o=t.params,e=t.user;Q.getItem(st)||p.storage.setItem(st,e.anonymousId);var n=Object.keys(t.params);if(n.length){var r=o.an_uid,a=o.an_event,i=n.reduce(function(t,e){if(e.match(dt)||e.match(/^(d|g)clid/)){var n=e.replace(dt,""),r="campaign"===n?"name":n;t.campaign[r]=o[e]}return e.match(ht)&&(t.props["".concat(e.replace(ht,""))]=o[e]),e.match(yt)&&(t.traits["".concat(e.replace(yt,""))]=o[e]),t},{campaign:{},props:{},traits:{}});u.dispatch($({type:ut.params,raw:o},i,{},r?{userId:r}:{})),r&&setTimeout(function(){return p.identify(r,i.traits)},0),a&&setTimeout(function(){return p.track(a,i.props)},0),Object.keys(i.campaign).length&&u.dispatch({type:ut.campaign,campaign:i.campaign})}}return c(t)}}}),(t=P,e=t.storage,s=e.setItem,l=e.removeItem,f=e.getItem,function(u){return function(c){return function(t){var e=t.userId,n=t.traits,r=t.options,o=t.callback;if(t.type===ut.reset&&([lt,ft,st].forEach(function(t){return l(t)}),mt(o)&&o()),t.type===ut.identify){var a=f(lt),i=f(ft)||{};a&&a!==e&&u.dispatch({type:ut.userIdChanged,old:{userId:a,traits:i},new:{userId:e,traits:n},options:r}),e&&s(lt,e),n&&s(ft,$({},i,{},n))}return c(t)}}}),S(Te)]),N={context:ce,user:ge,page:pe,track:he,plugins:(c=y,function(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:te,t=1<arguments.length?arguments[1]:void 0,e={};if("initialize:aborted"===t.type)return n;if(/^registerPlugin:([^:]*)$/.test(t.type)){var r=t.type.split(":")[1],o=c()[r];return o&&r?(e[r]={enabled:!0,initialized:!o.initialize,loaded:Boolean(o.loaded()),config:o.config||{}},$({},n,{},e)):n}if(/^initialize:([^:]*)$/.test(t.type)){var a=t.type.split(":")[1],i=c()[a];return i&&a?(e[a]=$({},n[a],{},{initialized:!0,loaded:Boolean(i.loaded())}),$({},n,{},e)):n}if(/^ready:([^:]*)$/.test(t.type))return e[t.name]=$({},n[t.name],{},{loaded:!0}),$({},n,{},e);switch(t.type){case ut.disablePlugin:return Array.isArray(t.name)?e=t.name.reduce(function(t,e){return t[e]=$({},n[e],{},{enabled:!1}),t},n):e[t.name]=$({},n[t.name],{},{enabled:!1}),$({},n,{},e);case ut.enablePlugin:return Array.isArray(t.name)?e=t.name.reduce(function(t,e){return t[e]=$({},n[e],{},{enabled:!0}),t},n):e[t.name]=$({},n[t.name],{},{enabled:!0}),$({},n,{},e);default:return n}}),queue:me},A=X,T=X;if(ae&&n.debug){var L=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;L&&(A=L({trace:!0,traceLimit:25})),T=function(){return 0===arguments.length?Oe():_t(G(arguments[0]))?je(arguments[0]):je().apply(null,arguments)}}var M,z,R,D,C=(M=n,Object.keys(M).reduce(function(t,e){return"plugins"===e||"reducers"===e||(t[e]=M[e]),t},{})),F={context:C,user:k,plugins:a.pluginsArray.reduce(function(t,e){var n=e.name,r=e.config,o=e.loaded;return t[n]={enabled:!0,initialized:Boolean(!e.initialize),loaded:Boolean(o()),config:r||{}},t},{})},V=B(W($({},N,{},r)),F,T(A(function(){for(var t=arguments.length,u=Array(t),e=0;e<t;e++)u[e]=arguments[e];return function(c){return function(t,e,n){var r,o=c(t,e,n),a=o.dispatch,i={getState:o.getState,dispatch:function(t){return a(t)}};return r=u.map(function(t){return t(i)}),a=X.apply(void 0,r)(o.dispatch),Y({},o,{dispatch:a})}}}.apply(void 0,U(_))))),q=Object.keys(u);return V.dispatch({type:ut.bootstrap,plugins:q,config:C,params:j,user:k}),V.dispatch({type:ut.registerPlugins,plugins:q}),a.pluginsArray.map(function(t,e){var n=t.bootstrap,r=t.config;n&&mt(n)&&n({instance:P,config:r,payload:t});var o=a.pluginsArray.length===e+1;V.dispatch({type:ut.registerPluginType(t.name),name:t.name,plugin:t}),o&&V.dispatch({type:ut.initializeStart,plugins:q})}),Se(function(t){V.dispatch({type:t?ut.offline:ut.online})}),z=V,R=y,D=P,setInterval(function(){St(z,R,D)},3e3),P}var Ae="before",Te="after";return t.default=Ne,t.init=Ne,t.Analytics=Ne,t.EVENTS=ut,t.CONSTANTS=pt,t}({}); | ||
var _analytics=function(t){"use strict";var e=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 n=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)};var r=function(){throw new TypeError("")};var U=function(t){return e(t)||n(t)||r()};function a(t,e){return t(e={exports:{}},e.exports),e.exports}var G=a(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});var d=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=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var $=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){d(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 i(t,e,n,r,a,o){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:"")+(a?"; domain="+a:"")+(o?"; secure":""):""):decodeURIComponent((("; "+document.cookie).split("; "+t+"=")[1]||"").split(";")[0])}var c=i,s=i;function u(t){return(u="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 l(e){var n;try{void 0===(n=JSON.parse(e))&&(n=e),"true"===n&&(n=!0),"false"===n&&(n=!1),parseFloat(n)===n&&"object"!==u(n)&&(n=parseFloat(n))}catch(t){n=e}return n}function f(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==this?this:{}}var p="localStorage",h="cookie",m="global",y=!1,g=function(){try{i("_c_","1");var t=-1!==document.cookie.indexOf("_c_");return i("_c_","",-1),t}catch(t){return!1}}();function v(t){return"string"==typeof t?t:t.storage}function b(t){return y&&(!t||t===p)}function w(t){return g&&(!t||t===h)}var B={getItem:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!t)return null;var n,r=v(e);if("all"===r)return{cookie:l(c(n=t)),localStorage:l(localStorage.getItem(n)),global:f[n]||null};if(b(r)){var a=localStorage.getItem(t);if(a||r===p)return l(a)}if(w(r)){var o=c(t);if(o||r===h)return l(o)}return f[t]||null},setItem:function(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};if(!t||!e)return!1;var r=v(n),a=JSON.stringify(e);if(b(r)){var o=l(localStorage.getItem(t));return localStorage.setItem(t,a),{value:e,oldValue:o,location:p}}if(w(r)){var i=l(c(t));return s(t,a),{value:e,oldValue:i,location:h}}var u=f[t];return{value:f[t]=e,oldValue:u,location:m}},removeItem:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(!t)return!1;var n=v(e);return b(n)?(localStorage.removeItem(t),p):w(n)?(i(t,"",-1),h):(f[t]=null,m)}};function X(t,e,n,r,a){for(e=e.split?e.split("."):e,r=0;r<e.length;r++)t=t?t[e[r]]:a;return t===a?n:t}function S(t){return(S="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 J(t){return"function"==typeof t}function W(t){return"string"==typeof t}function Y(t){if("object"!==S(t)||null===t)return!1;for(var e=t;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function x(t){try{return decodeURIComponent(t.replace(/\+/g," "))}catch(t){return null}}var H="undefined"!=typeof window;function Z(t){var e=function(t){if(t){var e=t.match(/\?(.*)/);return e&&e[1]?e[1].split("#")[0]:""}return H&&window.location.search.substring(1)}(t);return e?function(t){var e,n=/([^&=]+)=?([^&]*)/g,r={};for(;e=n.exec(t);){var a=x(e[1]),o=x(e[2]);if("[]"===a.substring(a.length-2))a=a.substring(0,a.length-2),(r[a]||(r[a]=[])).push(o);else{var i=""===o||o;r[a]=i}}for(var u in r){var c=u.split("[");if(1<c.length){var s=[];c.forEach(function(t,e){var n=t.replace(/[?[\]\\ ]/g,"");s.push(n)}),E(r,s,r[u]),delete r[u]}}return r}(e):{}}function E(t,e,n){for(var r=e.length-1,a=0;a<r;++a){var o=e[a];o in t||(t[o]={}),t=t[o]}t[e[r]]=n}function I(){for(var t,e,n,r,a=[],o=0;o<256;o++)a[o]=(o<16?"0":"")+o.toString(16);return t=O(),e=O(),n=O(),r=O(),"".concat(a[255&t]+a[t>>8&255]+a[t>>16&255]+a[t>>24&255],"-").concat(a[255&e]).concat(a[e>>8&255],"-").concat(a[e>>16&15|64]).concat(a[e>>24&255],"-").concat(a[63&n|128]).concat(a[n>>8&255],"-").concat(a[n>>16&255]).concat(a[n>>24&255]).concat(a[255&r]).concat(a[r>>8&255]).concat(a[r>>16&255]).concat(a[r>>24&255])}function O(){return 4294967295*Math.random()|0}var k="function",P="undefined",_="reducer",j="@@redux/",N=j+"INIT",A=j+Math.random().toString(36),T=function(){return("undefined"==typeof Symbol?"undefined":G(Symbol))===k&&Symbol.observable||"@@observable"}(),L=" != "+k;function K(t,e,n){if(G(e)===k&&G(n)===P&&(n=e,e=void 0),G(n)!==P){if(G(n)!==k)throw new Error("enhancer"+L);return n(K)(t,e)}if(G(t)!==k)throw new Error(_+L);var r=t,a=e,o=[],i=o,u=!1;function c(){i===o&&(i=o.slice())}function s(){return a}function l(e){if(G(e)!==k)throw new Error("Listener"+L);var n=!0;return c(),i.push(e),function(){if(n){n=!1,c();var t=i.indexOf(e);i.splice(t,1)}}}function f(t){if(!Y(t))throw new Error("Act != obj");if(G(t.type)===P)throw new Error("ActType "+P);if(u)throw new Error("Dispatch in "+_);try{u=!0,a=r(a,t)}finally{u=!1}for(var e=o=i,n=0;n<e.length;n++){(0,e[n])()}return t}return f({type:N}),d({dispatch:f,subscribe:l,getState:s,replaceReducer:function(t){if(G(t)!==k)throw new Error("next "+_+L);r=t,f({type:N})}},T,function(){var n=l;return d({subscribe:function(t){if("object"!==G(t))throw new TypeError("Observer != obj");function e(){t.next&&t.next(s())}return e(),{unsubscribe:n(e)}}},T,function(){return this})})}function Q(t){for(var e=Object.keys(t),d={},n=0;n<e.length;n++){var r=e[n];G(t[r])===k&&(d[r]=t[r])}var h,a,m=Object.keys(d);try{a=d,Object.keys(a).forEach(function(t){var e=a[t],n=e(void 0,{type:N});if(G(n)===P||G(e(void 0,{type:A}))===P)throw new Error(_+" "+t+" "+P)})}catch(t){h=t}return function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=1<arguments.length?arguments[1]:void 0;if(h)throw h;for(var n,r,a,o=!1,i={},u=0;u<m.length;u++){var c=m[u],s=d[c],l=t[c],f=s(l,e);if(G(f)===P){var p=(n=c,a=void 0,"action "+((a=(r=e)&&r.type)&&a.toString()||"?")+_+" "+n+" returns "+P);throw new Error(p)}i[c]=f,o=o||f!==l}return o?i:t}}function tt(){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 et=["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","loadPlugin","online","offline","setItemStart","setItem","setItemEnd","setItemAborted","removeItemStart","removeItem","removeItemEnd","removeItemAborted"],nt=["name","EVENTS","config","loaded"],rt=et.reduce(function(t,e){return t[e]=e,t},{registerPluginType:function(t){return"registerPlugin:".concat(t)},pluginReadyType:function(t){return"ready:".concat(t)}});var at="__anon_id",ot="__user_id",it="__user_traits",M=Object.freeze({ANON_ID:at,USER_ID:ot,USER_TRAITS:it}),ut=/^utm_/,ct=/^an_prop_/,st=/^an_trait_/;var lt=a(function(t){var e=function(o){var c,t=Object.prototype,s=t.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},a=e.iterator||"@@iterator",n=e.asyncIterator||"@@asyncIterator",r=e.toStringTag||"@@toStringTag";function i(t,e,n,r){var o,i,u,c,a=e&&e.prototype instanceof g?e:g,s=Object.create(a.prototype),l=new P(r||[]);return s._invoke=(o=t,i=n,u=l,c=p,function(t,e){if(c===h)throw new Error("");if(c===m){if("throw"===t)throw e;return j()}for(u.method=t,u.arg=e;;){var n=u.delegate;if(n){var r=I(n,u);if(r){if(r===y)continue;return r}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(c===p)throw c=m,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);c=h;var a=f(o,i,u);if("normal"===a.type){if(c=u.done?m:d,a.arg===y)continue;return{value:a.arg,done:u.done}}"throw"===a.type&&(c=m,u.method="throw",u.arg=a.arg)}}),s}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}o.wrap=i;var p="suspendedStart",d="suspendedYield",h="executing",m="completed",y={};function g(){}function u(){}function l(){}var v={};v[a]=function(){return this};var b=Object.getPrototypeOf,w=b&&b(b(_([])));w&&w!==t&&s.call(w,a)&&(v=w);var S=l.prototype=g.prototype=Object.create(v);function x(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function E(c){var e;this._invoke=function(n,r){function t(){return new Promise(function(t,e){!function e(t,n,r,a){var o=f(c[t],c,n);if("throw"!==o.type){var i=o.arg,u=i.value;return u&&"object"==typeof u&&s.call(u,"__await")?Promise.resolve(u.__await).then(function(t){e("next",t,r,a)},function(t){e("throw",t,r,a)}):Promise.resolve(u).then(function(t){i.value=t,r(i)},function(t){return e("throw",t,r,a)})}a(o.arg)}(n,r,t,e)})}return e=e?e.then(t,t):t()}}function I(t,e){var n=t.iterator[e.method];if(n===c){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=c,I(t,e),"throw"===e.method))return y;e.method="throw",e.arg=new TypeError("")}return y}var r=f(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,y;var a=r.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=c),e.delegate=null,y):a:(e.method="throw",e.arg=new TypeError(""),e.delegate=null,y)}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 k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function _(e){if(e){var t=e[a];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(s.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=c,t.done=!0,t};return r.next=r}}return{next:j}}function j(){return{value:c,done:!0}}return u.prototype=S.constructor=l,l.constructor=u,l[r]=u.displayName="GeneratorFunction",o.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===u||"GeneratorFunction"===(e.displayName||e.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,r in t||(t[r]="GeneratorFunction")),t.prototype=Object.create(S),t},o.awrap=function(t){return{__await:t}},x(E.prototype),E.prototype[n]=function(){return this},o.AsyncIterator=E,o.async=function(t,e,n,r){var a=new E(i(t,e,n,r));return o.isGeneratorFunction(e)?a:a.next().then(function(t){return t.done?t.value:a.next()})},x(S),S[r]="Generator",S[a]=function(){return this},S.toString=function(){return"[object Generator]"},o.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}},o.values=_,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(k),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=c)},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 o.type="throw",o.arg=n,r.next=t,e&&(r.method="next",r.arg=c),!!e}for(var e=this.tryEntries.length-1;0<=e;--e){var a=this.tryEntries[e],o=a.completion;if("root"===a.tryLoc)return t("end");if(a.tryLoc<=this.prev){var i=s.call(a,"catchLoc"),u=s.call(a,"finallyLoc");if(i&&u){if(this.prev<a.catchLoc)return t(a.catchLoc,!0);if(this.prev<a.finallyLoc)return t(a.finallyLoc)}else if(i){if(this.prev<a.catchLoc)return t(a.catchLoc,!0)}else{if(!u)throw new Error("");if(this.prev<a.finallyLoc)return t(a.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&&s.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var a=r;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(o)},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),y},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),k(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;k(n)}return a}}throw new Error("")},delegateYield:function(t,e,n){return this.delegate={iterator:_(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=c),y}},o}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}});function z(t,e,n,r,a,o,i){try{var u=t[o](i),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,a)}var ft=function(u){return function(){var t=this,i=arguments;return new Promise(function(e,n){var r=u.apply(t,i);function a(t){z(r,e,n,a,o,"next",t)}function o(t){z(r,e,n,a,o,"throw",t)}a(void 0)})}};function pt(a,o,i){return new Promise(function(e,n){return o()?e(a):i<1?n($({},a,{queue:!0})):(r=10,new Promise(function(t){return setTimeout(t,r)})).then(function(t){return pt(a,o,i-10).then(e,n)});var r})}var D="analytics",dt="userId",ht="anonymousId";function mt(u,t,c){var s=t(),e=u.getState(),l=e.plugins,n=e.context,f=e.queue,p=e.user;if(!n.offline&&f&&f.actions&&f.actions.length){var r=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:[]});if(r.processIndex&&r.processIndex.length){r.processIndex.forEach(function(t){var e=f.actions[t],n=e.plugin,r=e.payload.type,a=s[n][r];if(a&&J(a)){var o=function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};return[dt,ht].reduce(function(t,e){return function(t,e,n){if(t.hasOwnProperty(n)&&!t[n]&&e[n])return Object.assign({},t,d({},"".concat(n),e[n]));return t}(t,n,e)},t)}(e.payload,p);a({payload:o,config:l[n].config,instance:c});var i="".concat(r,":").concat(n);u.dispatch($({},o,{type:i,_:{called:i,from:"queueDrain"}}))}});var a=f.actions.filter(function(t,e){return!~r.processIndex.indexOf(e)});f.actions=a}}}var V=function(t){if(Array.isArray(t))return t};var q=function(t,e){var n=[],r=!0,a=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(r=(i=u.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){a=!0,o=t}finally{try{r||null==u.return||u.return()}finally{if(a)throw o}}return n};var R=function(){throw new TypeError("")};var C=function(t,e){return V(t)||q(t,e)||R()};function F(e){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};return Object.keys(e).filter(function(t){var e=r.plugins||{};return!1!==e[t]&&(!0===e[t]||(!n[t]||!1!==n[t].enabled))}).map(function(t){return e[t]})}var yt=/Start$/,gt=/^bootstrap/,vt=/^ready/;function bt(t,e,n,r,a){return wt.apply(this,arguments)}function wt(){return(wt=ft(lt.mark(function t(e,n,r,a,o){var i,u,c,s,l,f,p,d,h,m,y,g;return lt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=J(n)?n():n,u=e.type,c=u.replace(yt,""),e._&&e._.called)return t.abrupt("return",e);t.next=5;break;case 5:return s=r.getState(),l=F(i,s.plugins,e.options),f=l.map(function(t){return t.name}),p=_t(u,l,i),t.next=11,xt({action:e,data:{exact:p.before,namespaced:p.beforeNS},state:s,allPlugins:i,allMatches:p,instance:r,store:a,EVENTS:o});case 11:if(Nt(d=t.sent,f.length))return t.abrupt("return",d);t.next=14;break;case 14:if(u!==c){t.next=18;break}h=d,t.next=21;break;case 18:return t.next=20,xt({action:$({},d,{type:c}),data:{exact:p.during,namespaced:p.duringNS},state:s,allPlugins:i,allMatches:p,instance:r,store:a,EVENTS:o});case 20:h=t.sent;case 21:if(u.match(yt))return m="".concat(c,"End"),t.next=25,xt({action:$({},h,{type:m}),data:{exact:p.after,namespaced:p.afterNS},state:s,allPlugins:i,allMatches:p,instance:r,store:a,EVENTS:o});t.next=28;break;case 25:y=t.sent,(g=St(y))&&g({payload:y});case 28:return t.abrupt("return",d);case 29:case"end":return t.stop()}},t)}))).apply(this,arguments)}function St(r){return!!r.meta&&Object.keys(r.meta).reduce(function(t,e){var n=r.meta[e];return J(n)?n:t},!1)}function xt(t){return Et.apply(this,arguments)}function Et(){return(Et=ft(lt.mark(function t(e){var y,i,g,n,v,r,b,a,w,o,S,x,u,E,I,O,c,s;return lt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return y=e.data,i=e.action,g=e.instance,n=e.state,v=e.allPlugins,r=e.allMatches,b=e.store,a=e.EVENTS,w=n.plugins,o=n.context,S=i.type,x=S.match(yt),u=y.exact.map(function(t){return t.pluginName}),x&&(u=r.during.map(function(t){return t.pluginName})),E=Lt(g,u),I=y.exact.reduce(function(t,e){var n=e.pluginName,r=e.methodName,a=!1;return r.match(/^initialize/)||r.match(/^reset/)||(a=!w[n].loaded),o.offline&&(r.match(/^page/)||r.match(/^track/)||r.match(/^identify/))&&(a=!0),t["".concat(n)]=a,t},{}),t.next=10,y.exact.reduce(function(){var r=ft(lt.mark(function t(e,n,r){var c,a,o;return lt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return c=n.pluginName,t.next=3,e;case 3:if(a=t.sent,y.namespaced&&y.namespaced[c])return t.next=7,y.namespaced[c].reduce(function(){var r=ft(lt.mark(function t(e,n,r){var a,o,i,u;return lt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=function(n,r,a){return function(t,e){return $({},n,{abort:{reason:t,plugins:e||[r],caller:S,from:a||r}})}},t.next=3,e;case 3:if(a=t.sent,n.method&&J(n.method)){t.next=6;break}return t.abrupt("return",a);case 6:return Mt(n.methodName,n.pluginName),t.next=9,n.method({payload:a,instance:g,abort:o(a,c,n.pluginName),config:Ot(n.pluginName,w,v),plugins:w});case 9:return i=t.sent,u=Y(i)?i:{},t.abrupt("return",Promise.resolve($({},a,{},u)));case 12:case"end":return t.stop()}},t)}));return function(t,e,n){return r.apply(this,arguments)}}(),Promise.resolve(i));t.next=11;break;case 7:o=t.sent,a[c]=o,t.next=12;break;case 11:a[c]=i;case 12:return t.abrupt("return",Promise.resolve(a));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,y.exact.reduce(function(){var r=ft(lt.mark(function t(e,n,r){var a,o,i,u,c,s,l,f,p,d,h,m;return lt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return a=y.exact.length===r+1,o=n.pluginName,i=v[o],t.next=5,e;case 5:if(u=t.sent,c=O[o]?O[o]:{},x&&(c=u),jt(c,o))return It({data:c,method:S,instance:g,pluginName:o,store:b}),t.abrupt("return",Promise.resolve(u));t.next=11;break;case 11:if(jt(u,o))return a&&It({data:u,method:S,instance:g,store:b}),t.abrupt("return",Promise.resolve(u));t.next=14;break;case 14:if(I.hasOwnProperty(o)&&!0===I[o])return b.dispatch({type:"queue",plugin:o,payload:c,_:{called:"queue",from:"queueMechanism"}}),t.abrupt("return",Promise.resolve(u));t.next=17;break;case 17:return s=E(O[o],v[o]),t.next=20,i[S]({hello:o,abort:s.abort,payload:c,instance:g,config:Ot(o,w,v),plugins:w});case 20:return l=t.sent,f=Y(l)?l:{},p=$({},u,{},f),jt(d=O[o],o)?It({data:d,method:S,instance:g,pluginName:o,store:b}):(h="".concat(S,":").concat(o),(h.match(/:/g)||[]).length<2&&!S.match(gt)&&!S.match(vt)&&(m=x?p:c,g.dispatch($({},m,{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(i));case 13:if(c=t.sent,S.match(yt)||S.match(/^registerPlugin/)||S.match(vt)||S.match(gt)||S.match(/^params/)||S.match(/^userIdChanged/)){t.next=21;break}if(a.plugins.includes(S),c._&&c._.originalAction===S)return t.abrupt("return",c);t.next=18;break;case 18:s=$({},c,{},{_:{originalAction:c.type,called:c.type,from:"engineEnd"}}),Nt(c,y.exact.length)&&!S.match(/End$/)&&(s=$({},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 It(t){var e=t.data,n=t.method,r=(t.instance,t.pluginName),a=n+"Aborted"+(r?":"+r:"");t.store.dispatch($({},e,{type:a,_:{called:a,from:"abort"}}))}function Ot(t,e,n){var r=e[t]||n[t];return r&&r.config?r.config:{}}function kt(n,t){return t.reduce(function(t,e){return e[n]?t.concat({methodName:n,pluginName:e.name,method:e[n]}):t},[])}function Pt(t,e){var n=t.replace(yt,""),r=e?":".concat(e):"";return["".concat(t).concat(r),"".concat(n).concat(r),"".concat(n,"End").concat(r)]}function _t(c,s,t){var e=Pt(c).map(function(t){return kt(t,s)});return s.reduce(function(t,e){var n=e.name,r=Pt(c,n).map(function(t){return kt(t,s)}),a=C(r,3),o=a[0],i=a[1],u=a[2];return o.length&&(t.beforeNS[n]=o),i.length&&(t.duringNS[n]=i),u.length&&(t.afterNS[n]=u),t},{before:e[0],beforeNS:{},during:e[1],duringNS:{},after:e[2],afterNS:{}})}function jt(t,e){var n=t.abort;return!!n&&(!0===n||(Tt(n,e)||n&&Tt(n.plugins,e)))}function Nt(t,e){var n=t.abort;if(!n)return!1;if(!0===n||W(n))return!0;var r=n.plugins;return At(n)&&n.length===e||At(r)&&r.length===e}function At(t){return Array.isArray(t)}function Tt(t,e){return!(!t||!At(t))&&t.includes(e)}function Lt(m,y){return function(t,e,n){var r=e.config,a=e.name,o="".concat(a,".").concat(t.type);n&&(o=n.event);var i,u,c,s,l,f,p,d,h=t.type.match(yt)?(c=a,s=o,l=y,f=n,p=t,function(t,e){var n=f?f.name:c,r=e&&At(e)?e:l;if(f&&(!(r=e&&At(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 $({},p,{abort:{reason:t,plugins:r,caller:s,_:n}})}):(i=t,u=o,function(){throw new Error(i.type+" action not cancellable. Remove abort in "+u)});return{payload:(d=t,Object.keys(d).reduce(function(t,e){return"type"===e||(Y(d[e])?t[e]=Object.assign({},d[e]):t[e]=d[e]),t},{})),instance:m,config:r||{},abort:h}}}function Mt(t,e){var n=zt(t);if(n&&n.name===e){var r=zt(n.method),a=r?"or "+r.method:"";throw new Error([e+" plugin is calling method "+t,"Plugins cant call themselves","Use ".concat(n.method," ").concat(a," in ").concat(e," plugin insteadof ").concat(t)].join("\n"))}}function zt(t){var e=t.match(/(.*):(.*)/);return!!e&&{method:e[1],name:e[2]}}function Dt(){return(new Date).getTime()}var Vt=function(t,e){if(!(t instanceof e))throw new TypeError("")},qt=function t(){var i=this;Vt(this,t),d(this,"before",[]),d(this,"after",[]),d(this,"addMiddleware",function(t,e){i[e]=i[e].concat(t)}),d(this,"removeMiddleware",function(e,t){var n=i[t].findIndex(function(t){return t===e});-1!==n&&(i[t]=[].concat(U(i[t].slice(0,n)),U(i[t].slice(n+1))))}),d(this,"dynamicMiddlewares",function(o){return function(a){return function(r){return function(t){var e={getState:a.getState,dispatch:function(t){return a.dispatch(t)}},n=i[o].map(function(t){return t(e)});return tt.apply(void 0,U(n))(r)(t)}}}})},Rt={};var Ct,Ft,Ut,Gt;Ct=function(){if(!H)return!1;var t=navigator.appVersion;return~t.indexOf("Win")?"Windows":~t.indexOf("Mac")?"MacOS":~t.indexOf("X11")?"UNIX":~t.indexOf("Linux")?"Linux":"Unknown OS"}(),Ft=document.referrer,Ut=function(){if(!H)return null;var t=navigator,e=t.language,n=t.languages,r=t.userLanguage;return n&&n.length?n[0]:r||e}(),Gt="undefined"==typeof Intl||"function"!=typeof Intl.DateTimeFormat||"function"!=typeof Intl.DateTimeFormat().resolvedOptions?null:Intl.DateTimeFormat().resolvedOptions().timeZone;var $t={initialized:!1,sessionId:I(),app:null,version:null,debug:!1,offline:!!H&&!navigator.onLine,os:{name:Ct},userAgent:H?navigator.userAgent:"node",library:{name:D,version:"0.3.3"},timezone:Gt,locale:Ut,campaign:{},referrer:Ft};function Bt(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:$t,e=1<arguments.length?arguments[1]:void 0,n=t.initialized,r=e.type,a=e.campaign;switch(r){case rt.campaign:return $({},t,{},{campaign:a});case rt.offline:return $({},t,{},{offline:!0});case rt.online:return $({},t,{},{offline:!1});default:return n?t:$({},$t,{},t,{},{initialized:!0})}}var Xt=/#.*$/;function Jt(t){var e=function(){if(H)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 Wt=function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};if(!H)return t;var e,n,r=document,a=r.title,o=r.referrer,i=window,u=i.location,c=i.innerWidth,s=i.innerHeight,l=u.hash,f=u.search,p=Jt(f),d={title:a,url:p,path:(e=p,n=/(http[s]?:\/\/)?([^\/\s]+\/)(.*)/g.exec(e),"/"+(n&&n[3]?n[3].split("?")[0].replace(Xt,""):"")),hash:l,search:f,width:c,height:s};return o&&""!==o&&(d.referrer=o),$({},d,{},t)},Yt=Wt();function Ht(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Yt,e=1<arguments.length?arguments[1]:void 0;switch(e.type){case rt.page:return Object.assign({},t,e.properties);default:return t}}var Zt={event:{},lastEvent:null,history:[]};function Kt(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Zt,e=1<arguments.length?arguments[1]:void 0,n=e.type,r=e.payload,a=e.options,o=e.eventName;switch(n){case rt.track:return $({},t,{},{event:{eventName:o,payload:r,options:a},lastEvent:e.eventName,history:t.history.concat(e)});default:return t}}var Qt={actions:[]};function te(){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.data,e.timestamp,e.payload);switch(n){case"queue":var a;return a=r&&r.type&&r.type===rt.identify?[e].concat(t.actions):t.actions.concat(e),$({},t,{actions:a});case"dequeue":return[];default:return t}}var ee="object"===("undefined"==typeof self?"undefined":G(self))&&self.self===self&&self||"object"===("undefined"==typeof global?"undefined":G(global))&&global.global===global&&global||void 0;function ne(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=1<arguments.length?arguments[1]:void 0;if(e&&e.type===rt.setItemEnd&&e.key===at)return Object.assign({},t,{anonymousId:e.value});switch(e.type){case rt.identify:return Object.assign({},t,{userId:e.userId,traits:$({},t.traits,{},e.traits)});case rt.reset:return[dt,ht,"traits"].map(function(t){ee[ae(t)]=null}),[ot,at,it].map(function(t){B.removeItem(t)}),Object.assign({},t,{userId:null,anonymousId:null,traits:{}});default:return t}}function re(t){return{userId:B.getItem(ot)||t.an_uid,anonymousId:B.getItem(at)||t.an_aid||I(),traits:B.getItem(it)||{}}}var ae=function(t){return"__TEMP__"+t};function oe(t,e,n){var r=e.getState("user")[t];if(r)return r;if(n&&Y(n)&&n[t])return n[t];var a=re({})[t];return a||(ee[ae(t)]?ee[ae(t)]:null)}function ie(e){var n=function(t,e,n){if(!H)return!1;var r=window[(n?"add":"remove")+"EventListener"];t.split(" ").forEach(function(t){r(t,e)})}.bind(null,"online offline",function(t){return Promise.resolve(!navigator.onLine).then(e)});return n(!0),function(t){return n(!1)}}function ue(){return Array.prototype.slice.call(arguments).reduce(function(t,e){return t||(J(e)?e:t)},!1)}function ce(){var i="__"+D+"__";return ee[i]=[],function(o){return function(t,e,n){var r=o(t,e,n),a=r.dispatch;return Object.assign(r,{dispatch:function(t){var e=t.action||t;return ee[i].push(e),a(t)}})}}}function se(t){return function(){return tt(tt.apply(null,arguments),ce())}}var le=function(t,e,n){return{type:rt.setItemStart,timestamp:Dt(),key:t,value:e,options:n}},fe=function(t,e){return{type:rt.removeItemStart,timestamp:Dt(),key:t,options:e}},pe=function(t,e){return B.getItem(t,e)};function de(){var t,e,s,l,f,p,b,w,S,x,u,n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},r=n.reducers||{},o=(n.plugins||[]).reduce(function(t,e){if(J(e))return t.middlewares=t.middlewares.concat(e),t;if(e.NAMESPACE&&(e.name=e.NAMESPACE),!e.name)throw new Error("https://lytics.dev/errors/1");var n=e.EVENTS?Object.keys(e.EVENTS).map(function(t){return e.EVENTS[t]}):[],r=Object.keys(e).concat(n),a=new Set(t.events.concat(r));if(t.events=Array.from(a),t.pluginsArray=t.pluginsArray.concat(e),t.plugins[e.name])throw new Error(e.name+" plugin loaded twice");return t.plugins[e.name]=e,t.plugins[e.name].loaded||(t.plugins[e.name].loaded=function(){return!0}),t},{plugins:{},pluginsArray:[],middlewares:[],events:[]}),c=o.plugins,a=o.events.filter(function(t){return!nt.includes(t)}),i=new Set(a.concat(et).filter(function(t){return!nt.includes(t)})),d=Array.from(i).sort(),h=a.sort(),m=function(){return c},y=new qt,g=y.addMiddleware,v=y.removeMiddleware,E=y.dynamicMiddlewares,I=function(){throw new Error("Abort disabled in listener")},O=function(e,n){return function(t){n&&n(t),e(t)}},k=Z(),P=re(k),_={identify:function(t,n,r,a){var o=W(t)?t:null,i=Y(t)?t:n,u=r||{},c=_.user(),s=(ee[ae(dt)]=o)||i.userId||oe(dt,_,i);return new Promise(function(t,e){C.dispatch($({type:rt.identifyStart,userId:s,traits:i||{},options:u,anonymousId:c.anonymousId},c.id&&c.id!==o&&{previousId:c.id},{meta:{timestamp:Dt(),callback:O(t,ue(n,r,a))}}))})},track:function(t,n,r,a){var o=Y(t)?t.event:t;if(!o||!W(o))throw new Error("Event missing");var i=Y(t)?t:n||{},u=Y(r)?r:{};return new Promise(function(t,e){C.dispatch({type:rt.trackStart,event:o,properties:i,options:u,userId:oe(dt,_,n),anonymousId:oe(ht,_,n),meta:{timestamp:Dt(),callback:O(t,ue(n,r,a))}})})},page:function(n,r,a){var o=Y(n)?n:{},i=Y(r)?r:{};return new Promise(function(t,e){C.dispatch({type:rt.pageStart,properties:Wt(o),options:i,userId:oe(dt,_,o),anonymousId:oe(ht,_,o),meta:{timestamp:Dt(),callback:O(t,ue(n,r,a))}})})},user:function(t){if(t===dt||"id"===t)return oe(dt,_);var e=_.getState("user");return t?X(e,t):e},reset:function(n){return new Promise(function(t,e){C.dispatch({type:rt.resetStart,timestamp:Dt(),callback:O(t,n)})})},ready:function(t){return _.on(rt.ready,t)},on:function(n,r){if(!n||!J(r))return!1;if(n===rt.bootstrap)throw new Error(".on disabled for "+n);var a=/Start$|Start:/;if("*"===n){var t=function(t){return function(e){return function(t){return t.type.match(a)&&r({payload:t,instance:_,plugins:c}),e(t)}}},e=function(t){return function(e){return function(t){return t.type.match(a)||r({payload:t,instance:_,plugins:c}),e(t)}}};return g(t,he),g(e,me),function(){v(t,he),v(e,me)}}var o=n.match(a)?he:me,i=function(t){return function(e){return function(t){return t.type===n&&r({payload:t,instance:_,plugins:c,abort:I}),e(t)}}};return g(i,o),function(){return v(i,o)}},once:function(t,n){if(!t||!J(n))return!1;if(t===rt.bootstrap)throw new Error(".once disabled for "+t);var r=_.on(t,function(t){var e=t.payload;n({payload:e,instance:_,plugins:c,abort:I}),r()});return r},getState:function(t){var e=C.getState();return t?X(e,t):Object.assign({},e)},dispatch:function(t){var e,n=W(t)?{type:t}:t;if(e=n.type,et.includes(e))throw new Error("reserved action "+n.type);var r=n.meta||{},a=t._||{},o=$({},n,{meta:$({timestamp:Dt()},r),_:$({originalAction:n.type},a)});C.dispatch(o)},enablePlugin:function(t,e){var n,r;C.dispatch((n=t,r=e,{type:rt.enablePlugin,name:n,callback:r,_:{originalAction:rt.enablePlugin}}))},disablePlugin:function(t,e){var n,r;C.dispatch((n=t,r=e,{type:rt.disablePlugin,name:n,callback:r,_:{originalAction:rt.disablePlugin}}))},loadPlugin:function(t){C.dispatch({type:rt.loadPlugin,plugins:t?[t]:Object.keys(m())})},storage:{getItem:pe,setItem:function(t,e,n){C.dispatch(le(t,e,n))},removeItem:function(t,e){C.dispatch(fe(t,e))}},setAnonymousId:function(t,e){_.storage.setItem(at,t,e)},events:{all:d,core:et,plugins:h}},j=o.middlewares.concat([E(he),(b=_,w=m,S={all:d,plugins:h},x={},function(v){return function(g){return e=ft(lt.mark(function t(e){var n,r,a,o,i,u,c,s,l,f,p,d,h,m,y;return lt.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.type,r=e.name,a=e.callback,(o=e).abort)return t.abrupt("return",g(e));t.next=4;break;case 4:if(n!==rt.disablePlugin&&n!==rt.enablePlugin||J(a)&&a(r),n===rt.loadPlugin)return i=w(),u=Object.keys(i).filter(function(t){return e.plugins.includes(t)}).reduce(function(t,e){return t[e]=i[e],t},{}),c={type:rt.initializeStart,plugins:e.plugins},t.next=11,bt(c,u,b,v,S);t.next=13;break;case 11:return s=t.sent,t.abrupt("return",g(s));case 13:if(n===rt.initializeEnd&&(l=w(),f=Object.keys(l),p=f.filter(function(t){return e.plugins.includes(t)}).map(function(t){return l[t]}),d=[],h=[],m=p.map(function(e){var t=e.loaded,n=e.name;return pt(e,t,1e4).then(function(t){x[n]||(v.dispatch({type:rt.pluginReadyType(n),name:n,events:Object.keys(e).filter(function(t){return!nt.includes(t)})}),x[n]=!0),d=d.concat(n)}).catch(function(t){if(t instanceof Error)throw new Error(t);return h=h.concat(t.name),t})}),Promise.all(m).then(function(t){setTimeout(function(){f.length===m.length&&v.dispatch({type:rt.ready,plugins:d,failed:h})},0)})),n!==rt.bootstrap)return/^ready:([^:]*)$/.test(n)&&setTimeout(function(){return mt(v,w,b)},0),t.next=18,bt(e,w,b,v,S);t.next=20;break;case 18:return y=t.sent,t.abrupt("return",g(y));case 20:return t.abrupt("return",g(o));case 21:case"end":return t.stop()}},t)})),function(t){return e.apply(this,arguments)};var e}}),function(t){return function(o){return function(t){var e=t.type,n=t.key,r=t.value,a=t.options;if(e===rt.setItem||e===rt.removeItem){if(t.abort)return o(t);e===rt.setItem?B.setItem(n,r,a):B.removeItem(n,a)}return o(t)}}},(p=_,function(c){return function(u){return function(t){if(t.type===rt.bootstrap){var a=t.params,e=t.user;B.getItem(at)||p.storage.setItem(at,e.anonymousId);var n=Object.keys(t.params);if(n.length){var r=a.an_uid,o=a.an_event,i=n.reduce(function(t,e){if(e.match(ut)||e.match(/^(d|g)clid/)){var n=e.replace(ut,""),r="campaign"===n?"name":n;t.campaign[r]=a[e]}return e.match(ct)&&(t.props[e.replace(ct,"")]=a[e]),e.match(st)&&(t.traits[e.replace(st,"")]=a[e]),t},{campaign:{},props:{},traits:{}});c.dispatch($({type:rt.params,raw:a},i,{},r?{userId:r}:{})),r&&setTimeout(function(){return p.identify(r,i.traits)},0),o&&setTimeout(function(){return p.track(o,i.props)},0),Object.keys(i.campaign).length&&c.dispatch({type:rt.campaign,campaign:i.campaign})}}return u(t)}}}),(t=_,e=t.storage,s=e.setItem,l=e.removeItem,f=e.getItem,function(c){return function(u){return function(t){var e=t.userId,n=t.traits,r=t.options,a=t.callback;if(t.type===rt.reset&&([ot,it,at].forEach(function(t){return l(t)}),J(a)&&a()),t.type===rt.identify){var o=f(ot),i=f(it)||{};o&&o!==e&&c.dispatch({type:rt.userIdChanged,old:{userId:o,traits:i},new:{userId:e,traits:n},options:r}),e&&s(ot,e),n&&s(it,$({},i,{},n))}return u(t)}}}),E(me)]),N={context:Bt,user:ne,page:Ht,track:Kt,plugins:(u=m,function(){var n=0<arguments.length&&void 0!==arguments[0]?arguments[0]:Rt,t=1<arguments.length?arguments[1]:void 0,e={};if("initialize:aborted"===t.type)return n;if(/^registerPlugin:([^:]*)$/.test(t.type)){var r=t.type.split(":")[1],a=u()[r];return a&&r?(e[r]={enabled:!0,initialized:!a.initialize,loaded:Boolean(a.loaded()),config:a.config||{}},$({},n,{},e)):n}if(/^initialize:([^:]*)$/.test(t.type)){var o=t.type.split(":")[1],i=u()[o];return i&&o?(e[o]=$({},n[o],{},{initialized:!0,loaded:Boolean(i.loaded())}),$({},n,{},e)):n}if(/^ready:([^:]*)$/.test(t.type))return e[t.name]=$({},n[t.name],{},{loaded:!0}),$({},n,{},e);switch(t.type){case rt.disablePlugin:return Array.isArray(t.name)?e=t.name.reduce(function(t,e){return t[e]=$({},n[e],{},{enabled:!1}),t},n):e[t.name]=$({},n[t.name],{},{enabled:!1}),$({},n,{},e);case rt.enablePlugin:return Array.isArray(t.name)?e=t.name.reduce(function(t,e){return t[e]=$({},n[e],{},{enabled:!0}),t},n):e[t.name]=$({},n[t.name],{},{enabled:!0}),$({},n,{},e);default:return n}}),queue:te},A=tt,T=tt;if(H&&n.debug){var L=window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__;L&&(A=L({trace:!0,traceLimit:25})),T=function(){return 0===arguments.length?ce():Y(G(arguments[0]))?se(arguments[0]):se().apply(null,arguments)}}var M,z,D,V,q=(M=n,Object.keys(M).reduce(function(t,e){return"plugins"===e||"reducers"===e||(t[e]=M[e]),t},{})),R={context:q,user:P,plugins:o.pluginsArray.reduce(function(t,e){var n=e.name,r=e.config,a=e.loaded;return t[n]={enabled:!0,initialized:Boolean(!e.initialize),loaded:Boolean(a()),config:r||{}},t},{})},C=K(Q($({},N,{},r)),R,T(A(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,a=u(t,e,n),o=a.dispatch,i={getState:a.getState,dispatch:function(t){return o(t)}};return r=c.map(function(t){return t(i)}),o=tt.apply(void 0,U(r))(a.dispatch),$({},a,{dispatch:o})}}}.apply(void 0,U(j))))),F=Object.keys(c);return C.dispatch({type:rt.bootstrap,plugins:F,config:q,params:k,user:P}),C.dispatch({type:rt.registerPlugins,plugins:F}),o.pluginsArray.map(function(t,e){var n=t.bootstrap,r=t.config;n&&J(n)&&n({instance:_,config:r,payload:t});var a=o.pluginsArray.length===e+1;C.dispatch({type:rt.registerPluginType(t.name),name:t.name,plugin:t}),a&&C.dispatch({type:rt.initializeStart,plugins:F})}),ie(function(t){C.dispatch({type:t?rt.offline:rt.online})}),z=C,D=m,V=_,setInterval(function(){mt(z,D,V)},3e3),_}var he="before",me="after";return t.default=de,t.init=de,t.Analytics=de,t.EVENTS=rt,t.CONSTANTS=M,t}({}); |
{ | ||
"name": "analytics", | ||
"version": "0.3.2", | ||
"version": "0.3.4", | ||
"description": "Lightweight analytics library for tracking events, page views, & identifying users. Works with any third party analytics provider via an extendable plugin system.", | ||
@@ -58,4 +58,3 @@ "keywords": [ | ||
"dependencies": { | ||
"analytics-utils": "^0.1.2", | ||
"redux": "^3.6.0" | ||
"analytics-utils": "^0.2.0" | ||
}, | ||
@@ -90,3 +89,3 @@ "ava": { | ||
}, | ||
"gitHead": "ab351a29c49ae09c4e7a122995c7a08719c5e4d7" | ||
"gitHead": "f73593599a07304a54a8df833223d658e655476e" | ||
} |
@@ -70,12 +70,12 @@ <a href="https://getanalytics.io"> | ||
- You should never be locked into a analytics tool | ||
- You should never be locked into an analytics tool | ||
- DX is paramount. Adding & removing analytic tools from your application should be easy | ||
- Respecting visitor privacy settings & allowing for opt out mechanisms is crucial | ||
- Respecting visitor privacy settings & allowing for opt-out mechanisms is crucial | ||
- A pluggable API makes adding new business requests easy | ||
To add or remove an analytics provider adjust the `plugins` you load into `analytics`. | ||
To add or remove an analytics provider, adjust the `plugins` you load into `analytics` during initialization. | ||
## Install | ||
This module is distributed via [npm](https://npmjs.com/package/analytics) which is bundled with [node](https://nodejs.org/) and should be installed as one of your project's dependencies. | ||
This module is distributed via [npm](https://npmjs.com/package/analytics), which is bundled with [node](https://nodejs.org/) and should be installed as one of your project's dependencies. | ||
@@ -161,3 +161,3 @@ ```bash | ||
When importing global `analytics` into your project from a cdn the library is expose via a global `_analytics` variable. | ||
When importing global `analytics` into your project from a CDN, the library exposes via a global `_analytics` variable. | ||
@@ -650,2 +650,3 @@ Call `_analytics.init` to create an analytics instance. | ||
- [gatsby-plugin-analytics](https://github.com/DavidWells/analytics/tree/master/packages/gatsby-plugin-analytics) Easily add analytics to your Gatsby site [npm link](https://www.npmjs.com/package/gatsby-plugin-analytics). | ||
- [use-analytics](https://github.com/DavidWells/analytics/tree/master/packages/use-analytics) Analytics hooks for React [npm link](https://www.npmjs.com/package/use-analytics). | ||
- Add yours! 👇 | ||
@@ -720,3 +721,3 @@ <!-- AUTO-GENERATED-CONTENT:END --> | ||
For example, if you wanted to trigger custom logic when `analytics` bootstraps you can attach a function handler to the `bootstrap` event. | ||
For example, if you wanted to trigger custom logic when `analytics` bootstraps, you can attach a function handler to the `bootstrap` event. | ||
@@ -794,3 +795,3 @@ For a full list of core events, checkout [`events.js`](https://github.com/DavidWells/analytics/blob/master/packages/analytics-core/src/events.js). | ||
During development you can turn on `debug` mode. This will connect redux dev tools for you to visually see the analytics events passing through your application. | ||
During development, you can turn on `debug` mode. This will connect the dev tools for you to see the analytics events passing through your application visually. | ||
@@ -810,6 +811,4 @@ ![analytics-debug-tools](https://user-images.githubusercontent.com/532272/61163639-21da2300-a4c4-11e9-8743-b45d3a570271.gif) | ||
Contributions are always welcome, no matter how large or small. Before contributing, | ||
please read the [code of conduct](CODE_OF_CONDUCT.md). | ||
Contributions are always welcome, no matter how large or small. Before contributing, please read the [code of conduct](CODE_OF_CONDUCT.md). | ||
## Setup & Install dependencies | ||
@@ -825,3 +824,3 @@ | ||
This will setup all the packages and their dependencies. | ||
The above command will set up all the packages and their dependencies. | ||
@@ -835,1 +834,3 @@ ## Development | ||
``` | ||
While watch mode is activated, you can work against the demo site in examples to test out your changes on a live application. |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
786339
1
19293
829
+ Addedanalytics-utils@0.2.2(transitive)
- Removedredux@^3.6.0
- Removedanalytics-utils@0.1.3(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedlodash-es@4.17.21(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedredux@3.7.2(transitive)
- Removedsymbol-observable@1.2.0(transitive)
Updatedanalytics-utils@^0.2.0