Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gtm-event-tracker

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gtm-event-tracker - npm Package Compare versions

Comparing version 1.7.0-beta.9 to 1.7.0-beta.10

8

dist/cjs/index.js

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});function Tn(s={}){var c;const d=console;let g=(c=s.logger)!=null?c:d;function p(){return g}function _(v){g=v}return{getLogger:p,setLogger:_}}const It=Tn(),{setLogger:wn}=It,{getLogger:tt}=It;function mn(s){const c=tt(),{contextName:d,properties:g}=s;c.log({type:"context-created",contextName:d,properties:g})}function xn(s){const c=tt(),{contextName:d,currentProps:g,newProps:p}=s;c.log({type:"context-updated",contextName:d,previousProperties:g,currentProperties:p})}function Cn(s={},c={}){const d={options:{...c},value:{...s}};function g(){return d.value}function p(v){const w={...v};d.value=w}function _(v){const w=g(),N={...v};xn({contextName:d.options.name,currentProps:w,newProps:N}),p(N)}return mn({contextName:d.options.name,properties:g()}),{context:d,setProps:_}}class et extends Error{constructor(c){super(c),this.name="Warning"}}class An extends Error{constructor(c){super(c),this.name="InvalidConfiguration"}}function On(){throw new et(`Triggering events is not possible on server-side.
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});function Tn(a={}){var u;const g=console;let d=(u=a.logger)!=null?u:g;function h(){return d}function p(_){d=_}return{getLogger:h,setLogger:p}}const Mt=Tn(),{setLogger:wn}=Mt,{getLogger:mn}=Mt;var H=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},nt={exports:{}};(function(a,u){var g=200,d="__lodash_hash_undefined__",h=800,p=16,_=9007199254740991,b="[object Arguments]",A="[object Array]",j="[object AsyncFunction]",$="[object Boolean]",Lt="[object Date]",Nt="[object Error]",at="[object Function]",zt="[object GeneratorFunction]",Ut="[object Map]",Dt="[object Number]",Ft="[object Null]",ut="[object Object]",Gt="[object Proxy]",Rt="[object RegExp]",Bt="[object Set]",Ht="[object String]",$t="[object Undefined]",Kt="[object WeakMap]",qt="[object ArrayBuffer]",Vt="[object DataView]",Wt="[object Float32Array]",Yt="[object Float64Array]",Jt="[object Int8Array]",Xt="[object Int16Array]",Zt="[object Int32Array]",Qt="[object Uint8Array]",kt="[object Uint8ClampedArray]",te="[object Uint16Array]",ee="[object Uint32Array]",ne=/[\\^$.*+?()[\]{}|]/g,re=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,c={};c[Wt]=c[Yt]=c[Jt]=c[Xt]=c[Zt]=c[Qt]=c[kt]=c[te]=c[ee]=!0,c[b]=c[A]=c[qt]=c[$]=c[Vt]=c[Lt]=c[Nt]=c[at]=c[Ut]=c[Dt]=c[ut]=c[Rt]=c[Bt]=c[Ht]=c[Kt]=!1;var st=typeof H=="object"&&H&&H.Object===Object&&H,ie=typeof self=="object"&&self&&self.Object===Object&&self,I=st||ie||Function("return this")(),ct=u&&!u.nodeType&&u,S=ct&&!0&&a&&!a.nodeType&&a,ft=S&&S.exports===ct,K=ft&&st.process,lt=function(){try{var t=S&&S.require&&S.require("util").types;return t||K&&K.binding&&K.binding("util")}catch(e){}}(),gt=lt&&lt.isTypedArray;function ae(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function ue(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function se(t){return function(e){return t(e)}}function ce(t,e){return t==null?void 0:t[e]}function fe(t,e){return function(n){return t(e(n))}}var le=Array.prototype,ge=Function.prototype,N=Object.prototype,q=I["__core-js_shared__"],z=ge.toString,T=N.hasOwnProperty,dt=function(){var t=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),pt=N.toString,de=z.call(Object),pe=RegExp("^"+z.call(T).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),U=ft?I.Buffer:void 0,ht=I.Symbol,_t=I.Uint8Array,yt=U?U.allocUnsafe:void 0,vt=fe(Object.getPrototypeOf,Object),bt=Object.create,he=N.propertyIsEnumerable,_e=le.splice,m=ht?ht.toStringTag:void 0,D=function(){try{var t=Y(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),ye=U?U.isBuffer:void 0,Tt=Math.max,ve=Date.now,wt=Y(I,"Map"),E=Y(Object,"create"),be=function(){function t(){}return function(e){if(!C(e))return{};if(bt)return bt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function x(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Te(){this.__data__=E?E(null):{},this.size=0}function we(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function me(t){var e=this.__data__;if(E){var n=e[t];return n===d?void 0:n}return T.call(e,t)?e[t]:void 0}function xe(t){var e=this.__data__;return E?e[t]!==void 0:T.call(e,t)}function Ce(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=E&&e===void 0?d:e,this}x.prototype.clear=Te,x.prototype.delete=we,x.prototype.get=me,x.prototype.has=xe,x.prototype.set=Ce;function w(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ae(){this.__data__=[],this.size=0}function Oe(t){var e=this.__data__,n=F(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():_e.call(e,n,1),--this.size,!0}function Pe(t){var e=this.__data__,n=F(e,t);return n<0?void 0:e[n][1]}function je(t){return F(this.__data__,t)>-1}function Ie(t,e){var n=this.__data__,r=F(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}w.prototype.clear=Ae,w.prototype.delete=Oe,w.prototype.get=Pe,w.prototype.has=je,w.prototype.set=Ie;function O(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Se(){this.size=0,this.__data__={hash:new x,map:new(wt||w),string:new x}}function Ee(t){var e=R(this,t).delete(t);return this.size-=e?1:0,e}function Me(t){return R(this,t).get(t)}function Le(t){return R(this,t).has(t)}function Ne(t,e){var n=R(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}O.prototype.clear=Se,O.prototype.delete=Ee,O.prototype.get=Me,O.prototype.has=Le,O.prototype.set=Ne;function P(t){var e=this.__data__=new w(t);this.size=e.size}function ze(){this.__data__=new w,this.size=0}function Ue(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function De(t){return this.__data__.get(t)}function Fe(t){return this.__data__.has(t)}function Ge(t,e){var n=this.__data__;if(n instanceof w){var r=n.__data__;if(!wt||r.length<g-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new O(r)}return n.set(t,e),this.size=n.size,this}P.prototype.clear=ze,P.prototype.delete=Ue,P.prototype.get=De,P.prototype.has=Fe,P.prototype.set=Ge;function Re(t,e){var n=Z(t),r=!n&&X(t),i=!n&&!r&&Ot(t),s=!n&&!r&&!i&&jt(t),f=n||r||i||s,o=f?ue(t.length,String):[],l=o.length;for(var v in t)(e||T.call(t,v))&&!(f&&(v=="length"||i&&(v=="offset"||v=="parent")||s&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||Ct(v,l)))&&o.push(v);return o}function V(t,e,n){(n!==void 0&&!B(t[e],n)||n===void 0&&!(e in t))&&W(t,e,n)}function Be(t,e,n){var r=t[e];(!(T.call(t,e)&&B(r,n))||n===void 0&&!(e in t))&&W(t,e,n)}function F(t,e){for(var n=t.length;n--;)if(B(t[n][0],e))return n;return-1}function W(t,e,n){e=="__proto__"&&D?D(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var He=en();function G(t){return t==null?t===void 0?$t:Ft:m&&m in Object(t)?nn(t):cn(t)}function mt(t){return M(t)&&G(t)==b}function $e(t){if(!C(t)||un(t))return!1;var e=k(t)?pe:re;return e.test(dn(t))}function Ke(t){return M(t)&&Pt(t.length)&&!!c[G(t)]}function qe(t){if(!C(t))return sn(t);var e=At(t),n=[];for(var r in t)r=="constructor"&&(e||!T.call(t,r))||n.push(r);return n}function xt(t,e,n,r,i){t!==e&&He(e,function(s,f){if(i||(i=new P),C(s))Ve(t,e,f,n,xt,r,i);else{var o=r?r(J(t,f),s,f+"",t,e,i):void 0;o===void 0&&(o=s),V(t,f,o)}},It)}function Ve(t,e,n,r,i,s,f){var o=J(t,n),l=J(e,n),v=f.get(l);if(v){V(t,n,v);return}var y=s?s(o,l,n+"",t,e,f):void 0,L=y===void 0;if(L){var tt=Z(l),et=!tt&&Ot(l),Et=!tt&&!et&&jt(l);y=l,tt||et||Et?Z(o)?y=o:pn(o)?y=Qe(o):et?(L=!1,y=Je(l,!0)):Et?(L=!1,y=Ze(l,!0)):y=[]:hn(l)||X(l)?(y=o,X(o)?y=_n(o):(!C(o)||k(o))&&(y=rn(l))):L=!1}L&&(f.set(l,y),i(y,l,r,s,f),f.delete(l)),V(t,n,y)}function We(t,e){return ln(fn(t,e,St),t+"")}var Ye=D?function(t,e){return D(t,"toString",{configurable:!0,enumerable:!1,value:vn(e),writable:!0})}:St;function Je(t,e){if(e)return t.slice();var n=t.length,r=yt?yt(n):new t.constructor(n);return t.copy(r),r}function Xe(t){var e=new t.constructor(t.byteLength);return new _t(e).set(new _t(t)),e}function Ze(t,e){var n=e?Xe(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Qe(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function ke(t,e,n,r){var i=!n;n||(n={});for(var s=-1,f=e.length;++s<f;){var o=e[s],l=r?r(n[o],t[o],o,n,t):void 0;l===void 0&&(l=t[o]),i?W(n,o,l):Be(n,o,l)}return n}function tn(t){return We(function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,f=i>2?n[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,f&&on(n[0],n[1],f)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var o=n[r];o&&t(e,o,r,s)}return e})}function en(t){return function(e,n,r){for(var i=-1,s=Object(e),f=r(e),o=f.length;o--;){var l=f[t?o:++i];if(n(s[l],l,s)===!1)break}return e}}function R(t,e){var n=t.__data__;return an(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Y(t,e){var n=ce(t,e);return $e(n)?n:void 0}function nn(t){var e=T.call(t,m),n=t[m];try{t[m]=void 0;var r=!0}catch(s){}var i=pt.call(t);return r&&(e?t[m]=n:delete t[m]),i}function rn(t){return typeof t.constructor=="function"&&!At(t)?be(vt(t)):{}}function Ct(t,e){var n=typeof t;return e=e==null?_:e,!!e&&(n=="number"||n!="symbol"&&oe.test(t))&&t>-1&&t%1==0&&t<e}function on(t,e,n){if(!C(n))return!1;var r=typeof e;return(r=="number"?Q(n)&&Ct(e,n.length):r=="string"&&e in n)?B(n[e],t):!1}function an(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function un(t){return!!dt&&dt in t}function At(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||N;return t===n}function sn(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function cn(t){return pt.call(t)}function fn(t,e,n){return e=Tt(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=Tt(r.length-e,0),f=Array(s);++i<s;)f[i]=r[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=r[i];return o[e]=n(f),ae(t,this,o)}}function J(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var ln=gn(Ye);function gn(t){var e=0,n=0;return function(){var r=ve(),i=p-(r-n);if(n=r,i>0){if(++e>=h)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function dn(t){if(t!=null){try{return z.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function B(t,e){return t===e||t!==t&&e!==e}var X=mt(function(){return arguments}())?mt:function(t){return M(t)&&T.call(t,"callee")&&!he.call(t,"callee")},Z=Array.isArray;function Q(t){return t!=null&&Pt(t.length)&&!k(t)}function pn(t){return M(t)&&Q(t)}var Ot=ye||bn;function k(t){if(!C(t))return!1;var e=G(t);return e==at||e==zt||e==j||e==Gt}function Pt(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=_}function C(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function M(t){return t!=null&&typeof t=="object"}function hn(t){if(!M(t)||G(t)!=ut)return!1;var e=vt(t);if(e===null)return!0;var n=T.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&z.call(n)==de}var jt=gt?se(gt):Ke;function _n(t){return ke(t,It(t))}function It(t){return Q(t)?Re(t,!0):qe(t)}var yn=tn(function(t,e,n){xt(t,e,n)});function vn(t){return function(){return t}}function St(t){return t}function bn(){return!1}a.exports=yn})(nt,nt.exports);var xn=nt.exports;class rt extends Error{constructor(u){super(u),this.name="Warning"}}class Cn extends Error{constructor(u){super(u),this.name="InvalidConfiguration"}}function An(){throw new Cn("You've called configure function without a configuration object.")}function On(){const a=u();function u(){return{logger:{debugAll:!1,debugEvents:!1,debugContext:!1},events:{targetProperty:()=>window.dataLayer}}}function g(){return a}function d(h){Boolean(h)||An(),xn(a,h)}return{get:g,defaults:u,configure:d}}const ot=On(),{configure:Pn}=ot;function jn(a={}){function u(){var p;return(p=a.configurations)!=null?p:ot.get()}function g(){return a.getLogger?a.getLogger():mn()}function d({type:p}){const _=()=>u().logger.debugAll,b=()=>u().logger.debugContext,A=()=>u().logger.debugEvents,j=$=>_()||$();return new Map([["event",j(A)],["context-created",j(b)],["context-updated",j(b)]]).get(p)}function h(p){const _=g();d(p)&&_.log(p)}return{log:h}}const it=jn();function In(a){const{contextName:u,properties:g}=a;it.log({type:"context-created",contextName:u,properties:g})}function Sn(a){const{contextName:u,currentProps:g,newProps:d}=a;it.log({type:"context-updated",contextName:u,previousProperties:g,currentProperties:d})}function En(a={},u={}){const g={options:{...u},value:{...a}};function d(){return g.value}function h(_){const b={..._};g.value=b}function p(_){const b=d(),A={..._};Sn({contextName:g.options.name,currentProps:b,newProps:A}),h(A)}return In({contextName:g.options.name,properties:d()}),{context:g,setProps:p}}function Mn(){throw new rt(`Triggering events is not possible on server-side.
Make sure to only trigger events after your app is running on the client-side.`)}function Pn(){throw new et(`The targetProperty is not defined.
Make sure to only trigger events after your app is running on the client-side.`)}function Ln(){throw new rt(`The targetProperty is not defined.
Make sure you didn't forget to add Google Tag Manager's script in your application.
If you did but you don't use the default 'window.dataLayer' array, you can set your custom targetProperty with the configure function.`)}function jn(){throw new et(`The targetProperty is not an array.
If you did but you don't use the default 'window.dataLayer' array, you can set your custom targetProperty with the configure function.`)}function Nn(){throw new rt(`The targetProperty is not an array.
Either you didn't installed Google Tag Manager correctly or you configured the targetProperty incorrectly.`)}var B=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},nt={exports:{}};(function(s,c){var d=200,g="__lodash_hash_undefined__",p=800,_=16,v=9007199254740991,w="[object Arguments]",N="[object Array]",Et="[object AsyncFunction]",Nt="[object Boolean]",Mt="[object Date]",Lt="[object Error]",rt="[object Function]",zt="[object GeneratorFunction]",Ut="[object Map]",Dt="[object Number]",Ft="[object Null]",it="[object Object]",Gt="[object Proxy]",Rt="[object RegExp]",Bt="[object Set]",Ht="[object String]",$t="[object Undefined]",Kt="[object WeakMap]",qt="[object ArrayBuffer]",Vt="[object DataView]",Wt="[object Float32Array]",Yt="[object Float64Array]",Jt="[object Int8Array]",Xt="[object Int16Array]",Zt="[object Int32Array]",Qt="[object Uint8Array]",kt="[object Uint8ClampedArray]",te="[object Uint16Array]",ee="[object Uint32Array]",ne=/[\\^$.*+?()[\]{}|]/g,re=/^\[object .+?Constructor\]$/,ie=/^(?:0|[1-9]\d*)$/,u={};u[Wt]=u[Yt]=u[Jt]=u[Xt]=u[Zt]=u[Qt]=u[kt]=u[te]=u[ee]=!0,u[w]=u[N]=u[qt]=u[Nt]=u[Vt]=u[Mt]=u[Lt]=u[rt]=u[Ut]=u[Dt]=u[it]=u[Rt]=u[Bt]=u[Ht]=u[Kt]=!1;var ot=typeof B=="object"&&B&&B.Object===Object&&B,oe=typeof self=="object"&&self&&self.Object===Object&&self,P=ot||oe||Function("return this")(),at=c&&!c.nodeType&&c,j=at&&!0&&s&&!s.nodeType&&s,ut=j&&j.exports===at,H=ut&&ot.process,st=function(){try{var t=j&&j.require&&j.require("util").types;return t||H&&H.binding&&H.binding("util")}catch(e){}}(),ct=st&&st.isTypedArray;function ae(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function ue(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function se(t){return function(e){return t(e)}}function ce(t,e){return t==null?void 0:t[e]}function fe(t,e){return function(n){return t(e(n))}}var le=Array.prototype,de=Function.prototype,M=Object.prototype,$=P["__core-js_shared__"],L=de.toString,b=M.hasOwnProperty,ft=function(){var t=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),lt=M.toString,ge=L.call(Object),pe=RegExp("^"+L.call(b).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),z=ut?P.Buffer:void 0,dt=P.Symbol,gt=P.Uint8Array,pt=z?z.allocUnsafe:void 0,ht=fe(Object.getPrototypeOf,Object),_t=Object.create,he=M.propertyIsEnumerable,_e=le.splice,m=dt?dt.toStringTag:void 0,U=function(){try{var t=V(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),ye=z?z.isBuffer:void 0,yt=Math.max,ve=Date.now,vt=V(P,"Map"),I=V(Object,"create"),be=function(){function t(){}return function(e){if(!C(e))return{};if(_t)return _t(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function x(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Te(){this.__data__=I?I(null):{},this.size=0}function we(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function me(t){var e=this.__data__;if(I){var n=e[t];return n===g?void 0:n}return b.call(e,t)?e[t]:void 0}function xe(t){var e=this.__data__;return I?e[t]!==void 0:b.call(e,t)}function Ce(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=I&&e===void 0?g:e,this}x.prototype.clear=Te,x.prototype.delete=we,x.prototype.get=me,x.prototype.has=xe,x.prototype.set=Ce;function T(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ae(){this.__data__=[],this.size=0}function Oe(t){var e=this.__data__,n=D(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():_e.call(e,n,1),--this.size,!0}function Pe(t){var e=this.__data__,n=D(e,t);return n<0?void 0:e[n][1]}function je(t){return D(this.__data__,t)>-1}function Ie(t,e){var n=this.__data__,r=D(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}T.prototype.clear=Ae,T.prototype.delete=Oe,T.prototype.get=Pe,T.prototype.has=je,T.prototype.set=Ie;function A(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Se(){this.size=0,this.__data__={hash:new x,map:new(vt||T),string:new x}}function Ee(t){var e=G(this,t).delete(t);return this.size-=e?1:0,e}function Ne(t){return G(this,t).get(t)}function Me(t){return G(this,t).has(t)}function Le(t,e){var n=G(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}A.prototype.clear=Se,A.prototype.delete=Ee,A.prototype.get=Ne,A.prototype.has=Me,A.prototype.set=Le;function O(t){var e=this.__data__=new T(t);this.size=e.size}function ze(){this.__data__=new T,this.size=0}function Ue(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function De(t){return this.__data__.get(t)}function Fe(t){return this.__data__.has(t)}function Ge(t,e){var n=this.__data__;if(n instanceof T){var r=n.__data__;if(!vt||r.length<d-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new A(r)}return n.set(t,e),this.size=n.size,this}O.prototype.clear=ze,O.prototype.delete=Ue,O.prototype.get=De,O.prototype.has=Fe,O.prototype.set=Ge;function Re(t,e){var n=J(t),r=!n&&Y(t),o=!n&&!r&&xt(t),a=!n&&!r&&!o&&At(t),f=n||r||o||a,i=f?ue(t.length,String):[],l=i.length;for(var y in t)(e||b.call(t,y))&&!(f&&(y=="length"||o&&(y=="offset"||y=="parent")||a&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||wt(y,l)))&&i.push(y);return i}function K(t,e,n){(n!==void 0&&!R(t[e],n)||n===void 0&&!(e in t))&&q(t,e,n)}function Be(t,e,n){var r=t[e];(!(b.call(t,e)&&R(r,n))||n===void 0&&!(e in t))&&q(t,e,n)}function D(t,e){for(var n=t.length;n--;)if(R(t[n][0],e))return n;return-1}function q(t,e,n){e=="__proto__"&&U?U(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var He=en();function F(t){return t==null?t===void 0?$t:Ft:m&&m in Object(t)?nn(t):cn(t)}function bt(t){return S(t)&&F(t)==w}function $e(t){if(!C(t)||un(t))return!1;var e=Z(t)?pe:re;return e.test(gn(t))}function Ke(t){return S(t)&&Ct(t.length)&&!!u[F(t)]}function qe(t){if(!C(t))return sn(t);var e=mt(t),n=[];for(var r in t)r=="constructor"&&(e||!b.call(t,r))||n.push(r);return n}function Tt(t,e,n,r,o){t!==e&&He(e,function(a,f){if(o||(o=new O),C(a))Ve(t,e,f,n,Tt,r,o);else{var i=r?r(W(t,f),a,f+"",t,e,o):void 0;i===void 0&&(i=a),K(t,f,i)}},Ot)}function Ve(t,e,n,r,o,a,f){var i=W(t,n),l=W(e,n),y=f.get(l);if(y){K(t,n,y);return}var h=a?a(i,l,n+"",t,e,f):void 0,E=h===void 0;if(E){var Q=J(l),k=!Q&&xt(l),jt=!Q&&!k&&At(l);h=l,Q||k||jt?J(i)?h=i:pn(i)?h=Qe(i):k?(E=!1,h=Je(l,!0)):jt?(E=!1,h=Ze(l,!0)):h=[]:hn(l)||Y(l)?(h=i,Y(i)?h=_n(i):(!C(i)||Z(i))&&(h=rn(l))):E=!1}E&&(f.set(l,h),o(h,l,r,a,f),f.delete(l)),K(t,n,h)}function We(t,e){return ln(fn(t,e,Pt),t+"")}var Ye=U?function(t,e){return U(t,"toString",{configurable:!0,enumerable:!1,value:vn(e),writable:!0})}:Pt;function Je(t,e){if(e)return t.slice();var n=t.length,r=pt?pt(n):new t.constructor(n);return t.copy(r),r}function Xe(t){var e=new t.constructor(t.byteLength);return new gt(e).set(new gt(t)),e}function Ze(t,e){var n=e?Xe(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Qe(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function ke(t,e,n,r){var o=!n;n||(n={});for(var a=-1,f=e.length;++a<f;){var i=e[a],l=r?r(n[i],t[i],i,n,t):void 0;l===void 0&&(l=t[i]),o?q(n,i,l):Be(n,i,l)}return n}function tn(t){return We(function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,f=o>2?n[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,f&&on(n[0],n[1],f)&&(a=o<3?void 0:a,o=1),e=Object(e);++r<o;){var i=n[r];i&&t(e,i,r,a)}return e})}function en(t){return function(e,n,r){for(var o=-1,a=Object(e),f=r(e),i=f.length;i--;){var l=f[t?i:++o];if(n(a[l],l,a)===!1)break}return e}}function G(t,e){var n=t.__data__;return an(e)?n[typeof e=="string"?"string":"hash"]:n.map}function V(t,e){var n=ce(t,e);return $e(n)?n:void 0}function nn(t){var e=b.call(t,m),n=t[m];try{t[m]=void 0;var r=!0}catch(a){}var o=lt.call(t);return r&&(e?t[m]=n:delete t[m]),o}function rn(t){return typeof t.constructor=="function"&&!mt(t)?be(ht(t)):{}}function wt(t,e){var n=typeof t;return e=e==null?v:e,!!e&&(n=="number"||n!="symbol"&&ie.test(t))&&t>-1&&t%1==0&&t<e}function on(t,e,n){if(!C(n))return!1;var r=typeof e;return(r=="number"?X(n)&&wt(e,n.length):r=="string"&&e in n)?R(n[e],t):!1}function an(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function un(t){return!!ft&&ft in t}function mt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||M;return t===n}function sn(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function cn(t){return lt.call(t)}function fn(t,e,n){return e=yt(e===void 0?t.length-1:e,0),function(){for(var r=arguments,o=-1,a=yt(r.length-e,0),f=Array(a);++o<a;)f[o]=r[e+o];o=-1;for(var i=Array(e+1);++o<e;)i[o]=r[o];return i[e]=n(f),ae(t,this,i)}}function W(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var ln=dn(Ye);function dn(t){var e=0,n=0;return function(){var r=ve(),o=_-(r-n);if(n=r,o>0){if(++e>=p)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function gn(t){if(t!=null){try{return L.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function R(t,e){return t===e||t!==t&&e!==e}var Y=bt(function(){return arguments}())?bt:function(t){return S(t)&&b.call(t,"callee")&&!he.call(t,"callee")},J=Array.isArray;function X(t){return t!=null&&Ct(t.length)&&!Z(t)}function pn(t){return S(t)&&X(t)}var xt=ye||bn;function Z(t){if(!C(t))return!1;var e=F(t);return e==rt||e==zt||e==Et||e==Gt}function Ct(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=v}function C(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function S(t){return t!=null&&typeof t=="object"}function hn(t){if(!S(t)||F(t)!=it)return!1;var e=ht(t);if(e===null)return!0;var n=b.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&L.call(n)==ge}var At=ct?se(ct):Ke;function _n(t){return ke(t,Ot(t))}function Ot(t){return X(t)?Re(t,!0):qe(t)}var yn=tn(function(t,e,n){Tt(t,e,n)});function vn(t){return function(){return t}}function Pt(t){return t}function bn(){return!1}s.exports=yn})(nt,nt.exports);var In=nt.exports;function Sn(){throw new An("You've called configure function without a configuration object.")}function En(){const s=c();function c(){return{logger:{debugAll:!1,debugEvents:!1,debugContext:!1},events:{targetProperty:()=>window.dataLayer}}}function d(){return s}function g(p){Boolean(p)||Sn(),In(s,p)}return{get:d,defaults:c,configure:g}}const St=En(),{configure:Nn}=St;function Mn(s={}){function c(){var _;return(_=s.configurations)!=null?_:St.get()}function d(){return c().events.targetProperty()}function g(_){p(),d().push(_)}function p(){const _=()=>typeof window=="undefined",v=()=>Boolean(d()),w=()=>Array.isArray(d());_()?On():v()?w()||jn():Pn()}return{addEvent:g}}const Ln=Mn();function zn(s){tt().log({type:"event",properties:s})}function Un({context:s}){function c(g){const p={...s.value,...g};Ln.addEvent(p),zn(p)}function d(g){return p=>{c({...s.value,...g,...p})}}return{trackEvent:c,setRepeatedProps:d}}exports.configure=Nn,exports.createTrackerContext=Cn,exports.setLogger=wn,exports.withTrackerContext=Un;
Either you didn't installed Google Tag Manager correctly or you configured the targetProperty incorrectly.`)}function zn(a={}){function u(){var p;return(p=a.configurations)!=null?p:ot.get()}function g(){return u().events.targetProperty()}function d(p){h(),g().push(p)}function h(){const p=()=>typeof window=="undefined",_=()=>Boolean(g()),b=()=>Array.isArray(g());p()?Mn():_()?b()||Nn():Ln()}return{addEvent:d}}const Un=zn();function Dn(a){it.log({type:"event",properties:a})}function Fn({context:a}){function u(d){const h={...a.value,...d};Un.addEvent(h),Dn(h)}function g(d){return h=>{u({...a.value,...d,...h})}}return{trackEvent:u,setRepeatedProps:g}}exports.configure=Pn,exports.createTrackerContext=En,exports.setLogger=wn,exports.withTrackerContext=Fn;
//# sourceMappingURL=index.js.map

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

function Tn(s={}){var f;const d=console;let p=(f=s.logger)!=null?f:d;function g(){return p}function _(v){p=v}return{getLogger:g,setLogger:_}}const It=Tn(),{setLogger:wn}=It,{getLogger:tt}=It;function mn(s){const f=tt(),{contextName:d,properties:p}=s;f.log({type:"context-created",contextName:d,properties:p})}function xn(s){const f=tt(),{contextName:d,currentProps:p,newProps:g}=s;f.log({type:"context-updated",contextName:d,previousProperties:p,currentProperties:g})}function An(s={},f={}){const d={options:{...f},value:{...s}};function p(){return d.value}function g(v){const w={...v};d.value=w}function _(v){const w=p(),N={...v};xn({contextName:d.options.name,currentProps:w,newProps:N}),g(N)}return mn({contextName:d.options.name,properties:p()}),{context:d,setProps:_}}class et extends Error{constructor(f){super(f),this.name="Warning"}}class Cn extends Error{constructor(f){super(f),this.name="InvalidConfiguration"}}function On(){throw new et(`Triggering events is not possible on server-side.
function wn(a={}){var u;const g=console;let d=(u=a.logger)!=null?u:g;function h(){return d}function p(_){d=_}return{getLogger:h,setLogger:p}}const Mt=wn(),{setLogger:Tn}=Mt,{getLogger:mn}=Mt;var H=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},nt={exports:{}};(function(a,u){var g=200,d="__lodash_hash_undefined__",h=800,p=16,_=9007199254740991,b="[object Arguments]",C="[object Array]",j="[object AsyncFunction]",$="[object Boolean]",Lt="[object Date]",Nt="[object Error]",at="[object Function]",zt="[object GeneratorFunction]",Ut="[object Map]",Dt="[object Number]",Ft="[object Null]",ut="[object Object]",Gt="[object Proxy]",Rt="[object RegExp]",Bt="[object Set]",Ht="[object String]",$t="[object Undefined]",Kt="[object WeakMap]",qt="[object ArrayBuffer]",Vt="[object DataView]",Wt="[object Float32Array]",Yt="[object Float64Array]",Jt="[object Int8Array]",Xt="[object Int16Array]",Zt="[object Int32Array]",Qt="[object Uint8Array]",kt="[object Uint8ClampedArray]",te="[object Uint16Array]",ee="[object Uint32Array]",ne=/[\\^$.*+?()[\]{}|]/g,re=/^\[object .+?Constructor\]$/,oe=/^(?:0|[1-9]\d*)$/,c={};c[Wt]=c[Yt]=c[Jt]=c[Xt]=c[Zt]=c[Qt]=c[kt]=c[te]=c[ee]=!0,c[b]=c[C]=c[qt]=c[$]=c[Vt]=c[Lt]=c[Nt]=c[at]=c[Ut]=c[Dt]=c[ut]=c[Rt]=c[Bt]=c[Ht]=c[Kt]=!1;var st=typeof H=="object"&&H&&H.Object===Object&&H,ie=typeof self=="object"&&self&&self.Object===Object&&self,I=st||ie||Function("return this")(),ct=u&&!u.nodeType&&u,S=ct&&!0&&a&&!a.nodeType&&a,ft=S&&S.exports===ct,K=ft&&st.process,lt=function(){try{var t=S&&S.require&&S.require("util").types;return t||K&&K.binding&&K.binding("util")}catch(e){}}(),gt=lt&&lt.isTypedArray;function ae(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function ue(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function se(t){return function(e){return t(e)}}function ce(t,e){return t==null?void 0:t[e]}function fe(t,e){return function(n){return t(e(n))}}var le=Array.prototype,ge=Function.prototype,N=Object.prototype,q=I["__core-js_shared__"],z=ge.toString,w=N.hasOwnProperty,dt=function(){var t=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),pt=N.toString,de=z.call(Object),pe=RegExp("^"+z.call(w).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),U=ft?I.Buffer:void 0,ht=I.Symbol,_t=I.Uint8Array,yt=U?U.allocUnsafe:void 0,vt=fe(Object.getPrototypeOf,Object),bt=Object.create,he=N.propertyIsEnumerable,_e=le.splice,m=ht?ht.toStringTag:void 0,D=function(){try{var t=Y(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),ye=U?U.isBuffer:void 0,wt=Math.max,ve=Date.now,Tt=Y(I,"Map"),E=Y(Object,"create"),be=function(){function t(){}return function(e){if(!A(e))return{};if(bt)return bt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function x(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function we(){this.__data__=E?E(null):{},this.size=0}function Te(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function me(t){var e=this.__data__;if(E){var n=e[t];return n===d?void 0:n}return w.call(e,t)?e[t]:void 0}function xe(t){var e=this.__data__;return E?e[t]!==void 0:w.call(e,t)}function Ae(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=E&&e===void 0?d:e,this}x.prototype.clear=we,x.prototype.delete=Te,x.prototype.get=me,x.prototype.has=xe,x.prototype.set=Ae;function T(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ce(){this.__data__=[],this.size=0}function Oe(t){var e=this.__data__,n=F(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():_e.call(e,n,1),--this.size,!0}function Pe(t){var e=this.__data__,n=F(e,t);return n<0?void 0:e[n][1]}function je(t){return F(this.__data__,t)>-1}function Ie(t,e){var n=this.__data__,r=F(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}T.prototype.clear=Ce,T.prototype.delete=Oe,T.prototype.get=Pe,T.prototype.has=je,T.prototype.set=Ie;function O(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Se(){this.size=0,this.__data__={hash:new x,map:new(Tt||T),string:new x}}function Ee(t){var e=R(this,t).delete(t);return this.size-=e?1:0,e}function Me(t){return R(this,t).get(t)}function Le(t){return R(this,t).has(t)}function Ne(t,e){var n=R(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}O.prototype.clear=Se,O.prototype.delete=Ee,O.prototype.get=Me,O.prototype.has=Le,O.prototype.set=Ne;function P(t){var e=this.__data__=new T(t);this.size=e.size}function ze(){this.__data__=new T,this.size=0}function Ue(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function De(t){return this.__data__.get(t)}function Fe(t){return this.__data__.has(t)}function Ge(t,e){var n=this.__data__;if(n instanceof T){var r=n.__data__;if(!Tt||r.length<g-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new O(r)}return n.set(t,e),this.size=n.size,this}P.prototype.clear=ze,P.prototype.delete=Ue,P.prototype.get=De,P.prototype.has=Fe,P.prototype.set=Ge;function Re(t,e){var n=Z(t),r=!n&&X(t),i=!n&&!r&&Ot(t),s=!n&&!r&&!i&&jt(t),f=n||r||i||s,o=f?ue(t.length,String):[],l=o.length;for(var v in t)(e||w.call(t,v))&&!(f&&(v=="length"||i&&(v=="offset"||v=="parent")||s&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||At(v,l)))&&o.push(v);return o}function V(t,e,n){(n!==void 0&&!B(t[e],n)||n===void 0&&!(e in t))&&W(t,e,n)}function Be(t,e,n){var r=t[e];(!(w.call(t,e)&&B(r,n))||n===void 0&&!(e in t))&&W(t,e,n)}function F(t,e){for(var n=t.length;n--;)if(B(t[n][0],e))return n;return-1}function W(t,e,n){e=="__proto__"&&D?D(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var He=en();function G(t){return t==null?t===void 0?$t:Ft:m&&m in Object(t)?nn(t):cn(t)}function mt(t){return M(t)&&G(t)==b}function $e(t){if(!A(t)||un(t))return!1;var e=k(t)?pe:re;return e.test(dn(t))}function Ke(t){return M(t)&&Pt(t.length)&&!!c[G(t)]}function qe(t){if(!A(t))return sn(t);var e=Ct(t),n=[];for(var r in t)r=="constructor"&&(e||!w.call(t,r))||n.push(r);return n}function xt(t,e,n,r,i){t!==e&&He(e,function(s,f){if(i||(i=new P),A(s))Ve(t,e,f,n,xt,r,i);else{var o=r?r(J(t,f),s,f+"",t,e,i):void 0;o===void 0&&(o=s),V(t,f,o)}},It)}function Ve(t,e,n,r,i,s,f){var o=J(t,n),l=J(e,n),v=f.get(l);if(v){V(t,n,v);return}var y=s?s(o,l,n+"",t,e,f):void 0,L=y===void 0;if(L){var tt=Z(l),et=!tt&&Ot(l),Et=!tt&&!et&&jt(l);y=l,tt||et||Et?Z(o)?y=o:pn(o)?y=Qe(o):et?(L=!1,y=Je(l,!0)):Et?(L=!1,y=Ze(l,!0)):y=[]:hn(l)||X(l)?(y=o,X(o)?y=_n(o):(!A(o)||k(o))&&(y=rn(l))):L=!1}L&&(f.set(l,y),i(y,l,r,s,f),f.delete(l)),V(t,n,y)}function We(t,e){return ln(fn(t,e,St),t+"")}var Ye=D?function(t,e){return D(t,"toString",{configurable:!0,enumerable:!1,value:vn(e),writable:!0})}:St;function Je(t,e){if(e)return t.slice();var n=t.length,r=yt?yt(n):new t.constructor(n);return t.copy(r),r}function Xe(t){var e=new t.constructor(t.byteLength);return new _t(e).set(new _t(t)),e}function Ze(t,e){var n=e?Xe(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Qe(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function ke(t,e,n,r){var i=!n;n||(n={});for(var s=-1,f=e.length;++s<f;){var o=e[s],l=r?r(n[o],t[o],o,n,t):void 0;l===void 0&&(l=t[o]),i?W(n,o,l):Be(n,o,l)}return n}function tn(t){return We(function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,f=i>2?n[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,f&&on(n[0],n[1],f)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var o=n[r];o&&t(e,o,r,s)}return e})}function en(t){return function(e,n,r){for(var i=-1,s=Object(e),f=r(e),o=f.length;o--;){var l=f[t?o:++i];if(n(s[l],l,s)===!1)break}return e}}function R(t,e){var n=t.__data__;return an(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Y(t,e){var n=ce(t,e);return $e(n)?n:void 0}function nn(t){var e=w.call(t,m),n=t[m];try{t[m]=void 0;var r=!0}catch(s){}var i=pt.call(t);return r&&(e?t[m]=n:delete t[m]),i}function rn(t){return typeof t.constructor=="function"&&!Ct(t)?be(vt(t)):{}}function At(t,e){var n=typeof t;return e=e==null?_:e,!!e&&(n=="number"||n!="symbol"&&oe.test(t))&&t>-1&&t%1==0&&t<e}function on(t,e,n){if(!A(n))return!1;var r=typeof e;return(r=="number"?Q(n)&&At(e,n.length):r=="string"&&e in n)?B(n[e],t):!1}function an(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function un(t){return!!dt&&dt in t}function Ct(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||N;return t===n}function sn(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function cn(t){return pt.call(t)}function fn(t,e,n){return e=wt(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=wt(r.length-e,0),f=Array(s);++i<s;)f[i]=r[e+i];i=-1;for(var o=Array(e+1);++i<e;)o[i]=r[i];return o[e]=n(f),ae(t,this,o)}}function J(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var ln=gn(Ye);function gn(t){var e=0,n=0;return function(){var r=ve(),i=p-(r-n);if(n=r,i>0){if(++e>=h)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function dn(t){if(t!=null){try{return z.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function B(t,e){return t===e||t!==t&&e!==e}var X=mt(function(){return arguments}())?mt:function(t){return M(t)&&w.call(t,"callee")&&!he.call(t,"callee")},Z=Array.isArray;function Q(t){return t!=null&&Pt(t.length)&&!k(t)}function pn(t){return M(t)&&Q(t)}var Ot=ye||bn;function k(t){if(!A(t))return!1;var e=G(t);return e==at||e==zt||e==j||e==Gt}function Pt(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=_}function A(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function M(t){return t!=null&&typeof t=="object"}function hn(t){if(!M(t)||G(t)!=ut)return!1;var e=vt(t);if(e===null)return!0;var n=w.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&z.call(n)==de}var jt=gt?se(gt):Ke;function _n(t){return ke(t,It(t))}function It(t){return Q(t)?Re(t,!0):qe(t)}var yn=tn(function(t,e,n){xt(t,e,n)});function vn(t){return function(){return t}}function St(t){return t}function bn(){return!1}a.exports=yn})(nt,nt.exports);var xn=nt.exports;class rt extends Error{constructor(u){super(u),this.name="Warning"}}class An extends Error{constructor(u){super(u),this.name="InvalidConfiguration"}}function Cn(){throw new An("You've called configure function without a configuration object.")}function On(){const a=u();function u(){return{logger:{debugAll:!1,debugEvents:!1,debugContext:!1},events:{targetProperty:()=>window.dataLayer}}}function g(){return a}function d(h){Boolean(h)||Cn(),xn(a,h)}return{get:g,defaults:u,configure:d}}const ot=On(),{configure:Pn}=ot;function jn(a={}){function u(){var p;return(p=a.configurations)!=null?p:ot.get()}function g(){return a.getLogger?a.getLogger():mn()}function d({type:p}){const _=()=>u().logger.debugAll,b=()=>u().logger.debugContext,C=()=>u().logger.debugEvents,j=$=>_()||$();return new Map([["event",j(C)],["context-created",j(b)],["context-updated",j(b)]]).get(p)}function h(p){const _=g();d(p)&&_.log(p)}return{log:h}}const it=jn();function In(a){const{contextName:u,properties:g}=a;it.log({type:"context-created",contextName:u,properties:g})}function Sn(a){const{contextName:u,currentProps:g,newProps:d}=a;it.log({type:"context-updated",contextName:u,previousProperties:g,currentProperties:d})}function En(a={},u={}){const g={options:{...u},value:{...a}};function d(){return g.value}function h(_){const b={..._};g.value=b}function p(_){const b=d(),C={..._};Sn({contextName:g.options.name,currentProps:b,newProps:C}),h(C)}return In({contextName:g.options.name,properties:d()}),{context:g,setProps:p}}function Mn(){throw new rt(`Triggering events is not possible on server-side.
Make sure to only trigger events after your app is running on the client-side.`)}function Pn(){throw new et(`The targetProperty is not defined.
Make sure to only trigger events after your app is running on the client-side.`)}function Ln(){throw new rt(`The targetProperty is not defined.
Make sure you didn't forget to add Google Tag Manager's script in your application.
If you did but you don't use the default 'window.dataLayer' array, you can set your custom targetProperty with the configure function.`)}function jn(){throw new et(`The targetProperty is not an array.
If you did but you don't use the default 'window.dataLayer' array, you can set your custom targetProperty with the configure function.`)}function Nn(){throw new rt(`The targetProperty is not an array.
Either you didn't installed Google Tag Manager correctly or you configured the targetProperty incorrectly.`)}var B=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},nt={exports:{}};(function(s,f){var d=200,p="__lodash_hash_undefined__",g=800,_=16,v=9007199254740991,w="[object Arguments]",N="[object Array]",Et="[object AsyncFunction]",Nt="[object Boolean]",Mt="[object Date]",Lt="[object Error]",rt="[object Function]",zt="[object GeneratorFunction]",Ut="[object Map]",Dt="[object Number]",Ft="[object Null]",it="[object Object]",Gt="[object Proxy]",Rt="[object RegExp]",Bt="[object Set]",Ht="[object String]",$t="[object Undefined]",Kt="[object WeakMap]",qt="[object ArrayBuffer]",Vt="[object DataView]",Wt="[object Float32Array]",Yt="[object Float64Array]",Jt="[object Int8Array]",Xt="[object Int16Array]",Zt="[object Int32Array]",Qt="[object Uint8Array]",kt="[object Uint8ClampedArray]",te="[object Uint16Array]",ee="[object Uint32Array]",ne=/[\\^$.*+?()[\]{}|]/g,re=/^\[object .+?Constructor\]$/,ie=/^(?:0|[1-9]\d*)$/,u={};u[Wt]=u[Yt]=u[Jt]=u[Xt]=u[Zt]=u[Qt]=u[kt]=u[te]=u[ee]=!0,u[w]=u[N]=u[qt]=u[Nt]=u[Vt]=u[Mt]=u[Lt]=u[rt]=u[Ut]=u[Dt]=u[it]=u[Rt]=u[Bt]=u[Ht]=u[Kt]=!1;var ot=typeof B=="object"&&B&&B.Object===Object&&B,oe=typeof self=="object"&&self&&self.Object===Object&&self,P=ot||oe||Function("return this")(),at=f&&!f.nodeType&&f,j=at&&!0&&s&&!s.nodeType&&s,ut=j&&j.exports===at,H=ut&&ot.process,st=function(){try{var t=j&&j.require&&j.require("util").types;return t||H&&H.binding&&H.binding("util")}catch(e){}}(),ft=st&&st.isTypedArray;function ae(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function ue(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function se(t){return function(e){return t(e)}}function fe(t,e){return t==null?void 0:t[e]}function ce(t,e){return function(n){return t(e(n))}}var le=Array.prototype,de=Function.prototype,M=Object.prototype,$=P["__core-js_shared__"],L=de.toString,b=M.hasOwnProperty,ct=function(){var t=/[^.]+$/.exec($&&$.keys&&$.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),lt=M.toString,pe=L.call(Object),ge=RegExp("^"+L.call(b).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),z=ut?P.Buffer:void 0,dt=P.Symbol,pt=P.Uint8Array,gt=z?z.allocUnsafe:void 0,ht=ce(Object.getPrototypeOf,Object),_t=Object.create,he=M.propertyIsEnumerable,_e=le.splice,m=dt?dt.toStringTag:void 0,U=function(){try{var t=V(Object,"defineProperty");return t({},"",{}),t}catch(e){}}(),ye=z?z.isBuffer:void 0,yt=Math.max,ve=Date.now,vt=V(P,"Map"),I=V(Object,"create"),be=function(){function t(){}return function(e){if(!A(e))return{};if(_t)return _t(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function x(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Te(){this.__data__=I?I(null):{},this.size=0}function we(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function me(t){var e=this.__data__;if(I){var n=e[t];return n===p?void 0:n}return b.call(e,t)?e[t]:void 0}function xe(t){var e=this.__data__;return I?e[t]!==void 0:b.call(e,t)}function Ae(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=I&&e===void 0?p:e,this}x.prototype.clear=Te,x.prototype.delete=we,x.prototype.get=me,x.prototype.has=xe,x.prototype.set=Ae;function T(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ce(){this.__data__=[],this.size=0}function Oe(t){var e=this.__data__,n=D(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():_e.call(e,n,1),--this.size,!0}function Pe(t){var e=this.__data__,n=D(e,t);return n<0?void 0:e[n][1]}function je(t){return D(this.__data__,t)>-1}function Ie(t,e){var n=this.__data__,r=D(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}T.prototype.clear=Ce,T.prototype.delete=Oe,T.prototype.get=Pe,T.prototype.has=je,T.prototype.set=Ie;function C(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Se(){this.size=0,this.__data__={hash:new x,map:new(vt||T),string:new x}}function Ee(t){var e=G(this,t).delete(t);return this.size-=e?1:0,e}function Ne(t){return G(this,t).get(t)}function Me(t){return G(this,t).has(t)}function Le(t,e){var n=G(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}C.prototype.clear=Se,C.prototype.delete=Ee,C.prototype.get=Ne,C.prototype.has=Me,C.prototype.set=Le;function O(t){var e=this.__data__=new T(t);this.size=e.size}function ze(){this.__data__=new T,this.size=0}function Ue(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function De(t){return this.__data__.get(t)}function Fe(t){return this.__data__.has(t)}function Ge(t,e){var n=this.__data__;if(n instanceof T){var r=n.__data__;if(!vt||r.length<d-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new C(r)}return n.set(t,e),this.size=n.size,this}O.prototype.clear=ze,O.prototype.delete=Ue,O.prototype.get=De,O.prototype.has=Fe,O.prototype.set=Ge;function Re(t,e){var n=J(t),r=!n&&Y(t),o=!n&&!r&&xt(t),a=!n&&!r&&!o&&Ct(t),c=n||r||o||a,i=c?ue(t.length,String):[],l=i.length;for(var y in t)(e||b.call(t,y))&&!(c&&(y=="length"||o&&(y=="offset"||y=="parent")||a&&(y=="buffer"||y=="byteLength"||y=="byteOffset")||wt(y,l)))&&i.push(y);return i}function K(t,e,n){(n!==void 0&&!R(t[e],n)||n===void 0&&!(e in t))&&q(t,e,n)}function Be(t,e,n){var r=t[e];(!(b.call(t,e)&&R(r,n))||n===void 0&&!(e in t))&&q(t,e,n)}function D(t,e){for(var n=t.length;n--;)if(R(t[n][0],e))return n;return-1}function q(t,e,n){e=="__proto__"&&U?U(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var He=en();function F(t){return t==null?t===void 0?$t:Ft:m&&m in Object(t)?nn(t):fn(t)}function bt(t){return S(t)&&F(t)==w}function $e(t){if(!A(t)||un(t))return!1;var e=Z(t)?ge:re;return e.test(pn(t))}function Ke(t){return S(t)&&At(t.length)&&!!u[F(t)]}function qe(t){if(!A(t))return sn(t);var e=mt(t),n=[];for(var r in t)r=="constructor"&&(e||!b.call(t,r))||n.push(r);return n}function Tt(t,e,n,r,o){t!==e&&He(e,function(a,c){if(o||(o=new O),A(a))Ve(t,e,c,n,Tt,r,o);else{var i=r?r(W(t,c),a,c+"",t,e,o):void 0;i===void 0&&(i=a),K(t,c,i)}},Ot)}function Ve(t,e,n,r,o,a,c){var i=W(t,n),l=W(e,n),y=c.get(l);if(y){K(t,n,y);return}var h=a?a(i,l,n+"",t,e,c):void 0,E=h===void 0;if(E){var Q=J(l),k=!Q&&xt(l),jt=!Q&&!k&&Ct(l);h=l,Q||k||jt?J(i)?h=i:gn(i)?h=Qe(i):k?(E=!1,h=Je(l,!0)):jt?(E=!1,h=Ze(l,!0)):h=[]:hn(l)||Y(l)?(h=i,Y(i)?h=_n(i):(!A(i)||Z(i))&&(h=rn(l))):E=!1}E&&(c.set(l,h),o(h,l,r,a,c),c.delete(l)),K(t,n,h)}function We(t,e){return ln(cn(t,e,Pt),t+"")}var Ye=U?function(t,e){return U(t,"toString",{configurable:!0,enumerable:!1,value:vn(e),writable:!0})}:Pt;function Je(t,e){if(e)return t.slice();var n=t.length,r=gt?gt(n):new t.constructor(n);return t.copy(r),r}function Xe(t){var e=new t.constructor(t.byteLength);return new pt(e).set(new pt(t)),e}function Ze(t,e){var n=e?Xe(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Qe(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}function ke(t,e,n,r){var o=!n;n||(n={});for(var a=-1,c=e.length;++a<c;){var i=e[a],l=r?r(n[i],t[i],i,n,t):void 0;l===void 0&&(l=t[i]),o?q(n,i,l):Be(n,i,l)}return n}function tn(t){return We(function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,c=o>2?n[2]:void 0;for(a=t.length>3&&typeof a=="function"?(o--,a):void 0,c&&on(n[0],n[1],c)&&(a=o<3?void 0:a,o=1),e=Object(e);++r<o;){var i=n[r];i&&t(e,i,r,a)}return e})}function en(t){return function(e,n,r){for(var o=-1,a=Object(e),c=r(e),i=c.length;i--;){var l=c[t?i:++o];if(n(a[l],l,a)===!1)break}return e}}function G(t,e){var n=t.__data__;return an(e)?n[typeof e=="string"?"string":"hash"]:n.map}function V(t,e){var n=fe(t,e);return $e(n)?n:void 0}function nn(t){var e=b.call(t,m),n=t[m];try{t[m]=void 0;var r=!0}catch(a){}var o=lt.call(t);return r&&(e?t[m]=n:delete t[m]),o}function rn(t){return typeof t.constructor=="function"&&!mt(t)?be(ht(t)):{}}function wt(t,e){var n=typeof t;return e=e==null?v:e,!!e&&(n=="number"||n!="symbol"&&ie.test(t))&&t>-1&&t%1==0&&t<e}function on(t,e,n){if(!A(n))return!1;var r=typeof e;return(r=="number"?X(n)&&wt(e,n.length):r=="string"&&e in n)?R(n[e],t):!1}function an(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function un(t){return!!ct&&ct in t}function mt(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||M;return t===n}function sn(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}function fn(t){return lt.call(t)}function cn(t,e,n){return e=yt(e===void 0?t.length-1:e,0),function(){for(var r=arguments,o=-1,a=yt(r.length-e,0),c=Array(a);++o<a;)c[o]=r[e+o];o=-1;for(var i=Array(e+1);++o<e;)i[o]=r[o];return i[e]=n(c),ae(t,this,i)}}function W(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var ln=dn(Ye);function dn(t){var e=0,n=0;return function(){var r=ve(),o=_-(r-n);if(n=r,o>0){if(++e>=g)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function pn(t){if(t!=null){try{return L.call(t)}catch(e){}try{return t+""}catch(e){}}return""}function R(t,e){return t===e||t!==t&&e!==e}var Y=bt(function(){return arguments}())?bt:function(t){return S(t)&&b.call(t,"callee")&&!he.call(t,"callee")},J=Array.isArray;function X(t){return t!=null&&At(t.length)&&!Z(t)}function gn(t){return S(t)&&X(t)}var xt=ye||bn;function Z(t){if(!A(t))return!1;var e=F(t);return e==rt||e==zt||e==Et||e==Gt}function At(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=v}function A(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function S(t){return t!=null&&typeof t=="object"}function hn(t){if(!S(t)||F(t)!=it)return!1;var e=ht(t);if(e===null)return!0;var n=b.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&L.call(n)==pe}var Ct=ft?se(ft):Ke;function _n(t){return ke(t,Ot(t))}function Ot(t){return X(t)?Re(t,!0):qe(t)}var yn=tn(function(t,e,n){Tt(t,e,n)});function vn(t){return function(){return t}}function Pt(t){return t}function bn(){return!1}s.exports=yn})(nt,nt.exports);var In=nt.exports;function Sn(){throw new Cn("You've called configure function without a configuration object.")}function En(){const s=f();function f(){return{logger:{debugAll:!1,debugEvents:!1,debugContext:!1},events:{targetProperty:()=>window.dataLayer}}}function d(){return s}function p(g){Boolean(g)||Sn(),In(s,g)}return{get:d,defaults:f,configure:p}}const St=En(),{configure:Nn}=St;function Mn(s={}){function f(){var _;return(_=s.configurations)!=null?_:St.get()}function d(){return f().events.targetProperty()}function p(_){g(),d().push(_)}function g(){const _=()=>typeof window=="undefined",v=()=>Boolean(d()),w=()=>Array.isArray(d());_()?On():v()?w()||jn():Pn()}return{addEvent:p}}const Ln=Mn();function zn(s){tt().log({type:"event",properties:s})}function Un({context:s}){function f(p){const g={...s.value,...p};Ln.addEvent(g),zn(g)}function d(p){return g=>{f({...s.value,...p,...g})}}return{trackEvent:f,setRepeatedProps:d}}export{Nn as configure,An as createTrackerContext,wn as setLogger,Un as withTrackerContext};
Either you didn't installed Google Tag Manager correctly or you configured the targetProperty incorrectly.`)}function zn(a={}){function u(){var p;return(p=a.configurations)!=null?p:ot.get()}function g(){return u().events.targetProperty()}function d(p){h(),g().push(p)}function h(){const p=()=>typeof window=="undefined",_=()=>Boolean(g()),b=()=>Array.isArray(g());p()?Mn():_()?b()||Nn():Ln()}return{addEvent:d}}const Un=zn();function Dn(a){it.log({type:"event",properties:a})}function Fn({context:a}){function u(d){const h={...a.value,...d};Un.addEvent(h),Dn(h)}function g(d){return h=>{u({...a.value,...d,...h})}}return{trackEvent:u,setRepeatedProps:g}}export{Pn as configure,En as createTrackerContext,Tn as setLogger,Fn as withTrackerContext};
//# sourceMappingURL=index.js.map

@@ -8,5 +8,5 @@ // This file is read by tools that parse documentation comments conforming to the TSDoc standard.

"packageName": "@microsoft/api-extractor",
"packageVersion": "7.24.0"
"packageVersion": "7.24.2"
}
]
}

@@ -8,3 +8,3 @@ {

"license": "MIT",
"version": "1.7.0-beta.9",
"version": "1.7.0-beta.10",
"description": "A type-safe, reusable, and flexible way for triggering Google Tag Manager track events.",

@@ -41,2 +41,5 @@ "keywords": [

},
"engines": {
"node": ">=14"
},
"dependencies": {

@@ -46,7 +49,8 @@ "lodash.merge": "^4.6.2"

"devDependencies": {
"@babel/preset-env": "^7.17.10",
"@babel/preset-typescript": "^7.16.7",
"@commitlint/cli": "^16.3.0",
"@commitlint/config-conventional": "^16.2.4",
"@microsoft/api-extractor": "^7.24.0",
"@babel/preset-env": "^7.18.2",
"@babel/preset-typescript": "^7.17.12",
"@commitlint/cli": "^17.0.2",
"@commitlint/config-conventional": "^17.0.2",
"@faker-js/faker": "^7.2.0",
"@microsoft/api-extractor": "^7.24.2",
"@rollup/plugin-commonjs": "^22.0.0",

@@ -60,9 +64,9 @@ "@rollup/plugin-node-resolve": "^13.3.0",

"@semantic-release/release-notes-generator": "^10.0.3",
"@types/jest": "^27.5.1",
"@types/jest": "^28.1.1",
"@types/lodash-es": "^4.17.6",
"@types/lodash.merge": "^4.6.7",
"@typescript-eslint/eslint-plugin": "^5.23.0",
"@typescript-eslint/parser": "^5.23.0",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"esbuild": "^0.14.42",
"eslint": "^8.15.0",
"eslint": "^8.17.0",
"eslint-config-prettier": "^8.5.0",

@@ -72,3 +76,3 @@ "eslint-config-standard": "^17.0.0",

"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n": "^15.2.0",
"eslint-plugin-n": "^15.2.1",
"eslint-plugin-prettier": "^4.0.0",

@@ -79,15 +83,15 @@ "eslint-plugin-promise": "^6.0.0",

"jest-environment-jsdom": "^28.1.0",
"lint-staged": "^12.4.1",
"lint-staged": "^13.0.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.6.2",
"prettier-eslint": "^14.0.3",
"prettier-eslint": "^15.0.1",
"rimraf": "^3.0.2",
"rollup": "^2.75.3",
"rollup": "^2.75.5",
"rollup-plugin-esbuild": "^4.9.1",
"rollup-plugin-size": "^0.2.2",
"semantic-release": "^19.0.2",
"tsc-alias": "^1.6.7",
"tsc-alias": "^1.6.9",
"type-fest": "^2.13.0",
"typescript": "^4.6.4"
"typescript": "^4.7.3"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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