clarity-js 0.7.59 → 0.7.61

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.
@@ -1,3 +1,5 @@
1
+ import { WebApp } from '@clarity-types/data';
2
+
1
3
  var upload$1 = /*#__PURE__*/Object.freeze({
2
4
  __proto__: null,
3
5
  get queue () { return queue; },
@@ -188,6 +190,7 @@ function hash (input, precision) {
188
190
  }
189
191
 
190
192
  var catchallRegex = /\S/gi;
193
+ var maxUrlLength = 255;
191
194
  var unicodeRegex = true;
192
195
  var digitRegex = null;
193
196
  var letterRegex = null;
@@ -269,19 +272,26 @@ function text$1(value, hint, privacy, mangle, type) {
269
272
  }
270
273
  return value;
271
274
  }
272
- function url$1(input, electron) {
275
+ function url$1(input, electron, truncate) {
273
276
  if (electron === void 0) { electron = false; }
277
+ if (truncate === void 0) { truncate = false; }
278
+ var result = input;
274
279
  // Replace the URL for Electron apps so we don't send back file:/// URL
275
280
  if (electron) {
276
- return "".concat("https://" /* Data.Constant.HTTPS */).concat("Electron" /* Data.Constant.Electron */);
281
+ result = "".concat("https://" /* Data.Constant.HTTPS */).concat("Electron" /* Data.Constant.Electron */);
282
+ }
283
+ else {
284
+ var drop_1 = config$2.drop;
285
+ if (drop_1 && drop_1.length > 0 && input && input.indexOf("?") > 0) {
286
+ var _a = input.split("?"), path = _a[0], query = _a[1];
287
+ var swap_1 = "*na*" /* Data.Constant.Dropped */;
288
+ result = path + "?" + query.split("&").map(function (p) { return drop_1.some(function (x) { return p.indexOf("".concat(x, "=")) === 0; }) ? "".concat(p.split("=")[0], "=").concat(swap_1) : p; }).join("&");
289
+ }
277
290
  }
278
- var drop = config$2.drop;
279
- if (drop && drop.length > 0 && input && input.indexOf("?") > 0) {
280
- var _a = input.split("?"), path = _a[0], query = _a[1];
281
- var swap_1 = "*na*" /* Data.Constant.Dropped */;
282
- return path + "?" + query.split("&").map(function (p) { return drop.some(function (x) { return p.indexOf("".concat(x, "=")) === 0; }) ? "".concat(p.split("=")[0], "=").concat(swap_1) : p; }).join("&");
291
+ if (truncate) {
292
+ result = result.substring(0, maxUrlLength);
283
293
  }
284
- return input;
294
+ return result;
285
295
  }
286
296
  function mangleText(value) {
287
297
  var trimmed = value.trim();
@@ -671,6 +681,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
671
681
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
672
682
  PERFORMANCE OF THIS SOFTWARE.
673
683
  ***************************************************************************** */
684
+ /* global Reflect, Promise */
685
+
674
686
 
675
687
  function __awaiter(thisArg, _arguments, P, generator) {
676
688
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -2629,12 +2641,27 @@ function process$2() {
2629
2641
  _d.sent();
2630
2642
  _d.label = 5;
2631
2643
  case 5:
2644
+ cleanHistory();
2632
2645
  stop$w(timer);
2633
2646
  return [2 /*return*/];
2634
2647
  }
2635
2648
  });
2636
2649
  });
2637
2650
  }
2651
+ function cleanHistory() {
2652
+ var now = time();
2653
+ if (Object.keys(history$4).length > 10000 /* Setting.MaxMutationHistoryCount */) {
2654
+ history$4 = {};
2655
+ count$1(38 /* Metric.HistoryClear */);
2656
+ }
2657
+ for (var _i = 0, _a = Object.keys(history$4); _i < _a.length; _i++) {
2658
+ var key = _a[_i];
2659
+ var h = history$4[key];
2660
+ if (now > h[1] + 30000 /* Setting.MaxMutationHistoryTime */) {
2661
+ delete history$4[key];
2662
+ }
2663
+ }
2664
+ }
2638
2665
  function track$5(m, timer, instance, timestamp) {
2639
2666
  var value = m.target ? get(m.target.parentNode) : null;
2640
2667
  // Check if the parent is already discovered and that the parent is not the document root
@@ -3093,35 +3120,37 @@ var styleSheetMap = {};
3093
3120
  var styleTimeMap = {};
3094
3121
  var documentNodes = [];
3095
3122
  function start$j() {
3096
- if (replace === null) {
3097
- replace = CSSStyleSheet.prototype.replace;
3098
- CSSStyleSheet.prototype.replace = function () {
3099
- if (active()) {
3100
- max(36 /* Metric.ConstructedStyles */, 1);
3101
- // if we haven't seen this stylesheet on this page yet, wait until the checkDocumentStyles has found it
3102
- // and attached the sheet to a document. This way the timestamp of the style sheet creation will align
3103
- // to when it is used in the document rather than potentially being misaligned during the traverse process.
3104
- if (this[styleSheetPageNum] === data$2.pageNum) {
3105
- trackStyleChange(time(), this[styleSheetId], 1 /* StyleSheetOperation.Replace */, arguments[0]);
3123
+ if (window['CSSStyleSheet'] && CSSStyleSheet.prototype) {
3124
+ if (replace === null) {
3125
+ replace = CSSStyleSheet.prototype.replace;
3126
+ CSSStyleSheet.prototype.replace = function () {
3127
+ if (active()) {
3128
+ max(36 /* Metric.ConstructedStyles */, 1);
3129
+ // if we haven't seen this stylesheet on this page yet, wait until the checkDocumentStyles has found it
3130
+ // and attached the sheet to a document. This way the timestamp of the style sheet creation will align
3131
+ // to when it is used in the document rather than potentially being misaligned during the traverse process.
3132
+ if (this[styleSheetPageNum] === data$2.pageNum) {
3133
+ trackStyleChange(time(), this[styleSheetId], 1 /* StyleSheetOperation.Replace */, arguments[0]);
3134
+ }
3106
3135
  }
3107
- }
3108
- return replace.apply(this, arguments);
3109
- };
3110
- }
3111
- if (replaceSync === null) {
3112
- replaceSync = CSSStyleSheet.prototype.replaceSync;
3113
- CSSStyleSheet.prototype.replaceSync = function () {
3114
- if (active()) {
3115
- max(36 /* Metric.ConstructedStyles */, 1);
3116
- // if we haven't seen this stylesheet on this page yet, wait until the checkDocumentStyles has found it
3117
- // and attached the sheet to a document. This way the timestamp of the style sheet creation will align
3118
- // to when it is used in the document rather than potentially being misaligned during the traverse process.
3119
- if (this[styleSheetPageNum] === data$2.pageNum) {
3120
- trackStyleChange(time(), this[styleSheetId], 2 /* StyleSheetOperation.ReplaceSync */, arguments[0]);
3136
+ return replace.apply(this, arguments);
3137
+ };
3138
+ }
3139
+ if (replaceSync === null) {
3140
+ replaceSync = CSSStyleSheet.prototype.replaceSync;
3141
+ CSSStyleSheet.prototype.replaceSync = function () {
3142
+ if (active()) {
3143
+ max(36 /* Metric.ConstructedStyles */, 1);
3144
+ // if we haven't seen this stylesheet on this page yet, wait until the checkDocumentStyles has found it
3145
+ // and attached the sheet to a document. This way the timestamp of the style sheet creation will align
3146
+ // to when it is used in the document rather than potentially being misaligned during the traverse process.
3147
+ if (this[styleSheetPageNum] === data$2.pageNum) {
3148
+ trackStyleChange(time(), this[styleSheetId], 2 /* StyleSheetOperation.ReplaceSync */, arguments[0]);
3149
+ }
3121
3150
  }
3122
- }
3123
- return replaceSync.apply(this, arguments);
3124
- };
3151
+ return replaceSync.apply(this, arguments);
3152
+ };
3153
+ }
3125
3154
  }
3126
3155
  }
3127
3156
  function checkDocumentStyles(documentNode, timestamp) {
@@ -5038,7 +5067,9 @@ function start$8() {
5038
5067
  sessionId: m.sessionId,
5039
5068
  pageNum: m.pageNum,
5040
5069
  upload: 0 /* Upload.Async */,
5041
- end: 0 /* BooleanFlag.False */
5070
+ end: 0 /* BooleanFlag.False */,
5071
+ applicationPlatform: WebApp,
5072
+ url: ''
5042
5073
  };
5043
5074
  }
5044
5075
  function stop$7() {
@@ -5050,6 +5081,8 @@ function envelope(last) {
5050
5081
  data$1.sequence++;
5051
5082
  data$1.upload = last && "sendBeacon" in navigator ? 1 /* Upload.Beacon */ : 0 /* Upload.Async */;
5052
5083
  data$1.end = last ? 1 /* BooleanFlag.True */ : 0 /* BooleanFlag.False */;
5084
+ data$1.applicationPlatform = WebApp;
5085
+ data$1.url = url$1(location.href, false, true);
5053
5086
  return [
5054
5087
  data$1.version,
5055
5088
  data$1.sequence,
@@ -5060,7 +5093,9 @@ function envelope(last) {
5060
5093
  data$1.sessionId,
5061
5094
  data$1.pageNum,
5062
5095
  data$1.upload,
5063
- data$1.end
5096
+ data$1.end,
5097
+ data$1.applicationPlatform,
5098
+ data$1.url
5064
5099
  ];
5065
5100
  }
5066
5101
 
@@ -1 +1 @@
1
- !function(){"use strict";var t=Object.freeze({__proto__:null,get queue(){return gt},get start(){return vt},get stop(){return mt},get track(){return st}}),n=Object.freeze({__proto__:null,get check(){return Et},get compute(){return Mt},get data(){return lt},get start(){return _t},get stop(){return Ot},get trigger(){return It}}),e=Object.freeze({__proto__:null,get compute(){return qt},get data(){return Tt},get log(){return At},get reset(){return Nt},get start(){return zt},get stop(){return Ct},get updates(){return xt}}),r=Object.freeze({__proto__:null,get callback(){return Zt},get callbacks(){return Rt},get clear(){return Jt},get consent(){return Wt},get data(){return Pt},get electron(){return Ut},get id(){return Xt},get metadata(){return Bt},get save(){return Gt},get shortid(){return Kt},get start(){return Lt},get stop(){return Vt}}),o=Object.freeze({__proto__:null,get data(){return on},get envelope(){return un},get start(){return an},get stop(){return cn}}),a={projectId:null,delay:1e3,lean:!1,track:!0,content:!0,drop:[],mask:[],unmask:[],regions:[],cookies:[],fraud:!0,checksum:[],report:null,upload:null,fallback:null,upgrade:null,action:null,dob:null,delayDom:!1,throttleDom:!0,conversions:!1,longTask:30,includeSubdomains:!0};function i(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}var c=0;function u(t){void 0===t&&(t=null);var n=t&&t.timeStamp>0?t.timeStamp:performance.now(),e=t&&t.view?t.view.performance.timeOrigin:performance.timeOrigin;return Math.max(Math.round(n+e-c),0)}var s="0.7.58";var l=!0,d=null,f=null;function p(t,n,e){return function(){if(l&&null===d)try{d=new RegExp("\\p{N}","gu"),f=new RegExp("\\p{L}","gu"),new RegExp("\\p{Sc}","gu")}catch(t){l=!1}}(),t?t.replace(f,n).replace(d,e):t}var h=[],v=null;function g(){}var m=[];function y(){}function b(){}var w=Object.freeze({__proto__:null,checkDocumentStyles:function(t){},compute:function(){},data:v,hashText:y,keys:m,log:g,observe:function(){},reset:function(){},sheetAdoptionState:[],sheetUpdateState:[],start:function(){},state:h,stop:function(){},trigger:b}),k=null;function S(t,n){An()&&t&&"string"==typeof t&&t.length<255&&(k=n&&"string"==typeof n&&n.length<255?{key:t,value:n}:{value:t},St(24))}var _,E=null,I=null;function M(t){t in E||(E[t]=0),t in I||(I[t]=0),E[t]++,I[t]++}function O(t,n){null!==n&&(t in E||(E[t]=0),t in I||(I[t]=0),E[t]+=n,I[t]+=n)}function T(t,n){null!==n&&!1===isNaN(n)&&(t in E||(E[t]=0),(n>E[t]||0===E[t])&&(I[t]=n,E[t]=n))}function x(t,n,e){return window.setTimeout(dn(t),n,e)}function j(t){return window.clearTimeout(t)}var z=0,C=0,A=null;function q(){A&&j(A),A=x(N,C),z=u()}function N(){var t=u();_={gap:t-z},St(25),_.gap<3e5?A=x(N,C):jn&&(S("clarity","suspend"),ee(),["mousemove","touchstart"].forEach((function(t){return pn(document,t,qn)})),["resize","scroll","pageshow"].forEach((function(t){return pn(window,t,qn)})))}var D=Object.freeze({__proto__:null,get data(){return _},reset:q,start:function(){C=6e4,z=0},stop:function(){j(A),z=0,C=0}}),P=null;function R(t){An()&&a.lean&&(a.lean=!1,P={key:t},Zt(),Gt(),a.upgrade&&a.upgrade(t),St(3))}var U=Object.freeze({__proto__:null,get data(){return P},start:function(){!a.lean&&a.upgrade&&a.upgrade("Config"),P=null},stop:function(){P=null},upgrade:R});function H(t,n,e,r){return new(e||(e=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(i,c)}u((r=r.apply(t,n||[])).next())}))}function L(t,n){var e,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(u){return function(c){if(e)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(e=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=n.call(t,i)}catch(t){c=[6,t],r=0}finally{e=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}var V=null;function B(t,n){W(t,"string"==typeof n?[n]:n)}function X(t,n,e,r){return void 0===n&&(n=null),void 0===e&&(e=null),void 0===r&&(r=null),H(this,void 0,void 0,(function(){var o,a;return L(this,(function(i){switch(i.label){case 0:return a={},[4,G(t)];case 1:return a.userId=i.sent(),a.userHint=r||((c=t)&&c.length>=5?"".concat(c.substring(0,2)).concat(p(c.substring(2),"*","*")):p(c,"*","*")),W("userId",[(o=a).userId]),W("userHint",[o.userHint]),W("userType",[F(t)]),n&&(W("sessionId",[n]),o.sessionId=n),e&&(W("pageId",[e]),o.pageId=e),[2,o]}var c}))}))}function W(t,n){if(An()&&t&&n&&"string"==typeof t&&t.length<255){for(var e=(t in V?V[t]:[]),r=0;r<n.length;r++)"string"==typeof n[r]&&n[r].length<255&&e.push(n[r]);V[t]=e}}function J(){St(34)}function Z(){V={}}function G(t){return H(this,void 0,void 0,(function(){var n;return L(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),crypto&&t?[4,crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t))]:[3,2];case 1:return n=e.sent(),[2,Array.prototype.map.call(new Uint8Array(n),(function(t){return("00"+t.toString(16)).slice(-2)})).join("")];case 2:return[2,""];case 3:return[3,5];case 4:return e.sent(),[2,""];case 5:return[2]}}))}))}function F(t){return t&&t.indexOf("@")>0?"email":"string"}var Y="CompressionStream"in window;function K(t){return H(this,void 0,void 0,(function(){var n,e;return L(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),Y?(n=new ReadableStream({start:function(n){return H(this,void 0,void 0,(function(){return L(this,(function(e){return n.enqueue(t),n.close(),[2]}))}))}}).pipeThrough(new TextEncoderStream).pipeThrough(new window.CompressionStream("gzip")),e=Uint8Array.bind,[4,Q(n)]):[3,2];case 1:return[2,new(e.apply(Uint8Array,[void 0,r.sent()]))];case 2:return[3,4];case 3:return r.sent(),[3,4];case 4:return[2,null]}}))}))}function Q(t){return H(this,void 0,void 0,(function(){var n,e,r,o,a;return L(this,(function(i){switch(i.label){case 0:n=t.getReader(),e=[],r=!1,o=[],i.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return a=i.sent(),r=a.done,o=a.value,r?[2,e]:(e.push.apply(e,o),[3,1]);case 3:return[2,e]}}))}))}var $=null;function tt(t){try{if(!$)return;var n=function(t){try{return JSON.parse(t)}catch(t){return[]}}(t);n.forEach((function(t){$(t)}))}catch(t){}}var nt=[w,e,Object.freeze({__proto__:null,compute:J,get data(){return V},identify:X,reset:Z,set:B,start:function(){Z()},stop:function(){Z()}}),n,w,r,o,t,D,U,w];function et(){E={},I={},M(5),nt.forEach((function(t){return dn(t.start)()}))}function rt(){nt.slice().reverse().forEach((function(t){return dn(t.stop)()})),E={},I={}}function ot(){J(),qt(),St(0),Mt()}var at,it,ct,ut,st,lt,dt=0,ft=0,pt=null,ht=0;function vt(){ut=!0,dt=0,ft=0,ht=0,at=[],it=[],ct={},st=null}function gt(t,n){if(void 0===n&&(n=!0),ut){var e=u(),r=t.length>1?t[1]:null,o=JSON.stringify(t);switch(r){case 5:dt+=o.length;case 37:case 6:case 43:case 45:case 46:ft+=o.length,at.push(o);break;default:it.push(o)}M(25);var i=function(){var t=!1===a.lean&&dt>0?100:on.sequence*a.delay;return"string"==typeof a.upload?Math.max(Math.min(t,3e4),100):a.delay}();e-ht>2*i&&(j(pt),pt=null),n&&null===pt&&(25!==r&&q(),pt=x(yt,i),ht=e,Et(ft))}}function mt(){j(pt),yt(!0),dt=0,ft=0,ht=0,at=[],it=[],ct={},st=null,ut=!1}function yt(t){return void 0===t&&(t=!1),H(this,void 0,void 0,(function(){var n,e,r,o,i,c,u,s;return L(this,(function(l){switch(l.label){case 0:return pt=null,(n=!1===a.lean&&ft>0&&(ft<1048576||on.sequence>0))&&T(1,1),ot(),e=!0===t,r=JSON.stringify(un(e)),o="[".concat(it.join(),"]"),i=n?"[".concat(at.join(),"]"):"",c=function(t){return t.p.length>0?'{"e":'.concat(t.e,',"a":').concat(t.a,',"p":').concat(t.p,"}"):'{"e":'.concat(t.e,',"a":').concat(t.a,"}")}({e:r,a:o,p:i}),e?(s=null,[3,3]):[3,1];case 1:return[4,K(c)];case 2:s=l.sent(),l.label=3;case 3:return O(2,(u=s)?u.length:c.length),bt(c,u,on.sequence,e),it=[],n&&(at=[],ft=0,dt=0),[2]}}))}))}function bt(t,n,e,r){if(void 0===r&&(r=!1),"string"==typeof a.upload){var o=a.upload,i=!1;if(r&&"sendBeacon"in navigator)try{(i=navigator.sendBeacon.bind(navigator)(o,t))&&kt(e)}catch(t){}if(!1===i){e in ct?ct[e].attempts++:ct[e]={data:t,attempts:1};var c=new XMLHttpRequest;c.open("POST",o,!0),c.timeout=15e3,c.ontimeout=function(){ln(new Error("".concat("Timeout"," : ").concat(o)))},null!==e&&(c.onreadystatechange=function(){dn(wt)(c,e)}),c.withCredentials=!0,n?(c.setRequestHeader("Accept","application/x-clarity-gzip"),c.send(n)):c.send(t)}}else if(a.upload){(0,a.upload)(t),kt(e)}}function wt(t,n){var e=ct[n];t&&4===t.readyState&&e&&((t.status<200||t.status>208)&&e.attempts<=1?t.status>=400&&t.status<500?It(6):(0===t.status&&(a.upload=a.fallback?a.fallback:a.upload),bt(e.data,null,n)):(st={sequence:n,attempts:e.attempts,status:t.status},e.attempts>1&&St(2),200===t.status&&t.responseText&&function(t){for(var n=t&&t.length>0?t.split("\n"):[],e=0,r=n;e<r.length;e++){var o=r[e],i=o&&o.length>0?o.split(/ (.*)/):[""];switch(i[0]){case"END":It(6);break;case"UPGRADE":R("Auto");break;case"ACTION":a.action&&i.length>1&&a.action(i[1]);break;case"EXTRACT":i.length>1&&i[1];break;case"SIGNAL":i.length>1&&tt(i[1])}}}(t.responseText),0===t.status&&(bt(e.data,null,n,!0),It(3)),t.status>=200&&t.status<=208&&kt(n),delete ct[n]))}function kt(t){1===t&&(Gt(),Zt())}function St(t){var n=[u(),t];switch(t){case 4:var e=h;e&&((n=[e.time,e.event]).push(e.data.visible),n.push(e.data.docWidth),n.push(e.data.docHeight),n.push(e.data.screenWidth),n.push(e.data.screenHeight),n.push(e.data.scrollX),n.push(e.data.scrollY),n.push(e.data.pointerX),n.push(e.data.pointerY),n.push(e.data.activityTime),n.push(e.data.scrollTime),gt(n,!1));break;case 25:n.push(_.gap),gt(n);break;case 35:n.push(lt.check),gt(n,!1);break;case 3:n.push(P.key),gt(n);break;case 2:n.push(st.sequence),n.push(st.attempts),n.push(st.status),gt(n,!1);break;case 24:k.key&&n.push(k.key),n.push(k.value),gt(n);break;case 34:var r=Object.keys(V);if(r.length>0){for(var o=0,a=r;o<a.length;o++){var i=a[o];n.push(i),n.push(V[i])}Z(),gt(n,!1)}break;case 0:var c=Object.keys(I);if(c.length>0){for(var s=0,l=c;s<l.length;s++){var d=l[s],f=parseInt(d,10);n.push(f),n.push(Math.round(I[d]))}I={},gt(n,!1)}break;case 1:var p=Object.keys(xt);if(p.length>0){for(var g=0,y=p;g<y.length;g++){var b=y[g];f=parseInt(b,10);n.push(f),n.push(xt[b])}Nt(),gt(n,!1)}break;case 36:var w=Object.keys(v);if(w.length>0){for(var S=0,E=w;S<E.length;S++){var M=E[S];f=parseInt(M,10);n.push(f),n.push([].concat.apply([],v[M]))}gt(n,!1)}break;case 40:m.forEach((function(t){n.push(t);var e=[];for(var r in v[t]){var o=parseInt(r,10);e.push(o),e.push(v[t][r])}n.push(e)})),gt(n,!1)}}function _t(){lt={check:0}}function Et(t){if(0===lt.check){var n=lt.check;n=on.sequence>=128?1:n,n=on.pageNum>=128?7:n,n=u()>72e5?2:n,(n=t>10485760?2:n)!==lt.check&&It(n)}}function It(t){lt.check=t,5!==t&&(Jt(),ee())}function Mt(){0!==lt.check&&St(35)}function Ot(){lt=null}var Tt=null,xt=null,jt=!1;function zt(){Tt={},xt={},jt=!1}function Ct(){Tt={},xt={},jt=!1}function At(t,n){if(n&&(n="".concat(n),t in Tt||(Tt[t]=[]),Tt[t].indexOf(n)<0)){if(Tt[t].length>128)return void(jt||(jt=!0,It(5)));Tt[t].push(n),t in xt||(xt[t]=[]),xt[t].push(n)}}function qt(){St(1)}function Nt(){xt={},jt=!1}function Dt(t){At(36,t.toString())}var Pt=null,Rt=[],Ut=0,Ht=null;function Lt(){var t,n,e;Ht=null;var r=navigator&&"userAgent"in navigator?navigator.userAgent:"",o=null!==(e=null===(n=null===(t=null===Intl||void 0===Intl?void 0:Intl.DateTimeFormat())||void 0===t?void 0:t.resolvedOptions())||void 0===n?void 0:n.timeZone)&&void 0!==e?e:"",i=(new Date).getTimezoneOffset().toString(),c=window.location.ancestorOrigins?Array.from(window.location.ancestorOrigins).toString():"",u=document&&document.title?document.title:"";Ut=r.indexOf("Electron")>0?1:0;var s,l=function(){var t={session:Kt(),ts:Math.round(Date.now()),count:1,upgrade:null,upload:""},n=tn("_clsk",!a.includeSubdomains);if(n){var e=n.split("|");e.length>=5&&t.ts-Qt(e[1])<18e5&&(t.session=e[0],t.count=Qt(e[2])+1,t.upgrade=Qt(e[3]),t.upload=e.length>=6?"".concat("https://").concat(e[5],"/").concat(e[4]):"".concat("https://").concat(e[4]))}return t}(),d=$t(),f=a.projectId||function(t,n){void 0===n&&(n=null);for(var e,r=5381,o=r,a=0;a<t.length;a+=2)r=(r<<5)+r^t.charCodeAt(a),a+1<t.length&&(o=(o<<5)+o^t.charCodeAt(a+1));return e=Math.abs(r+11579*o),(n?e%Math.pow(2,n):e).toString(36)}(location.host);Pt={projectId:f,userId:d.id,sessionId:l.session,pageNum:l.count},a.lean=a.track&&null!==l.upgrade?0===l.upgrade:a.lean,a.upload=a.track&&"string"==typeof a.upload&&l.upload&&l.upload.length>"https://".length?l.upload:a.upload,At(0,r),At(3,u),At(1,function(t,n){if(void 0===n&&(n=!1),n)return"".concat("https://").concat("Electron");var e=a.drop;if(e&&e.length>0&&t&&t.indexOf("?")>0){var r=t.split("?");return r[0]+"?"+r[1].split("&").map((function(t){return e.some((function(n){return 0===t.indexOf("".concat(n,"="))}))?"".concat(t.split("=")[0],"=").concat("*na*"):t})).join("&")}return t}(location.href,!!Ut)),At(2,document.referrer),At(15,function(){var t=Kt();if(a.track&&Ft(window,"sessionStorage")){var n=sessionStorage.getItem("_cltk");t=n||t,sessionStorage.setItem("_cltk",t)}return t}()),At(16,document.documentElement.lang),At(17,document.dir),At(26,"".concat(window.devicePixelRatio)),At(28,d.dob.toString()),At(29,d.version.toString()),At(33,c),At(34,o),At(35,i),T(0,l.ts),T(1,0),T(35,Ut),navigator&&(At(9,navigator.language),T(33,navigator.hardwareConcurrency),T(32,navigator.maxTouchPoints),T(34,Math.round(navigator.deviceMemory)),(s=navigator.userAgentData)&&s.getHighEntropyValues?s.getHighEntropyValues(["model","platform","platformVersion","uaFullVersion"]).then((function(t){var n;At(22,t.platform),At(23,t.platformVersion),null===(n=t.brands)||void 0===n||n.forEach((function(t){At(24,t.name+"~"+t.version)})),At(25,t.model),T(27,t.mobile?1:0)})):At(22,navigator.platform)),screen&&(T(14,Math.round(screen.width)),T(15,Math.round(screen.height)),T(16,Math.round(screen.colorDepth)));for(var p=0,h=a.cookies;p<h.length;p++){var v=h[p],g=tn(v);g&&B(v,g)}!function(t){Dt(t?1:0)}(a.track),Yt(d)}function Vt(){Ht=null,Pt=null,Rt.forEach((function(t){t.called=!1}))}function Bt(t,n,e){void 0===n&&(n=!0),void 0===e&&(e=!1);var r=a.lean?0:1,o=!1;Pt&&(r||!1===n)&&(t(Pt,!a.lean),o=!0),!e&&o||Rt.push({callback:t,wait:n,recall:e,called:o})}function Xt(){return Pt?[Pt.userId,Pt.sessionId,Pt.pageNum].join("."):""}function Wt(t){if(void 0===t&&(t=!0),!t)return a.track=!1,en("_clsk","",-Number.MAX_VALUE),en("_clck","",-Number.MAX_VALUE),ee(),void window.setTimeout(ne,250);An()&&(a.track=!0,Yt($t(),1),Gt(),Dt(2))}function Jt(){en("_clsk","",0)}function Zt(){!function(t){if(Rt.length>0)for(var n=0;n<Rt.length;n++){var e=Rt[n];!e.callback||e.called||e.wait&&!t||(e.callback(Pt,!a.lean),e.called=!0,e.recall||(Rt.splice(n,1),n--))}}(a.lean?0:1)}function Gt(){if(Pt){var t=Math.round(Date.now()),n=a.upload&&"string"==typeof a.upload?a.upload.replace("https://",""):"",e=a.lean?0:1;en("_clsk",[Pt.sessionId,t,Pt.pageNum,e,n].join("|"),1)}}function Ft(t,n){try{return!!t[n]}catch(t){return!1}}function Yt(t,n){void 0===n&&(n=null),n=null===n?t.consent:n;var e=Math.ceil((Date.now()+31536e6)/864e5),r=0===t.dob?null===a.dob?0:a.dob:t.dob;(null===t.expiry||Math.abs(e-t.expiry)>=1||t.consent!==n||t.dob!==r)&&en("_clck",[Pt.userId,2,e.toString(36),n,r].join("|"),365)}function Kt(){var t=Math.floor(Math.random()*Math.pow(2,32));return window&&window.crypto&&window.crypto.getRandomValues&&Uint32Array&&(t=window.crypto.getRandomValues(new Uint32Array(1))[0]),t.toString(36)}function Qt(t,n){return void 0===n&&(n=10),parseInt(t,n)}function $t(){var t={id:Kt(),version:0,expiry:null,consent:0,dob:0},n=tn("_clck",!a.includeSubdomains);if(n&&n.length>0){for(var e=n.split("|"),r=0,o=0,i=document.cookie.split(";");o<i.length;o++){r+="_clck"===i[o].split("=")[0].trim()?1:0}if(1===e.length||r>1){var c="".concat(";").concat("expires=").concat(new Date(0).toUTCString()).concat(";path=/");document.cookie="".concat("_clck","=").concat(c),document.cookie="".concat("_clsk","=").concat(c)}e.length>1&&(t.version=Qt(e[1])),e.length>2&&(t.expiry=Qt(e[2],36)),e.length>3&&1===Qt(e[3])&&(t.consent=1),e.length>4&&Qt(e[1])>1&&(t.dob=Qt(e[4])),a.track=a.track||1===t.consent,t.id=a.track?e[0]:t.id}return t}function tn(t,n){var e;if(void 0===n&&(n=!1),Ft(document,"cookie")){var r=document.cookie.split(";");if(r)for(var o=0;o<r.length;o++){var a=r[o].split("=");if(a.length>1&&a[0]&&a[0].trim()===t){for(var i=nn(a[1]),c=i[0],u=i[1];c;)c=(e=nn(u))[0],u=e[1];return n?u.endsWith("".concat("~","1"))?u.substring(0,u.length-2):null:u}}}return null}function nn(t){try{var n=decodeURIComponent(t);return[n!=t,n]}catch(t){}return[!1,t]}function en(t,n,e){if((a.track||""==n)&&(navigator&&navigator.cookieEnabled||Ft(document,"cookie"))){var r=function(t){return encodeURIComponent(t)}(n),o=new Date;o.setDate(o.getDate()+e);var i=o?"expires="+o.toUTCString():"",c="".concat(t,"=").concat(r).concat(";").concat(i).concat(";path=/");try{if(null===Ht){for(var u=location.hostname?location.hostname.split("."):[],s=u.length-1;s>=0;s--)if(Ht=".".concat(u[s]).concat(Ht||""),s<u.length-1&&(document.cookie="".concat(c).concat(";").concat("domain=").concat(Ht),tn(t)===n))return;Ht=""}}catch(t){Ht=""}document.cookie=Ht?"".concat(c).concat(";").concat("domain=").concat(Ht):c}}var rn,on=null;function an(){var t=Pt;on={version:s,sequence:0,start:0,duration:0,projectId:t.projectId,userId:t.userId,sessionId:t.sessionId,pageNum:t.pageNum,upload:0,end:0}}function cn(){on=null}function un(t){return on.start=on.start+on.duration,on.duration=u()-on.start,on.sequence++,on.upload=t&&"sendBeacon"in navigator?1:0,on.end=t?1:0,[on.version,on.sequence,on.start,on.duration,on.projectId,on.userId,on.sessionId,on.pageNum,on.upload,on.end]}function sn(){rn=[]}function ln(t){if(rn&&-1===rn.indexOf(t.message)){var n=a.report;if(n&&n.length>0){var e={v:on.version,p:on.projectId,u:on.userId,s:on.sessionId,n:on.pageNum};t.message&&(e.m=t.message),t.stack&&(e.e=t.stack);var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(JSON.stringify(e)),rn.push(t.message)}}return t}function dn(t){return function(){var n=performance.now();try{t.apply(this,arguments)}catch(t){throw ln(t)}var e=performance.now()-n;O(4,e),e>a.longTask&&(M(7),T(6,e),"".concat(t.dn||t.name,"-").concat(e))}}var fn=[];function pn(t,n,e,r){void 0===r&&(r=!1),e=dn(e);try{t[i("addEventListener")](n,e,r),fn.push({event:n,target:t,listener:e,capture:r})}catch(t){}}function hn(){for(var t=0,n=fn;t<n.length;t++){var e=n[t];try{e.target[i("removeEventListener")](e.event,e.listener,e.capture)}catch(t){}}fn=[]}var vn=null,gn=null,mn=null,yn=0;function bn(){return!(yn++>20)}function wn(){yn=0,mn!==Sn()&&(ee(),window.setTimeout(kn,250))}function kn(){ne(),T(29,1)}function Sn(){return location.href?location.href.replace(location.hash,""):location.href}wn.dn=1;var _n=[],En=null,In=null,Mn=null;function On(){In&&(Mn(),In=null,null===En&&xn())}function Tn(){_n=[],En=null,In=null}function xn(){var t=_n.shift();t&&(En=t,t.task().then((function(){t.id===Xt()&&(t.resolve(),En=null,xn())})).catch((function(n){t.id===Xt()&&(n&&(n.name,n.message,n.stack),En=null,xn())})))}var jn=!1;function zn(){jn=!0,c=performance.now()+performance.timeOrigin,Tn(),hn(),sn(),mn=Sn(),yn=0,pn(window,"popstate",wn),null===vn&&(vn=history.pushState,history.pushState=function(){vn.apply(this,arguments),An()&&bn()&&wn()}),null===gn&&(gn=history.replaceState,history.replaceState=function(){gn.apply(this,arguments),An()&&bn()&&wn()})}function Cn(){mn=null,yn=0,sn(),hn(),Tn(),c=0,jn=!1}function An(){return jn}function qn(){ne(),S("clarity","restart")}qn.dn=2;var Nn=null;function Dn(){Nn=null}function Pn(t){Nn={fetchStart:Math.round(t.fetchStart),connectStart:Math.round(t.connectStart),connectEnd:Math.round(t.connectEnd),requestStart:Math.round(t.requestStart),responseStart:Math.round(t.responseStart),responseEnd:Math.round(t.responseEnd),domInteractive:Math.round(t.domInteractive),domComplete:Math.round(t.domComplete),loadEventStart:Math.round(t.loadEventStart),loadEventEnd:Math.round(t.loadEventEnd),redirectCount:Math.round(t.redirectCount),size:t.transferSize?t.transferSize:0,type:t.type,protocol:t.nextHopProtocol,encodedSize:t.encodedBodySize?t.encodedBodySize:0,decodedSize:t.decodedBodySize?t.decodedBodySize:0},function(t){H(this,void 0,void 0,(function(){var n,e;return L(this,(function(r){return n=u(),e=[n,t],29===t&&(e.push(Nn.fetchStart),e.push(Nn.connectStart),e.push(Nn.connectEnd),e.push(Nn.requestStart),e.push(Nn.responseStart),e.push(Nn.responseEnd),e.push(Nn.domInteractive),e.push(Nn.domComplete),e.push(Nn.loadEventStart),e.push(Nn.loadEventEnd),e.push(Nn.redirectCount),e.push(Nn.size),e.push(Nn.type),e.push(Nn.protocol),e.push(Nn.encodedSize),e.push(Nn.decodedSize),Dn(),gt(e)),[2]}))}))}(29)}var Rn,Un=0,Hn=1/0,Ln=0,Vn=0,Bn=[],Xn=new Map,Wn=function(){return Un||0},Jn=function(){if(!Bn.length)return-1;var t=Math.min(Bn.length-1,Math.floor((Wn()-Vn)/50));return Bn[t].latency},Zn=function(){Vn=Wn(),Bn.length=0,Xn.clear()},Gn=function(t){if(t.interactionId&&!(t.duration<40)){!function(t){"interactionCount"in performance?Un=performance.interactionCount:t.interactionId&&(Hn=Math.min(Hn,t.interactionId),Ln=Math.max(Ln,t.interactionId),Un=Ln?(Ln-Hn)/7+1:0)}(t);var n=Bn[Bn.length-1],e=Xn.get(t.interactionId);if(e||Bn.length<10||t.duration>(null==n?void 0:n.latency)){if(e)t.duration>e.latency&&(e.latency=t.duration);else{var r={id:t.interactionId,latency:t.duration};Xn.set(r.id,r),Bn.push(r)}Bn.sort((function(t,n){return n.latency-t.latency})),Bn.length>10&&Bn.splice(10).forEach((function(t){return Xn.delete(t.id)}))}}},Fn=["navigation","resource","longtask","first-input","layout-shift","largest-contentful-paint","event"];function Yn(){try{Rn&&Rn.disconnect(),Rn=new PerformanceObserver(dn(Kn));for(var t=0,n=Fn;t<n.length;t++){var e=n[t];PerformanceObserver.supportedEntryTypes.indexOf(e)>=0&&("layout-shift"===e&&O(9,0),Rn.observe({type:e,buffered:!0}))}}catch(t){}}function Kn(t){!function(t){for(var n=(!("visibilityState"in document)||"visible"===document.visibilityState),e=0;e<t.length;e++){var r=t[e];switch(r.entryType){case"navigation":Pn(r);break;case"resource":var o=r.name;At(4,Qn(o)),o!==a.upload&&o!==a.fallback||T(28,r.duration);break;case"longtask":M(7);break;case"first-input":n&&T(10,r.processingStart-r.startTime);break;case"event":n&&"PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&(Gn(r),At(37,Jn().toString()));break;case"layout-shift":n&&!r.hadRecentInput&&O(9,1e3*r.value);break;case"largest-contentful-paint":n&&T(8,r.startTime)}}}(t.getEntries())}function Qn(t){var n=document.createElement("a");return n.href=t,n.host}function $n(){Dn(),function(){navigator&&"connection"in navigator&&At(27,navigator.connection.effectiveType),window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&("complete"!==document.readyState?pn(window,"load",x.bind(this,Yn,0)):Yn())}()}Yn.dn=26,Kn.dn=27,$n.dn=25;var te=[w,w,w,Object.freeze({__proto__:null,start:$n,stop:function(){Rn&&Rn.disconnect(),Rn=null,Zn(),Dn()}})];function ne(t){void 0===t&&(t=null),function(){try{var t=navigator&&"globalPrivacyControl"in navigator&&1==navigator.globalPrivacyControl;return!1===jn&&"undefined"!=typeof Promise&&window.MutationObserver&&document.createTreeWalker&&"now"in Date&&"now"in performance&&"undefined"!=typeof WeakMap&&!t}catch(t){return!1}}()&&(!function(t){if(null===t||jn)return!1;for(var n in t)n in a&&(a[n]=t[n])}(t),zn(),et(),te.forEach((function(t){return dn(t.start)()})),null===t&&ie())}function ee(){An()&&(te.slice().reverse().forEach((function(t){return dn(t.stop)()})),rt(),Cn(),void 0!==oe&&(oe[ae]=function(){(oe[ae].q=oe[ae].q||[]).push(arguments),"start"===arguments[0]&&oe[ae].q.unshift(oe[ae].q.pop())&&ie()}))}var re=Object.freeze({__proto__:null,consent:Wt,event:S,hashText:y,identify:X,metadata:Bt,pause:function(){An()&&(S("clarity","pause"),null===In&&(In=new Promise((function(t){Mn=t}))))},resume:function(){An()&&(On(),S("clarity","resume"))},set:B,signal:function(t){$=t},start:ne,stop:ee,upgrade:R,version:s}),oe=window,ae="clarity";function ie(){if(void 0!==oe){if(oe[ae]&&oe[ae].v)return console.warn("Error CL001: Multiple Clarity tags detected.");var t=oe[ae]&&oe[ae].q||[];for(oe[ae]=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return re[t].apply(re,n)},oe[ae].v=s;t.length>0;)oe[ae].apply(oe,t.shift())}}ie()}();
1
+ !function(t){"use strict";var n=Object.freeze({__proto__:null,get queue(){return bt},get start(){return yt},get stop(){return wt},get track(){return ft}}),e=Object.freeze({__proto__:null,get check(){return Ot},get compute(){return xt},get data(){return pt},get start(){return Mt},get stop(){return jt},get trigger(){return Tt}}),r=Object.freeze({__proto__:null,get compute(){return Dt},get data(){return zt},get log(){return Pt},get reset(){return Rt},get start(){return qt},get stop(){return Nt},get updates(){return At}}),o=Object.freeze({__proto__:null,get callback(){return Yt},get callbacks(){return Lt},get clear(){return Ft},get consent(){return Gt},get data(){return Ht},get electron(){return Vt},get id(){return Zt},get metadata(){return Jt},get save(){return $t},get shortid(){return tn},get start(){return Wt},get stop(){return Xt}}),a=Object.freeze({__proto__:null,get data(){return un},get envelope(){return dn},get start(){return sn},get stop(){return ln}}),i={projectId:null,delay:1e3,lean:!1,track:!0,content:!0,drop:[],mask:[],unmask:[],regions:[],cookies:[],fraud:!0,checksum:[],report:null,upload:null,fallback:null,upgrade:null,action:null,dob:null,delayDom:!1,throttleDom:!0,conversions:!1,longTask:30,includeSubdomains:!0};function c(t){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(t):t}var u=0;function s(t){void 0===t&&(t=null);var n=t&&t.timeStamp>0?t.timeStamp:performance.now(),e=t&&t.view?t.view.performance.timeOrigin:performance.timeOrigin;return Math.max(Math.round(n+e-u),0)}var l="0.7.58";var d=255,f=!0,p=null,h=null;function v(t,n,e){void 0===n&&(n=!1),void 0===e&&(e=!1);var r=t;if(n)r="".concat("https://").concat("Electron");else{var o=i.drop;if(o&&o.length>0&&t&&t.indexOf("?")>0){var a=t.split("?"),c=a[0],u=a[1];r=c+"?"+u.split("&").map((function(t){return o.some((function(n){return 0===t.indexOf("".concat(n,"="))}))?"".concat(t.split("=")[0],"=").concat("*na*"):t})).join("&")}}return e&&(r=r.substring(0,d)),r}function g(t,n,e){return function(){if(f&&null===p)try{p=new RegExp("\\p{N}","gu"),h=new RegExp("\\p{L}","gu"),new RegExp("\\p{Sc}","gu")}catch(t){f=!1}}(),t?t.replace(h,n).replace(p,e):t}var m=[],y=null;function b(){}var w=[];function k(){}function S(){}var _=Object.freeze({__proto__:null,checkDocumentStyles:function(t){},compute:function(){},data:y,hashText:k,keys:w,log:b,observe:function(){},reset:function(){},sheetAdoptionState:[],sheetUpdateState:[],start:function(){},state:m,stop:function(){},trigger:S}),E=null;function I(t,n){Pn()&&t&&"string"==typeof t&&t.length<255&&(E=n&&"string"==typeof n&&n.length<255?{key:t,value:n}:{value:t},It(24))}var M,O=null,T=null;function x(t){t in O||(O[t]=0),t in T||(T[t]=0),O[t]++,T[t]++}function j(t,n){null!==n&&(t in O||(O[t]=0),t in T||(T[t]=0),O[t]+=n,T[t]+=n)}function z(t,n){null!==n&&!1===isNaN(n)&&(t in O||(O[t]=0),(n>O[t]||0===O[t])&&(T[t]=n,O[t]=n))}function A(t,n,e){return window.setTimeout(hn(t),n,e)}function C(t){return window.clearTimeout(t)}var q=0,N=0,P=null;function D(){P&&C(P),P=A(R,N),q=s()}function R(){var t=s();M={gap:t-q},It(25),M.gap<3e5?P=A(R,N):Cn&&(I("clarity","suspend"),ae(),["mousemove","touchstart"].forEach((function(t){return gn(document,t,Dn)})),["resize","scroll","pageshow"].forEach((function(t){return gn(window,t,Dn)})))}var U=Object.freeze({__proto__:null,get data(){return M},reset:D,start:function(){N=6e4,q=0},stop:function(){C(P),q=0,N=0}}),H=null;function L(t){Pn()&&i.lean&&(i.lean=!1,H={key:t},Yt(),$t(),i.upgrade&&i.upgrade(t),It(3))}var V=Object.freeze({__proto__:null,get data(){return H},start:function(){!i.lean&&i.upgrade&&i.upgrade("Config"),H=null},stop:function(){H=null},upgrade:L});function B(t,n,e,r){return new(e||(e=Promise))((function(o,a){function i(t){try{u(r.next(t))}catch(t){a(t)}}function c(t){try{u(r.throw(t))}catch(t){a(t)}}function u(t){var n;t.done?o(t.value):(n=t.value,n instanceof e?n:new e((function(t){t(n)}))).then(i,c)}u((r=r.apply(t,n||[])).next())}))}function W(t,n){var e,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(u){return function(c){if(e)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(e=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=n.call(t,i)}catch(t){c=[6,t],r=0}finally{e=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,u])}}}var X=null;function J(t,n){G(t,"string"==typeof n?[n]:n)}function Z(t,n,e,r){return void 0===n&&(n=null),void 0===e&&(e=null),void 0===r&&(r=null),B(this,void 0,void 0,(function(){var o,a;return W(this,(function(i){switch(i.label){case 0:return a={},[4,$(t)];case 1:return a.userId=i.sent(),a.userHint=r||((c=t)&&c.length>=5?"".concat(c.substring(0,2)).concat(g(c.substring(2),"*","*")):g(c,"*","*")),G("userId",[(o=a).userId]),G("userHint",[o.userHint]),G("userType",[K(t)]),n&&(G("sessionId",[n]),o.sessionId=n),e&&(G("pageId",[e]),o.pageId=e),[2,o]}var c}))}))}function G(t,n){if(Pn()&&t&&n&&"string"==typeof t&&t.length<255){for(var e=(t in X?X[t]:[]),r=0;r<n.length;r++)"string"==typeof n[r]&&n[r].length<255&&e.push(n[r]);X[t]=e}}function F(){It(34)}function Y(){X={}}function $(t){return B(this,void 0,void 0,(function(){var n;return W(this,(function(e){switch(e.label){case 0:return e.trys.push([0,4,,5]),crypto&&t?[4,crypto.subtle.digest("SHA-256",(new TextEncoder).encode(t))]:[3,2];case 1:return n=e.sent(),[2,Array.prototype.map.call(new Uint8Array(n),(function(t){return("00"+t.toString(16)).slice(-2)})).join("")];case 2:return[2,""];case 3:return[3,5];case 4:return e.sent(),[2,""];case 5:return[2]}}))}))}function K(t){return t&&t.indexOf("@")>0?"email":"string"}var Q="CompressionStream"in window;function tt(t){return B(this,void 0,void 0,(function(){var n,e;return W(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),Q?(n=new ReadableStream({start:function(n){return B(this,void 0,void 0,(function(){return W(this,(function(e){return n.enqueue(t),n.close(),[2]}))}))}}).pipeThrough(new TextEncoderStream).pipeThrough(new window.CompressionStream("gzip")),e=Uint8Array.bind,[4,nt(n)]):[3,2];case 1:return[2,new(e.apply(Uint8Array,[void 0,r.sent()]))];case 2:return[3,4];case 3:return r.sent(),[3,4];case 4:return[2,null]}}))}))}function nt(t){return B(this,void 0,void 0,(function(){var n,e,r,o,a;return W(this,(function(i){switch(i.label){case 0:n=t.getReader(),e=[],r=!1,o=[],i.label=1;case 1:return r?[3,3]:[4,n.read()];case 2:return a=i.sent(),r=a.done,o=a.value,r?[2,e]:(e.push.apply(e,o),[3,1]);case 3:return[2,e]}}))}))}var et=null;function rt(t){try{if(!et)return;var n=function(t){try{return JSON.parse(t)}catch(t){return[]}}(t);n.forEach((function(t){et(t)}))}catch(t){}}var ot=[_,r,Object.freeze({__proto__:null,compute:F,get data(){return X},identify:Z,reset:Y,set:J,start:function(){Y()},stop:function(){Y()}}),e,_,o,a,n,U,V,_];function at(){O={},T={},x(5),ot.forEach((function(t){return hn(t.start)()}))}function it(){ot.slice().reverse().forEach((function(t){return hn(t.stop)()})),O={},T={}}function ct(){F(),Dt(),It(0),xt()}var ut,st,lt,dt,ft,pt,ht=0,vt=0,gt=null,mt=0;function yt(){dt=!0,ht=0,vt=0,mt=0,ut=[],st=[],lt={},ft=null}function bt(t,n){if(void 0===n&&(n=!0),dt){var e=s(),r=t.length>1?t[1]:null,o=JSON.stringify(t);switch(r){case 5:ht+=o.length;case 37:case 6:case 43:case 45:case 46:vt+=o.length,ut.push(o);break;default:st.push(o)}x(25);var a=function(){var t=!1===i.lean&&ht>0?100:un.sequence*i.delay;return"string"==typeof i.upload?Math.max(Math.min(t,3e4),100):i.delay}();e-mt>2*a&&(C(gt),gt=null),n&&null===gt&&(25!==r&&D(),gt=A(kt,a),mt=e,Ot(vt))}}function wt(){C(gt),kt(!0),ht=0,vt=0,mt=0,ut=[],st=[],lt={},ft=null,dt=!1}function kt(t){return void 0===t&&(t=!1),B(this,void 0,void 0,(function(){var n,e,r,o,a,c,u,s;return W(this,(function(l){switch(l.label){case 0:return gt=null,(n=!1===i.lean&&vt>0&&(vt<1048576||un.sequence>0))&&z(1,1),ct(),e=!0===t,r=JSON.stringify(dn(e)),o="[".concat(st.join(),"]"),a=n?"[".concat(ut.join(),"]"):"",c=function(t){return t.p.length>0?'{"e":'.concat(t.e,',"a":').concat(t.a,',"p":').concat(t.p,"}"):'{"e":'.concat(t.e,',"a":').concat(t.a,"}")}({e:r,a:o,p:a}),e?(s=null,[3,3]):[3,1];case 1:return[4,tt(c)];case 2:s=l.sent(),l.label=3;case 3:return j(2,(u=s)?u.length:c.length),St(c,u,un.sequence,e),st=[],n&&(ut=[],vt=0,ht=0),[2]}}))}))}function St(t,n,e,r){if(void 0===r&&(r=!1),"string"==typeof i.upload){var o=i.upload,a=!1;if(r&&"sendBeacon"in navigator)try{(a=navigator.sendBeacon.bind(navigator)(o,t))&&Et(e)}catch(t){}if(!1===a){e in lt?lt[e].attempts++:lt[e]={data:t,attempts:1};var c=new XMLHttpRequest;c.open("POST",o,!0),c.timeout=15e3,c.ontimeout=function(){pn(new Error("".concat("Timeout"," : ").concat(o)))},null!==e&&(c.onreadystatechange=function(){hn(_t)(c,e)}),c.withCredentials=!0,n?(c.setRequestHeader("Accept","application/x-clarity-gzip"),c.send(n)):c.send(t)}}else if(i.upload){(0,i.upload)(t),Et(e)}}function _t(t,n){var e=lt[n];t&&4===t.readyState&&e&&((t.status<200||t.status>208)&&e.attempts<=1?t.status>=400&&t.status<500?Tt(6):(0===t.status&&(i.upload=i.fallback?i.fallback:i.upload),St(e.data,null,n)):(ft={sequence:n,attempts:e.attempts,status:t.status},e.attempts>1&&It(2),200===t.status&&t.responseText&&function(t){for(var n=t&&t.length>0?t.split("\n"):[],e=0,r=n;e<r.length;e++){var o=r[e],a=o&&o.length>0?o.split(/ (.*)/):[""];switch(a[0]){case"END":Tt(6);break;case"UPGRADE":L("Auto");break;case"ACTION":i.action&&a.length>1&&i.action(a[1]);break;case"EXTRACT":a.length>1&&a[1];break;case"SIGNAL":a.length>1&&rt(a[1])}}}(t.responseText),0===t.status&&(St(e.data,null,n,!0),Tt(3)),t.status>=200&&t.status<=208&&Et(n),delete lt[n]))}function Et(t){1===t&&($t(),Yt())}function It(t){var n=[s(),t];switch(t){case 4:var e=m;e&&((n=[e.time,e.event]).push(e.data.visible),n.push(e.data.docWidth),n.push(e.data.docHeight),n.push(e.data.screenWidth),n.push(e.data.screenHeight),n.push(e.data.scrollX),n.push(e.data.scrollY),n.push(e.data.pointerX),n.push(e.data.pointerY),n.push(e.data.activityTime),n.push(e.data.scrollTime),bt(n,!1));break;case 25:n.push(M.gap),bt(n);break;case 35:n.push(pt.check),bt(n,!1);break;case 3:n.push(H.key),bt(n);break;case 2:n.push(ft.sequence),n.push(ft.attempts),n.push(ft.status),bt(n,!1);break;case 24:E.key&&n.push(E.key),n.push(E.value),bt(n);break;case 34:var r=Object.keys(X);if(r.length>0){for(var o=0,a=r;o<a.length;o++){var i=a[o];n.push(i),n.push(X[i])}Y(),bt(n,!1)}break;case 0:var c=Object.keys(T);if(c.length>0){for(var u=0,l=c;u<l.length;u++){var d=l[u],f=parseInt(d,10);n.push(f),n.push(Math.round(T[d]))}T={},bt(n,!1)}break;case 1:var p=Object.keys(At);if(p.length>0){for(var h=0,v=p;h<v.length;h++){var g=v[h];f=parseInt(g,10);n.push(f),n.push(At[g])}Rt(),bt(n,!1)}break;case 36:var b=Object.keys(y);if(b.length>0){for(var k=0,S=b;k<S.length;k++){var _=S[k];f=parseInt(_,10);n.push(f),n.push([].concat.apply([],y[_]))}bt(n,!1)}break;case 40:w.forEach((function(t){n.push(t);var e=[];for(var r in y[t]){var o=parseInt(r,10);e.push(o),e.push(y[t][r])}n.push(e)})),bt(n,!1)}}function Mt(){pt={check:0}}function Ot(t){if(0===pt.check){var n=pt.check;n=un.sequence>=128?1:n,n=un.pageNum>=128?7:n,n=s()>72e5?2:n,(n=t>10485760?2:n)!==pt.check&&Tt(n)}}function Tt(t){pt.check=t,5!==t&&(Ft(),ae())}function xt(){0!==pt.check&&It(35)}function jt(){pt=null}var zt=null,At=null,Ct=!1;function qt(){zt={},At={},Ct=!1}function Nt(){zt={},At={},Ct=!1}function Pt(t,n){if(n&&(n="".concat(n),t in zt||(zt[t]=[]),zt[t].indexOf(n)<0)){if(zt[t].length>128)return void(Ct||(Ct=!0,Tt(5)));zt[t].push(n),t in At||(At[t]=[]),At[t].push(n)}}function Dt(){It(1)}function Rt(){At={},Ct=!1}function Ut(t){Pt(36,t.toString())}var Ht=null,Lt=[],Vt=0,Bt=null;function Wt(){var t,n,e;Bt=null;var r=navigator&&"userAgent"in navigator?navigator.userAgent:"",o=null!==(e=null===(n=null===(t=null===Intl||void 0===Intl?void 0:Intl.DateTimeFormat())||void 0===t?void 0:t.resolvedOptions())||void 0===n?void 0:n.timeZone)&&void 0!==e?e:"",a=(new Date).getTimezoneOffset().toString(),c=window.location.ancestorOrigins?Array.from(window.location.ancestorOrigins).toString():"",u=document&&document.title?document.title:"";Vt=r.indexOf("Electron")>0?1:0;var s,l=function(){var t={session:tn(),ts:Math.round(Date.now()),count:1,upgrade:null,upload:""},n=rn("_clsk",!i.includeSubdomains);if(n){var e=n.split("|");e.length>=5&&t.ts-nn(e[1])<18e5&&(t.session=e[0],t.count=nn(e[2])+1,t.upgrade=nn(e[3]),t.upload=e.length>=6?"".concat("https://").concat(e[5],"/").concat(e[4]):"".concat("https://").concat(e[4]))}return t}(),d=en(),f=i.projectId||function(t,n){void 0===n&&(n=null);for(var e,r=5381,o=r,a=0;a<t.length;a+=2)r=(r<<5)+r^t.charCodeAt(a),a+1<t.length&&(o=(o<<5)+o^t.charCodeAt(a+1));return e=Math.abs(r+11579*o),(n?e%Math.pow(2,n):e).toString(36)}(location.host);Ht={projectId:f,userId:d.id,sessionId:l.session,pageNum:l.count},i.lean=i.track&&null!==l.upgrade?0===l.upgrade:i.lean,i.upload=i.track&&"string"==typeof i.upload&&l.upload&&l.upload.length>"https://".length?l.upload:i.upload,Pt(0,r),Pt(3,u),Pt(1,v(location.href,!!Vt)),Pt(2,document.referrer),Pt(15,function(){var t=tn();if(i.track&&Kt(window,"sessionStorage")){var n=sessionStorage.getItem("_cltk");t=n||t,sessionStorage.setItem("_cltk",t)}return t}()),Pt(16,document.documentElement.lang),Pt(17,document.dir),Pt(26,"".concat(window.devicePixelRatio)),Pt(28,d.dob.toString()),Pt(29,d.version.toString()),Pt(33,c),Pt(34,o),Pt(35,a),z(0,l.ts),z(1,0),z(35,Vt),navigator&&(Pt(9,navigator.language),z(33,navigator.hardwareConcurrency),z(32,navigator.maxTouchPoints),z(34,Math.round(navigator.deviceMemory)),(s=navigator.userAgentData)&&s.getHighEntropyValues?s.getHighEntropyValues(["model","platform","platformVersion","uaFullVersion"]).then((function(t){var n;Pt(22,t.platform),Pt(23,t.platformVersion),null===(n=t.brands)||void 0===n||n.forEach((function(t){Pt(24,t.name+"~"+t.version)})),Pt(25,t.model),z(27,t.mobile?1:0)})):Pt(22,navigator.platform)),screen&&(z(14,Math.round(screen.width)),z(15,Math.round(screen.height)),z(16,Math.round(screen.colorDepth)));for(var p=0,h=i.cookies;p<h.length;p++){var g=h[p],m=rn(g);m&&J(g,m)}!function(t){Ut(t?1:0)}(i.track),Qt(d)}function Xt(){Bt=null,Ht=null,Lt.forEach((function(t){t.called=!1}))}function Jt(t,n,e){void 0===n&&(n=!0),void 0===e&&(e=!1);var r=i.lean?0:1,o=!1;Ht&&(r||!1===n)&&(t(Ht,!i.lean),o=!0),!e&&o||Lt.push({callback:t,wait:n,recall:e,called:o})}function Zt(){return Ht?[Ht.userId,Ht.sessionId,Ht.pageNum].join("."):""}function Gt(t){if(void 0===t&&(t=!0),!t)return i.track=!1,an("_clsk","",-Number.MAX_VALUE),an("_clck","",-Number.MAX_VALUE),ae(),void window.setTimeout(oe,250);Pn()&&(i.track=!0,Qt(en(),1),$t(),Ut(2))}function Ft(){an("_clsk","",0)}function Yt(){!function(t){if(Lt.length>0)for(var n=0;n<Lt.length;n++){var e=Lt[n];!e.callback||e.called||e.wait&&!t||(e.callback(Ht,!i.lean),e.called=!0,e.recall||(Lt.splice(n,1),n--))}}(i.lean?0:1)}function $t(){if(Ht){var t=Math.round(Date.now()),n=i.upload&&"string"==typeof i.upload?i.upload.replace("https://",""):"",e=i.lean?0:1;an("_clsk",[Ht.sessionId,t,Ht.pageNum,e,n].join("|"),1)}}function Kt(t,n){try{return!!t[n]}catch(t){return!1}}function Qt(t,n){void 0===n&&(n=null),n=null===n?t.consent:n;var e=Math.ceil((Date.now()+31536e6)/864e5),r=0===t.dob?null===i.dob?0:i.dob:t.dob;(null===t.expiry||Math.abs(e-t.expiry)>=1||t.consent!==n||t.dob!==r)&&an("_clck",[Ht.userId,2,e.toString(36),n,r].join("|"),365)}function tn(){var t=Math.floor(Math.random()*Math.pow(2,32));return window&&window.crypto&&window.crypto.getRandomValues&&Uint32Array&&(t=window.crypto.getRandomValues(new Uint32Array(1))[0]),t.toString(36)}function nn(t,n){return void 0===n&&(n=10),parseInt(t,n)}function en(){var t={id:tn(),version:0,expiry:null,consent:0,dob:0},n=rn("_clck",!i.includeSubdomains);if(n&&n.length>0){for(var e=n.split("|"),r=0,o=0,a=document.cookie.split(";");o<a.length;o++){r+="_clck"===a[o].split("=")[0].trim()?1:0}if(1===e.length||r>1){var c="".concat(";").concat("expires=").concat(new Date(0).toUTCString()).concat(";path=/");document.cookie="".concat("_clck","=").concat(c),document.cookie="".concat("_clsk","=").concat(c)}e.length>1&&(t.version=nn(e[1])),e.length>2&&(t.expiry=nn(e[2],36)),e.length>3&&1===nn(e[3])&&(t.consent=1),e.length>4&&nn(e[1])>1&&(t.dob=nn(e[4])),i.track=i.track||1===t.consent,t.id=i.track?e[0]:t.id}return t}function rn(t,n){var e;if(void 0===n&&(n=!1),Kt(document,"cookie")){var r=document.cookie.split(";");if(r)for(var o=0;o<r.length;o++){var a=r[o].split("=");if(a.length>1&&a[0]&&a[0].trim()===t){for(var i=on(a[1]),c=i[0],u=i[1];c;)c=(e=on(u))[0],u=e[1];return n?u.endsWith("".concat("~","1"))?u.substring(0,u.length-2):null:u}}}return null}function on(t){try{var n=decodeURIComponent(t);return[n!=t,n]}catch(t){}return[!1,t]}function an(t,n,e){if((i.track||""==n)&&(navigator&&navigator.cookieEnabled||Kt(document,"cookie"))){var r=function(t){return encodeURIComponent(t)}(n),o=new Date;o.setDate(o.getDate()+e);var a=o?"expires="+o.toUTCString():"",c="".concat(t,"=").concat(r).concat(";").concat(a).concat(";path=/");try{if(null===Bt){for(var u=location.hostname?location.hostname.split("."):[],s=u.length-1;s>=0;s--)if(Bt=".".concat(u[s]).concat(Bt||""),s<u.length-1&&(document.cookie="".concat(c).concat(";").concat("domain=").concat(Bt),rn(t)===n))return;Bt=""}}catch(t){Bt=""}document.cookie=Bt?"".concat(c).concat(";").concat("domain=").concat(Bt):c}}var cn,un=null;function sn(){var n=Ht;un={version:l,sequence:0,start:0,duration:0,projectId:n.projectId,userId:n.userId,sessionId:n.sessionId,pageNum:n.pageNum,upload:0,end:0,applicationPlatform:t.WebApp,url:""}}function ln(){un=null}function dn(n){return un.start=un.start+un.duration,un.duration=s()-un.start,un.sequence++,un.upload=n&&"sendBeacon"in navigator?1:0,un.end=n?1:0,un.applicationPlatform=t.WebApp,un.url=v(location.href,!1,!0),[un.version,un.sequence,un.start,un.duration,un.projectId,un.userId,un.sessionId,un.pageNum,un.upload,un.end,un.applicationPlatform,un.url]}function fn(){cn=[]}function pn(t){if(cn&&-1===cn.indexOf(t.message)){var n=i.report;if(n&&n.length>0){var e={v:un.version,p:un.projectId,u:un.userId,s:un.sessionId,n:un.pageNum};t.message&&(e.m=t.message),t.stack&&(e.e=t.stack);var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(JSON.stringify(e)),cn.push(t.message)}}return t}function hn(t){return function(){var n=performance.now();try{t.apply(this,arguments)}catch(t){throw pn(t)}var e=performance.now()-n;j(4,e),e>i.longTask&&(x(7),z(6,e),"".concat(t.dn||t.name,"-").concat(e))}}var vn=[];function gn(t,n,e,r){void 0===r&&(r=!1),e=hn(e);try{t[c("addEventListener")](n,e,r),vn.push({event:n,target:t,listener:e,capture:r})}catch(t){}}function mn(){for(var t=0,n=vn;t<n.length;t++){var e=n[t];try{e.target[c("removeEventListener")](e.event,e.listener,e.capture)}catch(t){}}vn=[]}var yn=null,bn=null,wn=null,kn=0;function Sn(){return!(kn++>20)}function _n(){kn=0,wn!==In()&&(ae(),window.setTimeout(En,250))}function En(){oe(),z(29,1)}function In(){return location.href?location.href.replace(location.hash,""):location.href}_n.dn=1;var Mn=[],On=null,Tn=null,xn=null;function jn(){Tn&&(xn(),Tn=null,null===On&&An())}function zn(){Mn=[],On=null,Tn=null}function An(){var t=Mn.shift();t&&(On=t,t.task().then((function(){t.id===Zt()&&(t.resolve(),On=null,An())})).catch((function(n){t.id===Zt()&&(n&&(n.name,n.message,n.stack),On=null,An())})))}var Cn=!1;function qn(){Cn=!0,u=performance.now()+performance.timeOrigin,zn(),mn(),fn(),wn=In(),kn=0,gn(window,"popstate",_n),null===yn&&(yn=history.pushState,history.pushState=function(){yn.apply(this,arguments),Pn()&&Sn()&&_n()}),null===bn&&(bn=history.replaceState,history.replaceState=function(){bn.apply(this,arguments),Pn()&&Sn()&&_n()})}function Nn(){wn=null,kn=0,fn(),mn(),zn(),u=0,Cn=!1}function Pn(){return Cn}function Dn(){oe(),I("clarity","restart")}Dn.dn=2;var Rn=null;function Un(){Rn=null}function Hn(t){Rn={fetchStart:Math.round(t.fetchStart),connectStart:Math.round(t.connectStart),connectEnd:Math.round(t.connectEnd),requestStart:Math.round(t.requestStart),responseStart:Math.round(t.responseStart),responseEnd:Math.round(t.responseEnd),domInteractive:Math.round(t.domInteractive),domComplete:Math.round(t.domComplete),loadEventStart:Math.round(t.loadEventStart),loadEventEnd:Math.round(t.loadEventEnd),redirectCount:Math.round(t.redirectCount),size:t.transferSize?t.transferSize:0,type:t.type,protocol:t.nextHopProtocol,encodedSize:t.encodedBodySize?t.encodedBodySize:0,decodedSize:t.decodedBodySize?t.decodedBodySize:0},function(t){B(this,void 0,void 0,(function(){var n,e;return W(this,(function(r){return n=s(),e=[n,t],29===t&&(e.push(Rn.fetchStart),e.push(Rn.connectStart),e.push(Rn.connectEnd),e.push(Rn.requestStart),e.push(Rn.responseStart),e.push(Rn.responseEnd),e.push(Rn.domInteractive),e.push(Rn.domComplete),e.push(Rn.loadEventStart),e.push(Rn.loadEventEnd),e.push(Rn.redirectCount),e.push(Rn.size),e.push(Rn.type),e.push(Rn.protocol),e.push(Rn.encodedSize),e.push(Rn.decodedSize),Un(),bt(e)),[2]}))}))}(29)}var Ln,Vn=0,Bn=1/0,Wn=0,Xn=0,Jn=[],Zn=new Map,Gn=function(){return Vn||0},Fn=function(){if(!Jn.length)return-1;var t=Math.min(Jn.length-1,Math.floor((Gn()-Xn)/50));return Jn[t].latency},Yn=function(){Xn=Gn(),Jn.length=0,Zn.clear()},$n=function(t){if(t.interactionId&&!(t.duration<40)){!function(t){"interactionCount"in performance?Vn=performance.interactionCount:t.interactionId&&(Bn=Math.min(Bn,t.interactionId),Wn=Math.max(Wn,t.interactionId),Vn=Wn?(Wn-Bn)/7+1:0)}(t);var n=Jn[Jn.length-1],e=Zn.get(t.interactionId);if(e||Jn.length<10||t.duration>(null==n?void 0:n.latency)){if(e)t.duration>e.latency&&(e.latency=t.duration);else{var r={id:t.interactionId,latency:t.duration};Zn.set(r.id,r),Jn.push(r)}Jn.sort((function(t,n){return n.latency-t.latency})),Jn.length>10&&Jn.splice(10).forEach((function(t){return Zn.delete(t.id)}))}}},Kn=["navigation","resource","longtask","first-input","layout-shift","largest-contentful-paint","event"];function Qn(){try{Ln&&Ln.disconnect(),Ln=new PerformanceObserver(hn(te));for(var t=0,n=Kn;t<n.length;t++){var e=n[t];PerformanceObserver.supportedEntryTypes.indexOf(e)>=0&&("layout-shift"===e&&j(9,0),Ln.observe({type:e,buffered:!0}))}}catch(t){}}function te(t){!function(t){for(var n=(!("visibilityState"in document)||"visible"===document.visibilityState),e=0;e<t.length;e++){var r=t[e];switch(r.entryType){case"navigation":Hn(r);break;case"resource":var o=r.name;Pt(4,ne(o)),o!==i.upload&&o!==i.fallback||z(28,r.duration);break;case"longtask":x(7);break;case"first-input":n&&z(10,r.processingStart-r.startTime);break;case"event":n&&"PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&($n(r),Pt(37,Fn().toString()));break;case"layout-shift":n&&!r.hadRecentInput&&j(9,1e3*r.value);break;case"largest-contentful-paint":n&&z(8,r.startTime)}}}(t.getEntries())}function ne(t){var n=document.createElement("a");return n.href=t,n.host}function ee(){Un(),function(){navigator&&"connection"in navigator&&Pt(27,navigator.connection.effectiveType),window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&("complete"!==document.readyState?gn(window,"load",A.bind(this,Qn,0)):Qn())}()}Qn.dn=26,te.dn=27,ee.dn=25;var re=[_,_,_,Object.freeze({__proto__:null,start:ee,stop:function(){Ln&&Ln.disconnect(),Ln=null,Yn(),Un()}})];function oe(t){void 0===t&&(t=null),function(){try{var t=navigator&&"globalPrivacyControl"in navigator&&1==navigator.globalPrivacyControl;return!1===Cn&&"undefined"!=typeof Promise&&window.MutationObserver&&document.createTreeWalker&&"now"in Date&&"now"in performance&&"undefined"!=typeof WeakMap&&!t}catch(t){return!1}}()&&(!function(t){if(null===t||Cn)return!1;for(var n in t)n in i&&(i[n]=t[n])}(t),qn(),at(),re.forEach((function(t){return hn(t.start)()})),null===t&&se())}function ae(){Pn()&&(re.slice().reverse().forEach((function(t){return hn(t.stop)()})),it(),Nn(),void 0!==ce&&(ce[ue]=function(){(ce[ue].q=ce[ue].q||[]).push(arguments),"start"===arguments[0]&&ce[ue].q.unshift(ce[ue].q.pop())&&se()}))}var ie=Object.freeze({__proto__:null,consent:Gt,event:I,hashText:k,identify:Z,metadata:Jt,pause:function(){Pn()&&(I("clarity","pause"),null===Tn&&(Tn=new Promise((function(t){xn=t}))))},resume:function(){Pn()&&(jn(),I("clarity","resume"))},set:J,signal:function(t){et=t},start:oe,stop:ae,upgrade:L,version:l}),ce=window,ue="clarity";function se(){if(void 0!==ce){if(ce[ue]&&ce[ue].v)return console.warn("Error CL001: Multiple Clarity tags detected.");var t=ce[ue]&&ce[ue].q||[];for(ce[ue]=function(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];return ie[t].apply(ie,n)},ce[ue].v=l;t.length>0;)ce[ue].apply(ce,t.shift())}}se()}(data$b);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clarity-js",
3
- "version": "0.7.59",
3
+ "version": "0.7.61",
4
4
  "description": "An analytics library that uses web page interactions to generate aggregated insights",
5
5
  "author": "Microsoft Corp.",
6
6
  "license": "MIT",
package/src/core/scrub.ts CHANGED
@@ -4,6 +4,7 @@ import * as Layout from "@clarity-types/layout";
4
4
  import config from "@src/core/config";
5
5
 
6
6
  const catchallRegex = /\S/gi;
7
+ const maxUrlLength = 255;
7
8
  let unicodeRegex = true;
8
9
  let digitRegex = null;
9
10
  let letterRegex = null;
@@ -87,17 +88,24 @@ export function text(value: string, hint: string, privacy: Privacy, mangle: bool
87
88
  return value;
88
89
  }
89
90
 
90
- export function url(input: string, electron: boolean = false): string {
91
+ export function url(input: string, electron: boolean = false, truncate: boolean = false): string {
92
+ let result = input;
91
93
  // Replace the URL for Electron apps so we don't send back file:/// URL
92
- if (electron) { return `${Data.Constant.HTTPS}${Data.Constant.Electron}`; }
94
+ if (electron) {
95
+ result = `${Data.Constant.HTTPS}${Data.Constant.Electron}`;
96
+ } else {
97
+ let drop = config.drop;
98
+ if (drop && drop.length > 0 && input && input.indexOf("?") > 0) {
99
+ let [path, query] = input.split("?");
100
+ let swap = Data.Constant.Dropped;
101
+ result = path + "?" + query.split("&").map(p => drop.some(x => p.indexOf(`${x}=`) === 0) ? `${p.split("=")[0]}=${swap}` : p).join("&");
102
+ }
103
+ }
93
104
 
94
- let drop = config.drop;
95
- if (drop && drop.length > 0 && input && input.indexOf("?") > 0) {
96
- let [path, query] = input.split("?");
97
- let swap = Data.Constant.Dropped;
98
- return path + "?" + query.split("&").map(p => drop.some(x => p.indexOf(`${x}=`) === 0) ? `${p.split("=")[0]}=${swap}` : p).join("&");
105
+ if (truncate) {
106
+ result = result.substring(0, maxUrlLength);
99
107
  }
100
- return input;
108
+ return result;
101
109
  }
102
110
 
103
111
  function mangleText(value: string): string {
@@ -111,7 +119,7 @@ function mangleText(value: string): string {
111
119
  }
112
120
  return value;
113
121
  }
114
-
122
+
115
123
  function mask(value: string): string {
116
124
  return value.replace(catchallRegex, Data.Constant.Mask);
117
125
  }
@@ -149,7 +157,7 @@ function redact(value: string): string {
149
157
  let hasEmail = false;
150
158
  let hasWhitespace = false;
151
159
  let array = null;
152
-
160
+
153
161
  regex(); // Initialize regular expressions
154
162
 
155
163
  for (let i = 0; i < value.length; i++) {
@@ -1,7 +1,8 @@
1
- import { BooleanFlag, Token, Upload, Envelope } from "@clarity-types/data";
1
+ import { BooleanFlag, Token, Upload, Envelope, WebApp } from "@clarity-types/data";
2
2
  import { time } from "@src/core/time";
3
3
  import version from "@src/core/version";
4
4
  import * as metadata from "@src/data/metadata";
5
+ import * as scrub from "@src/core/scrub";
5
6
 
6
7
  export let data: Envelope = null;
7
8
 
@@ -17,7 +18,9 @@ export function start(): void {
17
18
  sessionId: m.sessionId,
18
19
  pageNum: m.pageNum,
19
20
  upload: Upload.Async,
20
- end: BooleanFlag.False
21
+ end: BooleanFlag.False,
22
+ applicationPlatform: WebApp,
23
+ url: ''
21
24
  };
22
25
  }
23
26
 
@@ -31,6 +34,8 @@ export function envelope(last: boolean): Token[] {
31
34
  data.sequence++;
32
35
  data.upload = last && "sendBeacon" in navigator ? Upload.Beacon : Upload.Async;
33
36
  data.end = last ? BooleanFlag.True : BooleanFlag.False;
37
+ data.applicationPlatform = WebApp;
38
+ data.url = scrub.url(location.href, false, true);
34
39
  return [
35
40
  data.version,
36
41
  data.sequence,
@@ -41,6 +46,8 @@ export function envelope(last: boolean): Token[] {
41
46
  data.sessionId,
42
47
  data.pageNum,
43
48
  data.upload,
44
- data.end
49
+ data.end,
50
+ data.applicationPlatform,
51
+ data.url
45
52
  ];
46
53
  }
@@ -51,7 +51,7 @@ export function queue(tokens: Token[], transmit: boolean = true): void {
51
51
  case Event.Discover:
52
52
  discoverBytes += event.length;
53
53
  case Event.Box:
54
- case Event.Mutation:
54
+ case Event.Mutation:
55
55
  case Event.Snapshot:
56
56
  case Event.StyleSheetAdoption:
57
57
  case Event.StyleSheetUpdate:
@@ -241,7 +241,7 @@ function check(xhr: XMLHttpRequest, sequence: number): void {
241
241
 
242
242
  function done(sequence: number): void {
243
243
  // If we everything went successfully, and it is the first sequence, save this session for future reference
244
- if (sequence === 1) {
244
+ if (sequence === 1) {
245
245
  metadata.save();
246
246
  metadata.callback();
247
247
  }
@@ -14,6 +14,7 @@ import * as summary from "@src/data/summary";
14
14
  import * as internal from "@src/diagnostic/internal";
15
15
  import * as doc from "@src/layout/document";
16
16
  import * as dom from "@src/layout/dom";
17
+ import * as metric from "@src/data/metric";
17
18
  import encode from "@src/layout/encode";
18
19
  import * as region from "@src/layout/region";
19
20
  import traverse from "@src/layout/traverse";
@@ -195,10 +196,27 @@ async function process(): Promise<void> {
195
196
  if (Object.keys(throttledMutations).length === 0 && processedMutations) {
196
197
  await encode(Event.Mutation, timer, time());
197
198
  }
199
+
200
+ cleanHistory();
198
201
 
199
202
  task.stop(timer);
200
203
  }
201
204
 
205
+ function cleanHistory(): void {
206
+ let now = time();
207
+ if (Object.keys(history).length > Setting.MaxMutationHistoryCount) {
208
+ history = {};
209
+ metric.count(Metric.HistoryClear);
210
+ }
211
+
212
+ for (let key of Object.keys(history)) {
213
+ let h = history[key];
214
+ if (now > h[1] + Setting.MaxMutationHistoryTime) {
215
+ delete history[key];
216
+ }
217
+ }
218
+ }
219
+
202
220
  function track(m: MutationRecord, timer: Timer, instance: number, timestamp: number): string {
203
221
  let value = m.target ? dom.get(m.target.parentNode) : null;
204
222
  // Check if the parent is already discovered and that the parent is not the document root
@@ -19,37 +19,39 @@ let styleTimeMap: {[key: string]: number} = {};
19
19
  let documentNodes = [];
20
20
 
21
21
  export function start(): void {
22
- if (replace === null) {
23
- replace = CSSStyleSheet.prototype.replace;
24
- CSSStyleSheet.prototype.replace = function(): Promise<CSSStyleSheet> {
25
- if (core.active()) {
26
- metric.max(Metric.ConstructedStyles, 1);
27
- // if we haven't seen this stylesheet on this page yet, wait until the checkDocumentStyles has found it
28
- // and attached the sheet to a document. This way the timestamp of the style sheet creation will align
29
- // to when it is used in the document rather than potentially being misaligned during the traverse process.
30
- if (this[styleSheetPageNum] === metadataFields.pageNum) {
31
- trackStyleChange(time(), this[styleSheetId], StyleSheetOperation.Replace, arguments[0]);
22
+ if (window['CSSStyleSheet'] && CSSStyleSheet.prototype) {
23
+ if (replace === null) {
24
+ replace = CSSStyleSheet.prototype.replace;
25
+ CSSStyleSheet.prototype.replace = function(): Promise<CSSStyleSheet> {
26
+ if (core.active()) {
27
+ metric.max(Metric.ConstructedStyles, 1);
28
+ // if we haven't seen this stylesheet on this page yet, wait until the checkDocumentStyles has found it
29
+ // and attached the sheet to a document. This way the timestamp of the style sheet creation will align
30
+ // to when it is used in the document rather than potentially being misaligned during the traverse process.
31
+ if (this[styleSheetPageNum] === metadataFields.pageNum) {
32
+ trackStyleChange(time(), this[styleSheetId], StyleSheetOperation.Replace, arguments[0]);
33
+ }
32
34
  }
33
- }
34
- return replace.apply(this, arguments);
35
- };
36
- }
37
-
38
- if (replaceSync === null) {
39
- replaceSync = CSSStyleSheet.prototype.replaceSync;
40
- CSSStyleSheet.prototype.replaceSync = function(): void {
41
- if (core.active()) {
42
- metric.max(Metric.ConstructedStyles, 1);
43
- // if we haven't seen this stylesheet on this page yet, wait until the checkDocumentStyles has found it
44
- // and attached the sheet to a document. This way the timestamp of the style sheet creation will align
45
- // to when it is used in the document rather than potentially being misaligned during the traverse process.
46
- if (this[styleSheetPageNum] === metadataFields.pageNum) {
47
- trackStyleChange(time(), this[styleSheetId], StyleSheetOperation.ReplaceSync, arguments[0]);
48
- }
49
- }
50
- return replaceSync.apply(this, arguments);
51
- };
52
- }
35
+ return replace.apply(this, arguments);
36
+ };
37
+ }
38
+
39
+ if (replaceSync === null) {
40
+ replaceSync = CSSStyleSheet.prototype.replaceSync;
41
+ CSSStyleSheet.prototype.replaceSync = function(): void {
42
+ if (core.active()) {
43
+ metric.max(Metric.ConstructedStyles, 1);
44
+ // if we haven't seen this stylesheet on this page yet, wait until the checkDocumentStyles has found it
45
+ // and attached the sheet to a document. This way the timestamp of the style sheet creation will align
46
+ // to when it is used in the document rather than potentially being misaligned during the traverse process.
47
+ if (this[styleSheetPageNum] === metadataFields.pageNum) {
48
+ trackStyleChange(time(), this[styleSheetId], StyleSheetOperation.ReplaceSync, arguments[0]);
49
+ }
50
+ }
51
+ return replaceSync.apply(this, arguments);
52
+ };
53
+ }
54
+ }
53
55
  }
54
56
 
55
57
  export function checkDocumentStyles(documentNode: Document, timestamp: number): void {
package/types/data.d.ts CHANGED
@@ -12,6 +12,8 @@ export interface MetadataCallbackOptions {
12
12
  }
13
13
  export type SignalCallback = (data: ClaritySignal) => void
14
14
 
15
+ export const WebApp = 0;
16
+
15
17
  /* Enum */
16
18
  export const enum Event {
17
19
  /* Data */
@@ -127,7 +129,8 @@ export const enum Metric {
127
129
  /**
128
130
  * @deprecated Move it to dimension as it'll report only last value
129
131
  */
130
- InteractionNextPaint = 37
132
+ InteractionNextPaint = 37,
133
+ HistoryClear = 38
131
134
  }
132
135
 
133
136
  export const enum Dimension {
@@ -345,6 +348,7 @@ export const enum XMLReadyState {
345
348
  Done = 4
346
349
  }
347
350
 
351
+
348
352
  /* Helper Interfaces */
349
353
 
350
354
  export interface Payload {
@@ -389,6 +393,8 @@ export interface Envelope extends Metadata {
389
393
  version: string;
390
394
  upload: Upload;
391
395
  end: BooleanFlag;
396
+ applicationPlatform: number;
397
+ url: string;
392
398
  }
393
399
 
394
400
  export interface Transit {
@@ -485,4 +491,4 @@ export interface PerformanceEventTiming extends PerformanceEntry {
485
491
  export interface Interaction {
486
492
  id: number;
487
493
  latency: number;
488
- }
494
+ }
package/types/layout.d.ts CHANGED
@@ -156,7 +156,9 @@ export const enum JsonLD {
156
156
  export const enum Setting {
157
157
  LookAhead = 33, // 33ms
158
158
  MutationSuspendThreshold = 10, // Stop listening for mutations after hitting a threshold count
159
- MutationActivePeriod = 3000 // Unit: milliseconds. Let mutations continue as normal during active periods of user interactions
159
+ MutationActivePeriod = 3000, // Unit: milliseconds. Let mutations continue as normal during active periods of user interactions
160
+ MaxMutationHistoryCount = 10000,
161
+ MaxMutationHistoryTime = 30000, // Unit: milliseconds. Maximum time to keep mutation history in memory
160
162
  }
161
163
 
162
164
  export const enum StyleSheetOperation {