PageSourceSearch

https://odoctor.kg/_next/static/chunks/2532-0b3e70a705fc10ab.js?dpl=2-18-23

js odoctor.kg collected 2026-10-02 00:38:04 UTC 103,993 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="8d46e9ec-a0ce-4c77-aeeb-a6fbb5805f18",e._sentryDebugIdIdentifier="sentry-dbid-8d46e9ec-a0ce-4c77-aeeb-a6fbb5805f18")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2532],{5236:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BatchQueue=void 0;let r=n(15887),s=n(9634);class i{constructor(e=s.EventRetryConstants.DEFAULT_BATCH_SIZE){this._batches=[],this._batchSize=e}batchSize(){return this._batchSize}requeueBatch(e){return this._enqueueBatch(e)}hasFullBatch(){return this._batches.some(e=>e.events.length>=this._batchSize)}takeNextBatch(){return this._batches.shift()}takeAllBatches(){let e=this._batches;return this._batches=[],e}createBatches(e){let t=0,n=0;for(;t<e.length;){let s=e.slice(t,t+this._batchSize);n+=this._enqueueBatch(new r.EventBatch(s)),t+=this._batchSize}return n}_enqueueBatch(e){this._batches.push(e);let t=0;for(;this._batches.length>s.EventRetryConstants.MAX_PENDING_BATCHES;){let e=this._batches.shift();e&&(t+=e.events.length)}return t}}t.BatchQueue=i},5730:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._typedJsonParse=void 0;let r=n(12479);t._typedJsonParse=function(e,t,n){try{let n=JSON.parse(e);if(n&&"object"==typeof n&&t in n)return n}catch(e){}return r.Log.error(`Failed to parse ${n}`),null}},6846:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UrlConfiguration=void 0;let r=n(80649),s=n(83385),i={[s.Endpoint._initialize]:"i",[s.Endpoint._rgstr]:"e",[s.Endpoint._download_config_specs]:"d"};class a{constructor(e,t,n,r){this.customUrl=null,this.fallbackUrls=null,this.endpoint=e,this.endpointDnsKey=i[e],t&&(this.customUrl=t),!t&&n&&(this.customUrl=n.endsWith("/")?`${n}${e}`:`${n}/${e}`),r&&(this.fallbackUrls=r);const a=s.NetworkDefault[e];this.defaultUrl=`${a}/${e}`}getUrl(){var e;return null!=(e=this.customUrl)?e:this.defaultUrl}getChecksum(){var e;let t=(null!=(e=this.fallbackUrls)?e:[]).sort().join(",");return(0,r._DJB2)(this.customUrl+t)}}t.UrlConfiguration=a},9634:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EventRetryConstants=void 0,t.EventRetryConstants={MAX_RETRY_ATTEMPTS:8,DEFAULT_BATCH_SIZE:100,MAX_PENDING_BATCHES:40,TICK_INTERVAL_MS:1e3,QUICK_FLUSH_WINDOW_MS:200,MAX_LOCAL_STORAGE:500,get MAX_QUEUED_EVENTS(){return this.DEFAULT_BATCH_SIZE*this.MAX_PENDING_BATCHES}}},9885:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function o(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._makeDataAdapterResult=t.DataAdapterCore=void 0;let s=n(12479),i=n(51269),a=n(93077),o=n(85029),l=n(5730);class u{constructor(e,t){this._adapterName=e,this._cacheSuffix=t,this._options=null,this._sdkKey=null,this._cacheLimit=10,this._lastModifiedStoreKey=`statsig.last_modified_time.${t}`,this._inMemoryCache=new c}attach(e,t,n){this._sdkKey=e,this._options=t}getDataSync(e){let t=e&&(0,a._normalizeUser)(e,this._options),n=this._getCacheKey(t),r=this._inMemoryCache.get(n,t);if(r&&this._getIsCacheValueValid(r))return r;let s=this._loadFromCache(n);return s&&this._getIsCacheValueValid(s)?(this._inMemoryCache.add(n,s,this._cacheLimit),this._inMemoryCache.get(n,t)):null}setData(e,t){let n=t&&(0,a._normalizeUser)(t,this._options),r=this._getCacheKey(n);this._inMemoryCache.add(r,d("Bootstrap",e,null,n),this._cacheLimit)}_getIsCacheValueValid(e){return null==e.stableID||e.stableID===i.StableID.get(this._getSdkKey())}_getDataAsyncImpl(e,t,n){return r(this,void 0,void 0,function*(){o.Storage.isReady()||(yield o.Storage.isReadyResolver());let r=null!=e?e:this.getDataSync(t),i=[this._fetchAndPrepFromNetwork(r,t,n)];return(null==n?void 0:n.timeoutMs)&&i.push(new Promise(e=>setTimeout(e,n.timeoutMs)).then(()=>(s.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(i)})}_prefetchDataImpl(e,t){return r(this,void 0,void 0,function*(){let n=e&&(0,a._normalizeUser)(e,this._options),r=this._getCacheKey(n),s=yield this._getDataAsyncImpl(null,n,t);s&&this._inMemoryCache.add(r,Object.assign(Object.assign({},s),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(e,t,n){return r(this,void 0,void 0,function*(){var r;let a=null!=(r=null==e?void 0:e.data)?r:null,o=null!=e&&this._isCachedResultValidFor204(e,t),u=yield this._fetchFromNetwork(a,t,n,o);if(!u)return s.Log.debug("No response returned for latest value"),null;
1let c=(0,l._typedJsonParse)(u,"has_updates","Response"),_=this._getSdkKey(),h=i.StableID.get(_),g=null;if((null==c?void 0:c.has_updates)===!0)g=d("Network",u,h,t);else{if(!a||(null==c?void 0:c.has_updates)!==!1)return null;g=d("NetworkNotModified",a,h,t)}let f=this._getCacheKey(t);return this._inMemoryCache.add(f,g,this._cacheLimit),this._writeToCache(f,g),g})}_getSdkKey(){return null!=this._sdkKey?this._sdkKey:(s.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(e){var t;let n=null==(t=o.Storage.getItem)?void 0:t.call(o.Storage,e);if(null==n)return null;let r=(0,l._typedJsonParse)(n,"source","Cached Result");return r?Object.assign(Object.assign({},r),{source:"Cache"}):null}_writeToCache(e,t){let n=JSON.stringify(t);for(let t=0;t<8;t++)try{o.Storage.setItem(e,n);break}catch(t){if(!(t instanceof Error)||!(t.toString().includes("QuotaExceededError")||t.toString().includes("QUOTA_EXCEEDED_ERR"))||this._cacheLimit<=1)throw t;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(e,this._cacheLimit-1)}this._runLocalStorageCacheEviction(e)}_runLocalStorageCacheEviction(e,t=this._cacheLimit){var n;let r=null!=(n=(0,o._getObjectFromStorage)(this._lastModifiedStoreKey))?n:{};for(let n of(r[e]=Date.now(),_(r,t)))delete r[n],o.Storage.removeItem(n);(0,o._setObjectInStorage)(this._lastModifiedStoreKey,r)}}function d(e,t,n,r){return{source:e,data:t,receivedAt:Date.now(),stableID:n,fullUserHash:(0,a._getFullUserHash)(r)}}t.DataAdapterCore=u,t._makeDataAdapterResult=d;class c{constructor(){this._data={}}get(e,t){var n;let r=this._data[e],i=null==r?void 0:r.stableID,a=null==(n=null==t?void 0:t.customIDs)?void 0:n.stableID;return a&&i&&a!==i?(s.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):r}add(e,t,n){for(let e of _(this._data,n-1))delete this._data[e];this._data[e]=t}merge(e){this._data=Object.assign(Object.assign({},this._data),e)}}function _(e,t){let n=Object.keys(e);return n.length<=t?[]:0===t?n:n.sort((t,n)=>{let r=e[t],s=e[n];return"object"==typeof r&&"object"==typeof s?r.receivedAt-s.receivedAt:r-s}).slice(0,n.length-t)}},12479:(e,t)=>{function n(e){return e.unshift("[Statsig]"),e}Object.defineProperty(t,"__esModule",{value:!0}),t.Log=t.LogLevel=void 0,t.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class r{static info(...e){r.level>=t.LogLevel.Info&&console.info("  INFO ",...n(e))}static debug(...e){r.level>=t.LogLevel.Debug&&console.debug(" DEBUG ",...n(e))}static warn(...e){r.level>=t.LogLevel.Warn&&console.warn("  WARN ",...n(e))}static error(...e){r.level>=t.LogLevel.Error&&console.error(" ERROR ",...n(e))}}t.Log=r,r.level=t.LogLevel.Warn},14748:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useClientBootstrapInit=void 0;let r=n(22073),s=n(37888);t.useClientBootstrapInit=function(e,t,n,i=null,a){return(0,s.useStatsigInternalClientFactoryBootstrap)(e=>new r.StatsigClient(e.sdkKey,e.initialUser,e.statsigOptions),{sdkKey:e,initialUser:t,initialValues:n,statsigOptions:i,useLegacyFormat:a})}},15887:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EventBatch=void 0;class n{constructor(e){this.attempts=0,this.createdAt=Date.now(),this.events=e}incrementAttempts(){this.attempts++}}t.EventBatch=n},16075:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._fastApproxSizeOf=void 0,t._fastApproxSizeOf=(e,t)=>{let n=[e],r=[Object.keys(e)],s=[0],i=[0],a=0,o=0;for(;;){if(s[a]<r[a].length){let e=r[a][s[a]++],o=n[a][e];if(i[a]+=e.length,o&&"object"==typeof o){n[++a]=o,r[a]=Object.keys(o),s[a]=i[a]=0;continue}if(i[a]+=(o+"").length+1,i[a]<t)continue}for(o=i[a--];a>=0&&(i[a]+=o+2)>=t;o=i[a--]);if(a<0)return o}}},16993:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useStatsigClient=void 0;let r=n(7620),s=n(32501),i=n(21156),a=n(26670);t.useStatsigClient=function(){let{client:e,renderVersion:t,isLoading:n}=(0,r.useContext)(a.default),o=(0,r.useMemo)(()=>(0,i.isNoopClient)(e)?(s.Log.warn("Attempting to retrieve a StatsigClient but none was set."),i.NoopEvaluationsClient):e,[e,t]),l=[o,t],u=(0,r.useCallback)((e,t)=>o.checkGate(e,t),l),d=(0,r.useCallback)((e,t)=>o.getFeatureGate(e,t),l),c=(0,r.useCallback)((e,t)=>o.getDynamicConfig(e,t),l),_=(0,r.useCallback)((e,t)=>o.getExperiment(e,t),l),h=(0,r.useCallback)((e,t)=>o.getLayer(e,t),l),g=(0,r.useCallback)((e,t)=>o.getParameterStore(e,t),l),f=(0,r.useCallback)((e,t,n)=>"string"==typeof e?o.logEvent(e,t,n):o.logEvent(e),l);return(0,r.useMemo)(()=>({client:o,checkGate:u,getFeatureGate:d,getDynamicConfig:c,getExperiment:_,getLayer:h,getParameterStore:g,logEvent:f,isLoading:n}),[o,u,d,c,_,h,g,f,n])}},17162:(e,t)=>
1{Object.defineProperty(t,"__esModule",{value:!0})},17627:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigMetadataProvider=t.SDK_VERSION=void 0,t.SDK_VERSION="3.33.4";let n={sdkVersion:t.SDK_VERSION,sdkType:"js-mono"};t.StatsigMetadataProvider={get:()=>n,add:e=>{n=Object.assign(Object.assign({},n),e)}}},17693:(e,t)=>{let n;Object.defineProperty(t,"__esModule",{value:!0}),t.SDKType=void 0;let r={};t.SDKType={_get:e=>{var t;return(null!=(t=r[e])?t:"js-mono")+(null!=n?n:"")},_setClientType(e,t){r[e]=t},_setBindingType(e){n&&"-react"!==n||(n="-"+e)}}},18058:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useStatsigInternalClientFactoryAsync=void 0;let r=n(7620),s=n(32501);t.useStatsigInternalClientFactoryAsync=function(e,t){let n=(0,r.useMemo)(()=>{var n;return null!=(n=(0,s._getInstance)(t.sdkKey))?n:e(t)},[]),[i,a]=(0,r.useState)("Ready"!==n.loadingStatus);return(0,r.useMemo)(()=>{"Ready"!==n.loadingStatus&&n.initializeAsync().catch(s.Log.error).finally(()=>a(!1))},[]),{client:n,isLoading:i}}},19097:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DataAdapterCachePrefix=void 0,t.DataAdapterCachePrefix="statsig.cached"},19230:(e,t,n)=>{var r,s,i;Object.defineProperty(t,"__esModule",{value:!0}),t._getInstance=t._getStatsigGlobalFlag=t._getStatsigGlobal=void 0;let a=n(12479);t._getStatsigGlobal=()=>{try{return"u">typeof __STATSIG__?__STATSIG__:c}catch(e){return c}},t._getStatsigGlobalFlag=e=>(0,t._getStatsigGlobal)()[e],t._getInstance=e=>{let n=(0,t._getStatsigGlobal)();return e?n.instances&&n.instances[e]:(n.instances&&Object.keys(n.instances).length>1&&a.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."),n.firstInstance)};let o="__STATSIG__",l="u">typeof window?window:{},u=void 0!==n.g?n.g:{},d="u">typeof globalThis?globalThis:{},c=null!=(i=null!=(s=null!=(r=l[o])?r:u[o])?s:d[o])?i:{instance:t._getInstance};l[o]=c,u[o]=c,d[o]=c},19542:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},20722:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function o(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._fetchTxtRecords=void 0;let 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=["i","e","d"];t._fetchTxtRecords=function(e){return n(this,void 0,void 0,function*(){let t=yield e("https://cloudflare-dns.com/dns-query",{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:r});if(!t.ok){let e=Error("Failed to fetch TXT records from DNS");throw e.name="DnsTxtFetchError",e}return function(e){let t=e.findIndex((t,n)=>n<200&&"="===String.fromCharCode(t)&&s.includes(String.fromCharCode(e[n-1])));if(-1===t){let e=Error("Failed to parse TXT records from DNS");throw e.name="DnsTxtParseError",e}let n="";for(let r=t-1;r<e.length;r++)n+=String.fromCharCode(e[r]);return n.split(",")}(new Uint8Array((yield t.arrayBuffer())))})}},21156:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNoopClient=t.NoopEvaluationsClient=void 0;let r=n(32501),s={success:!1,error:Error("NoClient"),duration:0,source:"Uninitialized",sourceUrl:null},i=()=>{},a=()=>s,o=()=>Promise.resolve(),l=()=>Promise.resolve(s),u={reason:"Error:NoClient"},d=e=>(...t)=>{let n="string"==typeof t[0]?t[0]:t[1];switch(e){case"gate":return(0,r._makeFeatureGate)(n,u,null);case"config":return(0,r._makeDynamicConfig)(n,u,null);case"layer":return(0,r._makeLayer)(n,u,null);case"param_store":return{name:n}}},c={sdkKey:"",options:{},values:null,user:{userID:""},errorBoundary:{},session:{data:{sessionID:"",startTime:0,lastUpdate:0},sdkKey:"",lastPersistedAt:0,storageKey:""},stableID:"",storageProvider:r.Storage,sdkInstanceID:""},_=new r.PrecomputedEvaluationsContextHandle("",()=>({}),()=>({}),()=>null,()=>({userID:""}),()=>"");t.NoopEvaluationsClient={isNoop:!0,loadingStatus:"Uninitialized",initializeSync:a,initializeAsync:l,shutdown:o,flush:o,updateRuntimeOptions:i,updateUserSync:a,updateUserAsync:l,getContext:()=>Object.assign({},c),getContextHandle:()=>_,checkGate:()=>!1,getFeatureGate:d("gate"),getDynamicConfig:d("config"),getExperiment:d("config"),getLayer:d("layer"),getParameterStore:d("param_store"),logEvent:i,on:i,off:i,$on:i,$emt:i,dataAdapter:{attach:i,getDataSync:()=>null,getDataAsync:()=>Promise.resolve(null),setData:i,setDataLegacy:i,prefetchData:o}},t.isNoopClient=function(e){return"isNoop"in e}},21268:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
1ise))(function(s,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function o(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigEvaluationsDataAdapter=void 0;let s=n(32501),i=n(58559);class a extends s.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(e,t,n){super.attach(e,t,n),null!==n&&n instanceof i.default?this._network=n:this._network=new i.default(null!=t?t:{})}getDataAsync(e,t,n){return this._getDataAsyncImpl(e,(0,s._normalizeUser)(t,this._options),n)}prefetchData(e,t){return this._prefetchDataImpl(e,t)}setData(e){let t=(0,s._typedJsonParse)(e,"has_updates","data");t&&"user"in t?super.setData(e,t.user):s.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(e,t){super.setData(e,t)}_fetchFromNetwork(e,t,n,s){return r(this,void 0,void 0,function*(){var r;let i=yield null==(r=this._network)?void 0:r.fetchEvaluations(this._getSdkKey(),e,null==n?void 0:n.priority,t,s);return null!=i?i:null})}_getCacheKey(e){var t;let n=(0,s._getStorageKey)(this._getSdkKey(),e,null==(t=this._options)?void 0:t.customUserCacheKeyFunc);return`${s.DataAdapterCachePrefix}.${this._cacheSuffix}.${n}`}_isCachedResultValidFor204(e,t){return null!=e.fullUserHash&&e.fullUserHash===(0,s._getFullUserHash)(t)}}t.StatsigEvaluationsDataAdapter=a},22073:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClient=void 0;let i=n(32501),a=n(81389);t.StatsigClient=a.default,s(n(32501),t),t.default=Object.assign((0,i._getStatsigGlobal)(),{StatsigClient:a.default})},22300:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function o(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkCore=t.RETRYABLE_CODES=void 0,n(19230);let s=n(19230),i=n(84073),a=n(12479),o=n(83385),l=n(30011),u=n(23848),d=n(17693),c=n(55857),_=n(61752),h=n(51269),g=n(91139),f=n(17627),v=n(61065),p=n(79490);t.RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]);class m{constructor(e,t){this._emitter=t,this._errorBoundary=null,this._timeout=1e4,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,e&&(this._options=e),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new l.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(e))}setLogEventCompressionMode(e){this._options.logEventCompressionMode=e}setErrorBoundary(e){this._errorBoundary=e,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(e)}isBeaconSupported(){return"u">typeof navigator&&"function"==typeof navigator.sendBeacon}getLastUsedInitUrlAndReset(){let e=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,e}beacon(e,t){if(!y(e))return t&&(t.path="beacon_invalid_sdk_key"),!1;let n=this._getInternalRequestArgs("POST",e),r=this._getPopulatedURL(n),s=navigator;try{let e=s.sendBeacon.bind(s)(r,n.body);return!e&&t&&(t.path="beacon_send_false"),e}catch(e){throw t&&(t.path="beacon_send_exception"),e}}post(e,t){return r(this,void 0,void 0,function*(){let n=this._getInternalRequestArgs("POST",e);return this._tryEncodeBody(n),yield this._tryToCompressBody(n),this._sendRequest(n,t)})}get(e){let t=this._getInternalRequestArgs("GET",e);return this._sendRequest(t)}_sendRequest(e,n){return r(this,void 0,void 0,function*(){var s,l,u,d,_,h,f,v,m,b,k,C,w,I,D,O,P,x,M;if(!y(e))return n&&(n.path="network_invalid_sdk_key"),null;if(this._netConfig.preventAllNetworkTraffic)return n&&(n.path="network_prevent_all_network_traffic"),null;let{method:F,body:j,retries:L,attempt:U}=e,T=e.urlConfig.endpoint;if(this._isRateLimited(T))return a.Log.warn(`Request to ${T} was blocked because you are making requests too frequently.`),n&&(n.path="network_rate_limited"),null;let A=null!=U?U:1,R=!1,B=this._getPopulatedURL(e),N=Date.now(),K=null,$=(0,p._isUnloading)();try{let t,n={method:F,body:j,headers:Object.assign({},e.headers),priority:e.priority,keepalive:$};_=e,h=A,_.urlConfig.endpoint===o.Endpoint._initialize&&i.Diagnostics._markInitNetworkReqStart(_.sdkKey,{attempt:h});let r=this._leakyBucket[T];
1r&&(r.lastRequestTime=Date.now(),this._leakyBucket[T]=r);let a=null!=(s=this._netConfig.networkOverrideFunc)?s:fetch;if(!(K=yield Promise.race([a(B,n).finally(()=>clearTimeout(t)),new Promise((e,n)=>{t=setTimeout(()=>{R=!0,n(Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})])).ok){let e=yield K.text().catch(()=>"No Text"),t=Error(`NetworkError: ${B} ${e}`);throw t.name="NetworkError",t}let l=yield K.text();return E(e,K,A,l),this._fallbackResolver.tryBumpExpiryTime(e.sdkKey,e.urlConfig),{body:l,code:K.status}}catch(o){let s="string"==typeof(f=o)?f:f instanceof Error?`${f.name}: ${f.message}`:"Unknown Error",i=(v=null!=s?s:"",m=R,v.includes("Timeout")||m);if(E(e,K,A,"",o),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(e.sdkKey,e.urlConfig,s,i))&&(e.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(e.sdkKey,e.urlConfig)),!L||A>L||!t.RETRYABLE_CODES.has(null!=(l=null==K?void 0:K.status)?l:500)){null==(u=this._emitter)||u.call(this,{name:"error",error:o,tag:g.ErrorTag.NetworkError,requestArgs:e});let t=`A networking error occurred during ${F} request to ${B}.`;if(a.Log.error(t,s,o),null==(d=this._errorBoundary)||d.attachErrorIfNoneExists(t),e.preserveFailedStatusCode&&null!=K)return{body:null,code:K.status};if(null==K&&n){n.path=i?"network_request_timed_out_no_response":"network_request_exception_no_response",s&&(n.errorMessage=s);try{let t,r,s,a,o,l,u,d,_,h,g,f,v,m=(b=e,k=B,C=i,w=Date.now()-N,t=(0,c._getWindowSafe)(),r=null==t?void 0:t.document,s="u">typeof navigator?navigator:null,a=(0,p._isUnloading)(),o=s&&"boolean"==typeof s.onLine?String(s.onLine):"unknown",l=null!=(I=null==r?void 0:r.visibilityState)?I:"unknown",u=Object.keys(null!=(D=b.headers)?D:{}).length>0,d=(P=k,!(x=null==(O=null==t?void 0:t.location)?void 0:O.origin)||!P.startsWith(`${x}/`)&&!P.startsWith(`${x}?`)&&P!==x),_=null!=b.urlConfig.customUrl,h=null!=b.fallbackUrl,g=S(w,[250,1e3,5e3,1e4]),f=S((M=b.body,null==M?0:"string"==typeof M?M.length:M instanceof Uint8Array?M.byteLength:"u">typeof Blob&&M instanceof Blob?M.size:-1),[16384,65536,262144,1048576]),v="unknown_no_response",C?v="timeout":"false"===o?v="browser_offline":a?v="page_unloading":"hidden"===l?v="page_hidden":d&&u?v="cross_origin_custom_headers_preflight_risk":_||h?v="custom_url_no_response":w<250&&(v="immediate_network_rejection"),{bucket:v,metadata:{elapsedMsBucket:g,bodySizeBucket:f,online:o,visibilityState:l,isUnloading:String(a),crossOrigin:String(d),hasCustomUrl:String(_)}});n.diagnosticBucket=m.bucket,n.diagnosticMetadata=m.metadata}catch(e){}}return null}return yield function(e){return r(this,void 0,void 0,function*(){yield new Promise(t=>setTimeout(t,Math.min(e*e*500,3e4)))})}(A),this._sendRequest(Object.assign(Object.assign({},e),{retries:L,attempt:A+1}),n)}})}_getLogEventCompressionMode(e){let t=null==e?void 0:e.logEventCompressionMode;return t||(null==e?void 0:e.disableCompression)!==!0||(t=v.LogEventCompressionMode.Disabled),t||(t=v.LogEventCompressionMode.Enabled),t}_isRateLimited(e){var t;let n=Date.now(),r=null!=(t=this._leakyBucket[e])?t:{count:0,lastRequestTime:n},s=Math.floor((n-r.lastRequestTime)*.05);return r.count=Math.max(0,r.count-s),r.count>=50||(r.count+=1,r.lastRequestTime=n,this._leakyBucket[e]=r,!1)}_getPopulatedURL(e){var t;let n=null!=(t=e.fallbackUrl)?t:e.urlConfig.getUrl();(e.urlConfig.endpoint===o.Endpoint._initialize||e.urlConfig.endpoint===o.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=n);let r=Object.assign({[o.NetworkParam.SdkKey]:e.sdkKey,[o.NetworkParam.SdkType]:d.SDKType._get(e.sdkKey),[o.NetworkParam.SdkVersion]:f.SDK_VERSION,[o.NetworkParam.Time]:String(Date.now()),[o.NetworkParam.SessionID]:_.SessionID.get(e.sdkKey)},e.params),s=Object.keys(r).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(r[e])}`).join("&");return`${n}${s?`?${s}`:""}`}_tryEncodeBody(e){var t;let n=(0,c._getWindowSafe)(),r=e.body;if(e.isStatsigEncodable&&!this._options.disableStatsigEncoding&&"string"==typeof r&&null==(0,s._getStatsigGlobalFlag)("no-encode")&&(null==n?void 0:n.btoa))try{e.body=n.btoa(r).split("").reverse().join(""),e.params=Object.assign(Object.assign({},null!=(t=e.params)?t:{}),{[o.NetworkParam.StatsigEncoded]:"1"})}catch(t){a.Log.warn(`Request encoding failed for ${e.urlConfig.getUrl()}`,t)}}_tryToCompressBody(e){return r(this,void 0,void 0,function*(){var t;let n=e.body;if("string"==typeof n&&function(e,t){if(!e.isCompressable||null!=(0,s._getStatsigGlobalFlag)("no-compress")||"u"<typeof CompressionStream||"u"<typeof TextEncoder)return!1;let n=null!=e.urlConfig.customUrl||null!=e.urlConfig.fallbackUrls,r=!0===u.SDKFlags.get(e.sdkKey,"enable_log_event_compression");switch(t.logEventCompressionMode){case v.LogEventCompressionMode.Disabled:return!1;case v.LogEventCompressionMode.Enabled:if(n&&!r)return!1;return!0;case v.LogEventCompressionMode.Forced:return!0;default:return!1}}(e,this._options))try{let r,s=new TextEncoder().encode(n),i=new CompressionStream("gzip"),l=i.writable.getWriter();l.write(s).catch(a.Log.error),l.close().catch(a.Log.error);let u=i.readable.getReader(),d=[];for(;!(r=yield u.read()).done;)d.push(r.value);let c=d.reduce((e,t)=>
1e+t.length,0),_=new Uint8Array(c),h=0;for(let e of d)_.set(e,h),h+=e.length;e.body=_,e.params=Object.assign(Object.assign({},null!=(t=e.params)?t:{}),{[o.NetworkParam.IsGzipped]:"1"})}catch(t){a.Log.warn(`Request compression failed for ${e.urlConfig.getUrl()}`,t)}})}_getInternalRequestArgs(e,t){let n=this._fallbackResolver.getActiveFallbackUrl(t.sdkKey,t.urlConfig),r=Object.assign(Object.assign({},t),{method:e,fallbackUrl:n});return"data"in t&&b(r,t.data),r}}t.NetworkCore=m;let y=e=>!!e.sdkKey||(a.Log.warn("Unable to make request without an SDK key"),!1),b=(e,t)=>{let{sdkKey:n,fallbackUrl:r}=e,s=h.StableID.get(n),i=_.SessionID.get(n),a=d.SDKType._get(n);e.body=JSON.stringify(Object.assign(Object.assign({},t),{statsigMetadata:Object.assign(Object.assign({},f.StatsigMetadataProvider.get()),{stableID:s,sessionID:i,sdkType:a,fallbackUrl:r})}))};function S(e,t){if(e<0)return"unknown";for(let n of t)if(e<n)return`<${n}`;return`>=${t[t.length-1]}`}function E(e,t,n,r,s){e.urlConfig.endpoint===o.Endpoint._initialize&&i.Diagnostics._markInitNetworkReqEnd(e.sdkKey,i.Diagnostics._getDiagnosticsData(t,n,r,s))}},22532:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.useStatsigUser=t.useStatsigInternalClientFactoryBootstrap=t.useStatsigInternalClientFactoryAsync=t.useStatsigClient=t.useParameterStore=t.useLayer=t.useGateValue=t.useFeatureGate=t.useExperiment=t.useDynamicConfig=t.useClientBootstrapInit=t.useClientAsyncInit=t.StatsigProvider=t.StatsigContext=void 0;let i=n(32501),a=n(26670);t.StatsigContext=a.default;let o=n(68558);Object.defineProperty(t,"StatsigProvider",{enumerable:!0,get:function(){return o.StatsigProvider}});let l=n(71922);Object.defineProperty(t,"useClientAsyncInit",{enumerable:!0,get:function(){return l.useClientAsyncInit}});let u=n(14748);Object.defineProperty(t,"useClientBootstrapInit",{enumerable:!0,get:function(){return u.useClientBootstrapInit}});let d=n(76962);t.useDynamicConfig=d.default;let c=n(63184);t.useExperiment=c.default;let _=n(93616);t.useFeatureGate=_.default;let h=n(73565);t.useGateValue=h.default;let g=n(66212);t.useLayer=g.default;let f=n(51471);t.useParameterStore=f.default;let v=n(16993);Object.defineProperty(t,"useStatsigClient",{enumerable:!0,get:function(){return v.useStatsigClient}});let p=n(18058);Object.defineProperty(t,"useStatsigInternalClientFactoryAsync",{enumerable:!0,get:function(){return p.useStatsigInternalClientFactoryAsync}});let m=n(37888);Object.defineProperty(t,"useStatsigInternalClientFactoryBootstrap",{enumerable:!0,get:function(){return m.useStatsigInternalClientFactoryBootstrap}});let y=n(96717);Object.defineProperty(t,"useStatsigUser",{enumerable:!0,get:function(){return y.useStatsigUser}}),s(n(22073),t),Object.assign((0,i._getStatsigGlobal)(),{StatsigContext:a.default,StatsigProvider:o.StatsigProvider,useClientAsyncInit:l.useClientAsyncInit,useClientBootstrapInit:u.useClientBootstrapInit,useDynamicConfig:d.default,useExperiment:c.default,useFeatureGate:_.default,useGateValue:h.default,useLayer:g.default,useParameterStore:f.default,useStatsigClient:v.useStatsigClient,useStatsigInternalClientFactoryAsync:p.useStatsigInternalClientFactoryAsync,useStatsigInternalClientFactoryBootstrap:m.useStatsigInternalClientFactoryBootstrap,useStatsigUser:y.useStatsigUser})},23848:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SDKFlags=void 0;let n={};t.SDKFlags={setFlags:(e,t)=>{n[e]=t},get:(e,t)=>{var r,s;return null!=(s=null==(r=n[e])?void 0:r[t])&&s}}},26670:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(7620),s=n(21156);t.default=(0,r.createContext)({renderVersion:0,client:s.NoopEvaluationsClient,isLoading:!0})},30011:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
1ise))(function(s,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function o(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._isDomainFailure=t.NetworkFallbackResolver=void 0;let s=n(20722),i=n(80649),a=n(12479),o=n(85029);class l{constructor(e){var t;this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=null==(t=e.networkConfig)?void 0:t.networkOverrideFunc}setErrorBoundary(e){this._errorBoundary=e}tryBumpExpiryTime(e,t){var n;let r=null==(n=this._fallbackInfo)?void 0:n[t.endpoint];r&&(r.expiryTime=Date.now()+6048e5,c(e,Object.assign(Object.assign({},this._fallbackInfo),{[t.endpoint]:r})))}getActiveFallbackUrl(e,t){var n,r;if(null!=t.customUrl&&null!=t.fallbackUrls)return null;let s=this._fallbackInfo;null==s&&(s=null!=(n=function(e){let t=d(e),n=o.Storage.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch(e){return a.Log.error("Failed to parse FallbackInfo"),null}}(e))?n:{},this._fallbackInfo=s);let i=s[t.endpoint];return!i||Date.now()>(null!=(r=i.expiryTime)?r:0)||t.getChecksum()!==i.urlConfigChecksum?(delete s[t.endpoint],this._fallbackInfo=s,c(e,this._fallbackInfo),null):i.url?i.url:null}tryFetchUpdatedFallbackInfo(e,t,n,s){return r(this,void 0,void 0,function*(){var r,i;try{if(!u(n,s))return!1;let i=null==t.customUrl&&null==t.fallbackUrls?yield this._tryFetchFallbackUrlsFromNetwork(t):t.fallbackUrls,a=this._pickNewFallbackUrl(null==(r=this._fallbackInfo)?void 0:r[t.endpoint],i);if(!a)return!1;return this._updateFallbackInfoWithNewUrl(e,t,a),!0}catch(e){return null==(i=this._errorBoundary)||i.logError("tryFetchUpdatedFallbackInfo",e),!1}})}_updateFallbackInfoWithNewUrl(e,t,n){var r,s,i;let a={urlConfigChecksum:t.getChecksum(),url:n,expiryTime:Date.now()+6048e5,previous:[]},o=t.endpoint,l=null==(r=this._fallbackInfo)?void 0:r[o];l&&a.previous.push(...l.previous),a.previous.length>10&&(a.previous=[]);let u=null==(i=null==(s=this._fallbackInfo)?void 0:s[o])?void 0:i.url;null!=u&&a.previous.push(u),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[o]:a}),c(e,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(e){return r(this,void 0,void 0,function*(){var t;let n=this._dnsQueryCooldowns[e.endpoint];if(n&&Date.now()<n)return null;this._dnsQueryCooldowns[e.endpoint]=Date.now()+144e5;let r=[],i=yield(0,s._fetchTxtRecords)(null!=(t=this._networkOverrideFunc)?t:fetch),a=function(e){try{return new URL(e).pathname}catch(e){return null}}(e.defaultUrl);for(let t of i){if(!t.startsWith(e.endpointDnsKey+"="))continue;let n=t.split("=");if(n.length>1){let e=n[1];e.endsWith("/")&&(e=e.slice(0,-1)),r.push(`https://${e}${a}`)}}return r})}_pickNewFallbackUrl(e,t){var n;if(null==t)return null;let r=new Set(null!=(n=null==e?void 0:e.previous)?n:[]),s=null==e?void 0:e.url,i=null;for(let e of t){let t=e.endsWith("/")?e.slice(0,-1):e;if(!r.has(e)&&t!==s){i=t;break}}return i}}function u(e,t){var n;let r=null!=(n=null==e?void 0:e.toLowerCase())?n:"";return t||r.includes("uncaught exception")||r.includes("failed to fetch")||r.includes("networkerror when attempting to fetch resource")}function d(e){return`statsig.network_fallback.${(0,i._DJB2)(e)}`}function c(e,t){let n=d(e);t&&0!==Object.keys(t).length?o.Storage.setItem(n,JSON.stringify(t)):o.Storage.removeItem(n)}t.NetworkFallbackResolver=l,t._isDomainFailure=u},30407:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.V1InitializeContainer=void 0;let r=n(32501);class s{constructor(e){this._values=e}getGate(e){return this._getResultFromLookup(this._values.feature_gates,e)}getConfig(e){return this._getResultFromLookup(this._values.dynamic_configs,e)}getLayer(e){return this._getResultFromLookup(this._values.layer_configs,e)}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,t){var n,s;return e&&null!=(s=null!=(n=e[t])?n:e[(0,r._DJB2)(t)])?s:null}}t.V1InitializeContainer=s},32501:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var s=Object.getOwnPropertyDescriptor(t,n);
1(!s||("get"in s?!t.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,s)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=t.Log=t.EventLogger=t.Diagnostics=void 0,n(19230);let i=n(19230),a=n(84073);Object.defineProperty(t,"Diagnostics",{enumerable:!0,get:function(){return a.Diagnostics}});let o=n(51049);Object.defineProperty(t,"EventLogger",{enumerable:!0,get:function(){return o.EventLogger}});let l=n(12479);Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return l.Log}});let u=n(17627),d=n(85029);Object.defineProperty(t,"Storage",{enumerable:!0,get:function(){return d.Storage}}),s(n(19230),t),s(n(96038),t),s(n(55536),t),s(n(9885),t),s(n(84073),t),s(n(97580),t),s(n(46693),t),s(n(92805),t),s(n(19542),t),s(n(80649),t),s(n(17162),t),s(n(12479),t),s(n(38848),t),s(n(83385),t),s(n(22300),t),s(n(37790),t),s(n(57730),t),s(n(55857),t),s(n(17693),t),s(n(61752),t),s(n(16075),t),s(n(51269),t),s(n(55192),t),s(n(91139),t),s(n(19097),t),s(n(99842),t),s(n(17627),t),s(n(61065),t),s(n(64917),t),s(n(97596),t),s(n(57919),t),s(n(93077),t),s(n(85029),t),s(n(5730),t),s(n(47605),t),s(n(6846),t),s(n(79056),t),s(n(79490),t),s(n(74455),t),s(n(23848),t),Object.assign((0,i._getStatsigGlobal)(),{Log:l.Log,SDK_VERSION:u.SDK_VERSION})},37790:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},37888:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useStatsigInternalClientFactoryBootstrap=void 0;let r=n(7620),s=n(32501);t.useStatsigInternalClientFactoryBootstrap=function(e,t){let n=(0,r.useRef)((0,s._getInstance)(t.sdkKey));return(0,r.useMemo)(()=>{if(n.current)return n.current;let r=e(t);return n.current=r,t.useLegacyFormat?r.dataAdapter.setDataLegacy(t.initialValues,t.initialUser):r.dataAdapter.setData(t.initialValues),r.initializeSync(),r},[])}},38848:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createMemoKey=t.MemoPrefix=void 0,t.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};let n=new Set([]),r=new Set(["userPersistedValues"]);t.createMemoKey=function(e,t,s){let i=`${e}|${t}`;if(!s)return i;for(let e of Object.keys(s)){if(r.has(e))return;n.has(e)?i+=`|${e}=true`:i+=`|${e}=${s[e]}`}return i}},46693:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function o(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorBoundary=t.EXCEPTION_ENDPOINT=void 0;let s=n(12479),i=n(17693),a=n(17627);t.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";let o="[Statsig] UnknownError";class l{constructor(e,t,n,r){this._sdkKey=e,this._options=t,this._emitter=n,this._lastSeenError=r,this._seen=new Set}wrap(e,t){try{(function(e){let t=new Set,n=Object.getPrototypeOf(e);for(;n&&n!==Object.prototype;)Object.getOwnPropertyNames(n).filter(e=>"function"==typeof(null==n?void 0:n[e])).forEach(e=>t.add(e)),n=Object.getPrototypeOf(n);return Array.from(t)})(e).forEach(n=>{let r=e[n];"$EB"in r||(e[n]=(...s)=>this._capture(t?`${t}:${n}`:n,()=>r.apply(e,s)),e[n].$EB=!0)})}catch(e){this._onError("eb:wrap",e)}}logError(e,t){this._onError(e,t)}
1logDroppedEvents(e,t,n){let r={eventCount:String(e),reason:t};n&&Object.keys(n).forEach(e=>{r[e]=String(n[e])}),this._onError("statsig::log_event_dropped_event_count",Error(t),!0,r)}logEventRequestFailure(e,t,n,r,s,i,a,o,l){let u={eventCount:String(e),flushType:n,statusCode:String(r),reason:t,retries:String(s)};i&&(u.failurePath=i),"string"==typeof a&&a.length>0&&(u.failureErrorMessage=a),"string"==typeof o&&o.length>0&&(u.failureDiagnosticBucket=o),l&&Object.keys(l).forEach(e=>{let t=l[e];t.length>0&&(u[`failureDiagnostic_${e}`]=t)}),this._onError("statsig::log_event_failed",Error(t),!0,u)}getLastSeenErrorAndReset(){let e=this._lastSeenError;return this._lastSeenError=void 0,null!=e?e:null}attachErrorIfNoneExists(e){this._lastSeenError||(this._lastSeenError=u(e))}_capture(e,t){try{let n=t();if(n&&n instanceof Promise)return n.catch(t=>this._onError(e,t));return n}catch(t){return this._onError(e,t),null}}_onError(e,n,l=!1,d){try{s.Log.warn(`Caught error in ${e}`,{error:n}),r(this,void 0,void 0,function*(){var r,s,c,_,h,g,f;let v=n||Error(o),p=v instanceof Error,m=p?v.name:"No Name",y=u(v);if(this._lastSeenError=y,!l&&this._seen.has(m))return;if(this._seen.add(m),null==(s=null==(r=this._options)?void 0:r.networkConfig)?void 0:s.preventAllNetworkTraffic){null==(c=this._emitter)||c.call(this,{name:"error",error:n,tag:e});return}let b=i.SDKType._get(this._sdkKey),S=a.StatsigMetadataProvider.get(),E=p?v.stack:function(e){try{return JSON.stringify(e)}catch(e){return o}}(v),k=Object.assign(Object.assign({tag:e,exception:m,info:E,statsigOptions:function(e){if(!e)return{};let t={};return Object.keys(e).forEach(n=>{let r=e[n];switch(typeof r){case"number":case"bigint":case"boolean":t[String(n)]=r;break;case"string":r.length<50?t[String(n)]=r:t[String(n)]="set";break;case"object":"environment"===n?t.environment=r:"networkConfig"===n?t.networkConfig=r:t[String(n)]=null!=r?"set":"unset"}}),t}(this._options)},Object.assign(Object.assign({},S),{sdkType:b})),null!=d?d:{}),C=null==(_=this._options)?void 0:_.networkConfig,w=null!=(h=null==C?void 0:C.networkOverrideFunc)?h:fetch;yield w(null!=(g=null==C?void 0:C.sdkExceptionUrl)?g:t.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(b),"STATSIG-SDK-VERSION":String(S.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(k)}),null==(f=this._emitter)||f.call(this,{name:"error",error:n,tag:e})}).then(()=>{}).catch(()=>{})}catch(e){}}}function u(e){return e instanceof Error?e:"string"==typeof e?Error(e):Error("An unknown error occurred.")}t.ErrorBoundary=l},47605:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._isTypeMatch=t._typeOf=void 0,t._typeOf=function(e){return Array.isArray(e)?"array":typeof e},t._isTypeMatch=function(e,t){let n=e=>Array.isArray(e)?"array":null===e?"null":typeof e;return n(e)===n(t)}},51049:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function o(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.EventLogger=void 0;let s=n(5236),i=n(96038),a=n(9634),o=n(90607),l=n(80649),u=n(12479),d=n(83385),c=n(60419),_=n(55857),h=n(99842),g=n(61065),f=n(85029),v=n(6846),p=n(79490),m={};class y{static _safeFlushAndForget(e){var t;null==(t=m[e])||t.flush().catch(()=>{})}constructor(e,t,n,r,s){var i;this._sdkKey=e,this._emitter=t,this._network=n,this._options=r,this._errorBoundary=s,this._pendingEvents=null,this._batchQueue=null,this._flushCoordinator=null,this._lastExposureTimeMap={},this._nonExposedChecks={},this._isShuttingDown=!1,this._storageKey=null,this._pendingCompressionMode=null,this._loggingEnabled=null!=(i=null==r?void 0:r.loggingEnabled)?i:(null==r?void 0:r.disableLogging)===!0?g.LoggingEnabledOption.disabled:g.LoggingEnabledOption.browserOnly,(null==r?void 0:r.loggingEnabled)&&void 0!==r.disableLogging&&u.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging.");const a=null==r?void 0:r.networkConfig;this._logEventUrlConfig=new v.UrlConfiguration(d.Endpoint._rgstr,null==a?void 0:a.logEventUrl,null==a?void 0:a.api,null==a?void 0:a.logEventFallbackUrls)}setLogEventCompressionMode(e){this._flushCoordinator?this._flushCoordinator.setLogEventCompressionMode(e):this._pe
1ndingCompressionMode=e}setLoggingEnabled(e){let t="disabled"===this._loggingEnabled,n="disabled"!==e;if(this._loggingEnabled=e,this._flushCoordinator&&this._flushCoordinator.setLoggingEnabled(e),t&&n){let e=this._loadStoredEvents();u.Log.debug(`Loaded ${e.length} stored event(s) from storage`),e.length>0&&(e.forEach(e=>{this._initFlushCoordinator().addEvent(e)}),this.flush().catch(e=>{u.Log.warn("Failed to flush events after enabling logging:",e)}))}}enqueue(e){var t;if(!this._shouldLogEvent(e))return;let n=this._normalizeEvent(e);"disabled"===this._loggingEnabled?this._storeEventToStorage(n):(this._initFlushCoordinator().addEvent(n),null==(t=this._flushCoordinator)||t.checkQuickFlush())}incrementNonExposureCount(e){var t;let n=null!=(t=this._nonExposedChecks[e])?t:0;this._nonExposedChecks[e]=n+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var e;let t=(0,_._isServerEnv)();if(t&&(null==(e=this._options)?void 0:e.loggingEnabled)!=="always")return;let n=this._initFlushCoordinator();m[this._sdkKey]=this,t||(0,p._subscribeToVisiblityChanged)(e=>{"background"===e?y._safeFlushAndForget(this._sdkKey):"foreground"===e&&n.startScheduledFlushCycle()}),n.loadAndRetryShutdownFailedEvents().catch(e=>{u.Log.warn("Failed to load failed shutdown events:",e)}),n.startScheduledFlushCycle()}stop(){return r(this,void 0,void 0,function*(){this._isShuttingDown=!0,this._flushCoordinator&&(yield this._flushCoordinator.processShutdown()),delete m[this._sdkKey],this._flushCoordinator=null,this._pendingEvents=null,this._batchQueue=null})}flush(){return r(this,void 0,void 0,function*(){if(this._flushCoordinator)return this._flushCoordinator.processManualFlush()})}appendAndResetNonExposedChecks(){if(0===Object.keys(this._nonExposedChecks).length)return;let e=Object.assign({},this._nonExposedChecks);this._nonExposedChecks={};let t=this._normalizeEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:e}});this._flushCoordinator&&this._flushCoordinator.addEvent(t)}_shouldLogEvent(e){var t;if((null==(t=this._options)?void 0:t.loggingEnabled)!=="always"&&(0,_._isServerEnv)())return!1;if(!(0,h._isExposureEvent)(e))return!0;let n=e.user?e.user:{statsigEnvironment:void 0},r=(0,i._getUserStorageKey)(this._sdkKey,n),s=e.metadata?e.metadata:{},a=[e.eventName,r,s.gate,s.config,s.ruleID,s.allocatedExperiment,s.parameterName,String(s.isExplicitParameter),s.reason].join("|"),o=this._lastExposureTimeMap[a],l=Date.now();return(!o||!(l-o<6e5))&&(Object.keys(this._lastExposureTimeMap).length>1e3&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[a]=l,!0)}_getCurrentPageUrl(){var e;if((null==(e=this._options)?void 0:e.includeCurrentPageUrlWithEvents)!==!1)return(0,_._getCurrentPageUrlSafe)()}_getStorageKey(){return this._storageKey||(this._storageKey=`statsig.pending_events.${(0,l._DJB2)(this._sdkKey)}`),this._storageKey}_initFlushCoordinator(){var e,t;if(this._flushCoordinator)return this._flushCoordinator;let n=null!=(t=null==(e=this._options)?void 0:e.loggingBufferMaxSize)?t:a.EventRetryConstants.DEFAULT_BATCH_SIZE;return this._pendingEvents=new c.PendingEvents(n),this._batchQueue=new s.BatchQueue(n),this._flushCoordinator=new o.FlushCoordinator(this._batchQueue,this._pendingEvents,()=>this.appendAndResetNonExposedChecks(),this._sdkKey,this._network,this._emitter,this._logEventUrlConfig,this._options,this._loggingEnabled,this._errorBoundary),this._pendingCompressionMode&&(this._flushCoordinator.setLogEventCompressionMode(this._pendingCompressionMode),this._pendingCompressionMode=null),this._flushCoordinator}_storeEventToStorage(e){let t=this._getStorageKey();try{let n=this._getEventsFromStorage(t);n.push(e),n.length>a.EventRetryConstants.MAX_LOCAL_STORAGE&&(n=n.slice(-a.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,f._setObjectInStorage)(t,n)}catch(e){u.Log.warn("Unable to save events to storage")}}_getEventsFromStorage(e){try{let t=(0,f._getObjectFromStorage)(e);if(Array.isArray(t))return t;return[]}catch(e){return[]}}_loadStoredEvents(){let e=this._getStorageKey(),t=this._getEventsFromStorage(e);return t.length>0&&f.Storage.removeItem(e),t}_normalizeEvent(e){e.user&&(e.user=Object.assign({},e.user),delete e.user.privateAttributes);let t={},n=this._getCurrentPageUrl();return n&&(t.statsigMetadata={currentPage:n}),Object.assign(Object.assign({},e),t)}}t.EventLogger=y},51269:(e,t,n)=>
1{Object.defineProperty(t,"__esModule",{value:!0}),t.getCookieName=t.StableID=void 0;let r=n(96038),s=n(12479),i=n(55857),a=n(85029),o=n(79056),l={},u={},d={};function c(e){return`statsig.stable_id.${(0,r._getStorageKey)(e)}`}function _(e,t){let n=c(t);try{(0,a._setObjectInStorage)(n,e)}catch(e){s.Log.warn("Failed to save StableID to storage")}}function h(e,t){if(!u[t]||null==(0,i._getDocumentSafe)())return;let n=new Date;n.setFullYear(n.getFullYear()+1),document.cookie=`${g(t)}=${encodeURIComponent(e)}; expires=${n.toUTCString()}; path=/`}function g(e){return`statsig.stable_id.${(0,r._getStorageKey)(e)}`}t.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:e=>{let t;if(d[e])return null;if(null!=l[e])return l[e];let n=null;return null!=(n=function(e){if(!u[e]||null==(0,i._getDocumentSafe)())return null;for(let t of document.cookie.split(";")){let[n,r]=t.trim().split("=");if(n===g(e))return decodeURIComponent(r)}return null}(e))?(l[e]=n,_(n,e)):(null==(t=c(e),n=(0,a._getObjectFromStorage)(t))&&(n=(0,o.getUUID)()),_(n,e),h(n,e),l[e]=n),n},setOverride:(e,t)=>{l[t]=e,_(e,t),h(e,t)},_setCookiesEnabled:(e,t)=>{u[e]=t},_setDisabled:(e,t)=>{d[e]=t}},t.getCookieName=g},51471:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(7620),s=n(32501),i=n(21156),a=n(26670);t.default=function(e,t){let{client:n,renderVersion:o}=(0,r.useContext)(a.default);return(0,r.useMemo)(()=>(0,i.isNoopClient)(n)?(s.Log.warn(`useParameterStore hook failed to find a valid StatsigClient for parameter store '${e}'.`),i.NoopEvaluationsClient.getParameterStore(e,t)):n.getParameterStore(e,t),[e,n,o,...t?Object.values(t):[]])}},51678:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(32501),s=n(30407),i=n(57004);class a{constructor(e,t){this._sdkKey=e,this._options=t,this._valuesForExternalUse=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._valuesForExternalUse=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._valuesForExternalUse}setValues(e,t){var n,a;if(!e)return!1;let o=(0,r._typedJsonParse)(e.data,"has_updates","EvaluationResponse");return null!=o&&(this._source=e.source,(null==o?void 0:o.has_updates)!==!0||(null!=(n=o.time)?n:0)<this._lcut||(this._valuesForExternalUse=(0,r._typedJsonParse)(e.data,"has_updates","EvaluationResponse"),this._lcut=o.time,this._receivedAt=e.receivedAt,"init-v2"===o.response_format?this._values=new i.V2InitializeContainer(o):this._values=new s.V1InitializeContainer(o),this._bootstrapMetadata=this._extractBootstrapMetadata(e.source,o),e.source&&o.user&&this._setWarningState(t,o),r.SDKFlags.setFlags(this._sdkKey,null!=(a=o.sdk_flags)?a:{}),!0))}getWarnings(){if(0!==this._warnings.size)return Array.from(this._warnings)}getGate(e){let t=this._values?this._values.getGate(e):null;return this._getDetailedStoreResult(t)}getConfig(e){let t=this._values?this._values.getConfig(e):null;return this._getDetailedStoreResult(t)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(e){let t=this._values?this._values.getLayer(e):null;return this._getDetailedStoreResult(t)}getParamStore(e){let t=this._values?this._values.getParamStore(e):null;return this._getDetailedStoreResult(t)}getSource(){return this._source}getExposureMapping(){var e;return null==(e=this._values)?void 0:e.getExposureMapping()}_extractBootstrapMetadata(e,t){if("Bootstrap"!==e)return null;let n={};return t.user&&(n.user=t.user),t.sdkInfo&&(n.generatorSDKInfo=t.sdkInfo),n.lcut=t.time,n}_getDetailedStoreResult(e){return{result:e,details:this._getDetails(null==e)}}_setWarningState(e,t){var n,s,i;let a=r.StableID.get(this._sdkKey);if((null==(n=e.customIDs)?void 0:n.stableID)!==a&&((null==(s=e.customIDs)?void 0:s.stableID)||a))return void this._warnings.add("StableIDMismatch");if("user"in t){let n=t.user,s=Object.assign(Object.assign({},e),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});(null==(i=this._options)?void 0:i.disableStableID)&&(s=Object.assign(Object.assign({}
1,s),{customIDs:Object.assign(Object.assign({},s.customIDs),{stableID:void 0})}),n=Object.assign(Object.assign({},n),{customIDs:Object.assign(Object.assign({},n.customIDs),{stableID:void 0})})),(0,r._getFullUserHash)(s)!==(0,r._getFullUserHash)(n)&&this._warnings.add("PartialUserMatch")}}getCurrentSourceDetails(){if("Uninitialized"===this._source||"NoValues"===this._source)return{reason:this._source};let e={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(e.warnings=Array.from(this._warnings)),e}_getDetails(e){var t,n;let r=this.getCurrentSourceDetails(),s=r.reason,i=null!=(t=r.warnings)?t:[];"Bootstrap"===this._source&&i.length>0&&(s+=i[0]),"Uninitialized"!==s&&"NoValues"!==s&&(s=`${s}:${e?"Unrecognized":"Recognized"}`);let a="Bootstrap"===this._source&&null!=(n=this._bootstrapMetadata)?n:void 0;return a&&(r.bootstrapMetadata=a),Object.assign(Object.assign({},r),{reason:s})}}t.default=a},55192:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function o(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClientBase=void 0,n(19230);let s=n(19230),i=n(46693),a=n(51049),o=n(12479),l=n(38848),u=n(55857),d=n(61752),c=n(51269),_=n(61065),h=n(85029);class g{constructor(e,t,n,r){var l,_,g,f;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};const v=this.$emt.bind(this);(null==r?void 0:r.logLevel)!=null&&(o.Log.level=r.logLevel),(null==r?void 0:r.disableStorage)&&h.Storage._setDisabled(!0),(null==r?void 0:r.initialSessionID)&&d.StatsigSession.overrideInitialSessionID(r.initialSessionID,e),(null==r?void 0:r.storageProvider)&&h.Storage._setProvider(r.storageProvider),(null==r?void 0:r.enableCookies)&&c.StableID._setCookiesEnabled(e,r.enableCookies),(null==r?void 0:r.disableStableID)&&c.StableID._setDisabled(e,!0),this._sdkKey=e,this._options=null!=r?r:{},this._memoCache={},this.overrideAdapter=null!=(l=null==r?void 0:r.overrideAdapter)?l:null,this._errorBoundary=new i.ErrorBoundary(e,r,v),this._logger=new a.EventLogger(e,v,n,r,this._errorBoundary),this._errorBoundary.wrap(this),this._errorBoundary.wrap(t),this._errorBoundary.wrap(this._logger),n.setErrorBoundary(this._errorBoundary),this.dataAdapter=t,this.dataAdapter.attach(e,r,n),this.storageProvider=h.Storage,null==(f=null==(g=null==(_=this.overrideAdapter)?void 0:_.loadFromStorage)?void 0:g.call(_))||f.catch(e=>this._errorBoundary.logError("OA::loadFromStorage",e)),this._primeReadyRipcord(),function(e,t){var n;if((0,u._isServerEnv)())return;let r=(0,s._getStatsigGlobal)(),i=null!=(n=r.instances)?n:{};null!=i[e]&&o.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),i[e]=t,r.firstInstance||(r.firstInstance=t),r.instances=i,__STATSIG__=r}(e,this)}updateRuntimeOptions(e){e.loggingEnabled?(this._options.loggingEnabled=e.loggingEnabled,this._logger.setLoggingEnabled(e.loggingEnabled)):null!=e.disableLogging&&(this._options.disableLogging=e.disableLogging,this._logger.setLoggingEnabled(e.disableLogging?"disabled":"browser-only")),null!=e.disableStorage&&(this._options.disableStorage=e.disableStorage,h.Storage._setDisabled(e.disableStorage)),null!=e.enableCookies&&(this._options.enableCookies=e.enableCookies,c.StableID._setCookiesEnabled(this._sdkKey,e.enableCookies)),e.logEventCompressionMode?this._logger.setLogEventCompressionMode(e.logEventCompressionMode):e.disableCompression&&this._logger.setLogEventCompressionMode(_.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return r(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){if(this._listeners[e]){let n=this._listeners[e].indexOf(t);-1!==n&&this._listeners[e].splice(n,1)}}$on(e,t){t.__isInternal=!0,this.on(e,t)}$emt(e){var t;let n=t=>{try{t(e)}catch(n){if(!0===t.__isInternal)return void this._errorBoundary.logError(`__emit:${e.name}`,n);o.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",e)}};
1this._listeners[e.name]&&this._listeners[e.name].forEach(e=>n(e)),null==(t=this._listeners["*"])||t.forEach(n)}_setStatus(e,t){this.loadingStatus=e,this._memoCache={},this.$emt({name:"values_updated",status:e,values:t})}_enqueueExposure(e,t,n){(null==n?void 0:n.disableExposureLog)===!0?this._logger.incrementNonExposureCount(e):this._logger.enqueue(t)}_memoize(e,t){return(n,r)=>{if(this._options.disableEvaluationMemoization)return t(n,r);let s=(0,l.createMemoKey)(e,n,r);return s?(s in this._memoCache||(Object.keys(this._memoCache).length>=3e3&&(this._memoCache={}),this._memoCache[s]=t(n,r)),this._memoCache[s]):t(n,r)}}}t.StatsigClientBase=g},55536:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PrecomputedEvaluationsContextHandle=void 0;let r=n(12479),s=n(55857),i=n(61752),a=n(51269);class o{constructor(e,t,n,r,s,i){this._sdkKey=e,this._getOptions=t,this._getErrorBoundary=n,this._getValues=r,this._getUser=s,this._getSdkInstanceID=i}get sdkKey(){return this._sdkKey}get options(){return this._getOptions()}get errorBoundary(){return this._getErrorBoundary()}get values(){return this._getValues()}get user(){let e=(0,s._cloneObject)("StatsigUser",this._getUser());return null==e&&(r.Log.error("Failed to clone user"),e={}),e}getSession(e=!0){return i.StatsigSession.get(this._sdkKey,e)}get stableID(){return a.StableID.get(this._sdkKey)}get sdkInstanceID(){return this._getSdkInstanceID()}toContext(e=!0){return{sdkKey:this.sdkKey,options:this.options,values:this.values,user:this.user,errorBoundary:this.errorBoundary,session:this.getSession(e),stableID:this.stableID,sdkInstanceID:this.sdkInstanceID}}}t.PrecomputedEvaluationsContextHandle=o},55722:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FlushInterval=void 0;class n{constructor(){this._currentIntervalMs=1e3,this._lastFlushAttemptTime=Date.now()}getCurrentIntervalMs(){return this._currentIntervalMs}markFlushAttempt(){this._lastFlushAttemptTime=Date.now()}getTimeSinceLastAttempt(){return Date.now()-this._lastFlushAttemptTime}hasReachedMaxInterval(){return this.getTimeSinceLastAttempt()>=6e4}getTimeTillMaxInterval(){return 6e4-this.getTimeSinceLastAttempt()}hasCompletelyRecoveredFromBackoff(){return this._currentIntervalMs<=1e3}adjustForSuccess(){let e=this._currentIntervalMs;1e3!==e&&(this._currentIntervalMs=Math.max(1e3,Math.floor(e/2)))}adjustForFailure(){let e=this._currentIntervalMs;this._currentIntervalMs=Math.min(6e4,2*e)}getTimeUntilNextFlush(){return this.getCurrentIntervalMs()-this.getTimeSinceLastAttempt()}}t.FlushInterval=n},55857:(e,t,n)=>{var r=n(69194);Object.defineProperty(t,"__esModule",{value:!0}),t._cloneObject=t._getUnloadEvent=t._getCurrentPageUrlSafe=t._addDocumentEventListenerSafe=t._addWindowEventListenerSafe=t._isServerEnv=t._getDocumentSafe=t._getWindowSafe=void 0;let s=n(12479);t._getWindowSafe=()=>"u">typeof window?window:null,t._getDocumentSafe=()=>{var e;let n=(0,t._getWindowSafe)();return null!=(e=null==n?void 0:n.document)?e:null},t._isServerEnv=()=>{if(null!==(0,t._getDocumentSafe)())return!1;let e=void 0!==r&&null!=r.versions&&null!=r.versions.node;return"string"==typeof EdgeRuntime||e},t._addWindowEventListenerSafe=(e,n)=>{let r=(0,t._getWindowSafe)();"function"==typeof(null==r?void 0:r.addEventListener)&&r.addEventListener(e,n)},t._addDocumentEventListenerSafe=(e,n)=>{let r=(0,t._getDocumentSafe)();"function"==typeof(null==r?void 0:r.addEventListener)&&r.addEventListener(e,n)},t._getCurrentPageUrlSafe=()=>{var e;try{return null==(e=(0,t._getWindowSafe)())?void 0:e.location.href.split(/[?#]/)[0]}catch(e){return}},t._getUnloadEvent=()=>{let e=(0,t._getWindowSafe)();return e&&"onpagehide"in e?"pagehide":"beforeunload"},t._cloneObject=(e,t)=>{try{return JSON.parse(JSON.stringify(t))}catch(t){return s.Log.error(`Failed to clone object ${e}`),null}}},57004:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.V2InitializeContainer=void 0;let r=n(32501);class s{constructor(e){this._values=e}getGate(e){var t,n,r;let s=this._getResultFromLookup(this._values.feature_gates,e);return s?{name:e,value:!0===s.v,rule_id:null!=(t=s.r)?t:"default",secondary_exposures:null!=(n=s.s)?n:[],id_type:null!=(r=s.i)?r:""}:null}getConfig(e){var t,n,r,s;let i=this._getResultFromLookup(this._values.dynamic_configs,e);return i?{name:e,value:null!=(t=this._values.values[i.v])?t:{},rule_id:i.r,secondary_exposures:null!=(n=i.s)?n:[],id_type:null!=(r=i.i)?r:"",is_user_in_experiment:!0===i.ue,passed:!0===i.p,group_name:null!=(s=i.gn)?s:void 0,is_experiment_active:!0===i.ea,group:i.r,is_device_based:"stableID"===i.i}:null}getLayer(e){var t,n,r,s,i,a;let o=this._getResultFromLookup(this._values.layer_configs,e);
1return o?{name:e,value:null!=(t=this._values.values[o.v])?t:{},rule_id:o.r,secondary_exposures:null!=(n=o.s)?n:[],is_user_in_experiment:!0===o.ue,group_name:null!=(r=o.gn)?r:void 0,is_experiment_active:!0===o.ea,group:o.r,is_device_based:"stableID"===o.i,allocated_experiment_name:null!=(s=o.ae)?s:"",explicit_parameters:null!=(i=o.ep)?i:[],undelegated_secondary_exposures:null!=(a=o.us)?a:[],parameter_rule_ids:o.pr}:null}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,t){var n,s;return e&&null!=(s=null!=(n=e[t])?n:e[(0,r._DJB2)(t)])?s:null}}t.V2InitializeContainer=s},57730:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},57919:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},58559:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function o(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});let s=n(32501),i=n(85321);class a extends s.NetworkCore{constructor(e,t){super(e,t);const n=null==e?void 0:e.networkConfig;this._option=e,this._initializeUrlConfig=new s.UrlConfiguration(s.Endpoint._initialize,null==n?void 0:n.initializeUrl,null==n?void 0:n.api,null==n?void 0:n.initializeFallbackUrls)}fetchEvaluations(e,t,n,i,a){return r(this,void 0,void 0,function*(){var r,o,l,u,d,c;let _=t?(0,s._typedJsonParse)(t,"has_updates","InitializeResponse"):null,h={user:i,hash:null!=(l=null==(o=null==(r=this._option)?void 0:r.networkConfig)?void 0:o.initializeHashAlgorithm)?l:"djb2",deltasResponseRequested:!1,full_checksum:null};if(null==_?void 0:_.has_updates){let e=(null==_?void 0:_.hash_used)!==(null!=(c=null==(d=null==(u=this._option)?void 0:u.networkConfig)?void 0:d.initializeHashAlgorithm)?c:"djb2");h=Object.assign(Object.assign({},h),{sinceTime:a&&!e?_.time:0,previousDerivedFields:"derived_fields"in _&&a?_.derived_fields:{},deltasResponseRequested:!0,full_checksum:_.full_checksum,partialUserMatchSinceTime:e?0:_.time})}return this._fetchEvaluations(e,_,h,n)})}_fetchEvaluations(e,t,n,s){return r(this,void 0,void 0,function*(){var r,a;let o=yield this.post({sdkKey:e,urlConfig:this._initializeUrlConfig,data:n,retries:2,isStatsigEncodable:!0,priority:s});if((null==o?void 0:o.code)===204)return'{"has_updates": false}';if((null==o?void 0:o.code)!==200)return null!=(r=null==o?void 0:o.body)?r:null;if((null==t?void 0:t.has_updates)!==!0||(null==(a=o.body)?void 0:a.includes('"is_delta":true'))!==!0||!0!==n.deltasResponseRequested)return o.body;let l=(0,i._resolveDeltasResponse)(t,o.body);return"string"==typeof l?l:this._fetchEvaluations(e,t,Object.assign(Object.assign(Object.assign({},n),l),{deltasResponseRequested:!1}),s)})}}t.default=a},59448:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._makeParamStoreGetter=void 0;let r=n(32501),s={disableExposureLog:!0};function i(e){return null==e||!1===e.disableExposureLog}function a(e,t){return null!=t&&!(0,r._isTypeMatch)(e,t)}t._makeParamStoreGetter=function(e,t,n){return(o,l)=>{if(null==t)return l;let u=t[o];if(null==u||null!=l&&(0,r._typeOf)(l)!==u.param_type)return l;switch(u.ref_type){case"static":return u.value;case"gate":return e.getFeatureGate(u.gate_name,i(n)?void 0:s).value?u.pass_value:u.fail_value;case"dynamic_config":let d;return a(d=e.getDynamicConfig(u.config_name,i(n)?void 0:s).get(u.param_name),l)?l:d;case"experiment":let c;return a(c=e.getExperiment(u.experiment_name,i(n)?void 0:s).get(u.param_name),l)?l:c;case"layer":let _;return a(_=e.getLayer(u.layer_name,i(n)?void 0:s).get(u.param_name),l)?l:_;default:return l}}}},60419:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PendingEvents=void 0;let r=n(12479);class s{constructor(e){this._pendingEvents=[],this._batchSize=e}addToPendingEventsQueue(e){this._pendingEvents.push(e),r.Log.debug("Enqueued Event:",e)}hasEventsForFullBatch(){return this._pendingEvents.length>=this._batchSize}
1takeAll(){let e=this._pendingEvents;return this._pendingEvents=[],e}isEmpty(){return 0===this._pendingEvents.length}}t.PendingEvents=s},61065:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LoggingEnabledOption=t.LogEventCompressionMode=void 0,t.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},t.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}},61752:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigSession=t.SessionID=void 0;let r=n(96038),s=n(12479),i=n(85029),a=n(79056),o=n(79490),l={};function u(e){var t;let n=e.data,r=function({lastUpdate:e}){return Date.now()-e>18e5}(n)||function({startTime:e}){return Date.now()-e>144e5}(n);return r&&(e.data=_(),null==(t=null==__STATSIG__?void 0:__STATSIG__.instance(e.sdkKey))||t.$emt({name:"session_expired"})),r}function d(e){return`statsig.session_id.${(0,r._getStorageKey)(e)}`}function c(e){try{(0,i._setObjectInStorage)(e.storageKey,e.data),e.lastPersistedAt=Date.now()}catch(e){s.Log.warn("Failed to save SessionID")}}function _(){return{sessionID:(0,a.getUUID)(),startTime:Date.now(),lastUpdate:Date.now()}}(0,o._subscribeToVisiblityChanged)(e=>{"background"===e&&Object.values(l).forEach(e=>c(e))}),t.SessionID={get:e=>t.StatsigSession.get(e).data.sessionID},t.StatsigSession={get:(e,t=!0)=>{var n,r,s;let a;return null==l[e]&&(l[e]=function(e){let t=d(e),n=(0,i._getObjectFromStorage)(t);return n&&n.sessionID&&n.startTime&&n.lastUpdate?{data:n,sdkKey:e,lastPersistedAt:0,storageKey:t}:{data:_(),sdkKey:e,lastPersistedAt:0,storageKey:t}}(e)),n=l[e],r=t,a=Date.now(),u(n)?c(n):r&&(n.data.lastUpdate=a,s=n,Date.now()-s.lastPersistedAt>15e3&&c(s)),n},overrideInitialSessionID:(e,t)=>{let n=Date.now(),r={data:{sessionID:e,startTime:n,lastUpdate:n},sdkKey:t,lastPersistedAt:Date.now(),storageKey:d(t)};c(r),l[t]=r},checkForIdleSession:e=>{let t=l[e];!t||u(t)&&c(t)}}},63184:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(7620),s=n(32501),i=n(21156),a=n(26670);t.default=function(e,t){let{client:n,renderVersion:o}=(0,r.useContext)(a.default);return(0,r.useMemo)(()=>(0,i.isNoopClient)(n)?(s.Log.warn(`useExperiment hook failed to find a valid Statsig client for experiment '${e}'.`),i.NoopEvaluationsClient.getExperiment(e,t)):n.getExperiment(e,t),[e,n,o,...t?Object.values(t):[]])}},64917:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},66212:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(7620),s=n(32501),i=n(21156),a=n(26670);t.default=function(e,t){let{client:n,renderVersion:o}=(0,r.useContext)(a.default);return(0,r.useMemo)(()=>(0,i.isNoopClient)(n)?(s.Log.warn(`useLayer hook failed to find a valid Statsig client for layer '${e}'.`),i.NoopEvaluationsClient.getLayer(e,t)):n.getLayer(e,t),[e,n,o,...t?Object.values(t):[]])}},68558:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigProvider=void 0;let r=n(54568),s=n(7620),i=n(32501),a=n(26670),o=n(71922);function l(e){let[t,n]=(0,s.useState)(0),i=(0,o.useClientAsyncInit)(e.sdkKey,e.user,e.options).client,[l,u]=(0,s.useState)(!c(i));d(i,n,u);let _=(0,s.useMemo)(()=>({renderVersion:t,client:i,isLoading:l}),[t,i,l]);return(0,r.jsx)(a.default.Provider,{value:_,children:null!=e.loadingComponent&&_.isLoading?e.loadingComponent:e.children})}function u(e){let[t,n]=(0,s.useState)(0),i=e.client,[o,l]=(0,s.useState)(!c(i));d(i,n,l);let u=(0,s.useMemo)(()=>({renderVersion:t,client:i,isLoading:o}),[t,i,o]);return(0,r.jsx)(a.default.Provider,{value:u,children:null!=e.loadingComponent&&u.isLoading?e.loadingComponent:e.children})}function d(e,t,n){(0,s.useEffect)(()=>{let r=()=>{t(e=>e+1),n(!c(e))};return i.SDKType._setBindingType("react"),e.$on("values_updated",r),()=>{e.flush().catch(e=>i.Log.error("An error occurred during flush",e)),e.off("values_updated",r)}},[e,t])}function c(e){return"isNoop"in e||"Ready"===e.loadingStatus}t.StatsigProvider=function(e){return"client"in e?(("sdkKey"in e||"user"in e)&&i.Log.warn("Both client and configuration props (sdkKey, user) were provided to StatsigProvider. The client prop will be used and the configuration props will be ignored."),(0,r.jsx)(u,Object.assign({},e))):(0,r.jsx)(l,Object.assign({},e))}},71922:(e,t,n)=>
1{Object.defineProperty(t,"__esModule",{value:!0}),t.useClientAsyncInit=void 0;let r=n(22073),s=n(18058);t.useClientAsyncInit=function(e,t,n=null){return(0,s.useStatsigInternalClientFactoryAsync)(e=>new r.StatsigClient(e.sdkKey,e.initialUser,e.statsigOptions),{sdkKey:e,initialUser:t,statsigOptions:n})}},72656:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FlushTypeValues=void 0,t.FlushTypeValues={ScheduledMaxTime:"scheduled:max_time",ScheduledFullBatch:"scheduled:full_batch",Limit:"limit",Manual:"manual",Shutdown:"shutdown"}},73565:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(7620),s=n(32501),i=n(21156),a=n(26670);t.default=function(e,t){let{client:n,renderVersion:o}=(0,r.useContext)(a.default);return(0,r.useMemo)(()=>(0,i.isNoopClient)(n)?(s.Log.warn(`useGateValue hook failed to find a valid StatsigClient for gate '${e}'.`),i.NoopEvaluationsClient.checkGate(e,t)):n.checkGate(e,t),[e,n,o,...t?Object.values(t):[]])}},74455:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UPDATE_DETAIL_ERROR_MESSAGES=t.createUpdateDetails=void 0,t.createUpdateDetails=(e,t,n,r,s,i)=>({duration:n,source:t,success:e,error:r,sourceUrl:s,warnings:i}),t.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."}},76962:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(7620),s=n(32501),i=n(21156),a=n(26670);t.default=function(e,t){let{client:n,renderVersion:o}=(0,r.useContext)(a.default);return(0,r.useMemo)(()=>(0,i.isNoopClient)(n)?(s.Log.warn(`useDynamicConfig hook failed to find a valid StatsigClient for dynamic config '${e}'.`),i.NoopEvaluationsClient.getDynamicConfig(e,t)):n.getDynamicConfig(e,t),[e,n,o,...t?Object.values(t):[]])}},79056:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getUUID=void 0,t.getUUID=function(){if("u">typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let e=new Date().getTime(),t="u">typeof performance&&performance.now&&1e3*performance.now()||0,n="89ab"[Math.floor(4*Math.random())];return`xxxxxxxx-xxxx-4xxx-${n}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,n=>{let r=16*Math.random();return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),("x"===n?r:7&r|8).toString(16)})}},79490:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._notifyVisibilityChanged=t._subscribeToVisiblityChanged=t._isUnloading=t._isCurrentlyVisible=void 0;let r=n(55857),s="foreground",i="background",a=[],o=s,l=!1;t._isCurrentlyVisible=()=>o===s,t._isUnloading=()=>l,t._subscribeToVisiblityChanged=e=>{a.unshift(e)},t._notifyVisibilityChanged=e=>{e!==o&&(o=e,a.forEach(t=>t(e)))},(0,r._addWindowEventListenerSafe)("focus",()=>{l=!1,(0,t._notifyVisibilityChanged)(s)}),(0,r._addWindowEventListenerSafe)("blur",()=>(0,t._notifyVisibilityChanged)(i)),(0,r._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,t._notifyVisibilityChanged)("visible"===document.visibilityState?s:i)}),(0,r._addWindowEventListenerSafe)((0,r._getUnloadEvent)(),()=>{l=!0,(0,t._notifyVisibilityChanged)(i)})},80649:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._getSortedObject=t._DJB2Object=t._DJB2=void 0;let r=n(47605);t._DJB2=e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return String(t>>>0)},t._DJB2Object=(e,n)=>(0,t._DJB2)(JSON.stringify((0,t._getSortedObject)(e,n))),t._getSortedObject=(e,n)=>{if(null==e)return null;let s=Object.keys(e).sort(),i={};return s.forEach(s=>{let a=e[s];if(0===n||"object"!==(0,r._typeOf)(a)){i[s]=a;return}i[s]=(0,t._getSortedObject)(a,null!=n?n-1:n)}),i}},81389:(e,t,n)=>{var r=function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function o(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});let s=n(32501),i=n(51678),a=n(58559),o=n(59448),l=n(21268);class u extends s.StatsigClientBase{static instance(e){let t=(0,s._getStatsigGlobal)().instance(e);return t instanceof u?t:(s.Log.warn((0,s._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new u(null!=e?e:"",{}))}constructor(e,t,n=null){var r,o;s.SDKType._setClientType(e,"javascript-client");const u=new a.default(n,e=>{this.$emt(e)});for(const a of(super(e,null!=(r=null==n?void 0:n.dataAdapter)?r:new l.StatsigEvaluationsDataAdapter,u,n),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(s.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(s.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(s.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(s.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(s.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(s.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new i.default(e,null!=n?n:null),this._network=u,this._user=this._configureUser(t,n),this._sdkInstanceID=(0,s.getUUID)(),this._contextHandle=new s.PrecomputedEvaluationsContextHandle(e,()=>
1this._options,()=>this._errorBoundary,()=>this._store.getValues(),()=>this._user,()=>this._sdkInstanceID),null!=(o=null==n?void 0:n.plugins)?o:[]))a.bind(this)}initializeSync(e){var t;return"Uninitialized"!==this.loadingStatus?(0,s.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...null!=(t=this._store.getWarnings())?t:[]]):(this._logger.start(),this.updateUserSync(this._user,e))}initializeAsync(e){return r(this,void 0,void 0,function*(){return this._initializePromise||(this._initializePromise=this._initializeAsyncImpl(e)),this._initializePromise})}updateUserSync(e,t){let n=performance.now();try{return this._updateUserSyncImpl(e,t,n)}catch(t){let e=t instanceof Error?t:Error(String(t));return this._createErrorUpdateDetails(e,n)}}_updateUserSyncImpl(e,t,n){var r;let i=[...null!=(r=this._store.getWarnings())?r:[]];this._resetForUser(e);let a=this.dataAdapter.getDataSync(this._user);null==a&&i.push("NoCachedValues"),this._store.setValues(a,this._user),this._finalizeUpdate(a);let o=null==t?void 0:t.disableBackgroundCacheRefresh;return!0===o||null==o&&(null==a?void 0:a.source)==="Bootstrap"||this._runPostUpdate(null!=a?a:null,this._user),(0,s.createUpdateDetails)(!0,this._store.getSource(),performance.now()-n,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),i)}updateUserAsync(e,t){return r(this,void 0,void 0,function*(){let n=performance.now();try{return yield this._updateUserAsyncImpl(e,t)}catch(t){let e=t instanceof Error?t:Error(String(t));return this._createErrorUpdateDetails(e,n)}})}_updateUserAsyncImpl(e,t){return r(this,void 0,void 0,function*(){this._resetForUser(e);let n=this._user;s.Diagnostics._markInitOverallStart(this._sdkKey);let r=this.dataAdapter.getDataSync(n);if(this._store.setValues(r,this._user),this._setStatus("Loading",r),r=yield this.dataAdapter.getDataAsync(r,n,t),n!==this._user)return(0,s.createUpdateDetails)(!1,this._store.getSource(),-1,Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let i=!1;null!=r&&(s.Diagnostics._markInitProcessStart(this._sdkKey),i=this._store.setValues(r,this._user),s.Diagnostics._markInitProcessEnd(this._sdkKey,{success:i})),this._finalizeUpdate(r),i||(this._errorBoundary.attachErrorIfNoneExists(s.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),s.Diagnostics._markInitOverallEnd(this._sdkKey,i,this._store.getCurrentSourceDetails());let a=s.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,s.createUpdateDetails)(i,this._store.getSource(),a,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){let e=(0,s._cloneObject)("StatsigUser",this._user);return null==e&&(s.Log.error("Failed to clone user"),e={}),{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:e,errorBoundary:this._errorBoundary,session:s.StatsigSession.get(this._sdkKey),stableID:s.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}getContextHandle(){return this._contextHandle}checkGate(e,t){return this.getFeatureGate(e,t).value}logEvent(e,t,n){let r="string"==typeof e?{eventName:e,value:t,metadata:n}:e;this.$emt({name:"log_event_called",event:r}),this._logger.enqueue(Object.assign(Object.assign({},r),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(e){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:e}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this._finalizeUpdate(null)})}_initializeAsyncImpl(e){return r(this,void 0,void 0,function*(){return s.Storage.isReady()||(yield s.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,e)})}_createErrorUpdateDetails(e,t){var n;return(0,s.createUpdateDetails)(!1,this._store.getSource(),performance.now()-t,e,null,[...null!=(n=this._store.getWarnings())?n:[]])}_finalizeUpdate(e){this._store.finalize(),this._setStatus("Ready",e)}_runPostUpdate(e,t){this.dataAdapter.getDataAsync(e,t,{priority:"low"}).catch(e=>{s.Log.error("An error occurred after update.",e)})}_resetForUser(e){this._logger.reset(),this._store.reset(),this._user=this._configureUser(e,this._options)}_configureUser(e,t){var n,r,i;let a=(0,s._normalizeUser)(e,t),o=null==(n=a.customIDs)?void 0:n.stableID;if(o){let e=null==(i=(r=this.storageProvider).isReadyResolver)?void 0:i.call(r);e?e.then(()=>s.StableID.setOverride(o,this._sdkKey),()=>s.StableID.setOverride(o,this._sdkKey)):s.StableID.setOverride(o,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(a.analyticsOnlyMetadata=Object.assign(Object.assign({},a.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),a}_getFeatureGateImpl(e,t){var n,r;let{result:i,details:a}=this._store.getGate(e);this._checkUserHasIdForEvaluation(null==i?void 0:i.id_type,e,"Gate"),this._checkInitializationStatus(a.reason);let o=(0,s._makeFeatureGate)(e,a,i),l=null==(r=null==(n=this.overrideAdapter)?void 0:n.getGateOverride)?void 0:r.call(n,o,this._user,t),u=null!=l?l:o;return this._enqueueExposure(e,(0,s._createGateExposure)(this._user,u,this._store.getExposureMapping()),t),this.$emt({name:"gate_evaluation",gate:u}),u}_getDynamicConfigImpl(e,t){var n,r;let{result:i,details:a}=this._store.getConfig(e);this._checkUserHasIdForEvaluation(null==i?void 0:i.id_type,e,"Dynamic config"),this._checkInitializationStatus(a.reason);let o=(0,s._makeDynamicConfig)(e,a,i),l=null==(r=null==(n=this.overrideAdapter)?void 0:n.getDynamicConfigOverride)?void 0:r.call(n,o,this._user,t),u=null!=l?l:o;return this._enqueueExposure(e,(0,s._createConfigExposure)(this._user,u,this._store.getExposureMapping()),t),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:u}),u}_getExperimentImpl(e,t){var n,r,i,a;let{result:o,details:l}=this._store.getConfig(e);this._checkUserHasIdForEvaluation(null==o?void 0:o.id_type,e,"Experiment"),this._checkInitializationStatus(l.reason);let u=(0,s._makeExperiment)(e,l,o);null!=u.__evaluation&&(u.__evaluation.secondary_exposures=(0,s._mapExposures)(null!=(r=null==(n=u.__evaluation)?void 0:n.secondary_exposures)?r:[],this._store.getExposureMapping()));let d=null==(a=null==(i=this.overrideAdapter)?void 0:i.getExperimentOverride)?void 0:a.call(i,u,this._user,t),c=null!=d?d:u;return this._enqueueExposure(e,(0,s._createConfigExposure)(this._user,c,this._store.getExposureMapping()),t),this.$emt({name:"experiment_evaluation",experiment:c}),c}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(e,t){var n,r,i;let{result:a,details:o}=this._store.getLayer(e),l=(0,s._makeLayer)(e,o,a),u=null==(r=null==(n=this.overrideAdapter)?void 0:n.getLayerOverride)?void 0:r.call(n,l,this._user,t);(null==t?void 0:t.disableExposureLog)&&this._logger.incrementNonExposureCount(e);let d=(0,s._mergeOverride)(l,u,null!=(i=null==u?void 0:u.__value)?i:l.__value,n=>{null!=t&&t.disableExposureLog||this._enqueueExposure(e,(0,s._createLayerParameterExposure)(this._user,d,n,this._store.getExposureMapping()),t)}
1);return this.$emt({name:"layer_evaluation",layer:d}),d}_getParameterStoreImpl(e,t){var n,r;let{result:s,details:i}=this._store.getParamStore(e);this._logger.incrementNonExposureCount(e);let a={name:e,details:i,__configuration:s,get:(0,o._makeParamStoreGetter)(this,s,t)},l=null==(r=null==(n=this.overrideAdapter)?void 0:n.getParamStoreOverride)?void 0:r.call(n,a,t);return null!=l&&(a.__configuration=l.config,a.details=l.details,a.get=(0,o._makeParamStoreGetter)(this,l.config,t)),a}_checkUserHasIdForEvaluation(e,t,n){e&&((0,s._getUnitIDFromUser)(this._user,e)||s.Log.warn(`The user does not have the required id_type "${e}" for ${n} "${t}"`))}_checkInitializationStatus(e){("Uninitialized"===e||e.startsWith("Loading"))&&s.Log.warn(`SDK initialization has not completed. Reason: ${e}`)}}t.default=u},83385:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkParam=t.NetworkDefault=t.Endpoint=void 0,t.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},t.NetworkDefault={[t.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[t.Endpoint._initialize]:"https://featureassets.org/v1",[t.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},t.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},84073:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Diagnostics=void 0;let n=new Map,r="start";function s(e,t,n,r){return Object.assign({key:n,action:t,step:r,timestamp:Date.now()},e)}function i(e,t){var r;let s=null!=(r=n.get(e))?r:[];s.push(t),n.set(e,s)}function a(e,t){if(t in e)return e[t]}t.Diagnostics={_getMarkers:e=>n.get(e),_markInitOverallStart:e=>{i(e,s({},r,"overall"))},_markInitOverallEnd:(e,t,n)=>{i(e,s({success:t,error:t?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:n},"end","overall"))},_markInitNetworkReqStart:(e,t)=>{i(e,s(t,r,"initialize","network_request"))},_markInitNetworkReqEnd:(e,t)=>{i(e,s(t,"end","initialize","network_request"))},_markInitProcessStart:e=>{i(e,s({},r,"initialize","process"))},_markInitProcessEnd:(e,t)=>{i(e,s(t,"end","initialize","process"))},_clearMarkers:e=>{n.delete(e)},_formatError(e){if(e&&"object"==typeof e)return{code:a(e,"code"),name:a(e,"name"),message:a(e,"message")}},_getDiagnosticsData(e,n,r,s){var i;return{success:(null==e?void 0:e.ok)===!0,statusCode:null==e?void 0:e.status,sdkRegion:null==(i=null==e?void 0:e.headers)?void 0:i.get("x-statsig-region"),isDelta:!0===r.includes('"is_delta":true')||void 0,attempt:n,error:t.Diagnostics._formatError(s)}},_enqueueDiagnosticsEvent(e,n,r,s){let i=t.Diagnostics._getMarkers(r);if(null==i||i.length<=0)return -1;let a=i[i.length-1].timestamp-i[0].timestamp;t.Diagnostics._clearMarkers(r);let o={eventName:"statsig::diagnostics",user:e,value:null,metadata:{context:"initialize",markers:i.slice(),statsigOptions:s},time:Date.now()};return n.enqueue(o),a}}},85029:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._setObjectInStorage=t._getObjectFromStorage=t.Storage=void 0;let r=n(12479),s=n(55857),i={},a={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:e=>i[e]?i[e]:null,setItem:(e,t)=>{i[e]=t},removeItem:e=>{delete i[e]},getAllKeys:()=>Object.keys(i)},o=null;try{let e=(0,s._getWindowSafe)();e&&e.localStorage&&"function"==typeof e.localStorage.getItem&&(o={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:t=>e.localStorage.getItem(t),setItem:(t,n)=>e.localStorage.setItem(t,n),removeItem:t=>e.localStorage.removeItem(t),getAllKeys:()=>Object.keys(e.localStorage)})}catch(e){r.Log.warn("Failed to setup localStorageProvider.")}let l=null!=o?o:a,u=l;function d(e){try{return e()}catch(e){if(e instanceof Error&&"SecurityError"===e.name)return t.Storage._setProvider(a),null;throw e}}t.Storage={isReady:()=>u.isReady(),isReadyResolver:()=>u.isReadyResolver(),getProviderName:()=>u.getProviderName(),getItem:e=>d(()=>u.getItem(e)),setItem:(e,t)=>d(()=>u.setItem(e,t)),removeItem:e=>u.removeItem(e),getAllKeys:()=>u.getAllKeys(),_setProvider:e=>{l=e,u=e},_setDisabled:e=>{u=e?a:l}},t._getObjectFromStorage=function(e){let n=t.Storage.getItem(e);try{return JSON.parse(null!=n?n:"null")}catch(t){return r.Log.error(`Failed to parse value for key "${e}"`),null}},t._setObjectInStorage=function(e,n){t.Storage.setItem(e,JSON.stringify(n))}},85321:(e,t,n)=>
1{Object.defineProperty(t,"__esModule",{value:!0}),t._resolveDeltasResponse=void 0;let r=n(32501);function s(e,t){null==e||e.forEach(e=>{delete t[e]})}t._resolveDeltasResponse=function(e,t){var n,i,a;let o=(0,r._typedJsonParse)(t,"checksum","DeltasEvaluationResponse");if(!o)return{hadBadDeltaChecksum:!0};let l=(s((a=(n=e,i=o,Object.assign(Object.assign(Object.assign({},n),i),{feature_gates:Object.assign(Object.assign({},n.feature_gates),i.feature_gates),layer_configs:Object.assign(Object.assign({},n.layer_configs),i.layer_configs),dynamic_configs:Object.assign(Object.assign({},n.dynamic_configs),i.dynamic_configs)}))).deleted_gates,a.feature_gates),delete a.deleted_gates,s(a.deleted_configs,a.dynamic_configs),delete a.deleted_configs,s(a.deleted_layers,a.layer_configs),delete a.deleted_layers,a),u=(0,r._DJB2Object)({feature_gates:l.feature_gates,dynamic_configs:l.dynamic_configs,layer_configs:l.layer_configs},2);return u!==o.checksumV2?{hadBadDeltaChecksum:!0,badChecksum:u,badMergedConfigs:l,badFullResponse:o.deltas_full_response}:JSON.stringify(l)}},90607:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function o(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.FlushCoordinator=void 0;let s=n(9634),i=n(98072),a=n(55722),o=n(72656),l=n(80649),u=n(12479),d=n(22300),c=n(55857),_=n(61752),h=n(61065),g=n(85029),f=new Set(["network_request_timed_out_no_response","network_request_exception_no_response","event_sender_post_returned_null","event_sender_post_returned_undefined","event_sender_post_exception"]);class v{constructor(e,t,n,r,s,o,l,u,d,c){this._cooldownTimer=null,this._maxIntervalTimer=null,this._hasRunQuickFlush=!1,this._currentFlushPromise=null,this._creationTime=Date.now(),this._isShuttingDown=!1,this._storageKey=null,this._flushInterval=new a.FlushInterval,this._batchQueue=e,this._pendingEvents=t,this._onPrepareFlush=n,this._errorBoundary=c,this._sdkKey=r,this._loggingEnabled=d,this._eventSender=new i.EventSender(r,s,o,l,u)}setLoggingEnabled(e){this._loggingEnabled=e}setLogEventCompressionMode(e){this._eventSender.setLogEventCompressionMode(e)}startScheduledFlushCycle(){this._scheduleNextFlush()}stopScheduledFlushCycle(){this._clearAllTimers()}addEvent(e){this._pendingEvents.addToPendingEventsQueue(e),!this._currentFlushPromise&&this._pendingEvents.hasEventsForFullBatch()&&this.processLimitFlush()}processManualFlush(){return r(this,void 0,void 0,function*(){return this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(o.FlushTypeValues.Manual).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()}),this._currentFlushPromise})}processShutdown(){return r(this,void 0,void 0,function*(){return this._isShuttingDown=!0,this._clearAllTimers(),this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(o.FlushTypeValues.Shutdown).catch(e=>{u.Log.error(`Error during shutdown flush: ${e}`)}).finally(()=>{this._currentFlushPromise=null}),this._currentFlushPromise})}_executeFlush(e){return r(this,void 0,void 0,function*(){this._clearAllTimers();try{this._prepareQueueForFlush(e);let t=this._batchQueue.takeAllBatches();if(0===t.length)return;yield Promise.all(t.map(t=>this._processOneBatch(t,e)))}finally{this._isShuttingDown||this._scheduleNextFlush()}})}checkQuickFlush(){this._hasRunQuickFlush||Date.now()-this._creationTime>s.EventRetryConstants.QUICK_FLUSH_WINDOW_MS||(this._hasRunQuickFlush=!0,setTimeout(()=>{this.processManualFlush().catch(e=>{u.Log.warn("Quick flush failed:",e)})},s.EventRetryConstants.QUICK_FLUSH_WINDOW_MS))}_attemptScheduledFlush(){let e;if(this._currentFlushPromise)return void this._scheduleNextFlush();let t=this.containsAtLeastOneFullBatch(),n=this._flushInterval.hasReachedMaxInterval();t||n?(this._flushInterval.markFlushAttempt(),e=t?o.FlushTypeValues.ScheduledFullBatch:o.FlushTypeValues.ScheduledMaxTime,this._currentFlushPromise=this._processNextBatch(e).then(()=>{}).catch(e=>{u.Log.error("Error during scheduled flush:",e)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()})):this._scheduleNoopPollTick()}processLimitFlush(){!this._flushInterval.hasCompletelyRecoveredFromBackoff()||this._currentFlushPromise||(this._currentFlushPromise=this._processLimitFlush
1Internal().catch(e=>{u.Log.error("Error during limit flush",e)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()}))}_processLimitFlushInternal(){return r(this,void 0,void 0,function*(){if(yield this._processNextBatch(o.FlushTypeValues.Limit))for(;this._flushInterval.hasCompletelyRecoveredFromBackoff()&&this.containsAtLeastOneFullBatch()&&(yield this._processNextBatch(o.FlushTypeValues.Limit)););})}_scheduleNextFlush(){if(this._clearAllTimers(),this._isShuttingDown)return;let e=Math.max(0,this._flushInterval.getTimeUntilNextFlush());this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,_.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},e);let t=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,_.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},t)}_clearAllTimers(){null!==this._cooldownTimer&&(clearTimeout(this._cooldownTimer),this._cooldownTimer=null),null!==this._maxIntervalTimer&&(clearTimeout(this._maxIntervalTimer),this._maxIntervalTimer=null)}_scheduleNoopPollTick(){if(this._clearAllTimers(),this._isShuttingDown)return;this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,_.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},s.EventRetryConstants.TICK_INTERVAL_MS);let e=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,_.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},e)}_processNextBatch(e){return r(this,void 0,void 0,function*(){this._prepareQueueForFlush(e);let t=this._batchQueue.takeNextBatch();return!!t&&this._processOneBatch(t,e)})}_processOneBatch(e,t){return r(this,void 0,void 0,function*(){if(this._loggingEnabled!==h.LoggingEnabledOption.always&&(0,c._isServerEnv)())return this._flushInterval.adjustForSuccess(),!0;let n=yield this._eventSender.sendBatch(e);return n.success?(this._flushInterval.adjustForSuccess(),!0):(this._flushInterval.adjustForFailure(),this._handleFailure(e,t,n.statusCode,n.failurePath,n.failureErrorMessage,n.failureDiagnosticBucket,n.failureDiagnosticMetadata),!1)})}_prepareQueueForFlush(e){this._onPrepareFlush();let t=this.convertPendingEventsToBatches();t>0&&(u.Log.warn(`Dropped ${t} events`),this._errorBoundary.logDroppedEvents(t,"Batch queue limit reached during batching",{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:s.EventRetryConstants.MAX_PENDING_BATCHES,flushType:e,retries:"dropped before batching"}))}containsAtLeastOneFullBatch(){return this._pendingEvents.hasEventsForFullBatch()||this._batchQueue.hasFullBatch()}convertPendingEventsToBatches(){if(this._pendingEvents.isEmpty())return 0;let e=this._pendingEvents.takeAll();return this._batchQueue.createBatches(e)}_isRetryableBatch(e,t){return!!(d.RETRYABLE_CODES.has(e)||-1===e&&t&&f.has(t))}_handleFailure(e,t,n,r,i,a,l){if(t===o.FlushTypeValues.Shutdown){u.Log.warn(`${t} flush failed during shutdown. ${e.events.length} event(s) will be saved to storage for retry in next session.`),this._saveShutdownFailedEventsToStorage(e.events);return}if(!this._isRetryableBatch(n,r)){u.Log.warn(`${t} flush failed after ${e.attempts} attempt(s). ${e.events.length} event(s) will be dropped. Non-retryable error: ${n}`),this._errorBoundary.logEventRequestFailure(e.events.length,"non-retryable error",t,n,e.attempts,r,i,a,l);return}if(e.attempts>=s.EventRetryConstants.MAX_RETRY_ATTEMPTS){u.Log.warn(`${t} flush failed after ${e.attempts} attempt(s). ${e.events.length} event(s) will be dropped.`),this._errorBoundary.logEventRequestFailure(e.events.length,"max retry attempts exceeded",t,n,e.attempts,r,i,a,l);return}e.incrementAttempts();let d=this._batchQueue.requeueBatch(e);d>0&&(u.Log.warn(`Failed to requeue batch : dropped ${d} events due to full queue`),this._errorBoundary.logDroppedEvents(d,"Batch queue limit reached during requeue",{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:s.EventRetryConstants.MAX_PENDING_BATCHES,flushType:t,retries:e.attempts}))}loadAndRetryShutdownFailedEvents(){return r(this,void 0,void 0,function*(){let e=this._getStorageKey();try{g.Storage.isReady()||(yield g.Storage.isReadyResolver());let t=this._getShutdownFailedEventsFromStorage(e);if(0===t.length)return;u.Log.debug(`Loading ${t.length} failed shutdown event(s) from storage for retry`),g.Storage.removeItem(e),t.forEach(e
1=>{this.addEvent(e)}),yield this.processManualFlush()}catch(e){u.Log.warn("Failed to load and retry failed shutdown events:",e)}})}_getStorageKey(){return this._storageKey||(this._storageKey=`statsig.failed_shutdown_events.${(0,l._DJB2)(this._sdkKey)}`),this._storageKey}_saveShutdownFailedEventsToStorage(e){let t=this._getStorageKey();try{let n=[...this._getShutdownFailedEventsFromStorage(t),...e];n.length>s.EventRetryConstants.MAX_LOCAL_STORAGE&&(n=n.slice(-s.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,g._setObjectInStorage)(t,n),u.Log.debug(`Saved ${e.length} failed shutdown event(s) to storage (total stored: ${n.length})`)}catch(e){u.Log.warn("Unable to save failed shutdown events to storage:",e)}}_getShutdownFailedEventsFromStorage(e){try{let t=(0,g._getObjectFromStorage)(e);if(Array.isArray(t))return t;return[]}catch(e){return[]}}}t.FlushCoordinator=v},91139:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTag=void 0,t.ErrorTag={NetworkError:"NetworkError"}},92805:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},93077:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._getUnitIDFromUser=t._getFullUserHash=t._normalizeUser=void 0;let r=n(80649),s=n(12479),i=n(55857);t._normalizeUser=function(e,t,n){let r=(0,i._cloneObject)("StatsigUser",e);return null==r?(s.Log.error("Failed to clone user"),{statsigEnvironment:void 0}):(null!=t&&null!=t.environment?r.statsigEnvironment=t.environment:null!=n&&(r.statsigEnvironment={tier:n}),r)},t._getFullUserHash=function(e){return e?(0,r._DJB2Object)(e):null},t._getUnitIDFromUser=function(e,t){var n,r,s;if("string"!=typeof t)return e.userID;let i=t.toLowerCase();return"userid"!==i?null!=(r=null==(n=e.customIDs)?void 0:n[t])?r:null==(s=e.customIDs)?void 0:s[i]:e.userID}},93616:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(7620),s=n(32501),i=n(21156),a=n(26670);t.default=function(e,t){let{client:n,renderVersion:o}=(0,r.useContext)(a.default);return(0,r.useMemo)(()=>(0,i.isNoopClient)(n)?(s.Log.warn(`useFeatureGate hook failed to find a valid StatsigClient for gate '${e}'.`),i.NoopEvaluationsClient.getFeatureGate(e,t)):n.getFeatureGate(e,t),[e,n,o,...t?Object.values(t):[]])}},96038:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._getStorageKey=t._getUserStorageKey=void 0;let r=n(80649);function s(e,t,n){var s;if(n)return n(e,t);let i=t&&t.customIDs?t.customIDs:{},a=[`uid:${null!=(s=null==t?void 0:t.userID)?s:""}`,`cids:${Object.keys(i).sort((e,t)=>e.localeCompare(t)).map(e=>`${e}-${i[e]}`).join(",")}`,`k:${e}`];return(0,r._DJB2)(a.join("|"))}t._getUserStorageKey=s,t._getStorageKey=function(e,t,n){return t?s(e,t,n):(0,r._DJB2)(`k:${e}`)}},96717:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useStatsigUser=void 0;let r=n(7620),s=n(26670),i=n(16993);function a(e){return e.getContextHandle().user}t.useStatsigUser=function(){let{client:e}=(0,i.useStatsigClient)(),{renderVersion:t}=(0,r.useContext)(s.default);return{user:(0,r.useMemo)(()=>a(e),[e,t]),updateUserSync:(0,r.useCallback)(t=>("function"==typeof t&&(t=t(a(e))),e.updateUserSync(t)),[e]),updateUserAsync:(0,r.useCallback)(t=>("function"==typeof t&&(t=t(a(e))),e.updateUserAsync(t)),[e])}}},97580:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},97596:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._makeTypedGet=t._mergeOverride=t._makeLayer=t._makeExperiment=t._makeDynamicConfig=t._makeFeatureGate=void 0;let r=n(12479),s=n(47605);function i(e,t,n,r){var s;return{name:e,details:t,ruleID:null!=(s=null==n?void 0:n.rule_id)?s:"",__evaluation:n,value:r}}function a(e,t,n){var r,s;let a=null!=(r=null==n?void 0:n.value)?r:{};return Object.assign(Object.assign({},i(e,t,n,a)),{idType:null!=(s=null==n?void 0:n.id_type)?s:null,get:o(e,null==n?void 0:n.value)})}function o(e,t,n){return(i,a)=>{var o;let l=null!=(o=null==t?void 0:t[i])?o:null;return null==l?null!=a?a:null:null==a||(0,s._isTypeMatch)(l,a)?(null==n||n(i),l):(r.Log.warn(`Parameter type mismatch. '${e}.${i}' was found to be type '${typeof l}' but fallback/return type is '${typeof a}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=a?a:null)}}t._makeFeatureGate=function(e,t,n){var r;return Object.assign(Object.assign({},i(e,t,n,(null==n?void 0:n.value)===!0)),{idType:null!=(r=null==n?void 0:n.id_type)?r:null})},t._makeDynamicConfig=a,t._makeExperiment=function(e,t,n){var r;return Object.assign(Object.assign({},a(e,t,n)),{groupName:null!=(r=null==n?void 0:n.group_name)?r:null})},t._makeLayer=function(e,t,n,r){var s,a;return Object.assign(Object.assign({},i(e,t,n,void 0)),{get:o(e,null==n?void 0:n.value,r),groupName:null!=(s=null==n?void 0:n.group_name)?s:null,__value:null!=(a=null==n?void 0:n.value)?a:{}})},t._mergeOverride=function(e,t,n,r){return Object.assign(Object.assign(Object.assign({},e),t),{get:o(e.name,n,r)})},t._makeTypedGet=o},98072:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
1ise))(function(s,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function o(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?s(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.EventSender=void 0;let s=n(12479),i=n(83385),a=n(17693),o=n(17627),l=n(79490);class u{constructor(e,t,n,r,s){this._sdkKey=e,this._network=t,this._emitter=n,this._options=s,this._logEventUrlConfig=r}setLogEventCompressionMode(e){this._network.setLogEventCompressionMode(e)}sendBatch(e){return r(this,void 0,void 0,function*(){var t,n,r;let i="event_sender_unexpected_exception",a={};try{let r=(0,l._isUnloading)()&&this._network.isBeaconSupported()&&(null==(n=null==(t=this._options)?void 0:t.networkConfig)?void 0:n.networkOverrideFunc)==null;i="event_sender_pre_logs_flushed_emitter_exception",this._emitter({name:"pre_logs_flushed",events:e.events}),i=r?"event_sender_unexpected_exception":"event_sender_post_exception";let s=r?this._sendEventsViaBeacon(e,a):yield this._sendEventsViaPost(e,a);if(s.success)return i="event_sender_logs_flushed_emitter_exception",this._emitter({name:"logs_flushed",events:e.events}),s;return Object.assign(Object.assign(Object.assign({success:!1,statusCode:s.statusCode,failurePath:s.failurePath},s.failureErrorMessage?{failureErrorMessage:s.failureErrorMessage}:{}),s.failureDiagnosticBucket?{failureDiagnosticBucket:s.failureDiagnosticBucket}:{}),s.failureDiagnosticMetadata?{failureDiagnosticMetadata:s.failureDiagnosticMetadata}:{})}catch(e){return s.Log.warn("Failed to send batch:",e),Object.assign(Object.assign(Object.assign({success:!1,statusCode:-1,failurePath:null!=(r=a.path)?r:i},a.errorMessage?{failureErrorMessage:a.errorMessage}:{}),a.diagnosticBucket?{failureDiagnosticBucket:a.diagnosticBucket}:{}),a.diagnosticMetadata?{failureDiagnosticMetadata:a.diagnosticMetadata}:{})}})}_sendEventsViaPost(e,t){return r(this,void 0,void 0,function*(){var n,r;let s=yield this._network.post(this._getRequestData(e),t),i=null!=(n=null==s?void 0:s.code)?n:-1;return -1===i?Object.assign(Object.assign(Object.assign({success:!1,statusCode:-1,failurePath:null!=(r=t.path)?r:void 0===s?"event_sender_post_returned_undefined":"event_sender_post_returned_null"},t.errorMessage?{failureErrorMessage:t.errorMessage}:{}),t.diagnosticBucket?{failureDiagnosticBucket:t.diagnosticBucket}:{}),t.diagnosticMetadata?{failureDiagnosticMetadata:t.diagnosticMetadata}:{}):{success:i>=200&&i<300,statusCode:i}})}_sendEventsViaBeacon(e,t){var n;let r=this._network.beacon(this._getRequestData(e),t);return Object.assign(Object.assign(Object.assign({success:r,statusCode:r?200:-1,failurePath:r?void 0:null!=(n=t.path)?n:"beacon_send_false"},!r&&t.errorMessage?{failureErrorMessage:t.errorMessage}:{}),!r&&t.diagnosticBucket?{failureDiagnosticBucket:t.diagnosticBucket}:{}),!r&&t.diagnosticMetadata?{failureDiagnosticMetadata:t.diagnosticMetadata}:{})}_getRequestData(e){return{sdkKey:this._sdkKey,data:{events:e.events},urlConfig:this._logEventUrlConfig,retries:3,preserveFailedStatusCode:!0,isCompressable:!0,params:{[i.NetworkParam.EventCount]:String(e.events.length)},headers:{"statsig-event-count":String(e.events.length),"statsig-retry-count":String(e.attempts),"statsig-sdk-type":a.SDKType._get(this._sdkKey),"statsig-sdk-version":o.SDK_VERSION},credentials:"same-origin"}}}t.EventSender=u},99842:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._createLayerParameterExposure=t._createConfigExposure=t._mapExposures=t._createGateExposure=t._isExposureEvent=void 0;let n="statsig::config_exposure",r="statsig::gate_exposure",s="statsig::layer_exposure",i=(e,t,n,r,s)=>(n.bootstrapMetadata&&(r.bootstrapMetadata=n.bootstrapMetadata),{eventName:e,user:t,value:null,metadata:o(n,r),secondaryExposures:s,time:Date.now()});function a(e,t){return e.map(e=>"string"==typeof e?(null!=t?t:{})[e]:e).filter(e=>null!=e)}t._isExposureEvent=({eventName:e})=>e===r||e===n||e===s,t._createGateExposure=(e,t,n)=>{var s,o,l;let u={gate:t.name,gateValue:String(t.value),ruleID:t.ruleID};return(null==(s=t.__evaluation)?void 0:s.version)!=null&&(u.configVersion=t.__evaluation.version),i(r,e,t.details,u,a(null!=(l=null==(o=t.__evaluation)?void 0:o.secondary_exposures)?l:[],n))},t._mapExposures=a,t._createConfigExposure=(e,t,r)=>{var s,o,l,u;let d={config:t.name,ruleID:t.ruleID};return(null==(s=t.__evaluation)?void 0:s.version)!=null&&(d.configVersion=t.__evaluation.version),(null==(o=t.__evaluation)?void 0:o.passed)!=null&&(d.rulePassed=String(t.__evaluation.passed)),i(n,e,t.details,d,a(null!=(u=null==(l=t.__evaluation)?void 0:l.secondary_exposures)?u:[],r))},t._createLayerParameterExposure=(e,t,n,r)=>{var o,l,u,d,c,_,h;let g=t.__evaluation,f=(null==(o=null==g?void 0:g.explicit_parameters)?void 0:o.includes(n))===!0,v="",p=null!=(l=null==g?void 0:g.undelegated_secondary_exposures)?l:[];f&&(v=null!=(u=g.allocated_experiment_name)?u:"",p=null!=(d=g.secondary_exposures)?d:[]);let m=null==(c=t.__evaluation)?void 0:c.parameter_rule_ids,y={config:t.name,parameterName:n,ruleID:null!=(_=null==m?void 0:m[n])?_:t.ruleID,allocatedExperiment:v,isExplicitParameter:String(f)};return(null==(h=t.__evaluation)?void 0:h.version)!=null&&(y.configVersion=t.__evaluation.version),i(s,e,t.details,y,a(p,r))};let o=(e,t)=>(t.reason=e.reason,e.lcut&&(t.lcut=String(e.lcut)),e.receivedAt&&(t.receivedAt=String(e.receivedAt)),t)}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.