From f65e1b1ae6937adfb0fe236ad76855cdb3ad0681 Mon Sep 17 00:00:00 2001 From: turtledreams <62231246+turtledreams@users.noreply.github.com> Date: Fri, 10 Jan 2025 23:24:07 +0900 Subject: [PATCH] reduced verbosity --- lib/countly.js | 89 ++++++++++++++++++++++++++++------------------ lib/countly.min.js | 63 ++++++++++++++++---------------- 2 files changed, 87 insertions(+), 65 deletions(-) diff --git a/lib/countly.js b/lib/countly.js index 34168db4..d6b4cb4e 100644 --- a/lib/countly.js +++ b/lib/countly.js @@ -4386,8 +4386,22 @@ if (e) { return; } - _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "sendContentRequest, received content: [" + resp + "]"); - _classPrivateFieldGet2(_displayContent, _this).call(_this, resp); + if (!resp) { + _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.VERBOSE, "sendContentRequest, no content to display"); + return; + } + try { + var response = JSON.parse(resp); + } catch (error) { + // verbose log + _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.VERBOSE, "sendContentRequest, No content to display or an error while parsing content: " + error); + return; + } + if (!response.html || !response.geo) { + _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.VERBOSE, "sendContentRequest, no html content or orientation to display"); + return; + } + _classPrivateFieldGet2(_displayContent, _this).call(_this, response); clearInterval(_classPrivateFieldGet2(_contentZoneTimer, _this)); // prevent multiple content requests while one is on window.addEventListener('message', function (event) { _classPrivateFieldGet2(_interpretContentMessage, _this).call(_this, event); @@ -4399,6 +4413,9 @@ var width = window.innerWidth; var height = window.innerHeight; var iframe = document.getElementById(_classPrivateFieldGet2(_contentIframeID, _this)); + if (!iframe) { + return; + } iframe.contentWindow.postMessage({ type: 'resize', width: width, @@ -4408,72 +4425,75 @@ }); }, true); }); - _classPrivateFieldInitSpec(this, _displayContent, function (content) { - if (!content) { - _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "displayContent, no content to display"); - return; + _classPrivateFieldInitSpec(this, _displayContent, function (response) { + try { + var iframe = document.createElement("iframe"); + iframe.id = _classPrivateFieldGet2(_contentIframeID, _this); + iframe.src = response.html; + iframe.style.position = "absolute"; + var dimensionToUse = response.geo.p; + var resInfo = _classPrivateFieldGet2(_getResolution, _this).call(_this, true); + if (resInfo.width >= resInfo.height) { + dimensionToUse = response.geo.l; + } + ; + iframe.style.left = dimensionToUse.x + "px"; + iframe.style.top = dimensionToUse.y + "px"; + iframe.style.width = dimensionToUse.w + "px"; + iframe.style.height = dimensionToUse.h + "px"; + iframe.style.border = "none"; + iframe.style.zIndex = "999999"; + document.body.appendChild(iframe); + } catch (error) { + _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.ERROR, "displayContent, Error while creating iframe for the content: " + error); } - _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "displayContent, displaying content"); - var response = JSON.parse(content); - var iframe = document.createElement("iframe"); - iframe.id = _classPrivateFieldGet2(_contentIframeID, _this); - iframe.src = response.html; - iframe.style.position = "absolute"; - var dimensionToUse = response.geo.p; - var resInfo = _classPrivateFieldGet2(_getResolution, _this).call(_this, true); - if (resInfo.width >= resInfo.height) { - dimensionToUse = response.geo.l; - } - iframe.style.left = dimensionToUse.x + "px"; - iframe.style.top = dimensionToUse.y + "px"; - iframe.style.width = dimensionToUse.w + "px"; - iframe.style.height = dimensionToUse.h + "px"; - iframe.style.border = "none"; - iframe.style.zIndex = "999999"; - document.body.appendChild(iframe); }); _classPrivateFieldInitSpec(this, _interpretContentMessage, function (messageEvent) { if (messageEvent.origin !== _this.url) { - // this.#log(logLevelEnums.ERROR, "sendContentRequest, Received message from invalid origin"); + // this.#log(logLevelEnums.ERROR, "interpretContentMessage, Received message from invalid origin"); // silent ignore return; } - _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "sendContentRequest, Received message from: [" + messageEvent.origin + "] with data: [" + JSON.stringify(messageEvent.data) + "]"); + _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "interpretContentMessage, Received message from: [" + messageEvent.origin + "] with data: [" + JSON.stringify(messageEvent.data) + "]"); var _messageEvent$data = messageEvent.data, close = _messageEvent$data.close, link = _messageEvent$data.link, event = _messageEvent$data.event, resize_me = _messageEvent$data.resize_me; if (event) { - _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "sendContentRequest, Received event"); + _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "interpretContentMessage, Received event"); if (close === 1) { - _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "sendContentRequest, Closing content frame for event"); + _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "interpretContentMessage, Closing content frame for event"); _classPrivateFieldGet2(_closeContentFrame, _this).call(_this); } if (!Array.isArray(event)) { if (_typeof(event) === "object") { _readOnlyError("event"); } else { - _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.ERROR, "sendContentRequest, Invalid event type: [" + _typeof(event) + "]"); + _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.ERROR, "interpretContentMessage, Invalid event type: [" + _typeof(event) + "]"); return; } } // event is expected to be an array of events for (var i = 0; i < event.length; i++) { - _classPrivateFieldGet2(_add_cly_events, _this).call(_this, event[i]); + _classPrivateFieldGet2(_add_cly_events, _this).call(_this, event[i]); // let this method handle the event } } if (link) { if (close === 1) { - _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "sendContentRequest, Closing content frame for link"); + _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "interpretContentMessage, Closing content frame for link"); _classPrivateFieldGet2(_closeContentFrame, _this).call(_this); } window.open(link, "_blank"); - _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "sendContentRequest, Opened link in new tab: [".concat(link, "]")); + _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "interpretContentMessage, Opened link in new tab: [".concat(link, "]")); } if (resize_me) { - _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "sendContentRequest, Resizing iframe"); + _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "interpretContentMessage, Resizing iframe"); var resInfo = _classPrivateFieldGet2(_getResolution, _this).call(_this, true); + if (!resize_me.l || !resize_me.p || !resize_me.l.x || !resize_me.l.y || !resize_me.l.w || !resize_me.l.h || !resize_me.p.x || !resize_me.p.y || !resize_me.p.w || !resize_me.p.h) { + _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.ERROR, "interpretContentMessage, Invalid resize object"); + return; + } var dimensionToUse = resize_me.p; if (resInfo.width >= resInfo.height) { dimensionToUse = resize_me.l; @@ -4489,10 +4509,11 @@ } }); _classPrivateFieldInitSpec(this, _closeContentFrame, function () { + // we might want to remove event listeners here too but with the current implementation, it seems unnecessary var iframe = document.getElementById(_classPrivateFieldGet2(_contentIframeID, _this)); if (iframe) { iframe.remove(); - _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "sendContentRequest, removed iframe"); + _classPrivateFieldGet2(_log, _this).call(_this, logLevelEnums.DEBUG, "interpretContentMessage, removed iframe"); if (_classPrivateFieldGet2(_inContentZone, _this)) { // if user did not exit content zone, re-enter _classPrivateFieldGet2(_enterContentZoneInternal, _this).call(_this, true); diff --git a/lib/countly.min.js b/lib/countly.min.js index 2b90ab15..a01d2067 100644 --- a/lib/countly.min.js +++ b/lib/countly.min.js @@ -1,7 +1,7 @@ (function(va,Ja){"object"===typeof exports&&"undefined"!==typeof module?Ja(exports):"function"===typeof define&&define.amd?define(["exports"],Ja):(va="undefined"!==typeof globalThis?globalThis:va||self,Ja(va.Countly=va.Countly||{}))})(this,function(va){function Ja(m,p,v){if("function"==typeof m?m===p:m.has(p))return 3>arguments.length?p:v;throw new TypeError("Private element is not present on this object");}function b(m,p){return m.get(Ja(m,p))}function q(m,p,v){if(p.has(m))throw new TypeError("Cannot initialize the same private elements twice on an object"); p.set(m,v)}function l(m,p,v){return m.set(Ja(m,p),v),v}function w(m,p,v){a:{var a=p;if("object"==typeof a&&a){var F=a[Symbol.toPrimitive];if(void 0!==F){a=F.call(a,"string");if("object"!=typeof a)break a;throw new TypeError("@@toPrimitive must return a primitive value.");}a=String(a)}}return(p="symbol"==typeof a?a:a+"")in m?Object.defineProperty(m,p,{value:v,enumerable:!0,configurable:!0,writable:!0}):m[p]=v,m}function R(m){"@babel/helpers - typeof";return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator? function(p){return typeof p}:function(p){return p&&"function"==typeof Symbol&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},R(m)}function ac(m){var p=[];if("undefined"!==typeof m.options)for(var v=0;v=m?lb++:lb=m;return lb}function x(m,p,v){if(p&&Object.keys(p).length){if("undefined"!==typeof p[m])return p[m]}else if("undefined"!==typeof t[m])return t[m];return v}function Fb(m,p,v){for(var a in t.i)t.i[a].tracking_crashes&&t.i[a].recordError(m,p,v)}function Gb(m,p){var v=[],a;for(a in m)v.push(a+ +return m.replace(new RegExp(p,"g"),function(a){var F=(v+16*Math.random())%16|0;return("x"===a?F:F&3|8).toString(16)})}function M(){return Math.floor((new Date).getTime()/1E3)}function Eb(){var m=(new Date).getTime();lb>=m?lb++:lb=m;return lb}function y(m,p,v){if(p&&Object.keys(p).length){if("undefined"!==typeof p[m])return p[m]}else if("undefined"!==typeof t[m])return t[m];return v}function Fb(m,p,v){for(var a in t.i)t.i[a].tracking_crashes&&t.i[a].recordError(m,p,v)}function Gb(m,p){var v=[],a;for(a in m)v.push(a+ "="+encodeURIComponent(m[a]));var F=v.join("&");return p?cc(F,p).then(function(c){return F+="&checksum256="+c}):Promise.resolve(F)}function Ka(m){return"string"===typeof m&&"/"===m.substring(m.length-1)?m.substring(0,m.length-1):m}function Za(m,p){for(var v={},a,F=0,c=p.length;Fa){var g={},h=0,n;for(n in m)hp&&(F=m.substring(0,p),a(f.DEBUG,v+", Key: [ "+m+" ] is longer than accepted length. It will be truncated."));return F}function cc(m,p){m=(new TextEncoder).encode(m+p);return crypto.subtle.digest("SHA-256",m).then(function(v){return Array.from(new Uint8Array(v)).map(function(a){return a.toString(16).padStart(2,"0")}).join("")})}function D(m,p,v){A&&(null===m||"undefined"===typeof m?$a()&& console.warn("[WARNING] [Countly] add_event_listener, Can't bind ["+p+"] event to nonexisting element"):"undefined"!==typeof m.addEventListener?m.addEventListener(p,v,!1):m.attachEvent("on"+p,v))}function mb(m){return m?"undefined"!==typeof m.target?m.target:m.srcElement:window.event.srcElement}function La(m){if(m)return m;(m=navigator.userAgent)||(m=Hb());return m}function Hb(m){if(m)return m;m="";navigator.userAgentData&&(m=navigator.userAgentData.brands.map(function(p){return p.brand+":"+p.version}).join(), @@ -20,17 +20,17 @@ ma=new WeakMap,pb=new WeakMap,na=new WeakMap,ta=new WeakMap,H=new WeakMap,Ca=new oc=new WeakMap,Rb=new WeakMap,pc=new WeakMap,qc=new WeakMap,tb=new WeakMap,Fa=new WeakMap,ub=new WeakMap,Sb=new WeakMap,vb=new WeakMap,rc=new WeakMap,Tb=new WeakMap,Ga=new WeakMap,Q=new WeakMap,ib=new WeakMap,sc=new WeakMap,Ha=new WeakMap,wb=new WeakMap,tc=new WeakMap,Ub=new WeakMap,jb=new WeakMap,kb=new WeakMap,xb=new WeakMap,e=new WeakMap,ea=new WeakMap,Vb=new WeakMap,Wb=new WeakMap,yb=new WeakMap,zb=new WeakMap,Xb=new WeakMap,Ab=new WeakMap,uc=new WeakMap,Yb=new WeakMap,vc=new WeakMap,wc=new WeakMap, xc=new WeakMap,yc=new WeakMap,Zb=new WeakMap,B=new WeakMap,z=new WeakMap,T=new WeakMap,zc=new WeakMap,Ac=new WeakMap,Bc=new WeakMap,Cc=new WeakMap,qa=new WeakMap,Ec=function(m,p,v){return Object.defineProperty(m,"prototype",{writable:!1}),m}(function v(p){var a=this;if(!(this instanceof v))throw new TypeError("Cannot call a class as a function");q(this,ab,void 0);q(this,mc,void 0);q(this,Ma,void 0);q(this,X,void 0);q(this,bb,void 0);q(this,Na,void 0);q(this,Oa,void 0);q(this,Pa,void 0);q(this,K,void 0); q(this,N,void 0);q(this,P,void 0);q(this,la,void 0);q(this,aa,void 0);q(this,ba,void 0);q(this,cb,void 0);q(this,wa,void 0);q(this,fa,void 0);q(this,db,void 0);q(this,S,void 0);q(this,xa,void 0);q(this,ya,void 0);q(this,eb,void 0);q(this,Qa,void 0);q(this,za,void 0);q(this,ra,void 0);q(this,Ra,void 0);q(this,Aa,void 0);q(this,sa,void 0);q(this,ha,void 0);q(this,Ba,void 0);q(this,Sa,void 0);q(this,Ta,void 0);q(this,L,void 0);q(this,ca,void 0);q(this,ma,void 0);q(this,pb,void 0);q(this,na,void 0);q(this, -ta,void 0);q(this,H,void 0);q(this,Ca,void 0);q(this,Da,void 0);q(this,fb,void 0);q(this,oa,void 0);q(this,Ua,void 0);q(this,ia,void 0);q(this,ua,void 0);q(this,pa,void 0);q(this,gb,void 0);q(this,I,void 0);q(this,hb,void 0);q(this,qb,void 0);q(this,Kb,void 0);q(this,Ea,void 0);q(this,Va,void 0);q(this,Wa,void 0);q(this,Xa,void 0);q(this,nc,function(c){a.serialize=x("serialize",c,t.serialize);a.deserialize=x("deserialize",c,t.deserialize);a.getViewName=x("getViewName",c,t.getViewName);a.getViewUrl= -x("getViewUrl",c,t.getViewUrl);a.getSearchQuery=x("getSearchQuery",c,t.getSearchQuery);a.DeviceIdType=t.DeviceIdType;a.namespace=x("namespace",c,"");a.clearStoredId=x("clear_stored_id",c,!1);a.app_key=x("app_key",c,null);a.onload=x("onload",c,[]);a.utm=x("utm",c,{source:!0,medium:!0,campaign:!0,term:!0,content:!0});a.ignore_prefetch=x("ignore_prefetch",c,!0);a.rcAutoOptinAb=x("rc_automatic_optin_for_ab",c,!0);a.useExplicitRcApi=x("use_explicit_rc_api",c,!1);a.debug=x("debug",c,!1);a.test_mode=x("test_mode", -c,!1);a.test_mode_eq=x("test_mode_eq",c,!1);a.metrics=x("metrics",c,{});a.headers=x("headers",c,{});a.url=Ka(x("url",c,""));a.app_version=x("app_version",c,"0.0");a.country_code=x("country_code",c,null);a.city=x("city",c,null);a.ip_address=x("ip_address",c,null);a.ignore_bots=x("ignore_bots",c,!0);a.force_post=x("force_post",c,!1);a.remote_config=x("remote_config",c,!1);a.ignore_visitor=x("ignore_visitor",c,!1);a.require_consent=x("require_consent",c,!1);a.track_domains=A?x("track_domains",c,!0): -void 0;a.storage=x("storage",c,"default");a.enableOrientationTracking=A?x("enable_orientation_tracking",c,!0):void 0;a.maxKeyLength=x("max_key_length",c,128);a.maxValueSize=x("max_value_size",c,256);a.maxSegmentationValues=x("max_segmentation_values",c,100);a.maxBreadcrumbCount=x("max_breadcrumb_count",c,null);a.maxStackTraceLinesPerThread=x("max_stack_trace_lines_per_thread",c,30);a.maxStackTraceLineLength=x("max_stack_trace_line_length",c,200);a.heatmapWhitelist=x("heatmap_whitelist",c,[]);a.salt= -x("salt",c,null);a.hcErrorCount=b(B,a).call(a,Z.errorCount)||0;a.hcWarningCount=b(B,a).call(a,Z.warningCount)||0;a.hcStatusCode=b(B,a).call(a,Z.statusCode)||-1;a.hcErrorMessage=b(B,a).call(a,Z.errorMessage)||"";l(Wa,a,x("content_zone_timer_interval",c,null));b(Wa,a)&&l(qb,a,1E3*Math.max(b(Wa,a),15));b(sa,a)&&!a.maxBreadcrumbCount?(a.maxBreadcrumbCount=b(sa,a),b(e,a).call(a,f.WARNING,"initialize, 'maxCrashLogs' is deprecated. Use 'maxBreadcrumbCount' instead!")):b(sa,a)||a.maxBreadcrumbCount||(a.maxBreadcrumbCount= +ta,void 0);q(this,H,void 0);q(this,Ca,void 0);q(this,Da,void 0);q(this,fb,void 0);q(this,oa,void 0);q(this,Ua,void 0);q(this,ia,void 0);q(this,ua,void 0);q(this,pa,void 0);q(this,gb,void 0);q(this,I,void 0);q(this,hb,void 0);q(this,qb,void 0);q(this,Kb,void 0);q(this,Ea,void 0);q(this,Va,void 0);q(this,Wa,void 0);q(this,Xa,void 0);q(this,nc,function(c){a.serialize=y("serialize",c,t.serialize);a.deserialize=y("deserialize",c,t.deserialize);a.getViewName=y("getViewName",c,t.getViewName);a.getViewUrl= +y("getViewUrl",c,t.getViewUrl);a.getSearchQuery=y("getSearchQuery",c,t.getSearchQuery);a.DeviceIdType=t.DeviceIdType;a.namespace=y("namespace",c,"");a.clearStoredId=y("clear_stored_id",c,!1);a.app_key=y("app_key",c,null);a.onload=y("onload",c,[]);a.utm=y("utm",c,{source:!0,medium:!0,campaign:!0,term:!0,content:!0});a.ignore_prefetch=y("ignore_prefetch",c,!0);a.rcAutoOptinAb=y("rc_automatic_optin_for_ab",c,!0);a.useExplicitRcApi=y("use_explicit_rc_api",c,!1);a.debug=y("debug",c,!1);a.test_mode=y("test_mode", +c,!1);a.test_mode_eq=y("test_mode_eq",c,!1);a.metrics=y("metrics",c,{});a.headers=y("headers",c,{});a.url=Ka(y("url",c,""));a.app_version=y("app_version",c,"0.0");a.country_code=y("country_code",c,null);a.city=y("city",c,null);a.ip_address=y("ip_address",c,null);a.ignore_bots=y("ignore_bots",c,!0);a.force_post=y("force_post",c,!1);a.remote_config=y("remote_config",c,!1);a.ignore_visitor=y("ignore_visitor",c,!1);a.require_consent=y("require_consent",c,!1);a.track_domains=A?y("track_domains",c,!0): +void 0;a.storage=y("storage",c,"default");a.enableOrientationTracking=A?y("enable_orientation_tracking",c,!0):void 0;a.maxKeyLength=y("max_key_length",c,128);a.maxValueSize=y("max_value_size",c,256);a.maxSegmentationValues=y("max_segmentation_values",c,100);a.maxBreadcrumbCount=y("max_breadcrumb_count",c,null);a.maxStackTraceLinesPerThread=y("max_stack_trace_lines_per_thread",c,30);a.maxStackTraceLineLength=y("max_stack_trace_line_length",c,200);a.heatmapWhitelist=y("heatmap_whitelist",c,[]);a.salt= +y("salt",c,null);a.hcErrorCount=b(B,a).call(a,Z.errorCount)||0;a.hcWarningCount=b(B,a).call(a,Z.warningCount)||0;a.hcStatusCode=b(B,a).call(a,Z.statusCode)||-1;a.hcErrorMessage=b(B,a).call(a,Z.errorMessage)||"";l(Wa,a,y("content_zone_timer_interval",c,null));b(Wa,a)&&l(qb,a,1E3*Math.max(b(Wa,a),15));b(sa,a)&&!a.maxBreadcrumbCount?(a.maxBreadcrumbCount=b(sa,a),b(e,a).call(a,f.WARNING,"initialize, 'maxCrashLogs' is deprecated. Use 'maxBreadcrumbCount' instead!")):b(sa,a)||a.maxBreadcrumbCount||(a.maxBreadcrumbCount= 100);"cookie"===a.storage&&l(na,a,!1);a.rcAutoOptinAb||a.useExplicitRcApi||(b(e,a).call(a,f.WARNING,"initialize, Auto opting is disabled, switching to explicit RC API"),a.useExplicitRcApi=!0);Array.isArray(b(ba,a))||l(ba,a,[]);""===a.url&&(b(e,a).call(a,f.ERROR,"initialize, Please provide server URL"),a.ignore_visitor=!0);b(B,a).call(a,"cly_ignore")&&(a.ignore_visitor=!0);b(Pb,a).call(a);if(A)if(window.name&&0===window.name.indexOf("cly:"))try{a.passed_data=JSON.parse(window.name.replace("cly:",""))}catch(G){b(e, a).call(a,f.ERROR,"initialize, Could not parse name: "+window.name+", error: "+G)}else if(location.hash&&0===location.hash.indexOf("this.#cly:"))try{a.passed_data=JSON.parse(location.hash.replace("this.#cly:",""))}catch(G){b(e,a).call(a,f.ERROR,"initialize, Could not parse hash: "+location.hash+", error: "+G)}if((a.passed_data&&a.passed_data.app_key&&a.passed_data.app_key===a.app_key||a.passed_data&&!a.passed_data.app_key&&b(Ma,a))&&a.passed_data.token&&a.passed_data.purpose){a.passed_data.token!== b(B,a).call(a,"cly_old_token")&&(b(Yb,a).call(a,a.passed_data.token),b(z,a).call(a,"cly_old_token",a.passed_data.token));var d=[];Array.isArray(a.heatmapWhitelist)?(a.heatmapWhitelist.push(a.url),d=a.heatmapWhitelist.map(function(G){return Ka(G)})):d=[a.url];d.includes(a.passed_data.url)&&"heatmap"===a.passed_data.purpose&&(a.ignore_visitor=!0,ic(),hc(a.passed_data.url+"/views/heatmap.js",jc))}if(a.ignore_visitor)b(e,a).call(a,f.WARNING,"initialize, ignore_visitor:["+a.ignore_visitor+"], this user will not be tracked"); else{b(zc,a).call(a);l(K,a,b(B,a).call(a,"cly_queue")||[]);l(N,a,b(B,a).call(a,"cly_event")||[]);l(P,a,b(B,a).call(a,"cly_remote_configs")||{});d="[CLY]_temp_id"===b(B,a).call(a,"cly_id");a.clearStoredId&&(b(B,a).call(a,"cly_id")&&!d&&(a.device_id=b(B,a).call(a,"cly_id"),b(e,a).call(a,f.DEBUG,"initialize, temporarily using the previous device ID to flush existing events"),l(H,a,b(B,a).call(a,"cly_id_type")),b(H,a)||(b(e,a).call(a,f.DEBUG,"initialize, No device ID type info from the previous session, falling back to DEVELOPER_SUPPLIED, for event flushing"), l(H,a,0)),b(Fa,a).call(a),a.device_id=void 0,l(H,a,1)),b(e,a).call(a,f.INFO,"initialize, Clearing the device ID storage"),b(T,a).call(a,"cly_id"),b(T,a).call(a,"cly_id_type"),b(T,a).call(a,"cly_session"),d=!1);"javascript_native_web"===b(ua,a)&&"24.11.4"===b(pa,a)?b(e,a).call(a,f.DEBUG,"initialize, SDK name:["+b(ua,a)+"], version:["+b(pa,a)+"]"):b(e,a).call(a,f.DEBUG,"initialize, SDK name:["+b(ua,a)+"], version:["+b(pa,a)+"], default name:[javascript_native_web] and default version:[24.11.4]");b(e, -a).call(a,f.DEBUG,"initialize, app_key:["+a.app_key+"], url:["+a.url+"]");b(e,a).call(a,f.DEBUG,"initialize, device_id:["+x("device_id",c,void 0)+"]");b(e,a).call(a,f.DEBUG,"initialize, require_consent is enabled:["+a.require_consent+"]");try{b(e,a).call(a,f.DEBUG,"initialize, metric override:["+JSON.stringify(a.metrics)+"]"),b(e,a).call(a,f.DEBUG,"initialize, header override:["+JSON.stringify(a.headers)+"]"),b(e,a).call(a,f.DEBUG,"initialize, number of onload callbacks provided:["+a.onload.length+ +a).call(a,f.DEBUG,"initialize, app_key:["+a.app_key+"], url:["+a.url+"]");b(e,a).call(a,f.DEBUG,"initialize, device_id:["+y("device_id",c,void 0)+"]");b(e,a).call(a,f.DEBUG,"initialize, require_consent is enabled:["+a.require_consent+"]");try{b(e,a).call(a,f.DEBUG,"initialize, metric override:["+JSON.stringify(a.metrics)+"]"),b(e,a).call(a,f.DEBUG,"initialize, header override:["+JSON.stringify(a.headers)+"]"),b(e,a).call(a,f.DEBUG,"initialize, number of onload callbacks provided:["+a.onload.length+ "]"),b(e,a).call(a,f.DEBUG,"initialize, utm tags:["+JSON.stringify(a.utm)+"]"),b(ba,a)&&b(e,a).call(a,f.DEBUG,"initialize, referrers to ignore :["+JSON.stringify(b(ba,a))+"]"),b(e,a).call(a,f.DEBUG,"initialize, salt given:["+!!a.salt+"]")}catch(G){b(e,a).call(a,f.ERROR,"initialize, Could not stringify some config object values")}b(e,a).call(a,f.DEBUG,"initialize, app_version:["+a.app_version+"]");b(e,a).call(a,f.DEBUG,"initialize, provided location info; country_code:["+a.country_code+"], city:["+ a.city+"], ip_address:["+a.ip_address+"]");""!==a.namespace&&b(e,a).call(a,f.DEBUG,"initialize, namespace given:["+a.namespace+"]");a.clearStoredId&&b(e,a).call(a,f.DEBUG,"initialize, clearStoredId flag set to:["+a.clearStoredId+"]");a.ignore_prefetch&&b(e,a).call(a,f.DEBUG,"initialize, ignoring pre-fetching and pre-rendering from counting as real website visits :["+a.ignore_prefetch+"]");a.test_mode&&b(e,a).call(a,f.WARNING,"initialize, test_mode:["+a.test_mode+"], request queue won't be processed"); a.test_mode_eq&&b(e,a).call(a,f.WARNING,"initialize, test_mode_eq:["+a.test_mode_eq+"], event queue won't be processed");a.heatmapWhitelist&&b(e,a).call(a,f.DEBUG,"initialize, heatmap whitelist:["+JSON.stringify(a.heatmapWhitelist)+"], these domains will be whitelisted");"default"!==a.storage&&b(e,a).call(a,f.DEBUG,"initialize, storage is set to:["+a.storage+"]");a.ignore_bots&&b(e,a).call(a,f.DEBUG,"initialize, ignore traffic from bots :["+a.ignore_bots+"]");a.force_post&&b(e,a).call(a,f.DEBUG,"initialize, forced post method for all requests:["+ @@ -40,10 +40,10 @@ a)+"]");b(e,a).call(a,f.DEBUG,"initialize, 'getViewName' callback override provi b(e,a).call(a,f.DEBUG,"initialize, maxSegmentationValues set to:["+a.maxSegmentationValues+"] key/value pairs");100!==a.maxBreadcrumbCount&&b(e,a).call(a,f.DEBUG,"initialize, maxBreadcrumbCount for custom logs set to:["+a.maxBreadcrumbCount+"] entries");30!==a.maxStackTraceLinesPerThread&&b(e,a).call(a,f.DEBUG,"initialize, maxStackTraceLinesPerThread set to:["+a.maxStackTraceLinesPerThread+"] lines");200!==a.maxStackTraceLineLength&&b(e,a).call(a,f.DEBUG,"initialize, maxStackTraceLineLength set to:["+ a.maxStackTraceLineLength+"] characters");500!==b(Oa,a)&&b(e,a).call(a,f.DEBUG,"initialize, interval for heartbeats set to:["+b(Oa,a)+"] milliseconds");1E3!==b(Pa,a)&&b(e,a).call(a,f.DEBUG,"initialize, queue_size set to:["+b(Pa,a)+"] items max");60!==b(Qa,a)&&b(e,a).call(a,f.DEBUG,"initialize, fail_timeout set to:["+b(Qa,a)+"] seconds of wait time after a failed connection to server");20!==b(za,a)&&b(e,a).call(a,f.DEBUG,"initialize, inactivity_time set to:["+b(za,a)+"] minutes to consider a user as inactive after no observable action"); 60!==b(Ra,a)&&b(e,a).call(a,f.DEBUG,"initialize, session_update set to:["+b(Ra,a)+"] seconds to check if extending a session is needed while the user is active");100!==b(Aa,a)&&b(e,a).call(a,f.DEBUG,"initialize, max_events set to:["+b(Aa,a)+"] events to send in one batch");b(sa,a)&&b(e,a).call(a,f.WARNING,"initialize, max_logs set to:["+b(sa,a)+"] breadcrumbs to store for crash logs max, deprecated ");30!==b(Ba,a)&&b(e,a).call(a,f.DEBUG,"initialize, session_cookie_timeout set to:["+b(Ba,a)+"] minutes to expire a cookies session"); -var g=null,h=a.getSearchQuery(),n=!1,k={};if(h){0===h.indexOf("?")&&(h=h.substring(1));h=h.split("&");for(var r=0;r=a.maxBreadcrumbCount;)b(la,a).shift(),b(e,a).call(a,f.WARNING,"add_log, Reached maximum crashLogs size. Will erase the oldest one.");b(la,a).push(c)}});w(this,"fetch_remote_config",function(c,d,g){var h=null,n=null,k=null;c&&(g||"function"!==typeof c?Array.isArray(c)&&(h=c):k=c);d&&(g||"function"!==typeof d?Array.isArray(d)&&(n=d):k=d);k|| "function"!==typeof g||(k=g);a.useExplicitRcApi?(b(e,a).call(a,f.INFO,"fetch_remote_config, Fetching remote config"),c=a.rcAutoOptinAb?1:0,b(Nb,a).call(a,h,n,c,null,k)):(b(e,a).call(a,f.WARNING,"fetch_remote_config, Fetching remote config, with legacy API"),b(Nb,a).call(a,h,n,null,"legacy",k))});q(this,Nb,function(c,d,g,h,n){b(e,a).call(a,f.INFO,"fetch_remote_config_explicit, Fetching sequence initiated");var k={method:"rc",av:a.app_version};c&&(k.keys=JSON.stringify(c));d&&(k.omit_keys=JSON.stringify(d)); -var r;"legacy"===h&&(k.method="fetch_remote_config");0===g&&(k.oi=0);1===g&&(k.oi=1);"function"===typeof n&&(r=n);a.check_consent("sessions")&&(k.metrics=JSON.stringify(b(jb,a).call(a)));a.check_consent("remote-config")?(b(Ga,a).call(a,k),b(ea,a).call(a,"fetch_remote_config_explicit",a.url+b(Na,a),k,function(u,y,G){if(!u){try{var U=JSON.parse(G);if(k.keys||k.omit_keys)for(var J in U)b(P,a)[J]=U[J];else l(P,a,U);b(z,a).call(a,"cly_remote_configs",b(P,a))}catch(Ya){b(e,a).call(a,f.ERROR,"fetch_remote_config_explicit, Had an issue while parsing the response: "+ +var r;"legacy"===h&&(k.method="fetch_remote_config");0===g&&(k.oi=0);1===g&&(k.oi=1);"function"===typeof n&&(r=n);a.check_consent("sessions")&&(k.metrics=JSON.stringify(b(jb,a).call(a)));a.check_consent("remote-config")?(b(Ga,a).call(a,k),b(ea,a).call(a,"fetch_remote_config_explicit",a.url+b(Na,a),k,function(u,x,G){if(!u){try{var U=JSON.parse(G);if(k.keys||k.omit_keys)for(var J in U)b(P,a)[J]=U[J];else l(P,a,U);b(z,a).call(a,"cly_remote_configs",b(P,a))}catch(Ya){b(e,a).call(a,f.ERROR,"fetch_remote_config_explicit, Had an issue while parsing the response: "+ Ya)}r&&(b(e,a).call(a,f.INFO,"fetch_remote_config_explicit, Callback function is provided"),r(u,b(P,a)))}},!0)):(b(e,a).call(a,f.ERROR,"fetch_remote_config_explicit, Remote config requires explicit consent"),r&&r(Error("Remote config requires explicit consent"),b(P,a)))});w(this,"enrollUserToAb",function(c){b(e,a).call(a,f.INFO,"enrollUserToAb, Providing AB test keys to opt in for");c&&Array.isArray(c)&&0!==c.length?(c={method:"ab",keys:JSON.stringify(c),av:a.app_version},b(Ga,a).call(a,c),b(ea,a).call(a, "enrollUserToAb",a.url+b(Na,a),c,function(d,g,h){if(!d)try{var n=JSON.parse(h);b(e,a).call(a,f.DEBUG,"enrollUserToAb, Parsed the response's result: ["+n.result+"]")}catch(k){b(e,a).call(a,f.ERROR,"enrollUserToAb, Had an issue while parsing the response: "+k)}},!0)):b(e,a).call(a,f.ERROR,"enrollUserToAb, No keys provided")});w(this,"get_remote_config",function(c){b(e,a).call(a,f.INFO,"get_remote_config, Getting remote config from storage");return"undefined"!==typeof c?b(P,a)[c]:b(P,a)});q(this,Ob, function(){b(e,a).call(a,f.INFO,"stop_time, Stopping tracking duration");b(ma,a)&&(l(ma,a,!1),l(db,a,M()-b(fa,a)),l(ya,a,M()-b(xa,a)))});q(this,rb,function(){b(e,a).call(a,f.INFO,"start_time, Starting tracking duration");b(ma,a)||(l(ma,a,!0),l(fa,a,M()-b(db,a)),l(xa,a,M()-b(ya,a)),l(ya,a,0),b(Tb,a).call(a))});w(this,"track_sessions",function(){if(A){b(e,a).call(a,f.INFO,"track_session, Starting tracking user session");a.begin_session();b(rb,a).call(a);D(window,"beforeunload",function(){b(Ha,a).call(a); @@ -100,7 +100,7 @@ c=c||document,D(c,"click",function(d){a:{var g=mb(d);var h;for(h="A";g;){if(g.no !!c+"] Tracking hidden inputs :["+!!d+"]");c=c||document;var g=function(h){return h.name||h.id||h.type||h.nodeName};D(c,"submit",function(h){h=mb(h);var n={id:h.attributes.id&&h.attributes.id.nodeValue,name:h.attributes.name&&h.attributes.name.nodeValue,action:h.attributes.action&&h.attributes.action.nodeValue,method:h.attributes.method&&h.attributes.method.nodeValue,view:a.getViewUrl()},k;if("undefined"!==typeof h.elements){for(var r=0;r'),a.initializeRatingWidgets(c)):b(e,a).call(a,f.ERROR,"enableRatingWidgets, You should provide at least one widget id as param. Read documentation for more detail. https://resources.count.ly/plugins/feedback")))): b(e,a).call(a,f.WARNING,"enableRatingWidgets, window object is not available. Not enabling rating widgets.")});q(this,sb,function(c,d){b(e,a).call(a,f.INFO,"showWidget, Showing ".concat(c," widget, nameIDorTag:[").concat(d,"]"));a.get_available_feedback_widgets(function(g,h){h?b(e,a).call(a,f.ERROR,"showWidget, Error while getting feedback widgets list: ".concat(h)):(h=g.find(function(n){return n.type===c}),d&&"string"===typeof d&&(g=g.find(function(n){return n.type===c&&(n.name===d||n._id===d||n.tg.includes(d))}))&& (h=g,b(e,a).call(a,f.VERBOSE,"showWidget, Found ".concat(c," widget by name, id, or tag: [").concat(JSON.stringify(g),"]"))),h?a.present_feedback_widget(h,null,null,null):b(e,a).call(a,f.ERROR,"showWidget, No ".concat(c," widget found.")))})});w(this,"feedback",{showNPS:function(c){return b(sb,a).call(a,"nps",c)},showSurvey:function(c){return b(sb,a).call(a,"survey",c)},showRating:function(c){return b(sb,a).call(a,"rating",c)}});w(this,"get_available_feedback_widgets",function(c){b(e,a).call(a,f.INFO, "get_available_feedback_widgets, Getting the feedback list, callback function is provided:["+!!c+"]");if(a.check_consent("feedback"))if(b(L,a))b(e,a).call(a,f.ERROR,"get_available_feedback_widgets, Cannot enable feedback widgets in offline mode.");else{var d=a.url+b(Na,a),g={method:"feedback",device_id:a.device_id,app_key:a.app_key,av:a.app_version};b(ea,a).call(a,"get_available_feedback_widgets,",d,g,function(h,n,k){if(h)c&&c(null,h);else try{var r=JSON.parse(k).result||[];c&&c(r,null)}catch(u){b(e, a).call(a,f.ERROR,"get_available_feedback_widgets, Error while parsing feedback widgets list: "+u),c&&c(null,u)}},!1)}else c&&c(null,Error("Consent for feedback not provided."))});w(this,"getFeedbackWidgetData",function(c,d){if(c.type)if(b(e,a).call(a,f.INFO,"getFeedbackWidgetData, Retrieving data for: ["+JSON.stringify(c)+"], callback function is provided:["+!!d+"]"),a.check_consent("feedback"))if(b(L,a))b(e,a).call(a,f.ERROR,"getFeedbackWidgetData, Cannot enable feedback widgets in offline mode."); -else{var g=a.url,h={widget_id:c._id,shown:1,sdk_version:b(pa,a),sdk_name:b(ua,a),platform:a.platform,app_version:a.app_version};if("nps"===c.type)g+="/o/surveys/nps/widget";else if("survey"===c.type)g+="/o/surveys/survey/widget";else if("rating"===c.type)g+="/o/surveys/rating/widget";else{b(e,a).call(a,f.ERROR,"getFeedbackWidgetData, Unknown type info: ["+c.type+"]");return}b(ea,a).call(a,"getFeedbackWidgetData,",g,h,n,!0);var n=function(k,r,u){if(k)d&&d(null,k);else try{var y=JSON.parse(u);d&&d(y, +else{var g=a.url,h={widget_id:c._id,shown:1,sdk_version:b(pa,a),sdk_name:b(ua,a),platform:a.platform,app_version:a.app_version};if("nps"===c.type)g+="/o/surveys/nps/widget";else if("survey"===c.type)g+="/o/surveys/survey/widget";else if("rating"===c.type)g+="/o/surveys/rating/widget";else{b(e,a).call(a,f.ERROR,"getFeedbackWidgetData, Unknown type info: ["+c.type+"]");return}b(ea,a).call(a,"getFeedbackWidgetData,",g,h,n,!0);var n=function(k,r,u){if(k)d&&d(null,k);else try{var x=JSON.parse(u);d&&d(x, null)}catch(G){b(e,a).call(a,f.ERROR,"getFeedbackWidgetData, Error while parsing feedback widgets list: "+G),d&&d(null,G)}}}else d&&d(null,Error("Consent for feedback not provided."));else b(e,a).call(a,f.ERROR,"getFeedbackWidgetData, Expected the provided widget object to have a type but got: ["+JSON.stringify(c)+"], aborting.")});w(this,"present_feedback_widget",function(c,d,g,h){if(A){if(b(e,a).call(a,f.INFO,"present_feedback_widget, Presenting the feedback widget by appending to the element with ID: [ "+ d+" ] and className: [ "+g+" ]"),a.check_consent("feedback"))if(!c||"object"!==R(c)||Array.isArray(c))b(e,a).call(a,f.ERROR,"present_feedback_widget, Please provide at least one feedback widget object.");else{b(e,a).call(a,f.INFO,"present_feedback_widget, Adding segmentation to feedback widgets:["+JSON.stringify(h)+"]");h&&"object"===R(h)&&0!==Object.keys(h).length||(b(e,a).call(a,f.DEBUG,"present_feedback_widget, Segmentation is not an object or empty"),h=null);try{var n=a.url;if("nps"===c.type)b(e, a).call(a,f.DEBUG,"present_feedback_widget, Widget type: nps."),n+="/feedback/nps";else if("survey"===c.type)b(e,a).call(a,f.DEBUG,"present_feedback_widget, Widget type: survey."),n+="/feedback/survey";else if("rating"===c.type)b(e,a).call(a,f.DEBUG,"present_feedback_widget, Widget type: rating."),n+="/feedback/rating";else{b(e,a).call(a,f.ERROR,"present_feedback_widget, Feedback widget only accepts nps, rating and survey types.");return}var k=window.origin||window.location.origin;if("rating"===c.type){b(e, a).call(a,f.DEBUG,"present_feedback_widget, Loading css for rating widget.");var r="ratings";ob(a.url+"/star-rating/stylesheets/countly-feedback-web.css")}else b(e,a).call(a,f.DEBUG,"present_feedback_widget, Loading css for survey or nps."),ob(a.url+"/surveys/stylesheets/countly-surveys.css"),r="surveys";n+="?widget_id="+c._id;n+="&app_key="+a.app_key;n+="&device_id="+a.device_id;n+="&sdk_name="+b(ua,a);n+="&platform="+a.platform;n+="&app_version="+a.app_version;n+="&sdk_version="+b(pa,a);var u={tc:1}; -h&&(u.sg=h);n+="&custom="+JSON.stringify(u);n+="&origin="+k;n+="&widget_v=web";var y=document.createElement("iframe");y.src=n;y.name="countly-"+r+"-iframe";y.id="countly-"+r+"-iframe";var G=!1;y.onload=function(){G&&(document.getElementById("countly-"+r+"-wrapper-"+c._id).style.display="none",document.getElementById("csbg").style.display="none");G=!0;b(e,a).call(a,f.DEBUG,"present_feedback_widget, Loaded iframe.")};for(var U=document.getElementById("csbg");U;)U.remove(),U=document.getElementById("csbg"), +h&&(u.sg=h);n+="&custom="+JSON.stringify(u);n+="&origin="+k;n+="&widget_v=web";var x=document.createElement("iframe");x.src=n;x.name="countly-"+r+"-iframe";x.id="countly-"+r+"-iframe";var G=!1;x.onload=function(){G&&(document.getElementById("countly-"+r+"-wrapper-"+c._id).style.display="none",document.getElementById("csbg").style.display="none");G=!0;b(e,a).call(a,f.DEBUG,"present_feedback_widget, Loaded iframe.")};for(var U=document.getElementById("csbg");U;)U.remove(),U=document.getElementById("csbg"), b(e,a).call(a,f.DEBUG,"present_feedback_widget, Removing past overlay.");var J=document.getElementsByClassName("countly-"+r+"-wrapper");for(h=0;h');Ya.appendChild(J);if("rating"===c.type){var $b=document.createElement("div");$b.className="countly-ratings-overlay";$b.id="countly-ratings-overlay-"+c._id;J.appendChild($b);b(e,a).call(a,f.DEBUG,"present_feedback_widget, appended the rating overlay to wrapper"); -D(document.getElementById("countly-ratings-overlay-"+c._id),"click",function(){document.getElementById("countly-ratings-wrapper-"+c._id).style.display="none"})}J.appendChild(y);b(e,a).call(a,f.DEBUG,"present_feedback_widget, Appended the iframe");D(window,"message",function(E){var V={};try{V=JSON.parse(E.data)}catch(Ic){b(e,a).call(a,f.ERROR,"present_feedback_widget, Error while parsing message body "+Ic)}!0===V.close&&(b(e,a).call(a,f.DEBUG,"present_feedback_widget, Received message from widget with origin: ["+ +D(document.getElementById("countly-ratings-overlay-"+c._id),"click",function(){document.getElementById("countly-ratings-wrapper-"+c._id).style.display="none"})}J.appendChild(x);b(e,a).call(a,f.DEBUG,"present_feedback_widget, Appended the iframe");D(window,"message",function(E){var V={};try{V=JSON.parse(E.data)}catch(Ic){b(e,a).call(a,f.ERROR,"present_feedback_widget, Error while parsing message body "+Ic)}!0===V.close&&(b(e,a).call(a,f.DEBUG,"present_feedback_widget, Received message from widget with origin: ["+ E.origin+"] and data: ["+E.data+"]"),document.getElementById("countly-"+r+"-wrapper-"+c._id).style.display="none",document.getElementById("csbg").style.display="none",b(e,a).call(a,f.DEBUG,"present_feedback_widget, Closed the widget"))});var Ia=function(E){document.getElementById("countly-surveys-wrapper-"+E._id).style.display="block";document.getElementById("csbg").style.display="block"},Dc=function(E){for(var V=document.getElementsByClassName("countly-feedback-sticker");0E.appearance.text_color.length?"#"+E.appearance.text_color:E.appearance.text_color,V.style.backgroundColor=7>E.appearance.bg_color.length?"#"+E.appearance.bg_color:E.appearance.bg_color,V.className="countly-feedback-sticker "+E.appearance.position+ "-"+E.appearance.size,V.id="countly-feedback-sticker-"+E._id,document.body.appendChild(V),D(document.getElementById("countly-feedback-sticker-"+E._id),"click",function(){document.getElementById("countly-ratings-wrapper-"+E._id).style.display="flex";document.getElementById("csbg").style.display="block"}));D(document.getElementById("countly-feedback-close-icon-"+E._id),"click",function(){document.getElementById("countly-ratings-wrapper-"+E._id).style.display="none";document.getElementById("csbg").style.display= @@ -147,15 +147,16 @@ A&&(h._background=!document.hasFocus());0=h.height&&(g=c.geo.l);d.style.left=g.x+"px";d.style.top=g.y+"px";d.style.width= -g.w+"px";d.style.height=g.h+"px";d.style.border="none";d.style.zIndex="999999";document.body.appendChild(d)}else b(e,a).call(a,f.DEBUG,"displayContent, no content to display")});q(this,qc,function(c){if(c.origin===a.url){b(e,a).call(a,f.DEBUG,"sendContentRequest, Received message from: ["+c.origin+"] with data: ["+JSON.stringify(c.data)+"]");var d=c.data;c=d.close;var g=d.link,h=d.event;d=d.resize_me;if(h){b(e,a).call(a,f.DEBUG,"sendContentRequest, Received event");1===c&&(b(e,a).call(a,f.DEBUG,"sendContentRequest, Closing content frame for event"), -b(tb,a).call(a));if(!Array.isArray(h)){if("object"===R(h))throw new TypeError('"event" is read-only');b(e,a).call(a,f.ERROR,"sendContentRequest, Invalid event type: ["+R(h)+"]");return}for(var n=0;n=h.height&&(g=d.l),d=document.getElementById(b(Xa,a)),d.style.left=g.x+"px",d.style.top=g.y+"px",d.style.width=g.w+"px",d.style.height=g.h+"px");1===c&&b(tb,a).call(a)}});q(this,tb,function(){var c=document.getElementById(b(Xa,a));c&&(c.remove(),b(e,a).call(a,f.DEBUG,"sendContentRequest, removed iframe"),b(Ea,a)&&b(Qb,a).call(a,!0))});q(this,Fa,function(){0c.trigger_font_color.length?"#"+c.trigger_font_color:c.trigger_font_color;y.style.backgroundColor=7>c.trigger_bg_color.length?"#"+c.trigger_bg_color:c.trigger_bg_color;y.className="countly-feedback-sticker "+c.trigger_position+"-"+c.trigger_size;y.id="countly-feedback-sticker-"+c._id;k.appendChild(r);y.appendChild(k);y.appendChild(u);document.body.appendChild(y);var G=document.getElementById("smileyPathInStickerSvg"); +cly_ws:1,cly_origin:window.location.origin};b(Ga,a).call(a,d);return d});q(this,Rb,function(){b(e,a).call(a,f.DEBUG,"sendContentRequest, sending content request");var c=b(oc,a).call(a);b(ea,a).call(a,"sendContentRequest,",a.url+b(Kb,a),c,function(d,g,h){if(!d)if(h){try{var n=JSON.parse(h)}catch(r){b(e,a).call(a,f.VERBOSE,"sendContentRequest, No content to display or an error while parsing content: "+r);return}if(n.html&&n.geo){b(pc,a).call(a,n);clearInterval(b(Va,a));window.addEventListener("message", +function(r){b(qc,a).call(a,r)});var k;window.addEventListener("resize",function(){clearTimeout(k);k=setTimeout(function(){var r=window.innerWidth,u=window.innerHeight,x=document.getElementById(b(Xa,a));x&&x.contentWindow.postMessage({type:"resize",width:r,height:u},"*")},200)})}else b(e,a).call(a,f.VERBOSE,"sendContentRequest, no html content or orientation to display")}else b(e,a).call(a,f.VERBOSE,"sendContentRequest, no content to display")},!0)});q(this,pc,function(c){try{var d=document.createElement("iframe"); +d.id=b(Xa,a);d.src=c.html;d.style.position="absolute";var g=c.geo.p,h=b(kb,a).call(a,!0);h.width>=h.height&&(g=c.geo.l);d.style.left=g.x+"px";d.style.top=g.y+"px";d.style.width=g.w+"px";d.style.height=g.h+"px";d.style.border="none";d.style.zIndex="999999";document.body.appendChild(d)}catch(n){b(e,a).call(a,f.ERROR,"displayContent, Error while creating iframe for the content: "+n)}});q(this,qc,function(c){if(c.origin===a.url){b(e,a).call(a,f.DEBUG,"interpretContentMessage, Received message from: ["+ +c.origin+"] with data: ["+JSON.stringify(c.data)+"]");var d=c.data;c=d.close;var g=d.link,h=d.event;d=d.resize_me;if(h){b(e,a).call(a,f.DEBUG,"interpretContentMessage, Received event");1===c&&(b(e,a).call(a,f.DEBUG,"interpretContentMessage, Closing content frame for event"),b(tb,a).call(a));if(!Array.isArray(h)){if("object"===R(h))throw new TypeError('"event" is read-only');b(e,a).call(a,f.ERROR,"interpretContentMessage, Invalid event type: ["+R(h)+"]");return}for(var n=0;n=h.height&&(g= +d.l);d=document.getElementById(b(Xa,a));d.style.left=g.x+"px";d.style.top=g.y+"px";d.style.width=g.w+"px";d.style.height=g.h+"px"}1===c&&b(tb,a).call(a)}});q(this,tb,function(){var c=document.getElementById(b(Xa,a));c&&(c.remove(),b(e,a).call(a,f.DEBUG,"interpretContentMessage, removed iframe"),b(Ea,a)&&b(Qb,a).call(a,!0))});q(this,Fa,function(){0c.trigger_font_color.length?"#"+c.trigger_font_color:c.trigger_font_color;x.style.backgroundColor=7>c.trigger_bg_color.length?"#"+c.trigger_bg_color:c.trigger_bg_color;x.className="countly-feedback-sticker "+c.trigger_position+"-"+c.trigger_size;x.id="countly-feedback-sticker-"+c._id;k.appendChild(r);x.appendChild(k);x.appendChild(u);document.body.appendChild(x);var G=document.getElementById("smileyPathInStickerSvg"); G&&(G.style.fill=7>c.trigger_font_color.length?"#"+c.trigger_font_color:c.trigger_font_color);D(document.getElementById("countly-feedback-sticker-"+c._id),"click",function(){document.getElementById("countly-iframe-wrapper-"+c._id).style.display="block";document.getElementById("cfbg").style.display="block"})}else document.getElementById("countly-iframe-wrapper-"+c._id).style.display="block",document.getElementById("cfbg").style.display="block"}catch(U){b(e,a).call(a,f.ERROR,"Somethings went wrong while element injecting process: "+ U)}else b(e,a).call(a,f.WARNING,"processWidget, window object is not available. Not processing widget.")});q(this,Sb,function(){var c;if("undefined"!==typeof a.onload&&0c))return b(e,a).call(a,f.ERROR,"Http response status code:["+c+"] is not within the expected range"),!1;try{var g=JSON.parse(d);return"[object Object]"!==Object.prototype.toString.call(g)?(b(e,a).call(a,f.ERROR,"Http response is not JSON Object"),!1):!!g.result}catch(h){return b(e,a).call(a,f.ERROR,"Http response is not JSON: "+h),!1}});q(this,zb,function(c,d){if(!(200<=c&&300>c))return b(e,a).call(a,f.ERROR,"Http response status code:["+c+"] is not within the expected range"), !1;try{var g=JSON.parse(d);return"[object Object]"===Object.prototype.toString.call(g)||Array.isArray(g)?!0:(b(e,a).call(a,f.ERROR,"Http response is not JSON Object nor JSON Array"),!1)}catch(h){return b(e,a).call(a,f.ERROR,"Http response is not JSON: "+h),!1}});q(this,Xb,function(){A?l(Da,a,Math.max(b(Da,a),window.scrollY,document.body.scrollTop,document.documentElement.scrollTop)):b(e,a).call(a,f.WARNING,"processScroll, window object is not available. Not processing scroll.")});q(this,Ab,function(){if(!A)b(e, @@ -190,9 +191,9 @@ getInternalDeviceIdType:b(uc,this),getMsTimestamp:Eb,getTimestamp:M,isResponseVa showLoader:ic,hideLoader:jc,setValueInStorage:b(z,this),getValueFromStorage:b(B,this),removeValueFromStorage:b(T,this),add_cly_events:b(Y,this),processScrollView:b(Ab,this),processScroll:b(Xb,this),currentUserAgentString:La,currentUserAgentDataString:Hb,userAgentDeviceDetection:dc,userAgentSearchBotDetection:ec,getRequestQueue:b(xc,this),getEventQueue:b(wc,this),sendFetchRequest:b(Wb,this),processAsyncQueue:b(Ha,this),makeNetworkRequest:b(ea,this),onStorageChange:b(Ac,this),clearQueue:b(Bc,this), getLocalQueues:b(Cc,this),testingGetRequests:b(sc,this)});q(this,qa,{sendInstantHCRequest:function(){if(b(L,a))b(e,a).call(a,f.DEBUG,"sendInstantHCRequest, Offline mode is active. Not sending health check request."),l(gb,a,!0);else{var c=C(a.hcErrorMessage,1E3,"healthCheck",b(e,a));""!==c&&(c=JSON.stringify(c));c={hc:JSON.stringify({el:a.hcErrorCount,wl:a.hcWarningCount,sc:a.hcStatusCode,em:c}),metrics:JSON.stringify({_app_version:a.app_version})};b(Ga,a).call(a,c);b(ea,a).call(a,"[healthCheck]", a.url+b(bb,a),c,function(d){d||b(qa,a).resetAndSaveCounters()},!0)}},resetAndSaveCounters:function(){b(qa,a).resetCounters();b(z,a).call(a,Z.errorCount,a.hcErrorCount);b(z,a).call(a,Z.warningCount,a.hcWarningCount);b(z,a).call(a,Z.statusCode,a.hcStatusCode);b(z,a).call(a,Z.errorMessage,a.hcErrorMessage)},incrementErrorCount:function(){a.hcErrorCount++},incrementWarningCount:function(){a.hcWarningCount++},resetCounters:function(){a.hcErrorCount=0;a.hcWarningCount=0;a.hcStatusCode=-1;a.hcErrorMessage= -""},saveRequestCounters:function(c,d){a.hcStatusCode=c;a.hcErrorMessage=d;b(z,a).call(a,Z.statusCode,a.hcStatusCode);b(z,a).call(a,Z.errorMessage,a.hcErrorMessage)}});l(mc,this,this);l(Ma,this,!t.i);l(X,this,!1);l(bb,this,"/i");l(Na,this,"/o/sdk");l(Oa,this,x("interval",p,500));l(Pa,this,x("queue_size",p,1E3));l(K,this,[]);l(N,this,[]);l(P,this,{});l(la,this,[]);l(aa,this,{});l(ba,this,x("ignore_referrers",p,[]));l(cb,this,null);l(wa,this,!0);b(fa,this);l(db,this,0);l(S,this,null);l(xa,this,0);l(ya, -this,0);l(eb,this,0);l(Qa,this,x("fail_timeout",p,60));l(za,this,x("inactivity_time",p,20));l(ra,this,0);l(Ra,this,x("session_update",p,60));l(Aa,this,x("max_events",p,100));l(sa,this,x("max_logs",p,null));l(ha,this,x("use_session_cookie",p,!0));l(Ba,this,x("session_cookie_timeout",p,30));l(Sa,this,!0);l(Ta,this,!1);l(L,this,x("offline_mode",p,!1));l(ca,this,{});l(ma,this,!0);l(pb,this,M());l(na,this,!0);l(ta,this,null);l(H,this,1);l(Ca,this,!1);l(Da,this,0);l(fb,this,!1);l(oa,this,null);l(Ua,this, -null);l(ia,this,null);l(ua,this,x("sdk_name",p,"javascript_native_web"));l(pa,this,x("sdk_version",p,"24.11.4"));l(gb,this,!1);l(hb,this,[]);l(qb,this,3E4);l(Kb,this,"/o/sdk/content");l(Ea,this,!1);l(Va,this,null);l(Xa,this,"cly-content-iframe");try{localStorage.setItem("cly_testLocal",!0),localStorage.removeItem("cly_testLocal")}catch(c){b(e,this).call(this,f.ERROR,"Local storage test failed, Halting local storage support: "+c),l(na,this,!1)}l(I,this,{});for(var F=0;F