!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1dade642-3b4c-46cd-b18e-7f950e1dc309",e._sentryDebugIdIdentifier="sentry-dbid-1dade642-3b4c-46cd-b18e-7f950e1dc309")}catch(e){}}(),function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1dade642-3b4c-46cd-b18e-7f950e1dc309",e._sentryDebugIdIdentifier="sentry-dbid-1dade642-3b4c-46cd-b18e-7f950e1dc309")}catch(e){}}(),function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1dade642-3b4c-46cd-b18e-7f950e1dc309",e._sentryDebugIdIdentifier="sentry-dbid-1dade642-3b4c-46cd-b18e-7f950e1dc309")}catch(e){}}(),(self.webpackChunktwitch_twilight=self.webpackChunktwitch_twilight||[]).push([[54324],{67043:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignmentCacheFactory=void 0;const n=r(821552),i=r(382415),s=r(954035),a=r(171726),o=r(541479);t.assignmentCacheFactory=function({forceMemoryOnly:e=!1,chromeStorage:t,storageKeySuffix:r}){const u=new o.default;if(e)return u;if(t){const e=new i.default(t);return new s.default(u,e)}if((0,n.hasWindowLocalStorage)()){const e=new a.LocalStorageAssignmentCache(r);return new s.default(u,e)}return u}},382415:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(123231),i=r(330802);t.default=class{constructor(e){this.storage=new i.default(e)}set(e){this.storage.set((0,n.assignmentCacheKeyToString)(e),(0,n.assignmentCacheValueToString)(e))}has(e){throw new Error("This should never be called for ChromeStorageAssignmentCache, use getEntries() instead.")}async getEntries(){const e=await this.storage.entries();return Object.entries(e).map((([e,t])=>[e,t]))}}},330802:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e){this.storage=e}async has(e){return!!await this.get(e)}async get(e){var t;const r=await this.storage.get(e);return null!==(t=null==r?void 0:r[e])&&void 0!==t?t:void 0}async entries(){return await this.storage.get(null)}async set(e,t){await this.storage.set({[e]:t})}}},954035:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t){this.servingStore=e,this.persistentStore=t}async init(){const e=await this.persistentStore.getEntries();e&&this.servingStore.setEntries(e)}set(e){this.servingStore.set(e),this.persistentStore.set(e)}has(e){return this.servingStore.has(e)}}},171726:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocalStorageAssignmentCache=void 0;const n=r(123231),i=r(100135);class s extends n.AbstractAssignmentCache{constructor(e){super(new i.LocalStorageAssignmentShim(e))}setEntries(e){e.forEach((([e,t])=>{e&&t&&this.delegate.set(e,t)}))}getEntries(){return Promise.resolve(Array.from(this.entries()))}}t.LocalStorageAssignmentCache=s},100135:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.LocalStorageAssignmentShim=void 0;const i=r(821552);class s{constructor(e){if(this.size=this.getCache().size,this[n]=this.getCache()[Symbol.toStringTag],!(0,i.hasWindowLocalStorage)())throw new Error("LocalStorage is not available");const t=e?`-${e}`:"";this.localStorageKey=`eppo-assignment${t}`}clear(){this.getCache().clear()}delete(e){return this.getCache().delete(e)}forEach(e,t){this.getCache().forEach(e,t)}entries(){return this.getCache().entries()}keys(){return this.getCache().keys()}values(){return this.getCache().values()}[Symbol.iterator](){return this.getCache()[Symbol.iterator]()}has(e){return this.getCache().has(e)}get(e){var t;return null!==(t=this.getCache().get(e))&&void 0!==t?t:void 0}set(e,t){return this.setCache(this.getCache().set(e,t))}getCache(){const e=window.localStorage.getItem(this.localStorageKey);return e?new Map(JSON.parse(e)):new Map}setCache(e){return window.localStorage.setItem(this.localStorageKey,JSON.stringify(Array.from(e.entries()))),this}}t.LocalStorageAssignmentShim=s,n=Symbol.toStringTag},541479:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(123231);t.default=class{constructor(){this.store=new Map,this.cache=new n.NonExpiringInMemoryAssignmentCache(this.store)}set(e){this.cache.set(e)}has(e){return this.cache.has(e)}setEntries(e){const{store:t}=this;e.forEach((([e,r])=>t.set(e,r)))}getEntries(){return Promise.resolve(Array.from(this.cache.entries()))}}},806814:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ChromeStorageEngine=void 0;const n=r(554406);t.ChromeStorageEngine=class{constructor(e,t){this.storageMap=e,this.getContentsJsonString=async()=>{const e=await this.storageMap.get(this.contentsKey);return null!=e?e:null},this.getMetaJsonString=async()=>{const e=await this.storageMap.get(this.metaKey);return null!=e?e:null},this.setContentsJsonString=async e=>{await this.storageMap.set(this.contentsKey,e)},this.setMetaJsonString=async e=>{await this.storageMap.set(this.metaKey,e)};const r=t?`-${t}`:"";this.contentsKey=n.CONFIGURATION_KEY+r,this.metaKey=n.META_KEY+r}}},883983:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigSource=t.ConfigLoaderStatus=void 0,function(e){e[e.FAILED=0]="FAILED",e[e.DID_NOT_PRODUCE=1]="DID_NOT_PRODUCE",e[e.COMPLETED=2]="COMPLETED"}(t.ConfigLoaderStatus||(t.ConfigLoaderStatus={})),function(e){e[e.CONFIG_STORE=0]="CONFIG_STORE",e[e.FETCH=1]="FETCH",e[e.NONE=2]="NONE"}(t.ConfigSource||(t.ConfigSource={}))},821552:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.localStorageIfAvailable=t.hasWindowLocalStorage=t.chromeStorageIfAvailable=t.hasChromeStorage=t.overrideStorageFactory=t.configurationStorageFactory=t.precomputedBanditStoreFactory=t.precomputedFlagsStorageFactory=void 0;const n=r(123231),i=r(330802),s=r(806814),a=r(772557),o=r(137309),u=r(554406),c=r(297029);function l(){return"undefined"!=typeof chrome&&!!chrome.storage}function d(){try{return"undefined"!=typeof window&&!!window.localStorage}catch(e){return!1}}t.precomputedFlagsStorageFactory=function(){return new n.MemoryOnlyConfigurationStore},t.precomputedBanditStoreFactory=function(){return new n.MemoryOnlyConfigurationStore},t.configurationStorageFactory=function({maxAgeSeconds:e=0,servingStoreUpdateStrategy:t="always",hasChromeStorage:r=!1,hasWindowLocalStorage:u=!1,persistentStore:l,forceMemoryOnly:d=!1},{chromeStorage:h,windowLocalStorage:f,storageKeySuffix:p}={}){if(d)return new n.MemoryOnlyConfigurationStore;if(l)return new a.IsolatableHybridConfigurationStore(new n.MemoryStore,l,t);if(r&&h){const r=new s.ChromeStorageEngine(new i.default(h),null!=p?p:"");return new a.IsolatableHybridConfigurationStore(new n.MemoryStore,new c.StringValuedAsyncStore(r,e),t)}if(u&&f){const r=new o.LocalStorageEngine(f,null!=p?p:"");return new a.IsolatableHybridConfigurationStore(new n.MemoryStore,new c.StringValuedAsyncStore(r,e),t)}return new n.MemoryOnlyConfigurationStore},t.overrideStorageFactory=function({hasWindowLocalStorage:e=!1,forceMemoryOnly:t=!1},{windowLocalStorage:r,storageKey:i=u.OVERRIDES_KEY}={}){const s=new n.MemoryStore;if(!t&&e&&r){const e=r.getItem(i);if(e){const t=JSON.parse(e);s.setEntries(t)}}return s},t.hasChromeStorage=l,t.chromeStorageIfAvailable=function(){return l()?chrome.storage.local:void 0},t.hasWindowLocalStorage=d,t.localStorageIfAvailable=function(){return d()?window.localStorage:void 0}},851684:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(){if(this.listeners=[],this.debounceTimer=null,"undefined"==typeof window)throw new Error("BrowserNetworkStatusListener can only be used in a browser environment");this._isOffline="boolean"==typeof navigator.onLine&&!navigator.onLine,window.addEventListener("offline",(()=>this.notifyListeners(!0))),window.addEventListener("online",(()=>this.notifyListeners(!1)))}isOffline(){return this._isOffline}onNetworkStatusChange(e){this.listeners.push(e)}removeNetworkStatusChange(e){const t=this.listeners.indexOf(e);-1!==t&&this.listeners.splice(t,1)}notifyListeners(e){this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout((()=>{this._isOffline=e,[...this.listeners].forEach((t=>t(e)))}),200)}}},30136:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(123231),i=r(359721);class s{constructor(e){this.name=e,this.eventKeys=[],this.localStorageKey=`eventQueue:${this.name}`,this.loadStateFromLocalStorage()}splice(e){const t=Array.from({length:e},(()=>this.shift()));return(0,i.takeWhile)(t,(e=>void 0!==e))}isEmpty(){return 0===this.length}get length(){return this.eventKeys.length}push(e){const t=this.generateEventKey(e),r=JSON.stringify(e);localStorage.setItem(t,r),this.eventKeys.push(t),this.saveStateToLocalStorage()}*[Symbol.iterator](){for(const e of this.eventKeys){const t=localStorage.getItem(e);t&&(yield JSON.parse(t))}}shift(){if(0===this.eventKeys.length)return;const e=this.eventKeys.shift();if(!e)throw new Error("Unexpected undefined event key");const t=localStorage.getItem(e);return t?(localStorage.removeItem(e),this.saveStateToLocalStorage(),JSON.parse(t)):void 0}loadStateFromLocalStorage(){const e=localStorage.getItem(this.localStorageKey);if(e)try{this.eventKeys=JSON.parse(e)}catch(e){n.applicationLogger.error(`Failed to parse event queue ${this.name} state. Initializing empty queue.`),this.eventKeys=[]}}saveStateToLocalStorage(){const e=JSON.stringify(this.eventKeys);localStorage.setItem(this.localStorageKey,e)}generateEventKey(e){const t=this.hashEvent(e);return`eventQueue:${this.name}:${t}`}hashEvent(e){const t=JSON.stringify(e);let r=0;for(let e=0;e{"use strict";t.ge=t.LR=void 0;const n=r(123231),i=r(67043),s=r(954035),a=r(883983),o=r(821552),u=r(851684),c=r(30136),l=r(573142);var d=r(123231);var h=r(806814);const f=(0,o.configurationStorageFactory)({forceMemoryOnly:!0}),p=(0,o.precomputedFlagsStorageFactory)(),g=(0,o.precomputedBanditStoreFactory)();t.LR={attachContext:()=>{},dispatch:()=>{}};class m extends n.EppoClient{constructor(){super(...arguments),this.initialized=!1}getStringAssignment(e,t,r,n){return this.ensureInitialized(),super.getStringAssignment(e,t,r,n)}getStringAssignmentDetails(e,t,r,n){return this.ensureInitialized(),super.getStringAssignmentDetails(e,t,r,n)}getBoolAssignment(e,t,r,n){return this.getBooleanAssignment(e,t,r,n)}getBooleanAssignment(e,t,r,n){return this.ensureInitialized(),super.getBooleanAssignment(e,t,r,n)}getBooleanAssignmentDetails(e,t,r,n){return this.ensureInitialized(),super.getBooleanAssignmentDetails(e,t,r,n)}getIntegerAssignment(e,t,r,n){return this.ensureInitialized(),super.getIntegerAssignment(e,t,r,n)}getIntegerAssignmentDetails(e,t,r,n){return this.ensureInitialized(),super.getIntegerAssignmentDetails(e,t,r,n)}getNumericAssignment(e,t,r,n){return this.ensureInitialized(),super.getNumericAssignment(e,t,r,n)}getNumericAssignmentDetails(e,t,r,n){return this.ensureInitialized(),super.getNumericAssignmentDetails(e,t,r,n)}getJSONAssignment(e,t,r,n){return this.ensureInitialized(),super.getJSONAssignment(e,t,r,n)}getJSONAssignmentDetails(e,t,r,n){return this.ensureInitialized(),super.getJSONAssignmentDetails(e,t,r,n)}getBanditAction(e,t,r,n,i){return this.ensureInitialized(),super.getBanditAction(e,t,r,n,i)}getBanditActionDetails(e,t,r,n,i){return this.ensureInitialized(),super.getBanditActionDetails(e,t,r,n,i)}getExperimentContainerEntry(e,t,r){return this.ensureInitialized(),super.getExperimentContainerEntry(e,t,r)}ensureInitialized(){this.initialized||n.applicationLogger.warn("Eppo SDK assignment requested before init() completed")}async init(e){var r;let d;n.validation.validateNotBlank(e.apiKey,"API key required");const{apiKey:h,persistentStore:f,baseUrl:p,maxCacheAgeSeconds:g,updateOnFetch:m,requestTimeoutMs:y,numInitialRequestRetries:E,numPollRequestRetries:b,pollingIntervalMs:_,pollAfterSuccessfulInitialization:S=!1,pollAfterFailedInitialization:O=!1,skipInitialRequest:A=!1,eventTracking:w,enableOverrides:C=!1}=e;try{this.stopPolling(),this.setAssignmentLogger(e.assignmentLogger),e.banditLogger&&this.setBanditLogger(e.banditLogger);const r=v(h),I=(0,o.configurationStorageFactory)({maxAgeSeconds:g,servingStoreUpdateStrategy:m,persistentStore:f,hasChromeStorage:(0,o.hasChromeStorage)(),hasWindowLocalStorage:(0,o.hasWindowLocalStorage)()},{chromeStorage:(0,o.chromeStorageIfAvailable)(),windowLocalStorage:(0,o.localStorageIfAvailable)(),storageKeySuffix:r});if(I.setFormat(n.FormatEnum.CLIENT),this.setFlagConfigurationStore(I),C){const t=(0,o.overrideStorageFactory)({hasWindowLocalStorage:(0,o.hasWindowLocalStorage)()},{windowLocalStorage:(0,o.localStorageIfAvailable)(),storageKey:e.overridesStorageKey});this.setOverrideStore(t)}else this.unsetOverrideStore();const T=(0,i.assignmentCacheFactory)({chromeStorage:(0,o.chromeStorageIfAvailable)(),storageKeySuffix:r});T instanceof s.default&&await T.init(),this.useCustomAssignmentCache(T);const N={apiKey:h,sdkName:l.sdkName,sdkVersion:l.sdkVersion,baseUrl:p,requestTimeoutMs:y,numInitialRequestRetries:E,numPollRequestRetries:b,pollAfterSuccessfulInitialization:S,pollAfterFailedInitialization:O,pollingIntervalMs:_,throwOnFailedInitialization:!0,skipInitialPoll:A};let R,P;this.setConfigurationRequestParameters(N),this.setEventDispatcher(function(e,r={}){const{batchSize:i=1e3,deliveryIntervalMs:s=1e4,enabled:a=!1,maxQueueSize:l=1e4,maxRetries:d=3,maxRetryDelayMs:h=3e4,retryIntervalMs:f=5e3}=r;if(!a)return t.LR;const p=(0,o.hasWindowLocalStorage)()?new c.default("events"):new n.BoundedEventQueue("events",[],l),g={isOffline:()=>!1,onNetworkStatusChange:()=>{}},m="undefined"!=typeof window?new u.default:g;return(0,n.newDefaultEventDispatcher)(p,m,e,i,{deliveryIntervalMs:s,retryIntervalMs:f,maxRetryDelayMs:h,maxRetries:d})}(h,w));const L=I.init().then((async()=>{if(!I.getKeys().length)return n.applicationLogger.warn("Eppo SDK cached configuration is empty"),R=new Error("Configuration store was empty"),a.ConfigLoaderStatus.DID_NOT_PRODUCE;const t=await I.isExpired();return t&&!e.useExpiredCache?(n.applicationLogger.warn("Eppo SDK set not to use expired cached configuration"),R=new Error("Configuration store was expired"),a.ConfigLoaderStatus.DID_NOT_PRODUCE):(t&&e.useExpiredCache&&n.applicationLogger.warn("Eppo SDK config.useExpiredCache is true; using expired cache"),a.ConfigLoaderStatus.COMPLETED)})).catch((e=>(n.applicationLogger.warn("Eppo SDK encountered an error initializing from the configuration store",e),R=e,a.ConfigLoaderStatus.FAILED))).then((e=>({source:a.ConfigSource.CONFIG_STORE,result:e}))),j=this.fetchFlagConfigurations().then((()=>I.isInitialized()?a.ConfigLoaderStatus.COMPLETED:a.ConfigLoaderStatus.DID_NOT_PRODUCE)).catch((e=>(n.applicationLogger.warn("Eppo SDK encountered an error initializing from fetching",e),P=e,a.ConfigLoaderStatus.FAILED))).then((e=>({source:a.ConfigSource.FETCH,result:e}))),x=[L];let D;e.skipInitialRequest||x.push(j);const{source:M,result:k}=await Promise.race(x);if(k===a.ConfigLoaderStatus.COMPLETED)D=M;else{const e=M===a.ConfigSource.FETCH?L:j;D=await e.then((e=>{const{source:t,result:r}=e;return r===a.ConfigLoaderStatus.COMPLETED?t:a.ConfigSource.NONE}))}D===a.ConfigSource.NONE&&(d=P||(R||new Error("Eppo SDK: No configuration source produced a valid configuration"))),n.applicationLogger.debug("Initialization source",D)}catch(e){d=e instanceof Error?e:new Error(String(e))}if(d&&(n.applicationLogger.warn("Eppo SDK was unable to initialize with a configuration, assignment calls will return the default value and not be logged"+(e.pollAfterFailedInitialization?" until an experiment configuration is successfully retrieved":"")),null===(r=e.throwOnFailedInitialization)||void 0===r||r))throw d;return this.initialized=!0,this}offlineInit(e){var t,r,s;const a=null!==(t=e.isObfuscated)&&void 0!==t&&t,u=null===(r=e.throwOnFailedInitialization)||void 0===r||r,c=null!==(s=e.enableOverrides)&&void 0!==s&&s;try{const t=(0,o.configurationStorageFactory)({forceMemoryOnly:!0});if(t.setFormat(a?n.FormatEnum.CLIENT:n.FormatEnum.SERVER),t.setEntries(e.flagsConfiguration).catch((e=>n.applicationLogger.warn("Error setting flags for memory-only configuration store",e))),this.setFlagConfigurationStore(t),c){const t=(0,o.overrideStorageFactory)({hasWindowLocalStorage:(0,o.hasWindowLocalStorage)()},{windowLocalStorage:(0,o.localStorageIfAvailable)(),storageKey:e.overridesStorageKey});this.setOverrideStore(t)}else this.unsetOverrideStore();e.assignmentLogger&&this.setAssignmentLogger(e.assignmentLogger),e.banditLogger&&this.setBanditLogger(e.banditLogger);const r="offline",s=(0,i.assignmentCacheFactory)({storageKeySuffix:r,forceMemoryOnly:!0});this.useCustomAssignmentCache(s)}catch(e){if(n.applicationLogger.warn("Eppo SDK encountered an error initializing, assignment calls will return the default value and not be logged"),u)throw e}this.initialized=!0}}function v(e){return e.replace(/\W/g,"").substring(0,8)}m.instance=new m({flagConfigurationStore:f}),m.initialized=!1,t.ge=function(e){const t=E();return t.offlineInit(e),m.initialized=!0,t};let y=null;function E(){return m.instance}class b extends n.EppoPrecomputedClient{getStringAssignment(e,t){return b.getAssignmentInitializationCheck(),super.getStringAssignment(e,t)}getBooleanAssignment(e,t){return b.getAssignmentInitializationCheck(),super.getBooleanAssignment(e,t)}getIntegerAssignment(e,t){return b.getAssignmentInitializationCheck(),super.getIntegerAssignment(e,t)}getNumericAssignment(e,t){return b.getAssignmentInitializationCheck(),super.getNumericAssignment(e,t)}getJSONAssignment(e,t){return b.getAssignmentInitializationCheck(),super.getJSONAssignment(e,t)}getBanditAction(e,t){return b.getAssignmentInitializationCheck(),super.getBanditAction(e,t)}static getAssignmentInitializationCheck(){m.initialized||n.applicationLogger.warn("Eppo SDK assignment requested before init() completed")}}b.instance=new b({precomputedFlagStore:p,subject:{subjectKey:"",subjectAttributes:{}}}),b.initialized=!1},772557:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IsolatableHybridConfigurationStore=void 0;const n=r(123231);class i extends n.HybridConfigurationStore{constructor(e,t,r="always"){super(e,t),this.servingStoreUpdateStrategy=r}async setEntries(e){var t;this.persistentStore&&await this.persistentStore.setEntries(e);const r=!this.persistentStore||await this.persistentStore.isExpired(),n=!(null===(t=this.servingStore.getKeys())||void 0===t?void 0:t.length),i="always"===this.servingStoreUpdateStrategy||r&&"expired"===this.servingStoreUpdateStrategy||r&&n;return i&&this.servingStore.setEntries(e),i}}t.IsolatableHybridConfigurationStore=i},137309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LocalStorageEngine=void 0;const n=r(554406);t.LocalStorageEngine=class{constructor(e,t){this.localStorage=e,this.getContentsJsonString=async()=>this.localStorage.getItem(this.contentsKey),this.getMetaJsonString=async()=>this.localStorage.getItem(this.metaKey),this.setContentsJsonString=async e=>{this.localStorage.setItem(this.contentsKey,e)},this.setMetaJsonString=async e=>{this.localStorage.setItem(this.metaKey,e)};const r=t?`-${t}`:"";this.contentsKey=n.CONFIGURATION_KEY+r,this.metaKey=n.META_KEY+r}}},573142:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sdkName=t.sdkVersion=void 0;const n=r(670299);t.sdkVersion=n.version,t.sdkName="js-client-sdk"},554406:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OVERRIDES_KEY=t.META_KEY=t.CONFIGURATION_KEY=void 0,t.CONFIGURATION_KEY="eppo-configuration",t.META_KEY="eppo-configuration-meta",t.OVERRIDES_KEY="eppo-overrides"},297029:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StringValuedAsyncStore=void 0;t.StringValuedAsyncStore=class{constructor(e,t=0){this.storageEngine=e,this.cooldownSeconds=t,this.initialized=!1}isInitialized(){return this.initialized}async isExpired(){if(!this.cooldownSeconds)return!0;const e=await this.storageEngine.getMetaJsonString();let t=!0;if(e){const r=JSON.parse(e).lastUpdatedAtMs;t=!r||Date.now()-r>1e3*this.cooldownSeconds}return t}async entries(){const e=await this.storageEngine.getContentsJsonString();return e?JSON.parse(e):{}}async setEntries(e){await this.storageEngine.setContentsJsonString(JSON.stringify(e));const t={lastUpdatedAtMs:(new Date).getTime()};await this.storageEngine.setMetaJsonString(JSON.stringify(t)),this.initialized=!0}}},359721:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.takeWhile=void 0,t.takeWhile=function(e,t){const r=[];for(const n of e){if(!t(n))break;r.push(n)}return r}},127660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(723490);t.default=class{constructor(e){var t;this.params=e,this.params.baseUrl=null!==(t=e.baseUrl)&&void 0!==t?t:n.BASE_URL}endpoint(e){const t=`${this.params.baseUrl}${e}`,r=this.params.queryParams;if(!r)return t;const n=new URLSearchParams;return Object.entries(r).forEach((([e,t])=>n.append(e,t))),`${t}?${n}`}ufcEndpoint(){return this.endpoint(n.UFC_ENDPOINT)}banditParametersEndpoint(){return this.endpoint(n.BANDIT_ENDPOINT)}precomputedFlagsEndpoint(){return this.endpoint(n.PRECOMPUTED_FLAGS_ENDPOINT)}}},328902:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.logger=t.loggerPrefix=void 0;const i=r(44874);t.loggerPrefix="[Eppo SDK]",t.logger=(0,i.default)({level:null!==(n={API_BASE_URL:void 0,CDN_URL:"https://assets.twitch.tv/",GQL_BASE_URL:void 0,PASSPORT_BASE_URL:void 0,INTERPOL_BASE_URL:void 0,PUBSUB_ENV:void 0,TMI_BASE_URL:void 0,MANIFEST_URL:"https://assets.twitch.tv/config/manifest.json?v=1",NODE_ENV:"production",PLAYER_BASE_URL:"https://player.twitch.tv",IS_DEV_BUILD:!1,IS_STAGING_BUILD:!1,IS_LOCAL_DEVSERVER:!1}.LOG_LEVEL)&&void 0!==n?n:"warn",browser:{disabled:!0}})},889182:(e,t,r)=>{"use strict";var n=r(443693);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"number"==typeof r?t.numericAttributes[e]=r:t.categoricalAttributes[e]=r})),t}Object.defineProperty(t,"__esModule",{value:!0}),t.isInstanceOfContextualAttributes=a,t.ensureNonContextualSubjectAttributes=function(e){let t;if(a(e)){const r=e;t=s(s({},r.numericAttributes),r.categoricalAttributes)}else t=e;return t},t.ensureContextualSubjectAttributes=function(e){return a(e)?e:o(e)},t.deduceAttributeContext=o,t.ensureActionsWithContextualAttributes=function(e){let t={};Array.isArray(e)?e.forEach((e=>{t[e]={numericAttributes:{},categoricalAttributes:{}}})):Object.values(e).every(a)?t=e:Object.entries(e).forEach((([e,r])=>{t[e]=o(r)}));return t}},30033:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BanditEvaluator=void 0;const n=r(723490),i=r(736055);t.BanditEvaluator=class{constructor(){this.assignmentShards=n.BANDIT_ASSIGNMENT_SHARDS,this.sharder=new i.MD5Sharder}evaluateBestBanditAction(e,t,r){const n=this.scoreActions(e,t,r),{topAction:i}=this.getTopScore(n);return i}evaluateBandit(e,t,r,n,i){const s=this.scoreActions(r,n,i),a=this.weighActions(s,i.gamma,i.actionProbabilityFloor),o=this.selectAction(e,t,a),u=Object.values(s).reduce(((e,t)=>t>e?t:e),-1/0)-s[o];return{flagKey:e,subjectKey:t,subjectAttributes:r,actionKey:o,actionAttributes:n[o],actionScore:s[o],actionWeight:a[o],gamma:i.gamma,optimalityGap:u}}scoreActions(e,t,r){const n={};return Object.entries(t).forEach((([t,i])=>{let s=r.defaultActionScore;const a=r.coefficients[t];a&&(s=a.intercept,s+=this.scoreNumericAttributes(a.subjectNumericCoefficients,e.numericAttributes),s+=this.scoreCategoricalAttributes(a.subjectCategoricalCoefficients,e.categoricalAttributes),s+=this.scoreNumericAttributes(a.actionNumericCoefficients,i.numericAttributes),s+=this.scoreCategoricalAttributes(a.actionCategoricalCoefficients,i.categoricalAttributes)),n[t]=s})),n}scoreNumericAttributes(e,t){return e.reduce(((e,r)=>{const n=t[r.attributeKey];return"number"==typeof n&&isFinite(n)?e+=n*r.coefficient:e+=r.missingValueCoefficient,e}),0)}scoreCategoricalAttributes(e,t){return e.reduce(((e,r)=>{var n;const i=null===(n=t[r.attributeKey])||void 0===n?void 0:n.toString(),s=i&&r.valueCoefficients[i];return e+="number"==typeof s?s:r.missingValueCoefficient}),0)}weighActions(e,t,r){const n={},i=Object.entries(e);if(!i.length)return n;const{topScore:s,topAction:a}=this.getTopScore(e);if(null===s||null===a)throw new Error("Unable to find top score");const o=s,u=a,c=i.length,l=r/c;let d=0;return i.forEach((([e,r])=>{if(e===u)return;const i=1/(c+t*(o-r)),s=Math.max(i,l);d+=s,n[e]=s})),n[u]=Math.max(1-d,0),n}selectAction(e,t,r){const n=Object.entries(r).sort(((r,n)=>{let i=this.sharder.getShard(`${e}-${t}-${r[0]}`,this.assignmentShards)-this.sharder.getShard(`${e}-${t}-${n[0]}`,this.assignmentShards);return 0===i&&(i=r[0]i){a=e[0];break}if(null===a)throw new Error(`No bandit action selected for flag "${e}" and subject "${t}"`);return a}getTopScore(e){const t=Object.entries(e);let r=null,n=null;return t.forEach((([e,t])=>{(null===r||null===n||t>r||t===r&&e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractAssignmentCache=void 0,t.assignmentCacheKeyToString=i,t.assignmentCacheValueToString=s;const n=r(142060);function i({subjectKey:e,flagKey:t}){return(0,n.getMD5Hash)([e,t].join(";"))}function s(e){return(0,n.getMD5Hash)(Object.values(e).join(";"))}t.AbstractAssignmentCache=class{constructor(e){this.delegate=e}has(e){return this.get(e)===s(e)}get(e){return this.delegate.get(i(e))}set(e){this.delegate.set(i(e),s(e))}entries(){return this.delegate.entries()}}},158368:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=void 0;class r{constructor(e){this.capacity=e,this.cache=new Map,this.size=this.cache.size}[(Symbol.toStringTag,Symbol.iterator)](){return this.cache[Symbol.iterator]()}forEach(e,t){this.cache.forEach(e,t)}entries(){return this.cache.entries()}clear(){this.cache.clear()}delete(e){return this.cache.delete(e)}keys(){return this.cache.keys()}values(){return this.cache.values()}has(e){return this.cache.has(e)}get(e){if(!this.has(e))return;const t=this.cache.get(e);return void 0!==t&&(this.delete(e),this.cache.set(e,t)),t}set(e,t){if(0===this.capacity)return this;if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.capacity){const e=this.cache.keys().next().value;e&&this.delete(e)}return this.cache.set(e,t),this}}t.LRUCache=r},704814:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LRUInMemoryAssignmentCache=void 0;const n=r(305397),i=r(158368);class s extends n.AbstractAssignmentCache{constructor(e){super(new i.LRUCache(e))}}t.LRUInMemoryAssignmentCache=s},358651:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NonExpiringInMemoryAssignmentCache=void 0;const n=r(305397);class i extends n.AbstractAssignmentCache{constructor(e=new Map){super(e)}}t.NonExpiringInMemoryAssignmentCache=i},998350:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TLRUCache=void 0;const n=r(158368);class i extends n.LRUCache{constructor(e,t){super(e),this.maxSize=e,this.ttl=t,this.cacheEntriesTTLRegistry=new Map}getCacheEntryEvictionTime(){return new Date(Date.now()+this.ttl)}clearCacheEntryEvictionTimeIfExists(e){this.cacheEntriesTTLRegistry.has(e)&&this.cacheEntriesTTLRegistry.delete(e)}isCacheEntryValid(e){const t=new Date(Date.now()),r=this.cacheEntriesTTLRegistry.get(e);return void 0!==r&&t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TLRUInMemoryAssignmentCache=void 0;const n=r(723490),i=r(305397),s=r(998350);class a extends i.AbstractAssignmentCache{constructor(e,t=n.DEFAULT_TLRU_TTL_MS){super(new s.TLRUCache(e,t))}}t.TLRUInMemoryAssignmentCache=a},252635:(e,t,r)=>{"use strict";var n=r(443693);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t[e,t.key])))}async fetchFlagConfigurations(){var e,t,r;if(!this.configurationRequestParameters)throw new Error("Eppo SDK unable to fetch flag configurations without configuration request parameters");null===(e=this.requestPoller)||void 0===e||e.stop();const{apiKey:n,sdkName:i,sdkVersion:s,baseUrl:a,requestTimeoutMs:c=v.DEFAULT_REQUEST_TIMEOUT_MS,numInitialRequestRetries:l=v.DEFAULT_INITIAL_CONFIG_REQUEST_RETRIES,numPollRequestRetries:d=v.DEFAULT_POLL_CONFIG_REQUEST_RETRIES,pollAfterSuccessfulInitialization:h=!1,pollAfterFailedInitialization:f=!1,throwOnFailedInitialization:g=!1,skipInitialPoll:m=!1}=this.configurationRequestParameters;let{pollingIntervalMs:y=v.DEFAULT_POLL_INTERVAL_MS}=this.configurationRequestParameters;y<=0&&(u.logger.error("pollingIntervalMs must be greater than 0. Using default"),y=v.DEFAULT_POLL_INTERVAL_MS);const E=new o.default({baseUrl:a,queryParams:{apiKey:n,sdkName:i,sdkVersion:s}}),b=new w.default(E,c),_=new p.default(b,this.flagConfigurationStore,null!==(t=this.banditVariationConfigurationStore)&&void 0!==t?t:null,null!==(r=this.banditModelConfigurationStore)&&void 0!==r?r:null);this.configurationRequestor=_;this.requestPoller=(0,R.default)(y,(async function(){if(await _.isFlagConfigExpired())return _.fetchAndStoreConfigurations()}),{maxStartRetries:l,maxPollRetries:d,pollAfterSuccessfulStart:h,pollAfterFailedStart:f,errorOnFailedStart:g,skipInitialPoll:m}),await this.requestPoller.start()}stopPolling(){this.requestPoller&&this.requestPoller.stop()}getStringAssignment(e,t,r,n){return this.getStringAssignmentDetails(e,t,r,n).variation}getStringAssignmentDetails(e,t,r,n){var i;const{eppoValue:s,flagEvaluationDetails:a}=this.getAssignmentVariation(e,t,r,E.EppoValue.String(n),I.VariationType.STRING);return{variation:null!==(i=s.stringValue)&&void 0!==i?i:n,action:null,evaluationDetails:a}}getBoolAssignment(e,t,r,n){return this.getBooleanAssignment(e,t,r,n)}getBooleanAssignment(e,t,r,n){return this.getBooleanAssignmentDetails(e,t,r,n).variation}getBooleanAssignmentDetails(e,t,r,n){var i;const{eppoValue:s,flagEvaluationDetails:a}=this.getAssignmentVariation(e,t,r,E.EppoValue.Bool(n),I.VariationType.BOOLEAN);return{variation:null!==(i=s.boolValue)&&void 0!==i?i:n,action:null,evaluationDetails:a}}getIntegerAssignment(e,t,r,n){return this.getIntegerAssignmentDetails(e,t,r,n).variation}getIntegerAssignmentDetails(e,t,r,n){var i;const{eppoValue:s,flagEvaluationDetails:a}=this.getAssignmentVariation(e,t,r,E.EppoValue.Numeric(n),I.VariationType.INTEGER);return{variation:null!==(i=s.numericValue)&&void 0!==i?i:n,action:null,evaluationDetails:a}}getNumericAssignment(e,t,r,n){return this.getNumericAssignmentDetails(e,t,r,n).variation}getNumericAssignmentDetails(e,t,r,n){var i;const{eppoValue:s,flagEvaluationDetails:a}=this.getAssignmentVariation(e,t,r,E.EppoValue.Numeric(n),I.VariationType.NUMERIC);return{variation:null!==(i=s.numericValue)&&void 0!==i?i:n,action:null,evaluationDetails:a}}getJSONAssignment(e,t,r,n){return this.getJSONAssignmentDetails(e,t,r,n).variation}getJSONAssignmentDetails(e,t,r,n){var i;const{eppoValue:s,flagEvaluationDetails:a}=this.getAssignmentVariation(e,t,r,E.EppoValue.JSON(n),I.VariationType.JSON);return{variation:null!==(i=s.objectValue)&&void 0!==i?i:n,action:null,evaluationDetails:a}}getBanditAction(e,t,r,n,i){const{variation:s,action:a}=this.getBanditActionDetails(e,t,r,n,i);return{variation:s,action:a}}getBestAction(e,t,r,n){var i;const s=this.getConfiguration();let a=null;const o=s.getFlagBanditVariations(e),u=null==o||null===(i=o.at(0))||void 0===i?void 0:i.key;if(u){const e=s.getBandit(u);if(e){const n=(0,c.ensureContextualSubjectAttributes)(t),i=(0,c.ensureActionsWithContextualAttributes)(r);a=this.banditEvaluator.evaluateBestBanditAction(n,i,e.modelData)}}return null!=a?a:n}getBanditActionDetails(e,t,r,n,i){const s=this.getConfiguration();let a=i,o=null,l=this.newFlagEvaluationDetailsBuilder(s,e).buildForNoneResult("ASSIGNMENT_ERROR","Unexpected error getting assigned variation for bandit action");try{const d=(0,c.ensureNonContextualSubjectAttributes)(r),{variation:h,evaluationDetails:f}=this.getStringAssignmentDetails(e,t,d,i);a=h,l=f;const p=s.getFlagVariationBandit(e,a);if(!p)return{variation:a,action:null,evaluationDetails:l};l.banditKey=p.banditKey;const g=this.evaluateBanditAction(e,t,r,n,p.modelData);if(null!=g&&g.actionKey){o=g.actionKey;const r={timestamp:(new Date).toISOString(),featureFlag:e,bandit:p.banditKey,subject:t,action:o,actionProbability:g.actionWeight,optimalityGap:g.optimalityGap,modelVersion:p.modelVersion,subjectNumericAttributes:g.subjectAttributes.numericAttributes,subjectCategoricalAttributes:g.subjectAttributes.categoricalAttributes,actionNumericAttributes:g.actionAttributes.numericAttributes,actionCategoricalAttributes:g.actionAttributes.categoricalAttributes,metaData:this.buildLoggerMetadata(),evaluationDetails:l};try{this.logBanditAction(r)}catch(e){u.logger.error("Error logging bandit event",e)}l.banditAction=o}}catch(e){if(u.logger.error("Error determining bandit action",e),!this.isGracefulFailureMode)throw e;a&&(l.flagEvaluationCode="BANDIT_ERROR"),l.flagEvaluationDescription=`Error evaluating bandit action: ${e.message}`}return{variation:a,action:o,evaluationDetails:l}}getExperimentContainerEntry(e,t,r){const{flagKey:n,controlVariationEntry:i,treatmentVariationEntries:s}=e,a=this.getStringAssignment(n,t,r,"control");if("control"===a)return i;if(!a.startsWith("treatment-"))return u.logger.warn(`Variation '${a}' cannot be mapped to a container. Defaulting to control variation.`),i;const o=Number.parseInt(a.split("-")[1])-1;return isNaN(o)?(u.logger.warn(`Variation '${a}' cannot be mapped to a container. Defaulting to control variation.`),i):o>=s.length?(u.logger.warn(`Selected treatment variation (${o}) index is out of bounds. Defaulting to control variation.`),i):s[o]}evaluateBanditAction(e,t,r,n,i){if(!Object.keys(n).length)return null;const s=(0,c.ensureContextualSubjectAttributes)(r),a=(0,c.ensureActionsWithContextualAttributes)(n);return this.banditEvaluator.evaluateBandit(e,t,s,a,i)}logBanditAction(e){var t,r;const n=e.subject,i={flagKey:e.featureFlag,subjectKey:n,banditKey:e.bandit,actionKey:null!==(t=e.action)&&void 0!==t?t:"__eppo_no_action"};if(null===(r=this.banditAssignmentCache)||void 0===r||!r.has(i))try{var s;this.banditLogger?this.banditLogger.logBanditAction(e):this.banditEventsQueue.push(e),null===(s=this.banditAssignmentCache)||void 0===s||s.set(i)}catch(e){u.logger.warn("Error encountered logging bandit action",e)}}getAssignmentVariation(e,t,r,n,i){try{const s=this.getAssignmentDetail(e,t,r,i);return this.parseVariationWithDetails(s,n,i)}catch(e){const t=this.rethrowIfNotGraceful(e,n);if(e instanceof A.FlagEvaluationError&&e.flagEvaluationDetails)return{eppoValue:t,flagEvaluationDetails:e.flagEvaluationDetails};return{eppoValue:t,flagEvaluationDetails:new O.FlagEvaluationDetailsBuilder("",[],"","").buildForNoneResult("ASSIGNMENT_ERROR",`Assignment Error: ${e.message}`)}}}parseVariationWithDetails({flagEvaluationDetails:e,variation:t},r,n){try{if(!t||"MATCH"!==e.flagEvaluationCode)return{eppoValue:r,flagEvaluationDetails:e};return{eppoValue:E.EppoValue.valueOf(t.value,n),flagEvaluationDetails:e}}catch(t){return{eppoValue:this.rethrowIfNotGraceful(t,r),flagEvaluationDetails:e}}}rethrowIfNotGraceful(e,t){if(this.isGracefulFailureMode)return u.logger.error(`${u.loggerPrefix} Error getting assignment: ${e.message}`),null!=t?t:E.EppoValue.Null();throw e}getAllAssignments(e,t={}){const r=this.getConfiguration(),n=r.getFlagConfigDetails(),i=this.getFlagKeys(),s={};return i.forEach((i=>{const a=this.getNormalizedFlag(r,i);if(!a)return void u.logger.debug(`${u.loggerPrefix} No assigned variation. Flag does not exist.`);const o=this.evaluator.evaluateFlag(a,n,e,t,r.isObfuscated());o.variation&&o.allocationKey?s[i]={flagKey:i,allocationKey:o.allocationKey,doLog:o.doLog,extraLogging:o.extraLogging,variationKey:o.variation.key,variationType:a.variationType,variationValue:o.variation.value.toString()}:u.logger.debug(`${u.loggerPrefix} No assigned variation: ${i}`)})),s}getPrecomputedConfiguration(e,t={},r={},n){const i=this.getConfiguration(),s=i.getFlagConfigDetails(),a=(0,c.ensureContextualSubjectAttributes)(t),o=(0,c.ensureNonContextualSubjectAttributes)(t),u=this.getAllAssignments(e,o),l=this.computeBanditsForFlags(i,e,a,r,u),d=m.PrecomputedConfiguration.obfuscated(e,u,l,null!=n?n:"",a,s.configEnvironment),h=m.ConfigurationWireV1.precomputed(d);return JSON.stringify(h)}getAssignmentDetail(e,t,r={},n){var i;(0,L.validateNotBlank)(t,"Invalid argument: subjectKey cannot be blank"),(0,L.validateNotBlank)(e,"Invalid argument: flagKey cannot be blank");const s=this.getConfiguration(),a=this.newFlagEvaluationDetailsBuilder(s,e),o=null===(i=this.overrideStore)||void 0===i?void 0:i.get(e);if(o)return(0,b.overrideResult)(e,t,r,o,a);const c=s.getFlagConfigDetails(),l=this.getNormalizedFlag(s,e);if(null===l){u.logger.warn(`${u.loggerPrefix} No assigned variation. Flag not found: ${e}`);const n=a.buildForNoneResult("FLAG_UNRECOGNIZED_OR_DISABLED",`Unrecognized or disabled flag: ${e}`);return(0,b.noneResult)(e,t,r,n,c.configFormat)}if(!x(n,l.variationType)){const i=`Variation value does not have the correct type. Found ${l.variationType}, but expected ${n} for flag ${e}`;if(this.isGracefulFailureMode){const n=a.buildForNoneResult("TYPE_MISMATCH",i);return(0,b.noneResult)(e,t,r,n,c.configFormat)}throw new TypeError(i)}if(!l.enabled){u.logger.info(`${u.loggerPrefix} No assigned variation. Flag is disabled: ${e}`);const n=a.buildForNoneResult("FLAG_UNRECOGNIZED_OR_DISABLED",`Unrecognized or disabled flag: ${e}`);return(0,b.noneResult)(e,t,r,n,c.configFormat)}const d=s.isObfuscated(),h=this.evaluator.evaluateFlag(l,c,t,r,d,n);d&&(h.flagKey=e);try{null!=h&&h.doLog&&this.maybeLogAssignment(h)}catch(e){u.logger.error(`${u.loggerPrefix} Error logging assignment event: ${e}`)}return h}track(e,t){this.eventDispatcher.dispatch({uuid:(0,a.v4)(),type:e,timestamp:(new Date).getTime(),payload:t})}newFlagEvaluationDetailsBuilder(e,t){var r;const n=this.getNormalizedFlag(e,t),i=e.getFlagConfigDetails();return new O.FlagEvaluationDetailsBuilder(i.configEnvironment.name,null!==(r=null==n?void 0:n.allocations)&&void 0!==r?r:[],i.configFetchedAt,i.configPublishedAt)}getNormalizedFlag(e,t){return e.isObfuscated()?this.getObfuscatedFlag(e,t):e.getFlag(t)}getObfuscatedFlag(e,t){const r=e.getFlag((0,T.getMD5Hash)(t));return r?(0,y.decodeFlag)(r):null}getFlagKeys(){return this.getConfiguration().getFlagKeys()}isInitialized(){return this.getConfiguration().isInitialized()}setLogger(e){this.setAssignmentLogger(e)}setAssignmentLogger(e){var t;this.assignmentLogger=e,this.flushQueuedEvents(this.assignmentEventsQueue,null===(t=this.assignmentLogger)||void 0===t?void 0:t.logAssignment)}setBanditLogger(e){var t;this.banditLogger=e,this.flushQueuedEvents(this.banditEventsQueue,null===(t=this.banditLogger)||void 0===t?void 0:t.logBanditAction)}disableAssignmentCache(){this.assignmentCache=void 0}useNonExpiringInMemoryAssignmentCache(){this.assignmentCache=new h.NonExpiringInMemoryAssignmentCache}useLRUInMemoryAssignmentCache(e){this.assignmentCache=new d.LRUInMemoryAssignmentCache(e)}useCustomAssignmentCache(e){this.assignmentCache=e}disableBanditAssignmentCache(){this.banditAssignmentCache=void 0}useNonExpiringInMemoryBanditAssignmentCache(){this.banditAssignmentCache=new h.NonExpiringInMemoryAssignmentCache}useExpiringInMemoryBanditAssignmentCache(e,t){this.banditAssignmentCache=new f.TLRUInMemoryAssignmentCache(e,t)}useCustomBanditAssignmentCache(e){this.banditAssignmentCache=e}setIsGracefulFailureMode(e){this.isGracefulFailureMode=e}getFlagConfigurations(){return this.getConfiguration().getFlags()}flushQueuedEvents(e,t){const r=e.flush();t&&r.forEach((e=>{try{t(e)}catch(e){u.logger.error(`${u.loggerPrefix} Error flushing event to logger: ${e.message}`)}}))}maybeLogAssignment(e){var t;const{flagKey:r,format:n,subjectKey:i,allocationKey:a=null,subjectAttributes:o,variation:c,flagEvaluationDetails:l,extraLogging:d={},entityId:h}=e,f=s(s({},d),{},{allocation:a,experiment:a?`${r}-${a}`:null,featureFlag:r,format:n,variation:null!==(t=null==c?void 0:c.key)&&void 0!==t?t:null,subject:i,timestamp:(new Date).toISOString(),subjectAttributes:o,metaData:this.buildLoggerMetadata(),evaluationDetails:l,entityId:h});if(c&&a){var p;if(null===(p=this.assignmentCache)||void 0===p?void 0:p.has({flagKey:r,subjectKey:i,allocationKey:a,variationKey:c.key}))return}try{var g,m;this.assignmentLogger?this.assignmentLogger.logAssignment(f):this.assignmentEventsQueue.push(f),null===(g=this.assignmentCache)||void 0===g||g.set({flagKey:r,subjectKey:i,allocationKey:null!=a?a:"__eppo_no_allocation",variationKey:null!==(m=null==c?void 0:c.key)&&void 0!==m?m:"__eppo_no_variation"})}catch(e){u.logger.error(`${u.loggerPrefix} Error logging assignment event: ${e.message}`)}}buildLoggerMetadata(){return{obfuscated:this.getConfiguration().isObfuscated(),sdkLanguage:"javascript",sdkLibVersion:j.LIB_VERSION}}computeBanditsForFlags(e,t,r,n,i){const s={};return Object.keys(n).forEach((a=>{const o=i[a];if(o){const i=this.getPrecomputedBandit(e,a,o.variationValue,t,r,n[a]);i&&(s[a]=i)}})),s}getPrecomputedBandit(e,t,r,n,i,s){const a=e.getFlagVariationBandit(t,r);if(!a)return null;const o=this.evaluateBanditAction(t,n,i,s,a.modelData);return o?{banditKey:a.banditKey,action:o.actionKey,actionNumericAttributes:o.actionAttributes.numericAttributes,actionCategoricalAttributes:o.actionAttributes.categoricalAttributes,actionProbability:o.actionWeight,modelVersion:a.modelVersion,optimalityGap:o.optimalityGap}:null}}},956738:(e,t,r)=>{"use strict";var n=r(443693);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t0&&(this.precomputedFlagStore.isInitialized()||o.logger.error(`${o.loggerPrefix} EppoPrecomputedClient requires an initialized precomputedFlagStore if requestParameters are not provided`),this.precomputedFlagStore.salt||o.logger.error(`${o.loggerPrefix} EppoPrecomputedClient requires a precomputedFlagStore with a salt if requestParameters are not provided`)),this.precomputedBanditStore&&!this.precomputedBanditStore.isInitialized()&&o.logger.error(`${o.loggerPrefix} Passing banditOptions without requestParameters requires an initialized precomputedBanditStore`),this.precomputedBanditStore&&!this.precomputedBanditStore.salt&&o.logger.warn(`${o.loggerPrefix} EppoPrecomputedClient missing or empty salt for precomputedBanditStore`))}async fetchPrecomputedFlags(){var e,t=this;if(!this.requestParameters)throw new Error("Eppo SDK unable to fetch precomputed flags without the request parameters");null===(e=this.requestPoller)||void 0===e||e.stop();const{apiKey:r,sdkName:n,sdkVersion:i,baseUrl:s,requestTimeoutMs:u=d.DEFAULT_REQUEST_TIMEOUT_MS,numInitialRequestRetries:c=d.DEFAULT_INITIAL_CONFIG_REQUEST_RETRIES,numPollRequestRetries:l=d.DEFAULT_POLL_CONFIG_REQUEST_RETRIES,pollAfterSuccessfulInitialization:h=!1,pollAfterFailedInitialization:p=!1,throwOnFailedInitialization:g=!1,skipInitialPoll:y=!1}=this.requestParameters,{subjectKey:E,subjectAttributes:b}=this.subject;let{pollingIntervalMs:_=d.DEFAULT_POLL_INTERVAL_MS}=this.requestParameters;_<=0&&(o.logger.error("pollingIntervalMs must be greater than 0. Using default"),_=d.DEFAULT_POLL_INTERVAL_MS);const S=new a.default({baseUrl:null!=s?s:d.PRECOMPUTED_BASE_URL,queryParams:{apiKey:r,sdkName:n,sdkVersion:i}}),O=new f.default(S,u),A=new v.default(O,this.precomputedFlagStore,E,b,this.precomputedBanditStore,this.banditActions);this.requestPoller=(0,m.default)(_,(async function(){if(await t.precomputedFlagStore.isExpired())return A.fetchAndStorePrecomputedFlags()}),{maxStartRetries:c,maxPollRetries:l,pollAfterSuccessfulStart:h,pollAfterFailedStart:p,errorOnFailedStart:g,skipInitialPoll:y}),await this.requestPoller.start()}stopPolling(){this.requestPoller&&this.requestPoller.stop()}getPrecomputedAssignment(e,t,r,n=(e=>e)){var i,s,a,c,l,d,h;(0,y.validateNotBlank)(e,"Invalid argument: flagKey cannot be blank");const f=null===(i=this.overrideStore)||void 0===i?void 0:i.get(e);if(f)return n(f.value);const p=this.getPrecomputedFlag(e);if(null==p)return o.logger.warn(`${o.loggerPrefix} No assigned variation. Flag not found: ${e}`),t;if(!(0,b.checkTypeMatch)(r,p.variationType)){const n=`${o.loggerPrefix} Type mismatch: expected ${r} but flag ${e} has type ${p.variationType}`;return o.logger.error(n),t}const g={flagKey:e,format:null!==(s=this.precomputedFlagStore.getFormat())&&void 0!==s?s:"",subjectKey:null!==(a=this.subject.subjectKey)&&void 0!==a?a:"",subjectAttributes:(0,u.ensureNonContextualSubjectAttributes)(null!==(c=this.subject.subjectAttributes)&&void 0!==c?c:{}),variation:{key:null!==(l=p.variationKey)&&void 0!==l?l:"",value:p.variationValue},allocationKey:null!==(d=p.allocationKey)&&void 0!==d?d:"",extraLogging:null!==(h=p.extraLogging)&&void 0!==h?h:{},doLog:p.doLog,entityId:null};try{null!=g&&g.doLog&&this.logAssignment(g)}catch(e){o.logger.error(`${o.loggerPrefix} Error logging assignment event: ${e}`)}try{var m;return void 0!==(null===(m=g.variation)||void 0===m?void 0:m.value)?n(g.variation.value):t}catch(e){return o.logger.error(`${o.loggerPrefix} Error transforming value: ${e}`),t}}getStringAssignment(e,t){return this.getPrecomputedAssignment(e,t,p.VariationType.STRING)}getBooleanAssignment(e,t){return this.getPrecomputedAssignment(e,t,p.VariationType.BOOLEAN)}getIntegerAssignment(e,t){return this.getPrecomputedAssignment(e,t,p.VariationType.INTEGER)}getNumericAssignment(e,t){return this.getPrecomputedAssignment(e,t,p.VariationType.NUMERIC)}getJSONAssignment(e,t){return this.getPrecomputedAssignment(e,t,p.VariationType.JSON,(e=>"string"==typeof e?JSON.parse(e):t))}getBanditAction(e,t){if(!this.getPrecomputedFlag(e))return o.logger.warn(`${o.loggerPrefix} No assigned variation. Flag not found: ${e}`),{variation:t,action:null};const r=this.getPrecomputedBandit(e),n=this.getStringAssignment(e,t);if(r){var i;const t={timestamp:(new Date).toISOString(),featureFlag:e,bandit:r.banditKey,subject:null!==(i=this.subject.subjectKey)&&void 0!==i?i:"",action:r.action,actionProbability:r.actionProbability,optimalityGap:r.optimalityGap,modelVersion:r.modelVersion,subjectNumericAttributes:r.actionNumericAttributes,subjectCategoricalAttributes:r.actionCategoricalAttributes,actionNumericAttributes:r.actionNumericAttributes,actionCategoricalAttributes:r.actionCategoricalAttributes,metaData:this.buildLoggerMetadata(),evaluationDetails:null};try{this.logBanditAction(t)}catch(e){o.logger.error(`${o.loggerPrefix} Error logging bandit action: ${e}`)}return{variation:n,action:t.action}}return{variation:n,action:null}}getPrecomputedFlag(e){return this.getObfuscatedFlag(e)}getObfuscatedFlag(e){const t=this.precomputedFlagStore.salt,r=(0,g.getMD5Hash)(e,t),n=this.precomputedFlagStore.get(r);return n?(0,h.decodePrecomputedFlag)(n):null}getPrecomputedBandit(e){const t=this.getObfuscatedPrecomputedBandit(e);return t?(0,h.decodePrecomputedBandit)(t):null}getObfuscatedPrecomputedBandit(e){var t,r;const n=null===(t=this.precomputedBanditStore)||void 0===t?void 0:t.salt,i=(0,g.getMD5Hash)(e,n),s=null===(r=this.precomputedBanditStore)||void 0===r?void 0:r.get(i);return null!=s?s:null}isInitialized(){return this.precomputedFlagStore.isInitialized()}setAssignmentLogger(e){var t;this.assignmentLogger=e,this.flushQueuedEvents(this.queuedAssignmentEvents,null===(t=this.assignmentLogger)||void 0===t?void 0:t.logAssignment)}setBanditLogger(e){var t;this.banditLogger=e,this.flushQueuedEvents(this.banditEventsQueue,null===(t=this.banditLogger)||void 0===t?void 0:t.logBanditAction)}disableAssignmentCache(){this.assignmentCache=void 0}useNonExpiringInMemoryAssignmentCache(){this.assignmentCache=new l.NonExpiringInMemoryAssignmentCache}useLRUInMemoryAssignmentCache(e){this.assignmentCache=new c.LRUInMemoryAssignmentCache(e)}useCustomAssignmentCache(e){this.assignmentCache=e}flushQueuedEvents(e,t){const r=[...e];e.length=0,t&&r.forEach((e=>{try{t(e)}catch(e){o.logger.error(`${o.loggerPrefix} Error flushing event to logger: ${e.message}`)}}))}logAssignment(e){var t,r;const{flagKey:n,subjectKey:i,allocationKey:a,subjectAttributes:u,variation:c,format:l}=e,h=s(s({},null!==(t=e.extraLogging)&&void 0!==t?t:{}),{},{allocation:null!=a?a:null,experiment:a?`${n}-${a}`:null,featureFlag:n,format:l,variation:null!==(r=null==c?void 0:c.key)&&void 0!==r?r:null,subject:i,timestamp:(new Date).toISOString(),subjectAttributes:u,metaData:this.buildLoggerMetadata(),evaluationDetails:null});if(c&&a){var f;if(null===(f=this.assignmentCache)||void 0===f?void 0:f.has({flagKey:n,subjectKey:i,allocationKey:a,variationKey:c.key}))return}try{var p,g;this.assignmentLogger?this.assignmentLogger.logAssignment(h):this.queuedAssignmentEvents.length{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(271067);t.default=class{constructor(e,t,r,i){this.httpClient=e,this.flagConfigurationStore=t,this.banditVariationConfigurationStore=r,this.banditModelConfigurationStore=i,this.banditModelVersions=[],this.configuration=new n.StoreBackedConfiguration(this.flagConfigurationStore,this.banditVariationConfigurationStore,this.banditModelConfigurationStore)}setConfigurationStores(e,t,r){this.flagConfigurationStore=e,this.banditVariationConfigurationStore=t,this.banditModelConfigurationStore=r,this.configuration=new n.StoreBackedConfiguration(this.flagConfigurationStore,this.banditVariationConfigurationStore,this.banditModelConfigurationStore)}isFlagConfigExpired(){return this.flagConfigurationStore.isExpired()}getConfiguration(){return this.configuration}async fetchAndStoreConfigurations(){var e;const t=await this.httpClient.getUniversalFlagConfiguration();if(null==t||!t.flags)return;const r={entries:t.flags,environment:t.environment,createdAt:t.createdAt,format:t.format};let n,i;const s=Object.keys(null!==(e=t.banditReferences)&&void 0!==e?e:{}).length>0,a=Boolean(this.banditVariationConfigurationStore&&this.banditModelConfigurationStore);if(s&&a){if(n={entries:this.indexBanditVariationsByFlagKey(t.banditReferences),environment:t.environment,createdAt:t.createdAt,format:t.format},this.requiresBanditModelConfigurationStoreUpdate(this.banditModelVersions,t.banditReferences)){const e=await this.httpClient.getBanditParameters();null!=e&&e.bandits&&(i={entries:e.bandits,environment:t.environment,createdAt:t.createdAt,format:t.format},this.banditModelVersions=this.getLoadedBanditModelVersions(e.bandits))}}await this.configuration.hydrateConfigurationStores(r,n,i)}getLoadedBanditModelVersions(e){return Object.values(e).map((e=>e.modelVersion))}requiresBanditModelConfigurationStoreUpdate(e,t){return!Object.values(t).map((e=>e.modelVersion)).every((t=>e.includes(t)))}indexBanditVariationsByFlagKey(e){const t={};return Object.values(e).forEach((e=>{e.flagVariations.forEach((e=>{let r=t[e.flagKey];r||(r=[],t[e.flagKey]=r),r.push(e)}))})),t}}},646168:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hydrateConfigurationStore=async function(e,t){if(e){const r=await e.setEntries(t.entries);return r&&(e.setEnvironment(t.environment),e.setConfigFetchedAt((new Date).toISOString()),e.setConfigPublishedAt(t.createdAt),e.setFormat(t.format),e.salt=t.salt),r}return!1}},901741:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HybridConfigurationStore=void 0;const n=r(328902);t.HybridConfigurationStore=class{constructor(e,t){this.servingStore=e,this.persistentStore=t,this.environment=null,this.configFetchedAt=null,this.configPublishedAt=null,this.format=null}async init(){if(!this.persistentStore)return;this.persistentStore.isInitialized()||n.logger.warn(`${n.loggerPrefix} Persistent store is not initialized from remote configuration. Serving assignments that may be stale.`);const e=await this.persistentStore.entries();this.servingStore.setEntries(e)}isInitialized(){var e,t;return this.servingStore.isInitialized()&&(null===(e=null===(t=this.persistentStore)||void 0===t?void 0:t.isInitialized())||void 0===e||e)}async isExpired(){var e;const t=await(null===(e=this.persistentStore)||void 0===e?void 0:e.isExpired());return null==t||t}get(e){return this.servingStore.isInitialized()||n.logger.warn(`${n.loggerPrefix} getting a value from a ServingStore that is not initialized.`),this.servingStore.get(e)}entries(){return this.servingStore.entries()}getKeys(){return this.servingStore.getKeys()}async setEntries(e){return this.persistentStore&&await this.persistentStore.setEntries(e),this.servingStore.setEntries(e),!0}setEnvironment(e){this.environment=e}getEnvironment(){return this.environment}getConfigFetchedAt(){return this.configFetchedAt}setConfigFetchedAt(e){this.configFetchedAt=e}getConfigPublishedAt(){return this.configPublishedAt}setConfigPublishedAt(e){this.configPublishedAt=e}getFormat(){return this.format}setFormat(e){this.format=e}}},780952:(e,t,r)=>{"use strict";var n=r(443693);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}Object.defineProperty(t,"__esModule",{value:!0}),t.MemoryOnlyConfigurationStore=t.MemoryStore=void 0;class s{constructor(){this.store={},this.initialized=!1}get(e){var t;return null!==(t=this.store[e])&&void 0!==t?t:null}entries(){return this.store}getKeys(){return Object.keys(this.store)}isInitialized(){return this.initialized}setEntries(e){this.store=function(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationWireHelper=void 0;const n=r(127660),i=r(833027),s=r(738882);class a{static build(e,t={sdkName:"android",sdkVersion:"4.0.0"}){const{sdkName:r,sdkVersion:n,baseUrl:i}=t;return new a(e,r,n,i)}constructor(e,t="android",r="4.0.0",s){const a={sdkName:t,sdkVersion:r,apiKey:e},o=new n.default({baseUrl:s,queryParams:a});this.httpClient=new i.default(o,5e3)}async fetchBootstrapConfiguration(){var e;let t;const r=await this.httpClient.getUniversalFlagConfiguration();if(null==r||!r.flags)return console.warn("Unable to fetch configuration, returning empty configuration"),Promise.resolve(s.ConfigurationWireV1.empty());return Object.keys(null!==(e=r.banditReferences)&&void 0!==e?e:{}).length>0&&(t=await this.httpClient.getBanditParameters()),s.ConfigurationWireV1.fromResponses(r,t)}}t.ConfigurationWireHelper=a},738882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConfigurationWireV1=t.ObfuscatedPrecomputedConfigurationResponse=t.PrecomputedConfigurationResponse=t.PrecomputedConfiguration=void 0,t.inflateResponse=function(e){return JSON.parse(e)},t.deflateResponse=c;const n=r(763483),i=r(142060);class s{constructor(e,t,r){this.subjectKey=e,this.subjectAttributes=t,this.environment=r,this.format=n.FormatEnum.PRECOMPUTED,this.createdAt=(new Date).toISOString()}}class a{constructor(e,t,r){this.response=e,this.subjectKey=t,this.subjectAttributes=r}static obfuscated(e,t,r,n,i,s){const o=new u(e,t,r,n,i,s);return new a(JSON.stringify(o),e,i)}static unobfuscated(e,t,r,n,i){const s=new o(e,t,r,n,i);return new a(JSON.stringify(s),e,n)}}t.PrecomputedConfiguration=a;class o extends s{constructor(e,t,r,n,i){super(e,n,i),this.flags=t,this.bandits=r,this.obfuscated=!1}}t.PrecomputedConfigurationResponse=o;class u extends s{constructor(e,t,r,n,s,a){super(e,s,a),this.obfuscated=!0,this.salt=n,this.bandits=(0,i.obfuscatePrecomputedBanditMap)(this.salt,r),this.flags=(0,i.obfuscatePrecomputedFlags)(this.salt,t)}}function c(e){return JSON.stringify(e)}t.ObfuscatedPrecomputedConfigurationResponse=u;class l{constructor(e,t,r){this.precomputed=e,this.config=t,this.bandits=r,this.version=1}static fromResponses(e,t,r,n){return new l(void 0,{response:c(e),fetchedAt:(new Date).toISOString(),etag:r},t?{response:c(t),fetchedAt:(new Date).toISOString(),etag:n}:void 0)}static precomputed(e){return new l(e)}static empty(){return new l}}t.ConfigurationWireV1=l},723490:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OBFUSCATED_FORMATS=t.DEFAULT_TLRU_TTL_MS=t.BANDIT_ASSIGNMENT_SHARDS=t.MAX_EVENT_QUEUE_SIZE=t.NULL_SENTINEL=t.SESSION_ASSIGNMENT_CONFIG_LOADED=t.PRECOMPUTED_FLAGS_ENDPOINT=t.PRECOMPUTED_BASE_URL=t.BANDIT_ENDPOINT=t.UFC_ENDPOINT=t.BASE_URL=t.DEFAULT_POLL_CONFIG_REQUEST_RETRIES=t.DEFAULT_INITIAL_CONFIG_REQUEST_RETRIES=t.POLL_JITTER_PCT=t.DEFAULT_POLL_INTERVAL_MS=t.REQUEST_TIMEOUT_MILLIS=t.DEFAULT_REQUEST_TIMEOUT_MS=void 0;const n=r(763483);t.DEFAULT_REQUEST_TIMEOUT_MS=5e3,t.REQUEST_TIMEOUT_MILLIS=t.DEFAULT_REQUEST_TIMEOUT_MS,t.DEFAULT_POLL_INTERVAL_MS=3e4,t.POLL_JITTER_PCT=.1,t.DEFAULT_INITIAL_CONFIG_REQUEST_RETRIES=1,t.DEFAULT_POLL_CONFIG_REQUEST_RETRIES=7,t.BASE_URL="https://fscdn.eppo.cloud/api",t.UFC_ENDPOINT="/flag-config/v1/config",t.BANDIT_ENDPOINT="/flag-config/v1/bandits",t.PRECOMPUTED_BASE_URL="https://fs-edge-assignment.eppo.cloud",t.PRECOMPUTED_FLAGS_ENDPOINT="/assignments",t.SESSION_ASSIGNMENT_CONFIG_LOADED="eppo-session-assignment-config-loaded",t.NULL_SENTINEL="EPPO_NULL",t.MAX_EVENT_QUEUE_SIZE=100,t.BANDIT_ASSIGNMENT_SHARDS=1e4,t.DEFAULT_TLRU_TTL_MS=6e5,t.OBFUSCATED_FORMATS=[n.FormatEnum.CLIENT,n.FormatEnum.PRECOMPUTED]},178898:(e,t,r)=>{"use strict";var n=r(443693);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t+e)),actionCategoricalAttributes:f(null!==(r=e.actionCategoricalAttributes)&&void 0!==r?r:{})})};const a=r(763483),o=r(142060);function u(e,t){return Object.fromEntries(Object.entries(e).map((([,e])=>{const r=(0,o.decodeBase64)(e.key);return[r,{key:r,value:c(e.value,t)}]})))}function c(e,t){switch(t){case a.VariationType.INTEGER:case a.VariationType.NUMERIC:return Number((0,o.decodeBase64)(e));case a.VariationType.BOOLEAN:return"true"===(0,o.decodeBase64)(e);default:return(0,o.decodeBase64)(e)}}function l(e){return s(s({},e),{},{key:(0,o.decodeBase64)(e.key),splits:e.splits.map(d),startAt:e.startAt?new Date((0,o.decodeBase64)(e.startAt)).toISOString():void 0,endAt:e.endAt?new Date((0,o.decodeBase64)(e.endAt)).toISOString():void 0})}function d(e){return{extraLogging:e.extraLogging?f(e.extraLogging):void 0,variationKey:(0,o.decodeBase64)(e.variationKey),shards:e.shards.map(h)}}function h(e){return s(s({},e),{},{salt:(0,o.decodeBase64)(e.salt)})}function f(e){return p(e,(e=>e))}function p(e,t){return Object.fromEntries(Object.entries(e).map((([e,r])=>[(0,o.decodeBase64)(e),t((0,o.decodeBase64)(r))])))}},427310:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EppoAssignmentLogger=void 0;t.EppoAssignmentLogger=class{constructor(e){this.eppoClient=e}logAssignment(e){const{entityId:t,featureFlag:r,experiment:n,allocation:i,holdoutKey:s,holdoutVariation:a,subject:o,variation:u}=e;if(!t)return;const c={entity_id:t,experiment:n,feature_flag:r,allocation:i,holdout_variation:a,holdout:s,subject:o,variation:u};this.eppoClient.track("__eppo_assignment",c)}}},923481:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EppoValue=t.EppoValueType=void 0;const n=r(763483),i=r(142060);var s;!function(e){e[e.NullType=0]="NullType",e[e.BoolType=1]="BoolType",e[e.NumericType=2]="NumericType",e[e.StringType=3]="StringType",e[e.JSONType=4]="JSONType"}(s||(t.EppoValueType=s={}));class a{constructor(e,t,r,n,i){this.valueType=e,this.boolValue=t,this.numericValue=r,this.stringValue=n,this.objectValue=i}static valueOf(e,t){if(null==e)return a.Null();switch(t){case n.VariationType.BOOLEAN:return a.Bool(e);case n.VariationType.NUMERIC:case n.VariationType.INTEGER:return a.Numeric(e);case n.VariationType.STRING:return a.String(e);case n.VariationType.JSON:return a.JSON(e);default:return a.String(e)}}toString(){var e;switch(this.valueType){case s.NullType:return"null";case s.BoolType:return this.boolValue?"true":"false";case s.NumericType:return this.numericValue?this.numericValue.toString():"0";case s.StringType:return null!==(e=this.stringValue)&&void 0!==e?e:"";case s.JSONType:try{var t;return null!==(t=JSON.stringify(this.objectValue))&&void 0!==t?t:""}catch(e){var r;return null!==(r=this.stringValue)&&void 0!==r?r:""}}}toHashedString(){const e=this.toString();return(0,i.getMD5Hash)(e)}static Bool(e){return new a(s.BoolType,e,void 0,void 0,void 0)}static Numeric(e){return new a(s.NumericType,void 0,e,void 0,void 0)}static String(e){return new a(s.StringType,void 0,void 0,e,void 0)}static JSON(e){return new a(s.JSONType,void 0,void 0,void 0,"string"==typeof e?JSON.parse(e):e)}static Null(){return new a(s.NullType,void 0,void 0,void 0,void 0)}}t.EppoValue=a},742686:(e,t,r)=>{"use strict";var n=r(443693);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{const i=(0,c.matchesRule)(e,t,r);return i&&(n=e),i}))?{matched:!0,matchedRule:n}:{matched:!1,matchedRule:null}}t.Evaluator=class{constructor(e){this.getMatchedEvaluationCodeAndDescription=(e,t,r,n,i)=>{var s;if(!(0,a.checkValueTypeMatch)(i,e.value)){const{key:t,value:r}=e;return{flagEvaluationCode:"ASSIGNMENT_ERROR",flagEvaluationDescription:`Variation (${t}) is configured for type ${i}, but is set to incompatible value (${r})`}}const o=!(null===(s=t.rules)||void 0===s||!s.length),u=t.splits.length>1,c=r.shards.length>1,l=u||c;return o&&l?{flagEvaluationCode:"MATCH",flagEvaluationDescription:`Supplied attributes match rules defined in allocation "${t.key}" and ${n} belongs to the range of traffic assigned to "${r.variationKey}".`}:o&&!l?{flagEvaluationCode:"MATCH",flagEvaluationDescription:`Supplied attributes match rules defined in allocation "${t.key}".`}:{flagEvaluationCode:"MATCH",flagEvaluationDescription:`${n} belongs to the range of traffic assigned to "${r.variationKey}" defined in allocation "${t.key}".`}},this.sharder=null!=e?e:new l.MD5Sharder}evaluateFlag(e,t,r,n,i,a){const c=new o.FlagEvaluationDetailsBuilder(t.configEnvironment.name,e.allocations,t.configFetchedAt,t.configPublishedAt);try{if(!e.enabled)return f(e.key,r,n,c.buildForNoneResult("FLAG_UNRECOGNIZED_OR_DISABLED",`Unrecognized or disabled flag: ${e.key}`),t.configFormat);const u=new Date;for(let f=0;f{c.addUnmatchedAllocation({key:g.key,allocationEvaluationCode:e,orderPosition:f+1})};if(g.startAt&&unew Date(g.endAt)){m(o.AllocationEvaluationCode.AFTER_END_TIME);continue}const{matched:v,matchedRule:y}=p(null!==(l=null==g?void 0:g.rules)&&void 0!==l?l:[],s({id:r},n),i);if(v){for(const i of g.splits)if(i.shards.every((t=>this.matchesShard(t,r,e.totalShards)))){var d,h;const s=e.variations[i.variationKey],{flagEvaluationCode:o,flagEvaluationDescription:u}=this.getMatchedEvaluationCodeAndDescription(s,g,i,r,a),l=c.setMatch(f,s,g,y,a).build(o,u);return{flagKey:e.key,format:t.configFormat,subjectKey:r,subjectAttributes:n,allocationKey:g.key,variation:s,extraLogging:null!==(d=i.extraLogging)&&void 0!==d?d:{},doLog:g.doLog,flagEvaluationDetails:l,entityId:null!==(h=e.entityId)&&void 0!==h?h:null}}m(o.AllocationEvaluationCode.TRAFFIC_EXPOSURE_MISS)}else m(o.AllocationEvaluationCode.FAILING_RULE)}return f(e.key,r,n,c.buildForNoneResult("DEFAULT_ALLOCATION_NULL",'No allocations matched. Falling back to "Default Allocation", serving NULL'),t.configFormat)}catch(e){console.error(">>>>",e);const t=c.gracefulBuild("ASSIGNMENT_ERROR",`Assignment Error: ${e.message}`);if(t){const r=new u.FlagEvaluationError(e.message);throw r.flagEvaluationDetails=t,r}throw e}}matchesShard(e,t,r){const n=this.sharder.getShard(h(e.salt,t),r);return e.ranges.some((e=>d(n,e)))}}},978333:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{constructor(e,t){this.eventQueue=e,this.batchSize=Math.max(100,Math.min(1e4,t))}nextBatch(){return this.eventQueue.splice(this.batchSize)}push(...e){this.eventQueue.push(...e)}isEmpty(){return this.eventQueue.isEmpty()}}},59320:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(328902);t.default=class{constructor(e,t){this.delivery=e,this.config=t}async retry(e,t,r=0){const{retryIntervalMs:i,maxRetryDelayMs:s,maxRetries:a}=this.config,o=Math.min(i*Math.pow(2,r),s);n.logger.info(`[BatchRetryManager] Retrying batch delivery of ${e.length} events in ${o}ms...`),await new Promise((e=>setTimeout(e,o)));const{failedEvents:u}=await this.delivery.deliver(e,t);return 0===u.length?(n.logger.info(`[BatchRetryManager] Batch delivery successfully after ${r+1} tries.`),[]):r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BoundedEventQueue=void 0;const n=r(328902),i=r(723490);class s{constructor(e,t=new Array,r=i.MAX_EVENT_QUEUE_SIZE){this.name=e,this.queue=t,this.maxSize=r}get length(){return this.queue.length}splice(e){return this.queue.splice(0,e)}isEmpty(){return 0===this.queue.length}[Symbol.iterator](){return this.queue[Symbol.iterator]()}push(...e){const{name:t,maxSize:r,queue:i}=this;for(;i.length0;)i.push(...e.splice(0,1));e.length>0&&n.logger.warn(`Dropping ${e.length} events for queue ${t} since maxSize of ${r} reached.`)}flush(){const e=[...this.queue];return this.queue.length=0,e}}t.BoundedEventQueue=s},456355:(e,t,r)=>{"use strict";var n=r(443693);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{a.logger.info(`[EventDispatcher] Network status change, isOffline=${e}.`),this.isOffline=e,e?this.dispatchTimer=null:this.maybeScheduleNextDelivery()}))}attachContext(e,t){this.ensureValidContext(e,t),this.context[e]=t}dispatch(e){this.ensureValidEvent(e),this.batchProcessor.push(e),this.maybeScheduleNextDelivery()}ensureValidContext(e,t){if(t&&("object"==typeof t||Array.isArray(t)))throw new Error("Context value must be a string, number, boolean, or null");if(t&&JSON.stringify(s(s({},this.context),{},{[e]:t})).length>2048)throw new Error("The total context size must be less than 2048 characters")}ensureValidEvent(e){if(JSON.stringify(e).length>4096)throw new Error("Event serialized length exceeds maximum allowed length of 4096")}async deliverNextBatch(){if(this.isOffline)return void a.logger.warn("[EventDispatcher] Skipping delivery; network status is offline.");const e=this.batchProcessor.nextBatch();if(0===e.length)return void(this.dispatchTimer=null);const t=s({},this.context),{failedEvents:r}=await this.eventDelivery.deliver(e,t);if(r.length>0){a.logger.warn("[EventDispatcher] Failed to deliver some events from batch, retrying...");const e=await this.retryManager.retry(r,t);e.length>0&&this.batchProcessor.push(...e)}a.logger.debug(`[EventDispatcher] Delivered batch of ${e.length} events.`),this.dispatchTimer=null,this.maybeScheduleNextDelivery()}maybeScheduleNextDelivery(){this.isOffline||this.batchProcessor.isEmpty()||this.dispatchTimer||(a.logger.info(`[EventDispatcher] Scheduling next delivery in ${this.deliveryIntervalMs}ms.`),this.dispatchTimer=setTimeout((()=>this.deliverNextBatch()),this.deliveryIntervalMs))}ensureConfigFields(e){if(!e.ingestionUrl)throw new Error("Missing required ingestionUrl in EventDispatcherConfig");if(!e.deliveryIntervalMs)throw new Error("Missing required deliveryIntervalMs in EventDispatcherConfig");if(!e.retryIntervalMs)throw new Error("Missing required retryIntervalMs in EventDispatcherConfig");if(!e.maxRetryDelayMs)throw new Error("Missing required maxRetryDelayMs in EventDispatcherConfig")}}t.default=h},703278:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(328902);t.default=class{constructor(e,t){this.sdkKey=e,this.ingestionUrl=t}async deliver(e,t){try{n.logger.info(`[EventDispatcher] Delivering batch of ${e.length} events to ${this.ingestionUrl}...`);const r=await fetch(this.ingestionUrl,{method:"POST",headers:{"Content-Type":"application/json","x-eppo-token":this.sdkKey},body:JSON.stringify({eppo_events:e,context:t})});return r.ok?await this.parseFailedEvents(r,e):{failedEvents:e}}catch(t){return n.logger.warn("Failed to upload event batch",t),{failedEvents:e}}}async parseFailedEvents(e,t){n.logger.info("[EventDispatcher] Batch delivered successfully.");const r=await e.json(),i=new Set((null==r?void 0:r.failed_events)||[]);return i.size>0?(n.logger.warn(`[EventDispatcher] ${i.size}/${t.length} events failed ingestion.`),{failedEvents:t.filter((({uuid:e})=>i.has(e)))}):{failedEvents:[]}}}},164503:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{attachContext(e,t){}dispatch(e){}}},599050:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(808127),i="v0/i";t.default=class{decodeEventIngestionUrl(e){const t=e.split(".")[1];if(!t)return null;const r=n.Base64.decode(t),s=new URLSearchParams(r).get("eh");if(!s)return null;const a=s.endsWith("/")?`${s}${i}`:`${s}/${i}`;return a.startsWith("http://")||a.startsWith("https://")?a:`https://${a}`}}},111385:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FlagEvaluationDetailsBuilder=t.AllocationEvaluationCode=t.flagEvaluationCodes=void 0;const n=r(763483);var i;t.flagEvaluationCodes=["MATCH","FLAG_UNRECOGNIZED_OR_DISABLED","TYPE_MISMATCH","ASSIGNMENT_ERROR","DEFAULT_ALLOCATION_NULL","NO_ACTIONS_SUPPLIED_FOR_BANDIT","BANDIT_ERROR"],function(e){e.UNEVALUATED="UNEVALUATED",e.MATCH="MATCH",e.BEFORE_START_TIME="BEFORE_START_TIME",e.TRAFFIC_EXPOSURE_MISS="TRAFFIC_EXPOSURE_MISS",e.AFTER_END_TIME="AFTER_END_TIME",e.FAILING_RULE="FAILING_RULE"}(i||(t.AllocationEvaluationCode=i={}));t.FlagEvaluationDetailsBuilder=class{constructor(e,t,r,s){this.environmentName=e,this.allocations=t,this.configFetchedAt=r,this.configPublishedAt=s,this.variationKey=null,this.variationValue=null,this.matchedRule=null,this.matchedAllocation=null,this.unmatchedAllocations=[],this.addUnmatchedAllocation=e=>{this.unmatchedAllocations.push(e)},this.setNone=()=>(this.variationKey=null,this.variationValue=null,this.matchedRule=null,this.matchedAllocation=null,this),this.setMatch=(e,t,r,s,a)=>(this.variationKey=t.key,this.variationValue=a===n.VariationType.JSON&&"string"==typeof t.value?JSON.parse(t.value):t.value,this.matchedRule=s,this.matchedAllocation={key:r.key,allocationEvaluationCode:i.MATCH,orderPosition:e+1},this),this.buildForNoneResult=(e,t)=>this.setNone().build(e,t),this.build=(e,t)=>({environmentName:this.environmentName,flagEvaluationCode:e,flagEvaluationDescription:t,variationKey:this.variationKey,variationValue:this.variationValue,banditKey:null,banditAction:null,configFetchedAt:this.configFetchedAt,configPublishedAt:this.configPublishedAt,matchedRule:this.matchedRule,matchedAllocation:this.matchedAllocation,unmatchedAllocations:this.unmatchedAllocations,unevaluatedAllocations:this.calculateUnevaluatedAllocations()}),this.gracefulBuild=(e,t)=>{try{return this.build(e,t)}catch(e){return null}},this.calculateUnevaluatedAllocations=()=>{const e=this.matchedAllocation?this.unmatchedAllocations.length+1:this.unmatchedAllocations.length,t=e+1;return this.allocations.slice(e).map(((e,r)=>({key:e.key,allocationEvaluationCode:i.UNEVALUATED,orderPosition:t+r})))},this.setNone()}}},518963:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FlagEvaluationError=void 0;class r extends Error{}t.FlagEvaluationError=r},833027:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HttpRequestError=void 0;class r extends Error{constructor(e,t,r){super(e),this.message=e,this.status=t,this.cause=r,r&&(this.cause=r)}}t.HttpRequestError=r;t.default=class{constructor(e,t){this.apiEndpoints=e,this.timeout=t}async getUniversalFlagConfiguration(){const e=this.apiEndpoints.ufcEndpoint();return await this.rawGet(e)}async getBanditParameters(){const e=this.apiEndpoints.banditParametersEndpoint();return await this.rawGet(e)}async getPrecomputedFlags(e){const t=this.apiEndpoints.precomputedFlagsEndpoint();return await this.rawPost(t,e)}async rawGet(e){try{const t=new AbortController,n=t.signal,i=setTimeout((()=>t.abort()),this.timeout),s=await fetch(e,{signal:n});if(clearTimeout(i),null==s||!s.ok)throw new r("Failed to fetch data",null==s?void 0:s.status);return await s.json()}catch(e){if("AbortError"===e.name)throw new r("Request timed out",408,e);if(e instanceof r)throw e;throw new r("Network error",0,e)}}async rawPost(e,t){try{const n=new AbortController,i=n.signal,s=setTimeout((()=>n.abort()),this.timeout),a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t),signal:i});if(clearTimeout(s),null==a||!a.ok){const e=await a.text();throw new r(e||"Failed to post data",null==a?void 0:a.status)}return await a.json()}catch(e){if("AbortError"===e.name)throw new r("Request timed out",408,e);if(e instanceof r)throw e;throw new r("Network error",0,e)}}}},271067:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.StoreBackedConfiguration=void 0;const n=r(646168),i=r(723490);t.StoreBackedConfiguration=class{constructor(e,t,r){this.flagConfigurationStore=e,this.banditVariationConfigurationStore=t,this.banditModelConfigurationStore=r}async hydrateConfigurationStores(e,t,r){const i=await(0,n.hydrateConfigurationStore)(this.flagConfigurationStore,e),s=[];return this.banditVariationConfigurationStore&&t&&s.push((0,n.hydrateConfigurationStore)(this.banditVariationConfigurationStore,t)),this.banditModelConfigurationStore&&r&&s.push((0,n.hydrateConfigurationStore)(this.banditModelConfigurationStore,r)),await Promise.all(s),i}getBandit(e){var t,r;return null!==(t=null===(r=this.banditModelConfigurationStore)||void 0===r?void 0:r.get(e))&&void 0!==t?t:null}getFlagVariationBandit(e,t){var r,n;const i=null===(r=this.banditVariationConfigurationStore)||void 0===r?void 0:r.get(e),s=null==i||null===(n=i.find((e=>e.variationValue===t)))||void 0===n?void 0:n.key;return s?this.getBandit(s):null}getFlag(e){var t;return null!==(t=this.flagConfigurationStore.get(e))&&void 0!==t?t:null}getFlagConfigDetails(){var e,t,r,n;return{configFetchedAt:null!==(e=this.flagConfigurationStore.getConfigFetchedAt())&&void 0!==e?e:"",configPublishedAt:null!==(t=this.flagConfigurationStore.getConfigPublishedAt())&&void 0!==t?t:"",configEnvironment:null!==(r=this.flagConfigurationStore.getEnvironment())&&void 0!==r?r:{name:""},configFormat:null!==(n=this.flagConfigurationStore.getFormat())&&void 0!==n?n:""}}getFlagBanditVariations(e){var t,r;return null!==(t=null===(r=this.banditVariationConfigurationStore)||void 0===r?void 0:r.get(e))&&void 0!==t?t:[]}getFlagKeys(){return this.flagConfigurationStore.getKeys()}getFlags(){return this.flagConfigurationStore.entries()}isObfuscated(){var e;return i.OBFUSCATED_FORMATS.includes(null!==(e=this.getFlagConfigDetails().configFormat)&&void 0!==e?e:"SERVER")}isInitialized(){return this.flagConfigurationStore.isInitialized()&&(!this.banditVariationConfigurationStore||this.banditVariationConfigurationStore.isInitialized())&&(!this.banditModelConfigurationStore||this.banditModelConfigurationStore.isInitialized())}getBandits(){var e,t;return null!==(e=null===(t=this.banditModelConfigurationStore)||void 0===t?void 0:t.entries())&&void 0!==e?e:{}}getBanditVariations(){var e,t;return null!==(e=null===(t=this.banditVariationConfigurationStore)||void 0===t?void 0:t.entries())&&void 0!==e?e:{}}}},123231:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildStorageKeySuffix=t.decodePrecomputedFlag=t.ConfigurationWireHelper=t.DefaultEventDispatcher=t.BatchEventProcessor=t.newDefaultEventDispatcher=t.DEFAULT_EVENT_DISPATCHER_BATCH_SIZE=t.DEFAULT_EVENT_DISPATCHER_CONFIG=t.BoundedEventQueue=t.FormatEnum=t.VariationType=t.assignmentCacheValueToString=t.assignmentCacheKeyToString=t.LRUInMemoryAssignmentCache=t.NonExpiringInMemoryAssignmentCache=t.MemoryOnlyConfigurationStore=t.HybridConfigurationStore=t.MemoryStore=t.EppoPrecomputedClient=t.validation=t.HttpClient=t.FlagConfigRequestor=t.ApiEndpoints=t.constants=t.EppoClient=t.EppoAssignmentLogger=t.AbstractAssignmentCache=t.applicationLogger=t.loggerPrefix=void 0;const n=r(127660);t.ApiEndpoints=n.default;const i=r(328902);Object.defineProperty(t,"applicationLogger",{enumerable:!0,get:function(){return i.logger}}),Object.defineProperty(t,"loggerPrefix",{enumerable:!0,get:function(){return i.loggerPrefix}});const s=r(305397);Object.defineProperty(t,"AbstractAssignmentCache",{enumerable:!0,get:function(){return s.AbstractAssignmentCache}}),Object.defineProperty(t,"assignmentCacheKeyToString",{enumerable:!0,get:function(){return s.assignmentCacheKeyToString}}),Object.defineProperty(t,"assignmentCacheValueToString",{enumerable:!0,get:function(){return s.assignmentCacheValueToString}});const a=r(704814);Object.defineProperty(t,"LRUInMemoryAssignmentCache",{enumerable:!0,get:function(){return a.LRUInMemoryAssignmentCache}});const o=r(358651);Object.defineProperty(t,"NonExpiringInMemoryAssignmentCache",{enumerable:!0,get:function(){return o.NonExpiringInMemoryAssignmentCache}});const u=r(252635);t.EppoClient=u.default;const c=r(956738);t.EppoPrecomputedClient=c.default;const l=r(371152);t.FlagConfigRequestor=l.default;const d=r(901741);Object.defineProperty(t,"HybridConfigurationStore",{enumerable:!0,get:function(){return d.HybridConfigurationStore}});const h=r(780952);Object.defineProperty(t,"MemoryStore",{enumerable:!0,get:function(){return h.MemoryStore}}),Object.defineProperty(t,"MemoryOnlyConfigurationStore",{enumerable:!0,get:function(){return h.MemoryOnlyConfigurationStore}});const f=r(58135);Object.defineProperty(t,"ConfigurationWireHelper",{enumerable:!0,get:function(){return f.ConfigurationWireHelper}});const p=r(723490);t.constants=p;const g=r(178898);Object.defineProperty(t,"decodePrecomputedFlag",{enumerable:!0,get:function(){return g.decodePrecomputedFlag}});const m=r(427310);Object.defineProperty(t,"EppoAssignmentLogger",{enumerable:!0,get:function(){return m.EppoAssignmentLogger}});const v=r(978333);t.BatchEventProcessor=v.default;const y=r(660359);Object.defineProperty(t,"BoundedEventQueue",{enumerable:!0,get:function(){return y.BoundedEventQueue}});const E=r(456355);t.DefaultEventDispatcher=E.default,Object.defineProperty(t,"DEFAULT_EVENT_DISPATCHER_CONFIG",{enumerable:!0,get:function(){return E.DEFAULT_EVENT_DISPATCHER_CONFIG}}),Object.defineProperty(t,"DEFAULT_EVENT_DISPATCHER_BATCH_SIZE",{enumerable:!0,get:function(){return E.DEFAULT_EVENT_DISPATCHER_BATCH_SIZE}}),Object.defineProperty(t,"newDefaultEventDispatcher",{enumerable:!0,get:function(){return E.newDefaultEventDispatcher}});const b=r(833027);t.HttpClient=b.default;const _=r(763483);Object.defineProperty(t,"VariationType",{enumerable:!0,get:function(){return _.VariationType}}),Object.defineProperty(t,"FormatEnum",{enumerable:!0,get:function(){return _.FormatEnum}});const S=r(142060);Object.defineProperty(t,"buildStorageKeySuffix",{enumerable:!0,get:function(){return S.buildStorageKeySuffix}});const O=r(793252);t.validation=O},763483:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.FormatEnum=t.UNKNOWN_ENVIRONMENT_NAME=t.VariationType=void 0,function(e){e.STRING="STRING",e.INTEGER="INTEGER",e.NUMERIC="NUMERIC",e.BOOLEAN="BOOLEAN",e.JSON="JSON"}(r||(t.VariationType=r={})),t.UNKNOWN_ENVIRONMENT_NAME="UNKNOWN",function(e){e.SERVER="SERVER",e.CLIENT="CLIENT",e.PRECOMPUTED="PRECOMPUTED"}(n||(t.FormatEnum=n={}))},142060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMD5Hash=s,t.buildStorageKeySuffix=function(e){return s(e).slice(0,16)},t.encodeBase64=a,t.attributeEncodeBase64=o,t.decodeBase64=function(e){return n.decode(e)},t.obfuscatePrecomputedBanditMap=function(e,t){return Object.fromEntries(Object.entries(t).map((([t,r])=>{return[s(t,e),(n=r,{banditKey:a(n.banditKey),action:a(n.action),actionProbability:n.actionProbability,optimalityGap:n.optimalityGap,modelVersion:a(n.modelVersion),actionNumericAttributes:u(n.actionNumericAttributes),actionCategoricalAttributes:u(n.actionCategoricalAttributes)})];var n})))},t.obfuscatePrecomputedFlags=function(e,t){const r={};return Object.keys(t).forEach((n=>{var i,o,u;const c=t[n],l=Object.fromEntries(Object.entries(null!==(i=c.extraLogging)&&void 0!==i?i:{}).map((e=>e.map(a)))),d=s(n,e);r[d]={flagKey:d,variationType:c.variationType,extraLogging:l,doLog:c.doLog,allocationKey:a(null!==(o=c.allocationKey)&&void 0!==o?o:""),variationKey:a(null!==(u=c.variationKey)&&void 0!==u?u:""),variationValue:a(c.variationValue)}})),r};const n=r(808127),i=r(275735);function s(e,t=""){return(new i).append(t).append(e).end()}function a(e){return n.encode(e)}function o(e){return a("string"!=typeof e?String(e):e)}function u(e){return Object.fromEntries(Object.entries(e).map((([e,t])=>[a(e),o(t)])))}},294364:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OverrideValidator=t.sendValidationRequest=void 0;const n=r(998350);t.sendValidationRequest=async e=>{const t=await fetch("https://eppo.cloud/api/flag-overrides/v1/validate-key",{method:"POST",body:JSON.stringify({key:e}),headers:{"Content-Type":"application/json"}});if(200!==t.status)throw new Error(`Unable to authorize key: ${t.statusText}`)};t.OverrideValidator=class{constructor(){this.validKeyCache=new n.TLRUCache(100,18e6)}parseOverridePayload(e){try{const t=JSON.parse(e);return this.validateParsedOverridePayload(t),t}catch(e){var t;const r=null!==(t=null==e?void 0:e.message)&&void 0!==t?t:"unknown error";throw new Error(`Unable to parse overridePayload: ${r}`)}}validateParsedOverridePayload(e){if("object"!=typeof e)throw new Error("Expected object, but received "+typeof e);const t=Object.keys(e);if(!t.includes("browserExtensionKey"))throw new Error("Missing required field: 'browserExtensionKey'");if(!t.includes("overrides"))throw new Error("Missing required field: 'overrides'");if("string"!=typeof e.browserExtensionKey)throw new Error("Invalid type for 'browserExtensionKey'. Expected string, but received "+typeof e.browserExtensionKey);if("object"!=typeof e.overrides)throw new Error(`Invalid type for 'overrides'. Expected object, but received ${typeof e.overrides}.`)}async validateKey(e){if("true"===this.validKeyCache.get(e))return!0;await(0,t.sendValidationRequest)(e),this.validKeyCache.set(e,"true")}}},348869:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){let o,u=!1,c=0,l=e,d=!1;const h=()=>{u||(u=!0,o&&clearTimeout(o),n.logger.info("Eppo SDK polling stopped"))};async function f(){if(!u){try{await t(),c=0,l=e,d&&(d=!1,n.logger.info("Eppo SDK poll successful; resuming normal polling"))}catch(t){var s;d=!0,n.logger.warn(`Eppo SDK encountered an error polling configurations: ${t.message}`);const o=1+(null!==(s=null==r?void 0:r.maxPollRetries)&&void 0!==s?s:i.DEFAULT_POLL_CONFIG_REQUEST_RETRIES);if(++c{var c;u=!1;let l=!1,p=null!=r&&r.skipInitialPoll?0:1+(null!==(c=null==r?void 0:r.maxStartRetries)&&void 0!==c?c:i.DEFAULT_INITIAL_CONFIG_REQUEST_RETRIES),g=null;for(;!l&&p>0;)try{await t(),l=!0,d=!1,n.logger.info("Eppo SDK successfully requested initial configuration")}catch(t){if(d=!0,n.logger.warn(`Eppo SDK encountered an error with initial poll of configurations: ${t.message}`),--p>0){const t=a(e);n.logger.warn(`Eppo SDK will retry the initial poll again in ${t} ms (${p} attempts remaining)`),await(0,s.waitForMs)(t)}else null!=r&&r.pollAfterFailedStart?n.logger.warn("Eppo SDK initial poll failed; will attempt regular polling"):(n.logger.error("Eppo SDK initial poll failed. Aborting polling"),h()),null!=r&&r.errorOnFailedStart&&(g=t)}if(!u&&(l&&(null==r?void 0:r.pollAfterSuccessfulStart)||!l&&(null==r?void 0:r.pollAfterFailedStart))?(n.logger.info(`Eppo SDK starting regularly polling every ${e} ms`),o=setTimeout(f,e)):n.logger.info("Eppo SDK will not poll for configuration updates"),g)throw n.logger.info("Eppo SDK rethrowing start error"),g},stop:h}};const n=r(328902),i=r(723490),s=r(63071);function a(e){return e*i.POLL_JITTER_PCT/2+Math.max(Math.floor(Math.random()*e*i.POLL_JITTER_PCT/2),1)}},675012:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(646168),i=r(763483);t.default=class{constructor(e,t,r,n,i,s){this.httpClient=e,this.precomputedFlagStore=t,this.subjectKey=r,this.subjectAttributes=n,this.precomputedBanditsStore=i,this.banditActions=s}async fetchAndStorePrecomputedFlags(){var e;const t=await this.httpClient.getPrecomputedFlags({subject_key:this.subjectKey,subject_attributes:this.subjectAttributes,bandit_actions:this.banditActions});if(!t)return;const r=[];var s;(r.push((0,n.hydrateConfigurationStore)(this.precomputedFlagStore,{entries:t.flags,environment:null!==(e=t.environment)&&void 0!==e?e:{name:i.UNKNOWN_ENVIRONMENT_NAME},createdAt:t.createdAt,format:t.format,salt:t.salt})),this.precomputedBanditsStore)&&r.push((0,n.hydrateConfigurationStore)(this.precomputedBanditsStore,{entries:t.bandits,environment:null!==(s=t.environment)&&void 0!==s?s:{name:i.UNKNOWN_ENVIRONMENT_NAME},createdAt:t.createdAt,format:t.format,salt:t.salt}));await Promise.all(r)}}},131344:(e,t,r)=>{"use strict";var n=r(443693);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}Object.defineProperty(t,"__esModule",{value:!0}),t.ObfuscatedOperatorType=t.OperatorType=void 0,t.matchesRule=function(e,t,r){return!function(e,t,r){return t.map((t=>r?function(e,t){const r=e[t.attribute];if(t.operator===u.IS_NULL)return t.value===(0,a.getMD5Hash)("true")?null==r:null!=r;if(null!=r)switch(t.operator){case u.GTE:case u.GT:case u.LTE:case u.LT:{const e=(0,a.decodeBase64)(t.value);if(g(e)===c.SEM_VER){return p(r,e,t.operator===u.GTE?s.gte:t.operator===u.GT?s.gt:t.operator===u.LTE?s.lte:s.lt)}const n=(e,r)=>t.operator===u.GTE?e>=r:t.operator===u.GT?e>r:t.operator===u.LTE?e<=r:efunction(e){for(var t=1;tt.operator===o.GTE?e>=r:t.operator===o.GT?e>r:t.operator===o.LTE?e<=r:e0}function d(e,t){return 0===h(e,t).length}function h(e,t){return t.filter((t=>t===e))}function f(e,t,r){return r(Number(e),Number(t))}function p(e,t,r){return!!(0,s.valid)(e)&&!!(0,s.valid)(t)&&r(e,t)}function g(e){return"number"==typeof e?c.NUMERIC:Array.isArray(e)?c.STRING_ARRAY:"string"==typeof e&&(0,s.valid)(e)?c.SEM_VER:isNaN(Number(e))?c.PLAIN_STRING:c.NUMERIC}!function(e){e.MATCHES="MATCHES",e.NOT_MATCHES="NOT_MATCHES",e.GTE="GTE",e.GT="GT",e.LTE="LTE",e.LT="LT",e.ONE_OF="ONE_OF",e.NOT_ONE_OF="NOT_ONE_OF",e.IS_NULL="IS_NULL"}(o||(t.OperatorType=o={})),function(e){e.MATCHES="05015086bdd8402218f6aad6528bef08",e.NOT_MATCHES="8323761667755378c3a78e0a6ed37a78",e.GTE="32d35312e8f24bc1669bd2b45c00d47c",e.GT="cd6a9bd2a175104eed40f0d33a8b4020",e.LTE="cc981ecc65ecf63ad1673cbec9c64198",e.LT="c562607189d77eb9dfb707464c1e7b0b",e.ONE_OF="27457ce369f2a74203396a35ef537c0b",e.NOT_ONE_OF="602f5ee0b6e84fe29f43ab48b9e1addf",e.IS_NULL="dbd9c38e0339e6c34bd48cafc59be388"}(u||(t.ObfuscatedOperatorType=u={})),function(e){e.PLAIN_STRING="PLAIN_STRING",e.STRING_ARRAY="STRING_ARRAY",e.SEM_VER="SEM_VER",e.NUMERIC="NUMERIC"}(c||(c={}))},736055:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeterministicSharder=t.MD5Sharder=t.Sharder=void 0;const n=r(142060);class i{}t.Sharder=i;t.MD5Sharder=class extends i{getShard(e,t){const r=(0,n.getMD5Hash)(e);return parseInt(r.slice(0,8),16)%t}};t.DeterministicSharder=class extends i{constructor(e){super(),this.lookup=e}getShard(e,t){var r;return null!==(r=this.lookup[e])&&void 0!==r?r:0}}},63071:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.waitForMs=async function(e){await new Promise((t=>setTimeout(t,e)))},t.shallowClone=function(e){return Object.assign(Object.create(Object.getPrototypeOf(e)),e)}},793252:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidArgumentError=void 0,t.validateNotBlank=function(e,t){if(null==e||0===e.length)throw new r(t)};class r extends Error{}t.InvalidArgumentError=r},212911:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LIB_VERSION=void 0;const n=r(841461);t.LIB_VERSION=n.version},271306:(e,t,r)=>{var n=r(177693),i=r(286162),s=i;s.v1=n,s.v4=i,e.exports=s},851187:e=>{for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);e.exports=function(e,r){var n=r||0,i=t;return[i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],"-",i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]],i[e[n++]]].join("")}},40490:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var r=new Uint8Array(16);e.exports=function(){return t(r),r}}else{var n=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),n[t]=e>>>((3&t)<<3)&255;return n}}},177693:(e,t,r)=>{var n,i,s=r(40490),a=r(851187),o=0,u=0;e.exports=function(e,t,r){var c=t&&r||0,l=t||[],d=(e=e||{}).node||n,h=void 0!==e.clockseq?e.clockseq:i;if(null==d||null==h){var f=s();null==d&&(d=n=[1|f[0],f[1],f[2],f[3],f[4],f[5]]),null==h&&(h=i=16383&(f[6]<<8|f[7]))}var p=void 0!==e.msecs?e.msecs:(new Date).getTime(),g=void 0!==e.nsecs?e.nsecs:u+1,m=p-o+(g-u)/1e4;if(m<0&&void 0===e.clockseq&&(h=h+1&16383),(m<0||p>o)&&void 0===e.nsecs&&(g=0),g>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");o=p,u=g,i=h;var v=(1e4*(268435455&(p+=122192928e5))+g)%4294967296;l[c++]=v>>>24&255,l[c++]=v>>>16&255,l[c++]=v>>>8&255,l[c++]=255&v;var y=p/4294967296*1e4&268435455;l[c++]=y>>>8&255,l[c++]=255&y,l[c++]=y>>>24&15|16,l[c++]=y>>>16&255,l[c++]=h>>>8|128,l[c++]=255&h;for(var E=0;E<6;++E)l[c+E]=d[E];return t||a(l)}},286162:(e,t,r)=>{var n=r(40490),i=r(851187);e.exports=function(e,t,r){var s=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var a=(e=e||{}).random||(e.rng||n)();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t)for(var o=0;o<16;++o)t[s+o]=a[o];return t||i(a)}},93904:(e,t,r)=>{"use strict";const n=Symbol("SemVer ANY");class i{static get ANY(){return n}constructor(e,t){if(t=s(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),c("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,c("comp",this)}parse(e){const t=this.options.loose?a[o.COMPARATORLOOSE]:a[o.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(c("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return u(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):(!(t=s(t)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(u(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(u(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}e.exports=i;const s=r(398587),{safeRe:a,t:o}=r(199718),u=r(272111),c=r(257272),l=r(853908),d=r(778311)},778311:(e,t,r)=>{"use strict";const n=/\s+/g;class i{constructor(e,t){if(t=a(t),e instanceof i)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new i(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(n," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!v(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&g)|(this.options.loose&&m))+":"+e,r=s.get(t);if(r)return r;const n=this.options.loose,i=n?l[d.HYPHENRANGELOOSE]:l[d.HYPHENRANGE];e=e.replace(i,R(this.options.includePrerelease)),u("hyphen replace",e),e=e.replace(l[d.COMPARATORTRIM],h),u("comparator trim",e),e=e.replace(l[d.TILDETRIM],f),u("tilde trim",e),e=e.replace(l[d.CARETTRIM],p),u("caret trim",e);let a=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>N(e,this.options)));n&&(a=a.filter((e=>(u("loose invalid filter",e,this.options),!!e.match(l[d.COMPARATORLOOSE]))))),u("range list",a);const c=new Map,y=a.map((e=>new o(e,this.options)));for(const e of y){if(v(e))return[e];c.set(e.value,e)}c.size>1&&c.has("")&&c.delete("");const E=[...c.values()];return s.set(t,E),E}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Range is required");return this.set.some((r=>E(r,t)&&e.set.some((e=>E(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}for(let t=0;t"<0.0.0-0"===e.value,y=e=>""===e.value,E=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every((e=>i.intersects(e,t))),i=n.pop();return r},b=(e,t)=>(e=e.replace(l[d.BUILD],""),u("comp",e,t),e=A(e,t),u("caret",e),e=S(e,t),u("tildes",e),e=C(e,t),u("xrange",e),e=T(e,t),u("stars",e),e),_=e=>!e||"x"===e.toLowerCase()||"*"===e,S=(e,t)=>e.trim().split(/\s+/).map((e=>O(e,t))).join(" "),O=(e,t)=>{const r=t.loose?l[d.TILDELOOSE]:l[d.TILDE];return e.replace(r,((t,r,n,i,s)=>{let a;return u("tilde",e,t,r,n,i,s),_(r)?a="":_(n)?a=`>=${r}.0.0 <${+r+1}.0.0-0`:_(i)?a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:s?(u("replaceTilde pr",s),a=`>=${r}.${n}.${i}-${s} <${r}.${+n+1}.0-0`):a=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,u("tilde return",a),a}))},A=(e,t)=>e.trim().split(/\s+/).map((e=>w(e,t))).join(" "),w=(e,t)=>{u("caret",e,t);const r=t.loose?l[d.CARETLOOSE]:l[d.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,i,s,a)=>{let o;return u("caret",e,t,r,i,s,a),_(r)?o="":_(i)?o=`>=${r}.0.0${n} <${+r+1}.0.0-0`:_(s)?o="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:a?(u("replaceCaret pr",a),o="0"===r?"0"===i?`>=${r}.${i}.${s}-${a} <${r}.${i}.${+s+1}-0`:`>=${r}.${i}.${s}-${a} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${s}-${a} <${+r+1}.0.0-0`):(u("no pr"),o="0"===r?"0"===i?`>=${r}.${i}.${s}${n} <${r}.${i}.${+s+1}-0`:`>=${r}.${i}.${s}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${s} <${+r+1}.0.0-0`),u("caret return",o),o}))},C=(e,t)=>(u("replaceXRanges",e,t),e.split(/\s+/).map((e=>I(e,t))).join(" ")),I=(e,t)=>{e=e.trim();const r=t.loose?l[d.XRANGELOOSE]:l[d.XRANGE];return e.replace(r,((r,n,i,s,a,o)=>{u("xRange",e,r,n,i,s,a,o);const c=_(i),l=c||_(s),d=l||_(a),h=d;return"="===n&&h&&(n=""),o=t.includePrerelease?"-0":"",c?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&h?(l&&(s=0),a=0,">"===n?(n=">=",l?(i=+i+1,s=0,a=0):(s=+s+1,a=0)):"<="===n&&(n="<",l?i=+i+1:s=+s+1),"<"===n&&(o="-0"),r=`${n+i}.${s}.${a}${o}`):l?r=`>=${i}.0.0${o} <${+i+1}.0.0-0`:d&&(r=`>=${i}.${s}.0${o} <${i}.${+s+1}.0-0`),u("xRange return",r),r}))},T=(e,t)=>(u("replaceStars",e,t),e.trim().replace(l[d.STAR],"")),N=(e,t)=>(u("replaceGTE0",e,t),e.trim().replace(l[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),R=e=>(t,r,n,i,s,a,o,u,c,l,d,h)=>`${r=_(n)?"":_(i)?`>=${n}.0.0${e?"-0":""}`:_(s)?`>=${n}.${i}.0${e?"-0":""}`:a?`>=${r}`:`>=${r}${e?"-0":""}`} ${u=_(c)?"":_(l)?`<${+c+1}.0.0-0`:_(d)?`<${c}.${+l+1}.0-0`:h?`<=${c}.${l}.${d}-${h}`:e?`<${c}.${l}.${+d+1}-0`:`<=${u}`}`.trim(),P=(e,t,r)=>{for(let r=0;r0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},853908:(e,t,r)=>{"use strict";const n=r(257272),{MAX_LENGTH:i,MAX_SAFE_INTEGER:s}=r(416874),{safeRe:a,t:o}=r(199718),u=r(398587),{compareIdentifiers:c}=r(961123);class l{constructor(e,t){if(t=u(t),e instanceof l){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?a[o.LOOSE]:a[o.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&te.major?1:this.minore.minor?1:this.patche.patch?1:0}comparePre(e){if(e instanceof l||(e=new l(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],i=e.prerelease[t];if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return c(r,i)}while(++t)}compareBuild(e){e instanceof l||(e=new l(e,this.options));let t=0;do{const r=this.build[t],i=e.build[t];if(n("build compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return-1;if(r!==i)return c(r,i)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(t){const e=`-${t}`.match(this.options.loose?a[o.PRERELEASELOOSE]:a[o.PRERELEASE]);if(!e||e[1]!==t)throw new Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=l},57414:(e,t,r)=>{"use strict";const n=r(830144);e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},272111:(e,t,r)=>{"use strict";const n=r(694641),i=r(613999),s=r(535580),a=r(154089),o=r(207059),u=r(825200);e.exports=(e,t,r,c)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,c);case"!=":return i(e,r,c);case">":return s(e,r,c);case">=":return a(e,r,c);case"<":return o(e,r,c);case"<=":return u(e,r,c);default:throw new TypeError(`Invalid operator: ${t}`)}}},546170:(e,t,r)=>{"use strict";const n=r(853908),i=r(830144),{safeRe:s,t:a}=r(199718);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const n=t.includePrerelease?s[a.COERCERTLFULL]:s[a.COERCERTL];let i;for(;(i=n.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&i.index+i[0].length===r.index+r[0].length||(r=i),n.lastIndex=i.index+i[1].length+i[2].length;n.lastIndex=-1}else r=e.match(t.includePrerelease?s[a.COERCEFULL]:s[a.COERCE]);if(null===r)return null;const o=r[2],u=r[3]||"0",c=r[4]||"0",l=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return i(`${o}.${u}.${c}${l}${d}`,t)}},240909:(e,t,r)=>{"use strict";const n=r(853908);e.exports=(e,t,r)=>{const i=new n(e,r),s=new n(t,r);return i.compare(s)||i.compareBuild(s)}},111763:(e,t,r)=>{"use strict";const n=r(350560);e.exports=(e,t)=>n(e,t,!0)},350560:(e,t,r)=>{"use strict";const n=r(853908);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},251832:(e,t,r)=>{"use strict";const n=r(830144);e.exports=(e,t)=>{const r=n(e,null,!0),i=n(t,null,!0),s=r.compare(i);if(0===s)return null;const a=s>0,o=a?r:i,u=a?i:r,c=!!o.prerelease.length;if(!!u.prerelease.length&&!c){if(!u.patch&&!u.minor)return"major";if(0===u.compareMain(o))return u.minor&&!u.patch?"minor":"patch"}const l=c?"pre":"";return r.major!==i.major?l+"major":r.minor!==i.minor?l+"minor":r.patch!==i.patch?l+"patch":"prerelease"}},694641:(e,t,r)=>{"use strict";const n=r(350560);e.exports=(e,t,r)=>0===n(e,t,r)},535580:(e,t,r)=>{"use strict";const n=r(350560);e.exports=(e,t,r)=>n(e,t,r)>0},154089:(e,t,r)=>{"use strict";const n=r(350560);e.exports=(e,t,r)=>n(e,t,r)>=0},793007:(e,t,r)=>{"use strict";const n=r(853908);e.exports=(e,t,r,i,s)=>{"string"==typeof r&&(s=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,s).version}catch(e){return null}}},207059:(e,t,r)=>{"use strict";const n=r(350560);e.exports=(e,t,r)=>n(e,t,r)<0},825200:(e,t,r)=>{"use strict";const n=r(350560);e.exports=(e,t,r)=>n(e,t,r)<=0},532938:(e,t,r)=>{"use strict";const n=r(853908);e.exports=(e,t)=>new n(e,t).major},746254:(e,t,r)=>{"use strict";const n=r(853908);e.exports=(e,t)=>new n(e,t).minor},613999:(e,t,r)=>{"use strict";const n=r(350560);e.exports=(e,t,r)=>0!==n(e,t,r)},830144:(e,t,r)=>{"use strict";const n=r(853908);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},24493:(e,t,r)=>{"use strict";const n=r(853908);e.exports=(e,t)=>new n(e,t).patch},31729:(e,t,r)=>{"use strict";const n=r(830144);e.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},809970:(e,t,r)=>{"use strict";const n=r(350560);e.exports=(e,t,r)=>n(t,e,r)},474277:(e,t,r)=>{"use strict";const n=r(240909);e.exports=(e,t)=>e.sort(((e,r)=>n(r,e,t)))},897638:(e,t,r)=>{"use strict";const n=r(778311);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},343927:(e,t,r)=>{"use strict";const n=r(240909);e.exports=(e,t)=>e.sort(((e,r)=>n(e,r,t)))},556953:(e,t,r)=>{"use strict";const n=r(830144);e.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}},999589:(e,t,r)=>{"use strict";const n=r(199718),i=r(416874),s=r(853908),a=r(961123),o=r(830144),u=r(556953),c=r(57414),l=r(793007),d=r(251832),h=r(532938),f=r(746254),p=r(24493),g=r(31729),m=r(350560),v=r(809970),y=r(111763),E=r(240909),b=r(343927),_=r(474277),S=r(535580),O=r(207059),A=r(694641),w=r(613999),C=r(154089),I=r(825200),T=r(272111),N=r(546170),R=r(93904),P=r(778311),L=r(897638),j=r(277631),x=r(919628),D=r(300270),M=r(441261),k=r(113874),F=r(697075),$=r(375571),U=r(5342),V=r(676780),B=r(972525),Z=r(475032);e.exports={parse:o,valid:u,clean:c,inc:l,diff:d,major:h,minor:f,patch:p,prerelease:g,compare:m,rcompare:v,compareLoose:y,compareBuild:E,sort:b,rsort:_,gt:S,lt:O,eq:A,neq:w,gte:C,lte:I,cmp:T,coerce:N,Comparator:R,Range:P,satisfies:L,toComparators:j,maxSatisfying:x,minSatisfying:D,minVersion:M,validRange:k,outside:F,gtr:$,ltr:U,intersects:V,simplifyRange:B,subset:Z,SemVer:s,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}},416874:e=>{"use strict";const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},257272:e=>{"use strict";const t="object"==typeof process&&{API_BASE_URL:void 0,CDN_URL:"https://assets.twitch.tv/",GQL_BASE_URL:void 0,PASSPORT_BASE_URL:void 0,INTERPOL_BASE_URL:void 0,PUBSUB_ENV:void 0,TMI_BASE_URL:void 0,MANIFEST_URL:"https://assets.twitch.tv/config/manifest.json?v=1",NODE_ENV:"production",PLAYER_BASE_URL:"https://player.twitch.tv",IS_DEV_BUILD:!1,IS_STAGING_BUILD:!1,IS_LOCAL_DEVSERVER:!1}.NODE_DEBUG&&/\bsemver\b/i.test({API_BASE_URL:void 0,CDN_URL:"https://assets.twitch.tv/",GQL_BASE_URL:void 0,PASSPORT_BASE_URL:void 0,INTERPOL_BASE_URL:void 0,PUBSUB_ENV:void 0,TMI_BASE_URL:void 0,MANIFEST_URL:"https://assets.twitch.tv/config/manifest.json?v=1",NODE_ENV:"production",PLAYER_BASE_URL:"https://player.twitch.tv",IS_DEV_BUILD:!1,IS_STAGING_BUILD:!1,IS_LOCAL_DEVSERVER:!1}.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},961123:e=>{"use strict";const t=/^[0-9]+$/,r=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:er(t,e)}},668794:e=>{"use strict";e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},398587:e=>{"use strict";const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},199718:(e,t,r)=>{"use strict";const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:s}=r(416874),a=r(257272),o=(t=e.exports={}).re=[],u=t.safeRe=[],c=t.src=[],l=t.safeSrc=[],d=t.t={};let h=0;const f="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",s],[f,i]],g=(e,t,r)=>{const n=(e=>{for(const[t,r]of p)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=h++;a(e,i,t),d[e]=i,c[i]=t,l[i]=n,o[i]=new RegExp(t,r?"g":void 0),u[i]=new RegExp(n,r?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`),g("MAINVERSION",`(${c[d.NUMERICIDENTIFIER]})\\.(${c[d.NUMERICIDENTIFIER]})\\.(${c[d.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${c[d.NUMERICIDENTIFIERLOOSE]})\\.(${c[d.NUMERICIDENTIFIERLOOSE]})\\.(${c[d.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${c[d.NONNUMERICIDENTIFIER]}|${c[d.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${c[d.NONNUMERICIDENTIFIER]}|${c[d.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${c[d.PRERELEASEIDENTIFIER]}(?:\\.${c[d.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${c[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[d.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${f}+`),g("BUILD",`(?:\\+(${c[d.BUILDIDENTIFIER]}(?:\\.${c[d.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${c[d.MAINVERSION]}${c[d.PRERELEASE]}?${c[d.BUILD]}?`),g("FULL",`^${c[d.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${c[d.MAINVERSIONLOOSE]}${c[d.PRERELEASELOOSE]}?${c[d.BUILD]}?`),g("LOOSE",`^${c[d.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${c[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${c[d.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${c[d.XRANGEIDENTIFIER]})(?:\\.(${c[d.XRANGEIDENTIFIER]})(?:\\.(${c[d.XRANGEIDENTIFIER]})(?:${c[d.PRERELEASE]})?${c[d.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${c[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[d.XRANGEIDENTIFIERLOOSE]})(?:${c[d.PRERELEASELOOSE]})?${c[d.BUILD]}?)?)?`),g("XRANGE",`^${c[d.GTLT]}\\s*${c[d.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${c[d.GTLT]}\\s*${c[d.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${c[d.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",c[d.COERCEPLAIN]+`(?:${c[d.PRERELEASE]})?`+`(?:${c[d.BUILD]})?(?:$|[^\\d])`),g("COERCERTL",c[d.COERCE],!0),g("COERCERTLFULL",c[d.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${c[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${c[d.LONETILDE]}${c[d.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${c[d.LONETILDE]}${c[d.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${c[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${c[d.LONECARET]}${c[d.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${c[d.LONECARET]}${c[d.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${c[d.GTLT]}\\s*(${c[d.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${c[d.GTLT]}\\s*(${c[d.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${c[d.GTLT]}\\s*(${c[d.LOOSEPLAIN]}|${c[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${c[d.XRANGEPLAIN]})\\s+-\\s+(${c[d.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${c[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[d.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},375571:(e,t,r)=>{"use strict";const n=r(697075);e.exports=(e,t,r)=>n(e,t,">",r)},676780:(e,t,r)=>{"use strict";const n=r(778311);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},5342:(e,t,r)=>{"use strict";const n=r(697075);e.exports=(e,t,r)=>n(e,t,"<",r)},919628:(e,t,r)=>{"use strict";const n=r(853908),i=r(778311);e.exports=(e,t,r)=>{let s=null,a=null,o=null;try{o=new i(t,r)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&-1!==a.compare(e)||(s=e,a=new n(s,r)))})),s}},300270:(e,t,r)=>{"use strict";const n=r(853908),i=r(778311);e.exports=(e,t,r)=>{let s=null,a=null,o=null;try{o=new i(t,r)}catch(e){return null}return e.forEach((e=>{o.test(e)&&(s&&1!==a.compare(e)||(s=e,a=new n(s,r)))})),s}},441261:(e,t,r)=>{"use strict";const n=r(853908),i=r(778311),s=r(535580);e.exports=(e,t)=>{e=new i(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":a&&!s(t,a)||(a=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!a||r&&!s(r,a)||(r=a)}return r&&e.test(r)?r:null}},697075:(e,t,r)=>{"use strict";const n=r(853908),i=r(93904),{ANY:s}=i,a=r(778311),o=r(897638),u=r(535580),c=r(207059),l=r(825200),d=r(154089);e.exports=(e,t,r,h)=>{let f,p,g,m,v;switch(e=new n(e,h),t=new a(t,h),r){case">":f=u,p=l,g=c,m=">",v=">=";break;case"<":f=c,p=d,g=u,m="<",v="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(e,t,h))return!1;for(let r=0;r{e.semver===s&&(e=new i(">=0.0.0")),a=a||e,o=o||e,f(e.semver,a.semver,h)?a=e:g(e.semver,o.semver,h)&&(o=e)})),a.operator===m||a.operator===v)return!1;if((!o.operator||o.operator===m)&&p(e,o.semver))return!1;if(o.operator===v&&g(e,o.semver))return!1}return!0}},972525:(e,t,r)=>{"use strict";const n=r(897638),i=r(350560);e.exports=(e,t,r)=>{const s=[];let a=null,o=null;const u=e.sort(((e,t)=>i(e,t,r)));for(const e of u){n(e,t,r)?(o=e,a||(a=e)):(o&&s.push([a,o]),o=null,a=null)}a&&s.push([a,null]);const c=[];for(const[e,t]of s)e===t?c.push(e):t||e!==u[0]?t?e===u[0]?c.push(`<=${t}`):c.push(`${e} - ${t}`):c.push(`>=${e}`):c.push("*");const l=c.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return l.length{"use strict";const n=r(778311),i=r(93904),{ANY:s}=i,a=r(897638),o=r(350560),u=[new i(">=0.0.0-0")],c=[new i(">=0.0.0")],l=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=r.includePrerelease?u:c}if(1===t.length&&t[0].semver===s){if(r.includePrerelease)return!0;t=c}const n=new Set;let i,l,f,p,g,m,v;for(const t of e)">"===t.operator||">="===t.operator?i=d(i,t,r):"<"===t.operator||"<="===t.operator?l=h(l,t,r):n.add(t.semver);if(n.size>1)return null;if(i&&l){if(f=o(i.semver,l.semver,r),f>0)return null;if(0===f&&(">="!==i.operator||"<="!==l.operator))return null}for(const e of n){if(i&&!a(e,String(i),r))return null;if(l&&!a(e,String(l),r))return null;for(const n of t)if(!a(e,String(n),r))return!1;return!0}let y=!(!l||r.includePrerelease||!l.semver.prerelease.length)&&l.semver,E=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;y&&1===y.prerelease.length&&"<"===l.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(v=v||">"===e.operator||">="===e.operator,m=m||"<"===e.operator||"<="===e.operator,i)if(E&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===E.major&&e.semver.minor===E.minor&&e.semver.patch===E.patch&&(E=!1),">"===e.operator||">="===e.operator){if(p=d(i,e,r),p===e&&p!==i)return!1}else if(">="===i.operator&&!a(i.semver,String(e),r))return!1;if(l)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(g=h(l,e,r),g===e&&g!==l)return!1}else if("<="===l.operator&&!a(l.semver,String(e),r))return!1;if(!e.operator&&(l||i)&&0!==f)return!1}return!(i&&m&&!l&&0!==f)&&(!(l&&v&&!i&&0!==f)&&(!E&&!y))},d=(e,t,r)=>{if(!e)return t;const n=o(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;const n=o(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;e:for(const n of e.set){for(const e of t.set){const t=l(n,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},277631:(e,t,r)=>{"use strict";const n=r(778311);e.exports=(e,t)=>new n(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},113874:(e,t,r)=>{"use strict";const n=r(778311);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},275735:e=>{e.exports=function(e){"use strict";var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function r(e,t){var r=e[0],n=e[1],i=e[2],s=e[3];n=((n+=((i=((i+=((s=((s+=((r=((r+=(n&i|~n&s)+t[0]-680876936|0)<<7|r>>>25)+n|0)&n|~r&i)+t[1]-389564586|0)<<12|s>>>20)+r|0)&r|~s&n)+t[2]+606105819|0)<<17|i>>>15)+s|0)&s|~i&r)+t[3]-1044525330|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n&i|~n&s)+t[4]-176418897|0)<<7|r>>>25)+n|0)&n|~r&i)+t[5]+1200080426|0)<<12|s>>>20)+r|0)&r|~s&n)+t[6]-1473231341|0)<<17|i>>>15)+s|0)&s|~i&r)+t[7]-45705983|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n&i|~n&s)+t[8]+1770035416|0)<<7|r>>>25)+n|0)&n|~r&i)+t[9]-1958414417|0)<<12|s>>>20)+r|0)&r|~s&n)+t[10]-42063|0)<<17|i>>>15)+s|0)&s|~i&r)+t[11]-1990404162|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n&i|~n&s)+t[12]+1804603682|0)<<7|r>>>25)+n|0)&n|~r&i)+t[13]-40341101|0)<<12|s>>>20)+r|0)&r|~s&n)+t[14]-1502002290|0)<<17|i>>>15)+s|0)&s|~i&r)+t[15]+1236535329|0)<<22|n>>>10)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n&s|i&~s)+t[1]-165796510|0)<<5|r>>>27)+n|0)&i|n&~i)+t[6]-1069501632|0)<<9|s>>>23)+r|0)&n|r&~n)+t[11]+643717713|0)<<14|i>>>18)+s|0)&r|s&~r)+t[0]-373897302|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n&s|i&~s)+t[5]-701558691|0)<<5|r>>>27)+n|0)&i|n&~i)+t[10]+38016083|0)<<9|s>>>23)+r|0)&n|r&~n)+t[15]-660478335|0)<<14|i>>>18)+s|0)&r|s&~r)+t[4]-405537848|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n&s|i&~s)+t[9]+568446438|0)<<5|r>>>27)+n|0)&i|n&~i)+t[14]-1019803690|0)<<9|s>>>23)+r|0)&n|r&~n)+t[3]-187363961|0)<<14|i>>>18)+s|0)&r|s&~r)+t[8]+1163531501|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n&s|i&~s)+t[13]-1444681467|0)<<5|r>>>27)+n|0)&i|n&~i)+t[2]-51403784|0)<<9|s>>>23)+r|0)&n|r&~n)+t[7]+1735328473|0)<<14|i>>>18)+s|0)&r|s&~r)+t[12]-1926607734|0)<<20|n>>>12)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n^i^s)+t[5]-378558|0)<<4|r>>>28)+n|0)^n^i)+t[8]-2022574463|0)<<11|s>>>21)+r|0)^r^n)+t[11]+1839030562|0)<<16|i>>>16)+s|0)^s^r)+t[14]-35309556|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n^i^s)+t[1]-1530992060|0)<<4|r>>>28)+n|0)^n^i)+t[4]+1272893353|0)<<11|s>>>21)+r|0)^r^n)+t[7]-155497632|0)<<16|i>>>16)+s|0)^s^r)+t[10]-1094730640|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n^i^s)+t[13]+681279174|0)<<4|r>>>28)+n|0)^n^i)+t[0]-358537222|0)<<11|s>>>21)+r|0)^r^n)+t[3]-722521979|0)<<16|i>>>16)+s|0)^s^r)+t[6]+76029189|0)<<23|n>>>9)+i|0,n=((n+=((i=((i+=((s=((s+=((r=((r+=(n^i^s)+t[9]-640364487|0)<<4|r>>>28)+n|0)^n^i)+t[12]-421815835|0)<<11|s>>>21)+r|0)^r^n)+t[15]+530742520|0)<<16|i>>>16)+s|0)^s^r)+t[2]-995338651|0)<<23|n>>>9)+i|0,n=((n+=((s=((s+=(n^((r=((r+=(i^(n|~s))+t[0]-198630844|0)<<6|r>>>26)+n|0)|~i))+t[7]+1126891415|0)<<10|s>>>22)+r|0)^((i=((i+=(r^(s|~n))+t[14]-1416354905|0)<<15|i>>>17)+s|0)|~r))+t[5]-57434055|0)<<21|n>>>11)+i|0,n=((n+=((s=((s+=(n^((r=((r+=(i^(n|~s))+t[12]+1700485571|0)<<6|r>>>26)+n|0)|~i))+t[3]-1894986606|0)<<10|s>>>22)+r|0)^((i=((i+=(r^(s|~n))+t[10]-1051523|0)<<15|i>>>17)+s|0)|~r))+t[1]-2054922799|0)<<21|n>>>11)+i|0,n=((n+=((s=((s+=(n^((r=((r+=(i^(n|~s))+t[8]+1873313359|0)<<6|r>>>26)+n|0)|~i))+t[15]-30611744|0)<<10|s>>>22)+r|0)^((i=((i+=(r^(s|~n))+t[6]-1560198380|0)<<15|i>>>17)+s|0)|~r))+t[13]+1309151649|0)<<21|n>>>11)+i|0,n=((n+=((s=((s+=(n^((r=((r+=(i^(n|~s))+t[4]-145523070|0)<<6|r>>>26)+n|0)|~i))+t[11]-1120210379|0)<<10|s>>>22)+r|0)^((i=((i+=(r^(s|~n))+t[2]+718787259|0)<<15|i>>>17)+s|0)|~r))+t[9]-343485551|0)<<21|n>>>11)+i|0,e[0]=r+e[0]|0,e[1]=n+e[1]|0,e[2]=i+e[2]|0,e[3]=s+e[3]|0}function n(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function i(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return r}function s(e){var t,i,s,a,o,u,c=e.length,l=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)r(l,n(e.substring(t-64,t)));for(i=(e=e.substring(t-64)).length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t>2]|=e.charCodeAt(t)<<(t%4<<3);if(s[t>>2]|=128<<(t%4<<3),t>55)for(r(l,s),t=0;t<16;t+=1)s[t]=0;return a=(a=8*c).toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(a[2],16),u=parseInt(a[1],16)||0,s[14]=o,s[15]=u,r(l,s),l}function a(e){var t,n,s,a,o,u,c=e.length,l=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)r(l,i(e.subarray(t-64,t)));for(n=(e=t-64>2]|=e[t]<<(t%4<<3);if(s[t>>2]|=128<<(t%4<<3),t>55)for(r(l,s),t=0;t<16;t+=1)s[t]=0;return a=(a=8*c).toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(a[2],16),u=parseInt(a[1],16)||0,s[14]=o,s[15]=u,r(l,s),l}function o(e){var r,n="";for(r=0;r<4;r+=1)n+=t[e>>8*r+4&15]+t[e>>8*r&15];return n}function u(e){var t;for(t=0;tl?new ArrayBuffer(0):(i=l-c,s=new ArrayBuffer(i),a=new Uint8Array(s),o=new Uint8Array(this,c,i),a.set(o),s)}}(),p.prototype.append=function(e){return this.appendBinary(c(e)),this},p.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,i=this._buff.length;for(t=64;t<=i;t+=64)r(this._hash,n(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},p.prototype.end=function(e){var t,r,n=this._buff,i=n.length,s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t>2]|=n.charCodeAt(t)<<(t%4<<3);return this._finish(s,i),r=u(this._hash),e&&(r=f(r)),this.reset(),r},p.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},p.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},p.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},p.prototype._finish=function(e,t){var n,i,s,a=t;if(e[a>>2]|=128<<(a%4<<3),a>55)for(r(this._hash,e),a=0;a<16;a+=1)e[a]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(n[2],16),s=parseInt(n[1],16)||0,e[14]=i,e[15]=s,r(this._hash,e)},p.hash=function(e,t){return p.hashBinary(c(e),t)},p.hashBinary=function(e,t){var r=u(s(e));return t?f(r):r},p.ArrayBuffer=function(){this.reset()},p.ArrayBuffer.prototype.append=function(e){var t,n=h(this._buff.buffer,e,!0),s=n.length;for(this._length+=e.byteLength,t=64;t<=s;t+=64)r(this._hash,i(n.subarray(t-64,t)));return this._buff=t-64>2]|=n[t]<<(t%4<<3);return this._finish(s,i),r=u(this._hash),e&&(r=f(r)),this.reset(),r},p.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},p.ArrayBuffer.prototype.getState=function(){var e=p.prototype.getState.call(this);return e.buff=d(e.buff),e},p.ArrayBuffer.prototype.setState=function(e){return e.buff=l(e.buff,!0),p.prototype.setState.call(this,e)},p.ArrayBuffer.prototype.destroy=p.prototype.destroy,p.ArrayBuffer.prototype._finish=p.prototype._finish,p.ArrayBuffer.hash=function(e,t){var r=u(a(new Uint8Array(e)));return t?f(r):r},p}()},611775:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version=t.validate=t.v7=t.v6ToV1=t.v6=t.v5=t.v4=t.v3=t.v1ToV6=t.v1=t.stringify=t.parse=t.NIL=t.MAX=void 0;var n=r(559253);Object.defineProperty(t,"MAX",{enumerable:!0,get:function(){return n.default}});var i=r(632392);Object.defineProperty(t,"NIL",{enumerable:!0,get:function(){return i.default}});var s=r(835848);Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return s.default}});var a=r(409958);Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return a.default}});var o=r(673598);Object.defineProperty(t,"v1",{enumerable:!0,get:function(){return o.default}});var u=r(703831);Object.defineProperty(t,"v1ToV6",{enumerable:!0,get:function(){return u.default}});var c=r(129140);Object.defineProperty(t,"v3",{enumerable:!0,get:function(){return c.default}});var l=r(756737);Object.defineProperty(t,"v4",{enumerable:!0,get:function(){return l.default}});var d=r(865810);Object.defineProperty(t,"v5",{enumerable:!0,get:function(){return d.default}});var h=r(72607);Object.defineProperty(t,"v6",{enumerable:!0,get:function(){return h.default}});var f=r(29923);Object.defineProperty(t,"v6ToV1",{enumerable:!0,get:function(){return f.default}});var p=r(537992);Object.defineProperty(t,"v7",{enumerable:!0,get:function(){return p.default}});var g=r(203389);Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return g.default}});var m=r(806159);Object.defineProperty(t,"version",{enumerable:!0,get:function(){return m.default}})},559253:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="ffffffff-ffff-ffff-ffff-ffffffffffff"},813495:(e,t)=>{"use strict";function r(e){return 14+(e+64>>>9<<4)+1}function n(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function i(e,t,r,i,s,a){return n((o=n(n(t,e),n(i,a)))<<(u=s)|o>>>32-u,r);var o,u}function s(e,t,r,n,s,a,o){return i(t&r|~t&n,e,t,s,a,o)}function a(e,t,r,n,s,a,o){return i(t&n|r&~n,e,t,s,a,o)}function o(e,t,r,n,s,a,o){return i(t^r^n,e,t,s,a,o)}function u(e,t,r,n,s,a,o){return i(r^(t|~n),e,t,s,a,o)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(e){const t=new Uint8Array(4*e.length);for(let r=0;r<4*e.length;r++)t[r]=e[r>>2]>>>r%4*8&255;return t}(function(e,t){const i=new Uint32Array(r(t)).fill(0);i.set(e),i[t>>5]|=128<>2]|=(255&e[r])<{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);t.default={randomUUID:r}},632392:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default="00000000-0000-0000-0000-000000000000"},835848:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(203389);t.default=function(e){if(!(0,n.default)(e))throw TypeError("Invalid UUID");let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,255&t,(t=parseInt(e.slice(9,13),16))>>>8,255&t,(t=parseInt(e.slice(14,18),16))>>>8,255&t,(t=parseInt(e.slice(19,23),16))>>>8,255&t,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,255&t)}},367256:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i},876954:(e,t)=>{"use strict";let r;Object.defineProperty(t,"__esModule",{value:!0});const n=new Uint8Array(16);t.default=function(){if(!r){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");r=crypto.getRandomValues.bind(crypto)}return r(n)}},826786:(e,t)=>{"use strict";function r(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function n(e,t){return e<>>32-t}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520],s=new Uint8Array(e.length+1);s.set(e),s[e.length]=128;const a=(e=s).length/4+2,o=Math.ceil(a/16),u=new Array(o);for(let t=0;t>>0;d=l,l=c,c=n(o,30)>>>0,o=a,a=u}i[0]=i[0]+a>>>0,i[1]=i[1]+o>>>0,i[2]=i[2]+c>>>0,i[3]=i[3]+l>>>0,i[4]=i[4]+d>>>0}return Uint8Array.of(i[0]>>24,i[0]>>16,i[0]>>8,i[0],i[1]>>24,i[1]>>16,i[1]>>8,i[1],i[2]>>24,i[2]>>16,i[2]>>8,i[2],i[3]>>24,i[3]>>16,i[3]>>8,i[3],i[4]>>24,i[4]>>16,i[4]>>8,i[4])}},409958:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.unsafeStringify=void 0;const n=r(203389),i=[];for(let e=0;e<256;++e)i.push((e+256).toString(16).slice(1));function s(e,t=0){return(i[e[t+0]]+i[e[t+1]]+i[e[t+2]]+i[e[t+3]]+"-"+i[e[t+4]]+i[e[t+5]]+"-"+i[e[t+6]]+i[e[t+7]]+"-"+i[e[t+8]]+i[e[t+9]]+"-"+i[e[t+10]]+i[e[t+11]]+i[e[t+12]]+i[e[t+13]]+i[e[t+14]]+i[e[t+15]]).toLowerCase()}t.unsafeStringify=s,t.default=function(e,t=0){const r=s(e,t);if(!(0,n.default)(r))throw TypeError("Stringified UUID is invalid");return r}},673598:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateV1State=void 0;const n=r(876954),i=r(409958),s={};function a(e,t,r){var n,i;return null!==(n=e.msecs)&&void 0!==n||(e.msecs=-1/0),null!==(i=e.nsecs)&&void 0!==i||(e.nsecs=0),t===e.msecs?(e.nsecs++,e.nsecs>=1e4&&(e.node=void 0,e.nsecs=0)):t>e.msecs?e.nsecs=0:t= 16");if(s){if(a<0||a+16>s.length)throw new RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`)}else s=new Uint8Array(16),a=0;null!=t||(t=Date.now()),null!=r||(r=0),null!=n||(n=16383&(e[8]<<8|e[9])),null!=i||(i=e.slice(10,16));const o=(1e4*(268435455&(t+=122192928e5))+r)%4294967296;s[a++]=o>>>24&255,s[a++]=o>>>16&255,s[a++]=o>>>8&255,s[a++]=255&o;const u=t/4294967296*1e4&268435455;s[a++]=u>>>8&255,s[a++]=255&u,s[a++]=u>>>24&15|16,s[a++]=u>>>16&255,s[a++]=n>>>8|128,s[a++]=255&n;for(let e=0;e<6;++e)s[a++]=i[e];return s}t.updateV1State=a,t.default=function(e,t,r){var u,c;let l;const d=null!==(u=null===(c=e)||void 0===c?void 0:c._v6)&&void 0!==u&&u;if(e){const t=Object.keys(e);1===t.length&&"_v6"===t[0]&&(e=void 0)}if(e){var h,f,p,g;l=o(null!==(h=null!==(f=e.random)&&void 0!==f?f:null===(p=(g=e).rng)||void 0===p?void 0:p.call(g))&&void 0!==h?h:(0,n.default)(),e.msecs,e.nsecs,e.clockseq,e.node,t,r)}else{const e=Date.now(),i=(0,n.default)();a(s,e,i),l=o(i,s.msecs,s.nsecs,d?void 0:s.clockseq,d?void 0:s.node,t,r)}return null!=t?t:(0,i.unsafeStringify)(l)}},703831:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(835848),i=r(409958);t.default=function(e){const t=function(e){return Uint8Array.of((15&e[6])<<4|e[7]>>4&15,(15&e[7])<<4|(240&e[4])>>4,(15&e[4])<<4|(240&e[5])>>4,(15&e[5])<<4|(240&e[0])>>4,(15&e[0])<<4|(240&e[1])>>4,(15&e[1])<<4|(240&e[2])>>4,96|15&e[2],e[3],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}("string"==typeof e?(0,n.default)(e):e);return"string"==typeof e?(0,i.unsafeStringify)(t):t}},129140:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0;const n=r(813495),i=r(245345);var s=r(245345);function a(e,t,r,s){return(0,i.default)(48,n.default,e,t,r,s)}Object.defineProperty(t,"DNS",{enumerable:!0,get:function(){return s.DNS}}),Object.defineProperty(t,"URL",{enumerable:!0,get:function(){return s.URL}}),a.DNS=i.DNS,a.URL=i.URL,t.default=a},245345:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=t.stringToBytes=void 0;const n=r(835848),i=r(409958);function s(e){e=unescape(encodeURIComponent(e));const t=new Uint8Array(e.length);for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(525612),i=r(876954),s=r(409958);t.default=function(e,t,r){var a,o,u,c;if(n.default.randomUUID&&!t&&!e)return n.default.randomUUID();const l=null!==(a=null!==(o=(e=e||{}).random)&&void 0!==o?o:null===(u=(c=e).rng)||void 0===u?void 0:u.call(c))&&void 0!==a?a:(0,i.default)();if(l.length<16)throw new Error("Random bytes length must be >= 16");if(l[6]=15&l[6]|64,l[8]=63&l[8]|128,t){if((r=r||0)<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[r+e]=l[e];return t}return(0,s.unsafeStringify)(l)}},865810:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URL=t.DNS=void 0;const n=r(826786),i=r(245345);var s=r(245345);function a(e,t,r,s){return(0,i.default)(80,n.default,e,t,r,s)}Object.defineProperty(t,"DNS",{enumerable:!0,get:function(){return s.DNS}}),Object.defineProperty(t,"URL",{enumerable:!0,get:function(){return s.URL}}),a.DNS=i.DNS,a.URL=i.URL,t.default=a},72607:(e,t,r)=>{"use strict";var n=r(443693);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(835848),i=r(409958);t.default=function(e){const t=function(e){return Uint8Array.of((15&e[3])<<4|e[4]>>4&15,(15&e[4])<<4|(240&e[5])>>4,(15&e[5])<<4|15&e[6],e[7],(15&e[1])<<4|(240&e[2])>>4,(15&e[2])<<4|(240&e[3])>>4,16|(240&e[0])>>4,(15&e[0])<<4|(240&e[1])>>4,e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}("string"==typeof e?(0,n.default)(e):e);return"string"==typeof e?(0,i.unsafeStringify)(t):t}},537992:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateV7State=void 0;const n=r(876954),i=r(409958),s={};function a(e,t,r){var n,i;return null!==(n=e.msecs)&&void 0!==n||(e.msecs=-1/0),null!==(i=e.seq)&&void 0!==i||(e.seq=0),t>e.msecs?(e.seq=r[6]<<23|r[7]<<16|r[8]<<8|r[9],e.msecs=t):(e.seq=e.seq+1|0,0===e.seq&&e.msecs++),e}function o(e,t,r,n,i=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(n){if(i<0||i+16>n.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`)}else n=new Uint8Array(16),i=0;return null!=t||(t=Date.now()),null!=r||(r=127*e[6]<<24|e[7]<<16|e[8]<<8|e[9]),n[i++]=t/1099511627776&255,n[i++]=t/4294967296&255,n[i++]=t/16777216&255,n[i++]=t/65536&255,n[i++]=t/256&255,n[i++]=255&t,n[i++]=112|r>>>28&15,n[i++]=r>>>20&255,n[i++]=128|r>>>14&63,n[i++]=r>>>6&255,n[i++]=r<<2&255|3&e[10],n[i++]=e[11],n[i++]=e[12],n[i++]=e[13],n[i++]=e[14],n[i++]=e[15],n}t.updateV7State=a,t.default=function(e,t,r){let u;if(e){var c,l,d;u=o(null!==(c=null!==(l=e.random)&&void 0!==l?l:null===(d=e.rng)||void 0===d?void 0:d.call(e))&&void 0!==c?c:(0,n.default)(),e.msecs,e.seq,t,r)}else{const e=Date.now(),i=(0,n.default)();a(s,e,i),u=o(i,s.msecs,s.seq,t,r)}return null!=t?t:(0,i.unsafeStringify)(u)}},203389:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(367256);t.default=function(e){return"string"==typeof e&&n.default.test(e)}},806159:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(203389);t.default=function(e){if(!(0,n.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)}},512955:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>c});var n={};r.r(n),r.d(n,{BRAND:()=>o.qt,DIRTY:()=>s.jm,EMPTY_PATH:()=>s.I3,INVALID:()=>s.uY,NEVER:()=>o.tm,OK:()=>s.OK,ParseStatus:()=>s.MY,Schema:()=>o.Sj,ZodAny:()=>o.Ml,ZodArray:()=>o.n,ZodBigInt:()=>o.Lr,ZodBoolean:()=>o.WF,ZodBranded:()=>o.eN,ZodCatch:()=>o.hw,ZodDate:()=>o.aP,ZodDefault:()=>o.Xi,ZodDiscriminatedUnion:()=>o.jv,ZodEffects:()=>o.k1,ZodEnum:()=>o.Vb,ZodError:()=>u.G,ZodFirstPartyTypeKind:()=>o.kY,ZodFunction:()=>o.CZ,ZodIntersection:()=>o.Jv,ZodIssueCode:()=>u.eq,ZodLazy:()=>o.Ih,ZodLiteral:()=>o.DN,ZodMap:()=>o.Ut,ZodNaN:()=>o.Tq,ZodNativeEnum:()=>o.WM,ZodNever:()=>o.iS,ZodNull:()=>o.PQ,ZodNullable:()=>o.l1,ZodNumber:()=>o.rS,ZodObject:()=>o.bv,ZodOptional:()=>o.Ii,ZodParsedType:()=>a.Zp,ZodPipeline:()=>o._c,ZodPromise:()=>o.$i,ZodReadonly:()=>o.EV,ZodRecord:()=>o.b8,ZodSchema:()=>o.lK,ZodSet:()=>o.Kz,ZodString:()=>o.ND,ZodSymbol:()=>o.K5,ZodTransformer:()=>o.BG,ZodTuple:()=>o.y0,ZodType:()=>o.aR,ZodUndefined:()=>o._Z,ZodUnion:()=>o.fZ,ZodUnknown:()=>o._,ZodVoid:()=>o.a0,addIssueToContext:()=>s.zn,any:()=>o.bz,array:()=>o.YO,bigint:()=>o.o,boolean:()=>o.zM,coerce:()=>o.au,custom:()=>o.Ie,date:()=>o.p6,datetimeRegex:()=>o.fm,defaultErrorMap:()=>i.su,discriminatedUnion:()=>o.gM,effect:()=>o.QZ,enum:()=>o.k5,function:()=>o.fH,getErrorMap:()=>i.$W,getParsedType:()=>a.CR,instanceof:()=>o.Nl,intersection:()=>o.E$,isAborted:()=>s.G4,isAsync:()=>s.xP,isDirty:()=>s.DM,isValid:()=>s.fn,late:()=>o.fn,lazy:()=>o.RZ,literal:()=>o.eu,makeIssue:()=>s.y7,map:()=>o.Tj,nan:()=>o.oi,nativeEnum:()=>o.fc,never:()=>o.Zm,null:()=>o.ch,nullable:()=>o.me,number:()=>o.ai,object:()=>o.Ik,objectUtil:()=>a.o6,oboolean:()=>o.yN,onumber:()=>o.p7,optional:()=>o.lq,ostring:()=>o.Di,pipeline:()=>o.Tk,preprocess:()=>o.vk,promise:()=>o.iv,quotelessJson:()=>u.WI,record:()=>o.g1,set:()=>o.hZ,setErrorMap:()=>i.pJ,strictObject:()=>o.re,string:()=>o.Yj,symbol:()=>o.HR,transformer:()=>o.Gu,tuple:()=>o.PV,undefined:()=>o.Vx,union:()=>o.KC,unknown:()=>o.L5,util:()=>a.ZS,void:()=>o.rI});var i=r(557698),s=r(98332),a=r(290783),o=r(115633),u=r(13212);const c=n},13212:(e,t,r)=>{"use strict";r.d(t,{G:()=>a,WI:()=>s,eq:()=>i});var n=r(290783);const i=n.ZS.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),s=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class a extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const i of e.issues)if("invalid_union"===i.code)i.unionErrors.map(n);else if("invalid_return_type"===i.code)n(i.returnTypeError);else if("invalid_arguments"===i.code)n(i.argumentsError);else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;ne.message)){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}a.create=e=>new a(e)},557698:(e,t,r)=>{"use strict";r.d(t,{$W:()=>a,pJ:()=>s,su:()=>n.A});var n=r(294954);let i=n.A;function s(e){i=e}function a(){return i}},98332:(e,t,r)=>{"use strict";r.d(t,{DM:()=>m,G4:()=>g,I3:()=>c,MY:()=>d,OK:()=>p,fn:()=>v,jm:()=>f,uY:()=>h,xP:()=>y,y7:()=>u,zn:()=>l});var n=r(364467),i=r(557698),s=r(294954);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t{const{data:t,path:r,errorMaps:n,issueData:i}=e,s=[...r,...i.path||[]],a=o(o({},i),{},{path:s});if(void 0!==i.message)return o(o({},i),{},{path:s,message:i.message});let u="";const c=n.filter((e=>!!e)).slice().reverse();for(const e of c)u=e(a,{data:t,defaultError:u}).message;return o(o({},i),{},{path:s,message:u})},c=[];function l(e,t){const r=(0,i.$W)(),n=u({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===s.A?void 0:s.A].filter((e=>!!e))});e.common.issues.push(n)}class d{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return h;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,n=await e.value;r.push({key:t,value:n})}return d.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:i}=n;if("aborted"===t.status)return h;if("aborted"===i.status)return h;"dirty"===t.status&&e.dirty(),"dirty"===i.status&&e.dirty(),"__proto__"===t.value||void 0===i.value&&!n.alwaysSet||(r[t.value]=i.value)}return{status:e.value,value:r}}}const h=Object.freeze({status:"aborted"}),f=e=>({status:"dirty",value:e}),p=e=>({status:"valid",value:e}),g=e=>"aborted"===e.status,m=e=>"dirty"===e.status,v=e=>"valid"===e.status,y=e=>"undefined"!=typeof Promise&&e instanceof Promise},290783:(e,t,r)=>{"use strict";r.d(t,{CR:()=>c,ZS:()=>n,Zp:()=>u,o6:()=>i});var n,i,s=r(364467);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(n||(n={})),function(e){e.mergeShapes=(e,t)=>o(o({},e),t)}(i||(i={}));const u=n.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),c=e=>{switch(typeof e){case"undefined":return u.undefined;case"string":return u.string;case"number":return Number.isNaN(e)?u.nan:u.number;case"boolean":return u.boolean;case"function":return u.function;case"bigint":return u.bigint;case"symbol":return u.symbol;case"object":return Array.isArray(e)?u.array:null===e?u.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?u.promise:"undefined"!=typeof Map&&e instanceof Map?u.map:"undefined"!=typeof Set&&e instanceof Set?u.set:"undefined"!=typeof Date&&e instanceof Date?u.date:u.object;default:return u.unknown}}},294954:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});var n=r(13212),i=r(290783);const s=(e,t)=>{let r;switch(e.code){case n.eq.invalid_type:r=e.received===i.Zp.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case n.eq.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,i.ZS.jsonStringifyReplacer)}`;break;case n.eq.unrecognized_keys:r=`Unrecognized key(s) in object: ${i.ZS.joinValues(e.keys,", ")}`;break;case n.eq.invalid_union:r="Invalid input";break;case n.eq.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${i.ZS.joinValues(e.options)}`;break;case n.eq.invalid_enum_value:r=`Invalid enum value. Expected ${i.ZS.joinValues(e.options)}, received '${e.received}'`;break;case n.eq.invalid_arguments:r="Invalid function arguments";break;case n.eq.invalid_return_type:r="Invalid function return type";break;case n.eq.invalid_date:r="Invalid date";break;case n.eq.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:i.ZS.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case n.eq.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case n.eq.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case n.eq.custom:r="Invalid input";break;case n.eq.invalid_intersection_types:r="Intersection results could not be merged";break;case n.eq.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case n.eq.not_finite:r="Number must be finite";break;default:r=t.defaultError,i.ZS.assertNever(e)}return{message:r}}},115633:(e,t,r)=>{"use strict";r.d(t,{qt:()=>_e,tm:()=>pt,Sj:()=>g,Ml:()=>q,n:()=>W,Lr:()=>U,WF:()=>V,eN:()=>Se,hw:()=>Ee,aP:()=>B,Xi:()=>ye,jv:()=>te,k1:()=>ge,Vb:()=>he,kY:()=>Te,CZ:()=>ue,Jv:()=>ne,Ih:()=>ce,DN:()=>le,Ut:()=>ae,Tq:()=>be,WM:()=>fe,iS:()=>Y,PQ:()=>z,l1:()=>ve,rS:()=>$,bv:()=>Q,Ii:()=>me,_c:()=>Oe,$i:()=>pe,EV:()=>Ae,b8:()=>se,lK:()=>g,Kz:()=>oe,ND:()=>k,K5:()=>Z,BG:()=>ge,y0:()=>ie,aR:()=>g,_Z:()=>K,fZ:()=>X,_:()=>G,a0:()=>H,bz:()=>$e,YO:()=>Ze,o:()=>je,zM:()=>xe,au:()=>ft,Ie:()=>Ce,p6:()=>De,fm:()=>x,gM:()=>Ge,QZ:()=>st,k5:()=>rt,fH:()=>Xe,Nl:()=>Ne,E$:()=>Ye,fn:()=>Ie,RZ:()=>et,eu:()=>tt,Tj:()=>Je,oi:()=>Le,fc:()=>nt,Zm:()=>Ve,ch:()=>Fe,me:()=>ot,ai:()=>Pe,Ik:()=>Ke,yN:()=>ht,p7:()=>dt,lq:()=>at,Di:()=>lt,Tk:()=>ct,vk:()=>ut,iv:()=>it,g1:()=>We,hZ:()=>Qe,re:()=>ze,Yj:()=>Re,HR:()=>Me,Gu:()=>st,PV:()=>He,Vx:()=>ke,KC:()=>qe,L5:()=>Ue,rI:()=>Be});var n,i=r(364467),s=r(13212),a=r(557698),o=r(294954);!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(n||(n={}));var u=r(98332),c=r(290783);function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function d(e){for(var t=1;t{if((0,u.fn)(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new s.G(e.common.issues);return this._error=t,this._error}}};function p(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:i}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:i};return{errorMap:(t,i)=>{var s;const{message:a}=e;return"invalid_enum_value"===t.code?{message:null!=a?a:i.defaultError}:void 0===i.data?{message:null!==(o=null!=a?a:n)&&void 0!==o?o:i.defaultError}:"invalid_type"!==t.code?{message:i.defaultError}:{message:null!==(s=null!=a?a:r)&&void 0!==s?s:i.defaultError};var o},description:i}}class g{get description(){return this._def.description}_getType(e){return(0,c.CR)(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:(0,c.CR)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new u.MY,ctx:{common:e.parent.common,data:e.data,parsedType:(0,c.CR)(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if((0,u.xP)(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.CR)(e)},i=this._parseSync({data:e,path:n.path,parent:n});return f(n,i)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.CR)(e)};if(!this["~standard"].async)try{const r=this._parseSync({data:e,path:[],parent:t});return(0,u.fn)(r)?{value:r.value}:{issues:t.common.issues}}catch(e){var r;null!=e&&null!==(r=e.message)&&void 0!==r&&null!==(r=r.toLowerCase())&&void 0!==r&&r.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>(0,u.fn)(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:(0,c.CR)(e)},n=this._parse({data:e,path:r.path,parent:r}),i=await((0,u.xP)(n)?n:Promise.resolve(n));return f(r,i)}refine(e,t){return this._refinement(((r,n)=>{const i=e(r),a=()=>n.addIssue(d({code:s.eq.custom},(e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t)(r)));return"undefined"!=typeof Promise&&i instanceof Promise?i.then((e=>!!e||(a(),!1))):!!i||(a(),!1)}))}refinement(e,t){return this._refinement(((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1)))}_refinement(e){return new ge({schema:this,typeName:Te.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return me.create(this,this._def)}nullable(){return ve.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return W.create(this)}promise(){return pe.create(this,this._def)}or(e){return X.create([this,e],this._def)}and(e){return ne.create(this,e,this._def)}transform(e){return new ge(d(d({},p(this._def)),{},{schema:this,typeName:Te.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){const t="function"==typeof e?e:()=>e;return new ye(d(d({},p(this._def)),{},{innerType:this,defaultValue:t,typeName:Te.ZodDefault}))}brand(){return new Se(d({typeName:Te.ZodBranded,type:this},p(this._def)))}catch(e){const t="function"==typeof e?e:()=>e;return new Ee(d(d({},p(this._def)),{},{innerType:this,catchValue:t,typeName:Te.ZodCatch}))}describe(e){return new(0,this.constructor)(d(d({},this._def),{},{description:e}))}pipe(e){return Oe.create(this,e)}readonly(){return Ae.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const m=/^c[^\s-]{8,}$/i,v=/^[0-9a-z]+$/,y=/^[0-9A-HJKMNP-TV-Z]{26}$/i,E=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,b=/^[a-z0-9_-]{21}$/i,_=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,S=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,O=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let A;const w=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,C=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,I=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,T=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,N=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,R=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,P="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",L=new RegExp(`^${P}$`);function j(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function x(e){let t=`${P}T${j(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function D(e,t){if(!_.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return"object"==typeof i&&null!==i&&((!("typ"in i)||"JWT"===(null==i?void 0:i.typ))&&(!!i.alg&&(!t||i.alg===t)))}catch(e){return!1}}function M(e,t){return!("v4"!==t&&t||!C.test(e))||!("v6"!==t&&t||!T.test(e))}class k extends g{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==c.Zp.string){const t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:s.eq.invalid_type,expected:c.Zp.string,received:t.parsedType}),u.uY}const t=new u.MY;let r;for(const a of this._def.checks)if("min"===a.kind)e.data.lengtha.value&&(r=this._getOrReturnCtx(e,r),(0,u.zn)(r,{code:s.eq.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("length"===a.kind){const n=e.data.length>a.value,i=e.data.lengthe.test(t)),d({validation:t,code:s.eq.invalid_string},n.errToObj(r)))}_addCheck(e){return new k(d(d({},this._def),{},{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(d({kind:"email"},n.errToObj(e)))}url(e){return this._addCheck(d({kind:"url"},n.errToObj(e)))}emoji(e){return this._addCheck(d({kind:"emoji"},n.errToObj(e)))}uuid(e){return this._addCheck(d({kind:"uuid"},n.errToObj(e)))}nanoid(e){return this._addCheck(d({kind:"nanoid"},n.errToObj(e)))}cuid(e){return this._addCheck(d({kind:"cuid"},n.errToObj(e)))}cuid2(e){return this._addCheck(d({kind:"cuid2"},n.errToObj(e)))}ulid(e){return this._addCheck(d({kind:"ulid"},n.errToObj(e)))}base64(e){return this._addCheck(d({kind:"base64"},n.errToObj(e)))}base64url(e){return this._addCheck(d({kind:"base64url"},n.errToObj(e)))}jwt(e){return this._addCheck(d({kind:"jwt"},n.errToObj(e)))}ip(e){return this._addCheck(d({kind:"ip"},n.errToObj(e)))}cidr(e){return this._addCheck(d({kind:"cidr"},n.errToObj(e)))}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(d({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r},n.errToObj(null==e?void 0:e.message)))}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(d({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision},n.errToObj(null==e?void 0:e.message)))}duration(e){return this._addCheck(d({kind:"duration"},n.errToObj(e)))}regex(e,t){return this._addCheck(d({kind:"regex",regex:e},n.errToObj(t)))}includes(e,t){return this._addCheck(d({kind:"includes",value:e,position:null==t?void 0:t.position},n.errToObj(null==t?void 0:t.message)))}startsWith(e,t){return this._addCheck(d({kind:"startsWith",value:e},n.errToObj(t)))}endsWith(e,t){return this._addCheck(d({kind:"endsWith",value:e},n.errToObj(t)))}min(e,t){return this._addCheck(d({kind:"min",value:e},n.errToObj(t)))}max(e,t){return this._addCheck(d({kind:"max",value:e},n.errToObj(t)))}length(e,t){return this._addCheck(d({kind:"length",value:e},n.errToObj(t)))}nonempty(e){return this.min(1,n.errToObj(e))}trim(){return new k(d(d({},this._def),{},{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new k(d(d({},this._def),{},{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new k(d(d({},this._def),{},{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuen?r:n;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}k.create=e=>{var t;return new k(d({checks:[],typeName:Te.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t},p(e)))};class $ extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==c.Zp.number){const t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:s.eq.invalid_type,expected:c.Zp.number,received:t.parsedType}),u.uY}let t;const r=new u.MY;for(const n of this._def.checks)if("int"===n.kind)c.ZS.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),(0,u.zn)(t,{code:s.eq.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty());else if("min"===n.kind){(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,u.zn)(t,{code:s.eq.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else"multipleOf"===n.kind?0!==F(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),(0,u.zn)(t,{code:s.eq.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),(0,u.zn)(t,{code:s.eq.not_finite,message:n.message}),r.dirty()):c.ZS.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,n.toString(t))}gt(e,t){return this.setLimit("min",e,!1,n.toString(t))}lte(e,t){return this.setLimit("max",e,!0,n.toString(t))}lt(e,t){return this.setLimit("max",e,!1,n.toString(t))}setLimit(e,t,r,i){return new $(d(d({},this._def),{},{checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:n.toString(i)}]}))}_addCheck(e){return new $(d(d({},this._def),{},{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:n.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:n.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:n.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:n.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:n.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:n.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:n.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:n.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:n.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&c.ZS.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.valuenew $(d({checks:[],typeName:Te.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1},p(e)));class U extends g{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(t){return this._getInvalidInput(e)}if(this._getType(e)!==c.Zp.bigint)return this._getInvalidInput(e);let t;const r=new u.MY;for(const n of this._def.checks)if("min"===n.kind){(n.inclusive?e.datan.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),(0,u.zn)(t,{code:s.eq.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty())}else"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),(0,u.zn)(t,{code:s.eq.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):c.ZS.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:s.eq.invalid_type,expected:c.Zp.bigint,received:t.parsedType}),u.uY}gte(e,t){return this.setLimit("min",e,!0,n.toString(t))}gt(e,t){return this.setLimit("min",e,!1,n.toString(t))}lte(e,t){return this.setLimit("max",e,!0,n.toString(t))}lt(e,t){return this.setLimit("max",e,!1,n.toString(t))}setLimit(e,t,r,i){return new U(d(d({},this._def),{},{checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:n.toString(i)}]}))}_addCheck(e){return new U(d(d({},this._def),{},{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:n.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:n.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:n.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:n.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:n.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value{var t;return new U(d({checks:[],typeName:Te.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t},p(e)))};class V extends g{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==c.Zp.boolean){const t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:s.eq.invalid_type,expected:c.Zp.boolean,received:t.parsedType}),u.uY}return(0,u.OK)(e.data)}}V.create=e=>new V(d({typeName:Te.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1},p(e)));class B extends g{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==c.Zp.date){const t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:s.eq.invalid_type,expected:c.Zp.date,received:t.parsedType}),u.uY}if(Number.isNaN(e.data.getTime())){const t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:s.eq.invalid_date}),u.uY}const t=new u.MY;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()n.value&&(r=this._getOrReturnCtx(e,r),(0,u.zn)(r,{code:s.eq.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):c.ZS.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new B(d(d({},this._def),{},{checks:[...this._def.checks,e]}))}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:n.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:n.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew B(d({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Te.ZodDate},p(e)));class Z extends g{_parse(e){if(this._getType(e)!==c.Zp.symbol){const t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:s.eq.invalid_type,expected:c.Zp.symbol,received:t.parsedType}),u.uY}return(0,u.OK)(e.data)}}Z.create=e=>new Z(d({typeName:Te.ZodSymbol},p(e)));class K extends g{_parse(e){if(this._getType(e)!==c.Zp.undefined){const t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:s.eq.invalid_type,expected:c.Zp.undefined,received:t.parsedType}),u.uY}return(0,u.OK)(e.data)}}K.create=e=>new K(d({typeName:Te.ZodUndefined},p(e)));class z extends g{_parse(e){if(this._getType(e)!==c.Zp.null){const t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:s.eq.invalid_type,expected:c.Zp.null,received:t.parsedType}),u.uY}return(0,u.OK)(e.data)}}z.create=e=>new z(d({typeName:Te.ZodNull},p(e)));class q extends g{constructor(){super(...arguments),this._any=!0}_parse(e){return(0,u.OK)(e.data)}}q.create=e=>new q(d({typeName:Te.ZodAny},p(e)));class G extends g{constructor(){super(...arguments),this._unknown=!0}_parse(e){return(0,u.OK)(e.data)}}G.create=e=>new G(d({typeName:Te.ZodUnknown},p(e)));class Y extends g{_parse(e){const t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:s.eq.invalid_type,expected:c.Zp.never,received:t.parsedType}),u.uY}}Y.create=e=>new Y(d({typeName:Te.ZodNever},p(e)));class H extends g{_parse(e){if(this._getType(e)!==c.Zp.undefined){const t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:s.eq.invalid_type,expected:c.Zp.void,received:t.parsedType}),u.uY}return(0,u.OK)(e.data)}}H.create=e=>new H(d({typeName:Te.ZodVoid},p(e)));class W extends g{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==c.Zp.array)return(0,u.zn)(t,{code:s.eq.invalid_type,expected:c.Zp.array,received:t.parsedType}),u.uY;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,i=t.data.lengthn.maxLength.value&&((0,u.zn)(t,{code:s.eq.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>n.type._parseAsync(new h(t,e,t.path,r))))).then((e=>u.MY.mergeArray(r,e)));const i=[...t.data].map(((e,r)=>n.type._parseSync(new h(t,e,t.path,r))));return u.MY.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new W(d(d({},this._def),{},{minLength:{value:e,message:n.toString(t)}}))}max(e,t){return new W(d(d({},this._def),{},{maxLength:{value:e,message:n.toString(t)}}))}length(e,t){return new W(d(d({},this._def),{},{exactLength:{value:e,message:n.toString(t)}}))}nonempty(e){return this.min(1,e)}}function J(e){if(e instanceof Q){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=me.create(J(n))}return new Q(d(d({},e._def),{},{shape:()=>t}))}return e instanceof W?new W(d(d({},e._def),{},{type:J(e.element)})):e instanceof me?me.create(J(e.unwrap())):e instanceof ve?ve.create(J(e.unwrap())):e instanceof ie?ie.create(e.items.map((e=>J(e)))):e}W.create=(e,t)=>new W(d({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Te.ZodArray},p(t)));class Q extends g{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=c.ZS.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==c.Zp.object){const t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:s.eq.invalid_type,expected:c.Zp.object,received:t.parsedType}),u.uY}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Y&&"strip"===this._def.unknownKeys))for(const e in r.data)i.includes(e)||a.push(e);const o=[];for(const e of i){const t=n[e],i=r.data[e];o.push({key:{status:"valid",value:e},value:t._parse(new h(r,i,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof Y){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of a)o.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)a.length>0&&((0,u.zn)(r,{code:s.eq.unrecognized_keys,keys:a}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of a){const n=r.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new h(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async function(){const e=[];for(const t of o){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e})).then((e=>u.MY.mergeObjectSync(t,e))):u.MY.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return n.errToObj,new Q(d(d({},this._def),{},{unknownKeys:"strict"},void 0!==e?{errorMap:(t,r)=>{var i,s,a,o;const u=null!==(i=null===(s=(a=this._def).errorMap)||void 0===s?void 0:s.call(a,t,r).message)&&void 0!==i?i:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(o=n.errToObj(e).message)&&void 0!==o?o:u}:{message:u}}}:{}))}strip(){return new Q(d(d({},this._def),{},{unknownKeys:"strip"}))}passthrough(){return new Q(d(d({},this._def),{},{unknownKeys:"passthrough"}))}extend(e){return new Q(d(d({},this._def),{},{shape:()=>d(d({},this._def.shape()),e)}))}merge(e){return new Q({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>d(d({},this._def.shape()),e._def.shape()),typeName:Te.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Q(d(d({},this._def),{},{catchall:e}))}pick(e){const t={};for(const r of c.ZS.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new Q(d(d({},this._def),{},{shape:()=>t}))}omit(e){const t={};for(const r of c.ZS.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new Q(d(d({},this._def),{},{shape:()=>t}))}deepPartial(){return J(this)}partial(e){const t={};for(const r of c.ZS.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new Q(d(d({},this._def),{},{shape:()=>t}))}required(e){const t={};for(const r of c.ZS.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof me;)e=e._def.innerType;t[r]=e}return new Q(d(d({},this._def),{},{shape:()=>t}))}keyof(){return de(c.ZS.objectKeys(this.shape))}}Q.create=(e,t)=>new Q(d({shape:()=>e,unknownKeys:"strip",catchall:Y.create(),typeName:Te.ZodObject},p(t))),Q.strictCreate=(e,t)=>new Q(d({shape:()=>e,unknownKeys:"strict",catchall:Y.create(),typeName:Te.ZodObject},p(t))),Q.lazycreate=(e,t)=>new Q(d({shape:e,unknownKeys:"strip",catchall:Y.create(),typeName:Te.ZodObject},p(t)));class X extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async function(e){const r=d(d({},t),{},{common:d(d({},t.common),{},{issues:[]}),parent:null});return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map((e=>new s.G(e.ctx.common.issues)));return(0,u.zn)(t,{code:s.eq.invalid_union,unionErrors:r}),u.uY}));{let e;const n=[];for(const i of r){const r=d(d({},t),{},{common:d(d({},t.common),{},{issues:[]}),parent:null}),s=i._parseSync({data:t.data,path:t.path,parent:r});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=n.map((e=>new s.G(e)));return(0,u.zn)(t,{code:s.eq.invalid_union,unionErrors:i}),u.uY}}get options(){return this._def.options}}X.create=(e,t)=>new X(d({options:e,typeName:Te.ZodUnion},p(t)));const ee=e=>e instanceof ce?ee(e.schema):e instanceof ge?ee(e.innerType()):e instanceof le?[e.value]:e instanceof he?e.options:e instanceof fe?c.ZS.objectValues(e.enum):e instanceof ye?ee(e._def.innerType):e instanceof K?[void 0]:e instanceof z?[null]:e instanceof me?[void 0,...ee(e.unwrap())]:e instanceof ve?[null,...ee(e.unwrap())]:e instanceof Se||e instanceof Ae?ee(e.unwrap()):e instanceof Ee?ee(e._def.innerType):[];class te extends g{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.Zp.object)return(0,u.zn)(t,{code:s.eq.invalid_type,expected:c.Zp.object,received:t.parsedType}),u.uY;const r=this.discriminator,n=t.data[r],i=this.optionsMap.get(n);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):((0,u.zn)(t,{code:s.eq.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),u.uY)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const r of t){const t=ee(r.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const i of t){if(n.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);n.set(i,r)}}return new te(d({typeName:Te.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n},p(r)))}}function re(e,t){const r=(0,c.CR)(e),n=(0,c.CR)(t);if(e===t)return{valid:!0,data:e};if(r===c.Zp.object&&n===c.Zp.object){const r=c.ZS.objectKeys(t),n=c.ZS.objectKeys(e).filter((e=>-1!==r.indexOf(e))),i=d(d({},e),t);for(const r of n){const n=re(e[r],t[r]);if(!n.valid)return{valid:!1};i[r]=n.data}return{valid:!0,data:i}}if(r===c.Zp.array&&n===c.Zp.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n{if((0,u.G4)(e)||(0,u.G4)(n))return u.uY;const i=re(e.value,n.value);return i.valid?(((0,u.DM)(e)||(0,u.DM)(n))&&t.dirty(),{status:t.value,value:i.data}):((0,u.zn)(r,{code:s.eq.invalid_intersection_types}),u.uY)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}ne.create=(e,t,r)=>new ne(d({left:e,right:t,typeName:Te.ZodIntersection},p(r)));class ie extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.Zp.array)return(0,u.zn)(r,{code:s.eq.invalid_type,expected:c.Zp.array,received:r.parsedType}),u.uY;if(r.data.lengththis._def.items.length&&((0,u.zn)(r,{code:s.eq.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new h(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(n).then((e=>u.MY.mergeArray(t,e))):u.MY.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new ie(d(d({},this._def),{},{rest:e}))}}ie.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ie(d({items:e,typeName:Te.ZodTuple,rest:null},p(t)))};class se extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.Zp.object)return(0,u.zn)(r,{code:s.eq.invalid_type,expected:c.Zp.object,received:r.parsedType}),u.uY;const n=[],i=this._def.keyType,a=this._def.valueType;for(const e in r.data)n.push({key:i._parse(new h(r,e,r.path,e)),value:a._parse(new h(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?u.MY.mergeObjectAsync(t,n):u.MY.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new se(t instanceof g?d({keyType:e,valueType:t,typeName:Te.ZodRecord},p(r)):d({keyType:k.create(),valueType:e,typeName:Te.ZodRecord},p(t)))}}class ae extends g{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.Zp.map)return(0,u.zn)(r,{code:s.eq.invalid_type,expected:c.Zp.map,received:r.parsedType}),u.uY;const n=this._def.keyType,i=this._def.valueType,a=[...r.data.entries()].map((([e,t],s)=>({key:n._parse(new h(r,e,r.path,[s,"key"])),value:i._parse(new h(r,t,r.path,[s,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async function(){for(const r of a){const n=await r.key,i=await r.value;if("aborted"===n.status||"aborted"===i.status)return u.uY;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of a){const n=r.key,i=r.value;if("aborted"===n.status||"aborted"===i.status)return u.uY;"dirty"!==n.status&&"dirty"!==i.status||t.dirty(),e.set(n.value,i.value)}return{status:t.value,value:e}}}}ae.create=(e,t,r)=>new ae(d({valueType:t,keyType:e,typeName:Te.ZodMap},p(r)));class oe extends g{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==c.Zp.set)return(0,u.zn)(r,{code:s.eq.invalid_type,expected:c.Zp.set,received:r.parsedType}),u.uY;const n=this._def;null!==n.minSize&&r.data.sizen.maxSize.value&&((0,u.zn)(r,{code:s.eq.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const i=this._def.valueType;function a(e){const r=new Set;for(const n of e){if("aborted"===n.status)return u.uY;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const o=[...r.data.values()].map(((e,t)=>i._parse(new h(r,e,r.path,t))));return r.common.async?Promise.all(o).then((e=>a(e))):a(o)}min(e,t){return new oe(d(d({},this._def),{},{minSize:{value:e,message:n.toString(t)}}))}max(e,t){return new oe(d(d({},this._def),{},{maxSize:{value:e,message:n.toString(t)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}oe.create=(e,t)=>new oe(d({valueType:e,minSize:null,maxSize:null,typeName:Te.ZodSet},p(t)));class ue extends g{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.Zp.function)return(0,u.zn)(t,{code:s.eq.invalid_type,expected:c.Zp.function,received:t.parsedType}),u.uY;function r(e,r){return(0,u.y7)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,a.$W)(),o.A].filter((e=>!!e)),issueData:{code:s.eq.invalid_arguments,argumentsError:r}})}function n(e,r){return(0,u.y7)({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,(0,a.$W)(),o.A].filter((e=>!!e)),issueData:{code:s.eq.invalid_return_type,returnTypeError:r}})}const i={errorMap:t.common.contextualErrorMap},l=t.data;if(this._def.returns instanceof pe){const e=this;return(0,u.OK)((async function(...t){const a=new s.G([]),o=await e._def.args.parseAsync(t,i).catch((e=>{throw a.addIssue(r(t,e)),a})),u=await Reflect.apply(l,this,o);return await e._def.returns._def.type.parseAsync(u,i).catch((e=>{throw a.addIssue(n(u,e)),a}))}))}{const e=this;return(0,u.OK)((function(...t){const a=e._def.args.safeParse(t,i);if(!a.success)throw new s.G([r(t,a.error)]);const o=Reflect.apply(l,this,a.data),u=e._def.returns.safeParse(o,i);if(!u.success)throw new s.G([n(o,u.error)]);return u.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ue(d(d({},this._def),{},{args:ie.create(e).rest(G.create())}))}returns(e){return new ue(d(d({},this._def),{},{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ue(d({args:e||ie.create([]).rest(G.create()),returns:t||G.create(),typeName:Te.ZodFunction},p(r)))}}class ce extends g{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ce.create=(e,t)=>new ce(d({getter:e,typeName:Te.ZodLazy},p(t)));class le extends g{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return(0,u.zn)(t,{received:t.data,code:s.eq.invalid_literal,expected:this._def.value}),u.uY}return{status:"valid",value:e.data}}get value(){return this._def.value}}function de(e,t){return new he(d({values:e,typeName:Te.ZodEnum},p(t)))}le.create=(e,t)=>new le(d({value:e,typeName:Te.ZodLiteral},p(t)));class he extends g{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return(0,u.zn)(t,{expected:c.ZS.joinValues(r),received:t.parsedType,code:s.eq.invalid_type}),u.uY}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return(0,u.zn)(t,{received:t.data,code:s.eq.invalid_enum_value,options:r}),u.uY}return(0,u.OK)(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return he.create(e,d(d({},this._def),t))}exclude(e,t=this._def){return he.create(this.options.filter((t=>!e.includes(t))),d(d({},this._def),t))}}he.create=de;class fe extends g{_parse(e){const t=c.ZS.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==c.Zp.string&&r.parsedType!==c.Zp.number){const e=c.ZS.objectValues(t);return(0,u.zn)(r,{expected:c.ZS.joinValues(e),received:r.parsedType,code:s.eq.invalid_type}),u.uY}if(this._cache||(this._cache=new Set(c.ZS.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=c.ZS.objectValues(t);return(0,u.zn)(r,{received:r.data,code:s.eq.invalid_enum_value,options:e}),u.uY}return(0,u.OK)(e.data)}get enum(){return this._def.values}}fe.create=(e,t)=>new fe(d({values:e,typeName:Te.ZodNativeEnum},p(t)));class pe extends g{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==c.Zp.promise&&!1===t.common.async)return(0,u.zn)(t,{code:s.eq.invalid_type,expected:c.Zp.promise,received:t.parsedType}),u.uY;const r=t.parsedType===c.Zp.promise?t.data:Promise.resolve(t.data);return(0,u.OK)(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}pe.create=(e,t)=>new pe(d({type:e,typeName:Te.ZodPromise},p(t)));class ge extends g{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Te.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){var t=this;const{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,s={addIssue:e=>{(0,u.zn)(n,e),e.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===i.type){const e=i.transform(n.data,s);if(n.common.async)return Promise.resolve(e).then((async function(e){if("aborted"===r.value)return u.uY;const i=await t._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===i.status?u.uY:"dirty"===i.status||"dirty"===r.value?(0,u.jm)(i.value):i}));{if("aborted"===r.value)return u.uY;const t=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===t.status?u.uY:"dirty"===t.status||"dirty"===r.value?(0,u.jm)(t.value):t}}if("refinement"===i.type){const e=e=>{const t=i.refinement(e,s);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const t=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===t.status?u.uY:("dirty"===t.status&&r.dirty(),e(t.value),{status:r.value,value:t.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((t=>"aborted"===t.status?u.uY:("dirty"===t.status&&r.dirty(),e(t.value).then((()=>({status:r.value,value:t.value}))))))}if("transform"===i.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!(0,u.fn)(e))return u.uY;const t=i.transform(e.value,s);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:t}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>(0,u.fn)(e)?Promise.resolve(i.transform(e.value,s)).then((e=>({status:r.value,value:e}))):u.uY))}c.ZS.assertNever(i)}}ge.create=(e,t,r)=>new ge(d({schema:e,typeName:Te.ZodEffects,effect:t},p(r))),ge.createWithPreprocess=(e,t,r)=>new ge(d({schema:t,effect:{type:"preprocess",transform:e},typeName:Te.ZodEffects},p(r)));class me extends g{_parse(e){return this._getType(e)===c.Zp.undefined?(0,u.OK)(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}me.create=(e,t)=>new me(d({innerType:e,typeName:Te.ZodOptional},p(t)));class ve extends g{_parse(e){return this._getType(e)===c.Zp.null?(0,u.OK)(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ve.create=(e,t)=>new ve(d({innerType:e,typeName:Te.ZodNullable},p(t)));class ye extends g{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===c.Zp.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ye.create=(e,t)=>new ye(d({innerType:e,typeName:Te.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default},p(t)));class Ee extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=d(d({},t),{},{common:d(d({},t.common),{},{issues:[]})}),n=this._def.innerType._parse({data:r.data,path:r.path,parent:d({},r)});return(0,u.xP)(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new s.G(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new s.G(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Ee.create=(e,t)=>new Ee(d({innerType:e,typeName:Te.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch},p(t)));class be extends g{_parse(e){if(this._getType(e)!==c.Zp.nan){const t=this._getOrReturnCtx(e);return(0,u.zn)(t,{code:s.eq.invalid_type,expected:c.Zp.nan,received:t.parsedType}),u.uY}return{status:"valid",value:e.data}}}be.create=e=>new be(d({typeName:Te.ZodNaN},p(e)));const _e=Symbol("zod_brand");class Se extends g{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Oe extends g{_parse(e){var t=this;const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async){return async function(){const e=await t._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?u.uY:"dirty"===e.status?(r.dirty(),(0,u.jm)(e.value)):t._def.out._parseAsync({data:e.value,path:n.path,parent:n})}()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?u.uY:"dirty"===e.status?(r.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Oe({in:e,out:t,typeName:Te.ZodPipeline})}}class Ae extends g{_parse(e){const t=this._def.innerType._parse(e),r=e=>((0,u.fn)(e)&&(e.value=Object.freeze(e.value)),e);return(0,u.xP)(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}function we(e,t){const r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r}function Ce(e,t={},r){return e?q.create().superRefine(((n,i)=>{const s=e(n);if(s instanceof Promise)return s.then((e=>{if(!e){var s,a;const e=we(t,n),o=null===(s=null!==(a=e.fatal)&&void 0!==a?a:r)||void 0===s||s;i.addIssue(d(d({code:"custom"},e),{},{fatal:o}))}}));if(!s){var a,o;const e=we(t,n),s=null===(a=null!==(o=e.fatal)&&void 0!==o?o:r)||void 0===a||a;i.addIssue(d(d({code:"custom"},e),{},{fatal:s}))}})):q.create()}Ae.create=(e,t)=>new Ae(d({innerType:e,typeName:Te.ZodReadonly},p(t)));const Ie={object:Q.lazycreate};var Te;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Te||(Te={}));const Ne=(e,t={message:`Input not instance of ${e.name}`})=>Ce((t=>t instanceof e),t),Re=k.create,Pe=$.create,Le=be.create,je=U.create,xe=V.create,De=B.create,Me=Z.create,ke=K.create,Fe=z.create,$e=q.create,Ue=G.create,Ve=Y.create,Be=H.create,Ze=W.create,Ke=Q.create,ze=Q.strictCreate,qe=X.create,Ge=te.create,Ye=ne.create,He=ie.create,We=se.create,Je=ae.create,Qe=oe.create,Xe=ue.create,et=ce.create,tt=le.create,rt=he.create,nt=fe.create,it=pe.create,st=ge.create,at=me.create,ot=ve.create,ut=ge.createWithPreprocess,ct=Oe.create,lt=()=>Re().optional(),dt=()=>Pe().optional(),ht=()=>xe().optional(),ft={string:e=>k.create(d(d({},e),{},{coerce:!0})),number:e=>$.create(d(d({},e),{},{coerce:!0})),boolean:e=>V.create(d(d({},e),{},{coerce:!0})),bigint:e=>U.create(d(d({},e),{},{coerce:!0})),date:e=>B.create(d(d({},e),{},{coerce:!0}))},pt=u.uY},841461:e=>{"use strict";e.exports=JSON.parse('{"name":"@eppo/js-client-sdk-common","version":"4.14.4","description":"Common library for Eppo JavaScript SDKs (web, react native, and node)","main":"dist/index.js","files":["/dist","/src","!*.spec.ts"],"types":"./dist/index.d.ts","engines":{"node":">=18.x"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"lint":"eslint \'**/*.{ts,tsx}\' --cache","lint:fix":"eslint --fix \'**/*.{ts,tsx}\' --cache","lint:fix-pre-commit":"eslint -c .eslintrc.pre-commit.js --fix \'**/*.{ts,tsx}\' --no-eslintrc --cache","prepare":"make prepare","pre-commit":"lint-staged && tsc","typecheck":"tsc","test":"yarn test:unit","test:unit":"NODE_ENV=test jest \'.*\\\\.spec\\\\.ts\'","obfuscate-mock-ufc":"ts-node test/writeObfuscatedMockUFC"},"jsdelivr":"dist/eppo-sdk.js","repository":{"type":"git","url":"git+https://github.com/Eppo-exp/js-client-sdk-common.git"},"author":"","license":"MIT","bugs":{"url":"https://github.com/Eppo-exp/js-client-sdk-common/issues"},"homepage":"https://github.com/Eppo-exp/js-client-sdk-common#readme","devDependencies":{"@types/jest":"^29.5.11","@types/js-base64":"^3.3.1","@types/lodash":"^4.17.5","@types/semver":"^7.5.6","@types/spark-md5":"^3.0.5","@types/uuid":"^10.0.0","@typescript-eslint/eslint-plugin":"^5.13.0","@typescript-eslint/parser":"^5.13.0","eslint":"^8.17.0","eslint-config-prettier":"^10.0.1","eslint-import-resolver-typescript":"^3.7.0","eslint-plugin-import":"^2.25.4","eslint-plugin-prettier":"5.2.3","eslint-plugin-promise":"^7.2.1","eslint-plugin-unused-imports":"^4.1.4","jest":"^29.7.0","jest-environment-jsdom":"^29.7.0","lodash":"^4.17.21","prettier":"^3.4.2","prettier-eslint":"^16.3.0","terser-webpack-plugin":"^5.3.3","testdouble":"^3.20.1","ts-jest":"^29.1.1","ts-loader":"^9.3.1","ts-node":"^10.9.1","typescript":"^5.7.2","webpack":"^5.73.0","webpack-cli":"^6.0.1"},"dependencies":{"buffer":"npm:@eppo/buffer@6.2.0","js-base64":"^3.7.7","pino":"^9.5.0","semver":"^7.5.4","spark-md5":"^3.0.2","uuid":"^11.0.5"},"packageManager":"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"}')},670299:e=>{"use strict";e.exports=JSON.parse('{"name":"@eppo/js-client-sdk","version":"3.14.1","description":"Eppo SDK for client-side JavaScript applications","main":"dist/index.js","files":["/dist","/src","!*.spec.ts"],"types":"dist/index.d.ts","scripts":{"lint":"eslint \'**/*.ts\' --cache","lint:fix":"eslint --fix \'**/*.ts\' --cache","lint:fix-pre-commit":"eslint -c .eslintrc.pre-commit.js --fix \'**/*.ts\' --no-eslintrc --cache","prepare":"make prepare","pre-commit":"lint-staged && tsc && yarn docs","typecheck":"tsc","test":"yarn test:unit","test:unit":"NODE_ENV=test jest \'.*\\\\.spec\\\\.ts\'","docs":"api-documenter markdown -i ./temp -o ./docs"},"jsdelivr":"dist/eppo-sdk.js","repository":{"type":"git","url":"git+https://github.com/Eppo-exp/js-client-sdk.git"},"author":"","license":"MIT","bugs":{"url":"https://github.com/Eppo-exp/js-client-sdk/issues"},"homepage":"https://github.com/Eppo-exp/js-client-sdk#readme","devDependencies":{"@microsoft/api-documenter":"^7.26.3","@microsoft/api-extractor":"^7.48.1","@types/chrome":"^0.0.268","@types/jest":"^29.5.11","@types/spark-md5":"^3.0.5","@typescript-eslint/eslint-plugin":"^5.13.0","@typescript-eslint/parser":"^5.13.0","eslint":"^8.17.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^3.6.3","eslint-plugin-import":"^2.25.4","eslint-plugin-prettier":"^5.2.1","eslint-plugin-promise":"^7.2.1","husky":"^9.1.7","jest":"^29.7.0","jest-environment-jsdom":"^29.7.0","lint-staged":"^15.4.1","prettier":"^3.4.2","terser-webpack-plugin":"^5.3.3","testdouble":"^3.20.2","ts-jest":"^29.1.1","ts-loader":"^9.3.1","ts-node":"^10.9.2","typescript":"^4.7.4","webpack":"^5.73.0","webpack-cli":"^6.0.1"},"dependencies":{"@eppo/js-client-sdk-common":"4.14.4"},"packageManager":"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"}')}}]);