try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`d5f9595e-3753-4015-aa69-7aa9aab7d74d`,e._sentryDebugIdIdentifier=`sentry-dbid-d5f9595e-3753-4015-aa69-7aa9aab7d74d`)}catch{}import"./rolldown-runtime-eb2nym32.js";import{Th as e,ad as t,du as n,fu as r,hu as i,pu as a,sd as o,ud as s,vu as c,yu as l}from"./entry.client-dr7r6s9a.js";import{t as u}from"./constants-nryplh1o.js";import{r as d}from"./ServerInfo-ifpzd3cf.js";var f=class{logger;user;playService;constructor(e,t){this.user=e,this.playService=t,this.logger=s.Instance}async fetchAllUserContent(){return this.logger.info(`Calling gamestream services for user content info`),this.playService.fetchUserContent(this.user)}async deleteUserContent(e,t){return this.logger.info(`Calling gamestream services to delete user content info`),this.playService.deleteUserContent(this.user,e,t)}},p=class p{static appMetadata;static instances=0;logger;telemetry;instanceId=++p.instances;configuration;constructor(t){this.configuration=t,this.logger=new s(`StreamClient`,`(${this.instanceId})`),this.telemetry=o.Instance,this.updateConfiguration(t),this.telemetry.trackEvent(e.SdkInitialized,{},{location:`StreamClient`})}updateConfiguration(e){this.configuration=e,this.logger=new s(`StreamClient`,`(${this.instanceId})`),this.telemetry=o.Instance,this.telemetry.setHandler(e?.telemetryHandler),e?.logHandler&&(s.configuration={...s.configuration,logHandler:e?.logHandler,emitErrorWarningTelemetry:!!e.emitErrorWarningTelemetry}),p.appMetadata=e?.appMetadata,this.configuration.locale||(this.configuration.locale=`en-us`),this.logger.info(`Stream client created using sdk version: ${u.webSdkPackageVersion}`),this.logger.info(`Stream client using locale: ${this.configuration.locale}`),this.setNewSessionCv()}setNewSessionCv(){let e=this.configuration.correlationVector.increment().extend();return this.configuration.playService.setSessionCv(e),e}getContentManager(e){return new f(e,this.configuration.playService)}fetchConsolesForUser(e,t,n){return this.configuration.playService.fetchConsoles(e,t,n)}createCloudSessionRequest(e,t,r,i,a,o,s){return new n(t,e,this.setNewSessionCv(),this.configuration.playService,this.configuration.locale,a,r,i,this.configuration.deviceInformation,o,s)}createHomeConsoleSessionRequest(e,t,n,i,a){return new r(t,e,this.setNewSessionCv(),this.configuration.playService,this.configuration.locale,a,n,i,this.configuration.deviceInformation)}createDirectConnectSession(e,n,r,a,o,s,u){let f=d(n,r,s,u),p=this.setNewSessionCv();return new i(e,f,p,o,l.Direct,a,new t(p,c.PersonalConsole),this.configuration.playService.deviceInformation)}createManagedDevkitConnectSession(e,t,n,r,i){return new a(n,t,this.setNewSessionCv(),this.configuration.playService,this.configuration.locale,r,i,this.configuration.deviceInformation,e.path)}getCorrelationVector(){return this.configuration.correlationVector.increment().getValue()}getLogHandler(){return s.configuration?.logHandler}sendTelemetryEventsViaServices(e,t){if(e)return this.configuration.playService.sendTelemetryEventsViaServices(e,t)}fetchTouchAdaptationBundle(e,t){return this.configuration.playService.fetchTouchAdaptationBundle(e,e.serviceSettings,t)}};export{p as StreamClient};