@botpress/client 0.0.5 → 0.0.7

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/index.es.js DELETED
@@ -1,3 +0,0 @@
1
- var $t=Object.create;var Ze=Object.defineProperty;var Jt=Object.getOwnPropertyDescriptor;var Wt=Object.getOwnPropertyNames;var Kt=Object.getPrototypeOf,zt=Object.prototype.hasOwnProperty;var et=(s,t)=>()=>(t||s((t={exports:{}}).exports,t),t.exports);var Yt=(s,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Wt(t))!zt.call(s,o)&&o!==e&&Ze(s,o,{get:()=>t[o],enumerable:!(r=Jt(t,o))||r.enumerable});return s};var tt=(s,t,e)=>(e=s!=null?$t(Kt(s)):{},Yt(t||!s||!s.__esModule?Ze(e,"default",{value:s,enumerable:!0}):e,s));var gt=et((Br,dt)=>{dt.exports=typeof self=="object"?self.FormData:window.FormData});var Gt=et(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});var Js=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},Ws=typeof window<"u"&&typeof window.document<"u",Ks=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,zs=(typeof self>"u"?"undefined":Js(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",Ys=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Xs=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";N.isBrowser=Ws;N.isWebWorker=zs;N.isNode=Ks;N.isJsDom=Ys;N.isDeno=Xs});function K(s,t){return function(){return s.apply(t,arguments)}}var{toString:rt}=Object.prototype,{getPrototypeOf:be}=Object,Be=(s=>t=>{let e=rt.call(t);return s[e]||(s[e]=e.slice(8,-1).toLowerCase())})(Object.create(null)),V=s=>(s=s.toLowerCase(),t=>Be(t)===s),ie=s=>t=>typeof t===s,{isArray:H}=Array,z=ie("undefined");function Xt(s){return s!==null&&!z(s)&&s.constructor!==null&&!z(s.constructor)&&k(s.constructor.isBuffer)&&s.constructor.isBuffer(s)}var nt=V("ArrayBuffer");function Zt(s){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(s):t=s&&s.buffer&&nt(s.buffer),t}var es=ie("string"),k=ie("function"),ot=ie("number"),Ie=s=>s!==null&&typeof s=="object",ts=s=>s===!0||s===!1,ae=s=>{if(Be(s)!=="object")return!1;let t=be(s);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in s)&&!(Symbol.iterator in s)},ss=V("Date"),rs=V("File"),ns=V("Blob"),os=V("FileList"),as=s=>Ie(s)&&k(s.pipe),is=s=>{let t="[object FormData]";return s&&(typeof FormData=="function"&&s instanceof FormData||rt.call(s)===t||k(s.toString)&&s.toString()===t)},ls=V("URLSearchParams"),cs=s=>s.trim?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Y(s,t,{allOwnKeys:e=!1}={}){if(s===null||typeof s>"u")return;let r,o;if(typeof s!="object"&&(s=[s]),H(s))for(r=0,o=s.length;r<o;r++)t.call(null,s[r],r,s);else{let n=e?Object.getOwnPropertyNames(s):Object.keys(s),a=n.length,i;for(r=0;r<a;r++)i=n[r],t.call(null,s[i],i,s)}}function at(s,t){t=t.toLowerCase();let e=Object.keys(s),r=e.length,o;for(;r-- >0;)if(o=e[r],t===o.toLowerCase())return o;return null}var it=(()=>typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global)(),lt=s=>!z(s)&&s!==it;function Pe(){let{caseless:s}=lt(this)&&this||{},t={},e=(r,o)=>{let n=s&&at(t,o)||o;ae(t[n])&&ae(r)?t[n]=Pe(t[n],r):ae(r)?t[n]=Pe({},r):H(r)?t[n]=r.slice():t[n]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&Y(arguments[r],e);return t}var us=(s,t,e,{allOwnKeys:r}={})=>(Y(t,(o,n)=>{e&&k(o)?s[n]=K(o,e):s[n]=o},{allOwnKeys:r}),s),ps=s=>(s.charCodeAt(0)===65279&&(s=s.slice(1)),s),ds=(s,t,e,r)=>{s.prototype=Object.create(t.prototype,r),s.prototype.constructor=s,Object.defineProperty(s,"super",{value:t.prototype}),e&&Object.assign(s.prototype,e)},gs=(s,t,e,r)=>{let o,n,a,i={};if(t=t||{},s==null)return t;do{for(o=Object.getOwnPropertyNames(s),n=o.length;n-- >0;)a=o[n],(!r||r(a,s,t))&&!i[a]&&(t[a]=s[a],i[a]=!0);s=e!==!1&&be(s)}while(s&&(!e||e(s,t))&&s!==Object.prototype);return t},fs=(s,t,e)=>{s=String(s),(e===void 0||e>s.length)&&(e=s.length),e-=t.length;let r=s.indexOf(t,e);return r!==-1&&r===e},hs=s=>{if(!s)return null;if(H(s))return s;let t=s.length;if(!ot(t))return null;let e=new Array(t);for(;t-- >0;)e[t]=s[t];return e},ys=(s=>t=>s&&t instanceof s)(typeof Uint8Array<"u"&&be(Uint8Array)),ms=(s,t)=>{let r=(s&&s[Symbol.iterator]).call(s),o;for(;(o=r.next())&&!o.done;){let n=o.value;t.call(s,n[0],n[1])}},As=(s,t)=>{let e,r=[];for(;(e=s.exec(t))!==null;)r.push(e);return r},xs=V("HTMLFormElement"),Rs=s=>s.toLowerCase().replace(/[_-\s]([a-z\d])(\w*)/g,function(e,r,o){return r.toUpperCase()+o}),st=(({hasOwnProperty:s})=>(t,e)=>s.call(t,e))(Object.prototype),Cs=V("RegExp"),ct=(s,t)=>{let e=Object.getOwnPropertyDescriptors(s),r={};Y(e,(o,n)=>{t(o,n,s)!==!1&&(r[n]=o)}),Object.defineProperties(s,r)},Ps=s=>{ct(s,(t,e)=>{if(k(s)&&["arguments","caller","callee"].indexOf(e)!==-1)return!1;let r=s[e];if(k(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+e+"'")})}})},bs=(s,t)=>{let e={},r=o=>{o.forEach(n=>{e[n]=!0})};return H(s)?r(s):r(String(s).split(t)),e},Bs=()=>{},Is=(s,t)=>(s=+s,Number.isFinite(s)?s:t),Os=s=>{let t=new Array(10),e=(r,o)=>{if(Ie(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;let n=H(r)?[]:{};return Y(r,(a,i)=>{let c=e(a,o+1);!z(c)&&(n[i]=c)}),t[o]=void 0,n}}return r};return e(s,0)},u={isArray:H,isArrayBuffer:nt,isBuffer:Xt,isFormData:is,isArrayBufferView:Zt,isString:es,isNumber:ot,isBoolean:ts,isObject:Ie,isPlainObject:ae,isUndefined:z,isDate:ss,isFile:rs,isBlob:ns,isRegExp:Cs,isFunction:k,isStream:as,isURLSearchParams:ls,isTypedArray:ys,isFileList:os,forEach:Y,merge:Pe,extend:us,trim:cs,stripBOM:ps,inherits:ds,toFlatObject:gs,kindOf:Be,kindOfTest:V,endsWith:fs,toArray:hs,forEachEntry:ms,matchAll:As,isHTMLForm:xs,hasOwnProperty:st,hasOwnProp:st,reduceDescriptors:ct,freezeMethods:Ps,toObjectSet:bs,toCamelCase:Rs,noop:Bs,toFiniteNumber:Is,findKey:at,global:it,isContextDefined:lt,toJSONObject:Os};function Q(s,t,e,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=s,this.name="AxiosError",t&&(this.code=t),e&&(this.config=e),r&&(this.request=r),o&&(this.response=o)}u.inherits(Q,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 ut=Q.prototype,pt={};["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(s=>{pt[s]={value:s}});Object.defineProperties(Q,pt);Object.defineProperty(ut,"isAxiosError",{value:!0});Q.from=(s,t,e,r,o,n)=>{let a=Object.create(ut);return u.toFlatObject(s,a,function(c){return c!==Error.prototype},i=>i!=="isAxiosError"),Q.call(a,s.message,t,e,r,o),a.cause=s,a.name=s.name,n&&Object.assign(a,n),a};var b=Q;var ft=tt(gt(),1),ht=ft.default;function Oe(s){return u.isPlainObject(s)||u.isArray(s)}function mt(s){return u.endsWith(s,"[]")?s.slice(0,-2):s}function yt(s,t,e){return s?s.concat(t).map(function(o,n){return o=mt(o),!e&&n?"["+o+"]":o}).join(e?".":""):t}function qs(s){return u.isArray(s)&&!s.some(Oe)}var Us=u.toFlatObject(u,{},null,function(t){return/^is[A-Z]/.test(t)});function vs(s){return s&&u.isFunction(s.append)&&s[Symbol.toStringTag]==="FormData"&&s[Symbol.iterator]}function Es(s,t,e){if(!u.isObject(s))throw new TypeError("target must be an object");t=t||new(ht||FormData),e=u.toFlatObject(e,{metaTokens:!0,dots:!1,indexes:!1},!1,function(B,T){return!u.isUndefined(T[B])});let r=e.metaTokens,o=e.visitor||p,n=e.dots,a=e.indexes,c=(e.Blob||typeof Blob<"u"&&Blob)&&vs(t);if(!u.isFunction(o))throw new TypeError("visitor must be a function");function l(f){if(f===null)return"";if(u.isDate(f))return f.toISOString();if(!c&&u.isBlob(f))throw new b("Blob is not supported. Use a Buffer instead.");return u.isArrayBuffer(f)||u.isTypedArray(f)?c&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function p(f,B,T){let S=f;if(f&&!T&&typeof f=="object"){if(u.endsWith(B,"{}"))B=r?B:B.slice(0,-2),f=JSON.stringify(f);else if(u.isArray(f)&&qs(f)||u.isFileList(f)||u.endsWith(B,"[]")&&(S=u.toArray(f)))return B=mt(B),S.forEach(function(oe,Qt){!(u.isUndefined(oe)||oe===null)&&t.append(a===!0?yt([B],Qt,n):a===null?B:B+"[]",l(oe))}),!1}return Oe(f)?!0:(t.append(yt(T,B,n),l(f)),!1)}let g=[],O=Object.assign(Us,{defaultVisitor:p,convertValue:l,isVisitable:Oe});function I(f,B){if(!u.isUndefined(f)){if(g.indexOf(f)!==-1)throw Error("Circular reference detected in "+B.join("."));g.push(f),u.forEach(f,function(S,j){(!(u.isUndefined(S)||S===null)&&o.call(t,S,u.isString(j)?j.trim():j,B,O))===!0&&I(S,B?B.concat(j):[j])}),g.pop()}}if(!u.isObject(s))throw new TypeError("data must be an object");return I(s),t}var F=Es;function At(s){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(s).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function xt(s,t){this._pairs=[],s&&F(s,this,t)}var Rt=xt.prototype;Rt.append=function(t,e){this._pairs.push([t,e])};Rt.toString=function(t){let e=t?function(r){return t.call(this,r,At)}:At;return this._pairs.map(function(o){return e(o[0])+"="+e(o[1])},"").join("&")};var le=xt;function ws(s){return encodeURIComponent(s).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function X(s,t,e){if(!t)return s;let r=e&&e.encode||ws,o=e&&e.serialize,n;if(o?n=o(t,e):n=u.isURLSearchParams(t)?t.toString():new le(t,e).toString(r),n){let a=s.indexOf("#");a!==-1&&(s=s.slice(0,a)),s+=(s.indexOf("?")===-1?"?":"&")+n}return s}var qe=class{constructor(){this.handlers=[]}use(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){u.forEach(this.handlers,function(r){r!==null&&t(r)})}},Ue=qe;var ce={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Ct=typeof URLSearchParams<"u"?URLSearchParams:le;var Pt=FormData;var Ss=(()=>{let s;return typeof navigator<"u"&&((s=navigator.product)==="ReactNative"||s==="NativeScript"||s==="NS")?!1:typeof window<"u"&&typeof document<"u"})(),Ds=(()=>typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function")(),v={isBrowser:!0,classes:{URLSearchParams:Ct,FormData:Pt,Blob},isStandardBrowserEnv:Ss,isStandardBrowserWebWorkerEnv:Ds,protocols:["http","https","file","blob","url","data"]};function ve(s,t){return F(s,new v.classes.URLSearchParams,Object.assign({visitor:function(e,r,o,n){return v.isNode&&u.isBuffer(e)?(this.append(r,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}function Ts(s){return u.matchAll(/\w+|\[(\w*)]/g,s).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Vs(s){let t={},e=Object.keys(s),r,o=e.length,n;for(r=0;r<o;r++)n=e[r],t[n]=s[n];return t}function Ms(s){function t(e,r,o,n){let a=e[n++],i=Number.isFinite(+a),c=n>=e.length;return a=!a&&u.isArray(o)?o.length:a,c?(u.hasOwnProp(o,a)?o[a]=[o[a],r]:o[a]=r,!i):((!o[a]||!u.isObject(o[a]))&&(o[a]=[]),t(e,r,o[a],n)&&u.isArray(o[a])&&(o[a]=Vs(o[a])),!i)}if(u.isFormData(s)&&u.isFunction(s.entries)){let e={};return u.forEachEntry(s,(r,o)=>{t(Ts(r),o,e,0)}),e}return null}var ue=Ms;var Fs={"Content-Type":void 0};function Ls(s,t,e){if(u.isString(s))try{return(t||JSON.parse)(s),u.trim(s)}catch(r){if(r.name!=="SyntaxError")throw r}return(e||JSON.stringify)(s)}var pe={transitional:ce,adapter:["xhr","http"],transformRequest:[function(t,e){let r=e.getContentType()||"",o=r.indexOf("application/json")>-1,n=u.isObject(t);if(n&&u.isHTMLForm(t)&&(t=new FormData(t)),u.isFormData(t))return o&&o?JSON.stringify(ue(t)):t;if(u.isArrayBuffer(t)||u.isBuffer(t)||u.isStream(t)||u.isFile(t)||u.isBlob(t))return t;if(u.isArrayBufferView(t))return t.buffer;if(u.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(n){if(r.indexOf("application/x-www-form-urlencoded")>-1)return ve(t,this.formSerializer).toString();if((i=u.isFileList(t))||r.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return F(i?{"files[]":t}:t,c&&new c,this.formSerializer)}}return n||o?(e.setContentType("application/json",!1),Ls(t)):t}],transformResponse:[function(t){let e=this.transitional||pe.transitional,r=e&&e.forcedJSONParsing,o=this.responseType==="json";if(t&&u.isString(t)&&(r&&!this.responseType||o)){let a=!(e&&e.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(i){if(a)throw i.name==="SyntaxError"?b.from(i,b.ERR_BAD_RESPONSE,this,null,this.response):i}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:v.classes.FormData,Blob:v.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};u.forEach(["delete","get","head"],function(t){pe.headers[t]={}});u.forEach(["post","put","patch"],function(t){pe.headers[t]=u.merge(Fs)});var $=pe;var Gs=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"]),bt=s=>{let t={},e,r,o;return s&&s.split(`
2
- `).forEach(function(a){o=a.indexOf(":"),e=a.substring(0,o).trim().toLowerCase(),r=a.substring(o+1).trim(),!(!e||t[e]&&Gs[e])&&(e==="set-cookie"?t[e]?t[e].push(r):t[e]=[r]:t[e]=t[e]?t[e]+", "+r:r)}),t};var Bt=Symbol("internals");function Z(s){return s&&String(s).trim().toLowerCase()}function de(s){return s===!1||s==null?s:u.isArray(s)?s.map(de):String(s)}function ks(s){let t=Object.create(null),e=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,r;for(;r=e.exec(s);)t[r[1]]=r[2];return t}function Ns(s){return/^[-_a-zA-Z]+$/.test(s.trim())}function It(s,t,e,r){if(u.isFunction(r))return r.call(this,t,e);if(u.isString(t)){if(u.isString(r))return t.indexOf(r)!==-1;if(u.isRegExp(r))return r.test(t)}}function _s(s){return s.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,r)=>e.toUpperCase()+r)}function js(s,t){let e=u.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(s,r+e,{value:function(o,n,a){return this[r].call(this,t,o,n,a)},configurable:!0})})}var J=class{constructor(t){t&&this.set(t)}set(t,e,r){let o=this;function n(i,c,l){let p=Z(c);if(!p)throw new Error("header name must be a non-empty string");let g=u.findKey(o,p);(!g||o[g]===void 0||l===!0||l===void 0&&o[g]!==!1)&&(o[g||c]=de(i))}let a=(i,c)=>u.forEach(i,(l,p)=>n(l,p,c));return u.isPlainObject(t)||t instanceof this.constructor?a(t,e):u.isString(t)&&(t=t.trim())&&!Ns(t)?a(bt(t),e):t!=null&&n(e,t,r),this}get(t,e){if(t=Z(t),t){let r=u.findKey(this,t);if(r){let o=this[r];if(!e)return o;if(e===!0)return ks(o);if(u.isFunction(e))return e.call(this,o,r);if(u.isRegExp(e))return e.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Z(t),t){let r=u.findKey(this,t);return!!(r&&(!e||It(this,this[r],r,e)))}return!1}delete(t,e){let r=this,o=!1;function n(a){if(a=Z(a),a){let i=u.findKey(r,a);i&&(!e||It(r,r[i],i,e))&&(delete r[i],o=!0)}}return u.isArray(t)?t.forEach(n):n(t),o}clear(){return Object.keys(this).forEach(this.delete.bind(this))}normalize(t){let e=this,r={};return u.forEach(this,(o,n)=>{let a=u.findKey(r,n);if(a){e[a]=de(o),delete e[n];return}let i=t?_s(n):String(n).trim();i!==n&&delete e[n],e[i]=de(o),r[i]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let e=Object.create(null);return u.forEach(this,(r,o)=>{r!=null&&r!==!1&&(e[o]=t&&u.isArray(r)?r.join(", "):r)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join(`
3
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){let r=new this(t);return e.forEach(o=>r.set(o)),r}static accessor(t){let r=(this[Bt]=this[Bt]={accessors:{}}).accessors,o=this.prototype;function n(a){let i=Z(a);r[i]||(js(o,a),r[i]=!0)}return u.isArray(t)?t.forEach(n):n(t),this}};J.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent"]);u.freezeMethods(J.prototype);u.freezeMethods(J);var w=J;function ee(s,t){let e=this||$,r=t||e,o=w.from(r.headers),n=r.data;return u.forEach(s,function(i){n=i.call(e,n,o.normalize(),t?t.status:void 0)}),o.normalize(),n}function te(s){return!!(s&&s.__CANCEL__)}function Ot(s,t,e){b.call(this,s??"canceled",b.ERR_CANCELED,t,e),this.name="CanceledError"}u.inherits(Ot,b,{__CANCEL__:!0});var L=Ot;var qt=null;function Ee(s,t,e){let r=e.config.validateStatus;!e.status||!r||r(e.status)?s(e):t(new b("Request failed with status code "+e.status,[b.ERR_BAD_REQUEST,b.ERR_BAD_RESPONSE][Math.floor(e.status/100)-4],e.config,e.request,e))}var Ut=v.isStandardBrowserEnv?function(){return{write:function(e,r,o,n,a,i){let c=[];c.push(e+"="+encodeURIComponent(r)),u.isNumber(o)&&c.push("expires="+new Date(o).toGMTString()),u.isString(n)&&c.push("path="+n),u.isString(a)&&c.push("domain="+a),i===!0&&c.push("secure"),document.cookie=c.join("; ")},read:function(e){let r=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return r?decodeURIComponent(r[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}();function we(s){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(s)}function Se(s,t){return t?s.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):s}function se(s,t){return s&&!we(t)?Se(s,t):t}var vt=v.isStandardBrowserEnv?function(){let t=/(msie|trident)/i.test(navigator.userAgent),e=document.createElement("a"),r;function o(n){let a=n;return t&&(e.setAttribute("href",a),a=e.href),e.setAttribute("href",a),{href:e.href,protocol:e.protocol?e.protocol.replace(/:$/,""):"",host:e.host,search:e.search?e.search.replace(/^\?/,""):"",hash:e.hash?e.hash.replace(/^#/,""):"",hostname:e.hostname,port:e.port,pathname:e.pathname.charAt(0)==="/"?e.pathname:"/"+e.pathname}}return r=o(window.location.href),function(a){let i=u.isString(a)?o(a):a;return i.protocol===r.protocol&&i.host===r.host}}():function(){return function(){return!0}}();function De(s){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(s);return t&&t[1]||""}function Hs(s,t){s=s||10;let e=new Array(s),r=new Array(s),o=0,n=0,a;return t=t!==void 0?t:1e3,function(c){let l=Date.now(),p=r[n];a||(a=l),e[o]=c,r[o]=l;let g=n,O=0;for(;g!==o;)O+=e[g++],g=g%s;if(o=(o+1)%s,o===n&&(n=(n+1)%s),l-a<t)return;let I=p&&l-p;return I?Math.round(O*1e3/I):void 0}}var Et=Hs;function wt(s,t){let e=0,r=Et(50,250);return o=>{let n=o.loaded,a=o.lengthComputable?o.total:void 0,i=n-e,c=r(i),l=n<=a;e=n;let p={loaded:n,total:a,progress:a?n/a:void 0,bytes:i,rate:c||void 0,estimated:c&&a&&l?(a-n)/c:void 0,event:o};p[t?"download":"upload"]=!0,s(p)}}var Qs=typeof XMLHttpRequest<"u",St=Qs&&function(s){return new Promise(function(e,r){let o=s.data,n=w.from(s.headers).normalize(),a=s.responseType,i;function c(){s.cancelToken&&s.cancelToken.unsubscribe(i),s.signal&&s.signal.removeEventListener("abort",i)}u.isFormData(o)&&(v.isStandardBrowserEnv||v.isStandardBrowserWebWorkerEnv)&&n.setContentType(!1);let l=new XMLHttpRequest;if(s.auth){let I=s.auth.username||"",f=s.auth.password?unescape(encodeURIComponent(s.auth.password)):"";n.set("Authorization","Basic "+btoa(I+":"+f))}let p=se(s.baseURL,s.url);l.open(s.method.toUpperCase(),X(p,s.params,s.paramsSerializer),!0),l.timeout=s.timeout;function g(){if(!l)return;let I=w.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders()),B={data:!a||a==="text"||a==="json"?l.responseText:l.response,status:l.status,statusText:l.statusText,headers:I,config:s,request:l};Ee(function(S){e(S),c()},function(S){r(S),c()},B),l=null}if("onloadend"in l?l.onloadend=g:l.onreadystatechange=function(){!l||l.readyState!==4||l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)||setTimeout(g)},l.onabort=function(){l&&(r(new b("Request aborted",b.ECONNABORTED,s,l)),l=null)},l.onerror=function(){r(new b("Network Error",b.ERR_NETWORK,s,l)),l=null},l.ontimeout=function(){let f=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded",B=s.transitional||ce;s.timeoutErrorMessage&&(f=s.timeoutErrorMessage),r(new b(f,B.clarifyTimeoutError?b.ETIMEDOUT:b.ECONNABORTED,s,l)),l=null},v.isStandardBrowserEnv){let I=(s.withCredentials||vt(p))&&s.xsrfCookieName&&Ut.read(s.xsrfCookieName);I&&n.set(s.xsrfHeaderName,I)}o===void 0&&n.setContentType(null),"setRequestHeader"in l&&u.forEach(n.toJSON(),function(f,B){l.setRequestHeader(B,f)}),u.isUndefined(s.withCredentials)||(l.withCredentials=!!s.withCredentials),a&&a!=="json"&&(l.responseType=s.responseType),typeof s.onDownloadProgress=="function"&&l.addEventListener("progress",wt(s.onDownloadProgress,!0)),typeof s.onUploadProgress=="function"&&l.upload&&l.upload.addEventListener("progress",wt(s.onUploadProgress)),(s.cancelToken||s.signal)&&(i=I=>{l&&(r(!I||I.type?new L(null,s,l):I),l.abort(),l=null)},s.cancelToken&&s.cancelToken.subscribe(i),s.signal&&(s.signal.aborted?i():s.signal.addEventListener("abort",i)));let O=De(p);if(O&&v.protocols.indexOf(O)===-1){r(new b("Unsupported protocol "+O+":",b.ERR_BAD_REQUEST,s));return}l.send(o||null)})};var ge={http:qt,xhr:St};u.forEach(ge,(s,t)=>{if(s){try{Object.defineProperty(s,"name",{value:t})}catch{}Object.defineProperty(s,"adapterName",{value:t})}});var Dt={getAdapter:s=>{s=u.isArray(s)?s:[s];let{length:t}=s,e,r;for(let o=0;o<t&&(e=s[o],!(r=u.isString(e)?ge[e.toLowerCase()]:e));o++);if(!r)throw r===!1?new b(`Adapter ${e} is not supported by the environment`,"ERR_NOT_SUPPORT"):new Error(u.hasOwnProp(ge,e)?`Adapter '${e}' is not available in the build`:`Unknown adapter '${e}'`);if(!u.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:ge};function Te(s){if(s.cancelToken&&s.cancelToken.throwIfRequested(),s.signal&&s.signal.aborted)throw new L(null,s)}function fe(s){return Te(s),s.headers=w.from(s.headers),s.data=ee.call(s,s.transformRequest),["post","put","patch"].indexOf(s.method)!==-1&&s.headers.setContentType("application/x-www-form-urlencoded",!1),Dt.getAdapter(s.adapter||$.adapter)(s).then(function(r){return Te(s),r.data=ee.call(s,s.transformResponse,r),r.headers=w.from(r.headers),r},function(r){return te(r)||(Te(s),r&&r.response&&(r.response.data=ee.call(s,s.transformResponse,r.response),r.response.headers=w.from(r.response.headers))),Promise.reject(r)})}var Tt=s=>s instanceof w?s.toJSON():s;function M(s,t){t=t||{};let e={};function r(l,p,g){return u.isPlainObject(l)&&u.isPlainObject(p)?u.merge.call({caseless:g},l,p):u.isPlainObject(p)?u.merge({},p):u.isArray(p)?p.slice():p}function o(l,p,g){if(u.isUndefined(p)){if(!u.isUndefined(l))return r(void 0,l,g)}else return r(l,p,g)}function n(l,p){if(!u.isUndefined(p))return r(void 0,p)}function a(l,p){if(u.isUndefined(p)){if(!u.isUndefined(l))return r(void 0,l)}else return r(void 0,p)}function i(l,p,g){if(g in t)return r(l,p);if(g in s)return r(void 0,l)}let c={url:n,method:n,data:n,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:i,headers:(l,p)=>o(Tt(l),Tt(p),!0)};return u.forEach(Object.keys(s).concat(Object.keys(t)),function(p){let g=c[p]||o,O=g(s[p],t[p],p);u.isUndefined(O)&&g!==i||(e[p]=O)}),e}var he="1.2.5";var Ve={};["object","boolean","number","function","string","symbol"].forEach((s,t)=>{Ve[s]=function(r){return typeof r===s||"a"+(t<1?"n ":" ")+s}});var Vt={};Ve.transitional=function(t,e,r){function o(n,a){return"[Axios v"+he+"] Transitional option '"+n+"'"+a+(r?". "+r:"")}return(n,a,i)=>{if(t===!1)throw new b(o(a," has been removed"+(e?" in "+e:"")),b.ERR_DEPRECATED);return e&&!Vt[a]&&(Vt[a]=!0,console.warn(o(a," has been deprecated since v"+e+" and will be removed in the near future"))),t?t(n,a,i):!0}};function $s(s,t,e){if(typeof s!="object")throw new b("options must be an object",b.ERR_BAD_OPTION_VALUE);let r=Object.keys(s),o=r.length;for(;o-- >0;){let n=r[o],a=t[n];if(a){let i=s[n],c=i===void 0||a(i,n,s);if(c!==!0)throw new b("option "+n+" must be "+c,b.ERR_BAD_OPTION_VALUE);continue}if(e!==!0)throw new b("Unknown option "+n,b.ERR_BAD_OPTION)}}var ye={assertOptions:$s,validators:Ve};var G=ye.validators,W=class{constructor(t){this.defaults=t,this.interceptors={request:new Ue,response:new Ue}}request(t,e){typeof t=="string"?(e=e||{},e.url=t):e=t||{},e=M(this.defaults,e);let{transitional:r,paramsSerializer:o,headers:n}=e;r!==void 0&&ye.assertOptions(r,{silentJSONParsing:G.transitional(G.boolean),forcedJSONParsing:G.transitional(G.boolean),clarifyTimeoutError:G.transitional(G.boolean)},!1),o!==void 0&&ye.assertOptions(o,{encode:G.function,serialize:G.function},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let a;a=n&&u.merge(n.common,n[e.method]),a&&u.forEach(["delete","get","head","post","put","patch","common"],f=>{delete n[f]}),e.headers=w.concat(a,n);let i=[],c=!0;this.interceptors.request.forEach(function(B){typeof B.runWhen=="function"&&B.runWhen(e)===!1||(c=c&&B.synchronous,i.unshift(B.fulfilled,B.rejected))});let l=[];this.interceptors.response.forEach(function(B){l.push(B.fulfilled,B.rejected)});let p,g=0,O;if(!c){let f=[fe.bind(this),void 0];for(f.unshift.apply(f,i),f.push.apply(f,l),O=f.length,p=Promise.resolve(e);g<O;)p=p.then(f[g++],f[g++]);return p}O=i.length;let I=e;for(g=0;g<O;){let f=i[g++],B=i[g++];try{I=f(I)}catch(T){B.call(this,T);break}}try{p=fe.call(this,I)}catch(f){return Promise.reject(f)}for(g=0,O=l.length;g<O;)p=p.then(l[g++],l[g++]);return p}getUri(t){t=M(this.defaults,t);let e=se(t.baseURL,t.url);return X(e,t.params,t.paramsSerializer)}};u.forEach(["delete","get","head","options"],function(t){W.prototype[t]=function(e,r){return this.request(M(r||{},{method:t,url:e,data:(r||{}).data}))}});u.forEach(["post","put","patch"],function(t){function e(r){return function(n,a,i){return this.request(M(i||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:n,data:a}))}}W.prototype[t]=e(),W.prototype[t+"Form"]=e(!0)});var re=W;var ne=class{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(n){e=n});let r=this;this.promise.then(o=>{if(!r._listeners)return;let n=r._listeners.length;for(;n-- >0;)r._listeners[n](o);r._listeners=null}),this.promise.then=o=>{let n,a=new Promise(i=>{r.subscribe(i),n=i}).then(o);return a.cancel=function(){r.unsubscribe(n)},a},t(function(n,a,i){r.reason||(r.reason=new L(n,a,i),e(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let e=this._listeners.indexOf(t);e!==-1&&this._listeners.splice(e,1)}static source(){let t;return{token:new ne(function(o){t=o}),cancel:t}}},Mt=ne;function Me(s){return function(e){return s.apply(null,e)}}function Fe(s){return u.isObject(s)&&s.isAxiosError===!0}var Le={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(Le).forEach(([s,t])=>{Le[t]=s});var Ft=Le;function Lt(s){let t=new re(s),e=K(re.prototype.request,t);return u.extend(e,re.prototype,t,{allOwnKeys:!0}),u.extend(e,t,null,{allOwnKeys:!0}),e.create=function(o){return Lt(M(s,o))},e}var U=Lt($);U.Axios=re;U.CanceledError=L;U.CancelToken=Mt;U.isCancel=te;U.VERSION=he;U.toFormData=F;U.AxiosError=b;U.Cancel=U.CanceledError;U.all=function(t){return Promise.all(t)};U.spread=Me;U.isAxiosError=Fe;U.mergeConfig=M;U.AxiosHeaders=w;U.formToJSON=s=>ue(u.isHTMLForm(s)?new FormData(s):s);U.HttpStatusCode=Ft;U.default=U;var d=U;var{Axios:Ko,AxiosError:zo,CanceledError:Yo,isCancel:Xo,CancelToken:Zo,VERSION:ea,all:ta,Cancel:sa,isAxiosError:ra,spread:na,toFormData:oa,AxiosHeaders:Ge,HttpStatusCode:aa,formToJSON:ia,mergeConfig:la}=d;var _=tt(Gt()),me="https://api.botpress.cloud",Zs="https://oauth.botpress.cloud/oauth2/token",er="BP_API_URL",tr="BP_OAUTH_URL",sr="BP_BOT_ID",rr="BP_INTEGRATION_ID",nr="BP_WORKSPACE_ID",or="BP_ENV",ar="BP_TOKEN",ir="BP_CLIENT_KEY",lr="BP_CLIENT_SECRET";function kt(s){let t=cr(s),e={};return t.dev&&(e["x-bp-env"]="dev"),t.workspaceId&&(e["x-workspace-id"]=t.workspaceId),t.botId&&(e["x-bot-id"]=t.botId),t.integrationId&&(e["x-integration-id"]=t.integrationId),t.token?{authStrategy:"token",host:t.host??me,withCredentials:_.isBrowser,headers:e,token:t.token}:t.clientKey&&t.clientSecret&&t.oauthUrl?{authStrategy:"oauth",host:t.host??me,withCredentials:_.isBrowser,headers:e,clientKey:t.clientKey,clientSecret:t.clientSecret,oauthUrl:t.oauthUrl}:{host:t.host??me,withCredentials:_.isBrowser,headers:e,authStrategy:"none"}}function cr(s){return _.isBrowser?pr(s):_.isNode?ur(s):s}function ur(s){let t={...s,host:s.host??process.env[er]??me,oauthUrl:s.oauthUrl??process.env[tr]??Zs,botId:s.botId??process.env[sr],integrationId:s.integrationId??process.env[rr],workspaceId:s.workspaceId??process.env[nr],dev:s.dev??process.env[or]==="dev"},e=t.token??process.env[ar],r=t.clientKey??process.env[ir],o=t.clientSecret??process.env[lr];return e?t.token=e:r&&o&&(t.clientKey=r,t.clientSecret=o),t}function pr(s){return{...s,dev:s.dev??!0}}var h="https://api.botpress.cloud".replace(/\/+$/,"");var Ae=class{constructor(t,e=h,r=d){this.basePath=e;this.axios=r;t&&(this.configuration=t,this.basePath=t.basePath||this.basePath)}configuration},xe=class extends Error{constructor(e,r){super(r);this.field=e}name="RequiredError"};var y="https://example.com",P=function(s,t,e){if(e==null)throw new xe(t,`Required parameter ${t} was null or undefined when calling ${s}.`)};function ke(s,t,e=""){typeof t=="object"?Array.isArray(t)?t.forEach(r=>ke(s,r,e)):Object.keys(t).forEach(r=>ke(s,t[r],`${e}${e!==""?".":""}${r}`)):s.has(e)?s.append(e,t):s.set(e,t)}var m=function(s,...t){let e=new URLSearchParams(s.search);ke(e,t),s.search=e.toString()},q=function(s,t,e){let r=typeof s!="string";return(r&&e&&e.isJsonMime?e.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(s!==void 0?s:{}):s||""},A=function(s){return s.pathname+s.search+s.hash},x=function(s,t,e,r){return(o=t,n=e)=>{let a={...s.options,url:(r?.basePath||n)+s.url};return o.request(a)}};var dr=function(s){return{callAction:async(t,e={})=>{let r="/v1/chat/actions",o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"POST",...n,...e},i={},c={};i["Content-Type"]="application/json",m(o,c);let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},a.data=q(t,a,s),{url:A(o),options:a}},configureIntegration:async(t,e={})=>{let r="/v1/chat/integrations/configure",o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"POST",...n,...e},i={},c={};i["Content-Type"]="application/json",m(o,c);let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},a.data=q(t,a,s),{url:A(o),options:a}},createBot:async(t,e={})=>{let r="/v1/admin/bots",o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"POST",...n,...e},i={},c={};i["Content-Type"]="application/json",m(o,c);let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},a.data=q(t,a,s),{url:A(o),options:a}},createConversation:async(t,e={})=>{let r="/v1/chat/conversations",o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"POST",...n,...e},i={},c={};i["Content-Type"]="application/json",m(o,c);let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},a.data=q(t,a,s),{url:A(o),options:a}},createEvent:async(t,e={})=>{let r="/v1/chat/events",o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"POST",...n,...e},i={},c={};i["Content-Type"]="application/json",m(o,c);let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},a.data=q(t,a,s),{url:A(o),options:a}},createFile:async(t,e={})=>{let r="/v1/storage/files",o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"POST",...n,...e},i={},c={};i["Content-Type"]="application/json",m(o,c);let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},a.data=q(t,a,s),{url:A(o),options:a}},createIntegration:async(t,e={})=>{let r="/v1/admin/integrations",o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"POST",...n,...e},i={},c={};i["Content-Type"]="application/json",m(o,c);let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},a.data=q(t,a,s),{url:A(o),options:a}},createMessage:async(t,e={})=>{let r="/v1/chat/messages",o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"POST",...n,...e},i={},c={};i["Content-Type"]="application/json",m(o,c);let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},a.data=q(t,a,s),{url:A(o),options:a}},createUser:async(t,e={})=>{let r="/v1/chat/users",o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"POST",...n,...e},i={},c={};i["Content-Type"]="application/json",m(o,c);let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},a.data=q(t,a,s),{url:A(o),options:a}},deleteBot:async(t,e={})=>{P("deleteBot","id",t);let r="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"DELETE",...n,...e},i={};m(o,{});let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},deleteConversation:async(t,e={})=>{P("deleteConversation","id",t);let r="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"DELETE",...n,...e},i={};m(o,{});let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},deleteFile:async(t,e={})=>{P("deleteFile","id",t);let r="/v1/storage/files/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"DELETE",...n,...e},i={};m(o,{});let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},deleteIntegration:async(t,e={})=>{P("deleteIntegration","id",t);let r="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"DELETE",...n,...e},i={};m(o,{});let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},deleteMessage:async(t,e={})=>{P("deleteMessage","id",t);let r="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"DELETE",...n,...e},i={};m(o,{});let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},deleteUser:async(t,e={})=>{P("deleteUser","id",t);let r="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"DELETE",...n,...e},i={};m(o,{});let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},downloadFile:async(t,e={})=>{P("downloadFile","id",t);let r="/v1/storage/files/{id}/download".replace("{id}",encodeURIComponent(String(t))),o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"GET",...n,...e},i={};m(o,{});let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},getBot:async(t,e={})=>{P("getBot","id",t);let r="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"GET",...n,...e},i={};m(o,{});let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},getBotAnalytics:async(t,e,r,o={})=>{P("getBotAnalytics","id",t),P("getBotAnalytics","startDate",e),P("getBotAnalytics","endDate",r);let n="/v1/admin/bots/{id}/analytics".replace("{id}",encodeURIComponent(String(t))),a=new URL(n,y),i;s&&(i=s.baseOptions);let c={method:"GET",...i,...o},l={},p={};e!==void 0&&(p.startDate=e),r!==void 0&&(p.endDate=r),m(a,p);let g=i&&i.headers?i.headers:{};return c.headers={...l,...g,...o.headers},{url:A(a),options:c}},getBotLogs:async(t,e={})=>{P("getBotLogs","id",t);let r="/v1/admin/bots/{id}/logs".replace("{id}",encodeURIComponent(String(t))),o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"GET",...n,...e},i={};m(o,{});let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},getBotWebchat:async(t,e,r={})=>{P("getBotWebchat","id",t),P("getBotWebchat","type",e);let o="/v1/admin/bots/{id}/webchat".replace("{id}",encodeURIComponent(String(t))),n=new URL(o,y),a;s&&(a=s.baseOptions);let i={method:"GET",...a,...r},c={},l={};e!==void 0&&(l.type=e),m(n,l);let p=a&&a.headers?a.headers:{};return i.headers={...c,...p,...r.headers},{url:A(n),options:i}},getConversation:async(t,e={})=>{P("getConversation","id",t);let r="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"GET",...n,...e},i={};m(o,{});let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},getEvent:async(t,e={})=>{P("getEvent","id",t);let r="/v1/chat/events/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"GET",...n,...e},i={};m(o,{});let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},getFile:async(t,e={})=>{P("getFile","id",t);let r="/v1/storage/files/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"GET",...n,...e},i={};m(o,{});let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},getIntegration:async(t,e={})=>{P("getIntegration","id",t);let r="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"GET",...n,...e},i={};m(o,{});let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},getIntegrationByName:async(t,e,r={})=>{P("getIntegrationByName","name",t),P("getIntegrationByName","version",e);let o="/v1/admin/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(t))).replace("{version}",encodeURIComponent(String(e))),n=new URL(o,y),a;s&&(a=s.baseOptions);let i={method:"GET",...a,...r},c={};m(n,{});let p=a&&a.headers?a.headers:{};return i.headers={...c,...p,...r.headers},{url:A(n),options:i}},getMessage:async(t,e={})=>{P("getMessage","id",t);let r="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"GET",...n,...e},i={};m(o,{});let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},getOrCreateConversation:async(t,e={})=>{let r="/v1/chat/conversations/get-or-create",o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"POST",...n,...e},i={},c={};i["Content-Type"]="application/json",m(o,c);let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},a.data=q(t,a,s),{url:A(o),options:a}},getOrCreateMessage:async(t,e={})=>{let r="/v1/chat/messages/get-or-create",o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"POST",...n,...e},i={},c={};i["Content-Type"]="application/json",m(o,c);let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},a.data=q(t,a,s),{url:A(o),options:a}},getOrCreateUser:async(t,e={})=>{let r="/v1/chat/users/get-or-create",o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"POST",...n,...e},i={},c={};i["Content-Type"]="application/json",m(o,c);let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},a.data=q(t,a,s),{url:A(o),options:a}},getPublicIntegration:async(t,e,r={})=>{P("getPublicIntegration","name",t),P("getPublicIntegration","version",e);let o="/v1/admin/hub/integrations/{name}/{version}".replace("{name}",encodeURIComponent(String(t))).replace("{version}",encodeURIComponent(String(e))),n=new URL(o,y),a;s&&(a=s.baseOptions);let i={method:"GET",...a,...r},c={};m(n,{});let p=a&&a.headers?a.headers:{};return i.headers={...c,...p,...r.headers},{url:A(n),options:i}},getPublicIntegrationById:async(t,e={})=>{P("getPublicIntegrationById","id",t);let r="/v1/admin/hub/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"GET",...n,...e},i={};m(o,{});let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},getState:async(t,e,r,o={})=>{P("getState","type",t),P("getState","id",e),P("getState","name",r);let n="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(e))).replace("{name}",encodeURIComponent(String(r))),a=new URL(n,y),i;s&&(i=s.baseOptions);let c={method:"GET",...i,...o},l={};m(a,{});let g=i&&i.headers?i.headers:{};return c.headers={...l,...g,...o.headers},{url:A(a),options:c}},getUser:async(t,e={})=>{P("getUser","id",t);let r="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"GET",...n,...e},i={};m(o,{});let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},introspect:async(t,e={})=>{let r="/v1/admin/introspect",o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"POST",...n,...e},i={},c={};i["Content-Type"]="application/json",m(o,c);let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},a.data=q(t,a,s),{url:A(o),options:a}},listBots:async(t,e={})=>{let r="/v1/admin/bots",o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"GET",...n,...e},i={},c={};t!==void 0&&(c.nextToken=t),m(o,c);let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},listConversations:async(t,e,r,o={})=>{let n="/v1/chat/conversations",a=new URL(n,y),i;s&&(i=s.baseOptions);let c={method:"GET",...i,...o},l={},p={};t!==void 0&&(p.nextToken=t),e!==void 0&&(p.tags=e),r&&(p.participantIds=r),m(a,p);let g=i&&i.headers?i.headers:{};return c.headers={...l,...g,...o.headers},{url:A(a),options:c}},listEvents:async(t,e={})=>{let r="/v1/chat/events",o=new URL(r,y),n;s&&(n=s.baseOptions);let a={method:"GET",...n,...e},i={},c={};t!==void 0&&(c.nextToken=t),m(o,c);let l=n&&n.headers?n.headers:{};return a.headers={...i,...l,...e.headers},{url:A(o),options:a}},listFiles:async(t,e,r={})=>{P("listFiles","botId",t);let o="/v1/storage/files",n=new URL(o,y),a;s&&(a=s.baseOptions);let i={method:"GET",...a,...r},c={},l={};e!==void 0&&(l.nextToken=e),t!==void 0&&(l.botId=t),m(n,l);let p=a&&a.headers?a.headers:{};return i.headers={...c,...p,...r.headers},{url:A(n),options:i}},listIntegrations:async(t,e,r,o={})=>{let n="/v1/admin/integrations",a=new URL(n,y),i;s&&(i=s.baseOptions);let c={method:"GET",...i,...o},l={},p={};t!==void 0&&(p.nextToken=t),e!==void 0&&(p.name=e),r!==void 0&&(p.version=r),m(a,p);let g=i&&i.headers?i.headers:{};return c.headers={...l,...g,...o.headers},{url:A(a),options:c}},listMessages:async(t,e,r,o={})=>{let n="/v1/chat/messages",a=new URL(n,y),i;s&&(i=s.baseOptions);let c={method:"GET",...i,...o},l={},p={};t!==void 0&&(p.nextToken=t),e!==void 0&&(p.conversationId=e),r!==void 0&&(p.tags=r),m(a,p);let g=i&&i.headers?i.headers:{};return c.headers={...l,...g,...o.headers},{url:A(a),options:c}},listPublicIntegrations:async(t,e,r,o={})=>{let n="/v1/admin/hub/integrations",a=new URL(n,y),i;s&&(i=s.baseOptions);let c={method:"GET",...i,...o},l={},p={};t!==void 0&&(p.nextToken=t),e!==void 0&&(p.name=e),r!==void 0&&(p.version=r),m(a,p);let g=i&&i.headers?i.headers:{};return c.headers={...l,...g,...o.headers},{url:A(a),options:c}},listUsers:async(t,e,r,o={})=>{let n="/v1/chat/users",a=new URL(n,y),i;s&&(i=s.baseOptions);let c={method:"GET",...i,...o},l={},p={};t!==void 0&&(p.nextToken=t),e!==void 0&&(p.conversationId=e),r!==void 0&&(p.tags=r),m(a,p);let g=i&&i.headers?i.headers:{};return c.headers={...l,...g,...o.headers},{url:A(a),options:c}},patchState:async(t,e,r,o,n={})=>{P("patchState","type",t),P("patchState","id",e),P("patchState","name",r);let a="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(e))).replace("{name}",encodeURIComponent(String(r))),i=new URL(a,y),c;s&&(c=s.baseOptions);let l={method:"PATCH",...c,...n},p={},g={};p["Content-Type"]="application/json",m(i,g);let O=c&&c.headers?c.headers:{};return l.headers={...p,...O,...n.headers},l.data=q(o,l,s),{url:A(i),options:l}},setState:async(t,e,r,o,n={})=>{P("setState","type",t),P("setState","id",e),P("setState","name",r);let a="/v1/chat/states/{type}/{id}/{name}".replace("{type}",encodeURIComponent(String(t))).replace("{id}",encodeURIComponent(String(e))).replace("{name}",encodeURIComponent(String(r))),i=new URL(a,y),c;s&&(c=s.baseOptions);let l={method:"POST",...c,...n},p={},g={};p["Content-Type"]="application/json",m(i,g);let O=c&&c.headers?c.headers:{};return l.headers={...p,...O,...n.headers},l.data=q(o,l,s),{url:A(i),options:l}},updateBot:async(t,e,r={})=>{P("updateBot","id",t);let o="/v1/admin/bots/{id}".replace("{id}",encodeURIComponent(String(t))),n=new URL(o,y),a;s&&(a=s.baseOptions);let i={method:"PUT",...a,...r},c={},l={};c["Content-Type"]="application/json",m(n,l);let p=a&&a.headers?a.headers:{};return i.headers={...c,...p,...r.headers},i.data=q(e,i,s),{url:A(n),options:i}},updateConversation:async(t,e,r={})=>{P("updateConversation","id",t);let o="/v1/chat/conversations/{id}".replace("{id}",encodeURIComponent(String(t))),n=new URL(o,y),a;s&&(a=s.baseOptions);let i={method:"PUT",...a,...r},c={},l={};c["Content-Type"]="application/json",m(n,l);let p=a&&a.headers?a.headers:{};return i.headers={...c,...p,...r.headers},i.data=q(e,i,s),{url:A(n),options:i}},updateIntegration:async(t,e,r={})=>{P("updateIntegration","id",t);let o="/v1/admin/integrations/{id}".replace("{id}",encodeURIComponent(String(t))),n=new URL(o,y),a;s&&(a=s.baseOptions);let i={method:"PUT",...a,...r},c={},l={};c["Content-Type"]="application/json",m(n,l);let p=a&&a.headers?a.headers:{};return i.headers={...c,...p,...r.headers},i.data=q(e,i,s),{url:A(n),options:i}},updateMessage:async(t,e,r={})=>{P("updateMessage","id",t);let o="/v1/chat/messages/{id}".replace("{id}",encodeURIComponent(String(t))),n=new URL(o,y),a;s&&(a=s.baseOptions);let i={method:"PUT",...a,...r},c={},l={};c["Content-Type"]="application/json",m(n,l);let p=a&&a.headers?a.headers:{};return i.headers={...c,...p,...r.headers},i.data=q(e,i,s),{url:A(n),options:i}},updateUser:async(t,e,r={})=>{P("updateUser","id",t);let o="/v1/chat/users/{id}".replace("{id}",encodeURIComponent(String(t))),n=new URL(o,y),a;s&&(a=s.baseOptions);let i={method:"PUT",...a,...r},c={},l={};c["Content-Type"]="application/json",m(n,l);let p=a&&a.headers?a.headers:{};return i.headers={...c,...p,...r.headers},i.data=q(e,i,s),{url:A(n),options:i}}}},R=function(s){let t=dr(s);return{async callAction(e,r){let o=await t.callAction(e,r);return x(o,d,h,s)},async configureIntegration(e,r){let o=await t.configureIntegration(e,r);return x(o,d,h,s)},async createBot(e,r){let o=await t.createBot(e,r);return x(o,d,h,s)},async createConversation(e,r){let o=await t.createConversation(e,r);return x(o,d,h,s)},async createEvent(e,r){let o=await t.createEvent(e,r);return x(o,d,h,s)},async createFile(e,r){let o=await t.createFile(e,r);return x(o,d,h,s)},async createIntegration(e,r){let o=await t.createIntegration(e,r);return x(o,d,h,s)},async createMessage(e,r){let o=await t.createMessage(e,r);return x(o,d,h,s)},async createUser(e,r){let o=await t.createUser(e,r);return x(o,d,h,s)},async deleteBot(e,r){let o=await t.deleteBot(e,r);return x(o,d,h,s)},async deleteConversation(e,r){let o=await t.deleteConversation(e,r);return x(o,d,h,s)},async deleteFile(e,r){let o=await t.deleteFile(e,r);return x(o,d,h,s)},async deleteIntegration(e,r){let o=await t.deleteIntegration(e,r);return x(o,d,h,s)},async deleteMessage(e,r){let o=await t.deleteMessage(e,r);return x(o,d,h,s)},async deleteUser(e,r){let o=await t.deleteUser(e,r);return x(o,d,h,s)},async downloadFile(e,r){let o=await t.downloadFile(e,r);return x(o,d,h,s)},async getBot(e,r){let o=await t.getBot(e,r);return x(o,d,h,s)},async getBotAnalytics(e,r,o,n){let a=await t.getBotAnalytics(e,r,o,n);return x(a,d,h,s)},async getBotLogs(e,r){let o=await t.getBotLogs(e,r);return x(o,d,h,s)},async getBotWebchat(e,r,o){let n=await t.getBotWebchat(e,r,o);return x(n,d,h,s)},async getConversation(e,r){let o=await t.getConversation(e,r);return x(o,d,h,s)},async getEvent(e,r){let o=await t.getEvent(e,r);return x(o,d,h,s)},async getFile(e,r){let o=await t.getFile(e,r);return x(o,d,h,s)},async getIntegration(e,r){let o=await t.getIntegration(e,r);return x(o,d,h,s)},async getIntegrationByName(e,r,o){let n=await t.getIntegrationByName(e,r,o);return x(n,d,h,s)},async getMessage(e,r){let o=await t.getMessage(e,r);return x(o,d,h,s)},async getOrCreateConversation(e,r){let o=await t.getOrCreateConversation(e,r);return x(o,d,h,s)},async getOrCreateMessage(e,r){let o=await t.getOrCreateMessage(e,r);return x(o,d,h,s)},async getOrCreateUser(e,r){let o=await t.getOrCreateUser(e,r);return x(o,d,h,s)},async getPublicIntegration(e,r,o){let n=await t.getPublicIntegration(e,r,o);return x(n,d,h,s)},async getPublicIntegrationById(e,r){let o=await t.getPublicIntegrationById(e,r);return x(o,d,h,s)},async getState(e,r,o,n){let a=await t.getState(e,r,o,n);return x(a,d,h,s)},async getUser(e,r){let o=await t.getUser(e,r);return x(o,d,h,s)},async introspect(e,r){let o=await t.introspect(e,r);return x(o,d,h,s)},async listBots(e,r){let o=await t.listBots(e,r);return x(o,d,h,s)},async listConversations(e,r,o,n){let a=await t.listConversations(e,r,o,n);return x(a,d,h,s)},async listEvents(e,r){let o=await t.listEvents(e,r);return x(o,d,h,s)},async listFiles(e,r,o){let n=await t.listFiles(e,r,o);return x(n,d,h,s)},async listIntegrations(e,r,o,n){let a=await t.listIntegrations(e,r,o,n);return x(a,d,h,s)},async listMessages(e,r,o,n){let a=await t.listMessages(e,r,o,n);return x(a,d,h,s)},async listPublicIntegrations(e,r,o,n){let a=await t.listPublicIntegrations(e,r,o,n);return x(a,d,h,s)},async listUsers(e,r,o,n){let a=await t.listUsers(e,r,o,n);return x(a,d,h,s)},async patchState(e,r,o,n,a){let i=await t.patchState(e,r,o,n,a);return x(i,d,h,s)},async setState(e,r,o,n,a){let i=await t.setState(e,r,o,n,a);return x(i,d,h,s)},async updateBot(e,r,o){let n=await t.updateBot(e,r,o);return x(n,d,h,s)},async updateConversation(e,r,o){let n=await t.updateConversation(e,r,o);return x(n,d,h,s)},async updateIntegration(e,r,o){let n=await t.updateIntegration(e,r,o);return x(n,d,h,s)},async updateMessage(e,r,o){let n=await t.updateMessage(e,r,o);return x(n,d,h,s)},async updateUser(e,r,o){let n=await t.updateUser(e,r,o);return x(n,d,h,s)}}};var Re=class extends Ae{callAction(t={},e){return R(this.configuration).callAction(t.callActionBody,e).then(r=>r(this.axios,this.basePath))}configureIntegration(t={},e){return R(this.configuration).configureIntegration(t.configureIntegrationBody,e).then(r=>r(this.axios,this.basePath))}createBot(t={},e){return R(this.configuration).createBot(t.createBotBody,e).then(r=>r(this.axios,this.basePath))}createConversation(t={},e){return R(this.configuration).createConversation(t.createConversationBody,e).then(r=>r(this.axios,this.basePath))}createEvent(t={},e){return R(this.configuration).createEvent(t.createEventBody,e).then(r=>r(this.axios,this.basePath))}createFile(t={},e){return R(this.configuration).createFile(t.createFileBody,e).then(r=>r(this.axios,this.basePath))}createIntegration(t={},e){return R(this.configuration).createIntegration(t.createIntegrationBody,e).then(r=>r(this.axios,this.basePath))}createMessage(t={},e){return R(this.configuration).createMessage(t.createMessageBody,e).then(r=>r(this.axios,this.basePath))}createUser(t={},e){return R(this.configuration).createUser(t.createUserBody,e).then(r=>r(this.axios,this.basePath))}deleteBot(t,e){return R(this.configuration).deleteBot(t.id,e).then(r=>r(this.axios,this.basePath))}deleteConversation(t,e){return R(this.configuration).deleteConversation(t.id,e).then(r=>r(this.axios,this.basePath))}deleteFile(t,e){return R(this.configuration).deleteFile(t.id,e).then(r=>r(this.axios,this.basePath))}deleteIntegration(t,e){return R(this.configuration).deleteIntegration(t.id,e).then(r=>r(this.axios,this.basePath))}deleteMessage(t,e){return R(this.configuration).deleteMessage(t.id,e).then(r=>r(this.axios,this.basePath))}deleteUser(t,e){return R(this.configuration).deleteUser(t.id,e).then(r=>r(this.axios,this.basePath))}downloadFile(t,e){return R(this.configuration).downloadFile(t.id,e).then(r=>r(this.axios,this.basePath))}getBot(t,e){return R(this.configuration).getBot(t.id,e).then(r=>r(this.axios,this.basePath))}getBotAnalytics(t,e){return R(this.configuration).getBotAnalytics(t.id,t.startDate,t.endDate,e).then(r=>r(this.axios,this.basePath))}getBotLogs(t,e){return R(this.configuration).getBotLogs(t.id,e).then(r=>r(this.axios,this.basePath))}getBotWebchat(t,e){return R(this.configuration).getBotWebchat(t.id,t.type,e).then(r=>r(this.axios,this.basePath))}getConversation(t,e){return R(this.configuration).getConversation(t.id,e).then(r=>r(this.axios,this.basePath))}getEvent(t,e){return R(this.configuration).getEvent(t.id,e).then(r=>r(this.axios,this.basePath))}getFile(t,e){return R(this.configuration).getFile(t.id,e).then(r=>r(this.axios,this.basePath))}getIntegration(t,e){return R(this.configuration).getIntegration(t.id,e).then(r=>r(this.axios,this.basePath))}getIntegrationByName(t,e){return R(this.configuration).getIntegrationByName(t.name,t.version,e).then(r=>r(this.axios,this.basePath))}getMessage(t,e){return R(this.configuration).getMessage(t.id,e).then(r=>r(this.axios,this.basePath))}getOrCreateConversation(t={},e){return R(this.configuration).getOrCreateConversation(t.getOrCreateConversationBody,e).then(r=>r(this.axios,this.basePath))}getOrCreateMessage(t={},e){return R(this.configuration).getOrCreateMessage(t.getOrCreateMessageBody,e).then(r=>r(this.axios,this.basePath))}getOrCreateUser(t={},e){return R(this.configuration).getOrCreateUser(t.getOrCreateUserBody,e).then(r=>r(this.axios,this.basePath))}getPublicIntegration(t,e){return R(this.configuration).getPublicIntegration(t.name,t.version,e).then(r=>r(this.axios,this.basePath))}getPublicIntegrationById(t,e){return R(this.configuration).getPublicIntegrationById(t.id,e).then(r=>r(this.axios,this.basePath))}getState(t,e){return R(this.configuration).getState(t.type,t.id,t.name,e).then(r=>r(this.axios,this.basePath))}getUser(t,e){return R(this.configuration).getUser(t.id,e).then(r=>r(this.axios,this.basePath))}introspect(t={},e){return R(this.configuration).introspect(t.introspectBody,e).then(r=>r(this.axios,this.basePath))}listBots(t={},e){return R(this.configuration).listBots(t.nextToken,e).then(r=>r(this.axios,this.basePath))}listConversations(t={},e){return R(this.configuration).listConversations(t.nextToken,t.tags,t.participantIds,e).then(r=>r(this.axios,this.basePath))}listEvents(t={},e){return R(this.configuration).listEvents(t.nextToken,e).then(r=>r(this.axios,this.basePath))}listFiles(t,e){return R(this.configuration).listFiles(t.botId,t.nextToken,e).then(r=>r(this.axios,this.basePath))}listIntegrations(t={},e){return R(this.configuration).listIntegrations(t.nextToken,t.name,t.version,e).then(r=>r(this.axios,this.basePath))}listMessages(t={},e){return R(this.configuration).listMessages(t.nextToken,t.conversationId,t.tags,e).then(r=>r(this.axios,this.basePath))}listPublicIntegrations(t={},e){return R(this.configuration).listPublicIntegrations(t.nextToken,t.name,t.version,e).then(r=>r(this.axios,this.basePath))}listUsers(t={},e){return R(this.configuration).listUsers(t.nextToken,t.conversationId,t.tags,e).then(r=>r(this.axios,this.basePath))}patchState(t,e){return R(this.configuration).patchState(t.type,t.id,t.name,t.patchStateBody,e).then(r=>r(this.axios,this.basePath))}setState(t,e){return R(this.configuration).setState(t.type,t.id,t.name,t.setStateBody,e).then(r=>r(this.axios,this.basePath))}updateBot(t,e){return R(this.configuration).updateBot(t.id,t.updateBotBody,e).then(r=>r(this.axios,this.basePath))}updateConversation(t,e){return R(this.configuration).updateConversation(t.id,t.updateConversationBody,e).then(r=>r(this.axios,this.basePath))}updateIntegration(t,e){return R(this.configuration).updateIntegration(t.id,t.updateIntegrationBody,e).then(r=>r(this.axios,this.basePath))}updateMessage(t,e){return R(this.configuration).updateMessage(t.id,t.updateMessageBody,e).then(r=>r(this.axios,this.basePath))}updateUser(t,e){return R(this.configuration).updateUser(t.id,t.updateUserBody,e).then(r=>r(this.axios,this.basePath))}};var E=class extends Error{constructor(e,r,o,n,a){super(n);this.code=e;this.description=r;this.type=o;this.message=n;this.error=a}toJSON(){return{code:this.code,type:this.type,message:this.message}}},gr=s=>s instanceof E,D=class extends E{constructor(t,e){super(500,"An unknown error occurred","Unknown",t,e)}},Ne=class extends E{constructor(t,e){super(500,"An internal error occurred","Internal",t,e)}},_e=class extends E{constructor(t,e){super(403,"The requested action can't be peform by this resource.","Forbidden",t,e)}},je=class extends E{constructor(t,e){super(400,"The request payload isn't invalid.","InvalidPayload",t,e)}},He=class extends E{constructor(t,e){super(405,"The requested method does not exist.","MethodNotFound",t,e)}},Qe=class extends E{constructor(t,e){super(404,"The requested resource does not exist.","ResourceNotFound",t,e)}},$e=class extends E{constructor(t,e){super(400,"The provided JSON schema is invalid.","InvalidJsonSchema",t,e)}},Je=class extends E{constructor(t,e){super(400,"The provided data doesn't respect the provided JSON schema.","InvalidDataFormat",t,e)}},We=class extends E{constructor(t,e){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",t,e)}},Ke=class extends E{constructor(t,e){super(409,"The resource is not related with another resource. This is usually caused when providing two resources that aren't linked together.","RelationConflict",t,e)}},ze=class extends E{constructor(t,e){super(400,"The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.","ReferenceNotFound",t,e)}},Ye=class extends E{constructor(t,e){super(400,"The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.","InvalidQuery",t,e)}},fr={Unknown:D,Internal:Ne,Forbidden:_e,InvalidPayload:je,MethodNotFound:He,ResourceNotFound:Qe,InvalidJsonSchema:$e,InvalidDataFormat:Je,InvalidIdentifier:We,RelationConflict:Ke,ReferenceNotFound:ze,InvalidQuery:Ye},Xe=s=>s instanceof E?s:s instanceof Error?new D(s.message,s):s===null?new D("An unknown error occurred"):typeof s=="string"?new D(s):typeof s!="object"?new D("An unknown error occurred"):hr(s);function hr(s){if("code"in s&&"type"in s&&"message"in s){if(typeof s.message!="string")return new D("An unknown error occurred");if(typeof s.type!="string")return new D(s.message);let t=fr[s.type];return t?new t(s.message):new D(s.message)}return new D("An unknown error occurred")}var Ce=class{_innerClient;constructor(t,e,r){this._innerClient=new Re(t,e,r)}createConversation=t=>this._innerClient.createConversation({createConversationBody:t}).then(e=>e.data).catch(e=>{throw C(e)});getConversation=t=>this._innerClient.getConversation(t).then(e=>e.data).catch(e=>{throw C(e)});listConversations=t=>this._innerClient.listConversations(t).then(e=>e.data).catch(e=>{throw C(e)});getOrCreateConversation=t=>this._innerClient.getOrCreateConversation({getOrCreateConversationBody:t}).then(e=>e.data).catch(e=>{throw C(e)});updateConversation=({id:t,...e})=>this._innerClient.updateConversation({id:t,updateConversationBody:e}).then(r=>r.data).catch(r=>{throw C(r)});deleteConversation=t=>this._innerClient.deleteConversation(t).then(e=>e.data).catch(e=>{throw C(e)});createEvent=t=>this._innerClient.createEvent({createEventBody:t}).then(e=>e.data).catch(e=>{throw C(e)});getEvent=t=>this._innerClient.getEvent(t).then(e=>e.data).catch(e=>{throw C(e)});listEvents=t=>this._innerClient.listEvents(t).then(e=>e.data).catch(e=>{throw C(e)});createMessage=t=>this._innerClient.createMessage({createMessageBody:t}).then(e=>e.data).catch(e=>{throw C(e)});getOrCreateMessage=t=>this._innerClient.getOrCreateMessage({getOrCreateMessageBody:t}).then(e=>e.data).catch(e=>{throw C(e)});getMessage=t=>this._innerClient.getMessage(t).then(e=>e.data).catch(e=>{throw C(e)});updateMessage=({id:t,...e})=>this._innerClient.updateMessage({id:t,updateMessageBody:e}).then(r=>r.data).catch(r=>{throw C(r)});listMessages=t=>this._innerClient.listMessages(t).then(e=>e.data).catch(e=>{throw C(e)});deleteMessage=t=>this._innerClient.deleteMessage(t).then(e=>e.data).catch(e=>{throw C(e)});createUser=t=>this._innerClient.createUser({createUserBody:t}).then(e=>e.data).catch(e=>{throw C(e)});getUser=t=>this._innerClient.getUser(t).then(e=>e.data).catch(e=>{throw C(e)});listUsers=t=>this._innerClient.listUsers(t).then(e=>e.data).catch(e=>{throw C(e)});getOrCreateUser=t=>this._innerClient.getOrCreateUser({getOrCreateUserBody:t}).then(e=>e.data).catch(e=>{throw C(e)});updateUser=({id:t,...e})=>this._innerClient.updateUser({id:t,updateUserBody:e}).then(r=>r.data).catch(r=>{throw C(r)});deleteUser=t=>this._innerClient.deleteUser(t).then(e=>e.data).catch(e=>{throw C(e)});getState=t=>this._innerClient.getState(t).then(e=>e.data).catch(e=>{throw C(e)});setState=({type:t,id:e,name:r,...o})=>this._innerClient.setState({type:t,id:e,name:r,setStateBody:o}).then(n=>n.data).catch(n=>{throw C(n)});patchState=({type:t,id:e,name:r,...o})=>this._innerClient.patchState({type:t,id:e,name:r,patchStateBody:o}).then(n=>n.data).catch(n=>{throw C(n)});callAction=t=>this._innerClient.callAction({callActionBody:t}).then(e=>e.data).catch(e=>{throw C(e)});configureIntegration=t=>this._innerClient.configureIntegration({configureIntegrationBody:t}).then(e=>e.data).catch(e=>{throw C(e)});listPublicIntegrations=t=>this._innerClient.listPublicIntegrations(t).then(e=>e.data).catch(e=>{throw C(e)});getPublicIntegrationById=t=>this._innerClient.getPublicIntegrationById(t).then(e=>e.data).catch(e=>{throw C(e)});getPublicIntegration=t=>this._innerClient.getPublicIntegration(t).then(e=>e.data).catch(e=>{throw C(e)});createBot=t=>this._innerClient.createBot({createBotBody:t}).then(e=>e.data).catch(e=>{throw C(e)});updateBot=({id:t,...e})=>this._innerClient.updateBot({id:t,updateBotBody:e}).then(r=>r.data).catch(r=>{throw C(r)});listBots=t=>this._innerClient.listBots(t).then(e=>e.data).catch(e=>{throw C(e)});getBot=t=>this._innerClient.getBot(t).then(e=>e.data).catch(e=>{throw C(e)});deleteBot=t=>this._innerClient.deleteBot(t).then(e=>e.data).catch(e=>{throw C(e)});getBotLogs=t=>this._innerClient.getBotLogs(t).then(e=>e.data).catch(e=>{throw C(e)});getBotWebchat=t=>this._innerClient.getBotWebchat(t).then(e=>e.data).catch(e=>{throw C(e)});getBotAnalytics=t=>this._innerClient.getBotAnalytics(t).then(e=>e.data).catch(e=>{throw C(e)});createIntegration=t=>this._innerClient.createIntegration({createIntegrationBody:t}).then(e=>e.data).catch(e=>{throw C(e)});updateIntegration=({id:t,...e})=>this._innerClient.updateIntegration({id:t,updateIntegrationBody:e}).then(r=>r.data).catch(r=>{throw C(r)});listIntegrations=t=>this._innerClient.listIntegrations(t).then(e=>e.data).catch(e=>{throw C(e)});getIntegration=t=>this._innerClient.getIntegration(t).then(e=>e.data).catch(e=>{throw C(e)});getIntegrationByName=t=>this._innerClient.getIntegrationByName(t).then(e=>e.data).catch(e=>{throw C(e)});deleteIntegration=t=>this._innerClient.deleteIntegration(t).then(e=>e.data).catch(e=>{throw C(e)});introspect=t=>this._innerClient.introspect({introspectBody:t}).then(e=>e.data).catch(e=>{throw C(e)});createFile=t=>this._innerClient.createFile({createFileBody:t}).then(e=>e.data).catch(e=>{throw C(e)});getFile=t=>this._innerClient.getFile(t).then(e=>e.data).catch(e=>{throw C(e)});downloadFile=t=>this._innerClient.downloadFile(t).then(e=>e.data).catch(e=>{throw C(e)});deleteFile=t=>this._innerClient.deleteFile(t).then(e=>e.data).catch(e=>{throw C(e)});listFiles=t=>this._innerClient.listFiles(t).then(e=>e.data).catch(e=>{throw C(e)})};function C(s){return d.isAxiosError(s)?Xe(s.response?.data):Xe(s)}function Nt({oauthUrl:s,clientKey:t,clientSecret:e,getToken:r,getExpiry:o}){let n=null,a=null,i=!1,c=()=>n&&a&&a>Date.now(),l=async()=>{if(c())return n;i&&await mr(()=>i===!1,1e4),i=!0;try{if(c())return n;let p=await yr(s,t,e);return n=r(p),a=Date.now()+o(p),n}catch(p){throw p}finally{i=!1}};return l.reset=()=>{n=null,a=null},l}async function yr(s,t,e){let r=await d.post(s,new URLSearchParams({client_id:t,client_secret:e,grant_type:"client_credentials"}));return{token:r.data.access_token,expiresIn:r.data.expires_in}}var _t=s=>async t=>{let e=await s(t),r=Ge.from({...t.headers,Authorization:`Bearer ${e}`});return{...t,headers:r}},jt=(s,t)=>async e=>{let{config:r}=e;if(e.response?.status===401&&!r._retry){e.config._retry=!0;let o=await t(r);return r.headers=Ge.from({...r.headers,Authorization:`Bearer ${o}`}),s.request(r)}return Promise.reject(e)};function mr(s,t){return new Promise((e,r)=>{let o=Date.now(),n=setInterval(()=>{s()?(clearInterval(n),e()):Date.now()-o>t&&r(new Error("Timed out waiting for condition"))},100)})}var Ht=class extends Ce{constructor(t={}){let e=kt(t),{host:r,headers:o,withCredentials:n}=e;e.authStrategy==="token"&&(o.Authorization=`Bearer ${e.token}`);let a=d.create({headers:o,maxBodyLength:100*1024*1024,maxContentLength:1024*1024*1024,withCredentials:n,timeout:1e4});if(e.authStrategy==="oauth"){let i=Nt({oauthUrl:e.oauthUrl,clientKey:e.clientKey,clientSecret:e.clientSecret,getToken:c=>c.token,getExpiry:c=>c.expiresIn*1e3});a.interceptors.request.use(_t(i)),a.interceptors.response.use(void 0,jt(a,i))}super(void 0,r,a)}};export{Ht as Client,gr as isApiError};