diff --git a/dist/keen-tracking.js b/dist/keen-tracking.js index d81c5092..458e9ea2 100644 --- a/dist/keen-tracking.js +++ b/dist/keen-tracking.js @@ -2313,7 +2313,7 @@ function getDocumentDescription() { /* 27 */ /***/ (function(module) { -module.exports = {"name":"keen-tracking","version":"3.1.2","description":"Data Collection SDK for Keen IO","main":"dist/node/keen-tracking.js","browser":"dist/keen-tracking.js","repository":{"type":"git","url":"https://github.com/keen/keen-tracking.js.git"},"scripts":{"start":"NODE_ENV=development webpack-dev-server","test":"NODE_ENV=test jest && npm run test:node","test:node":"NODE_ENV=test TEST_ENV=node jest","test:watch":"NODE_ENV=test jest --watch","test:node:watch":"NODE_ENV=test TEST_ENV=node jest --watch","build":"NODE_ENV=production webpack -p && NODE_ENV=production OPTIMIZE_MINIMIZE=1 webpack -p && npm run build:node","build:node":"TARGET=node NODE_ENV=production webpack -p","profile":"webpack --profile --json > stats.json","analyze":"webpack-bundle-analyzer stats.json /dist","preversion":"npm run build && npm run test","version":"git add .","postversion":"git push && git push --tags","demo":"node ./test/demo/index.node.js"},"bugs":"https://github.com/keen/keen-tracking.js/issues","author":"Keen IO (https://keen.io/)","contributors":["Dustin Larimer (https://github.com/dustinlarimer)","Eric Anderson (https://github.com/aroc)","Joe Wegner (http://www.wegnerdesign.com)","Alex Kleissner (https://github.com/hex337)","Adam Kasprowicz (https://github.com/adamkasprowicz)"],"license":"MIT","dependencies":{"component-emitter":"^1.2.0","js-cookie":"2.1.0","keen-core":"^0.1.3","promise-polyfill":"^8.0.0","whatwg-fetch":"^2.0.4"},"devDependencies":{"babel-core":"^6.26.3","babel-jest":"^23.0.1","babel-loader":"^7.1.5","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-polyfill":"^6.26.0","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint":"^4.19.1","eslint-config-airbnb":"^16.1.0","eslint-loader":"^2.0.0","eslint-plugin-import":"^2.11.0","eslint-plugin-jsx-a11y":"^6.0.3","html-loader":"^0.5.5","html-webpack-plugin":"^3.2.0","jest":"^22.4.3","jest-fetch-mock":"^1.6.5","nock":"^9.2.6","regenerator-runtime":"^0.11.1","replace-in-file":"^3.4.0","webpack":"^4.5.0","webpack-bundle-analyzer":"^2.11.1","webpack-cli":"^2.0.13","webpack-dev-server":"^3.1.1","xhr-mock":"^2.3.2"}}; +module.exports = {"name":"keen-tracking","version":"3.2.0","description":"Data Collection SDK for Keen IO","main":"dist/node/keen-tracking.js","browser":"dist/keen-tracking.js","repository":{"type":"git","url":"https://github.com/keen/keen-tracking.js.git"},"scripts":{"start":"NODE_ENV=development webpack-dev-server","test":"NODE_ENV=test jest && npm run test:node","test:node":"NODE_ENV=test TEST_ENV=node jest","test:watch":"NODE_ENV=test jest --watch","test:node:watch":"NODE_ENV=test TEST_ENV=node jest --watch","build":"NODE_ENV=production webpack -p && NODE_ENV=production OPTIMIZE_MINIMIZE=1 webpack -p && npm run build:node","build:node":"TARGET=node NODE_ENV=production webpack -p","profile":"webpack --profile --json > stats.json","analyze":"webpack-bundle-analyzer stats.json /dist","preversion":"npm run build && npm run test","version":"git add .","postversion":"git push && git push --tags","demo":"node ./test/demo/index.node.js"},"bugs":"https://github.com/keen/keen-tracking.js/issues","author":"Keen IO (https://keen.io/)","contributors":["Dustin Larimer (https://github.com/dustinlarimer)","Eric Anderson (https://github.com/aroc)","Joe Wegner (http://www.wegnerdesign.com)","Alex Kleissner (https://github.com/hex337)","Adam Kasprowicz (https://github.com/adamkasprowicz)"],"license":"MIT","dependencies":{"component-emitter":"^1.2.0","js-cookie":"2.1.0","keen-core":"^0.1.3","promise-polyfill":"^8.0.0","whatwg-fetch":"^2.0.4"},"devDependencies":{"babel-core":"^6.26.3","babel-jest":"^23.0.1","babel-loader":"^7.1.5","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-polyfill":"^6.26.0","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint":"^4.19.1","eslint-config-airbnb":"^16.1.0","eslint-loader":"^2.0.0","eslint-plugin-import":"^2.11.0","eslint-plugin-jsx-a11y":"^6.0.3","html-loader":"^0.5.5","html-webpack-plugin":"^3.2.0","jest":"^22.4.3","jest-fetch-mock":"^1.6.5","nock":"^9.2.6","regenerator-runtime":"^0.11.1","replace-in-file":"^3.4.0","webpack":"^4.5.0","webpack-bundle-analyzer":"^2.11.1","webpack-cli":"^2.0.13","webpack-dev-server":"^3.1.1","xhr-mock":"^2.3.2"}}; /***/ }), /* 28 */ diff --git a/dist/keen-tracking.min.js b/dist/keen-tracking.min.js index 6ca0cb10..85277fd8 100644 --- a/dist/keen-tracking.min.js +++ b/dist/keen-tracking.min.js @@ -5,5 +5,5 @@ * * Copyright 2006, 2015 Klaus Hartl & Fagner Brack * Released under the MIT license - */void 0===(o="function"==typeof(r=function(){function e(){for(var e=0,t={};e1){if("number"==typeof(i=e({path:"/"},r.defaults,i)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}try{s=JSON.stringify(o),/^[\{\[]/.test(s)&&(o=s)}catch(e){}return o=n.write?n.write(o,t):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=(t=(t=encodeURIComponent(String(t))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[t,"=",o,i.expires&&"; expires="+i.expires.toUTCString(),i.path&&"; path="+i.path,i.domain&&"; domain="+i.domain,i.secure?"; secure":""].join("")}t||(s={});for(var c=document.cookie?document.cookie.split("; "):[],u=/(%[0-9A-Z]{2})+/g,l=0;l=2?this.data[e]=t||null:"object"===(void 0===e?"undefined":r(e))&&1===arguments.length&&(0,i.default)(this.data,e),o.default.set(this.config.key,this.data,(0,i.default)(this.config.options,n||{})),this):this},a.prototype.expire=function(e){return e?o.default.set(this.config.key,this.data,(0,i.default)(this.config.options,{expires:e})):(o.default.remove(this.config.key),this.data={}),this},a.prototype.options=function(e){return arguments.length?(this.config.options="object"===(void 0===e?"undefined":r(e))?e:{},this):this.config.options},a.prototype.enabled=function(){return navigator.cookieEnabled}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUniqueId=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues)return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)});return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"==e?t:3&t|8;return n.toString(16)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.getScrollState=function(e){var t="object"===(void 0===e?"undefined":r(e))?e:{},n=(0,s.default)({pixel:0,pixel_max:0,ratio:null,ratio_max:null},t);void 0===("undefined"==typeof window?"undefined":r(window))&&void 0===("undefined"==typeof document?"undefined":r(document))||(n.pixel=(void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)+(window.innerHeight||document.documentElement.clientHeight),n.pixel>n.pixel_max&&(n.pixel_max=n.pixel),n.ratio=parseFloat(Number(n.pixel/a()).toFixed(2)),n.ratio_max=parseFloat(Number(n.pixel_max/a()).toFixed(2)));return n};var o,i=n(1),s=(o=i)&&o.__esModule?o:{default:o};function a(){var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)||null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDomNodeProfile=function(e){return{action:e.action,class:e.className,href:e.href||null,id:e.id,method:e.method,name:e.name,node_name:e.nodeName,selector:(0,r.getDomNodePath)(e),text:e.text,title:e.title,type:e.type,x_position:e.offsetLeft||e.clientLeft||null,y_position:e.offsetTop||e.clientTop||null}};var r=n(8)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDomainName=function(e){var t=function(e){var t;t=e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0];return t=(t=t.split(":")[0]).split("?")[0]}(e),n=t.split("."),r=n.length;r>2&&(t=n[r-2]+"."+n[r-1],2==n[r-2].length&&2==n[r-1].length&&(t=n[r-3]+"."+t));return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDatetimeIndex=function(e){var t=e||new Date;return{hour_of_day:t.getHours(),day_of_week:parseInt(1+t.getDay()),day_of_month:t.getDate(),month:parseInt(1+t.getMonth()),year:t.getFullYear()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBrowserProfile=function(){return{cookies:void 0!==navigator.cookieEnabled&&navigator.cookieEnabled,codeName:navigator.appCodeName,description:function(){var e;document&&"function"==typeof document.querySelector&&(e=document.querySelector('meta[name="description"]'));return e?e.content:""}(),language:navigator.language,name:navigator.appName,online:navigator.onLine,platform:navigator.platform,useragent:navigator.userAgent,version:navigator.appVersion,screen:(0,r.getScreenProfile)(),window:(0,o.getWindowProfile)()}};var r=n(10),o=n(9)},function(e){e.exports={name:"keen-tracking",version:"3.1.2",description:"Data Collection SDK for Keen IO",main:"dist/node/keen-tracking.js",browser:"dist/keen-tracking.js",repository:{type:"git",url:"https://github.com/keen/keen-tracking.js.git"},scripts:{start:"NODE_ENV=development webpack-dev-server",test:"NODE_ENV=test jest && npm run test:node","test:node":"NODE_ENV=test TEST_ENV=node jest","test:watch":"NODE_ENV=test jest --watch","test:node:watch":"NODE_ENV=test TEST_ENV=node jest --watch",build:"NODE_ENV=production webpack -p && NODE_ENV=production OPTIMIZE_MINIMIZE=1 webpack -p && npm run build:node","build:node":"TARGET=node NODE_ENV=production webpack -p",profile:"webpack --profile --json > stats.json",analyze:"webpack-bundle-analyzer stats.json /dist",preversion:"npm run build && npm run test",version:"git add .",postversion:"git push && git push --tags",demo:"node ./test/demo/index.node.js"},bugs:"https://github.com/keen/keen-tracking.js/issues",author:"Keen IO (https://keen.io/)",contributors:["Dustin Larimer (https://github.com/dustinlarimer)","Eric Anderson (https://github.com/aroc)","Joe Wegner (http://www.wegnerdesign.com)","Alex Kleissner (https://github.com/hex337)","Adam Kasprowicz (https://github.com/adamkasprowicz)"],license:"MIT",dependencies:{"component-emitter":"^1.2.0","js-cookie":"2.1.0","keen-core":"^0.1.3","promise-polyfill":"^8.0.0","whatwg-fetch":"^2.0.4"},devDependencies:{"babel-core":"^6.26.3","babel-jest":"^23.0.1","babel-loader":"^7.1.5","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-polyfill":"^6.26.0","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-0":"^6.24.1",eslint:"^4.19.1","eslint-config-airbnb":"^16.1.0","eslint-loader":"^2.0.0","eslint-plugin-import":"^2.11.0","eslint-plugin-jsx-a11y":"^6.0.3","html-loader":"^0.5.5","html-webpack-plugin":"^3.2.0",jest:"^22.4.3","jest-fetch-mock":"^1.6.5",nock:"^9.2.6","regenerator-runtime":"^0.11.1","replace-in-file":"^3.4.0",webpack:"^4.5.0","webpack-bundle-analyzer":"^2.11.1","webpack-cli":"^2.0.13","webpack-dev-server":"^3.1.1","xhr-mock":"^2.3.2"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initAutoTrackingCore=function(e){return function(t){var n=this,r=e.helpers,o=e.utils,a=o.extend({ignoreDisabledFormFields:!1,ignoreFormFieldTypes:["password"],recordClicks:!0,recordFormSubmits:!0,recordPageViews:!0,recordPageViewsOnExit:!1,recordScrollState:!0,shareUuidAcrossDomains:!1,collectIpAddress:!0,collectUuid:!0,catchError:void 0},t);if("beaconAPI"===n.config.requestType&&a.catchError)throw"You cannot use the BeaconAPI and catchError function in the same time, because BeaconAPI ignores errors. For requests with error handling - use requestType: 'fetch'";"jsonp"===n.config.requestType&&(a.catchError?n.config.requestType="fetch":n.config.requestType="beaconAPI");var c=new Date,u=new o.cookie("keen"),l=r.getDomainName(window.location.hostname),f=l&&a.shareUuidAcrossDomains?{domain:"."+l}:{},d=void 0;a.collectUuid&&((d=u.get("uuid"))||(d=r.getUniqueId(),u.set("uuid",d,f)));var h=u.get("initialReferrer");h||(h=document&&document.referrer||void 0,u.set("initialReferrer",h,f));var p={};a.recordScrollState&&(p=r.getScrollState(),o.listener("window").on("scroll",function(){p=r.getScrollState(p)}));var m=[{name:"keen:ua_parser",input:{ua_string:"user_agent"},output:"tech"},{name:"keen:url_parser",input:{url:"url.full"},output:"url.info"},{name:"keen:url_parser",input:{url:"referrer.full"},output:"referrer.info"},{name:"keen:date_time_parser",input:{date_time:"keen.timestamp"},output:"time.utc"},{name:"keen:date_time_parser",input:{date_time:"local_time_full"},output:"time.local"}];return m.push({name:"keen:ip_to_geo",input:{ip:"ip_address",remove_ip_property:!a.collectIpAddress},output:"geo"}),n.extendEvents(function(){var e,t=r.getBrowserProfile();return{tracked_by:i.default.name+"-"+i.default.version,local_time_full:(new Date).toISOString(),user:{uuid:d},page:{title:document?document.title:null,description:t.description,scroll_state:p,time_on_page:(e=c,Math.round(s(e)/1e3)),time_on_page_ms:s(c)},ip_address:"${keen.ip}",geo:{},user_agent:"${keen.user_agent}",tech:{profile:t},url:{full:window?window.location.href:"",info:{}},referrer:{initial:h,full:document?document.referrer:"",info:{}},time:{local:{},utc:{}},keen:{timestamp:(new Date).toISOString(),addons:m}}}),!0===a.recordClicks&&o.listener("a, a *").on("click",function(e){var t=e.target,o={element:r.getDomNodeProfile(t),local_time_full:(new Date).toISOString()};return a.catchError?n.recordEvent({collection:"clicks",event:o}).catch(function(e){a.catchError(e)}):n.recordEvent({collection:"clicks",event:o})}),!0===a.recordFormSubmits&&o.listener("form").on("submit",function(e){var t=e.target,i={disabled:a.ignoreDisabledFormFields,ignoreTypes:a.ignoreFormFieldTypes},s={form:{action:t.action,fields:o.serializeForm(t,i),method:t.method},element:r.getDomNodeProfile(t),local_time_full:(new Date).toISOString()};return a.catchError?n.recordEvent({collection:"form_submissions",event:s}).catch(function(e){a.catchError(e)}):n.recordEvent({collection:"form_submissions",event:s})}),!0!==a.recordPageViews||a.recordPageViewsOnExit||(a.catchError?n.recordEvent({collection:"pageviews"}).catch(function(e){a.catchError(e)}):n.recordEvent({collection:"pageviews"})),a.recordPageViewsOnExit&&"undefined"!=typeof window&&window.addEventListener("beforeunload",function(){n.config.requestType="beaconAPI",n.recordEvent({collection:"pageviews"})}),n}};var r,o=n(27),i=(r=o)&&r.__esModule?r:{default:r};function s(e){return(new Date).getTime()-e.getTime()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0){e.queue.pause();var t=r({},e.queue.config),n=r({},e.queue.events);e.queue=(0,s.queue)(),e.queue.config=t,e.queue.on("flush",function(){e.recordDeferredEvents()}),e.emit("recordDeferredEvents",n),e.recordEvents(n,function(t,r){t&&e.emit("recordDeferredEventsError",t,n)})}return e};a(n(7));var i=a(n(0)),s=n(15);function a(e){return e&&e.__esModule?e:{default:e}}function c(e){var t="Event(s) not deferred: "+e;this.emit("error",t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFromCache=t.saveToCache=void 0;var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return a?Promise.resolve():s?(c=r({},c,e),new Promise(function(e,t){var n=self.indexedDB.open(c.dbName);n.onerror=function(t){s=!1,e()},n.onupgradeneeded=function(e){var t=e.target.result.createObjectStore(c.dbCollectionName,{keyPath:c.dbCollectionKey});t.createIndex(c.dbCollectionKey,c.dbCollectionKey,{unique:!0}),t.createIndex("expiryTime","expiryTime",{unique:!1})},n.onsuccess=function(t){(a=t.target.result).onerror=function(e){s=!1},e(a)}})):Promise.resolve()}t.saveToCache=function(e){return u((arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).cache).then(function(){var t=a.transaction(c.dbCollectionName,"readwrite").objectStore(c.dbCollectionName).add({hash:e,expiryTime:Date.now()+c.maxAge});t.onsuccess=function(e){},t.onerror=function(e){s=!1}})},t.getFromCache=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u(n.cache).then(function(){return new Promise(function(r,o){if(!s)return r(null);var i=a.transaction(c.dbCollectionName,"readwrite").objectStore(c.dbCollectionName).index("expiryTime"),u=IDBKeyRange.upperBound(Date.now(),!0);i.openCursor(u).onsuccess=function(e){var t=e.target.result;if(t){a.transaction(c.dbCollectionName,"readwrite").objectStore(c.dbCollectionName).delete(e.target.result.value[c.dbCollectionKey]);t.continue()}};var l=a.transaction(c.dbCollectionName,"readwrite").objectStore(c.dbCollectionName).index(c.dbCollectionKey).get(t);l.onsuccess=function(o){if(!o.target.result||o.target.result.expiryTimeu})}var l=a.find(function(e){return e.hash===r});if(l){if(!(l.expiryTime&&l.expiryTime0?u():r(e)}).catch(function(e){o>0?u():r(e)})};function u(){c+=1,setTimeout(function(){s(o-c)},2^c*i)}s(o-c)})},n(5),n(4);var o,i=n(14),s=(o=i)&&o.__esModule?o:{default:o}},function(e,t){e.exports={map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){"use strict";var t,n,r,o,i,s,a,c="",u=0,l=this.map;for(e=this.utf8.encode(e);u>2,i=(3&t)<<4|n>>4,s=isNaN(n)?64:(15&n)<<2|r>>6,a=isNaN(n)||isNaN(r)?64:63&r,c=c+l.charAt(o)+l.charAt(i)+l.charAt(s)+l.charAt(a);return c},decode:function(e){"use strict";var t,n,r,o,i,s,a="",c=0,u=this.map,l=String.fromCharCode;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>2,s=(3&r)<<6|(o=u.indexOf(e.charAt(c++))),a=a+(l(t<<2|n>>4)+(64!=r?l(i):""))+(64!=o?l(s):"");return this.utf8.decode(a)},utf8:{encode:function(e){"use strict";for(var t,n="",r=0,o=String.fromCharCode;r127&&t<2048?o(t>>6|192)+o(63&t|128):o(t>>12|224)+o(t>>6&63|128)+o(63&t|128);return n},decode:function(e){"use strict";for(var t,n="",r=0,o=String.fromCharCode;r191&&t<224?[o((31&t)<<6|63&e.charCodeAt(r+1)),r+=2][0]:[o((15&t)<<12|(63&e.charCodeAt(r+1))<<6|63&(c3=e.charCodeAt(r+2))),r+=3][0];return n}}}},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var c,u=[],l=!1,f=-1;function d(){l&&c&&(l=!1,c.length?u=c.concat(u):f=-1,u.length&&h())}function h(){if(!l){var e=a(d);l=!0;for(var t=u.length;t;){for(c=u,u=[];++f1)for(var n=1;n=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(35),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(2))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0))return 1900;return 16e3}(),navigator&&navigator.sendBeacon&&("beaconAPI"===S.requestType||O&&"beaconAPI"===O.requestType))return navigator.sendBeacon(l+"?api_key="+this.writeKey(),JSON.stringify(E)),this;if(k)switch(this.config.requestType){case"xhr":b.call(this,"POST",l,E,p);break;case"beacon":x?function(e,t){var n=this,r=t,o=document.createElement("img");t=null,o.onload=function(){if(!0,"naturalHeight"in this){if(this.naturalHeight+this.naturalWidth===0)return void this.onerror()}else if(this.width+this.height===0)return void this.onerror();r&&r.call(n)},o.onerror=function(){!0,r&&r.call(n,"An error occurred!",null)},o.src=e+"&c=clv1"}.call(this,_,p):v.call(this,l,E,"Beacon URL length exceeds current browser limit, and XHR is not supported.",p);break;default:if("undefined"!=typeof fetch)return g.call(this,"POST",l,E,p);x?function(e,t){var n=this,r=t,o=(new Date).getTime(),i=document.createElement("script"),s=document.getElementsByTagName("head")[0],a="keenJSONPCallback",c=!1;t=null,a+=o;for(;a in window;)a+="a";function u(){r&&r.call(n,"An error occurred!",null)}function l(){window[a]=void 0;try{delete window[a]}catch(e){}s.removeChild(i)}window[a]=function(e){!0!==c&&(c=!0,r&&r.call(n,null,e),l())},i.src=e+"&jsonp="+a,s.appendChild(i),i.onreadystatechange=function(){!1===c&&"loaded"===this.readyState&&(c=!0,u(),l())},i.onerror=function(){!1===c&&(c=!0,u(),l())}}.call(this,_,p):v.call(this,l,E,"JSONp URL length exceeds current browser limit, and XHR is not supported.",p)}else x&&function(e){var t=w();t&&(t.open("GET",e,!1),t.send(null))}(_);return n=p=null,this}y.call(this,"Collection name must be a string.",n)}}function p(e,t){var n,r,i=this;if(n=this.url("events"),m.call(this,t))if("object"!==(void 0===e?"undefined":o(e))||e instanceof Array)y.call(this,"First argument must be an object",t);else{if(!(arguments.length>2))return this.config.globalProperties&&(console.log("config.globalProperties are deprecated"),(0,s.default)(e,function(t,n){(0,s.default)(t,function(t,r){var o=i.config.globalProperties(n);e[n][r]=(0,a.default)(o,t)})})),r={},(0,s.default)(e,function(e,t){r[t]=r[t]||[],(0,s.default)(e,function(e,n){var o={};(0,u.getExtendedEventBody)(o,i.extensions.events),(0,u.getExtendedEventBody)(o,i.extensions.collections[t]),(0,u.getExtendedEventBody)(o,[e]),r[t].push(o)})}),this.emit("recordEvents",r),c.default.enabled?this.config.requestType&&"xhr"===this.config.requestType||"undefined"==typeof fetch?(w()&&b.call(this,"POST",n,r,t),this):g.call(this,"POST",n,r,t):(y.call(this,"Keen.enabled is set to false.",t),!1);y.call(this,"Incorrect arguments provided to #recordEvents method",t)}}function m(e){return this.projectId()?!!this.writeKey()||(y.call(this,"Keen.Client is missing a writeKey property.",e),!1):(y.call(this,"Keen.Client is missing a projectId property.",e),!1)}function y(e,t){var n="Event(s) not recorded: "+e;this.emit("error",n),t&&t.call(this,n,null)}function v(e,t,n,r){w()?b.call(this,"POST",e,t,r):y.call(this,n)}function g(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,o=this;return(0,l.default)(t,{method:e,body:n?JSON.stringify(n):"",mode:"cors",redirect:"follow",referrerPolicy:o.referrerPolicy()||"unsafe-url",headers:{Authorization:o.writeKey(),"Content-Type":"application/json"},retry:o.config.retry}).catch(function(e){return void 0!==r&&r.call(o,e,null),o.emit("error",e),Promise.reject(e)}).then(function(e){return e.ok?e.json():e.json().then(function(t){return Promise.reject({error_code:t.error_code,body:t.message,status:e.status,ok:!1,statusText:e.statusText})})}).then(function(e){return function(e){if(void 0!==e.created)return!!e.created;if(0===Object.keys(e).map(function(t){return e[t].filter(function(e){return!e.success})}).filter(function(e){return e.length>0}).length)return!0;return!1}(e)?(void 0!==r&&r.call(o,null,e),Promise.resolve(e)):(void 0!==r&&r.call(o,e,null),o.emit("error",e),Promise.reject(e))})}function b(e,t,n,r){var o,i=this,s=w(),a=r;r=null,s.onreadystatechange=function(){var e;if(4==s.readyState)if(s.status>=200&&s.status<300){try{e=JSON.parse(s.responseText)}catch(e){c.default.emit("error","Could not parse HTTP response: "+s.responseText),a&&a.call(i,s,null)}a&&e&&a.call(i,null,e)}else c.default.emit("error","HTTP request failed."),a&&a.call(i,s,null)},s.open(e,t,!0),s.setRequestHeader("Authorization",i.writeKey()),s.setRequestHeader("Content-Type","application/json"),n&&(o=JSON.stringify(n)),"GET"===e.toUpperCase()&&s.send(),"POST"===e.toUpperCase()&&s.send(o)}function w(){var e="undefined"==typeof window?this:window;if(e.XMLHttpRequest&&("file:"!=e.location.protocol||!e.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}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listenerCore=void 0;o(n(6));var r=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}t.listenerCore=function(e){function t(e){if(e)return this instanceof t==!1?new t(e):(this.selector=e,this)}return e.domListeners=e.domListeners||{},t.prototype.on=function(t,n){var o;return 2!==arguments.length||"string"!=typeof t||"function"!=typeof n?this:(void 0===e.domListeners[t]&&(!function(e,t){document.addEventListener?document.addEventListener(e,t,!1):document.attachEvent("on"+e,t)}(t,(o=t,function(t){var n,i;n=t||window.event,i=n.target||n.srcElement,"undefined"!==e.domListeners[o]&&(0,r.default)(e.domListeners[o],function(e,t){!function(e,t){for(var n=(e.parentNode||document).querySelectorAll(t)||[],r=n.length;r--;)if(n[r]==e)return!0;return!1}(i,t)?"window"===t&&(0,r.default)(e,function(e,t){e(n)}):(0,r.default)(e,function(e,t){"click"===o&&"A"===i.nodeName?function(e,t,n){var r,o;if(void 0!==t.getAttribute?r=t.getAttribute("target"):t.target&&(r=t.target),"boolean"==typeof(o=n(e))&&!1===o||e.defaultPrevented||!1===e.returnValue)return e.preventDefault&&e.preventDefault(),e.returnValue=!1,!1;if("_blank"!==r&&"blank"!==r&&!e.metaKey&&!t.hasAttribute("download")&&(e.preventDefault&&e.preventDefault(),e.returnValue=!1,t.href&&"#"!==t.href&&t.href!==window.location+"#"))if(void 0!==o){if(navigator&&navigator.sendBeacon)return void(window.location=t.href);o.then(function(){window.location=t.href}).catch(function(e){window.location=t.href})}else setTimeout(function(){window.location=t.href},500)}(n,i,e):"submit"===o&&"FORM"===i.nodeName?function(e,t,n){var r=n(e);if("boolean"==typeof r&&!1===r||e.defaultPrevented||!1===e.returnValue)return e.preventDefault&&e.preventDefault(),e.returnValue=!1,!1;if(e.preventDefault&&e.preventDefault(),e.returnValue=!1,void 0!==r){if(navigator&&navigator.sendBeacon)return void t.submit();r.then(function(){t.submit()}).catch(function(e){t.submit()})}else setTimeout(function(){t.submit()},500)}(n,i,e):e(n)})})})),e.domListeners[t]={}),e.domListeners[t][this.selector]=e.domListeners[t][this.selector]||[],e.domListeners[t][this.selector].push(n),this)},t.prototype.once=function(e,t){var n=this;function r(){return n.off(e,r),t.apply(n,arguments)}return r.fn=t,n.on(e,r),n},t.prototype.off=function(t,n){var o=this,i=[];if(2===arguments.length)(0,r.default)(e.domListeners[t][o.selector],function(e,t){e!==n&&e.fn!==n&&i.push(e)}),e.domListeners[t][o.selector]=i;else if(1===arguments.length)try{delete e.domListeners[t][o.selector]}catch(n){e.domListeners[t][o.selector]=[]}else(0,r.default)(e.domListeners,function(t,n){try{delete e.domListeners[n][o.selector]}catch(t){e.domListeners[n][o.selector]=function(){}}});return o},t}},function(e,t,n){var r=n(0);n(1);e.exports=function(e){var t=[];return r(e,function(e,n){"string"!=typeof e&&(e=JSON.stringify(e)),t.push(n+"="+encodeURIComponent(e))}),t.join("&")}},function(e,t){e.exports=function(e){var t,n={},r=/\+/g,o=/([^&=]+)=?([^&]*)/g,i=function(e){return decodeURIComponent(e.replace(r," "))},s=e.split("?")[1];for(;t=o.exec(s);)n[i(t[1])]=i(t[2]);return n}},function(e,t,n){(function(t){(function(t){var r=t.Keen||void 0,o=n(0),i=n(1),s=n(40),a=n(39),c=n(6);function u(e){if(this instanceof u==!1)return new u(e);this.configure(e),u.debug&&this.on("error",u.log),this.emit("ready"),u.emit("client",this)}function l(e){return void 0!==e}r&&void 0===r.resources&&(u.legacyVersion=r),c(u),c(u.prototype),i(u,{debug:!1,enabled:!0,loaded:!1,version:"__VERSION__"}),u.helpers=u.helpers||{},u.resources=u.resources||{},i(u.resources,{base:"{protocol}://{host}",version:"{protocol}://{host}/3.0",projects:"{protocol}://{host}/3.0/projects",projectId:"{protocol}://{host}/3.0/projects/{projectId}",events:"{protocol}://{host}/3.0/projects/{projectId}/events",queries:"{protocol}://{host}/3.0/projects/{projectId}/queries"}),u.utils=u.utils||{},i(u.utils,{each:o,extend:i,parseParams:s,serialize:a}),u.extendLibrary=function(e,t){var n=r||t;return l(n)&&l(n.resources)&&(o(n,function(t,n){"object"==typeof t?(e[n]=e[n]||{},i(e[n],t)):e[n]=e[n]||t}),i(e.prototype,n.prototype)),e},u.log=function(e){u.debug&&"object"==typeof console&&console.log("[Keen]",e)},u.noConflict=function(){return void 0!==t.Keen&&(t.Keen=u.legacyVersion||r),u},u.ready=function(e){u.loaded?e():u.once("ready",e)},u.prototype.configure=function(e){var t=e||{};return this.config=this.config||{projectId:void 0,writeKey:void 0,host:"api.keen.io",protocol:"https",requestType:"jsonp",resources:i({},u.resources)},"undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1&&(t.protocol=document.location.protocol.replace(":","")),t.host&&t.host.replace(/.*?:\/\//g,""),i(this.config,t),this},u.prototype.masterKey=function(e){return arguments.length?(this.config.masterKey=e?String(e):null,this):this.config.masterKey},u.prototype.projectId=function(e){return arguments.length?(this.config.projectId=e?String(e):null,this):this.config.projectId},u.prototype.resources=function(e){if(!arguments.length)return this.config.resources;var t=this;return"object"==typeof e&&o(e,function(e,n){t.config.resources[n]=e||null}),t},u.prototype.url=function(e){var t,n=Array.prototype.slice.call(arguments,1),r=this.config.resources.base||"{protocol}://{host}";return t=e&&"string"==typeof e?this.config.resources[e]?this.config.resources[e]:r+e:r,o(this.config,function(e,n){"object"!=typeof e&&(t=t.replace("{"+n+"}",e))}),o(n,function(e,n){"string"==typeof e?t+="/"+e:"object"==typeof e&&(t+="?",o(e,function(e,n){t+=n+"="+e+"&"}),t=t.slice(0,-1))}),t},function(e){if(u.loaded||"undefined"==typeof document)return void e();null==document.readyState&&document.addEventListener&&(document.addEventListener("DOMContentLoaded",function e(){document.removeEventListener("DOMContentLoaded",e,!1),document.readyState="complete"},!1),document.readyState="loading");!function e(t){/in/.test(document.readyState)?setTimeout(function(){e(t)},9):t()}(e)}(function(){u.loaded=!0,u.emit("ready")}),e.exports=u}).call(this,"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{})}).call(this,n(2))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeenTracking=t.Keen=t.keenGlobals=void 0;var r=k(n(7)),o=k(n(0)),i=k(n(1)),s=n(38),a=n(37),c=n(29),u=n(13),l=n(28),f=n(26),d=n(25),h=n(24),p=n(8),m=n(23),y=n(10),v=n(22),g=n(21),b=n(9),w=n(20),_=n(12),x=n(18),E=n(17);function k(e){return e&&e.__esModule?e:{default:e}}(0,i.default)(r.default.prototype,{recordEvent:a.recordEvent,recordEvents:a.recordEvents,addEvent:a.addEvent,addEvents:a.addEvents}),(0,i.default)(r.default.prototype,{deferEvent:c.deferEvent,deferEvents:c.deferEvents,queueCapacity:c.queueCapacity,queueInterval:c.queueInterval,recordDeferredEvents:c.recordDeferredEvents}),(0,i.default)(r.default.prototype,{extendEvent:u.extendEvent,extendEvents:u.extendEvents});var T=(0,l.initAutoTrackingCore)(r.default);(0,i.default)(r.default.prototype,{initAutoTracking:T}),r.default.prototype.trackExternalLink=function(e,t,n,r,o){this.emit("error","This method has been deprecated. Check out DOM listeners: https://github.com/keen/keen-tracking.js#listeners");var i,s=e,a=s.currentTarget?s.currentTarget:s.srcElement||s.target,c=r||500,u=!1,l="";void 0!==a.getAttribute?l=a.getAttribute("target"):a.target&&(l=a.target);"_blank"!=l&&"blank"!=l||s.metaKey||(window.open("about:blank").document.location=a.href);"A"===a.nodeName?i=function(){u||s.metaKey||"_blank"===l||"blank"===l||(u=!0,window.location=a.href)}:"FORM"===a.nodeName?i=function(){u||(u=!0,a.submit())}:this.trigger("error","#trackExternalLink method not attached to an or
DOM element");o&&(i=function(){u||(u=!0,o())});if(this.recordEvent(t,n,i),setTimeout(i,c),!s.metaKey)return!1},(0,i.default)(r.default.helpers,{getBrowserProfile:f.getBrowserProfile,getDatetimeIndex:d.getDatetimeIndex,getDomainName:h.getDomainName,getDomNodePath:p.getDomNodePath,getDomNodeProfile:m.getDomNodeProfile,getScreenProfile:y.getScreenProfile,getScrollState:v.getScrollState,getUniqueId:g.getUniqueId,getWindowProfile:b.getWindowProfile});var j=(0,s.listenerCore)(r.default);(0,i.default)(r.default.utils,{cookie:w.cookie,deepExtend:_.deepExtend,listener:j,serializeForm:x.serializeForm,timer:E.timer}),r.default.listenTo=function(e){(0,o.default)(e,function(e,t){var n=t.split(" "),r=n[0],o=n.slice(1,n.length).join(" ");return j(o).on(r,e)})},Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var t=this.length>>>0,n=Number(arguments[1])||0;for((n=n<0?Math.ceil(n):Math.floor(n))<0&&(n+=t);n1){if("number"==typeof(i=e({path:"/"},r.defaults,i)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*i.expires),i.expires=a}try{s=JSON.stringify(o),/^[\{\[]/.test(s)&&(o=s)}catch(e){}return o=n.write?n.write(o,t):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=(t=(t=encodeURIComponent(String(t))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape),document.cookie=[t,"=",o,i.expires&&"; expires="+i.expires.toUTCString(),i.path&&"; path="+i.path,i.domain&&"; domain="+i.domain,i.secure?"; secure":""].join("")}t||(s={});for(var c=document.cookie?document.cookie.split("; "):[],u=/(%[0-9A-Z]{2})+/g,l=0;l=2?this.data[e]=t||null:"object"===(void 0===e?"undefined":r(e))&&1===arguments.length&&(0,i.default)(this.data,e),o.default.set(this.config.key,this.data,(0,i.default)(this.config.options,n||{})),this):this},a.prototype.expire=function(e){return e?o.default.set(this.config.key,this.data,(0,i.default)(this.config.options,{expires:e})):(o.default.remove(this.config.key),this.data={}),this},a.prototype.options=function(e){return arguments.length?(this.config.options="object"===(void 0===e?"undefined":r(e))?e:{},this):this.config.options},a.prototype.enabled=function(){return navigator.cookieEnabled}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUniqueId=function(){if("undefined"!=typeof crypto&&crypto.getRandomValues)return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)});return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,n="x"==e?t:3&t|8;return n.toString(16)})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.getScrollState=function(e){var t="object"===(void 0===e?"undefined":r(e))?e:{},n=(0,s.default)({pixel:0,pixel_max:0,ratio:null,ratio_max:null},t);void 0===("undefined"==typeof window?"undefined":r(window))&&void 0===("undefined"==typeof document?"undefined":r(document))||(n.pixel=(void 0!==window.pageYOffset?window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop)+(window.innerHeight||document.documentElement.clientHeight),n.pixel>n.pixel_max&&(n.pixel_max=n.pixel),n.ratio=parseFloat(Number(n.pixel/a()).toFixed(2)),n.ratio_max=parseFloat(Number(n.pixel_max/a()).toFixed(2)));return n};var o,i=n(1),s=(o=i)&&o.__esModule?o:{default:o};function a(){var e=document.body,t=document.documentElement;return Math.max(e.scrollHeight,e.offsetHeight,t.clientHeight,t.scrollHeight,t.offsetHeight)||null}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDomNodeProfile=function(e){return{action:e.action,class:e.className,href:e.href||null,id:e.id,method:e.method,name:e.name,node_name:e.nodeName,selector:(0,r.getDomNodePath)(e),text:e.text,title:e.title,type:e.type,x_position:e.offsetLeft||e.clientLeft||null,y_position:e.offsetTop||e.clientTop||null}};var r=n(8)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDomainName=function(e){var t=function(e){var t;t=e.indexOf("://")>-1?e.split("/")[2]:e.split("/")[0];return t=(t=t.split(":")[0]).split("?")[0]}(e),n=t.split("."),r=n.length;r>2&&(t=n[r-2]+"."+n[r-1],2==n[r-2].length&&2==n[r-1].length&&(t=n[r-3]+"."+t));return t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDatetimeIndex=function(e){var t=e||new Date;return{hour_of_day:t.getHours(),day_of_week:parseInt(1+t.getDay()),day_of_month:t.getDate(),month:parseInt(1+t.getMonth()),year:t.getFullYear()}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBrowserProfile=function(){return{cookies:void 0!==navigator.cookieEnabled&&navigator.cookieEnabled,codeName:navigator.appCodeName,description:function(){var e;document&&"function"==typeof document.querySelector&&(e=document.querySelector('meta[name="description"]'));return e?e.content:""}(),language:navigator.language,name:navigator.appName,online:navigator.onLine,platform:navigator.platform,useragent:navigator.userAgent,version:navigator.appVersion,screen:(0,r.getScreenProfile)(),window:(0,o.getWindowProfile)()}};var r=n(10),o=n(9)},function(e){e.exports={name:"keen-tracking",version:"3.2.0",description:"Data Collection SDK for Keen IO",main:"dist/node/keen-tracking.js",browser:"dist/keen-tracking.js",repository:{type:"git",url:"https://github.com/keen/keen-tracking.js.git"},scripts:{start:"NODE_ENV=development webpack-dev-server",test:"NODE_ENV=test jest && npm run test:node","test:node":"NODE_ENV=test TEST_ENV=node jest","test:watch":"NODE_ENV=test jest --watch","test:node:watch":"NODE_ENV=test TEST_ENV=node jest --watch",build:"NODE_ENV=production webpack -p && NODE_ENV=production OPTIMIZE_MINIMIZE=1 webpack -p && npm run build:node","build:node":"TARGET=node NODE_ENV=production webpack -p",profile:"webpack --profile --json > stats.json",analyze:"webpack-bundle-analyzer stats.json /dist",preversion:"npm run build && npm run test",version:"git add .",postversion:"git push && git push --tags",demo:"node ./test/demo/index.node.js"},bugs:"https://github.com/keen/keen-tracking.js/issues",author:"Keen IO (https://keen.io/)",contributors:["Dustin Larimer (https://github.com/dustinlarimer)","Eric Anderson (https://github.com/aroc)","Joe Wegner (http://www.wegnerdesign.com)","Alex Kleissner (https://github.com/hex337)","Adam Kasprowicz (https://github.com/adamkasprowicz)"],license:"MIT",dependencies:{"component-emitter":"^1.2.0","js-cookie":"2.1.0","keen-core":"^0.1.3","promise-polyfill":"^8.0.0","whatwg-fetch":"^2.0.4"},devDependencies:{"babel-core":"^6.26.3","babel-jest":"^23.0.1","babel-loader":"^7.1.5","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-polyfill":"^6.26.0","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-0":"^6.24.1",eslint:"^4.19.1","eslint-config-airbnb":"^16.1.0","eslint-loader":"^2.0.0","eslint-plugin-import":"^2.11.0","eslint-plugin-jsx-a11y":"^6.0.3","html-loader":"^0.5.5","html-webpack-plugin":"^3.2.0",jest:"^22.4.3","jest-fetch-mock":"^1.6.5",nock:"^9.2.6","regenerator-runtime":"^0.11.1","replace-in-file":"^3.4.0",webpack:"^4.5.0","webpack-bundle-analyzer":"^2.11.1","webpack-cli":"^2.0.13","webpack-dev-server":"^3.1.1","xhr-mock":"^2.3.2"}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initAutoTrackingCore=function(e){return function(t){var n=this,r=e.helpers,o=e.utils,a=o.extend({ignoreDisabledFormFields:!1,ignoreFormFieldTypes:["password"],recordClicks:!0,recordFormSubmits:!0,recordPageViews:!0,recordPageViewsOnExit:!1,recordScrollState:!0,shareUuidAcrossDomains:!1,collectIpAddress:!0,collectUuid:!0,catchError:void 0},t);if("beaconAPI"===n.config.requestType&&a.catchError)throw"You cannot use the BeaconAPI and catchError function in the same time, because BeaconAPI ignores errors. For requests with error handling - use requestType: 'fetch'";"jsonp"===n.config.requestType&&(a.catchError?n.config.requestType="fetch":n.config.requestType="beaconAPI");var c=new Date,u=new o.cookie("keen"),l=r.getDomainName(window.location.hostname),f=l&&a.shareUuidAcrossDomains?{domain:"."+l}:{},d=void 0;a.collectUuid&&((d=u.get("uuid"))||(d=r.getUniqueId(),u.set("uuid",d,f)));var h=u.get("initialReferrer");h||(h=document&&document.referrer||void 0,u.set("initialReferrer",h,f));var p={};a.recordScrollState&&(p=r.getScrollState(),o.listener("window").on("scroll",function(){p=r.getScrollState(p)}));var m=[{name:"keen:ua_parser",input:{ua_string:"user_agent"},output:"tech"},{name:"keen:url_parser",input:{url:"url.full"},output:"url.info"},{name:"keen:url_parser",input:{url:"referrer.full"},output:"referrer.info"},{name:"keen:date_time_parser",input:{date_time:"keen.timestamp"},output:"time.utc"},{name:"keen:date_time_parser",input:{date_time:"local_time_full"},output:"time.local"}];return m.push({name:"keen:ip_to_geo",input:{ip:"ip_address",remove_ip_property:!a.collectIpAddress},output:"geo"}),n.extendEvents(function(){var e,t=r.getBrowserProfile();return{tracked_by:i.default.name+"-"+i.default.version,local_time_full:(new Date).toISOString(),user:{uuid:d},page:{title:document?document.title:null,description:t.description,scroll_state:p,time_on_page:(e=c,Math.round(s(e)/1e3)),time_on_page_ms:s(c)},ip_address:"${keen.ip}",geo:{},user_agent:"${keen.user_agent}",tech:{profile:t},url:{full:window?window.location.href:"",info:{}},referrer:{initial:h,full:document?document.referrer:"",info:{}},time:{local:{},utc:{}},keen:{timestamp:(new Date).toISOString(),addons:m}}}),!0===a.recordClicks&&o.listener("a, a *").on("click",function(e){var t=e.target,o={element:r.getDomNodeProfile(t),local_time_full:(new Date).toISOString()};return a.catchError?n.recordEvent({collection:"clicks",event:o}).catch(function(e){a.catchError(e)}):n.recordEvent({collection:"clicks",event:o})}),!0===a.recordFormSubmits&&o.listener("form").on("submit",function(e){var t=e.target,i={disabled:a.ignoreDisabledFormFields,ignoreTypes:a.ignoreFormFieldTypes},s={form:{action:t.action,fields:o.serializeForm(t,i),method:t.method},element:r.getDomNodeProfile(t),local_time_full:(new Date).toISOString()};return a.catchError?n.recordEvent({collection:"form_submissions",event:s}).catch(function(e){a.catchError(e)}):n.recordEvent({collection:"form_submissions",event:s})}),!0!==a.recordPageViews||a.recordPageViewsOnExit||(a.catchError?n.recordEvent({collection:"pageviews"}).catch(function(e){a.catchError(e)}):n.recordEvent({collection:"pageviews"})),a.recordPageViewsOnExit&&"undefined"!=typeof window&&window.addEventListener("beforeunload",function(){n.config.requestType="beaconAPI",n.recordEvent({collection:"pageviews"})}),n}};var r,o=n(27),i=(r=o)&&r.__esModule?r:{default:r};function s(e){return(new Date).getTime()-e.getTime()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0){e.queue.pause();var t=r({},e.queue.config),n=r({},e.queue.events);e.queue=(0,s.queue)(),e.queue.config=t,e.queue.on("flush",function(){e.recordDeferredEvents()}),e.emit("recordDeferredEvents",n),e.recordEvents(n,function(t,r){t&&e.emit("recordDeferredEventsError",t,n)})}return e};a(n(7));var i=a(n(0)),s=n(15);function a(e){return e&&e.__esModule?e:{default:e}}function c(e){var t="Event(s) not deferred: "+e;this.emit("error",t)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getFromCache=t.saveToCache=void 0;var r=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};return a?Promise.resolve():s?(c=r({},c,e),new Promise(function(e,t){var n=self.indexedDB.open(c.dbName);n.onerror=function(t){s=!1,e()},n.onupgradeneeded=function(e){var t=e.target.result.createObjectStore(c.dbCollectionName,{keyPath:c.dbCollectionKey});t.createIndex(c.dbCollectionKey,c.dbCollectionKey,{unique:!0}),t.createIndex("expiryTime","expiryTime",{unique:!1})},n.onsuccess=function(t){(a=t.target.result).onerror=function(e){s=!1},e(a)}})):Promise.resolve()}t.saveToCache=function(e){return u((arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).cache).then(function(){var t=a.transaction(c.dbCollectionName,"readwrite").objectStore(c.dbCollectionName).add({hash:e,expiryTime:Date.now()+c.maxAge});t.onsuccess=function(e){},t.onerror=function(e){s=!1}})},t.getFromCache=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return u(n.cache).then(function(){return new Promise(function(r,o){if(!s)return r(null);var i=a.transaction(c.dbCollectionName,"readwrite").objectStore(c.dbCollectionName).index("expiryTime"),u=IDBKeyRange.upperBound(Date.now(),!0);i.openCursor(u).onsuccess=function(e){var t=e.target.result;if(t){a.transaction(c.dbCollectionName,"readwrite").objectStore(c.dbCollectionName).delete(e.target.result.value[c.dbCollectionKey]);t.continue()}};var l=a.transaction(c.dbCollectionName,"readwrite").objectStore(c.dbCollectionName).index(c.dbCollectionKey).get(t);l.onsuccess=function(o){if(!o.target.result||o.target.result.expiryTimeu})}var l=a.find(function(e){return e.hash===r});if(l){if(!(l.expiryTime&&l.expiryTime0?u():r(e)}).catch(function(e){o>0?u():r(e)})};function u(){c+=1,setTimeout(function(){s(o-c)},2^c*i)}s(o-c)})},n(5),n(4);var o,i=n(14),s=(o=i)&&o.__esModule?o:{default:o}},function(e,t){e.exports={map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(e){"use strict";var t,n,r,o,i,s,a,c="",u=0,l=this.map;for(e=this.utf8.encode(e);u>2,i=(3&t)<<4|n>>4,s=isNaN(n)?64:(15&n)<<2|r>>6,a=isNaN(n)||isNaN(r)?64:63&r,c=c+l.charAt(o)+l.charAt(i)+l.charAt(s)+l.charAt(a);return c},decode:function(e){"use strict";var t,n,r,o,i,s,a="",c=0,u=this.map,l=String.fromCharCode;for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");c>2,s=(3&r)<<6|(o=u.indexOf(e.charAt(c++))),a=a+(l(t<<2|n>>4)+(64!=r?l(i):""))+(64!=o?l(s):"");return this.utf8.decode(a)},utf8:{encode:function(e){"use strict";for(var t,n="",r=0,o=String.fromCharCode;r127&&t<2048?o(t>>6|192)+o(63&t|128):o(t>>12|224)+o(t>>6&63|128)+o(63&t|128);return n},decode:function(e){"use strict";for(var t,n="",r=0,o=String.fromCharCode;r191&&t<224?[o((31&t)<<6|63&e.charCodeAt(r+1)),r+=2][0]:[o((15&t)<<12|(63&e.charCodeAt(r+1))<<6|63&(c3=e.charCodeAt(r+2))),r+=3][0];return n}}}},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var c,u=[],l=!1,f=-1;function d(){l&&c&&(l=!1,c.length?u=c.concat(u):f=-1,u.length&&h())}function h(){if(!l){var e=a(d);l=!0;for(var t=u.length;t;){for(c=u,u=[];++f1)for(var n=1;n=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n(35),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(2))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=Object.assign||function(e){for(var t=1;t0))return 1900;return 16e3}(),navigator&&navigator.sendBeacon&&("beaconAPI"===S.requestType||O&&"beaconAPI"===O.requestType))return navigator.sendBeacon(l+"?api_key="+this.writeKey(),JSON.stringify(E)),this;if(k)switch(this.config.requestType){case"xhr":b.call(this,"POST",l,E,p);break;case"beacon":x?function(e,t){var n=this,r=t,o=document.createElement("img");t=null,o.onload=function(){if(!0,"naturalHeight"in this){if(this.naturalHeight+this.naturalWidth===0)return void this.onerror()}else if(this.width+this.height===0)return void this.onerror();r&&r.call(n)},o.onerror=function(){!0,r&&r.call(n,"An error occurred!",null)},o.src=e+"&c=clv1"}.call(this,_,p):v.call(this,l,E,"Beacon URL length exceeds current browser limit, and XHR is not supported.",p);break;default:if("undefined"!=typeof fetch)return g.call(this,"POST",l,E,p);x?function(e,t){var n=this,r=t,o=(new Date).getTime(),i=document.createElement("script"),s=document.getElementsByTagName("head")[0],a="keenJSONPCallback",c=!1;t=null,a+=o;for(;a in window;)a+="a";function u(){r&&r.call(n,"An error occurred!",null)}function l(){window[a]=void 0;try{delete window[a]}catch(e){}s.removeChild(i)}window[a]=function(e){!0!==c&&(c=!0,r&&r.call(n,null,e),l())},i.src=e+"&jsonp="+a,s.appendChild(i),i.onreadystatechange=function(){!1===c&&"loaded"===this.readyState&&(c=!0,u(),l())},i.onerror=function(){!1===c&&(c=!0,u(),l())}}.call(this,_,p):v.call(this,l,E,"JSONp URL length exceeds current browser limit, and XHR is not supported.",p)}else x&&function(e){var t=w();t&&(t.open("GET",e,!1),t.send(null))}(_);return n=p=null,this}y.call(this,"Collection name must be a string.",n)}}function p(e,t){var n,r,i=this;if(n=this.url("events"),m.call(this,t))if("object"!==(void 0===e?"undefined":o(e))||e instanceof Array)y.call(this,"First argument must be an object",t);else{if(!(arguments.length>2))return this.config.globalProperties&&(console.log("config.globalProperties are deprecated"),(0,s.default)(e,function(t,n){(0,s.default)(t,function(t,r){var o=i.config.globalProperties(n);e[n][r]=(0,a.default)(o,t)})})),r={},(0,s.default)(e,function(e,t){r[t]=r[t]||[],(0,s.default)(e,function(e,n){var o={};(0,u.getExtendedEventBody)(o,i.extensions.events),(0,u.getExtendedEventBody)(o,i.extensions.collections[t]),(0,u.getExtendedEventBody)(o,[e]),r[t].push(o)})}),this.emit("recordEvents",r),c.default.enabled?this.config.requestType&&"xhr"===this.config.requestType||"undefined"==typeof fetch?(w()&&b.call(this,"POST",n,r,t),this):g.call(this,"POST",n,r,t):(y.call(this,"Keen.enabled is set to false.",t),!1);y.call(this,"Incorrect arguments provided to #recordEvents method",t)}}function m(e){return this.projectId()?!!this.writeKey()||(y.call(this,"Keen.Client is missing a writeKey property.",e),!1):(y.call(this,"Keen.Client is missing a projectId property.",e),!1)}function y(e,t){var n="Event(s) not recorded: "+e;this.emit("error",n),t&&t.call(this,n,null)}function v(e,t,n,r){w()?b.call(this,"POST",e,t,r):y.call(this,n)}function g(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0,o=this;return(0,l.default)(t,{method:e,body:n?JSON.stringify(n):"",mode:"cors",redirect:"follow",referrerPolicy:o.referrerPolicy()||"unsafe-url",headers:{Authorization:o.writeKey(),"Content-Type":"application/json"},retry:o.config.retry}).catch(function(e){return void 0!==r&&r.call(o,e,null),o.emit("error",e),Promise.reject(e)}).then(function(e){return e.ok?e.json():e.json().then(function(t){return Promise.reject({error_code:t.error_code,body:t.message,status:e.status,ok:!1,statusText:e.statusText})})}).then(function(e){return function(e){if(void 0!==e.created)return!!e.created;if(0===Object.keys(e).map(function(t){return e[t].filter(function(e){return!e.success})}).filter(function(e){return e.length>0}).length)return!0;return!1}(e)?(void 0!==r&&r.call(o,null,e),Promise.resolve(e)):(void 0!==r&&r.call(o,e,null),o.emit("error",e),Promise.reject(e))})}function b(e,t,n,r){var o,i=this,s=w(),a=r;r=null,s.onreadystatechange=function(){var e;if(4==s.readyState)if(s.status>=200&&s.status<300){try{e=JSON.parse(s.responseText)}catch(e){c.default.emit("error","Could not parse HTTP response: "+s.responseText),a&&a.call(i,s,null)}a&&e&&a.call(i,null,e)}else c.default.emit("error","HTTP request failed."),a&&a.call(i,s,null)},s.open(e,t,!0),s.setRequestHeader("Authorization",i.writeKey()),s.setRequestHeader("Content-Type","application/json"),n&&(o=JSON.stringify(n)),"GET"===e.toUpperCase()&&s.send(),"POST"===e.toUpperCase()&&s.send(o)}function w(){var e="undefined"==typeof window?this:window;if(e.XMLHttpRequest&&("file:"!=e.location.protocol||!e.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}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.listenerCore=void 0;o(n(6));var r=o(n(0));function o(e){return e&&e.__esModule?e:{default:e}}t.listenerCore=function(e){function t(e){if(e)return this instanceof t==!1?new t(e):(this.selector=e,this)}return e.domListeners=e.domListeners||{},t.prototype.on=function(t,n){var o;return 2!==arguments.length||"string"!=typeof t||"function"!=typeof n?this:(void 0===e.domListeners[t]&&(!function(e,t){document.addEventListener?document.addEventListener(e,t,!1):document.attachEvent("on"+e,t)}(t,(o=t,function(t){var n,i;n=t||window.event,i=n.target||n.srcElement,"undefined"!==e.domListeners[o]&&(0,r.default)(e.domListeners[o],function(e,t){!function(e,t){for(var n=(e.parentNode||document).querySelectorAll(t)||[],r=n.length;r--;)if(n[r]==e)return!0;return!1}(i,t)?"window"===t&&(0,r.default)(e,function(e,t){e(n)}):(0,r.default)(e,function(e,t){"click"===o&&"A"===i.nodeName?function(e,t,n){var r,o;if(void 0!==t.getAttribute?r=t.getAttribute("target"):t.target&&(r=t.target),"boolean"==typeof(o=n(e))&&!1===o||e.defaultPrevented||!1===e.returnValue)return e.preventDefault&&e.preventDefault(),e.returnValue=!1,!1;if("_blank"!==r&&"blank"!==r&&!e.metaKey&&!t.hasAttribute("download")&&(e.preventDefault&&e.preventDefault(),e.returnValue=!1,t.href&&"#"!==t.href&&t.href!==window.location+"#"))if(void 0!==o){if(navigator&&navigator.sendBeacon)return void(window.location=t.href);o.then(function(){window.location=t.href}).catch(function(e){window.location=t.href})}else setTimeout(function(){window.location=t.href},500)}(n,i,e):"submit"===o&&"FORM"===i.nodeName?function(e,t,n){var r=n(e);if("boolean"==typeof r&&!1===r||e.defaultPrevented||!1===e.returnValue)return e.preventDefault&&e.preventDefault(),e.returnValue=!1,!1;if(e.preventDefault&&e.preventDefault(),e.returnValue=!1,void 0!==r){if(navigator&&navigator.sendBeacon)return void t.submit();r.then(function(){t.submit()}).catch(function(e){t.submit()})}else setTimeout(function(){t.submit()},500)}(n,i,e):e(n)})})})),e.domListeners[t]={}),e.domListeners[t][this.selector]=e.domListeners[t][this.selector]||[],e.domListeners[t][this.selector].push(n),this)},t.prototype.once=function(e,t){var n=this;function r(){return n.off(e,r),t.apply(n,arguments)}return r.fn=t,n.on(e,r),n},t.prototype.off=function(t,n){var o=this,i=[];if(2===arguments.length)(0,r.default)(e.domListeners[t][o.selector],function(e,t){e!==n&&e.fn!==n&&i.push(e)}),e.domListeners[t][o.selector]=i;else if(1===arguments.length)try{delete e.domListeners[t][o.selector]}catch(n){e.domListeners[t][o.selector]=[]}else(0,r.default)(e.domListeners,function(t,n){try{delete e.domListeners[n][o.selector]}catch(t){e.domListeners[n][o.selector]=function(){}}});return o},t}},function(e,t,n){var r=n(0);n(1);e.exports=function(e){var t=[];return r(e,function(e,n){"string"!=typeof e&&(e=JSON.stringify(e)),t.push(n+"="+encodeURIComponent(e))}),t.join("&")}},function(e,t){e.exports=function(e){var t,n={},r=/\+/g,o=/([^&=]+)=?([^&]*)/g,i=function(e){return decodeURIComponent(e.replace(r," "))},s=e.split("?")[1];for(;t=o.exec(s);)n[i(t[1])]=i(t[2]);return n}},function(e,t,n){(function(t){(function(t){var r=t.Keen||void 0,o=n(0),i=n(1),s=n(40),a=n(39),c=n(6);function u(e){if(this instanceof u==!1)return new u(e);this.configure(e),u.debug&&this.on("error",u.log),this.emit("ready"),u.emit("client",this)}function l(e){return void 0!==e}r&&void 0===r.resources&&(u.legacyVersion=r),c(u),c(u.prototype),i(u,{debug:!1,enabled:!0,loaded:!1,version:"__VERSION__"}),u.helpers=u.helpers||{},u.resources=u.resources||{},i(u.resources,{base:"{protocol}://{host}",version:"{protocol}://{host}/3.0",projects:"{protocol}://{host}/3.0/projects",projectId:"{protocol}://{host}/3.0/projects/{projectId}",events:"{protocol}://{host}/3.0/projects/{projectId}/events",queries:"{protocol}://{host}/3.0/projects/{projectId}/queries"}),u.utils=u.utils||{},i(u.utils,{each:o,extend:i,parseParams:s,serialize:a}),u.extendLibrary=function(e,t){var n=r||t;return l(n)&&l(n.resources)&&(o(n,function(t,n){"object"==typeof t?(e[n]=e[n]||{},i(e[n],t)):e[n]=e[n]||t}),i(e.prototype,n.prototype)),e},u.log=function(e){u.debug&&"object"==typeof console&&console.log("[Keen]",e)},u.noConflict=function(){return void 0!==t.Keen&&(t.Keen=u.legacyVersion||r),u},u.ready=function(e){u.loaded?e():u.once("ready",e)},u.prototype.configure=function(e){var t=e||{};return this.config=this.config||{projectId:void 0,writeKey:void 0,host:"api.keen.io",protocol:"https",requestType:"jsonp",resources:i({},u.resources)},"undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1&&(t.protocol=document.location.protocol.replace(":","")),t.host&&t.host.replace(/.*?:\/\//g,""),i(this.config,t),this},u.prototype.masterKey=function(e){return arguments.length?(this.config.masterKey=e?String(e):null,this):this.config.masterKey},u.prototype.projectId=function(e){return arguments.length?(this.config.projectId=e?String(e):null,this):this.config.projectId},u.prototype.resources=function(e){if(!arguments.length)return this.config.resources;var t=this;return"object"==typeof e&&o(e,function(e,n){t.config.resources[n]=e||null}),t},u.prototype.url=function(e){var t,n=Array.prototype.slice.call(arguments,1),r=this.config.resources.base||"{protocol}://{host}";return t=e&&"string"==typeof e?this.config.resources[e]?this.config.resources[e]:r+e:r,o(this.config,function(e,n){"object"!=typeof e&&(t=t.replace("{"+n+"}",e))}),o(n,function(e,n){"string"==typeof e?t+="/"+e:"object"==typeof e&&(t+="?",o(e,function(e,n){t+=n+"="+e+"&"}),t=t.slice(0,-1))}),t},function(e){if(u.loaded||"undefined"==typeof document)return void e();null==document.readyState&&document.addEventListener&&(document.addEventListener("DOMContentLoaded",function e(){document.removeEventListener("DOMContentLoaded",e,!1),document.readyState="complete"},!1),document.readyState="loading");!function e(t){/in/.test(document.readyState)?setTimeout(function(){e(t)},9):t()}(e)}(function(){u.loaded=!0,u.emit("ready")}),e.exports=u}).call(this,"undefined"!=typeof window?window:void 0!==t?t:"undefined"!=typeof self?self:{})}).call(this,n(2))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeenTracking=t.Keen=t.keenGlobals=void 0;var r=k(n(7)),o=k(n(0)),i=k(n(1)),s=n(38),a=n(37),c=n(29),u=n(13),l=n(28),f=n(26),d=n(25),h=n(24),p=n(8),m=n(23),y=n(10),v=n(22),g=n(21),b=n(9),w=n(20),_=n(12),x=n(18),E=n(17);function k(e){return e&&e.__esModule?e:{default:e}}(0,i.default)(r.default.prototype,{recordEvent:a.recordEvent,recordEvents:a.recordEvents,addEvent:a.addEvent,addEvents:a.addEvents}),(0,i.default)(r.default.prototype,{deferEvent:c.deferEvent,deferEvents:c.deferEvents,queueCapacity:c.queueCapacity,queueInterval:c.queueInterval,recordDeferredEvents:c.recordDeferredEvents}),(0,i.default)(r.default.prototype,{extendEvent:u.extendEvent,extendEvents:u.extendEvents});var T=(0,l.initAutoTrackingCore)(r.default);(0,i.default)(r.default.prototype,{initAutoTracking:T}),r.default.prototype.trackExternalLink=function(e,t,n,r,o){this.emit("error","This method has been deprecated. Check out DOM listeners: https://github.com/keen/keen-tracking.js#listeners");var i,s=e,a=s.currentTarget?s.currentTarget:s.srcElement||s.target,c=r||500,u=!1,l="";void 0!==a.getAttribute?l=a.getAttribute("target"):a.target&&(l=a.target);"_blank"!=l&&"blank"!=l||s.metaKey||(window.open("about:blank").document.location=a.href);"A"===a.nodeName?i=function(){u||s.metaKey||"_blank"===l||"blank"===l||(u=!0,window.location=a.href)}:"FORM"===a.nodeName?i=function(){u||(u=!0,a.submit())}:this.trigger("error","#trackExternalLink method not attached to an or DOM element");o&&(i=function(){u||(u=!0,o())});if(this.recordEvent(t,n,i),setTimeout(i,c),!s.metaKey)return!1},(0,i.default)(r.default.helpers,{getBrowserProfile:f.getBrowserProfile,getDatetimeIndex:d.getDatetimeIndex,getDomainName:h.getDomainName,getDomNodePath:p.getDomNodePath,getDomNodeProfile:m.getDomNodeProfile,getScreenProfile:y.getScreenProfile,getScrollState:v.getScrollState,getUniqueId:g.getUniqueId,getWindowProfile:b.getWindowProfile});var j=(0,s.listenerCore)(r.default);(0,i.default)(r.default.utils,{cookie:w.cookie,deepExtend:_.deepExtend,listener:j,serializeForm:x.serializeForm,timer:E.timer}),r.default.listenTo=function(e){(0,o.default)(e,function(e,t){var n=t.split(" "),r=n[0],o=n.slice(1,n.length).join(" ");return j(o).on(r,e)})},Array.prototype.indexOf||(Array.prototype.indexOf=function(e){var t=this.length>>>0,n=Number(arguments[1])||0;for((n=n<0?Math.ceil(n):Math.floor(n))<0&&(n+=t);n stats.json","analyze":"webpack-bundle-analyzer stats.json /dist","preversion":"npm run build && npm run test","version":"git add .","postversion":"git push && git push --tags","demo":"node ./test/demo/index.node.js"},"bugs":"https://github.com/keen/keen-tracking.js/issues","author":"Keen IO (https://keen.io/)","contributors":["Dustin Larimer (https://github.com/dustinlarimer)","Eric Anderson (https://github.com/aroc)","Joe Wegner (http://www.wegnerdesign.com)","Alex Kleissner (https://github.com/hex337)","Adam Kasprowicz (https://github.com/adamkasprowicz)"],"license":"MIT","dependencies":{"component-emitter":"^1.2.0","js-cookie":"2.1.0","keen-core":"^0.1.3","promise-polyfill":"^8.0.0","whatwg-fetch":"^2.0.4"},"devDependencies":{"babel-core":"^6.26.3","babel-jest":"^23.0.1","babel-loader":"^7.1.5","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-polyfill":"^6.26.0","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint":"^4.19.1","eslint-config-airbnb":"^16.1.0","eslint-loader":"^2.0.0","eslint-plugin-import":"^2.11.0","eslint-plugin-jsx-a11y":"^6.0.3","html-loader":"^0.5.5","html-webpack-plugin":"^3.2.0","jest":"^22.4.3","jest-fetch-mock":"^1.6.5","nock":"^9.2.6","regenerator-runtime":"^0.11.1","replace-in-file":"^3.4.0","webpack":"^4.5.0","webpack-bundle-analyzer":"^2.11.1","webpack-cli":"^2.0.13","webpack-dev-server":"^3.1.1","xhr-mock":"^2.3.2"}}; +module.exports = {"name":"keen-tracking","version":"3.2.0","description":"Data Collection SDK for Keen IO","main":"dist/node/keen-tracking.js","browser":"dist/keen-tracking.js","repository":{"type":"git","url":"https://github.com/keen/keen-tracking.js.git"},"scripts":{"start":"NODE_ENV=development webpack-dev-server","test":"NODE_ENV=test jest && npm run test:node","test:node":"NODE_ENV=test TEST_ENV=node jest","test:watch":"NODE_ENV=test jest --watch","test:node:watch":"NODE_ENV=test TEST_ENV=node jest --watch","build":"NODE_ENV=production webpack -p && NODE_ENV=production OPTIMIZE_MINIMIZE=1 webpack -p && npm run build:node","build:node":"TARGET=node NODE_ENV=production webpack -p","profile":"webpack --profile --json > stats.json","analyze":"webpack-bundle-analyzer stats.json /dist","preversion":"npm run build && npm run test","version":"git add .","postversion":"git push && git push --tags","demo":"node ./test/demo/index.node.js"},"bugs":"https://github.com/keen/keen-tracking.js/issues","author":"Keen IO (https://keen.io/)","contributors":["Dustin Larimer (https://github.com/dustinlarimer)","Eric Anderson (https://github.com/aroc)","Joe Wegner (http://www.wegnerdesign.com)","Alex Kleissner (https://github.com/hex337)","Adam Kasprowicz (https://github.com/adamkasprowicz)"],"license":"MIT","dependencies":{"component-emitter":"^1.2.0","js-cookie":"2.1.0","keen-core":"^0.1.3","promise-polyfill":"^8.0.0","whatwg-fetch":"^2.0.4"},"devDependencies":{"babel-core":"^6.26.3","babel-jest":"^23.0.1","babel-loader":"^7.1.5","babel-plugin-transform-es2015-modules-commonjs":"^6.26.2","babel-plugin-transform-object-rest-spread":"^6.26.0","babel-polyfill":"^6.26.0","babel-preset-env":"^1.7.0","babel-preset-es2015":"^6.24.1","babel-preset-stage-0":"^6.24.1","eslint":"^4.19.1","eslint-config-airbnb":"^16.1.0","eslint-loader":"^2.0.0","eslint-plugin-import":"^2.11.0","eslint-plugin-jsx-a11y":"^6.0.3","html-loader":"^0.5.5","html-webpack-plugin":"^3.2.0","jest":"^22.4.3","jest-fetch-mock":"^1.6.5","nock":"^9.2.6","regenerator-runtime":"^0.11.1","replace-in-file":"^3.4.0","webpack":"^4.5.0","webpack-bundle-analyzer":"^2.11.1","webpack-cli":"^2.0.13","webpack-dev-server":"^3.1.1","xhr-mock":"^2.3.2"}}; /***/ }), /* 9 */ diff --git a/package-lock.json b/package-lock.json index f3fd6739..25bc8f32 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "keen-tracking", - "version": "3.2.0", + "version": "4.0.0", "lockfileVersion": 1, "dependencies": { "@babel/code-frame": { diff --git a/package.json b/package.json index b8af09f9..13809bcb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "keen-tracking", - "version": "3.2.0", + "version": "4.0.0", "description": "Data Collection SDK for Keen IO", "main": "dist/node/keen-tracking.js", "browser": "dist/keen-tracking.js",