@qbix/q 1.1.2 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,8 +15,7 @@ $jscomp.polyfill=function(c,h,d,a){if(h){d=$jscomp.global;c=c.split(".");for(a=0
15
15
  document.addEventListener(d,a,!1);document.addEventListener("pause",a,!1);document.addEventListener("resume",a,!1);document.addEventListener("resign",a,!1);document.addEventListener("active",a,!1)}}function d(){b._unloadBound||(b._unloadBound=!0,b.onVisibilityChange(function(g){g?(b._bgCooldown=!1,b._unloaded=!1,b._bgTime&&(g=Math.round((Date.now()-b._bgTime)/1E3),b._bgTime=null,1<g&&b.send("foreground",{away:g}))):(b._bgCooldown||(b._bgCooldown=!0,g=Math.round((Date.now()-b._startTime)/1E3),b.send("background",
16
16
  {elapsed:g})),b._bgTime=Date.now(),a())},"Metrics.unload"),window.addEventListener("pagehide",function(){a()}),window.addEventListener("pageshow",function(a){a.persisted&&(b._unloaded=!1,b._bgCooldown=!1,b.send("foreground",{bfcache:!0}))}))}function a(){if(!b._unloaded){var a=Math.round((Date.now()-b._startTime)/1E3);b.send("unload:"+a+"s");b._unloaded=!0}}var b=c.Metrics||{};c.Metrics=b;b._sessionKey="metrics_sid";b._visitorKey="metrics_vid";b._sid=null;b._vid=null;b.getSessionId=function(){if(b._sid)return b._sid;
17
17
  try{var a=sessionStorage.getItem(b._sessionKey);a||(a=Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2),sessionStorage.setItem(b._sessionKey,a));b._sid=a}catch(p){b._sid=Math.random().toString(36).slice(2)+Math.random().toString(36).slice(2)}return b._sid};b.getVisitorId=function(){if(b._vid)return b._vid;var a=null;try{return a=localStorage.getItem(b._visitorKey),a||(a=Math.random().toString(36).slice(2)+Date.now().toString(36)+Math.random().toString(36).slice(2),localStorage.setItem(b._visitorKey,
18
- a)),b._vid=a}catch(p){}try{return a=sessionStorage.getItem(b._visitorKey),a||(a=Math.random().toString(36).slice(2)+Date.now().toString(36)+Math.random().toString(36).slice(2),sessionStorage.setItem(b._visitorKey,a)),b._vid=a}catch(p){}a=Math.random().toString(36).slice(2)+Date.now().toString(36)+Math.random().toString(36).slice(2);return b._vid=a};b._defaultEndpoint="https://invites.to/metrics";b._endpoint=null;b._page=null;b._extra=null;b._unloaded=!1;b._startTime=Date.now();b.send=function(a,d){if(b._endpoint&&
19
- !b._unloaded){a={session:b.getSessionId(),visitor:b.getVisitorId(),origin:location.origin,url:location.pathname+location.search+location.hash,page:b._page||document.title,label:a,t:Date.now()};b._extra&&(a.extra=b._extra);d&&(a.data=d);d=JSON.stringify(a);try{navigator.sendBeacon?navigator.sendBeacon(b._endpoint,new Blob([d],{type:"text/plain"})):fetch(b._endpoint,{method:"POST",headers:{"Content-Type":"text/plain"},keepalive:!0,body:d})}catch(n){}}};b._visible=!0;b._visibilityCallbacks=[];b._visibilityBound=
18
+ a)),b._vid=a}catch(p){}try{return a=sessionStorage.getItem(b._visitorKey),a||(a=Math.random().toString(36).slice(2)+Date.now().toString(36)+Math.random().toString(36).slice(2),sessionStorage.setItem(b._visitorKey,a)),b._vid=a}catch(p){}a=Math.random().toString(36).slice(2)+Date.now().toString(36)+Math.random().toString(36).slice(2);return b._vid=a};b._defaultEndpoint="https://invites.to/metrics";b._endpoint=null;b._page=null;b._extra=null;b._unloaded=!1;b._startTime=Date.now();b.send=function(a,d){if(b._endpoint){a={session:b.getSessionId(),visitor:b.getVisitorId(),origin:location.origin,url:location.pathname+location.search+location.hash,page:b._page||document.title,label:a,t:Date.now()};b._extra&&(a.extra=b._extra);d&&(a.data=d);d=JSON.stringify(a);try{navigator.sendBeacon?navigator.sendBeacon(b._endpoint,new Blob([d],{type:"text/plain"})):fetch(b._endpoint,{method:"POST",headers:{"Content-Type":"text/plain"},keepalive:!0,body:d})}catch(n){}}};b._visible=!0;b._visibilityCallbacks=[];b._visibilityBound=
20
19
  !1;b.isVisible=function(){return b._visible};b.onVisibilityChange=function(a,d){if(d)for(var c=0;c<b._visibilityCallbacks.length;c++)if(b._visibilityCallbacks[c].key===d){b._visibilityCallbacks[c].fn=a;return}b._visibilityCallbacks.push({fn:a,key:d||null})};b._unloadBound=!1;b._bgTime=null;b._bgCooldown=!1;b._bgCooldownMs=1E3;b.init=function(a){a=a||{};b._endpoint=a.endpoint||b._defaultEndpoint;a.page&&(b._page=a.page);a.sessionKey&&(b._sessionKey=a.sessionKey);a.sessionId&&(b._sid=a.sessionId);a.extra&&
21
20
  (b._extra=a.extra);h();!1!==a.trackUnload&&d();a={referrer:document.referrer||"",screen:screen.width+"x"+screen.height,viewport:window.innerWidth+"x"+window.innerHeight,dpr:window.devicePixelRatio||1,lang:navigator.language||"",touch:"ontouchstart"in window||0<navigator.maxTouchPoints};try{a.tz=Intl.DateTimeFormat().resolvedOptions().timeZone}catch(n){}try{navigator.connection&&navigator.connection.effectiveType&&(a.conn=navigator.connection.effectiveType)}catch(n){}try{var c=performance.getEntriesByType("navigation");
22
21
  c&&c[0]&&(a.navType=c[0].type)}catch(n){}b.send("loaded",a);return b}})("undefined"!==typeof window?window:this);
@@ -94,4 +93,4 @@ var d=genId(c);state.tracked[d]||function(){if(root.Twitch&&root.Twitch.Player)h
94
93
  function trackMuseAi(c){var h=genId(c);if(!state.tracked[h]){var d=createTracker(h,"museai",c,0);state.tracked[h]=d;window.addEventListener("message",function(a){if(a.data&&a.source===c.contentWindow){try{var b="string"===typeof a.data?JSON.parse(a.data):a.data}catch(g){return}"play"===b.event?(d.playing=!0,d.lastPosition=b.currentTime||0,d._lastTimeUpdate=d.lastPosition,d.duration=b.duration||d.duration,sendEvent(d,"media-play"),startCheckpoints(d)):"pause"===b.event?d.playing&&(d.playing=!1,a=b.currentTime||
95
94
  0,d.watched.add(d._lastTimeUpdate,a),d.lastPosition=a,stopCheckpoints(d),sendEvent(d,"media-pause")):"ended"===b.event?(d.playing=!1,d.watched.add(d._lastTimeUpdate,d.duration),d.lastPosition=d.duration,stopCheckpoints(d),sendEvent(d,"media-ended")):"timeupdate"===b.event&&(a=b.currentTime||0,d.duration=b.duration||d.duration,d.playing&&a>d._lastTimeUpdate&&d.watched.add(d._lastTimeUpdate,a),d._lastTimeUpdate=a,d.lastPosition=a)}});try{c.contentWindow.postMessage({method:"addEventListener",value:"play"},
96
95
  "*")}catch(a){}try{c.contentWindow.postMessage({method:"addEventListener",value:"pause"},"*")}catch(a){}try{c.contentWindow.postMessage({method:"addEventListener",value:"ended"},"*")}catch(a){}try{c.contentWindow.postMessage({method:"addEventListener",value:"timeupdate"},"*")}catch(a){}}};
97
- export default window.Q;
96
+ export default window.Metrics;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qbix/q",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "Q.js, the Qbix JavaScript framework",
5
5
  "main": "dist/Q.min.js",
6
6
  "files": [