@statsig/js-on-device-eval-client 3.8.0 → 3.8.1

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 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Statsig=e():t.Statsig=e()}(this,()=>(()=>{"use strict";var $Q=(e)=>Object.defineProperty(e,"__esModule",{value:!0});var $Q2=(a,b,c)=>Object.defineProperty(a,b,c);var $P=(a,b)=>Object.assign(a,b);var $A=()=>((t,r,u,l)=>{return new(u=u||Promise)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function o(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof u?e:new u(function(t){t(e)})).then(i,o)}s((l=l.apply(t,r||[])).next())})});var n={1845:(t,n,e)=>{var i;$Q2(n,"__esModule",{value:!0}),n.t=n.i=n.l=void 0;const r=e(7512);n.l=()=>__STATSIG__||o,n.i=t=>(0,n.l)()[t];n.t=t=>{var e=(0,n.l)();return t?e.instances&&e.instances[t]:(e.instances&&1<Object.keys(e.instances).length&&r.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),e.firstInstance)};var s="__STATSIG__",l="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},u="undefined"!=typeof globalThis?globalThis:{};const o=null!=(i=null!=(i=null!=(i=l[s])?i:e[s])?i:u[s])?i:{instance:n.t};l[s]=o,e[s]=o,u[s]=o},2137:(t,e,n)=>{$Q(e),e.o=e.u=void 0;const r=n(1406);function i(t,e,n){if(n)return n(t,e);const i=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(n=null==e?void 0:e.userID)?n:""),"cids:"+Object.keys(i).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+i[t]).join(","),"k:"+t];return(0,r.h)(e.join("|"))}e.u=i,e.o=function(t,e,n){return e?i(t,e,n):(0,r.h)("k:"+t)}},6427:(t,e)=>{$Q(e)},694:function(t,e,n){var r=this&&this.__awaiter||$A();$Q(e),e.DataAdapterCore=void 0;const o=n(7512),a=n(9122),s=n(8578),l=n(4534),c=n(3401);function h(t,e,n,i){return{source:t,data:e,receivedAt:Date.now(),stableID:n,fullUserHash:(0,s.v)(i)}}e.DataAdapterCore=class{constructor(t,e){this._=t,this.p=e,this.m=null,this.O=null,this.j="statsig.last_modified_time."+e,this.S=new i}attach(t,e){this.O=t,this.m=e}getDataSync(t){var t=t&&(0,s.T)(t,this.m),e=this.k(t),n=this.S.get(e,t);return n||((n=this.I(e))?(this.S.add(e,n),this.S.get(e,t)):null)}setData(t,e){var e=e&&(0,s.T)(e,this.m),n=this.k(e);this.S.add(n,h("Bootstrap",t,null,e))}D(e,n,i){return r(this,void 0,void 0,function*(){l.Storage.isReady()||(yield l.Storage.isReadyResolver());var t=null!=e?e:this.getDataSync(n),t=[this.M(t,n,i)];return null!=i&&i.timeoutMs&&t.push(new Promise(t=>setTimeout(t,i.timeoutMs)).then(()=>(o.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}A(n,i){return r(this,void 0,void 0,function*(){var t=n&&(0,s.T)(n,this.m),e=this.k(t),t=yield this.D(null,t,i);t&&this.S.add(e,$P($P({},t),{source:"Prefetch"}))})}M(s,l,u){return r(this,void 0,void 0,function*(){let t=null;s&&this.N(s,l)&&(t=s.data);var e=yield this.R(t,l,u);if(!e)return o.Log.debug("No response returned for latest value"),null;var n=(0,c.P)(e,"has_updates","Response"),i=this.C(),i=a.StableID.get(i);let r=null;if(!0===(null==n?void 0:n.has_updates))r=h("Network",e,i,l);else{if(!t||!1!==(null==n?void 0:n.has_updates))return null;r=h("NetworkNotModified",t,i,l)}e=this.k(l);return this.S.add(e,r),this.U(e,r),r})}C(){return null!=this.O?this.O:(o.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=l.Storage.getItem)?void 0:e.call(l.Storage,t);return null!=e&&(t=(0,c.P)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}U(t,e){l.Storage.setItem(t,JSON.stringify(e)),this.F(t)}F(t){var e=null!=(e=(0,l.G)(this.j))?e:{},t=(e[t]=Date.now(),u(e,10));t&&(delete e[t],l.Storage.removeItem(t)),(0,l.L)(this.j,e)}};class i{constructor(){this.K={}}get(t,e){var t=this.K[t],n=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&n&&e!==n?(o.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var n=u(this.K,9);n&&delete this.K[n],this.K[t]=e}merge(t){this.K=$P($P({},this.K),t)}}function u(r,t){var e=Object.keys(r);return e.length<=t?null:e.reduce((t,e)=>{var n=r[t],i=r[e];return"object"==typeof n&&"object"==typeof i?i.receivedAt<n.receivedAt?e:t:i<n?e:t})}},8962:(t,s)=>{$Q2(s,"__esModule",{value:!0}),s.Diagnostics=void 0;const i=new Map,n="start";function r(t,e,n,i){return $P({key:n,action:e,step:i,timestamp:Date.now()},t)}function l(t,e){var n=null!=(n=i.get(t))?n:[];n.push(e),i.set(t,n)}function e(t,e){if(e in t)return t[e]}s.Diagnostics={q:t=>i.get(t),B:t=>{l(t,r({},n,"overall"))},V:(t,e,n)=>{l(t,r({success:e,error:e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:n},"end","overall"))},J:(t,e)=>{l(t,r(e,n,"initialize","network_request"))},$:(t,e)=>{l(t,r(e,"end","initialize","network_request"))},W:t=>{l(t,r({},n,"initialize","process"))},H:(t,e)=>{l(t,r(e,"end","initialize","process"))},Y:t=>{i.delete(t)},X(t){if(t&&"object"==typeof t)return{code:e(t,"code"),name:e(t,"name"),message:e(t,"message")}},Z(t,e,n,i){return{success:!0===(null==t?void 0:t.ok),statusCode:null==t?void 0:t.status,sdkRegion:null==(t=null==t?void 0:t.headers)?void 0:t.get("x-statsig-region"),isDelta:!0===n.includes('"is_delta":true')||void 0,attempt:e,error:s.Diagnostics.X(i)}},tt(t,e,n,i){var r=s.Diagnostics.q(n);null==r||r.length<=0||(s.Diagnostics.Y(n),n=function(t,e){t={eventName:"statsig::diagnostics",user:t,value:null,metadata:e,time:Date.now()};return t}(t,{context:"initialize",markers:r.slice(),statsigOptions:i}),e.enqueue(n))}}},8809:function(t,e){var n=this&&this.__awaiter||$A();$Q(e),e.et=void 0;const r=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),s="https://cloudflare-dns.com/dns-query",l=["i","e","d"],u=200;e.et=function(e){return n(this,void 0,void 0,function*(){var n=yield e(s,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:r});if(n.ok){var t,n=yield n.arrayBuffer(),n=new Uint8Array(n);{var i=n,n=i.findIndex((t,e)=>e<u&&"="===String.fromCharCode(t)&&l.includes(String.fromCharCode(i[e-1])));if(-1===n)throw(t=new Error("Failed to parse TXT records from DNS")).name="DnsTxtParseError",t;let e="";for(let t=n-1;t<i.length;t++)e+=String.fromCharCode(i[t]);return e.split(",")}}throw(t=new Error("Failed to fetch TXT records from DNS")).name="DnsTxtFetchError",t})}},3539:(t,e)=>{$Q(e)},5542:function(t,u,e){var n=this&&this.__awaiter||$A();$Q2(u,"__esModule",{value:!0}),u.ErrorBoundary=u.EXCEPTION_ENDPOINT=void 0;const i=e(7512),o=e(5902),a=e(8e3),c=(u.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");u.ErrorBoundary=class{constructor(t,e,n){this.O=t,this.m=e,this.nt=n,this.it=new Set}wrap(i){try{const t=i;!function(t){const e=new Set;let n=Object.getPrototypeOf(t);for(;n&&n!==Object.prototype;)Object.getOwnPropertyNames(n).filter(t=>"function"==typeof(null===n||void 0===n?void 0:n[t])).forEach(t=>e.add(t)),n=Object.getPrototypeOf(n);return Array.from(e)}(t).forEach(e=>{const n=t[e];"$EB"in n||(t[e]=(...t)=>this.rt(e,()=>n.apply(i,t)),t[e].$EB=!0)})}catch(t){this.st("eb:wrap",t)}}logError(t,e){this.st(t,e)}rt(e,t){try{var n=t();return n&&n instanceof Promise?n.catch(t=>this.st(e,t)):n}catch(t){return this.st(e,t),null}}st(s,l){try{i.Log.warn("Caught error in "+s,{error:l});n(this,void 0,void 0,function*(){var t,e,n=l||Error(c),i=n instanceof Error,r=i?n.name:"No Name";this.it.has(r)||(this.it.add(r),null!=(t=null==(t=this.m)?void 0:t.networkConfig)&&t.preventAllNetworkTraffic?null!=(t=this.nt)&&t.call(this,{name:"error",error:l,tag:s}):(t=o.SDKType.lt(this.O),e=a.StatsigMetadataProvider.get(),i=i?n.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(n),n=JSON.stringify($P({tag:s,exception:r,info:i},$P($P({},e),{sdkType:t}))),yield(null!=(r=null==(i=null==(r=this.m)?void 0:r.networkConfig)?void 0:i.networkOverrideFunc)?r:fetch)(u.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this.O,"STATSIG-SDK-TYPE":String(t),"STATSIG-SDK-VERSION":String(e.sdkVersion),"Content-Type":"application/json"},body:n}),null!=(i=this.nt)&&i.call(this,{name:"error",error:l,tag:s})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},2922:(t,e)=>{$Q(e)},2417:(t,e)=>{$Q(e)},7770:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const r=n(2137),s=n(1406),l=n(7512),u=n(7410),o=n(6830),a=n(1637),c=n(4534),h=n(1881),d=n(2397),v={},f={Startup:"startup",GainedFocus:"gained_focus"};class _{static ot(t){null!=(t=v[t])&&t.flush().catch(()=>{})}static ut(t){null!=(t=v[t])&&t.ct(f.GainedFocus)}constructor(t,e,n,i){this.O=t,this.nt=e,this.ht=n,this.m=i,this.dt=[],this.vt={},this.ft={},this._t=!1,this.gt=Date.now(),this.bt=!0===(null==i?void 0:i.disableLogging),this.yt=null!=(t=null==i?void 0:i.loggingBufferMaxSize)?t:50;e=null==i?void 0:i.networkConfig;this.Ot=new h.UrlConfiguration(u.Endpoint.jt,null==e?void 0:e.logEventUrl,null==e?void 0:e.api,null==e?void 0:e.logEventFallbackUrls)}setLoggingDisabled(t){this.bt=t}enqueue(t){this.St(t)&&(this.wt(t),this.Tt(),this.dt.length>this.yt)&&_.ot(this.O)}incrementNonExposureCount(t){var e=null!=(e=this.ft[t])?e:0;this.ft[t]=e+1}reset(){this.vt={}}start(){(0,o.kt)()||(v[this.O]=this,(0,d.It)(t=>{"background"===t?_.ot(this.O):"foreground"===t&&_.ut(this.O)}),this.ct(f.Startup),this.Dt())}stop(){return i(this,void 0,void 0,function*(){this.Et&&(clearInterval(this.Et),this.Et=null),delete v[this.O],yield this.flush()})}flush(){return i(this,void 0,void 0,function*(){var t;this.Mt(),0!==this.dt.length&&(t=this.dt,this.dt=[],yield this.At(t))})}Tt(){this._t||(this._t=!0,200<Date.now()-this.gt)||setTimeout(()=>_.ot(this.O),200)}St(t){if((0,o.kt)())return!1;if((0,a.xt)(t)){var e=t.user||{statsigEnvironment:void 0},e=(0,r.u)(this.O,e),n=t.metadata||{},t=[t.eventName,e,n.gate,n.config,n.ruleID,n.allocatedExperiment,n.parameterName,String(n.isExplicitParameter),n.reason].join("|"),e=this.vt[t],n=Date.now();if(e&&n-e<6e4)return!1;1e3<Object.keys(this.vt).length&&(this.vt={}),this.vt[t]=n}return!0}At(t){var e,n;return i(this,void 0,void 0,function*(){if(this.bt)return this.Nt(t),!1;try{return((0,d.Rt)()&&this.ht.isBeaconSupported()&&null==(null==(n=null==(e=this.m)?void 0:e.networkConfig)?void 0:n.networkOverrideFunc)?yield this.Pt(t):yield this.Ct(t)).success?(this.nt({name:"logs_flushed",events:t}),!0):(l.Log.warn("Failed to flush events."),this.Nt(t),!1)}catch(t){return l.Log.warn("Failed to flush events."),!1}})}Ct(e){var n;return i(this,void 0,void 0,function*(){var t=yield this.ht.post(this.Ut(e)),t=null!=(n=null==t?void 0:t.code)?n:-1;return{success:200<=t&&t<300}})}Pt(t){return i(this,void 0,void 0,function*(){return{success:yield this.ht.beacon(this.Ut(t))}})}Ut(t){return{sdkKey:this.O,data:{events:t},urlConfig:this.Ot,retries:3,isCompressable:!0,params:{[u.NetworkParam.EventCount]:String(t.length)}}}Nt(t){for(;500<t.length;)t.shift();var e=this.o();try{(0,c.L)(e,t)}catch(t){l.Log.warn("Unable to save failed logs to storage")}}ct(e){const n=this.o();i(this,void 0,void 0,function*(){c.Storage.isReady()||(yield c.Storage.isReadyResolver());var t=(0,c.G)(n);t&&(e===f.Startup&&c.Storage.removeItem(n),yield this.At(t))&&e===f.GainedFocus&&c.Storage.removeItem(n)}).catch(()=>{l.Log.warn("Failed to flush stored logs")})}o(){return"statsig.failed_logs."+(0,s.h)(this.O)}wt(t){t.user&&(t.user=$P({},t.user),delete t.user.privateAttributes);var e={},n=this.Ft(),n=(n&&(e.statsigMetadata={currentPage:n}),$P($P({},t),e));l.Log.debug("Enqueued Event:",n),this.dt.push(n)}Mt(){0!==Object.keys(this.ft).length&&(this.wt({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:$P({},this.ft)}}),this.ft={})}Ft(){var t;if(!1!==(null==(t=this.m)?void 0:t.includeCurrentPageUrlWithEvents))return(0,o.Gt)()}Dt(){var t=null!=(t=null==(t=this.m)?void 0:t.loggingIntervalMs)?t:1e4;const e=setInterval(()=>{var t=v[this.O];t&&t.Et===e?_.ot(this.O):clearInterval(e)},t);this.Et=e}}e.EventLogger=_},1406:(t,s,e)=>{$Q2(s,"__esModule",{value:!0}),s.Lt=s.Kt=s.h=void 0;const l=e(6634);s.h=e=>{let n=0;for(let t=0;t<e.length;t++){var i=e.charCodeAt(t);n=(n<<5)-n+i,n&=n}return String(n>>>0)},s.Kt=(t,e)=>(0,s.h)(JSON.stringify((0,s.Lt)(t,e)));s.Lt=(n,i)=>{if(null==n)return null;var t=Object.keys(n).sort();const r={};return t.forEach(t=>{var e=n[t];0===i||"object"!==(0,l.zt)(e)?r[t]=e:r[t]=(0,s.Lt)(e,null!=i?i-1:i)}),r}},1333:(t,e)=>{$Q(e)},7512:(t,e)=>{$Q(e),e.Log=e.LogLevel=void 0;function n(t){return t.unshift("[Statsig]"),t}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class i{static info(...t){this.level>=e.LogLevel.Info&&console.info(" INFO ",...n(t))}static debug(...t){this.level>=e.LogLevel.Debug&&console.debug(" DEBUG ",...n(t))}static warn(...t){this.level>=e.LogLevel.Warn&&console.warn(" WARN ",...n(t))}static error(...t){this.level>=e.LogLevel.Error&&console.error(" ERROR ",...n(t))}}(e.Log=i).level=e.LogLevel.Warn},7410:(t,e)=>{$Q(e),e.NetworkParam=e.NetworkDefault=e.Endpoint=void 0,e.Endpoint={qt:"initialize",jt:"rgstr",Bt:"download_config_specs"},e.NetworkDefault={[e.Endpoint.jt]:"https://prodregistryv2.org/v1",[e.Endpoint.qt]:"https://featureassets.org/v1",[e.Endpoint.Bt]:"https://api.statsigcdn.com/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},7023:function(t,e,n){var b=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,n(1845);const l=n(1845),m=n(8962),O=n(7512),j=n(7410),i=n(308),u=n(5902),o=n(6830),a=n(4143),c=n(9122),S=n(2636),h=n(8e3),w=n(2397),x=500,k=3e4,D=new Set([408,500,502,503,504,522,524,599]);e.NetworkCore=class{constructor(t,e){this.nt=e,this.Vt=1e4,this.Jt={},this.m={},this.$t=null,t&&(this.m=t),this.m.networkConfig&&(this.Jt=this.m.networkConfig),this.Jt.networkTimeoutMs&&(this.Vt=this.Jt.networkTimeoutMs),this.Wt=new i.NetworkFallbackResolver(this.m)}setErrorBoundary(t){this.$t=t,this.$t.wrap(this),this.$t.wrap(this.Wt),this.Wt.setErrorBoundary(t)}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}beacon(i){return b(this,void 0,void 0,function*(){var t,e,n;return!!T(i)&&(e=this.Ht("POST",i),t=yield this.Yt(e,i.data),e=yield this.Xt(e),(n=navigator).sendBeacon.bind(n)(e,t))})}post(e){return b(this,void 0,void 0,function*(){var t=this.Ht("POST",e);return t.body=yield this.Yt(t,e.data),e.isStatsigEncodable&&(t.body=this.Qt(t,t.body)),this.Zt(t)})}get(t){t=this.Ht("GET",t);return this.Zt(t)}Zt(p){var g,y;return b(this,void 0,void 0,function*(){if(!T(p))return null;if(this.Jt.preventAllNetworkTraffic)return null;var{method:e,body:n,retries:i,attempt:r}=p,r=null!=r?r:1;const s="undefined"!=typeof AbortController?new AbortController:null;var t=setTimeout(()=>{null!==s&&void 0!==s&&s.abort(`Timeout of ${this.Vt}ms expired.`)},this.Vt),l=yield this.Xt(p);let u=null;var o,a=(0,w.Rt)();try{var c,h,d,v={method:e,body:n,headers:$P({},p.headers),signal:null===s||void 0===s?void 0:s.signal,priority:p.priority,keepalive:a},f=(o=r,(_=p).urlConfig.endpoint===j.Endpoint.qt&&m.Diagnostics.J(_.sdkKey,{attempt:o}),null!=(g=this.Jt.networkOverrideFunc)?g:fetch);if(u=yield f(l,v),clearTimeout(t),u.ok)return d=yield u.text(),I(p,u,r,d),this.Wt.tryBumpExpiryTime(p.sdkKey,p.urlConfig),{body:d,code:u.status};throw c=yield u.text().catch(()=>"No Text"),(h=new Error(`NetworkError: ${l} `+c)).name="NetworkError",h}catch(t){var n=function(t,e){if(null!=t&&t.signal.aborted&&"string"==typeof t.signal.reason)return t.signal.reason;if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(s,t),a=function(t){t=(null==t?void 0:t.signal.aborted)&&"string"==typeof t.signal.reason&&t.signal.reason.includes("Timeout");return t||!1}(s),_=(I(p,u,r,"",t),yield this.Wt.tryFetchUpdatedFallbackInfo(p.sdkKey,p.urlConfig,n,a));return(_&&(p.fallbackUrl=this.Wt.getActiveFallbackUrl(p.sdkKey,p.urlConfig)),!i||i<r||!D.has(null!=(y=null===u||void 0===u?void 0:u.status)?y:500))?(null!=(y=this.nt)&&y.call(this,{name:"error",error:t,tag:S.ErrorTag.NetworkError,requestArgs:p}),O.Log.error(`A networking error occured during ${e} request to ${l}.`,n,t),null):(yield function(e){return b(this,void 0,void 0,function*(){yield new Promise(t=>setTimeout(t,Math.min(x*(e*e),k)))})}(r),this.Zt($P($P({},p),{retries:i,attempt:r+1})))}})}Xt(i){var r;return b(this,void 0,void 0,function*(){var t=null!=(r=i.fallbackUrl)?r:i.urlConfig.getUrl();const e=$P({[j.NetworkParam.SdkKey]:i.sdkKey,[j.NetworkParam.SdkType]:u.SDKType.lt(i.sdkKey),[j.NetworkParam.SdkVersion]:h.SDK_VERSION,[j.NetworkParam.Time]:String(Date.now()),[j.NetworkParam.SessionID]:a.SessionID.get(i.sdkKey)},i.params);var n=Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&");return t+(n?"?"+n:"")})}Yt(r,s){return b(this,void 0,void 0,function*(){var{sdkKey:t,fallbackUrl:e}=r,n=c.StableID.get(t),i=a.SessionID.get(t),t=u.SDKType.lt(t);return JSON.stringify($P($P({},s),{statsigMetadata:$P($P({},h.StatsigMetadataProvider.get()),{stableID:n,sessionID:i,sdkType:t,fallbackUrl:e})}))})}Qt(e,n){var t,i,r=(0,o.te)();if(this.m.disableStatsigEncoding||null!=(0,l.i)("no-encode")||null==r||!r.btoa)return n;try{var s=null!=(t=r.btoa(n).split("").reverse().join(""))?t:n;return e.params=$P($P({},null!=(i=e.params)?i:{}),{[j.NetworkParam.StatsigEncoded]:"1"}),s}catch(t){return O.Log.warn("Request encoding failed for "+e.urlConfig.getUrl()),n}}Ht(t,e){var n=this.Wt.getActiveFallbackUrl(e.sdkKey,e.urlConfig);return $P($P({},e),{method:t,fallbackUrl:n})}};const T=t=>!!t.sdkKey||(O.Log.warn("Unable to make request without an SDK key"),!1);function I(t,e,n,i,r){t.urlConfig.endpoint===j.Endpoint.qt&&m.Diagnostics.$(t.sdkKey,m.Diagnostics.Z(e,n,i,r))}},308:function(t,e,n){var o=this&&this.__awaiter||$A();$Q(e),e.ee=e.NetworkFallbackResolver=void 0;const u=n(8809),i=n(1406),s=n(7512),l=n(4534);function a(t,e){t=null!=(t=null==t?void 0:t.toLowerCase())?t:"";return e||t.includes("uncaught exception")||t.includes("failed to fetch")||t.includes("networkerror when attempting to fetch resource")}function c(t){return"statsig.network_fallback."+(0,i.h)(t)}function h(t,e){t=c(t);e&&0!==Object.keys(e).length?l.Storage.setItem(t,JSON.stringify(e)):l.Storage.removeItem(t)}function d(t){try{return new URL(t).pathname}catch(t){return null}}e.NetworkFallbackResolver=class{constructor(t){this.ne=null,this.$t=null,this.ie={},this.re=null==(t=t.networkConfig)?void 0:t.networkOverrideFunc}setErrorBoundary(t){this.$t=t}tryBumpExpiryTime(t,e){var n=null==(n=this.ne)?void 0:n[e.endpoint];n&&(n.expiryTime=Date.now()+6048e5,h(t,$P($P({},this.ne),{[e.endpoint]:n})))}getActiveFallbackUrl(t,e){var n;let i=this.ne;null==i&&(i=null!=(r=function(t){t=c(t),t=l.Storage.getItem(t);if(!t)return null;try{return JSON.parse(t)}catch(t){return s.Log.error("Failed to parse FallbackInfo"),null}}(t))?r:{},this.ne=i);var r=i[e.endpoint];return!r||Date.now()>(null!=(n=r.expiryTime)?n:0)?(delete i[e.endpoint],this.ne=i,h(t,this.ne),null):r.url||null}getFallbackFromProvided(t){var e=d(t);return e?t.replace(e,""):null}tryFetchUpdatedFallbackInfo(n,i,r,s){var l,u;return o(this,void 0,void 0,function*(){try{var t,e;return a(r,s)?(t=null==i.customUrl&&null==i.fallbackUrls?yield this.se(i):i.fallbackUrls,!!(e=this.le(null==(l=this.ne)?void 0:l[i.endpoint],t))&&(this.oe(n,i.endpoint,e),!0)):!1}catch(t){return null!=(u=this.$t)&&u.logError("tryFetchUpdatedFallbackInfo",t),!1}})}oe(t,e,n){var n={url:n,expiryTime:Date.now()+6048e5,previous:[]},i=null==(i=this.ne)?void 0:i[e],i=(i&&n.previous.push(...i.previous),10<n.previous.length&&(n.previous=[]),null==(i=null==(i=this.ne)?void 0:i[e])?void 0:i.url);null!=i&&n.previous.push(i),this.ne=$P($P({},this.ne),{[e]:n}),h(t,this.ne)}se(s){var l;return o(this,void 0,void 0,function*(){var t=this.ie[s.endpoint];if(t&&Date.now()<t)return null;this.ie[s.endpoint]=Date.now()+144e5;var e=[],t=yield(0,u.et)(null!=(l=this.re)?l:fetch),n=d(s.defaultUrl);for(const r of t)if(r.startsWith(s.endpointDnsKey+"=")){var i=r.split("=");if(1<i.length){let t=i[1];t.endsWith("/")&&(t=t.slice(0,-1)),e.push("https://"+t+n)}}return e})}le(t,e){var n;if(null==e)return null;var i=new Set(null!=(n=null==t?void 0:t.previous)?n:[]),r=null==t?void 0:t.url;let s=null;for(const u of e){var l=u.endsWith("/")?u.slice(0,-1):u;if(!i.has(u)&&l!==r){s=l;break}}return s}},e.ee=a},1405:(t,e)=>{$Q(e)},1361:(t,e)=>{$Q(e)},5902:(t,e)=>{$Q(e),e.SDKType=void 0;const n={};let i;e.SDKType={lt:t=>{return(null!=(t=n[t])?t:"js-mono")+(null!==i&&void 0!==i?i:"")},ue(t,e){n[t]=e},ae(t){i&&"-react"!==i||(i="-"+t)}}},6830:(t,i)=>{$Q2(i,"__esModule",{value:!0}),i.Gt=i.ce=i.he=i.kt=i.de=i.te=void 0;i.te=()=>"undefined"!=typeof window?window:null,i.de=()=>{var t=(0,i.te)();return null!=(t=null==t?void 0:t.document)?t:null},i.kt=()=>{var t;return null===(0,i.de)()&&(t="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,"string"==typeof EdgeRuntime||t)},i.he=(t,e)=>{var n=(0,i.te)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(t,e)},i.ce=(t,e)=>{var n=(0,i.de)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(t,e)};i.Gt=()=>{var t;try{return null==(t=(0,i.te)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}}},4143:(t,e,n)=>{$Q(e),e.StatsigSession=e.SessionID=void 0;const i=n(2137),s=n(7512),l=n(4534),u=n(8023),o=18e5,a=144e5,c={};function h(e,t){return setTimeout(()=>{var t=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(e);t&&t.$emt({name:"session_expired"})},t)}function d(t){return"statsig.session_id."+(0,i.o)(t)}e.SessionID={get:t=>e.StatsigSession.get(t).data.sessionID},e.StatsigSession={get:t=>{null==c[t]&&(c[t]=function(t){let e=function(t){t=d(t);return(0,l.G)(t)}(t);var n=Date.now();e=e||{sessionID:(0,u.getUUID)(),startTime:n,lastUpdate:n};return{data:e,sdkKey:t}}(t));var t=c[t],e=Date.now(),n=t.data,i=((function({lastUpdate:t}){return Date.now()-t>o}(n)||function({startTime:t}){return Date.now()-t>a}(n))&&(n.sessionID=(0,u.getUUID)(),n.startTime=e),n.lastUpdate=e,n),r=t.sdkKey;r=d(r);try{(0,l.L)(r,i)}catch(t){s.Log.warn("Failed to save SessionID")}return clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID),e-=n.startTime,n=t.sdkKey,t.idleTimeoutID=h(n,o),t.ageTimeoutID=h(n,a-e),t},overrideInitialSessionID:(t,e)=>{var n;c[e]=(t=t,e=e,n=Date.now(),{data:{sessionID:t,startTime:n,lastUpdate:n},sdkKey:e})}}},9122:(t,e,n)=>{$Q(e),e.StableID=void 0;const i=n(2137),r=n(7512),s=n(4534),l=n(8023),u={};function o(t){return"statsig.stable_id."+(0,i.o)(t)}function a(t,e){e=o(e);try{(0,s.L)(e,t)}catch(t){r.Log.warn("Failed to save StableID")}}e.StableID={get:e=>{if(null==u[e]){let t=function(t){t=o(t);return(0,s.G)(t)}(e);null==t&&a(t=(0,l.getUUID)(),e),u[e]=t}return u[e]},setOverride:(t,e)=>{a(u[e]=t,e)}}},1375:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,n(1845);const l=n(1845),u=n(5542),o=n(7770),a=n(7512),c=n(6830),h=n(4143),d=n(4534);e.StatsigClientBase=class{constructor(t,e,n,i){this.loadingStatus="Uninitialized",this.ve=null,this.fe={};var r,s=this.$emt.bind(this);null!=(null==i?void 0:i.logLevel)&&(a.Log.level=i.logLevel),null!=i&&i.disableStorage&&d.Storage._e(!0),null!=i&&i.initialSessionID&&h.StatsigSession.overrideInitialSessionID(i.initialSessionID,t),null!=i&&i.storageProvider&&d.Storage.ge(i.storageProvider),this.O=t,this.m=null!=i?i:{},this.overrideAdapter=null!=(r=null==i?void 0:i.overrideAdapter)?r:null,this.pe=new o.EventLogger(t,s,n,i),this.$t=new u.ErrorBoundary(t,i,s),this.$t.wrap(this),this.$t.wrap(e),this.$t.wrap(this.pe),n.setErrorBoundary(this.$t),this.dataAdapter=e,this.dataAdapter.attach(t,i),this.storageProvider=d.Storage,this.be(),r=t,s=this,(0,c.kt)()||(n=(0,l.l)(),e=null!=(e=n.instances)?e:{},s=s,null!=e[r]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),e[r]=s,n.firstInstance||(n.firstInstance=s),n.instances=e,__STATSIG__=n)}updateRuntimeOptions(t){null!=t.disableLogging&&(this.m.disableLogging=t.disableLogging,this.pe.setLoggingDisabled(t.disableLogging)),null!=t.disableStorage&&(this.m.disableStorage=t.disableStorage,d.Storage._e(t.disableStorage))}flush(){return this.pe.flush()}shutdown(){return i(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this.me("Uninitialized",null),this.ve=null,yield this.pe.stop()})}on(t,e){this.fe[t]||(this.fe[t]=[]),this.fe[t].push(e)}off(t,e){this.fe[t]&&-1!==(e=this.fe[t].indexOf(e))&&this.fe[t].splice(e,1)}$on(t,e){e.__isInternal=!0,this.on(t,e)}$emt(n){var t;const e=e=>{try{e(n)}catch(t){!0===e.__isInternal?this.$t.logError("__emit:"+n.name,t):a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",n)}};this.fe[n.name]&&this.fe[n.name].forEach(t=>e(t)),null!=(t=this.fe["*"])&&t.forEach(e)}me(t,e){this.loadingStatus=t,this.$emt({name:"values_updated",status:t,values:e})}ye(t,e,n){!0===(null==n?void 0:n.disableExposureLog)?this.pe.incrementNonExposureCount(t):this.pe.enqueue(e)}}},2636:(t,e)=>{$Q(e),e.ErrorTag=void 0,e.ErrorTag={NetworkError:"NetworkError"}},3206:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},1637:(t,e)=>{$Q(e),e.Oe=e.je=e.Se=e.xt=void 0;const r="statsig::config_exposure",s="statsig::gate_exposure",o="statsig::layer_exposure",a=(t,e,n,i,r)=>(n.bootstrapMetadata&&(i.bootstrapMetadata=n.bootstrapMetadata),{eventName:t,user:e,value:null,metadata:l(n,i),secondaryExposures:r,time:Date.now()});e.xt=({eventName:t})=>t===s||t===r||t===o,e.Se=(t,e)=>{var n,i={gate:e.name,gateValue:String(e.value),ruleID:e.ruleID};return null!=(null==(n=e.__evaluation)?void 0:n.version)&&(i.configVersion=e.__evaluation.version),a(s,t,e.details,i,null!=(t=null==(n=e.__evaluation)?void 0:n.secondary_exposures)?t:[])},e.je=(t,e)=>{var n,i={config:e.name,ruleID:e.ruleID};return null!=(null==(n=e.__evaluation)?void 0:n.version)&&(i.configVersion=e.__evaluation.version),null!=(null==(n=e.__evaluation)?void 0:n.passed)&&(i.rulePassed=String(e.__evaluation.passed)),a(r,t,e.details,i,null!=(t=null==(n=e.__evaluation)?void 0:n.secondary_exposures)?t:[])};e.Oe=(t,e,n)=>{var i=e.__evaluation,r=!0===(null==(r=null==i?void 0:i.explicit_parameters)?void 0:r.includes(n));let s="",l=null!=(u=null==i?void 0:i.undelegated_secondary_exposures)?u:[];r&&(s=null!=(u=i.allocated_experiment_name)?u:"",l=i.secondary_exposures);var u={config:e.name,parameterName:n,ruleID:e.ruleID,allocatedExperiment:s,isExplicitParameter:String(r)};return null!=(null==(i=e.__evaluation)?void 0:i.version)&&(u.configVersion=e.__evaluation.version),a(o,t,e.details,u,l)};const l=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},8e3:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="3.8.0";let n={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>n,add:t=>{n=$P($P({},n),t)}}},586:(t,e)=>{$Q(e)},1098:(t,e)=>{$Q(e)},2059:(t,e,n)=>{$Q(e),e.we=e.Te=e.ke=e.Ie=e.De=e.Ee=void 0;const l=n(7512),u=n(6634),r="default";function s(t,e,n,i){return{name:t,details:e,ruleID:null!=(t=null==n?void 0:n.rule_id)?t:r,__evaluation:n,value:i}}function i(t,e,n){var i=null!=(i=null==n?void 0:n.value)?i:{};return $P($P({},s(t,e,n,i)),{get:o(t,null==n?void 0:n.value)})}function o(i,r,s){return(t,e)=>{var n=null!=(n=null==r?void 0:r[t])?n:null;return null==n?null!=e?e:null:null==e||(0,u.Me)(n,e)?(null!=s&&s(t),n):(l.Log.warn(`Parameter type mismatch. '${i}.${t}' was found to be type '${typeof n}' but fallback/return type is '${typeof e}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=e?e:null)}}e.Ee=function(t,e,n){return s(t,e,n,!0===(null==n?void 0:n.value))},e.De=i,e.Ie=function(t,e,n){return t=i(t,e,n),$P($P({},t),{groupName:null!=(e=null==n?void 0:n.group_name)?e:null})},e.ke=function(t,e,n,i){return $P($P({},s(t,e,n,void 0)),{get:o(t,null==n?void 0:n.value,i),groupName:null!=(e=null==n?void 0:n.group_name)?e:null,__value:null!=(t=null==n?void 0:n.value)?t:{}})},e.Te=function(t,e,n,i){return $P($P($P({},t),e),{get:o(t.name,n,i)})},e.we=o},1812:(t,e)=>{$Q(e)},8578:(t,e,n)=>{$Q(e),e.v=e.T=void 0;const i=n(1406),r=n(7512);e.T=function(t,e,n){try{var i=JSON.parse(JSON.stringify(t));return null!=e&&null!=e.environment?i.statsigEnvironment=e.environment:null!=n&&(i.statsigEnvironment={tier:n}),i}catch(t){return r.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},e.v=function(t){return t?(0,i.Kt)(t):null}},4534:(t,n,e)=>{$Q2(n,"__esModule",{value:!0}),n.L=n.G=n.Storage=void 0;var i=e(7512),e=e(6830);const r={},s={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:t=>r[t]||null,setItem:(t,e)=>{r[t]=e},removeItem:t=>{delete r[t]},getAllKeys:()=>Object.keys(r)};let l=null;try{const a=(0,e.te)();a&&a.localStorage&&"function"==typeof a.localStorage.getItem&&(l={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:t=>a.localStorage.getItem(t),setItem:(t,e)=>a.localStorage.setItem(t,e),removeItem:t=>a.localStorage.removeItem(t),getAllKeys:()=>Object.keys(a.localStorage)})}catch(t){i.Log.warn("Failed to setup localStorageProvider.")}let u=null!==l&&void 0!==l?l:s,o=u;n.Storage={isReady:()=>o.isReady(),isReadyResolver:()=>o.isReadyResolver(),getProviderName:()=>o.getProviderName(),getItem:t=>{var e=()=>o.getItem(t);try{return e()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return n.Storage.ge(s),null;throw t}},setItem:(t,e)=>o.setItem(t,e),removeItem:t=>o.removeItem(t),getAllKeys:()=>o.getAllKeys(),ge:t=>{u=t,o=t},_e:t=>{o=t?s:u}},n.G=function(t){return t=n.Storage.getItem(t),JSON.parse(null!=t?t:"null")},n.L=function(t,e){n.Storage.setItem(t,JSON.stringify(e))}},3401:(t,e,n)=>{$Q(e),e.P=void 0;const r=n(7512);e.P=function(t,e,n){try{var i=JSON.parse(t);return"object"==typeof i&&0 in i,i}catch(t){}return r.Log.error("Failed to parse "+n),null}},6634:(t,e)=>{$Q(e),e.Me=e.zt=void 0,e.zt=function(t){return Array.isArray(t)?"array":typeof t},e.Me=function(t,e){var n=t=>Array.isArray(t)?"array":typeof t;return n(t)===n(e)}},8023:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let n=(new Date).getTime(),i="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let e=16*Math.random();return 0<n?(e=(n+e)%16|0,n=Math.floor(n/16)):(e=(i+e)%16|0,i=Math.floor(i/16)),("x"===t?e:7&e|8).toString(16)})}},1881:(t,e,n)=>{$Q(e),e.UrlConfiguration=void 0;const r=n(7410),s={[r.Endpoint.qt]:"i",[r.Endpoint.jt]:"e",[r.Endpoint.Bt]:"d"};e.UrlConfiguration=class{constructor(t,e,n,i){this.customUrl=null,this.fallbackUrls=null,this.endpoint=t,this.endpointDnsKey=s[t],e&&(this.customUrl=e),!e&&n&&(this.customUrl=n.endsWith("/")?""+n+t:n+"/"+t),i&&(this.fallbackUrls=i);e=r.NetworkDefault[t];this.defaultUrl=e+"/"+t}getUrl(){var t;return null!=(t=this.customUrl)?t:this.defaultUrl}}},2397:(t,e,n)=>{$Q(e),e.Ae=e.It=e.Rt=e.xe=void 0;n=n(6830);const i="foreground",r="background",s=[];let l=i,u=!1;e.xe=()=>l===i,e.Rt=()=>u,e.It=t=>{s.unshift(t)};e.Ae=e=>{e!==l&&(l=e,s.forEach(t=>t(e)))},(0,n.he)("focus",()=>{(u=!1,e.Ae)(i)}),(0,n.he)("blur",()=>(0,e.Ae)(r)),(0,n.he)("beforeunload",()=>{u=!0,(0,e.Ae)(r)}),(0,n.ce)("visibilitychange",()=>{(0,e.Ae)("visible"===document.visibilityState?i:r)})},6914:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&("get"in r?e.__esModule:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),$Q2(t,i,r)}:function(t,e,n,i){t[i=void 0===i?n:i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};$Q(e),e.Diagnostics=e.Log=e.Storage=e.EventLogger=void 0,n(1845);const s=n(8962),l=($Q2(e,"Diagnostics",{enumerable:!0,get:function(){return s.Diagnostics}}),n(7770)),u=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return l.EventLogger}}),n(7512));$Q2(e,"Log",{enumerable:!0,get:function(){return u.Log}});var o=n(8e3);const a=n(4534);$Q2(e,"Storage",{enumerable:!0,get:function(){return a.Storage}}),r(n(1845),e),r(n(2137),e),r(n(6427),e),r(n(694),e),r(n(8962),e),r(n(3539),e),r(n(5542),e),r(n(2922),e),r(n(2417),e),r(n(1406),e),r(n(1333),e),r(n(7512),e),r(n(7410),e),r(n(7023),e),r(n(1405),e),r(n(1361),e),r(n(6830),e),r(n(5902),e),r(n(4143),e),r(n(9122),e),r(n(1375),e),r(n(2636),e),r(n(3206),e),r(n(1637),e),r(n(8e3),e),r(n(586),e),r(n(1098),e),r(n(2059),e),r(n(1812),e),r(n(8578),e),r(n(4534),e),r(n(3401),e),r(n(6634),e),r(n(1881),e),r(n(8023),e),r(n(2397),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{Log:u.Log,SDK_VERSION:o.SDK_VERSION})},9638:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&("get"in r?e.__esModule:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),$Q2(t,i,r)}:function(t,e,n,i){t[i=void 0===i?n:i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};$Q(e),r(n(600),e),e.default=__STATSIG__},1977:(t,e)=>{function u(t){return t.setUTCHours(0,0,0,0),t.getTime()}$Q(e),e.default={compareNumbers(t,e,n){if(null==t||null==e)return!1;var i=Number(t),r=Number(e);if(isNaN(i)||isNaN(r))return!1;switch(n){case"gt":return e<t;case"gte":return e<=t;case"lt":return t<e;case"lte":return t<=e;default:return!1}},compareVersions(t,e,n){if(null==t||null==e)return!1;var t=String(t),e=String(e),i=t=>{var e=t.indexOf("-");return-1!==e?t.substring(0,e):t},r=((t,e)=>{var n=t.split(".").map(t=>parseInt(t)),i=e.split(".").map(t=>parseInt(t));let r=0;for(;r<Math.max(n.length,i.length);){var s=r<n.length?n[r]:0,l=r<i.length?i[r]:0;if(s<l)return-1;if(l<s)return 1;r++}return 0})(i(t),i(e));switch(n){case"version_gt":return 0<r;case"version_gte":return 0<=r;case"version_lt":return r<0;case"version_lte":return r<=0;case"version_eq":return 0===r;case"version_neq":return 0!==r;default:return!1}},compareStringInArray(r,t,s){if(!Array.isArray(t))return!1;const l="any_case_sensitive"!==s&&"none_case_sensitive"!==s;var e=-1!==t.findIndex(t=>{var e=String(r),t=String(t),n=l?e.toLowerCase():e,i=l?t.toLowerCase():t;switch(s){case"any":case"none":case"any_case_sensitive":case"none_case_sensitive":return n===i;case"str_starts_with_any":return n.startsWith(i);case"str_ends_with_any":return n.endsWith(i);case"str_contains_any":case"str_contains_none":return n.includes(i);default:return!1}});switch(s){case"none":case"none_case_sensitive":case"str_contains_none":return!e;default:return e}},compareStringWithRegEx(t,e){try{var n=String(t);if(n.length<1e3)return new RegExp(String(e)).test(n)}catch(t){}return!1},compareTime(n,i,r){if(null==n||null==i)return!1;try{let t=new Date(String(n)),e=(isNaN(t.getTime())&&(t=new Date(Number(n))),new Date(String(i)));isNaN(e.getTime())&&(e=new Date(Number(i)));var s=t.getTime(),l=e.getTime();if(isNaN(s)||isNaN(l))return!1;switch(r){case"before":return s<l;case"after":return l<s;case"on":return u(t)===u(e);default:return!1}}catch(t){return!1}},arrayHasValue(t,e){var n=new Set(t);for(let t=0;t<e.length;t++)if(n.has(e[t])||n.has(parseFloat(e[t])))return!0;return!1},arrayHasAllValues(t,e){var n=new Set(t);for(let t=0;t<e.length;t++)if(!n.has(e[t])&&!n.has(parseFloat(e[t])))return!1;return!0}}},4577:(t,e)=>{$Q(e),e.resultToLayerEval=e.resultToConfigEval=e.resultToGateEval=e.makeEvalResult=void 0,e.makeEvalResult=function(t){return $P($P({},{unsupported:!1,bool_value:!1,rule_id:"",secondary_exposures:[],json_value:{},explicit_parameters:null,allocated_experiment_name:null,is_experiment_group:!1,group_name:null,undelegated_secondary_exposures:void 0}),t)},e.resultToGateEval=function(t,e){return{name:t.name,id_type:t.idType,rule_id:e.rule_id,value:e.bool_value,secondary_exposures:e.secondary_exposures,version:null==(e=t.version)?void 0:e.toString()}},e.resultToConfigEval=function(t,e){var n;return{name:t.name,id_type:t.idType,rule_id:e.rule_id,value:e.json_value,secondary_exposures:e.secondary_exposures,group:null!=(n=e.group_name)?n:"",group_name:null!=(n=e.group_name)?n:void 0,is_device_based:!1,is_experiment_active:t.isActive,is_user_in_experiment:e.is_experiment_group,version:null==(n=t.version)?void 0:n.toString(),passed:e.bool_value}},e.resultToLayerEval=function(t,e,n){var i;return{name:t.name,rule_id:n.rule_id,value:n.json_value,secondary_exposures:n.secondary_exposures,undelegated_secondary_exposures:n.undelegated_secondary_exposures,allocated_experiment_name:null!=(i=n.allocated_experiment_name)?i:"",explicit_parameters:null!=(i=n.explicit_parameters)?i:[],group:null!=(i=n.group_name)?i:"",group_name:null!=(i=n.group_name)?i:void 0,is_device_based:!1,is_experiment_active:null==e?void 0:e.isActive,is_user_in_experiment:n.is_experiment_group,version:null==(i=t.version)?void 0:i.toString()}}},1485:(t,e,n)=>{$Q(e);const i=n(5680),h=n(1977),d=n(4577);function v(t,e){var n;return"string"==typeof e&&"userid"!==e.toLowerCase()?null!=(n=null==(n=t.customIDs)?void 0:n[e])?n:null==(n=null==t?void 0:t.customIDs)?void 0:n[e.toLowerCase()]:t.userID}function f(t){return(0,i.SHA256)(t).dataView().getBigUint64(0,!1)}function u(t){return null!=t&&"object"==typeof t}e.default=class{constructor(t){this.We=t}evaluateGate(t,e){var{spec:t,details:n}=this.xn("gate",t);return t?{evaluation:(0,d.resultToGateEval)(t,this.Dn(t,e)),details:n}:{evaluation:null,details:n}}evaluateConfig(t,e){var{spec:t,details:n}=this.xn("config",t);return t?{evaluation:(0,d.resultToConfigEval)(t,this.Dn(t,e)),details:n}:{evaluation:null,details:n}}evaluateLayer(t,e){var n,{spec:t,details:i}=this.xn("layer",t);return t?(n=null!=(n=null==(e=this.Dn(t,e))?void 0:e.allocated_experiment_name)?n:"",n=this.We.getSpecAndSourceInfo("config",n).spec,{evaluation:(0,d.resultToLayerEval)(t,n,e),details:i}):{evaluation:null,details:i}}xn(t,e){t=this.We.getSpecAndSourceInfo(t,e);return{details:this.Nn(t),spec:t.spec}}Nn(t){var{source:t,spec:e,lcut:n,receivedAt:i}=t;return"Uninitialized"===t||"NoValues"===t?{reason:t}:{reason:t+":"+(null==e?"Unrecognized":"Recognized"),lcut:n,receivedAt:i}}Dn(t,e){var n=u(t.defaultValue)?t.defaultValue:void 0;if(!t.enabled)return(0,d.makeEvalResult)({json_value:n,rule_id:"disabled"});var i=[];for(const l of t.rules){var r,s=this.En(l,e);if(s.unsupported)return s;if(i.push(...s.secondary_exposures),s.bool_value)return this.Mn(l.configDelegate,e,i)||(r=function(t,e,n){if(100===t.passPercentage)return!0;if(0===t.passPercentage)return!1;e=f(n.salt+"."+(null!=(n=t.salt)?n:t.id)+"."+(null!=(n=v(e,t.idType))?n:""));return Number(e%BigInt(1e4))<100*t.passPercentage}(l,e,t),(0,d.makeEvalResult)({rule_id:s.rule_id,bool_value:r,json_value:r?s.json_value:n,secondary_exposures:i,undelegated_secondary_exposures:i,is_experiment_group:s.is_experiment_group,group_name:s.group_name}))}return(0,d.makeEvalResult)({json_value:n,secondary_exposures:i,undelegated_secondary_exposures:i,rule_id:"default"})}En(t,e){var n=[];let i=!0;for(const s of t.conditions){var r=this.An(s,e);if(r.unsupported)return r;n.push(...r.secondary_exposures),r.bool_value||(i=!1)}return(0,d.makeEvalResult)({rule_id:t.id,bool_value:i,json_value:u(t.returnValue)?t.returnValue:void 0,secondary_exposures:n,is_experiment_group:!0===t.isExperimentGroup,group_name:t.groupName})}An(t,e){let n=null,i=!1;var r=t.field,s=t.targetValue,l=t.idType,u=t.type;switch(u){case"public":return(0,d.makeEvalResult)({bool_value:!0});case"pass_gate":case"fail_gate":var o=String(s),o=this.Fn(o,e);return(0,d.makeEvalResult)({bool_value:"fail_gate"===u?!o.bool_value:o.bool_value,secondary_exposures:o.secondary_exposures});case"multi_pass_gate":case"multi_fail_gate":return this.Rn(s,u,e);case"user_field":case"ip_based":case"ua_based":n=function(t,e){var n;if(null==e||"object"!=typeof t||null==t)return null;var i=t;return null!=(n=null!=(n=null!=(n=null!=(n=null!=(n=i[e])?n:i[e.toLowerCase()])?n:null==(i=null==t?void 0:t.custom)?void 0:i[e])?n:null==(i=null==t?void 0:t.custom)?void 0:i[e.toLowerCase()])?n:null==(i=null==t?void 0:t.privateAttributes)?void 0:i[e])?n:null==(i=null==t?void 0:t.privateAttributes)?void 0:i[e.toLowerCase()]}(e,r);break;case"environment_field":n=function(t,e){if(null==e)return null;t=t.statsigEnvironment;if(null!=t){const n=e.toLowerCase(),i=Object.keys(t).find(t=>t.toLowerCase()===n);return void 0!==i?t[i]:void 0}}(e,r);break;case"current_time":n=Date.now();break;case"user_bucket":o=f(String(null!=(o=null==(o=t.additionalValues)?void 0:o.salt)?o:"")+"."+(null!=(o=v(e,l))?o:""));n=Number(o%BigInt(1e3));break;case"unit_id":n=v(e,l);break;default:return(0,d.makeEvalResult)({unsupported:!0})}var a,c=t.operator;switch(c){case"gt":case"gte":case"lt":case"lte":i=h.default.compareNumbers(n,s,c);break;case"version_gt":case"version_gte":case"version_lt":case"version_lte":case"version_eq":case"version_neq":i=h.default.compareVersions(n,s,c);break;case"any":case"none":case"str_starts_with_any":case"str_ends_with_any":case"str_contains_any":case"str_contains_none":case"any_case_sensitive":case"none_case_sensitive":i=h.default.compareStringInArray(n,s,c);break;case"str_matches":i=h.default.compareStringWithRegEx(n,s);break;case"before":case"after":case"on":i=h.default.compareTime(n,s,c);break;case"eq":i=n==s;break;case"neq":i=n!=s;break;case"in_segment_list":case"not_in_segment_list":return(0,d.makeEvalResult)({unsupported:!0});case"array_contains_any":case"array_contains_none":Array.isArray(s)?i=!!Array.isArray(n)&&(a=h.default.arrayHasValue(n,s),"array_contains_any"===c?a:!a):i=!1;break;case"array_contains_all":case"not_array_contains_all":Array.isArray(s)?i=!!Array.isArray(n)&&(a=h.default.arrayHasAllValues(n,s),"array_contains_all"===c?a:!a):i=!1}return(0,d.makeEvalResult)({bool_value:i})}Mn(t,e,n){var i;return t&&(i=this.We.getSpecAndSourceInfo("config",t).spec,i)?(e=this.Dn(i,e),(0,d.makeEvalResult)($P($P({},e),{allocated_experiment_name:t,explicit_parameters:i.explicitParameters,secondary_exposures:n.concat(e.secondary_exposures),undelegated_secondary_exposures:n}))):null}Fn(t,e){var n=[];let i=!1;var r=this.We.getSpecAndSourceInfo("gate",t)["spec"];if(r){r=this.Dn(r,e);if(r.unsupported)return r;i=r.bool_value,n.push(...r.secondary_exposures),n.push({gate:t,gateValue:String(i),ruleID:r.rule_id})}return(0,d.makeEvalResult)({bool_value:i,secondary_exposures:n})}Rn(t,e,n){if(!Array.isArray(t))return(0,d.makeEvalResult)({unsupported:!0});var i="multi_pass_gate"===e,r=[];let s=!1;for(const u of t){if("string"!=typeof u)return(0,d.makeEvalResult)({unsupported:!0});var l=this.Fn(u,n);if(l.unsupported)return l;if(r.push(...l.secondary_exposures),i?!0===l.bool_value:!1===l.bool_value){s=!0;break}}return(0,d.makeEvalResult)({bool_value:s,secondary_exposures:r})}}},8494:function(t,e,n){var r=this&&this.__awaiter||$A();$Q(e);const i=n(6914);class s extends i.NetworkCore{constructor(t=null){super(t);t=null==t?void 0:t.networkConfig;this.Pn=new i.UrlConfiguration(i.Endpoint.Bt,null==t?void 0:t.downloadConfigSpecsUrl,null==t?void 0:t.api,null==t?void 0:t.downloadConfigSpecsFallbackUrls)}fetchConfigSpecs(e,n){var i;return r(this,void 0,void 0,function*(){var t=yield this.get({sdkKey:e,urlConfig:this.Pn,priority:n});return null!=(i=null==t?void 0:t.body)?i:null})}}e.default=s},5932:(t,e,n)=>{$Q(e);const i=n(6914);function r(t){return(0,i.P)(t,"has_updates","DownloadConfigSpecsResponse")}e.default=class{constructor(){this.Re=null,this.Pe=null,this.Ce="Uninitialized",this.Ue=0,this.Fe=0,this.zn=null}getValues(){return this.Re?r(this.Re):null}getDefaultEnvironment(){return this.zn}setValuesFromDataAdapter(t){var e;t&&!0===(null==(e=r(t.data))?void 0:e.has_updates)&&(this.Ue=e.time,this.Fe=t.receivedAt,this.Ce=t.source,this.Pe=e,this.Re=t.data,this.zn=null!=(t=e.default_environment)?t:null)}reset(){this.Pe=null,this.Re=null,this.Ce="Loading"}finalize(){this.Pe||(this.Ce="NoValues")}getSpecAndSourceInfo(t,e){var t=this.Cn(t);return{spec:null!=(t=null==t?void 0:t.find(t=>t.name===e))?t:null,source:this.Ce,lcut:this.Ue,receivedAt:this.Fe}}Cn(t){var e;switch(t){case"gate":return null==(e=this.Pe)?void 0:e.feature_gates;case"config":return null==(e=this.Pe)?void 0:e.dynamic_configs;case"layer":return null==(e=this.Pe)?void 0:e.layer_configs}}}},6217:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e);const l=n(6914),r=n(1485),s=n(8494),u=n(5932),o=n(2660);class a extends l.StatsigClientBase{static instance(t){var e=(0,l.l)().instance(t);return e instanceof a?e:(l.Log.warn((0,l.kt)()?"StatsigOnDeviceEvalClient.instance is not supported in server environments":"Unable to find StatsigOnDeviceEvalClient instance"),new a(null!=t?t:""))}constructor(t,e=null){l.SDKType.ue(t,"js-on-device-eval-client");var n=new s.default(e);super(t,null!=(t=null==e?void 0:e.dataAdapter)?t:new o.StatsigSpecsDataAdapter,n,e),this.We=new u.default,this.Un=new r.default(this.We)}initializeSync(t){"Uninitialized"===this.loadingStatus&&(this.pe.start(),this.updateSync(t))}initializeAsync(t){return i(this,void 0,void 0,function*(){return this.ve||(this.ve=this.Ye(t)),this.ve})}updateSync(t){this.We.reset();var e=this.dataAdapter.getDataSync();this.We.setValuesFromDataAdapter(e),this.We.finalize(),this.me("Ready",e),null!=t&&t.disableBackgroundCacheRefresh||this.Ze(e)}updateAsync(e){return i(this,void 0,void 0,function*(){this.We.reset(),this.me("Loading",null);var t=this.dataAdapter.getDataSync();this.We.setValuesFromDataAdapter(t),t=yield this.dataAdapter.getDataAsync(t,e),this.We.setValuesFromDataAdapter(t),this.We.finalize(),this.me("Ready",t)})}getContext(){return{sdkKey:this.O,options:this.m,values:this.We.getValues(),errorBoundary:this.$t,session:l.StatsigSession.get(this.O),stableID:l.StableID.get(this.O)}}checkGate(t,e,n){return this.getFeatureGate(t,e,n).value}getFeatureGate(t,e,n){var e=this.T(e),{evaluation:i,details:r}=this.Un.evaluateGate(t,e),r=(0,l.Ee)(t,r,i);return this.ye(t,(0,l.Se)(e,r),n),this.$emt({name:"gate_evaluation",gate:r}),r}getDynamicConfig(t,e,n){var e=this.T(e),{evaluation:i,details:r}=this.Un.evaluateConfig(t,e),r=(0,l.De)(t,r,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getDynamicConfigOverride)?void 0:s.call(i,r,e,n),i=null!=s?s:r;return this.ye(t,(0,l.je)(e,i),n),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}getExperiment(t,e,n){var e=this.T(e),{evaluation:i,details:r}=this.Un.evaluateConfig(t,e),r=(0,l.Ie)(t,r,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getExperimentOverride)?void 0:s.call(i,r,e,n),i=null!=s?s:r;return this.ye(t,(0,l.je)(e,i),n),this.$emt({name:"experiment_evaluation",experiment:i}),i}getLayer(e,t,n){const i=this.T(t);var{evaluation:t,details:r}=this.Un.evaluateLayer(e,i);const s=(0,l.ke)(e,r,t,t=>{this.ye(e,(0,l.Oe)(i,s,t),n)});return this.$emt({name:"layer_evaluation",layer:s}),s}logEvent(t,e,n,i){this.pe.enqueue($P($P({},"string"==typeof t?{eventName:t,value:n,metadata:i}:t),{user:this.T(e),time:Date.now()}))}be(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Qe(null)})}Ye(t){return i(this,void 0,void 0,function*(){return l.Storage.isReady()||(yield l.Storage.isReadyResolver()),this.pe.start(),this.updateAsync(t)})}Qe(t){this.We.finalize(),this.me("Ready",t)}T(t){return(0,l.T)(t,this.m,this.We.getDefaultEnvironment())}Ze(t){this.dataAdapter.getDataAsync(t,{priority:"low"}).catch(t=>{l.Log.error("An error occurred after update.",t)})}}e.default=a},2660:function(t,e,n){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigSpecsDataAdapter=void 0;const i=n(6914),s=n(8494);class l extends i.DataAdapterCore{constructor(){super("SpecsDataAdapter","specs"),this.ht=null}attach(t,e){super.attach(t,e),this.ht=new s.default(null!=e?e:{})}getDataAsync(t,e){return this.D(t,void 0,e)}prefetchData(t){return this.A(void 0,t)}R(t,e,n){var i;return r(this,void 0,void 0,function*(){return null!=(i=yield null==(i=this.ht)?void 0:i.fetchConfigSpecs(this.C(),null==n?void 0:n.priority))?i:null})}k(){var t=(0,i.o)(this.C());return`${i.DataAdapterCachePrefix}.${this.p}.`+t}N(t,e){return 0<t.data.length}}e.StatsigSpecsDataAdapter=l},600:(t,e,n)=>{$Q(e),e.StatsigSpecsDataAdapter=e.StatsigOnDeviceEvalClient=void 0;var i=n(6217);e.StatsigOnDeviceEvalClient=i.default;const r=n(2660);$Q2(e,"StatsigSpecsDataAdapter",{enumerable:!0,get:function(){return r.StatsigSpecsDataAdapter}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{StatsigSpecsDataAdapter:r.StatsigSpecsDataAdapter,StatsigOnDeviceEvalClient:i.default}),e.default=__STATSIG__},5680:(t,e,n)=>{$Q(e),e.SHA256=void 0;const i=n(7485);$Q2(e,"SHA256",{enumerable:!0,get:function(){return i.SHA256}})},7485:(t,e)=>{$Q(e),e.SHA256=void 0,e.SHA256=function(t){return(new i).update(t)};const n=[-2147483648,8388608,32768,128],l=[24,16,8,0],m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];class i{constructor(){this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.lastByteIndex=-1}update(n){if(!this.finalized){if("string"!=typeof n)throw new Error('Must be of type "string"');var i;let t=0,e;for(var r=n.length,s=this.blocks;t<r;){for(this.hashed&&(this.hashed=!1,s[0]=this.block,s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),e=this.start;t<r&&e<64;++t)(i=n.charCodeAt(t))<128?s[e>>2]|=i<<l[3&e++]:(i<2048?s[e>>2]|=(192|i>>6)<<l[3&e++]:(i<55296||57344<=i?s[e>>2]|=(224|i>>12)<<l[3&e++]:(i=65536+((1023&i)<<10|1023&n.charCodeAt(++t)),s[e>>2]|=(240|i>>18)<<l[3&e++],s[e>>2]|=(128|i>>12&63)<<l[3&e++]),s[e>>2]|=(128|i>>6&63)<<l[3&e++]),s[e>>2]|=(128|63&i)<<l[3&e++]);this.lastByteIndex=e,this.bytes+=e-this.start,64<=e?(this.block=s[16],this.start=e-64,this.hash(),this.hashed=!0):this.start=e}4294967295<this.bytes&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296)}return this}finalize(){var t,e;this.finalized||(this.finalized=!0,t=this.blocks,e=this.lastByteIndex,t[16]=this.block,t[e>>2]|=n[3&e],this.block=t[16],56<=e&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash())}hash(){var t=this.blocks;let e=this.h0,n=this.h1,i=this.h2,r=this.h3,s=this.h4,l=this.h5,u=this.h6,o=this.h7,a,c,h,d,v,f,_,p,g,y,b;for(a=16;a<64;++a)v=t[a-15],c=(v>>>7|v<<25)^(v>>>18|v<<14)^v>>>3,v=t[a-2],h=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10,t[a]=t[a-16]+c+t[a-7]+h<<0;for(b=n&i,a=0;a<64;a+=4)this.first?(p=704751109,v=t[0]-210244248,o=v-1521486534<<0,r=v+143694565<<0,this.first=!1):(c=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),h=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),p=e&n,d=p^e&i^b,_=s&l^~s&u,v=o+h+_+m[a]+t[a],f=c+d,o=r+v<<0,r=v+f<<0),c=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),h=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),g=r&e,d=g^r&n^p,_=o&s^~o&l,v=u+h+_+m[a+1]+t[a+1],f=c+d,u=i+v<<0,i=v+f<<0,c=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),h=(u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7),y=i&r,d=y^i&e^g,_=u&o^~u&s,v=l+h+_+m[a+2]+t[a+2],f=c+d,l=n+v<<0,n=v+f<<0,c=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),h=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),b=n&i,d=b^n&r^y,_=l&u^~l&o,v=s+h+_+m[a+3]+t[a+3],f=c+d,s=e+v<<0,e=v+f<<0;this.h0=this.h0+e<<0,this.h1=this.h1+n<<0,this.h2=this.h2+i<<0,this.h3=this.h3+r<<0,this.h4=this.h4+s<<0,this.h5=this.h5+l<<0,this.h6=this.h6+u<<0,this.h7=this.h7+o<<0}arrayBuffer(){return this.Gn().buffer}dataView(){return this.Gn().dataView}Gn(){this.finalize();var t=new ArrayBuffer(32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),e.setUint32(28,this.h7),{dataView:e,buffer:t}}}}},i={};function r(t){var e=i[t];return void 0!==e||(e=i[t]={exports:{}},n[t].call(e.exports,e,e.exports,r)),e.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r(9638).default})());
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Statsig=e():t.Statsig=e()}(this,()=>(()=>{"use strict";var $Q=(e)=>Object.defineProperty(e,"__esModule",{value:!0});var $Q2=(a,b,c)=>Object.defineProperty(a,b,c);var $P=(a,b)=>Object.assign(a,b);var $A=()=>((t,r,u,l)=>{return new(u=u||Promise)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function o(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof u?e:new u(function(t){t(e)})).then(i,o)}s((l=l.apply(t,r||[])).next())})});var n={1845:(t,n,e)=>{var i;$Q2(n,"__esModule",{value:!0}),n.t=n.i=n.l=void 0;const r=e(7512);n.l=()=>__STATSIG__||o,n.i=t=>(0,n.l)()[t];n.t=t=>{var e=(0,n.l)();return t?e.instances&&e.instances[t]:(e.instances&&1<Object.keys(e.instances).length&&r.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),e.firstInstance)};var s="__STATSIG__",l="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},u="undefined"!=typeof globalThis?globalThis:{};const o=null!=(i=null!=(i=null!=(i=l[s])?i:e[s])?i:u[s])?i:{instance:n.t};l[s]=o,e[s]=o,u[s]=o},2137:(t,e,n)=>{$Q(e),e.o=e.u=void 0;const r=n(1406);function i(t,e,n){if(n)return n(t,e);const i=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(n=null==e?void 0:e.userID)?n:""),"cids:"+Object.keys(i).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+i[t]).join(","),"k:"+t];return(0,r.h)(e.join("|"))}e.u=i,e.o=function(t,e,n){return e?i(t,e,n):(0,r.h)("k:"+t)}},6427:(t,e)=>{$Q(e)},694:function(t,e,n){var r=this&&this.__awaiter||$A();$Q(e),e.DataAdapterCore=void 0;const o=n(7512),a=n(9122),s=n(8578),l=n(4534),c=n(3401);function h(t,e,n,i){return{source:t,data:e,receivedAt:Date.now(),stableID:n,fullUserHash:(0,s.v)(i)}}e.DataAdapterCore=class{constructor(t,e){this._=t,this.p=e,this.m=null,this.O=null,this.j="statsig.last_modified_time."+e,this.S=new i}attach(t,e){this.O=t,this.m=e}getDataSync(t){var t=t&&(0,s.T)(t,this.m),e=this.k(t),n=this.S.get(e,t);return n||((n=this.I(e))?(this.S.add(e,n),this.S.get(e,t)):null)}setData(t,e){var e=e&&(0,s.T)(e,this.m),n=this.k(e);this.S.add(n,h("Bootstrap",t,null,e))}D(e,n,i){return r(this,void 0,void 0,function*(){l.Storage.isReady()||(yield l.Storage.isReadyResolver());var t=null!=e?e:this.getDataSync(n),t=[this.M(t,n,i)];return null!=i&&i.timeoutMs&&t.push(new Promise(t=>setTimeout(t,i.timeoutMs)).then(()=>(o.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}A(n,i){return r(this,void 0,void 0,function*(){var t=n&&(0,s.T)(n,this.m),e=this.k(t),t=yield this.D(null,t,i);t&&this.S.add(e,$P($P({},t),{source:"Prefetch"}))})}M(s,l,u){return r(this,void 0,void 0,function*(){let t=null;s&&this.N(s,l)&&(t=s.data);var e=yield this.R(t,l,u);if(!e)return o.Log.debug("No response returned for latest value"),null;var n=(0,c.P)(e,"has_updates","Response"),i=this.C(),i=a.StableID.get(i);let r=null;if(!0===(null==n?void 0:n.has_updates))r=h("Network",e,i,l);else{if(!t||!1!==(null==n?void 0:n.has_updates))return null;r=h("NetworkNotModified",t,i,l)}e=this.k(l);return this.S.add(e,r),this.U(e,r),r})}C(){return null!=this.O?this.O:(o.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=l.Storage.getItem)?void 0:e.call(l.Storage,t);return null!=e&&(t=(0,c.P)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}U(t,e){l.Storage.setItem(t,JSON.stringify(e)),this.F(t)}F(t){var e=null!=(e=(0,l.G)(this.j))?e:{},t=(e[t]=Date.now(),u(e,10));t&&(delete e[t],l.Storage.removeItem(t)),(0,l.L)(this.j,e)}};class i{constructor(){this.K={}}get(t,e){var t=this.K[t],n=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&n&&e!==n?(o.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var n=u(this.K,9);n&&delete this.K[n],this.K[t]=e}merge(t){this.K=$P($P({},this.K),t)}}function u(r,t){var e=Object.keys(r);return e.length<=t?null:e.reduce((t,e)=>{var n=r[t],i=r[e];return"object"==typeof n&&"object"==typeof i?i.receivedAt<n.receivedAt?e:t:i<n?e:t})}},8962:(t,s)=>{$Q2(s,"__esModule",{value:!0}),s.Diagnostics=void 0;const i=new Map,n="start";function r(t,e,n,i){return $P({key:n,action:e,step:i,timestamp:Date.now()},t)}function l(t,e){var n=null!=(n=i.get(t))?n:[];n.push(e),i.set(t,n)}function e(t,e){if(e in t)return t[e]}s.Diagnostics={q:t=>i.get(t),B:t=>{l(t,r({},n,"overall"))},V:(t,e,n)=>{l(t,r({success:e,error:e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:n},"end","overall"))},J:(t,e)=>{l(t,r(e,n,"initialize","network_request"))},$:(t,e)=>{l(t,r(e,"end","initialize","network_request"))},W:t=>{l(t,r({},n,"initialize","process"))},H:(t,e)=>{l(t,r(e,"end","initialize","process"))},Y:t=>{i.delete(t)},X(t){if(t&&"object"==typeof t)return{code:e(t,"code"),name:e(t,"name"),message:e(t,"message")}},Z(t,e,n,i){return{success:!0===(null==t?void 0:t.ok),statusCode:null==t?void 0:t.status,sdkRegion:null==(t=null==t?void 0:t.headers)?void 0:t.get("x-statsig-region"),isDelta:!0===n.includes('"is_delta":true')||void 0,attempt:e,error:s.Diagnostics.X(i)}},tt(t,e,n,i){var r=s.Diagnostics.q(n);null==r||r.length<=0||(s.Diagnostics.Y(n),n=function(t,e){t={eventName:"statsig::diagnostics",user:t,value:null,metadata:e,time:Date.now()};return t}(t,{context:"initialize",markers:r.slice(),statsigOptions:i}),e.enqueue(n))}}},8809:function(t,e){var n=this&&this.__awaiter||$A();$Q(e),e.et=void 0;const r=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),s="https://cloudflare-dns.com/dns-query",l=["i","e","d"],u=200;e.et=function(e){return n(this,void 0,void 0,function*(){var n=yield e(s,{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:r});if(n.ok){var t,n=yield n.arrayBuffer(),n=new Uint8Array(n);{var i=n,n=i.findIndex((t,e)=>e<u&&"="===String.fromCharCode(t)&&l.includes(String.fromCharCode(i[e-1])));if(-1===n)throw(t=new Error("Failed to parse TXT records from DNS")).name="DnsTxtParseError",t;let e="";for(let t=n-1;t<i.length;t++)e+=String.fromCharCode(i[t]);return e.split(",")}}throw(t=new Error("Failed to fetch TXT records from DNS")).name="DnsTxtFetchError",t})}},3539:(t,e)=>{$Q(e)},5542:function(t,u,e){var n=this&&this.__awaiter||$A();$Q2(u,"__esModule",{value:!0}),u.ErrorBoundary=u.EXCEPTION_ENDPOINT=void 0;const i=e(7512),o=e(5902),a=e(8e3),c=(u.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");u.ErrorBoundary=class{constructor(t,e,n){this.O=t,this.m=e,this.nt=n,this.it=new Set}wrap(i){try{const t=i;!function(t){const e=new Set;let n=Object.getPrototypeOf(t);for(;n&&n!==Object.prototype;)Object.getOwnPropertyNames(n).filter(t=>"function"==typeof(null===n||void 0===n?void 0:n[t])).forEach(t=>e.add(t)),n=Object.getPrototypeOf(n);return Array.from(e)}(t).forEach(e=>{const n=t[e];"$EB"in n||(t[e]=(...t)=>this.rt(e,()=>n.apply(i,t)),t[e].$EB=!0)})}catch(t){this.st("eb:wrap",t)}}logError(t,e){this.st(t,e)}rt(e,t){try{var n=t();return n&&n instanceof Promise?n.catch(t=>this.st(e,t)):n}catch(t){return this.st(e,t),null}}st(s,l){try{i.Log.warn("Caught error in "+s,{error:l});n(this,void 0,void 0,function*(){var t,e,n=l||Error(c),i=n instanceof Error,r=i?n.name:"No Name";this.it.has(r)||(this.it.add(r),null!=(t=null==(t=this.m)?void 0:t.networkConfig)&&t.preventAllNetworkTraffic?null!=(t=this.nt)&&t.call(this,{name:"error",error:l,tag:s}):(t=o.SDKType.lt(this.O),e=a.StatsigMetadataProvider.get(),i=i?n.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(n),n=JSON.stringify($P({tag:s,exception:r,info:i},$P($P({},e),{sdkType:t}))),yield(null!=(r=null==(i=null==(r=this.m)?void 0:r.networkConfig)?void 0:i.networkOverrideFunc)?r:fetch)(u.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this.O,"STATSIG-SDK-TYPE":String(t),"STATSIG-SDK-VERSION":String(e.sdkVersion),"Content-Type":"application/json"},body:n}),null!=(i=this.nt)&&i.call(this,{name:"error",error:l,tag:s})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},2922:(t,e)=>{$Q(e)},2417:(t,e)=>{$Q(e)},7770:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const r=n(2137),s=n(1406),l=n(7512),u=n(7410),o=n(6830),a=n(1637),c=n(4534),h=n(1881),d=n(2397),v={},f={Startup:"startup",GainedFocus:"gained_focus"};class _{static ot(t){null!=(t=v[t])&&t.flush().catch(()=>{})}static ut(t){null!=(t=v[t])&&t.ct(f.GainedFocus)}constructor(t,e,n,i){this.O=t,this.nt=e,this.ht=n,this.m=i,this.dt=[],this.vt={},this.ft={},this._t=!1,this.gt=Date.now(),this.bt=!0===(null==i?void 0:i.disableLogging),this.yt=null!=(t=null==i?void 0:i.loggingBufferMaxSize)?t:50;e=null==i?void 0:i.networkConfig;this.Ot=new h.UrlConfiguration(u.Endpoint.jt,null==e?void 0:e.logEventUrl,null==e?void 0:e.api,null==e?void 0:e.logEventFallbackUrls)}setLoggingDisabled(t){this.bt=t}enqueue(t){this.St(t)&&(this.wt(t),this.Tt(),this.dt.length>this.yt)&&_.ot(this.O)}incrementNonExposureCount(t){var e=null!=(e=this.ft[t])?e:0;this.ft[t]=e+1}reset(){this.vt={}}start(){(0,o.kt)()||(v[this.O]=this,(0,d.It)(t=>{"background"===t?_.ot(this.O):"foreground"===t&&_.ut(this.O)}),this.ct(f.Startup),this.Dt())}stop(){return i(this,void 0,void 0,function*(){this.Et&&(clearInterval(this.Et),this.Et=null),delete v[this.O],yield this.flush()})}flush(){return i(this,void 0,void 0,function*(){var t;this.Mt(),0!==this.dt.length&&(t=this.dt,this.dt=[],yield this.At(t))})}Tt(){this._t||(this._t=!0,200<Date.now()-this.gt)||setTimeout(()=>_.ot(this.O),200)}St(t){if((0,o.kt)())return!1;if((0,a.xt)(t)){var e=t.user||{statsigEnvironment:void 0},e=(0,r.u)(this.O,e),n=t.metadata||{},t=[t.eventName,e,n.gate,n.config,n.ruleID,n.allocatedExperiment,n.parameterName,String(n.isExplicitParameter),n.reason].join("|"),e=this.vt[t],n=Date.now();if(e&&n-e<6e4)return!1;1e3<Object.keys(this.vt).length&&(this.vt={}),this.vt[t]=n}return!0}At(t){var e,n;return i(this,void 0,void 0,function*(){if(this.bt)return this.Nt(t),!1;try{return((0,d.Rt)()&&this.ht.isBeaconSupported()&&null==(null==(n=null==(e=this.m)?void 0:e.networkConfig)?void 0:n.networkOverrideFunc)?yield this.Pt(t):yield this.Ct(t)).success?(this.nt({name:"logs_flushed",events:t}),!0):(l.Log.warn("Failed to flush events."),this.Nt(t),!1)}catch(t){return l.Log.warn("Failed to flush events."),!1}})}Ct(e){var n;return i(this,void 0,void 0,function*(){var t=yield this.ht.post(this.Ut(e)),t=null!=(n=null==t?void 0:t.code)?n:-1;return{success:200<=t&&t<300}})}Pt(t){return i(this,void 0,void 0,function*(){return{success:yield this.ht.beacon(this.Ut(t))}})}Ut(t){return{sdkKey:this.O,data:{events:t},urlConfig:this.Ot,retries:3,isCompressable:!0,params:{[u.NetworkParam.EventCount]:String(t.length)}}}Nt(t){for(;500<t.length;)t.shift();var e=this.o();try{(0,c.L)(e,t)}catch(t){l.Log.warn("Unable to save failed logs to storage")}}ct(e){const n=this.o();i(this,void 0,void 0,function*(){c.Storage.isReady()||(yield c.Storage.isReadyResolver());var t=(0,c.G)(n);t&&(e===f.Startup&&c.Storage.removeItem(n),yield this.At(t))&&e===f.GainedFocus&&c.Storage.removeItem(n)}).catch(()=>{l.Log.warn("Failed to flush stored logs")})}o(){return"statsig.failed_logs."+(0,s.h)(this.O)}wt(t){t.user&&(t.user=$P({},t.user),delete t.user.privateAttributes);var e={},n=this.Ft(),n=(n&&(e.statsigMetadata={currentPage:n}),$P($P({},t),e));l.Log.debug("Enqueued Event:",n),this.dt.push(n)}Mt(){0!==Object.keys(this.ft).length&&(this.wt({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:$P({},this.ft)}}),this.ft={})}Ft(){var t;if(!1!==(null==(t=this.m)?void 0:t.includeCurrentPageUrlWithEvents))return(0,o.Gt)()}Dt(){var t=null!=(t=null==(t=this.m)?void 0:t.loggingIntervalMs)?t:1e4;const e=setInterval(()=>{var t=v[this.O];t&&t.Et===e?_.ot(this.O):clearInterval(e)},t);this.Et=e}}e.EventLogger=_},1406:(t,s,e)=>{$Q2(s,"__esModule",{value:!0}),s.Lt=s.Kt=s.h=void 0;const l=e(6634);s.h=e=>{let n=0;for(let t=0;t<e.length;t++){var i=e.charCodeAt(t);n=(n<<5)-n+i,n&=n}return String(n>>>0)},s.Kt=(t,e)=>(0,s.h)(JSON.stringify((0,s.Lt)(t,e)));s.Lt=(n,i)=>{if(null==n)return null;var t=Object.keys(n).sort();const r={};return t.forEach(t=>{var e=n[t];0===i||"object"!==(0,l.zt)(e)?r[t]=e:r[t]=(0,s.Lt)(e,null!=i?i-1:i)}),r}},1333:(t,e)=>{$Q(e)},7512:(t,e)=>{$Q(e),e.Log=e.LogLevel=void 0;function n(t){return t.unshift("[Statsig]"),t}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class i{static info(...t){this.level>=e.LogLevel.Info&&console.info(" INFO ",...n(t))}static debug(...t){this.level>=e.LogLevel.Debug&&console.debug(" DEBUG ",...n(t))}static warn(...t){this.level>=e.LogLevel.Warn&&console.warn(" WARN ",...n(t))}static error(...t){this.level>=e.LogLevel.Error&&console.error(" ERROR ",...n(t))}}(e.Log=i).level=e.LogLevel.Warn},7410:(t,e)=>{$Q(e),e.NetworkParam=e.NetworkDefault=e.Endpoint=void 0,e.Endpoint={qt:"initialize",jt:"rgstr",Bt:"download_config_specs"},e.NetworkDefault={[e.Endpoint.jt]:"https://prodregistryv2.org/v1",[e.Endpoint.qt]:"https://featureassets.org/v1",[e.Endpoint.Bt]:"https://api.statsigcdn.com/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},7023:function(t,e,n){var b=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,n(1845);const l=n(1845),m=n(8962),O=n(7512),j=n(7410),i=n(308),u=n(5902),o=n(6830),a=n(4143),c=n(9122),S=n(2636),h=n(8e3),w=n(2397),x=500,k=3e4,D=new Set([408,500,502,503,504,522,524,599]);e.NetworkCore=class{constructor(t,e){this.nt=e,this.Vt=1e4,this.Jt={},this.m={},this.$t=null,t&&(this.m=t),this.m.networkConfig&&(this.Jt=this.m.networkConfig),this.Jt.networkTimeoutMs&&(this.Vt=this.Jt.networkTimeoutMs),this.Wt=new i.NetworkFallbackResolver(this.m)}setErrorBoundary(t){this.$t=t,this.$t.wrap(this),this.$t.wrap(this.Wt),this.Wt.setErrorBoundary(t)}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}beacon(i){return b(this,void 0,void 0,function*(){var t,e,n;return!!T(i)&&(e=this.Ht("POST",i),t=yield this.Yt(e,i.data),e=yield this.Xt(e),(n=navigator).sendBeacon.bind(n)(e,t))})}post(e){return b(this,void 0,void 0,function*(){var t=this.Ht("POST",e);return t.body=yield this.Yt(t,e.data),e.isStatsigEncodable&&(t.body=this.Qt(t,t.body)),this.Zt(t)})}get(t){t=this.Ht("GET",t);return this.Zt(t)}Zt(p){var g,y;return b(this,void 0,void 0,function*(){if(!T(p))return null;if(this.Jt.preventAllNetworkTraffic)return null;var{method:e,body:n,retries:i,attempt:r}=p,r=null!=r?r:1;const s="undefined"!=typeof AbortController?new AbortController:null;var t=setTimeout(()=>{null!==s&&void 0!==s&&s.abort(`Timeout of ${this.Vt}ms expired.`)},this.Vt),l=yield this.Xt(p);let u=null;var o,a=(0,w.Rt)();try{var c,h,d,v={method:e,body:n,headers:$P({},p.headers),signal:null===s||void 0===s?void 0:s.signal,priority:p.priority,keepalive:a},f=(o=r,(_=p).urlConfig.endpoint===j.Endpoint.qt&&m.Diagnostics.J(_.sdkKey,{attempt:o}),null!=(g=this.Jt.networkOverrideFunc)?g:fetch);if(u=yield f(l,v),clearTimeout(t),u.ok)return d=yield u.text(),I(p,u,r,d),this.Wt.tryBumpExpiryTime(p.sdkKey,p.urlConfig),{body:d,code:u.status};throw c=yield u.text().catch(()=>"No Text"),(h=new Error(`NetworkError: ${l} `+c)).name="NetworkError",h}catch(t){var n=function(t,e){if(null!=t&&t.signal.aborted&&"string"==typeof t.signal.reason)return t.signal.reason;if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(s,t),a=function(t){t=(null==t?void 0:t.signal.aborted)&&"string"==typeof t.signal.reason&&t.signal.reason.includes("Timeout");return t||!1}(s),_=(I(p,u,r,"",t),yield this.Wt.tryFetchUpdatedFallbackInfo(p.sdkKey,p.urlConfig,n,a));return(_&&(p.fallbackUrl=this.Wt.getActiveFallbackUrl(p.sdkKey,p.urlConfig)),!i||i<r||!D.has(null!=(y=null===u||void 0===u?void 0:u.status)?y:500))?(null!=(y=this.nt)&&y.call(this,{name:"error",error:t,tag:S.ErrorTag.NetworkError,requestArgs:p}),O.Log.error(`A networking error occured during ${e} request to ${l}.`,n,t),null):(yield function(e){return b(this,void 0,void 0,function*(){yield new Promise(t=>setTimeout(t,Math.min(x*(e*e),k)))})}(r),this.Zt($P($P({},p),{retries:i,attempt:r+1})))}})}Xt(i){var r;return b(this,void 0,void 0,function*(){var t=null!=(r=i.fallbackUrl)?r:i.urlConfig.getUrl();const e=$P({[j.NetworkParam.SdkKey]:i.sdkKey,[j.NetworkParam.SdkType]:u.SDKType.lt(i.sdkKey),[j.NetworkParam.SdkVersion]:h.SDK_VERSION,[j.NetworkParam.Time]:String(Date.now()),[j.NetworkParam.SessionID]:a.SessionID.get(i.sdkKey)},i.params);var n=Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&");return t+(n?"?"+n:"")})}Yt(r,s){return b(this,void 0,void 0,function*(){var{sdkKey:t,fallbackUrl:e}=r,n=c.StableID.get(t),i=a.SessionID.get(t),t=u.SDKType.lt(t);return JSON.stringify($P($P({},s),{statsigMetadata:$P($P({},h.StatsigMetadataProvider.get()),{stableID:n,sessionID:i,sdkType:t,fallbackUrl:e})}))})}Qt(e,n){var t,i,r=(0,o.te)();if(this.m.disableStatsigEncoding||null!=(0,l.i)("no-encode")||null==r||!r.btoa)return n;try{var s=null!=(t=r.btoa(n).split("").reverse().join(""))?t:n;return e.params=$P($P({},null!=(i=e.params)?i:{}),{[j.NetworkParam.StatsigEncoded]:"1"}),s}catch(t){return O.Log.warn("Request encoding failed for "+e.urlConfig.getUrl()),n}}Ht(t,e){var n=this.Wt.getActiveFallbackUrl(e.sdkKey,e.urlConfig);return $P($P({},e),{method:t,fallbackUrl:n})}};const T=t=>!!t.sdkKey||(O.Log.warn("Unable to make request without an SDK key"),!1);function I(t,e,n,i,r){t.urlConfig.endpoint===j.Endpoint.qt&&m.Diagnostics.$(t.sdkKey,m.Diagnostics.Z(e,n,i,r))}},308:function(t,e,n){var o=this&&this.__awaiter||$A();$Q(e),e.ee=e.NetworkFallbackResolver=void 0;const u=n(8809),i=n(1406),s=n(7512),l=n(4534);function a(t,e){t=null!=(t=null==t?void 0:t.toLowerCase())?t:"";return e||t.includes("uncaught exception")||t.includes("failed to fetch")||t.includes("networkerror when attempting to fetch resource")}function c(t){return"statsig.network_fallback."+(0,i.h)(t)}function h(t,e){t=c(t);e&&0!==Object.keys(e).length?l.Storage.setItem(t,JSON.stringify(e)):l.Storage.removeItem(t)}function d(t){try{return new URL(t).pathname}catch(t){return null}}e.NetworkFallbackResolver=class{constructor(t){this.ne=null,this.$t=null,this.ie={},this.re=null==(t=t.networkConfig)?void 0:t.networkOverrideFunc}setErrorBoundary(t){this.$t=t}tryBumpExpiryTime(t,e){var n=null==(n=this.ne)?void 0:n[e.endpoint];n&&(n.expiryTime=Date.now()+6048e5,h(t,$P($P({},this.ne),{[e.endpoint]:n})))}getActiveFallbackUrl(t,e){var n;let i=this.ne;null==i&&(i=null!=(r=function(t){t=c(t),t=l.Storage.getItem(t);if(!t)return null;try{return JSON.parse(t)}catch(t){return s.Log.error("Failed to parse FallbackInfo"),null}}(t))?r:{},this.ne=i);var r=i[e.endpoint];return!r||Date.now()>(null!=(n=r.expiryTime)?n:0)?(delete i[e.endpoint],this.ne=i,h(t,this.ne),null):r.url||null}getFallbackFromProvided(t){var e=d(t);return e?t.replace(e,""):null}tryFetchUpdatedFallbackInfo(n,i,r,s){var l,u;return o(this,void 0,void 0,function*(){try{var t,e;return a(r,s)?(t=null==i.customUrl&&null==i.fallbackUrls?yield this.se(i):i.fallbackUrls,!!(e=this.le(null==(l=this.ne)?void 0:l[i.endpoint],t))&&(this.oe(n,i.endpoint,e),!0)):!1}catch(t){return null!=(u=this.$t)&&u.logError("tryFetchUpdatedFallbackInfo",t),!1}})}oe(t,e,n){var n={url:n,expiryTime:Date.now()+6048e5,previous:[]},i=null==(i=this.ne)?void 0:i[e],i=(i&&n.previous.push(...i.previous),10<n.previous.length&&(n.previous=[]),null==(i=null==(i=this.ne)?void 0:i[e])?void 0:i.url);null!=i&&n.previous.push(i),this.ne=$P($P({},this.ne),{[e]:n}),h(t,this.ne)}se(s){var l;return o(this,void 0,void 0,function*(){var t=this.ie[s.endpoint];if(t&&Date.now()<t)return null;this.ie[s.endpoint]=Date.now()+144e5;var e=[],t=yield(0,u.et)(null!=(l=this.re)?l:fetch),n=d(s.defaultUrl);for(const r of t)if(r.startsWith(s.endpointDnsKey+"=")){var i=r.split("=");if(1<i.length){let t=i[1];t.endsWith("/")&&(t=t.slice(0,-1)),e.push("https://"+t+n)}}return e})}le(t,e){var n;if(null==e)return null;var i=new Set(null!=(n=null==t?void 0:t.previous)?n:[]),r=null==t?void 0:t.url;let s=null;for(const u of e){var l=u.endsWith("/")?u.slice(0,-1):u;if(!i.has(u)&&l!==r){s=l;break}}return s}},e.ee=a},1405:(t,e)=>{$Q(e)},1361:(t,e)=>{$Q(e)},5902:(t,e)=>{$Q(e),e.SDKType=void 0;const n={};let i;e.SDKType={lt:t=>{return(null!=(t=n[t])?t:"js-mono")+(null!==i&&void 0!==i?i:"")},ue(t,e){n[t]=e},ae(t){i&&"-react"!==i||(i="-"+t)}}},6830:(t,i)=>{$Q2(i,"__esModule",{value:!0}),i.Gt=i.ce=i.he=i.kt=i.de=i.te=void 0;i.te=()=>"undefined"!=typeof window?window:null,i.de=()=>{var t=(0,i.te)();return null!=(t=null==t?void 0:t.document)?t:null},i.kt=()=>{var t;return null===(0,i.de)()&&(t="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,"string"==typeof EdgeRuntime||t)},i.he=(t,e)=>{var n=(0,i.te)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(t,e)},i.ce=(t,e)=>{var n=(0,i.de)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(t,e)};i.Gt=()=>{var t;try{return null==(t=(0,i.te)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}}},4143:(t,e,n)=>{$Q(e),e.StatsigSession=e.SessionID=void 0;const i=n(2137),s=n(7512),l=n(4534),u=n(8023),o=18e5,a=144e5,c={};function h(e,t){return setTimeout(()=>{var t=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(e);t&&t.$emt({name:"session_expired"})},t)}function d(t){return"statsig.session_id."+(0,i.o)(t)}e.SessionID={get:t=>e.StatsigSession.get(t).data.sessionID},e.StatsigSession={get:t=>{null==c[t]&&(c[t]=function(t){let e=function(t){t=d(t);return(0,l.G)(t)}(t);var n=Date.now();e=e||{sessionID:(0,u.getUUID)(),startTime:n,lastUpdate:n};return{data:e,sdkKey:t}}(t));var t=c[t],e=Date.now(),n=t.data,i=((function({lastUpdate:t}){return Date.now()-t>o}(n)||function({startTime:t}){return Date.now()-t>a}(n))&&(n.sessionID=(0,u.getUUID)(),n.startTime=e),n.lastUpdate=e,n),r=t.sdkKey;r=d(r);try{(0,l.L)(r,i)}catch(t){s.Log.warn("Failed to save SessionID")}return clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID),e-=n.startTime,n=t.sdkKey,t.idleTimeoutID=h(n,o),t.ageTimeoutID=h(n,a-e),t},overrideInitialSessionID:(t,e)=>{var n;c[e]=(t=t,e=e,n=Date.now(),{data:{sessionID:t,startTime:n,lastUpdate:n},sdkKey:e})}}},9122:(t,e,n)=>{$Q(e),e.StableID=void 0;const i=n(2137),r=n(7512),s=n(4534),l=n(8023),u={};function o(t){return"statsig.stable_id."+(0,i.o)(t)}function a(t,e){e=o(e);try{(0,s.L)(e,t)}catch(t){r.Log.warn("Failed to save StableID")}}e.StableID={get:e=>{if(null==u[e]){let t=function(t){t=o(t);return(0,s.G)(t)}(e);null==t&&a(t=(0,l.getUUID)(),e),u[e]=t}return u[e]},setOverride:(t,e)=>{a(u[e]=t,e)}}},1375:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,n(1845);const l=n(1845),u=n(5542),o=n(7770),a=n(7512),c=n(6830),h=n(4143),d=n(4534);e.StatsigClientBase=class{constructor(t,e,n,i){this.loadingStatus="Uninitialized",this.ve=null,this.fe={};var r,s=this.$emt.bind(this);null!=(null==i?void 0:i.logLevel)&&(a.Log.level=i.logLevel),null!=i&&i.disableStorage&&d.Storage._e(!0),null!=i&&i.initialSessionID&&h.StatsigSession.overrideInitialSessionID(i.initialSessionID,t),null!=i&&i.storageProvider&&d.Storage.ge(i.storageProvider),this.O=t,this.m=null!=i?i:{},this.overrideAdapter=null!=(r=null==i?void 0:i.overrideAdapter)?r:null,this.pe=new o.EventLogger(t,s,n,i),this.$t=new u.ErrorBoundary(t,i,s),this.$t.wrap(this),this.$t.wrap(e),this.$t.wrap(this.pe),n.setErrorBoundary(this.$t),this.dataAdapter=e,this.dataAdapter.attach(t,i),this.storageProvider=d.Storage,this.be(),r=t,s=this,(0,c.kt)()||(n=(0,l.l)(),e=null!=(e=n.instances)?e:{},s=s,null!=e[r]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),e[r]=s,n.firstInstance||(n.firstInstance=s),n.instances=e,__STATSIG__=n)}updateRuntimeOptions(t){null!=t.disableLogging&&(this.m.disableLogging=t.disableLogging,this.pe.setLoggingDisabled(t.disableLogging)),null!=t.disableStorage&&(this.m.disableStorage=t.disableStorage,d.Storage._e(t.disableStorage))}flush(){return this.pe.flush()}shutdown(){return i(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this.me("Uninitialized",null),this.ve=null,yield this.pe.stop()})}on(t,e){this.fe[t]||(this.fe[t]=[]),this.fe[t].push(e)}off(t,e){this.fe[t]&&-1!==(e=this.fe[t].indexOf(e))&&this.fe[t].splice(e,1)}$on(t,e){e.__isInternal=!0,this.on(t,e)}$emt(n){var t;const e=e=>{try{e(n)}catch(t){!0===e.__isInternal?this.$t.logError("__emit:"+n.name,t):a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",n)}};this.fe[n.name]&&this.fe[n.name].forEach(t=>e(t)),null!=(t=this.fe["*"])&&t.forEach(e)}me(t,e){this.loadingStatus=t,this.$emt({name:"values_updated",status:t,values:e})}ye(t,e,n){!0===(null==n?void 0:n.disableExposureLog)?this.pe.incrementNonExposureCount(t):this.pe.enqueue(e)}}},2636:(t,e)=>{$Q(e),e.ErrorTag=void 0,e.ErrorTag={NetworkError:"NetworkError"}},3206:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},1637:(t,e)=>{$Q(e),e.Oe=e.je=e.Se=e.xt=void 0;const r="statsig::config_exposure",s="statsig::gate_exposure",o="statsig::layer_exposure",a=(t,e,n,i,r)=>(n.bootstrapMetadata&&(i.bootstrapMetadata=n.bootstrapMetadata),{eventName:t,user:e,value:null,metadata:l(n,i),secondaryExposures:r,time:Date.now()});e.xt=({eventName:t})=>t===s||t===r||t===o,e.Se=(t,e)=>{var n,i={gate:e.name,gateValue:String(e.value),ruleID:e.ruleID};return null!=(null==(n=e.__evaluation)?void 0:n.version)&&(i.configVersion=e.__evaluation.version),a(s,t,e.details,i,null!=(t=null==(n=e.__evaluation)?void 0:n.secondary_exposures)?t:[])},e.je=(t,e)=>{var n,i={config:e.name,ruleID:e.ruleID};return null!=(null==(n=e.__evaluation)?void 0:n.version)&&(i.configVersion=e.__evaluation.version),null!=(null==(n=e.__evaluation)?void 0:n.passed)&&(i.rulePassed=String(e.__evaluation.passed)),a(r,t,e.details,i,null!=(t=null==(n=e.__evaluation)?void 0:n.secondary_exposures)?t:[])};e.Oe=(t,e,n)=>{var i=e.__evaluation,r=!0===(null==(r=null==i?void 0:i.explicit_parameters)?void 0:r.includes(n));let s="",l=null!=(u=null==i?void 0:i.undelegated_secondary_exposures)?u:[];r&&(s=null!=(u=i.allocated_experiment_name)?u:"",l=i.secondary_exposures);var u={config:e.name,parameterName:n,ruleID:e.ruleID,allocatedExperiment:s,isExplicitParameter:String(r)};return null!=(null==(i=e.__evaluation)?void 0:i.version)&&(u.configVersion=e.__evaluation.version),a(o,t,e.details,u,l)};const l=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},8e3:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="3.8.1";let n={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>n,add:t=>{n=$P($P({},n),t)}}},586:(t,e)=>{$Q(e)},1098:(t,e)=>{$Q(e)},2059:(t,e,n)=>{$Q(e),e.we=e.Te=e.ke=e.Ie=e.De=e.Ee=void 0;const l=n(7512),u=n(6634),r="default";function s(t,e,n,i){return{name:t,details:e,ruleID:null!=(t=null==n?void 0:n.rule_id)?t:r,__evaluation:n,value:i}}function i(t,e,n){var i=null!=(i=null==n?void 0:n.value)?i:{};return $P($P({},s(t,e,n,i)),{get:o(t,null==n?void 0:n.value)})}function o(i,r,s){return(t,e)=>{var n=null!=(n=null==r?void 0:r[t])?n:null;return null==n?null!=e?e:null:null==e||(0,u.Me)(n,e)?(null!=s&&s(t),n):(l.Log.warn(`Parameter type mismatch. '${i}.${t}' was found to be type '${typeof n}' but fallback/return type is '${typeof e}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=e?e:null)}}e.Ee=function(t,e,n){return s(t,e,n,!0===(null==n?void 0:n.value))},e.De=i,e.Ie=function(t,e,n){return t=i(t,e,n),$P($P({},t),{groupName:null!=(e=null==n?void 0:n.group_name)?e:null})},e.ke=function(t,e,n,i){return $P($P({},s(t,e,n,void 0)),{get:o(t,null==n?void 0:n.value,i),groupName:null!=(e=null==n?void 0:n.group_name)?e:null,__value:null!=(t=null==n?void 0:n.value)?t:{}})},e.Te=function(t,e,n,i){return $P($P($P({},t),e),{get:o(t.name,n,i)})},e.we=o},1812:(t,e)=>{$Q(e)},8578:(t,e,n)=>{$Q(e),e.v=e.T=void 0;const i=n(1406),r=n(7512);e.T=function(t,e,n){try{var i=JSON.parse(JSON.stringify(t));return null!=e&&null!=e.environment?i.statsigEnvironment=e.environment:null!=n&&(i.statsigEnvironment={tier:n}),i}catch(t){return r.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},e.v=function(t){return t?(0,i.Kt)(t):null}},4534:(t,n,e)=>{$Q2(n,"__esModule",{value:!0}),n.L=n.G=n.Storage=void 0;var i=e(7512),e=e(6830);const r={},s={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:t=>r[t]||null,setItem:(t,e)=>{r[t]=e},removeItem:t=>{delete r[t]},getAllKeys:()=>Object.keys(r)};let l=null;try{const a=(0,e.te)();a&&a.localStorage&&"function"==typeof a.localStorage.getItem&&(l={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:t=>a.localStorage.getItem(t),setItem:(t,e)=>a.localStorage.setItem(t,e),removeItem:t=>a.localStorage.removeItem(t),getAllKeys:()=>Object.keys(a.localStorage)})}catch(t){i.Log.warn("Failed to setup localStorageProvider.")}let u=null!==l&&void 0!==l?l:s,o=u;n.Storage={isReady:()=>o.isReady(),isReadyResolver:()=>o.isReadyResolver(),getProviderName:()=>o.getProviderName(),getItem:t=>{var e=()=>o.getItem(t);try{return e()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return n.Storage.ge(s),null;throw t}},setItem:(t,e)=>o.setItem(t,e),removeItem:t=>o.removeItem(t),getAllKeys:()=>o.getAllKeys(),ge:t=>{u=t,o=t},_e:t=>{o=t?s:u}},n.G=function(t){return t=n.Storage.getItem(t),JSON.parse(null!=t?t:"null")},n.L=function(t,e){n.Storage.setItem(t,JSON.stringify(e))}},3401:(t,e,n)=>{$Q(e),e.P=void 0;const r=n(7512);e.P=function(t,e,n){try{var i=JSON.parse(t);return"object"==typeof i&&0 in i,i}catch(t){}return r.Log.error("Failed to parse "+n),null}},6634:(t,e)=>{$Q(e),e.Me=e.zt=void 0,e.zt=function(t){return Array.isArray(t)?"array":typeof t},e.Me=function(t,e){var n=t=>Array.isArray(t)?"array":typeof t;return n(t)===n(e)}},8023:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let n=(new Date).getTime(),i="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let e=16*Math.random();return 0<n?(e=(n+e)%16|0,n=Math.floor(n/16)):(e=(i+e)%16|0,i=Math.floor(i/16)),("x"===t?e:7&e|8).toString(16)})}},1881:(t,e,n)=>{$Q(e),e.UrlConfiguration=void 0;const r=n(7410),s={[r.Endpoint.qt]:"i",[r.Endpoint.jt]:"e",[r.Endpoint.Bt]:"d"};e.UrlConfiguration=class{constructor(t,e,n,i){this.customUrl=null,this.fallbackUrls=null,this.endpoint=t,this.endpointDnsKey=s[t],e&&(this.customUrl=e),!e&&n&&(this.customUrl=n.endsWith("/")?""+n+t:n+"/"+t),i&&(this.fallbackUrls=i);e=r.NetworkDefault[t];this.defaultUrl=e+"/"+t}getUrl(){var t;return null!=(t=this.customUrl)?t:this.defaultUrl}}},2397:(t,e,n)=>{$Q(e),e.Ae=e.It=e.Rt=e.xe=void 0;n=n(6830);const i="foreground",r="background",s=[];let l=i,u=!1;e.xe=()=>l===i,e.Rt=()=>u,e.It=t=>{s.unshift(t)};e.Ae=e=>{e!==l&&(l=e,s.forEach(t=>t(e)))},(0,n.he)("focus",()=>{(u=!1,e.Ae)(i)}),(0,n.he)("blur",()=>(0,e.Ae)(r)),(0,n.he)("beforeunload",()=>{u=!0,(0,e.Ae)(r)}),(0,n.ce)("visibilitychange",()=>{(0,e.Ae)("visible"===document.visibilityState?i:r)})},6914:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&("get"in r?e.__esModule:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),$Q2(t,i,r)}:function(t,e,n,i){t[i=void 0===i?n:i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};$Q(e),e.Diagnostics=e.Log=e.Storage=e.EventLogger=void 0,n(1845);const s=n(8962),l=($Q2(e,"Diagnostics",{enumerable:!0,get:function(){return s.Diagnostics}}),n(7770)),u=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return l.EventLogger}}),n(7512));$Q2(e,"Log",{enumerable:!0,get:function(){return u.Log}});var o=n(8e3);const a=n(4534);$Q2(e,"Storage",{enumerable:!0,get:function(){return a.Storage}}),r(n(1845),e),r(n(2137),e),r(n(6427),e),r(n(694),e),r(n(8962),e),r(n(3539),e),r(n(5542),e),r(n(2922),e),r(n(2417),e),r(n(1406),e),r(n(1333),e),r(n(7512),e),r(n(7410),e),r(n(7023),e),r(n(1405),e),r(n(1361),e),r(n(6830),e),r(n(5902),e),r(n(4143),e),r(n(9122),e),r(n(1375),e),r(n(2636),e),r(n(3206),e),r(n(1637),e),r(n(8e3),e),r(n(586),e),r(n(1098),e),r(n(2059),e),r(n(1812),e),r(n(8578),e),r(n(4534),e),r(n(3401),e),r(n(6634),e),r(n(1881),e),r(n(8023),e),r(n(2397),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{Log:u.Log,SDK_VERSION:o.SDK_VERSION})},9638:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&("get"in r?e.__esModule:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),$Q2(t,i,r)}:function(t,e,n,i){t[i=void 0===i?n:i]=e[n]}),r=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};$Q(e),r(n(600),e),e.default=__STATSIG__},1977:(t,e)=>{function u(t){return t.setUTCHours(0,0,0,0),t.getTime()}$Q(e),e.default={compareNumbers(t,e,n){if(null==t||null==e)return!1;var i=Number(t),r=Number(e);if(isNaN(i)||isNaN(r))return!1;switch(n){case"gt":return e<t;case"gte":return e<=t;case"lt":return t<e;case"lte":return t<=e;default:return!1}},compareVersions(t,e,n){if(null==t||null==e)return!1;var t=String(t),e=String(e),i=t=>{var e=t.indexOf("-");return-1!==e?t.substring(0,e):t},r=((t,e)=>{var n=t.split(".").map(t=>parseInt(t)),i=e.split(".").map(t=>parseInt(t));let r=0;for(;r<Math.max(n.length,i.length);){var s=r<n.length?n[r]:0,l=r<i.length?i[r]:0;if(s<l)return-1;if(l<s)return 1;r++}return 0})(i(t),i(e));switch(n){case"version_gt":return 0<r;case"version_gte":return 0<=r;case"version_lt":return r<0;case"version_lte":return r<=0;case"version_eq":return 0===r;case"version_neq":return 0!==r;default:return!1}},compareStringInArray(r,t,s){if(!Array.isArray(t))return!1;const l="any_case_sensitive"!==s&&"none_case_sensitive"!==s;var e=-1!==t.findIndex(t=>{var e=String(r),t=String(t),n=l?e.toLowerCase():e,i=l?t.toLowerCase():t;switch(s){case"any":case"none":case"any_case_sensitive":case"none_case_sensitive":return n===i;case"str_starts_with_any":return n.startsWith(i);case"str_ends_with_any":return n.endsWith(i);case"str_contains_any":case"str_contains_none":return n.includes(i);default:return!1}});switch(s){case"none":case"none_case_sensitive":case"str_contains_none":return!e;default:return e}},compareStringWithRegEx(t,e){try{var n=String(t);if(n.length<1e3)return new RegExp(String(e)).test(n)}catch(t){}return!1},compareTime(n,i,r){if(null==n||null==i)return!1;try{let t=new Date(String(n)),e=(isNaN(t.getTime())&&(t=new Date(Number(n))),new Date(String(i)));isNaN(e.getTime())&&(e=new Date(Number(i)));var s=t.getTime(),l=e.getTime();if(isNaN(s)||isNaN(l))return!1;switch(r){case"before":return s<l;case"after":return l<s;case"on":return u(t)===u(e);default:return!1}}catch(t){return!1}},arrayHasValue(t,e){var n=new Set(t);for(let t=0;t<e.length;t++)if(n.has(e[t])||n.has(parseFloat(e[t])))return!0;return!1},arrayHasAllValues(t,e){var n=new Set(t);for(let t=0;t<e.length;t++)if(!n.has(e[t])&&!n.has(parseFloat(e[t])))return!1;return!0}}},4577:(t,e)=>{$Q(e),e.resultToLayerEval=e.resultToConfigEval=e.resultToGateEval=e.makeEvalResult=void 0,e.makeEvalResult=function(t){return $P($P({},{unsupported:!1,bool_value:!1,rule_id:"",secondary_exposures:[],json_value:{},explicit_parameters:null,allocated_experiment_name:null,is_experiment_group:!1,group_name:null,undelegated_secondary_exposures:void 0}),t)},e.resultToGateEval=function(t,e){return{name:t.name,id_type:t.idType,rule_id:e.rule_id,value:e.bool_value,secondary_exposures:e.secondary_exposures,version:null==(e=t.version)?void 0:e.toString()}},e.resultToConfigEval=function(t,e){var n;return{name:t.name,id_type:t.idType,rule_id:e.rule_id,value:e.json_value,secondary_exposures:e.secondary_exposures,group:null!=(n=e.group_name)?n:"",group_name:null!=(n=e.group_name)?n:void 0,is_device_based:!1,is_experiment_active:t.isActive,is_user_in_experiment:e.is_experiment_group,version:null==(n=t.version)?void 0:n.toString(),passed:e.bool_value}},e.resultToLayerEval=function(t,e,n){var i;return{name:t.name,rule_id:n.rule_id,value:n.json_value,secondary_exposures:n.secondary_exposures,undelegated_secondary_exposures:n.undelegated_secondary_exposures,allocated_experiment_name:null!=(i=n.allocated_experiment_name)?i:"",explicit_parameters:null!=(i=n.explicit_parameters)?i:[],group:null!=(i=n.group_name)?i:"",group_name:null!=(i=n.group_name)?i:void 0,is_device_based:!1,is_experiment_active:null==e?void 0:e.isActive,is_user_in_experiment:n.is_experiment_group,version:null==(i=t.version)?void 0:i.toString()}}},1485:(t,e,n)=>{$Q(e);const i=n(5680),h=n(1977),d=n(4577);function v(t,e){var n;return"string"==typeof e&&"userid"!==e.toLowerCase()?null!=(n=null==(n=t.customIDs)?void 0:n[e])?n:null==(n=null==t?void 0:t.customIDs)?void 0:n[e.toLowerCase()]:t.userID}function f(t){return(0,i.SHA256)(t).dataView().getBigUint64(0,!1)}function u(t){return null!=t&&"object"==typeof t}e.default=class{constructor(t){this.We=t}evaluateGate(t,e){var{spec:t,details:n}=this.xn("gate",t);return t?{evaluation:(0,d.resultToGateEval)(t,this.Dn(t,e)),details:n}:{evaluation:null,details:n}}evaluateConfig(t,e){var{spec:t,details:n}=this.xn("config",t);return t?{evaluation:(0,d.resultToConfigEval)(t,this.Dn(t,e)),details:n}:{evaluation:null,details:n}}evaluateLayer(t,e){var n,{spec:t,details:i}=this.xn("layer",t);return t?(n=null!=(n=null==(e=this.Dn(t,e))?void 0:e.allocated_experiment_name)?n:"",n=this.We.getSpecAndSourceInfo("config",n).spec,{evaluation:(0,d.resultToLayerEval)(t,n,e),details:i}):{evaluation:null,details:i}}xn(t,e){t=this.We.getSpecAndSourceInfo(t,e);return{details:this.Nn(t),spec:t.spec}}Nn(t){var{source:t,spec:e,lcut:n,receivedAt:i}=t;return"Uninitialized"===t||"NoValues"===t?{reason:t}:{reason:t+":"+(null==e?"Unrecognized":"Recognized"),lcut:n,receivedAt:i}}Dn(t,e){var n=u(t.defaultValue)?t.defaultValue:void 0;if(!t.enabled)return(0,d.makeEvalResult)({json_value:n,rule_id:"disabled"});var i=[];for(const l of t.rules){var r,s=this.En(l,e);if(s.unsupported)return s;if(i.push(...s.secondary_exposures),s.bool_value)return this.Mn(l.configDelegate,e,i)||(r=function(t,e,n){if(100===t.passPercentage)return!0;if(0===t.passPercentage)return!1;e=f(n.salt+"."+(null!=(n=t.salt)?n:t.id)+"."+(null!=(n=v(e,t.idType))?n:""));return Number(e%BigInt(1e4))<100*t.passPercentage}(l,e,t),(0,d.makeEvalResult)({rule_id:s.rule_id,bool_value:r,json_value:r?s.json_value:n,secondary_exposures:i,undelegated_secondary_exposures:i,is_experiment_group:s.is_experiment_group,group_name:s.group_name}))}return(0,d.makeEvalResult)({json_value:n,secondary_exposures:i,undelegated_secondary_exposures:i,rule_id:"default"})}En(t,e){var n=[];let i=!0;for(const s of t.conditions){var r=this.An(s,e);if(r.unsupported)return r;n.push(...r.secondary_exposures),r.bool_value||(i=!1)}return(0,d.makeEvalResult)({rule_id:t.id,bool_value:i,json_value:u(t.returnValue)?t.returnValue:void 0,secondary_exposures:n,is_experiment_group:!0===t.isExperimentGroup,group_name:t.groupName})}An(t,e){let n=null,i=!1;var r=t.field,s=t.targetValue,l=t.idType,u=t.type;switch(u){case"public":return(0,d.makeEvalResult)({bool_value:!0});case"pass_gate":case"fail_gate":var o=String(s),o=this.Fn(o,e);return(0,d.makeEvalResult)({bool_value:"fail_gate"===u?!o.bool_value:o.bool_value,secondary_exposures:o.secondary_exposures});case"multi_pass_gate":case"multi_fail_gate":return this.Rn(s,u,e);case"user_field":case"ip_based":case"ua_based":n=function(t,e){var n;if(null==e||"object"!=typeof t||null==t)return null;var i=t;return null!=(n=null!=(n=null!=(n=null!=(n=null!=(n=i[e])?n:i[e.toLowerCase()])?n:null==(i=null==t?void 0:t.custom)?void 0:i[e])?n:null==(i=null==t?void 0:t.custom)?void 0:i[e.toLowerCase()])?n:null==(i=null==t?void 0:t.privateAttributes)?void 0:i[e])?n:null==(i=null==t?void 0:t.privateAttributes)?void 0:i[e.toLowerCase()]}(e,r);break;case"environment_field":n=function(t,e){if(null==e)return null;t=t.statsigEnvironment;if(null!=t){const n=e.toLowerCase(),i=Object.keys(t).find(t=>t.toLowerCase()===n);return void 0!==i?t[i]:void 0}}(e,r);break;case"current_time":n=Date.now();break;case"user_bucket":o=f(String(null!=(o=null==(o=t.additionalValues)?void 0:o.salt)?o:"")+"."+(null!=(o=v(e,l))?o:""));n=Number(o%BigInt(1e3));break;case"unit_id":n=v(e,l);break;default:return(0,d.makeEvalResult)({unsupported:!0})}var a,c=t.operator;switch(c){case"gt":case"gte":case"lt":case"lte":i=h.default.compareNumbers(n,s,c);break;case"version_gt":case"version_gte":case"version_lt":case"version_lte":case"version_eq":case"version_neq":i=h.default.compareVersions(n,s,c);break;case"any":case"none":case"str_starts_with_any":case"str_ends_with_any":case"str_contains_any":case"str_contains_none":case"any_case_sensitive":case"none_case_sensitive":i=h.default.compareStringInArray(n,s,c);break;case"str_matches":i=h.default.compareStringWithRegEx(n,s);break;case"before":case"after":case"on":i=h.default.compareTime(n,s,c);break;case"eq":i=n==s;break;case"neq":i=n!=s;break;case"in_segment_list":case"not_in_segment_list":return(0,d.makeEvalResult)({unsupported:!0});case"array_contains_any":case"array_contains_none":Array.isArray(s)?i=!!Array.isArray(n)&&(a=h.default.arrayHasValue(n,s),"array_contains_any"===c?a:!a):i=!1;break;case"array_contains_all":case"not_array_contains_all":Array.isArray(s)?i=!!Array.isArray(n)&&(a=h.default.arrayHasAllValues(n,s),"array_contains_all"===c?a:!a):i=!1}return(0,d.makeEvalResult)({bool_value:i})}Mn(t,e,n){var i;return t&&(i=this.We.getSpecAndSourceInfo("config",t).spec,i)?(e=this.Dn(i,e),(0,d.makeEvalResult)($P($P({},e),{allocated_experiment_name:t,explicit_parameters:i.explicitParameters,secondary_exposures:n.concat(e.secondary_exposures),undelegated_secondary_exposures:n}))):null}Fn(t,e){var n=[];let i=!1;var r=this.We.getSpecAndSourceInfo("gate",t)["spec"];if(r){r=this.Dn(r,e);if(r.unsupported)return r;i=r.bool_value,n.push(...r.secondary_exposures),n.push({gate:t,gateValue:String(i),ruleID:r.rule_id})}return(0,d.makeEvalResult)({bool_value:i,secondary_exposures:n})}Rn(t,e,n){if(!Array.isArray(t))return(0,d.makeEvalResult)({unsupported:!0});var i="multi_pass_gate"===e,r=[];let s=!1;for(const u of t){if("string"!=typeof u)return(0,d.makeEvalResult)({unsupported:!0});var l=this.Fn(u,n);if(l.unsupported)return l;if(r.push(...l.secondary_exposures),i?!0===l.bool_value:!1===l.bool_value){s=!0;break}}return(0,d.makeEvalResult)({bool_value:s,secondary_exposures:r})}}},8494:function(t,e,n){var r=this&&this.__awaiter||$A();$Q(e);const i=n(6914);class s extends i.NetworkCore{constructor(t=null){super(t);t=null==t?void 0:t.networkConfig;this.Pn=new i.UrlConfiguration(i.Endpoint.Bt,null==t?void 0:t.downloadConfigSpecsUrl,null==t?void 0:t.api,null==t?void 0:t.downloadConfigSpecsFallbackUrls)}fetchConfigSpecs(e,n){var i;return r(this,void 0,void 0,function*(){var t=yield this.get({sdkKey:e,urlConfig:this.Pn,priority:n});return null!=(i=null==t?void 0:t.body)?i:null})}}e.default=s},5932:(t,e,n)=>{$Q(e);const i=n(6914);function r(t){return(0,i.P)(t,"has_updates","DownloadConfigSpecsResponse")}e.default=class{constructor(){this.Re=null,this.Pe=null,this.Ce="Uninitialized",this.Ue=0,this.Fe=0,this.zn=null}getValues(){return this.Re?r(this.Re):null}getDefaultEnvironment(){return this.zn}setValuesFromDataAdapter(t){var e;t&&!0===(null==(e=r(t.data))?void 0:e.has_updates)&&(this.Ue=e.time,this.Fe=t.receivedAt,this.Ce=t.source,this.Pe=e,this.Re=t.data,this.zn=null!=(t=e.default_environment)?t:null)}reset(){this.Pe=null,this.Re=null,this.Ce="Loading"}finalize(){this.Pe||(this.Ce="NoValues")}getSpecAndSourceInfo(t,e){var t=this.Cn(t);return{spec:null!=(t=null==t?void 0:t.find(t=>t.name===e))?t:null,source:this.Ce,lcut:this.Ue,receivedAt:this.Fe}}Cn(t){var e;switch(t){case"gate":return null==(e=this.Pe)?void 0:e.feature_gates;case"config":return null==(e=this.Pe)?void 0:e.dynamic_configs;case"layer":return null==(e=this.Pe)?void 0:e.layer_configs}}}},6217:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e);const l=n(6914),r=n(1485),s=n(8494),u=n(5932),o=n(2660);class a extends l.StatsigClientBase{static instance(t){var e=(0,l.l)().instance(t);return e instanceof a?e:(l.Log.warn((0,l.kt)()?"StatsigOnDeviceEvalClient.instance is not supported in server environments":"Unable to find StatsigOnDeviceEvalClient instance"),new a(null!=t?t:""))}constructor(t,e=null){l.SDKType.ue(t,"js-on-device-eval-client");var n=new s.default(e);super(t,null!=(t=null==e?void 0:e.dataAdapter)?t:new o.StatsigSpecsDataAdapter,n,e),this.We=new u.default,this.Un=new r.default(this.We)}initializeSync(t){"Uninitialized"===this.loadingStatus&&(this.pe.start(),this.updateSync(t))}initializeAsync(t){return i(this,void 0,void 0,function*(){return this.ve||(this.ve=this.Ye(t)),this.ve})}updateSync(t){this.We.reset();var e=this.dataAdapter.getDataSync();this.We.setValuesFromDataAdapter(e),this.We.finalize(),this.me("Ready",e),null!=t&&t.disableBackgroundCacheRefresh||this.Ze(e)}updateAsync(e){return i(this,void 0,void 0,function*(){this.We.reset(),this.me("Loading",null);var t=this.dataAdapter.getDataSync();this.We.setValuesFromDataAdapter(t),t=yield this.dataAdapter.getDataAsync(t,e),this.We.setValuesFromDataAdapter(t),this.We.finalize(),this.me("Ready",t)})}getContext(){return{sdkKey:this.O,options:this.m,values:this.We.getValues(),errorBoundary:this.$t,session:l.StatsigSession.get(this.O),stableID:l.StableID.get(this.O)}}checkGate(t,e,n){return this.getFeatureGate(t,e,n).value}getFeatureGate(t,e,n){var e=this.T(e),{evaluation:i,details:r}=this.Un.evaluateGate(t,e),r=(0,l.Ee)(t,r,i);return this.ye(t,(0,l.Se)(e,r),n),this.$emt({name:"gate_evaluation",gate:r}),r}getDynamicConfig(t,e,n){var e=this.T(e),{evaluation:i,details:r}=this.Un.evaluateConfig(t,e),r=(0,l.De)(t,r,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getDynamicConfigOverride)?void 0:s.call(i,r,e,n),i=null!=s?s:r;return this.ye(t,(0,l.je)(e,i),n),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}getExperiment(t,e,n){var e=this.T(e),{evaluation:i,details:r}=this.Un.evaluateConfig(t,e),r=(0,l.Ie)(t,r,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getExperimentOverride)?void 0:s.call(i,r,e,n),i=null!=s?s:r;return this.ye(t,(0,l.je)(e,i),n),this.$emt({name:"experiment_evaluation",experiment:i}),i}getLayer(e,t,n){const i=this.T(t);var{evaluation:t,details:r}=this.Un.evaluateLayer(e,i);const s=(0,l.ke)(e,r,t,t=>{this.ye(e,(0,l.Oe)(i,s,t),n)});return this.$emt({name:"layer_evaluation",layer:s}),s}logEvent(t,e,n,i){this.pe.enqueue($P($P({},"string"==typeof t?{eventName:t,value:n,metadata:i}:t),{user:this.T(e),time:Date.now()}))}be(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Qe(null)})}Ye(t){return i(this,void 0,void 0,function*(){return l.Storage.isReady()||(yield l.Storage.isReadyResolver()),this.pe.start(),this.updateAsync(t)})}Qe(t){this.We.finalize(),this.me("Ready",t)}T(t){return(0,l.T)(t,this.m,this.We.getDefaultEnvironment())}Ze(t){this.dataAdapter.getDataAsync(t,{priority:"low"}).catch(t=>{l.Log.error("An error occurred after update.",t)})}}e.default=a},2660:function(t,e,n){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigSpecsDataAdapter=void 0;const i=n(6914),s=n(8494);class l extends i.DataAdapterCore{constructor(){super("SpecsDataAdapter","specs"),this.ht=null}attach(t,e){super.attach(t,e),this.ht=new s.default(null!=e?e:{})}getDataAsync(t,e){return this.D(t,void 0,e)}prefetchData(t){return this.A(void 0,t)}R(t,e,n){var i;return r(this,void 0,void 0,function*(){return null!=(i=yield null==(i=this.ht)?void 0:i.fetchConfigSpecs(this.C(),null==n?void 0:n.priority))?i:null})}k(){var t=(0,i.o)(this.C());return`${i.DataAdapterCachePrefix}.${this.p}.`+t}N(t,e){return 0<t.data.length}}e.StatsigSpecsDataAdapter=l},600:(t,e,n)=>{$Q(e),e.StatsigSpecsDataAdapter=e.StatsigOnDeviceEvalClient=void 0;var i=n(6217);e.StatsigOnDeviceEvalClient=i.default;const r=n(2660);$Q2(e,"StatsigSpecsDataAdapter",{enumerable:!0,get:function(){return r.StatsigSpecsDataAdapter}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{StatsigSpecsDataAdapter:r.StatsigSpecsDataAdapter,StatsigOnDeviceEvalClient:i.default}),e.default=__STATSIG__},5680:(t,e,n)=>{$Q(e),e.SHA256=void 0;const i=n(7485);$Q2(e,"SHA256",{enumerable:!0,get:function(){return i.SHA256}})},7485:(t,e)=>{$Q(e),e.SHA256=void 0,e.SHA256=function(t){return(new i).update(t)};const n=[-2147483648,8388608,32768,128],l=[24,16,8,0],m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];class i{constructor(){this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.lastByteIndex=-1}update(n){if(!this.finalized){if("string"!=typeof n)throw new Error('Must be of type "string"');var i;let t=0,e;for(var r=n.length,s=this.blocks;t<r;){for(this.hashed&&(this.hashed=!1,s[0]=this.block,s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),e=this.start;t<r&&e<64;++t)(i=n.charCodeAt(t))<128?s[e>>2]|=i<<l[3&e++]:(i<2048?s[e>>2]|=(192|i>>6)<<l[3&e++]:(i<55296||57344<=i?s[e>>2]|=(224|i>>12)<<l[3&e++]:(i=65536+((1023&i)<<10|1023&n.charCodeAt(++t)),s[e>>2]|=(240|i>>18)<<l[3&e++],s[e>>2]|=(128|i>>12&63)<<l[3&e++]),s[e>>2]|=(128|i>>6&63)<<l[3&e++]),s[e>>2]|=(128|63&i)<<l[3&e++]);this.lastByteIndex=e,this.bytes+=e-this.start,64<=e?(this.block=s[16],this.start=e-64,this.hash(),this.hashed=!0):this.start=e}4294967295<this.bytes&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296)}return this}finalize(){var t,e;this.finalized||(this.finalized=!0,t=this.blocks,e=this.lastByteIndex,t[16]=this.block,t[e>>2]|=n[3&e],this.block=t[16],56<=e&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash())}hash(){var t=this.blocks;let e=this.h0,n=this.h1,i=this.h2,r=this.h3,s=this.h4,l=this.h5,u=this.h6,o=this.h7,a,c,h,d,v,f,_,p,g,y,b;for(a=16;a<64;++a)v=t[a-15],c=(v>>>7|v<<25)^(v>>>18|v<<14)^v>>>3,v=t[a-2],h=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10,t[a]=t[a-16]+c+t[a-7]+h<<0;for(b=n&i,a=0;a<64;a+=4)this.first?(p=704751109,v=t[0]-210244248,o=v-1521486534<<0,r=v+143694565<<0,this.first=!1):(c=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),h=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),p=e&n,d=p^e&i^b,_=s&l^~s&u,v=o+h+_+m[a]+t[a],f=c+d,o=r+v<<0,r=v+f<<0),c=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),h=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),g=r&e,d=g^r&n^p,_=o&s^~o&l,v=u+h+_+m[a+1]+t[a+1],f=c+d,u=i+v<<0,i=v+f<<0,c=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),h=(u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7),y=i&r,d=y^i&e^g,_=u&o^~u&s,v=l+h+_+m[a+2]+t[a+2],f=c+d,l=n+v<<0,n=v+f<<0,c=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),h=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),b=n&i,d=b^n&r^y,_=l&u^~l&o,v=s+h+_+m[a+3]+t[a+3],f=c+d,s=e+v<<0,e=v+f<<0;this.h0=this.h0+e<<0,this.h1=this.h1+n<<0,this.h2=this.h2+i<<0,this.h3=this.h3+r<<0,this.h4=this.h4+s<<0,this.h5=this.h5+l<<0,this.h6=this.h6+u<<0,this.h7=this.h7+o<<0}arrayBuffer(){return this.Gn().buffer}dataView(){return this.Gn().dataView}Gn(){this.finalize();var t=new ArrayBuffer(32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),e.setUint32(28,this.h7),{dataView:e,buffer:t}}}}},i={};function r(t){var e=i[t];return void 0!==e||(e=i[t]={exports:{}},n[t].call(e.exports,e,e.exports,r)),e.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r(9638).default})());
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@statsig/js-on-device-eval-client",
3
- "version": "3.8.0",
3
+ "version": "3.8.1",
4
4
  "dependencies": {
5
- "@statsig/client-core": "3.8.0",
6
- "@statsig/sha256": "3.8.0"
5
+ "@statsig/client-core": "3.8.1",
6
+ "@statsig/sha256": "3.8.1"
7
7
  },
8
8
  "jsdelivr": "./build/statsig-js-on-device-eval-client.min.js",
9
9
  "type": "commonjs",