!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d192c324-f636-5e86-9499-4dcaeec460b9")}catch(e){}}();
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,625691,e=>{"use strict";e.s(["extractErrorStatus",()=>h,"isDetailedResponseError",()=>v,"isFetchError",()=>p,"isResponseError",()=>m,"isServerError",()=>c,"maybeProcessResponseError",()=>u],625691);var t=e.i(868275);e.i(298616);var n=e.i(736594),n=n,i=e.i(930241),o=e.i(389217),r=e.i(290583),n=n,a=e.i(486492);let s=["Load error","network error","The request failed and the interceptors did not return an alternative response",o.STREAM_DID_NOT_CLOSE],l=r.z.object({code:r.z.number(),message:r.z.string(),details:r.z.array(r.z.unknown())});class d extends Error{static async fromResponse(e){let t,n,i=e.headers.get("Content-Type");if(i&&i.includes("application/json"))try{var o;let n=await e.json(),i=null!=(o=n.error)?o:n,r=l.safeParse(i);if(r.success)t=r.data;else throw Error("Invalid GrpcError format: ".concat(r.error.message))}catch(e){throw Error("Failed to parse response JSON: ".concat(e instanceof Error?e.message:"Unknown error"))}else if(null==i?void 0:i.includes("text/html")){let n=function(e){let t=new DOMParser().parseFromString(e,"text/html").querySelector("title");return t?t.textContent:""}(await e.clone().text());t={code:e.status,message:n||e.statusText,details:[]}}if(!t)throw Error("Unable to parse RequestError response body as JSON. Content-Type: ".concat(i));return new d(e,t,n)}constructor(e,o,r){let a={...o};a.message.length>0&&!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!!e.match(/^\d+\s[A-Z_]+:\s([\s\S]+)/)}(a.message)&&(a.message="2 UNKNOWN: ".concat(a.message));let s=(0,n.default)(a);super(((e,t)=>{let n=e?"".concat(e,"\n"):"";return t&&Object.entries(t).map(e=>{let[t,n]=e;return"".concat(n.join(", "))}).join("\n")||n})(s.message,s.details)||"Request failed with status ".concat(e.status,": ").concat(e.statusText)),(0,t._)(this,"response",void 0),(0,t._)(this,"name",void 0),(0,t._)(this,"status",void 0),(0,t._)(this,"statusText",void 0),(0,t._)(this,"url",void 0),(0,t._)(this,"grpcError",void 0),(0,t._)(this,"errorMessage",void 0),(0,t._)(this,"wellKnownErrors",void 0),(0,t._)(this,"wellKnownErrorSet",void 0),(0,t._)(this,"extra",void 0),this.response=e,this.name="DetailedResponseError",this.status=e.status,this.statusText=e.statusText,this.url=e.url,this.grpcError=a,this.errorMessage=s,this.wellKnownErrors=(0,i.parseErrorMessage)(o.message),this.wellKnownErrorSet=new Set(this.wellKnownErrors.map(e=>e.error)),this.extra=r}}function u(e){return m(e)?d.fromResponse(e.response).catch(t=>((0,a.logError)("maybeProcessResponseError",t),e)):Promise.resolve(e)}function c(e){let t=h(e);for(let t of s)if((e instanceof Error||e instanceof TypeError)&&e.message.includes(t))return!1;return!t||t>=500}function h(e){return m(e)?e.response.status:v(e)?e.status:void 0}function p(e){return e instanceof Error&&"FetchError"===e.name}function m(e){return e instanceof Error&&"ResponseError"===e.name}function v(e){return e instanceof Error&&"DetailedResponseError"===e.name}},602723,41257,556934,562929,e=>{"use strict";e.s([],602723),e.s(["BaseAPI",()=>r,"Configuration",()=>i,"JSONApiResponse",()=>d,"RequiredError",()=>l],41257);var t=e.i(868275);let n="http://localhost".replace(/\/+$/,"");class i{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:n}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,t._)(this,"configuration",void 0),this.configuration=e}}let o=new i;class r{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&r.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new a(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=o){(0,t._)(this,"configuration",void 0),(0,t._)(this,"middleware",void 0),(0,t._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new s(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,t._)(r,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class a extends Error{constructor(e,n){super(n),(0,t._)(this,"response",void 0),(0,t._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class s extends Error{constructor(e,n){super(n),(0,t._)(this,"cause",void 0),(0,t._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class l extends Error{constructor(e,n){super(n),(0,t._)(this,"field",void 0),(0,t._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class d{async value(){return this.transformer(await this.raw.json())}constructor(e,n=e=>e){(0,t._)(this,"raw",void 0),(0,t._)(this,"transformer",void 0),this.raw=e,this.transformer=n}}e.s(["AssetRepositoryListAssetMetadataOrderByEnum",()=>w,"AssetRepositorySearchAssetMetadataSourceEnum",()=>f,"DefaultApi",()=>v],562929),e.s(["GrokApiV2UploadedFileSourceType",()=>u,"GrokApiV2UploadedFileSourceTypeFromJSON",()=>c,"GrokApiV2UploadedFileSourceTypeToJSON",()=>h],556934);let u={SelfUploadFileSource:"SELF_UPLOAD_FILE_SOURCE",GoogleDriveFileSource:"GOOGLE_DRIVE_FILE_SOURCE",OneDriveFileSource:"ONE_DRIVE_FILE_SOURCE",ImagineSelfUploadFileSource:"IMAGINE_SELF_UPLOAD_FILE_SOURCE",ImagineGeneratedFileSource:"IMAGINE_GENERATED_FILE_SOURCE"};function c(e){return e}function h(e){return e}function p(e){var t,n=e;if(null==n)return n;return{assetId:null==n.assetId?void 0:n.assetId,mimeType:null==n.mimeType?void 0:n.mimeType,name:null==n.name?void 0:n.name,sizeBytes:null==n.sizeBytes?void 0:n.sizeBytes,createTime:null==n.createTime?void 0:n.createTime,lastUseTime:null==n.lastUseTime?void 0:n.lastUseTime,summary:null==n.summary?void 0:n.summary,previewImageKey:null==n.previewImageKey?void 0:n.previewImageKey,key:null==n.key?void 0:n.key,auxKeys:null==n.auxKeys?void 0:n.auxKeys,responseId:null==n.responseId?void 0:n.responseId,isDeleted:null==n.isDeleted?void 0:n.isDeleted,fileSource:null==n.fileSource?void 0:c(n.fileSource),thirdPartyFileId:null==n.thirdPartyFileId?void 0:n.thirdPartyFileId,thirdPartyFileMimeType:null==n.thirdPartyFileMimeType?void 0:n.thirdPartyFileMimeType,currentConversationId:null==n.currentConversationId?void 0:n.currentConversationId,rootAssetId:null==n.rootAssetId?void 0:n.rootAssetId,sourceConversationId:null==n.sourceConversationId?void 0:n.sourceConversationId,assetDiff:null==n.assetDiff?void 0:n.assetDiff,isModelGenerated:null==n.isModelGenerated?void 0:n.isModelGenerated,updateTime:null==n.updateTime?void 0:n.updateTime,isLatest:null==n.isLatest?void 0:n.isLatest,inlineStatus:null==n.inlineStatus?void 0:(t=n.inlineStatus,t),isRootAssetCreatedByModel:null==n.isRootAssetCreatedByModel?void 0:n.isRootAssetCreatedByModel,rootAssetSourceConversationId:null==n.rootAssetSourceConversationId?void 0:n.rootAssetSourceConversationId,workspaceSharingKey:null==n.workspaceSharingKey?void 0:n.workspaceSharingKey,workspaceSharingPreviewImageKey:null==n.workspaceSharingPreviewImageKey?void 0:n.workspaceSharingPreviewImageKey,teamId:null==n.teamId?void 0:n.teamId,sharedWithTeam:null==n.sharedWithTeam?void 0:n.sharedWithTeam,sharedWithUserIds:null==n.sharedWithUserIds?void 0:n.sharedWithUserIds,isPublic:null==n.isPublic?void 0:n.isPublic,width:null==n.width?void 0:n.width,height:null==n.height?void 0:n.height,rRated:null==n.rRated?void 0:n.rRated}}function m(e){var t;return null==(t=e)?t:{assetMetadata:null==t.assetMetadata?void 0:p(t.assetMetadata),highlight:null==t.highlight?void 0:t.highlight,nameHighlight:null==t.nameHighlight?void 0:t.nameHighlight}}class v extends r{async assetRepositoryCloneAssetRaw(e,t){if(null==e.assetId)throw new l("assetId",'Required parameter "assetId" was null or undefined when calling assetRepositoryCloneAsset().');return new d(await this.request({path:"/rest/assets/{assetId}/clone".replace("{assetId}",encodeURIComponent(String(e.assetId))),method:"POST",headers:{},query:{}},t),e=>p(e))}async assetRepositoryCloneAsset(e,t){let n=await this.assetRepositoryCloneAssetRaw(e,t);return await n.value()}async assetRepositoryCreateAssetRaw(e,t){if(null==e.body)throw new l("body",'Required parameter "body" was null or undefined when calling assetRepositoryCreateAsset().');let n={};return n["Content-Type"]="application/json",new d(await this.request({path:"/rest/assets",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,mimeType:e.mimeType,content:e.content,makePublic:e.makePublic,fileSource:e.fileSource,thirdPartyFileId:e.thirdPartyFileId,thirdPartyFileMimeType:e.thirdPartyFileMimeType,assetId:e.assetId,rootAssetId:e.rootAssetId,currentConversationId:e.currentConversationId,sourceConversationId:e.sourceConversationId,assetDiff:e.assetDiff,isModelGenerated:e.isModelGenerated,responseId:e.responseId,updateTime:e.updateTime,shouldGenerateName:e.shouldGenerateName,width:e.width,height:e.height,auxKeys:e.auxKeys}}(e.body,!1)},t),e=>p(e))}async assetRepositoryCreateAsset(e,t){let n=await this.assetRepositoryCreateAssetRaw(e,t);return await n.value()}async assetRepositoryDeleteAssetRaw(e,t){if(null==e.assetId)throw new l("assetId",'Required parameter "assetId" was null or undefined when calling assetRepositoryDeleteAsset().');return new d(await this.request({path:"/rest/assets/{assetId}".replace("{assetId}",encodeURIComponent(String(e.assetId))),method:"DELETE",headers:{},query:{}},t))}async assetRepositoryDeleteAsset(e,t){let n=await this.assetRepositoryDeleteAssetRaw(e,t);return await n.value()}async assetRepositoryGetAssetMetadataRaw(e,t){if(null==e.assetId)throw new l("assetId",'Required parameter "assetId" was null or undefined when calling assetRepositoryGetAssetMetadata().');return new d(await this.request({path:"/rest/assets/{assetId}".replace("{assetId}",encodeURIComponent(String(e.assetId))),method:"GET",headers:{},query:{}},t),e=>p(e))}async assetRepositoryGetAssetMetadata(e,t){let n=await this.assetRepositoryGetAssetMetadataRaw(e,t);return await n.value()}async assetRepositoryGetLatestAssetMetadataVersionRaw(e,t){if(null==e.rootAssetId)throw new l("rootAssetId",'Required parameter "rootAssetId" was null or undefined when calling assetRepositoryGetLatestAssetMetadataVersion().');return new d(await this.request({path:"/rest/assets/{rootAssetId}/latest".replace("{rootAssetId}",encodeURIComponent(String(e.rootAssetId))),method:"GET",headers:{},query:{}},t),e=>p(e))}async assetRepositoryGetLatestAssetMetadataVersion(e,t){let n=await this.assetRepositoryGetLatestAssetMetadataVersionRaw(e,t);return await n.value()}async assetRepositoryGetStorageUsageInfoRaw(e){return new d(await this.request({path:"/rest/assets/storage-usage",method:"GET",headers:{},query:{}},e),e=>{var t;return null==(t=e)?t:{totalStorageBytes:null==t.totalStorageBytes?void 0:t.totalStorageBytes,usedStorageBytes:null==t.usedStorageBytes?void 0:t.usedStorageBytes,totalGeneratedVideoStorageBytes:null==t.totalGeneratedVideoStorageBytes?void 0:t.totalGeneratedVideoStorageBytes,usedGeneratedVideoStorageBytes:null==t.usedGeneratedVideoStorageBytes?void 0:t.usedGeneratedVideoStorageBytes}})}async assetRepositoryGetStorageUsageInfo(e){let t=await this.assetRepositoryGetStorageUsageInfoRaw(e);return await t.value()}async assetRepositoryListAllAssetVersionsRaw(e,t){if(null==e.rootAssetId)throw new l("rootAssetId",'Required parameter "rootAssetId" was null or undefined when calling assetRepositoryListAllAssetVersions().');return new d(await this.request({path:"/rest/assets/{rootAssetId}/versions".replace("{rootAssetId}",encodeURIComponent(String(e.rootAssetId))),method:"GET",headers:{},query:{}},t),e=>{var t;return null==(t=e)?t:{assets:null==t.assets?void 0:t.assets.map(p)}})}async assetRepositoryListAllAssetVersions(e,t){let n=await this.assetRepositoryListAllAssetVersionsRaw(e,t);return await n.value()}async assetRepositoryListAssetMetadataRaw(e,t){let n={};return null!=e.query&&(n.query=e.query),null!=e.pageSize&&(n.pageSize=e.pageSize),null!=e.pageToken&&(n.pageToken=e.pageToken),null!=e.mimeTypes&&(n.mimeTypes=e.mimeTypes),null!=e.assetIds&&(n.assetIds=e.assetIds),null!=e.orderBy&&(n.orderBy=e.orderBy),null!=e.workspaceId&&(n.workspaceId=e.workspaceId),null!=e.source&&(n.source=e.source),null!=e.isLatest&&(n.isLatest=e.isLatest),null!=e.sharedWithMe&&(n.sharedWithMe=e.sharedWithMe),new d(await this.request({path:"/rest/assets",method:"GET",headers:{},query:n},t),e=>{var t;return null==(t=e)?t:{assets:null==t.assets?void 0:t.assets.map(p),nextPageToken:null==t.nextPageToken?void 0:t.nextPageToken}})}async assetRepositoryListAssetMetadata(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.assetRepositoryListAssetMetadataRaw(e,t);return await n.value()}async assetRepositoryResetAssetConversationRaw(e,t){if(null==e.assetId)throw new l("assetId",'Required parameter "assetId" was null or undefined when calling assetRepositoryResetAssetConversation().');if(null==e.body)throw new l("body",'Required parameter "body" was null or undefined when calling assetRepositoryResetAssetConversation().');let n={};return n["Content-Type"]="application/json",new d(await this.request({path:"/rest/assets/{assetId}/reset-conversation".replace("{assetId}",encodeURIComponent(String(e.assetId))),method:"PUT",headers:n,query:{},body:e.body},t))}async assetRepositoryResetAssetConversation(e,t){let n=await this.assetRepositoryResetAssetConversationRaw(e,t);return await n.value()}async assetRepositoryRestoreAssetVersionRaw(e,t){if(null==e.assetId)throw new l("assetId",'Required parameter "assetId" was null or undefined when calling assetRepositoryRestoreAssetVersion().');return new d(await this.request({path:"/rest/assets/{assetId}/restore".replace("{assetId}",encodeURIComponent(String(e.assetId))),method:"POST",headers:{},query:{}},t),e=>p(e))}async assetRepositoryRestoreAssetVersion(e,t){let n=await this.assetRepositoryRestoreAssetVersionRaw(e,t);return await n.value()}async assetRepositorySearchAssetMetadataRaw(e,t){let n={};return null!=e.query&&(n.query=e.query),null!=e.pageSize&&(n.pageSize=e.pageSize),null!=e.pageToken&&(n.pageToken=e.pageToken),null!=e.mimeTypes&&(n.mimeTypes=e.mimeTypes),null!=e.source&&(n.source=e.source),new d(await this.request({path:"/rest/assets/search",method:"GET",headers:{},query:n},t),e=>{var t;return null==(t=e)?t:{matches:null==t.matches?void 0:t.matches.map(m),nextPageToken:null==t.nextPageToken?void 0:t.nextPageToken}})}async assetRepositorySearchAssetMetadata(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.assetRepositorySearchAssetMetadataRaw(e,t);return await n.value()}async assetRepositoryShareAssetRaw(e,t){if(null==e.assetId)throw new l("assetId",'Required parameter "assetId" was null or undefined when calling assetRepositoryShareAsset().');let n={};return null!=e.teamMembersToShare&&(n.teamMembersToShare=e.teamMembersToShare),null!=e.shareWithTeamMembers&&(n.shareWithTeamMembers=e.shareWithTeamMembers),new d(await this.request({path:"/rest/assets/{assetId}/share".replace("{assetId}",encodeURIComponent(String(e.assetId))),method:"POST",headers:{},query:n},t),e=>{var t;return null==(t=e)?t:{rootAssetId:null==t.rootAssetId?void 0:t.rootAssetId}})}async assetRepositoryShareAsset(e,t){let n=await this.assetRepositoryShareAssetRaw(e,t);return await n.value()}async assetRepositorySoftDeleteAssetMetadataRaw(e,t){if(null==e.assetId)throw new l("assetId",'Required parameter "assetId" was null or undefined when calling assetRepositorySoftDeleteAssetMetadata().');return new d(await this.request({path:"/rest/assets-metadata/{assetId}".replace("{assetId}",encodeURIComponent(String(e.assetId))),method:"DELETE",headers:{},query:{}},t))}async assetRepositorySoftDeleteAssetMetadata(e,t){let n=await this.assetRepositorySoftDeleteAssetMetadataRaw(e,t);return await n.value()}async assetRepositoryUpdateAssetRaw(e,t){if(null==e.assetId)throw new l("assetId",'Required parameter "assetId" was null or undefined when calling assetRepositoryUpdateAsset().');if(null==e.body)throw new l("body",'Required parameter "body" was null or undefined when calling assetRepositoryUpdateAsset().');let n={};return n["Content-Type"]="application/json",new d(await this.request({path:"/rest/assets/{assetId}".replace("{assetId}",encodeURIComponent(String(e.assetId))),method:"PUT",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{makeNewVersion:e.makeNewVersion,name:e.name,content:e.content}}(e.body,!1)},t),e=>p(e))}async assetRepositoryUpdateAsset(e,t){let n=await this.assetRepositoryUpdateAssetRaw(e,t);return await n.value()}}let w={OrderByInvalid:"ORDER_BY_INVALID",OrderByRelevancy:"ORDER_BY_RELEVANCY",OrderByCreateTime:"ORDER_BY_CREATE_TIME",OrderByLastUseTime:"ORDER_BY_LAST_USE_TIME",OrderByName:"ORDER_BY_NAME",OrderByMimeType:"ORDER_BY_MIME_TYPE",OrderByContentSize:"ORDER_BY_CONTENT_SIZE"},f={SourceAny:"SOURCE_ANY",SourceUploaded:"SOURCE_UPLOADED",SourceGenerated:"SOURCE_GENERATED"}},364778,928325,296135,318726,790182,556068,497522,732299,263457,801384,36023,47e3,126570,924219,866166,121198,108489,96264,127479,245242,541243,178759,122710,115051,883805,164201,732142,103988,255668,548310,994238,499313,722118,635331,967452,633510,749105,748570,554771,468097,627511,272028,e=>{"use strict";let t;e.s(["assetRepositoryApi",()=>s6,"authFrontendApi",()=>s4,"authMgmtApi",()=>s9,"chatApi",()=>sQ,"devConfigApi",()=>ll,"githubApi",()=>ln,"grokForTeamsApi",()=>lt,"grokTasksApi",()=>s7,"highlightsApi",()=>lo,"livekitApi",()=>s8,"mediaApi",()=>le,"modelsApi",()=>s1,"notificationsApi",()=>ls,"rateLimitsApi",()=>s2,"sandboxEnvironmentsApi",()=>li,"settingsApi",()=>sZ,"subscriptionsApi",()=>s0,"suggestionsApi",()=>la,"systemPromptRepositoryApi",()=>s3,"voiceApi",()=>lr,"workspaceRepositoryApi",()=>s5],364778);var n=e.i(625691),i=e.i(363848),o=e.i(70226);e.i(602723);var r=e.i(562929),a=e.i(41257),s=e.i(868275);let l="http://localhost".replace(/\/+$/,"");class d{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:l}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let u=new d;class c{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&c.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new h(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=u){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new p(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(c,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class h extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class p extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class m extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class v{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function w(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{provider:e.provider,identityToken:e.identityToken,givenName:e.givenName,familyName:e.familyName,state:e.state,oauth2Cookie:e.oauth2Cookie}}function f(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{code:e.code,state:e.state,oauth2Cookie:e.oauth2Cookie}}function g(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{credentials:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{emailAndPassword:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{email:e.email,clearTextPassword:e.clearTextPassword}}(e.emailAndPassword,!1),oauth:f(e.oauth,!1),apple:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{identityToken:e.identityToken,email:e.email,givenName:e.givenName,familyName:e.familyName,userId:e.userId,source:e.source,state:e.state,oauth2Cookie:e.oauth2Cookie}}(e.apple,!1),idToken:w(e.idToken,!1),oauthDataToken:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{oauthDataToken:e.oauthDataToken,ssoSelectedUserId:e.ssoSelectedUserId}}(e.oauthDataToken,!1),workos:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{code:e.code}}(e.workos,!1)}}(e.credentials,!1),sessionId:e.sessionId,promptOnDuplicateEmail:e.promptOnDuplicateEmail}}function y(e){return e}function I(e,t){return null==e?e:{session:null==e.session?void 0:function(e,t){var n,i;if(null==e)return e;return{sessionId:null==e.sessionId?void 0:e.sessionId,userId:null==e.userId?void 0:e.userId,createTime:null==e.createTime?void 0:e.createTime,expirationTime:null==e.expirationTime?void 0:e.expirationTime,status:null==e.status?void 0:(n=e.status,n),multiFactorDeviceId:null==e.multiFactorDeviceId?void 0:e.multiFactorDeviceId,startVerificationTime:null==e.startVerificationTime?void 0:e.startVerificationTime,verificationTime:null==e.verificationTime?void 0:e.verificationTime,cfMetadata:null==e.cfMetadata?void 0:(i=e.cfMetadata,null==i?i:{ipAddress:null==i.ipAddress?void 0:i.ipAddress,city:null==i.city?void 0:i.city,country:null==i.country?void 0:i.country,continent:null==i.continent?void 0:i.continent,latitude:null==i.latitude?void 0:i.latitude,longitude:null==i.longitude?void 0:i.longitude,region:null==i.region?void 0:i.region,regionCode:null==i.regionCode?void 0:i.regionCode,metro:null==i.metro?void 0:i.metro,postalCode:null==i.postalCode?void 0:i.postalCode,timezone:null==i.timezone?void 0:i.timezone,botScore:null==i.botScore?void 0:i.botScore,verifiedBot:null==i.verifiedBot?void 0:i.verifiedBot,connectionFingerprint:null==i.connectionFingerprint?void 0:i.connectionFingerprint}),userAgent:null==e.userAgent?void 0:e.userAgent,elevationTime:null==e.elevationTime?void 0:e.elevationTime,impersonationUserId:null==e.impersonationUserId?void 0:e.impersonationUserId,lastAuthTime:null==e.lastAuthTime?void 0:e.lastAuthTime,isIntegration:null==e.isIntegration?void 0:e.isIntegration,signInMethod:null==e.signInMethod?void 0:y(e.signInMethod)}}(e.session,0),sessionCookie:null==e.sessionCookie?void 0:e.sessionCookie,oneTimeLinkTokens:null==e.oneTimeLinkTokens?void 0:e.oneTimeLinkTokens}}function R(e,t){var n,i,o;if(null==e)return e;return{userId:null==e.userId?void 0:e.userId,createTime:null==e.createTime?void 0:e.createTime,email:null==e.email?void 0:e.email,profileImage:null==e.profileImage?void 0:e.profileImage,givenName:null==e.givenName?void 0:e.givenName,familyName:null==e.familyName?void 0:e.familyName,xSubscriptionType:null==e.xSubscriptionType?void 0:e.xSubscriptionType,xUserId:null==e.xUserId?void 0:e.xUserId,xUsername:null==e.xUsername?void 0:e.xUsername,role:null==e.role?void 0:e.role,emailConfirmed:null==e.emailConfirmed?void 0:e.emailConfirmed,tosAcceptedVersion:null==e.tosAcceptedVersion?void 0:e.tosAcceptedVersion,blockedReason:null==e.blockedReason?void 0:e.blockedReason,aclStrings:null==e.aclStrings?void 0:e.aclStrings,sessionTierId:null==e.sessionTierId?void 0:e.sessionTierId,birthDate:null==e.birthDate?void 0:e.birthDate,emailDomain:null==e.emailDomain?void 0:e.emailDomain,grokDb:null==e.grokDb?void 0:e.grokDb,deleteTime:null==e.deleteTime?void 0:e.deleteTime,vercelAvatarUrl:null==e.vercelAvatarUrl?void 0:e.vercelAvatarUrl,vercelEmail:null==e.vercelEmail?void 0:e.vercelEmail,vercelId:null==e.vercelId?void 0:e.vercelId,vercelName:null==e.vercelName?void 0:e.vercelName,vercelRole:null==e.vercelRole?void 0:e.vercelRole,hasPassword:null==e.hasPassword?void 0:e.hasPassword,googleEmail:null==e.googleEmail?void 0:e.googleEmail,emailSubscribed:null==e.emailSubscribed?void 0:e.emailSubscribed,migratedFromX:null==e.migratedFromX?void 0:e.migratedFromX,xMigrationStatus:null==e.xMigrationStatus?void 0:e.xMigrationStatus,organizationId:null==e.organizationId?void 0:e.organizationId,organizationRole:null==e.organizationRole?void 0:(n=e.organizationRole,n),organizationRbacRoleId:null==e.organizationRbacRoleId?void 0:e.organizationRbacRoleId,organizationType:null==e.organizationType?void 0:(i=e.organizationType,i),riskLevel:null==e.riskLevel?void 0:(o=e.riskLevel,o),allowNsfwContent:null==e.allowNsfwContent?void 0:e.allowNsfwContent,alwaysShowNsfwContent:null==e.alwaysShowNsfwContent?void 0:e.alwaysShowNsfwContent}}function T(e){return function(e,t){var n,i,o,r;if(null==e)return e;return{emailPassword:null==e.emailPassword?void 0:(n=e.emailPassword,null==n?n:{pwEmail:null==n.pwEmail?void 0:n.pwEmail,pwNormalizedEmail:null==n.pwNormalizedEmail?void 0:n.pwNormalizedEmail}),googleOauth2:null==e.googleOauth2?void 0:(i=e.googleOauth2,null==i?i:{googleEmail:null==i.googleEmail?void 0:i.googleEmail}),xOauth2:null==e.xOauth2?void 0:(o=e.xOauth2,null==o?o:{xUserId:null==o.xUserId?void 0:o.xUserId,xUsername:null==o.xUsername?void 0:o.xUsername,xSubscriptionType:null==o.xSubscriptionType?void 0:o.xSubscriptionType}),appleOauth2:null==e.appleOauth2?void 0:(r=e.appleOauth2,null==r?r:{appleUserId:null==r.appleUserId?void 0:r.appleUserId})}}(e,0)}function b(e){var t;return null==(t=e)?t:{user:null==t.user?void 0:R(t.user,!1),linkedAccounts:null==t.linkedAccounts?void 0:t.linkedAccounts.map(T)}}function S(e){var t,n=e;if(null==n)return n;return{deviceId:null==n.deviceId?void 0:n.deviceId,name:null==n.name?void 0:n.name,deviceType:null==n.deviceType?void 0:(t=n.deviceType,t),iconHint:null==n.iconHint?void 0:n.iconHint,lastUsedTime:null==n.lastUsedTime?void 0:n.lastUsedTime,createTime:null==n.createTime?void 0:n.createTime}}function k(e){var t,n=e;if(null==n)return n;return{oauthConnectorId:null==n.oauthConnectorId?void 0:n.oauthConnectorId,provider:null==n.provider?void 0:(t=n.provider,t),userId:null==n.userId?void 0:n.userId,accessTokenExpirationTime:null==n.accessTokenExpirationTime?void 0:n.accessTokenExpirationTime,scopes:null==n.scopes?void 0:n.scopes,createTime:null==n.createTime?void 0:n.createTime,modTime:null==n.modTime?void 0:n.modTime,accessToken:null==n.accessToken?void 0:n.accessToken}}function C(e){var t,n=e;if(null==n)return n;return{selector:null==n.selector?void 0:n.selector,tier:null==n.tier?void 0:n.tier,rateLimit:null==n.rateLimit?void 0:(t=n.rateLimit,null==t?t:{qpm:null==t.qpm?void 0:t.qpm,tpm:null==t.tpm?void 0:t.tpm})}}function q(e){var t;return null==(t=e)?t:{model:null==t.model?void 0:t.model,tierId:null==t.tierId?void 0:t.tierId}}function A(e){var t,n=e;if(null==n)return n;return{address:null==n.address?void 0:(t=n.address,null==t?t:{ipv4:null==t.ipv4?void 0:t.ipv4,ipv6:null==t.ipv6?void 0:t.ipv6}),prefixLength:null==n.prefixLength?void 0:n.prefixLength}}function P(e,t){return null==e?e:{ipRanges:null==e.ipRanges?void 0:e.ipRanges.map(A)}}function E(e){return e}function U(e){var t,n=e;if(null==n)return n;return{teamId:null==n.teamId?void 0:n.teamId,createTime:null==n.createTime?void 0:n.createTime,createUserId:null==n.createUserId?void 0:n.createUserId,name:null==n.name?void 0:n.name,description:null==n.description?void 0:n.description,user:null==n.user?void 0:(t=n.user,null==t?t:{userId:null==t.userId?void 0:t.userId,email:null==t.email?void 0:t.email,profileImage:null==t.profileImage?void 0:t.profileImage,givenName:null==t.givenName?void 0:t.givenName,familyName:null==t.familyName?void 0:t.familyName,profileImageUrl:null==t.profileImageUrl?void 0:t.profileImageUrl}),blockedReasons:null==n.blockedReasons?void 0:n.blockedReasons.map(E),tierId:null==n.tierId?void 0:n.tierId,tierOverrides:null==n.tierOverrides?void 0:n.tierOverrides.map(q),aclStrings:null==n.aclStrings?void 0:n.aclStrings,dataSharingEnabledAt:null==n.dataSharingEnabledAt?void 0:n.dataSharingEnabledAt,mfaRequired:null==n.mfaRequired?void 0:n.mfaRequired,ipRangesMc:null==n.ipRangesMc?void 0:P(n.ipRangesMc,!1),ipRangesIc:null==n.ipRangesIc?void 0:P(n.ipRangesIc,!1),allowApiKeysAllModels:null==n.allowApiKeysAllModels?void 0:n.allowApiKeysAllModels,allowApiKeysAllEndpoints:null==n.allowApiKeysAllEndpoints?void 0:n.allowApiKeysAllEndpoints,googleOauthDomain:null==n.googleOauthDomain?void 0:n.googleOauthDomain,organizationId:null==n.organizationId?void 0:n.organizationId,tier:null==n.tier?void 0:n.tier,rateLimitOverrides:null==n.rateLimitOverrides?void 0:n.rateLimitOverrides.map(C),profileImage:null==n.profileImage?void 0:n.profileImage}}function M(e,t){return null==e?e:{allowNsfwContent:null==e.allowNsfwContent?void 0:e.allowNsfwContent,alwaysShowNsfwContent:null==e.alwaysShowNsfwContent?void 0:e.alwaysShowNsfwContent}}let _="http://localhost".replace(/\/+$/,"");class x{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:_}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let O=new x;class G{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&G.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new D(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=O){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new L(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(G,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class D extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class L extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class F extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class N{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function j(e){var t;return null==(t=e)?t:{acl:null==t.acl?void 0:t.acl,description:null==t.description?void 0:t.description,namespace:null==t.namespace?void 0:t.namespace,key:null==t.key?void 0:t.key,value:null==t.value?void 0:t.value}}function B(e){var t;return null==(t=e)?t:{clientName:null==t.clientName?void 0:t.clientName,description:null==t.description?void 0:t.description}}function V(e){var t;return null==(t=e)?t:{queryOffset:null==t.queryOffset?void 0:t.queryOffset,queryBaseRate:null==t.queryBaseRate?void 0:t.queryBaseRate,queryMultiplier:null==t.queryMultiplier?void 0:t.queryMultiplier,tokenOffset:null==t.tokenOffset?void 0:t.tokenOffset,tokenBaseRate:null==t.tokenBaseRate?void 0:t.tokenBaseRate,tokenMultiplier:null==t.tokenMultiplier?void 0:t.tokenMultiplier}}function K(e){return e}function z(e){var t;return null==(t=e)?t:{name:null==t.name?void 0:t.name,version:null==t.version?void 0:t.version,inputModalities:null==t.inputModalities?void 0:t.inputModalities.map(K),outputModalities:null==t.outputModalities?void 0:t.outputModalities.map(K),promptTokenPrice:null==t.promptTokenPrice?void 0:t.promptTokenPrice,completionTokenPrice:null==t.completionTokenPrice?void 0:t.completionTokenPrice,supportedClients:null==t.supportedClients?void 0:t.supportedClients.map(B),rps:null==t.rps?void 0:t.rps,rpm:null==t.rpm?void 0:t.rpm,tpm:null==t.tpm?void 0:t.tpm,rph:null==t.rph?void 0:t.rph,rpd:null==t.rpd?void 0:t.rpd,cluster:null==t.cluster?void 0:t.cluster,aliases:null==t.aliases?void 0:t.aliases,rateLimits:null==t.rateLimits?void 0:V(t.rateLimits)}}function H(e){var t;return null==(t=e)?t:{name:null==t.name?void 0:t.name,version:null==t.version?void 0:t.version,inputModalities:null==t.inputModalities?void 0:t.inputModalities.map(K),promptTextTokenPrice:null==t.promptTextTokenPrice?void 0:t.promptTextTokenPrice,promptImageTokenPrice:null==t.promptImageTokenPrice?void 0:t.promptImageTokenPrice,rps:null==t.rps?void 0:t.rps,rpm:null==t.rpm?void 0:t.rpm,tpm:null==t.tpm?void 0:t.tpm,rph:null==t.rph?void 0:t.rph,rpd:null==t.rpd?void 0:t.rpd,cluster:null==t.cluster?void 0:t.cluster,aliases:null==t.aliases?void 0:t.aliases,rateLimits:null==t.rateLimits?void 0:V(t.rateLimits)}}function J(e){var t,n=e;if(null==n)return n;return{selector:null==n.selector?void 0:n.selector,tier:null==n.tier?void 0:n.tier,rateLimit:null==n.rateLimit?void 0:(t=n.rateLimit,null==t?t:{qpm:null==t.qpm?void 0:t.qpm,tpm:null==t.tpm?void 0:t.tpm})}}function W(e){var t;return null==(t=e)?t:{model:null==t.model?void 0:t.model,tierId:null==t.tierId?void 0:t.tierId}}function Y(e){var t,n=e;if(null==n)return n;return{address:null==n.address?void 0:(t=n.address,null==t?t:{ipv4:null==t.ipv4?void 0:t.ipv4,ipv6:null==t.ipv6?void 0:t.ipv6}),prefixLength:null==n.prefixLength?void 0:n.prefixLength}}function X(e,t){return null==e?e:{ipRanges:null==e.ipRanges?void 0:e.ipRanges.map(Y)}}function $(e){return e}function Q(e){var t,n=e;if(null==n)return n;return{teamId:null==n.teamId?void 0:n.teamId,createTime:null==n.createTime?void 0:n.createTime,createUserId:null==n.createUserId?void 0:n.createUserId,name:null==n.name?void 0:n.name,description:null==n.description?void 0:n.description,user:null==n.user?void 0:(t=n.user,null==t?t:{userId:null==t.userId?void 0:t.userId,email:null==t.email?void 0:t.email,profileImage:null==t.profileImage?void 0:t.profileImage,givenName:null==t.givenName?void 0:t.givenName,familyName:null==t.familyName?void 0:t.familyName,profileImageUrl:null==t.profileImageUrl?void 0:t.profileImageUrl}),blockedReasons:null==n.blockedReasons?void 0:n.blockedReasons.map($),tierId:null==n.tierId?void 0:n.tierId,tierOverrides:null==n.tierOverrides?void 0:n.tierOverrides.map(W),aclStrings:null==n.aclStrings?void 0:n.aclStrings,dataSharingEnabledAt:null==n.dataSharingEnabledAt?void 0:n.dataSharingEnabledAt,mfaRequired:null==n.mfaRequired?void 0:n.mfaRequired,ipRangesMc:null==n.ipRangesMc?void 0:X(n.ipRangesMc,!1),ipRangesIc:null==n.ipRangesIc?void 0:X(n.ipRangesIc,!1),allowApiKeysAllModels:null==n.allowApiKeysAllModels?void 0:n.allowApiKeysAllModels,allowApiKeysAllEndpoints:null==n.allowApiKeysAllEndpoints?void 0:n.allowApiKeysAllEndpoints,googleOauthDomain:null==n.googleOauthDomain?void 0:n.googleOauthDomain,organizationId:null==n.organizationId?void 0:n.organizationId,tier:null==n.tier?void 0:n.tier,rateLimitOverrides:null==n.rateLimitOverrides?void 0:n.rateLimitOverrides.map(J),profileImage:null==n.profileImage?void 0:n.profileImage}}function Z(e){var t,n=e;if(null==n)return n;return{resolution:null==n.resolution?void 0:(t=n.resolution,t),pricePerImage:null==n.pricePerImage?void 0:n.pricePerImage}}function ee(e){var t;return null==(t=e)?t:{name:null==t.name?void 0:t.name,version:null==t.version?void 0:t.version,inputModalities:null==t.inputModalities?void 0:t.inputModalities.map(K),outputModalities:null==t.outputModalities?void 0:t.outputModalities.map(K),imagePrice:null==t.imagePrice?void 0:t.imagePrice,rps:null==t.rps?void 0:t.rps,rpm:null==t.rpm?void 0:t.rpm,tpm:null==t.tpm?void 0:t.tpm,rph:null==t.rph?void 0:t.rph,rpd:null==t.rpd?void 0:t.rpd,cluster:null==t.cluster?void 0:t.cluster,aliases:null==t.aliases?void 0:t.aliases,resolutionPricing:null==t.resolutionPricing?void 0:t.resolutionPricing.map(Z),pricePerInputImage:null==t.pricePerInputImage?void 0:t.pricePerInputImage,rateLimits:null==t.rateLimits?void 0:V(t.rateLimits)}}function et(e){var t,n=e;if(null==n)return n;return{name:null==n.name?void 0:n.name,version:null==n.version?void 0:n.version,inputModalities:null==n.inputModalities?void 0:n.inputModalities.map(K),outputModalities:null==n.outputModalities?void 0:n.outputModalities.map(K),promptTextTokenPrice:null==n.promptTextTokenPrice?void 0:n.promptTextTokenPrice,promptImageTokenPrice:null==n.promptImageTokenPrice?void 0:n.promptImageTokenPrice,promptTextTokenPriceLongContext:null==n.promptTextTokenPriceLongContext?void 0:n.promptTextTokenPriceLongContext,cachedPromptTokenPrice:null==n.cachedPromptTokenPrice?void 0:n.cachedPromptTokenPrice,completionTextTokenPrice:null==n.completionTextTokenPrice?void 0:n.completionTextTokenPrice,completionTokenPriceLongContext:null==n.completionTokenPriceLongContext?void 0:n.completionTokenPriceLongContext,searchPrice:null==n.searchPrice?void 0:n.searchPrice,rps:null==n.rps?void 0:n.rps,rpm:null==n.rpm?void 0:n.rpm,tpm:null==n.tpm?void 0:n.tpm,rph:null==n.rph?void 0:n.rph,rpd:null==n.rpd?void 0:n.rpd,cluster:null==n.cluster?void 0:n.cluster,maxPromptLength:null==n.maxPromptLength?void 0:n.maxPromptLength,aliases:null==n.aliases?void 0:n.aliases,features:null==n.features?void 0:(t=n.features,null==t?t:{functionCalling:null==t.functionCalling?void 0:t.functionCalling,structuredOutputs:null==t.structuredOutputs?void 0:t.structuredOutputs,reasoning:null==t.reasoning?void 0:t.reasoning}),algorithm:null==n.algorithm?void 0:n.algorithm,longContextThreshold:null==n.longContextThreshold?void 0:n.longContextThreshold,rateLimits:null==n.rateLimits?void 0:V(n.rateLimits),batchDiscountPercent:null==n.batchDiscountPercent?void 0:n.batchDiscountPercent}}function en(e){var t;return null==(t=e)?t:{redactedApiKey:null==t.redactedApiKey?void 0:t.redactedApiKey,apiKey:null==t.apiKey?void 0:t.apiKey,userId:null==t.userId?void 0:t.userId,name:null==t.name?void 0:t.name,createTime:null==t.createTime?void 0:t.createTime,modifyTime:null==t.modifyTime?void 0:t.modifyTime,teamId:null==t.teamId?void 0:t.teamId,apiKeyId:null==t.apiKeyId?void 0:t.apiKeyId,disabled:null==t.disabled?void 0:t.disabled,expireTime:null==t.expireTime?void 0:t.expireTime,qps:null==t.qps?void 0:t.qps,qpm:null==t.qpm?void 0:t.qpm,tpm:null==t.tpm?void 0:t.tpm,aclStrings:null==t.aclStrings?void 0:t.aclStrings}}function ei(e){var t,n=e;if(null==n)return n;return{resolution:null==n.resolution?void 0:(t=n.resolution,t),pricePerSecond:null==n.pricePerSecond?void 0:n.pricePerSecond}}function eo(e){var t;return null==(t=e)?t:{name:null==t.name?void 0:t.name,version:null==t.version?void 0:t.version,inputModalities:null==t.inputModalities?void 0:t.inputModalities.map(K),outputModalities:null==t.outputModalities?void 0:t.outputModalities.map(K),rps:null==t.rps?void 0:t.rps,rpm:null==t.rpm?void 0:t.rpm,tpm:null==t.tpm?void 0:t.tpm,rph:null==t.rph?void 0:t.rph,rpd:null==t.rpd?void 0:t.rpd,cluster:null==t.cluster?void 0:t.cluster,aliases:null==t.aliases?void 0:t.aliases,resolutionPricing:null==t.resolutionPricing?void 0:t.resolutionPricing.map(ei),pricePerInputImage:null==t.pricePerInputImage?void 0:t.pricePerInputImage,pricePerInputVideoSecond:null==t.pricePerInputVideoSecond?void 0:t.pricePerInputVideoSecond,rateLimits:null==t.rateLimits?void 0:V(t.rateLimits)}}function er(e){var t;return null==(t=e)?t:{languageModels:null==t.languageModels?void 0:t.languageModels.map(et),embeddingModels:null==t.embeddingModels?void 0:t.embeddingModels.map(H),imageGenerationModels:null==t.imageGenerationModels?void 0:t.imageGenerationModels.map(ee),audioModels:null==t.audioModels?void 0:t.audioModels.map(z),videoGenerationModels:null==t.videoGenerationModels?void 0:t.videoGenerationModels.map(eo),clusterName:null==t.clusterName?void 0:t.clusterName}}function ea(e){return function(e,t){var n,i,o;if(null==e)return e;return{userId:null==e.userId?void 0:e.userId,createTime:null==e.createTime?void 0:e.createTime,email:null==e.email?void 0:e.email,profileImage:null==e.profileImage?void 0:e.profileImage,givenName:null==e.givenName?void 0:e.givenName,familyName:null==e.familyName?void 0:e.familyName,xSubscriptionType:null==e.xSubscriptionType?void 0:e.xSubscriptionType,xUserId:null==e.xUserId?void 0:e.xUserId,xUsername:null==e.xUsername?void 0:e.xUsername,role:null==e.role?void 0:e.role,emailConfirmed:null==e.emailConfirmed?void 0:e.emailConfirmed,tosAcceptedVersion:null==e.tosAcceptedVersion?void 0:e.tosAcceptedVersion,blockedReason:null==e.blockedReason?void 0:e.blockedReason,aclStrings:null==e.aclStrings?void 0:e.aclStrings,sessionTierId:null==e.sessionTierId?void 0:e.sessionTierId,birthDate:null==e.birthDate?void 0:e.birthDate,emailDomain:null==e.emailDomain?void 0:e.emailDomain,grokDb:null==e.grokDb?void 0:e.grokDb,deleteTime:null==e.deleteTime?void 0:e.deleteTime,vercelAvatarUrl:null==e.vercelAvatarUrl?void 0:e.vercelAvatarUrl,vercelEmail:null==e.vercelEmail?void 0:e.vercelEmail,vercelId:null==e.vercelId?void 0:e.vercelId,vercelName:null==e.vercelName?void 0:e.vercelName,vercelRole:null==e.vercelRole?void 0:e.vercelRole,hasPassword:null==e.hasPassword?void 0:e.hasPassword,googleEmail:null==e.googleEmail?void 0:e.googleEmail,emailSubscribed:null==e.emailSubscribed?void 0:e.emailSubscribed,migratedFromX:null==e.migratedFromX?void 0:e.migratedFromX,xMigrationStatus:null==e.xMigrationStatus?void 0:e.xMigrationStatus,organizationId:null==e.organizationId?void 0:e.organizationId,organizationRole:null==e.organizationRole?void 0:(n=e.organizationRole,n),organizationRbacRoleId:null==e.organizationRbacRoleId?void 0:e.organizationRbacRoleId,organizationType:null==e.organizationType?void 0:(i=e.organizationType,i),riskLevel:null==e.riskLevel?void 0:(o=e.riskLevel,o),allowNsfwContent:null==e.allowNsfwContent?void 0:e.allowNsfwContent,alwaysShowNsfwContent:null==e.alwaysShowNsfwContent?void 0:e.alwaysShowNsfwContent}}(e,0)}function es(e){var t;return null==(t=e)?t:{user:null==t.user?void 0:ea(t.user),acls:null==t.acls?void 0:t.acls.map(j)}}e.s([],866166);let el="http://localhost".replace(/\/+$/,"");class ed{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:el}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let eu=new ed;class ec{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&ec.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new eh(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=eu){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new ep(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(ec,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class eh extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class ep extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class em extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class ev{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}e.s(["ChatListShareLinksOrderByEnum",()=>nv,"DefaultApi",()=>nm],924219),e.s(["GrokApiConnectorType",()=>ew,"GrokApiConnectorTypeFromJSON",()=>ef,"GrokApiConnectorTypeToJSON",()=>eg],928325);let ew={ConnectorTypeUnknown:"CONNECTOR_TYPE_UNKNOWN",ConnectorTypeGoogleDrive:"CONNECTOR_TYPE_GOOGLE_DRIVE",ConnectorTypeNotion:"CONNECTOR_TYPE_NOTION",ConnectorTypeSlack:"CONNECTOR_TYPE_SLACK",ConnectorTypeGmail:"CONNECTOR_TYPE_GMAIL",ConnectorTypeGoogleCalendar:"CONNECTOR_TYPE_GOOGLE_CALENDAR"};function ef(e){return e}function eg(e){return e}function ey(e){var t;return null==(t=e)?t:{connectorType:null==t.connectorType?void 0:ef(t.connectorType),query:null==t.query?void 0:t.query,chunkContent:null==t.chunkContent?void 0:t.chunkContent,documentType:null==t.documentType?void 0:t.documentType,documentTitle:null==t.documentTitle?void 0:t.documentTitle,documentSourceUrl:null==t.documentSourceUrl?void 0:t.documentSourceUrl}}function eI(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{connectorType:e.connectorType,query:e.query,chunkContent:e.chunkContent,documentType:e.documentType,documentTitle:e.documentTitle,documentSourceUrl:e.documentSourceUrl}}(e,!1)}function eR(e){var t;return null==(t=e)?t:{tag:null==t.tag?void 0:t.tag,start:null==t.start?void 0:t.start,end:null==t.end?void 0:t.end}}function eT(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{tag:e.tag,start:e.start,end:e.end}}(e,!1)}function eb(e){var t;return null==(t=e)?t:{username:null==t.username?void 0:t.username,start:null==t.start?void 0:t.start,end:null==t.end?void 0:t.end}}function eS(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{username:e.username,start:e.start,end:e.end}}(e,!1)}function ek(e){var t;return null==(t=e)?t:{url:null==t.url?void 0:t.url,expandedUrl:null==t.expandedUrl?void 0:t.expandedUrl,displayUrl:null==t.displayUrl?void 0:t.displayUrl,start:null==t.start?void 0:t.start,end:null==t.end?void 0:t.end}}function eC(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{url:e.url,expandedUrl:e.expandedUrl,displayUrl:e.displayUrl,start:e.start,end:e.end}}(e,!1)}function eq(e){var t;return null==(t=e)?t:{bitRate:null==t.bitRate?void 0:t.bitRate,contentType:null==t.contentType?void 0:t.contentType,url:null==t.url?void 0:t.url}}function eA(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{bitRate:e.bitRate,contentType:e.contentType,url:e.url}}(e,!1)}function eP(e){var t;return null==(t=e)?t:{mediaKey:null==t.mediaKey?void 0:t.mediaKey,type:null==t.type?void 0:t.type,url:null==t.url?void 0:t.url,width:null==t.width?void 0:t.width,height:null==t.height?void 0:t.height,previewImageUrl:null==t.previewImageUrl?void 0:t.previewImageUrl,variants:null==t.variants?void 0:t.variants.map(eq)}}function eE(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{mediaKey:e.mediaKey,type:e.type,url:e.url,width:e.width,height:e.height,previewImageUrl:e.previewImageUrl,variants:null==e.variants?void 0:e.variants.map(eA)}}(e,!1)}function eU(e){var t,n,i=e;if(null==i)return i;return{username:null==i.username?void 0:i.username,name:null==i.name?void 0:i.name,text:null==i.text?void 0:i.text,createTime:null==i.createTime?void 0:i.createTime,profileImageUrl:null==i.profileImageUrl?void 0:i.profileImageUrl,postId:null==i.postId?void 0:i.postId,citationId:null==i.citationId?void 0:i.citationId,parent:null==i.parent?void 0:eU(i.parent),parentPostId:null==i.parentPostId?void 0:i.parentPostId,quotePostId:null==i.quotePostId?void 0:i.quotePostId,quote:null==i.quote?void 0:eU(i.quote),viewCount:null==i.viewCount?void 0:i.viewCount,communityNote:null==i.communityNote?void 0:i.communityNote,verifiedType:null==i.verifiedType?void 0:i.verifiedType,publicMetrics:null==i.publicMetrics?void 0:(t=i.publicMetrics,null==t?t:{viewCount:null==t.viewCount?void 0:t.viewCount,likeCount:null==t.likeCount?void 0:t.likeCount,replyCount:null==t.replyCount?void 0:t.replyCount,retweetCount:null==t.retweetCount?void 0:t.retweetCount,quoteCount:null==t.quoteCount?void 0:t.quoteCount}),entities:null==i.entities?void 0:(n=i.entities,null==n?n:{media:null==n.media?void 0:n.media.map(eP),urls:null==n.urls?void 0:n.urls.map(ek),hashtags:null==n.hashtags?void 0:n.hashtags.map(eR),mentions:null==n.mentions?void 0:n.mentions.map(eb)}),textMarkdown:null==i.textMarkdown?void 0:i.textMarkdown}}function eM(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{username:e.username,name:e.name,text:e.text,createTime:e.createTime,profileImageUrl:e.profileImageUrl,postId:e.postId,citationId:e.citationId,parent:eM(e.parent),parentPostId:e.parentPostId,quotePostId:e.quotePostId,quote:eM(e.quote),viewCount:e.viewCount,communityNote:e.communityNote,verifiedType:e.verifiedType,publicMetrics:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{viewCount:e.viewCount,likeCount:e.likeCount,replyCount:e.replyCount,retweetCount:e.retweetCount,quoteCount:e.quoteCount}}(e.publicMetrics,!1),entities:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{media:null==e.media?void 0:e.media.map(eE),urls:null==e.urls?void 0:e.urls.map(eC),hashtags:null==e.hashtags?void 0:e.hashtags.map(eT),mentions:null==e.mentions?void 0:e.mentions.map(eS)}}(e.entities,!1),textMarkdown:e.textMarkdown}}(e,!1)}function e_(e){var t;return null==(t=e)?t:{fileId:null==t.fileId?void 0:t.fileId,name:null==t.name?void 0:t.name,sizeBytes:null==t.sizeBytes?void 0:t.sizeBytes,contentType:null==t.contentType?void 0:t.contentType,createdAt:null==t.createdAt?void 0:t.createdAt,expiresAt:null==t.expiresAt?void 0:t.expiresAt,uploadStatus:null==t.uploadStatus?void 0:t.uploadStatus,uploadErrorMessage:null==t.uploadErrorMessage?void 0:t.uploadErrorMessage,processingStatus:null==t.processingStatus?void 0:t.processingStatus,filePath:null==t.filePath?void 0:t.filePath,url:null==t.url?void 0:t.url,query:null==t.query?void 0:t.query,chunkContent:null==t.chunkContent?void 0:t.chunkContent,chunkId:null==t.chunkId?void 0:t.chunkId}}function ex(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{fileId:e.fileId,name:e.name,sizeBytes:e.sizeBytes,contentType:e.contentType,createdAt:e.createdAt,expiresAt:e.expiresAt,uploadStatus:e.uploadStatus,uploadErrorMessage:e.uploadErrorMessage,processingStatus:e.processingStatus,filePath:e.filePath,url:e.url,query:e.query,chunkContent:e.chunkContent,chunkId:e.chunkId}}(e,!1)}function eO(e){var t;return null==(t=e)?t:{url:null==t.url?void 0:t.url,title:null==t.title?void 0:t.title,preview:null==t.preview?void 0:t.preview,searchEngineText:null==t.searchEngineText?void 0:t.searchEngineText,description:null==t.description?void 0:t.description,siteName:null==t.siteName?void 0:t.siteName,metadataTitle:null==t.metadataTitle?void 0:t.metadataTitle,creator:null==t.creator?void 0:t.creator,image:null==t.image?void 0:t.image,favicon:null==t.favicon?void 0:t.favicon,citationId:null==t.citationId?void 0:t.citationId}}function eG(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{url:e.url,title:e.title,preview:e.preview,searchEngineText:e.searchEngineText,description:e.description,siteName:e.siteName,metadataTitle:e.metadataTitle,creator:e.creator,image:e.image,favicon:e.favicon,citationId:e.citationId}}(e,!1)}function eD(e){var t;return null==(t=e)?t:{fileId:null==t.fileId?void 0:t.fileId,connectorType:null==t.connectorType?void 0:ef(t.connectorType),query:null==t.query?void 0:t.query,documentType:null==t.documentType?void 0:t.documentType,documentTitle:null==t.documentTitle?void 0:t.documentTitle,documentSourceUrl:null==t.documentSourceUrl?void 0:t.documentSourceUrl,chunkContent:null==t.chunkContent?void 0:t.chunkContent,chunkId:null==t.chunkId?void 0:t.chunkId}}function eL(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{fileId:e.fileId,connectorType:e.connectorType,query:e.query,documentType:e.documentType,documentTitle:e.documentTitle,documentSourceUrl:e.documentSourceUrl,chunkContent:e.chunkContent,chunkId:e.chunkId}}(e,!1)}e.s(["GrokApiMemoryV2OperationType",()=>eF,"GrokApiMemoryV2OperationTypeFromJSON",()=>eN,"GrokApiMemoryV2OperationTypeToJSON",()=>ej],296135);let eF={MemoryV2OperationTypeAdd:"MEMORY_V2_OPERATION_TYPE_ADD",MemoryV2OperationTypeEdit:"MEMORY_V2_OPERATION_TYPE_EDIT",MemoryV2OperationTypeDelete:"MEMORY_V2_OPERATION_TYPE_DELETE"};function eN(e){return e}function ej(e){return e}function eB(e,t){return null==e?e:{oldMemorySubstring:null==e.oldMemorySubstring?void 0:e.oldMemorySubstring,newMemorySubstring:null==e.newMemorySubstring?void 0:e.newMemorySubstring,operationType:null==e.operationType?void 0:eN(e.operationType),expiresAtTimestamp:null==e.expiresAtTimestamp?void 0:e.expiresAtTimestamp}}function eV(e,t){return null==e?e:{results:null==e.results?void 0:e.results.map(eU)}}function eK(e,t){return null==e?e:{results:null==e.results?void 0:e.results.map(eD)}}function ez(e,t){return null==e?e:{results:null==e.results?void 0:e.results.map(ey)}}function eH(e,t){return null==e?e:{stdout:null==e.stdout?void 0:e.stdout,stderr:null==e.stderr?void 0:e.stderr,exitCode:null==e.exitCode?void 0:e.exitCode,commandTimedOut:null==e.commandTimedOut?void 0:e.commandTimedOut}}function eJ(e,t){return null==e?e:{results:null==e.results?void 0:e.results.map(e_)}}function eW(e,t){return null==e?e:{results:null==e.results?void 0:e.results.map(eO)}}function eY(e){var t;return null==(t=e)?t:{toolUsageCardId:null==t.toolUsageCardId?void 0:t.toolUsageCardId,webSearchResults:null==t.webSearchResults?void 0:eW(t.webSearchResults,!1),xSearchResults:null==t.xSearchResults?void 0:eV(t.xSearchResults,!1),ragResults:null==t.ragResults?void 0:ez(t.ragResults,!1),connectorSearchResults:null==t.connectorSearchResults?void 0:eK(t.connectorSearchResults,!1),collectionSearchResults:null==t.collectionSearchResults?void 0:eJ(t.collectionSearchResults,!1),memoryV2UpdateResult:null==t.memoryV2UpdateResult?void 0:eB(t.memoryV2UpdateResult,!1),codeExecutionResult:null==t.codeExecutionResult?void 0:eH(t.codeExecutionResult,!1)}}function eX(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{toolUsageCardId:e.toolUsageCardId,webSearchResults:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{results:null==e.results?void 0:e.results.map(eG)}}(e.webSearchResults,!1),xSearchResults:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{results:null==e.results?void 0:e.results.map(eM)}}(e.xSearchResults,!1),ragResults:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{results:null==e.results?void 0:e.results.map(eI)}}(e.ragResults,!1),connectorSearchResults:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{results:null==e.results?void 0:e.results.map(eL)}}(e.connectorSearchResults,!1),collectionSearchResults:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{results:null==e.results?void 0:e.results.map(ex)}}(e.collectionSearchResults,!1),memoryV2UpdateResult:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{oldMemorySubstring:e.oldMemorySubstring,newMemorySubstring:e.newMemorySubstring,operationType:e.operationType,expiresAtTimestamp:e.expiresAtTimestamp}}(e.memoryV2UpdateResult,!1),codeExecutionResult:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{stdout:e.stdout,stderr:e.stderr,exitCode:e.exitCode,commandTimedOut:e.commandTimedOut}}(e.codeExecutionResult,!1)}}(e,!1)}function e$(e){var t;return null==(t=e)?t:{text:null==t.text?void 0:t.text,tags:null==t.tags?void 0:t.tags,webSearchResults:null==t.webSearchResults?void 0:t.webSearchResults.map(eO),xpostIds:null==t.xpostIds?void 0:t.xpostIds,xposts:null==t.xposts?void 0:t.xposts.map(eU),toolUsageResults:null==t.toolUsageResults?void 0:t.toolUsageResults.map(eY),rolloutId:null==t.rolloutId?void 0:t.rolloutId,ragResults:null==t.ragResults?void 0:t.ragResults.map(ey),connectorSearchResults:null==t.connectorSearchResults?void 0:t.connectorSearchResults.map(eD),collectionSearchResults:null==t.collectionSearchResults?void 0:t.collectionSearchResults.map(e_)}}function eQ(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{text:e.text,tags:e.tags,webSearchResults:null==e.webSearchResults?void 0:e.webSearchResults.map(eG),xpostIds:e.xpostIds,xposts:null==e.xposts?void 0:e.xposts.map(eM),toolUsageResults:null==e.toolUsageResults?void 0:e.toolUsageResults.map(eX),rolloutId:e.rolloutId,ragResults:null==e.ragResults?void 0:e.ragResults.map(eI),connectorSearchResults:null==e.connectorSearchResults?void 0:e.connectorSearchResults.map(eL),collectionSearchResults:null==e.collectionSearchResults?void 0:e.collectionSearchResults.map(ex)}}(e,!1)}function eZ(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{darkModeEnabled:e.darkModeEnabled,devicePixelRatio:e.devicePixelRatio,screenWidth:e.screenWidth,screenHeight:e.screenHeight,viewportWidth:e.viewportWidth,viewportHeight:e.viewportHeight}}function e0(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{storyId:e.storyId,source:e.source}}(e,!1)}e.s(["ModelConfigModelMode",()=>e1,"ModelConfigModelModeFromJSON",()=>e2,"ModelConfigModelModeToJSON",()=>e4],318726);let e1={ModelModeUnknown:"MODEL_MODE_UNKNOWN",ModelModeAuto:"MODEL_MODE_AUTO",ModelModeFast:"MODEL_MODE_FAST",ModelModeExpert:"MODEL_MODE_EXPERT",ModelModeHeavy:"MODEL_MODE_HEAVY",ModelModeGrok4MiniThinking:"MODEL_MODE_GROK_4_MINI_THINKING",ModelModeGrok41:"MODEL_MODE_GROK_4_1",ModelModeGrok41Thinking:"MODEL_MODE_GROK_4_1_THINKING",ModelModeGrok41Nightly:"MODEL_MODE_GROK_4_1_NIGHTLY"};function e2(e){return e}function e4(e){return e}function e3(e){return e}function e6(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{connectorId:e.connectorId,attributes:null==e.attributes?void 0:e.attributes.map(e3)}}(e,!1)}function e5(e,t){return null==e?e:{imageGen:null==e.imageGen?void 0:e.imageGen,webSearch:null==e.webSearch?void 0:e.webSearch,xSearch:null==e.xSearch?void 0:e.xSearch,xMediaSearch:null==e.xMediaSearch?void 0:e.xMediaSearch,trendsSearch:null==e.trendsSearch?void 0:e.trendsSearch,xPostAnalyze:null==e.xPostAnalyze?void 0:e.xPostAnalyze,videoGen:null==e.videoGen?void 0:e.videoGen,audioGen:null==e.audioGen?void 0:e.audioGen,gmailSearch:null==e.gmailSearch?void 0:e.gmailSearch,googleCalendarSearch:null==e.googleCalendarSearch?void 0:e.googleCalendarSearch}}function e7(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{imageGen:e.imageGen,webSearch:e.webSearch,xSearch:e.xSearch,xMediaSearch:e.xMediaSearch,trendsSearch:e.trendsSearch,xPostAnalyze:e.xPostAnalyze,videoGen:e.videoGen,audioGen:e.audioGen,gmailSearch:e.gmailSearch,googleCalendarSearch:e.googleCalendarSearch}}function e8(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{calculatorTool:e.calculatorTool,unitConversionTool:e.unitConversionTool}}function e9(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{latitude:e.latitude,longitude:e.longitude,accuracy:e.accuracy}}function te(e){var t,n=e;if(null==n)return n;return{properties:null==n.properties?void 0:(t=n.properties,null==t?t:{messageType:null==t.messageType?void 0:t.messageType,followUpType:null==t.followUpType?void 0:t.followUpType}),label:null==n.label?void 0:n.label,toolOverrides:null==n.toolOverrides?void 0:e5(n.toolOverrides,!1)}}function tt(e,t){var n,i;if(null==e)return e;return{title:null==e.title?void 0:e.title,subtitle:null==e.subtitle?void 0:e.subtitle,body:null==e.body?void 0:e.body,calculatorTool:null==e.calculatorTool?void 0:(n=e.calculatorTool,null==n?n:{kind:null==n.kind?void 0:n.kind,expression:null==n.expression?void 0:n.expression,result:null==n.result?void 0:n.result}),unitConversionTool:null==e.unitConversionTool?void 0:(i=e.unitConversionTool,null==i?i:{kind:null==i.kind?void 0:i.kind,sourceUnit:null==i.sourceUnit?void 0:i.sourceUnit,sourceValue:null==i.sourceValue?void 0:i.sourceValue,targetUnit:null==i.targetUnit?void 0:i.targetUnit,targetValue:null==i.targetValue?void 0:i.targetValue,unitType:null==i.unitType?void 0:i.unitType})}}function tn(e){var t;return null==(t=e)?t:{valueId:null==t.valueId?void 0:t.valueId,label:null==t.label?void 0:t.label}}e.s(["GrokApiTextBoxSize",()=>ti,"GrokApiTextBoxSizeFromJSON",()=>to,"GrokApiTextBoxSizeToJSON",()=>tr],790182);let ti={TextBoxSizeUnspecified:"TEXT_BOX_SIZE_UNSPECIFIED",TextBoxSizeSm:"TEXT_BOX_SIZE_SM",TextBoxSizeMd:"TEXT_BOX_SIZE_MD",TextBoxSizeLg:"TEXT_BOX_SIZE_LG"};function to(e){return e}function tr(e){return e}function ta(e){return function(e,t){var n,i,o;if(null==e)return e;return{textBox:null==e.textBox?void 0:(n=e.textBox,null==n?n:{id:null==n.id?void 0:n.id,placeholder:null==n.placeholder?void 0:n.placeholder,size:null==n.size?void 0:to(n.size)}),likert:null==e.likert?void 0:(i=e.likert,null==i?i:{id:null==i.id?void 0:i.id,labels:null==i.labels?void 0:i.labels,values:null==i.values?void 0:i.values.map(tn)}),thumbs:null==e.thumbs?void 0:(o=e.thumbs,null==o?o:{id:null==o.id?void 0:o.id,labels:null==o.labels?void 0:o.labels,values:null==o.values?void 0:o.values.map(tn)})}}(e,0)}function ts(e,t){var n;if(null==e)return e;return{singleThinkingDifferentSummary:null==e.singleThinkingDifferentSummary?void 0:function(e,t){var n,i;if(null==e)return e;return{kind:null==e.kind?void 0:(n=e.kind,n),sideBySideSingleThinkIndex:null==e.sideBySideSingleThinkIndex?void 0:e.sideBySideSingleThinkIndex,enablePreferButtonTrigger:null==e.enablePreferButtonTrigger?void 0:(i=e.enablePreferButtonTrigger,i)}}(e.singleThinkingDifferentSummary,0),enablePreferButtonTrigger:null==e.enablePreferButtonTrigger?void 0:(n=e.enablePreferButtonTrigger,n),streamFinalAnswersTogether:null==e.streamFinalAnswersTogether?void 0:e.streamFinalAnswersTogether,hideThinkingTrace:null==e.hideThinkingTrace?void 0:e.hideThinkingTrace,useLengthControlContainer:null==e.useLengthControlContainer?void 0:e.useLengthControlContainer}}e.s(["GrokApiV2UploadedFileSourceType",()=>tl,"GrokApiV2UploadedFileSourceTypeFromJSON",()=>td,"GrokApiV2UploadedFileSourceTypeToJSON",()=>tu],556068);let tl={SelfUploadFileSource:"SELF_UPLOAD_FILE_SOURCE",GoogleDriveFileSource:"GOOGLE_DRIVE_FILE_SOURCE",OneDriveFileSource:"ONE_DRIVE_FILE_SOURCE",ImagineSelfUploadFileSource:"IMAGINE_SELF_UPLOAD_FILE_SOURCE",ImagineGeneratedFileSource:"IMAGINE_GENERATED_FILE_SOURCE"};function td(e){return e}function tu(e){return e}function tc(e){var t;return null==(t=e)?t:{fileMetadataId:null==t.fileMetadataId?void 0:t.fileMetadataId,fileMimeType:null==t.fileMimeType?void 0:t.fileMimeType,fileName:null==t.fileName?void 0:t.fileName,fileUri:null==t.fileUri?void 0:t.fileUri,parsedFileUri:null==t.parsedFileUri?void 0:t.parsedFileUri,createTime:null==t.createTime?void 0:t.createTime,fileSource:null==t.fileSource?void 0:td(t.fileSource),thirdPartyFileId:null==t.thirdPartyFileId?void 0:t.thirdPartyFileId,thirdPartyFileMimeType:null==t.thirdPartyFileMimeType?void 0:t.thirdPartyFileMimeType}}function th(e){var t;return null==(t=e)?t:{followupId:null==t.followupId?void 0:t.followupId,label:null==t.label?void 0:t.label,prompt:null==t.prompt?void 0:t.prompt}}function tp(e){var t,n,i=e;if(null==i)return i;return{storyId:null==i.storyId?void 0:i.storyId,title:null==i.title?void 0:i.title,summary:null==i.summary?void 0:i.summary,createTime:null==i.createTime?void 0:i.createTime,updateTime:null==i.updateTime?void 0:i.updateTime,followups:null==i.followups?void 0:i.followups.map(th),grokAnalysis:null==i.grokAnalysis?void 0:i.grokAnalysis,source:null==i.source?void 0:(t=i.source,t),thumbnailImageUrl:null==i.thumbnailImageUrl?void 0:i.thumbnailImageUrl,coverImageUrl:null==i.coverImageUrl?void 0:i.coverImageUrl,article:null==i.article?void 0:(n=i.article,null==n?n:{content:null==n.content?void 0:n.content,webResults:null==n.webResults?void 0:n.webResults.map(eO),xPosts:null==n.xPosts?void 0:n.xPosts.map(eU),cardAttachments:null==n.cardAttachments?void 0:n.cardAttachments,followUpSuggestions:null==n.followUpSuggestions?void 0:n.followUpSuggestions.map(te)}),xPostIds:null==i.xPostIds?void 0:i.xPostIds}}e.s(["GrokApiReasoningUiLayout",()=>tm,"GrokApiReasoningUiLayoutFromJSON",()=>tv,"GrokApiReasoningUiLayoutToJSON",()=>tw],497522);let tm={Unspecified:"UNSPECIFIED",Unified:"UNIFIED",Split:"SPLIT",Heavy:"HEAVY",FunctionCall:"FUNCTION_CALL"};function tv(e){return e}function tw(e){return e}e.s(["GrokApiUiLayoutEffort",()=>tf,"GrokApiUiLayoutEffortFromJSON",()=>tg,"GrokApiUiLayoutEffortToJSON",()=>ty],732299);let tf={Unspecified:"UNSPECIFIED",Low:"LOW",High:"HIGH",Auto:"AUTO"};function tg(e){return e}function ty(e){return e}function tI(e,t){return null==e?e:{reasoningUiLayout:null==e.reasoningUiLayout?void 0:tv(e.reasoningUiLayout),willThinkLong:null==e.willThinkLong?void 0:e.willThinkLong,effort:null==e.effort?void 0:tg(e.effort),steerModelId:null==e.steerModelId?void 0:e.steerModelId,rolloutIds:null==e.rolloutIds?void 0:e.rolloutIds}}function tR(e,t){return null==e?e:{url:null==e.url?void 0:e.url,height:null==e.height?void 0:e.height,width:null==e.width?void 0:e.width}}function tT(e){var t,n=e;if(null==n)return n;return{image:null==n.image?void 0:tR(n.image,!1),video:null==n.video?void 0:(t=n.video,null==t?t:{url:null==t.url?void 0:t.url,height:null==t.height?void 0:t.height,width:null==t.width?void 0:t.width,durationSeconds:null==t.durationSeconds?void 0:t.durationSeconds,thumbnail:null==t.thumbnail?void 0:tR(t.thumbnail,!1)})}}e.s(["GrokApiProductCondition",()=>tb,"GrokApiProductConditionFromJSON",()=>tS,"GrokApiProductConditionToJSON",()=>tk],263457);let tb={New:"NEW",Refurbished:"REFURBISHED",Used:"USED"};function tS(e){return e}function tk(e){return e}e.s(["GrokApiProductAvailability",()=>tC,"GrokApiProductAvailabilityFromJSON",()=>tq,"GrokApiProductAvailabilityToJSON",()=>tA],801384);let tC={InStock:"IN_STOCK",AvailableForOrder:"AVAILABLE_FOR_ORDER",OutOfStock:"OUT_OF_STOCK",Discontinued:"DISCONTINUED",Preorder:"PREORDER"};function tq(e){return e}function tA(e){return e}function tP(e){var t,n,i=e;if(null==i)return i;return{merchant:null==i.merchant?void 0:(t=i.merchant,null==t?t:{merchantId:null==t.merchantId?void 0:t.merchantId,name:null==t.name?void 0:t.name,iconUrl:null==t.iconUrl?void 0:t.iconUrl}),availability:null==i.availability?void 0:tq(i.availability),url:null==i.url?void 0:i.url,condition:null==i.condition?void 0:tS(i.condition),price:null==i.price?void 0:(n=i.price,null==n?n:{currencyCode:null==n.currencyCode?void 0:n.currencyCode,amount:null==n.amount?void 0:n.amount}),action:null==i.action?void 0:function(e,t){var n;if(null==e)return e;return{link:null==e.link?void 0:(n=e.link,null==n?n:{url:null==n.url?void 0:n.url})}}(i.action,0)}}function tE(e){var t;return null==(t=e)?t:{name:null==t.name?void 0:t.name,sourceProductId:null==t.sourceProductId?void 0:t.sourceProductId}}function tU(e){var t,n=e;if(null==n)return n;return{gender:null==n.gender?void 0:function(e,t){var n;if(null==e)return e;return{value:null==e.value?void 0:(n=e.value,n)}}(n.gender,0),custom:null==n.custom?void 0:(t=n.custom,null==t?t:{name:null==t.name?void 0:t.name,value:null==t.value?void 0:t.value})}}function tM(e){var t;return null==(t=e)?t:{searchProductResultId:null==t.searchProductResultId?void 0:t.searchProductResultId,product:null==t.product?void 0:function e(t){var n,i,o=t;if(null==o)return o;return{productId:null==o.productId?void 0:o.productId,identifiers:null==o.identifiers?void 0:o.identifiers.map(tE),title:null==o.title?void 0:o.title,description:null==o.description?void 0:o.description,attributes:null==o.attributes?void 0:o.attributes.map(tU),mediaItems:null==o.mediaItems?void 0:o.mediaItems.map(tT),brand:null==o.brand?void 0:(n=o.brand,null==n?n:{name:null==n.name?void 0:n.name,iconUrl:null==n.iconUrl?void 0:n.iconUrl}),ratingsBreakdown:null==o.ratingsBreakdown?void 0:(i=o.ratingsBreakdown,null==i?i:{averageRating:null==i.averageRating?void 0:i.averageRating,totalReviews:null==i.totalReviews?void 0:i.totalReviews}),variants:null==o.variants?void 0:o.variants.map(e),offerings:null==o.offerings?void 0:o.offerings.map(tP)}}(t.product)}}function t_(e){var t,n=e;if(null==n)return n;return{responseId:null==n.responseId?void 0:n.responseId,message:null==n.message?void 0:n.message,sender:null==n.sender?void 0:n.sender,createTime:null==n.createTime?void 0:n.createTime,parentResponseId:null==n.parentResponseId?void 0:n.parentResponseId,manual:null==n.manual?void 0:n.manual,partial:null==n.partial?void 0:n.partial,shared:null==n.shared?void 0:n.shared,query:null==n.query?void 0:n.query,queryType:null==n.queryType?void 0:n.queryType,webSearchResults:null==n.webSearchResults?void 0:n.webSearchResults.map(eO),xpostIds:null==n.xpostIds?void 0:n.xpostIds,xposts:null==n.xposts?void 0:n.xposts.map(eU),generatedImageUrls:null==n.generatedImageUrls?void 0:n.generatedImageUrls,imageAttachments:null==n.imageAttachments?void 0:n.imageAttachments,fileAttachments:null==n.fileAttachments?void 0:n.fileAttachments,cardAttachmentsJson:null==n.cardAttachmentsJson?void 0:n.cardAttachmentsJson,fileUris:null==n.fileUris?void 0:n.fileUris,fileAttachmentsMetadata:null==n.fileAttachmentsMetadata?void 0:n.fileAttachmentsMetadata.map(tc),isControl:null==n.isControl?void 0:n.isControl,thinkingTrace:null==n.thinkingTrace?void 0:n.thinkingTrace,steps:null==n.steps?void 0:n.steps.map(e$),imageEditUri:null==n.imageEditUri?void 0:n.imageEditUri,imageEditUris:null==n.imageEditUris?void 0:n.imageEditUris,error:null==n.error?void 0:n.error,mediaTypes:null==n.mediaTypes?void 0:n.mediaTypes,webpageUrls:null==n.webpageUrls?void 0:n.webpageUrls,metadata:null==n.metadata?void 0:n.metadata,generatedImageHeight:null==n.generatedImageHeight?void 0:n.generatedImageHeight,generatedImageWidth:null==n.generatedImageWidth?void 0:n.generatedImageWidth,uiLayout:null==n.uiLayout?void 0:tI(n.uiLayout,!1),thinkingStartTime:null==n.thinkingStartTime?void 0:n.thinkingStartTime,thinkingEndTime:null==n.thinkingEndTime?void 0:n.thinkingEndTime,citedWebSearchResults:null==n.citedWebSearchResults?void 0:n.citedWebSearchResults.map(eO),selectedFileTextContent:null==n.selectedFileTextContent?void 0:n.selectedFileTextContent,selectedFileTextContentStartPosition:null==n.selectedFileTextContentStartPosition?void 0:n.selectedFileTextContentStartPosition,selectedFileTextContentEndPosition:null==n.selectedFileTextContentEndPosition?void 0:n.selectedFileTextContentEndPosition,toolResponses:null==n.toolResponses?void 0:n.toolResponses,threadParentId:null==n.threadParentId?void 0:n.threadParentId,parentQuotedText:null==n.parentQuotedText?void 0:n.parentQuotedText,model:null==n.model?void 0:n.model,sideBySideConfig:null==n.sideBySideConfig?void 0:ts(n.sideBySideConfig,!1),fastToolResponse:null==n.fastToolResponse?void 0:tt(n.fastToolResponse,!1),requestMetadata:null==n.requestMetadata?void 0:(t=n.requestMetadata,null==t?t:{model:null==t.model?void 0:t.model,mode:null==t.mode?void 0:e2(t.mode),effort:null==t.effort?void 0:tg(t.effort)}),ragResults:null==n.ragResults?void 0:n.ragResults.map(ey),citedRagResults:null==n.citedRagResults?void 0:n.citedRagResults.map(ey),searchProductResults:null==n.searchProductResults?void 0:n.searchProductResults.map(tM),connectorSearchResults:null==n.connectorSearchResults?void 0:n.connectorSearchResults.map(eD),collectionSearchResults:null==n.collectionSearchResults?void 0:n.collectionSearchResults.map(e_),highlightsStories:null==n.highlightsStories?void 0:n.highlightsStories.map(tp)}}function tx(e){return e}function tO(e){var t;return null==(t=e)?t:{id:null==t.id?void 0:t.id,labelEn:null==t.labelEn?void 0:t.labelEn,icon:null==t.icon?void 0:t.icon}}e.s(["GrokApiProgressReportCategory",()=>tG,"GrokApiProgressReportCategoryFromJSON",()=>tD,"GrokApiProgressReportCategoryToJSON",()=>tL],36023);let tG={ProgressReportCategoryUnknown:"PROGRESS_REPORT_CATEGORY_UNKNOWN",ProgressReportCategoryAttachmentsPreprocessing:"PROGRESS_REPORT_CATEGORY_ATTACHMENTS_PREPROCESSING",ProgressReportCategoryHistoryAttachmentsPreprocessing:"PROGRESS_REPORT_CATEGORY_HISTORY_ATTACHMENTS_PREPROCESSING",ProgressReportCategoryWebpageAttachmentsPreprocessing:"PROGRESS_REPORT_CATEGORY_WEBPAGE_ATTACHMENTS_PREPROCESSING",ProgressReportCategoryHistoryWebpageAttachmentsPreprocessing:"PROGRESS_REPORT_CATEGORY_HISTORY_WEBPAGE_ATTACHMENTS_PREPROCESSING",ToolProcessing:"TOOL_PROCESSING",HeavyRollout:"HEAVY_ROLLOUT"};function tD(e){return e}function tL(e){return e}function tF(e){var t;return null==(t=e)?t:{conversationId:null==t.conversationId?void 0:t.conversationId,summary:null==t.summary?void 0:t.summary}}function tN(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{conversationId:e.conversationId,summary:e.summary}}(e,!1)}function tj(e,t){var n,i,o,r,a,s,l,d,u,c,h,p,m,v,w,f,g,y,I,R,T,b,S;if(null==e)return e;return{userResponse:null==e.userResponse?void 0:t_(e.userResponse),token:null==e.token?void 0:e.token,modelResponse:null==e.modelResponse?void 0:t_(e.modelResponse),queryAction:null==e.queryAction?void 0:(n=e.queryAction,null==n?n:{query:null==n.query?void 0:n.query,type:null==n.type?void 0:n.type}),imageGenerationResponse:null==e.imageGenerationResponse?void 0:(i=e.imageGenerationResponse,null==i?i:{generatedImageBytes:null==i.generatedImageBytes?void 0:i.generatedImageBytes,contentType:null==i.contentType?void 0:i.contentType}),xSearchResults:null==e.xSearchResults?void 0:eV(e.xSearchResults,!1),cachedImageGenerationResponse:null==e.cachedImageGenerationResponse?void 0:(o=e.cachedImageGenerationResponse,null==o?o:{imageUrl:null==o.imageUrl?void 0:o.imageUrl,moderated:null==o.moderated?void 0:o.moderated}),webSearchResults:null==e.webSearchResults?void 0:eW(e.webSearchResults,!1),grokInXaiRequest:null==e.grokInXaiRequest?void 0:(r=e.grokInXaiRequest,null==r?r:{requestJson:null==r.requestJson?void 0:r.requestJson}),followUpSuggestions:null==e.followUpSuggestions?void 0:(a=e.followUpSuggestions,null==a?a:{suggestions:null==a.suggestions?void 0:a.suggestions.map(te)}),streamingImageGenerationResponse:null==e.streamingImageGenerationResponse?void 0:(s=e.streamingImageGenerationResponse,null==s?s:{imageId:null==s.imageId?void 0:s.imageId,imageUrl:null==s.imageUrl?void 0:s.imageUrl,seq:null==s.seq?void 0:s.seq,progress:null==s.progress?void 0:s.progress,moderated:null==s.moderated?void 0:s.moderated,imageIndex:null==s.imageIndex?void 0:s.imageIndex,assetId:null==s.assetId?void 0:s.assetId,imageModel:null==s.imageModel?void 0:s.imageModel,rRated:null==s.rRated?void 0:s.rRated,sideBySideIndex:null==s.sideBySideIndex?void 0:s.sideBySideIndex}),cardAttachment:null==e.cardAttachment?void 0:(l=e.cardAttachment,null==l?l:{jsonData:null==l.jsonData?void 0:l.jsonData}),finalMetadata:null==e.finalMetadata?void 0:(d=e.finalMetadata,null==d?d:{followUpSuggestions:null==d.followUpSuggestions?void 0:d.followUpSuggestions.map(te),feedbackLabels:null==d.feedbackLabels?void 0:d.feedbackLabels.map(tO),toolsUsed:null==d.toolsUsed?void 0:e5(d.toolsUsed,!1),disclaimer:null==d.disclaimer?void 0:d.disclaimer}),imageAttachmentInfo:null==e.imageAttachmentInfo?void 0:(u=e.imageAttachmentInfo,null==u?u:{imageAttachmentCount:null==u.imageAttachmentCount?void 0:u.imageAttachmentCount}),bannerMessage:null==e.bannerMessage?void 0:(c=e.bannerMessage,null==c?c:{message:null==c.message?void 0:c.message}),disclaimer:null==e.disclaimer?void 0:(h=e.disclaimer,null==h?h:{message:null==h.message?void 0:h.message}),progressReport:null==e.progressReport?void 0:function(e,t){var n;if(null==e)return e;return{category:null==e.category?void 0:tD(e.category),state:null==e.state?void 0:(n=e.state,n),message:null==e.message?void 0:e.message,percentage:null==e.percentage?void 0:e.percentage}}(e.progressReport,0),memoryReferences:null==e.memoryReferences?void 0:(p=e.memoryReferences,null==p?p:{references:null==p.references?void 0:p.references.map(tF)}),imageDimensions:null==e.imageDimensions?void 0:(m=e.imageDimensions,null==m?m:{width:null==m.width?void 0:m.width,height:null==m.height?void 0:m.height}),followUpSuggestedMode:null==e.followUpSuggestedMode?void 0:(v=e.followUpSuggestedMode,null==v?v:{mode:null==v.mode?void 0:v.mode,web:null==v.web?void 0:v.web,mobile:null==v.mobile?void 0:v.mobile}),uiLayout:null==e.uiLayout?void 0:tI(e.uiLayout,!1),authNotification:null==e.authNotification?void 0:(w=e.authNotification,null==w?w:{providers:null==w.providers?void 0:w.providers.map(tx)}),citedWebSearchResults:null==e.citedWebSearchResults?void 0:eW(e.citedWebSearchResults,!1),toolRequest:null==e.toolRequest?void 0:(f=e.toolRequest,null==f?f:{name:null==f.name?void 0:f.name,args:null==f.args?void 0:f.args}),streamingVideoGenerationResponse:null==e.streamingVideoGenerationResponse?void 0:(g=e.streamingVideoGenerationResponse,null==g?g:{videoId:null==g.videoId?void 0:g.videoId,progress:null==g.progress?void 0:g.progress,assetId:null==g.assetId?void 0:g.assetId,videoUrl:null==g.videoUrl?void 0:g.videoUrl,audioUrls:null==g.audioUrls?void 0:g.audioUrls,videoPrompt:null==g.videoPrompt?void 0:g.videoPrompt,imageReference:null==g.imageReference?void 0:g.imageReference,audioTranscripts:null==g.audioTranscripts?void 0:g.audioTranscripts,moderated:null==g.moderated?void 0:g.moderated,mode:null==g.mode?void 0:g.mode,modelName:null==g.modelName?void 0:g.modelName,thumbnailImageUrl:null==g.thumbnailImageUrl?void 0:g.thumbnailImageUrl,parentPostId:null==g.parentPostId?void 0:g.parentPostId,videoPostId:null==g.videoPostId?void 0:g.videoPostId,sideBySideIndex:null==g.sideBySideIndex?void 0:g.sideBySideIndex,rRated:null==g.rRated?void 0:g.rRated,videoStreamingIndex:null==g.videoStreamingIndex?void 0:g.videoStreamingIndex,height:null==g.height?void 0:g.height,width:null==g.width?void 0:g.width,videoStreamingDuration:null==g.videoStreamingDuration?void 0:g.videoStreamingDuration,resolutionName:null==g.resolutionName?void 0:g.resolutionName}),sideBySideConfig:null==e.sideBySideConfig?void 0:ts(e.sideBySideConfig,!1),streamingAudioGenerationResponse:null==e.streamingAudioGenerationResponse?void 0:(y=e.streamingAudioGenerationResponse,null==y?y:{videoId:null==y.videoId?void 0:y.videoId,audioUrls:null==y.audioUrls?void 0:y.audioUrls}),effortDecision:null==e.effortDecision?void 0:function(e,t){var n;if(null==e)return e;return{effort:null==e.effort?void 0:(n=e.effort,n),steerModelId:null==e.steerModelId?void 0:e.steerModelId}}(e.effortDecision,0),llmInfo:null==e.llmInfo?void 0:(I=e.llmInfo,null==I?I:{modelHash:null==I.modelHash?void 0:I.modelHash}),fastToolResponse:null==e.fastToolResponse?void 0:tt(e.fastToolResponse,!1),survey:null==e.survey?void 0:(R=e.survey,null==R?R:{surveyTitle:null==R.surveyTitle?void 0:R.surveyTitle,statsigSurveyName:null==R.statsigSurveyName?void 0:R.statsigSurveyName,elements:null==R.elements?void 0:R.elements.map(ta)}),ragResults:null==e.ragResults?void 0:ez(e.ragResults,!1),citedRagResults:null==e.citedRagResults?void 0:ez(e.citedRagResults,!1),searchProductResults:null==e.searchProductResults?void 0:(T=e.searchProductResults,null==T?T:{results:null==T.results?void 0:T.results.map(tM)}),connectorSearchResults:null==e.connectorSearchResults?void 0:eK(e.connectorSearchResults,!1),collectionSearchResults:null==e.collectionSearchResults?void 0:eJ(e.collectionSearchResults,!1),memoryV2UpdateResult:null==e.memoryV2UpdateResult?void 0:eB(e.memoryV2UpdateResult,!1),codeExecutionResult:null==e.codeExecutionResult?void 0:eH(e.codeExecutionResult,!1),error:null==e.error?void 0:(b=e.error,null==b?b:{message:null==b.message?void 0:b.message,globalRateLimit:null==b.globalRateLimit?void 0:b.globalRateLimit,modelNotAvailable:null==b.modelNotAvailable?void 0:b.modelNotAvailable}),sideBySideIndex:null==e.sideBySideIndex?void 0:e.sideBySideIndex,isThinking:null==e.isThinking?void 0:e.isThinking,isSoftStop:null==e.isSoftStop?void 0:e.isSoftStop,messageTag:null==e.messageTag?void 0:e.messageTag,messageStepId:null==e.messageStepId?void 0:e.messageStepId,responseId:null==e.responseId?void 0:e.responseId,streamingMetadata:null==e.streamingMetadata?void 0:(S=e.streamingMetadata,null==S?S:{streamKey:null==S.streamKey?void 0:S.streamKey,msgId:null==S.msgId?void 0:S.msgId}),toolUsageCardId:null==e.toolUsageCardId?void 0:e.toolUsageCardId,rolloutId:null==e.rolloutId?void 0:e.rolloutId}}function tB(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{id:e.id,text:e.text}}(e,!1)}function tV(e){var t;return null==(t=e)?t:{label:null==t.label?void 0:t.label,query:null==t.query?void 0:t.query,inputGuide:null==t.inputGuide?void 0:t.inputGuide,placeholderLabelsJson:null==t.placeholderLabelsJson?void 0:t.placeholderLabelsJson}}function tK(e){var t,n,i=e;if(null==i)return i;return{workspaceId:null==i.workspaceId?void 0:i.workspaceId,name:null==i.name?void 0:i.name,createTime:null==i.createTime?void 0:i.createTime,lastUseTime:null==i.lastUseTime?void 0:i.lastUseTime,icon:null==i.icon?void 0:i.icon,customPersonality:null==i.customPersonality?void 0:i.customPersonality,preferredModel:null==i.preferredModel?void 0:i.preferredModel,isPublic:null==i.isPublic?void 0:i.isPublic,isReadonly:null==i.isReadonly?void 0:i.isReadonly,accessLevel:null==i.accessLevel?void 0:(t=i.accessLevel,t),teamId:null==i.teamId?void 0:i.teamId,conversationStarters:null==i.conversationStarters?void 0:i.conversationStarters,viewCount:null==i.viewCount?void 0:i.viewCount,conversationsCreatedCount:null==i.conversationsCreatedCount?void 0:i.conversationsCreatedCount,cloneCount:null==i.cloneCount?void 0:i.cloneCount,conversationTemplates:null==i.conversationTemplates?void 0:(n=i.conversationTemplates,null==n?n:{templates:null==n.templates?void 0:n.templates.map(tV)})}}e.s(["GrokApiV2TaskResultStatus",()=>tz,"GrokApiV2TaskResultStatusFromJSON",()=>tH,"GrokApiV2TaskResultStatusToJSON",()=>tJ],47e3);let tz={TaskResultPending:"TASK_RESULT_PENDING",TaskResultSuccess:"TASK_RESULT_SUCCESS",TaskResultError:"TASK_RESULT_ERROR"};function tH(e){return e}function tJ(e){return e}function tW(e){var t,n=e;if(null==n)return n;return{scheduleId:null==n.scheduleId?void 0:n.scheduleId,taskCadence:null==n.taskCadence?void 0:(t=n.taskCadence,t),isEnabled:null==n.isEnabled?void 0:n.isEnabled,nextRun:null==n.nextRun?void 0:n.nextRun,dayOfWeek:null==n.dayOfWeek?void 0:n.dayOfWeek,dayOfMonth:null==n.dayOfMonth?void 0:n.dayOfMonth,dayOfYear:null==n.dayOfYear?void 0:n.dayOfYear,timeOfDay:null==n.timeOfDay?void 0:n.timeOfDay,timezone:null==n.timezone?void 0:n.timezone,isCompleted:null==n.isCompleted?void 0:n.isCompleted,endDate:null==n.endDate?void 0:n.endDate}}e.s(["GrokApiV2ModelMode",()=>tY,"GrokApiV2ModelModeFromJSON",()=>tX,"GrokApiV2ModelModeToJSON",()=>t$],126570);let tY={Base:"BASE",Think:"THINK",Deepsearch:"DEEPSEARCH",Imagegen:"IMAGEGEN"};function tX(e){return e}function t$(e){return e}function tQ(e){var t;return null==(t=e)?t:{conversationId:null==t.conversationId?void 0:t.conversationId,title:null==t.title?void 0:t.title,starred:null==t.starred?void 0:t.starred,createTime:null==t.createTime?void 0:t.createTime,modifyTime:null==t.modifyTime?void 0:t.modifyTime,systemPromptName:null==t.systemPromptName?void 0:t.systemPromptName,temporary:null==t.temporary?void 0:t.temporary,mediaTypes:null==t.mediaTypes?void 0:t.mediaTypes,workspaces:null==t.workspaces?void 0:t.workspaces.map(tK),taskResult:null==t.taskResult?void 0:function(e,t){var n;if(null==e)return e;return{task:null==e.task?void 0:(n=e.task,null==n?n:{task:null==n.task?void 0:function(e,t){var n;if(null==e)return e;return{taskId:null==e.taskId?void 0:e.taskId,userId:null==e.userId?void 0:e.userId,name:null==e.name?void 0:e.name,prompt:null==e.prompt?void 0:e.prompt,metadataJsonString:null==e.metadataJsonString?void 0:e.metadataJsonString,isActive:null==e.isActive?void 0:e.isActive,notificationMethod:null==e.notificationMethod?void 0:(n=e.notificationMethod,n),modelMode:null==e.modelMode?void 0:tX(e.modelMode),notificationDeciderEnable:null==e.notificationDeciderEnable?void 0:e.notificationDeciderEnable,notificationDeciderGuideline:null==e.notificationDeciderGuideline?void 0:e.notificationDeciderGuideline,modelName:null==e.modelName?void 0:e.modelName,toolset:null==e.toolset?void 0:e.toolset,teamId:null==e.teamId?void 0:e.teamId}}(n.task,0),schedules:null==n.schedules?void 0:n.schedules.map(tW)}),result:null==e.result?void 0:function(e,t){var n;if(null==e)return e;return{taskResultId:null==e.taskResultId?void 0:e.taskResultId,title:null==e.title?void 0:e.title,conversationId:null==e.conversationId?void 0:e.conversationId,status:null==e.status?void 0:tH(e.status),error:null==e.error?void 0:e.error,createTime:null==e.createTime?void 0:e.createTime,updateTime:null==e.updateTime?void 0:e.updateTime,isRead:null==e.isRead?void 0:e.isRead,execTime:null==e.execTime?void 0:e.execTime,scheduleId:null==e.scheduleId?void 0:e.scheduleId,notificationDecision:null==e.notificationDecision?void 0:(n=e.notificationDecision,n),taskId:null==e.taskId?void 0:e.taskId}}(e.result,0)}}(t.taskResult,0),teamId:null==t.teamId?void 0:t.teamId,xUserId:null==t.xUserId?void 0:t.xUserId,templateId:null==t.templateId?void 0:t.templateId,voiceChatAssetUrl:null==t.voiceChatAssetUrl?void 0:t.voiceChatAssetUrl,voiceChatAlignmentInfo:null==t.voiceChatAlignmentInfo?void 0:t.voiceChatAlignmentInfo,voiceChatSessionMetadata:null==t.voiceChatSessionMetadata?void 0:t.voiceChatSessionMetadata}}function tZ(e,t){return null==e?e:{newTitle:null==e.newTitle?void 0:e.newTitle}}function t0(e,t){return null==e?e:{numDeleted:null==e.numDeleted?void 0:e.numDeleted}}function t1(e){var t;return null==(t=e)?t:{id:null==t.id?void 0:t.id,content:null==t.content?void 0:t.content,companionId:null==t.companionId?void 0:t.companionId,createdAt:null==t.createdAt?void 0:t.createdAt,updatedAt:null==t.updatedAt?void 0:t.updatedAt,expiresAt:null==t.expiresAt?void 0:t.expiresAt}}function t2(e){var t,n=e;if(null==n)return n;return{artifactId:null==n.artifactId?void 0:n.artifactId,conversationId:null==n.conversationId?void 0:n.conversationId,title:null==n.title?void 0:n.title,contentType:null==n.contentType?void 0:n.contentType,createTime:null==n.createTime?void 0:n.createTime,inlineStatus:null==n.inlineStatus?void 0:(t=n.inlineStatus,t),updateTime:null==n.updateTime?void 0:n.updateTime}}function t4(e){var t,n=e;if(null==n)return n;return{artifactId:null==n.artifactId?void 0:n.artifactId,artifactVersionId:null==n.artifactVersionId?void 0:n.artifactVersionId,title:null==n.title?void 0:n.title,contentType:null==n.contentType?void 0:n.contentType,conversationId:null==n.conversationId?void 0:n.conversationId,responseId:null==n.responseId?void 0:n.responseId,fullArtifact:null==n.fullArtifact?void 0:n.fullArtifact,artifactDiff:null==n.artifactDiff?void 0:n.artifactDiff,createTime:null==n.createTime?void 0:n.createTime,inlineStatus:null==n.inlineStatus?void 0:(t=n.inlineStatus,t),updateTime:null==n.updateTime?void 0:n.updateTime}}function t3(e,t){return null==e?e:{teamId:null==e.teamId?void 0:e.teamId,switchToPersonalTeam:null==e.switchToPersonalTeam?void 0:e.switchToPersonalTeam}}function t6(e){var t;return null==(t=e)?t:{convoId:null==t.convoId?void 0:t.convoId,convoSummary:null==t.convoSummary?void 0:t.convoSummary}}function t5(e){var t;return null==(t=e)?t:{text:null==t.text?void 0:t.text,type:null==t.type?void 0:t.type}}function t7(e,t){return null==e?e:{responses:null==e.responses?void 0:e.responses.map(t_),conversation:null==e.conversation?void 0:tQ(e.conversation),teamSwitchPrompt:null==e.teamSwitchPrompt?void 0:t3(e.teamSwitchPrompt,!1),allowIndexing:null==e.allowIndexing?void 0:e.allowIndexing,viewCount:null==e.viewCount?void 0:e.viewCount}}function t8(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{title:e.title,timestampMs:e.timestampMs}}(e,!1)}function t9(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{role:e.role,content:e.content}}(e,!1)}function ne(e,t){return null==e?e:{query:null==e.query?void 0:e.query,suggestions:null==e.suggestions?void 0:e.suggestions.map(t5)}}function nt(e){var t;return null==(t=e)?t:{id:null==t.id?void 0:t.id,name:null==t.name?void 0:t.name,mimeType:null==t.mimeType?void 0:t.mimeType}}function nn(e){var t;return null==(t=e)?t:{conversationId:null==t.conversationId?void 0:t.conversationId,imageUrl:null==t.imageUrl?void 0:t.imageUrl,imageQuery:null==t.imageQuery?void 0:t.imageQuery,assistantMessage:null==t.assistantMessage?void 0:t.assistantMessage,createTime:null==t.createTime?void 0:t.createTime,responseId:null==t.responseId?void 0:t.responseId}}function ni(e){var t,n=e;if(null==n)return n;return{responseId:null==n.responseId?void 0:n.responseId,status:null==n.status?void 0:(t=n.status,t),createTime:null==n.createTime?void 0:n.createTime,parentResponseId:null==n.parentResponseId?void 0:n.parentResponseId,threadParentId:null==n.threadParentId?void 0:n.threadParentId}}function no(e){var t,n=e;if(null==n)return n;return{conversation:null==n.conversation?void 0:tQ(n.conversation),matchType:null==n.matchType?void 0:(t=n.matchType,t),matchedResponseId:null==n.matchedResponseId?void 0:n.matchedResponseId,highlight:null==n.highlight?void 0:n.highlight,matchedWords:null==n.matchedWords?void 0:n.matchedWords}}function nr(e){var t;return null==(t=e)?t:{responseId:null==t.responseId?void 0:t.responseId,sender:null==t.sender?void 0:t.sender,parentResponseId:null==t.parentResponseId?void 0:t.parentResponseId,threadParentId:null==t.threadParentId?void 0:t.threadParentId}}function na(e){var t;return null==(t=e)?t:{shareLinkId:null==t.shareLinkId?void 0:t.shareLinkId,conversationId:null==t.conversationId?void 0:t.conversationId,conversationTitle:null==t.conversationTitle?void 0:t.conversationTitle,createTime:null==t.createTime?void 0:t.createTime}}function ns(e){var t;return null==(t=e)?t:{shareLinkId:null==t.shareLinkId?void 0:t.shareLinkId,conversationId:null==t.conversationId?void 0:t.conversationId,responseId:null==t.responseId?void 0:t.responseId,isPublic:null==t.isPublic?void 0:t.isPublic,createTime:null==t.createTime?void 0:t.createTime,modifyTime:null==t.modifyTime?void 0:t.modifyTime,teamId:null==t.teamId?void 0:t.teamId,sharedWithTeam:null==t.sharedWithTeam?void 0:t.sharedWithTeam,sharedWithUserIds:null==t.sharedWithUserIds?void 0:t.sharedWithUserIds,publicId:null==t.publicId?void 0:t.publicId,xaiUserId:null==t.xaiUserId?void 0:t.xaiUserId,sharedLink:null==t.sharedLink?void 0:t7(t.sharedLink,!1),viewCount:null==t.viewCount?void 0:t.viewCount}}function nl(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{xUserId:e.xUserId,xConversationId:e.xConversationId,xaiUserId:e.xaiUserId,xaiConversationId:e.xaiConversationId}}(e,!1)}function nd(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{conversationId:e.conversationId,title:e.title,createTime:e.createTime,modifyTime:e.modifyTime,starred:e.starred,systemPromptName:e.systemPromptName,isXShared:e.isXShared,controller:e.controller}}(e,!1)}function nu(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{responseId:e.responseId,conversationId:e.conversationId,message:e.message,sender:e.sender,createTime:e.createTime,parentResponseId:e.parentResponseId,partial:e.partial,query:e.query,queryType:e.queryType,webSearchResults:null==e.webSearchResults?void 0:e.webSearchResults.map(eG),xpostIds:e.xpostIds,generatedImageUrls:e.generatedImageUrls,imageAttachments:e.imageAttachments,fileAttachments:e.fileAttachments,cardAttachmentsJson:e.cardAttachmentsJson,thinkingTrace:e.thinkingTrace,steps:null==e.steps?void 0:e.steps.map(eQ),imageEditUri:e.imageEditUri,error:e.error,webpageUrls:e.webpageUrls,metadata:e.metadata,citedWebSearchResults:null==e.citedWebSearchResults?void 0:e.citedWebSearchResults.map(eG),memoryReferences:null==e.memoryReferences?void 0:e.memoryReferences.map(tN),uiLayout:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{reasoningUiLayout:e.reasoningUiLayout,willThinkLong:e.willThinkLong,effort:e.effort,steerModelId:e.steerModelId,rolloutIds:e.rolloutIds}}(e.uiLayout,!1),ragResults:null==e.ragResults?void 0:e.ragResults.map(eI),citedRagResults:null==e.citedRagResults?void 0:e.citedRagResults.map(eI),connectorSearchResults:null==e.connectorSearchResults?void 0:e.connectorSearchResults.map(eL),collectionSearchResults:null==e.collectionSearchResults?void 0:e.collectionSearchResults.map(ex)}}(e,!1)}function nc(e){var t;return null==(t=e)?t:{...t,type:null==t["@type"]?void 0:t["@type"]}}function nh(e){var t;return null==(t=e)?t:{code:null==t.code?void 0:t.code,message:null==t.message?void 0:t.message,details:null==t.details?void 0:t.details.map(nc)}}function np(e,t){return null==e?e:{result:null==e.result?void 0:tj(e.result,!1),error:null==e.error?void 0:nh(e.error)}}class nm extends ec{async chatAddModelResponseRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatAddModelResponse().');if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatAddModelResponse().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/conversations/{conversationId}/model-responses".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{message:e.message,partial:e.partial,parentResponseId:e.parentResponseId,webSearchResults:null==e.webSearchResults?void 0:e.webSearchResults.map(eG),xpostIds:e.xpostIds,cardAttachmentsJson:e.cardAttachmentsJson,thinkingTrace:e.thinkingTrace,steps:null==e.steps?void 0:e.steps.map(eQ),bannerMessage:e.bannerMessage,disclaimer:e.disclaimer}}(e.body,!1)},t),e=>t_(e))}async chatAddModelResponse(e,t){let n=await this.chatAddModelResponseRaw(e,t);return await n.value()}async chatAddResponseRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatAddResponse().');if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatAddResponse().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/conversations/{conversationId}/responses".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{message:e.message,modelName:e.modelName,parentResponseId:e.parentResponseId,parentQuotedText:e.parentQuotedText,disableSearch:e.disableSearch,enableImageGeneration:e.enableImageGeneration,imageAttachments:e.imageAttachments,returnImageBytes:e.returnImageBytes,returnRawGrokInXaiRequest:e.returnRawGrokInXaiRequest,fileAttachments:e.fileAttachments,enableImageStreaming:e.enableImageStreaming,imageGenerationCount:e.imageGenerationCount,forceConcise:e.forceConcise,toolOverrides:e7(e.toolOverrides,!1),enableSideBySide:e.enableSideBySide,sendFinalMetadata:e.sendFinalMetadata,customInstructions:e.customInstructions,customPersonality:e.customPersonality,deepsearchPreset:e.deepsearchPreset,imageEditUri:e.imageEditUri,isReasoning:e.isReasoning,systemPromptName:e.systemPromptName,webpageUrls:e.webpageUrls,metadata:e.metadata,imageEditUris:e.imageEditUris,disableTextFollowUps:e.disableTextFollowUps,disableArtifact:e.disableArtifact,followUpType:e.followUpType,disableArtifactDiff:e.disableArtifactDiff,doForceTriggerArtifact:e.doForceTriggerArtifact,isFromGrokFiles:e.isFromGrokFiles,resumeResponseId:e.resumeResponseId,selectedFileTextContent:e.selectedFileTextContent,selectedFileTextContentStartPosition:e.selectedFileTextContentStartPosition,selectedFileTextContentEndPosition:e.selectedFileTextContentEndPosition,disableMemory:e.disableMemory,forceSideBySide:e.forceSideBySide,threadParentId:e.threadParentId,modelMode:e.modelMode,modelsUserCanUse:e.modelsUserCanUse,skipResponseCache:e.skipResponseCache,isAsyncChat:e.isAsyncChat,skipCancelCurrentInflightRequests:e.skipCancelCurrentInflightRequests,enableNsfw:e.enableNsfw,isKidsMode:e.isKidsMode,supportedFastTools:e8(e.supportedFastTools,!1),isRegenRequest:e.isRegenRequest,companionId:e.companionId,disableSelfHarmShortCircuit:e.disableSelfHarmShortCircuit,collectionIds:e.collectionIds,connectorIds:e.connectorIds,connectors:null==e.connectors?void 0:e.connectors.map(e6),searchAllConnectors:e.searchAllConnectors,deviceEnvInfo:eZ(e.deviceEnvInfo,!1),modelOverrideKey:e.modelOverrideKey,browserGeoLocation:e9(e.browserGeoLocation,!1),highlightsStoryRequests:null==e.highlightsStoryRequests?void 0:e.highlightsStoryRequests.map(e0),disablePersonalization:e.disablePersonalization,imagineProjectId:e.imagineProjectId}}(e.body,!1)},t),e=>np(e,!1))}async chatAddResponse(e,t){let n=await this.chatAddResponseRaw(e,t);return await n.value()}async chatAddToolResponseRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatAddToolResponse().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/tool-responses",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{responseId:e.responseId,toolResponse:e.toolResponse}}(e.body,!1)},t))}async chatAddToolResponse(e,t){let n=await this.chatAddToolResponseRaw(e,t);return await n.value()}async chatAddUserResponseRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatAddUserResponse().');if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatAddUserResponse().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/conversations/{conversationId}/user-responses".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{message:e.message,parentResponseId:e.parentResponseId}}(e.body,!1)},t),e=>t_(e))}async chatAddUserResponse(e,t){let n=await this.chatAddUserResponseRaw(e,t);return await n.value()}async chatAskToShareConversationRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatAskToShareConversation().');if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatAskToShareConversation().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/conversations/{conversationId}/ask-to-share".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"POST",headers:n,query:{},body:e.body},t))}async chatAskToShareConversation(e,t){let n=await this.chatAskToShareConversationRaw(e,t);return await n.value()}async chatChooseSBSResponseRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatChooseSBSResponse().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/choose_sbs_response",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{conversationId:e.conversationId,responseId:e.responseId}}(e.body,!1)},t))}async chatChooseSBSResponse(e,t){let n=await this.chatChooseSBSResponseRaw(e,t);return await n.value()}async chatCloneConversationRaw(e,t){if(null==e.shareLinkId)throw new em("shareLinkId",'Required parameter "shareLinkId" was null or undefined when calling chatCloneConversation().');if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatCloneConversation().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/share_links/{shareLinkId}/clone".replace("{shareLinkId}",encodeURIComponent(String(e.shareLinkId))),method:"POST",headers:n,query:{},body:e.body},t),e=>{var t;return null==(t=e)?t:{conversation:null==t.conversation?void 0:tQ(t.conversation),responses:null==t.responses?void 0:t.responses.map(t_)}})}async chatCloneConversation(e,t){let n=await this.chatCloneConversationRaw(e,t);return await n.value()}async chatCreateConversationRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatCreateConversation().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/conversations",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{systemPromptName:e.systemPromptName,temporary:e.temporary,addResponseRequest:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{conversationId:e.conversationId,message:e.message,modelName:e.modelName,parentResponseId:e.parentResponseId,parentQuotedText:e.parentQuotedText,disableSearch:e.disableSearch,enableImageGeneration:e.enableImageGeneration,imageAttachments:e.imageAttachments,returnImageBytes:e.returnImageBytes,returnRawGrokInXaiRequest:e.returnRawGrokInXaiRequest,fileAttachments:e.fileAttachments,enableImageStreaming:e.enableImageStreaming,imageGenerationCount:e.imageGenerationCount,forceConcise:e.forceConcise,toolOverrides:e7(e.toolOverrides,!1),enableSideBySide:e.enableSideBySide,sendFinalMetadata:e.sendFinalMetadata,customInstructions:e.customInstructions,customPersonality:e.customPersonality,deepsearchPreset:e.deepsearchPreset,imageEditUri:e.imageEditUri,isReasoning:e.isReasoning,systemPromptName:e.systemPromptName,webpageUrls:e.webpageUrls,metadata:e.metadata,imageEditUris:e.imageEditUris,disableTextFollowUps:e.disableTextFollowUps,disableArtifact:e.disableArtifact,followUpType:e.followUpType,disableArtifactDiff:e.disableArtifactDiff,doForceTriggerArtifact:e.doForceTriggerArtifact,isFromGrokFiles:e.isFromGrokFiles,resumeResponseId:e.resumeResponseId,selectedFileTextContent:e.selectedFileTextContent,selectedFileTextContentStartPosition:e.selectedFileTextContentStartPosition,selectedFileTextContentEndPosition:e.selectedFileTextContentEndPosition,disableMemory:e.disableMemory,forceSideBySide:e.forceSideBySide,threadParentId:e.threadParentId,modelMode:e.modelMode,modelsUserCanUse:e.modelsUserCanUse,skipResponseCache:e.skipResponseCache,isAsyncChat:e.isAsyncChat,skipCancelCurrentInflightRequests:e.skipCancelCurrentInflightRequests,enableNsfw:e.enableNsfw,isKidsMode:e.isKidsMode,supportedFastTools:e8(e.supportedFastTools,!1),isRegenRequest:e.isRegenRequest,companionId:e.companionId,disableSelfHarmShortCircuit:e.disableSelfHarmShortCircuit,collectionIds:e.collectionIds,connectorIds:e.connectorIds,connectors:null==e.connectors?void 0:e.connectors.map(e6),searchAllConnectors:e.searchAllConnectors,deviceEnvInfo:eZ(e.deviceEnvInfo,!1),modelOverrideKey:e.modelOverrideKey,browserGeoLocation:e9(e.browserGeoLocation,!1),highlightsStoryRequests:null==e.highlightsStoryRequests?void 0:e.highlightsStoryRequests.map(e0),disablePersonalization:e.disablePersonalization,imagineProjectId:e.imagineProjectId}}(e.addResponseRequest,!1),workspaceIds:e.workspaceIds,taskResultId:e.taskResultId,templateId:e.templateId}}(e.body,!1)},t),e=>tQ(e))}async chatCreateConversation(e,t){let n=await this.chatCreateConversationRaw(e,t);return await n.value()}async chatCreateConversationAndRespondRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatCreateConversationAndRespond().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/conversations/new",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{systemPromptName:e.systemPromptName,temporary:e.temporary,modelName:e.modelName,message:e.message,fileAttachments:e.fileAttachments,imageAttachments:e.imageAttachments,disableSearch:e.disableSearch,enableImageGeneration:e.enableImageGeneration,returnImageBytes:e.returnImageBytes,returnRawGrokInXaiRequest:e.returnRawGrokInXaiRequest,enableImageStreaming:e.enableImageStreaming,imageGenerationCount:e.imageGenerationCount,forceConcise:e.forceConcise,toolOverrides:e7(e.toolOverrides,!1),enableSideBySide:e.enableSideBySide,sendFinalMetadata:e.sendFinalMetadata,customInstructions:e.customInstructions,customPersonality:e.customPersonality,deepsearchPreset:e.deepsearchPreset,imageEditUri:e.imageEditUri,isReasoning:e.isReasoning,webpageUrls:e.webpageUrls,imageEditUris:e.imageEditUris,workspaceIds:e.workspaceIds,disableTextFollowUps:e.disableTextFollowUps,disableArtifact:e.disableArtifact,responseMetadata:e.responseMetadata,disableArtifactDiff:e.disableArtifactDiff,doForceTriggerArtifact:e.doForceTriggerArtifact,isFromGrokFiles:e.isFromGrokFiles,selectedFileTextContent:e.selectedFileTextContent,selectedFileTextContentStartPosition:e.selectedFileTextContentStartPosition,selectedFileTextContentEndPosition:e.selectedFileTextContentEndPosition,disableMemory:e.disableMemory,forceSideBySide:e.forceSideBySide,modelsUserCanUse:e.modelsUserCanUse,modelMode:e.modelMode,skipResponseCache:e.skipResponseCache,isAsyncChat:e.isAsyncChat,enableNsfw:e.enableNsfw,isKidsMode:e.isKidsMode,supportedFastTools:e8(e.supportedFastTools,!1),isRegenRequest:e.isRegenRequest,companionId:e.companionId,templateId:e.templateId,disableSelfHarmShortCircuit:e.disableSelfHarmShortCircuit,collectionIds:e.collectionIds,connectorIds:e.connectorIds,connectors:null==e.connectors?void 0:e.connectors.map(e6),searchAllConnectors:e.searchAllConnectors,deviceEnvInfo:eZ(e.deviceEnvInfo,!1),modelOverrideKey:e.modelOverrideKey,browserGeoLocation:e9(e.browserGeoLocation,!1),highlightsStoryRequests:null==e.highlightsStoryRequests?void 0:e.highlightsStoryRequests.map(e0),disablePersonalization:e.disablePersonalization,imagineProjectId:e.imagineProjectId}}(e.body,!1)},t),e=>(function(e,t){var n;if(null==e)return e;return{result:null==e.result?void 0:(n=e.result,null==n?n:{response:null==n.response?void 0:tj(n.response,!1),conversation:null==n.conversation?void 0:tQ(n.conversation),title:null==n.title?void 0:tZ(n.title,!1)}),error:null==e.error?void 0:nh(e.error)}})(e,0))}async chatCreateConversationAndRespond(e,t){let n=await this.chatCreateConversationAndRespondRaw(e,t);return await n.value()}async chatDeleteAllMemoriesV2Raw(e,t){if(null==e.companionId)throw new em("companionId",'Required parameter "companionId" was null or undefined when calling chatDeleteAllMemoriesV2().');return new ev(await this.request({path:"/rest/app-chat/memories_v2/{companionId}".replace("{companionId}",encodeURIComponent(String(e.companionId))),method:"DELETE",headers:{},query:{}},t),e=>t0(e,!1))}async chatDeleteAllMemoriesV2(e,t){let n=await this.chatDeleteAllMemoriesV2Raw(e,t);return await n.value()}async chatDeleteConversationRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatDeleteConversation().');let n={};return null!=e.deleteMedia&&(n.deleteMedia=e.deleteMedia),new ev(await this.request({path:"/rest/app-chat/conversations/{conversationId}".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"DELETE",headers:{},query:n},t))}async chatDeleteConversation(e,t){let n=await this.chatDeleteConversationRaw(e,t);return await n.value()}async chatDeleteMemoryRaw(e,t){let n={};return null!=e.conversationIds&&(n.conversationIds=e.conversationIds),new ev(await this.request({path:"/rest/app-chat/memory",method:"DELETE",headers:{},query:n},t))}async chatDeleteMemory(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.chatDeleteMemoryRaw(e,t);return await n.value()}async chatDeleteShareLinkRaw(e,t){if(null==e.shareLinkId)throw new em("shareLinkId",'Required parameter "shareLinkId" was null or undefined when calling chatDeleteShareLink().');return new ev(await this.request({path:"/rest/app-chat/share_links/{shareLinkId}".replace("{shareLinkId}",encodeURIComponent(String(e.shareLinkId))),method:"DELETE",headers:{},query:{}},t))}async chatDeleteShareLink(e,t){let n=await this.chatDeleteShareLinkRaw(e,t);return await n.value()}async chatDeleteSingleMemoryV2Raw(e,t){if(null==e.id)throw new em("id",'Required parameter "id" was null or undefined when calling chatDeleteSingleMemoryV2().');return new ev(await this.request({path:"/rest/app-chat/memory_v2/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:{},query:{}},t))}async chatDeleteSingleMemoryV2(e,t){let n=await this.chatDeleteSingleMemoryV2Raw(e,t);return await n.value()}async chatEditMemoryV2Raw(e,t){if(null==e.id)throw new em("id",'Required parameter "id" was null or undefined when calling chatEditMemoryV2().');if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatEditMemoryV2().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/memory_v2/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"PUT",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{content:e.content}}(e.body,!1)},t),e=>{var t;return null==(t=e)?t:{memory:null==t.memory?void 0:t1(t.memory)}})}async chatEditMemoryV2(e,t){let n=await this.chatEditMemoryV2Raw(e,t);return await n.value()}async chatFetchMemoriesV2Raw(e,t){if(null==e.companionId)throw new em("companionId",'Required parameter "companionId" was null or undefined when calling chatFetchMemoriesV2().');return new ev(await this.request({path:"/rest/app-chat/memories_v2/{companionId}".replace("{companionId}",encodeURIComponent(String(e.companionId))),method:"GET",headers:{},query:{}},t),e=>{var t;return null==(t=e)?t:{memories:null==t.memories?void 0:t.memories.map(t1)}})}async chatFetchMemoriesV2(e,t){let n=await this.chatFetchMemoriesV2Raw(e,t);return await n.value()}async chatFetchSuggestionsRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatFetchSuggestions().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/fetch-suggestions",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{query:e.query,count:e.count,includeAnswers:e.includeAnswers,conversation:null==e.conversation?void 0:e.conversation.map(t9),conversationHistory:null==e.conversationHistory?void 0:e.conversationHistory.map(t8)}}(e.body,!1)},t),e=>ne(e,!1))}async chatFetchSuggestions(e,t){let n=await this.chatFetchSuggestionsRaw(e,t);return await n.value()}async chatGenerateTitleRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatGenerateTitle().');if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatGenerateTitle().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/conversations/{conversationId}/title".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{leafResponseId:e.leafResponseId}}(e.body,!1)},t),e=>tZ(e,!1))}async chatGenerateTitle(e,t){let n=await this.chatGenerateTitleRaw(e,t);return await n.value()}async chatGetAllArtifactsMetadataRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatGetAllArtifactsMetadata().');if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatGetAllArtifactsMetadata().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/conversations/{conversationId}/artifacts_metadata".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"POST",headers:n,query:{},body:e.body},t),e=>{var t;return null==(t=e)?t:{artifactsMetadata:null==t.artifactsMetadata?void 0:t.artifactsMetadata.map(t2)}})}async chatGetAllArtifactsMetadata(e,t){let n=await this.chatGetAllArtifactsMetadataRaw(e,t);return await n.value()}async chatGetArtifactByIdRaw(e,t){if(null==e.artifactId)throw new em("artifactId",'Required parameter "artifactId" was null or undefined when calling chatGetArtifactById().');if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatGetArtifactById().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/artifacts/{artifactId}".replace("{artifactId}",encodeURIComponent(String(e.artifactId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{conversationId:e.conversationId,responseId:e.responseId}}(e.body,!1)},t),e=>{var t;return null==(t=e)?t:{artifacts:null==t.artifacts?void 0:t.artifacts.map(t4)}})}async chatGetArtifactById(e,t){let n=await this.chatGetArtifactByIdRaw(e,t);return await n.value()}async chatGetArtifactContentRaw(e,t){if(null==e.artifactVersionId)throw new em("artifactVersionId",'Required parameter "artifactVersionId" was null or undefined when calling chatGetArtifactContent().');return new ev(await this.request({path:"/rest/app-chat/artifact_content/{artifactVersionId}".replace("{artifactVersionId}",encodeURIComponent(String(e.artifactVersionId))),method:"GET",headers:{},query:{}},t),e=>{var t;return null==(t=e)?t:{fullArtifact:null==t.fullArtifact?void 0:t.fullArtifact,artifactDiff:null==t.artifactDiff?void 0:t.artifactDiff}})}async chatGetArtifactContent(e,t){let n=await this.chatGetArtifactContentRaw(e,t);return await n.value()}async chatGetConversationRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatGetConversation().');let n={};return null!=e.includeWorkspaces&&(n.includeWorkspaces=e.includeWorkspaces),null!=e.includeTaskResult&&(n.includeTaskResult=e.includeTaskResult),null!=e.rid&&(n.rid=e.rid),new ev(await this.request({path:"/rest/app-chat/conversations/{conversationId}".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"GET",headers:{},query:n},t),e=>tQ(e))}async chatGetConversation(e,t){let n=await this.chatGetConversationRaw(e,t);return await n.value()}async chatGetConversationExistsRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatGetConversationExists().');return new ev(await this.request({path:"/rest/app-chat/conversations/exists/{conversationId}".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"GET",headers:{},query:{}},t),e=>{var t;return null==(t=e)?t:{_exists:null==t.exists?void 0:t.exists}})}async chatGetConversationExists(e,t){let n=await this.chatGetConversationExistsRaw(e,t);return await n.value()}async chatGetConversationStartersRaw(e){return new ev(await this.request({path:"/rest/app-chat/conversation-starters",method:"GET",headers:{},query:{}},e),e=>{var t;return null==(t=e)?t:{starters:null==t.starters?void 0:t.starters}})}async chatGetConversationStarters(e){let t=await this.chatGetConversationStartersRaw(e);return await t.value()}async chatGetConversationV2Raw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatGetConversationV2().');let n={};return null!=e.includeWorkspaces&&(n.includeWorkspaces=e.includeWorkspaces),null!=e.includeTaskResult&&(n.includeTaskResult=e.includeTaskResult),null!=e.rid&&(n.rid=e.rid),new ev(await this.request({path:"/rest/app-chat/conversations_v2/{conversationId}".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"GET",headers:{},query:n},t),e=>{var t;return null==(t=e)?t:{conversation:null==t.conversation?void 0:tQ(t.conversation),shareLinkPath:null==t.shareLinkPath?void 0:t.shareLinkPath,teamSwitchPrompt:null==t.teamSwitchPrompt?void 0:t3(t.teamSwitchPrompt,!1)}})}async chatGetConversationV2(e,t){let n=await this.chatGetConversationV2Raw(e,t);return await n.value()}async chatGetConversationsRaw(e,t){let n={};return null!=e.conversationIds&&(n.conversationIds=e.conversationIds),null!=e.includeWorkspaces&&(n.includeWorkspaces=e.includeWorkspaces),null!=e.includeTaskResult&&(n.includeTaskResult=e.includeTaskResult),new ev(await this.request({path:"/rest/app-chat/conversations-many",method:"GET",headers:{},query:n},t),e=>{var t;return null==(t=e)?t:{conversations:null==t.conversations?void 0:t.conversations.map(tQ)}})}async chatGetConversations(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.chatGetConversationsRaw(e,t);return await n.value()}async chatGetFileMetadataRaw(e,t){if(null==e.fileMetadataId)throw new em("fileMetadataId",'Required parameter "fileMetadataId" was null or undefined when calling chatGetFileMetadata().');return new ev(await this.request({path:"/rest/app-chat/file-metadata/{fileMetadataId}".replace("{fileMetadataId}",encodeURIComponent(String(e.fileMetadataId))),method:"POST",headers:{},query:{}},t),e=>tc(e))}async chatGetFileMetadata(e,t){let n=await this.chatGetFileMetadataRaw(e,t);return await n.value()}async chatGetMemoryRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatGetMemory().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/memory",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{conversationIds:e.conversationIds}}(e.body,!1)},t),e=>{var t;return null==(t=e)?t:{memories:null==t.memories?void 0:t.memories.map(t6)}})}async chatGetMemory(e,t){let n=await this.chatGetMemoryRaw(e,t);return await n.value()}async chatGetQuickAnswerRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatGetQuickAnswer().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/quick-answer",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{query:e.query}}(e.body,!1)},t),e=>{var t;return null==(t=e)?t:{suggestions:null==t.suggestions?void 0:t.suggestions.map(t5)}})}async chatGetQuickAnswer(e,t){let n=await this.chatGetQuickAnswerRaw(e,t);return await n.value()}async chatGetShareLinkRaw(e,t){if(null==e.shareLinkId)throw new em("shareLinkId",'Required parameter "shareLinkId" was null or undefined when calling chatGetShareLink().');return new ev(await this.request({path:"/rest/app-chat/share_links_data/{shareLinkId}".replace("{shareLinkId}",encodeURIComponent(String(e.shareLinkId))),method:"GET",headers:{},query:{}},t),e=>t7(e,!1))}async chatGetShareLink(e,t){let n=await this.chatGetShareLinkRaw(e,t);return await n.value()}async chatGetShareLinkAndIncrementViewCountRaw(e,t){if(null==e.shareLinkId)throw new em("shareLinkId",'Required parameter "shareLinkId" was null or undefined when calling chatGetShareLinkAndIncrementViewCount().');return new ev(await this.request({path:"/rest/app-chat/share_links/{shareLinkId}".replace("{shareLinkId}",encodeURIComponent(String(e.shareLinkId))),method:"GET",headers:{},query:{}},t),e=>t7(e,!1))}async chatGetShareLinkAndIncrementViewCount(e,t){let n=await this.chatGetShareLinkAndIncrementViewCountRaw(e,t);return await n.value()}async chatGetSharedArtifactRaw(e,t){if(null==e.sharedArtifactId)throw new em("sharedArtifactId",'Required parameter "sharedArtifactId" was null or undefined when calling chatGetSharedArtifact().');return new ev(await this.request({path:"/rest/app-chat/shared_artifacts/{sharedArtifactId}".replace("{sharedArtifactId}",encodeURIComponent(String(e.sharedArtifactId))),method:"GET",headers:{},query:{}},t),e=>{var t;return null==(t=e)?t:{parsedArtifact:null==t.parsedArtifact?void 0:t.parsedArtifact,conversation:null==t.conversation?void 0:tQ(t.conversation)}})}async chatGetSharedArtifact(e,t){let n=await this.chatGetSharedArtifactRaw(e,t);return await n.value()}async chatGetSuggestionsRaw(e,t){let n={};return null!=e.query&&(n.query=e.query),null!=e.count&&(n.count=e.count),null!=e.includeAnswers&&(n.includeAnswers=e.includeAnswers),new ev(await this.request({path:"/rest/app-chat/suggestions",method:"GET",headers:{},query:n},t),e=>ne(e,!1))}async chatGetSuggestions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.chatGetSuggestionsRaw(e,t);return await n.value()}async chatGoogleDriveFilesListRaw(e,t){let n={};return null!=e.query&&(n.query=e.query),new ev(await this.request({path:"/rest/app-chat/google-drive/files",method:"GET",headers:{},query:n},t),e=>{var t;return null==(t=e)?t:{files:null==t.files?void 0:t.files.map(nt)}})}async chatGoogleDriveFilesList(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.chatGoogleDriveFilesListRaw(e,t);return await n.value()}async chatGoogleDriveReadFileRaw(e,t){if(null==e.id)throw new em("id",'Required parameter "id" was null or undefined when calling chatGoogleDriveReadFile().');return new ev(await this.request({path:"/rest/app-chat/google-drive/files/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:{},query:{}},t),e=>{var t;return null==(t=e)?t:{content:null==t.content?void 0:t.content,mime:null==t.mime?void 0:t.mime}})}async chatGoogleDriveReadFile(e,t){let n=await this.chatGoogleDriveReadFileRaw(e,t);return await n.value()}async chatListConversationsRaw(e,t){let n={};return null!=e.pageSize&&(n.pageSize=e.pageSize),null!=e.pageToken&&(n.pageToken=e.pageToken),null!=e.searchQuery&&(n.searchQuery=e.searchQuery),null!=e.workspaceId&&(n.workspaceId=e.workspaceId),null!=e.filterIsStarred&&(n.filterIsStarred=e.filterIsStarred),null!=e.forceElastic&&(n.forceElastic=e.forceElastic),new ev(await this.request({path:"/rest/app-chat/conversations",method:"GET",headers:{},query:n},t),e=>{var t;return null==(t=e)?t:{conversations:null==t.conversations?void 0:t.conversations.map(tQ),nextPageToken:null==t.nextPageToken?void 0:t.nextPageToken,textSearchMatches:null==t.textSearchMatches?void 0:t.textSearchMatches.map(no)}})}async chatListConversations(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.chatListConversationsRaw(e,t);return await n.value()}async chatListImageGenerationsRaw(e){return new ev(await this.request({path:"/rest/app-chat/image-generations",method:"GET",headers:{},query:{}},e),e=>{var t;return null==(t=e)?t:{generations:null==t.generations?void 0:t.generations.map(nn)}})}async chatListImageGenerations(e){let t=await this.chatListImageGenerationsRaw(e);return await t.value()}async chatListResponseNodesRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatListResponseNodes().');let n={};return null!=e.includeThreads&&(n.includeThreads=e.includeThreads),new ev(await this.request({path:"/rest/app-chat/conversations/{conversationId}/response-node".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"GET",headers:{},query:n},t),e=>{var t;return null==(t=e)?t:{responseNodes:null==t.responseNodes?void 0:t.responseNodes.map(nr),inflightResponses:null==t.inflightResponses?void 0:t.inflightResponses.map(ni)}})}async chatListResponseNodes(e,t){let n=await this.chatListResponseNodesRaw(e,t);return await n.value()}async chatListResponsesRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatListResponses().');let n={};return null!=e.includeThreads&&(n.includeThreads=e.includeThreads),new ev(await this.request({path:"/rest/app-chat/conversations/{conversationId}/responses".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"GET",headers:{},query:n},t),e=>{var t;return null==(t=e)?t:{responses:null==t.responses?void 0:t.responses.map(t_),inflightResponses:null==t.inflightResponses?void 0:t.inflightResponses.map(ni)}})}async chatListResponses(e,t){let n=await this.chatListResponsesRaw(e,t);return await n.value()}async chatListShareLinkSummariesRaw(e,t){let n={};return null!=e.pageSize&&(n.pageSize=e.pageSize),null!=e.pageToken&&(n.pageToken=e.pageToken),null!=e.sharedWithMe&&(n.sharedWithMe=e.sharedWithMe),null!=e.conversationId&&(n.conversationId=e.conversationId),null!=e.responseId&&(n.responseId=e.responseId),null!=e.orderBy&&(n.orderBy=e.orderBy),null!=e.workspaceId&&(n.workspaceId=e.workspaceId),new ev(await this.request({path:"/rest/app-chat/share_links/summaries",method:"GET",headers:{},query:n},t),e=>{var t;return null==(t=e)?t:{shareLinkSummaries:null==t.shareLinkSummaries?void 0:t.shareLinkSummaries.map(na),nextPageToken:null==t.nextPageToken?void 0:t.nextPageToken}})}async chatListShareLinkSummaries(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.chatListShareLinkSummariesRaw(e,t);return await n.value()}async chatListShareLinksRaw(e,t){let n={};return null!=e.pageSize&&(n.pageSize=e.pageSize),null!=e.pageToken&&(n.pageToken=e.pageToken),null!=e.sharedWithMe&&(n.sharedWithMe=e.sharedWithMe),null!=e.conversationId&&(n.conversationId=e.conversationId),null!=e.responseId&&(n.responseId=e.responseId),null!=e.orderBy&&(n.orderBy=e.orderBy),null!=e.workspaceId&&(n.workspaceId=e.workspaceId),new ev(await this.request({path:"/rest/app-chat/share_links",method:"GET",headers:{},query:n},t),e=>{var t;return null==(t=e)?t:{shareLinks:null==t.shareLinks?void 0:t.shareLinks.map(ns),nextPageToken:null==t.nextPageToken?void 0:t.nextPageToken}})}async chatListShareLinks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.chatListShareLinksRaw(e,t);return await n.value()}async chatListSoftDeletedConversationsRaw(e,t){let n={};return null!=e.pageSize&&(n.pageSize=e.pageSize),null!=e.pageToken&&(n.pageToken=e.pageToken),null!=e.workspaceId&&(n.workspaceId=e.workspaceId),new ev(await this.request({path:"/rest/app-chat/conversations/deleted",method:"GET",headers:{},query:n},t),e=>{var t;return null==(t=e)?t:{conversations:null==t.conversations?void 0:t.conversations.map(tQ),nextPageToken:null==t.nextPageToken?void 0:t.nextPageToken}})}async chatListSoftDeletedConversations(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.chatListSoftDeletedConversationsRaw(e,t);return await n.value()}async chatLoadResponsesRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatLoadResponses().');if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatLoadResponses().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/conversations/{conversationId}/load-responses".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{responseIds:e.responseIds}}(e.body,!1)},t),e=>{var t;return null==(t=e)?t:{responses:null==t.responses?void 0:t.responses.map(t_)}})}async chatLoadResponses(e,t){let n=await this.chatLoadResponsesRaw(e,t);return await n.value()}async chatMigrateConversationsRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatMigrateConversations().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/migrate-conversations",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{conversations:null==e.conversations?void 0:e.conversations.map(nd)}}(e.body,!1)},t))}async chatMigrateConversations(e,t){let n=await this.chatMigrateConversationsRaw(e,t);return await n.value()}async chatMigrateFileRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatMigrateFile().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/migrate-file",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{fileName:e.fileName,fileMimeType:e.fileMimeType,content:e.content,isModelGenerated:e.isModelGenerated}}(e.body,!1)},t),e=>tc(e))}async chatMigrateFile(e,t){let n=await this.chatMigrateFileRaw(e,t);return await n.value()}async chatMigrateMemoryRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatMigrateMemory().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/migrate-memory",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{memoryKeyMappings:null==e.memoryKeyMappings?void 0:e.memoryKeyMappings.map(nl)}}(e.body,!1)},t))}async chatMigrateMemory(e,t){let n=await this.chatMigrateMemoryRaw(e,t);return await n.value()}async chatMigrateResponsesRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatMigrateResponses().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/migrate-responses",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{responses:null==e.responses?void 0:e.responses.map(nu)}}(e.body,!1)},t))}async chatMigrateResponses(e,t){let n=await this.chatMigrateResponsesRaw(e,t);return await n.value()}async chatPostVoiceChatRecordingRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatPostVoiceChatRecording().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/voice/post-recording",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{contentBytes:e.contentBytes,mimeType:e.mimeType,conversationId:e.conversationId,responseId:e.responseId,sessionMetadata:e.sessionMetadata,alignmentInfo:e.alignmentInfo}}(e.body,!1)},t),e=>{var t;return null==(t=e)?t:{shareLinkPath:null==t.shareLinkPath?void 0:t.shareLinkPath,assetUrl:null==t.assetUrl?void 0:t.assetUrl}})}async chatPostVoiceChatRecording(e,t){let n=await this.chatPostVoiceChatRecordingRaw(e,t);return await n.value()}async chatReadResponseRaw(e,t){if(null==e.responseId)throw new em("responseId",'Required parameter "responseId" was null or undefined when calling chatReadResponse().');let n={};return null!=e.voiceId&&(n.voiceId=e.voiceId),new ev(await this.request({path:"/rest/app-chat/read-response/{responseId}".replace("{responseId}",encodeURIComponent(String(e.responseId))),method:"GET",headers:{},query:n},t),e=>(function(e,t){var n;if(null==e)return e;return{result:null==e.result?void 0:(n=e.result,null==n?n:{audioChunk:null==n.audioChunk?void 0:n.audioChunk}),error:null==e.error?void 0:nh(e.error)}})(e,0))}async chatReadResponse(e,t){let n=await this.chatReadResponseRaw(e,t);return await n.value()}async chatReadResponseAudioFileRaw(e,t){if(null==e.responseId)throw new em("responseId",'Required parameter "responseId" was null or undefined when calling chatReadResponseAudioFile().');let n={};return null!=e.voiceId&&(n.voiceId=e.voiceId),new ev(await this.request({path:"/rest/app-chat/read-response-audio/{responseId}".replace("{responseId}",encodeURIComponent(String(e.responseId))),method:"GET",headers:{},query:n},t),e=>(function(e,t){var n;if(null==e)return e;return{result:null==e.result?void 0:(n=e.result,null==n?n:{data:null==n.data?void 0:n.data,contentType:null==n.contentType?void 0:n.contentType}),error:null==e.error?void 0:nh(e.error)}})(e,0))}async chatReadResponseAudioFile(e,t){let n=await this.chatReadResponseAudioFileRaw(e,t);return await n.value()}async chatReadResponseAudioMultipartRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatReadResponseAudioMultipart().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/tts",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{articles:null==e.articles?void 0:e.articles.map(tB),sanitize:e.sanitize,voice:e.voice,enableAlignment:e.enableAlignment}}(e.body,!1)},t),e=>(function(e,t){var n;if(null==e)return e;return{result:null==e.result?void 0:(n=e.result,null==n?n:{data:null==n.data?void 0:n.data,contentType:null==n.contentType?void 0:n.contentType}),error:null==e.error?void 0:nh(e.error)}})(e,0))}async chatReadResponseAudioMultipart(e,t){let n=await this.chatReadResponseAudioMultipartRaw(e,t);return await n.value()}async chatReconnectResponseRaw(e,t){if(null==e.responseId)throw new em("responseId",'Required parameter "responseId" was null or undefined when calling chatReconnectResponse().');return new ev(await this.request({path:"/rest/app-chat/conversations/reconnect-response/{responseId}".replace("{responseId}",encodeURIComponent(String(e.responseId))),method:"GET",headers:{},query:{}},t),e=>np(e,!1))}async chatReconnectResponse(e,t){let n=await this.chatReconnectResponseRaw(e,t);return await n.value()}async chatReconnectResponseV2Raw(e,t){if(null==e.responseId)throw new em("responseId",'Required parameter "responseId" was null or undefined when calling chatReconnectResponseV2().');return new ev(await this.request({path:"/rest/app-chat/conversations/reconnect-response-v2/{responseId}".replace("{responseId}",encodeURIComponent(String(e.responseId))),method:"GET",headers:{},query:{}},t),e=>(function(e,t){var n;if(null==e)return e;return{result:null==e.result?void 0:(n=e.result,null==n?n:{response:null==n.response?void 0:tj(n.response,!1),title:null==n.title?void 0:tZ(n.title,!1)}),error:null==e.error?void 0:nh(e.error)}})(e,0))}async chatReconnectResponseV2(e,t){let n=await this.chatReconnectResponseV2Raw(e,t);return await n.value()}async chatRestoreSoftDeletedConversationRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatRestoreSoftDeletedConversation().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/conversations/restore",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{conversationId:e.conversationId}}(e.body,!1)},t))}async chatRestoreSoftDeletedConversation(e,t){let n=await this.chatRestoreSoftDeletedConversationRaw(e,t);return await n.value()}async chatRunCodeRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatRunCode().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/run-code",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{language:e.language,code:e.code}}(e.body,!1)},t),e=>{var t;return null==(t=e)?t:{success:null==t.success?void 0:t.success,stdout:null==t.stdout?void 0:t.stdout,stderr:null==t.stderr?void 0:t.stderr,outputFiles:null==t.outputFiles?void 0:t.outputFiles}})}async chatRunCode(e,t){let n=await this.chatRunCodeRaw(e,t);return await n.value()}async chatShareArtifactRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatShareArtifact().');if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatShareArtifact().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/conversations/{conversationId}/share_artifact".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{responseId:e.responseId,artifactId:e.artifactId,artifactVersionId:e.artifactVersionId}}(e.body,!1)},t),e=>{var t;return null==(t=e)?t:{sharedArtifactId:null==t.sharedArtifactId?void 0:t.sharedArtifactId}})}async chatShareArtifact(e,t){let n=await this.chatShareArtifactRaw(e,t);return await n.value()}async chatShareConversationRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatShareConversation().');if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatShareConversation().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/conversations/{conversationId}/share".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{responseId:e.responseId,teamMembersToShare:e.teamMembersToShare,shareWithTeamMembers:e.shareWithTeamMembers,sharePublicly:e.sharePublicly,allowIndexing:e.allowIndexing}}(e.body,!1)},t),e=>{var t;return null==(t=e)?t:{shareLinkId:null==t.shareLinkId?void 0:t.shareLinkId}})}async chatShareConversation(e,t){let n=await this.chatShareConversationRaw(e,t);return await n.value()}async chatShareVoiceChatRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatShareVoiceChat().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/voice/share",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{videoBytes:e.videoBytes,text:e.text}}(e.body,!1)},t))}async chatShareVoiceChat(e,t){let n=await this.chatShareVoiceChatRaw(e,t);return await n.value()}async chatSoftDeleteAllConversationsRaw(e){return new ev(await this.request({path:"/rest/app-chat/conversations",method:"DELETE",headers:{},query:{}},e))}async chatSoftDeleteAllConversations(e){let t=await this.chatSoftDeleteAllConversationsRaw(e);return await t.value()}async chatSoftDeleteAllMemoriesV2Raw(e,t){if(null==e.companionId)throw new em("companionId",'Required parameter "companionId" was null or undefined when calling chatSoftDeleteAllMemoriesV2().');return new ev(await this.request({path:"/rest/app-chat/memories_v2/soft/{companionId}".replace("{companionId}",encodeURIComponent(String(e.companionId))),method:"DELETE",headers:{},query:{}},t),e=>t0(e,!1))}async chatSoftDeleteAllMemoriesV2(e,t){let n=await this.chatSoftDeleteAllMemoriesV2Raw(e,t);return await n.value()}async chatSoftDeleteConversationRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatSoftDeleteConversation().');return new ev(await this.request({path:"/rest/app-chat/conversations/soft/{conversationId}".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"DELETE",headers:{},query:{}},t))}async chatSoftDeleteConversation(e,t){let n=await this.chatSoftDeleteConversationRaw(e,t);return await n.value()}async chatSoftDeleteSingleMemoryV2Raw(e,t){if(null==e.id)throw new em("id",'Required parameter "id" was null or undefined when calling chatSoftDeleteSingleMemoryV2().');return new ev(await this.request({path:"/rest/app-chat/memory_v2/soft/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:{},query:{}},t))}async chatSoftDeleteSingleMemoryV2(e,t){let n=await this.chatSoftDeleteSingleMemoryV2Raw(e,t);return await n.value()}async chatStopConversationInflightResponsesRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatStopConversationInflightResponses().');return new ev(await this.request({path:"/rest/app-chat/conversations/{conversationId}/stop-inflight-responses".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"POST",headers:{},query:{}},t))}async chatStopConversationInflightResponses(e,t){let n=await this.chatStopConversationInflightResponsesRaw(e,t);return await n.value()}async chatStopInflightResponseRaw(e,t){if(null==e.responseId)throw new em("responseId",'Required parameter "responseId" was null or undefined when calling chatStopInflightResponse().');return new ev(await this.request({path:"/rest/app-chat/conversations/inflight-response/{responseId}".replace("{responseId}",encodeURIComponent(String(e.responseId))),method:"DELETE",headers:{},query:{}},t))}async chatStopInflightResponse(e,t){let n=await this.chatStopInflightResponseRaw(e,t);return await n.value()}async chatUpdateArtifactRaw(e,t){if(null==e.artifactId)throw new em("artifactId",'Required parameter "artifactId" was null or undefined when calling chatUpdateArtifact().');if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatUpdateArtifact().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/artifacts/{artifactId}/update".replace("{artifactId}",encodeURIComponent(String(e.artifactId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{fullArtifact:e.fullArtifact,artifactDiff:e.artifactDiff,artifactVersionId:e.artifactVersionId}}(e.body,!1)},t),e=>{var t;return null==(t=e)?t:{artifactVersionId:null==t.artifactVersionId?void 0:t.artifactVersionId}})}async chatUpdateArtifact(e,t){let n=await this.chatUpdateArtifactRaw(e,t);return await n.value()}async chatUpdateArtifactInlineStatusRaw(e,t){if(null==e.artifactId)throw new em("artifactId",'Required parameter "artifactId" was null or undefined when calling chatUpdateArtifactInlineStatus().');if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatUpdateArtifactInlineStatus().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/artifacts/{artifactId}/update_inline_status".replace("{artifactId}",encodeURIComponent(String(e.artifactId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{artifactVersionId:e.artifactVersionId,inlineStatus:e.inlineStatus}}(e.body,!1)},t),e=>{var t;return null==(t=e)?t:{artifactVersionId:null==t.artifactVersionId?void 0:t.artifactVersionId}})}async chatUpdateArtifactInlineStatus(e,t){let n=await this.chatUpdateArtifactInlineStatusRaw(e,t);return await n.value()}async chatUpdateConversationRaw(e,t){if(null==e.conversationId)throw new em("conversationId",'Required parameter "conversationId" was null or undefined when calling chatUpdateConversation().');if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatUpdateConversation().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/conversations/{conversationId}".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"PUT",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{title:e.title,starred:e.starred}}(e.body,!1)},t),e=>tQ(e))}async chatUpdateConversation(e,t){let n=await this.chatUpdateConversationRaw(e,t);return await n.value()}async chatUploadFileRaw(e,t){if(null==e.body)throw new em("body",'Required parameter "body" was null or undefined when calling chatUploadFile().');let n={};return n["Content-Type"]="application/json",new ev(await this.request({path:"/rest/app-chat/upload-file",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{fileName:e.fileName,fileMimeType:e.fileMimeType,content:e.content,makePublic:e.makePublic,fileSource:e.fileSource,thirdPartyFileId:e.thirdPartyFileId}}(e.body,!1)},t),e=>tc(e))}async chatUploadFile(e,t){let n=await this.chatUploadFileRaw(e,t);return await n.value()}}let nv={ListShareLinksOrderByInvalid:"LIST_SHARE_LINKS_ORDER_BY_INVALID",ListShareLinksOrderByCreateTime:"LIST_SHARE_LINKS_ORDER_BY_CREATE_TIME",ListShareLinksOrderByViewCount:"LIST_SHARE_LINKS_ORDER_BY_VIEW_COUNT"},nw="http://localhost".replace(/\/+$/,"");class nf{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:nw}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let ng=new nf;class ny{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&ny.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new nI(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=ng){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new nR(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(ny,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class nI extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class nR extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class nT extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class nb{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function nS(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{file_id:e.fileId,fields:e.fields}}(e,!1)}function nk(e){var t,n,i=e;if(null==i)return i;return{fileMetadata:null==i.file_metadata?void 0:(t=i.file_metadata,null==t?t:{fileId:null==t.file_id?void 0:t.file_id,name:null==t.name?void 0:t.name,sizeBytes:null==t.size_bytes?void 0:t.size_bytes,contentType:null==t.content_type?void 0:t.content_type,createdAt:null==t.created_at?void 0:t.created_at,expiresAt:null==t.expires_at?void 0:t.expires_at,hash:null==t.hash?void 0:t.hash,uploadStatus:null==t.upload_status?void 0:t.upload_status,uploadErrorMessage:null==t.upload_error_message?void 0:t.upload_error_message,processingStatus:null==t.processing_status?void 0:t.processing_status,filePath:null==t.file_path?void 0:t.file_path}),fields:null==i.fields?void 0:i.fields,status:null==i.status?void 0:(n=i.status,n),errorMessage:null==i.error_message?void 0:i.error_message,lastIndexedAt:null==i.last_indexed_at?void 0:i.last_indexed_at}}function nC(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{chars_configuration:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{max_chunk_size_chars:e.maxChunkSizeChars,chunk_overlap_chars:e.chunkOverlapChars}}(e.charsConfiguration,!1),tokens_configuration:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{max_chunk_size_tokens:e.maxChunkSizeTokens,chunk_overlap_tokens:e.chunkOverlapTokens,encoding_name:e.encodingName}}(e.tokensConfiguration,!1),ast_configuration:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{max_chunk_size_tokens:e.maxChunkSizeTokens,encoding_name:e.encodingName}}(e.astConfiguration,!1),table_configuration:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{max_chunk_size_tokens:e.maxChunkSizeTokens,encoding_name:e.encodingName}}(e.tableConfiguration,!1),markdown_tokens_configuration:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{max_chunk_size_tokens:e.maxChunkSizeTokens,chunk_overlap_tokens:e.chunkOverlapTokens,encoding_name:e.encodingName}}(e.markdownTokensConfiguration,!1),markdown_chars_configuration:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{max_chunk_size_chars:e.maxChunkSizeChars,chunk_overlap_chars:e.chunkOverlapChars}}(e.markdownCharsConfiguration,!1),code_tokens_configuration:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{max_chunk_size_tokens:e.maxChunkSizeTokens,chunk_overlap_tokens:e.chunkOverlapTokens,encoding_name:e.encodingName}}(e.codeTokensConfiguration,!1),code_chars_configuration:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{max_chunk_size_chars:e.maxChunkSizeChars,chunk_overlap_chars:e.chunkOverlapChars}}(e.codeCharsConfiguration,!1),strip_whitespace:e.stripWhitespace,inject_name_into_chunks:e.injectNameIntoChunks}}function nq(e){var t;return null==(t=e)?t:{key:t.key,required:null==t.required?void 0:t.required,injectIntoChunk:null==t.inject_into_chunk?void 0:t.inject_into_chunk,unique:null==t.unique?void 0:t.unique,description:null==t.description?void 0:t.description}}function nA(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{key:e.key,required:e.required,inject_into_chunk:e.injectIntoChunk,unique:e.unique,description:e.description}}(e,!1)}function nP(e){var t,n=e;if(null==n)return n;return{collectionId:null==n.collection_id?void 0:n.collection_id,collectionName:null==n.collection_name?void 0:n.collection_name,createdAt:null==n.created_at?void 0:n.created_at,indexConfiguration:null==n.index_configuration?void 0:(t=n.index_configuration,null==t?t:{modelName:null==t.model_name?void 0:t.model_name}),chunkConfiguration:null==n.chunk_configuration?void 0:function(e,t){var n,i,o,r,a,s,l,d;if(null==e)return e;return{charsConfiguration:null==e.chars_configuration?void 0:(n=e.chars_configuration,null==n?n:{maxChunkSizeChars:null==n.max_chunk_size_chars?void 0:n.max_chunk_size_chars,chunkOverlapChars:null==n.chunk_overlap_chars?void 0:n.chunk_overlap_chars}),tokensConfiguration:null==e.tokens_configuration?void 0:(i=e.tokens_configuration,null==i?i:{maxChunkSizeTokens:null==i.max_chunk_size_tokens?void 0:i.max_chunk_size_tokens,chunkOverlapTokens:null==i.chunk_overlap_tokens?void 0:i.chunk_overlap_tokens,encodingName:null==i.encoding_name?void 0:i.encoding_name}),astConfiguration:null==e.ast_configuration?void 0:(o=e.ast_configuration,null==o?o:{maxChunkSizeTokens:null==o.max_chunk_size_tokens?void 0:o.max_chunk_size_tokens,encodingName:null==o.encoding_name?void 0:o.encoding_name}),tableConfiguration:null==e.table_configuration?void 0:(r=e.table_configuration,null==r?r:{maxChunkSizeTokens:null==r.max_chunk_size_tokens?void 0:r.max_chunk_size_tokens,encodingName:null==r.encoding_name?void 0:r.encoding_name}),markdownTokensConfiguration:null==e.markdown_tokens_configuration?void 0:(a=e.markdown_tokens_configuration,null==a?a:{maxChunkSizeTokens:null==a.max_chunk_size_tokens?void 0:a.max_chunk_size_tokens,chunkOverlapTokens:null==a.chunk_overlap_tokens?void 0:a.chunk_overlap_tokens,encodingName:null==a.encoding_name?void 0:a.encoding_name}),markdownCharsConfiguration:null==e.markdown_chars_configuration?void 0:(s=e.markdown_chars_configuration,null==s?s:{maxChunkSizeChars:null==s.max_chunk_size_chars?void 0:s.max_chunk_size_chars,chunkOverlapChars:null==s.chunk_overlap_chars?void 0:s.chunk_overlap_chars}),codeTokensConfiguration:null==e.code_tokens_configuration?void 0:(l=e.code_tokens_configuration,null==l?l:{maxChunkSizeTokens:null==l.max_chunk_size_tokens?void 0:l.max_chunk_size_tokens,chunkOverlapTokens:null==l.chunk_overlap_tokens?void 0:l.chunk_overlap_tokens,encodingName:null==l.encoding_name?void 0:l.encoding_name}),codeCharsConfiguration:null==e.code_chars_configuration?void 0:(d=e.code_chars_configuration,null==d?d:{maxChunkSizeChars:null==d.max_chunk_size_chars?void 0:d.max_chunk_size_chars,chunkOverlapChars:null==d.chunk_overlap_chars?void 0:d.chunk_overlap_chars}),stripWhitespace:null==e.strip_whitespace?void 0:e.strip_whitespace,injectNameIntoChunks:null==e.inject_name_into_chunks?void 0:e.inject_name_into_chunks}}(n.chunk_configuration,0),documentsCount:null==n.documents_count?void 0:n.documents_count,fieldDefinitions:null==n.field_definitions?void 0:n.field_definitions.map(nq),collectionDescription:null==n.collection_description?void 0:n.collection_description}}function nE(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{field_definition:nA(e.fieldDefinition),operation:e.operation}}(e,!1)}function nU(e){var t;return null==(t=e)?t:{...t,type:null==t["@type"]?void 0:t["@type"]}}e.s([],96264);let nM="http://localhost".replace(/\/+$/,"");class n_{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:nM}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let nx=new n_;class nO{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&nO.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new nG(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=nx){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new nD(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(nO,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class nG extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class nD extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class nL extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class nF{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function nN(e){var t;return null==(t=e)?t:{toolName:null==t.toolName?void 0:t.toolName,toolVariant:null==t.toolVariant?void 0:t.toolVariant,descriptionOverride:null==t.descriptionOverride?void 0:t.descriptionOverride}}function nj(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{toolName:e.toolName,toolVariant:e.toolVariant,descriptionOverride:e.descriptionOverride}}(e,!1)}e.s(["ChatOverrideTarget",()=>nB,"ChatOverrideTargetFromJSON",()=>nV,"ChatOverrideTargetToJSON",()=>nK],121198);let nB={OverrideTargetUnspecified:"OVERRIDE_TARGET_UNSPECIFIED",OverrideTargetByName:"OVERRIDE_TARGET_BY_NAME",OverrideTargetAll:"OVERRIDE_TARGET_ALL",OverrideTargetAddNew:"OVERRIDE_TARGET_ADD_NEW"};function nV(e){return e}function nK(e){return e}e.s(["ChatPromptType",()=>nz,"ChatPromptTypeFromJSON",()=>nH,"ChatPromptTypeToJSON",()=>nJ],108489);let nz={PromptTypeUnspecified:"PROMPT_TYPE_UNSPECIFIED",PromptTypeSystem:"PROMPT_TYPE_SYSTEM",PromptTypeDeveloper:"PROMPT_TYPE_DEVELOPER"};function nH(e){return e}function nJ(e){return e}function nW(e){var t;return null==(t=e)?t:{promptType:null==t.promptType?void 0:nH(t.promptType),promptText:null==t.promptText?void 0:t.promptText,promptName:null==t.promptName?void 0:t.promptName}}function nY(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{promptType:e.promptType,promptText:e.promptText,promptName:e.promptName}}(e,!1)}function nX(e){var t,n=e;if(null==n)return n;return{target:null==n.target?void 0:nV(n.target),agentName:null==n.agentName?void 0:n.agentName,samplerConfig:null==n.samplerConfig?void 0:function(e,t){var n;if(null==e)return e;return{endpoint:null==e.endpoint?void 0:e.endpoint,modelFamilyConfig:null==e.modelFamilyConfig?void 0:(n=e.modelFamilyConfig,null==n?n:{maxLen:null==n.maxLen?void 0:n.maxLen})}}(n.samplerConfig,0),promptConfigs:null==n.promptConfigs?void 0:n.promptConfigs.map(nW),toolboxConfig:null==n.toolboxConfig?void 0:(t=n.toolboxConfig,null==t?t:{toolConfigs:null==t.toolConfigs?void 0:t.toolConfigs.map(nN)})}}function n$(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{target:e.target,agentName:e.agentName,samplerConfig:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{endpoint:e.endpoint,modelFamilyConfig:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{maxLen:e.maxLen}}(e.modelFamilyConfig,!1)}}(e.samplerConfig,!1),promptConfigs:null==e.promptConfigs?void 0:e.promptConfigs.map(nY),toolboxConfig:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{toolConfigs:null==e.toolConfigs?void 0:e.toolConfigs.map(nj)}}(e.toolboxConfig,!1)}}(e,!1)}function nQ(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{modelName:e.modelName,schedulerConfig:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{target:e.target,schedulerName:e.schedulerName,agentConfigs:null==e.agentConfigs?void 0:e.agentConfigs.map(n$)}}(e.schedulerConfig,!1)}}function nZ(e){var t;return null==(t=e)?t:{name:null==t.name?void 0:t.name,variant:null==t.variant?void 0:t.variant}}function n0(e){var t;return null==(t=e)?t:{templateName:null==t.templateName?void 0:t.templateName}}function n1(e){var t,n=e;if(null==n)return n;return{name:null==n.name?void 0:n.name,systemPromptSpecs:null==n.systemPromptSpecs?void 0:n0(n.systemPromptSpecs),developerPromptSpecs:null==n.developerPromptSpecs?void 0:n.developerPromptSpecs.map(n0),toolboxSpec:null==n.toolboxSpec?void 0:(t=n.toolboxSpec,null==t?t:{name:null==t.name?void 0:t.name,toolSpecs:null==t.toolSpecs?void 0:t.toolSpecs.map(nZ)})}}function n2(e){var t;return null==(t=e)?t:{id:null==t.id?void 0:t.id,name:null==t.name?void 0:t.name,createdBy:null==t.createdBy?void 0:t.createdBy,updatedBy:null==t.updatedBy?void 0:t.updatedBy,createTime:null==t.createTime?void 0:t.createTime,updateTime:null==t.updateTime?void 0:t.updateTime,chatConfigOverride:null==t.chatConfigOverride?void 0:function(e,t){var n;if(null==e)return e;return{modelName:null==e.modelName?void 0:e.modelName,schedulerConfig:null==e.schedulerConfig?void 0:(n=e.schedulerConfig,null==n?n:{target:null==n.target?void 0:nV(n.target),schedulerName:null==n.schedulerName?void 0:n.schedulerName,agentConfigs:null==n.agentConfigs?void 0:n.agentConfigs.map(nX)})}}(t.chatConfigOverride,0),description:null==t.description?void 0:t.description}}function n4(e){var t;return null==(t=e)?t:{name:null==t.name?void 0:t.name,agentSpecs:null==t.agentSpecs?void 0:t.agentSpecs.map(n1)}}function n3(e){var t;return null==(t=e)?t:{name:null==t.name?void 0:t.name,variants:null==t.variants?void 0:t.variants}}let n6="http://localhost".replace(/\/+$/,"");class n5{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:n6}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let n7=new n5;class n8{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&n8.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new n9(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=n7){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new ie(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(n8,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class n9 extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class ie extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class it extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class ii{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function io(e){var t;return null==(t=e)?t:{imagePost:null==t.imagePost?void 0:function(e,t){var n;if(null==e)return e;return{id:null==e.id?void 0:e.id,title:null==e.title?void 0:e.title,thumbnailUrl:null==e.thumbnailUrl?void 0:e.thumbnailUrl,url:null==e.url?void 0:e.url,prompt:null==e.prompt?void 0:e.prompt,promptType:null==e.promptType?void 0:(n=e.promptType,n),tags:null==e.tags?void 0:e.tags,width:null==e.width?void 0:e.width,height:null==e.height?void 0:e.height,modelName:null==e.modelName?void 0:e.modelName,createTime:null==e.createTime?void 0:e.createTime}}(t.imagePost,0)}}function ir(e){var t;return null==(t=e)?t:{id:null==t.id?void 0:t.id,displayName:null==t.displayName?void 0:t.displayName}}let ia="http://localhost".replace(/\/+$/,"");class is{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:ia}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let il=new is;class id{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&id.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new iu(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=il){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new ic(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(id,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class iu extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class ic extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class ih extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}function ip(e,t){return Object.keys(e).reduce((n,i)=>({...n,[i]:t(e[i])}),{})}class im{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function iv(e){var t;return null==(t=e)?t:{value:null==t.value?void 0:t.value,change:null==t.change?void 0:t.change,changePercent:null==t.changePercent?void 0:t.changePercent,unit:null==t.unit?void 0:t.unit,label:null==t.label?void 0:t.label}}function iw(e){var t;return null==(t=e)?t:{fiscalYear:null==t.fiscalYear?void 0:t.fiscalYear,fiscalPeriod:null==t.fiscalPeriod?void 0:t.fiscalPeriod,report:null==t.report?void 0:ip(t.report,iv),endDate:null==t.endDate?void 0:t.endDate,filingDate:null==t.filingDate?void 0:t.filingDate}}function ig(e){var t;return null==(t=e)?t:{timestamp:null==t.timestamp?void 0:t.timestamp,open:null==t.open?void 0:t.open,high:null==t.high?void 0:t.high,low:null==t.low?void 0:t.low,close:null==t.close?void 0:t.close,volume:null==t.volume?void 0:t.volume,average:null==t.average?void 0:t.average}}function iy(e){var t,n=e;if(null==n)return n;return{ticker:null==n.ticker?void 0:n.ticker,stockOverview:null==n.stockOverview?void 0:(t=n.stockOverview,null==t?t:{ticker:null==t.ticker?void 0:t.ticker,name:null==t.name?void 0:t.name,iconUrl:null==t.iconUrl?void 0:t.iconUrl,logoUrl:null==t.logoUrl?void 0:t.logoUrl,exchange:null==t.exchange?void 0:t.exchange,currency:null==t.currency?void 0:t.currency,market:null==t.market?void 0:t.market,weightedSharesOutstanding:null==t.weightedSharesOutstanding?void 0:t.weightedSharesOutstanding,shareClassSharesOutstanding:null==t.shareClassSharesOutstanding?void 0:t.shareClassSharesOutstanding,tickerType:null==t.tickerType?void 0:t.tickerType}),financeValue:null==n.financeValue?void 0:iv(n.financeValue),prevDay:null==n.prevDay?void 0:ig(n.prevDay),timestamp:null==n.timestamp?void 0:n.timestamp}}let iI="http://localhost".replace(/\/+$/,"");class iR{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:iI}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let iT=new iR;class ib{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&ib.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new iS(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=iT){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new ik(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(ib,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class iS extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class ik extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class iC extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class iq{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function iA(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{addition:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{path:e.path,contents:e.contents}}(e.addition,!1),deletion:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{path:e.path}}(e.deletion,!1)}}(e,!1)}function iP(e){var t;return null==(t=e)?t:{name:null==t.name?void 0:t.name,commitSha:null==t.commitSha?void 0:t.commitSha,_protected:null==t.protected?void 0:t.protected}}function iE(e){var t;return null==(t=e)?t:{number:null==t.number?void 0:t.number,url:null==t.url?void 0:t.url,title:null==t.title?void 0:t.title,state:null==t.state?void 0:t.state,headBranch:null==t.headBranch?void 0:t.headBranch,baseBranch:null==t.baseBranch?void 0:t.baseBranch}}function iU(e){var t;return null==(t=e)?t:{name:null==t.name?void 0:t.name,fullName:null==t.fullName?void 0:t.fullName,cloneUrl:null==t.cloneUrl?void 0:t.cloneUrl,_private:null==t.private?void 0:t.private,defaultBranch:null==t.defaultBranch?void 0:t.defaultBranch,description:null==t.description?void 0:t.description}}function iM(e){var t;return null==(t=e)?t:{installationId:null==t.installationId?void 0:t.installationId,accountLogin:null==t.accountLogin?void 0:t.accountLogin,accountType:null==t.accountType?void 0:t.accountType}}e.s([],245242);let i_="http://localhost".replace(/\/+$/,"");class ix{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:i_}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let iO=new ix;class iG{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&iG.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new iD(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=iO){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new iL(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(iG,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class iD extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class iL extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class iF extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class iN{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function ij(e){var t;return null==(t=e)?t:{key:t.key,required:null==t.required?void 0:t.required,injectIntoChunk:null==t.injectIntoChunk?void 0:t.injectIntoChunk,unique:null==t.unique?void 0:t.unique,description:null==t.description?void 0:t.description}}function iB(e){var t,n=e;if(null==n)return n;return{collectionId:null==n.collectionId?void 0:n.collectionId,collectionName:null==n.collectionName?void 0:n.collectionName,createdAt:null==n.createdAt?void 0:n.createdAt,indexConfiguration:null==n.indexConfiguration?void 0:(t=n.indexConfiguration,null==t?t:{modelName:null==t.modelName?void 0:t.modelName}),chunkConfiguration:null==n.chunkConfiguration?void 0:function(e,t){var n,i,o,r,a,s,l,d;if(null==e)return e;return{charsConfiguration:null==e.charsConfiguration?void 0:(n=e.charsConfiguration,null==n?n:{maxChunkSizeChars:null==n.maxChunkSizeChars?void 0:n.maxChunkSizeChars,chunkOverlapChars:null==n.chunkOverlapChars?void 0:n.chunkOverlapChars}),tokensConfiguration:null==e.tokensConfiguration?void 0:(i=e.tokensConfiguration,null==i?i:{maxChunkSizeTokens:null==i.maxChunkSizeTokens?void 0:i.maxChunkSizeTokens,chunkOverlapTokens:null==i.chunkOverlapTokens?void 0:i.chunkOverlapTokens,encodingName:null==i.encodingName?void 0:i.encodingName}),astConfiguration:null==e.astConfiguration?void 0:(o=e.astConfiguration,null==o?o:{maxChunkSizeTokens:null==o.maxChunkSizeTokens?void 0:o.maxChunkSizeTokens,encodingName:null==o.encodingName?void 0:o.encodingName}),tableConfiguration:null==e.tableConfiguration?void 0:(r=e.tableConfiguration,null==r?r:{maxChunkSizeTokens:null==r.maxChunkSizeTokens?void 0:r.maxChunkSizeTokens,encodingName:null==r.encodingName?void 0:r.encodingName}),markdownTokensConfiguration:null==e.markdownTokensConfiguration?void 0:(a=e.markdownTokensConfiguration,null==a?a:{maxChunkSizeTokens:null==a.maxChunkSizeTokens?void 0:a.maxChunkSizeTokens,chunkOverlapTokens:null==a.chunkOverlapTokens?void 0:a.chunkOverlapTokens,encodingName:null==a.encodingName?void 0:a.encodingName}),markdownCharsConfiguration:null==e.markdownCharsConfiguration?void 0:(s=e.markdownCharsConfiguration,null==s?s:{maxChunkSizeChars:null==s.maxChunkSizeChars?void 0:s.maxChunkSizeChars,chunkOverlapChars:null==s.chunkOverlapChars?void 0:s.chunkOverlapChars}),codeTokensConfiguration:null==e.codeTokensConfiguration?void 0:(l=e.codeTokensConfiguration,null==l?l:{maxChunkSizeTokens:null==l.maxChunkSizeTokens?void 0:l.maxChunkSizeTokens,chunkOverlapTokens:null==l.chunkOverlapTokens?void 0:l.chunkOverlapTokens,encodingName:null==l.encodingName?void 0:l.encodingName}),codeCharsConfiguration:null==e.codeCharsConfiguration?void 0:(d=e.codeCharsConfiguration,null==d?d:{maxChunkSizeChars:null==d.maxChunkSizeChars?void 0:d.maxChunkSizeChars,chunkOverlapChars:null==d.chunkOverlapChars?void 0:d.chunkOverlapChars}),stripWhitespace:null==e.stripWhitespace?void 0:e.stripWhitespace,injectNameIntoChunks:null==e.injectNameIntoChunks?void 0:e.injectNameIntoChunks}}(n.chunkConfiguration,0),documentsCount:null==n.documentsCount?void 0:n.documentsCount,fieldDefinitions:null==n.fieldDefinitions?void 0:n.fieldDefinitions.map(ij),collectionDescription:null==n.collectionDescription?void 0:n.collectionDescription}}function iV(e){var t,n,i=e;if(null==i)return i;return{fileMetadata:null==i.fileMetadata?void 0:(t=i.fileMetadata,null==t?t:{fileId:null==t.fileId?void 0:t.fileId,name:null==t.name?void 0:t.name,sizeBytes:null==t.sizeBytes?void 0:t.sizeBytes,contentType:null==t.contentType?void 0:t.contentType,createdAt:null==t.createdAt?void 0:t.createdAt,expiresAt:null==t.expiresAt?void 0:t.expiresAt,hash:null==t.hash?void 0:t.hash,uploadStatus:null==t.uploadStatus?void 0:t.uploadStatus,uploadErrorMessage:null==t.uploadErrorMessage?void 0:t.uploadErrorMessage,processingStatus:null==t.processingStatus?void 0:t.processingStatus,filePath:null==t.filePath?void 0:t.filePath}),fields:null==i.fields?void 0:i.fields,status:null==i.status?void 0:(n=i.status,n),errorMessage:null==i.errorMessage?void 0:i.errorMessage,lastIndexedAt:null==i.lastIndexedAt?void 0:i.lastIndexedAt}}function iK(e){var t;return null==(t=e)?t:{startTime:null==t.startTime?void 0:t.startTime,totalMessages:null==t.totalMessages?void 0:t.totalMessages,totalUniqueUsers:null==t.totalUniqueUsers?void 0:t.totalUniqueUsers}}e.s(["DefaultApi",()=>iQ,"GrokForTeamsTemplatesListTemplatesFilterEnum",()=>i0,"GrokForTeamsTemplatesListTemplatesOrderByEnum",()=>iZ],127479);function iz(e,t){return null==e?e:{userId:null==e.userId?void 0:e.userId,email:null==e.email?void 0:e.email,profileImage:null==e.profileImage?void 0:e.profileImage,givenName:null==e.givenName?void 0:e.givenName,familyName:null==e.familyName?void 0:e.familyName,profileImageUrl:null==e.profileImageUrl?void 0:e.profileImageUrl}}function iH(e){var t;return null==(t=e)?t:{assetId:null==t.assetId?void 0:t.assetId}}function iJ(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{assetId:e.assetId}}(e,!1)}function iW(e){var t;return null==(t=e)?t:{templateId:null==t.templateId?void 0:t.templateId,templateName:null==t.templateName?void 0:t.templateName,templateDescription:null==t.templateDescription?void 0:t.templateDescription,inputGuidance:null==t.inputGuidance?void 0:t.inputGuidance,systemPrompt:null==t.systemPrompt?void 0:t.systemPrompt,sharedWithTeam:null==t.sharedWithTeam?void 0:t.sharedWithTeam,createTime:null==t.createTime?void 0:t.createTime,modifyTime:null==t.modifyTime?void 0:t.modifyTime,teamId:null==t.teamId?void 0:t.teamId,userId:null==t.userId?void 0:t.userId,assets:null==t.assets?void 0:t.assets.map(iH),usageCount:null==t.usageCount?void 0:t.usageCount,owner:null==t.owner?void 0:iz(t.owner,!1)}}function iY(e){var t;return null==(t=e)?t:{user:null==t.user?void 0:iz(t.user,!1),shareLinkCount:null==t.shareLinkCount?void 0:t.shareLinkCount}}function iX(e,t){return null==e?e:{allowPublicShare:null==e.allowPublicShare?void 0:e.allowPublicShare}}function i$(e,t){return null==e?e:{conversationsRetentionPeriodDays:null==e.conversationsRetentionPeriodDays?void 0:e.conversationsRetentionPeriodDays,publicSettings:null==e.publicSettings?void 0:iX(e.publicSettings,!1),conversationsRetentionPeriodDisabled:null==e.conversationsRetentionPeriodDisabled?void 0:e.conversationsRetentionPeriodDisabled}}class iQ extends iG{async grokForTeamsGetTeamPublicSettingsRaw(e){return new iN(await this.request({path:"/rest/grok-for-teams/team-public-settings",method:"GET",headers:{},query:{}},e),e=>iX(e,!1))}async grokForTeamsGetTeamPublicSettings(e){let t=await this.grokForTeamsGetTeamPublicSettingsRaw(e);return await t.value()}async grokForTeamsGetTeamSettingsRaw(e){return new iN(await this.request({path:"/rest/grok-for-teams/team-settings",method:"GET",headers:{},query:{}},e),e=>i$(e,!1))}async grokForTeamsGetTeamSettings(e){let t=await this.grokForTeamsGetTeamSettingsRaw(e);return await t.value()}async grokForTeamsGetTeamStatsRaw(e,t){let n={};return null!=e.fromTime&&(n.fromTime=e.fromTime),null!=e.toTime&&(n.toTime=e.toTime),null!=e.maxEntries&&(n.maxEntries=e.maxEntries),new iN(await this.request({path:"/rest/grok-for-teams/team-stats",method:"GET",headers:{},query:n},t),e=>(function(e,t){var n;if(null==e)return e;return{messageCount:null==e.messageCount?void 0:e.messageCount,totalMessages:null==e.totalMessages?void 0:e.totalMessages,topUsers:null==e.topUsers?void 0:e.topUsers.map(iY),teamStats:null==e.teamStats?void 0:(n=e.teamStats,null==n?n:{stats:null==n.stats?void 0:n.stats.map(iK)})}})(e,0))}async grokForTeamsGetTeamStats(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.grokForTeamsGetTeamStatsRaw(e,t);return await n.value()}async grokForTeamsListTeamCollectionDocumentsRaw(e,t){if(null==e.collectionId)throw new iF("collectionId",'Required parameter "collectionId" was null or undefined when calling grokForTeamsListTeamCollectionDocuments().');let n={};return null!=e.teamId&&(n.teamId=e.teamId),null!=e.limit&&(n.limit=e.limit),new iN(await this.request({path:"/rest/grok-for-teams/collections/{collectionId}/documents".replace("{collectionId}",encodeURIComponent(String(e.collectionId))),method:"GET",headers:{},query:n},t),e=>{var t;return null==(t=e)?t:{documents:null==t.documents?void 0:t.documents.map(iV)}})}async grokForTeamsListTeamCollectionDocuments(e,t){let n=await this.grokForTeamsListTeamCollectionDocumentsRaw(e,t);return await n.value()}async grokForTeamsListTeamCollectionsRaw(e,t){let n={};return null!=e.teamId&&(n.teamId=e.teamId),new iN(await this.request({path:"/rest/grok-for-teams/collections",method:"GET",headers:{},query:n},t),e=>{var t;return null==(t=e)?t:{collections:null==t.collections?void 0:t.collections.map(iB)}})}async grokForTeamsListTeamCollections(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.grokForTeamsListTeamCollectionsRaw(e,t);return await n.value()}async grokForTeamsTemplatesCreateTemplateRaw(e,t){if(null==e.body)throw new iF("body",'Required parameter "body" was null or undefined when calling grokForTeamsTemplatesCreateTemplate().');let n={};return n["Content-Type"]="application/json",new iN(await this.request({path:"/rest/grok-for-teams/templates",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{templateName:e.templateName,templateDescription:e.templateDescription,inputGuidance:e.inputGuidance,systemPrompt:e.systemPrompt,sharedWithTeam:e.sharedWithTeam,assets:null==e.assets?void 0:e.assets.map(iJ)}}(e.body,!1)},t),e=>{var t;return null==(t=e)?t:{template:null==t.template?void 0:iW(t.template)}})}async grokForTeamsTemplatesCreateTemplate(e,t){let n=await this.grokForTeamsTemplatesCreateTemplateRaw(e,t);return await n.value()}async grokForTeamsTemplatesDeleteTemplateRaw(e,t){if(null==e.templateId)throw new iF("templateId",'Required parameter "templateId" was null or undefined when calling grokForTeamsTemplatesDeleteTemplate().');return new iN(await this.request({path:"/rest/grok-for-teams/templates/{templateId}".replace("{templateId}",encodeURIComponent(String(e.templateId))),method:"DELETE",headers:{},query:{}},t))}async grokForTeamsTemplatesDeleteTemplate(e,t){let n=await this.grokForTeamsTemplatesDeleteTemplateRaw(e,t);return await n.value()}async grokForTeamsTemplatesGetTemplateRaw(e,t){if(null==e.templateId)throw new iF("templateId",'Required parameter "templateId" was null or undefined when calling grokForTeamsTemplatesGetTemplate().');return new iN(await this.request({path:"/rest/grok-for-teams/templates/{templateId}".replace("{templateId}",encodeURIComponent(String(e.templateId))),method:"GET",headers:{},query:{}},t),e=>{var t;return null==(t=e)?t:{template:null==t.template?void 0:iW(t.template)}})}async grokForTeamsTemplatesGetTemplate(e,t){let n=await this.grokForTeamsTemplatesGetTemplateRaw(e,t);return await n.value()}async grokForTeamsTemplatesListTemplatesRaw(e,t){let n={};return null!=e.pageSize&&(n.pageSize=e.pageSize),null!=e.pageToken&&(n.pageToken=e.pageToken),null!=e.sharedWithMe&&(n.sharedWithMe=e.sharedWithMe),null!=e.orderBy&&(n.orderBy=e.orderBy),null!=e.query&&(n.query=e.query),null!=e.filter&&(n.filter=e.filter),new iN(await this.request({path:"/rest/grok-for-teams/templates",method:"GET",headers:{},query:n},t),e=>{var t;return null==(t=e)?t:{templates:null==t.templates?void 0:t.templates.map(iW),nextPageToken:null==t.nextPageToken?void 0:t.nextPageToken}})}async grokForTeamsTemplatesListTemplates(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.grokForTeamsTemplatesListTemplatesRaw(e,t);return await n.value()}async grokForTeamsTemplatesUpdateTemplateRaw(e,t){if(null==e.templateId)throw new iF("templateId",'Required parameter "templateId" was null or undefined when calling grokForTeamsTemplatesUpdateTemplate().');if(null==e.body)throw new iF("body",'Required parameter "body" was null or undefined when calling grokForTeamsTemplatesUpdateTemplate().');let n={};return n["Content-Type"]="application/json",new iN(await this.request({path:"/rest/grok-for-teams/templates/{templateId}".replace("{templateId}",encodeURIComponent(String(e.templateId))),method:"PUT",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{template:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{templateId:e.templateId,templateName:e.templateName,templateDescription:e.templateDescription,inputGuidance:e.inputGuidance,systemPrompt:e.systemPrompt,sharedWithTeam:e.sharedWithTeam,createTime:e.createTime,modifyTime:e.modifyTime,teamId:e.teamId,userId:e.userId,assets:null==e.assets?void 0:e.assets.map(iJ),usageCount:e.usageCount,owner:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{userId:e.userId,email:e.email,profileImage:e.profileImage,givenName:e.givenName,familyName:e.familyName,profileImageUrl:e.profileImageUrl}}(e.owner,!1)}}(e.template,!1)}}(e.body,!1)},t),e=>{var t;return null==(t=e)?t:{template:null==t.template?void 0:iW(t.template)}})}async grokForTeamsTemplatesUpdateTemplate(e,t){let n=await this.grokForTeamsTemplatesUpdateTemplateRaw(e,t);return await n.value()}async grokForTeamsUpdateTeamSettingsRaw(e,t){if(null==e.body)throw new iF("body",'Required parameter "body" was null or undefined when calling grokForTeamsUpdateTeamSettings().');let n={};return n["Content-Type"]="application/json",new iN(await this.request({path:"/rest/grok-for-teams/team-settings",method:"PUT",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{newSettings:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{conversationsRetentionPeriodDays:e.conversationsRetentionPeriodDays,publicSettings:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{allowPublicShare:e.allowPublicShare}}(e.publicSettings,!1),conversationsRetentionPeriodDisabled:e.conversationsRetentionPeriodDisabled}}(e.newSettings,!1)}}(e.body,!1)},t),e=>i$(e,!1))}async grokForTeamsUpdateTeamSettings(e,t){let n=await this.grokForTeamsUpdateTeamSettingsRaw(e,t);return await n.value()}}let iZ={ListTemplatesOrderByInvalid:"LIST_TEMPLATES_ORDER_BY_INVALID",ListTemplatesOrderByCreateTime:"LIST_TEMPLATES_ORDER_BY_CREATE_TIME",ListTemplatesOrderByUsageCount:"LIST_TEMPLATES_ORDER_BY_USAGE_COUNT"},i0={ListTemplatesFilterInvalid:"LIST_TEMPLATES_FILTER_INVALID",ListTemplatesFilterPersonal:"LIST_TEMPLATES_FILTER_PERSONAL",ListTemplatesFilterShared:"LIST_TEMPLATES_FILTER_SHARED",ListTemplatesFilterAll:"LIST_TEMPLATES_FILTER_ALL"},i1="http://localhost".replace(/\/+$/,"");class i2{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:i1}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let i4=new i2;class i3{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&i3.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new i6(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=i4){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new i5(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(i3,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class i6 extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class i5 extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class i7 extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class i8{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function i9(e){var t,n,i=e;if(null==i)return i;return{properties:null==i.properties?void 0:(t=i.properties,null==t?t:{messageType:null==t.messageType?void 0:t.messageType,followUpType:null==t.followUpType?void 0:t.followUpType}),label:null==i.label?void 0:i.label,toolOverrides:null==i.toolOverrides?void 0:(n=i.toolOverrides,null==n?n:{imageGen:null==n.imageGen?void 0:n.imageGen,webSearch:null==n.webSearch?void 0:n.webSearch,xSearch:null==n.xSearch?void 0:n.xSearch,xMediaSearch:null==n.xMediaSearch?void 0:n.xMediaSearch,trendsSearch:null==n.trendsSearch?void 0:n.trendsSearch,xPostAnalyze:null==n.xPostAnalyze?void 0:n.xPostAnalyze,videoGen:null==n.videoGen?void 0:n.videoGen,audioGen:null==n.audioGen?void 0:n.audioGen,gmailSearch:null==n.gmailSearch?void 0:n.gmailSearch,googleCalendarSearch:null==n.googleCalendarSearch?void 0:n.googleCalendarSearch})}}function oe(e){var t;return null==(t=e)?t:{tag:null==t.tag?void 0:t.tag,start:null==t.start?void 0:t.start,end:null==t.end?void 0:t.end}}function ot(e){var t;return null==(t=e)?t:{username:null==t.username?void 0:t.username,start:null==t.start?void 0:t.start,end:null==t.end?void 0:t.end}}function on(e){var t;return null==(t=e)?t:{url:null==t.url?void 0:t.url,expandedUrl:null==t.expandedUrl?void 0:t.expandedUrl,displayUrl:null==t.displayUrl?void 0:t.displayUrl,start:null==t.start?void 0:t.start,end:null==t.end?void 0:t.end}}function oi(e){var t;return null==(t=e)?t:{bitRate:null==t.bitRate?void 0:t.bitRate,contentType:null==t.contentType?void 0:t.contentType,url:null==t.url?void 0:t.url}}function oo(e){var t;return null==(t=e)?t:{mediaKey:null==t.mediaKey?void 0:t.mediaKey,type:null==t.type?void 0:t.type,url:null==t.url?void 0:t.url,width:null==t.width?void 0:t.width,height:null==t.height?void 0:t.height,previewImageUrl:null==t.previewImageUrl?void 0:t.previewImageUrl,variants:null==t.variants?void 0:t.variants.map(oi)}}function or(e){var t,n,i=e;if(null==i)return i;return{username:null==i.username?void 0:i.username,name:null==i.name?void 0:i.name,text:null==i.text?void 0:i.text,createTime:null==i.createTime?void 0:i.createTime,profileImageUrl:null==i.profileImageUrl?void 0:i.profileImageUrl,postId:null==i.postId?void 0:i.postId,citationId:null==i.citationId?void 0:i.citationId,parent:null==i.parent?void 0:or(i.parent),parentPostId:null==i.parentPostId?void 0:i.parentPostId,quotePostId:null==i.quotePostId?void 0:i.quotePostId,quote:null==i.quote?void 0:or(i.quote),viewCount:null==i.viewCount?void 0:i.viewCount,communityNote:null==i.communityNote?void 0:i.communityNote,verifiedType:null==i.verifiedType?void 0:i.verifiedType,publicMetrics:null==i.publicMetrics?void 0:(t=i.publicMetrics,null==t?t:{viewCount:null==t.viewCount?void 0:t.viewCount,likeCount:null==t.likeCount?void 0:t.likeCount,replyCount:null==t.replyCount?void 0:t.replyCount,retweetCount:null==t.retweetCount?void 0:t.retweetCount,quoteCount:null==t.quoteCount?void 0:t.quoteCount}),entities:null==i.entities?void 0:(n=i.entities,null==n?n:{media:null==n.media?void 0:n.media.map(oo),urls:null==n.urls?void 0:n.urls.map(on),hashtags:null==n.hashtags?void 0:n.hashtags.map(oe),mentions:null==n.mentions?void 0:n.mentions.map(ot)}),textMarkdown:null==i.textMarkdown?void 0:i.textMarkdown}}function oa(e){var t;return null==(t=e)?t:{followupId:null==t.followupId?void 0:t.followupId,label:null==t.label?void 0:t.label,prompt:null==t.prompt?void 0:t.prompt}}function os(e){var t;return null==(t=e)?t:{url:null==t.url?void 0:t.url,title:null==t.title?void 0:t.title,preview:null==t.preview?void 0:t.preview,searchEngineText:null==t.searchEngineText?void 0:t.searchEngineText,description:null==t.description?void 0:t.description,siteName:null==t.siteName?void 0:t.siteName,metadataTitle:null==t.metadataTitle?void 0:t.metadataTitle,creator:null==t.creator?void 0:t.creator,image:null==t.image?void 0:t.image,favicon:null==t.favicon?void 0:t.favicon,citationId:null==t.citationId?void 0:t.citationId}}function ol(e){var t,n,i=e;if(null==i)return i;return{storyId:null==i.storyId?void 0:i.storyId,title:null==i.title?void 0:i.title,summary:null==i.summary?void 0:i.summary,createTime:null==i.createTime?void 0:i.createTime,updateTime:null==i.updateTime?void 0:i.updateTime,followups:null==i.followups?void 0:i.followups.map(oa),grokAnalysis:null==i.grokAnalysis?void 0:i.grokAnalysis,source:null==i.source?void 0:(t=i.source,t),thumbnailImageUrl:null==i.thumbnailImageUrl?void 0:i.thumbnailImageUrl,coverImageUrl:null==i.coverImageUrl?void 0:i.coverImageUrl,article:null==i.article?void 0:(n=i.article,null==n?n:{content:null==n.content?void 0:n.content,webResults:null==n.webResults?void 0:n.webResults.map(os),xPosts:null==n.xPosts?void 0:n.xPosts.map(or),cardAttachments:null==n.cardAttachments?void 0:n.cardAttachments,followUpSuggestions:null==n.followUpSuggestions?void 0:n.followUpSuggestions.map(i9)}),xPostIds:null==i.xPostIds?void 0:i.xPostIds}}function od(e){var t;return null==(t=e)?t:{storyId:null==t.storyId?void 0:t.storyId,posts:null==t.posts?void 0:t.posts.map(or)}}let ou="http://localhost".replace(/\/+$/,"");class oc{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:ou}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let oh=new oc;class op{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&op.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new om(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=oh){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new ov(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(op,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class om extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class ov extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class ow extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class of{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}e.s([],164201);let og="http://localhost".replace(/\/+$/,"");class oy{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:og}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let oI=new oy;class oR{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&oR.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new oT(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=oI){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new ob(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(oR,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class oT extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class ob extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class oS extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class ok{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}e.s([],883805),e.s(["GrokApiMediaPostType",()=>oC,"GrokApiMediaPostTypeFromJSON",()=>oq,"GrokApiMediaPostTypeToJSON",()=>oA],541243);let oC={MediaPostTypeInvalid:"MEDIA_POST_TYPE_INVALID",MediaPostTypeImage:"MEDIA_POST_TYPE_IMAGE",MediaPostTypeVideo:"MEDIA_POST_TYPE_VIDEO",MediaPostTypeTemplate:"MEDIA_POST_TYPE_TEMPLATE"};function oq(e){return e}function oA(e){return e}function oP(e){return e}e.s(["GrokApiOriginalRefType",()=>oE,"GrokApiOriginalRefTypeFromJSON",()=>oU,"GrokApiOriginalRefTypeToJSON",()=>oM],178759);let oE={OriginalRefTypeInvalid:"ORIGINAL_REF_TYPE_INVALID",OriginalRefTypeVideoExtension:"ORIGINAL_REF_TYPE_VIDEO_EXTENSION",OriginalRefTypeVideoEdit:"ORIGINAL_REF_TYPE_VIDEO_EDIT",OriginalRefTypeImageEdit:"ORIGINAL_REF_TYPE_IMAGE_EDIT",OriginalRefTypeMultiRefImageEdit:"ORIGINAL_REF_TYPE_MULTI_REF_IMAGE_EDIT"};function oU(e){return e}function oM(e){return e}function o_(e,t){return null==e?e:{width:null==e.width?void 0:e.width,height:null==e.height?void 0:e.height}}function ox(e){var t;return null==(t=e)?t:{id:null==t.id?void 0:t.id,mimeType:null==t.mimeType?void 0:t.mimeType,mediaUrl:null==t.mediaUrl?void 0:t.mediaUrl,resolution:null==t.resolution?void 0:o_(t.resolution,!1),moderated:null==t.moderated?void 0:t.moderated,rRated:null==t.rRated?void 0:t.rRated}}function oO(e){return function(e,t){var n,i,o;if(null==e)return e;return{id:null==e.id?void 0:e.id,userId:null==e.userId?void 0:e.userId,createTime:null==e.createTime?void 0:e.createTime,prompt:null==e.prompt?void 0:e.prompt,mediaType:null==e.mediaType?void 0:oq(e.mediaType),mediaUrl:null==e.mediaUrl?void 0:e.mediaUrl,mimeType:null==e.mimeType?void 0:e.mimeType,originalPostId:null==e.originalPostId?void 0:e.originalPostId,audioUrls:null==e.audioUrls?void 0:e.audioUrls,originalPost:null==e.originalPost?void 0:oO(e.originalPost),conversationId:null==e.conversationId?void 0:e.conversationId,childPosts:null==e.childPosts?void 0:e.childPosts.map(oO),originalPrompt:null==e.originalPrompt?void 0:e.originalPrompt,mode:null==e.mode?void 0:e.mode,userInteractionStatus:null==e.userInteractionStatus?void 0:(n=e.userInteractionStatus,null==n?n:{likeStatus:null==n.likeStatus?void 0:n.likeStatus}),resolution:null==e.resolution?void 0:o_(e.resolution,!1),modelName:null==e.modelName?void 0:e.modelName,title:null==e.title?void 0:e.title,hdMediaUrl:null==e.hdMediaUrl?void 0:e.hdMediaUrl,thumbnailImageUrl:null==e.thumbnailImageUrl?void 0:e.thumbnailImageUrl,originalRefType:null==e.originalRefType?void 0:oU(e.originalRefType),platform:null==e.platform?void 0:(i=e.platform,i),mediaStatus:null==e.mediaStatus?void 0:(o=e.mediaStatus,o),lastFrameThumbnailImageUrl:null==e.lastFrameThumbnailImageUrl?void 0:e.lastFrameThumbnailImageUrl,watermarkedMediaUrl:null==e.watermarkedMediaUrl?void 0:e.watermarkedMediaUrl,videoExtensionStartTime:null==e.videoExtensionStartTime?void 0:e.videoExtensionStartTime,availableActions:null==e.availableActions?void 0:e.availableActions.map(oP),videoDuration:null==e.videoDuration?void 0:e.videoDuration,moderated:null==e.moderated?void 0:e.moderated,images:null==e.images?void 0:e.images.map(oO),videos:null==e.videos?void 0:e.videos.map(oO),rRated:null==e.rRated?void 0:e.rRated,isHiddenForClient:null==e.isHiddenForClient?void 0:e.isHiddenForClient,resolutionName:null==e.resolutionName?void 0:e.resolutionName,inputMediaItems:null==e.inputMediaItems?void 0:e.inputMediaItems.map(ox)}}(e,0)}function oG(e){var t;return null==(t=e)?t:{id:null==t.id?void 0:t.id,assetId:null==t.assetId?void 0:t.assetId,startTime:null==t.startTime?void 0:t.startTime,endTime:null==t.endTime?void 0:t.endTime}}function oD(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{id:e.id,assetId:e.assetId,startTime:e.startTime,endTime:e.endTime}}(e,!1)}function oL(e){var t;return null==(t=e)?t:{id:null==t.id?void 0:t.id,clips:null==t.clips?void 0:t.clips.map(oG)}}function oF(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{id:e.id,clips:null==e.clips?void 0:e.clips.map(oD)}}(e,!1)}function oN(e){var t;return null==(t=e)?t:{id:null==t.id?void 0:t.id,thumbnailImageUrl:null==t.thumbnailImageUrl?void 0:t.thumbnailImageUrl}}function oj(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{id:e.id,thumbnailImageUrl:e.thumbnailImageUrl}}(e,!1)}function oB(e){var t;return null==(t=e)?t:{id:null==t.id?void 0:t.id,userId:null==t.userId?void 0:t.userId,versions:null==t.versions?void 0:t.versions,currentVersion:null==t.currentVersion?void 0:t.currentVersion,assets:null==t.assets?void 0:t.assets.map(oN),timelines:null==t.timelines?void 0:t.timelines.map(oL),createTime:null==t.createTime?void 0:t.createTime,updateTime:null==t.updateTime?void 0:t.updateTime,conversationIds:null==t.conversationIds?void 0:t.conversationIds}}function oV(e){var t;return null==(t=e)?t:{characterId:null==t.characterId?void 0:t.characterId,previewUrl:null==t.previewUrl?void 0:t.previewUrl,characterName:null==t.characterName?void 0:t.characterName}}e.s(["GrokApiListMediaPostsFilterFromJSON",()=>oJ,"GrokApiListMediaPostsFilterToJSON",()=>oW],115051),e.s(["GrokApiMediaPostSource",()=>oK,"GrokApiMediaPostSourceFromJSON",()=>oz,"GrokApiMediaPostSourceToJSON",()=>oH],122710);let oK={MediaPostSourceInvalid:"MEDIA_POST_SOURCE_INVALID",MediaPostSourcePublic:"MEDIA_POST_SOURCE_PUBLIC",MediaPostSourceLiked:"MEDIA_POST_SOURCE_LIKED",MediaPostSourceOwned:"MEDIA_POST_SOURCE_OWNED",MediaPostSourceCharacterMentioned:"MEDIA_POST_SOURCE_CHARACTER_MENTIONED"};function oz(e){return e}function oH(e){return e}function oJ(e){var t;return null==(t=e)?t:{source:null==t.source?void 0:oz(t.source),userId:null==t.userId?void 0:t.userId,mediaType:null==t.mediaType?void 0:oq(t.mediaType)}}function oW(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{source:e.source,userId:e.userId,mediaType:e.mediaType}}(e,!1)}function oY(e){var t;return null==(t=e)?t:{postId:null==t.postId?void 0:t.postId,thumbnailImageUrl:null==t.thumbnailImageUrl?void 0:t.thumbnailImageUrl,prompt:null==t.prompt?void 0:t.prompt,viewCount:null==t.viewCount?void 0:t.viewCount,createdAt:null==t.createdAt?void 0:t.createdAt}}e.s([],103988);let oX="http://localhost".replace(/\/+$/,"");class o${set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:oX}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let oQ=new o$;class oZ{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&oZ.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new o0(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=oQ){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new o1(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(oZ,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class o0 extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class o1 extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class o2 extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class o4{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function o3(e){var t;return null==(t=e)?t:{name:null==t.name?void 0:t.name,key:null==t.key?void 0:t.key,type:null==t.type?void 0:t.type,options:null==t.options?void 0:t.options}}e.s(["ModelConfigModelMode",()=>o6,"ModelConfigModelModeFromJSON",()=>o5,"ModelConfigModelModeToJSON",()=>o7],732142);let o6={ModelModeUnknown:"MODEL_MODE_UNKNOWN",ModelModeAuto:"MODEL_MODE_AUTO",ModelModeFast:"MODEL_MODE_FAST",ModelModeExpert:"MODEL_MODE_EXPERT",ModelModeHeavy:"MODEL_MODE_HEAVY",ModelModeGrok4MiniThinking:"MODEL_MODE_GROK_4_MINI_THINKING",ModelModeGrok41:"MODEL_MODE_GROK_4_1",ModelModeGrok41Thinking:"MODEL_MODE_GROK_4_1_THINKING",ModelModeGrok41Nightly:"MODEL_MODE_GROK_4_1_NIGHTLY"};function o5(e){return e}function o7(e){return e}function o8(e){var t;return null==(t=e)?t:{modelId:null==t.modelId?void 0:t.modelId,name:null==t.name?void 0:t.name,description:null==t.description?void 0:t.description,modeDescription:null==t.modeDescription?void 0:t.modeDescription,modeName:null==t.modeName?void 0:t.modeName,badgeText:null==t.badgeText?void 0:t.badgeText,tags:null==t.tags?void 0:t.tags,modelMode:null==t.modelMode?void 0:o5(t.modelMode)}}let o9="http://localhost".replace(/\/+$/,"");class re{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:o9}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let rt=new re;class rn{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&rn.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new ri(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=rt){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new ro(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(rn,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class ri extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class ro extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class rr extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class ra{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}e.s(["GrokApiConversationAccessRequestStatus",()=>rs,"GrokApiConversationAccessRequestStatusFromJSON",()=>rl,"GrokApiConversationAccessRequestStatusToJSON",()=>rd],255668);let rs={ConversationAccessRequestStatusUnspecified:"CONVERSATION_ACCESS_REQUEST_STATUS_UNSPECIFIED",ConversationAccessRequestStatusPending:"CONVERSATION_ACCESS_REQUEST_STATUS_PENDING",ConversationAccessRequestStatusApproved:"CONVERSATION_ACCESS_REQUEST_STATUS_APPROVED",ConversationAccessRequestStatusDenied:"CONVERSATION_ACCESS_REQUEST_STATUS_DENIED"};function rl(e){return e}function rd(e){return e}function ru(e){var t,n,i=e;if(null==i)return i;return{notificationId:null==i.notificationId?void 0:i.notificationId,createTime:null==i.createTime?void 0:i.createTime,status:null==i.status?void 0:(t=i.status,t),conversationAccessRequest:null==i.conversationAccessRequest?void 0:(n=i.conversationAccessRequest,null==n?n:{status:null==n.status?void 0:rl(n.status),requesterEmail:null==n.requesterEmail?void 0:n.requesterEmail,conversationId:null==n.conversationId?void 0:n.conversationId,requesterName:null==n.requesterName?void 0:n.requesterName,requesterUserId:null==n.requesterUserId?void 0:n.requesterUserId})}}let rc="http://localhost".replace(/\/+$/,"");class rh{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:rc}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let rp=new rh;class rm{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&rm.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new rv(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=rp){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new rw(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(rm,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class rv extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class rw extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class rf extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class rg{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function ry(e,t){return null==e?e:{cost:null==e.cost?void 0:e.cost,waitTimeSeconds:null==e.waitTimeSeconds?void 0:e.waitTimeSeconds,remainingQueries:null==e.remainingQueries?void 0:e.remainingQueries}}let rI="http://localhost".replace(/\/+$/,"");class rR{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:rI}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let rT=new rR;class rb{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&rb.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new rS(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=rT){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new rk(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(rb,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class rS extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class rk extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class rC extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class rq{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function rA(e){var t;return null==(t=e)?t:{key:null==t.key?void 0:t.key,value:null==t.value?void 0:t.value}}function rP(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{key:e.key,value:e.value}}(e,!1)}function rE(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{key:e.key,value:e.value}}(e,!1)}function rU(e){var t,n,i=e;if(null==i)return i;return{environment:null==i.environment?void 0:(t=i.environment,null==t?t:{environmentId:null==t.environmentId?void 0:t.environmentId,userId:null==t.userId?void 0:t.userId,teamId:null==t.teamId?void 0:t.teamId,name:null==t.name?void 0:t.name,description:null==t.description?void 0:t.description,repository:null==t.repository?void 0:t.repository,defaultBranch:null==t.defaultBranch?void 0:t.defaultBranch,workspaceDirectory:null==t.workspaceDirectory?void 0:t.workspaceDirectory,containerImage:null==t.containerImage?void 0:t.containerImage,setupScript:null==t.setupScript?void 0:t.setupScript,maintenanceScript:null==t.maintenanceScript?void 0:t.maintenanceScript,cachingEnabled:null==t.cachingEnabled?void 0:t.cachingEnabled,internetEnabled:null==t.internetEnabled?void 0:t.internetEnabled,domainAllowlistPreset:null==t.domainAllowlistPreset?void 0:t.domainAllowlistPreset,additionalDomains:null==t.additionalDomains?void 0:t.additionalDomains,allowedHttpMethods:null==t.allowedHttpMethods?void 0:t.allowedHttpMethods,preinstalledPackages:null==t.preinstalledPackages?void 0:t.preinstalledPackages,createTime:null==t.createTime?void 0:t.createTime,modifyTime:null==t.modifyTime?void 0:t.modifyTime,cachedCommitSha:null==t.cachedCommitSha?void 0:t.cachedCommitSha,providerId:null==t.providerId?void 0:t.providerId,requestedCpus:null==t.requestedCpus?void 0:t.requestedCpus,requestedMemoryBytes:null==t.requestedMemoryBytes?void 0:t.requestedMemoryBytes,requestedDiskBytes:null==t.requestedDiskBytes?void 0:t.requestedDiskBytes,requestedGpus:null==t.requestedGpus?void 0:t.requestedGpus}),environmentVariables:null==i.environmentVariables?void 0:i.environmentVariables.map(rA),secrets:null==i.secrets?void 0:i.secrets.map(rA),userRole:null==i.userRole?void 0:(n=i.userRole,n)}}function rM(e){var t;return null==(t=e)?t:{name:null==t.name?void 0:t.name,versions:null==t.versions?void 0:t.versions,defaultVersion:null==t.defaultVersion?void 0:t.defaultVersion}}e.s([],994238);let r_="http://localhost".replace(/\/+$/,"");class rx{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:r_}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let rO=new rx;class rG{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&rG.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new rD(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=rO){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new rL(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(rG,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class rD extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class rL extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class rF extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class rN{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}e.s(["GrokApiUserFeedbackType",()=>rj,"GrokApiUserFeedbackTypeFromJSON",()=>rB,"GrokApiUserFeedbackTypeToJSON",()=>rV],548310);let rj={GeneralFeedback:"general_feedback",IssueReport:"issue_report",ChildSafety:"child_safety",ResponseFeedback:"response_feedback"};function rB(e){return e}function rV(e){return e}function rK(e,t){return null==e?e:{excludeFromTraining:null==e.excludeFromTraining?void 0:e.excludeFromTraining,preferences:null==e.preferences?void 0:e.preferences,allowXPersonalization:null==e.allowXPersonalization?void 0:e.allowXPersonalization,enableMemory:null==e.enableMemory?void 0:e.enableMemory,allowShareIndexing:null==e.allowShareIndexing?void 0:e.allowShareIndexing,allowCompanionNotifications:null==e.allowCompanionNotifications?void 0:e.allowCompanionNotifications,allowAutoShare:null==e.allowAutoShare?void 0:e.allowAutoShare}}e.s([],749105);let rz="http://localhost".replace(/\/+$/,"");class rH{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:rz}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let rJ=new rH;class rW{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&rW.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new rY(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=rJ){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new rX(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(rW,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class rY extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class rX extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class r$ extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class rQ{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function rZ(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{itemId:e.itemId,quantity:e.quantity,priceId:e.priceId}}(e,!1)}e.s(["GrokApiV2SubscriptionTier",()=>r0,"GrokApiV2SubscriptionTierFromJSON",()=>r1,"GrokApiV2SubscriptionTierToJSON",()=>r2],499313);let r0={SubscriptionTierInvalid:"SUBSCRIPTION_TIER_INVALID",SubscriptionTierGrokPro:"SUBSCRIPTION_TIER_GROK_PRO",SubscriptionTierXBasic:"SUBSCRIPTION_TIER_X_BASIC",SubscriptionTierXPremium:"SUBSCRIPTION_TIER_X_PREMIUM",SubscriptionTierXPremiumPlus:"SUBSCRIPTION_TIER_X_PREMIUM_PLUS",SubscriptionTierSuperGrokPro:"SUBSCRIPTION_TIER_SUPER_GROK_PRO"};function r1(e){return e}function r2(e){return e}e.s(["GrokApiV2SubscriptionStatus",()=>r4,"GrokApiV2SubscriptionStatusFromJSON",()=>r3,"GrokApiV2SubscriptionStatusToJSON",()=>r6],722118);let r4={SubscriptionStatusInvalid:"SUBSCRIPTION_STATUS_INVALID",SubscriptionStatusActive:"SUBSCRIPTION_STATUS_ACTIVE",SubscriptionStatusInactive:"SUBSCRIPTION_STATUS_INACTIVE"};function r3(e){return e}function r6(e){return e}function r5(e){return function(e,t){var n,i,o,r,a,s,l;if(null==e)return e;return{google:null==e.google?void 0:(n=e.google,null==n?n:{purchaseToken:null==n.purchaseToken?void 0:n.purchaseToken,productId:null==n.productId?void 0:n.productId,basePlanId:null==n.basePlanId?void 0:n.basePlanId}),apple:null==e.apple?void 0:(i=e.apple,null==i?i:{originalTxid:null==i.originalTxid?void 0:i.originalTxid,txid:null==i.txid?void 0:i.txid,bundleId:null==i.bundleId?void 0:i.bundleId,productId:null==i.productId?void 0:i.productId}),stripe:null==e.stripe?void 0:(o=e.stripe,null==o?o:{subscriptionId:null==o.subscriptionId?void 0:o.subscriptionId,invoiceId:null==o.invoiceId?void 0:o.invoiceId,productId:null==o.productId?void 0:o.productId}),paypal:null==e.paypal?void 0:(r=e.paypal,null==r?r:{subscriptionId:null==r.subscriptionId?void 0:r.subscriptionId,planId:null==r.planId?void 0:r.planId}),x:null==e.x?void 0:e.x,enterprise:null==e.enterprise?void 0:(a=e.enterprise,null==a?a:{teamId:null==a.teamId?void 0:a.teamId,subscriptionId:null==a.subscriptionId?void 0:a.subscriptionId}),adhoc:null==e.adhoc?void 0:(s=e.adhoc,null==s?s:{productId:null==s.productId?void 0:s.productId}),eapi:null==e.eapi?void 0:(l=e.eapi,null==l?l:{productId:null==l.productId?void 0:l.productId}),xaiUserId:null==e.xaiUserId?void 0:e.xaiUserId,tier:null==e.tier?void 0:r1(e.tier),status:null==e.status?void 0:r3(e.status),createTime:null==e.createTime?void 0:e.createTime,modTime:null==e.modTime?void 0:e.modTime}}(e,0)}function r7(e,t){return null==e?e:{val:null==e.val?void 0:e.val}}function r8(e){var t;return null==(t=e)?t:{amount:null==t.amount?void 0:r7(t.amount,!1),currency:null==t.currency?void 0:t.currency}}e.s(["ProdChargerStripeDiscountDurationType",()=>r9,"ProdChargerStripeDiscountDurationTypeFromJSON",()=>ae,"ProdChargerStripeDiscountDurationTypeToJSON",()=>at],635331);let r9={UnknownStripeDiscountDurationType:"UNKNOWN_STRIPE_DISCOUNT_DURATION_TYPE",Forever:"FOREVER",Once:"ONCE",MultipleMonths:"MULTIPLE_MONTHS"};function ae(e){return e}function at(e){return e}function an(e){var t;return null==(t=e)?t:{id:null==t.id?void 0:t.id,amount:null==t.amount?void 0:r7(t.amount,!1),currency:null==t.currency?void 0:t.currency,currencies:null==t.currencies?void 0:t.currencies.map(r8),campaign:null==t.campaign?void 0:function(e,t){var n;if(null==e)return e;return{campaignId:null==e.campaignId?void 0:e.campaignId,endsTs:null==e.endsTs?void 0:e.endsTs,apple:null==e.apple?void 0:function(e,t){var n;if(null==e)return e;return{offerType:null==e.offerType?void 0:(n=e.offerType,n),offerId:null==e.offerId?void 0:e.offerId}}(e.apple,0),google:null==e.google?void 0:(n=e.google,null==n?n:{offerId:null==n.offerId?void 0:n.offerId}),stripe:null==e.stripe?void 0:function(e,t){var n,i,o;if(null==e)return e;return{freeTrial:null==e.freeTrial?void 0:(n=e.freeTrial,null==n?n:{freeTrialDays:null==n.freeTrialDays?void 0:n.freeTrialDays}),discount:null==e.discount?void 0:(i=e.discount,null==i?i:{promotionCode:null==i.promotionCode?void 0:i.promotionCode,durationType:null==i.durationType?void 0:ae(i.durationType),numberOfMonths:null==i.numberOfMonths?void 0:i.numberOfMonths,percentageOff:null==i.percentageOff?void 0:i.percentageOff}),payUpfront:null==e.payUpfront?void 0:(o=e.payUpfront,null==o?o:{couponId:null==o.couponId?void 0:o.couponId,numberOfMonthsToPayUpfront:null==o.numberOfMonthsToPayUpfront?void 0:o.numberOfMonthsToPayUpfront,numberOfFreeMonthsAfterPay:null==o.numberOfFreeMonthsAfterPay?void 0:o.numberOfFreeMonthsAfterPay})}}(e.stripe,0)}}(t.campaign,0)}}function ai(e){var t;return null==(t=e)?t:{id:null==t.id?void 0:t.id,name:null==t.name?void 0:t.name,description:null==t.description?void 0:t.description,prices:null==t.prices?void 0:t.prices.map(an)}}function ao(e){var t;return null==(t=e)?t:{products:null==t.products?void 0:t.products.map(ai)}}function ar(e){var t;return null==(t=e)?t:{teamId:null==t.teamId?void 0:t.teamId,name:null==t.name?void 0:t.name}}e.s(["GrokApiV2RequestedTier",()=>aa,"GrokApiV2RequestedTierFromJSON",()=>as,"GrokApiV2RequestedTierToJSON",()=>al],967452);let aa={RequestedTierInvalid:"REQUESTED_TIER_INVALID",RequestedTierGrokPro:"REQUESTED_TIER_GROK_PRO",RequestedTierSuperGrokPro:"REQUESTED_TIER_SUPER_GROK_PRO"};function as(e){return e}function al(e){return e}function ad(e){var t;return null==(t=e)?t:{href:null==t.href?void 0:t.href,rel:null==t.rel?void 0:t.rel,method:null==t.method?void 0:t.method}}function au(e){return e}function ac(e){return e}e.s(["GrokApiV2SubscriptionType",()=>ah,"GrokApiV2SubscriptionTypeFromJSON",()=>ap,"GrokApiV2SubscriptionTypeToJSON",()=>am],633510);let ah={Monthly:"MONTHLY",Yearly:"YEARLY"};function ap(e){return e}function am(e){return e}let av="http://localhost".replace(/\/+$/,"");class aw{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:av}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let af=new aw;class ag{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&ag.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new ay(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=af){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new aI(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(ag,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class ay extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class aI extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class aR extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class aT{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function ab(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{type:e.type,maxItems:e.maxItems}}(e,!1)}function aS(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{title:e.title,timestampMs:e.timestampMs}}(e,!1)}function ak(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{role:e.role,content:e.content}}(e,!1)}function aC(e){var t;return null==(t=e)?t:{...t,type:null==t["@type"]?void 0:t["@type"]}}let aq="http://localhost".replace(/\/+$/,"");class aA{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:aq}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let aP=new aA;class aE{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&aE.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new aU(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=aP){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new aM(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(aE,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class aU extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class aM extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class a_ extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class ax{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function aO(e){var t;return null==(t=e)?t:{text:null==t.text?void 0:t.text,asset:null==t.asset?void 0:function(e,t){var n,i;if(null==e)return e;return{assetId:null==e.assetId?void 0:e.assetId,mimeType:null==e.mimeType?void 0:e.mimeType,name:null==e.name?void 0:e.name,sizeBytes:null==e.sizeBytes?void 0:e.sizeBytes,createTime:null==e.createTime?void 0:e.createTime,lastUseTime:null==e.lastUseTime?void 0:e.lastUseTime,summary:null==e.summary?void 0:e.summary,previewImageKey:null==e.previewImageKey?void 0:e.previewImageKey,key:null==e.key?void 0:e.key,auxKeys:null==e.auxKeys?void 0:e.auxKeys,responseId:null==e.responseId?void 0:e.responseId,isDeleted:null==e.isDeleted?void 0:e.isDeleted,fileSource:null==e.fileSource?void 0:(n=e.fileSource,n),thirdPartyFileId:null==e.thirdPartyFileId?void 0:e.thirdPartyFileId,thirdPartyFileMimeType:null==e.thirdPartyFileMimeType?void 0:e.thirdPartyFileMimeType,currentConversationId:null==e.currentConversationId?void 0:e.currentConversationId,rootAssetId:null==e.rootAssetId?void 0:e.rootAssetId,sourceConversationId:null==e.sourceConversationId?void 0:e.sourceConversationId,assetDiff:null==e.assetDiff?void 0:e.assetDiff,isModelGenerated:null==e.isModelGenerated?void 0:e.isModelGenerated,updateTime:null==e.updateTime?void 0:e.updateTime,isLatest:null==e.isLatest?void 0:e.isLatest,inlineStatus:null==e.inlineStatus?void 0:(i=e.inlineStatus,i),isRootAssetCreatedByModel:null==e.isRootAssetCreatedByModel?void 0:e.isRootAssetCreatedByModel,rootAssetSourceConversationId:null==e.rootAssetSourceConversationId?void 0:e.rootAssetSourceConversationId,workspaceSharingKey:null==e.workspaceSharingKey?void 0:e.workspaceSharingKey,workspaceSharingPreviewImageKey:null==e.workspaceSharingPreviewImageKey?void 0:e.workspaceSharingPreviewImageKey,teamId:null==e.teamId?void 0:e.teamId,sharedWithTeam:null==e.sharedWithTeam?void 0:e.sharedWithTeam,sharedWithUserIds:null==e.sharedWithUserIds?void 0:e.sharedWithUserIds,isPublic:null==e.isPublic?void 0:e.isPublic,width:null==e.width?void 0:e.width,height:null==e.height?void 0:e.height,rRated:null==e.rRated?void 0:e.rRated}}(t.asset,0)}}function aG(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{text:e.text,asset:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{assetId:e.assetId,mimeType:e.mimeType,name:e.name,sizeBytes:e.sizeBytes,createTime:e.createTime,lastUseTime:e.lastUseTime,summary:e.summary,previewImageKey:e.previewImageKey,key:e.key,auxKeys:e.auxKeys,responseId:e.responseId,isDeleted:e.isDeleted,fileSource:e.fileSource,thirdPartyFileId:e.thirdPartyFileId,thirdPartyFileMimeType:e.thirdPartyFileMimeType,currentConversationId:e.currentConversationId,rootAssetId:e.rootAssetId,sourceConversationId:e.sourceConversationId,assetDiff:e.assetDiff,isModelGenerated:e.isModelGenerated,updateTime:e.updateTime,isLatest:e.isLatest,inlineStatus:e.inlineStatus,isRootAssetCreatedByModel:e.isRootAssetCreatedByModel,rootAssetSourceConversationId:e.rootAssetSourceConversationId,workspaceSharingKey:e.workspaceSharingKey,workspaceSharingPreviewImageKey:e.workspaceSharingPreviewImageKey,teamId:e.teamId,sharedWithTeam:e.sharedWithTeam,sharedWithUserIds:e.sharedWithUserIds,isPublic:e.isPublic,width:e.width,height:e.height,rRated:e.rRated}}(e.asset,!1)}}(e,!1)}function aD(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{text:e.text,assetId:e.assetId}}(e,!1)}function aL(e){var t;return null==(t=e)?t:{systemPromptId:null==t.systemPromptId?void 0:t.systemPromptId,name:null==t.name?void 0:t.name,createTime:null==t.createTime?void 0:t.createTime,lastUseTime:null==t.lastUseTime?void 0:t.lastUseTime,content:null==t.content?void 0:t.content.map(aO)}}e.s([],272028);let aF="http://localhost".replace(/\/+$/,"");class aN{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:aF}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let aj=new aN;class aB{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&aB.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new aV(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=aj){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new aK(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(aB,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class aV extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class aK extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class az extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class aH{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}e.s(["GrokApiV2TaskCadence",()=>aJ,"GrokApiV2TaskCadenceFromJSON",()=>aW,"GrokApiV2TaskCadenceToJSON",()=>aY],748570);let aJ={TaskCadenceOnce:"TASK_CADENCE_ONCE",TaskCadenceOnceDaily:"TASK_CADENCE_ONCE_DAILY",TaskCadenceOnceWeekly:"TASK_CADENCE_ONCE_WEEKLY",TaskCadenceOnceWeekday:"TASK_CADENCE_ONCE_WEEKDAY",TaskCadenceOnceMonthly:"TASK_CADENCE_ONCE_MONTHLY",TaskCadenceOnceAnnually:"TASK_CADENCE_ONCE_ANNUALLY",TaskCadenceOnceInstant:"TASK_CADENCE_ONCE_INSTANT"};function aW(e){return e}function aY(e){return e}function aX(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{taskCadence:e.taskCadence,isEnabled:e.isEnabled,isoUtcSchedule:e.isoUtcSchedule,timezone:e.timezone,timeOfDay:e.timeOfDay,dayOfWeek:e.dayOfWeek,dayOfMonth:e.dayOfMonth,dayOfYear:e.dayOfYear}}e.s(["GrokApiV2ModelMode",()=>a$,"GrokApiV2ModelModeFromJSON",()=>aQ,"GrokApiV2ModelModeToJSON",()=>aZ],554771);let a$={Base:"BASE",Think:"THINK",Deepsearch:"DEEPSEARCH",Imagegen:"IMAGEGEN"};function aQ(e){return e}function aZ(e){return e}function a0(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,prompt:e.prompt,metadataJsonString:e.metadataJsonString,schedule:aX(e.schedule,!1),notificationMethod:e.notificationMethod,modelMode:e.modelMode,notificationDeciderEnable:e.notificationDeciderEnable,notificationDeciderGuideline:e.notificationDeciderGuideline,modelName:e.modelName,responseId:e.responseId,toolset:e.toolset}}e.s(["GrokApiV2TaskResultStatus",()=>a1,"GrokApiV2TaskResultStatusFromJSON",()=>a2,"GrokApiV2TaskResultStatusToJSON",()=>a4],468097);let a1={TaskResultPending:"TASK_RESULT_PENDING",TaskResultSuccess:"TASK_RESULT_SUCCESS",TaskResultError:"TASK_RESULT_ERROR"};function a2(e){return e}function a4(e){return e}e.s(["GrokApiV2TaskNotificationDecision",()=>a3,"GrokApiV2TaskNotificationDecisionFromJSON",()=>a6,"GrokApiV2TaskNotificationDecisionToJSON",()=>a5],627511);let a3={Disabled:"DISABLED",Yes:"YES",No:"NO"};function a6(e){return e}function a5(e){return e}function a7(e){var t;return null==(t=e)?t:{taskResultId:null==t.taskResultId?void 0:t.taskResultId,title:null==t.title?void 0:t.title,conversationId:null==t.conversationId?void 0:t.conversationId,status:null==t.status?void 0:a2(t.status),error:null==t.error?void 0:t.error,createTime:null==t.createTime?void 0:t.createTime,updateTime:null==t.updateTime?void 0:t.updateTime,isRead:null==t.isRead?void 0:t.isRead,execTime:null==t.execTime?void 0:t.execTime,scheduleId:null==t.scheduleId?void 0:t.scheduleId,notificationDecision:null==t.notificationDecision?void 0:a6(t.notificationDecision),taskId:null==t.taskId?void 0:t.taskId}}function a8(e){var t;return null==(t=e)?t:{scheduleId:null==t.scheduleId?void 0:t.scheduleId,taskCadence:null==t.taskCadence?void 0:aW(t.taskCadence),isEnabled:null==t.isEnabled?void 0:t.isEnabled,nextRun:null==t.nextRun?void 0:t.nextRun,dayOfWeek:null==t.dayOfWeek?void 0:t.dayOfWeek,dayOfMonth:null==t.dayOfMonth?void 0:t.dayOfMonth,dayOfYear:null==t.dayOfYear?void 0:t.dayOfYear,timeOfDay:null==t.timeOfDay?void 0:t.timeOfDay,timezone:null==t.timezone?void 0:t.timezone,isCompleted:null==t.isCompleted?void 0:t.isCompleted,endDate:null==t.endDate?void 0:t.endDate}}function a9(e){var t;return null==(t=e)?t:{task:null==t.task?void 0:function(e,t){var n;if(null==e)return e;return{taskId:null==e.taskId?void 0:e.taskId,userId:null==e.userId?void 0:e.userId,name:null==e.name?void 0:e.name,prompt:null==e.prompt?void 0:e.prompt,metadataJsonString:null==e.metadataJsonString?void 0:e.metadataJsonString,isActive:null==e.isActive?void 0:e.isActive,notificationMethod:null==e.notificationMethod?void 0:(n=e.notificationMethod,n),modelMode:null==e.modelMode?void 0:aQ(e.modelMode),notificationDeciderEnable:null==e.notificationDeciderEnable?void 0:e.notificationDeciderEnable,notificationDeciderGuideline:null==e.notificationDeciderGuideline?void 0:e.notificationDeciderGuideline,modelName:null==e.modelName?void 0:e.modelName,toolset:null==e.toolset?void 0:e.toolset,teamId:null==e.teamId?void 0:e.teamId}}(t.task,0),schedules:null==t.schedules?void 0:t.schedules.map(a8)}}function se(e){var t;return null==(t=e)?t:{taskId:null==t.taskId?void 0:t.taskId,originResponseId:null==t.originResponseId?void 0:t.originResponseId}}function st(e,t){return null==e?e:{results:null==e.results?void 0:e.results.map(a7),nextPage:null==e.nextPage?void 0:e.nextPage}}function sn(e){var t;return null==(t=e)?t:{id:null==t.id?void 0:t.id,label:null==t.label?void 0:t.label,icon:null==t.icon?void 0:t.icon,toolIds:null==t.toolIds?void 0:t.toolIds,connectorIds:null==t.connectorIds?void 0:t.connectorIds}}function si(e,t){return null==e?e:{usage:null==e.usage?void 0:e.usage,limit:null==e.limit?void 0:e.limit,frequentUsage:null==e.frequentUsage?void 0:e.frequentUsage,frequentLimit:null==e.frequentLimit?void 0:e.frequentLimit,occasionalUsage:null==e.occasionalUsage?void 0:e.occasionalUsage,occasionalLimit:null==e.occasionalLimit?void 0:e.occasionalLimit}}function so(e){var t;return null==(t=e)?t:{taskId:null==t.taskId?void 0:t.taskId,unreadCount:null==t.unreadCount?void 0:t.unreadCount}}let sr="http://localhost".replace(/\/+$/,"");class sa{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:sr}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let ss=new sa;class sl{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&sl.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new sd(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=ss){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new su(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(sl,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class sd extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class su extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class sc{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function sh(e){var t;return null==(t=e)?t:{tag:null==t.tag?void 0:t.tag,start:null==t.start?void 0:t.start,end:null==t.end?void 0:t.end}}function sp(e){var t;return null==(t=e)?t:{username:null==t.username?void 0:t.username,start:null==t.start?void 0:t.start,end:null==t.end?void 0:t.end}}function sm(e){var t;return null==(t=e)?t:{url:null==t.url?void 0:t.url,expandedUrl:null==t.expandedUrl?void 0:t.expandedUrl,displayUrl:null==t.displayUrl?void 0:t.displayUrl,start:null==t.start?void 0:t.start,end:null==t.end?void 0:t.end}}function sv(e){var t;return null==(t=e)?t:{bitRate:null==t.bitRate?void 0:t.bitRate,contentType:null==t.contentType?void 0:t.contentType,url:null==t.url?void 0:t.url}}function sw(e){var t;return null==(t=e)?t:{mediaKey:null==t.mediaKey?void 0:t.mediaKey,type:null==t.type?void 0:t.type,url:null==t.url?void 0:t.url,width:null==t.width?void 0:t.width,height:null==t.height?void 0:t.height,previewImageUrl:null==t.previewImageUrl?void 0:t.previewImageUrl,variants:null==t.variants?void 0:t.variants.map(sv)}}function sf(e){var t;return null==(t=e)?t:{name:null==t.name?void 0:t.name,hook:null==t.hook?void 0:t.hook,summary:null==t.summary?void 0:t.summary,postCount:null==t.postCount?void 0:t.postCount,topicNames:null==t.topicNames?void 0:t.topicNames,createTime:null==t.createTime?void 0:t.createTime,posts:null==t.posts?void 0:t.posts.map(function e(t){var n,i,o=t;if(null==o)return o;return{username:null==o.username?void 0:o.username,name:null==o.name?void 0:o.name,text:null==o.text?void 0:o.text,createTime:null==o.createTime?void 0:o.createTime,profileImageUrl:null==o.profileImageUrl?void 0:o.profileImageUrl,postId:null==o.postId?void 0:o.postId,citationId:null==o.citationId?void 0:o.citationId,parent:null==o.parent?void 0:e(o.parent),parentPostId:null==o.parentPostId?void 0:o.parentPostId,quotePostId:null==o.quotePostId?void 0:o.quotePostId,quote:null==o.quote?void 0:e(o.quote),viewCount:null==o.viewCount?void 0:o.viewCount,communityNote:null==o.communityNote?void 0:o.communityNote,verifiedType:null==o.verifiedType?void 0:o.verifiedType,publicMetrics:null==o.publicMetrics?void 0:(n=o.publicMetrics,null==n?n:{viewCount:null==n.viewCount?void 0:n.viewCount,likeCount:null==n.likeCount?void 0:n.likeCount,replyCount:null==n.replyCount?void 0:n.replyCount,retweetCount:null==n.retweetCount?void 0:n.retweetCount,quoteCount:null==n.quoteCount?void 0:n.quoteCount}),entities:null==o.entities?void 0:(i=o.entities,null==i?i:{media:null==i.media?void 0:i.media.map(sw),urls:null==i.urls?void 0:i.urls.map(sm),hashtags:null==i.hashtags?void 0:i.hashtags.map(sh),mentions:null==i.mentions?void 0:i.mentions.map(sp)}),textMarkdown:null==o.textMarkdown?void 0:o.textMarkdown}}),score:null==t.score?void 0:t.score}}let sg="http://localhost".replace(/\/+$/,"");class sy{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:sg}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let sI=new sy;class sR{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&sR.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new sT(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=sI){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new sb(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(sR,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class sT extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class sb extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class sS extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class sk{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function sC(e){var t;return null==(t=e)?t:{word:null==t.word?void 0:t.word,alignScore:null==t.alignScore?void 0:t.alignScore,startMs:null==t.startMs?void 0:t.startMs,endMs:null==t.endMs?void 0:t.endMs}}function sq(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{role:e.role,content:e.content}}(e,!1)}function sA(e){var t;return null==(t=e)?t:{shareToken:null==t.shareToken?void 0:t.shareToken,voiceId:null==t.voiceId?void 0:t.voiceId,ownerId:null==t.ownerId?void 0:t.ownerId,voiceName:null==t.voiceName?void 0:t.voiceName,creatorDisplayName:null==t.creatorDisplayName?void 0:t.creatorDisplayName,durationSeconds:null==t.durationSeconds?void 0:t.durationSeconds,createdAt:null==t.createdAt?void 0:t.createdAt,resolveCount:null==t.resolveCount?void 0:t.resolveCount}}function sP(e){var t,n=e;if(null==n)return n;return{voiceId:null==n.voiceId?void 0:n.voiceId,name:null==n.name?void 0:n.name,userId:null==n.userId?void 0:n.userId,gcsPath:null==n.gcsPath?void 0:n.gcsPath,durationSeconds:null==n.durationSeconds?void 0:n.durationSeconds,sampleRate:null==n.sampleRate?void 0:n.sampleRate,sha256Hash:null==n.sha256Hash?void 0:n.sha256Hash,createdAt:null==n.createdAt?void 0:n.createdAt,updatedAt:null==n.updatedAt?void 0:n.updatedAt,deletedAt:null==n.deletedAt?void 0:n.deletedAt,visibility:null==n.visibility?void 0:(t=n.visibility,t)}}function sE(e,t){return null==e?e:{id:null==e.id?void 0:e.id,ownerId:null==e.ownerId?void 0:e.ownerId,status:null==e.status?void 0:e.status,title:null==e.title?void 0:e.title,conversationId:null==e.conversationId?void 0:e.conversationId,generationPrompt:null==e.generationPrompt?void 0:e.generationPrompt,audioAssetId:null==e.audioAssetId?void 0:e.audioAssetId,alignmentInfo:null==e.alignmentInfo?void 0:e.alignmentInfo,createdAt:null==e.createdAt?void 0:e.createdAt,updatedAt:null==e.updatedAt?void 0:e.updatedAt,deletedAt:null==e.deletedAt?void 0:e.deletedAt}}function sU(e){var t;return null==(t=e)?t:{id:null==t.id?void 0:t.id,title:null==t.title?void 0:t.title,status:null==t.status?void 0:t.status}}function sM(e){var t;return null==(t=e)?t:{voiceId:null==t.voiceId?void 0:t.voiceId,savedAt:null==t.savedAt?void 0:t.savedAt,voice:null==t.voice?void 0:sP(t.voice)}}function s_(e){var t;return null==(t=e)?t:{start:null==t.start?void 0:t.start,end:null==t.end?void 0:t.end,words:null==t.words?void 0:t.words.map(sC),languageCode:null==t.languageCode?void 0:t.languageCode}}let sx="http://localhost".replace(/\/+$/,"");class sO{set config(e){this.configuration=e}get basePath(){return null!=this.configuration.basePath?this.configuration.basePath:sx}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||function e(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(t).map(i=>(function t(n,i){let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=o+(o.length?"[".concat(n,"]"):n);if(i instanceof Array){let e=i.map(e=>encodeURIComponent(String(e))).join("&".concat(encodeURIComponent(r),"="));return"".concat(encodeURIComponent(r),"=").concat(e)}return i instanceof Set?t(n,Array.from(i),o):i instanceof Date?"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(i.toISOString())):i instanceof Object?e(i,r):"".concat(encodeURIComponent(r),"=").concat(encodeURIComponent(String(i)))})(i,t[i],n)).filter(e=>e.length>0).join("&")}}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){let e=this.configuration.apiKey;if(e)return"function"==typeof e?e:()=>e}get accessToken(){let e=this.configuration.accessToken;if(e)return"function"==typeof e?e:async()=>e}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}constructor(e={}){(0,s._)(this,"configuration",void 0),this.configuration=e}}let sG=new sO;class sD{withMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=this.clone();return i.middleware=i.middleware.concat(...t),i}withPreMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({pre:e}));return this.withMiddleware(...i)}withPostMiddleware(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];let i=t.map(e=>({post:e}));return this.withMiddleware(...i)}isJsonMime(e){return!!e&&sD.jsonRegex.test(e)}async request(e,t){let{url:n,init:i}=await this.createFetchParams(e,t),o=await this.fetchApi(n,i);if(o&&o.status>=200&&o.status<300)return o;throw new sL(o,"Response returned an error code")}async createFetchParams(e,t){var n,i;let o,r=this.configuration.basePath+e.path;void 0!==e.query&&0!==Object.keys(e.query).length&&(r+="?"+this.configuration.queryParamsStringify(e.query));let a=Object.assign({},this.configuration.headers,e.headers);Object.keys(a).forEach(e=>void 0===a[e]?delete a[e]:{});let s={method:e.method,headers:a,body:e.body,credentials:this.configuration.credentials},l={...s,...await ("function"==typeof t?t:async()=>t)({init:s,context:e})};return n=l.body,o="undefined"!=typeof FormData&&n instanceof FormData||l.body instanceof URLSearchParams||(i=l.body,"undefined"!=typeof Blob&&i instanceof Blob)?l.body:this.isJsonMime(a["Content-Type"])?JSON.stringify(l.body):l.body,{url:r,init:{...l,body:o}}}clone(){let e=new this.constructor(this.configuration);return e.middleware=this.middleware.slice(),e}constructor(e=sG){(0,s._)(this,"configuration",void 0),(0,s._)(this,"middleware",void 0),(0,s._)(this,"fetchApi",void 0),this.configuration=e,this.fetchApi=async(e,t)=>{let n,i={url:e,init:t};for(let e of this.middleware)e.pre&&(i=await e.pre({fetch:this.fetchApi,...i})||i);try{n=await (this.configuration.fetchApi||fetch)(i.url,i.init)}catch(e){for(let t of this.middleware)t.onError&&(n=await t.onError({fetch:this.fetchApi,url:i.url,init:i.init,error:e,response:n?n.clone():void 0})||n);if(void 0===n)if(e instanceof Error)throw new sF(e,"The request failed and the interceptors did not return an alternative response");else throw e}for(let e of this.middleware)e.post&&(n=await e.post({fetch:this.fetchApi,url:i.url,init:i.init,response:n.clone()})||n);return n},this.middleware=e.middleware}}(0,s._)(sD,"jsonRegex",RegExp("^(:?application/json|[^;/ 	]+/[^;/ 	]+[+]json)[ 	]*(:?;.*)?$","i"));class sL extends Error{constructor(e,t){super(t),(0,s._)(this,"response",void 0),(0,s._)(this,"name",void 0),this.response=e,this.name="ResponseError"}}class sF extends Error{constructor(e,t){super(t),(0,s._)(this,"cause",void 0),(0,s._)(this,"name",void 0),this.cause=e,this.name="FetchError"}}class sN extends Error{constructor(e,t){super(t),(0,s._)(this,"field",void 0),(0,s._)(this,"name",void 0),this.field=e,this.name="RequiredError"}}class sj{async value(){return this.transformer(await this.raw.json())}constructor(e,t=e=>e){(0,s._)(this,"raw",void 0),(0,s._)(this,"transformer",void 0),this.raw=e,this.transformer=t}}function sB(e){var t;return null==(t=e)?t:{label:null==t.label?void 0:t.label,query:null==t.query?void 0:t.query,inputGuide:null==t.inputGuide?void 0:t.inputGuide,placeholderLabelsJson:null==t.placeholderLabelsJson?void 0:t.placeholderLabelsJson}}function sV(e){return function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{label:e.label,query:e.query,inputGuide:e.inputGuide,placeholderLabelsJson:e.placeholderLabelsJson}}(e,!1)}function sK(e){var t,n=e;if(null==n)return n;return{email:null==n.email?void 0:n.email,userId:null==n.userId?void 0:n.userId,access:null==n.access?void 0:(t=n.access,t)}}function sz(e){var t,n,i=e;if(null==i)return i;return{publicAccess:null==i.publicAccess?void 0:(t=i.publicAccess,t),teamAccess:null==i.teamAccess?void 0:(n=i.teamAccess,n),users:null==i.users?void 0:i.users.map(sK)}}function sH(e){var t,n,i=e;if(null==i)return i;return{workspaceId:null==i.workspaceId?void 0:i.workspaceId,name:null==i.name?void 0:i.name,createTime:null==i.createTime?void 0:i.createTime,lastUseTime:null==i.lastUseTime?void 0:i.lastUseTime,icon:null==i.icon?void 0:i.icon,customPersonality:null==i.customPersonality?void 0:i.customPersonality,preferredModel:null==i.preferredModel?void 0:i.preferredModel,isPublic:null==i.isPublic?void 0:i.isPublic,isReadonly:null==i.isReadonly?void 0:i.isReadonly,accessLevel:null==i.accessLevel?void 0:(t=i.accessLevel,t),teamId:null==i.teamId?void 0:i.teamId,conversationStarters:null==i.conversationStarters?void 0:i.conversationStarters,viewCount:null==i.viewCount?void 0:i.viewCount,conversationsCreatedCount:null==i.conversationsCreatedCount?void 0:i.conversationsCreatedCount,cloneCount:null==i.cloneCount?void 0:i.cloneCount,conversationTemplates:null==i.conversationTemplates?void 0:(n=i.conversationTemplates,null==n?n:{templates:null==n.templates?void 0:n.templates.map(sB)})}}async function sJ(n,i){t=t||new Promise(t=>{e.A(483347).then(e=>t(e.default()))});let o=await t;return await o(n,i)}let sW=async e=>{var t,n;let i,r=(0,o.v4)();null!=e.init||(e.init={}),null!=(t=e.init).headers||(t.headers={});try{i=await sJ(function(e){var t;return(null==(t=(new URL(e).pathname||"").split("?")[0])?void 0:t.trim())||""}(e.url),null!=(n=e.init.method)?n:"")}catch(e){i=btoa("e:".concat(e))}return e.init.headers instanceof Headers?(e.init.headers.set("x-xai-request-id",r),e.init.headers.set("x-statsig-id",i)):Array.isArray(e.init.headers)?(e.init.headers.push(["x-xai-request-id",r]),e.init.headers.push(["x-statsig-id",i])):(e.init.headers["x-xai-request-id"]=r,e.init.headers["x-statsig-id"]=i),e},sY=async e=>{let t=e.response;if(t&&t.status>=200&&t.status<300)return t;let i=new eh(t,"Response returned an error code");throw await (0,n.maybeProcessResponseError)(i)},sX={basePath:"undefined"==typeof location?void 0:location.origin,credentials:"include",fetchApi:i.fetchAndRecord4xx5xx,middleware:[{pre:sW,post:sY}]},s$={basePath:"undefined"==typeof location?void 0:location.origin,credentials:"include",fetchApi:i.fetchAndRecord4xx5xx,middleware:[{pre:sW,post:sY}]},sQ=new nm(new ed(sX));new class e extends id{async financeFindStockRaw(e,t){let n={};return null!=e.ticker&&(n.ticker=e.ticker),new im(await this.request({path:"/rest/finance",method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{stockSummaries:null==t.stockSummaries?void 0:t.stockSummaries.map(iy)}})}async financeFindStock(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.financeFindStockRaw(e,t);return await n.value()}async financeGetRelatedTickersRaw(e,t){if(null==e.ticker)throw new ih("ticker",'Required parameter "ticker" was null or undefined when calling financeGetRelatedTickers().');return new im(await this.request({path:"/rest/finance/{ticker}/related_tickers".replace("{ticker}",encodeURIComponent(String(e.ticker))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{relatedTickers:null==t.relatedTickers?void 0:ip(t.relatedTickers,iy)}})}async financeGetRelatedTickers(e,t){let n=await this.financeGetRelatedTickersRaw(e,t);return await n.value()}async financeGetStockChartDataRaw(e,t){if(null==e.ticker)throw new ih("ticker",'Required parameter "ticker" was null or undefined when calling financeGetStockChartData().');if(null==e.timespan)throw new ih("timespan",'Required parameter "timespan" was null or undefined when calling financeGetStockChartData().');return new im(await this.request({path:"/rest/finance/{ticker}/chart/{timespan}".replace("{ticker}",encodeURIComponent(String(e.ticker))).replace("{timespan}",encodeURIComponent(String(e.timespan))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{ticker:null==t.ticker?void 0:t.ticker,chartData:null==t.chartData?void 0:ip(t.chartData,ig),unit:null==t.unit?void 0:t.unit}})}async financeGetStockChartData(e,t){let n=await this.financeGetStockChartDataRaw(e,t);return await n.value()}async financeGetStockFinancialsRaw(e,t){if(null==e.ticker)throw new ih("ticker",'Required parameter "ticker" was null or undefined when calling financeGetStockFinancials().');if(null==e.timeframe)throw new ih("timeframe",'Required parameter "timeframe" was null or undefined when calling financeGetStockFinancials().');return new im(await this.request({path:"/rest/finance/{ticker}/financials/{timeframe}".replace("{ticker}",encodeURIComponent(String(e.ticker))).replace("{timeframe}",encodeURIComponent(String(e.timeframe))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{ticker:null==t.ticker?void 0:t.ticker,balanceSheets:null==t.balanceSheets?void 0:ip(t.balanceSheets,iw),incomeStatements:null==t.incomeStatements?void 0:ip(t.incomeStatements,iw),cashFlows:null==t.cashFlows?void 0:ip(t.cashFlows,iw)}})}async financeGetStockFinancials(e,t){let n=await this.financeGetStockFinancialsRaw(e,t);return await n.value()}async financeGetStockMiniSummaryRaw(e,t){if(null==e.ticker)throw new ih("ticker",'Required parameter "ticker" was null or undefined when calling financeGetStockMiniSummary().');return new im(await this.request({path:"/rest/finance/{ticker}/mini_summary".replace("{ticker}",encodeURIComponent(String(e.ticker))),method:"GET",headers:{},query:{}},t),e=>iy(e))}async financeGetStockMiniSummary(e,t){let n=await this.financeGetStockMiniSummaryRaw(e,t);return await n.value()}async financeGetStockSummaryRaw(e,t){if(null==e.ticker)throw new ih("ticker",'Required parameter "ticker" was null or undefined when calling financeGetStockSummary().');return new im(await this.request({path:"/rest/finance/{ticker}/summary".replace("{ticker}",encodeURIComponent(String(e.ticker))),method:"GET",headers:{},query:{}},t),e=>(function(e,t){var n,i;if(null==e)return e;return{ticker:null==e.ticker?void 0:e.ticker,timestamp:null==e.timestamp?void 0:e.timestamp,marketCap:null==e.marketCap?void 0:e.marketCap,prevDay:null==e.prevDay?void 0:ig(e.prevDay),currentDay:null==e.currentDay?void 0:ig(e.currentDay),dividend:null==e.dividend?void 0:(n=e.dividend,i=0,null==n?n:{exDividendDate:null==n.exDividendDate?void 0:n.exDividendDate,paymentDate:null==n.paymentDate?void 0:n.paymentDate,frequency:null==n.frequency?void 0:n.frequency,cashAmount:null==n.cashAmount?void 0:n.cashAmount,dividendYield:null==n.dividendYield?void 0:n.dividendYield}),oneYear:null==e.oneYear?void 0:ig(e.oneYear)}})(e,0))}async financeGetStockSummary(e,t){let n=await this.financeGetStockSummaryRaw(e,t);return await n.value()}}(new is(sX));let sZ=new class e extends rG{async settingsAddMobileDeviceNotificationTokenRaw(e,t){if(null==e.body)throw new rF("body",'Required parameter "body" was null or undefined when calling settingsAddMobileDeviceNotificationToken().');let n={};return n["Content-Type"]="application/json",new rN(await this.request({path:"/rest/add-mobile-device-notification-token",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{token:e.token,deviceType:e.deviceType}}(e.body,!1)},t))}async settingsAddMobileDeviceNotificationToken(e,t){let n=await this.settingsAddMobileDeviceNotificationTokenRaw(e,t);return await n.value()}async settingsGetUserSettingsRaw(e){return new rN(await this.request({path:"/rest/user-settings",method:"GET",headers:{},query:{}},e),e=>rK(e,!1))}async settingsGetUserSettings(e){let t=await this.settingsGetUserSettingsRaw(e);return await t.value()}async settingsSetUserSettingsRaw(e,t){if(null==e.body)throw new rF("body",'Required parameter "body" was null or undefined when calling settingsSetUserSettings().');let n={};return n["Content-Type"]="application/json",new rN(await this.request({path:"/rest/user-settings",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{excludeFromTraining:e.excludeFromTraining,preferences:e.preferences,allowXPersonalization:e.allowXPersonalization,enableMemory:e.enableMemory,allowShareIndexing:e.allowShareIndexing,allowCompanionNotifications:e.allowCompanionNotifications,allowAutoShare:e.allowAutoShare}}(e.body,!1)},t),e=>rK(e,!1))}async settingsSetUserSettings(e,t){let n=await this.settingsSetUserSettingsRaw(e,t);return await n.value()}async settingsUserIssueReportRaw(e,t){if(null==e.body)throw new rF("body",'Required parameter "body" was null or undefined when calling settingsUserIssueReport().');let n={};return n["Content-Type"]="application/json",new rN(await this.request({path:"/rest/issue-report",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{reportJSONString:e.reportJSONString,reportWithDumpJSONString:e.reportWithDumpJSONString,report:e.report,feedbackType:e.feedbackType}}(e.body,!1)},t))}async settingsUserIssueReport(e,t){let n=await this.settingsUserIssueReportRaw(e,t);return await n.value()}}(new rx(sX)),s0=new class e extends rW{async subscriptionsCreateBillingPortalSessionRaw(e,t){if(null==e.body)throw new r$("body",'Required parameter "body" was null or undefined when calling subscriptionsCreateBillingPortalSession().');let n={};return n["Content-Type"]="application/json",new rQ(await this.request({path:"/rest/subscriptions/billing-portal",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{configuration:e._configuration,flowData:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{type:e.type,afterCompletion:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{type:e.type,hostedConfirmation:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{customMessage:e.customMessage}}(e.hostedConfirmation,!1),redirect:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{returnUrl:e.returnUrl}}(e.redirect,!1)}}(e.afterCompletion,!1),subscriptionCancel:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{subscription:e.subscription,retention:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{couponOffer:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{coupon:e.coupon}}(e.couponOffer,!1)}}(e.retention,!1)}}(e.subscriptionCancel,!1),subscriptionUpdate:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{subscription:e.subscription}}(e.subscriptionUpdate,!1),subscriptionUpdateConfirm:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{subscription:e.subscription,items:null==e.items?void 0:e.items.map(rZ),discounts:e.discounts}}(e.subscriptionUpdateConfirm,!1)}}(e.flowData,!1),returnUrl:e.returnUrl}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{url:null==t.url?void 0:t.url}})}async subscriptionsCreateBillingPortalSession(e,t){let n=await this.subscriptionsCreateBillingPortalSessionRaw(e,t);return await n.value()}async subscriptionsCreateStripeCustomerRaw(e,t){if(null==e.body)throw new r$("body",'Required parameter "body" was null or undefined when calling subscriptionsCreateStripeCustomer().');let n={};return n["Content-Type"]="application/json",new rQ(await this.request({path:"/rest/subscriptions/customer/new",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{billingInfo:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,address:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{line1:e.line1,line2:e.line2,city:e.city,country:e.country,postalCode:e.postalCode,state:e.state}}(e.address,!1),email:e.email,taxIdType:e.taxIdType,taxNumber:e.taxNumber}}(e.billingInfo,!1)}}(e.body,!1)},t))}async subscriptionsCreateStripeCustomer(e,t){let n=await this.subscriptionsCreateStripeCustomerRaw(e,t);return await n.value()}async subscriptionsCreateUpdateSubscriptionBillingPortalSessionRaw(e,t){if(null==e.body)throw new r$("body",'Required parameter "body" was null or undefined when calling subscriptionsCreateUpdateSubscriptionBillingPortalSession().');let n={};return n["Content-Type"]="application/json",new rQ(await this.request({path:"/rest/subscriptions/billing-portal/update",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{subscriptionId:e.subscriptionId,newPriceId:e.newPriceId,returnUrl:e.returnUrl}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{url:null==t.url?void 0:t.url}})}async subscriptionsCreateUpdateSubscriptionBillingPortalSession(e,t){let n=await this.subscriptionsCreateUpdateSubscriptionBillingPortalSessionRaw(e,t);return await n.value()}async subscriptionsGetProductsInfoRaw(e,t){let n={};return null!=e.provider&&(n.provider=e.provider),new rQ(await this.request({path:"/rest/products",method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{google:null==t.google?void 0:ao(t.google),apple:null==t.apple?void 0:ao(t.apple),stripe:null==t.stripe?void 0:ao(t.stripe),paypal:null==t.paypal?void 0:ao(t.paypal),x:null==t.x?void 0:ao(t.x)}})}async subscriptionsGetProductsInfo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.subscriptionsGetProductsInfoRaw(e,t);return await n.value()}async subscriptionsGetSubscriptionsRaw(e,t){let n={};return null!=e.provider&&(n.provider=e.provider),null!=e.status&&(n.status=e.status),new rQ(await this.request({path:"/rest/subscriptions",method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{subscriptions:null==t.subscriptions?void 0:t.subscriptions.map(r5)}})}async subscriptionsGetSubscriptions(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.subscriptionsGetSubscriptionsRaw(e,t);return await n.value()}async subscriptionsGetTeamsWhereUserHasActiveSubRaw(e){return new rQ(await this.request({path:"/rest/teams-where-user-has-active-sub",method:"GET",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{publicTeams:null==t.publicTeams?void 0:t.publicTeams.map(ar)}})}async subscriptionsGetTeamsWhereUserHasActiveSub(e){let t=await this.subscriptionsGetTeamsWhereUserHasActiveSubRaw(e);return await t.value()}async subscriptionsSubscribeViaPaypalRaw(e,t){if(null==e.body)throw new r$("body",'Required parameter "body" was null or undefined when calling subscriptionsSubscribeViaPaypal().');let n={};return n["Content-Type"]="application/json",new rQ(await this.request({path:"/rest/subscriptions/subscribe-via-paypal/new",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{planId:e.planId}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{links:null==t.links?void 0:t.links.map(ad),ignoredDueToActiveSubscriptions:null==t.ignoredDueToActiveSubscriptions?void 0:t.ignoredDueToActiveSubscriptions.map(au)}})}async subscriptionsSubscribeViaPaypal(e,t){let n=await this.subscriptionsSubscribeViaPaypalRaw(e,t);return await n.value()}async subscriptionsSubscribeViaStripeRaw(e,t){if(null==e.body)throw new r$("body",'Required parameter "body" was null or undefined when calling subscriptionsSubscribeViaStripe().');let n={};return n["Content-Type"]="application/json",new rQ(await this.request({path:"/rest/subscriptions/subscribe/new",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{embedded:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{returnUrl:e.returnUrl,isEmbedded:e.isEmbedded}}(e.embedded,!1),stripeHosted:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{successUrl:e.successUrl}}(e.stripeHosted,!1),priceId:e.priceId,ignoreExistingActiveSubscriptions:e.ignoreExistingActiveSubscriptions,discountId:e.discountId,subscriptionType:e.subscriptionType,xPremDiscountCodeMonth:e.xPremDiscountCodeMonth,xPremDiscountCodeYear:e.xPremDiscountCodeYear,eduDiscountCodeMonth:e.eduDiscountCodeMonth,eduDiscountCodeYear:e.eduDiscountCodeYear,allowedPaymentMethodTypes:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{paymentMethodTypes:null==e.paymentMethodTypes?void 0:e.paymentMethodTypes.map(ac)}}(e.allowedPaymentMethodTypes,!1),requestedTier:e.requestedTier,campaignId:e.campaignId}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{clientSecret:null==t.clientSecret?void 0:t.clientSecret,url:null==t.url?void 0:t.url,ignoredDueToActiveSubscriptions:null==t.ignoredDueToActiveSubscriptions?void 0:t.ignoredDueToActiveSubscriptions.map(au)}})}async subscriptionsSubscribeViaStripe(e,t){let n=await this.subscriptionsSubscribeViaStripeRaw(e,t);return await n.value()}}(new rH(sX)),s1=new class e extends oZ{async modelsGetModelsRaw(e,t){if(null==e.body)throw new o2("body",'Required parameter "body" was null or undefined when calling modelsGetModels().');let n={};return n["Content-Type"]="application/json",new o4(await this.request({path:"/rest/models",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{locale:e.locale}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{models:null==t.models?void 0:t.models.map(o8),unavailableModels:null==t.unavailableModels?void 0:t.unavailableModels.map(o8),defaultFreeModel:null==t.defaultFreeModel?void 0:t.defaultFreeModel,defaultProModel:null==t.defaultProModel?void 0:t.defaultProModel,defaultAnonModel:null==t.defaultAnonModel?void 0:t.defaultAnonModel,defaultHeavyModel:null==t.defaultHeavyModel?void 0:t.defaultHeavyModel,defaultAnonMode:null==t.defaultAnonMode?void 0:o5(t.defaultAnonMode),defaultFreeMode:null==t.defaultFreeMode?void 0:o5(t.defaultFreeMode),defaultProMode:null==t.defaultProMode?void 0:o5(t.defaultProMode),defaultHeavyMode:null==t.defaultHeavyMode?void 0:o5(t.defaultHeavyMode)}})}async modelsGetModels(e,t){let n=await this.modelsGetModelsRaw(e,t);return await n.value()}async modelsGetModelsImagineOverridesRaw(e,t){if(null==e.body)throw new o2("body",'Required parameter "body" was null or undefined when calling modelsGetModelsImagineOverrides().');let n={};return n["Content-Type"]="application/json",new o4(await this.request({path:"/rest/models/imagine/overrides",method:"POST",headers:n,query:{},body:e.body},t),e=>{var t,n;return n=0,null==(t=e)?t:{modelMapOverrides:null==t.modelMapOverrides?void 0:t.modelMapOverrides.map(o3)}})}async modelsGetModelsImagineOverrides(e,t){let n=await this.modelsGetModelsImagineOverridesRaw(e,t);return await n.value()}}(new o$(sX)),s2=new class e extends rm{async rateLimitsGetRateLimitsRaw(e,t){if(null==e.body)throw new rf("body",'Required parameter "body" was null or undefined when calling rateLimitsGetRateLimits().');let n={};return n["Content-Type"]="application/json",new rg(await this.request({path:"/rest/rate-limits",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{requestKind:e.requestKind,modelName:e.modelName}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{windowSizeSeconds:null==t.windowSizeSeconds?void 0:t.windowSizeSeconds,remainingQueries:null==t.remainingQueries?void 0:t.remainingQueries,waitTimeSeconds:null==t.waitTimeSeconds?void 0:t.waitTimeSeconds,totalQueries:null==t.totalQueries?void 0:t.totalQueries,remainingTokens:null==t.remainingTokens?void 0:t.remainingTokens,totalTokens:null==t.totalTokens?void 0:t.totalTokens,lowEffortRateLimits:null==t.lowEffortRateLimits?void 0:ry(t.lowEffortRateLimits,!1),highEffortRateLimits:null==t.highEffortRateLimits?void 0:ry(t.highEffortRateLimits,!1)}})}async rateLimitsGetRateLimits(e,t){let n=await this.rateLimitsGetRateLimitsRaw(e,t);return await n.value()}}(new rh(sX)),s4=new class e extends c{async authFrontendCreateAnonUserRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendCreateAnonUser().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/create-anon-user",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{userPublicKey:e.userPublicKey,anonUserToken:e.anonUserToken}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{anonUserId:null==t.anonUserId?void 0:t.anonUserId}})}async authFrontendCreateAnonUser(e,t){let n=await this.authFrontendCreateAnonUserRaw(e,t);return await n.value()}async authFrontendCreateAnonUserChallengeRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendCreateAnonUserChallenge().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/create-anon-user-challenge",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{anonUserId:e.anonUserId}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{challenge:null==t.challenge?void 0:t.challenge,challengeExpirationTime:null==t.challengeExpirationTime?void 0:t.challengeExpirationTime}})}async authFrontendCreateAnonUserChallenge(e,t){let n=await this.authFrontendCreateAnonUserChallengeRaw(e,t);return await n.value()}async authFrontendCreateCookieSetterLinkRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendCreateCookieSetterLink().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/create-cookie-setter-link",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{successUrl:e.successUrl,errorUrl:e.errorUrl}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{encodedConfig:null==t.encodedConfig?void 0:t.encodedConfig}})}async authFrontendCreateCookieSetterLink(e,t){let n=await this.authFrontendCreateCookieSetterLinkRaw(e,t);return await n.value()}async authFrontendCreateOauthConnectorRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendCreateOauthConnector().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/create-oauth-connector",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{credentials:f(e.credentials,!1)}}(e.body,!1)},t))}async authFrontendCreateOauthConnector(e,t){let n=await this.authFrontendCreateOauthConnectorRaw(e,t);return await n.value()}async authFrontendCreateSessionRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendCreateSession().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/create-session",method:"POST",headers:n,query:{},body:g(e.body,!1)},t),e=>I(e,!1))}async authFrontendCreateSession(e,t){let n=await this.authFrontendCreateSessionRaw(e,t);return await n.value()}async authFrontendCreateSessionV2Raw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendCreateSessionV2().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/create-session-v2",method:"POST",headers:n,query:{},body:g(e.body,!1)},t),e=>(function(e,t){var n,i;if(null==e)return e;return{session:null==e.session?void 0:I(e.session,!1),existingEmailSignInMethods:null==e.existingEmailSignInMethods?void 0:(n=e.existingEmailSignInMethods,i=0,null==n?n:{signInMethods:null==n.signInMethods?void 0:n.signInMethods.map(y),oauthDataToken:null==n.oauthDataToken?void 0:n.oauthDataToken,users:null==n.users?void 0:n.users.map(b)})}})(e,0))}async authFrontendCreateSessionV2(e,t){let n=await this.authFrontendCreateSessionV2Raw(e,t);return await n.value()}async authFrontendCreateXIntegrationUserRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendCreateXIntegrationUser().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/create-x-integration-user",method:"POST",headers:n,query:{},body:e.body},t),e=>{var t,n;return n=0,null==(t=e)?t:{xaiUserId:null==t.xaiUserId?void 0:t.xaiUserId}})}async authFrontendCreateXIntegrationUser(e,t){let n=await this.authFrontendCreateXIntegrationUserRaw(e,t);return await n.value()}async authFrontendCreateXUserSessionRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendCreateXUserSession().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/create-x-user-session",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{tosVersion:e.tosVersion}}(e.body,!1)},t),e=>I(e,!1))}async authFrontendCreateXUserSession(e,t){let n=await this.authFrontendCreateXUserSessionRaw(e,t);return await n.value()}async authFrontendDeleteOauthConnectorRaw(e,t){let n={};return null!=e.oauthConnectorId&&(n.oauthConnectorId=e.oauthConnectorId),new v(await this.request({path:"/rest/auth/delete-oauth-connnector",method:"DELETE",headers:{},query:n},t))}async authFrontendDeleteOauthConnector(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.authFrontendDeleteOauthConnectorRaw(e,t);return await n.value()}async authFrontendDeleteSessionRaw(e,t){let n={};return null!=e.sessionId&&(n.sessionId=e.sessionId),new v(await this.request({path:"/rest/auth/delete-session",method:"DELETE",headers:{},query:n},t))}async authFrontendDeleteSession(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.authFrontendDeleteSessionRaw(e,t);return await n.value()}async authFrontendEditUserRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendEditUser().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/edit-user",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{user:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{userId:e.userId,createTime:e.createTime,email:e.email,profileImage:e.profileImage,givenName:e.givenName,familyName:e.familyName,xSubscriptionType:e.xSubscriptionType,xUserId:e.xUserId,xUsername:e.xUsername,role:e.role,emailConfirmed:e.emailConfirmed,tosAcceptedVersion:e.tosAcceptedVersion,blockedReason:e.blockedReason,aclStrings:e.aclStrings,sessionTierId:e.sessionTierId,birthDate:e.birthDate,emailDomain:e.emailDomain,grokDb:e.grokDb,deleteTime:e.deleteTime,vercelAvatarUrl:e.vercelAvatarUrl,vercelEmail:e.vercelEmail,vercelId:e.vercelId,vercelName:e.vercelName,vercelRole:e.vercelRole,hasPassword:e.hasPassword,googleEmail:e.googleEmail,emailSubscribed:e.emailSubscribed,migratedFromX:e.migratedFromX,xMigrationStatus:e.xMigrationStatus,organizationId:e.organizationId,organizationRole:e.organizationRole,organizationRbacRoleId:e.organizationRbacRoleId,organizationType:e.organizationType,riskLevel:e.riskLevel,allowNsfwContent:e.allowNsfwContent,alwaysShowNsfwContent:e.alwaysShowNsfwContent}}(e.user,!1),fieldMask:e.fieldMask}}(e.body,!1)},t),e=>R(e,!1))}async authFrontendEditUser(e,t){let n=await this.authFrontendEditUserRaw(e,t);return await n.value()}async authFrontendFinishMfaVerificationRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendFinishMfaVerification().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/finish-mfa-verification",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{otp:e.otp,publicKeyJson:e.publicKeyJson,domain:e.domain}}(e.body,!1)},t))}async authFrontendFinishMfaVerification(e,t){let n=await this.authFrontendFinishMfaVerificationRaw(e,t);return await n.value()}async authFrontendGetAuthStatusRaw(e){return new v(await this.request({path:"/rest/auth/get-auth-status",method:"GET",headers:{},query:{}},e))}async authFrontendGetAuthStatus(e){let t=await this.authFrontendGetAuthStatusRaw(e);return await t.value()}async authFrontendGetAuthUrlRaw(e,t){let n={};return null!=e.provider&&(n.provider=e.provider),null!=e.redirectUrl&&(n.redirectUrl=e.redirectUrl),null!=e.antiAbuseTokenTurnstileToken&&(n["antiAbuseToken.turnstileToken"]=e.antiAbuseTokenTurnstileToken),null!=e.stateMetadata&&(n.stateMetadata=e.stateMetadata),null!=e.domain&&(n.domain=e.domain),new v(await this.request({path:"/rest/get-auth-url",method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{authUrl:null==t.authUrl?void 0:t.authUrl,oauth2Cookie:null==t.oauth2Cookie?void 0:t.oauth2Cookie}})}async authFrontendGetAuthUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.authFrontendGetAuthUrlRaw(e,t);return await n.value()}async authFrontendGetTeamRaw(e,t){let n={};return null!=e.teamId&&(n.teamId=e.teamId),null!=e.returnCreateUser&&(n.returnCreateUser=e.returnCreateUser),new v(await this.request({path:"/rest/auth/get-team",method:"GET",headers:{},query:n},t),e=>U(e))}async authFrontendGetTeam(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.authFrontendGetTeamRaw(e,t);return await n.value()}async authFrontendGetUserRaw(e){return new v(await this.request({path:"/rest/auth/get-user",method:"GET",headers:{},query:{}},e),e=>R(e,!1))}async authFrontendGetUser(e){let t=await this.authFrontendGetUserRaw(e);return await t.value()}async authFrontendGetUserFeatureControlsRaw(e){return new v(await this.request({path:"/rest/auth/get-user-feature-controls",method:"GET",headers:{},query:{}},e),e=>M(e,!1))}async authFrontendGetUserFeatureControls(e){let t=await this.authFrontendGetUserFeatureControlsRaw(e);return await t.value()}async authFrontendLinkAccountRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendLinkAccount().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/link-account",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{credentials:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{oauth:f(e.oauth,!1),idToken:w(e.idToken,!1)}}(e.credentials,!1)}}(e.body,!1)},t))}async authFrontendLinkAccount(e,t){let n=await this.authFrontendLinkAccountRaw(e,t);return await n.value()}async authFrontendListMfaDevicesRaw(e){return new v(await this.request({path:"/rest/auth/list-mfa-devices",method:"GET",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{devices:null==t.devices?void 0:t.devices.map(S)}})}async authFrontendListMfaDevices(e){let t=await this.authFrontendListMfaDevicesRaw(e);return await t.value()}async authFrontendListOauthConnectorsRaw(e){return new v(await this.request({path:"/rest/auth/list-oauth-connectors",method:"GET",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{oauthConnectors:null==t.oauthConnectors?void 0:t.oauthConnectors.map(k)}})}async authFrontendListOauthConnectors(e){let t=await this.authFrontendListOauthConnectorsRaw(e);return await t.value()}async authFrontendListTeamsRaw(e){return new v(await this.request({path:"/rest/auth/list-teams",method:"GET",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{teams:null==t.teams?void 0:t.teams.map(U)}})}async authFrontendListTeams(e){let t=await this.authFrontendListTeamsRaw(e);return await t.value()}async authFrontendRefreshXSubscriptionStatusRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendRefreshXSubscriptionStatus().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/refresh-x-subscription-status",method:"POST",headers:n,query:{},body:e.body},t))}async authFrontendRefreshXSubscriptionStatus(e,t){let n=await this.authFrontendRefreshXSubscriptionStatusRaw(e,t);return await n.value()}async authFrontendResendEmailValidationEmailRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendResendEmailValidationEmail().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/resend-email-validation-email",method:"POST",headers:n,query:{},body:e.body},t))}async authFrontendResendEmailValidationEmail(e,t){let n=await this.authFrontendResendEmailValidationEmailRaw(e,t);return await n.value()}async authFrontendRestoreDeletedUserRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendRestoreDeletedUser().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/restore-deleted-user",method:"POST",headers:n,query:{},body:e.body},t))}async authFrontendRestoreDeletedUser(e,t){let n=await this.authFrontendRestoreDeletedUserRaw(e,t);return await n.value()}async authFrontendSetBirthDateRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendSetBirthDate().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/set-birth-date",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{birthDate:e.birthDate}}(e.body,!1)},t))}async authFrontendSetBirthDate(e,t){let n=await this.authFrontendSetBirthDateRaw(e,t);return await n.value()}async authFrontendSetEmailAddressRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendSetEmailAddress().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/set-email-address",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{newEmail:e.newEmail}}(e.body,!1)},t))}async authFrontendSetEmailAddress(e,t){let n=await this.authFrontendSetEmailAddressRaw(e,t);return await n.value()}async authFrontendSetTosAcceptedVersionRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendSetTosAcceptedVersion().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/set-tos-accepted",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{tosVersion:e.tosVersion}}(e.body,!1)},t))}async authFrontendSetTosAcceptedVersion(e,t){let n=await this.authFrontendSetTosAcceptedVersionRaw(e,t);return await n.value()}async authFrontendSetXUserDetailsRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendSetXUserDetails().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/set-x-user-details",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{xSubscriptionType:e.xSubscriptionType,xUsername:e.xUsername}}(e.body,!1)},t))}async authFrontendSetXUserDetails(e,t){let n=await this.authFrontendSetXUserDetailsRaw(e,t);return await n.value()}async authFrontendSoftDeleteUserRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendSoftDeleteUser().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/soft-delete-user",method:"POST",headers:n,query:{},body:e.body},t))}async authFrontendSoftDeleteUser(e,t){let n=await this.authFrontendSoftDeleteUserRaw(e,t);return await n.value()}async authFrontendStartMfaVerificationRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendStartMfaVerification().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/start-mfa-verification",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{multiFactorDeviceId:e.multiFactorDeviceId,domain:e.domain}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{toptChallenge:null==t.toptChallenge?void 0:t.toptChallenge,webAuthnChallenge:null==t.webAuthnChallenge?void 0:t.webAuthnChallenge}})}async authFrontendStartMfaVerification(e,t){let n=await this.authFrontendStartMfaVerificationRaw(e,t);return await n.value()}async authFrontendUpdateProfileImageRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendUpdateProfileImage().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/update-profile-image",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{profileImage:e.profileImage}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{assetKey:null==t.assetKey?void 0:t.assetKey}})}async authFrontendUpdateProfileImage(e,t){let n=await this.authFrontendUpdateProfileImageRaw(e,t);return await n.value()}async authFrontendUpdateUserFeatureControlsRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendUpdateUserFeatureControls().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/update-user-feature-controls",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{features:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{allowNsfwContent:e.allowNsfwContent,alwaysShowNsfwContent:e.alwaysShowNsfwContent}}(e.features,!1),updateMask:e.updateMask}}(e.body,!1)},t),e=>M(e,!1))}async authFrontendUpdateUserFeatureControls(e,t){let n=await this.authFrontendUpdateUserFeatureControlsRaw(e,t);return await n.value()}async authFrontendUpdateXIntegrationUserStatusRaw(e,t){if(null==e.body)throw new m("body",'Required parameter "body" was null or undefined when calling authFrontendUpdateXIntegrationUserStatus().');let n={};return n["Content-Type"]="application/json",new v(await this.request({path:"/rest/auth/update-x-integration-user-status",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{xMigrationStatus:e.xMigrationStatus}}(e.body,!1)},t))}async authFrontendUpdateXIntegrationUserStatus(e,t){let n=await this.authFrontendUpdateXIntegrationUserStatusRaw(e,t);return await n.value()}}(new d(sX)),s3=new class e extends aE{async systemPromptRepositoryCreateSystemPromptRaw(e,t){if(null==e.body)throw new a_("body",'Required parameter "body" was null or undefined when calling systemPromptRepositoryCreateSystemPrompt().');let n={};return n["Content-Type"]="application/json",new ax(await this.request({path:"/rest/system-prompt/create",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,content:null==e.content?void 0:e.content.map(aD)}}(e.body,!1)},t),e=>aL(e))}async systemPromptRepositoryCreateSystemPrompt(e,t){let n=await this.systemPromptRepositoryCreateSystemPromptRaw(e,t);return await n.value()}async systemPromptRepositoryDeleteSystemPromptRaw(e,t){if(null==e.systemPromptId)throw new a_("systemPromptId",'Required parameter "systemPromptId" was null or undefined when calling systemPromptRepositoryDeleteSystemPrompt().');return new ax(await this.request({path:"/rest/system-prompt/{systemPromptId}".replace("{systemPromptId}",encodeURIComponent(String(e.systemPromptId))),method:"DELETE",headers:{},query:{}},t))}async systemPromptRepositoryDeleteSystemPrompt(e,t){let n=await this.systemPromptRepositoryDeleteSystemPromptRaw(e,t);return await n.value()}async systemPromptRepositoryGetSystemPromptRaw(e,t){if(null==e.systemPromptId)throw new a_("systemPromptId",'Required parameter "systemPromptId" was null or undefined when calling systemPromptRepositoryGetSystemPrompt().');return new ax(await this.request({path:"/rest/system-prompt/{systemPromptId}".replace("{systemPromptId}",encodeURIComponent(String(e.systemPromptId))),method:"GET",headers:{},query:{}},t),e=>aL(e))}async systemPromptRepositoryGetSystemPrompt(e,t){let n=await this.systemPromptRepositoryGetSystemPromptRaw(e,t);return await n.value()}async systemPromptRepositoryListSystemPromptsRaw(e,t){if(null==e.body)throw new a_("body",'Required parameter "body" was null or undefined when calling systemPromptRepositoryListSystemPrompts().');let n={};return n["Content-Type"]="application/json",new ax(await this.request({path:"/rest/system-prompt/list",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{query:e.query,pageSize:e.pageSize,pageToken:e.pageToken,orderBy:e.orderBy}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{assets:null==t.assets?void 0:t.assets.map(aL),nextPageToken:null==t.nextPageToken?void 0:t.nextPageToken}})}async systemPromptRepositoryListSystemPrompts(e,t){let n=await this.systemPromptRepositoryListSystemPromptsRaw(e,t);return await n.value()}async systemPromptRepositoryUpdateSystemPromptRaw(e,t){if(null==e.systemPromptId)throw new a_("systemPromptId",'Required parameter "systemPromptId" was null or undefined when calling systemPromptRepositoryUpdateSystemPrompt().');if(null==e.body)throw new a_("body",'Required parameter "body" was null or undefined when calling systemPromptRepositoryUpdateSystemPrompt().');let n={};return n["Content-Type"]="application/json",new ax(await this.request({path:"/rest/system-prompt/{systemPromptId}".replace("{systemPromptId}",encodeURIComponent(String(e.systemPromptId))),method:"PUT",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,content:null==e.content?void 0:e.content.map(aG)}}(e.body,!1)},t),e=>aL(e))}async systemPromptRepositoryUpdateSystemPrompt(e,t){let n=await this.systemPromptRepositoryUpdateSystemPromptRaw(e,t);return await n.value()}}(new aA(sX)),s6=new r.DefaultApi(new a.Configuration(sX)),s5=new class e extends sD{async workspaceRepositoryAddAssetRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositoryAddAsset().');if(null==e.body)throw new sN("body",'Required parameter "body" was null or undefined when calling workspaceRepositoryAddAsset().');let n={};return n["Content-Type"]="application/json",new sj(await this.request({path:"/rest/workspaces/{workspaceId}/assets".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{assetId:e.assetId}}(e.body,!1)},t))}async workspaceRepositoryAddAsset(e,t){let n=await this.workspaceRepositoryAddAssetRaw(e,t);return await n.value()}async workspaceRepositoryAddConversationRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositoryAddConversation().');if(null==e.body)throw new sN("body",'Required parameter "body" was null or undefined when calling workspaceRepositoryAddConversation().');let n={};return n["Content-Type"]="application/json",new sj(await this.request({path:"/rest/workspaces/{workspaceId}/conversations".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{conversationId:e.conversationId}}(e.body,!1)},t))}async workspaceRepositoryAddConversation(e,t){let n=await this.workspaceRepositoryAddConversationRaw(e,t);return await n.value()}async workspaceRepositoryCloneWorkspaceRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositoryCloneWorkspace().');if(null==e.body)throw new sN("body",'Required parameter "body" was null or undefined when calling workspaceRepositoryCloneWorkspace().');let n={};return n["Content-Type"]="application/json",new sj(await this.request({path:"/rest/workspaces/{workspaceId}/clone".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,icon:e.icon}}(e.body,!1)},t),e=>sH(e))}async workspaceRepositoryCloneWorkspace(e,t){let n=await this.workspaceRepositoryCloneWorkspaceRaw(e,t);return await n.value()}async workspaceRepositoryCreateWorkspaceRaw(e,t){if(null==e.body)throw new sN("body",'Required parameter "body" was null or undefined when calling workspaceRepositoryCreateWorkspace().');let n={};return n["Content-Type"]="application/json",new sj(await this.request({path:"/rest/workspaces",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,icon:e.icon,customPersonality:e.customPersonality,preferredModel:e.preferredModel,conversationStarters:e.conversationStarters}}(e.body,!1)},t),e=>sH(e))}async workspaceRepositoryCreateWorkspace(e,t){let n=await this.workspaceRepositoryCreateWorkspaceRaw(e,t);return await n.value()}async workspaceRepositoryDeleteWorkspaceRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositoryDeleteWorkspace().');return new sj(await this.request({path:"/rest/workspaces/{workspaceId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"DELETE",headers:{},query:{}},t))}async workspaceRepositoryDeleteWorkspace(e,t){let n=await this.workspaceRepositoryDeleteWorkspaceRaw(e,t);return await n.value()}async workspaceRepositoryGetWorkspaceRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositoryGetWorkspace().');return new sj(await this.request({path:"/rest/workspaces/{workspaceId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"GET",headers:{},query:{}},t),e=>sH(e))}async workspaceRepositoryGetWorkspace(e,t){let n=await this.workspaceRepositoryGetWorkspaceRaw(e,t);return await n.value()}async workspaceRepositoryGetWorkspacePermissionsRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositoryGetWorkspacePermissions().');return new sj(await this.request({path:"/rest/workspaces/{workspaceId}/permissions".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{permissions:null==t.permissions?void 0:sz(t.permissions)}})}async workspaceRepositoryGetWorkspacePermissions(e,t){let n=await this.workspaceRepositoryGetWorkspacePermissionsRaw(e,t);return await n.value()}async workspaceRepositoryListActiveCollectionsRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositoryListActiveCollections().');return new sj(await this.request({path:"/rest/workspaces/{workspaceId}/collections".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{collectionIds:null==t.collectionIds?void 0:t.collectionIds}})}async workspaceRepositoryListActiveCollections(e,t){let n=await this.workspaceRepositoryListActiveCollectionsRaw(e,t);return await n.value()}async workspaceRepositoryListActiveConnectorsRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositoryListActiveConnectors().');return new sj(await this.request({path:"/rest/workspaces/{workspaceId}/connectors".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{connectorIds:null==t.connectorIds?void 0:t.connectorIds}})}async workspaceRepositoryListActiveConnectors(e,t){let n=await this.workspaceRepositoryListActiveConnectorsRaw(e,t);return await n.value()}async workspaceRepositoryListSharedWorkspacesRaw(e){return new sj(await this.request({path:"/rest/workspaces/shared",method:"GET",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{workspaces:null==t.workspaces?void 0:t.workspaces.map(sH)}})}async workspaceRepositoryListSharedWorkspaces(e){let t=await this.workspaceRepositoryListSharedWorkspacesRaw(e);return await t.value()}async workspaceRepositoryListWorkspacesRaw(e,t){let n={};return null!=e.query&&(n.query=e.query),null!=e.pageSize&&(n.pageSize=e.pageSize),null!=e.pageToken&&(n.pageToken=e.pageToken),null!=e.orderBy&&(n.orderBy=e.orderBy),new sj(await this.request({path:"/rest/workspaces",method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{workspaces:null==t.workspaces?void 0:t.workspaces.map(sH),nextPageToken:null==t.nextPageToken?void 0:t.nextPageToken}})}async workspaceRepositoryListWorkspaces(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.workspaceRepositoryListWorkspacesRaw(e,t);return await n.value()}async workspaceRepositoryRemoveActiveCollectionRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositoryRemoveActiveCollection().');if(null==e.collectionId)throw new sN("collectionId",'Required parameter "collectionId" was null or undefined when calling workspaceRepositoryRemoveActiveCollection().');return new sj(await this.request({path:"/rest/workspaces/{workspaceId}/collections/{collectionId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{collectionId}",encodeURIComponent(String(e.collectionId))),method:"DELETE",headers:{},query:{}},t))}async workspaceRepositoryRemoveActiveCollection(e,t){let n=await this.workspaceRepositoryRemoveActiveCollectionRaw(e,t);return await n.value()}async workspaceRepositoryRemoveActiveConnectorRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositoryRemoveActiveConnector().');if(null==e.connectorId)throw new sN("connectorId",'Required parameter "connectorId" was null or undefined when calling workspaceRepositoryRemoveActiveConnector().');return new sj(await this.request({path:"/rest/workspaces/{workspaceId}/connectors/{connectorId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{connectorId}",encodeURIComponent(String(e.connectorId))),method:"DELETE",headers:{},query:{}},t))}async workspaceRepositoryRemoveActiveConnector(e,t){let n=await this.workspaceRepositoryRemoveActiveConnectorRaw(e,t);return await n.value()}async workspaceRepositoryRemoveAssetRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositoryRemoveAsset().');if(null==e.assetId)throw new sN("assetId",'Required parameter "assetId" was null or undefined when calling workspaceRepositoryRemoveAsset().');return new sj(await this.request({path:"/rest/workspaces/{workspaceId}/assets/{assetId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{assetId}",encodeURIComponent(String(e.assetId))),method:"DELETE",headers:{},query:{}},t))}async workspaceRepositoryRemoveAsset(e,t){let n=await this.workspaceRepositoryRemoveAssetRaw(e,t);return await n.value()}async workspaceRepositoryRemoveConversationRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositoryRemoveConversation().');if(null==e.conversationId)throw new sN("conversationId",'Required parameter "conversationId" was null or undefined when calling workspaceRepositoryRemoveConversation().');return new sj(await this.request({path:"/rest/workspaces/{workspaceId}/conversations/{conversationId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))).replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"DELETE",headers:{},query:{}},t))}async workspaceRepositoryRemoveConversation(e,t){let n=await this.workspaceRepositoryRemoveConversationRaw(e,t);return await n.value()}async workspaceRepositorySetActiveCollectionRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositorySetActiveCollection().');if(null==e.body)throw new sN("body",'Required parameter "body" was null or undefined when calling workspaceRepositorySetActiveCollection().');let n={};return n["Content-Type"]="application/json",new sj(await this.request({path:"/rest/workspaces/{workspaceId}/collections".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{collectionId:e.collectionId}}(e.body,!1)},t))}async workspaceRepositorySetActiveCollection(e,t){let n=await this.workspaceRepositorySetActiveCollectionRaw(e,t);return await n.value()}async workspaceRepositorySetActiveConnectorRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositorySetActiveConnector().');if(null==e.body)throw new sN("body",'Required parameter "body" was null or undefined when calling workspaceRepositorySetActiveConnector().');let n={};return n["Content-Type"]="application/json",new sj(await this.request({path:"/rest/workspaces/{workspaceId}/connectors".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{connectorId:e.connectorId}}(e.body,!1)},t))}async workspaceRepositorySetActiveConnector(e,t){let n=await this.workspaceRepositorySetActiveConnectorRaw(e,t);return await n.value()}async workspaceRepositorySetProjectEmailAccessRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositorySetProjectEmailAccess().');if(null==e.body)throw new sN("body",'Required parameter "body" was null or undefined when calling workspaceRepositorySetProjectEmailAccess().');let n={};return n["Content-Type"]="application/json",new sj(await this.request({path:"/rest/workspaces/{workspaceId}/permissions/email".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{email:e.email,accessLevel:e.accessLevel}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{permissions:null==t.permissions?void 0:sz(t.permissions)}})}async workspaceRepositorySetProjectEmailAccess(e,t){let n=await this.workspaceRepositorySetProjectEmailAccessRaw(e,t);return await n.value()}async workspaceRepositorySetProjectPublicAccessRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositorySetProjectPublicAccess().');if(null==e.body)throw new sN("body",'Required parameter "body" was null or undefined when calling workspaceRepositorySetProjectPublicAccess().');let n={};return n["Content-Type"]="application/json",new sj(await this.request({path:"/rest/workspaces/{workspaceId}/permissions/public".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{accessLevel:e.accessLevel}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{permissions:null==t.permissions?void 0:sz(t.permissions)}})}async workspaceRepositorySetProjectPublicAccess(e,t){let n=await this.workspaceRepositorySetProjectPublicAccessRaw(e,t);return await n.value()}async workspaceRepositorySetProjectTeamAccessRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositorySetProjectTeamAccess().');if(null==e.body)throw new sN("body",'Required parameter "body" was null or undefined when calling workspaceRepositorySetProjectTeamAccess().');let n={};return n["Content-Type"]="application/json",new sj(await this.request({path:"/rest/workspaces/{workspaceId}/permissions/team".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{teamId:e.teamId,accessLevel:e.accessLevel}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{permissions:null==t.permissions?void 0:sz(t.permissions)}})}async workspaceRepositorySetProjectTeamAccess(e,t){let n=await this.workspaceRepositorySetProjectTeamAccessRaw(e,t);return await n.value()}async workspaceRepositorySetProjectUserIdAccessRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositorySetProjectUserIdAccess().');if(null==e.body)throw new sN("body",'Required parameter "body" was null or undefined when calling workspaceRepositorySetProjectUserIdAccess().');let n={};return n["Content-Type"]="application/json",new sj(await this.request({path:"/rest/workspaces/{workspaceId}/permissions/user-id".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{userId:e.userId,accessLevel:e.accessLevel}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{permissions:null==t.permissions?void 0:sz(t.permissions)}})}async workspaceRepositorySetProjectUserIdAccess(e,t){let n=await this.workspaceRepositorySetProjectUserIdAccessRaw(e,t);return await n.value()}async workspaceRepositoryUpdateWorkspaceRaw(e,t){if(null==e.workspaceId)throw new sN("workspaceId",'Required parameter "workspaceId" was null or undefined when calling workspaceRepositoryUpdateWorkspace().');if(null==e.body)throw new sN("body",'Required parameter "body" was null or undefined when calling workspaceRepositoryUpdateWorkspace().');let n={};return n["Content-Type"]="application/json",new sj(await this.request({path:"/rest/workspaces/{workspaceId}".replace("{workspaceId}",encodeURIComponent(String(e.workspaceId))),method:"PUT",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,icon:e.icon,customPersonality:e.customPersonality,preferredModel:e.preferredModel,conversationStarters:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{starters:e.starters}}(e.conversationStarters,!1),isPublic:e.isPublic,conversationTemplates:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{templates:null==e.templates?void 0:e.templates.map(sV)}}(e.conversationTemplates,!1)}}(e.body,!1)},t),e=>sH(e))}async workspaceRepositoryUpdateWorkspace(e,t){let n=await this.workspaceRepositoryUpdateWorkspaceRaw(e,t);return await n.value()}}(new sO(sX));new class e extends ny{async collectionsAddDocumentToCollectionRaw(e,t){if(null==e.collectionId)throw new nT("collectionId",'Required parameter "collectionId" was null or undefined when calling collectionsAddDocumentToCollection().');if(null==e.fileId)throw new nT("fileId",'Required parameter "fileId" was null or undefined when calling collectionsAddDocumentToCollection().');if(null==e.collectionsAddDocumentToCollectionBody)throw new nT("collectionsAddDocumentToCollectionBody",'Required parameter "collectionsAddDocumentToCollectionBody" was null or undefined when calling collectionsAddDocumentToCollection().');let n={};return n["Content-Type"]="application/json",new nb(await this.request({path:"/v1/collections/{collection_id}/documents/{file_id}".replace("{collection_id}",encodeURIComponent(String(e.collectionId))).replace("{file_id}",encodeURIComponent(String(e.fileId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{team_id:e.teamId,fields:e.fields}}(e.collectionsAddDocumentToCollectionBody,!1)},t))}async collectionsAddDocumentToCollection(e,t){let n=await this.collectionsAddDocumentToCollectionRaw(e,t);return await n.value()}async collectionsBatchAddDocumentToCollectionRaw(e,t){if(null==e.collectionId)throw new nT("collectionId",'Required parameter "collectionId" was null or undefined when calling collectionsBatchAddDocumentToCollection().');if(null==e.collectionsBatchAddDocumentToCollectionBody)throw new nT("collectionsBatchAddDocumentToCollectionBody",'Required parameter "collectionsBatchAddDocumentToCollectionBody" was null or undefined when calling collectionsBatchAddDocumentToCollection().');let n={};return n["Content-Type"]="application/json",new nb(await this.request({path:"/v1/collections/{collection_id}/documents:batch".replace("{collection_id}",encodeURIComponent(String(e.collectionId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{team_id:e.teamId,documents:e.documents.map(nS)}}(e.collectionsBatchAddDocumentToCollectionBody,!1)},t))}async collectionsBatchAddDocumentToCollection(e,t){let n=await this.collectionsBatchAddDocumentToCollectionRaw(e,t);return await n.value()}async collectionsBatchGetDocumentsRaw(e,t){if(null==e.collectionId)throw new nT("collectionId",'Required parameter "collectionId" was null or undefined when calling collectionsBatchGetDocuments().');if(null==e.fileIds)throw new nT("fileIds",'Required parameter "fileIds" was null or undefined when calling collectionsBatchGetDocuments().');let n={};return null!=e.teamId&&(n.team_id=e.teamId),null!=e.fileIds&&(n.file_ids=e.fileIds),new nb(await this.request({path:"/v1/collections/{collection_id}/documents:batchGet".replace("{collection_id}",encodeURIComponent(String(e.collectionId))),method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{documents:null==t.documents?void 0:t.documents.map(nk)}})}async collectionsBatchGetDocuments(e,t){let n=await this.collectionsBatchGetDocumentsRaw(e,t);return await n.value()}async collectionsCreateCollectionRaw(e,t){if(null==e.collectionsCreateCollectionRequest)throw new nT("collectionsCreateCollectionRequest",'Required parameter "collectionsCreateCollectionRequest" was null or undefined when calling collectionsCreateCollection().');let n={};return n["Content-Type"]="application/json",new nb(await this.request({path:"/v1/collections",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{team_id:e.teamId,collection_name:e.collectionName,index_configuration:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{model_name:e.modelName}}(e.indexConfiguration,!1),chunk_configuration:nC(e.chunkConfiguration,!1),metric_space:e.metricSpace,version:e.version,field_definitions:null==e.fieldDefinitions?void 0:e.fieldDefinitions.map(nA),collection_description:e.collectionDescription}}(e.collectionsCreateCollectionRequest,!1)},t),e=>nP(e))}async collectionsCreateCollection(e,t){let n=await this.collectionsCreateCollectionRaw(e,t);return await n.value()}async collectionsDeleteCollectionRaw(e,t){if(null==e.collectionId)throw new nT("collectionId",'Required parameter "collectionId" was null or undefined when calling collectionsDeleteCollection().');let n={};return null!=e.teamId&&(n.team_id=e.teamId),new nb(await this.request({path:"/v1/collections/{collection_id}".replace("{collection_id}",encodeURIComponent(String(e.collectionId))),method:"DELETE",headers:{},query:n},t))}async collectionsDeleteCollection(e,t){let n=await this.collectionsDeleteCollectionRaw(e,t);return await n.value()}async collectionsDownloadCollectionRaw(e,t){if(null==e.collectionId)throw new nT("collectionId",'Required parameter "collectionId" was null or undefined when calling collectionsDownloadCollection().');let n={};return null!=e.teamId&&(n.team_id=e.teamId),new nb(await this.request({path:"/v1/collections/{collection_id}/download".replace("{collection_id}",encodeURIComponent(String(e.collectionId))),method:"GET",headers:{},query:n},t),e=>(function(e,t){var n,i,o,r;if(null==e)return e;return{result:null==e.result?void 0:(n=e.result,i=0,null==n?n:{data:null==n.data?void 0:n.data}),error:null==e.error?void 0:(o=e.error,r=0,null==o?o:{code:null==o.code?void 0:o.code,message:null==o.message?void 0:o.message,details:null==o.details?void 0:o.details.map(nU)})}})(e,0))}async collectionsDownloadCollection(e,t){let n=await this.collectionsDownloadCollectionRaw(e,t);return await n.value()}async collectionsGetCollectionMetadataRaw(e,t){if(null==e.collectionId)throw new nT("collectionId",'Required parameter "collectionId" was null or undefined when calling collectionsGetCollectionMetadata().');let n={};return null!=e.teamId&&(n.team_id=e.teamId),new nb(await this.request({path:"/v1/collections/{collection_id}".replace("{collection_id}",encodeURIComponent(String(e.collectionId))),method:"GET",headers:{},query:n},t),e=>nP(e))}async collectionsGetCollectionMetadata(e,t){let n=await this.collectionsGetCollectionMetadataRaw(e,t);return await n.value()}async collectionsGetDocumentMetadataRaw(e,t){if(null==e.collectionId)throw new nT("collectionId",'Required parameter "collectionId" was null or undefined when calling collectionsGetDocumentMetadata().');if(null==e.fileId)throw new nT("fileId",'Required parameter "fileId" was null or undefined when calling collectionsGetDocumentMetadata().');let n={};return null!=e.teamId&&(n.team_id=e.teamId),new nb(await this.request({path:"/v1/collections/{collection_id}/documents/{file_id}".replace("{collection_id}",encodeURIComponent(String(e.collectionId))).replace("{file_id}",encodeURIComponent(String(e.fileId))),method:"GET",headers:{},query:n},t),e=>nk(e))}async collectionsGetDocumentMetadata(e,t){let n=await this.collectionsGetDocumentMetadataRaw(e,t);return await n.value()}async collectionsListCollectionsRaw(e,t){let n={};return null!=e.teamId&&(n.team_id=e.teamId),null!=e.limit&&(n.limit=e.limit),null!=e.order&&(n.order=e.order),null!=e.sortBy&&(n.sort_by=e.sortBy),null!=e.paginationToken&&(n.pagination_token=e.paginationToken),null!=e.filter&&(n.filter=e.filter),new nb(await this.request({path:"/v1/collections",method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{collections:null==t.collections?void 0:t.collections.map(nP),paginationToken:null==t.pagination_token?void 0:t.pagination_token}})}async collectionsListCollections(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.collectionsListCollectionsRaw(e,t);return await n.value()}async collectionsListDocumentsRaw(e,t){if(null==e.collectionId)throw new nT("collectionId",'Required parameter "collectionId" was null or undefined when calling collectionsListDocuments().');let n={};return null!=e.teamId&&(n.team_id=e.teamId),null!=e.limit&&(n.limit=e.limit),null!=e.order&&(n.order=e.order),null!=e.sortBy&&(n.sort_by=e.sortBy),null!=e.paginationToken&&(n.pagination_token=e.paginationToken),null!=e.name&&(n.name=e.name),null!=e.filter&&(n.filter=e.filter),new nb(await this.request({path:"/v1/collections/{collection_id}/documents".replace("{collection_id}",encodeURIComponent(String(e.collectionId))),method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{documents:null==t.documents?void 0:t.documents.map(nk),paginationToken:null==t.pagination_token?void 0:t.pagination_token}})}async collectionsListDocuments(e,t){let n=await this.collectionsListDocumentsRaw(e,t);return await n.value()}async collectionsReIndexDocumentRaw(e,t){if(null==e.collectionId)throw new nT("collectionId",'Required parameter "collectionId" was null or undefined when calling collectionsReIndexDocument().');if(null==e.fileId)throw new nT("fileId",'Required parameter "fileId" was null or undefined when calling collectionsReIndexDocument().');let n={};return null!=e.teamId&&(n.team_id=e.teamId),new nb(await this.request({path:"/v1/collections/{collection_id}/documents/{file_id}".replace("{collection_id}",encodeURIComponent(String(e.collectionId))).replace("{file_id}",encodeURIComponent(String(e.fileId))),method:"PATCH",headers:{},query:n},t))}async collectionsReIndexDocument(e,t){let n=await this.collectionsReIndexDocumentRaw(e,t);return await n.value()}async collectionsRemoveDocumentFromCollectionRaw(e,t){if(null==e.collectionId)throw new nT("collectionId",'Required parameter "collectionId" was null or undefined when calling collectionsRemoveDocumentFromCollection().');if(null==e.fileId)throw new nT("fileId",'Required parameter "fileId" was null or undefined when calling collectionsRemoveDocumentFromCollection().');let n={};return null!=e.teamId&&(n.team_id=e.teamId),new nb(await this.request({path:"/v1/collections/{collection_id}/documents/{file_id}".replace("{collection_id}",encodeURIComponent(String(e.collectionId))).replace("{file_id}",encodeURIComponent(String(e.fileId))),method:"DELETE",headers:{},query:n},t))}async collectionsRemoveDocumentFromCollection(e,t){let n=await this.collectionsRemoveDocumentFromCollectionRaw(e,t);return await n.value()}async collectionsUpdateCollectionRaw(e,t){if(null==e.collectionId)throw new nT("collectionId",'Required parameter "collectionId" was null or undefined when calling collectionsUpdateCollection().');if(null==e.collectionsUpdateCollectionBody)throw new nT("collectionsUpdateCollectionBody",'Required parameter "collectionsUpdateCollectionBody" was null or undefined when calling collectionsUpdateCollection().');let n={};return n["Content-Type"]="application/json",new nb(await this.request({path:"/v1/collections/{collection_id}".replace("{collection_id}",encodeURIComponent(String(e.collectionId))),method:"PUT",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{team_id:e.teamId,collection_name:e.collectionName,chunk_configuration:nC(e.chunkConfiguration,!1),field_definition_updates:null==e.fieldDefinitionUpdates?void 0:e.fieldDefinitionUpdates.map(nE),collection_description:e.collectionDescription}}(e.collectionsUpdateCollectionBody,!1)},t),e=>nP(e))}async collectionsUpdateCollection(e,t){let n=await this.collectionsUpdateCollectionRaw(e,t);return await n.value()}}(new nf(sX));let s7=new class e extends aB{async grokTasksAddTaskScheduleToTaskRaw(e,t){if(null==e.body)throw new az("body",'Required parameter "body" was null or undefined when calling grokTasksAddTaskScheduleToTask().');let n={};return n["Content-Type"]="application/json",new aH(await this.request({path:"/rest/task/task-schedules",method:"PATCH",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{taskId:e.taskId,schedule:aX(e.schedule,!1)}}(e.body,!1)},t))}async grokTasksAddTaskScheduleToTask(e,t){let n=await this.grokTasksAddTaskScheduleToTaskRaw(e,t);return await n.value()}async grokTasksArchiveTaskRaw(e,t){if(null==e.body)throw new az("body",'Required parameter "body" was null or undefined when calling grokTasksArchiveTask().');let n={};return n["Content-Type"]="application/json",new aH(await this.request({path:"/rest/tasks/archive",method:"PUT",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{taskId:e.taskId,isEnabled:e.isEnabled}}(e.body,!1)},t))}async grokTasksArchiveTask(e,t){let n=await this.grokTasksArchiveTaskRaw(e,t);return await n.value()}async grokTasksBatchSetIsReadForTaskResultRaw(e,t){let n={};return null!=e.taskResultIds&&(n.taskResultIds=e.taskResultIds),null!=e.value&&(n.value=e.value),new aH(await this.request({path:"/rest/tasks/results/batch/is-read",method:"POST",headers:{},query:n},t))}async grokTasksBatchSetIsReadForTaskResult(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.grokTasksBatchSetIsReadForTaskResultRaw(e,t);return await n.value()}async grokTasksCreateTaskRaw(e,t){if(null==e.body)throw new az("body",'Required parameter "body" was null or undefined when calling grokTasksCreateTask().');let n={};return n["Content-Type"]="application/json",new aH(await this.request({path:"/rest/tasks",method:"POST",headers:n,query:{},body:a0(e.body,!1)},t),e=>a9(e))}async grokTasksCreateTask(e,t){let n=await this.grokTasksCreateTaskRaw(e,t);return await n.value()}async grokTasksGetGrokCreatedTasksByConversationIdRaw(e,t){if(null==e.conversationId)throw new az("conversationId",'Required parameter "conversationId" was null or undefined when calling grokTasksGetGrokCreatedTasksByConversationId().');return new aH(await this.request({path:"/rest/tasks/responses/{conversationId}".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{taskIdWithResponseIds:null==t.taskIdWithResponseIds?void 0:t.taskIdWithResponseIds.map(se)}})}async grokTasksGetGrokCreatedTasksByConversationId(e,t){let n=await this.grokTasksGetGrokCreatedTasksByConversationIdRaw(e,t);return await n.value()}async grokTasksGetInactiveUserTasksRaw(e){return new aH(await this.request({path:"/rest/tasks/inactive",method:"GET",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{tasks:null==t.tasks?void 0:t.tasks.map(a9)}})}async grokTasksGetInactiveUserTasks(e){let t=await this.grokTasksGetInactiveUserTasksRaw(e);return await t.value()}async grokTasksGetLatestUnreadTaskResultRaw(e,t){if(null==e.taskId)throw new az("taskId",'Required parameter "taskId" was null or undefined when calling grokTasksGetLatestUnreadTaskResult().');let n={};return null!=e.nextPage&&(n.nextPage=e.nextPage),null!=e.limit&&(n.limit=e.limit),new aH(await this.request({path:"/rest/tasks/latest/results/{taskId}".replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"GET",headers:{},query:n},t),e=>st(e,!1))}async grokTasksGetLatestUnreadTaskResult(e,t){let n=await this.grokTasksGetLatestUnreadTaskResultRaw(e,t);return await n.value()}async grokTasksGetStatRaw(e){return new aH(await this.request({path:"/rest/tasks/stat",method:"GET",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{statsJson:null==t.statsJson?void 0:t.statsJson}})}async grokTasksGetStat(e){let t=await this.grokTasksGetStatRaw(e);return await t.value()}async grokTasksGetTaskByConversationIdIfExistsRaw(e,t){if(null==e.conversationId)throw new az("conversationId",'Required parameter "conversationId" was null or undefined when calling grokTasksGetTaskByConversationIdIfExists().');return new aH(await this.request({path:"/rest/tasks/conversation/{conversationId}".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{task:null==t.task?void 0:a9(t.task),result:null==t.result?void 0:a7(t.result)}})}async grokTasksGetTaskByConversationIdIfExists(e,t){let n=await this.grokTasksGetTaskByConversationIdIfExistsRaw(e,t);return await n.value()}async grokTasksGetTaskResultsRaw(e,t){if(null==e.taskId)throw new az("taskId",'Required parameter "taskId" was null or undefined when calling grokTasksGetTaskResults().');let n={};return null!=e.nextPage&&(n.nextPage=e.nextPage),null!=e.limit&&(n.limit=e.limit),new aH(await this.request({path:"/rest/tasks/results/{taskId}".replace("{taskId}",encodeURIComponent(String(e.taskId))),method:"GET",headers:{},query:n},t),e=>st(e,!1))}async grokTasksGetTaskResults(e,t){let n=await this.grokTasksGetTaskResultsRaw(e,t);return await n.value()}async grokTasksGetTaskToolsRaw(e){return new aH(await this.request({path:"/rest/task/tools",method:"GET",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{tools:null==t.tools?void 0:t.tools.map(sn)}})}async grokTasksGetTaskTools(e){let t=await this.grokTasksGetTaskToolsRaw(e);return await t.value()}async grokTasksGetTaskUsageRaw(e){return new aH(await this.request({path:"/rest/tasks/usage",method:"GET",headers:{},query:{}},e),e=>si(e,!1))}async grokTasksGetTaskUsage(e){let t=await this.grokTasksGetTaskUsageRaw(e);return await t.value()}async grokTasksGetUserTasksRaw(e){return new aH(await this.request({path:"/rest/tasks",method:"GET",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{tasks:null==t.tasks?void 0:t.tasks.map(a9),unreadResults:null==t.unreadResults?void 0:t.unreadResults.map(a7),unreadCounts:null==t.unreadCounts?void 0:t.unreadCounts.map(so),taskUsage:null==t.taskUsage?void 0:si(t.taskUsage,!1)}})}async grokTasksGetUserTasks(e){let t=await this.grokTasksGetUserTasksRaw(e);return await t.value()}async grokTasksPauseTaskScheduleRaw(e,t){if(null==e.body)throw new az("body",'Required parameter "body" was null or undefined when calling grokTasksPauseTaskSchedule().');let n={};return n["Content-Type"]="application/json",new aH(await this.request({path:"/rest/task-schedules",method:"PATCH",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{scheduleId:e.scheduleId,isEnabled:e.isEnabled}}(e.body,!1)},t))}async grokTasksPauseTaskSchedule(e,t){let n=await this.grokTasksPauseTaskScheduleRaw(e,t);return await n.value()}async grokTasksUpdateTaskRaw(e,t){if(null==e.body)throw new az("body",'Required parameter "body" was null or undefined when calling grokTasksUpdateTask().');let n={};return n["Content-Type"]="application/json",new aH(await this.request({path:"/rest/tasks",method:"PUT",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{taskId:e.taskId,scheduleId:e.scheduleId,updatedTask:a0(e.updatedTask,!1)}}(e.body,!1)},t),e=>a9(e))}async grokTasksUpdateTask(e,t){let n=await this.grokTasksUpdateTaskRaw(e,t);return await n.value()}}(new aN(sX)),s8=new class e extends op{async livekitCreateTokenRaw(e,t){if(null==e.body)throw new ow("body",'Required parameter "body" was null or undefined when calling livekitCreateToken().');let n={};return n["Content-Type"]="application/json",new of(await this.request({path:"/rest/livekit/tokens",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{conversationId:e.conversationId,agentName:e.agentName,sessionPayload:e.sessionPayload,requestAgentDispatch:e.requestAgentDispatch,livekitUrl:e.livekitUrl,params:e.params}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{token:null==t.token?void 0:t.token,requestId:null==t.requestId?void 0:t.requestId}})}async livekitCreateToken(e,t){let n=await this.livekitCreateTokenRaw(e,t);return await n.value()}}(new oc(sX));new class e extends n8{async exploreGetExploreItemRaw(e,t){if(null==e.id)throw new it("id",'Required parameter "id" was null or undefined when calling exploreGetExploreItem().');return new ii(await this.request({path:"/rest/explore/items/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{item:null==t.item?void 0:io(t.item)}})}async exploreGetExploreItem(e,t){let n=await this.exploreGetExploreItemRaw(e,t);return await n.value()}async exploreGetExploreItemsRaw(e,t){if(null==e.body)throw new it("body",'Required parameter "body" was null or undefined when calling exploreGetExploreItems().');let n={};return n["Content-Type"]="application/json",new ii(await this.request({path:"/rest/explore/items",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{typeId:e.typeId,limit:e.limit,cursor:e.cursor}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{items:null==t.items?void 0:t.items.map(io),nextCursor:null==t.nextCursor?void 0:t.nextCursor}})}async exploreGetExploreItems(e,t){let n=await this.exploreGetExploreItemsRaw(e,t);return await n.value()}async exploreGetExploreTypesRaw(e,t){let n={};return null!=e.locale&&(n.locale=e.locale),new ii(await this.request({path:"/rest/explore/types",method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{types:null==t.types?void 0:t.types.map(ir)}})}async exploreGetExploreTypes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.exploreGetExploreTypesRaw(e,t);return await n.value()}}(new n5(sX));let s9=new class e extends G{async authManagementAssignTeamCreditsFromXDeveloperRaw(e,t){if(null==e.authMgmtAssignTeamCreditsFromXDeveloperRequest)throw new F("authMgmtAssignTeamCreditsFromXDeveloperRequest",'Required parameter "authMgmtAssignTeamCreditsFromXDeveloperRequest" was null or undefined when calling authManagementAssignTeamCreditsFromXDeveloper().');let n={};return n["Content-Type"]="application/json",new N(await this.request({path:"/auth/teams/x-developer-assign-credits",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{cents:e.cents,idempotencyKey:e.idempotencyKey}}(e.authMgmtAssignTeamCreditsFromXDeveloperRequest,!1)},t))}async authManagementAssignTeamCreditsFromXDeveloper(e,t){let n=await this.authManagementAssignTeamCreditsFromXDeveloperRaw(e,t);return await n.value()}async authManagementCheckApiKeyPropagationRaw(e,t){if(null==e.apiKeyId)throw new F("apiKeyId",'Required parameter "apiKeyId" was null or undefined when calling authManagementCheckApiKeyPropagation().');return new N(await this.request({path:"/auth/api-keys/{apiKeyId}/propagation".replace("{apiKeyId}",encodeURIComponent(String(e.apiKeyId))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{icPropagation:null==t.icPropagation?void 0:t.icPropagation}})}async authManagementCheckApiKeyPropagation(e,t){let n=await this.authManagementCheckApiKeyPropagationRaw(e,t);return await n.value()}async authManagementCreateApiKeyRaw(e,t){if(null==e.teamId)throw new F("teamId",'Required parameter "teamId" was null or undefined when calling authManagementCreateApiKey().');if(null==e.authManagementCreateApiKeyBody)throw new F("authManagementCreateApiKeyBody",'Required parameter "authManagementCreateApiKeyBody" was null or undefined when calling authManagementCreateApiKey().');let n={};return n["Content-Type"]="application/json",new N(await this.request({path:"/auth/teams/{teamId}/api-keys".replace("{teamId}",encodeURIComponent(String(e.teamId))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,acls:e.acls,qps:e.qps,qpm:e.qpm,tpm:e.tpm,expireTime:e.expireTime}}(e.authManagementCreateApiKeyBody,!1)},t),e=>en(e))}async authManagementCreateApiKey(e,t){let n=await this.authManagementCreateApiKeyRaw(e,t);return await n.value()}async authManagementCreateXIntegrationUserRaw(e,t){if(null==e.body)throw new F("body",'Required parameter "body" was null or undefined when calling authManagementCreateXIntegrationUser().');let n={};return n["Content-Type"]="application/json",new N(await this.request({path:"/auth/create-x-integration-user",method:"POST",headers:n,query:{},body:e.body},t),e=>{var t,n;return n=0,null==(t=e)?t:{xaiUserId:null==t.xaiUserId?void 0:t.xaiUserId}})}async authManagementCreateXIntegrationUser(e,t){let n=await this.authManagementCreateXIntegrationUserRaw(e,t);return await n.value()}async authManagementDeleteApiKeyRaw(e,t){if(null==e.apiKeyId)throw new F("apiKeyId",'Required parameter "apiKeyId" was null or undefined when calling authManagementDeleteApiKey().');return new N(await this.request({path:"/auth/api-keys/{apiKeyId}".replace("{apiKeyId}",encodeURIComponent(String(e.apiKeyId))),method:"DELETE",headers:{},query:{}},t))}async authManagementDeleteApiKey(e,t){let n=await this.authManagementDeleteApiKeyRaw(e,t);return await n.value()}async authManagementExchangeGrokCliOnetimeCodeRaw(e,t){if(null==e.code)throw new F("code",'Required parameter "code" was null or undefined when calling authManagementExchangeGrokCliOnetimeCode().');return new N(await this.request({path:"/auth/exchange-grok-cli-code/{code}".replace("{code}",encodeURIComponent(String(e.code))),method:"POST",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{token:null==t.token?void 0:t.token}})}async authManagementExchangeGrokCliOnetimeCode(e,t){let n=await this.authManagementExchangeGrokCliOnetimeCodeRaw(e,t);return await n.value()}async authManagementGetTeamRaw(e,t){if(null==e.teamId)throw new F("teamId",'Required parameter "teamId" was null or undefined when calling authManagementGetTeam().');let n={};return null!=e.returnCreateUser&&(n.returnCreateUser=e.returnCreateUser),new N(await this.request({path:"/auth/team/{teamId}".replace("{teamId}",encodeURIComponent(String(e.teamId))),method:"GET",headers:{},query:n},t),e=>Q(e))}async authManagementGetTeam(e,t){let n=await this.authManagementGetTeamRaw(e,t);return await n.value()}async authManagementGetTeamAndRoleRaw(e,t){if(null==e.teamId)throw new F("teamId",'Required parameter "teamId" was null or undefined when calling authManagementGetTeamAndRole().');let n={};return null!=e.returnCreateUser&&(n.returnCreateUser=e.returnCreateUser),new N(await this.request({path:"/auth/team-and-role/{teamId}".replace("{teamId}",encodeURIComponent(String(e.teamId))),method:"GET",headers:{},query:n},t),e=>(function(e,t){var n,i;if(null==e)return e;return{team:null==e.team?void 0:Q(e.team),role:null==e.role?void 0:(n=e.role,i=0,n),acls:null==e.acls?void 0:e.acls.map(j)}})(e,0))}async authManagementGetTeamAndRole(e,t){let n=await this.authManagementGetTeamAndRoleRaw(e,t);return await n.value()}async authManagementListApiKeysRaw(e,t){if(null==e.teamId)throw new F("teamId",'Required parameter "teamId" was null or undefined when calling authManagementListApiKeys().');let n={};return null!=e.pageSize&&(n.pageSize=e.pageSize),null!=e.paginationToken&&(n.paginationToken=e.paginationToken),null!=e.aclFilters&&(n.aclFilters=e.aclFilters),new N(await this.request({path:"/auth/teams/{teamId}/api-keys".replace("{teamId}",encodeURIComponent(String(e.teamId))),method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{apiKeys:null==t.apiKeys?void 0:t.apiKeys.map(en),paginationToken:null==t.paginationToken?void 0:t.paginationToken}})}async authManagementListApiKeys(e,t){let n=await this.authManagementListApiKeysRaw(e,t);return await n.value()}async authManagementListModelsForTeamRaw(e,t){if(null==e.teamId)throw new F("teamId",'Required parameter "teamId" was null or undefined when calling authManagementListModelsForTeam().');return new N(await this.request({path:"/auth/teams/{teamId}/models".replace("{teamId}",encodeURIComponent(String(e.teamId))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{clusterConfigs:null==t.clusterConfigs?void 0:t.clusterConfigs.map(er)}})}async authManagementListModelsForTeam(e,t){let n=await this.authManagementListModelsForTeamRaw(e,t);return await n.value()}async authManagementListPossibleEndpointAclsRaw(e,t){if(null==e.teamId)throw new F("teamId",'Required parameter "teamId" was null or undefined when calling authManagementListPossibleEndpointAcls().');return new N(await this.request({path:"/auth/teams/{teamId}/endpoints".replace("{teamId}",encodeURIComponent(String(e.teamId))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{acls:null==t.acls?void 0:t.acls.map(j)}})}async authManagementListPossibleEndpointAcls(e,t){let n=await this.authManagementListPossibleEndpointAclsRaw(e,t);return await n.value()}async authManagementListTeamsRaw(e){return new N(await this.request({path:"/auth/teams",method:"GET",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{teams:null==t.teams?void 0:t.teams.map(Q)}})}async authManagementListTeams(e){let t=await this.authManagementListTeamsRaw(e);return await t.value()}async authManagementListUsersRaw(e,t){if(null==e.teamId)throw new F("teamId",'Required parameter "teamId" was null or undefined when calling authManagementListUsers().');let n={};return null!=e.pageSize&&(n.pageSize=e.pageSize),null!=e.paginationToken&&(n.paginationToken=e.paginationToken),new N(await this.request({path:"/auth/team/{teamId}/users".replace("{teamId}",encodeURIComponent(String(e.teamId))),method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{users:null==t.users?void 0:t.users.map(ea),members:null==t.members?void 0:t.members.map(es),paginationToken:null==t.paginationToken?void 0:t.paginationToken}})}async authManagementListUsers(e,t){let n=await this.authManagementListUsersRaw(e,t);return await n.value()}async authManagementSendGrokBusinessSelfServeEmailRaw(e,t){if(null==e.authMgmtSendGrokBusinessSelfServeEmailRequest)throw new F("authMgmtSendGrokBusinessSelfServeEmailRequest",'Required parameter "authMgmtSendGrokBusinessSelfServeEmailRequest" was null or undefined when calling authManagementSendGrokBusinessSelfServeEmail().');let n={};return n["Content-Type"]="application/json",new N(await this.request({path:"/auth/send-grok-business-self-serve-email",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{email:e.email,firstName:e.firstName,selfServeUrl:e.selfServeUrl}}(e.authMgmtSendGrokBusinessSelfServeEmailRequest,!1)},t))}async authManagementSendGrokBusinessSelfServeEmail(e,t){let n=await this.authManagementSendGrokBusinessSelfServeEmailRaw(e,t);return await n.value()}async authManagementUpdateApiKeyRaw(e,t){if(null==e.apiKeyId)throw new F("apiKeyId",'Required parameter "apiKeyId" was null or undefined when calling authManagementUpdateApiKey().');if(null==e.authManagementUpdateApiKeyBody)throw new F("authManagementUpdateApiKeyBody",'Required parameter "authManagementUpdateApiKeyBody" was null or undefined when calling authManagementUpdateApiKey().');let n={};return n["Content-Type"]="application/json",new N(await this.request({path:"/auth/api-keys/{api_key_id}".replace("{api_key_id}",encodeURIComponent(String(e.apiKeyId))),method:"PUT",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{apiKey:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,disabled:e.disabled,expireTime:e.expireTime,qps:e.qps,qpm:e.qpm,tpm:e.tpm,aclStrings:e.aclStrings}}(e.apiKey,!1),fieldMask:e.fieldMask}}(e.authManagementUpdateApiKeyBody,!1)},t),e=>en(e))}async authManagementUpdateApiKey(e,t){let n=await this.authManagementUpdateApiKeyRaw(e,t);return await n.value()}async authManagementValidateTeamTokenRaw(e){return new N(await this.request({path:"/auth/management-keys/validation",method:"GET",headers:{},query:{}},e),e=>(function(e,t){var n,i;if(null==e)return e;return{apiKeyId:null==e.apiKeyId?void 0:e.apiKeyId,teamId:null==e.teamId?void 0:e.teamId,scope:null==e.scope?void 0:(n=e.scope,i=0,n),scopeId:null==e.scopeId?void 0:e.scopeId,ownerUserId:null==e.ownerUserId?void 0:e.ownerUserId,createTime:null==e.createTime?void 0:e.createTime,modifyTime:null==e.modifyTime?void 0:e.modifyTime,name:null==e.name?void 0:e.name,acls:null==e.acls?void 0:e.acls,apiKey:null==e.apiKey?void 0:e.apiKey,redactedApiKey:null==e.redactedApiKey?void 0:e.redactedApiKey,ipRanges:null==e.ipRanges?void 0:X(e.ipRanges,!1)}})(e,0))}async authManagementValidateTeamToken(e){let t=await this.authManagementValidateTeamTokenRaw(e);return await t.value()}}(new x(sX)),le=new class e extends oR{async mediaCreateMediaPostRaw(e,t){if(null==e.body)throw new oS("body",'Required parameter "body" was null or undefined when calling mediaCreateMediaPost().');let n={};return n["Content-Type"]="application/json",new ok(await this.request({path:"/rest/media/post/create",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{mediaType:e.mediaType,mediaUrl:e.mediaUrl,originalPostId:e.originalPostId,prompt:e.prompt}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{post:null==t.post?void 0:oO(t.post)}})}async mediaCreateMediaPost(e,t){let n=await this.mediaCreateMediaPostRaw(e,t);return await n.value()}async mediaCreateMediaProjectRaw(e,t){if(null==e.body)throw new oS("body",'Required parameter "body" was null or undefined when calling mediaCreateMediaProject().');let n={};return n["Content-Type"]="application/json",new ok(await this.request({path:"/rest/media/project/create",method:"POST",headers:n,query:{},body:e.body},t),e=>{var t,n;return n=0,null==(t=e)?t:{project:null==t.project?void 0:oB(t.project)}})}async mediaCreateMediaProject(e,t){let n=await this.mediaCreateMediaProjectRaw(e,t);return await n.value()}async mediaCreatePostLinkRaw(e,t){if(null==e.body)throw new oS("body",'Required parameter "body" was null or undefined when calling mediaCreatePostLink().');let n={};return n["Content-Type"]="application/json",new ok(await this.request({path:"/rest/media/post/create-link",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{postId:e.postId,source:e.source,platform:e.platform}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{shareLink:null==t.shareLink?void 0:t.shareLink}})}async mediaCreatePostLink(e,t){let n=await this.mediaCreatePostLinkRaw(e,t);return await n.value()}async mediaDeleteAllMediaPostDataRaw(e){return new ok(await this.request({path:"/rest/media/post/delete-all",method:"POST",headers:{},query:{}},e))}async mediaDeleteAllMediaPostData(e){let t=await this.mediaDeleteAllMediaPostDataRaw(e);return await t.value()}async mediaDeleteCharactersRaw(e,t){if(null==e.body)throw new oS("body",'Required parameter "body" was null or undefined when calling mediaDeleteCharacters().');let n={};return n["Content-Type"]="application/json",new ok(await this.request({path:"/rest/media/characters/delete",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{characterIds:e.characterIds}}(e.body,!1)},t))}async mediaDeleteCharacters(e,t){let n=await this.mediaDeleteCharactersRaw(e,t);return await n.value()}async mediaDeleteMediaPostRaw(e,t){if(null==e.body)throw new oS("body",'Required parameter "body" was null or undefined when calling mediaDeleteMediaPost().');let n={};return n["Content-Type"]="application/json",new ok(await this.request({path:"/rest/media/post/delete",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{id:e.id,isHiddenForClient:e.isHiddenForClient}}(e.body,!1)},t))}async mediaDeleteMediaPost(e,t){let n=await this.mediaDeleteMediaPostRaw(e,t);return await n.value()}async mediaGetMediaPostRaw(e,t){if(null==e.body)throw new oS("body",'Required parameter "body" was null or undefined when calling mediaGetMediaPost().');let n={};return n["Content-Type"]="application/json",new ok(await this.request({path:"/rest/media/post/get",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{id:e.id,isKidsMode:e.isKidsMode,isNsfwEnabled:e.isNsfwEnabled,withContainerOnly:e.withContainerOnly}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{post:null==t.post?void 0:oO(t.post)}})}async mediaGetMediaPost(e,t){let n=await this.mediaGetMediaPostRaw(e,t);return await n.value()}async mediaGetMediaProjectRaw(e,t){if(null==e.body)throw new oS("body",'Required parameter "body" was null or undefined when calling mediaGetMediaProject().');let n={};return n["Content-Type"]="application/json",new ok(await this.request({path:"/rest/media/project/get",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{id:e.id}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{project:null==t.project?void 0:oB(t.project)}})}async mediaGetMediaProject(e,t){let n=await this.mediaGetMediaProjectRaw(e,t);return await n.value()}async mediaLikeRaw(e,t){if(null==e.body)throw new oS("body",'Required parameter "body" was null or undefined when calling mediaLike().');let n={};return n["Content-Type"]="application/json",new ok(await this.request({path:"/rest/media/post/like",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{id:e.id}}(e.body,!1)},t))}async mediaLike(e,t){let n=await this.mediaLikeRaw(e,t);return await n.value()}async mediaListCharactersRaw(e){return new ok(await this.request({path:"/rest/media/characters/list",method:"GET",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{characters:null==t.characters?void 0:t.characters.map(oV)}})}async mediaListCharacters(e){let t=await this.mediaListCharactersRaw(e);return await t.value()}async mediaListMediaPostsRaw(e,t){if(null==e.body)throw new oS("body",'Required parameter "body" was null or undefined when calling mediaListMediaPosts().');let n={};return n["Content-Type"]="application/json",new ok(await this.request({path:"/rest/media/post/list",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{limit:e.limit,cursor:e.cursor,filter:oW(e.filter),isKidsMode:e.isKidsMode,isNsfwEnabled:e.isNsfwEnabled,withContainerOnly:e.withContainerOnly}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{posts:null==t.posts?void 0:t.posts.map(oO),nextCursor:null==t.nextCursor?void 0:t.nextCursor}})}async mediaListMediaPosts(e,t){let n=await this.mediaListMediaPostsRaw(e,t);return await n.value()}async mediaListMediaProjectsRaw(e,t){if(null==e.body)throw new oS("body",'Required parameter "body" was null or undefined when calling mediaListMediaProjects().');let n={};return n["Content-Type"]="application/json",new ok(await this.request({path:"/rest/media/project/list",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{limit:e.limit,cursor:e.cursor}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{projects:null==t.projects?void 0:t.projects.map(oB),nextCursor:null==t.nextCursor?void 0:t.nextCursor}})}async mediaListMediaProjects(e,t){let n=await this.mediaListMediaProjectsRaw(e,t);return await n.value()}async mediaListSharedMediaPostsRaw(e,t){if(null==e.body)throw new oS("body",'Required parameter "body" was null or undefined when calling mediaListSharedMediaPosts().');let n={};return n["Content-Type"]="application/json",new ok(await this.request({path:"/rest/media/post/list-shared-posts",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{limit:e.limit,cursor:e.cursor}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{posts:null==t.posts?void 0:t.posts.map(oY),nextCursor:null==t.nextCursor?void 0:t.nextCursor}})}async mediaListSharedMediaPosts(e,t){let n=await this.mediaListSharedMediaPostsRaw(e,t);return await n.value()}async mediaSetMediaPostVisibilityRaw(e,t){if(null==e.body)throw new oS("body",'Required parameter "body" was null or undefined when calling mediaSetMediaPostVisibility().');let n={};return n["Content-Type"]="application/json",new ok(await this.request({path:"/rest/media/post/set-visibility",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{postId:e.postId,visibility:e.visibility}}(e.body,!1)},t))}async mediaSetMediaPostVisibility(e,t){let n=await this.mediaSetMediaPostVisibilityRaw(e,t);return await n.value()}async mediaUnlikeRaw(e,t){if(null==e.body)throw new oS("body",'Required parameter "body" was null or undefined when calling mediaUnlike().');let n={};return n["Content-Type"]="application/json",new ok(await this.request({path:"/rest/media/post/unlike",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{id:e.id}}(e.body,!1)},t))}async mediaUnlike(e,t){let n=await this.mediaUnlikeRaw(e,t);return await n.value()}async mediaUpdateMediaProjectRaw(e,t){if(null==e.body)throw new oS("body",'Required parameter "body" was null or undefined when calling mediaUpdateMediaProject().');let n={};return n["Content-Type"]="application/json",new ok(await this.request({path:"/rest/media/project/update",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{project:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{id:e.id,userId:e.userId,versions:e.versions,currentVersion:e.currentVersion,assets:null==e.assets?void 0:e.assets.map(oj),timelines:null==e.timelines?void 0:e.timelines.map(oF),createTime:e.createTime,updateTime:e.updateTime,conversationIds:e.conversationIds}}(e.project,!1)}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{project:null==t.project?void 0:oB(t.project)}})}async mediaUpdateMediaProject(e,t){let n=await this.mediaUpdateMediaProjectRaw(e,t);return await n.value()}async mediaUpscaleVideoRaw(e,t){if(null==e.body)throw new oS("body",'Required parameter "body" was null or undefined when calling mediaUpscaleVideo().');let n={};return n["Content-Type"]="application/json",new ok(await this.request({path:"/rest/media/video/upscale",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{videoId:e.videoId}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{hdMediaUrl:null==t.hdMediaUrl?void 0:t.hdMediaUrl}})}async mediaUpscaleVideo(e,t){let n=await this.mediaUpscaleVideoRaw(e,t);return await n.value()}}(new oy(sX)),lt=new iQ(new ix(sX)),ln=new class e extends ib{async gitHubCompareCommitsRaw(e,t){if(null==e.owner)throw new iC("owner",'Required parameter "owner" was null or undefined when calling gitHubCompareCommits().');if(null==e.repo)throw new iC("repo",'Required parameter "repo" was null or undefined when calling gitHubCompareCommits().');if(null==e.range)throw new iC("range",'Required parameter "range" was null or undefined when calling gitHubCompareCommits().');return new iq(await this.request({path:"/rest/github/repositories/{owner}/{repo}/compare/{range}".replace("{owner}",encodeURIComponent(String(e.owner))).replace("{repo}",encodeURIComponent(String(e.repo))).replace("{range}",encodeURIComponent(String(e.range))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{aheadBy:null==t.aheadBy?void 0:t.aheadBy,behindBy:null==t.behindBy?void 0:t.behindBy,status:null==t.status?void 0:t.status,totalCommits:null==t.totalCommits?void 0:t.totalCommits}})}async gitHubCompareCommits(e,t){let n=await this.gitHubCompareCommitsRaw(e,t);return await n.value()}async gitHubCreatePullRequestRaw(e,t){if(null==e.owner)throw new iC("owner",'Required parameter "owner" was null or undefined when calling gitHubCreatePullRequest().');if(null==e.repo)throw new iC("repo",'Required parameter "repo" was null or undefined when calling gitHubCreatePullRequest().');if(null==e.body)throw new iC("body",'Required parameter "body" was null or undefined when calling gitHubCreatePullRequest().');let n={};return n["Content-Type"]="application/json",new iq(await this.request({path:"/rest/github/repositories/{owner}/{repo}/pull-requests".replace("{owner}",encodeURIComponent(String(e.owner))).replace("{repo}",encodeURIComponent(String(e.repo))),method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{baseBranch:e.baseBranch,title:e.title,body:e.body,fileChanges:null==e.fileChanges?void 0:e.fileChanges.map(iA),headBranchName:e.headBranchName,createFork:e.createFork,labels:e.labels}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{prUrl:null==t.prUrl?void 0:t.prUrl,prNumber:null==t.prNumber?void 0:t.prNumber,headBranch:null==t.headBranch?void 0:t.headBranch}})}async gitHubCreatePullRequest(e,t){let n=await this.gitHubCreatePullRequestRaw(e,t);return await n.value()}async gitHubDisconnectRaw(e){return new iq(await this.request({path:"/rest/github/oauth",method:"DELETE",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{success:null==t.success?void 0:t.success}})}async gitHubDisconnect(e){let t=await this.gitHubDisconnectRaw(e);return await t.value()}async gitHubGetInstallUrlRaw(e){return new iq(await this.request({path:"/rest/github/install-url",method:"GET",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{installUrl:null==t.installUrl?void 0:t.installUrl}})}async gitHubGetInstallUrl(e){let t=await this.gitHubGetInstallUrlRaw(e);return await t.value()}async gitHubGetInstallationTokenRaw(e,t){if(null==e.body)throw new iC("body",'Required parameter "body" was null or undefined when calling gitHubGetInstallationToken().');let n={};return n["Content-Type"]="application/json",new iq(await this.request({path:"/rest/github/installation-token",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{installationId:e.installationId}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{token:null==t.token?void 0:t.token,expiresAt:null==t.expiresAt?void 0:t.expiresAt,accountLogin:null==t.accountLogin?void 0:t.accountLogin,accountType:null==t.accountType?void 0:t.accountType,installationId:null==t.installationId?void 0:t.installationId}})}async gitHubGetInstallationToken(e,t){let n=await this.gitHubGetInstallationTokenRaw(e,t);return await n.value()}async gitHubGetOAuthInfoRaw(e){return new iq(await this.request({path:"/rest/github/oauth/info",method:"GET",headers:{},query:{}},e),e=>(function(e,t){var n,i;if(null==e)return e;return{oauthInfo:null==e.oauthInfo?void 0:(n=e.oauthInfo,i=0,null==n?n:{oauthConnectorId:null==n.oauthConnectorId?void 0:n.oauthConnectorId,userId:null==n.userId?void 0:n.userId,accessTokenExpirationTime:null==n.accessTokenExpirationTime?void 0:n.accessTokenExpirationTime,scopes:null==n.scopes?void 0:n.scopes,createTime:null==n.createTime?void 0:n.createTime,modTime:null==n.modTime?void 0:n.modTime})}})(e,0))}async gitHubGetOAuthInfo(e){let t=await this.gitHubGetOAuthInfoRaw(e);return await t.value()}async gitHubGetOauthUrlRaw(e,t){let n={};return null!=e.redirectUri&&(n.redirectUri=e.redirectUri),new iq(await this.request({path:"/rest/github/oauth-url",method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{authorizeUrl:null==t.authorizeUrl?void 0:t.authorizeUrl,state:null==t.state?void 0:t.state}})}async gitHubGetOauthUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.gitHubGetOauthUrlRaw(e,t);return await n.value()}async gitHubGetPullRequestRaw(e,t){if(null==e.owner)throw new iC("owner",'Required parameter "owner" was null or undefined when calling gitHubGetPullRequest().');if(null==e.repo)throw new iC("repo",'Required parameter "repo" was null or undefined when calling gitHubGetPullRequest().');if(null==e.pullNumber)throw new iC("pullNumber",'Required parameter "pullNumber" was null or undefined when calling gitHubGetPullRequest().');return new iq(await this.request({path:"/rest/github/repositories/{owner}/{repo}/pull-requests/{pullNumber}".replace("{owner}",encodeURIComponent(String(e.owner))).replace("{repo}",encodeURIComponent(String(e.repo))).replace("{pullNumber}",encodeURIComponent(String(e.pullNumber))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{pullRequest:null==t.pullRequest?void 0:iE(t.pullRequest)}})}async gitHubGetPullRequest(e,t){let n=await this.gitHubGetPullRequestRaw(e,t);return await n.value()}async gitHubGetRepositoryRaw(e,t){if(null==e.owner)throw new iC("owner",'Required parameter "owner" was null or undefined when calling gitHubGetRepository().');if(null==e.repo)throw new iC("repo",'Required parameter "repo" was null or undefined when calling gitHubGetRepository().');return new iq(await this.request({path:"/rest/github/repositories/{owner}/{repo}".replace("{owner}",encodeURIComponent(String(e.owner))).replace("{repo}",encodeURIComponent(String(e.repo))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{repository:null==t.repository?void 0:iU(t.repository)}})}async gitHubGetRepository(e,t){let n=await this.gitHubGetRepositoryRaw(e,t);return await n.value()}async gitHubHandleInstallCallbackRaw(e,t){if(null==e.body)throw new iC("body",'Required parameter "body" was null or undefined when calling gitHubHandleInstallCallback().');let n={};return n["Content-Type"]="application/json",new iq(await this.request({path:"/rest/github/install-callback",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{installationId:e.installationId,setupAction:e.setupAction,code:e.code}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{installation:null==t.installation?void 0:iM(t.installation)}})}async gitHubHandleInstallCallback(e,t){let n=await this.gitHubHandleInstallCallbackRaw(e,t);return await n.value()}async gitHubHandleOAuthCallbackRaw(e,t){if(null==e.body)throw new iC("body",'Required parameter "body" was null or undefined when calling gitHubHandleOAuthCallback().');let n={};return n["Content-Type"]="application/json",new iq(await this.request({path:"/rest/github/oauth-callback",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{code:e.code,state:e.state}}(e.body,!1)},t))}async gitHubHandleOAuthCallback(e,t){let n=await this.gitHubHandleOAuthCallbackRaw(e,t);return await n.value()}async gitHubHandleWebhookRaw(e,t){if(null==e.body)throw new iC("body",'Required parameter "body" was null or undefined when calling gitHubHandleWebhook().');let n={};return n["Content-Type"]="application/json",new iq(await this.request({path:"/webhook/github",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{payload:e.payload,signature:e.signature,eventType:e.eventType}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{success:null==t.success?void 0:t.success}})}async gitHubHandleWebhook(e,t){let n=await this.gitHubHandleWebhookRaw(e,t);return await n.value()}async gitHubListBranchesRaw(e,t){if(null==e.owner)throw new iC("owner",'Required parameter "owner" was null or undefined when calling gitHubListBranches().');if(null==e.repo)throw new iC("repo",'Required parameter "repo" was null or undefined when calling gitHubListBranches().');let n={};return null!=e.page&&(n.page=e.page),null!=e.pageSize&&(n.pageSize=e.pageSize),new iq(await this.request({path:"/rest/github/repositories/{owner}/{repo}/branches".replace("{owner}",encodeURIComponent(String(e.owner))).replace("{repo}",encodeURIComponent(String(e.repo))),method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{branches:null==t.branches?void 0:t.branches.map(iP),page:null==t.page?void 0:t.page,pageSize:null==t.pageSize?void 0:t.pageSize,hasMore:null==t.hasMore?void 0:t.hasMore}})}async gitHubListBranches(e,t){let n=await this.gitHubListBranchesRaw(e,t);return await n.value()}async gitHubListInstallationsRaw(e){return new iq(await this.request({path:"/rest/github/installations",method:"GET",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{installations:null==t.installations?void 0:t.installations.map(iM)}})}async gitHubListInstallations(e){let t=await this.gitHubListInstallationsRaw(e);return await t.value()}async gitHubListPullRequestsRaw(e,t){if(null==e.owner)throw new iC("owner",'Required parameter "owner" was null or undefined when calling gitHubListPullRequests().');if(null==e.repo)throw new iC("repo",'Required parameter "repo" was null or undefined when calling gitHubListPullRequests().');let n={};return null!=e.head&&(n.head=e.head),null!=e.state&&(n.state=e.state),null!=e.page&&(n.page=e.page),null!=e.pageSize&&(n.pageSize=e.pageSize),new iq(await this.request({path:"/rest/github/repositories/{owner}/{repo}/pull-requests".replace("{owner}",encodeURIComponent(String(e.owner))).replace("{repo}",encodeURIComponent(String(e.repo))),method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{pullRequests:null==t.pullRequests?void 0:t.pullRequests.map(iE),page:null==t.page?void 0:t.page,pageSize:null==t.pageSize?void 0:t.pageSize,hasMore:null==t.hasMore?void 0:t.hasMore}})}async gitHubListPullRequests(e,t){let n=await this.gitHubListPullRequestsRaw(e,t);return await n.value()}async gitHubListRepositoriesRaw(e,t){let n={};return null!=e.page&&(n.page=e.page),null!=e.pageSize&&(n.pageSize=e.pageSize),null!=e.installationId&&(n.installationId=e.installationId),new iq(await this.request({path:"/rest/github/repositories",method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{repositories:null==t.repositories?void 0:t.repositories.map(iU),page:null==t.page?void 0:t.page,pageSize:null==t.pageSize?void 0:t.pageSize,hasMore:null==t.hasMore?void 0:t.hasMore}})}async gitHubListRepositories(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.gitHubListRepositoriesRaw(e,t);return await n.value()}async gitHubUnlinkInstallationRaw(e,t){if(null==e.installationId)throw new iC("installationId",'Required parameter "installationId" was null or undefined when calling gitHubUnlinkInstallation().');return new iq(await this.request({path:"/rest/github/installations/{installationId}".replace("{installationId}",encodeURIComponent(String(e.installationId))),method:"DELETE",headers:{},query:{}},t))}async gitHubUnlinkInstallation(e,t){let n=await this.gitHubUnlinkInstallationRaw(e,t);return await n.value()}async gitHubUpdatePullRequestRaw(e,t){if(null==e.owner)throw new iC("owner",'Required parameter "owner" was null or undefined when calling gitHubUpdatePullRequest().');if(null==e.repo)throw new iC("repo",'Required parameter "repo" was null or undefined when calling gitHubUpdatePullRequest().');if(null==e.pullNumber)throw new iC("pullNumber",'Required parameter "pullNumber" was null or undefined when calling gitHubUpdatePullRequest().');if(null==e.body)throw new iC("body",'Required parameter "body" was null or undefined when calling gitHubUpdatePullRequest().');let n={};return n["Content-Type"]="application/json",new iq(await this.request({path:"/rest/github/repositories/{owner}/{repo}/pull-requests/{pullNumber}".replace("{owner}",encodeURIComponent(String(e.owner))).replace("{repo}",encodeURIComponent(String(e.repo))).replace("{pullNumber}",encodeURIComponent(String(e.pullNumber))),method:"PATCH",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{title:e.title,body:e.body,state:e.state,base:e.base,maintainerCanModify:e.maintainerCanModify}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{pullRequest:null==t.pullRequest?void 0:iE(t.pullRequest)}})}async gitHubUpdatePullRequest(e,t){let n=await this.gitHubUpdatePullRequestRaw(e,t);return await n.value()}async gitHubValidateInstallationAccessRaw(e,t){if(null==e.installationId)throw new iC("installationId",'Required parameter "installationId" was null or undefined when calling gitHubValidateInstallationAccess().');return new iq(await this.request({path:"/rest/github/installations/{installationId}/validate".replace("{installationId}",encodeURIComponent(String(e.installationId))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{hasAccess:null==t.hasAccess?void 0:t.hasAccess,installationId:null==t.installationId?void 0:t.installationId}})}async gitHubValidateInstallationAccess(e,t){let n=await this.gitHubValidateInstallationAccessRaw(e,t);return await n.value()}async gitHubValidateTokenForRepoRaw(e,t){if(null==e.body)throw new iC("body",'Required parameter "body" was null or undefined when calling gitHubValidateTokenForRepo().');let n={};return n["Content-Type"]="application/json",new iq(await this.request({path:"/rest/github/token/validate",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{repository:e.repository}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{token:null==t.token?void 0:t.token,hasAccess:null==t.hasAccess?void 0:t.hasAccess,repository:null==t.repository?void 0:t.repository}})}async gitHubValidateTokenForRepo(e,t){let n=await this.gitHubValidateTokenForRepoRaw(e,t);return await n.value()}}(new iR(s$)),li=new class e extends rb{async sandboxEnvironmentsCacheEnvironmentRaw(e,t){if(null==e.environmentId)throw new rC("environmentId",'Required parameter "environmentId" was null or undefined when calling sandboxEnvironmentsCacheEnvironment().');return new rq(await this.request({path:"/rest/sandbox_environments/environments/{environmentId}/cache".replace("{environmentId}",encodeURIComponent(String(e.environmentId))),method:"POST",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{containerImage:null==t.containerImage?void 0:t.containerImage,baseImageVersion:null==t.baseImageVersion?void 0:t.baseImageVersion,commitSha:null==t.commitSha?void 0:t.commitSha}})}async sandboxEnvironmentsCacheEnvironment(e,t){let n=await this.sandboxEnvironmentsCacheEnvironmentRaw(e,t);return await n.value()}async sandboxEnvironmentsCreateEnvironmentRaw(e,t){if(null==e.body)throw new rC("body",'Required parameter "body" was null or undefined when calling sandboxEnvironmentsCreateEnvironment().');let n={};return n["Content-Type"]="application/json",new rq(await this.request({path:"/rest/sandbox_environments/environments",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,teamId:e.teamId,repository:e.repository,defaultBranch:e.defaultBranch,workspaceDirectory:e.workspaceDirectory,containerImage:e.containerImage,setupScript:e.setupScript,maintenanceScript:e.maintenanceScript,cachingEnabled:e.cachingEnabled,internetEnabled:e.internetEnabled,domainAllowlistPreset:e.domainAllowlistPreset,additionalDomains:e.additionalDomains,allowedHttpMethods:e.allowedHttpMethods,environmentVariables:null==e.environmentVariables?void 0:e.environmentVariables.map(rP),secrets:null==e.secrets?void 0:e.secrets.map(rE),preinstalledPackages:e.preinstalledPackages,providerId:e.providerId,requestedCpus:e.requestedCpus,requestedMemoryBytes:e.requestedMemoryBytes,requestedDiskBytes:e.requestedDiskBytes,requestedGpus:e.requestedGpus}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{environment:null==t.environment?void 0:rU(t.environment)}})}async sandboxEnvironmentsCreateEnvironment(e,t){let n=await this.sandboxEnvironmentsCreateEnvironmentRaw(e,t);return await n.value()}async sandboxEnvironmentsDeleteEnvironmentRaw(e,t){if(null==e.environmentId)throw new rC("environmentId",'Required parameter "environmentId" was null or undefined when calling sandboxEnvironmentsDeleteEnvironment().');return new rq(await this.request({path:"/rest/sandbox_environments/environments/{environmentId}".replace("{environmentId}",encodeURIComponent(String(e.environmentId))),method:"DELETE",headers:{},query:{}},t))}async sandboxEnvironmentsDeleteEnvironment(e,t){let n=await this.sandboxEnvironmentsDeleteEnvironmentRaw(e,t);return await n.value()}async sandboxEnvironmentsGetCachingStatusRaw(e,t){if(null==e.environmentId)throw new rC("environmentId",'Required parameter "environmentId" was null or undefined when calling sandboxEnvironmentsGetCachingStatus().');return new rq(await this.request({path:"/rest/sandbox_environments/environments/{environmentId}/caching-status".replace("{environmentId}",encodeURIComponent(String(e.environmentId))),method:"GET",headers:{},query:{}},t),e=>(function(e,t){var n,i;if(null==e)return e;return{status:null==e.status?void 0:(n=e.status,i=0,n),containerImage:null==e.containerImage?void 0:e.containerImage,commitSha:null==e.commitSha?void 0:e.commitSha,errorMessage:null==e.errorMessage?void 0:e.errorMessage,createdAt:null==e.createdAt?void 0:e.createdAt}})(e,0))}async sandboxEnvironmentsGetCachingStatus(e,t){let n=await this.sandboxEnvironmentsGetCachingStatusRaw(e,t);return await n.value()}async sandboxEnvironmentsGetEnvironmentRaw(e,t){if(null==e.environmentId)throw new rC("environmentId",'Required parameter "environmentId" was null or undefined when calling sandboxEnvironmentsGetEnvironment().');return new rq(await this.request({path:"/rest/sandbox_environments/environments/{environmentId}".replace("{environmentId}",encodeURIComponent(String(e.environmentId))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{environment:null==t.environment?void 0:rU(t.environment)}})}async sandboxEnvironmentsGetEnvironment(e,t){let n=await this.sandboxEnvironmentsGetEnvironmentRaw(e,t);return await n.value()}async sandboxEnvironmentsListEnvironmentsRaw(e,t){let n={};return null!=e.page&&(n.page=e.page),null!=e.pageSize&&(n.pageSize=e.pageSize),new rq(await this.request({path:"/rest/sandbox_environments/environments",method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{environments:null==t.environments?void 0:t.environments.map(rU),page:null==t.page?void 0:t.page,pageSize:null==t.pageSize?void 0:t.pageSize,hasMore:null==t.hasMore?void 0:t.hasMore}})}async sandboxEnvironmentsListEnvironments(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.sandboxEnvironmentsListEnvironmentsRaw(e,t);return await n.value()}async sandboxEnvironmentsListPreinstalledPackagesRaw(e){return new rq(await this.request({path:"/rest/sandbox_environments/preinstalled-packages",method:"GET",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{packages:null==t.packages?void 0:t.packages.map(rM)}})}async sandboxEnvironmentsListPreinstalledPackages(e){let t=await this.sandboxEnvironmentsListPreinstalledPackagesRaw(e);return await t.value()}async sandboxEnvironmentsRebuildCacheRaw(e,t){if(null==e.environmentId)throw new rC("environmentId",'Required parameter "environmentId" was null or undefined when calling sandboxEnvironmentsRebuildCache().');return new rq(await this.request({path:"/rest/sandbox_environments/environments/{environmentId}/rebuild-cache".replace("{environmentId}",encodeURIComponent(String(e.environmentId))),method:"POST",headers:{},query:{}},t))}async sandboxEnvironmentsRebuildCache(e,t){let n=await this.sandboxEnvironmentsRebuildCacheRaw(e,t);return await n.value()}async sandboxEnvironmentsUpdateEnvironmentRaw(e,t){if(null==e.environmentId)throw new rC("environmentId",'Required parameter "environmentId" was null or undefined when calling sandboxEnvironmentsUpdateEnvironment().');if(null==e.body)throw new rC("body",'Required parameter "body" was null or undefined when calling sandboxEnvironmentsUpdateEnvironment().');let n={};return n["Content-Type"]="application/json",new rq(await this.request({path:"/rest/sandbox_environments/environments/{environmentId}".replace("{environmentId}",encodeURIComponent(String(e.environmentId))),method:"PUT",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,description:e.description,teamId:e.teamId,repository:e.repository,defaultBranch:e.defaultBranch,workspaceDirectory:e.workspaceDirectory,containerImage:e.containerImage,setupScript:e.setupScript,maintenanceScript:e.maintenanceScript,cachingEnabled:e.cachingEnabled,internetEnabled:e.internetEnabled,domainAllowlistPreset:e.domainAllowlistPreset,additionalDomains:e.additionalDomains,allowedHttpMethods:e.allowedHttpMethods,environmentVariables:null==e.environmentVariables?void 0:e.environmentVariables.map(rP),secrets:null==e.secrets?void 0:e.secrets.map(rE),preinstalledPackages:e.preinstalledPackages,providerId:e.providerId,requestedCpus:e.requestedCpus,requestedMemoryBytes:e.requestedMemoryBytes,requestedDiskBytes:e.requestedDiskBytes,requestedGpus:e.requestedGpus}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{environment:null==t.environment?void 0:rU(t.environment)}})}async sandboxEnvironmentsUpdateEnvironment(e,t){let n=await this.sandboxEnvironmentsUpdateEnvironmentRaw(e,t);return await n.value()}}(new rR(s$)),lo=new class e extends i3{async highlightsGetAccessRaw(e){return new i8(await this.request({path:"/rest/highlights/access",method:"GET",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{hasAccess:null==t.hasAccess?void 0:t.hasAccess}})}async highlightsGetAccess(e){let t=await this.highlightsGetAccessRaw(e);return await t.value()}async highlightsGetDiscussionPostsRaw(e,t){if(null==e.storyId)throw new i7("storyId",'Required parameter "storyId" was null or undefined when calling highlightsGetDiscussionPosts().');let n={};return null!=e.limit&&(n.limit=e.limit),null!=e.cursor&&(n.cursor=e.cursor),null!=e.source&&(n.source=e.source),new i8(await this.request({path:"/rest/highlights/stories/{storyId}/discussion-posts".replace("{storyId}",encodeURIComponent(String(e.storyId))),method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{discussionPosts:null==t.discussionPosts?void 0:t.discussionPosts.map(or),nextCursor:null==t.nextCursor?void 0:t.nextCursor}})}async highlightsGetDiscussionPosts(e,t){let n=await this.highlightsGetDiscussionPostsRaw(e,t);return await n.value()}async highlightsGetEngagingPostsRaw(e,t){if(null==e.storyId)throw new i7("storyId",'Required parameter "storyId" was null or undefined when calling highlightsGetEngagingPosts().');let n={};return null!=e.source&&(n.source=e.source),new i8(await this.request({path:"/rest/highlights/stories/{storyId}/engaging-posts".replace("{storyId}",encodeURIComponent(String(e.storyId))),method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{engagingPosts:null==t.engagingPosts?void 0:t.engagingPosts.map(or)}})}async highlightsGetEngagingPosts(e,t){let n=await this.highlightsGetEngagingPostsRaw(e,t);return await n.value()}async highlightsGetSourcePostsRaw(e,t){if(null==e.body)throw new i7("body",'Required parameter "body" was null or undefined when calling highlightsGetSourcePosts().');let n={};return n["Content-Type"]="application/json",new i8(await this.request({path:"/rest/highlights/source-posts",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{storyIds:e.storyIds,source:e.source}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{storyPosts:null==t.storyPosts?void 0:t.storyPosts.map(od)}})}async highlightsGetSourcePosts(e,t){let n=await this.highlightsGetSourcePostsRaw(e,t);return await n.value()}async highlightsGetStoriesRaw(e,t){let n={};return null!=e.limit&&(n.limit=e.limit),null!=e.cursor&&(n.cursor=e.cursor),new i8(await this.request({path:"/rest/highlights/stories",method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{stories:null==t.stories?void 0:t.stories.map(ol),nextCursor:null==t.nextCursor?void 0:t.nextCursor}})}async highlightsGetStories(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.highlightsGetStoriesRaw(e,t);return await n.value()}async highlightsGetStoryRaw(e,t){if(null==e.storyId)throw new i7("storyId",'Required parameter "storyId" was null or undefined when calling highlightsGetStory().');let n={};return null!=e.source&&(n.source=e.source),new i8(await this.request({path:"/rest/highlights/stories/{storyId}".replace("{storyId}",encodeURIComponent(String(e.storyId))),method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{story:null==t.story?void 0:ol(t.story)}})}async highlightsGetStory(e,t){let n=await this.highlightsGetStoryRaw(e,t);return await n.value()}}(new i2(sX)),lr=new class e extends sR{async voiceAlignAudioRaw(e,t){if(null==e.body)throw new sS("body",'Required parameter "body" was null or undefined when calling voiceAlignAudio().');let n={};return n["Content-Type"]="application/json",new sk(await this.request({path:"/rest/voice/align",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{transcript:e.transcript,format:e.format,audioB64:e.audioB64,alignmentProvider:e.alignmentProvider,langCode:e.langCode}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{words:null==t.words?void 0:t.words.map(sC),score:null==t.score?void 0:t.score,numSamples:null==t.numSamples?void 0:t.numSamples,transcript:null==t.transcript?void 0:t.transcript,infTime:null==t.infTime?void 0:t.infTime,alignmentScore:null==t.alignmentScore?void 0:t.alignmentScore}})}async voiceAlignAudio(e,t){let n=await this.voiceAlignAudioRaw(e,t);return await n.value()}async voiceCreateGrokCastRaw(e,t){if(null==e.body)throw new sS("body",'Required parameter "body" was null or undefined when calling voiceCreateGrokCast().');let n={};return n["Content-Type"]="application/json",new sk(await this.request({path:"/rest/voice/grokcasts",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{title:e.title,conversationId:e.conversationId,generationPrompt:e.generationPrompt,audioAssetId:e.audioAssetId,alignmentInfo:e.alignmentInfo}}(e.body,!1)},t),e=>sE(e,!1))}async voiceCreateGrokCast(e,t){let n=await this.voiceCreateGrokCastRaw(e,t);return await n.value()}async voiceCreateShareLinkRaw(e,t){if(null==e.voiceId)throw new sS("voiceId",'Required parameter "voiceId" was null or undefined when calling voiceCreateShareLink().');if(null==e.body)throw new sS("body",'Required parameter "body" was null or undefined when calling voiceCreateShareLink().');let n={};return n["Content-Type"]="application/json",new sk(await this.request({path:"/rest/voice/voices/{voiceId}/share-link".replace("{voiceId}",encodeURIComponent(String(e.voiceId))),method:"POST",headers:n,query:{},body:e.body},t),e=>{var t,n;return n=0,null==(t=e)?t:{shareToken:null==t.shareToken?void 0:t.shareToken,metadata:null==t.metadata?void 0:sA(t.metadata)}})}async voiceCreateShareLink(e,t){let n=await this.voiceCreateShareLinkRaw(e,t);return await n.value()}async voiceCreateVoiceRaw(e,t){if(null==e.body)throw new sS("body",'Required parameter "body" was null or undefined when calling voiceCreateVoice().');let n={};return n["Content-Type"]="application/json",new sk(await this.request({path:"/rest/voice/voices",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{audioB64:e.audioB64,name:e.name,format:e.format}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{voiceId:null==t.voiceId?void 0:t.voiceId,metadata:null==t.metadata?void 0:sP(t.metadata)}})}async voiceCreateVoice(e,t){let n=await this.voiceCreateVoiceRaw(e,t);return await n.value()}async voiceDeleteVoiceRaw(e,t){if(null==e.voiceId)throw new sS("voiceId",'Required parameter "voiceId" was null or undefined when calling voiceDeleteVoice().');return new sk(await this.request({path:"/rest/voice/voices/{voiceId}".replace("{voiceId}",encodeURIComponent(String(e.voiceId))),method:"DELETE",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{success:null==t.success?void 0:t.success}})}async voiceDeleteVoice(e,t){let n=await this.voiceDeleteVoiceRaw(e,t);return await n.value()}async voiceGetGrokCastRaw(e,t){if(null==e.grokcastId)throw new sS("grokcastId",'Required parameter "grokcastId" was null or undefined when calling voiceGetGrokCast().');return new sk(await this.request({path:"/rest/voice/grokcasts/{grokcastId}".replace("{grokcastId}",encodeURIComponent(String(e.grokcastId))),method:"GET",headers:{},query:{}},t),e=>sE(e,!1))}async voiceGetGrokCast(e,t){let n=await this.voiceGetGrokCastRaw(e,t);return await n.value()}async voiceGetVoiceRaw(e,t){if(null==e.voiceId)throw new sS("voiceId",'Required parameter "voiceId" was null or undefined when calling voiceGetVoice().');return new sk(await this.request({path:"/rest/voice/voices/{voiceId}".replace("{voiceId}",encodeURIComponent(String(e.voiceId))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{metadata:null==t.metadata?void 0:sP(t.metadata)}})}async voiceGetVoice(e,t){let n=await this.voiceGetVoiceRaw(e,t);return await n.value()}async voiceListGrokCastsRaw(e,t){if(null==e.conversationId)throw new sS("conversationId",'Required parameter "conversationId" was null or undefined when calling voiceListGrokCasts().');return new sk(await this.request({path:"/rest/voice/conversations/{conversationId}/grokcasts".replace("{conversationId}",encodeURIComponent(String(e.conversationId))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{grokcasts:null==t.grokcasts?void 0:t.grokcasts.map(sU)}})}async voiceListGrokCasts(e,t){let n=await this.voiceListGrokCastsRaw(e,t);return await n.value()}async voiceListSavedVoicesRaw(e,t){let n={};return null!=e.limit&&(n.limit=e.limit),new sk(await this.request({path:"/rest/voice/saved-voices",method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{savedVoices:null==t.savedVoices?void 0:t.savedVoices.map(sM)}})}async voiceListSavedVoices(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.voiceListSavedVoicesRaw(e,t);return await n.value()}async voiceListVoiceShareLinksRaw(e,t){if(null==e.voiceId)throw new sS("voiceId",'Required parameter "voiceId" was null or undefined when calling voiceListVoiceShareLinks().');let n={};return null!=e.limit&&(n.limit=e.limit),new sk(await this.request({path:"/rest/voice/voices/{voiceId}/share-links".replace("{voiceId}",encodeURIComponent(String(e.voiceId))),method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{links:null==t.links?void 0:t.links.map(sA)}})}async voiceListVoiceShareLinks(e,t){let n=await this.voiceListVoiceShareLinksRaw(e,t);return await n.value()}async voiceListVoicesRaw(e,t){let n={};return null!=e.limit&&(n.limit=e.limit),null!=e.cursor&&(n.cursor=e.cursor),new sk(await this.request({path:"/rest/voice/voices",method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{voices:null==t.voices?void 0:t.voices.map(sP),nextCursor:null==t.nextCursor?void 0:t.nextCursor}})}async voiceListVoices(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.voiceListVoicesRaw(e,t);return await n.value()}async voiceResolveShareLinkRaw(e,t){if(null==e.shareToken)throw new sS("shareToken",'Required parameter "shareToken" was null or undefined when calling voiceResolveShareLink().');return new sk(await this.request({path:"/rest/voice/share-link/{shareToken}".replace("{shareToken}",encodeURIComponent(String(e.shareToken))),method:"GET",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{link:null==t.link?void 0:sA(t.link),voice:null==t.voice?void 0:sP(t.voice)}})}async voiceResolveShareLink(e,t){let n=await this.voiceResolveShareLinkRaw(e,t);return await n.value()}async voiceRevokeShareLinkRaw(e,t){if(null==e.shareToken)throw new sS("shareToken",'Required parameter "shareToken" was null or undefined when calling voiceRevokeShareLink().');return new sk(await this.request({path:"/rest/voice/share-link/{shareToken}".replace("{shareToken}",encodeURIComponent(String(e.shareToken))),method:"DELETE",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{success:null==t.success?void 0:t.success}})}async voiceRevokeShareLink(e,t){let n=await this.voiceRevokeShareLinkRaw(e,t);return await n.value()}async voiceSaveVoiceRaw(e,t){if(null==e.body)throw new sS("body",'Required parameter "body" was null or undefined when calling voiceSaveVoice().');let n={};return n["Content-Type"]="application/json",new sk(await this.request({path:"/rest/voice/saved-voices",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{voiceId:e.voiceId,shareToken:e.shareToken}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{success:null==t.success?void 0:t.success}})}async voiceSaveVoice(e,t){let n=await this.voiceSaveVoiceRaw(e,t);return await n.value()}async voiceSpeechToTextRaw(e,t){if(null==e.body)throw new sS("body",'Required parameter "body" was null or undefined when calling voiceSpeechToText().');let n={};return n["Content-Type"]="application/json",new sk(await this.request({path:"/rest/voice/speech-to-text",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{audioBase64:e.audioBase64,audioFormat:e.audioFormat,maxTokens:e.maxTokens,enhance:e.enhance,history:null==e.history?void 0:e.history.map(sq)}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{text:null==t.text?void 0:t.text,samplingTime:null==t.samplingTime?void 0:t.samplingTime,words:null==t.words?void 0:t.words.map(sC),languageCode:null==t.languageCode?void 0:t.languageCode}})}async voiceSpeechToText(e,t){let n=await this.voiceSpeechToTextRaw(e,t);return await n.value()}async voiceTranscribeRaw(e,t){if(null==e.body)throw new sS("body",'Required parameter "body" was null or undefined when calling voiceTranscribe().');let n={};return n["Content-Type"]="application/json",new sk(await this.request({path:"/rest/voice/transcribe",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{audioB64:e.audioB64,format:e.format,prefix:e.prefix,beamSize:e.beamSize,patience:e.patience,batchSize:e.batchSize}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{segments:null==t.segments?void 0:t.segments.map(s_)}})}async voiceTranscribe(e,t){let n=await this.voiceTranscribeRaw(e,t);return await n.value()}async voiceUnsaveVoiceRaw(e,t){if(null==e.voiceId)throw new sS("voiceId",'Required parameter "voiceId" was null or undefined when calling voiceUnsaveVoice().');return new sk(await this.request({path:"/rest/voice/saved-voices/{voiceId}".replace("{voiceId}",encodeURIComponent(String(e.voiceId))),method:"DELETE",headers:{},query:{}},t),e=>{var t,n;return n=0,null==(t=e)?t:{success:null==t.success?void 0:t.success}})}async voiceUnsaveVoice(e,t){let n=await this.voiceUnsaveVoiceRaw(e,t);return await n.value()}async voiceUpdateVoiceVisibilityRaw(e,t){if(null==e.voiceId)throw new sS("voiceId",'Required parameter "voiceId" was null or undefined when calling voiceUpdateVoiceVisibility().');if(null==e.body)throw new sS("body",'Required parameter "body" was null or undefined when calling voiceUpdateVoiceVisibility().');let n={};return n["Content-Type"]="application/json",new sk(await this.request({path:"/rest/voice/voices/{voiceId}/visibility".replace("{voiceId}",encodeURIComponent(String(e.voiceId))),method:"PATCH",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{visibility:e.visibility}}(e.body,!1)},t),e=>{var t,n;return n=0,null==(t=e)?t:{metadata:null==t.metadata?void 0:sP(t.metadata)}})}async voiceUpdateVoiceVisibility(e,t){let n=await this.voiceUpdateVoiceVisibilityRaw(e,t);return await n.value()}}(new sy(sX)),la=new class e extends ag{async suggestionServiceGetUserProfileRaw(e){return new aT(await this.request({path:"/rest/suggestions/profile",method:"GET",headers:{},query:{}},e),e=>(function(e,t){var n,i;if(null==e)return e;return{userProfile:null==e.userProfile?void 0:(n=e.userProfile,i=0,null==n?n:{topicsOfInterest:null==n.topicsOfInterest?void 0:n.topicsOfInterest})}})(e,0))}async suggestionServiceGetUserProfile(e){let t=await this.suggestionServiceGetUserProfileRaw(e);return await t.value()}async suggestionServiceStreamSuggestionsRaw(e,t){if(null==e.body)throw new aR("body",'Required parameter "body" was null or undefined when calling suggestionServiceStreamSuggestions().');let n={};return n["Content-Type"]="application/json",new aT(await this.request({path:"/rest/suggestions/stream",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{query:e.query,acceptedTypes:null==e.acceptedTypes?void 0:e.acceptedTypes.map(ab),conversation:null==e.conversation?void 0:e.conversation.map(ak),conversationHistory:null==e.conversationHistory?void 0:e.conversationHistory.map(aS),userProfile:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{topicsOfInterest:e.topicsOfInterest}}(e.userProfile,!1)}}(e.body,!1)},t),e=>(function(e,t){var n,i;if(null==e)return e;return{result:null==e.result?void 0:function(e,t){var n,i,o,r,a,s,l,d;if(null==e)return e;return{searchCompletion:null==e.searchCompletion?void 0:(n=e.searchCompletion,i=0,null==n?n:{text:null==n.text?void 0:n.text}),stock:null==e.stock?void 0:(o=e.stock,r=0,null==o?o:{data:null==o.data?void 0:function(e,t){var n,i,o,r,a,s;if(null==e)return e;return{ticker:null==e.ticker?void 0:e.ticker,stockOverview:null==e.stockOverview?void 0:(n=e.stockOverview,i=0,null==n?n:{ticker:null==n.ticker?void 0:n.ticker,name:null==n.name?void 0:n.name,iconUrl:null==n.iconUrl?void 0:n.iconUrl,logoUrl:null==n.logoUrl?void 0:n.logoUrl,exchange:null==n.exchange?void 0:n.exchange,currency:null==n.currency?void 0:n.currency,market:null==n.market?void 0:n.market,weightedSharesOutstanding:null==n.weightedSharesOutstanding?void 0:n.weightedSharesOutstanding,shareClassSharesOutstanding:null==n.shareClassSharesOutstanding?void 0:n.shareClassSharesOutstanding,tickerType:null==n.tickerType?void 0:n.tickerType}),financeValue:null==e.financeValue?void 0:(o=e.financeValue,r=0,null==o?o:{value:null==o.value?void 0:o.value,change:null==o.change?void 0:o.change,changePercent:null==o.changePercent?void 0:o.changePercent,unit:null==o.unit?void 0:o.unit,label:null==o.label?void 0:o.label}),prevDay:null==e.prevDay?void 0:(a=e.prevDay,s=0,null==a?a:{timestamp:null==a.timestamp?void 0:a.timestamp,open:null==a.open?void 0:a.open,high:null==a.high?void 0:a.high,low:null==a.low?void 0:a.low,close:null==a.close?void 0:a.close,volume:null==a.volume?void 0:a.volume,average:null==a.average?void 0:a.average}),timestamp:null==e.timestamp?void 0:e.timestamp}}(o.data,0)}),quickAnswer:null==e.quickAnswer?void 0:(a=e.quickAnswer,s=0,null==a?a:{text:null==a.text?void 0:a.text}),grokCompletion:null==e.grokCompletion?void 0:(l=e.grokCompletion,d=0,null==l?l:{text:null==l.text?void 0:l.text})}}(e.result,0),error:null==e.error?void 0:(n=e.error,i=0,null==n?n:{code:null==n.code?void 0:n.code,message:null==n.message?void 0:n.message,details:null==n.details?void 0:n.details.map(aC)})}})(e,0))}async suggestionServiceStreamSuggestions(e,t){let n=await this.suggestionServiceStreamSuggestionsRaw(e,t);return await n.value()}}(new aw(sX));new class e extends sl{async trendsGetPersonalizedTrendsRaw(e,t){let n={};return null!=e.limit&&(n.limit=e.limit),null!=e.includePosts&&(n.includePosts=e.includePosts),null!=e.includePostInfo&&(n.includePostInfo=e.includePostInfo),null!=e.includeAuthorInfo&&(n.includeAuthorInfo=e.includeAuthorInfo),null!=e.numPosts&&(n.numPosts=e.numPosts),new sc(await this.request({path:"/rest/trends/personalized",method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{trends:null==t.trends?void 0:t.trends.map(sf)}})}async trendsGetPersonalizedTrends(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.trendsGetPersonalizedTrendsRaw(e,t);return await n.value()}}(new sa(sX));let ls=new class e extends rn{async notificationsListNotificationsRaw(e,t){let n={};return null!=e.pageSize&&(n.pageSize=e.pageSize),null!=e.pageToken&&(n.pageToken=e.pageToken),new ra(await this.request({path:"/rest/notifications/list",method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{notifications:null==t.notifications?void 0:t.notifications.map(ru),nextPageToken:null==t.nextPageToken?void 0:t.nextPageToken}})}async notificationsListNotifications(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.notificationsListNotificationsRaw(e,t);return await n.value()}async notificationsMarkNotificationsReadRaw(e,t){if(null==e.body)throw new rr("body",'Required parameter "body" was null or undefined when calling notificationsMarkNotificationsRead().');let n={};return n["Content-Type"]="application/json",new ra(await this.request({path:"/rest/notifications/mark-read",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{notificationIds:e.notificationIds}}(e.body,!1)},t))}async notificationsMarkNotificationsRead(e,t){let n=await this.notificationsMarkNotificationsReadRaw(e,t);return await n.value()}async notificationsUpdateConversationAccessRequestStatusRaw(e,t){if(null==e.body)throw new rr("body",'Required parameter "body" was null or undefined when calling notificationsUpdateConversationAccessRequestStatus().');let n={};return n["Content-Type"]="application/json",new ra(await this.request({path:"/rest/notifications/update-access-request-status",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{notificationId:e.notificationId,status:e.status}}(e.body,!1)},t))}async notificationsUpdateConversationAccessRequestStatus(e,t){let n=await this.notificationsUpdateConversationAccessRequestStatusRaw(e,t);return await n.value()}}(new re(sX)),ll=new class e extends nO{async grokDevModelsCreateModelRaw(e,t){if(null==e.body)throw new nL("body",'Required parameter "body" was null or undefined when calling grokDevModelsCreateModel().');let n={};return n["Content-Type"]="application/json",new nF(await this.request({path:"/rest/dev/models",method:"POST",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{model:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{id:e.id,name:e.name,createdBy:e.createdBy,updatedBy:e.updatedBy,createTime:e.createTime,updateTime:e.updateTime,chatConfigOverride:nQ(e.chatConfigOverride,!1),description:e.description}}(e.model,!1)}}(e.body,!1)},t),e=>n2(e))}async grokDevModelsCreateModel(e,t){let n=await this.grokDevModelsCreateModelRaw(e,t);return await n.value()}async grokDevModelsDeleteModelRaw(e,t){if(null==e.id)throw new nL("id",'Required parameter "id" was null or undefined when calling grokDevModelsDeleteModel().');return new nF(await this.request({path:"/rest/dev/models/{id}".replace("{id}",encodeURIComponent(String(e.id))),method:"DELETE",headers:{},query:{}},t))}async grokDevModelsDeleteModel(e,t){let n=await this.grokDevModelsDeleteModelRaw(e,t);return await n.value()}async grokDevModelsGetDefaultModelSpecRaw(e){return new nF(await this.request({path:"/rest/dev/models/default",method:"GET",headers:{},query:{}},e),e=>{var t,n;return n=0,null==(t=e)?t:{availableSchedulers:null==t.availableSchedulers?void 0:t.availableSchedulers.map(n4),availableTools:null==t.availableTools?void 0:t.availableTools.map(n3)}})}async grokDevModelsGetDefaultModelSpec(e){let t=await this.grokDevModelsGetDefaultModelSpecRaw(e);return await t.value()}async grokDevModelsListModelsRaw(e,t){let n={};return null!=e.pageSize&&(n.pageSize=e.pageSize),null!=e.pageToken&&(n.pageToken=e.pageToken),new nF(await this.request({path:"/rest/dev/models",method:"GET",headers:{},query:n},t),e=>{var t,n;return n=0,null==(t=e)?t:{models:null==t.models?void 0:t.models.map(n2),nextPageToken:null==t.nextPageToken?void 0:t.nextPageToken}})}async grokDevModelsListModels(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,n=await this.grokDevModelsListModelsRaw(e,t);return await n.value()}async grokDevModelsUpdateModelRaw(e,t){if(null==e.modelId)throw new nL("modelId",'Required parameter "modelId" was null or undefined when calling grokDevModelsUpdateModel().');if(null==e.body)throw new nL("body",'Required parameter "body" was null or undefined when calling grokDevModelsUpdateModel().');let n={};return n["Content-Type"]="application/json",new nF(await this.request({path:"/rest/dev/models/{model.id}".replace("{model.id}",encodeURIComponent(String(e.modelId))),method:"PATCH",headers:n,query:{},body:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{model:function(e){return(arguments.length>1&&void 0!==arguments[1]&&arguments[1],null==e)?e:{name:e.name,createdBy:e.createdBy,updatedBy:e.updatedBy,createTime:e.createTime,updateTime:e.updateTime,chatConfigOverride:nQ(e.chatConfigOverride,!1),description:e.description}}(e.model,!1)}}(e.body,!1)},t),e=>n2(e))}async grokDevModelsUpdateModel(e,t){let n=await this.grokDevModelsUpdateModelRaw(e,t);return await n.value()}}(new n_(sX))}]);

//# sourceMappingURL=d98c3ad59a4ee0db.js.map
//# debugId=d192c324-f636-5e86-9499-4dcaeec460b9