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

@livechat/store-metrics

Package Overview
Dependencies
Maintainers
0
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@livechat/store-metrics - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

2

dist/store-metrics.cjs.js

@@ -8,3 +8,3 @@ 'use strict';

var whitelist = [/:\/\/(www\.)?(accounts\.labs\.|accounts\.staging\.|accounts\.)?(livechatinc\.|livechat\.)com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?helpdesk\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?livechat\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?(my\.labs\.|my\.staging\.|my\.)livechatinc\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?knowledgebase\.ai(\/.*)?(\?.*)?$/, /:\/\/(www\.)?(app\.staging\.|app\.)knowledgebase\.ai(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?chatbot\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?openwidget\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?(platform\.)?((labs\.)|(staging\.))?text\.com(\/.*)?(\?.*)?$/];
var whitelist = [/:\/\/(www\.)?(accounts\.labs\.|accounts\.staging\.|accounts\.)?(livechatinc\.|livechat\.)com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?helpdesk\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?livechat\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?(my\.labs\.|my\.staging\.|my\.)livechatinc\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?knowledgebase\.ai(\/.*)?(\?.*)?$/, /:\/\/(www\.)?(app\.staging\.|app\.)knowledgebase\.ai(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?chatbot\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?openwidget\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?(platform\.)?((labs\.)|(staging\.))?text\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?(marketplace-agentapp\.)((labs\.)|(staging\.))?livechatinc\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?(marketplace\.)((labs\.)|(staging\.))?helpdesk\.com(\/.*)?(\?.*)?$/];

@@ -11,0 +11,0 @@ window.debuggingEnabled = document.location.href.includes('labs') || document.location.href.includes('staging') || document.location.href.includes('development');

import Cookies from 'js-cookie';
import CrossStorageClient from 'cross-storage/lib/client';
var whitelist = [/:\/\/(www\.)?(accounts\.labs\.|accounts\.staging\.|accounts\.)?(livechatinc\.|livechat\.)com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?helpdesk\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?livechat\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?(my\.labs\.|my\.staging\.|my\.)livechatinc\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?knowledgebase\.ai(\/.*)?(\?.*)?$/, /:\/\/(www\.)?(app\.staging\.|app\.)knowledgebase\.ai(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?chatbot\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?openwidget\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?(platform\.)?((labs\.)|(staging\.))?text\.com(\/.*)?(\?.*)?$/];
var whitelist = [/:\/\/(www\.)?(accounts\.labs\.|accounts\.staging\.|accounts\.)?(livechatinc\.|livechat\.)com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?helpdesk\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?livechat\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?(my\.labs\.|my\.staging\.|my\.)livechatinc\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?knowledgebase\.ai(\/.*)?(\?.*)?$/, /:\/\/(www\.)?(app\.staging\.|app\.)knowledgebase\.ai(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?chatbot\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?((labs\.)|(staging\.))?openwidget\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?(platform\.)?((labs\.)|(staging\.))?text\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?(marketplace-agentapp\.)((labs\.)|(staging\.))?livechatinc\.com(\/.*)?(\?.*)?$/, /:\/\/(www\.)?(marketplace\.)((labs\.)|(staging\.))?helpdesk\.com(\/.*)?(\?.*)?$/];

@@ -6,0 +6,0 @@ window.debuggingEnabled = document.location.href.includes('labs') || document.location.href.includes('staging') || document.location.href.includes('development');

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(0,function(){"use strict";function e(e,t){return t={exports:{}},e(t,t.exports),t.exports}"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var t=e(function(e,t){!function(t){if(e.exports=t(),!!0){var n=window.Cookies,r=window.Cookies=t();r.noConflict=function(){return window.Cookies=n,r}}}(function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}function t(n){function r(t,o,s){var i;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(s=e({path:"/"},r.defaults,s)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*s.expires),s.expires=a}s.expires=s.expires?s.expires.toUTCString():"";try{i=JSON.stringify(o),/^[\{\[]/.test(i)&&(o=i)}catch(e){}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);var c="";for(var u in s)s[u]&&(c+="; "+u,!0!==s[u]&&(c+="="+s[u]));return document.cookie=t+"="+o+c}t||(i={});for(var l=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,f=0;f<l.length;f++){var p=l[f].split("="),m=p.slice(1).join("=");this.json||'"'!==m.charAt(0)||(m=m.slice(1,-1));try{var h=p[0].replace(d,decodeURIComponent);if(m=n.read?n.read(m,h):n(m,h)||m.replace(d,decodeURIComponent),this.json)try{m=JSON.parse(m)}catch(e){}if(t===h){i=m;break}t||(i[h]=m)}catch(e){}}return i}}return r.set=r,r.get=function(e){return r.call(r,e)},r.getJSON=function(){return r.apply({json:!0},[].slice.call(arguments))},r.defaults={},r.remove=function(t,n){r(t,"",e(n,{expires:-1}))},r.withConverter=t,r}return t(function(){})})}),n=e(function(e,t){!function(n){function r(e,t){t=t||{},this._id=r._generateUUID(),this._promise=t.promise||Promise,this._frameId=t.frameId||"CrossStorageClient-"+this._id,this._origin=r._getOrigin(e),this._requests={},this._connected=!1,this._closed=!1,this._count=0,this._timeout=t.timeout||5e3,this._listener=null,this._installListener();var n;t.frameId&&(n=document.getElementById(t.frameId)),n&&this._poll(),n=n||this._createFrame(e),this._hub=n.contentWindow}r.frameStyle={display:"none",position:"absolute",top:"-999px",left:"-999px"},r._getOrigin=function(e){var t,n,r;return t=document.createElement("a"),t.href=e,t.host||(t=window.location),n=t.protocol&&":"!==t.protocol?t.protocol:window.location.protocol,r=n+"//"+t.host,r=r.replace(/:80$|:443$/,"")},r._generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},r.prototype.onConnect=function(){var e=this;return this._connected?this._promise.resolve():this._closed?this._promise.reject(new Error("CrossStorageClient has closed")):(this._requests.connect||(this._requests.connect=[]),new this._promise(function(t,n){var r=setTimeout(function(){n(new Error("CrossStorageClient could not connect"))},e._timeout);e._requests.connect.push(function(e){if(clearTimeout(r),e)return n(e);t()})}))},r.prototype.set=function(e,t,n){return this._request("set",{key:e,value:t,ttl:n})},r.prototype.get=function(e){var t=Array.prototype.slice.call(arguments);return this._request("get",{keys:t})},r.prototype.del=function(){var e=Array.prototype.slice.call(arguments);return this._request("del",{keys:e})},r.prototype.clear=function(){return this._request("clear")},r.prototype.getKeys=function(){return this._request("getKeys")},r.prototype.close=function(){var e=document.getElementById(this._frameId);e&&e.parentNode.removeChild(e),window.removeEventListener?window.removeEventListener("message",this._listener,!1):window.detachEvent("onmessage",this._listener),this._connected=!1,this._closed=!0},r.prototype._installListener=function(){var e=this;this._listener=function(t){var n,r,o;if(!e._closed&&t.data&&"string"==typeof t.data&&("null"===t.origin?"file://":t.origin)===e._origin)if("cross-storage:unavailable"!==t.data){if(-1!==t.data.indexOf("cross-storage:")&&!e._connected){if(e._connected=!0,!e._requests.connect)return;for(n=0;n<e._requests.connect.length;n++)e._requests.connect[n](r);delete e._requests.connect}if("cross-storage:ready"!==t.data){try{o=JSON.parse(t.data)}catch(e){return}o.id&&e._requests[o.id]&&e._requests[o.id](o.error,o.result)}}else{if(e._closed||e.close(),!e._requests.connect)return;for(r=new Error("Closing client. Could not access localStorage in hub."),n=0;n<e._requests.connect.length;n++)e._requests.connect[n](r)}},window.addEventListener?window.addEventListener("message",this._listener,!1):window.attachEvent("onmessage",this._listener)},r.prototype._poll=function(){var e,t,n;n="file://"===(e=this)._origin?"*":e._origin,t=setInterval(function(){if(e._connected)return clearInterval(t);e._hub&&e._hub.postMessage("cross-storage:poll",n)},1e3)},r.prototype._createFrame=function(e){var t,n;(t=window.document.createElement("iframe")).id=this._frameId;for(n in r.frameStyle)r.frameStyle.hasOwnProperty(n)&&(t.style[n]=r.frameStyle[n]);return window.document.body.appendChild(t),t.src=e,t},r.prototype._request=function(e,t){var n,r;return this._closed?this._promise.reject(new Error("CrossStorageClient has closed")):(r=this,r._count++,n={id:this._id+":"+r._count,method:"cross-storage:"+e,params:t},new this._promise(function(e,t){var o,s,i;o=setTimeout(function(){r._requests[n.id]&&(delete r._requests[n.id],t(new Error("Timeout: could not perform "+n.method)))},r._timeout),r._requests[n.id]=function(s,i){if(clearTimeout(o),delete r._requests[n.id],s)return t(new Error(s));e(i)},Array.prototype.toJSON&&(s=Array.prototype.toJSON,Array.prototype.toJSON=null),i="file://"===r._origin?"*":r._origin,r._hub.postMessage(JSON.stringify(n),i),s&&(Array.prototype.toJSON=s)}))},e.exports?e.exports=r:t.CrossStorageClient=r}()}),r=(n.CrossStorageClient,[/:\/\/(www\.)?(accounts\.labs\.|accounts\.staging\.|accounts\.)?(livechatinc\.|livechat\.)com(\/.*)?(\?.*)?$/,/:\/\/(www\.)?((labs\.)|(staging\.))?helpdesk\.com(\/.*)?(\?.*)?$/,/:\/\/(www\.)?((labs\.)|(staging\.))?livechat\.com(\/.*)?(\?.*)?$/,/:\/\/(www\.)?(my\.labs\.|my\.staging\.|my\.)livechatinc\.com(\/.*)?(\?.*)?$/,/:\/\/(www\.)?((labs\.)|(staging\.))?knowledgebase\.ai(\/.*)?(\?.*)?$/,/:\/\/(www\.)?(app\.staging\.|app\.)knowledgebase\.ai(\/.*)?(\?.*)?$/,/:\/\/(www\.)?((labs\.)|(staging\.))?chatbot\.com(\/.*)?(\?.*)?$/,/:\/\/(www\.)?((labs\.)|(staging\.))?openwidget\.com(\/.*)?(\?.*)?$/,/:\/\/(www\.)?(platform\.)?((labs\.)|(staging\.))?text\.com(\/.*)?(\?.*)?$/]);window.debuggingEnabled=document.location.href.includes("labs")||document.location.href.includes("staging")||document.location.href.includes("development");var o=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(window.debuggingEnabled){var r;(r=console).log.apply(r,["[debug logs from @livechat/store-metrics - labs only]"].concat(t))}},s=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],i={utm:12096e5,referrer:12096e5,landing_page:12096e5,discount:12096e5,partner_id:10368e6,promocode:10368e6,sscid:10368e6},a=function(e){var t=e.split(".");return"."+(t.length>2?t.slice(1).join("."):t.join("."))};!function(){var e={},c=new window.URL(document.location.href),u=function(e){var t=c.hostname.split(".");if(t.length>1)return t[t.length-2]}(),l="https://accounts."+(c.hostname.includes("labs")?"labs.":"")+"livechat.com/static/hub.html",d=Boolean(t.get("metrics_session")),f=s.filter(function(e){return c.searchParams.has(e)});f.length&&(e.utm={},f.forEach(function(t){e.utm[t]=c.searchParams.get(t)}));var p=document.referrer?new window.URL(document.referrer):null;p&&a(p.hostname)!==a(c.hostname)&&(e.referrer=p.href),d||(e.landing_page=c.origin+c.pathname),c.searchParams.has("discount")&&(e.discount=c.searchParams.get("discount")),c.searchParams.has("a")&&(e.partner_id=c.searchParams.get("a")),c.searchParams.has("partner_id")&&(e.partner_id=c.searchParams.get("partner_id"));var m=r.some(function(e){return e.test(c.href)}),h=!e.referrer,g=!(!e.utm||!e.utm.utm_source&&!e.utm.utm_medium);o("isUrlOnWhitelist",m),o("isDirectVisit",h),o("hasUtmSourceOrMedium",g);var _=!0;(m||h||!g)&&(_=!1),_&&(e.partner_id=void 0),o("shouldResetPartnerId",_),c.searchParams.has("partner")&&(e.promocode=c.searchParams.get("partner")),c.searchParams.has("sscid")&&(e.sscid=c.searchParams.get("sscid"));var w=Object.keys(e);if(w.length){var y=new n(l),v=y.onConnect();w.forEach(function(t){v.then(function(){return y.set(u+":"+t,e[t],i[t])})}),v.catch(function(e){return console.error(e)}),t.set("metrics_session","true",{domain:a(c.hostname),samesite:"none",secure:!0,expires:14})}}()});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t():"function"==typeof define&&define.amd?define(t):t()}(0,function(){"use strict";function e(e,t){return t={exports:{}},e(t,t.exports),t.exports}"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var t=e(function(e,t){!function(t){if(e.exports=t(),!!0){var n=window.Cookies,r=window.Cookies=t();r.noConflict=function(){return window.Cookies=n,r}}}(function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}function t(n){function r(t,o,s){var i;if("undefined"!=typeof document){if(arguments.length>1){if("number"==typeof(s=e({path:"/"},r.defaults,s)).expires){var a=new Date;a.setMilliseconds(a.getMilliseconds()+864e5*s.expires),s.expires=a}s.expires=s.expires?s.expires.toUTCString():"";try{i=JSON.stringify(o),/^[\{\[]/.test(i)&&(o=i)}catch(e){}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);var c="";for(var u in s)s[u]&&(c+="; "+u,!0!==s[u]&&(c+="="+s[u]));return document.cookie=t+"="+o+c}t||(i={});for(var l=document.cookie?document.cookie.split("; "):[],d=/(%[0-9A-Z]{2})+/g,p=0;p<l.length;p++){var m=l[p].split("="),f=m.slice(1).join("=");this.json||'"'!==f.charAt(0)||(f=f.slice(1,-1));try{var h=m[0].replace(d,decodeURIComponent);if(f=n.read?n.read(f,h):n(f,h)||f.replace(d,decodeURIComponent),this.json)try{f=JSON.parse(f)}catch(e){}if(t===h){i=f;break}t||(i[h]=f)}catch(e){}}return i}}return r.set=r,r.get=function(e){return r.call(r,e)},r.getJSON=function(){return r.apply({json:!0},[].slice.call(arguments))},r.defaults={},r.remove=function(t,n){r(t,"",e(n,{expires:-1}))},r.withConverter=t,r}return t(function(){})})}),n=e(function(e,t){!function(n){function r(e,t){t=t||{},this._id=r._generateUUID(),this._promise=t.promise||Promise,this._frameId=t.frameId||"CrossStorageClient-"+this._id,this._origin=r._getOrigin(e),this._requests={},this._connected=!1,this._closed=!1,this._count=0,this._timeout=t.timeout||5e3,this._listener=null,this._installListener();var n;t.frameId&&(n=document.getElementById(t.frameId)),n&&this._poll(),n=n||this._createFrame(e),this._hub=n.contentWindow}r.frameStyle={display:"none",position:"absolute",top:"-999px",left:"-999px"},r._getOrigin=function(e){var t,n,r;return t=document.createElement("a"),t.href=e,t.host||(t=window.location),n=t.protocol&&":"!==t.protocol?t.protocol:window.location.protocol,r=n+"//"+t.host,r=r.replace(/:80$|:443$/,"")},r._generateUUID=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},r.prototype.onConnect=function(){var e=this;return this._connected?this._promise.resolve():this._closed?this._promise.reject(new Error("CrossStorageClient has closed")):(this._requests.connect||(this._requests.connect=[]),new this._promise(function(t,n){var r=setTimeout(function(){n(new Error("CrossStorageClient could not connect"))},e._timeout);e._requests.connect.push(function(e){if(clearTimeout(r),e)return n(e);t()})}))},r.prototype.set=function(e,t,n){return this._request("set",{key:e,value:t,ttl:n})},r.prototype.get=function(e){var t=Array.prototype.slice.call(arguments);return this._request("get",{keys:t})},r.prototype.del=function(){var e=Array.prototype.slice.call(arguments);return this._request("del",{keys:e})},r.prototype.clear=function(){return this._request("clear")},r.prototype.getKeys=function(){return this._request("getKeys")},r.prototype.close=function(){var e=document.getElementById(this._frameId);e&&e.parentNode.removeChild(e),window.removeEventListener?window.removeEventListener("message",this._listener,!1):window.detachEvent("onmessage",this._listener),this._connected=!1,this._closed=!0},r.prototype._installListener=function(){var e=this;this._listener=function(t){var n,r,o;if(!e._closed&&t.data&&"string"==typeof t.data&&("null"===t.origin?"file://":t.origin)===e._origin)if("cross-storage:unavailable"!==t.data){if(-1!==t.data.indexOf("cross-storage:")&&!e._connected){if(e._connected=!0,!e._requests.connect)return;for(n=0;n<e._requests.connect.length;n++)e._requests.connect[n](r);delete e._requests.connect}if("cross-storage:ready"!==t.data){try{o=JSON.parse(t.data)}catch(e){return}o.id&&e._requests[o.id]&&e._requests[o.id](o.error,o.result)}}else{if(e._closed||e.close(),!e._requests.connect)return;for(r=new Error("Closing client. Could not access localStorage in hub."),n=0;n<e._requests.connect.length;n++)e._requests.connect[n](r)}},window.addEventListener?window.addEventListener("message",this._listener,!1):window.attachEvent("onmessage",this._listener)},r.prototype._poll=function(){var e,t,n;n="file://"===(e=this)._origin?"*":e._origin,t=setInterval(function(){if(e._connected)return clearInterval(t);e._hub&&e._hub.postMessage("cross-storage:poll",n)},1e3)},r.prototype._createFrame=function(e){var t,n;(t=window.document.createElement("iframe")).id=this._frameId;for(n in r.frameStyle)r.frameStyle.hasOwnProperty(n)&&(t.style[n]=r.frameStyle[n]);return window.document.body.appendChild(t),t.src=e,t},r.prototype._request=function(e,t){var n,r;return this._closed?this._promise.reject(new Error("CrossStorageClient has closed")):(r=this,r._count++,n={id:this._id+":"+r._count,method:"cross-storage:"+e,params:t},new this._promise(function(e,t){var o,s,i;o=setTimeout(function(){r._requests[n.id]&&(delete r._requests[n.id],t(new Error("Timeout: could not perform "+n.method)))},r._timeout),r._requests[n.id]=function(s,i){if(clearTimeout(o),delete r._requests[n.id],s)return t(new Error(s));e(i)},Array.prototype.toJSON&&(s=Array.prototype.toJSON,Array.prototype.toJSON=null),i="file://"===r._origin?"*":r._origin,r._hub.postMessage(JSON.stringify(n),i),s&&(Array.prototype.toJSON=s)}))},e.exports?e.exports=r:t.CrossStorageClient=r}()}),r=(n.CrossStorageClient,[/:\/\/(www\.)?(accounts\.labs\.|accounts\.staging\.|accounts\.)?(livechatinc\.|livechat\.)com(\/.*)?(\?.*)?$/,/:\/\/(www\.)?((labs\.)|(staging\.))?helpdesk\.com(\/.*)?(\?.*)?$/,/:\/\/(www\.)?((labs\.)|(staging\.))?livechat\.com(\/.*)?(\?.*)?$/,/:\/\/(www\.)?(my\.labs\.|my\.staging\.|my\.)livechatinc\.com(\/.*)?(\?.*)?$/,/:\/\/(www\.)?((labs\.)|(staging\.))?knowledgebase\.ai(\/.*)?(\?.*)?$/,/:\/\/(www\.)?(app\.staging\.|app\.)knowledgebase\.ai(\/.*)?(\?.*)?$/,/:\/\/(www\.)?((labs\.)|(staging\.))?chatbot\.com(\/.*)?(\?.*)?$/,/:\/\/(www\.)?((labs\.)|(staging\.))?openwidget\.com(\/.*)?(\?.*)?$/,/:\/\/(www\.)?(platform\.)?((labs\.)|(staging\.))?text\.com(\/.*)?(\?.*)?$/,/:\/\/(www\.)?(marketplace-agentapp\.)((labs\.)|(staging\.))?livechatinc\.com(\/.*)?(\?.*)?$/,/:\/\/(www\.)?(marketplace\.)((labs\.)|(staging\.))?helpdesk\.com(\/.*)?(\?.*)?$/]);window.debuggingEnabled=document.location.href.includes("labs")||document.location.href.includes("staging")||document.location.href.includes("development");var o=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];if(window.debuggingEnabled){var r;(r=console).log.apply(r,["[debug logs from @livechat/store-metrics - labs only]"].concat(t))}},s=["utm_source","utm_medium","utm_campaign","utm_term","utm_content"],i={utm:12096e5,referrer:12096e5,landing_page:12096e5,discount:12096e5,partner_id:10368e6,promocode:10368e6,sscid:10368e6},a=function(e){var t=e.split(".");return"."+(t.length>2?t.slice(1).join("."):t.join("."))};!function(){var e={},c=new window.URL(document.location.href),u=function(e){var t=c.hostname.split(".");if(t.length>1)return t[t.length-2]}(),l="https://accounts."+(c.hostname.includes("labs")?"labs.":"")+"livechat.com/static/hub.html",d=Boolean(t.get("metrics_session")),p=s.filter(function(e){return c.searchParams.has(e)});p.length&&(e.utm={},p.forEach(function(t){e.utm[t]=c.searchParams.get(t)}));var m=document.referrer?new window.URL(document.referrer):null;m&&a(m.hostname)!==a(c.hostname)&&(e.referrer=m.href),d||(e.landing_page=c.origin+c.pathname),c.searchParams.has("discount")&&(e.discount=c.searchParams.get("discount")),c.searchParams.has("a")&&(e.partner_id=c.searchParams.get("a")),c.searchParams.has("partner_id")&&(e.partner_id=c.searchParams.get("partner_id"));var f=r.some(function(e){return e.test(c.href)}),h=!e.referrer,g=!(!e.utm||!e.utm.utm_source&&!e.utm.utm_medium);o("isUrlOnWhitelist",f),o("isDirectVisit",h),o("hasUtmSourceOrMedium",g);var _=!0;(f||h||!g)&&(_=!1),_&&(e.partner_id=void 0),o("shouldResetPartnerId",_),c.searchParams.has("partner")&&(e.promocode=c.searchParams.get("partner")),c.searchParams.has("sscid")&&(e.sscid=c.searchParams.get("sscid"));var w=Object.keys(e);if(w.length){var y=new n(l),v=y.onConnect();w.forEach(function(t){v.then(function(){return y.set(u+":"+t,e[t],i[t])})}),v.catch(function(e){return console.error(e)}),t.set("metrics_session","true",{domain:a(c.hostname),samesite:"none",secure:!0,expires:14})}}()});
{
"name": "@livechat/store-metrics",
"version": "1.1.3",
"version": "1.1.4",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/store-metrics.cjs.js",

@@ -57,2 +57,6 @@ # @livechat/store-metrics

### 1.1.4 — 2024-08-14
#### Added
- Regexes for Marketplace in whitelisted urls
### 1.1.3 — 2024-08-08

@@ -59,0 +63,0 @@ #### Added

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc