const t="cookieStorage",e="localStorage",r="memoryStorage",n=t=>"function"==typeof t&&Boolean(t.constructor&&t.call&&t.apply),o=t=>"string"==typeof t,a=t=>null===t,i=t=>void 0===t,u=t=>a(t)||i(t),c=t=>!i(t),s=t=>!u(t),l=t=>"boolean"==typeof t,f=t=>t.replace(/\/{2,}/g,"/");for(var y,p=[],h=0;h<256;h++)p[h]=(h+256).toString(16).substring(1);function g(){var t;(!y||h+16>4096)&&(t=4096,y=crypto.getRandomValues(new Uint8Array(t)),h=0);for(var e,r=0,n="";r<16;r++)e=y[h+r],n+=6==r?p[15&e|64]:8==r?p[63&e|128]:p[e],1&r&&r>1&&r<11&&(n+="-");return h+=16,n}for(var b,d=256,v=[];d--;)v[d]=(d+256).toString(16).substring(1);const m=()=>!u(globalThis.crypto)&&n(globalThis.crypto.getRandomValues)?g():function(){var t,e=0,r="";if(!b||d+16>256){for(b=Array(e=256);e--;)b[e]=256*Math.random()|0;e=d=0}for(;e<16;e++)t=b[d+e],r+=6==e?v[15&t|64]:8==e?v[63&t|128]:v[t],1&e&&e>1&&e<11&&(r+="-");return d++,r}(),O=t=>429===t||!(t>=400&&t<500),A=t=>{let e=t;if(!o(t)&&!u(t))try{e=JSON.stringify(t)}catch(t){e=null}return e},j=t=>(t=>{const e=Array.from(t,(t=>String.fromCodePoint(t))).join("");return globalThis.btoa(e)})((new TextEncoder).encode(t)),w=t=>(new TextDecoder).decode((t=>{const e=globalThis.atob(t).split("").map((t=>t.charCodeAt(0)));return new Uint8Array(e)})(t)),S=":: ";function E(t){return null!=t&&"object"==typeof t&&!0===t["@@functional/placeholder"]}function P(t){return function e(r){return 0===arguments.length||E(r)?e:t.apply(this,arguments)}}function T(t){return function e(r,n){switch(arguments.length){case 0:return e;case 1:return E(r)?e:P((function(e){return t(r,e)}));default:return E(r)&&E(n)?e:E(r)?P((function(e){return t(e,n)})):E(n)?P((function(e){return t(r,e)})):t(r,n)}}}function U(t){return function e(r,n,o){switch(arguments.length){case 0:return e;case 1:return E(r)?e:T((function(e,n){return t(r,e,n)}));case 2:return E(r)&&E(n)?e:E(r)?T((function(e,r){return t(e,n,r)})):E(n)?T((function(e,n){return t(r,e,n)})):P((function(e){return t(r,n,e)}));default:return E(r)&&E(n)&&E(o)?e:E(r)&&E(n)?T((function(e,r){return t(e,r,o)})):E(r)&&E(o)?T((function(e,r){return t(e,n,r)})):E(n)&&E(o)?T((function(e,n){return t(r,e,n)})):E(r)?P((function(e){return t(e,n,o)})):E(n)?P((function(e){return t(r,e,o)})):E(o)?P((function(e){return t(r,n,e)})):t(r,n,o)}}}function R(t,e){return Object.prototype.hasOwnProperty.call(e,t)}var C=P((function(t){return null===t?"Null":void 0===t?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}));function $(t){return"[object Object]"===Object.prototype.toString.call(t)}function D(t,e,r){if(r||(r=new N),function(t){var e=typeof t;return null==t||"object"!=e&&"function"!=e}(t))return t;var n,o=function(e){var n=r.get(t);if(n)return n;for(var o in r.set(t,e),t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=D(t[o],!0,r));return e};switch(C(t)){case"Object":return o(Object.create(Object.getPrototypeOf(t)));case"Array":return o(Array(t.length));case"Date":return new Date(t.valueOf());case"RegExp":return n=t,new RegExp(n.source,n.flags?n.flags:(n.global?"g":"")+(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.sticky?"y":"")+(n.unicode?"u":"")+(n.dotAll?"s":""));case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":return t.slice();default:return t}}var N=function(){function t(){this.map={},this.length=0}return t.prototype.set=function(t,e){var r=this.hash(t),n=this.map[r];n||(this.map[r]=n=[]),n.push([t,e]),this.length+=1},t.prototype.hash=function(t){var e=[];for(var r in t)e.push(Object.prototype.toString.call(t[r]));return e.join()},t.prototype.get=function(t){if(this.length<=180)for(var e in this.map)for(var r=this.map[e],n=0;n!a(t)&&"[object Object]"===Object.prototype.toString.call(t),z=(t,e)=>{if(!Array.isArray(t)||!Array.isArray(e))return k(e);const r=k(t);return e.forEach(((t,e)=>{r[e]=Array.isArray(t)||(t=>!a(t)&&(t=>"object"==typeof t)(t)&&!Array.isArray(t))(t)?F(r[e],t):t})),r},F=(t,e)=>L(z,t,e),J=t=>B(t)&&Object.keys(t).length>0,Q=t=>{const e=_(s,t);return Object.keys(e).forEach((t=>{const r=e[t];B(r)&&(e[t]=Q(r))})),e},M="[Circular Reference]",q=(t,e,r)=>{const n=[];return function(t,e){if(!u(e)){if("object"!=typeof e||a(e))return e;for(;n.length>0&&n[n.length-1]!==this;)n.pop();return n.includes(e)?(null==r||r.warn(((t,e)=>`${t}${S}A circular reference has been detected in the object and the property "${e}" has been dropped from the output.`)("JSONStringify",t)),M):(n.push(e),e)}}},G=(t,e,r,n)=>{try{return JSON.stringify(t,q(0,0,n))}catch(t){return null==n||n.warn("Failed to convert the value to a JSON string.",t),null}},V=t=>{const e=[];return function(t,r){if((t=>"bigint"==typeof t)(r))return"[BigInt]";for(;e.length>0&&e[e.length-1]!==this;)e.pop();return e.includes(r)?M:(e.push(r),r)}},H=(t,e)=>{const r=Array.isArray(t)?[]:{};for(const n in t)if(Object.hasOwnProperty.call(t,n)){const o=t[n],a=e.call(t,n,o);B(a)||Array.isArray(a)?r[n]=H(a,e):r[n]=a}return r},K=(t,e)=>{const r=V(),n=r.call(t,"",t);return B(t)||Array.isArray(t)?H(t,r):n},W=()=>(new Date).toISOString();function X(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=typeof t||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Y(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Z(t){for(var e=1;e`${tt}${j(t)}`,rt=t=>null!=t&&t.startsWith(tt)?w(t.substring(10)):t,nt="client-timeout",ot="client-network",at="QueueUtilities",it=(t,e)=>G(t,0,0,e),ut=(t,e)=>G(t,0,0,e),ct=(t,e)=>{const r=it(t,e);if(r){const t=r.length;t>32768&&(null==e||e.warn(((t,e,r)=>`${t}${S}The size of the event payload (${e} bytes) exceeds the maximum limit of ${r} bytes. Events with large payloads may be dropped in the future. Please review your instrumentation to ensure that event payloads are within the size limit.`)(at,t,32768)))}else null==e||e.warn(`${at}${S}Failed to validate event payload size. Please make sure that the event payload is within the size limit and is a valid JSON object.`)},st=(t,e)=>{const r=k(t);return r.sentAt=e,r},lt=t=>{let e=!1,r=!1;function n(){e||(e=!0,t(r),setTimeout((()=>{e=!1}),0))}globalThis.addEventListener("beforeunload",(()=>{r=!1,n()})),globalThis.addEventListener("blur",(()=>{r=!0,n()})),globalThis.addEventListener("focus",(()=>{e=!1})),document.addEventListener("pagehide",(()=>{r="hidden"===document.visibilityState,n()})),document.addEventListener("visibilitychange",(()=>{r=!0,"hidden"===document.visibilityState?n():e=!1}))},ft={IN_PROGRESS:"inProgress",QUEUE:"queue",RECLAIM_START:"reclaimStart",RECLAIM_END:"reclaimEnd",ACK:"ack",BATCH_QUEUE:"batchQueue"};export{it as A,j as B,t as C,ot as D,m as E,lt as F,X as G,e as L,r as M,ft as Q,nt as R,Z as _,B as a,a as b,k as c,c as d,s as e,o as f,i as g,rt as h,n as i,et as j,S as k,u as l,F as m,W as n,st as o,K as p,l as q,f as r,G as s,A as t,J as u,ct as v,Q as w,ut as x,O as y,w as z}; //# sourceMappingURL=rsa-plugins-common.min.js.map