PageSourceSearch

https://www.smct.org.au/_next/static/chunks/2464-d791d1b2b05931e8.js

js smct.org.au collected 2026-09-24 09:57:17 UTC 92,427 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2464],{1571:(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}}},1628:(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."}},2655:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BatchQueue=void 0;let r=n(53404),s=n(1571);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},3133:(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}},4615:(e,t,n)=>{var r,s,i;Object.defineProperty(t,"__esModule",{value:!0}),t._getInstance=t._getStatsigGlobalFlag=t._getStatsigGlobal=void 0;let o=n(9958);t._getStatsigGlobal=()=>{try{return"undefined"!=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&&o.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 a="__STATSIG__",l="undefined"!=typeof window?window:{},u=void 0!==n.g?n.g:{},d="undefined"!=typeof globalThis?globalThis:{},c=null!=(i=null!=(s=null!=(r=l[a])?r:u[a])?s:d[a])?i:{instance:t._getInstance};l[a]=c,u[a]=c,d[a]=c},4793:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6215:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function a(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(o,a)}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())))})}},6310:(e,t)=>
1{Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigMetadataProvider=t.SDK_VERSION=void 0,t.SDK_VERSION="3.33.3";let n={sdkVersion:t.SDK_VERSION,sdkType:"js-mono"};t.StatsigMetadataProvider={get:()=>n,add:e=>{n=Object.assign(Object.assign({},n),e)}}},9958:(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},10616:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},11024:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._setObjectInStorage=t._getObjectFromStorage=t.Storage=void 0;let r=n(9958),s=n(33530),i={},o={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)},a=null;try{let e=(0,s._getWindowSafe)();e&&e.localStorage&&"function"==typeof e.localStorage.getItem&&(a={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!=a?a:o,u=l;function d(e){try{return e()}catch(e){if(e instanceof Error&&"SecurityError"===e.name)return t.Storage._setProvider(o),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?o: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))}},12207:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PrecomputedEvaluationsContextHandle=void 0;let r=n(9958),s=n(33530),i=n(22337),o=n(62238);class a{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 o.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=a},12464: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(54896),o=n(30464);t.StatsigClient=o.default,s(n(54896),t),t.default=Object.assign((0,i._getStatsigGlobal)(),{StatsigClient:o.default})},12761:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UrlConfiguration=void 0;let r=n(79724),s=n(41384),i={[s.Endpoint._initialize]:"i",[s.Endpoint._rgstr]:"e",[s.Endpoint._download_config_specs]:"d"};class o{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);let o=s.NetworkDefault[e];this.defaultUrl=`${o}/${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=o},18289:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
1ise))(function(s,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function a(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(o,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClientBase=void 0,n(4615);let s=n(4615),i=n(55004),o=n(54292),a=n(9958),l=n(3133),u=n(33530),d=n(22337),c=n(62238),h=n(39666),_=n(11024);class g{constructor(e,t,n,r){var l,h,g,v;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};let f=this.$emt.bind(this);(null==r?void 0:r.logLevel)!=null&&(a.Log.level=r.logLevel),(null==r?void 0:r.disableStorage)&&_.Storage._setDisabled(!0),(null==r?void 0:r.initialSessionID)&&d.StatsigSession.overrideInitialSessionID(r.initialSessionID,e),(null==r?void 0:r.storageProvider)&&_.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,f),this._logger=new o.EventLogger(e,f,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=_.Storage,null==(v=null==(g=null==(h=this.overrideAdapter)?void 0:h.loadFromStorage)?void 0:g.call(h))||v.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]&&a.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,_.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(h.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);a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",e)}};this._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){if((null==n?void 0:n.disableExposureLog)===!0)return void 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},18427:(e,t,n)=>
1{Object.defineProperty(t,"__esModule",{value:!0}),t._notifyVisibilityChanged=t._subscribeToVisiblityChanged=t._isUnloading=t._isCurrentlyVisible=void 0;let r=n(33530),s="foreground",i="background",o=[],a=s,l=!1;t._isCurrentlyVisible=()=>a===s,t._isUnloading=()=>l,t._subscribeToVisiblityChanged=e=>{o.unshift(e)},t._notifyVisibilityChanged=e=>{e!==a&&(a=e,o.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)})},22337:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigSession=t.SessionID=void 0;let r=n(93069),s=n(9958),i=n(11024),o=n(26095),a=n(18427),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=h(),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 h(){return{sessionID:(0,o.getUUID)(),startTime:Date.now(),lastUpdate:Date.now()}}(0,a._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)=>(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:h(),sdkKey:e,lastPersistedAt:0,storageKey:t}}(e)),function(e,t){var n;let r=Date.now();return u(e)?c(e):t&&(e.data.lastUpdate=r,n=e,Date.now()-n.lastPersistedAt>15e3&&c(n)),e}(l[e],t)),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)}}},24357:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.V2InitializeContainer=void 0;let r=n(54896);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,o;let a=this._getResultFromLookup(this._values.layer_configs,e);return a?{name:e,value:null!=(t=this._values.values[a.v])?t:{},rule_id:a.r,secondary_exposures:null!=(n=a.s)?n:[],is_user_in_experiment:!0===a.ue,group_name:null!=(r=a.gn)?r:void 0,is_experiment_active:!0===a.ea,group:a.r,is_device_based:"stableID"===a.i,allocated_experiment_name:null!=(s=a.ae)?s:"",explicit_parameters:null!=(i=a.ep)?i:[],undelegated_secondary_exposures:null!=(o=a.us)?o:[],parameter_rule_ids:a.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},24674:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DataAdapterCachePrefix=void 0,t.DataAdapterCachePrefix="statsig.cached"},26095:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getUUID=void 0,t.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let e=new Date().getTime(),t="undefined"!=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)})}},26200:(e,t)=>
1{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)}},30464:(e,t,n)=>{var r=function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function a(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(o,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});let s=n(54896),i=n(93131),o=n(44990),a=n(93453),l=n(82257);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:"",{}))}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 o=this.dataAdapter.getDataSync(this._user);null==o&&i.push("NoCachedValues"),this._store.setValues(o,this._user),this._finalizeUpdate(o);let a=null==t?void 0:t.disableBackgroundCacheRefresh;return!0===a||null==a&&(null==o?void 0:o.source)==="Bootstrap"||this._runPostUpdate(null!=o?o: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 o=s.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,s.createUpdateDetails)(i,this._store.getSource(),o,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 o=(0,s._normalizeUser)(e,t),a=null==(n=o.customIDs)?void 0:n.stableID;if(a){let e=null==(i=(r=this.storageProvider).isReadyResolver)?void 0:i.call(r);e?e.then(()=>s.StableID.setOverride(a,this._sdkKey),()=>s.StableID.setOverride(a,this._sdkKey)):s.StableID.setOverride(a,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(o.analyticsOnlyMetadata=Object.assign(Object.assign({},o.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),o}_getFeatureGateImpl(e,t){var n,r;let{result:i,details:o}=this._store.getGate(e);this._checkUserHasIdForEvaluation(null==i?void 0:i.id_type,e,"Gate"),this._checkInitializationStatus(o.reason);let a=(0,s._makeFeatureGate)(e,o,i),l=null==(r=null==(n=this.overrideAdapter)?void 0:n.getGateOverride)?void 0:r.call(n,a,this._user,t),u=null!=l?l:a;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:o}=this._store.getConfig(e);this._checkUserHasIdForEvaluation(null==i?void 0:i.id_type,e,"Dynamic config"),this._checkInitializationStatus(o.reason);let a=(0,s._makeDynamicConfig)(e,o,i),l=null==(r=null==(n=this.overrideAdapter)?void 0:n.getDynamicConfigOverride)?void 0:r.call(n,a,this._user,t),u=null!=l?l:a;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,o;let{result:a,details:l}=this._store.getConfig(e);this._checkUserHasIdForEvaluation(null==a?void 0:a.id_type,e,"Experiment"),this._checkInitializationStatus(l.reason);let u=(0,s._makeExperiment)(e,l,a);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==(o=null==(i=this.overrideAdapter)?void 0:i.getExperimentOverride)?void 0:o.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:o,details:a}=this._store.getLayer(e),l=(0,s._makeLayer)(e,a,o),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 o={name:e,details:i,__configuration:s,get:(0,a._makeParamStoreGetter)(this,s,t)},l=null==(r=null==(n=this.overrideAdapter)?void 0:n.getParamStoreOverride)?void 0:r.call(n,o,t);return null!=l&&(o.__configuration=l.config,o.details=l.details,o.get=(0,a._makeParamStoreGetter)(this,l.config,t)),o}_checkUserHasIdForEvaluation(e,t,n){e&&((0,s._getUnitIDFromUser)(this._user,e)||s.Log.warn('The user does not have the required id_type "'.concat(e,'" for ').concat(n,' "').concat(t,'"')))}_checkInitializationStatus(e){("Uninitialized"===e||e.startsWith("Loading"))&&s.Log.warn("SDK initialization has not completed. Reason: ".concat(e))}constructor(e,t,n=null){var r,a;s.SDKType._setClientType(e,"javascript-client");let u=new o.default(n,e=>{this.$emt(e)});for(let o 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,()=>this._options,()=>this._errorBoundary,()=>this._store.getValues(),()=>this._user,()=>this._sdkInstanceID),null!=(a=null==n?void 0:n.plugins)?a:[]))o.bind(this)}}t.default=u},33530:(e,t,n)=>{var r=n(40459);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(9958);t._getWindowSafe=()=>"undefined"!=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}}},37267:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},39461:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},39588:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},39666:(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"}},41384:(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"}},42040:(e,t)=>
1{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],o=0,a=0;for(;;){if(s[o]<r[o].length){let e=r[o][s[o]++],a=n[o][e];if(i[o]+=e.length,a&&"object"==typeof a){n[++o]=a,r[o]=Object.keys(a),s[o]=i[o]=0;continue}if(i[o]+=(a+"").length+1,i[o]<t)continue}for(a=i[o--];o>=0&&(i[o]+=a+2)>=t;a=i[o--]);if(o<0)return a}}},43355:(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(9958),s=n(26200);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 o(e,t,n){var r,s;let o=null!=(r=null==n?void 0:n.value)?r:{};return Object.assign(Object.assign({},i(e,t,n,o)),{idType:null!=(s=null==n?void 0:n.id_type)?s:null,get:a(e,null==n?void 0:n.value)})}function a(e,t,n){return(i,o)=>{var a;let l=null!=(a=null==t?void 0:t[i])?a:null;return null==l?null!=o?o:null:null==o||(0,s._isTypeMatch)(l,o)?(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 o}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=o?o: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=o,t._makeExperiment=function(e,t,n){var r;return Object.assign(Object.assign({},o(e,t,n)),{groupName:null!=(r=null==n?void 0:n.group_name)?r:null})},t._makeLayer=function(e,t,n,r){var s,o;return Object.assign(Object.assign({},i(e,t,n,void 0)),{get:a(e,null==n?void 0:n.value,r),groupName:null!=(s=null==n?void 0:n.group_name)?s:null,__value:null!=(o=null==n?void 0:n.value)?o:{}})},t._mergeOverride=function(e,t,n,r){return Object.assign(Object.assign(Object.assign({},e),t),{get:a(e.name,n,r)})},t._makeTypedGet=a},44572:(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 o(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:o(e,"code"),name:o(e,"name"),message:o(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 o=i[i.length-1].timestamp-i[0].timestamp;t.Diagnostics._clearMarkers(r);let a={eventName:"statsig::diagnostics",user:e,value:null,metadata:{context:"initialize",markers:i.slice(),statsigOptions:s},time:Date.now()};return n.enqueue(a),o}}},44990:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function a(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(o,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});let s=n(54896),i=n(51106);class o extends s.NetworkCore{constructor(e,t){super(e,t);let 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,o){return r(this,void 0,void 0,function*(){var r,a,l,u,d,c;let h=t?(0,s._typedJsonParse)(t,"has_updates","InitializeResponse"):null,_={user:i,hash:null!=(l=null==(a=null==(r=this._option)?void 0:r.networkConfig)?void 0:a.initializeHashAlgorithm)?l:"djb2",deltasResponseRequested:!1,full_checksum:null};if(null==h?void 0:h.has_updates){let e=(null==h?void 0:h.hash_used)!==(null!=(c=null==(d=null==(u=this._option)?void 0:u.networkConfig)?void 0:d.initializeHashAlgorithm)?c:"djb2");_=Object.assign(Object.assign({},_),{sinceTime:o&&!e?h.time:0,previousDerivedFields:"derived_fields"in h&&o?h.derived_fields:{},deltasResponseRequested:!0,full_checksum:h.full_checksum,partialUserMatchSinceTime:e?0:h.time})}return this._fetchEvaluations(e,h,_,n)})}_fetchEvaluations(e,t,n,s){return r(this,void 0,void 0,function*(){var r,o;let a=yield this.post({sdkKey:e,urlConfig:this._initializeUrlConfig,data:n,retries:2,isStatsigEncodable:!0,priority:s});if((null==a?void 0:a.code)===204)return'{"has_updates": false}';if((null==a?void 0:a.code)!==200)return null!=(r=null==a?void 0:a.body)?r:null;if((null==t?void 0:t.has_updates)!==!0||(null==(o=a.body)?void 0:o.includes('"is_delta":true'))!==!0||!0!==n.deltasResponseRequested)return a.body;let l=(0,i._resolveDeltasResponse)(t,a.body);return"string"==typeof l?l:this._fetchEvaluations(e,t,Object.assign(Object.assign(Object.assign({},n),l),{deltasResponseRequested:!1}),s)})}}t.default=o},51106:(e,t,n)=>
1{Object.defineProperty(t,"__esModule",{value:!0}),t._resolveDeltasResponse=void 0;let r=n(54896);function s(e,t){null==e||e.forEach(e=>{delete t[e]})}t._resolveDeltasResponse=function(e,t){var n,i,o;let a=(0,r._typedJsonParse)(t,"checksum","DeltasEvaluationResponse");if(!a)return{hadBadDeltaChecksum:!0};let l=(s((o=(n=e,i=a,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,o.feature_gates),delete o.deleted_gates,s(o.deleted_configs,o.dynamic_configs),delete o.deleted_configs,s(o.deleted_layers,o.layer_configs),delete o.deleted_layers,o),u=(0,r._DJB2Object)({feature_gates:l.feature_gates,dynamic_configs:l.dynamic_configs,layer_configs:l.layer_configs},2);return u!==a.checksumV2?{hadBadDeltaChecksum:!0,badChecksum:u,badMergedConfigs:l,badFullResponse:a.deltas_full_response}:JSON.stringify(l)}},53404:(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},53630:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.V1InitializeContainer=void 0;let r=n(54896);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},54292:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function a(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(o,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.EventLogger=void 0;let s=n(2655),i=n(93069),o=n(1571),a=n(95308),l=n(79724),u=n(9958),d=n(41384),c=n(64042),h=n(33530),_=n(80421),g=n(39666),v=n(11024),f=n(12761),p=n(18427),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.");let o=null==r?void 0:r.networkConfig;this._logEventUrlConfig=new f.UrlConfiguration(d.Endpoint._rgstr,null==o?void 0:o.logEventUrl,null==o?void 0:o.api,null==o?void 0:o.logEventFallbackUrls)}setLogEventCompressionMode(e){this._flushCoordinator?this._flushCoordinator.setLogEventCompressionMode(e):this._pendingCompressionMode=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);
1if("disabled"===this._loggingEnabled)return void 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,h._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,h._isServerEnv)())return!1;if(!(0,_._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:{},o=[e.eventName,r,s.gate,s.config,s.ruleID,s.allocatedExperiment,s.parameterName,String(s.isExplicitParameter),s.reason].join("|"),a=this._lastExposureTimeMap[o],l=Date.now();return(!a||!(l-a<6e5))&&(Object.keys(this._lastExposureTimeMap).length>1e3&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[o]=l,!0)}_getCurrentPageUrl(){var e;if((null==(e=this._options)?void 0:e.includeCurrentPageUrlWithEvents)!==!1)return(0,h._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:o.EventRetryConstants.DEFAULT_BATCH_SIZE;return this._pendingEvents=new c.PendingEvents(n),this._batchQueue=new s.BatchQueue(n),this._flushCoordinator=new a.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>o.EventRetryConstants.MAX_LOCAL_STORAGE&&(n=n.slice(-o.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,v._setObjectInStorage)(t,n)}catch(e){u.Log.warn("Unable to save events to storage")}}_getEventsFromStorage(e){try{let t=(0,v._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&&v.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},54896: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)};
1Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=t.Log=t.EventLogger=t.Diagnostics=void 0,n(4615);let i=n(4615),o=n(44572);Object.defineProperty(t,"Diagnostics",{enumerable:!0,get:function(){return o.Diagnostics}});let a=n(54292);Object.defineProperty(t,"EventLogger",{enumerable:!0,get:function(){return a.EventLogger}});let l=n(9958);Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return l.Log}});let u=n(6310),d=n(11024);Object.defineProperty(t,"Storage",{enumerable:!0,get:function(){return d.Storage}}),s(n(4615),t),s(n(93069),t),s(n(12207),t),s(n(65308),t),s(n(44572),t),s(n(4793),t),s(n(55004),t),s(n(10616),t),s(n(68459),t),s(n(79724),t),s(n(39461),t),s(n(9958),t),s(n(3133),t),s(n(41384),t),s(n(77053),t),s(n(37267),t),s(n(68263),t),s(n(33530),t),s(n(79740),t),s(n(22337),t),s(n(42040),t),s(n(62238),t),s(n(18289),t),s(n(93566),t),s(n(24674),t),s(n(80421),t),s(n(6310),t),s(n(39666),t),s(n(93588),t),s(n(43355),t),s(n(39588),t),s(n(77340),t),s(n(11024),t),s(n(79025),t),s(n(26200),t),s(n(12761),t),s(n(26095),t),s(n(18427),t),s(n(1628),t),s(n(92567),t),Object.assign((0,i._getStatsigGlobal)(),{Log:l.Log,SDK_VERSION:u.SDK_VERSION})},55004:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function a(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(o,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorBoundary=t.EXCEPTION_ENDPOINT=void 0;let s=n(9958),i=n(79740),o=n(6310);t.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";let a="[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,o,a,l){let u={eventCount:String(e),flushType:n,statusCode:String(r),reason:t,retries:String(s)};i&&(u.failurePath=i),"string"==typeof o&&o.length>0&&(u.failureErrorMessage=o),"string"==typeof a&&a.length>0&&(u.failureDiagnosticBucket=a),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,v;let f=n||Error(a),p=f instanceof Error,m=p?f.name:"No Name",y=u(f);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=o.StatsigMetadataProvider.get(),E=p?f.stack:function(e){try{return JSON.stringify(e)}catch(e){return a}}(f),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:{}),w=null==(h=this._options)?void 0:h.networkConfig,D=null!=(_=null==w?void 0:w.networkOverrideFunc)?_:fetch;yield D(null!=(g=null==w?void 0:w.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==(v=this._emitter)||v.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},62238:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getCookieName=t.StableID=void 0;let r=n(93069),s=n(9958),i=n(33530),o=n(11024),a=n(26095),l={},u={},d={};function c(e){return`statsig.stable_id.${(0,r._getStorageKey)(e)}`}function h(e,t){let n=c(t);try{(0,o._setObjectInStorage)(n,e)}catch(e){s.Log.warn("Failed to save StableID to storage")}}function _(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=>{if(d[e])return null;if(null!=l[e])return l[e];let t=null;return null!=(t=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]=t,h(t,e)):(null==(t=function(e){let t=c(e);return(0,o._getObjectFromStorage)(t)}(e))&&(t=(0,a.getUUID)()),h(t,e),_(t,e),l[e]=t),t},setOverride:(e,t)=>{l[t]=e,h(e,t),_(e,t)},_setCookiesEnabled:(e,t)=>{u[e]=t},_setDisabled:(e,t)=>{d[e]=t}},t.getCookieName=g},64042:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PendingEvents=void 0;let r=n(9958);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},65308:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function a(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(o,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._makeDataAdapterResult=t.DataAdapterCore=void 0;let s=n(9958),i=n(62238),o=n(77340),a=n(11024),l=n(79025);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,o._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,o._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*(){a.Storage.isReady()||(yield a.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,o._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 o=null!=(r=null==e?void 0:e.data)?r:null,a=null!=e&&this._isCachedResultValidFor204(e,t),u=yield this._fetchFromNetwork(o,t,n,a);if(!u)return s.Log.debug("No response returned for latest value"),null;let c=(0,l._typedJsonParse)(u,"has_updates","Response"),h=this._getSdkKey(),_=i.StableID.get(h),g=null;if((null==c?void 0:c.has_updates)===!0)g=d("Network",u,_,t);else{if(!o||(null==c?void 0:c.has_updates)!==!1)return null;g=d("NetworkNotModified",o,_,t)}let v=this._getCacheKey(t);return this._inMemoryCache.add(v,g,this._cacheLimit),this._writeToCache(v,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=a.Storage.getItem)?void 0:t.call(a.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{a.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,a._getObjectFromStorage)(this._lastModifiedStoreKey))?n:{};for(let n of(r[e]=Date.now(),h(r,t)))delete r[n],a.Storage.removeItem(n);(0,a._setObjectInStorage)(this._lastModifiedStoreKey,r)}}function d(e,t,n,r){return{source:e,data:t,receivedAt:Date.now(),stableID:n,fullUserHash:(0,o._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,o=null==(n=null==t?void 0:t.customIDs)?void 0:n.stableID;return o&&i&&o!==i?(s.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):r}add(e,t,n){for(let e of h(this._data,n-1))delete this._data[e];this._data[e]=t}merge(e){this._data=Object.assign(Object.assign({},this._data),e)}}function h(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)}},67353:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
1ise))(function(s,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function a(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(o,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.EventSender=void 0;let s=n(9958),i=n(41384),o=n(79740),a=n(6310),l=n(18427);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",o={};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,o):yield this._sendEventsViaPost(e,o);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=o.path)?r:i},o.errorMessage?{failureErrorMessage:o.errorMessage}:{}),o.diagnosticBucket?{failureDiagnosticBucket:o.diagnosticBucket}:{}),o.diagnosticMetadata?{failureDiagnosticMetadata:o.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":o.SDKType._get(this._sdkKey),"statsig-sdk-version":a.SDK_VERSION},credentials:"same-origin"}}}t.EventSender=u},68263:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},68459:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},77053:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function a(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(o,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkCore=t.RETRYABLE_CODES=void 0,n(4615);let s=n(4615),i=n(44572),o=n(9958),a=n(41384),l=n(79794),u=n(92567),d=n(79740),c=n(33530),h=n(22337),_=n(62238),g=n(93566),v=n(6310),f=n(39666),p=n(18427);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"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}
1getLastUsedInitUrlAndReset(){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,_,v,f,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:b,body:k,retries:w,attempt:D}=e,C=e.urlConfig.endpoint;if(this._isRateLimited(C))return o.Log.warn(`Request to ${C} was blocked because you are making requests too frequently.`),n&&(n.path="network_rate_limited"),null;let I=null!=D?D:1,O=!1,x=this._getPopulatedURL(e),F=Date.now(),M=null,P=(0,p._isUnloading)();try{let t,n={method:b,body:k,headers:Object.assign({},e.headers),priority:e.priority,keepalive:P};h=e,_=I,h.urlConfig.endpoint===a.Endpoint._initialize&&i.Diagnostics._markInitNetworkReqStart(h.sdkKey,{attempt:_});let r=this._leakyBucket[C];r&&(r.lastRequestTime=Date.now(),this._leakyBucket[C]=r);let o=null!=(s=this._netConfig.networkOverrideFunc)?s:fetch;if(!(M=yield Promise.race([o(x,n).finally(()=>clearTimeout(t)),new Promise((e,n)=>{t=setTimeout(()=>{O=!0,n(Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})])).ok){let e=yield M.text().catch(()=>"No Text"),t=Error(`NetworkError: ${x} ${e}`);throw t.name="NetworkError",t}let l=yield M.text();return E(e,M,I,l),this._fallbackResolver.tryBumpExpiryTime(e.sdkKey,e.urlConfig),{body:l,code:M.status}}catch(a){let s="string"==typeof(v=a)?v:v instanceof Error?`${v.name}: ${v.message}`:"Unknown Error",i=(f=null!=s?s:"",m=O,f.includes("Timeout")||m);if(E(e,M,I,"",a),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(e.sdkKey,e.urlConfig,s,i))&&(e.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(e.sdkKey,e.urlConfig)),!w||I>w||!t.RETRYABLE_CODES.has(null!=(l=null==M?void 0:M.status)?l:500)){null==(u=this._emitter)||u.call(this,{name:"error",error:a,tag:g.ErrorTag.NetworkError,requestArgs:e});let t=`A networking error occurred during ${b} request to ${x}.`;if(o.Log.error(t,s,a),null==(d=this._errorBoundary)||d.attachErrorIfNoneExists(t),e.preserveFailedStatusCode&&null!=M)return{body:null,code:M.status};if(null==M&&n){n.path=i?"network_request_timed_out_no_response":"network_request_exception_no_response",s&&(n.errorMessage=s);try{let t=function(e,t,n,r){var s,i,o,a,l,u;let d=(0,c._getWindowSafe)(),h=null==d?void 0:d.document,_="undefined"!=typeof navigator?navigator:null,g=(0,p._isUnloading)(),v=_&&"boolean"==typeof _.onLine?String(_.onLine):"unknown",f=null!=(s=null==h?void 0:h.visibilityState)?s:"unknown",m=Object.keys(null!=(i=e.headers)?i:{}).length>0,y=(a=t,!(l=null==(o=null==d?void 0:d.location)?void 0:o.origin)||!a.startsWith(`${l}/`)&&!a.startsWith(`${l}?`)&&a!==l),b=null!=e.urlConfig.customUrl,E=null!=e.fallbackUrl,k=S(r,[250,1e3,5e3,1e4]),w=S((u=e.body,null==u?0:"string"==typeof u?u.length:u instanceof Uint8Array?u.byteLength:"undefined"!=typeof Blob&&u instanceof Blob?u.size:-1),[16384,65536,262144,1048576]),D="unknown_no_response";return n?D="timeout":"false"===v?D="browser_offline":g?D="page_unloading":"hidden"===f?D="page_hidden":y&&m?D="cross_origin_custom_headers_preflight_risk":b||E?D="custom_url_no_response":r<250&&(D="immediate_network_rejection"),{bucket:D,metadata:{elapsedMsBucket:k,bodySizeBucket:w,online:v,visibilityState:f,isUnloading:String(g),crossOrigin:String(y),hasCustomUrl:String(b)}}}(e,x,i,Date.now()-F);n.diagnosticBucket=t.bucket,n.diagnosticMetadata=t.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)))})}(I),this._sendRequest(Object.assign(Object.assign({},e),{retries:w,attempt:I+1}),n)}})}_getLogEventCompressionMode(e){let t=null==e?void 0:e.logEventCompressionMode;return t||(null==e?void 0:e.disableCompression)!==!0||(t=f.LogEventCompressionMode.Disabled),t||(t=f.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===a.Endpoint._initialize||e.urlConfig.endpoint===a.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=n);let r=Object.assign({[a.NetworkParam.SdkKey]:e.sdkKey,[a.NetworkParam.SdkType]:d.SDKType._get(e.sdkKey),[a.NetworkParam.SdkVersion]:v.SDK_VERSION,[a.NetworkParam.Time]:String(Date.now()),[a.NetworkParam.SessionID]:h.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:{}),{[a.NetworkParam.StatsigEncoded]:"1"})}catch(t){o.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")||"undefined"==typeof CompressionStream||"undefined"==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 f.LogEventCompressionMode.Disabled:return!1;case f.LogEventCompressionMode.Enabled:if(n&&!r)return!1;return!0;case f.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(o.Log.error),l.close().catch(o.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),h=new Uint8Array(c),_=0;for(let e of d)h.set(e,_),_+=e.length;e.body=h,e.params=Object.assign(Object.assign({},null!=(t=e.params)?t:{}),{[a.NetworkParam.IsGzipped]:"1"})}catch(t){o.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||(o.Log.warn("Unable to make request without an SDK key"),!1),b=(e,t)=>{let{sdkKey:n,fallbackUrl:r}=e,s=_.StableID.get(n),i=h.SessionID.get(n),o=d.SDKType._get(n);e.body=JSON.stringify(Object.assign(Object.assign({},t),{statsigMetadata:Object.assign(Object.assign({},v.StatsigMetadataProvider.get()),{stableID:s,sessionID:i,sdkType:o,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===a.Endpoint._initialize&&i.Diagnostics._markInitNetworkReqEnd(e.sdkKey,i.Diagnostics._getDiagnosticsData(t,n,r,s))}},77340:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._getUnitIDFromUser=t._getFullUserHash=t._normalizeUser=void 0;let r=n(79724),s=n(9958),i=n(33530);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}},79025:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._typedJsonParse=void 0;let r=n(9958);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}},79724:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._getSortedObject=t._DJB2Object=t._DJB2=void 0;let r=n(26200);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 o=e[s];if(0===n||"object"!==(0,r._typeOf)(o)){i[s]=o;return}i[s]=(0,t._getSortedObject)(o,null!=n?n-1:n)}),i}},79740:(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)}}},79794:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function a(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(o,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._isDomainFailure=t.NetworkFallbackResolver=void 0;let s=n(6215),i=n(79724),o=n(9958),a=n(11024);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=a.Storage.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch(e){return o.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,o=this._pickNewFallbackUrl(null==(r=this._fallbackInfo)?void 0:r[t.endpoint],i);if(!o)return!1;return this._updateFallbackInfoWithNewUrl(e,t,o),!0}catch(e){return null==(i=this._errorBoundary)||i.logError("tryFetchUpdatedFallbackInfo",e),!1}})}_updateFallbackInfoWithNewUrl(e,t,n){var r,s,i;let o={urlConfigChecksum:t.getChecksum(),url:n,expiryTime:Date.now()+6048e5,previous:[]},a=t.endpoint,l=null==(r=this._fallbackInfo)?void 0:r[a];l&&o.previous.push(...l.previous),o.previous.length>10&&(o.previous=[]);let u=null==(i=null==(s=this._fallbackInfo)?void 0:s[a])?void 0:i.url;null!=u&&o.previous.push(u),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[a]:o}),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),o=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}${o}
1`)}}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);if(!t||0===Object.keys(t).length)return void a.Storage.removeItem(n);a.Storage.setItem(n,JSON.stringify(t))}t.NetworkFallbackResolver=l,t._isDomainFailure=u},80421:(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:a(n,r),secondaryExposures:s,time:Date.now()});function o(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,a,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,o(null!=(l=null==(a=t.__evaluation)?void 0:a.secondary_exposures)?l:[],n))},t._mapExposures=o,t._createConfigExposure=(e,t,r)=>{var s,a,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==(a=t.__evaluation)?void 0:a.passed)!=null&&(d.rulePassed=String(t.__evaluation.passed)),i(n,e,t.details,d,o(null!=(u=null==(l=t.__evaluation)?void 0:l.secondary_exposures)?u:[],r))},t._createLayerParameterExposure=(e,t,n,r)=>{var a,l,u,d,c,h,_;let g=t.__evaluation,v=(null==(a=null==g?void 0:g.explicit_parameters)?void 0:a.includes(n))===!0,f="",p=null!=(l=null==g?void 0:g.undelegated_secondary_exposures)?l:[];v&&(f=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!=(h=null==m?void 0:m[n])?h:t.ruleID,allocatedExperiment:f,isExplicitParameter:String(v)};return(null==(_=t.__evaluation)?void 0:_.version)!=null&&(y.configVersion=t.__evaluation.version),i(s,e,t.details,y,o(p,r))};let a=(e,t)=>(t.reason=e.reason,e.lcut&&(t.lcut=String(e.lcut)),e.receivedAt&&(t.receivedAt=String(e.receivedAt)),t)},82257:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function a(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(o,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigEvaluationsDataAdapter=void 0;let s=n(54896),i=n(44990);class o 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=o},86151:(e,t)=>
1{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},87183:(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"}},92567:(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}}},93069:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._getStorageKey=t._getUserStorageKey=void 0;let r=n(79724);function s(e,t,n){var s;if(n)return n(e,t);let i=t&&t.customIDs?t.customIDs:{},o=[`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)(o.join("|"))}t._getUserStorageKey=s,t._getStorageKey=function(e,t,n){return t?s(e,t,n):(0,r._DJB2)(`k:${e}`)}},93131:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(54896),s=n(53630),i=n(24357);class o{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,o;if(!e)return!1;let a=(0,r._typedJsonParse)(e.data,"has_updates","EvaluationResponse");return null!=a&&(this._source=e.source,(null==a?void 0:a.has_updates)!==!0||(null!=(n=a.time)?n:0)<this._lcut||(this._valuesForExternalUse=(0,r._typedJsonParse)(e.data,"has_updates","EvaluationResponse"),this._lcut=a.time,this._receivedAt=e.receivedAt,"init-v2"===a.response_format?this._values=new i.V2InitializeContainer(a):this._values=new s.V1InitializeContainer(a),this._bootstrapMetadata=this._extractBootstrapMetadata(e.source,a),e.source&&a.user&&this._setWarningState(t,a),r.SDKFlags.setFlags(this._sdkKey,null!=(o=a.sdk_flags)?o:{}),!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 o=r.StableID.get(this._sdkKey);if((null==(n=e.customIDs)?void 0:n.stableID)!==o&&((null==(s=e.customIDs)?void 0:s.stableID)||o))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 o="Bootstrap"===this._source&&null!=(n=this._bootstrapMetadata)?n:void 0;return o&&(r.bootstrapMetadata=o),Object.assign(Object.assign({},r),{reason:s})}}t.default=o},93453:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._makeParamStoreGetter=void 0;let r=n(54896),s={disableExposureLog:!0};function i(e){return null==e||!1===e.disableExposureLog}function o(e,t){return null!=t&&!(0,r._isTypeMatch)(e,t)}t._makeParamStoreGetter=function(e,t,n){return(a,l)=>{if(null==t)return l;let u=t[a];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=e.getDynamicConfig(u.config_name,i(n)?void 0:s).get(u.param_name);return o(d,l)?l:d;case"experiment":let c=e.getExperiment(u.experiment_name,i(n)?void 0:s).get(u.param_name);return o(c,l)?l:c;case"layer":let h=e.getLayer(u.layer_name,i(n)?void 0:s).get(u.param_name);return o(h,l)?l:h;default:return l}}}},93566:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTag=void 0,t.ErrorTag={NetworkError:"NetworkError"}},93588:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},95308:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(s,i){function o(e){try{l(r.next(e))}catch(e){i(e)}}function a(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(o,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.FlushCoordinator=void 0;let s=n(1571),i=n(67353),o=n(86151),a=n(87183),l=n(79724),u=n(9958),d=n(77053),c=n(33530),h=n(22337),_=n(39666),g=n(11024),v=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 f{constructor(e,t,n,r,s,a,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 o.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,a,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(a.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(a.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();if(!t&&!n)return void this._scheduleNoopPollTick();this._flushInterval.markFlushAttempt(),e=t?a.FlushTypeValues.ScheduledFullBatch:a.FlushTypeValues.ScheduledMaxTime,this._currentFlushPromise=this._processNextBatch(e).then(()=>{}).catch(e=>{u.Log.error("Error during scheduled flush:",e)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()})}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(a.FlushTypeValues.Limit))for(;this._flushInterval.hasCompletelyRecoveredFromBackoff()&&this.containsAtLeastOneFullBatch()&&(yield this._processNextBatch(a.FlushTypeValues.Limit)););})}_scheduleNextFlush(){if(this._clearAllTimers(),this._isShuttingDown)return;let e=Math.max(0,this._flushInterval.getTimeUntilNextFlush());this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,h.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},e);let t=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,h.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,h.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,h.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!==_.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&&v.has(t))}_handleFailure(e,t,n,r,i,o,l){if(t===a.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,o,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,o,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=f}}]);

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.