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]=`4d16c226-3843-4d8a-9826-2711efffdcb9`,e._sentryDebugIdIdentifier=`sentry-dbid-4d16c226-3843-4d8a-9826-2711efffdcb9`)}catch{}import"./rolldown-runtime-nx40z1zs.js";import{Ha as e,Va as t,gh as n}from"./entry.client-mpghtlrl.js";import{cn as r,on as i}from"./workspace-leaf-files-oergw4h0.js";import{a,m as o,n as s,r as c,t as l}from"./StreamSessionRequest-b1lr9edg.js";import{t as u}from"./constants-b87zkitl.js";import{r as d}from"./ServerInfo-ki93py3b.js";var f=class{constructor(t,n){this.user=t,this.playService=n,this.logger=e.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 instances=0;instanceId=++p.instances;constructor(r){this.configuration=r,this.logger=new e(`StreamClient`,`(${this.instanceId})`),this.telemetry=t.Instance,this.updateConfiguration(r),this.telemetry.trackEvent(n.SdkInitialized,{},{location:`StreamClient`})}updateConfiguration(n){this.configuration=n,this.logger=new e(`StreamClient`,`(${this.instanceId})`),this.telemetry=t.Instance,this.telemetry.setHandler(n?.telemetryHandler),n?.logHandler&&(e.configuration={...e.configuration,logHandler:n?.logHandler,emitErrorWarningTelemetry:!!n.emitErrorWarningTelemetry}),p.appMetadata=n?.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,n,r,i,a,o){return new l(t,e,this.setNewSessionCv(),this.configuration.playService,this.configuration.locale,i,n,r,this.configuration.deviceInformation,a,o)}createHomeConsoleSessionRequest(e,t,n,r,i){return new s(t,e,this.setNewSessionCv(),this.configuration.playService,this.configuration.locale,i,n,r,this.configuration.deviceInformation)}createDirectConnectSession(e,t,n,s,c,l,u){let f=d(t,n,l,u),p=this.setNewSessionCv();return new a(e,f,p,c,r.Direct,s,new o(p,i.PersonalConsole),this.configuration.playService.deviceInformation)}createManagedDevkitConnectSession(e,t,n,r,i){return new c(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 e.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};