@launchdarkly/observability 1.1.13 → 1.1.14
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.
- package/CHANGELOG.md +9 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -275,7 +275,7 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):a
|
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
277
|
${ia}
|
|
278
|
-
`,Cp=(e,t,n,r)=>e();function xp(e,t=Cp){return{PushPayload(n,r){return t(i=>e.request(Ep,n,I(I({},r),i)),"PushPayload","mutation",n)},PushSessionEvents(n,r){return t(i=>e.request(bp,n,I(I({},r),i)),"PushSessionEvents","mutation",n)},identifySession(n,r){return t(i=>e.request(Tp,n,I(I({},r),i)),"identifySession","mutation",n)},addSessionProperties(n,r){return t(i=>e.request(Sp,n,I(I({},r),i)),"addSessionProperties","mutation",n)},pushMetrics(n,r){return t(i=>e.request(wp,n,I(I({},r),i)),"pushMetrics","mutation",n)},addSessionFeedback(n,r){return t(i=>e.request(Op,n,I(I({},r),i)),"addSessionFeedback","mutation",n)},initializeSession(n,r){return t(i=>e.request(Lp,n,I(I({},r),i)),"initializeSession","mutation",n)},Ignore(n,r){return t(i=>e.request(Ap,n,I(I({},r),i)),"Ignore","query",n)},GetSamplingConfig(n,r){return t(i=>e.request(Rp,n,I(I({},r),i)),"GetSamplingConfig","query",n)}}}function Pp(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}function Np(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();let r=e.parentElement,i=[];if(r.children&&r.children.length>0)for(let o=0;o<r.children.length;o++){let a=r.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&i.push(a)}i.length>1&&(n+=":eq("+i.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function Pr(e){return Object.prototype.toString.call(e)==="[object Object]"}function oa(e,t){if(t===0)return!0;const n=Object.keys(e);for(const r of n)if(Pr(e[r])&&oa(e[r],t-1))return!0;return!1}function Nr(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const r=[],i=[];return JSON.stringify(e,function(u,c){if(r.length>0){const s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?i.splice(s,1/0,u):i.push(u),~r.indexOf(c)&&(r[0]===c?c="[Circular ~]":c="[Circular ~."+i.slice(0,r.indexOf(c)).join(".")+"]")}else r.push(c);if(c==null)return c;if(o(c))return a(c);if(c instanceof Event){const s={};for(const l in c){const p=c[l];Array.isArray(p)?s[l]=Np(p.length?p[0]:null):s[l]=p}return s}else{if(c instanceof Node)return c instanceof HTMLElement?c?c.outerHTML:"":c.nodeName;if(c instanceof Error)return c.name+": "+c.message}return c});function o(u){return Pr(u)&&Object.keys(u).length>n.numOfKeysLimit||typeof u=="function"?!0:u instanceof Event&&u.isTrusted===!1?Object.keys(u).length===1:!!(Pr(u)&&oa(u,n.depthOfLimit))}function a(u){let c=u.toString();return n.stringLengthLimit&&c.length>n.stringLengthLimit&&(c=`${c.slice(0,n.stringLengthLimit)}...`),c}}function Ip(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}const Ir="exception.message",kp="exception.stacktrace",kr="exception.type",aa="http.response.status_code",Mp="server.address",Dp="service.name",Up="service.version",jp="telemetry.sdk.name",Bp="telemetry.sdk.version",wt="url.full",bn="url.path",$p="url.query",Fp="user_agent.original",Mr=15*60*1e3;/*! js-cookie v3.0.5 | MIT */function Tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Vp={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Dr(e,t){function n(i,o,a){if(typeof document<"u"){a=Tn({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var u="";for(var c in a)a[c]&&(u+="; "+c,a[c]!==!0&&(u+="="+a[c].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+u}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},u=0;u<o.length;u++){var c=o[u].split("="),s=c.slice(1).join("=");try{var l=decodeURIComponent(c[0]);if(a[l]=e.read(s,l),i===l)break}catch{}}return i?a[i]:a}}return Object.create({set:n,get:r,remove:function(i,o){n(i,"",Tn({},o,{expires:-1}))},withAttributes:function(i){return Dr(this.converter,Tn({},this.attributes,i))},withConverter:function(i){return Dr(Tn({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Sn=Dr(Vp,{path:"/"});let Ur="localStorage",jr=!0;class Gp{constructor(){Re(this,"storage",{})}get length(){return Object.keys(this.storage).length}key(t){var n;return(n=Object.keys(this.storage)[t])!=null?n:null}getItem(t){var n;return(n=this.storage[t])!=null?n:""}setItem(t,n){this.storage[t]=n}removeItem(t){delete this.storage[t]}}let Hp=class{getItem(t){var n;return(n=Sn.get(t))!=null?n:""}setItem(t,n){if(!jr)return;const r=new Date;r.setTime(r.getTime()+Mr),Sn.set(t,n,{expires:r})}removeItem(t){jr&&Sn.remove(t)}keys(){var t;return Object.keys((t=Sn.get())!=null?t:{})}};const ae=new Gp,se=new Hp,wn=()=>{let e=null;if(typeof window>"u")return ae;try{switch(Ur){case"localStorage":e=window.localStorage;break;case"sessionStorage":e=window.sessionStorage;break}e||(kt("storage","getPersistentStorage","debug",`persistent storage was not found for mode ${Ur}; using global storage`),e=ae)}catch(t){kt("storage","getPersistentStorage","debug","failed to get persistent storage; using global storage",t),e=ae}return e},qp=e=>{Ur=e},sa=e=>{jr=e},Br=e=>{try{return wn().getItem(e)}catch(t){return kt("storage","getItem","debug",`failed to get item ${e}; using global storage`,t),ae.getItem(e)}},ua=(e,t)=>{se.setItem(e,t);try{return wn().setItem(e,t)}catch(n){return kt("storage","setItem","debug",`failed to set item ${e}; using global storage`,n),ae.setItem(e,t)}},ca=e=>{se.removeItem(e);try{return wn().removeItem(e)}catch(t){return kt("storage","removeItem","debug",`failed to remove item ${e}; using global storage`,t),ae.removeItem(e)}};var ue=(e=>(e.SEGMENT_LAST_SENT_HASH_KEY="HIGHLIGHT_SEGMENT_LAST_SENT_HASH_KEY",e.SESSION_ID="sessionID",e.SESSION_DATA="sessionData",e.USER_IDENTIFIER="highlightIdentifier",e.USER_OBJECT="highlightUserObject",e))(ue||{});const On=e=>`${ue.SESSION_DATA}_${e}`,Ot=()=>{var e;return typeof globalThis<"u"&&(e=globalThis.persistentSessionSecureID)!=null&&e.length?globalThis.persistentSessionSecureID:la()},zp=e=>{typeof globalThis<"u"&&e!=null&&e.length&&(globalThis.persistentSessionSecureID=e)},la=()=>{var e;return(e=Br(ue.SESSION_ID))!=null?e:""},pa=e=>{ua(ue.SESSION_ID,e)},Xp=e=>{const t=On(e);return JSON.parse(Br(t)||"{}")},Kp=e=>{e||(e=la());let t=Xp(e);if(t&&t.lastPushTime&&Date.now()-t.lastPushTime<Mr)return t;ca(On(e))},fa=function(e){if(!(e!=null&&e.sessionSecureID))return;const t=e.sessionSecureID;zp(t);const n=On(t);ua(n,JSON.stringify(e)),Yp(n)},Wp=function(){const e=se.getItem(ue.SESSION_ID);pa(e);const t=On(e),n=se.getItem(t);try{fa(JSON.parse(n))}catch{}};function Yp(e){var t;const n=`${ue.SESSION_DATA}_`,r=new Set,i=wn();for(let o=i.length-1;o>=0;o--){const a=i.key(o);a&&a.startsWith(n)&&a!==e&&r.add(a)}for(const o of se.keys())o.startsWith(n)&&o!==e&&r.add(o);for(const o of r){let a=!0;try{const u=Br(o)||se.getItem(o)||"{}",c=JSON.parse(u),s=(t=c.lastPushTime)!=null?t:c.sessionStartTime;a=s===void 0||Date.now()-s>=Mr}catch{}a&&(kt("highlightSession","pruneSessionData","debug",`removing session data for stale key ${o}`),ca(o))}}var ha=(e=>(e.BillingQuotaExceeded="BillingQuotaExceeded",e))(ha||{});const $r=3,Fr=1e3,Vr=500,Jp=[ha.BillingQuotaExceeded.toString()],Qp=e=>{var t;return((t=e.response.errors)==null?void 0:t.find(n=>Jp.includes(n.message)))===void 0},Zp=()=>{const e=(t,n,r,i,o=0)=>ne(void 0,null,function*(){try{return yield t()}catch(a){if(a instanceof ta&&!Qp(a))throw a;if(o<$r)return yield new Promise(u=>setTimeout(u,Fr+Vr*Math.pow(2,o))),yield e(t,n,r,i,o+1);throw console.error(`highlight.io: data request failed after ${o} retries`),a}});return e},J="feature_flag",da="launchdarkly",tf="evaluation",ef=`${J}.set.id`,nf=`${J}.key`,rf=`${J}.contextKeys`,of=`${J}.context.id`,af=`${J}.result.value`,sf=`${J}.provider.name`,va={kind:`${J}.result.reason.kind`,errorKind:`${J}.result.reason.errorKind`,ruleIndex:`${J}.result.reason.ruleIndex`,ruleId:`${J}.result.reason.ruleId`,prerequisiteKey:`${J}.result.reason.prerequisiteKey`,inExperiment:`${J}.result.reason.inExperiment`,bigSegmentsStatus:`${J}.result.reason.bigSegmentsStatus`},uf=`${J}.result.variationIndex`,cf=`${da}.application.id`,lf=`${da}.application.version`,pf="context",ff=`${pf}.contextKeys`,hf="$ld:telemetry:session:init",ya="$ld:telemetry:track",df="launchdarkly.track",vf="page_view",yf="document_load",gf="result.status";function ga(e){return e.includes("%")||e.includes(":")?e.replace(/%/g,"%25").replace(/:/g,"%3A"):e}function ma(e){return e.kind==="multi"}function Gr(e){return ma(e)?Object.keys(e).sort().filter(t=>t!=="kind").map(t=>`${t}:${ga(e[t].key)}`).join(":"):"kind"in e&&e.kind==="user"?e.key:"kind"in e?`${e.kind}:${ga(e.key)}`:e.key}function _a(e){return ma(e)?Object.keys(e).sort().filter(t=>t!=="kind").map(t=>({[t]:e[t].key})).reduce((t,n)=>I(I({},t),n),{}):"kind"in e?{[e.kind]:e.key}:{user:e.key}}let mf=class{constructor(t,n){Re(this,"client"),Re(this,"metadata"),this.client=t,this.metadata=n}getHooks(t){return[]}init(t){this.client.track(hf,{sessionID:t})}recordGauge(t,n){}identify(t,n,r={},i){}error(t,n){}track(t,n){const r=n.event;this.client.track(r?`${ya}:${r}`:ya,cn(I({},n),{sessionID:t}))}},_f=class extends ko{constructor(t,n){super(),Re(this,"client"),this.client=new mf(t,n)}getHooks(t){return[{getMetadata:()=>({name:"highlight.run/ld"}),afterIdentify:(n,r,i)=>(this.load(this.client),r)}]}init(t){return this._bufferCall("init",[t])}recordGauge(t,n){return this._bufferCall("recordGauge",[t,n])}identify(t,n,r={},i){return this._bufferCall("identify",[t,n,r,i])}error(t,n){return this._bufferCall("error",[t,n])}track(t,n){return this._bufferCall("track",[t,n])}};const Ef=e=>{e(window.location.href);const t=history.pushState;history.pushState=(o=>function(){var a=o.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),a})(history.pushState);const n=history.replaceState;history.replaceState=(o=>function(){var a=o.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),a})(history.replaceState);const r=()=>{window.dispatchEvent(new Event("locationchange"))};window.addEventListener("popstate",r);const i=function(){e(window.location.href)};return window.addEventListener("locationchange",i),()=>{window.removeEventListener("popstate",r),window.removeEventListener("locationchange",i),history.pushState=t,history.replaceState=n}},bf="10.3.4",Tf={version:bf},Sf=Tf.version;function wf(e){if(e.id.length)return`#${e.id}`;if(e.classList.length){let t=[];for(const n of e.classList)t.push(`.${n}`);return`${e.nodeName.toLowerCase()}${t.join(",")}`}return e.nodeName.toLowerCase()}const Of=e=>{let t;const n=()=>{clearTimeout(t),t=setTimeout(()=>{var r,i;e({height:window.innerHeight,width:window.innerWidth,availHeight:window.screen.availHeight,availWidth:window.screen.availWidth,colorDepth:window.screen.colorDepth,pixelDepth:window.screen.pixelDepth,orientation:(i=(r=window.screen.orientation)==null?void 0:r.angle)!=null?i:0})},500)};return window.addEventListener("resize",n),n(),()=>window.removeEventListener("resize",n)};var Ea={exports:{}};/**
|
|
278
|
+
`,Cp=(e,t,n,r)=>e();function xp(e,t=Cp){return{PushPayload(n,r){return t(i=>e.request(Ep,n,I(I({},r),i)),"PushPayload","mutation",n)},PushSessionEvents(n,r){return t(i=>e.request(bp,n,I(I({},r),i)),"PushSessionEvents","mutation",n)},identifySession(n,r){return t(i=>e.request(Tp,n,I(I({},r),i)),"identifySession","mutation",n)},addSessionProperties(n,r){return t(i=>e.request(Sp,n,I(I({},r),i)),"addSessionProperties","mutation",n)},pushMetrics(n,r){return t(i=>e.request(wp,n,I(I({},r),i)),"pushMetrics","mutation",n)},addSessionFeedback(n,r){return t(i=>e.request(Op,n,I(I({},r),i)),"addSessionFeedback","mutation",n)},initializeSession(n,r){return t(i=>e.request(Lp,n,I(I({},r),i)),"initializeSession","mutation",n)},Ignore(n,r){return t(i=>e.request(Ap,n,I(I({},r),i)),"Ignore","query",n)},GetSamplingConfig(n,r){return t(i=>e.request(Rp,n,I(I({},r),i)),"GetSamplingConfig","query",n)}}}function Pp(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],i=n(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=i,()=>{e[t]=r}}catch{return()=>{}}}function Np(e){if(!e||!e.outerHTML)return"";let t="";for(;e.parentElement;){let n=e.localName;if(!n)break;n=n.toLowerCase();let r=e.parentElement,i=[];if(r.children&&r.children.length>0)for(let o=0;o<r.children.length;o++){let a=r.children[o];a.localName&&a.localName.toLowerCase&&a.localName.toLowerCase()===n&&i.push(a)}i.length>1&&(n+=":eq("+i.indexOf(e)+")"),t=n+(t?">"+t:""),e=r}return t}function Pr(e){return Object.prototype.toString.call(e)==="[object Object]"}function oa(e,t){if(t===0)return!0;const n=Object.keys(e);for(const r of n)if(Pr(e[r])&&oa(e[r],t-1))return!0;return!1}function Nr(e,t){const n={numOfKeysLimit:50,depthOfLimit:4};Object.assign(n,t);const r=[],i=[];return JSON.stringify(e,function(u,c){if(r.length>0){const s=r.indexOf(this);~s?r.splice(s+1):r.push(this),~s?i.splice(s,1/0,u):i.push(u),~r.indexOf(c)&&(r[0]===c?c="[Circular ~]":c="[Circular ~."+i.slice(0,r.indexOf(c)).join(".")+"]")}else r.push(c);if(c==null)return c;if(o(c))return a(c);if(c instanceof Event){const s={};for(const l in c){const p=c[l];Array.isArray(p)?s[l]=Np(p.length?p[0]:null):s[l]=p}return s}else{if(c instanceof Node)return c instanceof HTMLElement?c?c.outerHTML:"":c.nodeName;if(c instanceof Error)return c.name+": "+c.message}return c});function o(u){return Pr(u)&&Object.keys(u).length>n.numOfKeysLimit||typeof u=="function"?!0:u instanceof Event&&u.isTrusted===!1?Object.keys(u).length===1:!!(Pr(u)&&oa(u,n.depthOfLimit))}function a(u){let c=u.toString();return n.stringLengthLimit&&c.length>n.stringLengthLimit&&(c=`${c.slice(0,n.stringLengthLimit)}...`),c}}function Ip(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}const Ir="exception.message",kp="exception.stacktrace",kr="exception.type",aa="http.response.status_code",Mp="server.address",Dp="service.name",Up="service.version",jp="telemetry.sdk.name",Bp="telemetry.sdk.version",wt="url.full",bn="url.path",$p="url.query",Fp="user_agent.original",Mr=15*60*1e3;/*! js-cookie v3.0.5 | MIT */function Tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var Vp={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Dr(e,t){function n(i,o,a){if(typeof document<"u"){a=Tn({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var u="";for(var c in a)a[c]&&(u+="; "+c,a[c]!==!0&&(u+="="+a[c].split(";")[0]));return document.cookie=i+"="+e.write(o,i)+u}}function r(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var o=document.cookie?document.cookie.split("; "):[],a={},u=0;u<o.length;u++){var c=o[u].split("="),s=c.slice(1).join("=");try{var l=decodeURIComponent(c[0]);if(a[l]=e.read(s,l),i===l)break}catch{}}return i?a[i]:a}}return Object.create({set:n,get:r,remove:function(i,o){n(i,"",Tn({},o,{expires:-1}))},withAttributes:function(i){return Dr(this.converter,Tn({},this.attributes,i))},withConverter:function(i){return Dr(Tn({},this.converter,i),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Sn=Dr(Vp,{path:"/"});let Ur="localStorage",jr=!0;class Gp{constructor(){Re(this,"storage",{})}get length(){return Object.keys(this.storage).length}key(t){var n;return(n=Object.keys(this.storage)[t])!=null?n:null}getItem(t){var n;return(n=this.storage[t])!=null?n:""}setItem(t,n){this.storage[t]=n}removeItem(t){delete this.storage[t]}}let Hp=class{getItem(t){var n;return(n=Sn.get(t))!=null?n:""}setItem(t,n){if(!jr)return;const r=new Date;r.setTime(r.getTime()+Mr),Sn.set(t,n,{expires:r})}removeItem(t){jr&&Sn.remove(t)}keys(){var t;return Object.keys((t=Sn.get())!=null?t:{})}};const ae=new Gp,se=new Hp,wn=()=>{let e=null;if(typeof window>"u")return ae;try{switch(Ur){case"localStorage":e=window.localStorage;break;case"sessionStorage":e=window.sessionStorage;break}e||(kt("storage","getPersistentStorage","debug",`persistent storage was not found for mode ${Ur}; using global storage`),e=ae)}catch(t){kt("storage","getPersistentStorage","debug","failed to get persistent storage; using global storage",t),e=ae}return e},qp=e=>{Ur=e},sa=e=>{jr=e},Br=e=>{try{return wn().getItem(e)}catch(t){return kt("storage","getItem","debug",`failed to get item ${e}; using global storage`,t),ae.getItem(e)}},ua=(e,t)=>{se.setItem(e,t);try{return wn().setItem(e,t)}catch(n){return kt("storage","setItem","debug",`failed to set item ${e}; using global storage`,n),ae.setItem(e,t)}},ca=e=>{se.removeItem(e);try{return wn().removeItem(e)}catch(t){return kt("storage","removeItem","debug",`failed to remove item ${e}; using global storage`,t),ae.removeItem(e)}};var ue=(e=>(e.SEGMENT_LAST_SENT_HASH_KEY="HIGHLIGHT_SEGMENT_LAST_SENT_HASH_KEY",e.SESSION_ID="sessionID",e.SESSION_DATA="sessionData",e.USER_IDENTIFIER="highlightIdentifier",e.USER_OBJECT="highlightUserObject",e))(ue||{});const On=e=>`${ue.SESSION_DATA}_${e}`,Ot=()=>{var e;return typeof globalThis<"u"&&(e=globalThis.persistentSessionSecureID)!=null&&e.length?globalThis.persistentSessionSecureID:la()},zp=e=>{typeof globalThis<"u"&&e!=null&&e.length&&(globalThis.persistentSessionSecureID=e)},la=()=>{var e;return(e=Br(ue.SESSION_ID))!=null?e:""},pa=e=>{ua(ue.SESSION_ID,e)},Xp=e=>{const t=On(e);return JSON.parse(Br(t)||"{}")},Kp=e=>{e||(e=la());let t=Xp(e);if(t&&t.lastPushTime&&Date.now()-t.lastPushTime<Mr)return t;ca(On(e))},fa=function(e){if(!(e!=null&&e.sessionSecureID))return;const t=e.sessionSecureID;zp(t);const n=On(t);ua(n,JSON.stringify(e)),Yp(n)},Wp=function(){const e=se.getItem(ue.SESSION_ID);pa(e);const t=On(e),n=se.getItem(t);try{fa(JSON.parse(n))}catch{}};function Yp(e){var t;const n=`${ue.SESSION_DATA}_`,r=new Set,i=wn();for(let o=i.length-1;o>=0;o--){const a=i.key(o);a&&a.startsWith(n)&&a!==e&&r.add(a)}for(const o of se.keys())o.startsWith(n)&&o!==e&&r.add(o);for(const o of r){let a=!0;try{const u=Br(o)||se.getItem(o)||"{}",c=JSON.parse(u),s=(t=c.lastPushTime)!=null?t:c.sessionStartTime;a=s===void 0||Date.now()-s>=Mr}catch{}a&&(kt("highlightSession","pruneSessionData","debug",`removing session data for stale key ${o}`),ca(o))}}var ha=(e=>(e.BillingQuotaExceeded="BillingQuotaExceeded",e))(ha||{});const $r=3,Fr=1e3,Vr=500,Jp=[ha.BillingQuotaExceeded.toString()],Qp=e=>{var t;return((t=e.response.errors)==null?void 0:t.find(n=>Jp.includes(n.message)))===void 0},Zp=()=>{const e=(t,n,r,i,o=0)=>ne(void 0,null,function*(){try{return yield t()}catch(a){if(a instanceof ta&&!Qp(a))throw a;if(o<$r)return yield new Promise(u=>setTimeout(u,Fr+Vr*Math.pow(2,o))),yield e(t,n,r,i,o+1);throw console.error(`highlight.io: data request failed after ${o} retries`),a}});return e},J="feature_flag",da="launchdarkly",tf="evaluation",ef=`${J}.set.id`,nf=`${J}.key`,rf=`${J}.contextKeys`,of=`${J}.context.id`,af=`${J}.result.value`,sf=`${J}.provider.name`,va={kind:`${J}.result.reason.kind`,errorKind:`${J}.result.reason.errorKind`,ruleIndex:`${J}.result.reason.ruleIndex`,ruleId:`${J}.result.reason.ruleId`,prerequisiteKey:`${J}.result.reason.prerequisiteKey`,inExperiment:`${J}.result.reason.inExperiment`,bigSegmentsStatus:`${J}.result.reason.bigSegmentsStatus`},uf=`${J}.result.variationIndex`,cf=`${da}.application.id`,lf=`${da}.application.version`,pf="context",ff=`${pf}.contextKeys`,hf="$ld:telemetry:session:init",ya="$ld:telemetry:track",df="launchdarkly.track",vf="page_view",yf="document_load",gf="result.status";function ga(e){return e.includes("%")||e.includes(":")?e.replace(/%/g,"%25").replace(/:/g,"%3A"):e}function ma(e){return e.kind==="multi"}function Gr(e){return ma(e)?Object.keys(e).sort().filter(t=>t!=="kind").map(t=>`${t}:${ga(e[t].key)}`).join(":"):"kind"in e&&e.kind==="user"?e.key:"kind"in e?`${e.kind}:${ga(e.key)}`:e.key}function _a(e){return ma(e)?Object.keys(e).sort().filter(t=>t!=="kind").map(t=>({[t]:e[t].key})).reduce((t,n)=>I(I({},t),n),{}):"kind"in e?{[e.kind]:e.key}:{user:e.key}}let mf=class{constructor(t,n){Re(this,"client"),Re(this,"metadata"),this.client=t,this.metadata=n}getHooks(t){return[]}init(t){this.client.track(hf,{sessionID:t})}recordGauge(t,n){}identify(t,n,r={},i){}error(t,n){}track(t,n){const r=n.event;this.client.track(r?`${ya}:${r}`:ya,cn(I({},n),{sessionID:t}))}},_f=class extends ko{constructor(t,n){super(),Re(this,"client"),this.client=new mf(t,n)}getHooks(t){return[{getMetadata:()=>({name:"highlight.run/ld"}),afterIdentify:(n,r,i)=>(this.load(this.client),r)}]}init(t){return this._bufferCall("init",[t])}recordGauge(t,n){return this._bufferCall("recordGauge",[t,n])}identify(t,n,r={},i){return this._bufferCall("identify",[t,n,r,i])}error(t,n){return this._bufferCall("error",[t,n])}track(t,n){return this._bufferCall("track",[t,n])}};const Ef=e=>{e(window.location.href);const t=history.pushState;history.pushState=(o=>function(){var a=o.apply(this,arguments);return window.dispatchEvent(new Event("pushstate")),window.dispatchEvent(new Event("locationchange")),a})(history.pushState);const n=history.replaceState;history.replaceState=(o=>function(){var a=o.apply(this,arguments);return window.dispatchEvent(new Event("replacestate")),window.dispatchEvent(new Event("locationchange")),a})(history.replaceState);const r=()=>{window.dispatchEvent(new Event("locationchange"))};window.addEventListener("popstate",r);const i=function(){e(window.location.href)};return window.addEventListener("locationchange",i),()=>{window.removeEventListener("popstate",r),window.removeEventListener("locationchange",i),history.pushState=t,history.replaceState=n}},bf="10.4.0",Tf={version:bf},Sf=Tf.version;function wf(e){if(e.id.length)return`#${e.id}`;if(e.classList.length){let t=[];for(const n of e.classList)t.push(`.${n}`);return`${e.nodeName.toLowerCase()}${t.join(",")}`}return e.nodeName.toLowerCase()}const Of=e=>{let t;const n=()=>{clearTimeout(t),t=setTimeout(()=>{var r,i;e({height:window.innerHeight,width:window.innerWidth,availHeight:window.screen.availHeight,availWidth:window.screen.availWidth,colorDepth:window.screen.colorDepth,pixelDepth:window.screen.pixelDepth,orientation:(i=(r=window.screen.orientation)==null?void 0:r.angle)!=null?i:0})},500)};return window.addEventListener("resize",n),n(),()=>window.removeEventListener("resize",n)};var Ea={exports:{}};/**
|
|
279
279
|
* @preserve
|
|
280
280
|
* JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
|
|
281
281
|
*
|