diff --git a/app/api/config.js b/app/api/config.js index 48b8a577..9ea31796 100644 --- a/app/api/config.js +++ b/app/api/config.js @@ -6,7 +6,11 @@ var session = require('../lib/session'); exports.get = function(next) { var sessionAttrs = session.getSessionAttributes(); sessionAttrs.auid = session.getAppUserID(); - if (sessionAttrs.prms) sessionAttrs.prms = JSON.stringify(sessionAttrs.prms); + if (sessionAttrs.prms) + sessionAttrs.prms = JSON.stringify(sessionAttrs.prms); + + if (session.test_experiments) + sessionAttrs.uev = JSON.stringify(session.test_experiments); log.log("config_get", sessionAttrs, log.DEBUG); request.get("config", sessionAttrs, function(err, response) { diff --git a/app/functions/__tests__/reset_test.js b/app/functions/__tests__/reset_test.js index 9ae85ab2..a5ebcc8f 100644 --- a/app/functions/__tests__/reset_test.js +++ b/app/functions/__tests__/reset_test.js @@ -1,7 +1,7 @@ jest.dontMock('../reset'); describe("Taplytics.reset - uninitialized app", function() { -it("should error on if app is not initialized", function() { + it("should error on if app is not initialized", function() { var TaplyticsUninitialized = require('../../../test/helpers/uninitialized_app'); var logger = require('../../lib/logger'); diff --git a/app/functions/init.js b/app/functions/init.js index cff528d3..c719d26b 100644 --- a/app/functions/init.js +++ b/app/functions/init.js @@ -22,6 +22,9 @@ module.exports = function(token, options) { if (options.env) this.env = options.env; + + if (options.test_experiments) + session.test_experiments = options.test_experiments; } /* Initialization */ diff --git a/config.js b/config.js index f0bea705..4f0f5cc5 100644 --- a/config.js +++ b/config.js @@ -15,7 +15,7 @@ exports.obj = function() { config.functionFlushQueueTimeout = 500; - config.sdkVersion = "1.0"; + config.sdkVersion = "1.0.1"; return config; }; diff --git a/dist/taplytics.min.js b/dist/taplytics.min.js index f6798438..fb882f33 100644 --- a/dist/taplytics.min.js +++ b/dist/taplytics.min.js @@ -1,2 +1,2 @@ -!function e(t,i,r){function n(s,a){if(!i[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=i[s]={exports:{}};t[s][0].call(l.exports,function(e){var i=t[s][1][e];return n(i?i:e)},l,l.exports,e,t,i,r)}return i[s].exports}for(var o="function"==typeof require&&require,s=0;s=e}var n=0;i.LOUD=3,i.DEBUG=2,i.LOG=1,i.USER=0,i.setPriorityLevel=function(e){n=e},i.log=function(e,t,i){(void 0===i||r(i))&&(console.log("[Taplytics]",e),t&&console.dir(t))},i.error=function(e,t,i){(void 0===i||r(i))&&(console.error("[Taplytics]",e),t&&console.dir(t))}},{}],21:[function(e,t,i){t.exports=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}},{}],22:[function(e,t,i){function r(){var e=[];this.length=function(){return e.length},this.isEmpty=function(){return 0===e.length},this.enqueue=function(t){e.push(t)},this.enqueueAll=function(e){if(!e||e&&"array"!=typeof e)return 0;var t=0;for(t=0;t0?e[0]:void 0}}t.exports=r},{}],23:[function(e,t,i){function r(e,t,i){var r=new Date(e);switch(t.toLowerCase()){case"year":r.setFullYear(r.getFullYear()+i);break;case"quarter":r.setMonth(r.getMonth()+3*i);break;case"month":r.setMonth(r.getMonth()+i);break;case"week":r.setDate(r.getDate()+7*i);break;case"day":r.setDate(r.getDate()+i);break;case"hour":r.setTime(r.getTime()+36e5*i);break;case"minute":r.setTime(r.getTime()+6e4*i);break;case"second":r.setTime(r.getTime()+1e3*i);break;default:r=void 0}return r}var n=e("./cookies"),o=e("uuid"),s=e("./logger"),a=e("../../config"),u=e("../lib/source"),c=e("../lib/location"),l={cookieSessionID:"_tl_csid",sessionUUID:"_tl_suuid",sessionID:"_tl_sid",appUserID:"_tl_auid",sessionOptions:function(e,t){return e&&t?"tl_sopts_"+e+"_"+t:null}};i.data={},i.hasLoadedData=!1,i.start=function(){return i.updateCookieSession().setSessionUUID(),i},i.get=function(e,t){if(e){i.tick();var r=i.getCookieSessionID(),o=l.sessionOptions(r,e);if(o){if(!(t&&JSON&&JSON.parse))return n.get(o);var a=n.get(o);try{return JSON.parse(a)}catch(u){return s.error("Session.get("+e+") failed to parse JSON.",u,s.DEBUG),a}}}},i.tick=function(){return i.updateCookieSession(),i},i.set=function(e,t,o){if(!e||void 0===t||0===(""+t).length)return!1;i.tick();var s=i.getCookieSessionID(),a=l.sessionOptions(s,e),u=r(new Date,"minute",30),c=t;return a?(o&&JSON&&JSON.stringify&&(c=JSON.stringify(t)),n.set(a,c,{expires:u}),!0):!1},i.unset=function(e){if(!e)return!1;i.tick();var t=i.getCookieSessionID(),r=l.sessionOptions(t,e);n.expire(r)},i.updateCookieSession=function(){var e=i.getCookieSessionID();e||(e=o.v4(),i.deleteSessionID());var t=r(new Date,"minute",30);return n.set(l.cookieSessionID,e,{expires:t}),s.log("Set cookieSessionID to: "+e,{expires:t},s.DEBUG),i},i.setSessionUUID=function(){var e=i.getSessionUUID();return e||(e=o.v4()),n.set(l.sessionUUID,e),s.log("Set sessionUUID to: "+e,null,s.DEBUG),i},i.deleteSessionID=function(){return n.expire(l.sessionID),i},i.deleteAppUserID=function(){return n.expire(l.appUserID),i},i.setSessionID=function(e){return n.set(l.sessionID,e),s.log("Set sessionID to: "+e,null,s.DEBUG),i},i.setAppUserID=function(e){return n.set(l.appUserID,e),s.log("Set appUserID to: "+e,null,s.DEBUG),i},i.getSessionUUID=function(){return n.get(l.sessionUUID)},i.getCookieSessionID=function(){return n.get(l.cookieSessionID)},i.getAppUserID=function(){return n.get(l.appUserID)},i.getSessionID=function(){return n.get(l.sessionID)},i.getSessionAttributes=function(e){e=e||{};var t=c.toObject(),i=u();return e.sid=this.getSessionID(),e.ad=this.getSessionUUID(),e.adt="browser",e.ct="browser",e.lv=a.isProduction()?"0":"1",e.sdk=a.sdkVersion,e.rfr=i.referrer,e.exm=i.search.utm_medium,e.exs=i.search.utm_source,e.exc=i.search.utm_campaign,e.ext=i.search.utm_term,e.exct=i.search.utm_content,e.prms={search:i.search,location:t},navigator&&navigator.userAgent&&(e.prms.userAgent=navigator.userAgent),e},i.saveSessionConfig=function(e){i.config=e,e&&(i.hasLoadedData=!0,i.setAppUserID(e.app_user_id),i.setSessionID(e.session_id),i.tick());for(var t=0,t=0;t0){n.log("flushAppQueue: "+e.length,e,n.LOUD);for(var t=0;tr;++r)i[r].apply(this,t)}return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},{}],30:[function(e,t,i){!function(){"use strict";function e(t,i,r,n){return this instanceof e?(this.domain=t||void 0,this.path=i||"/",this.secure=!!r,this.script=!!n,this):new e(t,i,r,n)}function t(e,i,r){return e instanceof t?e:this instanceof t?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(r||"/"),this.explicit_path=!1,this.domain=i||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,e&&this.parse(e,i,r),this):new t(e,i,r)}function r(){var e,i,n;return this instanceof r?(e=Object.create(null),this.setCookie=function(r,o,s){var a,u;if(r=new t(r,o,s),a=r.expiration_date<=Date.now(),void 0!==e[r.name]){for(i=e[r.name],u=0;uo;++o){var a=n[o],u=-1===a.indexOf("]=")?a.indexOf("="):a.indexOf("]=")+1;if(-1===u)i[r.decode(a)]="";else{var c=r.decode(a.slice(0,u)),l=r.decode(a.slice(u+1));Object.prototype.hasOwnProperty.call(i,c)?i[c]=[].concat(i[c]).concat(l):i[c]=l}}return i},n.parseObject=function(e,t,i){if(!e.length)return t;var r=e.shift(),o={};if("[]"===r)o=[],o=o.concat(n.parseObject(e,t,i));else{var s="["===r[0]&&"]"===r[r.length-1]?r.slice(1,r.length-1):r,a=parseInt(s,10),u=""+a;!isNaN(a)&&r!==s&&u===s&&a>=0&&a<=i.arrayLimit?(o=[],o[a]=n.parseObject(e,t,i)):o[s]=n.parseObject(e,t,i)}return o},n.parseKeys=function(e,t,i){if(e){var r=/^([^\[\]]*)/,o=/(\[[^\[\]]*\])/g,s=r.exec(e);if(!Object.prototype.hasOwnProperty(s[1])){var a=[];s[1]&&a.push(s[1]);for(var u=0;null!==(s=o.exec(e))&&ua;++a){var c=s[a],l=n.parseKeys(c,i[c],t);o=r.merge(o,l)}return r.compact(o)}},{"./utils":35}],34:[function(e,t,i){var r=e("./utils"),n={delimiter:"&",arrayPrefixGenerators:{brackets:function(e,t){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e,t){return e}}};n.stringify=function(e,t,i){if(r.isBuffer(e)?e=e.toString():e instanceof Date?e=e.toISOString():null===e&&(e=""),"string"==typeof e||"number"==typeof e||"boolean"==typeof e)return[encodeURIComponent(t)+"="+encodeURIComponent(e)];var o=[];if("undefined"==typeof e)return o;for(var s=Object.keys(e),a=0,u=s.length;u>a;++a){var c=s[a];o=Array.isArray(e)?o.concat(n.stringify(e[c],i(t,c),i)):o.concat(n.stringify(e[c],t+"["+c+"]",i))}return o},t.exports=function(e,t){t=t||{};var i="undefined"==typeof t.delimiter?n.delimiter:t.delimiter,r=[];if("object"!=typeof e||null===e)return"";var o;o=t.arrayFormat in n.arrayPrefixGenerators?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":"indices";for(var s=n.arrayPrefixGenerators[o],a=Object.keys(e),u=0,c=a.length;c>u;++u){var l=a[u];r=r.concat(n.stringify(e[l],l,s))}return r.join(i)}},{"./utils":35}],35:[function(e,t,i){i.arrayToObject=function(e){for(var t={},i=0,r=e.length;r>i;++i)"undefined"!=typeof e[i]&&(t[i]=e[i]);return t},i.merge=function(e,t){if(!t)return e;if("object"!=typeof t)return Array.isArray(e)?e.push(t):e[t]=!0,e;if("object"!=typeof e)return e=[e].concat(t);Array.isArray(e)&&!Array.isArray(t)&&(e=i.arrayToObject(e));for(var r=Object.keys(t),n=0,o=r.length;o>n;++n){var s=r[n],a=t[s];e[s]?e[s]=i.merge(e[s],a):e[s]=a}return e},i.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},i.compact=function(e,t){if("object"!=typeof e||null===e)return e;t=t||[];var r=t.indexOf(e);if(-1!==r)return t[r];if(t.push(e),Array.isArray(e)){for(var n=[],o=0,s=e.length;s>o;++o)"undefined"!=typeof e[o]&&n.push(e[o]);return n}var a=Object.keys(e);for(o=0,s=a.length;s>o;++o){var u=a[o];e[u]=i.compact(e[u],t)}return e},i.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},i.isBuffer=function(e){return null===e||"undefined"==typeof e?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},{}],36:[function(e,t,i){t.exports=function(e,t,i){for(var r=0,n=e.length,o=3==arguments.length?i:e[r++];n>r;)o=t.call(null,o,e[r],++r,e);return o}},{}],37:[function(e,t,i){function r(){}function n(e){var t={}.toString.call(e);switch(t){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function o(e){if(!b(e))return e;var t=[];for(var i in e)null!=e[i]&&s(t,i,e[i]);return t.join("&")}function s(e,t,i){return Array.isArray(i)?i.forEach(function(i){s(e,t,i)}):void e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}function a(e){for(var t,i,r={},n=e.split("&"),o=0,s=n.length;s>o;++o)i=n[o],t=i.split("="),r[decodeURIComponent(t[0])]=decodeURIComponent(t[1]);return r}function u(e){var t,i,r,n,o=e.split(/\r?\n/),s={};o.pop();for(var a=0,u=o.length;u>a;++a)i=o[a],t=i.indexOf(":"),r=i.slice(0,t).toLowerCase(),n=w(i.slice(t+1)),s[r]=n;return s}function c(e){return/[\/+]json\b/.test(e)}function l(e){return e.split(/ *; */).shift()}function p(e){return y(e.split(/ *; */),function(e,t){var i=t.split(/ *= */),r=i.shift(),n=i.shift();return r&&n&&(e[r]=n),e},{})}function f(e,t){t=t||{},this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||"undefined"==typeof this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText,this.setStatusProperties(this.xhr.status),this.header=this.headers=u(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this.parseBody(this.text?this.text:this.xhr.response):null}function h(e,t){var i=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new f(i)}catch(r){return e=new Error("Parser is unable to parse the response"),e.parse=!0,e.original=r,e.rawResponse=i.xhr&&i.xhr.responseText?i.xhr.responseText:null,e.statusCode=i.xhr&&i.xhr.status?i.xhr.status:null,i.callback(e)}if(i.emit("response",t),e)return i.callback(e,t);if(t.status>=200&&t.status<300)return i.callback(e,t);var n=new Error(t.statusText||"Unsuccessful HTTP response");n.original=e,n.response=t,n.status=t.status,i.callback(n,t)})}function d(e,t){var i=_("DELETE",e);return t&&i.end(t),i}var g,v=e("emitter"),y=e("reduce"),m=e("./request-base"),b=e("./is-object"); -g="undefined"!=typeof window?window:"undefined"!=typeof self?self:this;var _=t.exports=e("./request").bind(null,h);_.getXHR=function(){if(!(!g.XMLHttpRequest||g.location&&"file:"==g.location.protocol&&g.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1};var w="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};_.serializeObject=o,_.parseString=a,_.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},_.serialize={"application/x-www-form-urlencoded":o,"application/json":JSON.stringify},_.parse={"application/x-www-form-urlencoded":a,"application/json":JSON.parse},f.prototype.get=function(e){return this.header[e.toLowerCase()]},f.prototype.setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=l(t);var i=p(t);for(var r in i)this[r]=i[r]},f.prototype.parseBody=function(e){var t=_.parse[this.type];return!t&&c(this.type)&&(t=_.parse["application/json"]),t&&e&&(e.length||e instanceof Object)?t(e):null},f.prototype.setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=4==t||5==t?this.toError():!1,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},f.prototype.toError=function(){var e=this.req,t=e.method,i=e.url,r="cannot "+t+" "+i+" ("+this.status+")",n=new Error(r);return n.status=this.status,n.method=t,n.url=i,n},_.Response=f,v(h.prototype);for(var k in m)h.prototype[k]=m[k];h.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},h.prototype.type=function(e){return this.set("Content-Type",_.types[e]||e),this},h.prototype.responseType=function(e){return this._responseType=e,this},h.prototype.accept=function(e){return this.set("Accept",_.types[e]||e),this},h.prototype.auth=function(e,t,i){switch(i||(i={type:"basic"}),i.type){case"basic":var r=btoa(e+":"+t);this.set("Authorization","Basic "+r);break;case"auto":this.username=e,this.password=t}return this},h.prototype.query=function(e){return"string"!=typeof e&&(e=o(e)),e&&this._query.push(e),this},h.prototype.attach=function(e,t,i){return this._getFormData().append(e,t,i||t.name),this},h.prototype._getFormData=function(){return this._formData||(this._formData=new g.FormData),this._formData},h.prototype.send=function(e){var t=b(e),i=this._header["content-type"];if(t&&b(this._data))for(var r in e)this._data[r]=e[r];else"string"==typeof e?(i||this.type("form"),i=this._header["content-type"],"application/x-www-form-urlencoded"==i?this._data=this._data?this._data+"&"+e:e:this._data=(this._data||"")+e):this._data=e;return!t||n(e)?this:(i||this.type("json"),this)},f.prototype.parse=function(e){return g.console&&console.warn("Client-side parse() method has been renamed to serialize(). This method is not compatible with superagent v2.0"),this.serialize(e),this},f.prototype.serialize=function(e){return this._parser=e,this},h.prototype.callback=function(e,t){var i=this._callback;this.clearTimeout(),i(e,t)},h.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},h.prototype.timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},h.prototype.withCredentials=function(){return this._withCredentials=!0,this},h.prototype.end=function(e){var t=this,i=this.xhr=_.getXHR(),o=this._query.join("&"),s=this._timeout,a=this._formData||this._data;this._callback=e||r,i.onreadystatechange=function(){if(4==i.readyState){var e;try{e=i.status}catch(r){e=0}if(0==e){if(t.timedout)return t.timeoutError();if(t.aborted)return;return t.crossDomainError()}t.emit("end")}};var u=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),e.direction="download",t.emit("progress",e)};this.hasListeners("progress")&&(i.onprogress=u);try{i.upload&&this.hasListeners("progress")&&(i.upload.onprogress=u)}catch(l){}if(s&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},s)),o&&(o=_.serializeObject(o),this.url+=~this.url.indexOf("?")?"&"+o:"?"+o),this.username&&this.password?i.open(this.method,this.url,!0,this.username,this.password):i.open(this.method,this.url,!0),this._withCredentials&&(i.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof a&&!n(a)){var p=this._header["content-type"],f=this._parser||_.serialize[p?p.split(";")[0]:""];!f&&c(p)&&(f=_.serialize["application/json"]),f&&(a=f(a))}for(var h in this.header)null!=this.header[h]&&i.setRequestHeader(h,this.header[h]);return this._responseType&&(i.responseType=this._responseType),this.emit("request",this),i.send("undefined"!=typeof a?a:null),this},_.Request=h,_.get=function(e,t,i){var r=_("GET",e);return"function"==typeof t&&(i=t,t=null),t&&r.query(t),i&&r.end(i),r},_.head=function(e,t,i){var r=_("HEAD",e);return"function"==typeof t&&(i=t,t=null),t&&r.send(t),i&&r.end(i),r},_.del=d,_["delete"]=d,_.patch=function(e,t,i){var r=_("PATCH",e);return"function"==typeof t&&(i=t,t=null),t&&r.send(t),i&&r.end(i),r},_.post=function(e,t,i){var r=_("POST",e);return"function"==typeof t&&(i=t,t=null),t&&r.send(t),i&&r.end(i),r},_.put=function(e,t,i){var r=_("PUT",e);return"function"==typeof t&&(i=t,t=null),t&&r.send(t),i&&r.end(i),r}},{"./is-object":38,"./request":40,"./request-base":39,emitter:29,reduce:36}],38:[function(e,t,i){function r(e){return null!=e&&"object"==typeof e}t.exports=r},{}],39:[function(e,t,i){var r=e("./is-object");i.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},i.parse=function(e){return this._parser=e,this},i.timeout=function(e){return this._timeout=e,this},i.then=function(e,t){return this.end(function(i,r){i?t(i):e(r)})},i.use=function(e){return e(this),this},i.get=function(e){return this._header[e.toLowerCase()]},i.getHeader=i.get,i.set=function(e,t){if(r(e)){for(var i in e)this.set(i,e[i]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},i.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},i.field=function(e,t){return this._getFormData().append(e,t),this}},{"./is-object":38}],40:[function(e,t,i){function r(e,t,i){return"function"==typeof i?new e("GET",t).end(i):2==arguments.length?new e("GET",t):new e(t,i)}t.exports=r},{}],41:[function(e,t,i){(function(e){var i;if(e.crypto&&crypto.getRandomValues){var r=new Uint8Array(16);i=function(){return crypto.getRandomValues(r),r}}if(!i){var n=new Array(16);i=function(){for(var e,t=0;16>t;t++)0===(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],42:[function(e,t,i){function r(e,t,i){var r=t&&i||0,n=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){16>n&&(t[r+n++]=c[e])});16>n;)t[r+n++]=0;return t}function n(e,t){var i=t||0,r=u;return r[e[i++]]+r[e[i++]]+r[e[i++]]+r[e[i++]]+"-"+r[e[i++]]+r[e[i++]]+"-"+r[e[i++]]+r[e[i++]]+"-"+r[e[i++]]+r[e[i++]]+"-"+r[e[i++]]+r[e[i++]]+r[e[i++]]+r[e[i++]]+r[e[i++]]+r[e[i++]]}function o(e,t,i){var r=t&&i||0,o=t||[];e=e||{};var s=void 0!==e.clockseq?e.clockseq:h,a=void 0!==e.msecs?e.msecs:(new Date).getTime(),u=void 0!==e.nsecs?e.nsecs:g+1,c=a-d+(u-g)/1e4;if(0>c&&void 0===e.clockseq&&(s=s+1&16383),(0>c||a>d)&&void 0===e.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=a,g=u,h=s,a+=122192928e5;var l=(1e4*(268435455&a)+u)%4294967296;o[r++]=l>>>24&255,o[r++]=l>>>16&255,o[r++]=l>>>8&255,o[r++]=255&l;var p=a/4294967296*1e4&268435455;o[r++]=p>>>8&255,o[r++]=255&p,o[r++]=p>>>24&15|16,o[r++]=p>>>16&255,o[r++]=s>>>8|128,o[r++]=255&s;for(var v=e.node||f,y=0;6>y;y++)o[r+y]=v[y];return t?t:n(o)}function s(e,t,i){var r=t&&i||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null),e=e||{};var o=e.random||(e.rng||a)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;16>s;s++)t[r+s]=o[s];return t||n(o)}for(var a=e("./rng"),u=[],c={},l=0;256>l;l++)u[l]=(l+256).toString(16).substr(1),c[u[l]]=l;var p=a(),f=[1|p[0],p[1],p[2],p[3],p[4],p[5]],h=16383&(p[6]<<8|p[7]),d=0,g=0,v=s;v.v1=o,v.v4=s,v.parse=r,v.unparse=n,t.exports=v},{"./rng":41}]},{},[28]); \ No newline at end of file +!function e(t,i,r){function n(o,a){if(!i[o]){if(!t[o]){var u="function"==typeof require&&require;if(!a&&u)return u(o,!0);if(s)return s(o,!0);var c=new Error("Cannot find module '"+o+"'");throw c.code="MODULE_NOT_FOUND",c}var l=i[o]={exports:{}};t[o][0].call(l.exports,function(e){var i=t[o][1][e];return n(i?i:e)},l,l.exports,e,t,i,r)}return i[o].exports}for(var s="function"==typeof require&&require,o=0;o=e}var n=0;i.LOUD=3,i.DEBUG=2,i.LOG=1,i.USER=0,i.setPriorityLevel=function(e){n=e},i.log=function(e,t,i){(void 0===i||r(i))&&(console.log("[Taplytics]",e),t&&console.dir(t))},i.error=function(e,t,i){(void 0===i||r(i))&&(console.error("[Taplytics]",e),t&&console.dir(t))}},{}],21:[function(e,t,i){t.exports=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e}},{}],22:[function(e,t,i){function r(){var e=[];this.length=function(){return e.length},this.isEmpty=function(){return 0===e.length},this.enqueue=function(t){e.push(t)},this.enqueueAll=function(e){if(!e||e&&"array"!=typeof e)return 0;var t=0;for(t=0;t0?e[0]:void 0}}t.exports=r},{}],23:[function(e,t,i){function r(e,t,i){var r=new Date(e);switch(t.toLowerCase()){case"year":r.setFullYear(r.getFullYear()+i);break;case"quarter":r.setMonth(r.getMonth()+3*i);break;case"month":r.setMonth(r.getMonth()+i);break;case"week":r.setDate(r.getDate()+7*i);break;case"day":r.setDate(r.getDate()+i);break;case"hour":r.setTime(r.getTime()+36e5*i);break;case"minute":r.setTime(r.getTime()+6e4*i);break;case"second":r.setTime(r.getTime()+1e3*i);break;default:r=void 0}return r}var n=e("./cookies"),s=e("uuid"),o=e("./logger"),a=e("../../config"),u=e("../lib/source"),c=e("../lib/location"),l={cookieSessionID:"_tl_csid",sessionUUID:"_tl_suuid",sessionID:"_tl_sid",appUserID:"_tl_auid",sessionOptions:function(e,t){return e&&t?"tl_sopts_"+e+"_"+t:null}};i.data={},i.hasLoadedData=!1,i.start=function(){return i.updateCookieSession().setSessionUUID(),i},i.get=function(e,t){if(e){i.tick();var r=i.getCookieSessionID(),s=l.sessionOptions(r,e);if(s){if(!(t&&JSON&&JSON.parse))return n.get(s);var a=n.get(s);try{return JSON.parse(a)}catch(u){return o.error("Session.get("+e+") failed to parse JSON.",u,o.DEBUG),a}}}},i.tick=function(){return i.updateCookieSession(),i},i.set=function(e,t,s){if(!e||void 0===t||0===(""+t).length)return!1;i.tick();var o=i.getCookieSessionID(),a=l.sessionOptions(o,e),u=r(new Date,"minute",30),c=t;return a?(s&&JSON&&JSON.stringify&&(c=JSON.stringify(t)),n.set(a,c,{expires:u}),!0):!1},i.unset=function(e){if(!e)return!1;i.tick();var t=i.getCookieSessionID(),r=l.sessionOptions(t,e);n.expire(r)},i.updateCookieSession=function(){var e=i.getCookieSessionID();e||(e=s.v4(),i.deleteSessionID());var t=r(new Date,"minute",30);return n.set(l.cookieSessionID,e,{expires:t}),o.log("Set cookieSessionID to: "+e,{expires:t},o.DEBUG),i},i.setSessionUUID=function(){var e=i.getSessionUUID();return e||(e=s.v4()),n.set(l.sessionUUID,e),o.log("Set sessionUUID to: "+e,null,o.DEBUG),i},i.deleteSessionID=function(){return n.expire(l.sessionID),i},i.deleteAppUserID=function(){return n.expire(l.appUserID),i},i.setSessionID=function(e){return n.set(l.sessionID,e),o.log("Set sessionID to: "+e,null,o.DEBUG),i},i.setAppUserID=function(e){return n.set(l.appUserID,e),o.log("Set appUserID to: "+e,null,o.DEBUG),i},i.getSessionUUID=function(){return n.get(l.sessionUUID)},i.getCookieSessionID=function(){return n.get(l.cookieSessionID)},i.getAppUserID=function(){return n.get(l.appUserID)},i.getSessionID=function(){return n.get(l.sessionID)},i.getSessionAttributes=function(e){e=e||{};var t=c.toObject(),i=u();return e.sid=this.getSessionID(),e.ad=this.getSessionUUID(),e.adt="browser",e.ct="browser",e.lv=a.isProduction()?"0":"1",e.sdk=a.sdkVersion,e.rfr=i.referrer,e.exm=i.search.utm_medium,e.exs=i.search.utm_source,e.exc=i.search.utm_campaign,e.ext=i.search.utm_term,e.exct=i.search.utm_content,e.prms={search:i.search,location:t},navigator&&navigator.userAgent&&(e.prms.userAgent=navigator.userAgent),e},i.saveSessionConfig=function(e){i.config=e,e&&(i.hasLoadedData=!0,i.setAppUserID(e.app_user_id),i.setSessionID(e.session_id),i.tick());for(var t=0,t=0;t0){n.log("flushAppQueue: "+e.length,e,n.LOUD);for(var t=0;tr;++r)i[r].apply(this,t)}return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}},{}],30:[function(e,t,i){!function(){"use strict";function e(t,i,r,n){return this instanceof e?(this.domain=t||void 0,this.path=i||"/",this.secure=!!r,this.script=!!n,this):new e(t,i,r,n)}function t(e,i,r){return e instanceof t?e:this instanceof t?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(r||"/"),this.explicit_path=!1,this.domain=i||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,e&&this.parse(e,i,r),this):new t(e,i,r)}function r(){var e,i,n;return this instanceof r?(e=Object.create(null),this.setCookie=function(r,s,o){var a,u;if(r=new t(r,s,o),a=r.expiration_date<=Date.now(),void 0!==e[r.name]){for(i=e[r.name],u=0;us;++s){var a=n[s],u=-1===a.indexOf("]=")?a.indexOf("="):a.indexOf("]=")+1;if(-1===u)i[r.decode(a)]="";else{var c=r.decode(a.slice(0,u)),l=r.decode(a.slice(u+1));Object.prototype.hasOwnProperty.call(i,c)?i[c]=[].concat(i[c]).concat(l):i[c]=l}}return i},n.parseObject=function(e,t,i){if(!e.length)return t;var r=e.shift(),s={};if("[]"===r)s=[],s=s.concat(n.parseObject(e,t,i));else{var o="["===r[0]&&"]"===r[r.length-1]?r.slice(1,r.length-1):r,a=parseInt(o,10),u=""+a;!isNaN(a)&&r!==o&&u===o&&a>=0&&a<=i.arrayLimit?(s=[],s[a]=n.parseObject(e,t,i)):s[o]=n.parseObject(e,t,i)}return s},n.parseKeys=function(e,t,i){if(e){var r=/^([^\[\]]*)/,s=/(\[[^\[\]]*\])/g,o=r.exec(e);if(!Object.prototype.hasOwnProperty(o[1])){var a=[];o[1]&&a.push(o[1]);for(var u=0;null!==(o=s.exec(e))&&ua;++a){var c=o[a],l=n.parseKeys(c,i[c],t);s=r.merge(s,l)}return r.compact(s)}},{"./utils":35}],34:[function(e,t,i){var r=e("./utils"),n={delimiter:"&",arrayPrefixGenerators:{brackets:function(e,t){return e+"[]"},indices:function(e,t){return e+"["+t+"]"},repeat:function(e,t){return e}}};n.stringify=function(e,t,i){if(r.isBuffer(e)?e=e.toString():e instanceof Date?e=e.toISOString():null===e&&(e=""),"string"==typeof e||"number"==typeof e||"boolean"==typeof e)return[encodeURIComponent(t)+"="+encodeURIComponent(e)];var s=[];if("undefined"==typeof e)return s;for(var o=Object.keys(e),a=0,u=o.length;u>a;++a){var c=o[a];s=Array.isArray(e)?s.concat(n.stringify(e[c],i(t,c),i)):s.concat(n.stringify(e[c],t+"["+c+"]",i))}return s},t.exports=function(e,t){t=t||{};var i="undefined"==typeof t.delimiter?n.delimiter:t.delimiter,r=[];if("object"!=typeof e||null===e)return"";var s;s=t.arrayFormat in n.arrayPrefixGenerators?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":"indices";for(var o=n.arrayPrefixGenerators[s],a=Object.keys(e),u=0,c=a.length;c>u;++u){var l=a[u];r=r.concat(n.stringify(e[l],l,o))}return r.join(i)}},{"./utils":35}],35:[function(e,t,i){i.arrayToObject=function(e){for(var t={},i=0,r=e.length;r>i;++i)"undefined"!=typeof e[i]&&(t[i]=e[i]);return t},i.merge=function(e,t){if(!t)return e;if("object"!=typeof t)return Array.isArray(e)?e.push(t):e[t]=!0,e;if("object"!=typeof e)return e=[e].concat(t);Array.isArray(e)&&!Array.isArray(t)&&(e=i.arrayToObject(e));for(var r=Object.keys(t),n=0,s=r.length;s>n;++n){var o=r[n],a=t[o];e[o]?e[o]=i.merge(e[o],a):e[o]=a}return e},i.decode=function(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return e}},i.compact=function(e,t){if("object"!=typeof e||null===e)return e;t=t||[];var r=t.indexOf(e);if(-1!==r)return t[r];if(t.push(e),Array.isArray(e)){for(var n=[],s=0,o=e.length;o>s;++s)"undefined"!=typeof e[s]&&n.push(e[s]);return n}var a=Object.keys(e);for(s=0,o=a.length;o>s;++s){var u=a[s];e[u]=i.compact(e[u],t)}return e},i.isRegExp=function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},i.isBuffer=function(e){return null===e||"undefined"==typeof e?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}},{}],36:[function(e,t,i){t.exports=function(e,t,i){for(var r=0,n=e.length,s=3==arguments.length?i:e[r++];n>r;)s=t.call(null,s,e[r],++r,e);return s}},{}],37:[function(e,t,i){function r(){}function n(e){var t={}.toString.call(e);switch(t){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function s(e){if(!b(e))return e;var t=[];for(var i in e)null!=e[i]&&o(t,i,e[i]);return t.join("&")}function o(e,t,i){return Array.isArray(i)?i.forEach(function(i){o(e,t,i)}):void e.push(encodeURIComponent(t)+"="+encodeURIComponent(i))}function a(e){for(var t,i,r={},n=e.split("&"),s=0,o=n.length;o>s;++s)i=n[s],t=i.split("="),r[decodeURIComponent(t[0])]=decodeURIComponent(t[1]);return r}function u(e){var t,i,r,n,s=e.split(/\r?\n/),o={};s.pop();for(var a=0,u=s.length;u>a;++a)i=s[a],t=i.indexOf(":"),r=i.slice(0,t).toLowerCase(),n=w(i.slice(t+1)),o[r]=n;return o}function c(e){return/[\/+]json\b/.test(e)}function l(e){return e.split(/ *; */).shift()}function p(e){return y(e.split(/ *; */),function(e,t){var i=t.split(/ *= */),r=i.shift(),n=i.shift();return r&&n&&(e[r]=n),e},{})}function f(e,t){t=t||{},this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!=this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||"undefined"==typeof this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText,this.setStatusProperties(this.xhr.status),this.header=this.headers=u(this.xhr.getAllResponseHeaders()),this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this.setHeaderProperties(this.header),this.body="HEAD"!=this.req.method?this.parseBody(this.text?this.text:this.xhr.response):null}function h(e,t){var i=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",function(){var e=null,t=null;try{t=new f(i)}catch(r){return e=new Error("Parser is unable to parse the response"),e.parse=!0,e.original=r,e.rawResponse=i.xhr&&i.xhr.responseText?i.xhr.responseText:null,e.statusCode=i.xhr&&i.xhr.status?i.xhr.status:null,i.callback(e)}if(i.emit("response",t),e)return i.callback(e,t);if(t.status>=200&&t.status<300)return i.callback(e,t);var n=new Error(t.statusText||"Unsuccessful HTTP response");n.original=e,n.response=t,n.status=t.status,i.callback(n,t); +})}function d(e,t){var i=_("DELETE",e);return t&&i.end(t),i}var g,v=e("emitter"),y=e("reduce"),m=e("./request-base"),b=e("./is-object");g="undefined"!=typeof window?window:"undefined"!=typeof self?self:this;var _=t.exports=e("./request").bind(null,h);_.getXHR=function(){if(!(!g.XMLHttpRequest||g.location&&"file:"==g.location.protocol&&g.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1};var w="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};_.serializeObject=s,_.parseString=a,_.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},_.serialize={"application/x-www-form-urlencoded":s,"application/json":JSON.stringify},_.parse={"application/x-www-form-urlencoded":a,"application/json":JSON.parse},f.prototype.get=function(e){return this.header[e.toLowerCase()]},f.prototype.setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=l(t);var i=p(t);for(var r in i)this[r]=i[r]},f.prototype.parseBody=function(e){var t=_.parse[this.type];return!t&&c(this.type)&&(t=_.parse["application/json"]),t&&e&&(e.length||e instanceof Object)?t(e):null},f.prototype.setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=4==t||5==t?this.toError():!1,this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},f.prototype.toError=function(){var e=this.req,t=e.method,i=e.url,r="cannot "+t+" "+i+" ("+this.status+")",n=new Error(r);return n.status=this.status,n.method=t,n.url=i,n},_.Response=f,v(h.prototype);for(var k in m)h.prototype[k]=m[k];h.prototype.abort=function(){return this.aborted?void 0:(this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this)},h.prototype.type=function(e){return this.set("Content-Type",_.types[e]||e),this},h.prototype.responseType=function(e){return this._responseType=e,this},h.prototype.accept=function(e){return this.set("Accept",_.types[e]||e),this},h.prototype.auth=function(e,t,i){switch(i||(i={type:"basic"}),i.type){case"basic":var r=btoa(e+":"+t);this.set("Authorization","Basic "+r);break;case"auto":this.username=e,this.password=t}return this},h.prototype.query=function(e){return"string"!=typeof e&&(e=s(e)),e&&this._query.push(e),this},h.prototype.attach=function(e,t,i){return this._getFormData().append(e,t,i||t.name),this},h.prototype._getFormData=function(){return this._formData||(this._formData=new g.FormData),this._formData},h.prototype.send=function(e){var t=b(e),i=this._header["content-type"];if(t&&b(this._data))for(var r in e)this._data[r]=e[r];else"string"==typeof e?(i||this.type("form"),i=this._header["content-type"],"application/x-www-form-urlencoded"==i?this._data=this._data?this._data+"&"+e:e:this._data=(this._data||"")+e):this._data=e;return!t||n(e)?this:(i||this.type("json"),this)},f.prototype.parse=function(e){return g.console&&console.warn("Client-side parse() method has been renamed to serialize(). This method is not compatible with superagent v2.0"),this.serialize(e),this},f.prototype.serialize=function(e){return this._parser=e,this},h.prototype.callback=function(e,t){var i=this._callback;this.clearTimeout(),i(e,t)},h.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},h.prototype.timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},h.prototype.withCredentials=function(){return this._withCredentials=!0,this},h.prototype.end=function(e){var t=this,i=this.xhr=_.getXHR(),s=this._query.join("&"),o=this._timeout,a=this._formData||this._data;this._callback=e||r,i.onreadystatechange=function(){if(4==i.readyState){var e;try{e=i.status}catch(r){e=0}if(0==e){if(t.timedout)return t.timeoutError();if(t.aborted)return;return t.crossDomainError()}t.emit("end")}};var u=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),e.direction="download",t.emit("progress",e)};this.hasListeners("progress")&&(i.onprogress=u);try{i.upload&&this.hasListeners("progress")&&(i.upload.onprogress=u)}catch(l){}if(o&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},o)),s&&(s=_.serializeObject(s),this.url+=~this.url.indexOf("?")?"&"+s:"?"+s),this.username&&this.password?i.open(this.method,this.url,!0,this.username,this.password):i.open(this.method,this.url,!0),this._withCredentials&&(i.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof a&&!n(a)){var p=this._header["content-type"],f=this._parser||_.serialize[p?p.split(";")[0]:""];!f&&c(p)&&(f=_.serialize["application/json"]),f&&(a=f(a))}for(var h in this.header)null!=this.header[h]&&i.setRequestHeader(h,this.header[h]);return this._responseType&&(i.responseType=this._responseType),this.emit("request",this),i.send("undefined"!=typeof a?a:null),this},_.Request=h,_.get=function(e,t,i){var r=_("GET",e);return"function"==typeof t&&(i=t,t=null),t&&r.query(t),i&&r.end(i),r},_.head=function(e,t,i){var r=_("HEAD",e);return"function"==typeof t&&(i=t,t=null),t&&r.send(t),i&&r.end(i),r},_.del=d,_["delete"]=d,_.patch=function(e,t,i){var r=_("PATCH",e);return"function"==typeof t&&(i=t,t=null),t&&r.send(t),i&&r.end(i),r},_.post=function(e,t,i){var r=_("POST",e);return"function"==typeof t&&(i=t,t=null),t&&r.send(t),i&&r.end(i),r},_.put=function(e,t,i){var r=_("PUT",e);return"function"==typeof t&&(i=t,t=null),t&&r.send(t),i&&r.end(i),r}},{"./is-object":38,"./request":40,"./request-base":39,emitter:29,reduce:36}],38:[function(e,t,i){function r(e){return null!=e&&"object"==typeof e}t.exports=r},{}],39:[function(e,t,i){var r=e("./is-object");i.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},i.parse=function(e){return this._parser=e,this},i.timeout=function(e){return this._timeout=e,this},i.then=function(e,t){return this.end(function(i,r){i?t(i):e(r)})},i.use=function(e){return e(this),this},i.get=function(e){return this._header[e.toLowerCase()]},i.getHeader=i.get,i.set=function(e,t){if(r(e)){for(var i in e)this.set(i,e[i]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},i.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},i.field=function(e,t){return this._getFormData().append(e,t),this}},{"./is-object":38}],40:[function(e,t,i){function r(e,t,i){return"function"==typeof i?new e("GET",t).end(i):2==arguments.length?new e("GET",t):new e(t,i)}t.exports=r},{}],41:[function(e,t,i){(function(e){var i;if(e.crypto&&crypto.getRandomValues){var r=new Uint8Array(16);i=function(){return crypto.getRandomValues(r),r}}if(!i){var n=new Array(16);i=function(){for(var e,t=0;16>t;t++)0===(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}t.exports=i}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],42:[function(e,t,i){function r(e,t,i){var r=t&&i||0,n=0;for(t=t||[],e.toLowerCase().replace(/[0-9a-f]{2}/g,function(e){16>n&&(t[r+n++]=c[e])});16>n;)t[r+n++]=0;return t}function n(e,t){var i=t||0,r=u;return r[e[i++]]+r[e[i++]]+r[e[i++]]+r[e[i++]]+"-"+r[e[i++]]+r[e[i++]]+"-"+r[e[i++]]+r[e[i++]]+"-"+r[e[i++]]+r[e[i++]]+"-"+r[e[i++]]+r[e[i++]]+r[e[i++]]+r[e[i++]]+r[e[i++]]+r[e[i++]]}function s(e,t,i){var r=t&&i||0,s=t||[];e=e||{};var o=void 0!==e.clockseq?e.clockseq:h,a=void 0!==e.msecs?e.msecs:(new Date).getTime(),u=void 0!==e.nsecs?e.nsecs:g+1,c=a-d+(u-g)/1e4;if(0>c&&void 0===e.clockseq&&(o=o+1&16383),(0>c||a>d)&&void 0===e.nsecs&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");d=a,g=u,h=o,a+=122192928e5;var l=(1e4*(268435455&a)+u)%4294967296;s[r++]=l>>>24&255,s[r++]=l>>>16&255,s[r++]=l>>>8&255,s[r++]=255&l;var p=a/4294967296*1e4&268435455;s[r++]=p>>>8&255,s[r++]=255&p,s[r++]=p>>>24&15|16,s[r++]=p>>>16&255,s[r++]=o>>>8|128,s[r++]=255&o;for(var v=e.node||f,y=0;6>y;y++)s[r+y]=v[y];return t?t:n(s)}function o(e,t,i){var r=t&&i||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null),e=e||{};var s=e.random||(e.rng||a)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var o=0;16>o;o++)t[r+o]=s[o];return t||n(s)}for(var a=e("./rng"),u=[],c={},l=0;256>l;l++)u[l]=(l+256).toString(16).substr(1),c[u[l]]=l;var p=a(),f=[1|p[0],p[1],p[2],p[3],p[4],p[5]],h=16383&(p[6]<<8|p[7]),d=0,g=0,v=o;v.v1=s,v.v4=o,v.parse=r,v.unparse=n,t.exports=v},{"./rng":41}]},{},[28]); \ No newline at end of file diff --git a/package.json b/package.json index b13b9134..41987ba8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "taplytics-js", - "version": "1.0", + "version": "1.0.1", "description": "Taplytics JS SDK", "main": "app/index.js", "repository": { diff --git a/test/helpers/initialized_app.js b/test/helpers/initialized_app.js index 5470f640..8c41f202 100644 --- a/test/helpers/initialized_app.js +++ b/test/helpers/initialized_app.js @@ -9,6 +9,6 @@ jest.dontMock('../../app/functions/isReady.js'); module.exports = function() { var app = require('../../app/app.js'); - app = app.init("33d4d4330f2a056c1898d7cd1112f63b526c6794", {log_level: 0, env: 'dev'}); + app = app.init("33d4d4330f2a056c1898d7cd1112f63b526c6794", {log_level: 3, env: 'dev'}); return app; }();