@botpress/client 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bundle.cjs CHANGED
@@ -5,7 +5,7 @@
5
5
  `)}function Mo(a){a?process.env.DEBUG=a:delete process.env.DEBUG}function Lo(){return process.env.DEBUG}function Fo(a){a.inspectOpts={};let e=Object.keys(N.inspectOpts);for(let t=0;t<e.length;t++)a.inspectOpts[e[t]]=N.inspectOpts[e[t]]}lt.exports=pa()(N);var{formatters:Js}=lt.exports;Js.o=function(a){return this.inspectOpts.colors=this.useColors,pt.inspect(a,this.inspectOpts).split(`
6
6
  `).map(e=>e.trim()).join(" ")};Js.O=function(a){return this.inspectOpts.colors=this.useColors,pt.inspect(a,this.inspectOpts)}});var Ys=T((hp,da)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?da.exports=Ws():da.exports=Ks()});var Zs=T((gp,Xs)=>{var Ne;Xs.exports=function(){if(!Ne){try{Ne=Ys()("follow-redirects")}catch{}typeof Ne!="function"&&(Ne=function(){})}Ne.apply(null,arguments)}});var cn=T((vp,ga)=>{var he=require("url"),ma=he.URL,No=require("http"),Wo=require("https"),an=require("stream").Writable,sn=require("assert"),nn=Zs(),xa=["abort","aborted","connect","error","socket","timeout"],ha=Object.create(null);xa.forEach(function(a){ha[a]=function(e,t,s){this._redirectable.emit(a,e,t,s)}});var Go=Ge("ERR_INVALID_URL","Invalid URL",TypeError),en=Ge("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),zo=Ge("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),Ho=Ge("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Qo=Ge("ERR_STREAM_WRITE_AFTER_END","write after end");function $(a,e){an.call(this),this._sanitizeOptions(a),this._options=a,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var t=this;this._onNativeResponse=function(s){t._processResponse(s)},this._performRequest()}$.prototype=Object.create(an.prototype);$.prototype.abort=function(){rn(this._currentRequest),this.emit("abort")};$.prototype.write=function(a,e,t){if(this._ending)throw new Qo;if(!ge(a)&&!Ko(a))throw new TypeError("data should be a string, Buffer or Uint8Array");if(We(e)&&(t=e,e=null),a.length===0){t&&t();return}this._requestBodyLength+a.length<=this._options.maxBodyLength?(this._requestBodyLength+=a.length,this._requestBodyBuffers.push({data:a,encoding:e}),this._currentRequest.write(a,e,t)):(this.emit("error",new Ho),this.abort())};$.prototype.end=function(a,e,t){if(We(a)?(t=a,a=e=null):We(e)&&(t=e,e=null),!a)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var s=this,i=this._currentRequest;this.write(a,e,function(){s._ended=!0,i.end(null,null,t)}),this._ending=!0}};$.prototype.setHeader=function(a,e){this._options.headers[a]=e,this._currentRequest.setHeader(a,e)};$.prototype.removeHeader=function(a){delete this._options.headers[a],this._currentRequest.removeHeader(a)};$.prototype.setTimeout=function(a,e){var t=this;function s(o){o.setTimeout(a),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function i(o){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),n()},a),s(o)}function n(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",n),t.removeListener("error",n),t.removeListener("response",n),e&&t.removeListener("timeout",e),t.socket||t._currentRequest.removeListener("socket",i)}return e&&this.on("timeout",e),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",s),this.on("abort",n),this.on("error",n),this.on("response",n),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(a){$.prototype[a]=function(e,t){return this._currentRequest[a](e,t)}});["aborted","connection","socket"].forEach(function(a){Object.defineProperty($.prototype,a,{get:function(){return this._currentRequest[a]}})});$.prototype._sanitizeOptions=function(a){if(a.headers||(a.headers={}),a.host&&(a.hostname||(a.hostname=a.host),delete a.host),!a.pathname&&a.path){var e=a.path.indexOf("?");e<0?a.pathname=a.path:(a.pathname=a.path.substring(0,e),a.search=a.path.substring(e))}};$.prototype._performRequest=function(){var a=this._options.protocol,e=this._options.nativeProtocols[a];if(!e){this.emit("error",new TypeError("Unsupported protocol "+a));return}if(this._options.agents){var t=a.slice(0,-1);this._options.agent=this._options.agents[t]}var s=this._currentRequest=e.request(this._options,this._onNativeResponse);s._redirectable=this;for(var i of xa)s.on(i,ha[i]);if(this._currentUrl=/^\//.test(this._options.path)?he.format(this._options):this._options.path,this._isRedirect){var n=0,o=this,r=this._requestBodyBuffers;(function p(c){if(s===o._currentRequest)if(c)o.emit("error",c);else if(n<r.length){var l=r[n++];s.finished||s.write(l.data,l.encoding,p)}else o._ended&&s.end()})()}};$.prototype._processResponse=function(a){var e=a.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:a.headers,statusCode:e});var t=a.headers.location;if(!t||this._options.followRedirects===!1||e<300||e>=400){a.responseUrl=this._currentUrl,a.redirects=this._redirects,this.emit("response",a),this._requestBodyBuffers=[];return}if(rn(this._currentRequest),a.destroy(),++this._redirectCount>this._options.maxRedirects){this.emit("error",new zo);return}var s,i=this._options.beforeRedirect;i&&(s=Object.assign({Host:a.req.getHeader("host")},this._options.headers));var n=this._options.method;((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],fa(/^content-/i,this._options.headers));var o=fa(/^host$/i,this._options.headers),r=he.parse(this._currentUrl),p=o||r.host,c=/^\w+:/.test(t)?this._currentUrl:he.format(Object.assign(r,{host:p})),l;try{l=he.resolve(c,t)}catch(m){this.emit("error",new en({cause:m}));return}nn("redirecting to",l),this._isRedirect=!0;var d=he.parse(l);if(Object.assign(this._options,d),(d.protocol!==r.protocol&&d.protocol!=="https:"||d.host!==p&&!Jo(d.host,p))&&fa(/^(?:authorization|cookie)$/i,this._options.headers),We(i)){var f={headers:a.headers,statusCode:e},P={url:c,method:n,headers:s};try{i(this._options,f,P)}catch(m){this.emit("error",m);return}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(m){this.emit("error",new en({cause:m}))}};function on(a){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(a).forEach(function(s){var i=s+":",n=t[i]=a[s],o=e[s]=Object.create(n);function r(c,l,d){if(ge(c)){var f;try{f=tn(new ma(c))}catch{f=he.parse(c)}if(!ge(f.protocol))throw new Go({input:c});c=f}else ma&&c instanceof ma?c=tn(c):(d=l,l=c,c={protocol:i});return We(l)&&(d=l,l=null),l=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},c,l),l.nativeProtocols=t,!ge(l.host)&&!ge(l.hostname)&&(l.hostname="::1"),sn.equal(l.protocol,i,"protocol mismatch"),nn("options",l),new $(l,d)}function p(c,l,d){var f=o.request(c,l,d);return f.end(),f}Object.defineProperties(o,{request:{value:r,configurable:!0,enumerable:!0,writable:!0},get:{value:p,configurable:!0,enumerable:!0,writable:!0}})}),e}function $o(){}function tn(a){var e={protocol:a.protocol,hostname:a.hostname.startsWith("[")?a.hostname.slice(1,-1):a.hostname,hash:a.hash,search:a.search,pathname:a.pathname,path:a.pathname+a.search,href:a.href};return a.port!==""&&(e.port=Number(a.port)),e}function fa(a,e){var t;for(var s in e)a.test(s)&&(t=e[s],delete e[s]);return t===null||typeof t>"u"?void 0:String(t).trim()}function Ge(a,e,t){function s(i){Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=a,this.message=this.cause?e+": "+this.cause.message:e}return s.prototype=new(t||Error),s.prototype.constructor=s,s.prototype.name="Error ["+a+"]",s}function rn(a){for(var e of xa)a.removeListener(e,ha[e]);a.on("error",$o),a.abort()}function Jo(a,e){sn(ge(a)&&ge(e));var t=a.length-e.length-1;return t>0&&a[t]==="."&&a.endsWith(e)}function ge(a){return typeof a=="string"||a instanceof String}function We(a){return typeof a=="function"}function Ko(a){return typeof a=="object"&&"length"in a}ga.exports=on({http:No,https:Wo});ga.exports.wrap=on});var Un=T(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});var wr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},Br=typeof window<"u"&&typeof window.document<"u",Pr=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,kr=(typeof self>"u"?"undefined":wr(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",qr=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Er=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";ve.isBrowser=Br;ve.isWebWorker=kr;ve.isNode=Pr;ve.isJsDom=qr;ve.isDeno=Er});var Fr={};Ua(Fr,{AlreadyExistsError:()=>It,Client:()=>qa,ForbiddenError:()=>vt,InternalError:()=>ht,InvalidDataFormatError:()=>Bt,InvalidIdentifierError:()=>Pt,InvalidJsonSchemaError:()=>wt,InvalidPayloadError:()=>yt,InvalidQueryError:()=>Et,MethodNotFoundError:()=>At,PayloadTooLargeError:()=>bt,RateLimitedError:()=>Tt,ReferenceNotFoundError:()=>qt,RelationConflictError:()=>kt,ResourceNotFoundError:()=>Ct,RuntimeError:()=>Ut,UnauthorizedError:()=>gt,UnknownError:()=>X,UnsupportedMediaTypeError:()=>Rt,axios:()=>Pa,errorFrom:()=>Ot,isApiError:()=>On});module.exports=Fn(Fr);var Pa={};Ua(Pa,{Axios:()=>pr,AxiosError:()=>lr,AxiosHeaders:()=>yr,Cancel:()=>hr,CancelToken:()=>mr,CanceledError:()=>ur,HttpStatusCode:()=>Rr,VERSION:()=>fr,all:()=>xr,default:()=>x,formToJSON:()=>Ar,isAxiosError:()=>gr,isCancel:()=>dr,mergeConfig:()=>Cr,spread:()=>vr,toFormData:()=>br});function Ve(a,e){return function(){return a.apply(e,arguments)}}var{toString:Oa}=Object.prototype,{getPrototypeOf:Wt}=Object,Gt=(a=>e=>{let t=Oa.call(e);return a[t]||(a[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),ie=a=>(a=a.toLowerCase(),e=>Gt(e)===a),tt=a=>e=>typeof e===a,{isArray:Ae}=Array,_e=tt("undefined");function Nn(a){return a!==null&&!_e(a)&&a.constructor!==null&&!_e(a.constructor)&&de(a.constructor.isBuffer)&&a.constructor.isBuffer(a)}var Sa=ie("ArrayBuffer");function Wn(a){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(a):e=a&&a.buffer&&Sa(a.buffer),e}var Gn=tt("string"),de=tt("function"),Da=tt("number"),zt=a=>a!==null&&typeof a=="object",zn=a=>a===!0||a===!1,et=a=>{if(Gt(a)!=="object")return!1;let e=Wt(a);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in a)&&!(Symbol.iterator in a)},Hn=ie("Date"),Qn=ie("File"),$n=ie("Blob"),Jn=ie("FileList"),Kn=a=>zt(a)&&de(a.pipe),Yn=a=>{let e="[object FormData]";return a&&(typeof FormData=="function"&&a instanceof FormData||Oa.call(a)===e||de(a.toString)&&a.toString()===e)},Xn=ie("URLSearchParams"),Zn=a=>a.trim?a.trim():a.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function je(a,e,{allOwnKeys:t=!1}={}){if(a===null||typeof a>"u")return;let s,i;if(typeof a!="object"&&(a=[a]),Ae(a))for(s=0,i=a.length;s<i;s++)e.call(null,a[s],s,a);else{let n=t?Object.getOwnPropertyNames(a):Object.keys(a),o=n.length,r;for(s=0;s<o;s++)r=n[s],e.call(null,a[r],r,a)}}function Va(a,e){e=e.toLowerCase();let t=Object.keys(a),s=t.length,i;for(;s-- >0;)if(i=t[s],e===i.toLowerCase())return i;return null}var _a=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),ja=a=>!_e(a)&&a!==_a;function Nt(){let{caseless:a}=ja(this)&&this||{},e={},t=(s,i)=>{let n=a&&Va(e,i)||i;et(e[n])&&et(s)?e[n]=Nt(e[n],s):et(s)?e[n]=Nt({},s):Ae(s)?e[n]=s.slice():e[n]=s};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&je(arguments[s],t);return e}var ei=(a,e,t,{allOwnKeys:s}={})=>(je(e,(i,n)=>{t&&de(i)?a[n]=Ve(i,t):a[n]=i},{allOwnKeys:s}),a),ti=a=>(a.charCodeAt(0)===65279&&(a=a.slice(1)),a),ai=(a,e,t,s)=>{a.prototype=Object.create(e.prototype,s),a.prototype.constructor=a,Object.defineProperty(a,"super",{value:e.prototype}),t&&Object.assign(a.prototype,t)},si=(a,e,t,s)=>{let i,n,o,r={};if(e=e||{},a==null)return e;do{for(i=Object.getOwnPropertyNames(a),n=i.length;n-- >0;)o=i[n],(!s||s(o,a,e))&&!r[o]&&(e[o]=a[o],r[o]=!0);a=t!==!1&&Wt(a)}while(a&&(!t||t(a,e))&&a!==Object.prototype);return e},ni=(a,e,t)=>{a=String(a),(t===void 0||t>a.length)&&(t=a.length),t-=e.length;let s=a.indexOf(e,t);return s!==-1&&s===t},ii=a=>{if(!a)return null;if(Ae(a))return a;let e=a.length;if(!Da(e))return null;let t=new Array(e);for(;e-- >0;)t[e]=a[e];return t},oi=(a=>e=>a&&e instanceof a)(typeof Uint8Array<"u"&&Wt(Uint8Array)),ri=(a,e)=>{let s=(a&&a[Symbol.iterator]).call(a),i;for(;(i=s.next())&&!i.done;){let n=i.value;e.call(a,n[0],n[1])}},ci=(a,e)=>{let t,s=[];for(;(t=a.exec(e))!==null;)s.push(t);return s},pi=ie("HTMLFormElement"),li=a=>a.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(t,s,i){return s.toUpperCase()+i}),Ta=(({hasOwnProperty:a})=>(e,t)=>a.call(e,t))(Object.prototype),ui=ie("RegExp"),Ma=(a,e)=>{let t=Object.getOwnPropertyDescriptors(a),s={};je(t,(i,n)=>{e(i,n,a)!==!1&&(s[n]=i)}),Object.defineProperties(a,s)},di=a=>{Ma(a,(e,t)=>{if(de(a)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;let s=a[t];if(de(s)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},mi=(a,e)=>{let t={},s=i=>{i.forEach(n=>{t[n]=!0})};return Ae(a)?s(a):s(String(a).split(e)),t},fi=()=>{},xi=(a,e)=>(a=+a,Number.isFinite(a)?a:e),hi=a=>{let e=new Array(10),t=(s,i)=>{if(zt(s)){if(e.indexOf(s)>=0)return;if(!("toJSON"in s)){e[i]=s;let n=Ae(s)?[]:{};return je(s,(o,r)=>{let p=t(o,i+1);!_e(p)&&(n[r]=p)}),e[i]=void 0,n}}return s};return t(a,0)},u={isArray:Ae,isArrayBuffer:Sa,isBuffer:Nn,isFormData:Yn,isArrayBufferView:Wn,isString:Gn,isNumber:Da,isBoolean:zn,isObject:zt,isPlainObject:et,isUndefined:_e,isDate:Hn,isFile:Qn,isBlob:$n,isRegExp:ui,isFunction:de,isStream:Kn,isURLSearchParams:Xn,isTypedArray:oi,isFileList:Jn,forEach:je,merge:Nt,extend:ei,trim:Zn,stripBOM:ti,inherits:ai,toFlatObject:si,kindOf:Gt,kindOfTest:ie,endsWith:ni,toArray:ii,forEachEntry:ri,matchAll:ci,isHTMLForm:pi,hasOwnProperty:Ta,hasOwnProp:Ta,reduceDescriptors:Ma,freezeMethods:di,toObjectSet:mi,toCamelCase:li,noop:fi,toFiniteNumber:xi,findKey:Va,global:_a,isContextDefined:ja,toJSONObject:hi};function Ce(a,e,t,s,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=a,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),s&&(this.request=s),i&&(this.response=i)}u.inherits(Ce,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:u.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var La=Ce.prototype,Fa={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(a=>{Fa[a]={value:a}});Object.defineProperties(Ce,Fa);Object.defineProperty(La,"isAxiosError",{value:!0});Ce.from=(a,e,t,s,i,n)=>{let o=Object.create(La);return u.toFlatObject(a,o,function(p){return p!==Error.prototype},r=>r!=="isAxiosError"),Ce.call(o,a.message,e,t,s,i),o.cause=a,o.name=a.name,n&&Object.assign(o,n),o};var h=Ce;var As=K(aa(),1),Cs=As.default;function sa(a){return u.isPlainObject(a)||u.isArray(a)}function Bs(a){return u.endsWith(a,"[]")?a.slice(0,-2):a}function ws(a,e,t){return a?a.concat(e).map(function(i,n){return i=Bs(i),!t&&n?"["+i+"]":i}).join(t?".":""):e}function Zi(a){return u.isArray(a)&&!a.some(sa)}var eo=u.toFlatObject(u,{},null,function(e){return/^is[A-Z]/.test(e)});function to(a){return a&&u.isFunction(a.append)&&a[Symbol.toStringTag]==="FormData"&&a[Symbol.iterator]}function ao(a,e,t){if(!u.isObject(a))throw new TypeError("target must be an object");e=e||new(Cs||FormData),t=u.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,E){return!u.isUndefined(E[v])});let s=t.metaTokens,i=t.visitor||l,n=t.dots,o=t.indexes,p=(t.Blob||typeof Blob<"u"&&Blob)&&to(e);if(!u.isFunction(i))throw new TypeError("visitor must be a function");function c(m){if(m===null)return"";if(u.isDate(m))return m.toISOString();if(!p&&u.isBlob(m))throw new h("Blob is not supported. Use a Buffer instead.");return u.isArrayBuffer(m)||u.isTypedArray(m)?p&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function l(m,v,E){let k=m;if(m&&!E&&typeof m=="object"){if(u.endsWith(v,"{}"))v=s?v:v.slice(0,-2),m=JSON.stringify(m);else if(u.isArray(m)&&Zi(m)||u.isFileList(m)||u.endsWith(v,"[]")&&(k=u.toArray(m)))return v=Bs(v),k.forEach(function(W,D){!(u.isUndefined(W)||W===null)&&e.append(o===!0?ws([v],D,n):o===null?v:v+"[]",c(W))}),!1}return sa(m)?!0:(e.append(ws(E,v,n),c(m)),!1)}let d=[],f=Object.assign(eo,{defaultVisitor:l,convertValue:c,isVisitable:sa});function P(m,v){if(!u.isUndefined(m)){if(d.indexOf(m)!==-1)throw Error("Circular reference detected in "+v.join("."));d.push(m),u.forEach(m,function(k,O){(!(u.isUndefined(k)||k===null)&&i.call(e,k,u.isString(O)?O.trim():O,v,f))===!0&&P(k,v?v.concat(O):[O])}),d.pop()}}if(!u.isObject(a))throw new TypeError("data must be an object");return P(a),e}var re=ao;function Ps(a){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(a).replace(/[!'()~]|%20|%00/g,function(s){return e[s]})}function ks(a,e){this._pairs=[],a&&re(a,this,e)}var qs=ks.prototype;qs.append=function(e,t){this._pairs.push([e,t])};qs.toString=function(e){let t=e?function(s){return e.call(this,s,Ps)}:Ps;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};var Es=ks;function so(a){return encodeURIComponent(a).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function me(a,e,t){if(!e)return a;let s=t&&t.encode||so,i=t&&t.serialize,n;if(i?n=i(e,t):n=u.isURLSearchParams(e)?e.toString():new Es(e,t).toString(s),n){let o=a.indexOf("#");o!==-1&&(a=a.slice(0,o)),a+=(a.indexOf("?")===-1?"?":"&")+n}return a}var na=class{constructor(){this.handlers=[]}use(e,t,s){return this.handlers.push({fulfilled:e,rejected:t,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){u.forEach(this.handlers,function(s){s!==null&&e(s)})}},ia=na;var we={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Us=K(require("url"),1),Is=Us.default.URLSearchParams;var Ts=K(aa(),1),Os=Ts.default;var j={isNode:!0,classes:{URLSearchParams:Is,FormData:Os,Blob:typeof Blob<"u"&&Blob||null},protocols:["http","https","file","data"]};function oa(a,e){return re(a,new j.classes.URLSearchParams,Object.assign({visitor:function(t,s,i,n){return j.isNode&&u.isBuffer(t)?(this.append(s,t.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},e))}function no(a){return u.matchAll(/\w+|\[(\w*)]/g,a).map(e=>e[0]==="[]"?"":e[1]||e[0])}function io(a){let e={},t=Object.keys(a),s,i=t.length,n;for(s=0;s<i;s++)n=t[s],e[n]=a[n];return e}function oo(a){function e(t,s,i,n){let o=t[n++],r=Number.isFinite(+o),p=n>=t.length;return o=!o&&u.isArray(i)?i.length:o,p?(u.hasOwnProp(i,o)?i[o]=[i[o],s]:i[o]=s,!r):((!i[o]||!u.isObject(i[o]))&&(i[o]=[]),e(t,s,i[o],n)&&u.isArray(i[o])&&(i[o]=io(i[o])),!r)}if(u.isFormData(a)&&u.isFunction(a.entries)){let t={};return u.forEachEntry(a,(s,i)=>{e(no(s),i,t,0)}),t}return null}var nt=oo;var ro={"Content-Type":void 0};function co(a,e,t){if(u.isString(a))try{return(e||JSON.parse)(a),u.trim(a)}catch(s){if(s.name!=="SyntaxError")throw s}return(t||JSON.stringify)(a)}var it={transitional:we,adapter:["xhr","http"],transformRequest:[function(e,t){let s=t.getContentType()||"",i=s.indexOf("application/json")>-1,n=u.isObject(e);if(n&&u.isHTMLForm(e)&&(e=new FormData(e)),u.isFormData(e))return i&&i?JSON.stringify(nt(e)):e;if(u.isArrayBuffer(e)||u.isBuffer(e)||u.isStream(e)||u.isFile(e)||u.isBlob(e))return e;if(u.isArrayBufferView(e))return e.buffer;if(u.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let r;if(n){if(s.indexOf("application/x-www-form-urlencoded")>-1)return oa(e,this.formSerializer).toString();if((r=u.isFileList(e))||s.indexOf("multipart/form-data")>-1){let p=this.env&&this.env.FormData;return re(r?{"files[]":e}:e,p&&new p,this.formSerializer)}}return n||i?(t.setContentType("application/json",!1),co(e)):e}],transformResponse:[function(e){let t=this.transitional||it.transitional,s=t&&t.forcedJSONParsing,i=this.responseType==="json";if(e&&u.isString(e)&&(s&&!this.responseType||i)){let o=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(r){if(o)throw r.name==="SyntaxError"?h.from(r,h.ERR_BAD_RESPONSE,this,null,this.response):r}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:j.classes.FormData,Blob:j.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};u.forEach(["delete","get","head"],function(e){it.headers[e]={}});u.forEach(["post","put","patch"],function(e){it.headers[e]=u.merge(ro)});var Be=it;var po=u.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Ss=a=>{let e={},t,s,i;return a&&a.split(`
7
7
  `).forEach(function(o){i=o.indexOf(":"),t=o.substring(0,i).trim().toLowerCase(),s=o.substring(i+1).trim(),!(!t||e[t]&&po[t])&&(t==="set-cookie"?e[t]?e[t].push(s):e[t]=[s]:e[t]=e[t]?e[t]+", "+s:s)}),e};var Ds=Symbol("internals");function Me(a){return a&&String(a).trim().toLowerCase()}function ot(a){return a===!1||a==null?a:u.isArray(a)?a.map(ot):String(a)}function lo(a){let e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,s;for(;s=t.exec(a);)e[s[1]]=s[2];return e}function uo(a){return/^[-_a-zA-Z]+$/.test(a.trim())}function Vs(a,e,t,s){if(u.isFunction(s))return s.call(this,e,t);if(u.isString(e)){if(u.isString(s))return e.indexOf(s)!==-1;if(u.isRegExp(s))return s.test(e)}}function mo(a){return a.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,s)=>t.toUpperCase()+s)}function fo(a,e){let t=u.toCamelCase(" "+e);["get","set","has"].forEach(s=>{Object.defineProperty(a,s+t,{value:function(i,n,o){return this[s].call(this,e,i,n,o)},configurable:!0})})}var Pe=class{constructor(e){e&&this.set(e)}set(e,t,s){let i=this;function n(r,p,c){let l=Me(p);if(!l)throw new Error("header name must be a non-empty string");let d=u.findKey(i,l);(!d||i[d]===void 0||c===!0||c===void 0&&i[d]!==!1)&&(i[d||p]=ot(r))}let o=(r,p)=>u.forEach(r,(c,l)=>n(c,l,p));return u.isPlainObject(e)||e instanceof this.constructor?o(e,t):u.isString(e)&&(e=e.trim())&&!uo(e)?o(Ss(e),t):e!=null&&n(t,e,s),this}get(e,t){if(e=Me(e),e){let s=u.findKey(this,e);if(s){let i=this[s];if(!t)return i;if(t===!0)return lo(i);if(u.isFunction(t))return t.call(this,i,s);if(u.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Me(e),e){let s=u.findKey(this,e);return!!(s&&(!t||Vs(this,this[s],s,t)))}return!1}delete(e,t){let s=this,i=!1;function n(o){if(o=Me(o),o){let r=u.findKey(s,o);r&&(!t||Vs(s,s[r],r,t))&&(delete s[r],i=!0)}}return u.isArray(e)?e.forEach(n):n(e),i}clear(){return Object.keys(this).forEach(this.delete.bind(this))}normalize(e){let t=this,s={};return u.forEach(this,(i,n)=>{let o=u.findKey(s,n);if(o){t[o]=ot(i),delete t[n];return}let r=e?mo(n):String(n).trim();r!==n&&delete t[n],t[r]=ot(i),s[r]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return u.forEach(this,(s,i)=>{s!=null&&s!==!1&&(t[i]=e&&u.isArray(s)?s.join(", "):s)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
8
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let s=new this(e);return t.forEach(i=>s.set(i)),s}static accessor(e){let s=(this[Ds]=this[Ds]={accessors:{}}).accessors,i=this.prototype;function n(o){let r=Me(o);s[r]||(fo(i,o),s[r]=!0)}return u.isArray(e)?e.forEach(n):n(e),this}};Pe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]);u.freezeMethods(Pe.prototype);u.freezeMethods(Pe);var M=Pe;function Le(a,e){let t=this||Be,s=e||t,i=M.from(s.headers),n=s.data;return u.forEach(a,function(r){n=r.call(t,n,i.normalize(),e?e.status:void 0)}),i.normalize(),n}function Fe(a){return!!(a&&a.__CANCEL__)}function _s(a,e,t){h.call(this,a??"canceled",h.ERR_CANCELED,e,t),this.name="CanceledError"}u.inherits(_s,h,{__CANCEL__:!0});var ae=_s;function ce(a,e,t){let s=t.config.validateStatus;!t.status||!s||s(t.status)?a(t):e(new h("Request failed with status code "+t.status,[h.ERR_BAD_REQUEST,h.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function ra(a){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a)}function ca(a,e){return e?a.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):a}function fe(a,e){return a&&!ra(e)?ca(a,e):e}var mn=K(Ms(),1),fn=K(require("http"),1),xn=K(require("https"),1),hn=K(cn(),1),le=K(require("zlib"),1);var Ie="1.2.5";function ze(a){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(a);return e&&e[1]||""}var Yo=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function va(a,e,t){let s=t&&t.Blob||j.classes.Blob,i=ze(a);if(e===void 0&&s&&(e=!0),i==="data"){a=i.length?a.slice(i.length+1):a;let n=Yo.exec(a);if(!n)throw new h("Invalid URL",h.ERR_INVALID_URL);let o=n[1],r=n[2],p=n[3],c=Buffer.from(decodeURIComponent(p),r?"base64":"utf8");if(e){if(!s)throw new h("Blob is not supported",h.ERR_NOT_SUPPORT);return new s([c],{type:o})}return c}throw new h("Unsupported protocol "+i,h.ERR_NOT_SUPPORT)}var Te=K(require("stream"),1);var ln=K(require("stream"),1);function Xo(a,e){let t=0,s=1e3/e,i=null;return function(o,r){let p=Date.now();if(o||p-t>s)return i&&(clearTimeout(i),i=null),t=p,a.apply(null,r);i||(i=setTimeout(()=>(i=null,t=Date.now(),a.apply(null,r)),s-(p-t)))}}var pn=Xo;function Zo(a,e){a=a||10;let t=new Array(a),s=new Array(a),i=0,n=0,o;return e=e!==void 0?e:1e3,function(p){let c=Date.now(),l=s[n];o||(o=c),t[i]=p,s[i]=c;let d=n,f=0;for(;d!==i;)f+=t[d++],d=d%a;if(i=(i+1)%a,i===n&&(n=(n+1)%a),c-o<e)return;let P=l&&c-l;return P?Math.round(f*1e3/P):void 0}}var ut=Zo;var dt=Symbol("internals"),ba=class extends ln.default.Transform{constructor(e){e=u.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(r,p)=>!u.isUndefined(p[r])),super({readableHighWaterMark:e.chunkSize});let t=this,s=this[dt]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},i=ut(s.ticksRate*e.samplesCount,s.timeWindow);this.on("newListener",r=>{r==="progress"&&(s.isCaptured||(s.isCaptured=!0))});let n=0;s.updateProgress=pn(function(){let p=s.length,c=s.bytesSeen,l=c-n;if(!l||t.destroyed)return;let d=i(l);n=c,process.nextTick(()=>{t.emit("progress",{loaded:c,total:p,progress:p?c/p:void 0,bytes:l,rate:d||void 0,estimated:d&&p&&c<=p?(p-c)/d:void 0})})},s.ticksRate);let o=()=>{s.updateProgress(!0)};this.once("end",o),this.once("error",o)}_read(e){let t=this[dt];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,s){let i=this,n=this[dt],o=n.maxRate,r=this.readableHighWaterMark,p=n.timeWindow,c=1e3/p,l=o/c,d=n.minChunkSize!==!1?Math.max(n.minChunkSize,l*.01):0;function f(m,v){let E=Buffer.byteLength(m);n.bytesSeen+=E,n.bytes+=E,n.isCaptured&&n.updateProgress(),i.push(m)?process.nextTick(v):n.onReadCallback=()=>{n.onReadCallback=null,process.nextTick(v)}}let P=(m,v)=>{let E=Buffer.byteLength(m),k=null,O=r,W,D=0;if(o){let se=Date.now();(!n.ts||(D=se-n.ts)>=p)&&(n.ts=se,W=l-n.bytes,n.bytes=W<0?-W:0,D=0),W=l-n.bytes}if(o){if(W<=0)return setTimeout(()=>{v(null,m)},p-D);W<O&&(O=W)}O&&E>O&&E-O>d&&(k=m.subarray(O),m=m.subarray(0,O)),f(m,k?()=>{process.nextTick(v,null,k)}:v)};P(e,function m(v,E){if(v)return s(v);E?P(E,m):s(null)})}setLength(e){return this[dt].length=+e,this}},ya=ba;var gn=K(require("events"),1),er={flush:le.default.constants.Z_SYNC_FLUSH,finishFlush:le.default.constants.Z_SYNC_FLUSH},tr={flush:le.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:le.default.constants.BROTLI_OPERATION_FLUSH},un=u.isFunction(le.default.createBrotliDecompress),{http:ar,https:sr}=hn.default,nr=/https:?/,dn=j.protocols.map(a=>a+":");function ir(a){a.beforeRedirects.proxy&&a.beforeRedirects.proxy(a),a.beforeRedirects.config&&a.beforeRedirects.config(a)}function vn(a,e,t){let s=e;if(!s&&s!==!1){let i=(0,mn.getProxyForUrl)(t);i&&(s=new URL(i))}if(s){if(s.username&&(s.auth=(s.username||"")+":"+(s.password||"")),s.auth){(s.auth.username||s.auth.password)&&(s.auth=(s.auth.username||"")+":"+(s.auth.password||""));let n=Buffer.from(s.auth,"utf8").toString("base64");a.headers["Proxy-Authorization"]="Basic "+n}a.headers.host=a.hostname+(a.port?":"+a.port:"");let i=s.hostname||s.host;a.hostname=i,a.host=i,a.port=s.port,a.path=t,s.protocol&&(a.protocol=s.protocol.includes(":")?s.protocol:`${s.protocol}:`)}a.beforeRedirects.proxy=function(n){vn(n,e,n.href)}}var or=typeof process<"u"&&u.kindOf(process)==="process",bn=or&&function(e){return new Promise(function(s,i){let n=e.data,o=e.responseType,r=e.responseEncoding,p=e.method.toUpperCase(),c,l,d=!1,f,P=new gn.default;function m(){c||(c=!0,e.cancelToken&&e.cancelToken.unsubscribe(O),e.signal&&e.signal.removeEventListener("abort",O),P.removeAllListeners())}function v(U,q){l||(l=!0,q&&(d=!0,m()),q?i(U):s(U))}let E=function(q){v(q)},k=function(q){v(q,!0)};function O(U){P.emit("abort",!U||U.type?new ae(null,e,f):U)}P.once("abort",k),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(O),e.signal&&(e.signal.aborted?O():e.signal.addEventListener("abort",O)));let W=fe(e.baseURL,e.url),D=new URL(W),se=D.protocol||dn[0];if(se==="data:"){let U;if(p!=="GET")return ce(E,k,{status:405,statusText:"method not allowed",headers:{},config:e});try{U=va(e.url,o==="blob",{Blob:e.env&&e.env.Blob})}catch(q){throw h.from(q,h.ERR_BAD_REQUEST,e)}return o==="text"?(U=U.toString(r),(!r||r==="utf8")&&(n=u.stripBOM(U))):o==="stream"&&(U=Te.default.Readable.from(U)),ce(E,k,{data:U,status:200,statusText:"OK",headers:new M,config:e})}if(dn.indexOf(se)===-1)return k(new h("Unsupported protocol "+se,h.ERR_BAD_REQUEST,e));let Z=M.from(e.headers).normalize();Z.set("User-Agent","axios/"+Ie,!1);let Se=e.onDownloadProgress,be=e.onUploadProgress,ye=e.maxRate,Je,jt;if(u.isFormData(n)&&u.isFunction(n.getHeaders))Z.set(n.getHeaders());else if(n&&!u.isStream(n)){if(!Buffer.isBuffer(n))if(u.isArrayBuffer(n))n=Buffer.from(new Uint8Array(n));else if(u.isString(n))n=Buffer.from(n,"utf-8");else return k(new h("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",h.ERR_BAD_REQUEST,e));if(Z.set("Content-Length",n.length,!1),e.maxBodyLength>-1&&n.length>e.maxBodyLength)return k(new h("Request body larger than maxBodyLength limit",h.ERR_BAD_REQUEST,e))}let Sn=u.toFiniteNumber(Z.getContentLength());u.isArray(ye)?(Je=ye[0],jt=ye[1]):Je=jt=ye,n&&(be||Je)&&(u.isStream(n)||(n=Te.default.Readable.from(n,{objectMode:!1})),n=Te.default.pipeline([n,new ya({length:Sn,maxRate:u.toFiniteNumber(Je)})],u.noop),be&&n.on("progress",U=>{be(Object.assign(U,{upload:!0}))}));let De;if(e.auth){let U=e.auth.username||"",q=e.auth.password||"";De=U+":"+q}if(!De&&D.username){let U=D.username,q=D.password;De=U+":"+q}De&&Z.delete("authorization");let Ea;try{Ea=me(D.pathname+D.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(U){let q=new Error(U.message);return q.config=e,q.url=e.url,q.exists=!0,k(q)}Z.set("Accept-Encoding","gzip, compress, deflate"+(un?", br":""),!1);let H={path:Ea,method:p,headers:Z.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:De,protocol:se,beforeRedirect:ir,beforeRedirects:{}};e.socketPath?H.socketPath=e.socketPath:(H.hostname=D.hostname,H.port=D.port,vn(H,e.proxy,se+"//"+D.hostname+(D.port?":"+D.port:"")+H.path));let Ke,Mt=nr.test(H.protocol);if(H.agent=Mt?e.httpsAgent:e.httpAgent,e.transport?Ke=e.transport:e.maxRedirects===0?Ke=Mt?xn.default:fn.default:(e.maxRedirects&&(H.maxRedirects=e.maxRedirects),e.beforeRedirect&&(H.beforeRedirects.config=e.beforeRedirect),Ke=Mt?sr:ar),e.maxBodyLength>-1?H.maxBodyLength=e.maxBodyLength:H.maxBodyLength=1/0,e.insecureHTTPParser&&(H.insecureHTTPParser=e.insecureHTTPParser),f=Ke.request(H,function(q){if(f.destroyed)return;let ee=[q],Lt=+q.headers["content-length"];if(Se){let ne=new ya({length:u.toFiniteNumber(Lt),maxRate:u.toFiniteNumber(jt)});Se&&ne.on("progress",Xe=>{Se(Object.assign(Xe,{download:!0}))}),ee.push(ne)}let J=q,Ye=q.req||f;if(e.decompress!==!1&&q.headers["content-encoding"])switch((p==="HEAD"||q.statusCode===204)&&delete q.headers["content-encoding"],q.headers["content-encoding"]){case"gzip":case"x-gzip":case"compress":case"x-compress":case"deflate":ee.push(le.default.createUnzip(er)),delete q.headers["content-encoding"];break;case"br":un&&(ee.push(le.default.createBrotliDecompress(tr)),delete q.headers["content-encoding"])}J=ee.length>1?Te.default.pipeline(ee,u.noop):ee[0];let Dn=Te.default.finished(J,()=>{Dn(),m()}),Re={status:q.statusCode,statusText:q.statusMessage,headers:new M(q.headers),config:e,request:Ye};if(o==="stream")Re.data=J,ce(E,k,Re);else{let ne=[],Xe=0;J.on("data",function(G){ne.push(G),Xe+=G.length,e.maxContentLength>-1&&Xe>e.maxContentLength&&(d=!0,J.destroy(),k(new h("maxContentLength size of "+e.maxContentLength+" exceeded",h.ERR_BAD_RESPONSE,e,Ye)))}),J.on("aborted",function(){if(d)return;let G=new h("maxContentLength size of "+e.maxContentLength+" exceeded",h.ERR_BAD_RESPONSE,e,Ye);J.destroy(G),k(G)}),J.on("error",function(G){f.destroyed||k(h.from(G,null,e,Ye))}),J.on("end",function(){try{let G=ne.length===1?ne[0]:Buffer.concat(ne);o!=="arraybuffer"&&(G=G.toString(r),(!r||r==="utf8")&&(G=u.stripBOM(G))),Re.data=G}catch(G){k(h.from(G,null,e,Re.request,Re))}ce(E,k,Re)})}P.once("abort",ne=>{J.destroyed||(J.emit("error",ne),J.destroy())})}),P.once("abort",U=>{k(U),f.destroy(U)}),f.on("error",function(q){k(h.from(q,null,e,f))}),f.on("socket",function(q){q.setKeepAlive(!0,1e3*60)}),e.timeout){let U=parseInt(e.timeout,10);if(isNaN(U)){k(new h("error trying to parse `config.timeout` to int",h.ERR_BAD_OPTION_VALUE,e,f));return}f.setTimeout(U,function(){if(l)return;let ee=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",Lt=e.transitional||we;e.timeoutErrorMessage&&(ee=e.timeoutErrorMessage),k(new h(ee,Lt.clarifyTimeoutError?h.ETIMEDOUT:h.ECONNABORTED,e,f)),O()})}if(u.isStream(n)){let U=!1,q=!1;n.on("end",()=>{U=!0}),n.once("error",ee=>{q=!0,f.destroy(ee)}),n.on("close",()=>{!U&&!q&&O(new ae("Request stream has been aborted",e,f))}),n.pipe(f)}else f.end(n)})};var yn=j.isStandardBrowserEnv?function(){return{write:function(t,s,i,n,o,r){let p=[];p.push(t+"="+encodeURIComponent(s)),u.isNumber(i)&&p.push("expires="+new Date(i).toGMTString()),u.isString(n)&&p.push("path="+n),u.isString(o)&&p.push("domain="+o),r===!0&&p.push("secure"),document.cookie=p.join("; ")},read:function(t){let s=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();var Rn=j.isStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),s;function i(n){let o=n;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return s=i(window.location.href),function(o){let r=u.isString(o)?i(o):o;return r.protocol===s.protocol&&r.host===s.host}}():function(){return function(){return!0}}();function An(a,e){let t=0,s=ut(50,250);return i=>{let n=i.loaded,o=i.lengthComputable?i.total:void 0,r=n-t,p=s(r),c=n<=o;t=n;let l={loaded:n,total:o,progress:o?n/o:void 0,bytes:r,rate:p||void 0,estimated:p&&o&&c?(o-n)/p:void 0,event:i};l[e?"download":"upload"]=!0,a(l)}}var rr=typeof XMLHttpRequest<"u",Cn=rr&&function(a){return new Promise(function(t,s){let i=a.data,n=M.from(a.headers).normalize(),o=a.responseType,r;function p(){a.cancelToken&&a.cancelToken.unsubscribe(r),a.signal&&a.signal.removeEventListener("abort",r)}u.isFormData(i)&&(j.isStandardBrowserEnv||j.isStandardBrowserWebWorkerEnv)&&n.setContentType(!1);let c=new XMLHttpRequest;if(a.auth){let P=a.auth.username||"",m=a.auth.password?unescape(encodeURIComponent(a.auth.password)):"";n.set("Authorization","Basic "+btoa(P+":"+m))}let l=fe(a.baseURL,a.url);c.open(a.method.toUpperCase(),me(l,a.params,a.paramsSerializer),!0),c.timeout=a.timeout;function d(){if(!c)return;let P=M.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),v={data:!o||o==="text"||o==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:P,config:a,request:c};ce(function(k){t(k),p()},function(k){s(k),p()},v),c=null}if("onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(d)},c.onabort=function(){c&&(s(new h("Request aborted",h.ECONNABORTED,a,c)),c=null)},c.onerror=function(){s(new h("Network Error",h.ERR_NETWORK,a,c)),c=null},c.ontimeout=function(){let m=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded",v=a.transitional||we;a.timeoutErrorMessage&&(m=a.timeoutErrorMessage),s(new h(m,v.clarifyTimeoutError?h.ETIMEDOUT:h.ECONNABORTED,a,c)),c=null},j.isStandardBrowserEnv){let P=(a.withCredentials||Rn(l))&&a.xsrfCookieName&&yn.read(a.xsrfCookieName);P&&n.set(a.xsrfHeaderName,P)}i===void 0&&n.setContentType(null),"setRequestHeader"in c&&u.forEach(n.toJSON(),function(m,v){c.setRequestHeader(v,m)}),u.isUndefined(a.withCredentials)||(c.withCredentials=!!a.withCredentials),o&&o!=="json"&&(c.responseType=a.responseType),typeof a.onDownloadProgress=="function"&&c.addEventListener("progress",An(a.onDownloadProgress,!0)),typeof a.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",An(a.onUploadProgress)),(a.cancelToken||a.signal)&&(r=P=>{c&&(s(!P||P.type?new ae(null,a,c):P),c.abort(),c=null)},a.cancelToken&&a.cancelToken.subscribe(r),a.signal&&(a.signal.aborted?r():a.signal.addEventListener("abort",r)));let f=ze(l);if(f&&j.protocols.indexOf(f)===-1){s(new h("Unsupported protocol "+f+":",h.ERR_BAD_REQUEST,a));return}c.send(i||null)})};var mt={http:bn,xhr:Cn};u.forEach(mt,(a,e)=>{if(a){try{Object.defineProperty(a,"name",{value:e})}catch{}Object.defineProperty(a,"adapterName",{value:e})}});var wn={getAdapter:a=>{a=u.isArray(a)?a:[a];let{length:e}=a,t,s;for(let i=0;i<e&&(t=a[i],!(s=u.isString(t)?mt[t.toLowerCase()]:t));i++);if(!s)throw s===!1?new h(`Adapter ${t} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(u.hasOwnProp(mt,t)?`Adapter '${t}' is not available in the build`:`Unknown adapter '${t}'`);if(!u.isFunction(s))throw new TypeError("adapter is not a function");return s},adapters:mt};function Ra(a){if(a.cancelToken&&a.cancelToken.throwIfRequested(),a.signal&&a.signal.aborted)throw new ae(null,a)}function ft(a){return Ra(a),a.headers=M.from(a.headers),a.data=Le.call(a,a.transformRequest),["post","put","patch"].indexOf(a.method)!==-1&&a.headers.setContentType("application/x-www-form-urlencoded",!1),wn.getAdapter(a.adapter||Be.adapter)(a).then(function(s){return Ra(a),s.data=Le.call(a,a.transformResponse,s),s.headers=M.from(s.headers),s},function(s){return Fe(s)||(Ra(a),s&&s.response&&(s.response.data=Le.call(a,a.transformResponse,s.response),s.response.headers=M.from(s.response.headers))),Promise.reject(s)})}var Bn=a=>a instanceof M?a.toJSON():a;function oe(a,e){e=e||{};let t={};function s(c,l,d){return u.isPlainObject(c)&&u.isPlainObject(l)?u.merge.call({caseless:d},c,l):u.isPlainObject(l)?u.merge({},l):u.isArray(l)?l.slice():l}function i(c,l,d){if(u.isUndefined(l)){if(!u.isUndefined(c))return s(void 0,c,d)}else return s(c,l,d)}function n(c,l){if(!u.isUndefined(l))return s(void 0,l)}function o(c,l){if(u.isUndefined(l)){if(!u.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function r(c,l,d){if(d in e)return s(c,l);if(d in a)return s(void 0,c)}let p={url:n,method:n,data:n,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:r,headers:(c,l)=>i(Bn(c),Bn(l),!0)};return u.forEach(Object.keys(a).concat(Object.keys(e)),function(l){let d=p[l]||i,f=d(a[l],e[l],l);u.isUndefined(f)&&d!==r||(t[l]=f)}),t}var Aa={};["object","boolean","number","function","string","symbol"].forEach((a,e)=>{Aa[a]=function(s){return typeof s===a||"a"+(e<1?"n ":" ")+a}});var Pn={};Aa.transitional=function(e,t,s){function i(n,o){return"[Axios v"+Ie+"] Transitional option '"+n+"'"+o+(s?". "+s:"")}return(n,o,r)=>{if(e===!1)throw new h(i(o," has been removed"+(t?" in "+t:"")),h.ERR_DEPRECATED);return t&&!Pn[o]&&(Pn[o]=!0,console.warn(i(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(n,o,r):!0}};function cr(a,e,t){if(typeof a!="object")throw new h("options must be an object",h.ERR_BAD_OPTION_VALUE);let s=Object.keys(a),i=s.length;for(;i-- >0;){let n=s[i],o=e[n];if(o){let r=a[n],p=r===void 0||o(r,n,a);if(p!==!0)throw new h("option "+n+" must be "+p,h.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new h("Unknown option "+n,h.ERR_BAD_OPTION)}}var xt={assertOptions:cr,validators:Aa};var ue=xt.validators,Oe=class{constructor(e){this.defaults=e,this.interceptors={request:new ia,response:new ia}}request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=oe(this.defaults,t);let{transitional:s,paramsSerializer:i,headers:n}=t;s!==void 0&&xt.assertOptions(s,{silentJSONParsing:ue.transitional(ue.boolean),forcedJSONParsing:ue.transitional(ue.boolean),clarifyTimeoutError:ue.transitional(ue.boolean)},!1),i!==void 0&&xt.assertOptions(i,{encode:ue.function,serialize:ue.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o;o=n&&u.merge(n.common,n[t.method]),o&&u.forEach(["delete","get","head","post","put","patch","common"],m=>{delete n[m]}),t.headers=M.concat(o,n);let r=[],p=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(t)===!1||(p=p&&v.synchronous,r.unshift(v.fulfilled,v.rejected))});let c=[];this.interceptors.response.forEach(function(v){c.push(v.fulfilled,v.rejected)});let l,d=0,f;if(!p){let m=[ft.bind(this),void 0];for(m.unshift.apply(m,r),m.push.apply(m,c),f=m.length,l=Promise.resolve(t);d<f;)l=l.then(m[d++],m[d++]);return l}f=r.length;let P=t;for(d=0;d<f;){let m=r[d++],v=r[d++];try{P=m(P)}catch(E){v.call(this,E);break}}try{l=ft.call(this,P)}catch(m){return Promise.reject(m)}for(d=0,f=c.length;d<f;)l=l.then(c[d++],c[d++]);return l}getUri(e){e=oe(this.defaults,e);let t=fe(e.baseURL,e.url);return me(t,e.params,e.paramsSerializer)}};u.forEach(["delete","get","head","options"],function(e){Oe.prototype[e]=function(t,s){return this.request(oe(s||{},{method:e,url:t,data:(s||{}).data}))}});u.forEach(["post","put","patch"],function(e){function t(s){return function(n,o,r){return this.request(oe(r||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}Oe.prototype[e]=t(),Oe.prototype[e+"Form"]=t(!0)});var He=Oe;var Qe=class{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(n){t=n});let s=this;this.promise.then(i=>{if(!s._listeners)return;let n=s._listeners.length;for(;n-- >0;)s._listeners[n](i);s._listeners=null}),this.promise.then=i=>{let n,o=new Promise(r=>{s.subscribe(r),n=r}).then(i);return o.cancel=function(){s.unsubscribe(n)},o},e(function(n,o,r){s.reason||(s.reason=new ae(n,o,r),t(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new Qe(function(i){e=i}),cancel:e}}},kn=Qe;function Ca(a){return function(t){return a.apply(null,t)}}function wa(a){return u.isObject(a)&&a.isAxiosError===!0}var Ba={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ba).forEach(([a,e])=>{Ba[e]=a});var qn=Ba;function En(a){let e=new He(a),t=Ve(He.prototype.request,e);return u.extend(t,He.prototype,e,{allOwnKeys:!0}),u.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return En(oe(a,i))},t}var L=En(Be);L.Axios=He;L.CanceledError=ae;L.CancelToken=kn;L.isCancel=Fe;L.VERSION=Ie;L.toFormData=re;L.AxiosError=h;L.Cancel=L.CanceledError;L.all=function(e){return Promise.all(e)};L.spread=Ca;L.isAxiosError=wa;L.mergeConfig=oe;L.AxiosHeaders=M;L.formToJSON=a=>nt(u.isHTMLForm(a)?new FormData(a):a);L.HttpStatusCode=qn;L.default=L;var x=L;var{Axios:pr,AxiosError:lr,CanceledError:ur,isCancel:dr,CancelToken:mr,VERSION:fr,all:xr,Cancel:hr,isAxiosError:gr,spread:vr,toFormData:br,AxiosHeaders:yr,HttpStatusCode:Rr,formToJSON:Ar,mergeConfig:Cr}=x;var $e=K(Un()),In="https://api.botpress.cloud",Ur="BP_API_URL",Ir="BP_BOT_ID",Tr="BP_INTEGRATION_ID",Or="BP_WORKSPACE_ID",Sr="BP_TOKEN";function Tn(a){let e=Dr(a),t={};return e.workspaceId&&(t["x-workspace-id"]=e.workspaceId),e.botId&&(t["x-bot-id"]=e.botId),e.integrationId&&(t["x-integration-id"]=e.integrationId),e.token&&(t.Authorization=`Bearer ${e.token}`),{host:e.host??In,withCredentials:$e.isBrowser,headers:t}}function Dr(a){return $e.isBrowser?a:$e.isNode?Vr(a):a}function Vr(a){let e={...a,host:a.host??process.env[Ur]??In,botId:a.botId??process.env[Ir],integrationId:a.integrationId??process.env[Tr],workspaceId:a.workspaceId??process.env[Or]},t=e.token??process.env[Sr];return t&&(e.token=t),e}var _=class extends Error{constructor(t,s,i,n,o){super(n);this.code=t;this.description=s;this.type=i;this.message=n;this.error=o}isApiError=!0;toJSON(){return{code:this.code,type:this.type,message:this.message}}},_r=a=>typeof a=="object"&&!Array.isArray(a)&&a!==null,On=a=>a instanceof _||_r(a)&&a.isApiError===!0,X=class extends _{constructor(e,t){super(500,"An unknown error occurred","Unknown",e,t)}},ht=class extends _{constructor(e,t){super(500,"An internal error occurred","Internal",e,t)}},gt=class extends _{constructor(e,t){super(401,"The request requires to be authenticated.","Unauthorized",e,t)}},vt=class extends _{constructor(e,t){super(403,"The requested action can't be peform by this resource.","Forbidden",e,t)}},bt=class extends _{constructor(e,t){super(413,"The request payload is too large.","PayloadTooLarge",e,t)}},yt=class extends _{constructor(e,t){super(400,"The request payload is invalid.","InvalidPayload",e,t)}},Rt=class extends _{constructor(e,t){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",e,t)}},At=class extends _{constructor(e,t){super(405,"The requested method does not exist.","MethodNotFound",e,t)}},Ct=class extends _{constructor(e,t){super(404,"The requested resource does not exist.","ResourceNotFound",e,t)}},wt=class extends _{constructor(e,t){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",e,t)}},Bt=class extends _{constructor(e,t){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",e,t)}},Pt=class extends _{constructor(e,t){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",e,t)}},kt=class extends _{constructor(e,t){super(409,"The resource is not related with another resource. This is usually caused when providing two resources that aren't linked together.","RelationConflict",e,t)}},qt=class extends _{constructor(e,t){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",e,t)}},Et=class extends _{constructor(e,t){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",e,t)}},Ut=class extends _{constructor(e,t){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",e,t)}},It=class extends _{constructor(e,t){super(409,"The record attempted to be created already exists.","AlreadyExists",e,t)}},Tt=class extends _{constructor(e,t){super(429,"The request has been rate limited.","RateLimited",e,t)}},jr={Unknown:X,Internal:ht,Unauthorized:gt,Forbidden:vt,PayloadTooLarge:bt,InvalidPayload:yt,UnsupportedMediaType:Rt,MethodNotFound:At,ResourceNotFound:Ct,InvalidJsonSchema:wt,InvalidDataFormat:Bt,InvalidIdentifier:Pt,RelationConflict:kt,ReferenceNotFound:qt,InvalidQuery:Et,Runtime:Ut,AlreadyExists:It,RateLimited:Tt},Ot=a=>On(a)?a:a instanceof Error?new X(a.message,a):a===null?new X("An unknown error occurred"):typeof a=="string"?new X(a):typeof a!="object"?new X("An unknown error occurred"):Mr(a);function Mr(a){if("code"in a&&"type"in a&&"message"in a){if(typeof a.message!="string")return new X("An unknown error occurred");if(typeof a.type!="string")return new X(a.message);let e=jr[a.type];return e?new e(a.message):new X(a.message)}return new X("An unknown error occurred")}var g="https://api.botpress.cloud".replace(/\/+$/,"");var St=class{constructor(e,t=g,s=x){this.basePath=t;this.axios=s;e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}configuration},Dt=class extends Error{constructor(t,s){super(s);this.field=t;this.name="RequiredError"}};var b="https://example.com",B=function(a,e,t){if(t==null)throw new Dt(e,`Required parameter ${e} was null or undefined when calling ${a}.`)};function ka(a,e,t=""){e!=null&&(typeof e=="object"?Array.isArray(e)?e.forEach(s=>ka(a,s,t)):Object.keys(e).forEach(s=>ka(a,e[s],`${t}${t!==""?".":""}${s}`)):a.has(t)?a.append(t,e):a.set(t,e))}var y=function(a,...e){let t=new URLSearchParams(a.search);ka(t,e),a.search=t.toString()},S=function(a,e,t){let s=typeof a!="string";return(s&&t&&t.isJsonMime?t.isJsonMime(e.headers["Content-Type"]):s)?JSON.stringify(a!==void 0?a:{}):a||""},R=function(a){return a.pathname+a.search+a.hash},A=function(a,e,t,s){return(i=e,n=t)=>{let o={...a.options,url:(s?.basePath||n)+a.url};return i.request(o)}};var Lr=function(a){return{callAction:async(e,t={})=>{let s="/v1/chat/actions",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},configureIntegration:async(e,t={})=>{let s="/v1/chat/integrations/configure",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},createBot:async(e,t={})=>{let s="/v1/admin/bots",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},createConversation:async(e,t={})=>{let s="/v1/chat/conversations",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},createEvent:async(e,t={})=>{let s="/v1/chat/events",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},createFile:async(e,t={})=>{let s="/v1/storage/files",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},createIntegration:async(e,t={})=>{let s="/v1/admin/integrations",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},createMessage:async(e,t={})=>{let s="/v1/chat/messages",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},createUser:async(e,t={})=>{let s="/v1/chat/users",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},createWorkspaceMember:async(e,t={})=>{let s="/v1/admin/workspace-members",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},deleteBot:async(e,t={})=>{B("deleteBot","id",e);let s="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"DELETE",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},deleteConversation:async(e,t={})=>{B("deleteConversation","id",e);let s="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"DELETE",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},deleteFile:async(e,t={})=>{B("deleteFile","id",e);let s="/v1/storage/files/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"DELETE",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},deleteIntegration:async(e,t={})=>{B("deleteIntegration","id",e);let s="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"DELETE",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},deleteMessage:async(e,t={})=>{B("deleteMessage","id",e);let s="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"DELETE",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},deleteUser:async(e,t={})=>{B("deleteUser","id",e);let s="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"DELETE",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},deleteWorkspaceMember:async(e,t={})=>{B("deleteWorkspaceMember","id",e);let s="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"DELETE",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},downloadFile:async(e,t={})=>{B("downloadFile","id",e);let s="/v1/storage/files/{id}/download".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getBot:async(e,t={})=>{B("getBot","id",e);let s="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getBotAnalytics:async(e,t,s,i={})=>{B("getBotAnalytics","id",e),B("getBotAnalytics","startDate",t),B("getBotAnalytics","endDate",s);let n="/v1/admin/bots/{id}/analytics".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,b),r;a&&(r=a.baseOptions);let p={method:"GET",...r,...i},c={},l={};t!==void 0&&(l.startDate=t),s!==void 0&&(l.endDate=s),y(o,l);let d=r&&r.headers?r.headers:{};return p.headers={...c,...d,...i.headers},{url:R(o),options:p}},getBotLogs:async(e,t={})=>{B("getBotLogs","id",e);let s="/v1/admin/bots/{id}/logs".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getBotWebchat:async(e,t,s={})=>{B("getBotWebchat","id",e),B("getBotWebchat","type",t);let i="/v1/admin/bots/{id}/webchat".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"GET",...o,...s},p={},c={};t!==void 0&&(c.type=t),y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},{url:R(n),options:r}},getConversation:async(e,t={})=>{B("getConversation","id",e);let s="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getEvent:async(e,t={})=>{B("getEvent","id",e);let s="/v1/chat/events/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getFile:async(e,t={})=>{B("getFile","id",e);let s="/v1/storage/files/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getIntegration:async(e,t={})=>{B("getIntegration","id",e);let s="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getIntegrationByName:async(e,t,s={})=>{B("getIntegrationByName","name",e),B("getIntegrationByName","version",t);let i="/v1/admin/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(e))).replace("{version}",encodeURIComponent(String(t))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"GET",...o,...s},p={};y(n,{});let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},{url:R(n),options:r}},getIntegrationLogs:async(e,t={})=>{B("getIntegrationLogs","id",e);let s="/v1/admin/integrations/{id}/logs".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getMessage:async(e,t={})=>{B("getMessage","id",e);let s="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getOrCreateConversation:async(e,t={})=>{let s="/v1/chat/conversations/get-or-create",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},getOrCreateMessage:async(e,t={})=>{let s="/v1/chat/messages/get-or-create",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},getOrCreateUser:async(e,t={})=>{let s="/v1/chat/users/get-or-create",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},getPublicIntegration:async(e,t,s={})=>{B("getPublicIntegration","name",e),B("getPublicIntegration","version",t);let i="/v1/admin/hub/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(e))).replace("{version}",encodeURIComponent(String(t))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"GET",...o,...s},p={};y(n,{});let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},{url:R(n),options:r}},getPublicIntegrationById:async(e,t={})=>{B("getPublicIntegrationById","id",e);let s="/v1/admin/hub/integrations/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getState:async(e,t,s,i={})=>{B("getState","type",e),B("getState","id",t),B("getState","name",s);let n="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(e))).replace("{id}",encodeURIComponent(String(t))).replace("{name}",encodeURIComponent(String(s))),o=new URL(n,b),r;a&&(r=a.baseOptions);let p={method:"GET",...r,...i},c={};y(o,{});let d=r&&r.headers?r.headers:{};return p.headers={...c,...d,...i.headers},{url:R(o),options:p}},getUser:async(e,t={})=>{B("getUser","id",e);let s="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getWorkspace:async(e,t={})=>{B("getWorkspace","id",e);let s="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},introspect:async(e,t={})=>{let s="/v1/admin/introspect",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},listBots:async(e,t={})=>{let s="/v1/admin/bots",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={},p={};e!==void 0&&(p.nextToken=e),y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},listConversations:async(e,t,s,i={})=>{let n="/v1/chat/conversations",o=new URL(n,b),r;a&&(r=a.baseOptions);let p={method:"GET",...r,...i},c={},l={};e!==void 0&&(l.nextToken=e),t!==void 0&&(l.tags=t),s&&(l.participantIds=s),y(o,l);let d=r&&r.headers?r.headers:{};return p.headers={...c,...d,...i.headers},{url:R(o),options:p}},listEvents:async(e,t,s={})=>{let i="/v1/chat/events",n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"GET",...o,...s},p={},c={};e!==void 0&&(c.nextToken=e),t!==void 0&&(c.type=t),y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},{url:R(n),options:r}},listFiles:async(e,t,s={})=>{B("listFiles","botId",e);let i="/v1/storage/files",n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"GET",...o,...s},p={},c={};t!==void 0&&(c.nextToken=t),e!==void 0&&(c.botId=e),y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},{url:R(n),options:r}},listIntegrations:async(e,t,s,i={})=>{let n="/v1/admin/integrations",o=new URL(n,b),r;a&&(r=a.baseOptions);let p={method:"GET",...r,...i},c={},l={};e!==void 0&&(l.nextToken=e),t!==void 0&&(l.name=t),s!==void 0&&(l.version=s),y(o,l);let d=r&&r.headers?r.headers:{};return p.headers={...c,...d,...i.headers},{url:R(o),options:p}},listMessages:async(e,t,s,i={})=>{let n="/v1/chat/messages",o=new URL(n,b),r;a&&(r=a.baseOptions);let p={method:"GET",...r,...i},c={},l={};e!==void 0&&(l.nextToken=e),t!==void 0&&(l.conversationId=t),s!==void 0&&(l.tags=s),y(o,l);let d=r&&r.headers?r.headers:{};return p.headers={...c,...d,...i.headers},{url:R(o),options:p}},listPublicIntegrations:async(e,t,s,i={})=>{let n="/v1/admin/hub/integrations",o=new URL(n,b),r;a&&(r=a.baseOptions);let p={method:"GET",...r,...i},c={},l={};e!==void 0&&(l.nextToken=e),t!==void 0&&(l.name=t),s!==void 0&&(l.version=s),y(o,l);let d=r&&r.headers?r.headers:{};return p.headers={...c,...d,...i.headers},{url:R(o),options:p}},listUsers:async(e,t,s,i={})=>{let n="/v1/chat/users",o=new URL(n,b),r;a&&(r=a.baseOptions);let p={method:"GET",...r,...i},c={},l={};e!==void 0&&(l.nextToken=e),t!==void 0&&(l.conversationId=t),s!==void 0&&(l.tags=s),y(o,l);let d=r&&r.headers?r.headers:{};return p.headers={...c,...d,...i.headers},{url:R(o),options:p}},listWorkspaceMembers:async(e,t={})=>{let s="/v1/admin/workspace-members",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={},p={};e!==void 0&&(p.nextToken=e),y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},listWorkspaces:async(e,t={})=>{let s="/v1/admin/workspaces",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={},p={};e!==void 0&&(p.nextToken=e),y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},patchState:async(e,t,s,i,n={})=>{B("patchState","type",e),B("patchState","id",t),B("patchState","name",s);let o="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(e))).replace("{id}",encodeURIComponent(String(t))).replace("{name}",encodeURIComponent(String(s))),r=new URL(o,b),p;a&&(p=a.baseOptions);let c={method:"PATCH",...p,...n},l={},d={};l["Content-Type"]="application/json",y(r,d);let f=p&&p.headers?p.headers:{};return c.headers={...l,...f,...n.headers},c.data=S(i,c,a),{url:R(r),options:c}},setState:async(e,t,s,i,n={})=>{B("setState","type",e),B("setState","id",t),B("setState","name",s);let o="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(e))).replace("{id}",encodeURIComponent(String(t))).replace("{name}",encodeURIComponent(String(s))),r=new URL(o,b),p;a&&(p=a.baseOptions);let c={method:"POST",...p,...n},l={},d={};l["Content-Type"]="application/json",y(r,d);let f=p&&p.headers?p.headers:{};return c.headers={...l,...f,...n.headers},c.data=S(i,c,a),{url:R(r),options:c}},transferBot:async(e,t,s={})=>{B("transferBot","id",e);let i="/v1/admin/bots/{id}/transfer".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"POST",...o,...s},p={},c={};p["Content-Type"]="application/json",y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},r.data=S(t,r,a),{url:R(n),options:r}},updateBot:async(e,t,s={})=>{B("updateBot","id",e);let i="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"PUT",...o,...s},p={},c={};p["Content-Type"]="application/json",y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},r.data=S(t,r,a),{url:R(n),options:r}},updateConversation:async(e,t,s={})=>{B("updateConversation","id",e);let i="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"PUT",...o,...s},p={},c={};p["Content-Type"]="application/json",y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},r.data=S(t,r,a),{url:R(n),options:r}},updateIntegration:async(e,t,s={})=>{B("updateIntegration","id",e);let i="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"PUT",...o,...s},p={},c={};p["Content-Type"]="application/json",y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},r.data=S(t,r,a),{url:R(n),options:r}},updateMessage:async(e,t,s={})=>{B("updateMessage","id",e);let i="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"PUT",...o,...s},p={},c={};p["Content-Type"]="application/json",y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},r.data=S(t,r,a),{url:R(n),options:r}},updateUser:async(e,t,s={})=>{B("updateUser","id",e);let i="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"PUT",...o,...s},p={},c={};p["Content-Type"]="application/json",y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},r.data=S(t,r,a),{url:R(n),options:r}},updateWorkspace:async(e,t,s={})=>{B("updateWorkspace","id",e);let i="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"PUT",...o,...s},p={},c={};p["Content-Type"]="application/json",y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},r.data=S(t,r,a),{url:R(n),options:r}},updateWorkspaceMember:async(e,t,s={})=>{B("updateWorkspaceMember","id",e);let i="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"PUT",...o,...s},p={},c={};p["Content-Type"]="application/json",y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},r.data=S(t,r,a),{url:R(n),options:r}}}},C=function(a){let e=Lr(a);return{async callAction(t,s){let i=await e.callAction(t,s);return A(i,x,g,a)},async configureIntegration(t,s){let i=await e.configureIntegration(t,s);return A(i,x,g,a)},async createBot(t,s){let i=await e.createBot(t,s);return A(i,x,g,a)},async createConversation(t,s){let i=await e.createConversation(t,s);return A(i,x,g,a)},async createEvent(t,s){let i=await e.createEvent(t,s);return A(i,x,g,a)},async createFile(t,s){let i=await e.createFile(t,s);return A(i,x,g,a)},async createIntegration(t,s){let i=await e.createIntegration(t,s);return A(i,x,g,a)},async createMessage(t,s){let i=await e.createMessage(t,s);return A(i,x,g,a)},async createUser(t,s){let i=await e.createUser(t,s);return A(i,x,g,a)},async createWorkspaceMember(t,s){let i=await e.createWorkspaceMember(t,s);return A(i,x,g,a)},async deleteBot(t,s){let i=await e.deleteBot(t,s);return A(i,x,g,a)},async deleteConversation(t,s){let i=await e.deleteConversation(t,s);return A(i,x,g,a)},async deleteFile(t,s){let i=await e.deleteFile(t,s);return A(i,x,g,a)},async deleteIntegration(t,s){let i=await e.deleteIntegration(t,s);return A(i,x,g,a)},async deleteMessage(t,s){let i=await e.deleteMessage(t,s);return A(i,x,g,a)},async deleteUser(t,s){let i=await e.deleteUser(t,s);return A(i,x,g,a)},async deleteWorkspaceMember(t,s){let i=await e.deleteWorkspaceMember(t,s);return A(i,x,g,a)},async downloadFile(t,s){let i=await e.downloadFile(t,s);return A(i,x,g,a)},async getBot(t,s){let i=await e.getBot(t,s);return A(i,x,g,a)},async getBotAnalytics(t,s,i,n){let o=await e.getBotAnalytics(t,s,i,n);return A(o,x,g,a)},async getBotLogs(t,s){let i=await e.getBotLogs(t,s);return A(i,x,g,a)},async getBotWebchat(t,s,i){let n=await e.getBotWebchat(t,s,i);return A(n,x,g,a)},async getConversation(t,s){let i=await e.getConversation(t,s);return A(i,x,g,a)},async getEvent(t,s){let i=await e.getEvent(t,s);return A(i,x,g,a)},async getFile(t,s){let i=await e.getFile(t,s);return A(i,x,g,a)},async getIntegration(t,s){let i=await e.getIntegration(t,s);return A(i,x,g,a)},async getIntegrationByName(t,s,i){let n=await e.getIntegrationByName(t,s,i);return A(n,x,g,a)},async getIntegrationLogs(t,s){let i=await e.getIntegrationLogs(t,s);return A(i,x,g,a)},async getMessage(t,s){let i=await e.getMessage(t,s);return A(i,x,g,a)},async getOrCreateConversation(t,s){let i=await e.getOrCreateConversation(t,s);return A(i,x,g,a)},async getOrCreateMessage(t,s){let i=await e.getOrCreateMessage(t,s);return A(i,x,g,a)},async getOrCreateUser(t,s){let i=await e.getOrCreateUser(t,s);return A(i,x,g,a)},async getPublicIntegration(t,s,i){let n=await e.getPublicIntegration(t,s,i);return A(n,x,g,a)},async getPublicIntegrationById(t,s){let i=await e.getPublicIntegrationById(t,s);return A(i,x,g,a)},async getState(t,s,i,n){let o=await e.getState(t,s,i,n);return A(o,x,g,a)},async getUser(t,s){let i=await e.getUser(t,s);return A(i,x,g,a)},async getWorkspace(t,s){let i=await e.getWorkspace(t,s);return A(i,x,g,a)},async introspect(t,s){let i=await e.introspect(t,s);return A(i,x,g,a)},async listBots(t,s){let i=await e.listBots(t,s);return A(i,x,g,a)},async listConversations(t,s,i,n){let o=await e.listConversations(t,s,i,n);return A(o,x,g,a)},async listEvents(t,s,i){let n=await e.listEvents(t,s,i);return A(n,x,g,a)},async listFiles(t,s,i){let n=await e.listFiles(t,s,i);return A(n,x,g,a)},async listIntegrations(t,s,i,n){let o=await e.listIntegrations(t,s,i,n);return A(o,x,g,a)},async listMessages(t,s,i,n){let o=await e.listMessages(t,s,i,n);return A(o,x,g,a)},async listPublicIntegrations(t,s,i,n){let o=await e.listPublicIntegrations(t,s,i,n);return A(o,x,g,a)},async listUsers(t,s,i,n){let o=await e.listUsers(t,s,i,n);return A(o,x,g,a)},async listWorkspaceMembers(t,s){let i=await e.listWorkspaceMembers(t,s);return A(i,x,g,a)},async listWorkspaces(t,s){let i=await e.listWorkspaces(t,s);return A(i,x,g,a)},async patchState(t,s,i,n,o){let r=await e.patchState(t,s,i,n,o);return A(r,x,g,a)},async setState(t,s,i,n,o){let r=await e.setState(t,s,i,n,o);return A(r,x,g,a)},async transferBot(t,s,i){let n=await e.transferBot(t,s,i);return A(n,x,g,a)},async updateBot(t,s,i){let n=await e.updateBot(t,s,i);return A(n,x,g,a)},async updateConversation(t,s,i){let n=await e.updateConversation(t,s,i);return A(n,x,g,a)},async updateIntegration(t,s,i){let n=await e.updateIntegration(t,s,i);return A(n,x,g,a)},async updateMessage(t,s,i){let n=await e.updateMessage(t,s,i);return A(n,x,g,a)},async updateUser(t,s,i){let n=await e.updateUser(t,s,i);return A(n,x,g,a)},async updateWorkspace(t,s,i){let n=await e.updateWorkspace(t,s,i);return A(n,x,g,a)},async updateWorkspaceMember(t,s,i){let n=await e.updateWorkspaceMember(t,s,i);return A(n,x,g,a)}}};var Vt=class extends St{callAction(e={},t){return C(this.configuration).callAction(e.callActionBody,t).then(s=>s(this.axios,this.basePath))}configureIntegration(e={},t){return C(this.configuration).configureIntegration(e.configureIntegrationBody,t).then(s=>s(this.axios,this.basePath))}createBot(e={},t){return C(this.configuration).createBot(e.createBotBody,t).then(s=>s(this.axios,this.basePath))}createConversation(e={},t){return C(this.configuration).createConversation(e.createConversationBody,t).then(s=>s(this.axios,this.basePath))}createEvent(e={},t){return C(this.configuration).createEvent(e.createEventBody,t).then(s=>s(this.axios,this.basePath))}createFile(e={},t){return C(this.configuration).createFile(e.createFileBody,t).then(s=>s(this.axios,this.basePath))}createIntegration(e={},t){return C(this.configuration).createIntegration(e.createIntegrationBody,t).then(s=>s(this.axios,this.basePath))}createMessage(e={},t){return C(this.configuration).createMessage(e.createMessageBody,t).then(s=>s(this.axios,this.basePath))}createUser(e={},t){return C(this.configuration).createUser(e.createUserBody,t).then(s=>s(this.axios,this.basePath))}createWorkspaceMember(e={},t){return C(this.configuration).createWorkspaceMember(e.createWorkspaceMemberBody,t).then(s=>s(this.axios,this.basePath))}deleteBot(e,t){return C(this.configuration).deleteBot(e.id,t).then(s=>s(this.axios,this.basePath))}deleteConversation(e,t){return C(this.configuration).deleteConversation(e.id,t).then(s=>s(this.axios,this.basePath))}deleteFile(e,t){return C(this.configuration).deleteFile(e.id,t).then(s=>s(this.axios,this.basePath))}deleteIntegration(e,t){return C(this.configuration).deleteIntegration(e.id,t).then(s=>s(this.axios,this.basePath))}deleteMessage(e,t){return C(this.configuration).deleteMessage(e.id,t).then(s=>s(this.axios,this.basePath))}deleteUser(e,t){return C(this.configuration).deleteUser(e.id,t).then(s=>s(this.axios,this.basePath))}deleteWorkspaceMember(e,t){return C(this.configuration).deleteWorkspaceMember(e.id,t).then(s=>s(this.axios,this.basePath))}downloadFile(e,t){return C(this.configuration).downloadFile(e.id,t).then(s=>s(this.axios,this.basePath))}getBot(e,t){return C(this.configuration).getBot(e.id,t).then(s=>s(this.axios,this.basePath))}getBotAnalytics(e,t){return C(this.configuration).getBotAnalytics(e.id,e.startDate,e.endDate,t).then(s=>s(this.axios,this.basePath))}getBotLogs(e,t){return C(this.configuration).getBotLogs(e.id,t).then(s=>s(this.axios,this.basePath))}getBotWebchat(e,t){return C(this.configuration).getBotWebchat(e.id,e.type,t).then(s=>s(this.axios,this.basePath))}getConversation(e,t){return C(this.configuration).getConversation(e.id,t).then(s=>s(this.axios,this.basePath))}getEvent(e,t){return C(this.configuration).getEvent(e.id,t).then(s=>s(this.axios,this.basePath))}getFile(e,t){return C(this.configuration).getFile(e.id,t).then(s=>s(this.axios,this.basePath))}getIntegration(e,t){return C(this.configuration).getIntegration(e.id,t).then(s=>s(this.axios,this.basePath))}getIntegrationByName(e,t){return C(this.configuration).getIntegrationByName(e.name,e.version,t).then(s=>s(this.axios,this.basePath))}getIntegrationLogs(e,t){return C(this.configuration).getIntegrationLogs(e.id,t).then(s=>s(this.axios,this.basePath))}getMessage(e,t){return C(this.configuration).getMessage(e.id,t).then(s=>s(this.axios,this.basePath))}getOrCreateConversation(e={},t){return C(this.configuration).getOrCreateConversation(e.getOrCreateConversationBody,t).then(s=>s(this.axios,this.basePath))}getOrCreateMessage(e={},t){return C(this.configuration).getOrCreateMessage(e.getOrCreateMessageBody,t).then(s=>s(this.axios,this.basePath))}getOrCreateUser(e={},t){return C(this.configuration).getOrCreateUser(e.getOrCreateUserBody,t).then(s=>s(this.axios,this.basePath))}getPublicIntegration(e,t){return C(this.configuration).getPublicIntegration(e.name,e.version,t).then(s=>s(this.axios,this.basePath))}getPublicIntegrationById(e,t){return C(this.configuration).getPublicIntegrationById(e.id,t).then(s=>s(this.axios,this.basePath))}getState(e,t){return C(this.configuration).getState(e.type,e.id,e.name,t).then(s=>s(this.axios,this.basePath))}getUser(e,t){return C(this.configuration).getUser(e.id,t).then(s=>s(this.axios,this.basePath))}getWorkspace(e,t){return C(this.configuration).getWorkspace(e.id,t).then(s=>s(this.axios,this.basePath))}introspect(e={},t){return C(this.configuration).introspect(e.introspectBody,t).then(s=>s(this.axios,this.basePath))}listBots(e={},t){return C(this.configuration).listBots(e.nextToken,t).then(s=>s(this.axios,this.basePath))}listConversations(e={},t){return C(this.configuration).listConversations(e.nextToken,e.tags,e.participantIds,t).then(s=>s(this.axios,this.basePath))}listEvents(e={},t){return C(this.configuration).listEvents(e.nextToken,e.type,t).then(s=>s(this.axios,this.basePath))}listFiles(e,t){return C(this.configuration).listFiles(e.botId,e.nextToken,t).then(s=>s(this.axios,this.basePath))}listIntegrations(e={},t){return C(this.configuration).listIntegrations(e.nextToken,e.name,e.version,t).then(s=>s(this.axios,this.basePath))}listMessages(e={},t){return C(this.configuration).listMessages(e.nextToken,e.conversationId,e.tags,t).then(s=>s(this.axios,this.basePath))}listPublicIntegrations(e={},t){return C(this.configuration).listPublicIntegrations(e.nextToken,e.name,e.version,t).then(s=>s(this.axios,this.basePath))}listUsers(e={},t){return C(this.configuration).listUsers(e.nextToken,e.conversationId,e.tags,t).then(s=>s(this.axios,this.basePath))}listWorkspaceMembers(e={},t){return C(this.configuration).listWorkspaceMembers(e.nextToken,t).then(s=>s(this.axios,this.basePath))}listWorkspaces(e={},t){return C(this.configuration).listWorkspaces(e.nextToken,t).then(s=>s(this.axios,this.basePath))}patchState(e,t){return C(this.configuration).patchState(e.type,e.id,e.name,e.patchStateBody,t).then(s=>s(this.axios,this.basePath))}setState(e,t){return C(this.configuration).setState(e.type,e.id,e.name,e.setStateBody,t).then(s=>s(this.axios,this.basePath))}transferBot(e,t){return C(this.configuration).transferBot(e.id,e.transferBotBody,t).then(s=>s(this.axios,this.basePath))}updateBot(e,t){return C(this.configuration).updateBot(e.id,e.updateBotBody,t).then(s=>s(this.axios,this.basePath))}updateConversation(e,t){return C(this.configuration).updateConversation(e.id,e.updateConversationBody,t).then(s=>s(this.axios,this.basePath))}updateIntegration(e,t){return C(this.configuration).updateIntegration(e.id,e.updateIntegrationBody,t).then(s=>s(this.axios,this.basePath))}updateMessage(e,t){return C(this.configuration).updateMessage(e.id,e.updateMessageBody,t).then(s=>s(this.axios,this.basePath))}updateUser(e,t){return C(this.configuration).updateUser(e.id,e.updateUserBody,t).then(s=>s(this.axios,this.basePath))}updateWorkspace(e,t){return C(this.configuration).updateWorkspace(e.id,e.updateWorkspaceBody,t).then(s=>s(this.axios,this.basePath))}updateWorkspaceMember(e,t){return C(this.configuration).updateWorkspaceMember(e.id,e.updateWorkspaceMemberBody,t).then(s=>s(this.axios,this.basePath))}};var _t=class{_innerClient;constructor(e,t,s){this._innerClient=new Vt(e,t,s)}createConversation=e=>this._innerClient.createConversation({createConversationBody:e}).then(t=>t.data).catch(t=>{throw w(t)});getConversation=e=>this._innerClient.getConversation(e).then(t=>t.data).catch(t=>{throw w(t)});listConversations=e=>this._innerClient.listConversations(e).then(t=>t.data).catch(t=>{throw w(t)});getOrCreateConversation=e=>this._innerClient.getOrCreateConversation({getOrCreateConversationBody:e}).then(t=>t.data).catch(t=>{throw w(t)});updateConversation=({id:e,...t})=>this._innerClient.updateConversation({id:e,updateConversationBody:t}).then(s=>s.data).catch(s=>{throw w(s)});deleteConversation=e=>this._innerClient.deleteConversation(e).then(t=>t.data).catch(t=>{throw w(t)});createEvent=e=>this._innerClient.createEvent({createEventBody:e}).then(t=>t.data).catch(t=>{throw w(t)});getEvent=e=>this._innerClient.getEvent(e).then(t=>t.data).catch(t=>{throw w(t)});listEvents=e=>this._innerClient.listEvents(e).then(t=>t.data).catch(t=>{throw w(t)});createMessage=e=>this._innerClient.createMessage({createMessageBody:e}).then(t=>t.data).catch(t=>{throw w(t)});getOrCreateMessage=e=>this._innerClient.getOrCreateMessage({getOrCreateMessageBody:e}).then(t=>t.data).catch(t=>{throw w(t)});getMessage=e=>this._innerClient.getMessage(e).then(t=>t.data).catch(t=>{throw w(t)});updateMessage=({id:e,...t})=>this._innerClient.updateMessage({id:e,updateMessageBody:t}).then(s=>s.data).catch(s=>{throw w(s)});listMessages=e=>this._innerClient.listMessages(e).then(t=>t.data).catch(t=>{throw w(t)});deleteMessage=e=>this._innerClient.deleteMessage(e).then(t=>t.data).catch(t=>{throw w(t)});createUser=e=>this._innerClient.createUser({createUserBody:e}).then(t=>t.data).catch(t=>{throw w(t)});getUser=e=>this._innerClient.getUser(e).then(t=>t.data).catch(t=>{throw w(t)});listUsers=e=>this._innerClient.listUsers(e).then(t=>t.data).catch(t=>{throw w(t)});getOrCreateUser=e=>this._innerClient.getOrCreateUser({getOrCreateUserBody:e}).then(t=>t.data).catch(t=>{throw w(t)});updateUser=({id:e,...t})=>this._innerClient.updateUser({id:e,updateUserBody:t}).then(s=>s.data).catch(s=>{throw w(s)});deleteUser=e=>this._innerClient.deleteUser(e).then(t=>t.data).catch(t=>{throw w(t)});getState=e=>this._innerClient.getState(e).then(t=>t.data).catch(t=>{throw w(t)});setState=({type:e,id:t,name:s,...i})=>this._innerClient.setState({type:e,id:t,name:s,setStateBody:i}).then(n=>n.data).catch(n=>{throw w(n)});patchState=({type:e,id:t,name:s,...i})=>this._innerClient.patchState({type:e,id:t,name:s,patchStateBody:i}).then(n=>n.data).catch(n=>{throw w(n)});callAction=e=>this._innerClient.callAction({callActionBody:e}).then(t=>t.data).catch(t=>{throw w(t)});configureIntegration=e=>this._innerClient.configureIntegration({configureIntegrationBody:e}).then(t=>t.data).catch(t=>{throw w(t)});listPublicIntegrations=e=>this._innerClient.listPublicIntegrations(e).then(t=>t.data).catch(t=>{throw w(t)});getPublicIntegrationById=e=>this._innerClient.getPublicIntegrationById(e).then(t=>t.data).catch(t=>{throw w(t)});getPublicIntegration=e=>this._innerClient.getPublicIntegration(e).then(t=>t.data).catch(t=>{throw w(t)});createBot=e=>this._innerClient.createBot({createBotBody:e}).then(t=>t.data).catch(t=>{throw w(t)});updateBot=({id:e,...t})=>this._innerClient.updateBot({id:e,updateBotBody:t}).then(s=>s.data).catch(s=>{throw w(s)});transferBot=({id:e,...t})=>this._innerClient.transferBot({id:e,transferBotBody:t}).then(s=>s.data).catch(s=>{throw w(s)});listBots=e=>this._innerClient.listBots(e).then(t=>t.data).catch(t=>{throw w(t)});getBot=e=>this._innerClient.getBot(e).then(t=>t.data).catch(t=>{throw w(t)});deleteBot=e=>this._innerClient.deleteBot(e).then(t=>t.data).catch(t=>{throw w(t)});getBotLogs=e=>this._innerClient.getBotLogs(e).then(t=>t.data).catch(t=>{throw w(t)});getBotWebchat=e=>this._innerClient.getBotWebchat(e).then(t=>t.data).catch(t=>{throw w(t)});getBotAnalytics=e=>this._innerClient.getBotAnalytics(e).then(t=>t.data).catch(t=>{throw w(t)});getWorkspace=e=>this._innerClient.getWorkspace(e).then(t=>t.data).catch(t=>{throw w(t)});updateWorkspace=({id:e,...t})=>this._innerClient.updateWorkspace({id:e,updateWorkspaceBody:t}).then(s=>s.data).catch(s=>{throw w(s)});listWorkspaces=e=>this._innerClient.listWorkspaces(e).then(t=>t.data).catch(t=>{throw w(t)});createIntegration=e=>this._innerClient.createIntegration({createIntegrationBody:e}).then(t=>t.data).catch(t=>{throw w(t)});updateIntegration=({id:e,...t})=>this._innerClient.updateIntegration({id:e,updateIntegrationBody:t}).then(s=>s.data).catch(s=>{throw w(s)});listIntegrations=e=>this._innerClient.listIntegrations(e).then(t=>t.data).catch(t=>{throw w(t)});getIntegration=e=>this._innerClient.getIntegration(e).then(t=>t.data).catch(t=>{throw w(t)});getIntegrationLogs=e=>this._innerClient.getIntegrationLogs(e).then(t=>t.data).catch(t=>{throw w(t)});getIntegrationByName=e=>this._innerClient.getIntegrationByName(e).then(t=>t.data).catch(t=>{throw w(t)});deleteIntegration=e=>this._innerClient.deleteIntegration(e).then(t=>t.data).catch(t=>{throw w(t)});listWorkspaceMembers=e=>this._innerClient.listWorkspaceMembers(e).then(t=>t.data).catch(t=>{throw w(t)});deleteWorkspaceMember=e=>this._innerClient.deleteWorkspaceMember(e).then(t=>t.data).catch(t=>{throw w(t)});createWorkspaceMember=e=>this._innerClient.createWorkspaceMember({createWorkspaceMemberBody:e}).then(t=>t.data).catch(t=>{throw w(t)});updateWorkspaceMember=({id:e,...t})=>this._innerClient.updateWorkspaceMember({id:e,updateWorkspaceMemberBody:t}).then(s=>s.data).catch(s=>{throw w(s)});introspect=e=>this._innerClient.introspect({introspectBody:e}).then(t=>t.data).catch(t=>{throw w(t)});createFile=e=>this._innerClient.createFile({createFileBody:e}).then(t=>t.data).catch(t=>{throw w(t)});getFile=e=>this._innerClient.getFile(e).then(t=>t.data).catch(t=>{throw w(t)});downloadFile=e=>this._innerClient.downloadFile(e).then(t=>t.data).catch(t=>{throw w(t)});deleteFile=e=>this._innerClient.deleteFile(e).then(t=>t.data).catch(t=>{throw w(t)});listFiles=e=>this._innerClient.listFiles(e).then(t=>t.data).catch(t=>{throw w(t)})};function w(a){return x.isAxiosError(a)?Ot(a.response?.data):Ot(a)}var qa=class extends _t{config;constructor(e={}){let t=Tn(e),{host:s,headers:i,withCredentials:n,timeout:o}=t,r=x.create({maxBodyLength:100*1024*1024,maxContentLength:1024*1024*1024,timeout:o??6e4,withCredentials:n,headers:i});super(void 0,s,r),this.config=t}};0&&(module.exports={AlreadyExistsError,Client,ForbiddenError,InternalError,InvalidDataFormatError,InvalidIdentifierError,InvalidJsonSchemaError,InvalidPayloadError,InvalidQueryError,MethodNotFoundError,PayloadTooLargeError,RateLimitedError,ReferenceNotFoundError,RelationConflictError,ResourceNotFoundError,RuntimeError,UnauthorizedError,UnknownError,UnsupportedMediaTypeError,axios,errorFrom,isApiError});
8
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let s=new this(e);return t.forEach(i=>s.set(i)),s}static accessor(e){let s=(this[Ds]=this[Ds]={accessors:{}}).accessors,i=this.prototype;function n(o){let r=Me(o);s[r]||(fo(i,o),s[r]=!0)}return u.isArray(e)?e.forEach(n):n(e),this}};Pe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]);u.freezeMethods(Pe.prototype);u.freezeMethods(Pe);var M=Pe;function Le(a,e){let t=this||Be,s=e||t,i=M.from(s.headers),n=s.data;return u.forEach(a,function(r){n=r.call(t,n,i.normalize(),e?e.status:void 0)}),i.normalize(),n}function Fe(a){return!!(a&&a.__CANCEL__)}function _s(a,e,t){h.call(this,a??"canceled",h.ERR_CANCELED,e,t),this.name="CanceledError"}u.inherits(_s,h,{__CANCEL__:!0});var ae=_s;function ce(a,e,t){let s=t.config.validateStatus;!t.status||!s||s(t.status)?a(t):e(new h("Request failed with status code "+t.status,[h.ERR_BAD_REQUEST,h.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function ra(a){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(a)}function ca(a,e){return e?a.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):a}function fe(a,e){return a&&!ra(e)?ca(a,e):e}var mn=K(Ms(),1),fn=K(require("http"),1),xn=K(require("https"),1),hn=K(cn(),1),le=K(require("zlib"),1);var Ie="1.2.5";function ze(a){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(a);return e&&e[1]||""}var Yo=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function va(a,e,t){let s=t&&t.Blob||j.classes.Blob,i=ze(a);if(e===void 0&&s&&(e=!0),i==="data"){a=i.length?a.slice(i.length+1):a;let n=Yo.exec(a);if(!n)throw new h("Invalid URL",h.ERR_INVALID_URL);let o=n[1],r=n[2],p=n[3],c=Buffer.from(decodeURIComponent(p),r?"base64":"utf8");if(e){if(!s)throw new h("Blob is not supported",h.ERR_NOT_SUPPORT);return new s([c],{type:o})}return c}throw new h("Unsupported protocol "+i,h.ERR_NOT_SUPPORT)}var Te=K(require("stream"),1);var ln=K(require("stream"),1);function Xo(a,e){let t=0,s=1e3/e,i=null;return function(o,r){let p=Date.now();if(o||p-t>s)return i&&(clearTimeout(i),i=null),t=p,a.apply(null,r);i||(i=setTimeout(()=>(i=null,t=Date.now(),a.apply(null,r)),s-(p-t)))}}var pn=Xo;function Zo(a,e){a=a||10;let t=new Array(a),s=new Array(a),i=0,n=0,o;return e=e!==void 0?e:1e3,function(p){let c=Date.now(),l=s[n];o||(o=c),t[i]=p,s[i]=c;let d=n,f=0;for(;d!==i;)f+=t[d++],d=d%a;if(i=(i+1)%a,i===n&&(n=(n+1)%a),c-o<e)return;let P=l&&c-l;return P?Math.round(f*1e3/P):void 0}}var ut=Zo;var dt=Symbol("internals"),ba=class extends ln.default.Transform{constructor(e){e=u.toFlatObject(e,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(r,p)=>!u.isUndefined(p[r])),super({readableHighWaterMark:e.chunkSize});let t=this,s=this[dt]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},i=ut(s.ticksRate*e.samplesCount,s.timeWindow);this.on("newListener",r=>{r==="progress"&&(s.isCaptured||(s.isCaptured=!0))});let n=0;s.updateProgress=pn(function(){let p=s.length,c=s.bytesSeen,l=c-n;if(!l||t.destroyed)return;let d=i(l);n=c,process.nextTick(()=>{t.emit("progress",{loaded:c,total:p,progress:p?c/p:void 0,bytes:l,rate:d||void 0,estimated:d&&p&&c<=p?(p-c)/d:void 0})})},s.ticksRate);let o=()=>{s.updateProgress(!0)};this.once("end",o),this.once("error",o)}_read(e){let t=this[dt];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,s){let i=this,n=this[dt],o=n.maxRate,r=this.readableHighWaterMark,p=n.timeWindow,c=1e3/p,l=o/c,d=n.minChunkSize!==!1?Math.max(n.minChunkSize,l*.01):0;function f(m,v){let E=Buffer.byteLength(m);n.bytesSeen+=E,n.bytes+=E,n.isCaptured&&n.updateProgress(),i.push(m)?process.nextTick(v):n.onReadCallback=()=>{n.onReadCallback=null,process.nextTick(v)}}let P=(m,v)=>{let E=Buffer.byteLength(m),k=null,O=r,W,D=0;if(o){let se=Date.now();(!n.ts||(D=se-n.ts)>=p)&&(n.ts=se,W=l-n.bytes,n.bytes=W<0?-W:0,D=0),W=l-n.bytes}if(o){if(W<=0)return setTimeout(()=>{v(null,m)},p-D);W<O&&(O=W)}O&&E>O&&E-O>d&&(k=m.subarray(O),m=m.subarray(0,O)),f(m,k?()=>{process.nextTick(v,null,k)}:v)};P(e,function m(v,E){if(v)return s(v);E?P(E,m):s(null)})}setLength(e){return this[dt].length=+e,this}},ya=ba;var gn=K(require("events"),1),er={flush:le.default.constants.Z_SYNC_FLUSH,finishFlush:le.default.constants.Z_SYNC_FLUSH},tr={flush:le.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:le.default.constants.BROTLI_OPERATION_FLUSH},un=u.isFunction(le.default.createBrotliDecompress),{http:ar,https:sr}=hn.default,nr=/https:?/,dn=j.protocols.map(a=>a+":");function ir(a){a.beforeRedirects.proxy&&a.beforeRedirects.proxy(a),a.beforeRedirects.config&&a.beforeRedirects.config(a)}function vn(a,e,t){let s=e;if(!s&&s!==!1){let i=(0,mn.getProxyForUrl)(t);i&&(s=new URL(i))}if(s){if(s.username&&(s.auth=(s.username||"")+":"+(s.password||"")),s.auth){(s.auth.username||s.auth.password)&&(s.auth=(s.auth.username||"")+":"+(s.auth.password||""));let n=Buffer.from(s.auth,"utf8").toString("base64");a.headers["Proxy-Authorization"]="Basic "+n}a.headers.host=a.hostname+(a.port?":"+a.port:"");let i=s.hostname||s.host;a.hostname=i,a.host=i,a.port=s.port,a.path=t,s.protocol&&(a.protocol=s.protocol.includes(":")?s.protocol:`${s.protocol}:`)}a.beforeRedirects.proxy=function(n){vn(n,e,n.href)}}var or=typeof process<"u"&&u.kindOf(process)==="process",bn=or&&function(e){return new Promise(function(s,i){let n=e.data,o=e.responseType,r=e.responseEncoding,p=e.method.toUpperCase(),c,l,d=!1,f,P=new gn.default;function m(){c||(c=!0,e.cancelToken&&e.cancelToken.unsubscribe(O),e.signal&&e.signal.removeEventListener("abort",O),P.removeAllListeners())}function v(U,q){l||(l=!0,q&&(d=!0,m()),q?i(U):s(U))}let E=function(q){v(q)},k=function(q){v(q,!0)};function O(U){P.emit("abort",!U||U.type?new ae(null,e,f):U)}P.once("abort",k),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(O),e.signal&&(e.signal.aborted?O():e.signal.addEventListener("abort",O)));let W=fe(e.baseURL,e.url),D=new URL(W),se=D.protocol||dn[0];if(se==="data:"){let U;if(p!=="GET")return ce(E,k,{status:405,statusText:"method not allowed",headers:{},config:e});try{U=va(e.url,o==="blob",{Blob:e.env&&e.env.Blob})}catch(q){throw h.from(q,h.ERR_BAD_REQUEST,e)}return o==="text"?(U=U.toString(r),(!r||r==="utf8")&&(n=u.stripBOM(U))):o==="stream"&&(U=Te.default.Readable.from(U)),ce(E,k,{data:U,status:200,statusText:"OK",headers:new M,config:e})}if(dn.indexOf(se)===-1)return k(new h("Unsupported protocol "+se,h.ERR_BAD_REQUEST,e));let Z=M.from(e.headers).normalize();Z.set("User-Agent","axios/"+Ie,!1);let Se=e.onDownloadProgress,be=e.onUploadProgress,ye=e.maxRate,Je,jt;if(u.isFormData(n)&&u.isFunction(n.getHeaders))Z.set(n.getHeaders());else if(n&&!u.isStream(n)){if(!Buffer.isBuffer(n))if(u.isArrayBuffer(n))n=Buffer.from(new Uint8Array(n));else if(u.isString(n))n=Buffer.from(n,"utf-8");else return k(new h("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",h.ERR_BAD_REQUEST,e));if(Z.set("Content-Length",n.length,!1),e.maxBodyLength>-1&&n.length>e.maxBodyLength)return k(new h("Request body larger than maxBodyLength limit",h.ERR_BAD_REQUEST,e))}let Sn=u.toFiniteNumber(Z.getContentLength());u.isArray(ye)?(Je=ye[0],jt=ye[1]):Je=jt=ye,n&&(be||Je)&&(u.isStream(n)||(n=Te.default.Readable.from(n,{objectMode:!1})),n=Te.default.pipeline([n,new ya({length:Sn,maxRate:u.toFiniteNumber(Je)})],u.noop),be&&n.on("progress",U=>{be(Object.assign(U,{upload:!0}))}));let De;if(e.auth){let U=e.auth.username||"",q=e.auth.password||"";De=U+":"+q}if(!De&&D.username){let U=D.username,q=D.password;De=U+":"+q}De&&Z.delete("authorization");let Ea;try{Ea=me(D.pathname+D.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(U){let q=new Error(U.message);return q.config=e,q.url=e.url,q.exists=!0,k(q)}Z.set("Accept-Encoding","gzip, compress, deflate"+(un?", br":""),!1);let H={path:Ea,method:p,headers:Z.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:De,protocol:se,beforeRedirect:ir,beforeRedirects:{}};e.socketPath?H.socketPath=e.socketPath:(H.hostname=D.hostname,H.port=D.port,vn(H,e.proxy,se+"//"+D.hostname+(D.port?":"+D.port:"")+H.path));let Ke,Mt=nr.test(H.protocol);if(H.agent=Mt?e.httpsAgent:e.httpAgent,e.transport?Ke=e.transport:e.maxRedirects===0?Ke=Mt?xn.default:fn.default:(e.maxRedirects&&(H.maxRedirects=e.maxRedirects),e.beforeRedirect&&(H.beforeRedirects.config=e.beforeRedirect),Ke=Mt?sr:ar),e.maxBodyLength>-1?H.maxBodyLength=e.maxBodyLength:H.maxBodyLength=1/0,e.insecureHTTPParser&&(H.insecureHTTPParser=e.insecureHTTPParser),f=Ke.request(H,function(q){if(f.destroyed)return;let ee=[q],Lt=+q.headers["content-length"];if(Se){let ne=new ya({length:u.toFiniteNumber(Lt),maxRate:u.toFiniteNumber(jt)});Se&&ne.on("progress",Xe=>{Se(Object.assign(Xe,{download:!0}))}),ee.push(ne)}let J=q,Ye=q.req||f;if(e.decompress!==!1&&q.headers["content-encoding"])switch((p==="HEAD"||q.statusCode===204)&&delete q.headers["content-encoding"],q.headers["content-encoding"]){case"gzip":case"x-gzip":case"compress":case"x-compress":case"deflate":ee.push(le.default.createUnzip(er)),delete q.headers["content-encoding"];break;case"br":un&&(ee.push(le.default.createBrotliDecompress(tr)),delete q.headers["content-encoding"])}J=ee.length>1?Te.default.pipeline(ee,u.noop):ee[0];let Dn=Te.default.finished(J,()=>{Dn(),m()}),Re={status:q.statusCode,statusText:q.statusMessage,headers:new M(q.headers),config:e,request:Ye};if(o==="stream")Re.data=J,ce(E,k,Re);else{let ne=[],Xe=0;J.on("data",function(G){ne.push(G),Xe+=G.length,e.maxContentLength>-1&&Xe>e.maxContentLength&&(d=!0,J.destroy(),k(new h("maxContentLength size of "+e.maxContentLength+" exceeded",h.ERR_BAD_RESPONSE,e,Ye)))}),J.on("aborted",function(){if(d)return;let G=new h("maxContentLength size of "+e.maxContentLength+" exceeded",h.ERR_BAD_RESPONSE,e,Ye);J.destroy(G),k(G)}),J.on("error",function(G){f.destroyed||k(h.from(G,null,e,Ye))}),J.on("end",function(){try{let G=ne.length===1?ne[0]:Buffer.concat(ne);o!=="arraybuffer"&&(G=G.toString(r),(!r||r==="utf8")&&(G=u.stripBOM(G))),Re.data=G}catch(G){k(h.from(G,null,e,Re.request,Re))}ce(E,k,Re)})}P.once("abort",ne=>{J.destroyed||(J.emit("error",ne),J.destroy())})}),P.once("abort",U=>{k(U),f.destroy(U)}),f.on("error",function(q){k(h.from(q,null,e,f))}),f.on("socket",function(q){q.setKeepAlive(!0,1e3*60)}),e.timeout){let U=parseInt(e.timeout,10);if(isNaN(U)){k(new h("error trying to parse `config.timeout` to int",h.ERR_BAD_OPTION_VALUE,e,f));return}f.setTimeout(U,function(){if(l)return;let ee=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",Lt=e.transitional||we;e.timeoutErrorMessage&&(ee=e.timeoutErrorMessage),k(new h(ee,Lt.clarifyTimeoutError?h.ETIMEDOUT:h.ECONNABORTED,e,f)),O()})}if(u.isStream(n)){let U=!1,q=!1;n.on("end",()=>{U=!0}),n.once("error",ee=>{q=!0,f.destroy(ee)}),n.on("close",()=>{!U&&!q&&O(new ae("Request stream has been aborted",e,f))}),n.pipe(f)}else f.end(n)})};var yn=j.isStandardBrowserEnv?function(){return{write:function(t,s,i,n,o,r){let p=[];p.push(t+"="+encodeURIComponent(s)),u.isNumber(i)&&p.push("expires="+new Date(i).toGMTString()),u.isString(n)&&p.push("path="+n),u.isString(o)&&p.push("domain="+o),r===!0&&p.push("secure"),document.cookie=p.join("; ")},read:function(t){let s=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return s?decodeURIComponent(s[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();var Rn=j.isStandardBrowserEnv?function(){let e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),s;function i(n){let o=n;return e&&(t.setAttribute("href",o),o=t.href),t.setAttribute("href",o),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return s=i(window.location.href),function(o){let r=u.isString(o)?i(o):o;return r.protocol===s.protocol&&r.host===s.host}}():function(){return function(){return!0}}();function An(a,e){let t=0,s=ut(50,250);return i=>{let n=i.loaded,o=i.lengthComputable?i.total:void 0,r=n-t,p=s(r),c=n<=o;t=n;let l={loaded:n,total:o,progress:o?n/o:void 0,bytes:r,rate:p||void 0,estimated:p&&o&&c?(o-n)/p:void 0,event:i};l[e?"download":"upload"]=!0,a(l)}}var rr=typeof XMLHttpRequest<"u",Cn=rr&&function(a){return new Promise(function(t,s){let i=a.data,n=M.from(a.headers).normalize(),o=a.responseType,r;function p(){a.cancelToken&&a.cancelToken.unsubscribe(r),a.signal&&a.signal.removeEventListener("abort",r)}u.isFormData(i)&&(j.isStandardBrowserEnv||j.isStandardBrowserWebWorkerEnv)&&n.setContentType(!1);let c=new XMLHttpRequest;if(a.auth){let P=a.auth.username||"",m=a.auth.password?unescape(encodeURIComponent(a.auth.password)):"";n.set("Authorization","Basic "+btoa(P+":"+m))}let l=fe(a.baseURL,a.url);c.open(a.method.toUpperCase(),me(l,a.params,a.paramsSerializer),!0),c.timeout=a.timeout;function d(){if(!c)return;let P=M.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders()),v={data:!o||o==="text"||o==="json"?c.responseText:c.response,status:c.status,statusText:c.statusText,headers:P,config:a,request:c};ce(function(k){t(k),p()},function(k){s(k),p()},v),c=null}if("onloadend"in c?c.onloadend=d:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(d)},c.onabort=function(){c&&(s(new h("Request aborted",h.ECONNABORTED,a,c)),c=null)},c.onerror=function(){s(new h("Network Error",h.ERR_NETWORK,a,c)),c=null},c.ontimeout=function(){let m=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded",v=a.transitional||we;a.timeoutErrorMessage&&(m=a.timeoutErrorMessage),s(new h(m,v.clarifyTimeoutError?h.ETIMEDOUT:h.ECONNABORTED,a,c)),c=null},j.isStandardBrowserEnv){let P=(a.withCredentials||Rn(l))&&a.xsrfCookieName&&yn.read(a.xsrfCookieName);P&&n.set(a.xsrfHeaderName,P)}i===void 0&&n.setContentType(null),"setRequestHeader"in c&&u.forEach(n.toJSON(),function(m,v){c.setRequestHeader(v,m)}),u.isUndefined(a.withCredentials)||(c.withCredentials=!!a.withCredentials),o&&o!=="json"&&(c.responseType=a.responseType),typeof a.onDownloadProgress=="function"&&c.addEventListener("progress",An(a.onDownloadProgress,!0)),typeof a.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",An(a.onUploadProgress)),(a.cancelToken||a.signal)&&(r=P=>{c&&(s(!P||P.type?new ae(null,a,c):P),c.abort(),c=null)},a.cancelToken&&a.cancelToken.subscribe(r),a.signal&&(a.signal.aborted?r():a.signal.addEventListener("abort",r)));let f=ze(l);if(f&&j.protocols.indexOf(f)===-1){s(new h("Unsupported protocol "+f+":",h.ERR_BAD_REQUEST,a));return}c.send(i||null)})};var mt={http:bn,xhr:Cn};u.forEach(mt,(a,e)=>{if(a){try{Object.defineProperty(a,"name",{value:e})}catch{}Object.defineProperty(a,"adapterName",{value:e})}});var wn={getAdapter:a=>{a=u.isArray(a)?a:[a];let{length:e}=a,t,s;for(let i=0;i<e&&(t=a[i],!(s=u.isString(t)?mt[t.toLowerCase()]:t));i++);if(!s)throw s===!1?new h(`Adapter ${t} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(u.hasOwnProp(mt,t)?`Adapter '${t}' is not available in the build`:`Unknown adapter '${t}'`);if(!u.isFunction(s))throw new TypeError("adapter is not a function");return s},adapters:mt};function Ra(a){if(a.cancelToken&&a.cancelToken.throwIfRequested(),a.signal&&a.signal.aborted)throw new ae(null,a)}function ft(a){return Ra(a),a.headers=M.from(a.headers),a.data=Le.call(a,a.transformRequest),["post","put","patch"].indexOf(a.method)!==-1&&a.headers.setContentType("application/x-www-form-urlencoded",!1),wn.getAdapter(a.adapter||Be.adapter)(a).then(function(s){return Ra(a),s.data=Le.call(a,a.transformResponse,s),s.headers=M.from(s.headers),s},function(s){return Fe(s)||(Ra(a),s&&s.response&&(s.response.data=Le.call(a,a.transformResponse,s.response),s.response.headers=M.from(s.response.headers))),Promise.reject(s)})}var Bn=a=>a instanceof M?a.toJSON():a;function oe(a,e){e=e||{};let t={};function s(c,l,d){return u.isPlainObject(c)&&u.isPlainObject(l)?u.merge.call({caseless:d},c,l):u.isPlainObject(l)?u.merge({},l):u.isArray(l)?l.slice():l}function i(c,l,d){if(u.isUndefined(l)){if(!u.isUndefined(c))return s(void 0,c,d)}else return s(c,l,d)}function n(c,l){if(!u.isUndefined(l))return s(void 0,l)}function o(c,l){if(u.isUndefined(l)){if(!u.isUndefined(c))return s(void 0,c)}else return s(void 0,l)}function r(c,l,d){if(d in e)return s(c,l);if(d in a)return s(void 0,c)}let p={url:n,method:n,data:n,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:r,headers:(c,l)=>i(Bn(c),Bn(l),!0)};return u.forEach(Object.keys(a).concat(Object.keys(e)),function(l){let d=p[l]||i,f=d(a[l],e[l],l);u.isUndefined(f)&&d!==r||(t[l]=f)}),t}var Aa={};["object","boolean","number","function","string","symbol"].forEach((a,e)=>{Aa[a]=function(s){return typeof s===a||"a"+(e<1?"n ":" ")+a}});var Pn={};Aa.transitional=function(e,t,s){function i(n,o){return"[Axios v"+Ie+"] Transitional option '"+n+"'"+o+(s?". "+s:"")}return(n,o,r)=>{if(e===!1)throw new h(i(o," has been removed"+(t?" in "+t:"")),h.ERR_DEPRECATED);return t&&!Pn[o]&&(Pn[o]=!0,console.warn(i(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(n,o,r):!0}};function cr(a,e,t){if(typeof a!="object")throw new h("options must be an object",h.ERR_BAD_OPTION_VALUE);let s=Object.keys(a),i=s.length;for(;i-- >0;){let n=s[i],o=e[n];if(o){let r=a[n],p=r===void 0||o(r,n,a);if(p!==!0)throw new h("option "+n+" must be "+p,h.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new h("Unknown option "+n,h.ERR_BAD_OPTION)}}var xt={assertOptions:cr,validators:Aa};var ue=xt.validators,Oe=class{constructor(e){this.defaults=e,this.interceptors={request:new ia,response:new ia}}request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=oe(this.defaults,t);let{transitional:s,paramsSerializer:i,headers:n}=t;s!==void 0&&xt.assertOptions(s,{silentJSONParsing:ue.transitional(ue.boolean),forcedJSONParsing:ue.transitional(ue.boolean),clarifyTimeoutError:ue.transitional(ue.boolean)},!1),i!==void 0&&xt.assertOptions(i,{encode:ue.function,serialize:ue.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o;o=n&&u.merge(n.common,n[t.method]),o&&u.forEach(["delete","get","head","post","put","patch","common"],m=>{delete n[m]}),t.headers=M.concat(o,n);let r=[],p=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(t)===!1||(p=p&&v.synchronous,r.unshift(v.fulfilled,v.rejected))});let c=[];this.interceptors.response.forEach(function(v){c.push(v.fulfilled,v.rejected)});let l,d=0,f;if(!p){let m=[ft.bind(this),void 0];for(m.unshift.apply(m,r),m.push.apply(m,c),f=m.length,l=Promise.resolve(t);d<f;)l=l.then(m[d++],m[d++]);return l}f=r.length;let P=t;for(d=0;d<f;){let m=r[d++],v=r[d++];try{P=m(P)}catch(E){v.call(this,E);break}}try{l=ft.call(this,P)}catch(m){return Promise.reject(m)}for(d=0,f=c.length;d<f;)l=l.then(c[d++],c[d++]);return l}getUri(e){e=oe(this.defaults,e);let t=fe(e.baseURL,e.url);return me(t,e.params,e.paramsSerializer)}};u.forEach(["delete","get","head","options"],function(e){Oe.prototype[e]=function(t,s){return this.request(oe(s||{},{method:e,url:t,data:(s||{}).data}))}});u.forEach(["post","put","patch"],function(e){function t(s){return function(n,o,r){return this.request(oe(r||{},{method:e,headers:s?{"Content-Type":"multipart/form-data"}:{},url:n,data:o}))}}Oe.prototype[e]=t(),Oe.prototype[e+"Form"]=t(!0)});var He=Oe;var Qe=class{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(n){t=n});let s=this;this.promise.then(i=>{if(!s._listeners)return;let n=s._listeners.length;for(;n-- >0;)s._listeners[n](i);s._listeners=null}),this.promise.then=i=>{let n,o=new Promise(r=>{s.subscribe(r),n=r}).then(i);return o.cancel=function(){s.unsubscribe(n)},o},e(function(n,o,r){s.reason||(s.reason=new ae(n,o,r),t(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}static source(){let e;return{token:new Qe(function(i){e=i}),cancel:e}}},kn=Qe;function Ca(a){return function(t){return a.apply(null,t)}}function wa(a){return u.isObject(a)&&a.isAxiosError===!0}var Ba={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ba).forEach(([a,e])=>{Ba[e]=a});var qn=Ba;function En(a){let e=new He(a),t=Ve(He.prototype.request,e);return u.extend(t,He.prototype,e,{allOwnKeys:!0}),u.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return En(oe(a,i))},t}var L=En(Be);L.Axios=He;L.CanceledError=ae;L.CancelToken=kn;L.isCancel=Fe;L.VERSION=Ie;L.toFormData=re;L.AxiosError=h;L.Cancel=L.CanceledError;L.all=function(e){return Promise.all(e)};L.spread=Ca;L.isAxiosError=wa;L.mergeConfig=oe;L.AxiosHeaders=M;L.formToJSON=a=>nt(u.isHTMLForm(a)?new FormData(a):a);L.HttpStatusCode=qn;L.default=L;var x=L;var{Axios:pr,AxiosError:lr,CanceledError:ur,isCancel:dr,CancelToken:mr,VERSION:fr,all:xr,Cancel:hr,isAxiosError:gr,spread:vr,toFormData:br,AxiosHeaders:yr,HttpStatusCode:Rr,formToJSON:Ar,mergeConfig:Cr}=x;var $e=K(Un()),In="https://api.botpress.cloud",Ur="BP_API_URL",Ir="BP_BOT_ID",Tr="BP_INTEGRATION_ID",Or="BP_WORKSPACE_ID",Sr="BP_TOKEN";function Tn(a){let e=Dr(a),t={};return e.workspaceId&&(t["x-workspace-id"]=e.workspaceId),e.botId&&(t["x-bot-id"]=e.botId),e.integrationId&&(t["x-integration-id"]=e.integrationId),e.token&&(t.Authorization=`Bearer ${e.token}`),{host:e.host??In,withCredentials:$e.isBrowser,headers:t,timeout:e.timeout}}function Dr(a){return $e.isBrowser?a:$e.isNode?Vr(a):a}function Vr(a){let e={...a,host:a.host??process.env[Ur]??In,botId:a.botId??process.env[Ir],integrationId:a.integrationId??process.env[Tr],workspaceId:a.workspaceId??process.env[Or]},t=e.token??process.env[Sr];return t&&(e.token=t),e}var _=class extends Error{constructor(t,s,i,n,o){super(n);this.code=t;this.description=s;this.type=i;this.message=n;this.error=o}isApiError=!0;toJSON(){return{code:this.code,type:this.type,message:this.message}}},_r=a=>typeof a=="object"&&!Array.isArray(a)&&a!==null,On=a=>a instanceof _||_r(a)&&a.isApiError===!0,X=class extends _{constructor(e,t){super(500,"An unknown error occurred","Unknown",e,t)}},ht=class extends _{constructor(e,t){super(500,"An internal error occurred","Internal",e,t)}},gt=class extends _{constructor(e,t){super(401,"The request requires to be authenticated.","Unauthorized",e,t)}},vt=class extends _{constructor(e,t){super(403,"The requested action can't be peform by this resource.","Forbidden",e,t)}},bt=class extends _{constructor(e,t){super(413,"The request payload is too large.","PayloadTooLarge",e,t)}},yt=class extends _{constructor(e,t){super(400,"The request payload is invalid.","InvalidPayload",e,t)}},Rt=class extends _{constructor(e,t){super(415,"The request is invalid because the content-type is not supported.","UnsupportedMediaType",e,t)}},At=class extends _{constructor(e,t){super(405,"The requested method does not exist.","MethodNotFound",e,t)}},Ct=class extends _{constructor(e,t){super(404,"The requested resource does not exist.","ResourceNotFound",e,t)}},wt=class extends _{constructor(e,t){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",e,t)}},Bt=class extends _{constructor(e,t){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",e,t)}},Pt=class extends _{constructor(e,t){super(400,"The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.","InvalidIdentifier",e,t)}},kt=class extends _{constructor(e,t){super(409,"The resource is not related with another resource. This is usually caused when providing two resources that aren't linked together.","RelationConflict",e,t)}},qt=class extends _{constructor(e,t){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",e,t)}},Et=class extends _{constructor(e,t){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",e,t)}},Ut=class extends _{constructor(e,t){super(400,"An error happened during the execution of a runtime (bot or integration).","Runtime",e,t)}},It=class extends _{constructor(e,t){super(409,"The record attempted to be created already exists.","AlreadyExists",e,t)}},Tt=class extends _{constructor(e,t){super(429,"The request has been rate limited.","RateLimited",e,t)}},jr={Unknown:X,Internal:ht,Unauthorized:gt,Forbidden:vt,PayloadTooLarge:bt,InvalidPayload:yt,UnsupportedMediaType:Rt,MethodNotFound:At,ResourceNotFound:Ct,InvalidJsonSchema:wt,InvalidDataFormat:Bt,InvalidIdentifier:Pt,RelationConflict:kt,ReferenceNotFound:qt,InvalidQuery:Et,Runtime:Ut,AlreadyExists:It,RateLimited:Tt},Ot=a=>On(a)?a:a instanceof Error?new X(a.message,a):a===null?new X("An unknown error occurred"):typeof a=="string"?new X(a):typeof a!="object"?new X("An unknown error occurred"):Mr(a);function Mr(a){if("code"in a&&"type"in a&&"message"in a){if(typeof a.message!="string")return new X("An unknown error occurred");if(typeof a.type!="string")return new X(a.message);let e=jr[a.type];return e?new e(a.message):new X(a.message)}return new X("An unknown error occurred")}var g="https://api.botpress.cloud".replace(/\/+$/,"");var St=class{constructor(e,t=g,s=x){this.basePath=t;this.axios=s;e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}configuration},Dt=class extends Error{constructor(t,s){super(s);this.field=t;this.name="RequiredError"}};var b="https://example.com",B=function(a,e,t){if(t==null)throw new Dt(e,`Required parameter ${e} was null or undefined when calling ${a}.`)};function ka(a,e,t=""){e!=null&&(typeof e=="object"?Array.isArray(e)?e.forEach(s=>ka(a,s,t)):Object.keys(e).forEach(s=>ka(a,e[s],`${t}${t!==""?".":""}${s}`)):a.has(t)?a.append(t,e):a.set(t,e))}var y=function(a,...e){let t=new URLSearchParams(a.search);ka(t,e),a.search=t.toString()},S=function(a,e,t){let s=typeof a!="string";return(s&&t&&t.isJsonMime?t.isJsonMime(e.headers["Content-Type"]):s)?JSON.stringify(a!==void 0?a:{}):a||""},R=function(a){return a.pathname+a.search+a.hash},A=function(a,e,t,s){return(i=e,n=t)=>{let o={...a.options,url:(s?.basePath||n)+a.url};return i.request(o)}};var Lr=function(a){return{callAction:async(e,t={})=>{let s="/v1/chat/actions",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},configureIntegration:async(e,t={})=>{let s="/v1/chat/integrations/configure",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},createBot:async(e,t={})=>{let s="/v1/admin/bots",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},createConversation:async(e,t={})=>{let s="/v1/chat/conversations",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},createEvent:async(e,t={})=>{let s="/v1/chat/events",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},createFile:async(e,t={})=>{let s="/v1/storage/files",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},createIntegration:async(e,t={})=>{let s="/v1/admin/integrations",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},createMessage:async(e,t={})=>{let s="/v1/chat/messages",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},createUser:async(e,t={})=>{let s="/v1/chat/users",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},createWorkspaceMember:async(e,t={})=>{let s="/v1/admin/workspace-members",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},deleteBot:async(e,t={})=>{B("deleteBot","id",e);let s="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"DELETE",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},deleteConversation:async(e,t={})=>{B("deleteConversation","id",e);let s="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"DELETE",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},deleteFile:async(e,t={})=>{B("deleteFile","id",e);let s="/v1/storage/files/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"DELETE",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},deleteIntegration:async(e,t={})=>{B("deleteIntegration","id",e);let s="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"DELETE",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},deleteMessage:async(e,t={})=>{B("deleteMessage","id",e);let s="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"DELETE",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},deleteUser:async(e,t={})=>{B("deleteUser","id",e);let s="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"DELETE",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},deleteWorkspaceMember:async(e,t={})=>{B("deleteWorkspaceMember","id",e);let s="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"DELETE",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},downloadFile:async(e,t={})=>{B("downloadFile","id",e);let s="/v1/storage/files/{id}/download".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getBot:async(e,t={})=>{B("getBot","id",e);let s="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getBotAnalytics:async(e,t,s,i={})=>{B("getBotAnalytics","id",e),B("getBotAnalytics","startDate",t),B("getBotAnalytics","endDate",s);let n="/v1/admin/bots/{id}/analytics".replace("{id}",encodeURIComponent(String(e))),o=new URL(n,b),r;a&&(r=a.baseOptions);let p={method:"GET",...r,...i},c={},l={};t!==void 0&&(l.startDate=t),s!==void 0&&(l.endDate=s),y(o,l);let d=r&&r.headers?r.headers:{};return p.headers={...c,...d,...i.headers},{url:R(o),options:p}},getBotLogs:async(e,t={})=>{B("getBotLogs","id",e);let s="/v1/admin/bots/{id}/logs".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getBotWebchat:async(e,t,s={})=>{B("getBotWebchat","id",e),B("getBotWebchat","type",t);let i="/v1/admin/bots/{id}/webchat".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"GET",...o,...s},p={},c={};t!==void 0&&(c.type=t),y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},{url:R(n),options:r}},getConversation:async(e,t={})=>{B("getConversation","id",e);let s="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getEvent:async(e,t={})=>{B("getEvent","id",e);let s="/v1/chat/events/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getFile:async(e,t={})=>{B("getFile","id",e);let s="/v1/storage/files/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getIntegration:async(e,t={})=>{B("getIntegration","id",e);let s="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getIntegrationByName:async(e,t,s={})=>{B("getIntegrationByName","name",e),B("getIntegrationByName","version",t);let i="/v1/admin/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(e))).replace("{version}",encodeURIComponent(String(t))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"GET",...o,...s},p={};y(n,{});let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},{url:R(n),options:r}},getIntegrationLogs:async(e,t={})=>{B("getIntegrationLogs","id",e);let s="/v1/admin/integrations/{id}/logs".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getMessage:async(e,t={})=>{B("getMessage","id",e);let s="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getOrCreateConversation:async(e,t={})=>{let s="/v1/chat/conversations/get-or-create",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},getOrCreateMessage:async(e,t={})=>{let s="/v1/chat/messages/get-or-create",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},getOrCreateUser:async(e,t={})=>{let s="/v1/chat/users/get-or-create",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},getPublicIntegration:async(e,t,s={})=>{B("getPublicIntegration","name",e),B("getPublicIntegration","version",t);let i="/v1/admin/hub/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(e))).replace("{version}",encodeURIComponent(String(t))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"GET",...o,...s},p={};y(n,{});let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},{url:R(n),options:r}},getPublicIntegrationById:async(e,t={})=>{B("getPublicIntegrationById","id",e);let s="/v1/admin/hub/integrations/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getState:async(e,t,s,i={})=>{B("getState","type",e),B("getState","id",t),B("getState","name",s);let n="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(e))).replace("{id}",encodeURIComponent(String(t))).replace("{name}",encodeURIComponent(String(s))),o=new URL(n,b),r;a&&(r=a.baseOptions);let p={method:"GET",...r,...i},c={};y(o,{});let d=r&&r.headers?r.headers:{};return p.headers={...c,...d,...i.headers},{url:R(o),options:p}},getUser:async(e,t={})=>{B("getUser","id",e);let s="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},getWorkspace:async(e,t={})=>{B("getWorkspace","id",e);let s="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(e))),i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={};y(i,{});let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},introspect:async(e,t={})=>{let s="/v1/admin/introspect",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"POST",...n,...t},r={},p={};r["Content-Type"]="application/json",y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},o.data=S(e,o,a),{url:R(i),options:o}},listBots:async(e,t={})=>{let s="/v1/admin/bots",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={},p={};e!==void 0&&(p.nextToken=e),y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},listConversations:async(e,t,s,i={})=>{let n="/v1/chat/conversations",o=new URL(n,b),r;a&&(r=a.baseOptions);let p={method:"GET",...r,...i},c={},l={};e!==void 0&&(l.nextToken=e),t!==void 0&&(l.tags=t),s&&(l.participantIds=s),y(o,l);let d=r&&r.headers?r.headers:{};return p.headers={...c,...d,...i.headers},{url:R(o),options:p}},listEvents:async(e,t,s={})=>{let i="/v1/chat/events",n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"GET",...o,...s},p={},c={};e!==void 0&&(c.nextToken=e),t!==void 0&&(c.type=t),y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},{url:R(n),options:r}},listFiles:async(e,t,s={})=>{B("listFiles","botId",e);let i="/v1/storage/files",n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"GET",...o,...s},p={},c={};t!==void 0&&(c.nextToken=t),e!==void 0&&(c.botId=e),y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},{url:R(n),options:r}},listIntegrations:async(e,t,s,i={})=>{let n="/v1/admin/integrations",o=new URL(n,b),r;a&&(r=a.baseOptions);let p={method:"GET",...r,...i},c={},l={};e!==void 0&&(l.nextToken=e),t!==void 0&&(l.name=t),s!==void 0&&(l.version=s),y(o,l);let d=r&&r.headers?r.headers:{};return p.headers={...c,...d,...i.headers},{url:R(o),options:p}},listMessages:async(e,t,s,i={})=>{let n="/v1/chat/messages",o=new URL(n,b),r;a&&(r=a.baseOptions);let p={method:"GET",...r,...i},c={},l={};e!==void 0&&(l.nextToken=e),t!==void 0&&(l.conversationId=t),s!==void 0&&(l.tags=s),y(o,l);let d=r&&r.headers?r.headers:{};return p.headers={...c,...d,...i.headers},{url:R(o),options:p}},listPublicIntegrations:async(e,t,s,i={})=>{let n="/v1/admin/hub/integrations",o=new URL(n,b),r;a&&(r=a.baseOptions);let p={method:"GET",...r,...i},c={},l={};e!==void 0&&(l.nextToken=e),t!==void 0&&(l.name=t),s!==void 0&&(l.version=s),y(o,l);let d=r&&r.headers?r.headers:{};return p.headers={...c,...d,...i.headers},{url:R(o),options:p}},listUsers:async(e,t,s,i={})=>{let n="/v1/chat/users",o=new URL(n,b),r;a&&(r=a.baseOptions);let p={method:"GET",...r,...i},c={},l={};e!==void 0&&(l.nextToken=e),t!==void 0&&(l.conversationId=t),s!==void 0&&(l.tags=s),y(o,l);let d=r&&r.headers?r.headers:{};return p.headers={...c,...d,...i.headers},{url:R(o),options:p}},listWorkspaceMembers:async(e,t={})=>{let s="/v1/admin/workspace-members",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={},p={};e!==void 0&&(p.nextToken=e),y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},listWorkspaces:async(e,t={})=>{let s="/v1/admin/workspaces",i=new URL(s,b),n;a&&(n=a.baseOptions);let o={method:"GET",...n,...t},r={},p={};e!==void 0&&(p.nextToken=e),y(i,p);let c=n&&n.headers?n.headers:{};return o.headers={...r,...c,...t.headers},{url:R(i),options:o}},patchState:async(e,t,s,i,n={})=>{B("patchState","type",e),B("patchState","id",t),B("patchState","name",s);let o="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(e))).replace("{id}",encodeURIComponent(String(t))).replace("{name}",encodeURIComponent(String(s))),r=new URL(o,b),p;a&&(p=a.baseOptions);let c={method:"PATCH",...p,...n},l={},d={};l["Content-Type"]="application/json",y(r,d);let f=p&&p.headers?p.headers:{};return c.headers={...l,...f,...n.headers},c.data=S(i,c,a),{url:R(r),options:c}},setState:async(e,t,s,i,n={})=>{B("setState","type",e),B("setState","id",t),B("setState","name",s);let o="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(e))).replace("{id}",encodeURIComponent(String(t))).replace("{name}",encodeURIComponent(String(s))),r=new URL(o,b),p;a&&(p=a.baseOptions);let c={method:"POST",...p,...n},l={},d={};l["Content-Type"]="application/json",y(r,d);let f=p&&p.headers?p.headers:{};return c.headers={...l,...f,...n.headers},c.data=S(i,c,a),{url:R(r),options:c}},transferBot:async(e,t,s={})=>{B("transferBot","id",e);let i="/v1/admin/bots/{id}/transfer".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"POST",...o,...s},p={},c={};p["Content-Type"]="application/json",y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},r.data=S(t,r,a),{url:R(n),options:r}},updateBot:async(e,t,s={})=>{B("updateBot","id",e);let i="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"PUT",...o,...s},p={},c={};p["Content-Type"]="application/json",y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},r.data=S(t,r,a),{url:R(n),options:r}},updateConversation:async(e,t,s={})=>{B("updateConversation","id",e);let i="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"PUT",...o,...s},p={},c={};p["Content-Type"]="application/json",y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},r.data=S(t,r,a),{url:R(n),options:r}},updateIntegration:async(e,t,s={})=>{B("updateIntegration","id",e);let i="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"PUT",...o,...s},p={},c={};p["Content-Type"]="application/json",y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},r.data=S(t,r,a),{url:R(n),options:r}},updateMessage:async(e,t,s={})=>{B("updateMessage","id",e);let i="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"PUT",...o,...s},p={},c={};p["Content-Type"]="application/json",y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},r.data=S(t,r,a),{url:R(n),options:r}},updateUser:async(e,t,s={})=>{B("updateUser","id",e);let i="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"PUT",...o,...s},p={},c={};p["Content-Type"]="application/json",y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},r.data=S(t,r,a),{url:R(n),options:r}},updateWorkspace:async(e,t,s={})=>{B("updateWorkspace","id",e);let i="/v1/admin/workspaces/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"PUT",...o,...s},p={},c={};p["Content-Type"]="application/json",y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},r.data=S(t,r,a),{url:R(n),options:r}},updateWorkspaceMember:async(e,t,s={})=>{B("updateWorkspaceMember","id",e);let i="/v1/admin/workspace-members/{id}".replace("{id}",encodeURIComponent(String(e))),n=new URL(i,b),o;a&&(o=a.baseOptions);let r={method:"PUT",...o,...s},p={},c={};p["Content-Type"]="application/json",y(n,c);let l=o&&o.headers?o.headers:{};return r.headers={...p,...l,...s.headers},r.data=S(t,r,a),{url:R(n),options:r}}}},C=function(a){let e=Lr(a);return{async callAction(t,s){let i=await e.callAction(t,s);return A(i,x,g,a)},async configureIntegration(t,s){let i=await e.configureIntegration(t,s);return A(i,x,g,a)},async createBot(t,s){let i=await e.createBot(t,s);return A(i,x,g,a)},async createConversation(t,s){let i=await e.createConversation(t,s);return A(i,x,g,a)},async createEvent(t,s){let i=await e.createEvent(t,s);return A(i,x,g,a)},async createFile(t,s){let i=await e.createFile(t,s);return A(i,x,g,a)},async createIntegration(t,s){let i=await e.createIntegration(t,s);return A(i,x,g,a)},async createMessage(t,s){let i=await e.createMessage(t,s);return A(i,x,g,a)},async createUser(t,s){let i=await e.createUser(t,s);return A(i,x,g,a)},async createWorkspaceMember(t,s){let i=await e.createWorkspaceMember(t,s);return A(i,x,g,a)},async deleteBot(t,s){let i=await e.deleteBot(t,s);return A(i,x,g,a)},async deleteConversation(t,s){let i=await e.deleteConversation(t,s);return A(i,x,g,a)},async deleteFile(t,s){let i=await e.deleteFile(t,s);return A(i,x,g,a)},async deleteIntegration(t,s){let i=await e.deleteIntegration(t,s);return A(i,x,g,a)},async deleteMessage(t,s){let i=await e.deleteMessage(t,s);return A(i,x,g,a)},async deleteUser(t,s){let i=await e.deleteUser(t,s);return A(i,x,g,a)},async deleteWorkspaceMember(t,s){let i=await e.deleteWorkspaceMember(t,s);return A(i,x,g,a)},async downloadFile(t,s){let i=await e.downloadFile(t,s);return A(i,x,g,a)},async getBot(t,s){let i=await e.getBot(t,s);return A(i,x,g,a)},async getBotAnalytics(t,s,i,n){let o=await e.getBotAnalytics(t,s,i,n);return A(o,x,g,a)},async getBotLogs(t,s){let i=await e.getBotLogs(t,s);return A(i,x,g,a)},async getBotWebchat(t,s,i){let n=await e.getBotWebchat(t,s,i);return A(n,x,g,a)},async getConversation(t,s){let i=await e.getConversation(t,s);return A(i,x,g,a)},async getEvent(t,s){let i=await e.getEvent(t,s);return A(i,x,g,a)},async getFile(t,s){let i=await e.getFile(t,s);return A(i,x,g,a)},async getIntegration(t,s){let i=await e.getIntegration(t,s);return A(i,x,g,a)},async getIntegrationByName(t,s,i){let n=await e.getIntegrationByName(t,s,i);return A(n,x,g,a)},async getIntegrationLogs(t,s){let i=await e.getIntegrationLogs(t,s);return A(i,x,g,a)},async getMessage(t,s){let i=await e.getMessage(t,s);return A(i,x,g,a)},async getOrCreateConversation(t,s){let i=await e.getOrCreateConversation(t,s);return A(i,x,g,a)},async getOrCreateMessage(t,s){let i=await e.getOrCreateMessage(t,s);return A(i,x,g,a)},async getOrCreateUser(t,s){let i=await e.getOrCreateUser(t,s);return A(i,x,g,a)},async getPublicIntegration(t,s,i){let n=await e.getPublicIntegration(t,s,i);return A(n,x,g,a)},async getPublicIntegrationById(t,s){let i=await e.getPublicIntegrationById(t,s);return A(i,x,g,a)},async getState(t,s,i,n){let o=await e.getState(t,s,i,n);return A(o,x,g,a)},async getUser(t,s){let i=await e.getUser(t,s);return A(i,x,g,a)},async getWorkspace(t,s){let i=await e.getWorkspace(t,s);return A(i,x,g,a)},async introspect(t,s){let i=await e.introspect(t,s);return A(i,x,g,a)},async listBots(t,s){let i=await e.listBots(t,s);return A(i,x,g,a)},async listConversations(t,s,i,n){let o=await e.listConversations(t,s,i,n);return A(o,x,g,a)},async listEvents(t,s,i){let n=await e.listEvents(t,s,i);return A(n,x,g,a)},async listFiles(t,s,i){let n=await e.listFiles(t,s,i);return A(n,x,g,a)},async listIntegrations(t,s,i,n){let o=await e.listIntegrations(t,s,i,n);return A(o,x,g,a)},async listMessages(t,s,i,n){let o=await e.listMessages(t,s,i,n);return A(o,x,g,a)},async listPublicIntegrations(t,s,i,n){let o=await e.listPublicIntegrations(t,s,i,n);return A(o,x,g,a)},async listUsers(t,s,i,n){let o=await e.listUsers(t,s,i,n);return A(o,x,g,a)},async listWorkspaceMembers(t,s){let i=await e.listWorkspaceMembers(t,s);return A(i,x,g,a)},async listWorkspaces(t,s){let i=await e.listWorkspaces(t,s);return A(i,x,g,a)},async patchState(t,s,i,n,o){let r=await e.patchState(t,s,i,n,o);return A(r,x,g,a)},async setState(t,s,i,n,o){let r=await e.setState(t,s,i,n,o);return A(r,x,g,a)},async transferBot(t,s,i){let n=await e.transferBot(t,s,i);return A(n,x,g,a)},async updateBot(t,s,i){let n=await e.updateBot(t,s,i);return A(n,x,g,a)},async updateConversation(t,s,i){let n=await e.updateConversation(t,s,i);return A(n,x,g,a)},async updateIntegration(t,s,i){let n=await e.updateIntegration(t,s,i);return A(n,x,g,a)},async updateMessage(t,s,i){let n=await e.updateMessage(t,s,i);return A(n,x,g,a)},async updateUser(t,s,i){let n=await e.updateUser(t,s,i);return A(n,x,g,a)},async updateWorkspace(t,s,i){let n=await e.updateWorkspace(t,s,i);return A(n,x,g,a)},async updateWorkspaceMember(t,s,i){let n=await e.updateWorkspaceMember(t,s,i);return A(n,x,g,a)}}};var Vt=class extends St{callAction(e={},t){return C(this.configuration).callAction(e.callActionBody,t).then(s=>s(this.axios,this.basePath))}configureIntegration(e={},t){return C(this.configuration).configureIntegration(e.configureIntegrationBody,t).then(s=>s(this.axios,this.basePath))}createBot(e={},t){return C(this.configuration).createBot(e.createBotBody,t).then(s=>s(this.axios,this.basePath))}createConversation(e={},t){return C(this.configuration).createConversation(e.createConversationBody,t).then(s=>s(this.axios,this.basePath))}createEvent(e={},t){return C(this.configuration).createEvent(e.createEventBody,t).then(s=>s(this.axios,this.basePath))}createFile(e={},t){return C(this.configuration).createFile(e.createFileBody,t).then(s=>s(this.axios,this.basePath))}createIntegration(e={},t){return C(this.configuration).createIntegration(e.createIntegrationBody,t).then(s=>s(this.axios,this.basePath))}createMessage(e={},t){return C(this.configuration).createMessage(e.createMessageBody,t).then(s=>s(this.axios,this.basePath))}createUser(e={},t){return C(this.configuration).createUser(e.createUserBody,t).then(s=>s(this.axios,this.basePath))}createWorkspaceMember(e={},t){return C(this.configuration).createWorkspaceMember(e.createWorkspaceMemberBody,t).then(s=>s(this.axios,this.basePath))}deleteBot(e,t){return C(this.configuration).deleteBot(e.id,t).then(s=>s(this.axios,this.basePath))}deleteConversation(e,t){return C(this.configuration).deleteConversation(e.id,t).then(s=>s(this.axios,this.basePath))}deleteFile(e,t){return C(this.configuration).deleteFile(e.id,t).then(s=>s(this.axios,this.basePath))}deleteIntegration(e,t){return C(this.configuration).deleteIntegration(e.id,t).then(s=>s(this.axios,this.basePath))}deleteMessage(e,t){return C(this.configuration).deleteMessage(e.id,t).then(s=>s(this.axios,this.basePath))}deleteUser(e,t){return C(this.configuration).deleteUser(e.id,t).then(s=>s(this.axios,this.basePath))}deleteWorkspaceMember(e,t){return C(this.configuration).deleteWorkspaceMember(e.id,t).then(s=>s(this.axios,this.basePath))}downloadFile(e,t){return C(this.configuration).downloadFile(e.id,t).then(s=>s(this.axios,this.basePath))}getBot(e,t){return C(this.configuration).getBot(e.id,t).then(s=>s(this.axios,this.basePath))}getBotAnalytics(e,t){return C(this.configuration).getBotAnalytics(e.id,e.startDate,e.endDate,t).then(s=>s(this.axios,this.basePath))}getBotLogs(e,t){return C(this.configuration).getBotLogs(e.id,t).then(s=>s(this.axios,this.basePath))}getBotWebchat(e,t){return C(this.configuration).getBotWebchat(e.id,e.type,t).then(s=>s(this.axios,this.basePath))}getConversation(e,t){return C(this.configuration).getConversation(e.id,t).then(s=>s(this.axios,this.basePath))}getEvent(e,t){return C(this.configuration).getEvent(e.id,t).then(s=>s(this.axios,this.basePath))}getFile(e,t){return C(this.configuration).getFile(e.id,t).then(s=>s(this.axios,this.basePath))}getIntegration(e,t){return C(this.configuration).getIntegration(e.id,t).then(s=>s(this.axios,this.basePath))}getIntegrationByName(e,t){return C(this.configuration).getIntegrationByName(e.name,e.version,t).then(s=>s(this.axios,this.basePath))}getIntegrationLogs(e,t){return C(this.configuration).getIntegrationLogs(e.id,t).then(s=>s(this.axios,this.basePath))}getMessage(e,t){return C(this.configuration).getMessage(e.id,t).then(s=>s(this.axios,this.basePath))}getOrCreateConversation(e={},t){return C(this.configuration).getOrCreateConversation(e.getOrCreateConversationBody,t).then(s=>s(this.axios,this.basePath))}getOrCreateMessage(e={},t){return C(this.configuration).getOrCreateMessage(e.getOrCreateMessageBody,t).then(s=>s(this.axios,this.basePath))}getOrCreateUser(e={},t){return C(this.configuration).getOrCreateUser(e.getOrCreateUserBody,t).then(s=>s(this.axios,this.basePath))}getPublicIntegration(e,t){return C(this.configuration).getPublicIntegration(e.name,e.version,t).then(s=>s(this.axios,this.basePath))}getPublicIntegrationById(e,t){return C(this.configuration).getPublicIntegrationById(e.id,t).then(s=>s(this.axios,this.basePath))}getState(e,t){return C(this.configuration).getState(e.type,e.id,e.name,t).then(s=>s(this.axios,this.basePath))}getUser(e,t){return C(this.configuration).getUser(e.id,t).then(s=>s(this.axios,this.basePath))}getWorkspace(e,t){return C(this.configuration).getWorkspace(e.id,t).then(s=>s(this.axios,this.basePath))}introspect(e={},t){return C(this.configuration).introspect(e.introspectBody,t).then(s=>s(this.axios,this.basePath))}listBots(e={},t){return C(this.configuration).listBots(e.nextToken,t).then(s=>s(this.axios,this.basePath))}listConversations(e={},t){return C(this.configuration).listConversations(e.nextToken,e.tags,e.participantIds,t).then(s=>s(this.axios,this.basePath))}listEvents(e={},t){return C(this.configuration).listEvents(e.nextToken,e.type,t).then(s=>s(this.axios,this.basePath))}listFiles(e,t){return C(this.configuration).listFiles(e.botId,e.nextToken,t).then(s=>s(this.axios,this.basePath))}listIntegrations(e={},t){return C(this.configuration).listIntegrations(e.nextToken,e.name,e.version,t).then(s=>s(this.axios,this.basePath))}listMessages(e={},t){return C(this.configuration).listMessages(e.nextToken,e.conversationId,e.tags,t).then(s=>s(this.axios,this.basePath))}listPublicIntegrations(e={},t){return C(this.configuration).listPublicIntegrations(e.nextToken,e.name,e.version,t).then(s=>s(this.axios,this.basePath))}listUsers(e={},t){return C(this.configuration).listUsers(e.nextToken,e.conversationId,e.tags,t).then(s=>s(this.axios,this.basePath))}listWorkspaceMembers(e={},t){return C(this.configuration).listWorkspaceMembers(e.nextToken,t).then(s=>s(this.axios,this.basePath))}listWorkspaces(e={},t){return C(this.configuration).listWorkspaces(e.nextToken,t).then(s=>s(this.axios,this.basePath))}patchState(e,t){return C(this.configuration).patchState(e.type,e.id,e.name,e.patchStateBody,t).then(s=>s(this.axios,this.basePath))}setState(e,t){return C(this.configuration).setState(e.type,e.id,e.name,e.setStateBody,t).then(s=>s(this.axios,this.basePath))}transferBot(e,t){return C(this.configuration).transferBot(e.id,e.transferBotBody,t).then(s=>s(this.axios,this.basePath))}updateBot(e,t){return C(this.configuration).updateBot(e.id,e.updateBotBody,t).then(s=>s(this.axios,this.basePath))}updateConversation(e,t){return C(this.configuration).updateConversation(e.id,e.updateConversationBody,t).then(s=>s(this.axios,this.basePath))}updateIntegration(e,t){return C(this.configuration).updateIntegration(e.id,e.updateIntegrationBody,t).then(s=>s(this.axios,this.basePath))}updateMessage(e,t){return C(this.configuration).updateMessage(e.id,e.updateMessageBody,t).then(s=>s(this.axios,this.basePath))}updateUser(e,t){return C(this.configuration).updateUser(e.id,e.updateUserBody,t).then(s=>s(this.axios,this.basePath))}updateWorkspace(e,t){return C(this.configuration).updateWorkspace(e.id,e.updateWorkspaceBody,t).then(s=>s(this.axios,this.basePath))}updateWorkspaceMember(e,t){return C(this.configuration).updateWorkspaceMember(e.id,e.updateWorkspaceMemberBody,t).then(s=>s(this.axios,this.basePath))}};var _t=class{_innerClient;constructor(e,t,s){this._innerClient=new Vt(e,t,s)}createConversation=e=>this._innerClient.createConversation({createConversationBody:e}).then(t=>t.data).catch(t=>{throw w(t)});getConversation=e=>this._innerClient.getConversation(e).then(t=>t.data).catch(t=>{throw w(t)});listConversations=e=>this._innerClient.listConversations(e).then(t=>t.data).catch(t=>{throw w(t)});getOrCreateConversation=e=>this._innerClient.getOrCreateConversation({getOrCreateConversationBody:e}).then(t=>t.data).catch(t=>{throw w(t)});updateConversation=({id:e,...t})=>this._innerClient.updateConversation({id:e,updateConversationBody:t}).then(s=>s.data).catch(s=>{throw w(s)});deleteConversation=e=>this._innerClient.deleteConversation(e).then(t=>t.data).catch(t=>{throw w(t)});createEvent=e=>this._innerClient.createEvent({createEventBody:e}).then(t=>t.data).catch(t=>{throw w(t)});getEvent=e=>this._innerClient.getEvent(e).then(t=>t.data).catch(t=>{throw w(t)});listEvents=e=>this._innerClient.listEvents(e).then(t=>t.data).catch(t=>{throw w(t)});createMessage=e=>this._innerClient.createMessage({createMessageBody:e}).then(t=>t.data).catch(t=>{throw w(t)});getOrCreateMessage=e=>this._innerClient.getOrCreateMessage({getOrCreateMessageBody:e}).then(t=>t.data).catch(t=>{throw w(t)});getMessage=e=>this._innerClient.getMessage(e).then(t=>t.data).catch(t=>{throw w(t)});updateMessage=({id:e,...t})=>this._innerClient.updateMessage({id:e,updateMessageBody:t}).then(s=>s.data).catch(s=>{throw w(s)});listMessages=e=>this._innerClient.listMessages(e).then(t=>t.data).catch(t=>{throw w(t)});deleteMessage=e=>this._innerClient.deleteMessage(e).then(t=>t.data).catch(t=>{throw w(t)});createUser=e=>this._innerClient.createUser({createUserBody:e}).then(t=>t.data).catch(t=>{throw w(t)});getUser=e=>this._innerClient.getUser(e).then(t=>t.data).catch(t=>{throw w(t)});listUsers=e=>this._innerClient.listUsers(e).then(t=>t.data).catch(t=>{throw w(t)});getOrCreateUser=e=>this._innerClient.getOrCreateUser({getOrCreateUserBody:e}).then(t=>t.data).catch(t=>{throw w(t)});updateUser=({id:e,...t})=>this._innerClient.updateUser({id:e,updateUserBody:t}).then(s=>s.data).catch(s=>{throw w(s)});deleteUser=e=>this._innerClient.deleteUser(e).then(t=>t.data).catch(t=>{throw w(t)});getState=e=>this._innerClient.getState(e).then(t=>t.data).catch(t=>{throw w(t)});setState=({type:e,id:t,name:s,...i})=>this._innerClient.setState({type:e,id:t,name:s,setStateBody:i}).then(n=>n.data).catch(n=>{throw w(n)});patchState=({type:e,id:t,name:s,...i})=>this._innerClient.patchState({type:e,id:t,name:s,patchStateBody:i}).then(n=>n.data).catch(n=>{throw w(n)});callAction=e=>this._innerClient.callAction({callActionBody:e}).then(t=>t.data).catch(t=>{throw w(t)});configureIntegration=e=>this._innerClient.configureIntegration({configureIntegrationBody:e}).then(t=>t.data).catch(t=>{throw w(t)});listPublicIntegrations=e=>this._innerClient.listPublicIntegrations(e).then(t=>t.data).catch(t=>{throw w(t)});getPublicIntegrationById=e=>this._innerClient.getPublicIntegrationById(e).then(t=>t.data).catch(t=>{throw w(t)});getPublicIntegration=e=>this._innerClient.getPublicIntegration(e).then(t=>t.data).catch(t=>{throw w(t)});createBot=e=>this._innerClient.createBot({createBotBody:e}).then(t=>t.data).catch(t=>{throw w(t)});updateBot=({id:e,...t})=>this._innerClient.updateBot({id:e,updateBotBody:t}).then(s=>s.data).catch(s=>{throw w(s)});transferBot=({id:e,...t})=>this._innerClient.transferBot({id:e,transferBotBody:t}).then(s=>s.data).catch(s=>{throw w(s)});listBots=e=>this._innerClient.listBots(e).then(t=>t.data).catch(t=>{throw w(t)});getBot=e=>this._innerClient.getBot(e).then(t=>t.data).catch(t=>{throw w(t)});deleteBot=e=>this._innerClient.deleteBot(e).then(t=>t.data).catch(t=>{throw w(t)});getBotLogs=e=>this._innerClient.getBotLogs(e).then(t=>t.data).catch(t=>{throw w(t)});getBotWebchat=e=>this._innerClient.getBotWebchat(e).then(t=>t.data).catch(t=>{throw w(t)});getBotAnalytics=e=>this._innerClient.getBotAnalytics(e).then(t=>t.data).catch(t=>{throw w(t)});getWorkspace=e=>this._innerClient.getWorkspace(e).then(t=>t.data).catch(t=>{throw w(t)});updateWorkspace=({id:e,...t})=>this._innerClient.updateWorkspace({id:e,updateWorkspaceBody:t}).then(s=>s.data).catch(s=>{throw w(s)});listWorkspaces=e=>this._innerClient.listWorkspaces(e).then(t=>t.data).catch(t=>{throw w(t)});createIntegration=e=>this._innerClient.createIntegration({createIntegrationBody:e}).then(t=>t.data).catch(t=>{throw w(t)});updateIntegration=({id:e,...t})=>this._innerClient.updateIntegration({id:e,updateIntegrationBody:t}).then(s=>s.data).catch(s=>{throw w(s)});listIntegrations=e=>this._innerClient.listIntegrations(e).then(t=>t.data).catch(t=>{throw w(t)});getIntegration=e=>this._innerClient.getIntegration(e).then(t=>t.data).catch(t=>{throw w(t)});getIntegrationLogs=e=>this._innerClient.getIntegrationLogs(e).then(t=>t.data).catch(t=>{throw w(t)});getIntegrationByName=e=>this._innerClient.getIntegrationByName(e).then(t=>t.data).catch(t=>{throw w(t)});deleteIntegration=e=>this._innerClient.deleteIntegration(e).then(t=>t.data).catch(t=>{throw w(t)});listWorkspaceMembers=e=>this._innerClient.listWorkspaceMembers(e).then(t=>t.data).catch(t=>{throw w(t)});deleteWorkspaceMember=e=>this._innerClient.deleteWorkspaceMember(e).then(t=>t.data).catch(t=>{throw w(t)});createWorkspaceMember=e=>this._innerClient.createWorkspaceMember({createWorkspaceMemberBody:e}).then(t=>t.data).catch(t=>{throw w(t)});updateWorkspaceMember=({id:e,...t})=>this._innerClient.updateWorkspaceMember({id:e,updateWorkspaceMemberBody:t}).then(s=>s.data).catch(s=>{throw w(s)});introspect=e=>this._innerClient.introspect({introspectBody:e}).then(t=>t.data).catch(t=>{throw w(t)});createFile=e=>this._innerClient.createFile({createFileBody:e}).then(t=>t.data).catch(t=>{throw w(t)});getFile=e=>this._innerClient.getFile(e).then(t=>t.data).catch(t=>{throw w(t)});downloadFile=e=>this._innerClient.downloadFile(e).then(t=>t.data).catch(t=>{throw w(t)});deleteFile=e=>this._innerClient.deleteFile(e).then(t=>t.data).catch(t=>{throw w(t)});listFiles=e=>this._innerClient.listFiles(e).then(t=>t.data).catch(t=>{throw w(t)})};function w(a){return x.isAxiosError(a)?Ot(a.response?.data):Ot(a)}var qa=class extends _t{config;constructor(e={}){let t=Tn(e),{host:s,headers:i,withCredentials:n,timeout:o}=t,r=x.create({maxBodyLength:100*1024*1024,maxContentLength:1024*1024*1024,timeout:o??6e4,withCredentials:n,headers:i});super(void 0,s,r),this.config=t}};0&&(module.exports={AlreadyExistsError,Client,ForbiddenError,InternalError,InvalidDataFormatError,InvalidIdentifierError,InvalidJsonSchemaError,InvalidPayloadError,InvalidQueryError,MethodNotFoundError,PayloadTooLargeError,RateLimitedError,ReferenceNotFoundError,RelationConflictError,ResourceNotFoundError,RuntimeError,UnauthorizedError,UnknownError,UnsupportedMediaTypeError,axios,errorFrom,isApiError});
9
9
  /*! Bundled license information:
10
10
 
11
11
  mime-db/index.js: