appmesh 3.1.23 → 3.2.0

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/README.md CHANGED
@@ -48,7 +48,7 @@ partial result; the instance is left in place for the daemon to clean up.
48
48
  #### Forwarding and streaming in a cluster
49
49
 
50
50
  `client.forwardingHost` (the `X-Target-Host` header) applies to every call, the streaming
51
- ones included (`runTaskStream`, `followOutput`, `streamRun`): the task runs on the target
51
+ ones included (`runTaskStream`, `followOutput`, `runAppStream`): the task runs on the target
52
52
  node and its stream is served from there, and a target the gateway cannot reach rejects
53
53
  the call with 502 like any other forwarded request. `AppMeshClientTCP` streams over a
54
54
  direct HTTPS side channel: a forwarded stream on it dials the agent REST listener on the
@@ -1 +1 @@
1
- var e={};const t={};function n(r){const o=t[r];if(void 0!==o)return o.exports;const i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.m=e,(()=>{const e=Object.getPrototypeOf;let t;n.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if("object"==typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&"function"==typeof r.then)return r}const i=Object.create(null);n.r(i);const s=Object.create(null);t=t||[null,e({}),e([]),e(e)];for(var a=2&o&&r;("object"==typeof a||"function"==typeof a)&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(e=>s[e]=()=>r[e]);return s.default=()=>r,n.d(i,s),i}})(),n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>{const t=[];return n.f.j(e,t),Promise.all(t)},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{Object.defineProperties(e,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})},(()=>{const e={994:()=>import("./994.appmesh.esm.js"),453:()=>import("./453.appmesh.esm.js"),603:()=>import("./603.appmesh.esm.js"),582:()=>import("./582.appmesh.esm.js"),770:()=>import("./770.appmesh.esm.js")},t={792:0},r=e=>{let{__webpack_esm_ids__:r,__webpack_esm_modules__:o,__webpack_esm_runtime__:i}=e;var s,a,u=0;for(s in o)n.o(o,s)&&(n.m[s]=o[s]);for(i&&i(n);u<r.length;u++)a=r[u],n.o(t,a)&&t[a]&&t[a][0](),t[a]=0};n.f.j=(o,i)=>{let s=n.o(t,o)?t[o]:void 0;if(0!==s)if(s)i.push(s[1]);else{const n=Promise.race([e[o]().then(r,e=>{throw 0!==t[o]&&(t[o]=void 0),e}),new Promise(e=>s=t[o]=[e])]);i.push(s[1]=n)}}})();var r={};function o(e,t){return function(){return e.apply(t,arguments)}}n.r(r),n.d(r,{hasBrowserEnv:()=>He,hasStandardBrowserEnv:()=>Me,hasStandardBrowserWebWorkerEnv:()=>ze,navigator:()=>qe,origin:()=>Xe});const{toString:i}=Object.prototype,{getPrototypeOf:s}=Object,{iterator:a,toStringTag:u}=Symbol,c=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),l=e=>"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e),f=(e,t,n)=>e===Object.prototype||!n&&null===t,p=(e,t)=>{let n=e;const r=[];for(;null!=n;){if(-1!==r.indexOf(n))return!1;r.push(n);const o=s(n);if(f(n,o,n===e))return!1;if(c(n,t))return!0;n=o}return!1},h=(d=Object.create(null),e=>{const t=i.call(e);return d[t]||(d[t]=t.slice(8,-1).toLowerCase())});var d;const y=e=>(e=e.toLowerCase(),t=>h(t)===e),m=e=>t=>typeof t===e,{isArray:b}=Array,v=m("undefined");function g(e){return null!==e&&!v(e)&&null!==e.constructor&&!v(e.constructor)&&E(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const w=y("ArrayBuffer");const _=m("string"),E=m("function"),O=m("number"),S=e=>null!==e&&"object"==typeof e,T=e=>{if(!S(e))return!1;const t=s(e);return(null===t||t===Object.prototype||null===s(t))&&(f(e,t,!0)||!c(e,u)&&!c(e,a))},R=y("Date"),k=y("File"),P=y("Blob"),A=y("FileList"),j=y("Set");const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},N=void 0!==C.FormData?C.FormData:void 0,U=y("URLSearchParams"),[x,D,L,B]=["ReadableStream","Request","Response","Headers"].map(y);function F(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),b(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(g(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,H=e=>!v(e)&&e!==I;const q=(M="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>M&&e instanceof M);var M;const z=y("HTMLFormElement"),{propertyIsEnumerable:X}=Object.prototype,K=y("RegExp"),W=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};F(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const Y=y("AsyncFunction"),G=($="function"==typeof setImmediate,J=E(I.postMessage),$?setImmediate:J?(V=`axios@${Math.random()}`,Q=[],I.addEventListener("message",({source:e,data:t})=>{e===I&&t===V&&Q.length&&Q.shift()()},!1),e=>{Q.push(e),I.postMessage(V,"*")}):e=>setTimeout(e));var $,J,V,Q;const Z="undefined"!=typeof queueMicrotask?queueMicrotask.bind(I):"undefined"!=typeof process&&process.nextTick||G,ee=e=>null!=e&&E(e[a]),te={isArray:b,isArrayBuffer:w,isBuffer:g,isFormData:e=>{if(!e)return!1;if(N&&e instanceof N)return!0;const t=s(e);if(!t||t===Object.prototype)return!1;if(!E(e.append))return!1;const n=h(e);return"formdata"===n||"object"===n&&E(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&w(e.buffer),t},isString:_,isNumber:O,isBoolean:e=>!0===e||!1===e,isObject:S,isPlainObject:T,isEmptyObject:e=>{if(!S(e)||g(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:x,isRequest:D,isResponse:L,isHeaders:B,isUndefined:v,isDate:R,isFile:k,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:P,isRegExp:K,isFunction:E,isStream:e=>S(e)&&E(e.pipe),isURLSearchParams:U,isTypedArray:q,isFileList:A,forEach:F,merge:function e(...t){const{caseless:n,skipUndefined:r}=H(this)&&this||{},o={},i=n?Object.create(null):null,s=(t,n)=>{if("__proto__"===n||"constructor"===n||"prototype"===n)return;let s=n;if(i&&"string"==typeof n){const e=n.toLowerCase(),t=i[e];void 0!==t&&c(o,t)?s=t:i[e]=n}const a=c(o,s)?o[s]:void 0;T(a)&&T(t)?o[s]=e(a,t):T(t)?o[s]=e({},t):b(t)?o[s]=t.slice():r&&v(t)||(o[s]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||g(n))continue;if(F(n,s),"object"!=typeof n||b(n)||!Object.getOwnPropertySymbols)continue;const r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){const t=r[e];X.call(n,t)&&s(n[t],t)}}return o},extend:(e,t,n,{allOwnKeys:r}={})=>(F(t,(t,r)=>{n&&E(t)?Object.defineProperty(e,r,{__proto__:null,value:o(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const u={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||u[a]||(t[a]=e[a],u[a]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:h,kindOfTest:y,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(b(e))return e;let t=e.length;if(!Number.isSafeInteger(t)||t<0||t>4294967295)return null;const n=new Set,r=new Set;let o=e;for(;null!=o&&n.size<t;){if(r.has(o))return null;r.add(o);const i=s(o);if(f(o,i,o===e))break;Object.getOwnPropertyNames(o).forEach(e=>{const r=+e;Number.isInteger(r)&&r>=0&&r<t&&String(r)===e&&c(o,e)&&n.add(r)}),o=i}if(n.size!==t)return null;const i=new Array(t);for(;t-- >0;)i[t]=e[t];return i},forEachEntry:(e,t)=>{const n=(e&&e[a]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:z,hasOwnProperty:c,hasOwnProp:c,hasOwnInPrototypeChain:p,getSafeProp:(e,t)=>null!=e&&p(e,t)?e[t]:void 0,toSafeFlatObject:e=>{if(null==e||"object"!=typeof e&&"function"!=typeof e)return e;const t=s(e);if(null===t&&(e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(t=>{if(l(t))return!1;const n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable})})(e))return e;const n=Object.create(null),r=Object.create(null),o=[];let i=e;for(;null!=i&&-1===o.indexOf(i);){o.push(i);const a=i===e?t:s(i);if(f(i,a,i===e))break;const u=Object.getOwnPropertyNames(i);Object.getOwnPropertySymbols&&u.push(...Object.getOwnPropertySymbols(i));for(const t of u)l(t)||c(r,t)||(n[t]=e[t],r[t]=!0);i=a}return n},reduceDescriptors:W,freezeMethods:e=>{W(e,(t,n)=>{if(E(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];E(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return b(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:function(e,t){if(g(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null},global:I,isContextDefined:H,isSpecCompliantForm:function(e){return!!(e&&E(e.append)&&"FormData"===e[u]&&e[a])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(S(e)){if(t.has(e))return;if(g(e))return e;if(!("toJSON"in e)){let r;if(t.add(e),j(e)){r=[];for(const t of e){const e=n(t);!v(e)&&r.push(e)}}else r=b(e)?[]:{},F(e,(e,t)=>{const o=n(e);!v(o)&&(r[t]=o)});return t.delete(e),r}}return e};return n(e)},isAsyncFn:Y,isThenable:e=>e&&(S(e)||E(e))&&E(e.then)&&E(e.catch),setImmediate:G,asap:Z,isIterable:ee,isSafeIterable:e=>null!=e&&p(e,a)&&ee(e)},ne=te.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"]);const re=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),oe=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ie(e,t){return te.isArray(e)?e.map(e=>ie(e,t)):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function se(e){const t=Object.create(null);return te.forEach(e.toJSON(),(e,n)=>{t[n]=(e=>ie(e,oe))(e)}),t}const ae=Symbol("internals");function ue(e){return e&&String(e).trim().toLowerCase()}function ce(e){return!1===e||null==e?e:te.isArray(e)?e.map(ce):(e=>ie(e,re))(String(e))}const le=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function fe(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}const pe=e=>"__proto__"===e?"__Proto__":e;function he(e,t,n,r,o){return te.isFunction(r)?r.call(e,t,n):(o&&(t=n),te.isString(t)?te.isString(r)?-1!==t.indexOf(r):te.isRegExp(r)?r.test(t):void 0:void 0)}class de{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=ue(t);if(!o)return;const i=te.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[pe(i||t)]=ce(e))}const i=(e,t)=>te.forEach(e,(e,n)=>o(e,n,t));if(te.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(te.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t=Object.create(null);let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim();const i=te.hasOwnProp(t,n);!n||i&&te.hasOwnProp(ne,n)||("set-cookie"===n?i?t[n].push(r):t[n]=[r]:t[n]=i?t[n]+", "+r:r)}),t})(e),t);else if(te.isObject(e)&&te.isSafeIterable(e)){let n,r,o=Object.create(null);for(const t of e){if(!te.isArray(t))throw new TypeError("Object iterator must return a key-value pair");r=t[0],te.hasOwnProp(o,r)?(n=o[r],o[r]=te.isArray(n)?[...n,t[1]]:[n,t[1]]):o[r]=t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=ue(e)){const n=te.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(te.isFunction(t))return t.call(this,e,n);if(te.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ue(e)){const n=te.findKey(this,e);return!(!n||void 0===this[n]||t&&!he(this,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=ue(e)){const o=te.findKey(n,e);!o||t&&!he(n,n[o],o,t)||(delete n[o],r=!0)}}return te.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!he(this,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n=Object.create(null);return te.forEach(this,(r,o)=>{const i=te.findKey(n,o);if(i)return t[i]=ce(r),void delete t[o];const s=pe(e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim());s!==o&&delete t[o],t[s]=ce(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return te.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&te.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){const e=this.get("set-cookie");return te.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){const t=Object.create(null),n=String(e);let r=0,o=!1,i=!1;function s(e){const o=fe(n.slice(r,e)),i=o.indexOf("=");if(i<1)return;const s=fe(o.slice(0,i));if(!le.test(s))return;const a=s.toLowerCase();if("__proto__"===a||"constructor"===a||"prototype"===a)return;const u=fe(o.slice(i+1));t[a]=function(e){const t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let r=1;r<t;r++){const o=e.charCodeAt(r);if(34===o)return e;if(92===o&&(r+=1,r>=t))return e;n+=e[r]}return n}(u)}for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);o?i?i=!1:92===t?i=!0:34===t&&(o=!1):34===t?o=!0:44!==t&&59!==t||(s(e),r=e+1)}return s(n.length),t}(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[ae]=this[ae]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ue(e);t[r]||(!function(e,t){const n=te.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return te.isArray(e)?e.forEach(r):r(e),this}}de.accessor(["Content-Type","Content-Length","Content-Encoding","Accept","Accept-Encoding","User-Agent","Authorization"]),te.reduceDescriptors(de.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),te.freezeMethods(de);const ye=de,me="[REDACTED ****]";function be(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),r=[],o=e=>{if(null===e||"object"!=typeof e)return e;if(te.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof ye&&(e=e.toJSON()),r.push(e),te.isArray(e))t=[],e.forEach((e,n)=>{const r=o(e);te.isUndefined(r)||(t[n]=r)});else{if(!te.isPlainObject(e)&&function(e){if(te.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(te.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,i]of Object.entries(e)){const e=n.has(r.toLowerCase())?me:o(i);te.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return o(e)}function ve(e){try{return String(e)}catch(e){return""}}const ge=Symbol("causeStack");class we extends Error{static from(e,t,n,r,o,i){let s=e.message;!s&&te.isArray(e.errors)&&e.errors.length&&(s=function(e){return e.errors.map(e=>{try{return e&&e.message?ve(e.message):ve(e)}catch(e){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));const a=new we(s,t||e.code,n,r,o);return Object.defineProperty(a,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),a.name=e.name,function(e,t){try{const n=t&&t.stack;if("string"!=typeof n||!n)return;const r=e.stack;if("string"!=typeof r||!r)return;const o="\nCaused by: "+n;e.stack=r+o,Object.defineProperty(e,ge,{__proto__:null,value:o})}catch(e){}}(a,e),null!=e.status&&null==a.status&&(a.status=e.status),i&&Object.assign(a,i),a}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){const e=this.config,t=e&&te.hasOwnProp(e,"redact")?e.redact:void 0,n=te.isArray(t)&&t.length>0?be(e,t):te.toJSONObject(e);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:n,code:this.code,status:this.status}}}we.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",we.ERR_BAD_OPTION="ERR_BAD_OPTION",we.ECONNABORTED="ECONNABORTED",we.ETIMEDOUT="ETIMEDOUT",we.ECONNREFUSED="ECONNREFUSED",we.ERR_NETWORK="ERR_NETWORK",we.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",we.ERR_DEPRECATED="ERR_DEPRECATED",we.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",we.ERR_BAD_REQUEST="ERR_BAD_REQUEST",we.ERR_CANCELED="ERR_CANCELED",we.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",we.ERR_INVALID_URL="ERR_INVALID_URL",we.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const _e=we;function Ee(e){return te.isPlainObject(e)||te.isArray(e)}function Oe(e){return te.endsWith(e,"[]")?e.slice(0,-2):e}function Se(e,t,n){return e?e.concat(t).map(function(e,t){return e=Oe(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Te=te.toFlatObject(te,{},null,function(e){return/^is[A-Z]/.test(e)});const Re=function(e,t,n){if(!te.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(e,t)=>{const r=te.getSafeProp(n,e);return te.isUndefined(r)?t:r},o=r("metaTokens",!0),i=r("visitor")||d,s=r("dots",!1),a=r("indexes",!1),u=r("Blob")||"undefined"!=typeof Blob&&Blob,c=r("maxDepth",100),l=u&&te.isSpecCompliantForm(t),f=[];if(!te.isFunction(i))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(te.isDate(e))return e.toISOString();if(te.isBoolean(e))return e.toString();if(!l&&te.isBlob(e))throw new _e("Blob is not supported. Use a Buffer instead.");if(te.isArrayBuffer(e)||te.isTypedArray(e)){if(l&&"function"==typeof u)return new u([e]);throw new _e("Blob is not supported. Use a Buffer instead.",_e.ERR_NOT_SUPPORT)}return e}function h(e){if(e>c)throw new _e("Object is too deeply nested ("+e+" levels). Max depth: "+c,_e.ERR_FORM_DATA_DEPTH_EXCEEDED)}function d(e,n,r){let i=e;if(te.isReactNative(t)&&te.isReactNativeBlob(e))return t.append(Se(r,n,s),p(e)),!1;if(e&&!r&&"object"==typeof e)if(te.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=function(e,t){if(c===1/0)return JSON.stringify(e);const n=[];return JSON.stringify(e,function(e,r){if(!te.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),h(t+n.length-1),r})}(e,1);else if(te.isArray(e)&&function(e){return te.isArray(e)&&!e.some(Ee)}(e)||(te.isFileList(e)||te.endsWith(n,"[]"))&&(i=te.toArray(e)))return n=Oe(n),i.forEach(function(e,r){!te.isUndefined(e)&&null!==e&&t.append(!0===a?Se([n],r,s):null===a?n:n+"[]",p(e))}),!1;return!!Ee(e)||(t.append(Se(r,n,s),p(e)),!1)}const y=Object.assign(Te,{defaultVisitor:d,convertValue:p,isVisitable:Ee});if(!te.isObject(e))throw new TypeError("data must be an object");return function e(n,r,o=0){if(!te.isUndefined(n)){if(h(o),-1!==f.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));f.push(n),te.forEach(n,function(n,s){!0===(!(te.isUndefined(n)||null===n)&&i.call(t,n,te.isString(s)?s.trim():s,r,y))&&e(n,r?r.concat(s):[s],o+1)}),f.pop()}}(e),t};function ke(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function Pe(e,t){this._pairs=[],e&&Re(e,this,t)}const Ae=Pe.prototype;Ae.append=function(e,t){this._pairs.push([e,t])},Ae.toString=function(e){const t=e?t=>e.call(this,t,ke):ke;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const je=Pe;function Ce(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ne(e,t,n){if(!t)return e;e=e||"";const r=te.isFunction(n)?{serialize:n}:n,o=te.getSafeProp(r,"encode")||Ce,i=te.getSafeProp(r,"serialize");let s;if(s=i?i(t,r):te.isURLSearchParams(t)?t.toString():new je(t,r).toString(o),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const Ue=Symbol("internals");function xe(e){return e?e.length:0}function De(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function Le(e,t){const n=e.handlers,r=xe(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):r!==t.handlersLength&&(r?t.handlerEntries.forEach(function(e,r){n[e.index]!==e.handler&&t.handlerEntries.delete(r)}):t.handlerEntries.clear()),t.handlersLength=r}const Be=class{constructor(){this.handlers=[],this[Ue]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){const r={fulfilled:e,rejected:t,synchronous:!(!n||!te.hasOwnInPrototypeChain(n,"synchronous"))&&n.synchronous,runWhen:n&&te.hasOwnInPrototypeChain(n,"runWhen")?n.runWhen:null},o=this[Ue];null==this.handlers&&(this.handlers=[]),Le(this,o);const i=o.nextId++;return this.handlers.push(r),o.handlerEntries.set(i,{handler:r,index:this.handlers.length-1}),o.handlersLength=this.handlers.length,i}eject(e){const t=this[Ue];Le(this,t);const n=function(e){return"string"==typeof e&&""!==e&&String(Number(e))===e?Number(e):e}(e),r=t.handlerEntries.get(n);if(r){if(t.handlerEntries.delete(n),this.handlers[r.index]!==r.handler)return;this.handlers[r.index]=null,t.iterationDepth||(De(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],Le(this,this[Ue]))}forEach(e){const t=this[Ue];Le(this,t),t.iterationDepth++;try{te.forEach(this.handlers,function(t){null!==t&&e(t)})}finally{--t.iterationDepth||(Le(this,t),De(this.handlers),t.handlersLength=xe(this.handlers))}}},Fe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0,encodeBasicAuthUsername:!1},Ie={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:je,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},He="undefined"!=typeof window&&"undefined"!=typeof document,qe="object"==typeof navigator&&navigator||void 0,Me=He&&(!qe||["ReactNative","NativeScript","NS"].indexOf(qe.product)<0),ze="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Xe=He&&window.location.href||"http://localhost",Ke={...r,...Ie};function We(e){if(e>100)throw new _e("FormData field is too deeply nested ("+e+" levels). Max depth: 100",_e.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Ye(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}function Ge(e){if(!te.isArray(e))return e;const t=Object.keys(e);return t.length!==e.length||t.some((e,t)=>e!==String(t))?Ye(e):e}const $e=function(e){function t(e,n,r,o){We(o);let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;if(i=!i&&te.isArray(r)?r.length:i,a)return te.hasOwnProp(r,i)?(r[i]=Ge(r[i]),r[i]=te.isArray(r[i])?r[i].concat(n):[r[i],n]):r[i]=n,!s;te.hasOwnProp(r,i)&&te.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&te.isArray(r[i])&&(r[i]=Ye(r[i])),!s}if(te.isFormData(e)&&te.isFunction(e.entries)){const n={};return te.forEachEntry(e,(e,r)=>{t(function(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;null!==(r=n.exec(e));)We(t.length),t.push("[]"===r[0]?"":r[1]||r[0]);return t}(e),r,n,0)}),function(e){const t=[e];for(;t.length;){const e=t.pop();Object.keys(e).forEach(n=>{const r=e[n]=Ge(e[n]);(te.isArray(r)||te.isPlainObject(r))&&t.push(r)})}return e}(n)}return null},Je=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),Ve=(e,t)=>null!=e&&te.hasOwnProp(e,t)?e[t]:void 0;const Qe={transitional:Fe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=te.isObject(e);o&&te.isHTMLForm(e)&&(e=new FormData(e));if(te.isFormData(e))return r?JSON.stringify($e(e)):e;if(te.isArrayBuffer(e)||te.isBuffer(e)||te.isStream(e)||te.isFile(e)||te.isBlob(e)||te.isReadableStream(e))return e;if(te.isArrayBufferView(e))return e.buffer;if(te.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){const t=Ve(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Re(e,new Ke.classes.URLSearchParams,{visitor:function(e,t,n,r){return Ke.isNode&&te.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((i=te.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Ve(this,"env"),r=n&&n.FormData;return Re(i?{"files[]":e}:e,r&&new r,t)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(te.isString(e))try{return(t||JSON.parse)(e),te.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Ve(this,"transitional")||Qe.transitional,n=t&&t.forcedJSONParsing,r=Ve(this,"responseType"),o="json"===r;if(te.isResponse(e)||te.isReadableStream(e))return e;if(e&&te.isString(e)&&(n&&!r||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,Ve(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw _e.from(e,_e.ERR_BAD_RESPONSE,this,null,Ve(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ke.classes.FormData,Blob:Ke.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};te.forEach(Je,e=>{Qe.headers[e]={}});const Ze=Qe;function et(e,t){const n=this||Ze,r=t||n,o=ye.from(r.headers);let i=r.data;return te.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function tt(e){return!(!e||!e.__CANCEL__)}const nt=class extends _e{constructor(e,t,n){super(e??"canceled",_e.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function rt(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new _e("Request failed with status code "+n.status,n.status>=400&&n.status<500?_e.ERR_BAD_REQUEST:_e.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const ot=/[\t\n\r]/g;function it(e){if("string"!=typeof e)return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(ot,"")}function st(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1].toLowerCase()||""}const at=e=>{try{return decodeURIComponent(e)}catch(t){return e}},ut=Ke.hasStandardBrowserEnv?{write(e,t,n,r,o,i,s){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];te.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),te.isString(r)&&a.push(`path=${r}`),te.isString(o)&&a.push(`domain=${o}`),!0===i&&a.push("secure"),te.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie;if(!t)return null;const n=t.split(";");for(let t=0;t<n.length;t++){const r=n[t].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===e)return at(r.slice(o+1))}return null},async readAsync(e){try{const t="undefined"!=typeof window&&window.cookieStore;if(t&&te.isFunction(t.get)){const n=await t.get(e);return n?at(n.value):null}}catch(e){}return this.read(e)},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,readAsync:async()=>null,remove(){}};const ct=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const u=Date.now(),c=r[s];o||(o=u),n[i]=a,r[i]=u;let l=s,f=0;for(;l!==i;)f+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),u-o<t)return;const p=c&&u-c;return p?Math.round(1e3*f/p):void 0}};const lt=function(e,t){let n,r,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},i-a)))},()=>n&&s(n),(...e)=>s(e)]},ft=(e,t,n=3)=>{let r=0;const o=ct(50,250);return lt(n=>{if(!n||!te.isNumber(n.loaded))return;const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=Math.max(0,null!=s?Math.min(i,s):i),u=Math.max(0,a-r),c=o(u);r=Math.max(r,a);e({loaded:a,total:s,progress:s?a/s:void 0,bytes:u,rate:c||void 0,estimated:c&&s?(s-a)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},pt=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ht=(e,t=te.asap)=>(...n)=>t(()=>e(...n)),dt=Ke.hasStandardBrowserEnv?(e=>t=>(t=new URL(t,document.baseURI||Ke.origin),e.protocol===t.protocol&&e.host===t.host&&e.port===t.port))(new URL(Ke.origin)):()=>!0;const yt=/^https?:(?!\/\/)/i;function mt(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${me}@`),n=t.indexOf("#"),r=(-1===n?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${me}`);return-1===n?r:`${r}#${o=t.slice(n+1),o?o.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n="")=>`${t}${n}${me}`):o}`;var o}function bt(e,t){if("string"==typeof e){const n=it(e);if(yt.test(n))throw new _e(`Invalid URL ${JSON.stringify(mt(n))}: missing "//" after protocol`,_e.ERR_INVALID_URL,t)}}function vt(e,t,n,r){bt(t,r);let o=!("string"==typeof(i=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i));var i;return e&&(o||!1===n)?(bt(e,r),function(e,t){if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return 0===n?"/"+t.replace(/^[/\\\t\n\r]+/,""):e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}const gt=e=>e instanceof ye?{...e}:e,wt=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>{const n=Object.getOwnPropertyDescriptor(e,t);return n&&n.enumerable})):Object.keys(e);function _t(e,t,n,r){return te.isPlainObject(e)&&te.isPlainObject(t)?te.merge.call({caseless:r},e,t):te.isPlainObject(t)?te.merge({},t):te.isArray(t)?t.slice():t}function Et(e,t,n,r){return te.isUndefined(t)?te.isUndefined(e)?void 0:_t(void 0,e,0,r):_t(e,t,0,r)}function Ot(e,t){if(!te.isUndefined(t))return _t(void 0,t)}function St(e,t){return te.isUndefined(t)?te.isUndefined(e)?void 0:_t(void 0,e):_t(void 0,t)}function Tt(e,t,n,r,o){return te.hasOwnProp(o,n)?_t(e,t):te.hasOwnProp(r,n)?_t(void 0,e):void 0}const Rt=Object.freeze({__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0}),kt={url:Ot,method:Ot,data:Ot,baseURL:St,transformRequest:St,transformResponse:St,params:function(e,t){const n=[],r=new WeakMap,o={};function i(e,t){if(!te.isPlainObject(t))return te.isArray(t)?t.slice():t;const i=te.isPlainObject(e)?e:o;let s=r.get(t);if(s||(s=new WeakMap,r.set(t,s)),s.has(i))return s.get(i);const a={};return s.set(i,a),n.push({base:i,source:t,result:a}),a}const s=te.isUndefined(t)?i(void 0,e):i(e,t);for(;n.length;){const{base:e,source:t,result:r}=n.pop(),o=new Set(wt(e)),s=new Set(wt(t));new Set([...o,...s]).forEach(n=>{if("__proto__"===n||"constructor"===n||"prototype"===n)return;const a=s.has(n),u=a?t[n]:void 0,c=a&&!te.isPlainObject(u)||!o.has(n)?void 0:e[n];r[n]=a?i(c,u):i(void 0,c)})}return function(e){const t=[{value:e}],n=new WeakSet,r=new WeakSet;for(;t.length;){const{value:e,done:o}=t.pop();if(!te.isPlainObject(e)&&!te.isArray(e))continue;if(o){n.delete(e);continue}if(n.has(e))throw new _e("Circular reference detected in params",_e.ERR_BAD_OPTION_VALUE);if(r.has(e))continue;r.add(e),n.add(e),t.push({value:e,done:!0});const i=Object.keys(e);Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor&&Object.getOwnPropertySymbols(e).forEach(t=>{const n=Object.getOwnPropertyDescriptor(e,t);n&&n.enumerable&&i.push(t)}),i.forEach(n=>{if("__proto__"===n||"constructor"===n||"prototype"===n){const r=Object.getOwnPropertyDescriptor(e,n);r&&te.hasOwnProp(r,"value")&&t.push({value:r.value})}else t.push({value:e[n]})})}}(s),s},paramsSerializer:St,timeout:St,timeoutErrorMessage:St,withCredentials:St,withXSRFToken:St,adapter:St,responseType:St,xsrfCookieName:St,xsrfHeaderName:St,onUploadProgress:St,onDownloadProgress:St,decompress:St,maxContentLength:St,maxBodyLength:St,beforeRedirect:St,transport:St,httpAgent:St,httpsAgent:St,cancelToken:St,socketPath:St,allowedSocketPaths:St,responseEncoding:St,validateStatus:Tt,headers:function(e,t,n){return Et(gt(e),gt(t),0,!0)}};function Pt(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",Rt);const r=wt({...e,...t});for(let o=0,i=r.length;o<i;o++){const i=r[o];if("__proto__"===i||"constructor"===i||"prototype"===i)continue;const s=te.hasOwnProp(kt,i)?kt[i]:Et,a=te.hasOwnProp(e,i)?e[i]:void 0,u=te.hasOwnProp(t,i)?t[i]:void 0,c=s===Tt?s(a,u,i,e,t):s(a,u,i);te.isUndefined(c)&&s!==Tt||(n[i]=c)}return te.hasOwnProp(t,"validateStatus")&&te.isUndefined(t.validateStatus)&&!1===function(e,t,n){const r=te.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!te.isUndefined(r)){if(!te.isPlainObject(r))return;if(te.hasOwnProp(r,n))return r[n]}const o=te.hasOwnProp(e,"transitional")?e.transitional:void 0;if(te.isPlainObject(o)&&te.hasOwnProp(o,n))return o[n]}(e,t,"validateStatusUndefinedResolves")&&(te.hasOwnProp(e,"validateStatus")?n.validateStatus=_t(void 0,e.validateStatus):delete n.validateStatus),n}const At=["content-type","content-length"];const jt=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),Ct=e=>ut.read(e);const Nt=function(e,t=Ct){const n=Pt({},e),r=e=>te.hasOwnProp(n,e)?n[e]:void 0,o=r("data");let i=r("withXSRFToken");const s=r("xsrfHeaderName"),a=r("xsrfCookieName");let u=r("headers");const c=r("auth"),l=r("baseURL"),f=r("allowAbsoluteUrls"),p=r("url");if(n.headers=u=ye.from(u),n.url=Ne(vt(l,p,f,n),r("params"),r("paramsSerializer")),c){const t=te.getSafeProp(c,"username")||"",n=te.getSafeProp(c,"password")||"",o=r("transitional"),i=o&&te.hasOwnProp(o,"encodeBasicAuthUsername")&&!0===o.encodeBasicAuthUsername;try{u.set("Authorization","Basic "+btoa((i?jt(t):t)+":"+(n?jt(n):"")))}catch(t){throw _e.from(t,_e.ERR_BAD_OPTION_VALUE,e)}}if(te.isFormData(o)){const e=te.getSafeProp(o,"getHeaders");Ke.hasStandardBrowserEnv||Ke.hasStandardBrowserWebWorkerEnv||te.isReactNative(o)?u.setContentType(void 0):te.isFunction(e)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(([t,n])=>{At.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}(u,e.call(o),r("formDataHeaderPolicy"))}if(Ke.hasStandardBrowserEnv){te.isFunction(i)&&(i=i(n));if(!0===i||null==i&&dt(n.url)){const e=s&&a&&t(a);e&&u.set(s,e)}}return n},Ut="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){let r,o;try{const e=Ke.hasStandardBrowserEnv&&"undefined"!=typeof window&&window.cookieStore;r=e&&te.isFunction(e.get)}catch(e){}const i=Nt(e,r?e=>(o=e,null):void 0);let s=i.data;const a=ye.from(i.headers).normalize();let u,c,l,f,p,h,d,{responseType:y,onUploadProgress:m,onDownloadProgress:b}=i;function v(){clearTimeout(c);try{p&&p()}catch(e){setTimeout(()=>{throw e})}try{h&&h()}catch(e){setTimeout(()=>{throw e})}g&&(f&&g.removeEventListener("progress",f),g.upload&&(l&&g.upload.removeEventListener("progress",l),p&&g.upload.removeEventListener("loadend",p))),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let g=new XMLHttpRequest;function w(r){if(!g)return;if(!(0!==g.status||"file"===(st(it(i.url))||st(Ke.origin))||g.responseURL&&g.responseURL.startsWith("file:")))return n(new _e("Request aborted",_e.ECONNABORTED,e,g)),v(),void(g=null);try{r?d&&d(r):h&&h()}catch(e){setTimeout(()=>{throw e})}if(!g)return;const o=ye.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());rt(function(e){t(e),v()},function(e){n(e),v()},{data:y&&"text"!==y&&"json"!==y?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:o,config:e,request:g}),g=null}if(g.open(i.method.toUpperCase(),i.url,!0),g.timeout=i.timeout,"onloadend"in g?g.onloadend=w:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&g.responseURL.startsWith("file:"))&&setTimeout(w)},g.onabort=function(){g&&(n(new _e("Request aborted",_e.ECONNABORTED,e,g)),v(),g=null)},g.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new _e(r,_e.ERR_NETWORK,e,g);o.event=t||null,n(o),v(),g=null},g.ontimeout=function(){if(!g)return;let t=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const r=i.transitional||Fe;i.timeoutErrorMessage&&(t=i.timeoutErrorMessage),n(new _e(t,r.clarifyTimeoutError?_e.ETIMEDOUT:_e.ECONNABORTED,e,g)),v(),g=null},void 0===s&&a.setContentType(null),te.isUndefined(i.withCredentials)||(g.withCredentials=!!i.withCredentials),y&&"json"!==y&&(g.responseType=i.responseType),b&&([f,h,d]=ft(b,!0),g.addEventListener("progress",f)),m&&g.upload&&([l,p]=ft(m),g.upload.addEventListener("progress",l),g.upload.addEventListener("loadend",p)),i.cancelToken||i.signal){if(u=t=>{if(!g)return;n(!t||t.type?new nt(null,e,g):t);const r=g;v(),g=null,r.abort()},i.cancelToken&&i.cancelToken.subscribe(u),!g)return;i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u))}if(!g)return;const _=st(i.url);if(_&&!Ke.protocols.includes(_))return n(new _e("Unsupported protocol "+_+":",_e.ERR_BAD_REQUEST,e)),void v();const E=()=>{g&&("setRequestHeader"in g&&te.forEach(se(a),function(e,t){g.setRequestHeader(t,e)}),g.send(s||null))};if(o){const t="undefined"!=typeof performance&&te.isFunction(performance.now)?()=>performance.now():Date.now,r=g.timeout>0?t()+Number(g.timeout):void 0,s=()=>{if(!g)return;const e=g;e.ontimeout(),e.abort()};if(void 0!==r){const e=()=>{const n=r-t();n>0?c=setTimeout(e,Math.min(n,2147483647)):s()};e()}ut.readAsync(o).then(e=>{if(g)if(void 0!==r&&t()>=r)s();else{if(e){const t=te.hasOwnProp(i,"xsrfHeaderName")&&i.xsrfHeaderName;a.set(t,e)}E()}}).catch(t=>{g&&(n(_e.from(t,null,e,g)),v(),g=null)})}else E()})},xt=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const o=function(e){if(!r){r=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof _e?t:new nt(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new _e(`timeout of ${t}ms exceeded`,_e.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{const t=te.getSafeProp(e,"unsubscribe");te.isFunction(t)?t.call(e,o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>{r||(e.aborted?o.call(e):e.addEventListener("abort",o,{once:!0}))});const{signal:a}=n;return a.unsubscribe=()=>te.asap(s),a},Dt=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Lt=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Bt=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Lt(e))yield*Dt(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw o.return().catch(()=>{}),a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},Ft="\r\n",It=e=>String(e).replace(/\r\n|\r|\n/g,Ft),Ht=e=>String(e).replace(/[\r\n"]/g,e=>"\r"===e?"%0D":"\n"===e?"%0A":"%22"),qt=(e,t)=>{let n=0;for(let r=0;r<e.length;r++){const o=e.charCodeAt(r);!t||13!==o&&10!==o?o<128?n++:o<2048?n+=2:o>=55296&&o<=56319&&e.charCodeAt(r+1)>=56320&&e.charCodeAt(r+1)<=57343?(n+=4,r++):n+=3:(13===o&&10===e.charCodeAt(r+1)&&r++,n+=2)}return n};class Mt extends TypeError{constructor(e,t){super(e),this.name="FormDataError",this.reason=t}}function zt(e,t,n,r,o){if(!te.isFunction(t))throw new _e("Blob is not supported",_e.ERR_NOT_SUPPORT);if(void 0===o)if(te.isFunction(Ke.generateString))o="axios-"+Ke.generateString(36,"0123456789abcdef");else{const e=te.global.crypto;if(!e||!te.isFunction(e.getRandomValues))throw new _e("Random byte generation is not supported",_e.ERR_NOT_SUPPORT);const t=new Uint8Array(18);e.getRandomValues(t),o="axios-"+Array.from(t,e=>("0"+e.toString(16)).slice(-2)).join("")}try{return function(e,t,n,r,o){if(!te.isFunction(t))throw new Mt("Blob is not supported","blob");if(!te.isString(o)||!/^[A-Za-z0-9'()+_,./:=? -]{1,70}$/.test(o)||/ $/.test(o))throw new Mt("Invalid multipart boundary","boundary");const i="--"+o+"--"+Ft;let s=i.length;const a=[],u=e=>{if(s+e>n)throw r()};u(0);for(const[t,n]of e){const e=te.isString(n),r=e?qt(n,!0):n.size;if(!Number.isFinite(r)||r<0)throw new Mt("Unsupported FormData part size","part");u(r+qt(t,!0)+(!e&&n.name?qt(n.name,!1):0)+(!e&&n.type?qt(n.type,!1):0));let i="--"+o+'\r\nContent-Disposition: form-data; name="'+Ht(It(t))+'"';e||(i+='; filename="'+Ht(te.isString(n.name)?n.name:"blob")+'"\r\nContent-Type: '+String(n.type||"application/octet-stream").replace(/[\r\n]/g,"")),i+=Ft+Ft;const c=qt(i,!1)+r+2;u(c),s+=c,a.push({header:i,value:n,isString:e})}const c=[];for(const e of a)c.push(e.header,e.isString?It(e.value):e.value,Ft);return c.push(i),new t(c,{type:"multipart/form-data; boundary="+o})}(e,t,n,r,o)}catch(e){if(e instanceof Mt){const t="boundary"===e.reason?_e.ERR_BAD_OPTION_VALUE:_e.ERR_BAD_REQUEST;throw new _e(e.message,t)}throw e}}const Xt=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Kt=(e,t,n)=>t+2<n&&Xt(e.charCodeAt(t+1))&&Xt(e.charCodeAt(t+2)),Wt=e=>e<=57?e-48:(223&e)-55,Yt=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,Gt=e=>9===e||10===e||12===e||13===e||32===e,$t=e=>{const t=e.length;let n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)},Jt=e=>{const t=e.length;let n=0,r=0,o=!1;for(let i=0;i<t;i++){let s=e.charCodeAt(i);37===s&&Kt(e,i,t)&&(s=16*Wt(e.charCodeAt(i+1))+Wt(e.charCodeAt(i+2)),i+=2),Gt(s)||(61!==s?!Yt(s)||r>0?o=!0:n++:r++)}return o||r>2||r>0&&(n+r)%4!=0||n%4==1?$t(e):(e=>{const t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)})(n)},Vt=(e,t,n)=>{if(!e||"string"!=typeof e)return 0;if(!/^data:/i.test(e))return 0;const r=e.indexOf(",");if(r<0)return 0;const o=e.slice(5,r),i=e.slice(r+1);if(n.test(o))return t(i);let s=0;for(let e=0,t=i.length;e<t;e++){const n=i.charCodeAt(e);if(37===n&&Kt(i,e,t))s+=1,e+=2;else if(n<128)s+=1;else if(n<2048)s+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=i.charCodeAt(e+1);t>=56320&&t<=57343?(s+=4,e++):s+=3}else s+=3}return s};const Qt={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:Zt}=te,en=e=>{if(!te.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},tn=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},nn=e=>{try{if(null!==e&&("object"==typeof e||"function"==typeof e)){const t=e.then;Zt(t)&&t.call(e,void 0,te.noop)}}catch(e){}},rn=e=>{const t=void 0!==te.global&&null!==te.global?te.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=te.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response,Blob:t.Blob},e);const o=te.hasOwnProp(e,"fetch")?e.fetch:void 0,{Request:i,Response:s,Blob:a}=e,u=o?Zt(o):"function"==typeof fetch,c=Zt(i),l=Zt(s);if(!u)return!1;const f=u&&Zt(n),p=u&&("function"==typeof r?(h=new r,e=>h.encode(e)):async e=>new Uint8Array(await new i(e).arrayBuffer()));var h;const d=c&&f&&tn(()=>{let e=!1;const t=new i(Ke.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&nn(t.body.cancel()),e&&!r}),y=l&&f&&tn(()=>{const e=new s("").body;try{return te.isReadableStream(e)}finally{(e=>{if(null!=e)try{const t=e.cancel;Zt(t)&&nn(t.call(e))}catch(e){}})(e)}}),m=Object.assign(Object.create(null),Qt);c&&!tn(()=>new i(Ke.origin,m))&&(delete m.cache,tn(()=>new i(Ke.origin,m))||(m.cache=Qt.cache));const b={stream:y&&(e=>e.body)};u&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!b[e]&&(b[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new _e(`Response type '${e}' is not supported`,_e.ERR_NOT_SUPPORT,n)})});const v=async e=>null==e?0:te.isBlob(e)?e.size:te.isArrayBufferView(e)||te.isArrayBuffer(e)?e.byteLength:(te.isURLSearchParams(e)&&(e+=""),te.isString(e)?(await p(e)).byteLength:void 0);return async e=>{let{url:t,method:n,data:u,signal:l,cancelToken:p,timeout:h,onDownloadProgress:g,onUploadProgress:w,responseType:_,headers:E,withCredentials:O="same-origin",fetchOptions:S,maxContentLength:T,maxBodyLength:R,maxRedirects:k}=Nt(e);const P=te.isNumber(T)&&T>-1,A=te.isNumber(R)&&R>-1,j=t=>te.hasOwnProp(e,t)?e[t]:void 0;let C=o||fetch;_=_?(_+"").toLowerCase():"text";let N=xt([l,p&&p.toAbortSignal()],h),U=null;const x=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let D,L=null,B=null;const F=()=>new _e("Request body larger than maxBodyLength limit",_e.ERR_BAD_REQUEST,e,U);try{let o;const l=j("auth");if(l){const e=te.getSafeProp(l,"username")||"";o={username:e,password:te.getSafeProp(l,"password")||""}}let p;if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){if(p=new URL(t,Ke.origin),!o&&(p.username||p.password)){const e=en(p.username);o={username:e,password:en(p.password)}}(p.username||p.password)&&(p.username="",p.password="",t=p.href)}if(o&&(E.delete("authorization"),E.set("Authorization","Basic "+btoa((I=(o.username||"")+":"+(o.password||""),encodeURIComponent(I).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))),P&&p&&"data:"===p.protocol){const t=function(e){const t="string"==typeof e?e.indexOf("#"):-1;return Vt(-1===t?e:e.slice(0,t),Jt,/; *base64[\t\n\f\r ]*$/i)}(p.href);if(t>T)throw new _e("maxContentLength size of "+T+" exceeded",_e.ERR_BAD_RESPONSE,e,U)}const h=te.isSpecCompliantForm(u)&&ye.from(j("headers")).getContentType();let H;if(te.isString(h)&&/^multipart\/form-data(?:\s*;|$)/i.test(h.trim())){const e=ye.parseParameters(h);te.hasOwnProp(e,"boundary")&&(H=e.boundary)}if(te.isSpecCompliantForm(u)&&"get"!==n&&"head"!==n&&(A||w&&d||void 0!==H)&&(u=zt(u,a,A?R:1/0,F,H),E.setContentType(void 0===H?u.type:h),D=u.size),A&&"get"!==n&&"head"!==n){const e=await v(u);if("number"==typeof e&&isFinite(e)&&(D=e,e>R))throw F()}const q=A&&(te.isReadableStream(u)||te.isStream(u)),M=(e,t,n)=>Bt(e,65536,e=>{if(A&&e>R)throw L=F();t&&t(e)},n);if(d&&"get"!==n&&"head"!==n&&(w||q)){if(D=D??await(async(e,t)=>{const n=te.toFiniteNumber(e.getContentLength());return n??v(t)})(E,u),0!==D||q){let e,n=new i(t,{method:"POST",body:u,duplex:"half"});if(te.isFormData(u)&&(e=n.headers.get("content-type"))&&E.setContentType(e),n.body){const[e,t]=w&&pt(D,ft(ht(w)))||[];u=M(n.body,e,t)}}}else if(q&&!c&&f&&"get"!==n&&"head"!==n)u=M(u);else if(q&&c&&!d&&"get"!==n&&"head"!==n)throw new _e("Stream request bodies are not supported by the current fetch implementation",_e.ERR_NOT_SUPPORT,e,U);te.isString(O)||(O=O?"include":"omit");const z=c&&"credentials"in i.prototype;if(te.isFormData(u)){const e=E.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&E.delete("content-type")}E.set("User-Agent","axios/1.22.0",!1);const X=null==S?S:Object.assign(Object.create(null),S);X&&(delete X.body,delete X.headers,delete X.method,delete X.signal,delete X.duplex,delete X.credentials);const K=Object.assign(Object.create(null),X,{signal:N,method:n.toUpperCase(),headers:se(E.normalize()),body:u,duplex:"half",credentials:z?O:void 0});c&&(te.forEach(m,(e,t)=>{void 0===K[t]&&(K[t]=e)}),void 0===K.signal&&(K.signal=null),void 0===K.body&&(K.body=null)),0===k&&(K.redirect="manual",X&&(X.redirect="manual")),U=c&&new i(t,K);let W=await(c?C(U,X):C(t,K));const Y=ye.from(W.headers);if(P){const t=te.toFiniteNumber(Y.getContentLength());if(null!=t&&t>T)throw new _e("maxContentLength size of "+T+" exceeded",_e.ERR_BAD_RESPONSE,e,U)}const G=y&&("stream"===_||"response"===_);if(y&&W.body&&(g||P||G&&x)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=W[e]});const n=te.toFiniteNumber(Y.getContentLength()),[r,o]=g&&pt(n,ft(ht(g),!0))||[];let i=0;const a=t=>{if(P&&(i=t,i>T))throw B=new _e("maxContentLength size of "+T+" exceeded",_e.ERR_BAD_RESPONSE,e,U);r&&r(t)};W=new s(Bt(W.body,65536,a,()=>{o&&o(),x&&x()}),t)}_=_||"text";let $=await b[te.findKey(b,_)||"text"](W,e);if(P&&!y&&!G){let t;if(null!=$&&("number"==typeof $.byteLength?t=$.byteLength:"number"==typeof $.size?t=$.size:"string"==typeof $&&(t="function"==typeof r?(new r).encode($).byteLength:$.length)),"number"==typeof t&&t>T)throw new _e("maxContentLength size of "+T+" exceeded",_e.ERR_BAD_RESPONSE,e,U)}return!G&&x&&x(),await new Promise((t,n)=>{rt(t,n,{data:$,headers:ye.from(W.headers),status:W.status,statusText:W.statusText,config:e,request:U})})}catch(t){if(x&&x(),N&&N.aborted&&N.reason instanceof _e){const n=N.reason;throw n.config=e,U&&(n.request=U),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(L)throw U&&!L.request&&(L.request=U),L;if(B)throw B;if(t instanceof _e)throw U&&!t.request&&(t.request=U),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new _e("Network Error",_e.ERR_NETWORK,e,U,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw _e.from(t,t&&t.code,e,U,t&&t.response)}var I}},on=new Map,sn=new WeakSet,an=e=>{const t=rn(e);return t&&sn.add(t),t},un=e=>{const t=Object.create(null),n=e&&te.hasOwnProp(e,"env")&&e.env;["fetch","Request","Response","Blob"].forEach(e=>{n&&te.hasOwnProp(n,e)&&(t[e]=n[e])});const{fetch:r,Request:o,Response:i,Blob:s}=t,a=[o,i,r,s];let u,c,l=a.length,f=on;for(;l--;)u=a[l],c=f.get(u),void 0===c&&f.set(u,c=l?new Map:an(t)),f=c;return c},cn=(un(),{http:null,xhr:Ut,fetch:{get:un}});te.forEach(cn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const ln=e=>`- ${e}`,fn=e=>te.isFunction(e)||null===e||!1===e;const pn={getAdapter:function(e,t){e=te.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s<n;s++){let n;if(r=e[s],o=r,!fn(r)&&(o=cn[(n=String(r)).toLowerCase()],void 0===o))throw new _e(`Unknown adapter '${n}'`);if(o&&(te.isFunction(o)||(o=o.get(t))))break;i[n||"#"+s]=o}if(!o){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(ln).join("\n"):" "+ln(e[0]):"as no adapter specified";throw new _e("There is no suitable adapter to dispatch the request "+t,_e.ERR_NOT_SUPPORT)}return o},isBuiltinAdapter:function(e){return!!e&&(e===cn.xhr||e===cn.http||(e=>sn.has(e))(e))},adapters:cn};function hn(e,t){const n=te.getSafeProp(e,"url");if(null!=n)return;if(te.getSafeProp(e,"baseURL"))return;const r=t(),o=pn.adapters.http;if((!o||r!==o||!te.getSafeProp(e,"socketPath"))&&pn.isBuiltinAdapter(r))throw new _e(`Invalid URL: url cannot be ${null===n?"null":"undefined"} when baseURL is not set`,_e.ERR_INVALID_URL,e)}function dn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nt(null,e)}function yn(e,t){return Math.max(0,Math.round(e()-t))}function mn(e){const t=te.toSafeFlatObject(e);dn(t),t.headers=ye.from(te.getSafeProp(t,"headers")),t.data=et.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);const n=pn.getAdapter(t.adapter||Ze.adapter,t);hn(t,()=>n);const r="undefined"!=typeof performance&&te.isFunction(performance.now)?()=>performance.now():Date.now,o=r();return n(t).then(function(e){dn(t),e.duration=yn(r,o),t.response=e;try{e.data=et.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=ye.from(e.headers),e},function(e){if(!tt(e)&&(dn(t),e&&e.response)){e.response.duration=yn(r,o),t.response=e.response;try{e.response.data=et.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=ye.from(e.response.headers)}return Promise.reject(e)})}const bn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{bn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const vn={};bn.transitional=function(e,t,n){function r(e,t){return"[Axios v1.22.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new _e(r(o," has been removed"+(t?" in "+t:"")),_e.ERR_DEPRECATED);return t&&!vn[o]&&(vn[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},bn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const gn={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new _e("options must be an object",_e.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new _e("option "+i+" must be "+n,_e.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new _e("Unknown option "+i,_e.ERR_BAD_OPTION)}},validators:bn},wn=gn.validators,_n=e=>{if(null==e||te.isPlainObject(e)||e instanceof ye)return!0;try{return te.isObject(e)&&"AxiosHeaders"===te.getSafeProp(e,Symbol.toStringTag)&&["toJSON","set","get","has","delete","clear","normalize","concat","toString",Symbol.iterator].every(t=>te.isFunction(te.getSafeProp(e,t)))}catch(e){return!1}};class En{constructor(e){this.defaults=e||{},this.interceptors={request:new Be,response:new Be}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error)try{let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack;let r="";if("string"==typeof n){const e=n.indexOf("\n");r=-1===e?"":n.slice(e+1)}if(e.stack){if(r){const t=r.indexOf("\n"),n=-1===t?-1:r.indexOf("\n",t+1),o=-1===n?r:r.slice(n+1),i=String(e.stack),s=function(e,t){const n=te.hasOwnProp(e,ge)&&e[ge];return n&&t.endsWith(n)?t.length-n.length:-1}(e,i),a=-1===s?i:i.slice(0,s),u=-1===s?"":i.slice(s);a.endsWith(o)||(e.stack=a+"\n"+r+u)}}else e.stack=r}catch(e){}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Pt(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&gn.assertOptions(n,{silentJSONParsing:wn.transitional(wn.boolean),forcedJSONParsing:wn.transitional(wn.boolean),clarifyTimeoutError:wn.transitional(wn.boolean),legacyInterceptorReqResOrdering:wn.transitional(wn.boolean),advertiseZstdAcceptEncoding:wn.transitional(wn.boolean),validateStatusUndefinedResolves:wn.transitional(wn.boolean),encodeBasicAuthUsername:wn.transitional(wn.boolean)},!1),null!=r&&(te.isFunction(r)?t.paramsSerializer={serialize:r}:gn.assertOptions(r,{encode:wn.function,serialize:wn.function},!0)),void 0!==t.allowAbsoluteUrls||(te.hasOwnProp(this.defaults,"allowAbsoluteUrls")&&void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),gn.assertOptions(t,{baseUrl:wn.spelling("baseURL"),withXsrfToken:wn.spelling("withXSRFToken")},!0),t.method=(te.getSafeProp(t,"method")||te.getSafeProp(this.defaults,"method")||"get").toLowerCase();const i=te.getSafeProp(o,"common"),s=te.getSafeProp(o,t.method),a=o&&te.merge(_n(i)?i:void 0,_n(s)?s:void 0);o&&te.forEach(Je.concat("common"),e=>{_n(te.getSafeProp(o,e))&&delete o[e]}),t.headers=ye.concat(a,o);const u=[];let c=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;c=c&&e.synchronous;const n=t.transitional||Fe;n&&n.legacyInterceptorReqResOrdering?u.unshift(e.fulfilled,e.rejected):u.push(e.fulfilled,e.rejected)});const l=[];let f;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let p,h=0;if(!c){const e=[mn.bind(this),void 0];for(e.unshift(...u),e.push(...l),p=e.length,f=Promise.resolve(t);h<p;)f=f.then(e[h++],e[h++]);return f}p=u.length;let d=t;for(;h<p;){const e=u[h++],t=u[h++];try{d=e?e(d):d}catch(e){if(!t){f=Promise.reject(e);break}try{const n=t.call(this,e);te.isThenable(n)&&(f=Promise.resolve(n).then(()=>mn.call(this,d)))}catch(e){f=Promise.reject(e)}break}}if(!f)try{f=mn.call(this,d)}catch(e){f=Promise.reject(e)}for(h=0,p=l.length;h<p;)f=f.then(l[h++],l[h++]);return f}getUri(e){hn(e=Pt(this.defaults,e),()=>pn.getAdapter(e.adapter||Ze.adapter,e));return Ne(vt(e.baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}te.forEach(["delete","get","head","options"],function(e){En.prototype[e]=async function(t,n){return this.request(Pt(n||{},{method:e,url:t,data:n&&te.hasOwnProp(n,"data")?n.data:void 0}))}}),te.forEach(["post","put","patch","query"],function(e){function t(t){return async function(n,r,o){return this.request(Pt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}En.prototype[e]=t(),"query"!==e&&(En.prototype[e+"Form"]=t(!0))});const On=En;class Sn{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new nt(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Sn(function(t){e=t}),cancel:e}}}const Tn=Sn;const Rn={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,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent: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,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Rn).forEach(([e,t])=>{void 0===Rn[t]&&(Rn[t]=e)});const kn=Rn;const Pn=function e(t){const n=new On(t),r=o(On.prototype.request,n);return te.extend(r,On.prototype,n,{allOwnKeys:!0}),te.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Pt(t,n))},r}(Ze);Pn.Axios=On,Pn.CanceledError=nt,Pn.CancelToken=Tn,Pn.isCancel=tt,Pn.VERSION="1.22.0",Pn.toFormData=Re,Pn.AxiosError=_e,Pn.Cancel=Pn.CanceledError,Pn.all=function(e){return Promise.all(e)},Pn.spread=function(e){return function(t){return e.apply(null,t)}},Pn.isAxiosError=function(e){return te.isObject(e)&&!0===e.isAxiosError},Pn.mergeConfig=Pt,Pn.AxiosHeaders=ye,Pn.formToJSON=e=>$e(te.isHTMLForm(e)?new FormData(e):e),Pn.getAdapter=pn.getAdapter,Pn.HttpStatusCode=kn,Pn.default=Pn;const An=Pn;function jn(e){return jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jn(e)}function Cn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return Nn(c,"_invoke",function(n,r,o){var i,a,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],h=p.p,d=i[2];n>3?(o=d===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,p.v=r,p.n=i[1]):h<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,p.n=d,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),a=l,u=d;(t=a<2?e:u)||!f;){i||(a?(a>1&&(p.n=a<3?-1:u),h(a,u)):p.v=u);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(Nn(t={},r,function(){return this}),t),f=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Nn(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,Nn(f,"constructor",c),Nn(c,"constructor",u),u.displayName="GeneratorFunction",Nn(c,o,"GeneratorFunction"),Nn(f),Nn(f,o,"Generator"),Nn(f,r,function(){return this}),Nn(f,"toString",function(){return"[object Generator]"}),(Cn=function(){return{w:i,m:p}})()}function Nn(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Nn=function(e,t,n,r){function i(t,n){Nn(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Nn(e,t,n,r)}function Un(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function xn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Dn(r.key),r)}}function Dn(e){var t=function(e,t){if("object"!=jn(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=jn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jn(t)?t:t+""}var Ln=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._token=e._validate(t)},t=[{key:"getAccessToken",value:(r=Cn().m(function e(){return Cn().w(function(e){for(;;)if(0===e.n)return e.a(2,this._token)},e,this)}),o=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function s(e){Un(i,n,o,s,a,"next",e)}function a(e){Un(i,n,o,s,a,"throw",e)}s(void 0)})},function(){return o.apply(this,arguments)})},{key:"canRefresh",value:function(){return!1}},{key:"clear",value:function(){this._token=null}}],n=[{key:"_validate",value:function(e){if("string"!=typeof e||!e.trim())throw new TypeError("bearer token must be a non-empty string");return e.trim()}}],t&&xn(e.prototype,t),n&&xn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o}();function Bn(e){return Bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bn(e)}function Fn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return In(c,"_invoke",function(n,r,o){var i,a,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],h=p.p,d=i[2];n>3?(o=d===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,p.v=r,p.n=i[1]):h<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,p.n=d,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),a=l,u=d;(t=a<2?e:u)||!f;){i||(a?(a>1&&(p.n=a<3?-1:u),h(a,u)):p.v=u);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(In(t={},r,function(){return this}),t),f=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,In(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,In(f,"constructor",c),In(c,"constructor",u),u.displayName="GeneratorFunction",In(c,o,"GeneratorFunction"),In(f),In(f,o,"Generator"),In(f,r,function(){return this}),In(f,"toString",function(){return"[object Generator]"}),(Fn=function(){return{w:i,m:p}})()}function In(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}In=function(e,t,n,r){function i(t,n){In(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},In(e,t,n,r)}function Hn(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function qn(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(e){Hn(i,r,o,s,a,"next",e)}function a(e){Hn(i,r,o,s,a,"throw",e)}s(void 0)})}}function Mn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,zn(r.key),r)}}function zn(e){var t=function(e,t){if("object"!=Bn(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=Bn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Bn(t)?t:t+""}var Xn=new Set(["127.0.0.1","localhost","::1","[::1]"]);var Kn=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.tokenUrl,r=t.clientId,o=void 0===r?"appmesh-cli":r,i=t.accessToken,s=t.refreshToken,a=t.expiresIn,u=void 0===a?0:a,c=t.httpClient;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._tokenUrl=function(e){var t;try{t=new URL(e)}catch(e){throw new TypeError("tokenUrl must be a valid URL")}if("https:"===t.protocol)return e;if("http:"===t.protocol&&Xn.has(t.hostname.toLowerCase()))return e;throw new TypeError("tokenUrl must use https, or http only for loopback hosts (127.0.0.1, localhost, ::1)")}(n),this._clientId=o,this._accessToken=i||null,this._refreshToken=s||null,this._http=c||An.create({timeout:3e4}),this._inflightRefresh=null,this._expiresAtMs=0,this._lifetimeMs=0,this._setExpiry(u)},t=[{key:"getAccessToken",value:(s=qn(Fn().m(function e(){return Fn().w(function(e){for(;;)switch(e.n){case 0:if(!(null===this._accessToken&&this._refreshToken||this._isExpiringSoon())){e.n=1;break}return e.n=1,this._refresh();case 1:if(null!==this._accessToken||this._refreshToken){e.n=2;break}throw new Error("no access token available: the provider holds no credentials");case 2:return e.a(2,this._accessToken)}},e,this)})),function(){return s.apply(this,arguments)})},{key:"canRefresh",value:function(){return!!this._refreshToken}},{key:"refreshAccessToken",value:(i=qn(Fn().m(function e(t){return Fn().w(function(e){for(;;)switch(e.n){case 0:if(!t||t===this._accessToken){e.n=1;break}return e.a(2,this._accessToken);case 1:return e.n=2,this._refresh();case 2:return e.a(2,this._accessToken)}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"clear",value:function(){this._accessToken=null,this._refreshToken=null,this._expiresAtMs=0,this._lifetimeMs=0}},{key:"_setExpiry",value:function(e){var t=Number(e);Number.isFinite(t)&&t>0?(this._lifetimeMs=1e3*t,this._expiresAtMs=Date.now()+this._lifetimeMs):(this._lifetimeMs=0,this._expiresAtMs=0)}},{key:"_isExpiringSoon",value:function(){if(!this._expiresAtMs||!this._refreshToken)return!1;var e=Math.max(3e4,.1*this._lifetimeMs);return Date.now()>=this._expiresAtMs-e}},{key:"_refresh",value:(o=qn(Fn().m(function e(){var t=this;return Fn().w(function(e){for(;;)if(0===e.n)return this._inflightRefresh||(this._inflightRefresh=this._performRefresh().finally(function(){t._inflightRefresh=null})),e.a(2,this._inflightRefresh)},e,this)})),function(){return o.apply(this,arguments)})},{key:"_performRefresh",value:(r=qn(Fn().m(function e(){var t,n,r,o,i;return Fn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this._refreshToken){e.n=1;break}throw new Error("cannot refresh: no refresh token available");case 1:return t=new URLSearchParams({grant_type:"refresh_token",refresh_token:this._refreshToken,client_id:this._clientId}),e.p=2,e.n=3,this._http.post(this._tokenUrl,t.toString(),{headers:{"Content-Type":"application/x-www-form-urlencoded"},validateStatus:function(){return!0}});case 3:n=e.v,e.n=5;break;case 4:throw e.p=4,i=e.v,new Error("token refresh request failed: ".concat(i.message||"unknown error"));case 5:if(r=n.status,"invalid_grant"!==(o=n.data&&"object"===Bn(n.data)?n.data:{}).error){e.n=6;break}throw this.clear(),new Error("token refresh rejected by the server (invalid_grant)");case 6:if(!(r<200||r>=300||o.error)){e.n=7;break}throw new Error("token refresh failed with status ".concat(r).concat(o.error?": ".concat(o.error):""));case 7:if("string"==typeof o.access_token&&o.access_token){e.n=8;break}throw new Error("token refresh response did not include an access_token");case 8:this._accessToken=o.access_token,"string"==typeof o.refresh_token&&o.refresh_token&&(this._refreshToken=o.refresh_token),this._setExpiry(o.expires_in);case 9:return e.a(2)}},e,this,[[2,4]])})),function(){return r.apply(this,arguments)})}],t&&Mn(e.prototype,t),n&&Mn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o,i,s}();function Wn(e){return Wn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wn(e)}function Yn(e){var t=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(Array.isArray(e)&&(null==t||t===("undefined"!=typeof Symbol&&[][Symbol.iterator])||t===[]["@@iterator"]))return e;if(null!=t){for(var n,r=[],o=t.call(e);!(n=o.next()).done;)r.push(n.value);return r}}(e);return t===e?Jn(e):t||$n(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gn(e,t){return function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(Array.isArray(e)&&(null==n||n===("undefined"!=typeof Symbol&&[][Symbol.iterator])||n===[]["@@iterator"]))return e;if(null!=n){var r,o,i,s,a=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||$n(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $n(e,t){if(e){if("string"==typeof e)return Jn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jn(e,t):void 0}}function Jn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Vn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return Qn(c,"_invoke",function(n,r,o){var i,a,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],h=p.p,d=i[2];n>3?(o=d===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,p.v=r,p.n=i[1]):h<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,p.n=d,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),a=l,u=d;(t=a<2?e:u)||!f;){i||(a?(a>1&&(p.n=a<3?-1:u),h(a,u)):p.v=u);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(Qn(t={},r,function(){return this}),t),f=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Qn(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,Qn(f,"constructor",c),Qn(c,"constructor",u),u.displayName="GeneratorFunction",Qn(c,o,"GeneratorFunction"),Qn(f),Qn(f,o,"Generator"),Qn(f,r,function(){return this}),Qn(f,"toString",function(){return"[object Generator]"}),(Vn=function(){return{w:i,m:p}})()}function Qn(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Qn=function(e,t,n,r){function i(t,n){Qn(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Qn(e,t,n,r)}function Zn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,er(r.key),r)}}function er(e){var t=function(e,t){if("object"!=Wn(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=Wn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Wn(t)?t:t+""}function tr(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function nr(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(e){tr(i,r,o,s,a,"next",e)}function a(e){tr(i,r,o,s,a,"throw",e)}s(void 0)})}}var rr=null;function or(){return ir.apply(this,arguments)}function ir(){return(ir=nr(Vn().m(function e(){var t;return Vn().w(function(e){for(;;)switch(e.n){case 0:if(!rr){e.n=1;break}return e.a(2,rr);case 1:return e.n=2,import("node:crypto");case 2:return t=e.v,rr=t.default&&t.default.createHmac?t.default:t,e.a(2,rr)}},e)}))).apply(this,arguments)}var sr=new Set(["/appmesh/files"]),ar=/^\/appmesh\/apps\/[^/]+\/(output|task)\/stream$/,ur=Object.freeze({KEY_ID:"X-Request-Key",TIMESTAMP:"X-Timestamp",NONCE:"X-Nonce",SIGNATURE:"X-Signature"});function cr(e){if("string"!=typeof e)return!1;var t=lr(e);return sr.has(t)||ar.test(t)}function lr(e){return"/appmesh/files/ws"===e?"/appmesh/files":e}var fr=function(){return e=function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"string"!=typeof t||""===t.trim())throw new TypeError("keyId must be a non-empty string");if("string"!=typeof n||""===n)throw new TypeError("secret must be a non-empty string");Object.defineProperty(this,"_keyId",{value:t,writable:!0}),Object.defineProperty(this,"_secret",{value:n,writable:!0})},t=[{key:"keyId",get:function(){return this._keyId}},{key:"attach",value:(i=nr(Vn().m(function e(t,n,r,o,i,s,a){var u,c,l,f,p,h,d,y,m,b,v;return Vn().w(function(e){for(;;)switch(e.n){case 0:if(u=s||String(Math.floor(Date.now()/1e3)),p=a){e.n=2;break}return e.n=1,this.randomNonce();case 1:p=e.v;case 2:return c=p,l=lr(r),h=pr,d=n,y=l,m=o,e.n=3,hr(l,i);case 3:return f=h(d,y,m,e.v,u,c),t[ur.KEY_ID]=this._keyId,t[ur.TIMESTAMP]=u,t[ur.NONCE]=c,b=t,v=ur.SIGNATURE,e.n=4,this.sign(f);case 4:b[v]=e.v;case 5:return e.a(2)}},e,this)})),function(e,t,n,r,o,s,a){return i.apply(this,arguments)})},{key:"randomNonce",value:(o=nr(Vn().m(function e(){var t;return Vn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,or();case 1:return t=e.v,e.a(2,t.randomBytes(16).toString("hex"))}},e)})),function(){return o.apply(this,arguments)})},{key:"sign",value:(r=nr(Vn().m(function e(t){var n;return Vn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,or();case 1:return n=e.v,e.a(2,n.createHmac("sha256",this._secret).update(t,"utf8").digest("hex"))}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"toString",value:function(){return"RequestSigner[keyId=".concat(this._keyId,"]")}}],t&&Zn(e.prototype,t),n&&Zn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o,i}();function pr(e,t,n,r,o,i){if(!e||!t)throw new TypeError("method and path are required");return[e,t,n||"",r,o,i].join("\n")}function hr(e,t){return dr.apply(this,arguments)}function dr(){return(dr=nr(Vn().m(function e(t,n){var r,o;return Vn().w(function(e){for(;;)switch(e.n){case 0:return r=null==n||cr(t)?Buffer.alloc(0):Buffer.from(n),e.n=1,or();case 1:return o=e.v,e.a(2,o.createHash("sha256").update(r).digest("hex"))}},e)}))).apply(this,arguments)}function yr(e){if(!e)return"";for(var t=Object.create(null),n=0;n<e.length;){var r=e.indexOf("&",n),o=r<0?e.slice(n):e.slice(n,r),i=o.indexOf("="),s=i<0?o:o.slice(0,i),a=i<0?"":o.slice(i+1),u=mr(s);if(Object.prototype.hasOwnProperty.call(t,u)||(t[u]=mr(a)),r<0)break;n=r+1}var c=Object.entries(t);return c.sort(function(e,t){var n=Buffer.compare(Buffer.from(e[0],"utf8"),Buffer.from(t[0],"utf8"));return 0!==n?n:Buffer.compare(Buffer.from(e[1],"utf8"),Buffer.from(t[1],"utf8"))}),c.map(function(e){var t=Gn(e,2),n=t[0],r=t[1];return"".concat(n,"=").concat(r)}).join("&")}function mr(e){if(!e.includes("%"))return e;for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(37===r){var o=e.charCodeAt(n+1),i=e.charCodeAt(n+2),s=function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102};if(!s(o)||!s(i))return e;t.push(parseInt(e.slice(n+1,n+3),16)),n+=2}else if(r<128)t.push(r);else{var a=Buffer.from(e[n],"utf8");t.push.apply(t,Yn(a))}}return Buffer.from(t).toString("utf8")}function br(e){return e?Object.entries(e).filter(function(e){var t=Gn(e,2)[1];return null!=t}).map(function(e){var t=Gn(e,2),n=t[0],r=t[1];return"".concat(encodeURIComponent(String(n)),"=").concat(encodeURIComponent(String(r)))}).join("&"):""}function vr(e){return vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vr(e)}function gr(e,t){return function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(Array.isArray(e)&&(null==n||n===("undefined"!=typeof Symbol&&[][Symbol.iterator])||n===[]["@@iterator"]))return e;if(null!=n){var r,o,i,s,a=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||Pr(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wr(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return _r(c,"_invoke",function(n,r,o){var i,a,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],h=p.p,d=i[2];n>3?(o=d===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,p.v=r,p.n=i[1]):h<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,p.n=d,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),a=l,u=d;(t=a<2?e:u)||!f;){i||(a?(a>1&&(p.n=a<3?-1:u),h(a,u)):p.v=u);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(_r(t={},r,function(){return this}),t),f=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,_r(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,_r(f,"constructor",c),_r(c,"constructor",u),u.displayName="GeneratorFunction",_r(c,o,"GeneratorFunction"),_r(f),_r(f,o,"Generator"),_r(f,r,function(){return this}),_r(f,"toString",function(){return"[object Generator]"}),(wr=function(){return{w:i,m:p}})()}function _r(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}_r=function(e,t,n,r){function i(t,n){_r(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},_r(e,t,n,r)}function Er(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Or(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Er(Object(n),!0).forEach(function(t){Sr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Er(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Sr(e,t,n){return(t=Nr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tr(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function Rr(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(e){Tr(i,r,o,s,a,"next",e)}function a(e){Tr(i,r,o,s,a,"throw",e)}s(void 0)})}}function kr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Pr(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function Pr(e,t){if(e){if("string"==typeof e)return Ar(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ar(e,t):void 0}}function Ar(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Nr(r.key),r)}}function Cr(e,t,n){return t&&jr(e.prototype,t),n&&jr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Nr(e){var t=function(e,t){if("object"!=vr(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=vr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==vr(t)?t:t+""}function Ur(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xr(e,t,n){return t=Ir(t),function(e,t){if(t&&("object"==vr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Br()?Reflect.construct(t,n||[],Ir(e).constructor):t.apply(e,n))}function Dr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fr(e,t)}function Lr(e){var t="function"==typeof Map?new Map:void 0;return Lr=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(Br())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&Fr(o,n.prototype),o}(e,arguments,Ir(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Fr(n,e)},Lr(e)}function Br(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Br=function(){return!!e})()}function Fr(e,t){return Fr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fr(e,t)}function Ir(e){return Ir=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ir(e)}function Hr(e){return new zr(e,0)}function qr(e){return function(){return new Mr(e.apply(this,arguments))}}function Mr(e){var t,n;function r(t,n){try{var i=e[t](n),s=i.value,a=s instanceof zr;Promise.resolve(a?s.v:s).then(function(n){if(a){var u="return"===t&&s.k?t:"next";if(!s.k||n.done)return r(u,n);n=e[u](n).value}o(!!i.done,n)},function(e){r("throw",e)})}catch(e){o(2,e)}}function o(e,o){2===e?t.reject(o):t.resolve({value:o,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise(function(i,s){var a={key:e,arg:o,resolve:i,reject:s,next:null};n?n=n.next=a:(t=n=a,r(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}function zr(e,t){this.v=e,this.k=t}function Xr(e){var t,n,r,o=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);o--;){if(n&&null!=(t=e[n]))return t.call(e);if(r&&null!=(t=e[r]))return new Kr(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function Kr(e){function t(e,t){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var r,o=e.done,i=e.value;try{r=Promise.resolve(i)}catch(e){if(t&&!o)try{n(t)}catch(e){}return Promise.reject(e)}return r.then(function(e){return{value:e,done:o}},t&&!o?function(e){try{n(t)}catch(e){}throw e}:void 0)}function n(e){var t=e.return;null!=t&&t.call(e)}return Kr=function(e){this.s=e,this.n=e.next},Kr.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments),this.s)},return:function(e){var n=this.s.return;return void 0===n?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(){var e=this.s,r=e.throw;return void 0===r?new Promise(function(t,r){n(e),r(new TypeError("The iterator does not provide a 'throw' method"))}):t(r.apply(e,arguments),e)}},new Kr(e)}Mr.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Mr.prototype.next=function(e){return this._invoke("next",e)},Mr.prototype.throw=function(e){return this._invoke("throw",e)},Mr.prototype.return=function(e){return this._invoke("return",e)};var Wr=null,Yr=null,Gr=null,$r=Object.freeze({HTTP_USER_AGENT_HEADER_NAME:"User-Agent",HTTP_USER_AGENT:"appmesh/javascript",DEFAULT_RUN_APP_TIMEOUT_SECONDS:"P2D",DEFAULT_RUN_APP_LIFECYCLE_SECONDS:"P2DT12H",SYNC_RUN_OUTPUT_PAGE_BYTES:5242880,SYNC_RUN_TRUNCATED_RETENTION_SECONDS:600,HTTP_HEADER_KEY_AUTH:"Authorization",HTTP_HEADER_KEY_X_TARGET_HOST:"X-Target-Host",HTTP_HEADER_KEY_X_FILE_PATH:"X-File-Path",HTTP_HEADER_KEY_X_FILE_OVERWRITE:"X-File-Overwrite",HTTP_HEADER_KEY_X_FILE_MODE:"X-File-Mode",HTTP_HEADER_KEY_X_FILE_USER:"X-File-User",HTTP_HEADER_KEY_X_FILE_GROUP:"X-File-Group",HTTP_HEADER_KEY_X_OUTPUT_POSITION:"X-Output-Position",HTTP_HEADER_KEY_X_EXIT_CODE:"X-Exit-Code",HTTP_HEADER_KEY_X_OUTPUT_TRUNCATED:"X-Output-Truncated",HTTP_HEADER_KEY_X_APP_NAME:"X-App-Name",HTTP_HEADER_KEY_X_INPUT_CLOSE:"X-Input-Close",HTTP_HEADER_KEY_X_SUBSCRIPTION_ID:"X-Subscription-Id",HTTP_HEADER_KEY_X_APPMESH_PROCESS_KEY:"X-AppMesh-Process-Key"}),Jr=Object.freeze({isNode:!("undefined"!=typeof window&&"undefined"!==window.document)}),Vr=/^([a-z][a-z\d+\-.]*:)?\/\//i;function Qr(e,t){var n=String(e||""),r=String(t||""),o=r;if(n&&!Vr.test(r)){for(var i=n.length;i>0&&47===n.charCodeAt(i-1);)i--;o=r?n.slice(0,i)+"/"+r.replace(/^\/+/,""):n}try{return new URL(o).pathname}catch(e){try{return new URL(o,"http://localhost").pathname}catch(e){return r}}}var Zr=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return Ur(this,e),(n=xr(this,e,[t])).name="AppMeshError",n.statusCode=r,n.responseData=o,n.errorCode=i,n.timestamp=(new Date).toISOString(),n}return Dr(e,Lr(Error)),Cr(e)}(),eo=function(){function e(t){var n;return Ur(this,e),(n=xr(this,e,[t,null,null,"APP_REMOVED"])).name="AppRemovedError",n}return Dr(e,Zr),Cr(e)}(),to=function(){function e(t){var n;return Ur(this,e),(n=xr(this,e,[t,null,null,"TRANSPORT_DISCONNECTED"])).name="TransportDisconnectedError",n}return Dr(e,Zr),Cr(e)}(),no=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Ur(this,e),(n=xr(this,e,[t,r,null,"REQUEST"])).name="AppMeshRequestError",n}return Dr(e,Zr),Cr(e)}(),ro=function(){function e(t){var n;return Ur(this,e),(n=xr(this,e,[t,null,null,"TIMEOUT"])).name="AppMeshTimeoutError",n}return Dr(e,Zr),Cr(e)}(),oo=function(e,t){Jr.isNode?process.stdout.write(e):console.log(e)};function io(e){if("number"==typeof e)return e;if("string"!=typeof e)throw new Error("Invalid input type. Expected number or ISO 8601 duration string.");if(/^\d+$/.test(e))return parseInt(e,10);if(!e.trim())throw new Error("Duration string cannot be empty");if(!e.startsWith("P"))throw new Error("Invalid ISO8601 duration: must start with P");var t="\\d+",n="".concat(t,"(?:[\\.,]").concat(t,")?"),r="(".concat(t,"Y)?(").concat(t,"M)?(").concat(t,"W)?(").concat(t,"D)?"),o="T(".concat(n,"H)?(").concat(n,"M)?(").concat(n,"S)?"),i="P(?:".concat(r,"(?:").concat(o,")?)"),s=["years","months","weeks","days","hours","minutes","seconds"],a=e.replace(/,/g,".").match(new RegExp(i));if(!a)throw new RangeError("invalid duration: "+e);var u=a.slice(1);if(0===u.filter(function(e){return null!=e}).length)throw new RangeError("invalid duration: "+e);if(u.filter(function(e){return/\./.test(e||"")}).length>1)throw new RangeError("only the smallest unit can be fractional");var c=u.reduce(function(e,t,n){return e[s[n]]=parseFloat(t||"0")||0,e},{}),l=0;return l+=31536e3*c.years,l+=2592e3*c.months,l+=604800*c.weeks,l+=86400*c.days,l+=3600*c.hours,l+=60*c.minutes,l+=c.seconds}function so(e){return"undefined"!=typeof Buffer&&Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):(new TextEncoder).encode(null==e?"":String(e))}function ao(e){if("undefined"!=typeof Buffer)return Buffer.concat(e.map(function(e){return Buffer.isBuffer(e)?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)}));var t,n=0,r=kr(e);try{for(r.s();!(t=r.n()).done;){n+=t.value.byteLength}}catch(e){r.e(e)}finally{r.f()}var o,i=new Uint8Array(n),s=0,a=kr(e);try{for(a.s();!(o=a.n()).done;){var u=o.value;i.set(u,s),s+=u.byteLength}}catch(e){a.e(e)}finally{a.f()}return i}function uo(e){return fo(e.headers,"content-type")||(null==e.contentType?void 0:e.contentType)}function co(e){var t=/charset\s*=\s*"?([\w!#$%&*+\-.^`|~]+)"?/i.exec(String(e||""));return t?t[1]:null}function lo(e,t){for(var n=0,r=[t,"utf-8"];n<r.length;n++){var o=r[n];if(o)try{return new TextDecoder(o).decode(e)}catch(e){}}return new TextDecoder("utf-8").decode(e)}function fo(e,t){if(e){var n=t.toLowerCase(),r=Object.keys(e).find(function(e){return e.toLowerCase()===n});return void 0===r?void 0:e[r]}}function po(e,t,n){if("string"!=typeof e||""===e)return e;if(!String(fo(t,"content-type")||"").toLowerCase().includes("json"))return e;try{return JSON.parse(e)}catch(t){throw new Zr("Response body is not valid JSON: ".concat(t.message),null!=n?n:null,e,"JSON_PARSE")}}function ho(e){return yo.apply(this,arguments)}function yo(){return(yo=Rr(wr().m(function e(t){var r,o,i,s;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=parseInt(t,10),isNaN(r)||String(r)!==t.trim()){e.n=1;break}return e.a(2,r);case 1:return e.p=1,e.n=2,n.e(994).then(()=>n.t(994,19));case 2:if(o=e.v,i=o.spawnSync,0===(s=i("id",["-u",t],{encoding:"utf8",timeout:3e3})).status&&s.stdout){e.n=3;break}return e.a(2,null);case 3:return e.a(2,parseInt(s.stdout.trim(),10));case 4:return e.p=4,e.v,e.a(2,null)}},e,null,[[1,4]])}))).apply(this,arguments)}function mo(e){return bo.apply(this,arguments)}function bo(){return(bo=Rr(wr().m(function e(t){var n,r;return wr().w(function(e){for(;;)switch(e.n){case 0:if(n=parseInt(t,10),isNaN(n)||String(n)!==t.trim()){e.n=1;break}return e.a(2,n);case 1:return e.n=2,vo("name",t);case 2:return r=e.v,e.a(2,r?r.gid:null)}},e)}))).apply(this,arguments)}function vo(e,t){return go.apply(this,arguments)}function go(){return(go=Rr(wr().m(function e(t,r){var o,i,s,a,u,c,l,f,p,h,d;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,n.e(994).then(()=>n.t(994,19));case 1:if(o=e.v,i=o.spawnSync,0!==(s=i("getent",["group",String(r)],{encoding:"utf8",timeout:3e3})).status||!s.stdout){e.n=2;break}return a=s.stdout.trim().split(":"),u=a.length>=3?parseInt(a[2],10):NaN,e.a(2,a[0]&&!isNaN(u)?{name:a[0],gid:u}:null);case 2:if(0===(c=i("dscacheutil",["-q","group","-a",t,String(r)],{encoding:"utf8",timeout:3e3})).status&&c.stdout){e.n=3;break}return e.a(2,null);case 3:if(l=c.stdout.split("\n"),f=l.find(function(e){return e.startsWith("name:")}),p=l.find(function(e){return e.startsWith("gid:")}),f&&p){e.n=4;break}return e.a(2,null);case 4:return h=f.slice(5).trim(),d=parseInt(p.slice(4).trim(),10),e.a(2,h&&!isNaN(d)?{name:h,gid:d}:null);case 5:return e.p=5,e.v,e.a(2,null)}},e,null,[[0,5]])}))).apply(this,arguments)}function wo(e){return _o.apply(this,arguments)}function _o(){return(_o=Rr(wr().m(function e(t){var r,o,i,s;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,n.e(994).then(()=>n.t(994,19));case 1:if(r=e.v,o=r.spawnSync,0===(i=o("id",["-un",String(t)],{encoding:"utf8",timeout:3e3})).status&&i.stdout){e.n=2;break}return e.a(2,null);case 2:return s=i.stdout.trim(),e.a(2,s||null);case 3:return e.p=3,e.v,e.a(2,null)}},e,null,[[0,3]])}))).apply(this,arguments)}function Eo(e){return Oo.apply(this,arguments)}function Oo(){return(Oo=Rr(wr().m(function e(t){var n;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,vo("gid",t);case 1:return n=e.v,e.a(2,n?n.name:null)}},e)}))).apply(this,arguments)}var So="/opt/appmesh/ssl/ca.pem";function To(e){return null==e||"string"==typeof e||"undefined"!=typeof Buffer&&Buffer.isBuffer(e)}function Ro(e){if(!e)return null;var t="function"==typeof e.get?e.get($r.HTTP_HEADER_KEY_AUTH):e[$r.HTTP_HEADER_KEY_AUTH]||e.authorization;return"string"==typeof t&&t.startsWith("Bearer ")?t.slice(7):null}function ko(e){return"string"!=typeof e||e.includes("-----BEGIN")?e:Yr.readFileSync(e)}function Po(e){if(!1===e)return{rejectUnauthorized:!1};if(!e)return Yr.existsSync(So)?{ca:Yr.readFileSync(So),rejectUnauthorized:!0}:{rejectUnauthorized:!0};for(var t=Or({},e),n=0,r=["ca","cert","key"];n<r.length;n++){var o=r[n];t[o]&&(t[o]=ko(t[o]))}return"boolean"!=typeof t.rejectUnauthorized&&(t.rejectUnauthorized=!0),t}var Ao=Cr(function e(t){var n,r,o,i,s,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ur(this,e),this.reason=t,this.exitCode=null!==(n=a.exitCode)&&void 0!==n?n:null,this.position=null!==(r=a.position)&&void 0!==r?r:null,this.status=null!==(o=a.status)&&void 0!==o?o:null,this.message=null!==(i=a.message)&&void 0!==i?i:null,this.result=null!==(s=a.result)&&void 0!==s?s:null});function jo(e){return Co.apply(this,arguments)}function Co(){return(Co=qr(wr().m(function e(t){var n,r,o,i,s,a,u,c,l,f,p,h,d,y,m,b;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:n=new TextDecoder("utf-8"),r="",o="message",i=[],s=!1,a=!1,e.p=1,c=Xr(t);case 2:return e.n=3,Hr(c.next());case 3:if(!(s=!(l=e.v).done)){e.n=12;break}f=l.value,r+="string"==typeof f?f:n.decode(f,{stream:!0}),p=void 0;case 4:if(!((p=r.indexOf("\n"))>=0)){e.n=11;break}if(h=r.slice(0,p).replace(/\r$/,""),r=r.slice(p+1),""!==h){e.n=9;break}if(!("message"!==o||i.length>0)){e.n=8;break}if(d=i.join("\n"),y={},!d){e.n=7;break}e.p=5,y=JSON.parse(d),e.n=7;break;case 6:throw e.p=6,m=e.v,new Zr("malformed SSE frame (".concat(o,"): ").concat(m.message));case 7:return e.n=8,[o,y];case 8:o="message",i=[],e.n=10;break;case 9:h.startsWith(":")||(h.startsWith("event:")?o=h.slice(6).trim():h.startsWith("data:")&&i.push(h.slice(5).trimStart()));case 10:e.n=4;break;case 11:s=!1,e.n=2;break;case 12:e.n=14;break;case 13:e.p=13,b=e.v,a=!0,u=b;case 14:if(e.p=14,e.p=15,!s||null==c.return){e.n=16;break}return e.n=16,Hr(c.return());case 16:if(e.p=16,!a){e.n=17;break}throw u;case 17:return e.f(16);case 18:return e.f(14);case 19:return e.a(2)}},e,null,[[15,,16,18],[5,6],[1,13,14,19]])}))).apply(this,arguments)}function No(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Ao(String(null!==(t=e.reason)&&void 0!==t?t:"closed"),Or({exitCode:e.exit_code,position:e.position,status:e.status,message:e.message},n))}function Uo(e){var t;if("error"===e.reason)throw new no(e.message||"stream failed with an error",null!==(t=e.status)&&void 0!==t?t:null);if("timeout"===e.reason)throw new ro(e.message||"stream timed out");if(!["exit","removed","eof","final","disconnected","closed"].includes(e.reason))throw new Zr("stream ended with unknown reason: ".concat(e.reason))}var xo=function(){return Cr(function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jr.isNode?"https://127.0.0.1:6060":window.location.origin,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Ur(this,e),this.baseURL=r,this.forwardingHost=null,this._requestSigner=null,this._tokenProvider=null,i&&this.setTokenProvider(i);var s={baseURL:r,timeout:3e5,validateStatus:function(e){return!0},transformResponse:[po]};this._sslConfig=o,this._client=An.create(s),Jr.isNode&&!Gr&&(Gr=Promise.all([n.e(453).then(()=>n.t(453,19)),n.e(603).then(()=>n.t(603,19))]).then(function(e){var t=gr(e,2),n=t[0],r=t[1];Wr=n.default||n,Yr=r.default||r}).catch(function(){})),this._client.interceptors.request.use(function(){var e=Rr(wr().m(function e(n){var r,o,i;return wr().w(function(e){for(;;)switch(e.n){case 0:return r=n,o=Or,i=Or({},n.headers),e.n=1,t._commonHeaders();case 1:return r.headers=o(i,e.v),e.a(2,n)}},e)}));return function(t){return e.apply(this,arguments)}}(),function(e){var t=new Zr("Request configuration error: "+(e.message||"Unknown error"));return Promise.reject(t)}),this._client.interceptors.response.use(function(e){return t._handleUnauthorizedRetry(e)},function(e){var t,n,r,o;if(e instanceof Zr)return Promise.reject(e);var i=new Zr("Request failed: "+(e.message||"Unknown error"),null!==(t=null===(n=e.response)||void 0===n?void 0:n.status)&&void 0!==t?t:null,null!==(r=null===(o=e.response)||void 0===o?void 0:o.data)&&void 0!==r?r:null);return i.cause=e,Promise.reject(i)})},[{key:"setTokenProvider",value:function(e){if(!e||"function"!=typeof e.getAccessToken)throw new TypeError("tokenProvider must implement async getAccessToken()");this._tokenProvider=e}},{key:"setBearerToken",value:function(e){null!=e?this.setTokenProvider(new Ln(e)):this.clearBearerToken()}},{key:"setToken",value:function(e){this.setBearerToken(e)}},{key:"clearBearerToken",value:function(){var e=this._tokenProvider;e&&"function"==typeof e.clear&&e.clear(),this._tokenProvider=null}},{key:"enableRequestSignature",value:function(e,t){this._requestSigner=new fr(e,t)}},{key:"disableRequestSignature",value:function(){this._requestSigner=null}},{key:"isRequestSignatureEnabled",value:function(){return null!==this._requestSigner}},{key:"_applyRequestSignature",value:(Y=Rr(wr().m(function e(t){var n,r,o,i,s,a,u,c,l,f,p,h;return wr().w(function(e){for(;;)switch(e.n){case 0:if((n=this._requestSigner)&&t){e.n=1;break}return e.a(2);case 1:return r=Qr(t.baseURL||this._client.defaults.baseURL||this.baseURL,t.url),o="",t.params&&"object"===vr(t.params)&&Object.keys(t.params).length>0&&(t.paramsSerializer=br,o=yr(br(t.params))),i=this._headerValue(t.headers,"content-type"),s=cr(r)?Buffer.alloc(0):this._wireBodyBytes(t.data,i),a=String(t.method||"get").toUpperCase(),u={},e.n=2,n.attach(u,a,r,o,s);case 2:for(c=0,l=Object.entries(u);c<l.length;c++)f=gr(l[c],2),p=f[0],h=f[1],t.headers&&"function"==typeof t.headers.set?t.headers.set(p,h):t.headers=Or(Or({},t.headers),{},Sr({},p,h));case 3:return e.a(2)}},e,this)})),function(e){return Y.apply(this,arguments)})},{key:"_headerValue",value:function(e,t){if(e){if("function"==typeof e.get)return e.get(t);var n=Object.keys(e).find(function(e){return e.toLowerCase()===t.toLowerCase()});return void 0===n?void 0:e[n]}}},{key:"_wireBodyBytes",value:function(e,t){if(null==e)return Buffer.alloc(0);if("string"==typeof e){if(String(t||"").toLowerCase().includes("application/json"))try{return JSON.parse(e),Buffer.from(e.trim(),"utf8")}catch(t){if("SyntaxError"!==t.name)throw t;return Buffer.from(JSON.stringify(e),"utf8")}return Buffer.from(e,"utf8")}if(Buffer.isBuffer(e)||e instanceof Uint8Array||e instanceof ArrayBuffer)return Buffer.from(e);if("object"===vr(e))return Buffer.from(JSON.stringify(e),"utf8");throw new Zr("cannot sign a streaming request body; only the /appmesh/files endpoints accept unbound bodies")}},{key:"_getAccessToken",value:(W=Rr(wr().m(function e(){var t;return wr().w(function(e){for(;;)switch(e.n){case 0:if(!this._tokenProvider){e.n=2;break}return e.n=1,this._tokenProvider.getAccessToken();case 1:t=e.v,e.n=3;break;case 2:t=null;case 3:return e.a(2,t)}},e,this)})),function(){return W.apply(this,arguments)})},{key:"_handleUnauthorizedRetry",value:(K=Rr(wr().m(function e(t){var n,r,o,i,s,a,u,c,l,f;return wr().w(function(e){for(;;)switch(e.n){case 0:if(r=t.config||{},o=this._tokenProvider,401===t.status&&!r.__appmeshRetried&&o){e.n=1;break}return e.a(2,t);case 1:if("function"!=typeof o.canRefresh){e.n=3;break}return e.n=2,o.canRefresh();case 2:l=e.v,e.n=4;break;case 3:l=!!o.canRefresh;case 4:if(l&&"function"==typeof o.refreshAccessToken&&To(r.data)){e.n=5;break}return e.a(2,t);case 5:if(!this._requestSigner){e.n=6;break}if(i=t.headers||{},(s="function"==typeof i.get?i.get("WWW-Authenticate"):i["WWW-Authenticate"]||i["www-authenticate"])&&s.includes("invalid_token")){e.n=6;break}return e.a(2,t);case 6:if(null===(n=Ro(r.headers))||void 0===n){e.n=7;break}f=n,e.n=9;break;case 7:return e.n=8,this._getAccessToken();case 8:f=e.v;case 9:return a=f,e.n=10,o.refreshAccessToken(a);case 10:if("string"==typeof(u=e.v)&&u.trim()){e.n=11;break}return e.a(2,t);case 11:if(r.__appmeshRetried=!0,c="Bearer ".concat(u.trim()),r.headers&&"function"==typeof r.headers.set?r.headers.set($r.HTTP_HEADER_KEY_AUTH,c):r.headers=Or(Or({},r.headers),{},Sr({},$r.HTTP_HEADER_KEY_AUTH,c)),!this._requestSigner){e.n=12;break}return e.n=12,this._applyRequestSignature(r);case 12:return e.a(2,this._client(r))}},e,this)})),function(e){return K.apply(this,arguments)})},{key:"getAuthConfig",value:(X=Rr(wr().m(function e(){var t,n=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.n=1,this._request("get","/appmesh/auth/config",null,t);case 1:return e.a(2,e.v.data)}},e,this)})),function(){return X.apply(this,arguments)})},{key:"getCurrentPrincipal",value:(z=Rr(wr().m(function e(){var t,n=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.n=1,this._request("get","/appmesh/principals/self",null,t);case 1:return e.a(2,e.v.data)}},e,this)})),function(){return z.apply(this,arguments)})},{key:"listApps",value:(M=Rr(wr().m(function e(){var t;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/apps");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return M.apply(this,arguments)})},{key:"getApp",value:(q=Rr(wr().m(function e(t){var n;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/apps/".concat(t));case 1:return n=e.v,e.a(2,n.data)}},e,this)})),function(e){return q.apply(this,arguments)})},{key:"checkAppHealth",value:(H=Rr(wr().m(function e(t){var n;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/apps/".concat(t,"/health"));case 1:return n=e.v,e.a(2,0===parseInt(n.data,10))}},e,this)})),function(e){return H.apply(this,arguments)})},{key:"addApp",value:(I=Rr(wr().m(function e(t,n){var r;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("put","/appmesh/apps/".concat(t),n);case 1:return r=e.v,e.a(2,r.data)}},e,this)})),function(e,t){return I.apply(this,arguments)})},{key:"deleteApp",value:(F=Rr(wr().m(function e(t){var n,r;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this._request("delete","/appmesh/apps/".concat(t));case 1:return n=e.v,e.a(2,200===n.status);case 2:if(e.p=2,404!==(r=e.v).statusCode){e.n=3;break}return e.a(2,!1);case 3:throw r;case 4:return e.a(2)}},e,this,[[0,2]])})),function(e){return F.apply(this,arguments)})},{key:"enableApp",value:(B=Rr(wr().m(function e(t){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("post","/appmesh/apps/".concat(t,"/enable"));case 1:return e.a(2,!0)}},e,this)})),function(e){return B.apply(this,arguments)})},{key:"disableApp",value:(L=Rr(wr().m(function e(t){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("post","/appmesh/apps/".concat(t,"/disable"));case 1:return e.a(2,!0)}},e,this)})),function(e){return L.apply(this,arguments)})},{key:"getAppOutput",value:(D=Rr(wr().m(function e(t){var n,r,o,i,s,a,u,c,l,f,p=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return n=p.length>2&&void 0!==p[2]?p[2]:0,r=p.length>3&&void 0!==p[3]?p[3]:10240,o=p.length>4&&void 0!==p[4]?p[4]:"",i=p.length>5&&void 0!==p[5]?p[5]:0,s={stdout_position:(p.length>1&&void 0!==p[1]?p[1]:0).toString(),stdout_index:n.toString(),stdout_maxsize:r.toString(),process_uuid:o,timeout:io(i).toString()},e.n=1,this._request("get","/appmesh/apps/".concat(t,"/output"),null,{params:s});case 1:return a=e.v,u=fo(a.headers,$r.HTTP_HEADER_KEY_X_OUTPUT_POSITION),c=fo(a.headers,$r.HTTP_HEADER_KEY_X_EXIT_CODE),l=u?parseInt(u,10):null,f=c?parseInt(c,10):null,e.a(2,new Do(a.status,a.data,l,f))}},e,this)})),function(e){return D.apply(this,arguments)})},{key:"runAppSync",value:(x=Rr(wr().m(function e(t){var n,r,o,i,s,a,u,c,l,f,p,h,d,y=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return n=y.length>1&&void 0!==y[1]?y[1]:oo,r=y.length>2&&void 0!==y[2]?y[2]:$r.DEFAULT_RUN_APP_TIMEOUT_SECONDS,o=y.length>3&&void 0!==y[3]?y[3]:$r.DEFAULT_RUN_APP_LIFECYCLE_SECONDS,i=y.length>4&&void 0!==y[4]?y[4]:null,s={timeout:io(r),lifecycle:io(o),sync:1},e.n=1,this._request("post","/appmesh/apps/run",t,{params:s,config:{responseType:"arraybuffer"}});case 1:if(a=e.v,u=null,200!==a.status){e.n=3;break}if((c=fo(a.headers,$r.HTTP_HEADER_KEY_X_EXIT_CODE))&&(u=parseInt(c,10)),l=fo(a.headers,$r.HTTP_HEADER_KEY_X_APP_NAME),f=fo(a.headers,$r.HTTP_HEADER_KEY_X_OUTPUT_TRUNCATED),!l||"1"!==String(f)){e.n=3;break}return p=fo(a.headers,$r.HTTP_HEADER_KEY_X_OUTPUT_POSITION),e.n=2,this._readTruncatedRunOutput(a,l,i,p?parseInt(p,10):NaN);case 2:return h=e.v,n&&n(h,0),e.a(2,u);case 3:if(d=so(a.data),!(null!=i&&d.byteLength>i)){e.n=4;break}throw new no("run output exceeds maxOutputBytes=".concat(i," (").concat(d.byteLength," bytes)"),a.status);case 4:return n&&n(lo(d,co(uo(a))),0),e.a(2,u)}},e,this)})),function(e){return x.apply(this,arguments)})},{key:"_readTruncatedRunOutput",value:(U=Rr(wr().m(function e(t,n,r,o){var i,s,a,u,c,l;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:i=[so(t.data)],Number.isFinite(o)||(o=i[0].byteLength),(s=function(){var e=i.reduce(function(e,t){return e+t.byteLength},0);if(null!=r&&e>r)throw new no("run output exceeds maxOutputBytes=".concat(r,"; the rest stays readable on application ")+"'".concat(n,"' for ").concat($r.SYNC_RUN_TRUNCATED_RETENTION_SECONDS," seconds"),t.status)})(),a=!1,e.p=1;case 2:return e.n=3,this._request("get","/appmesh/apps/".concat(n,"/output"),null,{params:{stdout_position:String(o)},config:{responseType:"arraybuffer"}});case 3:if(u=e.v,c=so(u.data),i.push(c),o+=c.byteLength,s(),!(c.byteLength<$r.SYNC_RUN_OUTPUT_PAGE_BYTES)){e.n=4;break}return a=!0,e.a(3,5);case 4:e.n=2;break;case 5:if(e.p=5,!a){e.n=9;break}return e.p=6,e.n=7,this.deleteApp(n);case 7:e.n=9;break;case 8:e.p=8,l=e.v,console.warn("Warning: Failed to remove sync run application '".concat(n,"':"),l.message);case 9:return e.f(5);case 10:return e.a(2,lo(ao(i),co(uo(t))))}},e,this,[[6,8],[1,,5,10]])})),function(e,t,n,r){return U.apply(this,arguments)})},{key:"runAppAsync",value:(N=Rr(wr().m(function e(t){var n,r,o,i,s=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:$r.DEFAULT_RUN_APP_TIMEOUT_SECONDS,r=s.length>2&&void 0!==s[2]?s[2]:$r.DEFAULT_RUN_APP_LIFECYCLE_SECONDS,o={timeout:io(n),lifecycle:io(r)},e.n=1,this._request("post","/appmesh/apps/run",t,{params:o});case 1:return i=e.v,e.a(2,new Lo(this,i.data.name,i.data.process_uuid))}},e,this)})),function(e){return N.apply(this,arguments)})},{key:"waitForAsyncRun",value:(C=Rr(wr().m(function e(t){var n,r,o,i,s,a,u=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:if(n=u.length>1&&void 0!==u[1]?u[1]:oo,r=u.length>2&&void 0!==u[2]?u[2]:0,!t){e.n=7;break}o=0,i=new Date,s=1;case 1:if(!(t.procUid.length>0)){e.n=7;break}return e.n=2,this.getAppOutput(t.appName,o,0,20480,t.procUid,s);case 2:if((a=e.v).output&&n&&n(a.output,o),null!==a.outPosition&&(o=a.outPosition),null===a.exitCode){e.n=4;break}return e.n=3,this.deleteApp(t.appName);case 3:return e.a(2,a.exitCode);case 4:if(!(r>0&&(new Date-i)/1e3>r)){e.n=5;break}return e.a(3,7);case 5:return e.n=6,new Promise(function(e){return setTimeout(e,100)});case 6:e.n=1;break;case 7:return e.a(2,null)}},e,this)})),function(e){return C.apply(this,arguments)})},{key:"runTask",value:(j=Rr(wr().m(function e(t,n){var r,o,i=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return(r=i.length>2&&void 0!==i[2]?i[2]:300)<=0&&(r=300),e.n=1,this._request("post","/appmesh/apps/".concat(t,"/task"),n,{params:{timeout:r.toString()}});case 1:return o=e.v,e.a(2,o.data)}},e,this)})),function(e,t){return j.apply(this,arguments)})},{key:"cancelTask",value:(A=Rr(wr().m(function e(t){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("delete","/appmesh/apps/".concat(t,"/task"));case 1:return e.a(2,!0)}},e,this)})),function(e){return A.apply(this,arguments)})},{key:"followOutput",value:function(e){var t=this;return qr(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wr().m(function r(){var o,i,s,a,u,c,l,f,p,h,d,y,m,b,v,g,w,_,E,O,S,T,R,k;return wr().w(function(r){for(;;)switch(r.p=r.n){case 0:return o=n.stdoutPosition,i=void 0===o?0:o,s=n.processUuid,a=void 0===s?"":s,u=n.follow,c=void 0===u||u,l=n.timeout,f=void 0===l?3600:l,p={stdout_position:String(i),follow:c?"true":"false",timeout:String(f)},a&&(p.process_uuid=a),r.n=1,Hr(t._sseRequest("get","/appmesh/apps/".concat(e,"/output/stream"),{params:p}));case 1:h=r.v,d=null,r.p=2,y=!1,m=!1,r.p=3,v=Xr(jo(h.data));case 4:return r.n=5,Hr(v.next());case 5:if(!(y=!(g=r.v).done)){r.n=9;break}if(w=gr(g.value,2),_=w[0],E=w[1],"stdout"!==_){r.n=7;break}return r.n=6,String(null!==(O=E.output)&&void 0!==O?O:"");case 6:r.n=8;break;case 7:if("end"!==_){r.n=8;break}return d=No(E),r.a(3,9);case 8:y=!1,r.n=4;break;case 9:r.n=11;break;case 10:r.p=10,R=r.v,m=!0,b=R;case 11:if(r.p=11,r.p=12,!y||null==v.return){r.n=13;break}return r.n=13,Hr(v.return());case 13:if(r.p=13,!m){r.n=14;break}throw b;case 14:return r.f(13);case 15:return r.f(11);case 16:r.n=18;break;case 17:throw r.p=17,k=r.v,t.onError(k);case 18:return r.p=18,null===(S=h.data)||void 0===S||null===(T=S.destroy)||void 0===T||T.call(S),r.f(18);case 19:return null===d&&(d=new Ao("closed")),Uo(d),r.a(2,d)}},r,null,[[12,,13,15],[3,10,11,16],[2,17,18,19]])})()}).apply(this,arguments)}},{key:"runTaskStream",value:function(e,t){var n=this;return qr(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return wr().m(function o(){var i,s,a,u,c,l,f,p,h,d,y,m,b,v,g,w,_,E,O,S;return wr().w(function(o){for(;;)switch(o.p=o.n){case 0:return i=r.timeout,a=(s=void 0===i?300:i)&&s>0?{timeout:String(s)}:{},o.n=1,Hr(n._sseRequest("post","/appmesh/apps/".concat(e,"/task/stream"),{params:a,body:t}));case 1:u=o.v,c=null,l=null,o.p=2,f=!1,p=!1,o.p=3,d=Xr(jo(u.data));case 4:return o.n=5,Hr(d.next());case 5:if(!(f=!(y=o.v).done)){o.n=10;break}if(m=gr(y.value,2),b=m[0],v=m[1],"partial"!==b){o.n=7;break}return o.n=6,String(null!==(g=v.data)&&void 0!==g?g:"");case 6:o.n=9;break;case 7:if("final"!==b){o.n=8;break}l=null!==(w=v.result)&&void 0!==w?w:null,o.n=9;break;case 8:if("end"!==b){o.n=9;break}return c=No(v,{result:l}),o.a(3,10);case 9:f=!1,o.n=4;break;case 10:o.n=12;break;case 11:o.p=11,O=o.v,p=!0,h=O;case 12:if(o.p=12,o.p=13,!f||null==d.return){o.n=14;break}return o.n=14,Hr(d.return());case 14:if(o.p=14,!p){o.n=15;break}throw h;case 15:return o.f(14);case 16:return o.f(12);case 17:o.n=19;break;case 18:throw o.p=18,S=o.v,n.onError(S);case 19:return o.p=19,null===(_=u.data)||void 0===_||null===(E=_.destroy)||void 0===E||E.call(_),o.f(19);case 20:return null===c&&(c=new Ao("closed",{result:l})),Uo(c),o.a(2,c)}},o,null,[[13,,14,16],[3,11,12,17],[2,18,19,20]])})()}).apply(this,arguments)}},{key:"streamRun",value:function(e){var t=this;return qr(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$r.DEFAULT_RUN_APP_TIMEOUT_SECONDS,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$r.DEFAULT_RUN_APP_LIFECYCLE_SECONDS;return wr().m(function o(){var i,s,a,u,c;return wr().w(function(o){for(;;)switch(o.p=o.n){case 0:return i="string"==typeof e?{command:e,shell:!0}:e,o.n=1,Hr(t.runAppAsync(i,n,r));case 1:return s=o.v,o.p=2,u=t.followOutput(s.appName,{processUuid:s.procUid,follow:!0,timeout:Math.max(io(n),io(r))}),o.n=3,Hr(u.next());case 3:c=o.v;case 4:if(c.done){o.n=7;break}return o.n=5,c.value;case 5:return o.n=6,Hr(u.next());case 6:c=o.v,o.n=4;break;case 7:a=c.value;case 8:return o.p=8,o.p=9,o.n=10,Hr(t.deleteApp(s.appName));case 10:o.n=12;break;case 11:o.p=11,o.v;case 12:return o.f(8);case 13:return o.a(2,a)}},o,null,[[9,11],[2,,8,13]])})()}).apply(this,arguments)}},{key:"sendInput",value:(P=Rr(wr().m(function e(t,n){var r,o,i,s,a,u,c,l,f,p,h=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return s=(i=h.length>2&&void 0!==h[2]?h[2]:{}).close,a=void 0!==s&&s,u=i.processUuid,c=void 0===u?"":u,l=a?Sr({},$r.HTTP_HEADER_KEY_X_INPUT_CLOSE,"true"):{},f=c?{process_uuid:c}:{},e.n=1,this._request("post","/appmesh/apps/".concat(t,"/input"),n,{headers:l,params:f});case 1:return p=e.v,e.a(2,parseInt(null!==(r=null===(o=p.data)||void 0===o?void 0:o.bytes_written)&&void 0!==r?r:0,10))}},e,this)})),function(e,t){return P.apply(this,arguments)})},{key:"downloadFile",value:(k=Rr(wr().m(function e(t){var r,o,i,s,a,u,c,l,f,p,h,d,y,m,b,v,g,w,_,E,O,S,T,R,k,P,A=arguments;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:return a=A.length>2&&void 0!==A[2]&&A[2],(s=A.length>1&&void 0!==A[1]?A[1]:null)||(s=t.split(/[\\/]/).pop()),u=Sr({},$r.HTTP_HEADER_KEY_X_FILE_PATH,encodeURIComponent(t)),e.n=1,this._request("get","/appmesh/files",null,{headers:u,config:{responseType:Jr.isNode?"stream":"arraybuffer"}});case 1:if(c=e.v,l=Jr.isNode?"":c.data,200!==c.status||null!==(r=c.headers)&&void 0!==r&&r["content-disposition"]||!String(null!==(o=null===(i=c.headers)||void 0===i?void 0:i["content-type"])&&void 0!==o?o:"").toLowerCase().includes("json")){e.n=2;break}throw Jr.isNode&&c.data.destroy(),new Zr("File download is not supported by this server surface: ".concat(t),c.status,l);case 2:if(200===c.status){e.n=3;break}throw new Zr("Failed to download file: ".concat(t),c.status,l);case 3:if(!Jr.isNode){e.n=20;break}return e.n=4,n.e(603).then(()=>n.t(603,19));case 4:return f=e.v,e.n=5,n.e(582).then(()=>n.t(582,19));case 5:return p=e.v,h=p.promisify,R=h,e.n=6,n.e(770).then(()=>n.t(770,19));case 6:return d=R(e.v.pipeline),y=f.promises,e.p=7,e.n=8,d(c.data,f.createWriteStream(s));case 8:if(!a||"win32"===process.platform){e.n=17;break}if(m=c.headers,e.p=9,!(b=m["x-file-mode"])){e.n=12;break}if(v=parseInt(b,10),!(Number.isInteger(v)&&v>=0&&v<=511)){e.n=11;break}return e.n=10,y.chmod(s,v);case 10:e.n=12;break;case 11:console.warn("Warning: Invalid x-file-mode value:",b);case 12:if(g=m["x-file-user"],w=m["x-file-group"],!g||!w){e.n=15;break}return e.n=13,ho(g);case 13:return _=e.v,e.n=14,mo(w);case 14:if(E=e.v,null===_||null===E){e.n=15;break}return e.n=15,y.chown(s,_,E);case 15:e.n=17;break;case 16:e.p=16,k=e.v,console.warn("Warning: Unable to apply file attributes to",s,k.message);case 17:e.n=19;break;case 18:throw e.p=18,P=e.v,new Zr("Failed to write file to ".concat(s,": ").concat(P.message),c.status);case 19:e.n=21;break;case 20:O=new Blob([c.data]),S=window.URL.createObjectURL(O),(T=document.createElement("a")).style.display="none",T.href=S,T.download=s.split("/").pop(),document.body.appendChild(T),T.click(),window.URL.revokeObjectURL(S),document.body.removeChild(T);case 21:return e.a(2)}},e,this,[[9,16],[7,18]])})),function(e){return k.apply(this,arguments)})},{key:"uploadFile",value:(R=Rr(wr().m(function e(t){var r,o,i,s,a,u,c,l,f,p,h,d,y,m,b=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:if(s=b.length>2&&void 0!==b[2]&&b[2],a=b.length>3&&void 0!==b[3]&&b[3],i=b.length>1&&void 0!==b[1]?b[1]:null){e.n=2;break}if(u="string"==typeof t?t:t&&t.name){e.n=1;break}throw new Zr("filePath is required when localFile is a Blob without a name");case 1:i=u.split(/[\\/]/).pop();case 2:if(c=Sr({},$r.HTTP_HEADER_KEY_X_FILE_PATH,encodeURIComponent(i)),a&&(c[$r.HTTP_HEADER_KEY_X_FILE_OVERWRITE]="true"),!Jr.isNode){e.n=7;break}return e.n=3,n.e(603).then(()=>n.t(603,19));case 3:if(f=e.v,p=f.statSync(t),!s){e.n=6;break}return c["X-File-Mode"]=(511&p.mode).toString(),e.n=4,wo(p.uid);case 4:return h=e.v,e.n=5,Eo(p.gid);case 5:d=e.v,c["X-File-User"]=h||String(p.uid),c["X-File-Group"]=d||String(p.gid);case 6:l=p.size<10485760?f.readFileSync(t):f.createReadStream(t),e.n=9;break;case 7:if(!(t instanceof File||t instanceof Blob)){e.n=8;break}l=t,e.n=9;break;case 8:throw new Zr("In browser, localFile must be File or Blob");case 9:return e.n=10,this._request("post","/appmesh/files",l,{headers:c,config:{maxBodyLength:1/0,maxContentLength:1/0}});case 10:if(200===(y=e.v).status||201===y.status){e.n=11;break}throw new Zr("Failed to upload file: ".concat(i),y.status,y.data);case 11:if(m=String(null!==(r=null===(o=y.headers)||void 0===o?void 0:o["content-type"])&&void 0!==r?r:"").toLowerCase(),!(200===y.status&&m.includes("json")&&y.data&&"object"===vr(y.data)&&"message"in y.data)){e.n=12;break}throw new Zr("File upload is not supported by this server surface: ".concat(i),y.status,y.data);case 12:return e.a(2)}},e,this)})),function(e){return R.apply(this,arguments)})},{key:"getHostResources",value:(T=Rr(wr().m(function e(){var t;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/resources");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return T.apply(this,arguments)})},{key:"getConfig",value:(S=Rr(wr().m(function e(){var t;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/config");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return S.apply(this,arguments)})},{key:"setConfig",value:(O=Rr(wr().m(function e(t){var n;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("put","/appmesh/config",t);case 1:return n=e.v,e.a(2,n.data)}},e,this)})),function(e){return O.apply(this,arguments)})},{key:"setLogLevel",value:(E=Rr(wr().m(function e(){var t,n,r=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:"DEBUG",e.n=1,this.setConfig({BaseConfig:{LogLevel:t}});case 1:return n=e.v,e.a(2,n.BaseConfig.LogLevel)}},e,this)})),function(){return E.apply(this,arguments)})},{key:"addLabel",value:(_=Rr(wr().m(function e(t,n){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("put","/appmesh/labels/".concat(t),null,{params:{value:n}});case 1:return e.a(2,!0)}},e,this)})),function(e,t){return _.apply(this,arguments)})},{key:"deleteLabel",value:(w=Rr(wr().m(function e(t){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("delete","/appmesh/labels/".concat(t));case 1:return e.a(2,!0)}},e,this)})),function(e){return w.apply(this,arguments)})},{key:"listLabels",value:(g=Rr(wr().m(function e(){var t;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/labels");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return g.apply(this,arguments)})},{key:"listPrincipals",value:(v=Rr(wr().m(function e(){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/principals");case 1:return e.a(2,e.v.data)}},e,this)})),function(){return v.apply(this,arguments)})},{key:"updatePrincipal",value:(b=Rr(wr().m(function e(t,n){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("patch","/appmesh/principals/".concat(encodeURIComponent(t)),n);case 1:return e.a(2,!0)}},e,this)})),function(e,t){return b.apply(this,arguments)})},{key:"deletePrincipal",value:(m=Rr(wr().m(function e(t){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("delete","/appmesh/principals/".concat(encodeURIComponent(t)));case 1:return e.a(2,!0)}},e,this)})),function(e){return m.apply(this,arguments)})},{key:"getCurrentUser",value:(y=Rr(wr().m(function e(){return wr().w(function(e){for(;;)if(0===e.n)return e.a(2,this.getCurrentPrincipal())},e,this)})),function(){return y.apply(this,arguments)})},{key:"listPermissions",value:(d=Rr(wr().m(function e(){var t;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/permissions");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return d.apply(this,arguments)})},{key:"getPrincipalPermissions",value:(h=Rr(wr().m(function e(){var t,n,r=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:{},e.n=1,this._request("get","/appmesh/principals/self/permissions",null,t);case 1:return n=e.v,e.a(2,n.data)}},e,this)})),function(){return h.apply(this,arguments)})},{key:"getUserPermissions",value:(p=Rr(wr().m(function e(){var t,n=arguments;return wr().w(function(e){for(;;)if(0===e.n)return t=n.length>0&&void 0!==n[0]?n[0]:{},e.a(2,this.getPrincipalPermissions(t))},e,this)})),function(){return p.apply(this,arguments)})},{key:"listRoles",value:(f=Rr(wr().m(function e(){var t;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/roles");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return f.apply(this,arguments)})},{key:"updateRole",value:(l=Rr(wr().m(function e(t,n){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("put","/appmesh/roles/".concat(t),n);case 1:return e.a(2,!0)}},e,this)})),function(e,t){return l.apply(this,arguments)})},{key:"deleteRole",value:(c=Rr(wr().m(function e(t){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("delete","/appmesh/roles/".concat(t));case 1:return e.a(2,!0)}},e,this)})),function(e){return c.apply(this,arguments)})},{key:"getMetrics",value:(u=Rr(wr().m(function e(){var t;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/metrics",null,{config:{responseType:"text"}});case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return u.apply(this,arguments)})},{key:"subscribe",value:(a=Rr(wr().m(function e(){return wr().w(function(e){for(;;)switch(e.n){case 0:throw new Zr("subscribe requires the TCP client (AppMeshClientTCP, imported from 'appmesh/tcp'); the HTTP client does not support event subscriptions");case 1:return e.a(2)}},e)})),function(){return a.apply(this,arguments)})},{key:"unsubscribe",value:(s=Rr(wr().m(function e(){return wr().w(function(e){for(;;)switch(e.n){case 0:throw new Zr("unsubscribe requires the TCP client (AppMeshClientTCP, imported from 'appmesh/tcp'); the HTTP client does not support event subscriptions");case 1:return e.a(2)}},e)})),function(){return s.apply(this,arguments)})},{key:"request",value:(i=Rr(wr().m(function e(t,n){var r,o,i=arguments;return wr().w(function(e){for(;;)if(0===e.n)return r=i.length>2&&void 0!==i[2]?i[2]:null,o=i.length>3&&void 0!==i[3]?i[3]:{},e.a(2,this._request(t,n,r,o))},e,this)})),function(e,t){return i.apply(this,arguments)})},{key:"_commonHeaders",value:(o=Rr(wr().m(function e(){var t,n;return wr().w(function(e){for(;;)switch(e.n){case 0:return t={},Jr.isNode&&(t[$r.HTTP_USER_AGENT_HEADER_NAME]=$r.HTTP_USER_AGENT),e.n=1,this._getAccessToken();case 1:return(n=e.v)&&(t[$r.HTTP_HEADER_KEY_AUTH]="Bearer ".concat(n)),this.forwardingHost&&(t[$r.HTTP_HEADER_KEY_X_TARGET_HOST]=this.forwardingHost),e.a(2,t)}},e,this)})),function(){return o.apply(this,arguments)})},{key:"_request",value:(r=Rr(wr().m(function e(t,n){var r,o,i,s,a,u,c,l,f,p,h,d,y=arguments;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=y.length>2&&void 0!==y[2]?y[2]:null,o=y.length>3&&void 0!==y[3]?y[3]:{},e.n=1,this._ensureHttpsAgent();case 1:if(i=o.headers,s=void 0===i?{}:i,a=o.params,u=void 0===a?{}:a,c=o.config,l=void 0===c?{}:c,e.p=2,f=Or(Or({method:t,url:n,withCredentials:!1},l),{},{headers:Or({},s),params:Or({},u)}),null!==r&&(f.data=r),!this._requestSigner){e.n=3;break}return e.n=3,this._applyRequestSignature(f);case 3:return e.n=4,this._client(f);case 4:if(!((p=e.v).status<200||p.status>=300)){e.n=5;break}throw h=this._extractErrorMessage(p.data),new Zr(h,p.status,p.data);case 5:return e.a(2,p);case 6:throw e.p=6,d=e.v,this.onError(d);case 7:return e.a(2)}},e,this,[[2,6]])})),function(e,t){return r.apply(this,arguments)})},{key:"_ensureHttpsAgent",value:(t=Rr(wr().m(function e(){return wr().w(function(e){for(;;)switch(e.n){case 0:if(!Jr.isNode||!Gr||this._client.defaults.httpsAgent){e.n=2;break}return e.n=1,Gr;case 1:Wr&&(this._client.defaults.httpsAgent=new Wr.Agent(Or(Or({},Po(this._sslConfig)),{},{keepAlive:!0,keepAliveMsecs:3e3})));case 2:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"_sseRequest",value:(e=Rr(wr().m(function e(t,n){var r,o,i,s,a,u,c,l,f,p,h,d,y,m,b,v,g,w,_,E=arguments;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=E.length>2&&void 0!==E[2]?E[2]:{},e.n=1,this._ensureHttpsAgent();case 1:if(o=r.params,i=void 0===o?{}:o,s=r.headers,a=void 0===s?{}:s,u=r.body,c={method:t,url:n,withCredentials:!1,responseType:"stream",timeout:0,headers:Or({},a),params:Or({},i)},null!=u&&(c.data=u),!this._requestSigner){e.n=2;break}return e.n=2,this._applyRequestSignature(c);case 2:return e.p=2,e.n=3,this._client(c);case 3:l=e.v,e.n=5;break;case 4:throw e.p=4,w=e.v,this.onError(w);case 5:if(200===l.status){e.n=21;break}f="",e.p=6,p=[],h=!1,d=!1,e.p=7,m=Xr(l.data);case 8:return e.n=9,m.next();case 9:if(!(h=!(b=e.v).done)){e.n=11;break}v=b.value,p.push(v);case 10:h=!1,e.n=8;break;case 11:e.n=13;break;case 12:e.p=12,_=e.v,d=!0,y=_;case 13:if(e.p=13,e.p=14,!h||null==m.return){e.n=15;break}return e.n=15,m.return();case 15:if(e.p=15,!d){e.n=16;break}throw y;case 16:return e.f(15);case 17:return e.f(13);case 18:f=Buffer.concat(p).toString("utf8"),e.n=20;break;case 19:e.p=19,e.v;case 20:throw g=f?this._extractErrorMessage(f):"SSE request failed with status ".concat(l.status),this.forwardingHost&&(400===l.status?g+="; streaming through node forwarding (forwardingHost=".concat(this.forwardingHost,") is relayed by")+" the agent REST listener (default port 6060): point the client at it, not at the engine listener":404!==l.status&&405!==l.status||(g+="; a forwarded stream needs X-Target-Host to name the target without its TCP port"+" (forwardingHost=".concat(this.forwardingHost,"): use a bare host or the target's agent REST port (6060)"))),new Zr(g,l.status,f||null);case 21:return e.a(2,l)}},e,this,[[14,,15,17],[7,12,13,18],[6,19],[2,4]])})),function(t,n){return e.apply(this,arguments)})},{key:"_extractErrorMessage",value:function(e){if(!e)return"Unknown error";if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return this._extractErrorMessage(e.toString("utf8"));if(e instanceof ArrayBuffer)try{var t=new TextDecoder("utf-8").decode(e);return t?this._extractJsonErrorText(t):"Unknown error"}catch(e){return"Binary response error (could not decode)"}return"string"==typeof e?this._extractJsonErrorText(e):"object"===vr(e)?e.message||e.error||JSON.stringify(e):String(e)}},{key:"_extractJsonErrorText",value:function(e){try{var t=JSON.parse(e);return t&&"object"===vr(t)?t.message||t.error||e:"string"==typeof t?t:e}catch(t){return e}}},{key:"onError",value:function(e){return e instanceof Zr?e:new Zr(e.message||"Unknown error")}}]);var e,t,r,o,i,s,a,u,c,l,f,p,h,d,y,m,b,v,g,w,_,E,O,S,T,R,k,P,A,j,C,N,U,x,D,L,B,F,I,H,q,M,z,X,K,W,Y}(),Do=Cr(function e(t,n,r,o){Ur(this,e),this.statusCode=Number(t),this.output=String(n),this.outPosition=null!==r?Number(r):null,this.exitCode=null!==o?Number(o):null}),Lo=function(){return Cr(function e(t,n,r){Ur(this,e),this.appName=n,this.procUid=r,this._client=t,this._forwardingHost=t.forwardingHost},[{key:"withForwardingHost",value:(t=Rr(wr().m(function e(t){var n;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=this._client.forwardingHost,this._client.forwardingHost=this._forwardingHost,e.p=1,e.n=2,t();case 2:return e.a(2,e.v);case 3:return e.p=3,this._client.forwardingHost=n,e.f(3);case 4:return e.a(2)}},e,this,[[1,,3,4]])})),function(e){return t.apply(this,arguments)})},{key:"wait",value:(e=Rr(wr().m(function e(){var t,n,r=this,o=arguments;return wr().w(function(e){for(;;)if(0===e.n)return t=o.length>0&&void 0!==o[0]?o[0]:oo,n=o.length>1&&void 0!==o[1]?o[1]:0,e.a(2,this.withForwardingHost(function(){return r._client.waitForAsyncRun(r,t,n)}))},e,this)})),function(){return e.apply(this,arguments)})}]);var e,t}();const Bo=xo;export{xo as AppMeshClient,Zr as AppMeshError,no as AppMeshRequestError,ro as AppMeshTimeoutError,Do as AppOutput,eo as AppRemovedError,Lo as AppRun,$r as CONSTANTS,So as DEFAULT_CA_FILE,Kn as RefreshTokenProvider,fr as RequestSigner,Ao as SseEnd,Ln as StaticAccessTokenProvider,to as TransportDisconnectedError,mo as _resolveGid,Eo as _resolveGroupName,ho as _resolveUid,wo as _resolveUserName,Bo as default};
1
+ var e={};const t={};function n(r){const o=t[r];if(void 0!==o)return o.exports;const i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.m=e,(()=>{const e=Object.getPrototypeOf;let t;n.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if("object"==typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&"function"==typeof r.then)return r}const i=Object.create(null);n.r(i);const s=Object.create(null);t=t||[null,e({}),e([]),e(e)];for(var a=2&o&&r;("object"==typeof a||"function"==typeof a)&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(e=>s[e]=()=>r[e]);return s.default=()=>r,n.d(i,s),i}})(),n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>{const t=[];return n.f.j(e,t),Promise.all(t)},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{Object.defineProperties(e,{[Symbol.toStringTag]:{value:"Module"},__esModule:{value:!0}})},(()=>{const e={994:()=>import("./994.appmesh.esm.js"),453:()=>import("./453.appmesh.esm.js"),603:()=>import("./603.appmesh.esm.js"),582:()=>import("./582.appmesh.esm.js"),770:()=>import("./770.appmesh.esm.js")},t={792:0},r=e=>{let{__webpack_esm_ids__:r,__webpack_esm_modules__:o,__webpack_esm_runtime__:i}=e;var s,a,u=0;for(s in o)n.o(o,s)&&(n.m[s]=o[s]);for(i&&i(n);u<r.length;u++)a=r[u],n.o(t,a)&&t[a]&&t[a][0](),t[a]=0};n.f.j=(o,i)=>{let s=n.o(t,o)?t[o]:void 0;if(0!==s)if(s)i.push(s[1]);else{const n=Promise.race([e[o]().then(r,e=>{throw 0!==t[o]&&(t[o]=void 0),e}),new Promise(e=>s=t[o]=[e])]);i.push(s[1]=n)}}})();var r={};function o(e,t){return function(){return e.apply(t,arguments)}}n.r(r),n.d(r,{hasBrowserEnv:()=>He,hasStandardBrowserEnv:()=>Me,hasStandardBrowserWebWorkerEnv:()=>ze,navigator:()=>qe,origin:()=>Xe});const{toString:i}=Object.prototype,{getPrototypeOf:s}=Object,{iterator:a,toStringTag:u}=Symbol,c=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),l=e=>"string"==typeof e&&("__proto__"===e||"constructor"===e||"prototype"===e),f=(e,t,n)=>e===Object.prototype||!n&&null===t,p=(e,t)=>{let n=e;const r=[];for(;null!=n;){if(-1!==r.indexOf(n))return!1;r.push(n);const o=s(n);if(f(n,o,n===e))return!1;if(c(n,t))return!0;n=o}return!1},h=(d=Object.create(null),e=>{const t=i.call(e);return d[t]||(d[t]=t.slice(8,-1).toLowerCase())});var d;const y=e=>(e=e.toLowerCase(),t=>h(t)===e),m=e=>t=>typeof t===e,{isArray:b}=Array,v=m("undefined");function g(e){return null!==e&&!v(e)&&null!==e.constructor&&!v(e.constructor)&&E(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const w=y("ArrayBuffer");const _=m("string"),E=m("function"),O=m("number"),S=e=>null!==e&&"object"==typeof e,T=e=>{if(!S(e))return!1;const t=s(e);return(null===t||t===Object.prototype||null===s(t))&&(f(e,t,!0)||!c(e,u)&&!c(e,a))},R=y("Date"),k=y("File"),P=y("Blob"),A=y("FileList"),j=y("Set");const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:{},N=void 0!==C.FormData?C.FormData:void 0,U=y("URLSearchParams"),[x,D,L,B]=["ReadableStream","Request","Response","Headers"].map(y);function F(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),b(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(g(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),i=o.length;let s;for(r=0;r<i;r++)s=o[r],t.call(null,e[s],s,e)}}const I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:n.g,H=e=>!v(e)&&e!==I;const q=(M="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>M&&e instanceof M);var M;const z=y("HTMLFormElement"),{propertyIsEnumerable:X}=Object.prototype,W=y("RegExp"),K=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};F(n,(n,o)=>{let i;!1!==(i=t(n,o,e))&&(r[o]=i||n)}),Object.defineProperties(e,r)};const G=y("AsyncFunction"),Y=($="function"==typeof setImmediate,J=E(I.postMessage),$?setImmediate:J?(V=`axios@${Math.random()}`,Q=[],I.addEventListener("message",({source:e,data:t})=>{e===I&&t===V&&Q.length&&Q.shift()()},!1),e=>{Q.push(e),I.postMessage(V,"*")}):e=>setTimeout(e));var $,J,V,Q;const Z="undefined"!=typeof queueMicrotask?queueMicrotask.bind(I):"undefined"!=typeof process&&process.nextTick||Y,ee=e=>null!=e&&E(e[a]),te={isArray:b,isArrayBuffer:w,isBuffer:g,isFormData:e=>{if(!e)return!1;if(N&&e instanceof N)return!0;const t=s(e);if(!t||t===Object.prototype)return!1;if(!E(e.append))return!1;const n=h(e);return"formdata"===n||"object"===n&&E(e.toString)&&"[object FormData]"===e.toString()},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&w(e.buffer),t},isString:_,isNumber:O,isBoolean:e=>!0===e||!1===e,isObject:S,isPlainObject:T,isEmptyObject:e=>{if(!S(e)||g(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:x,isRequest:D,isResponse:L,isHeaders:B,isUndefined:v,isDate:R,isFile:k,isReactNativeBlob:e=>!(!e||void 0===e.uri),isReactNative:e=>e&&void 0!==e.getParts,isBlob:P,isRegExp:W,isFunction:E,isStream:e=>S(e)&&E(e.pipe),isURLSearchParams:U,isTypedArray:q,isFileList:A,forEach:F,merge:function e(...t){const{caseless:n,skipUndefined:r}=H(this)&&this||{},o={},i=n?Object.create(null):null,s=(t,n)=>{if("__proto__"===n||"constructor"===n||"prototype"===n)return;let s=n;if(i&&"string"==typeof n){const e=n.toLowerCase(),t=i[e];void 0!==t&&c(o,t)?s=t:i[e]=n}const a=c(o,s)?o[s]:void 0;T(a)&&T(t)?o[s]=e(a,t):T(t)?o[s]=e({},t):b(t)?o[s]=t.slice():r&&v(t)||(o[s]=t)};for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n||g(n))continue;if(F(n,s),"object"!=typeof n||b(n)||!Object.getOwnPropertySymbols)continue;const r=Object.getOwnPropertySymbols(n);for(let e=0;e<r.length;e++){const t=r[e];X.call(n,t)&&s(n[t],t)}}return o},extend:(e,t,n,{allOwnKeys:r}={})=>(F(t,(t,r)=>{n&&E(t)?Object.defineProperty(e,r,{__proto__:null,value:o(t,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,r,{__proto__:null,value:t,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,i,a;const u={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],r&&!r(a,e,t)||u[a]||(t[a]=e[a],u[a]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:h,kindOfTest:y,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(b(e))return e;let t=e.length;if(!Number.isSafeInteger(t)||t<0||t>4294967295)return null;const n=new Set,r=new Set;let o=e;for(;null!=o&&n.size<t;){if(r.has(o))return null;r.add(o);const i=s(o);if(f(o,i,o===e))break;Object.getOwnPropertyNames(o).forEach(e=>{const r=+e;Number.isInteger(r)&&r>=0&&r<t&&String(r)===e&&c(o,e)&&n.add(r)}),o=i}if(n.size!==t)return null;const i=new Array(t);for(;t-- >0;)i[t]=e[t];return i},forEachEntry:(e,t)=>{const n=(e&&e[a]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:z,hasOwnProperty:c,hasOwnProp:c,hasOwnInPrototypeChain:p,getSafeProp:(e,t)=>null!=e&&p(e,t)?e[t]:void 0,toSafeFlatObject:e=>{if(null==e||"object"!=typeof e&&"function"!=typeof e)return e;const t=s(e);if(null===t&&(e=>{if(!Object.isExtensible(e))return!1;const t=Object.getOwnPropertyNames(e);return Object.getOwnPropertySymbols&&t.push(...Object.getOwnPropertySymbols(e)),t.every(t=>{if(l(t))return!1;const n=Object.getOwnPropertyDescriptor(e,t);return!!n&&n.configurable&&!0===n.writable})})(e))return e;const n=Object.create(null),r=Object.create(null),o=[];let i=e;for(;null!=i&&-1===o.indexOf(i);){o.push(i);const a=i===e?t:s(i);if(f(i,a,i===e))break;const u=Object.getOwnPropertyNames(i);Object.getOwnPropertySymbols&&u.push(...Object.getOwnPropertySymbols(i));for(const t of u)l(t)||c(r,t)||(n[t]=e[t],r[t]=!0);i=a}return n},reduceDescriptors:K,freezeMethods:e=>{K(e,(t,n)=>{if(E(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];E(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return b(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:function(e,t){if(g(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null},global:I,isContextDefined:H,isSpecCompliantForm:function(e){return!!(e&&E(e.append)&&"FormData"===e[u]&&e[a])},toJSONObject:e=>{const t=new WeakSet,n=e=>{if(S(e)){if(t.has(e))return;if(g(e))return e;if(!("toJSON"in e)){let r;if(t.add(e),j(e)){r=[];for(const t of e){const e=n(t);!v(e)&&r.push(e)}}else r=b(e)?[]:{},F(e,(e,t)=>{const o=n(e);!v(o)&&(r[t]=o)});return t.delete(e),r}}return e};return n(e)},isAsyncFn:G,isThenable:e=>e&&(S(e)||E(e))&&E(e.then)&&E(e.catch),setImmediate:Y,asap:Z,isIterable:ee,isSafeIterable:e=>null!=e&&p(e,a)&&ee(e)},ne=te.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"]);const re=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),oe=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function ie(e,t){return te.isArray(e)?e.map(e=>ie(e,t)):function(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}(String(e).replace(t,""))}function se(e){const t=Object.create(null);return te.forEach(e.toJSON(),(e,n)=>{t[n]=(e=>ie(e,oe))(e)}),t}const ae=Symbol("internals");function ue(e){return e&&String(e).trim().toLowerCase()}function ce(e){return!1===e||null==e?e:te.isArray(e)?e.map(ce):(e=>ie(e,re))(String(e))}const le=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function fe(e){let t=0,n=e.length;for(;t<n;){const n=e.charCodeAt(t);if(9!==n&&32!==n)break;t+=1}for(;n>t;){const t=e.charCodeAt(n-1);if(9!==t&&32!==t)break;n-=1}return 0===t&&n===e.length?e:e.slice(t,n)}const pe=e=>"__proto__"===e?"__Proto__":e;function he(e,t,n,r,o){return te.isFunction(r)?r.call(e,t,n):(o&&(t=n),te.isString(t)?te.isString(r)?-1!==t.indexOf(r):te.isRegExp(r)?r.test(t):void 0:void 0)}class de{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=ue(t);if(!o)return;const i=te.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[pe(i||t)]=ce(e))}const i=(e,t)=>te.forEach(e,(e,n)=>o(e,n,t));if(te.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(te.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))i((e=>{const t=Object.create(null);let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim();const i=te.hasOwnProp(t,n);!n||i&&te.hasOwnProp(ne,n)||("set-cookie"===n?i?t[n].push(r):t[n]=[r]:t[n]=i?t[n]+", "+r:r)}),t})(e),t);else if(te.isObject(e)&&te.isSafeIterable(e)){let n,r,o=Object.create(null);for(const t of e){if(!te.isArray(t))throw new TypeError("Object iterator must return a key-value pair");r=t[0],te.hasOwnProp(o,r)?(n=o[r],o[r]=te.isArray(n)?[...n,t[1]]:[n,t[1]]):o[r]=t[1]}i(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=ue(e)){const n=te.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(te.isFunction(t))return t.call(this,e,n);if(te.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ue(e)){const n=te.findKey(this,e);return!(!n||void 0===this[n]||t&&!he(this,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=ue(e)){const o=te.findKey(n,e);!o||t&&!he(n,n[o],o,t)||(delete n[o],r=!0)}}return te.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!he(this,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n=Object.create(null);return te.forEach(this,(r,o)=>{const i=te.findKey(n,o);if(i)return t[i]=ce(r),void delete t[o];const s=pe(e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim());s!==o&&delete t[o],t[s]=ce(r),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return te.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&te.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){const e=this.get("set-cookie");return te.isArray(e)?e:null==e||!1===e?[]:[e]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static parseParameters(e){return function(e){const t=Object.create(null),n=String(e);let r=0,o=!1,i=!1;function s(e){const o=fe(n.slice(r,e)),i=o.indexOf("=");if(i<1)return;const s=fe(o.slice(0,i));if(!le.test(s))return;const a=s.toLowerCase();if("__proto__"===a||"constructor"===a||"prototype"===a)return;const u=fe(o.slice(i+1));t[a]=function(e){const t=e.length-1;if(t<1||34!==e.charCodeAt(0)||34!==e.charCodeAt(t))return e;let n="";for(let r=1;r<t;r++){const o=e.charCodeAt(r);if(34===o)return e;if(92===o&&(r+=1,r>=t))return e;n+=e[r]}return n}(u)}for(let e=0;e<n.length;e++){const t=n.charCodeAt(e);o?i?i=!1:92===t?i=!0:34===t&&(o=!1):34===t?o=!0:44!==t&&59!==t||(s(e),r=e+1)}return s(n.length),t}(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[ae]=this[ae]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=ue(e);t[r]||(!function(e,t){const n=te.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return te.isArray(e)?e.forEach(r):r(e),this}}de.accessor(["Content-Type","Content-Length","Content-Encoding","Accept","Accept-Encoding","User-Agent","Authorization"]),te.reduceDescriptors(de.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),te.freezeMethods(de);const ye=de,me="[REDACTED ****]";function be(e,t){const n=new Set(t.map(e=>String(e).toLowerCase())),r=[],o=e=>{if(null===e||"object"!=typeof e)return e;if(te.isBuffer(e))return e;if(-1!==r.indexOf(e))return;let t;if(e instanceof ye&&(e=e.toJSON()),r.push(e),te.isArray(e))t=[],e.forEach((e,n)=>{const r=o(e);te.isUndefined(r)||(t[n]=r)});else{if(!te.isPlainObject(e)&&function(e){if(te.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(te.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}(e))return r.pop(),e;t=Object.create(null);for(const[r,i]of Object.entries(e)){const e=n.has(r.toLowerCase())?me:o(i);te.isUndefined(e)||(t[r]=e)}}return r.pop(),t};return o(e)}function ve(e){try{return String(e)}catch(e){return""}}const ge=Symbol("causeStack");class we extends Error{static from(e,t,n,r,o,i){let s=e.message;!s&&te.isArray(e.errors)&&e.errors.length&&(s=function(e){return e.errors.map(e=>{try{return e&&e.message?ve(e.message):ve(e)}catch(e){return""}}).filter(Boolean).join("; ")||e.name||"AggregateError"}(e));const a=new we(s,t||e.code,n,r,o);return Object.defineProperty(a,"cause",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),a.name=e.name,function(e,t){try{const n=t&&t.stack;if("string"!=typeof n||!n)return;const r=e.stack;if("string"!=typeof r||!r)return;const o="\nCaused by: "+n;e.stack=r+o,Object.defineProperty(e,ge,{__proto__:null,value:o})}catch(e){}}(a,e),null!=e.status&&null==a.status&&(a.status=e.status),i&&Object.assign(a,i),a}constructor(e,t,n,r,o){super(e),Object.defineProperty(this,"message",{__proto__:null,value:e,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){const e=this.config,t=e&&te.hasOwnProp(e,"redact")?e.redact:void 0,n=te.isArray(t)&&t.length>0?be(e,t):te.toJSONObject(e);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:n,code:this.code,status:this.status}}}we.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",we.ERR_BAD_OPTION="ERR_BAD_OPTION",we.ECONNABORTED="ECONNABORTED",we.ETIMEDOUT="ETIMEDOUT",we.ECONNREFUSED="ECONNREFUSED",we.ERR_NETWORK="ERR_NETWORK",we.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",we.ERR_DEPRECATED="ERR_DEPRECATED",we.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",we.ERR_BAD_REQUEST="ERR_BAD_REQUEST",we.ERR_CANCELED="ERR_CANCELED",we.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",we.ERR_INVALID_URL="ERR_INVALID_URL",we.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const _e=we;function Ee(e){return te.isPlainObject(e)||te.isArray(e)}function Oe(e){return te.endsWith(e,"[]")?e.slice(0,-2):e}function Se(e,t,n){return e?e.concat(t).map(function(e,t){return e=Oe(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const Te=te.toFlatObject(te,{},null,function(e){return/^is[A-Z]/.test(e)});const Re=function(e,t,n){if(!te.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(e,t)=>{const r=te.getSafeProp(n,e);return te.isUndefined(r)?t:r},o=r("metaTokens",!0),i=r("visitor")||d,s=r("dots",!1),a=r("indexes",!1),u=r("Blob")||"undefined"!=typeof Blob&&Blob,c=r("maxDepth",100),l=u&&te.isSpecCompliantForm(t),f=[];if(!te.isFunction(i))throw new TypeError("visitor must be a function");function p(e){if(null===e)return"";if(te.isDate(e))return e.toISOString();if(te.isBoolean(e))return e.toString();if(!l&&te.isBlob(e))throw new _e("Blob is not supported. Use a Buffer instead.");if(te.isArrayBuffer(e)||te.isTypedArray(e)){if(l&&"function"==typeof u)return new u([e]);throw new _e("Blob is not supported. Use a Buffer instead.",_e.ERR_NOT_SUPPORT)}return e}function h(e){if(e>c)throw new _e("Object is too deeply nested ("+e+" levels). Max depth: "+c,_e.ERR_FORM_DATA_DEPTH_EXCEEDED)}function d(e,n,r){let i=e;if(te.isReactNative(t)&&te.isReactNativeBlob(e))return t.append(Se(r,n,s),p(e)),!1;if(e&&!r&&"object"==typeof e)if(te.endsWith(n,"{}"))n=o?n:n.slice(0,-2),e=function(e,t){if(c===1/0)return JSON.stringify(e);const n=[];return JSON.stringify(e,function(e,r){if(!te.isObject(r))return r;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(r),h(t+n.length-1),r})}(e,1);else if(te.isArray(e)&&function(e){return te.isArray(e)&&!e.some(Ee)}(e)||(te.isFileList(e)||te.endsWith(n,"[]"))&&(i=te.toArray(e)))return n=Oe(n),i.forEach(function(e,r){!te.isUndefined(e)&&null!==e&&t.append(!0===a?Se([n],r,s):null===a?n:n+"[]",p(e))}),!1;return!!Ee(e)||(t.append(Se(r,n,s),p(e)),!1)}const y=Object.assign(Te,{defaultVisitor:d,convertValue:p,isVisitable:Ee});if(!te.isObject(e))throw new TypeError("data must be an object");return function e(n,r,o=0){if(!te.isUndefined(n)){if(h(o),-1!==f.indexOf(n))throw new Error("Circular reference detected in "+r.join("."));f.push(n),te.forEach(n,function(n,s){!0===(!(te.isUndefined(n)||null===n)&&i.call(t,n,te.isString(s)?s.trim():s,r,y))&&e(n,r?r.concat(s):[s],o+1)}),f.pop()}}(e),t};function ke(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(e){return t[e]})}function Pe(e,t){this._pairs=[],e&&Re(e,this,t)}const Ae=Pe.prototype;Ae.append=function(e,t){this._pairs.push([e,t])},Ae.toString=function(e){const t=e?t=>e.call(this,t,ke):ke;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};const je=Pe;function Ce(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function Ne(e,t,n){if(!t)return e;e=e||"";const r=te.isFunction(n)?{serialize:n}:n,o=te.getSafeProp(r,"encode")||Ce,i=te.getSafeProp(r,"serialize");let s;if(s=i?i(t,r):te.isURLSearchParams(t)?t.toString():new je(t,r).toString(o),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}const Ue=Symbol("internals");function xe(e){return e?e.length:0}function De(e){if(e)for(;e.length&&null===e[e.length-1];)e.pop()}function Le(e,t){const n=e.handlers,r=xe(n);n!==t.handlersRef?(t.handlersRef=n,t.handlerEntries.clear()):r!==t.handlersLength&&(r?t.handlerEntries.forEach(function(e,r){n[e.index]!==e.handler&&t.handlerEntries.delete(r)}):t.handlerEntries.clear()),t.handlersLength=r}const Be=class{constructor(){this.handlers=[],this[Ue]={handlersRef:this.handlers,handlersLength:this.handlers.length,handlerEntries:new Map,iterationDepth:0,nextId:0}}use(e,t,n){const r={fulfilled:e,rejected:t,synchronous:!(!n||!te.hasOwnInPrototypeChain(n,"synchronous"))&&n.synchronous,runWhen:n&&te.hasOwnInPrototypeChain(n,"runWhen")?n.runWhen:null},o=this[Ue];null==this.handlers&&(this.handlers=[]),Le(this,o);const i=o.nextId++;return this.handlers.push(r),o.handlerEntries.set(i,{handler:r,index:this.handlers.length-1}),o.handlersLength=this.handlers.length,i}eject(e){const t=this[Ue];Le(this,t);const n=function(e){return"string"==typeof e&&""!==e&&String(Number(e))===e?Number(e):e}(e),r=t.handlerEntries.get(n);if(r){if(t.handlerEntries.delete(n),this.handlers[r.index]!==r.handler)return;this.handlers[r.index]=null,t.iterationDepth||(De(this.handlers),t.handlersLength=this.handlers.length)}}clear(){this.handlers&&(this.handlers=[],Le(this,this[Ue]))}forEach(e){const t=this[Ue];Le(this,t),t.iterationDepth++;try{te.forEach(this.handlers,function(t){null!==t&&e(t)})}finally{--t.iterationDepth||(Le(this,t),De(this.handlers),t.handlersLength=xe(this.handlers))}}},Fe={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0,encodeBasicAuthUsername:!1},Ie={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:je,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},He="undefined"!=typeof window&&"undefined"!=typeof document,qe="object"==typeof navigator&&navigator||void 0,Me=He&&(!qe||["ReactNative","NativeScript","NS"].indexOf(qe.product)<0),ze="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Xe=He&&window.location.href||"http://localhost",We={...r,...Ie};function Ke(e){if(e>100)throw new _e("FormData field is too deeply nested ("+e+" levels). Max depth: 100",_e.ERR_FORM_DATA_DEPTH_EXCEEDED)}function Ge(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r<o;r++)i=n[r],t[i]=e[i];return t}function Ye(e){if(!te.isArray(e))return e;const t=Object.keys(e);return t.length!==e.length||t.some((e,t)=>e!==String(t))?Ge(e):e}const $e=function(e){function t(e,n,r,o){Ke(o);let i=e[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),a=o>=e.length;if(i=!i&&te.isArray(r)?r.length:i,a)return te.hasOwnProp(r,i)?(r[i]=Ye(r[i]),r[i]=te.isArray(r[i])?r[i].concat(n):[r[i],n]):r[i]=n,!s;te.hasOwnProp(r,i)&&te.isObject(r[i])||(r[i]=[]);return t(e,n,r[i],o)&&te.isArray(r[i])&&(r[i]=Ge(r[i])),!s}if(te.isFormData(e)&&te.isFunction(e.entries)){const n={};return te.forEachEntry(e,(e,r)=>{t(function(e){const t=[],n=/[^.[\]]+|\[([^.[\]]*)]/g;let r;for(;null!==(r=n.exec(e));)Ke(t.length),t.push("[]"===r[0]?"":r[1]||r[0]);return t}(e),r,n,0)}),function(e){const t=[e];for(;t.length;){const e=t.pop();Object.keys(e).forEach(n=>{const r=e[n]=Ye(e[n]);(te.isArray(r)||te.isPlainObject(r))&&t.push(r)})}return e}(n)}return null},Je=Object.freeze(["get","delete","head","options","post","put","patch","purge","link","unlink","query"]),Ve=(e,t)=>null!=e&&te.hasOwnProp(e,t)?e[t]:void 0;const Qe={transitional:Fe,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=te.isObject(e);o&&te.isHTMLForm(e)&&(e=new FormData(e));if(te.isFormData(e))return r?JSON.stringify($e(e)):e;if(te.isArrayBuffer(e)||te.isBuffer(e)||te.isStream(e)||te.isFile(e)||te.isBlob(e)||te.isReadableStream(e))return e;if(te.isArrayBufferView(e))return e.buffer;if(te.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let i;if(o){const t=Ve(this,"formSerializer");if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Re(e,new We.classes.URLSearchParams,{visitor:function(e,t,n,r){return We.isNode&&te.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,t).toString();if((i=te.isFileList(e))||n.indexOf("multipart/form-data")>-1){const n=Ve(this,"env"),r=n&&n.FormData;return Re(i?{"files[]":e}:e,r&&new r,t)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(te.isString(e))try{return(t||JSON.parse)(e),te.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=Ve(this,"transitional")||Qe.transitional,n=t&&t.forcedJSONParsing,r=Ve(this,"responseType"),o="json"===r;if(te.isResponse(e)||te.isReadableStream(e))return e;if(e&&te.isString(e)&&(n&&!r||o)){const n=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e,Ve(this,"parseReviver"))}catch(e){if(n){if("SyntaxError"===e.name)throw _e.from(e,_e.ERR_BAD_RESPONSE,this,null,Ve(this,"response"));throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:We.classes.FormData,Blob:We.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};te.forEach(Je,e=>{Qe.headers[e]={}});const Ze=Qe;function et(e,t){const n=this||Ze,r=t||n,o=ye.from(r.headers);let i=r.data;return te.forEach(e,function(e){i=e.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function tt(e){return!(!e||!e.__CANCEL__)}const nt=class extends _e{constructor(e,t,n){super(e??"canceled",_e.ERR_CANCELED,t,n),this.name="CanceledError",this.__CANCEL__=!0}};function rt(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new _e("Request failed with status code "+n.status,n.status>=400&&n.status<500?_e.ERR_BAD_REQUEST:_e.ERR_BAD_RESPONSE,n.config,n.request,n)):e(n)}const ot=/[\t\n\r]/g;function it(e){if("string"!=typeof e)return e;let t=0;for(;t<e.length&&e.charCodeAt(t)<=32;)t++;return e.slice(t).replace(ot,"")}function st(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1].toLowerCase()||""}const at=e=>{try{return decodeURIComponent(e)}catch(t){return e}},ut=We.hasStandardBrowserEnv?{write(e,t,n,r,o,i,s){if("undefined"==typeof document)return;const a=[`${e}=${encodeURIComponent(t)}`];te.isNumber(n)&&a.push(`expires=${new Date(n).toUTCString()}`),te.isString(r)&&a.push(`path=${r}`),te.isString(o)&&a.push(`domain=${o}`),!0===i&&a.push("secure"),te.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if("undefined"==typeof document)return null;const t=document.cookie;if(!t)return null;const n=t.split(";");for(let t=0;t<n.length;t++){const r=n[t].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===e)return at(r.slice(o+1))}return null},async readAsync(e){try{const t="undefined"!=typeof window&&window.cookieStore;if(t&&te.isFunction(t.get)){const n=await t.get(e);return n?at(n.value):null}}catch(e){}return this.read(e)},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,readAsync:async()=>null,remove(){}};const ct=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,i=0,s=0;return t=void 0!==t?t:1e3,function(a){const u=Date.now(),c=r[s];o||(o=u),n[i]=a,r[i]=u;let l=s,f=0;for(;l!==i;)f+=n[l++],l%=e;if(i=(i+1)%e,i===s&&(s=(s+1)%e),u-o<t)return;const p=c&&u-c;return p?Math.round(1e3*f/p):void 0}};const lt=function(e,t){let n,r,o=0,i=1e3/t;const s=(t,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-o;a>=i?s(e,t):(n=e,r||(r=setTimeout(()=>{r=null,s(n)},i-a)))},()=>n&&s(n),(...e)=>s(e)]},ft=(e,t,n=3)=>{let r=0;const o=ct(50,250);return lt(n=>{if(!n||!te.isNumber(n.loaded))return;const i=n.loaded,s=n.lengthComputable?n.total:void 0,a=Math.max(0,null!=s?Math.min(i,s):i),u=Math.max(0,a-r),c=o(u);r=Math.max(r,a);e({loaded:a,total:s,progress:s?a/s:void 0,bytes:u,rate:c||void 0,estimated:c&&s?(s-a)/c:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})},n)},pt=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},ht=(e,t=te.asap)=>(...n)=>t(()=>e(...n)),dt=We.hasStandardBrowserEnv?(e=>t=>(t=new URL(t,document.baseURI||We.origin),e.protocol===t.protocol&&e.host===t.host&&e.port===t.port))(new URL(We.origin)):()=>!0;const yt=/^https?:(?!\/\/)/i;function mt(e){const t=e.replace(/^(https?:\/{0,2})[^/?#]*@/i,`$1${me}@`),n=t.indexOf("#"),r=(-1===n?t:t.slice(0,n)).replace(/([?&][^=&#]*=)[^&#]*/g,`$1${me}`);return-1===n?r:`${r}#${o=t.slice(n+1),o?o.replace(/(^|&)([^=&]*=)?[^&]+/g,(e,t,n="")=>`${t}${n}${me}`):o}`;var o}function bt(e,t){if("string"==typeof e){const n=it(e);if(yt.test(n))throw new _e(`Invalid URL ${JSON.stringify(mt(n))}: missing "//" after protocol`,_e.ERR_INVALID_URL,t)}}function vt(e,t,n,r){bt(t,r);let o=!("string"==typeof(i=t)&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i));var i;return e&&(o||!1===n)?(bt(e,r),function(e,t){if(!t)return e;let n=e.length;for(;n>0&&47===e.charCodeAt(n-1);)n--;return 0===n?"/"+t.replace(/^[/\\\t\n\r]+/,""):e.slice(0,n)+"/"+t.replace(/^\/+/,"")}(e,t)):t}const gt=e=>e instanceof ye?{...e}:e,wt=e=>Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor?Object.keys(e).concat(Object.getOwnPropertySymbols(e).filter(t=>{const n=Object.getOwnPropertyDescriptor(e,t);return n&&n.enumerable})):Object.keys(e);function _t(e,t,n,r){return te.isPlainObject(e)&&te.isPlainObject(t)?te.merge.call({caseless:r},e,t):te.isPlainObject(t)?te.merge({},t):te.isArray(t)?t.slice():t}function Et(e,t,n,r){return te.isUndefined(t)?te.isUndefined(e)?void 0:_t(void 0,e,0,r):_t(e,t,0,r)}function Ot(e,t){if(!te.isUndefined(t))return _t(void 0,t)}function St(e,t){return te.isUndefined(t)?te.isUndefined(e)?void 0:_t(void 0,e):_t(void 0,t)}function Tt(e,t,n,r,o){return te.hasOwnProp(o,n)?_t(e,t):te.hasOwnProp(r,n)?_t(void 0,e):void 0}const Rt=Object.freeze({__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0}),kt={url:Ot,method:Ot,data:Ot,baseURL:St,transformRequest:St,transformResponse:St,params:function(e,t){const n=[],r=new WeakMap,o={};function i(e,t){if(!te.isPlainObject(t))return te.isArray(t)?t.slice():t;const i=te.isPlainObject(e)?e:o;let s=r.get(t);if(s||(s=new WeakMap,r.set(t,s)),s.has(i))return s.get(i);const a={};return s.set(i,a),n.push({base:i,source:t,result:a}),a}const s=te.isUndefined(t)?i(void 0,e):i(e,t);for(;n.length;){const{base:e,source:t,result:r}=n.pop(),o=new Set(wt(e)),s=new Set(wt(t));new Set([...o,...s]).forEach(n=>{if("__proto__"===n||"constructor"===n||"prototype"===n)return;const a=s.has(n),u=a?t[n]:void 0,c=a&&!te.isPlainObject(u)||!o.has(n)?void 0:e[n];r[n]=a?i(c,u):i(void 0,c)})}return function(e){const t=[{value:e}],n=new WeakSet,r=new WeakSet;for(;t.length;){const{value:e,done:o}=t.pop();if(!te.isPlainObject(e)&&!te.isArray(e))continue;if(o){n.delete(e);continue}if(n.has(e))throw new _e("Circular reference detected in params",_e.ERR_BAD_OPTION_VALUE);if(r.has(e))continue;r.add(e),n.add(e),t.push({value:e,done:!0});const i=Object.keys(e);Object.getOwnPropertySymbols&&Object.getOwnPropertyDescriptor&&Object.getOwnPropertySymbols(e).forEach(t=>{const n=Object.getOwnPropertyDescriptor(e,t);n&&n.enumerable&&i.push(t)}),i.forEach(n=>{if("__proto__"===n||"constructor"===n||"prototype"===n){const r=Object.getOwnPropertyDescriptor(e,n);r&&te.hasOwnProp(r,"value")&&t.push({value:r.value})}else t.push({value:e[n]})})}}(s),s},paramsSerializer:St,timeout:St,timeoutErrorMessage:St,withCredentials:St,withXSRFToken:St,adapter:St,responseType:St,xsrfCookieName:St,xsrfHeaderName:St,onUploadProgress:St,onDownloadProgress:St,decompress:St,maxContentLength:St,maxBodyLength:St,beforeRedirect:St,transport:St,httpAgent:St,httpsAgent:St,cancelToken:St,socketPath:St,allowedSocketPaths:St,responseEncoding:St,validateStatus:Tt,headers:function(e,t,n){return Et(gt(e),gt(t),0,!0)}};function Pt(e,t){e=e||{},t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",Rt);const r=wt({...e,...t});for(let o=0,i=r.length;o<i;o++){const i=r[o];if("__proto__"===i||"constructor"===i||"prototype"===i)continue;const s=te.hasOwnProp(kt,i)?kt[i]:Et,a=te.hasOwnProp(e,i)?e[i]:void 0,u=te.hasOwnProp(t,i)?t[i]:void 0,c=s===Tt?s(a,u,i,e,t):s(a,u,i);te.isUndefined(c)&&s!==Tt||(n[i]=c)}return te.hasOwnProp(t,"validateStatus")&&te.isUndefined(t.validateStatus)&&!1===function(e,t,n){const r=te.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!te.isUndefined(r)){if(!te.isPlainObject(r))return;if(te.hasOwnProp(r,n))return r[n]}const o=te.hasOwnProp(e,"transitional")?e.transitional:void 0;if(te.isPlainObject(o)&&te.hasOwnProp(o,n))return o[n]}(e,t,"validateStatusUndefinedResolves")&&(te.hasOwnProp(e,"validateStatus")?n.validateStatus=_t(void 0,e.validateStatus):delete n.validateStatus),n}const At=["content-type","content-length"];const jt=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))),Ct=e=>ut.read(e);const Nt=function(e,t=Ct){const n=Pt({},e),r=e=>te.hasOwnProp(n,e)?n[e]:void 0,o=r("data");let i=r("withXSRFToken");const s=r("xsrfHeaderName"),a=r("xsrfCookieName");let u=r("headers");const c=r("auth"),l=r("baseURL"),f=r("allowAbsoluteUrls"),p=r("url");if(n.headers=u=ye.from(u),n.url=Ne(vt(l,p,f,n),r("params"),r("paramsSerializer")),c){const t=te.getSafeProp(c,"username")||"",n=te.getSafeProp(c,"password")||"",o=r("transitional"),i=o&&te.hasOwnProp(o,"encodeBasicAuthUsername")&&!0===o.encodeBasicAuthUsername;try{u.set("Authorization","Basic "+btoa((i?jt(t):t)+":"+(n?jt(n):"")))}catch(t){throw _e.from(t,_e.ERR_BAD_OPTION_VALUE,e)}}if(te.isFormData(o)){const e=te.getSafeProp(o,"getHeaders");We.hasStandardBrowserEnv||We.hasStandardBrowserWebWorkerEnv||te.isReactNative(o)?u.setContentType(void 0):te.isFunction(e)&&function(e,t,n){"content-only"===n?Object.entries(t||{}).forEach(([t,n])=>{At.includes(t.toLowerCase())&&e.set(t,n)}):e.set(t)}(u,e.call(o),r("formDataHeaderPolicy"))}if(We.hasStandardBrowserEnv){te.isFunction(i)&&(i=i(n));if(!0===i||null==i&&dt(n.url)){const e=s&&a&&t(a);e&&u.set(s,e)}}return n},Ut="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){let r,o;try{const e=We.hasStandardBrowserEnv&&"undefined"!=typeof window&&window.cookieStore;r=e&&te.isFunction(e.get)}catch(e){}const i=Nt(e,r?e=>(o=e,null):void 0);let s=i.data;const a=ye.from(i.headers).normalize();let u,c,l,f,p,h,d,{responseType:y,onUploadProgress:m,onDownloadProgress:b}=i;function v(){clearTimeout(c);try{p&&p()}catch(e){setTimeout(()=>{throw e})}try{h&&h()}catch(e){setTimeout(()=>{throw e})}g&&(f&&g.removeEventListener("progress",f),g.upload&&(l&&g.upload.removeEventListener("progress",l),p&&g.upload.removeEventListener("loadend",p))),i.cancelToken&&i.cancelToken.unsubscribe(u),i.signal&&i.signal.removeEventListener("abort",u)}let g=new XMLHttpRequest;function w(r){if(!g)return;if(!(0!==g.status||"file"===(st(it(i.url))||st(We.origin))||g.responseURL&&g.responseURL.startsWith("file:")))return n(new _e("Request aborted",_e.ECONNABORTED,e,g)),v(),void(g=null);try{r?d&&d(r):h&&h()}catch(e){setTimeout(()=>{throw e})}if(!g)return;const o=ye.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders());rt(function(e){t(e),v()},function(e){n(e),v()},{data:y&&"text"!==y&&"json"!==y?g.response:g.responseText,status:g.status,statusText:g.statusText,headers:o,config:e,request:g}),g=null}if(g.open(i.method.toUpperCase(),i.url,!0),g.timeout=i.timeout,"onloadend"in g?g.onloadend=w:g.onreadystatechange=function(){g&&4===g.readyState&&(0!==g.status||g.responseURL&&g.responseURL.startsWith("file:"))&&setTimeout(w)},g.onabort=function(){g&&(n(new _e("Request aborted",_e.ECONNABORTED,e,g)),v(),g=null)},g.onerror=function(t){const r=t&&t.message?t.message:"Network Error",o=new _e(r,_e.ERR_NETWORK,e,g);o.event=t||null,n(o),v(),g=null},g.ontimeout=function(){if(!g)return;let t=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const r=i.transitional||Fe;i.timeoutErrorMessage&&(t=i.timeoutErrorMessage),n(new _e(t,r.clarifyTimeoutError?_e.ETIMEDOUT:_e.ECONNABORTED,e,g)),v(),g=null},void 0===s&&a.setContentType(null),te.isUndefined(i.withCredentials)||(g.withCredentials=!!i.withCredentials),y&&"json"!==y&&(g.responseType=i.responseType),b&&([f,h,d]=ft(b,!0),g.addEventListener("progress",f)),m&&g.upload&&([l,p]=ft(m),g.upload.addEventListener("progress",l),g.upload.addEventListener("loadend",p)),i.cancelToken||i.signal){if(u=t=>{if(!g)return;n(!t||t.type?new nt(null,e,g):t);const r=g;v(),g=null,r.abort()},i.cancelToken&&i.cancelToken.subscribe(u),!g)return;i.signal&&(i.signal.aborted?u():i.signal.addEventListener("abort",u))}if(!g)return;const _=st(i.url);if(_&&!We.protocols.includes(_))return n(new _e("Unsupported protocol "+_+":",_e.ERR_BAD_REQUEST,e)),void v();const E=()=>{g&&("setRequestHeader"in g&&te.forEach(se(a),function(e,t){g.setRequestHeader(t,e)}),g.send(s||null))};if(o){const t="undefined"!=typeof performance&&te.isFunction(performance.now)?()=>performance.now():Date.now,r=g.timeout>0?t()+Number(g.timeout):void 0,s=()=>{if(!g)return;const e=g;e.ontimeout(),e.abort()};if(void 0!==r){const e=()=>{const n=r-t();n>0?c=setTimeout(e,Math.min(n,2147483647)):s()};e()}ut.readAsync(o).then(e=>{if(g)if(void 0!==r&&t()>=r)s();else{if(e){const t=te.hasOwnProp(i,"xsrfHeaderName")&&i.xsrfHeaderName;a.set(t,e)}E()}}).catch(t=>{g&&(n(_e.from(t,null,e,g)),v(),g=null)})}else E()})},xt=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const o=function(e){if(!r){r=!0,s();const t=e instanceof Error?e:this.reason;n.abort(t instanceof _e?t:new nt(t instanceof Error?t.message:t))}};let i=t&&setTimeout(()=>{i=null,o(new _e(`timeout of ${t}ms exceeded`,_e.ETIMEDOUT))},t);const s=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{const t=te.getSafeProp(e,"unsubscribe");te.isFunction(t)?t.call(e,o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>{r||(e.aborted?o.call(e):e.addEventListener("abort",o,{once:!0}))});const{signal:a}=n;return a.unsubscribe=()=>te.asap(s),a},Dt=function*(e,t){let n=e.byteLength;if(!t||n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},Lt=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},Bt=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of Lt(e))yield*Dt(n,t)}(e,t);let i,s=0,a=e=>{i||(i=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return a(),void e.close();let i=r.byteLength;if(n){let e=s+=i;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw o.return().catch(()=>{}),a(e),e}},cancel:e=>(a(e),o.return())},{highWaterMark:2})},Ft="\r\n",It=e=>String(e).replace(/\r\n|\r|\n/g,Ft),Ht=e=>String(e).replace(/[\r\n"]/g,e=>"\r"===e?"%0D":"\n"===e?"%0A":"%22"),qt=(e,t)=>{let n=0;for(let r=0;r<e.length;r++){const o=e.charCodeAt(r);!t||13!==o&&10!==o?o<128?n++:o<2048?n+=2:o>=55296&&o<=56319&&e.charCodeAt(r+1)>=56320&&e.charCodeAt(r+1)<=57343?(n+=4,r++):n+=3:(13===o&&10===e.charCodeAt(r+1)&&r++,n+=2)}return n};class Mt extends TypeError{constructor(e,t){super(e),this.name="FormDataError",this.reason=t}}function zt(e,t,n,r,o){if(!te.isFunction(t))throw new _e("Blob is not supported",_e.ERR_NOT_SUPPORT);if(void 0===o)if(te.isFunction(We.generateString))o="axios-"+We.generateString(36,"0123456789abcdef");else{const e=te.global.crypto;if(!e||!te.isFunction(e.getRandomValues))throw new _e("Random byte generation is not supported",_e.ERR_NOT_SUPPORT);const t=new Uint8Array(18);e.getRandomValues(t),o="axios-"+Array.from(t,e=>("0"+e.toString(16)).slice(-2)).join("")}try{return function(e,t,n,r,o){if(!te.isFunction(t))throw new Mt("Blob is not supported","blob");if(!te.isString(o)||!/^[A-Za-z0-9'()+_,./:=? -]{1,70}$/.test(o)||/ $/.test(o))throw new Mt("Invalid multipart boundary","boundary");const i="--"+o+"--"+Ft;let s=i.length;const a=[],u=e=>{if(s+e>n)throw r()};u(0);for(const[t,n]of e){const e=te.isString(n),r=e?qt(n,!0):n.size;if(!Number.isFinite(r)||r<0)throw new Mt("Unsupported FormData part size","part");u(r+qt(t,!0)+(!e&&n.name?qt(n.name,!1):0)+(!e&&n.type?qt(n.type,!1):0));let i="--"+o+'\r\nContent-Disposition: form-data; name="'+Ht(It(t))+'"';e||(i+='; filename="'+Ht(te.isString(n.name)?n.name:"blob")+'"\r\nContent-Type: '+String(n.type||"application/octet-stream").replace(/[\r\n]/g,"")),i+=Ft+Ft;const c=qt(i,!1)+r+2;u(c),s+=c,a.push({header:i,value:n,isString:e})}const c=[];for(const e of a)c.push(e.header,e.isString?It(e.value):e.value,Ft);return c.push(i),new t(c,{type:"multipart/form-data; boundary="+o})}(e,t,n,r,o)}catch(e){if(e instanceof Mt){const t="boundary"===e.reason?_e.ERR_BAD_OPTION_VALUE:_e.ERR_BAD_REQUEST;throw new _e(e.message,t)}throw e}}const Xt=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,Wt=(e,t,n)=>t+2<n&&Xt(e.charCodeAt(t+1))&&Xt(e.charCodeAt(t+2)),Kt=e=>e<=57?e-48:(223&e)-55,Gt=e=>e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||43===e||47===e||45===e||95===e,Yt=e=>9===e||10===e||12===e||13===e||32===e,$t=e=>{const t=e.length;let n=0;return t>0&&61===e.charCodeAt(t-1)&&(n++,t>1&&61===e.charCodeAt(t-2)&&n++),Math.floor(3*(t-n)/4)},Jt=e=>{const t=e.length;let n=0,r=0,o=!1;for(let i=0;i<t;i++){let s=e.charCodeAt(i);37===s&&Wt(e,i,t)&&(s=16*Kt(e.charCodeAt(i+1))+Kt(e.charCodeAt(i+2)),i+=2),Yt(s)||(61!==s?!Gt(s)||r>0?o=!0:n++:r++)}return o||r>2||r>0&&(n+r)%4!=0||n%4==1?$t(e):(e=>{const t=e%4;return 3*Math.floor(e/4)+(2===t?1:3===t?2:0)})(n)},Vt=(e,t,n)=>{if(!e||"string"!=typeof e)return 0;if(!/^data:/i.test(e))return 0;const r=e.indexOf(",");if(r<0)return 0;const o=e.slice(5,r),i=e.slice(r+1);if(n.test(o))return t(i);let s=0;for(let e=0,t=i.length;e<t;e++){const n=i.charCodeAt(e);if(37===n&&Wt(i,e,t))s+=1,e+=2;else if(n<128)s+=1;else if(n<2048)s+=2;else if(n>=55296&&n<=56319&&e+1<t){const t=i.charCodeAt(e+1);t>=56320&&t<=57343?(s+=4,e++):s+=3}else s+=3}return s};const Qt={cache:"default",redirect:"follow",referrer:"about:client",referrerPolicy:"",mode:"cors",integrity:"",keepalive:!1,priority:"auto",window:null},{isFunction:Zt}=te,en=e=>{if(!te.isString(e))return e;try{return decodeURIComponent(e)}catch(t){return e}},tn=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},nn=e=>{try{if(null!==e&&("object"==typeof e||"function"==typeof e)){const t=e.then;Zt(t)&&t.call(e,void 0,te.noop)}}catch(e){}},rn=e=>{const t=void 0!==te.global&&null!==te.global?te.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=te.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response,Blob:t.Blob},e);const o=te.hasOwnProp(e,"fetch")?e.fetch:void 0,{Request:i,Response:s,Blob:a}=e,u=o?Zt(o):"function"==typeof fetch,c=Zt(i),l=Zt(s);if(!u)return!1;const f=u&&Zt(n),p=u&&("function"==typeof r?(h=new r,e=>h.encode(e)):async e=>new Uint8Array(await new i(e).arrayBuffer()));var h;const d=c&&f&&tn(()=>{let e=!1;const t=new i(We.origin,{body:new n,method:"POST",get duplex(){return e=!0,"half"}}),r=t.headers.has("Content-Type");return null!=t.body&&nn(t.body.cancel()),e&&!r}),y=l&&f&&tn(()=>{const e=new s("").body;try{return te.isReadableStream(e)}finally{(e=>{if(null!=e)try{const t=e.cancel;Zt(t)&&nn(t.call(e))}catch(e){}})(e)}}),m=Object.assign(Object.create(null),Qt);c&&!tn(()=>new i(We.origin,m))&&(delete m.cache,tn(()=>new i(We.origin,m))||(m.cache=Qt.cache));const b={stream:y&&(e=>e.body)};u&&["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!b[e]&&(b[e]=(t,n)=>{let r=t&&t[e];if(r)return r.call(t);throw new _e(`Response type '${e}' is not supported`,_e.ERR_NOT_SUPPORT,n)})});const v=async e=>null==e?0:te.isBlob(e)?e.size:te.isArrayBufferView(e)||te.isArrayBuffer(e)?e.byteLength:(te.isURLSearchParams(e)&&(e+=""),te.isString(e)?(await p(e)).byteLength:void 0);return async e=>{let{url:t,method:n,data:u,signal:l,cancelToken:p,timeout:h,onDownloadProgress:g,onUploadProgress:w,responseType:_,headers:E,withCredentials:O="same-origin",fetchOptions:S,maxContentLength:T,maxBodyLength:R,maxRedirects:k}=Nt(e);const P=te.isNumber(T)&&T>-1,A=te.isNumber(R)&&R>-1,j=t=>te.hasOwnProp(e,t)?e[t]:void 0;let C=o||fetch;_=_?(_+"").toLowerCase():"text";let N=xt([l,p&&p.toAbortSignal()],h),U=null;const x=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let D,L=null,B=null;const F=()=>new _e("Request body larger than maxBodyLength limit",_e.ERR_BAD_REQUEST,e,U);try{let o;const l=j("auth");if(l){const e=te.getSafeProp(l,"username")||"";o={username:e,password:te.getSafeProp(l,"password")||""}}let p;if((e=>{const t=e.indexOf("://");let n=e;return-1!==t&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")})(t)){if(p=new URL(t,We.origin),!o&&(p.username||p.password)){const e=en(p.username);o={username:e,password:en(p.password)}}(p.username||p.password)&&(p.username="",p.password="",t=p.href)}if(o&&(E.delete("authorization"),E.set("Authorization","Basic "+btoa((I=(o.username||"")+":"+(o.password||""),encodeURIComponent(I).replace(/%([0-9A-F]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))))))),P&&p&&"data:"===p.protocol){const t=function(e){const t="string"==typeof e?e.indexOf("#"):-1;return Vt(-1===t?e:e.slice(0,t),Jt,/; *base64[\t\n\f\r ]*$/i)}(p.href);if(t>T)throw new _e("maxContentLength size of "+T+" exceeded",_e.ERR_BAD_RESPONSE,e,U)}const h=te.isSpecCompliantForm(u)&&ye.from(j("headers")).getContentType();let H;if(te.isString(h)&&/^multipart\/form-data(?:\s*;|$)/i.test(h.trim())){const e=ye.parseParameters(h);te.hasOwnProp(e,"boundary")&&(H=e.boundary)}if(te.isSpecCompliantForm(u)&&"get"!==n&&"head"!==n&&(A||w&&d||void 0!==H)&&(u=zt(u,a,A?R:1/0,F,H),E.setContentType(void 0===H?u.type:h),D=u.size),A&&"get"!==n&&"head"!==n){const e=await v(u);if("number"==typeof e&&isFinite(e)&&(D=e,e>R))throw F()}const q=A&&(te.isReadableStream(u)||te.isStream(u)),M=(e,t,n)=>Bt(e,65536,e=>{if(A&&e>R)throw L=F();t&&t(e)},n);if(d&&"get"!==n&&"head"!==n&&(w||q)){if(D=D??await(async(e,t)=>{const n=te.toFiniteNumber(e.getContentLength());return n??v(t)})(E,u),0!==D||q){let e,n=new i(t,{method:"POST",body:u,duplex:"half"});if(te.isFormData(u)&&(e=n.headers.get("content-type"))&&E.setContentType(e),n.body){const[e,t]=w&&pt(D,ft(ht(w)))||[];u=M(n.body,e,t)}}}else if(q&&!c&&f&&"get"!==n&&"head"!==n)u=M(u);else if(q&&c&&!d&&"get"!==n&&"head"!==n)throw new _e("Stream request bodies are not supported by the current fetch implementation",_e.ERR_NOT_SUPPORT,e,U);te.isString(O)||(O=O?"include":"omit");const z=c&&"credentials"in i.prototype;if(te.isFormData(u)){const e=E.getContentType();e&&/^multipart\/form-data/i.test(e)&&!/boundary=/i.test(e)&&E.delete("content-type")}E.set("User-Agent","axios/1.22.0",!1);const X=null==S?S:Object.assign(Object.create(null),S);X&&(delete X.body,delete X.headers,delete X.method,delete X.signal,delete X.duplex,delete X.credentials);const W=Object.assign(Object.create(null),X,{signal:N,method:n.toUpperCase(),headers:se(E.normalize()),body:u,duplex:"half",credentials:z?O:void 0});c&&(te.forEach(m,(e,t)=>{void 0===W[t]&&(W[t]=e)}),void 0===W.signal&&(W.signal=null),void 0===W.body&&(W.body=null)),0===k&&(W.redirect="manual",X&&(X.redirect="manual")),U=c&&new i(t,W);let K=await(c?C(U,X):C(t,W));const G=ye.from(K.headers);if(P){const t=te.toFiniteNumber(G.getContentLength());if(null!=t&&t>T)throw new _e("maxContentLength size of "+T+" exceeded",_e.ERR_BAD_RESPONSE,e,U)}const Y=y&&("stream"===_||"response"===_);if(y&&K.body&&(g||P||Y&&x)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=K[e]});const n=te.toFiniteNumber(G.getContentLength()),[r,o]=g&&pt(n,ft(ht(g),!0))||[];let i=0;const a=t=>{if(P&&(i=t,i>T))throw B=new _e("maxContentLength size of "+T+" exceeded",_e.ERR_BAD_RESPONSE,e,U);r&&r(t)};K=new s(Bt(K.body,65536,a,()=>{o&&o(),x&&x()}),t)}_=_||"text";let $=await b[te.findKey(b,_)||"text"](K,e);if(P&&!y&&!Y){let t;if(null!=$&&("number"==typeof $.byteLength?t=$.byteLength:"number"==typeof $.size?t=$.size:"string"==typeof $&&(t="function"==typeof r?(new r).encode($).byteLength:$.length)),"number"==typeof t&&t>T)throw new _e("maxContentLength size of "+T+" exceeded",_e.ERR_BAD_RESPONSE,e,U)}return!Y&&x&&x(),await new Promise((t,n)=>{rt(t,n,{data:$,headers:ye.from(K.headers),status:K.status,statusText:K.statusText,config:e,request:U})})}catch(t){if(x&&x(),N&&N.aborted&&N.reason instanceof _e){const n=N.reason;throw n.config=e,U&&(n.request=U),t!==n&&Object.defineProperty(n,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),n}if(L)throw U&&!L.request&&(L.request=U),L;if(B)throw B;if(t instanceof _e)throw U&&!t.request&&(t.request=U),t;if(t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message)){const n=new _e("Network Error",_e.ERR_NETWORK,e,U,t&&t.response);throw Object.defineProperty(n,"cause",{__proto__:null,value:t.cause||t,writable:!0,enumerable:!1,configurable:!0}),n}throw _e.from(t,t&&t.code,e,U,t&&t.response)}var I}},on=new Map,sn=new WeakSet,an=e=>{const t=rn(e);return t&&sn.add(t),t},un=e=>{const t=Object.create(null),n=e&&te.hasOwnProp(e,"env")&&e.env;["fetch","Request","Response","Blob"].forEach(e=>{n&&te.hasOwnProp(n,e)&&(t[e]=n[e])});const{fetch:r,Request:o,Response:i,Blob:s}=t,a=[o,i,r,s];let u,c,l=a.length,f=on;for(;l--;)u=a[l],c=f.get(u),void 0===c&&f.set(u,c=l?new Map:an(t)),f=c;return c},cn=(un(),{http:null,xhr:Ut,fetch:{get:un}});te.forEach(cn,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch(e){}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const ln=e=>`- ${e}`,fn=e=>te.isFunction(e)||null===e||!1===e;const pn={getAdapter:function(e,t){e=te.isArray(e)?e:[e];const{length:n}=e;let r,o;const i={};for(let s=0;s<n;s++){let n;if(r=e[s],o=r,!fn(r)&&(o=cn[(n=String(r)).toLowerCase()],void 0===o))throw new _e(`Unknown adapter '${n}'`);if(o&&(te.isFunction(o)||(o=o.get(t))))break;i[n||"#"+s]=o}if(!o){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));let t=n?e.length>1?"since :\n"+e.map(ln).join("\n"):" "+ln(e[0]):"as no adapter specified";throw new _e("There is no suitable adapter to dispatch the request "+t,_e.ERR_NOT_SUPPORT)}return o},isBuiltinAdapter:function(e){return!!e&&(e===cn.xhr||e===cn.http||(e=>sn.has(e))(e))},adapters:cn};function hn(e,t){const n=te.getSafeProp(e,"url");if(null!=n)return;if(te.getSafeProp(e,"baseURL"))return;const r=t(),o=pn.adapters.http;if((!o||r!==o||!te.getSafeProp(e,"socketPath"))&&pn.isBuiltinAdapter(r))throw new _e(`Invalid URL: url cannot be ${null===n?"null":"undefined"} when baseURL is not set`,_e.ERR_INVALID_URL,e)}function dn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nt(null,e)}function yn(e,t){return Math.max(0,Math.round(e()-t))}function mn(e){const t=te.toSafeFlatObject(e);dn(t),t.headers=ye.from(te.getSafeProp(t,"headers")),t.data=et.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);const n=pn.getAdapter(t.adapter||Ze.adapter,t);hn(t,()=>n);const r="undefined"!=typeof performance&&te.isFunction(performance.now)?()=>performance.now():Date.now,o=r();return n(t).then(function(e){dn(t),e.duration=yn(r,o),t.response=e;try{e.data=et.call(t,t.transformResponse,e)}finally{delete t.response}return e.headers=ye.from(e.headers),e},function(e){if(!tt(e)&&(dn(t),e&&e.response)){e.response.duration=yn(r,o),t.response=e.response;try{e.response.data=et.call(t,t.transformResponse,e.response)}finally{delete t.response}e.response.headers=ye.from(e.response.headers)}return Promise.reject(e)})}const bn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{bn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const vn={};bn.transitional=function(e,t,n){function r(e,t){return"[Axios v1.22.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,i)=>{if(!1===e)throw new _e(r(o," has been removed"+(t?" in "+t:"")),_e.ERR_DEPRECATED);return t&&!vn[o]&&(vn[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,i)}},bn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};const gn={assertOptions:function(e,t,n){if("object"!=typeof e||null===e)throw new _e("options must be an object",_e.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],s=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(s){const t=e[i],n=void 0===t||s(t,i,e);if(!0!==n)throw new _e("option "+i+" must be "+n,_e.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new _e("Unknown option "+i,_e.ERR_BAD_OPTION)}},validators:bn},wn=gn.validators,_n=e=>{if(null==e||te.isPlainObject(e)||e instanceof ye)return!0;try{return te.isObject(e)&&"AxiosHeaders"===te.getSafeProp(e,Symbol.toStringTag)&&["toJSON","set","get","has","delete","clear","normalize","concat","toString",Symbol.iterator].every(t=>te.isFunction(te.getSafeProp(e,t)))}catch(e){return!1}};class En{constructor(e){this.defaults=e||{},this.interceptors={request:new Be,response:new Be}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error)try{let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack;let r="";if("string"==typeof n){const e=n.indexOf("\n");r=-1===e?"":n.slice(e+1)}if(e.stack){if(r){const t=r.indexOf("\n"),n=-1===t?-1:r.indexOf("\n",t+1),o=-1===n?r:r.slice(n+1),i=String(e.stack),s=function(e,t){const n=te.hasOwnProp(e,ge)&&e[ge];return n&&t.endsWith(n)?t.length-n.length:-1}(e,i),a=-1===s?i:i.slice(0,s),u=-1===s?"":i.slice(s);a.endsWith(o)||(e.stack=a+"\n"+r+u)}}else e.stack=r}catch(e){}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Pt(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&gn.assertOptions(n,{silentJSONParsing:wn.transitional(wn.boolean),forcedJSONParsing:wn.transitional(wn.boolean),clarifyTimeoutError:wn.transitional(wn.boolean),legacyInterceptorReqResOrdering:wn.transitional(wn.boolean),advertiseZstdAcceptEncoding:wn.transitional(wn.boolean),validateStatusUndefinedResolves:wn.transitional(wn.boolean),encodeBasicAuthUsername:wn.transitional(wn.boolean)},!1),null!=r&&(te.isFunction(r)?t.paramsSerializer={serialize:r}:gn.assertOptions(r,{encode:wn.function,serialize:wn.function},!0)),void 0!==t.allowAbsoluteUrls||(te.hasOwnProp(this.defaults,"allowAbsoluteUrls")&&void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),gn.assertOptions(t,{baseUrl:wn.spelling("baseURL"),withXsrfToken:wn.spelling("withXSRFToken")},!0),t.method=(te.getSafeProp(t,"method")||te.getSafeProp(this.defaults,"method")||"get").toLowerCase();const i=te.getSafeProp(o,"common"),s=te.getSafeProp(o,t.method),a=o&&te.merge(_n(i)?i:void 0,_n(s)?s:void 0);o&&te.forEach(Je.concat("common"),e=>{_n(te.getSafeProp(o,e))&&delete o[e]}),t.headers=ye.concat(a,o);const u=[];let c=!0;this.interceptors.request.forEach(function(e){if("function"==typeof e.runWhen&&!1===e.runWhen(t))return;c=c&&e.synchronous;const n=t.transitional||Fe;n&&n.legacyInterceptorReqResOrdering?u.unshift(e.fulfilled,e.rejected):u.push(e.fulfilled,e.rejected)});const l=[];let f;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let p,h=0;if(!c){const e=[mn.bind(this),void 0];for(e.unshift(...u),e.push(...l),p=e.length,f=Promise.resolve(t);h<p;)f=f.then(e[h++],e[h++]);return f}p=u.length;let d=t;for(;h<p;){const e=u[h++],t=u[h++];try{d=e?e(d):d}catch(e){if(!t){f=Promise.reject(e);break}try{const n=t.call(this,e);te.isThenable(n)&&(f=Promise.resolve(n).then(()=>mn.call(this,d)))}catch(e){f=Promise.reject(e)}break}}if(!f)try{f=mn.call(this,d)}catch(e){f=Promise.reject(e)}for(h=0,p=l.length;h<p;)f=f.then(l[h++],l[h++]);return f}getUri(e){hn(e=Pt(this.defaults,e),()=>pn.getAdapter(e.adapter||Ze.adapter,e));return Ne(vt(e.baseURL,e.url,e.allowAbsoluteUrls,e),e.params,e.paramsSerializer)}}te.forEach(["delete","get","head","options"],function(e){En.prototype[e]=async function(t,n){return this.request(Pt(n||{},{method:e,url:t,data:n&&te.hasOwnProp(n,"data")?n.data:void 0}))}}),te.forEach(["post","put","patch","query"],function(e){function t(t){return async function(n,r,o){return this.request(Pt(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}En.prototype[e]=t(),"query"!==e&&(En.prototype[e+"Form"]=t(!0))});const On=En;class Sn{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new nt(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Sn(function(t){e=t}),cancel:e}}}const Tn=Sn;const Rn={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,ContentTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,UnprocessableContent: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,WebServerReturnsAnUnknownError:520,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(Rn).forEach(([e,t])=>{void 0===Rn[t]&&(Rn[t]=e)});const kn=Rn;const Pn=function e(t){const n=new On(t),r=o(On.prototype.request,n);return te.extend(r,On.prototype,n,{allOwnKeys:!0}),te.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Pt(t,n))},r}(Ze);Pn.Axios=On,Pn.CanceledError=nt,Pn.CancelToken=Tn,Pn.isCancel=tt,Pn.VERSION="1.22.0",Pn.toFormData=Re,Pn.AxiosError=_e,Pn.Cancel=Pn.CanceledError,Pn.all=function(e){return Promise.all(e)},Pn.spread=function(e){return function(t){return e.apply(null,t)}},Pn.isAxiosError=function(e){return te.isObject(e)&&!0===e.isAxiosError},Pn.mergeConfig=Pt,Pn.AxiosHeaders=ye,Pn.formToJSON=e=>$e(te.isHTMLForm(e)?new FormData(e):e),Pn.getAdapter=pn.getAdapter,Pn.HttpStatusCode=kn,Pn.default=Pn;const An=Pn;function jn(e){return jn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jn(e)}function Cn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return Nn(c,"_invoke",function(n,r,o){var i,a,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],h=p.p,d=i[2];n>3?(o=d===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,p.v=r,p.n=i[1]):h<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,p.n=d,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),a=l,u=d;(t=a<2?e:u)||!f;){i||(a?(a>1&&(p.n=a<3?-1:u),h(a,u)):p.v=u);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(Nn(t={},r,function(){return this}),t),f=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Nn(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,Nn(f,"constructor",c),Nn(c,"constructor",u),u.displayName="GeneratorFunction",Nn(c,o,"GeneratorFunction"),Nn(f),Nn(f,o,"Generator"),Nn(f,r,function(){return this}),Nn(f,"toString",function(){return"[object Generator]"}),(Cn=function(){return{w:i,m:p}})()}function Nn(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Nn=function(e,t,n,r){function i(t,n){Nn(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Nn(e,t,n,r)}function Un(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function xn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Dn(r.key),r)}}function Dn(e){var t=function(e,t){if("object"!=jn(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=jn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==jn(t)?t:t+""}var Ln=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._token=e._validate(t)},t=[{key:"getAccessToken",value:(r=Cn().m(function e(){return Cn().w(function(e){for(;;)if(0===e.n)return e.a(2,this._token)},e,this)}),o=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function s(e){Un(i,n,o,s,a,"next",e)}function a(e){Un(i,n,o,s,a,"throw",e)}s(void 0)})},function(){return o.apply(this,arguments)})},{key:"canRefresh",value:function(){return!1}},{key:"clear",value:function(){this._token=null}}],n=[{key:"_validate",value:function(e){if("string"!=typeof e||!e.trim())throw new TypeError("bearer token must be a non-empty string");return e.trim()}}],t&&xn(e.prototype,t),n&&xn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o}();function Bn(e){return Bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bn(e)}function Fn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return In(c,"_invoke",function(n,r,o){var i,a,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],h=p.p,d=i[2];n>3?(o=d===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,p.v=r,p.n=i[1]):h<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,p.n=d,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),a=l,u=d;(t=a<2?e:u)||!f;){i||(a?(a>1&&(p.n=a<3?-1:u),h(a,u)):p.v=u);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(In(t={},r,function(){return this}),t),f=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,In(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,In(f,"constructor",c),In(c,"constructor",u),u.displayName="GeneratorFunction",In(c,o,"GeneratorFunction"),In(f),In(f,o,"Generator"),In(f,r,function(){return this}),In(f,"toString",function(){return"[object Generator]"}),(Fn=function(){return{w:i,m:p}})()}function In(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}In=function(e,t,n,r){function i(t,n){In(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},In(e,t,n,r)}function Hn(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function qn(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(e){Hn(i,r,o,s,a,"next",e)}function a(e){Hn(i,r,o,s,a,"throw",e)}s(void 0)})}}function Mn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,zn(r.key),r)}}function zn(e){var t=function(e,t){if("object"!=Bn(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=Bn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Bn(t)?t:t+""}var Xn=new Set(["127.0.0.1","localhost","::1","[::1]"]);var Wn=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.tokenUrl,r=t.clientId,o=void 0===r?"appmesh-cli":r,i=t.accessToken,s=t.refreshToken,a=t.expiresIn,u=void 0===a?0:a,c=t.httpClient;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._tokenUrl=function(e){var t;try{t=new URL(e)}catch(e){throw new TypeError("tokenUrl must be a valid URL")}if("https:"===t.protocol)return e;if("http:"===t.protocol&&Xn.has(t.hostname.toLowerCase()))return e;throw new TypeError("tokenUrl must use https, or http only for loopback hosts (127.0.0.1, localhost, ::1)")}(n),this._clientId=o,this._accessToken=i||null,this._refreshToken=s||null,this._http=c||An.create({timeout:3e4}),this._inflightRefresh=null,this._expiresAtMs=0,this._lifetimeMs=0,this._setExpiry(u)},t=[{key:"getAccessToken",value:(s=qn(Fn().m(function e(){return Fn().w(function(e){for(;;)switch(e.n){case 0:if(!(null===this._accessToken&&this._refreshToken||this._isExpiringSoon())){e.n=1;break}return e.n=1,this._refresh();case 1:if(null!==this._accessToken||this._refreshToken){e.n=2;break}throw new Error("no access token available: the provider holds no credentials");case 2:return e.a(2,this._accessToken)}},e,this)})),function(){return s.apply(this,arguments)})},{key:"canRefresh",value:function(){return!!this._refreshToken}},{key:"refreshAccessToken",value:(i=qn(Fn().m(function e(t){return Fn().w(function(e){for(;;)switch(e.n){case 0:if(!t||t===this._accessToken){e.n=1;break}return e.a(2,this._accessToken);case 1:return e.n=2,this._refresh();case 2:return e.a(2,this._accessToken)}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"clear",value:function(){this._accessToken=null,this._refreshToken=null,this._expiresAtMs=0,this._lifetimeMs=0}},{key:"_setExpiry",value:function(e){var t=Number(e);Number.isFinite(t)&&t>0?(this._lifetimeMs=1e3*t,this._expiresAtMs=Date.now()+this._lifetimeMs):(this._lifetimeMs=0,this._expiresAtMs=0)}},{key:"_isExpiringSoon",value:function(){if(!this._expiresAtMs||!this._refreshToken)return!1;var e=Math.max(3e4,.1*this._lifetimeMs);return Date.now()>=this._expiresAtMs-e}},{key:"_refresh",value:(o=qn(Fn().m(function e(){var t=this;return Fn().w(function(e){for(;;)if(0===e.n)return this._inflightRefresh||(this._inflightRefresh=this._performRefresh().finally(function(){t._inflightRefresh=null})),e.a(2,this._inflightRefresh)},e,this)})),function(){return o.apply(this,arguments)})},{key:"_performRefresh",value:(r=qn(Fn().m(function e(){var t,n,r,o,i;return Fn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(this._refreshToken){e.n=1;break}throw new Error("cannot refresh: no refresh token available");case 1:return t=new URLSearchParams({grant_type:"refresh_token",refresh_token:this._refreshToken,client_id:this._clientId}),e.p=2,e.n=3,this._http.post(this._tokenUrl,t.toString(),{headers:{"Content-Type":"application/x-www-form-urlencoded"},validateStatus:function(){return!0}});case 3:n=e.v,e.n=5;break;case 4:throw e.p=4,i=e.v,new Error("token refresh request failed: ".concat(i.message||"unknown error"));case 5:if(r=n.status,"invalid_grant"!==(o=n.data&&"object"===Bn(n.data)?n.data:{}).error){e.n=6;break}throw this.clear(),new Error("token refresh rejected by the server (invalid_grant)");case 6:if(!(r<200||r>=300||o.error)){e.n=7;break}throw new Error("token refresh failed with status ".concat(r).concat(o.error?": ".concat(o.error):""));case 7:if("string"==typeof o.access_token&&o.access_token){e.n=8;break}throw new Error("token refresh response did not include an access_token");case 8:this._accessToken=o.access_token,"string"==typeof o.refresh_token&&o.refresh_token&&(this._refreshToken=o.refresh_token),this._setExpiry(o.expires_in);case 9:return e.a(2)}},e,this,[[2,4]])})),function(){return r.apply(this,arguments)})}],t&&Mn(e.prototype,t),n&&Mn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o,i,s}();function Kn(e){return Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kn(e)}function Gn(e){var t=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(Array.isArray(e)&&(null==t||t===("undefined"!=typeof Symbol&&[][Symbol.iterator])||t===[]["@@iterator"]))return e;if(null!=t){for(var n,r=[],o=t.call(e);!(n=o.next()).done;)r.push(n.value);return r}}(e);return t===e?Jn(e):t||$n(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yn(e,t){return function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(Array.isArray(e)&&(null==n||n===("undefined"!=typeof Symbol&&[][Symbol.iterator])||n===[]["@@iterator"]))return e;if(null!=n){var r,o,i,s,a=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||$n(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $n(e,t){if(e){if("string"==typeof e)return Jn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Jn(e,t):void 0}}function Jn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Vn(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return Qn(c,"_invoke",function(n,r,o){var i,a,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],h=p.p,d=i[2];n>3?(o=d===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,p.v=r,p.n=i[1]):h<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,p.n=d,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),a=l,u=d;(t=a<2?e:u)||!f;){i||(a?(a>1&&(p.n=a<3?-1:u),h(a,u)):p.v=u);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(Qn(t={},r,function(){return this}),t),f=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Qn(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,Qn(f,"constructor",c),Qn(c,"constructor",u),u.displayName="GeneratorFunction",Qn(c,o,"GeneratorFunction"),Qn(f),Qn(f,o,"Generator"),Qn(f,r,function(){return this}),Qn(f,"toString",function(){return"[object Generator]"}),(Vn=function(){return{w:i,m:p}})()}function Qn(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Qn=function(e,t,n,r){function i(t,n){Qn(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},Qn(e,t,n,r)}function Zn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,er(r.key),r)}}function er(e){var t=function(e,t){if("object"!=Kn(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=Kn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Kn(t)?t:t+""}function tr(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function nr(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(e){tr(i,r,o,s,a,"next",e)}function a(e){tr(i,r,o,s,a,"throw",e)}s(void 0)})}}var rr=null;function or(){return ir.apply(this,arguments)}function ir(){return(ir=nr(Vn().m(function e(){var t;return Vn().w(function(e){for(;;)switch(e.n){case 0:if(!rr){e.n=1;break}return e.a(2,rr);case 1:return e.n=2,import("node:crypto");case 2:return t=e.v,rr=t.default&&t.default.createHmac?t.default:t,e.a(2,rr)}},e)}))).apply(this,arguments)}var sr=new Set(["/appmesh/files"]),ar=/^\/appmesh\/apps\/[^/]+\/(output|task)\/stream$/,ur=Object.freeze({KEY_ID:"X-Request-Key",TIMESTAMP:"X-Timestamp",NONCE:"X-Nonce",SIGNATURE:"X-Signature"});function cr(e){if("string"!=typeof e)return!1;var t=lr(e);return sr.has(t)||ar.test(t)}function lr(e){return"/appmesh/files/ws"===e?"/appmesh/files":e}var fr=function(){return e=function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"string"!=typeof t||""===t.trim())throw new TypeError("keyId must be a non-empty string");if("string"!=typeof n||""===n)throw new TypeError("secret must be a non-empty string");Object.defineProperty(this,"_keyId",{value:t,writable:!0}),Object.defineProperty(this,"_secret",{value:n,writable:!0})},t=[{key:"keyId",get:function(){return this._keyId}},{key:"attach",value:(i=nr(Vn().m(function e(t,n,r,o,i,s,a){var u,c,l,f,p,h,d,y,m,b,v;return Vn().w(function(e){for(;;)switch(e.n){case 0:if(u=s||String(Math.floor(Date.now()/1e3)),p=a){e.n=2;break}return e.n=1,this.randomNonce();case 1:p=e.v;case 2:return c=p,l=lr(r),h=pr,d=n,y=l,m=o,e.n=3,hr(l,i);case 3:return f=h(d,y,m,e.v,u,c),t[ur.KEY_ID]=this._keyId,t[ur.TIMESTAMP]=u,t[ur.NONCE]=c,b=t,v=ur.SIGNATURE,e.n=4,this.sign(f);case 4:b[v]=e.v;case 5:return e.a(2)}},e,this)})),function(e,t,n,r,o,s,a){return i.apply(this,arguments)})},{key:"randomNonce",value:(o=nr(Vn().m(function e(){var t;return Vn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,or();case 1:return t=e.v,e.a(2,t.randomBytes(16).toString("hex"))}},e)})),function(){return o.apply(this,arguments)})},{key:"sign",value:(r=nr(Vn().m(function e(t){var n;return Vn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,or();case 1:return n=e.v,e.a(2,n.createHmac("sha256",this._secret).update(t,"utf8").digest("hex"))}},e,this)})),function(e){return r.apply(this,arguments)})},{key:"toString",value:function(){return"RequestSigner[keyId=".concat(this._keyId,"]")}}],t&&Zn(e.prototype,t),n&&Zn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n,r,o,i}();function pr(e,t,n,r,o,i){if(!e||!t)throw new TypeError("method and path are required");return[e,t,n||"",r,o,i].join("\n")}function hr(e,t){return dr.apply(this,arguments)}function dr(){return(dr=nr(Vn().m(function e(t,n){var r,o;return Vn().w(function(e){for(;;)switch(e.n){case 0:return r=null==n||cr(t)?Buffer.alloc(0):Buffer.from(n),e.n=1,or();case 1:return o=e.v,e.a(2,o.createHash("sha256").update(r).digest("hex"))}},e)}))).apply(this,arguments)}function yr(e){if(!e)return"";for(var t=Object.create(null),n=0;n<e.length;){var r=e.indexOf("&",n),o=r<0?e.slice(n):e.slice(n,r),i=o.indexOf("="),s=i<0?o:o.slice(0,i),a=i<0?"":o.slice(i+1),u=mr(s);if(Object.prototype.hasOwnProperty.call(t,u)||(t[u]=mr(a)),r<0)break;n=r+1}var c=Object.entries(t);return c.sort(function(e,t){var n=Buffer.compare(Buffer.from(e[0],"utf8"),Buffer.from(t[0],"utf8"));return 0!==n?n:Buffer.compare(Buffer.from(e[1],"utf8"),Buffer.from(t[1],"utf8"))}),c.map(function(e){var t=Yn(e,2),n=t[0],r=t[1];return"".concat(n,"=").concat(r)}).join("&")}function mr(e){if(!e.includes("%"))return e;for(var t=[],n=0;n<e.length;n++){var r=e.charCodeAt(n);if(37===r){var o=e.charCodeAt(n+1),i=e.charCodeAt(n+2),s=function(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102};if(!s(o)||!s(i))return e;t.push(parseInt(e.slice(n+1,n+3),16)),n+=2}else if(r<128)t.push(r);else{var a=Buffer.from(e[n],"utf8");t.push.apply(t,Gn(a))}}return Buffer.from(t).toString("utf8")}function br(e){return e?Object.entries(e).filter(function(e){var t=Yn(e,2)[1];return null!=t}).map(function(e){var t=Yn(e,2),n=t[0],r=t[1];return"".concat(encodeURIComponent(String(n)),"=").concat(encodeURIComponent(String(r)))}).join("&"):""}function vr(e){return vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vr(e)}function gr(e,t){return function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(Array.isArray(e)&&(null==n||n===("undefined"!=typeof Symbol&&[][Symbol.iterator])||n===[]["@@iterator"]))return e;if(null!=n){var r,o,i,s,a=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);u=!0);}catch(e){c=!0,o=e}finally{try{if(!u&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}(e,t)||Pr(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wr(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var u=r&&r.prototype instanceof a?r:a,c=Object.create(u.prototype);return _r(c,"_invoke",function(n,r,o){var i,a,u,c=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,u=e,p.n=n,s}};function h(n,r){for(a=n,u=r,t=0;!f&&c&&!o&&t<l.length;t++){var o,i=l[t],h=p.p,d=i[2];n>3?(o=d===r)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,p.v=r,p.n=i[1]):h<d&&(o=n<3||i[0]>r||r>d)&&(i[4]=n,i[5]=r,p.n=d,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,l,d){if(c>1)throw TypeError("Generator is already running");for(f&&1===l&&h(l,d),a=l,u=d;(t=a<2?e:u)||!f;){i||(a?(a>1&&(p.n=a<3?-1:u),h(a,u)):p.v=u);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=p.n<0)?u:n.call(r,p))!==s)break}catch(t){i=e,a=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var s={};function a(){}function u(){}function c(){}t=Object.getPrototypeOf;var l=[][r]?t(t([][r]())):(_r(t={},r,function(){return this}),t),f=c.prototype=a.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,_r(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,_r(f,"constructor",c),_r(c,"constructor",u),u.displayName="GeneratorFunction",_r(c,o,"GeneratorFunction"),_r(f),_r(f,o,"Generator"),_r(f,r,function(){return this}),_r(f,"toString",function(){return"[object Generator]"}),(wr=function(){return{w:i,m:p}})()}function _r(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}_r=function(e,t,n,r){function i(t,n){_r(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},_r(e,t,n,r)}function Er(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Or(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Er(Object(n),!0).forEach(function(t){Sr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Er(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Sr(e,t,n){return(t=Nr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tr(e,t,n,r,o,i,s){try{var a=e[i](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,o)}function Rr(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function s(e){Tr(i,r,o,s,a,"next",e)}function a(e){Tr(i,r,o,s,a,"throw",e)}s(void 0)})}}function kr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Pr(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw i}}}}function Pr(e,t){if(e){if("string"==typeof e)return Ar(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ar(e,t):void 0}}function Ar(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function jr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Nr(r.key),r)}}function Cr(e,t,n){return t&&jr(e.prototype,t),n&&jr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Nr(e){var t=function(e,t){if("object"!=vr(e)||!e)return e;var n;if("undefined"!=typeof Symbol&&void 0!==(n=e[Symbol.toPrimitive])){var r=n.call(e,t||"default");if("object"!=vr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==vr(t)?t:t+""}function Ur(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function xr(e,t,n){return t=Ir(t),function(e,t){if(t&&("object"==vr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Br()?Reflect.construct(t,n||[],Ir(e).constructor):t.apply(e,n))}function Dr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fr(e,t)}function Lr(e){var t="function"==typeof Map?new Map:void 0;return Lr=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(Br())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&Fr(o,n.prototype),o}(e,arguments,Ir(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Fr(n,e)},Lr(e)}function Br(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Br=function(){return!!e})()}function Fr(e,t){return Fr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fr(e,t)}function Ir(e){return Ir=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ir(e)}function Hr(e){return new zr(e,0)}function qr(e){return function(){return new Mr(e.apply(this,arguments))}}function Mr(e){var t,n;function r(t,n){try{var i=e[t](n),s=i.value,a=s instanceof zr;Promise.resolve(a?s.v:s).then(function(n){if(a){var u="return"===t&&s.k?t:"next";if(!s.k||n.done)return r(u,n);n=e[u](n).value}o(!!i.done,n)},function(e){r("throw",e)})}catch(e){o(2,e)}}function o(e,o){2===e?t.reject(o):t.resolve({value:o,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,o){return new Promise(function(i,s){var a={key:e,arg:o,resolve:i,reject:s,next:null};n?n=n.next=a:(t=n=a,r(e,o))})},"function"!=typeof e.return&&(this.return=void 0)}function zr(e,t){this.v=e,this.k=t}function Xr(e){var t,n,r,o=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,r=Symbol.iterator);o--;){if(n&&null!=(t=e[n]))return t.call(e);if(r&&null!=(t=e[r]))return new Wr(t.call(e));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function Wr(e){function t(e,t){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var r,o=e.done,i=e.value;try{r=Promise.resolve(i)}catch(e){if(t&&!o)try{n(t)}catch(e){}return Promise.reject(e)}return r.then(function(e){return{value:e,done:o}},t&&!o?function(e){try{n(t)}catch(e){}throw e}:void 0)}function n(e){var t=e.return;null!=t&&t.call(e)}return Wr=function(e){this.s=e,this.n=e.next},Wr.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments),this.s)},return:function(e){var n=this.s.return;return void 0===n?Promise.resolve({value:e,done:!0}):t(n.apply(this.s,arguments))},throw:function(){var e=this.s,r=e.throw;return void 0===r?new Promise(function(t,r){n(e),r(new TypeError("The iterator does not provide a 'throw' method"))}):t(r.apply(e,arguments),e)}},new Wr(e)}Mr.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Mr.prototype.next=function(e){return this._invoke("next",e)},Mr.prototype.throw=function(e){return this._invoke("throw",e)},Mr.prototype.return=function(e){return this._invoke("return",e)};var Kr=null,Gr=null,Yr=null,$r=Object.freeze({HTTP_USER_AGENT_HEADER_NAME:"User-Agent",HTTP_USER_AGENT:"appmesh/javascript",DEFAULT_RUN_APP_TIMEOUT_SECONDS:"P2D",DEFAULT_RUN_APP_LIFECYCLE_SECONDS:"P2DT12H",SYNC_RUN_OUTPUT_PAGE_BYTES:5242880,SYNC_RUN_TRUNCATED_RETENTION_SECONDS:600,HTTP_HEADER_KEY_AUTH:"Authorization",HTTP_HEADER_KEY_X_TARGET_HOST:"X-Target-Host",HTTP_HEADER_KEY_X_FILE_PATH:"X-File-Path",HTTP_HEADER_KEY_X_FILE_OVERWRITE:"X-File-Overwrite",HTTP_HEADER_KEY_X_FILE_MODE:"X-File-Mode",HTTP_HEADER_KEY_X_FILE_USER:"X-File-User",HTTP_HEADER_KEY_X_FILE_GROUP:"X-File-Group",HTTP_HEADER_KEY_X_OUTPUT_POSITION:"X-Output-Position",HTTP_HEADER_KEY_X_EXIT_CODE:"X-Exit-Code",HTTP_HEADER_KEY_X_OUTPUT_TRUNCATED:"X-Output-Truncated",HTTP_HEADER_KEY_X_APP_NAME:"X-App-Name",HTTP_HEADER_KEY_X_INPUT_CLOSE:"X-Input-Close",HTTP_HEADER_KEY_X_SUBSCRIPTION_ID:"X-Subscription-Id"}),Jr=Object.freeze({isNode:!("undefined"!=typeof window&&"undefined"!==window.document)}),Vr=/^([a-z][a-z\d+\-.]*:)?\/\//i;function Qr(e,t){var n=String(e||""),r=String(t||""),o=r;if(n&&!Vr.test(r)){for(var i=n.length;i>0&&47===n.charCodeAt(i-1);)i--;o=r?n.slice(0,i)+"/"+r.replace(/^\/+/,""):n}try{return new URL(o).pathname}catch(e){try{return new URL(o,"http://localhost").pathname}catch(e){return r}}}var Zr=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;return Ur(this,e),(n=xr(this,e,[t])).name="AppMeshError",n.statusCode=r,n.responseData=o,n.errorCode=i,n.timestamp=(new Date).toISOString(),n}return Dr(e,Lr(Error)),Cr(e)}(),eo=function(){function e(t){var n;return Ur(this,e),(n=xr(this,e,[t,null,null,"APP_REMOVED"])).name="AppRemovedError",n}return Dr(e,Zr),Cr(e)}(),to=function(){function e(t){var n;return Ur(this,e),(n=xr(this,e,[t,null,null,"TRANSPORT_DISCONNECTED"])).name="TransportDisconnectedError",n}return Dr(e,Zr),Cr(e)}(),no=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return Ur(this,e),(n=xr(this,e,[t,r,null,"REQUEST"])).name="AppMeshRequestError",n}return Dr(e,Zr),Cr(e)}(),ro=function(){function e(t){var n;return Ur(this,e),(n=xr(this,e,[t,null,null,"TIMEOUT"])).name="AppMeshTimeoutError",n}return Dr(e,Zr),Cr(e)}(),oo=function(e,t){Jr.isNode?process.stdout.write(e):console.log(e)};function io(e){if("number"==typeof e)return e;if("string"!=typeof e)throw new Error("Invalid input type. Expected number or ISO 8601 duration string.");if(/^\d+$/.test(e))return parseInt(e,10);if(!e.trim())throw new Error("Duration string cannot be empty");if(!e.startsWith("P"))throw new Error("Invalid ISO8601 duration: must start with P");var t="\\d+",n="".concat(t,"(?:[\\.,]").concat(t,")?"),r="(".concat(t,"Y)?(").concat(t,"M)?(").concat(t,"W)?(").concat(t,"D)?"),o="T(".concat(n,"H)?(").concat(n,"M)?(").concat(n,"S)?"),i="P(?:".concat(r,"(?:").concat(o,")?)"),s=["years","months","weeks","days","hours","minutes","seconds"],a=e.replace(/,/g,".").match(new RegExp(i));if(!a)throw new RangeError("invalid duration: "+e);var u=a.slice(1);if(0===u.filter(function(e){return null!=e}).length)throw new RangeError("invalid duration: "+e);if(u.filter(function(e){return/\./.test(e||"")}).length>1)throw new RangeError("only the smallest unit can be fractional");var c=u.reduce(function(e,t,n){return e[s[n]]=parseFloat(t||"0")||0,e},{}),l=0;return l+=31536e3*c.years,l+=2592e3*c.months,l+=604800*c.weeks,l+=86400*c.days,l+=3600*c.hours,l+=60*c.minutes,l+=c.seconds}function so(e){return"undefined"!=typeof Buffer&&Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?new Uint8Array(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):(new TextEncoder).encode(null==e?"":String(e))}function ao(e){if("undefined"!=typeof Buffer)return Buffer.concat(e.map(function(e){return Buffer.isBuffer(e)?e:Buffer.from(e.buffer,e.byteOffset,e.byteLength)}));var t,n=0,r=kr(e);try{for(r.s();!(t=r.n()).done;){n+=t.value.byteLength}}catch(e){r.e(e)}finally{r.f()}var o,i=new Uint8Array(n),s=0,a=kr(e);try{for(a.s();!(o=a.n()).done;){var u=o.value;i.set(u,s),s+=u.byteLength}}catch(e){a.e(e)}finally{a.f()}return i}function uo(e){return fo(e.headers,"content-type")||(null==e.contentType?void 0:e.contentType)}function co(e){var t=/charset\s*=\s*"?([\w!#$%&*+\-.^`|~]+)"?/i.exec(String(e||""));return t?t[1]:null}function lo(e,t){for(var n=0,r=[t,"utf-8"];n<r.length;n++){var o=r[n];if(o)try{return new TextDecoder(o).decode(e)}catch(e){}}return new TextDecoder("utf-8").decode(e)}function fo(e,t){if(e){var n=t.toLowerCase(),r=Object.keys(e).find(function(e){return e.toLowerCase()===n});return void 0===r?void 0:e[r]}}function po(e,t,n){if("string"!=typeof e||""===e)return e;if(!String(fo(t,"content-type")||"").toLowerCase().includes("json"))return e;try{return JSON.parse(e)}catch(t){throw new Zr("Response body is not valid JSON: ".concat(t.message),null!=n?n:null,e,"JSON_PARSE")}}function ho(e){return yo.apply(this,arguments)}function yo(){return(yo=Rr(wr().m(function e(t){var r,o,i,s;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=parseInt(t,10),isNaN(r)||String(r)!==t.trim()){e.n=1;break}return e.a(2,r);case 1:return e.p=1,e.n=2,n.e(994).then(()=>n.t(994,19));case 2:if(o=e.v,i=o.spawnSync,0===(s=i("id",["-u",t],{encoding:"utf8",timeout:3e3})).status&&s.stdout){e.n=3;break}return e.a(2,null);case 3:return e.a(2,parseInt(s.stdout.trim(),10));case 4:return e.p=4,e.v,e.a(2,null)}},e,null,[[1,4]])}))).apply(this,arguments)}function mo(e){return bo.apply(this,arguments)}function bo(){return(bo=Rr(wr().m(function e(t){var n,r;return wr().w(function(e){for(;;)switch(e.n){case 0:if(n=parseInt(t,10),isNaN(n)||String(n)!==t.trim()){e.n=1;break}return e.a(2,n);case 1:return e.n=2,vo("name",t);case 2:return r=e.v,e.a(2,r?r.gid:null)}},e)}))).apply(this,arguments)}function vo(e,t){return go.apply(this,arguments)}function go(){return(go=Rr(wr().m(function e(t,r){var o,i,s,a,u,c,l,f,p,h,d;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,n.e(994).then(()=>n.t(994,19));case 1:if(o=e.v,i=o.spawnSync,0!==(s=i("getent",["group",String(r)],{encoding:"utf8",timeout:3e3})).status||!s.stdout){e.n=2;break}return a=s.stdout.trim().split(":"),u=a.length>=3?parseInt(a[2],10):NaN,e.a(2,a[0]&&!isNaN(u)?{name:a[0],gid:u}:null);case 2:if(0===(c=i("dscacheutil",["-q","group","-a",t,String(r)],{encoding:"utf8",timeout:3e3})).status&&c.stdout){e.n=3;break}return e.a(2,null);case 3:if(l=c.stdout.split("\n"),f=l.find(function(e){return e.startsWith("name:")}),p=l.find(function(e){return e.startsWith("gid:")}),f&&p){e.n=4;break}return e.a(2,null);case 4:return h=f.slice(5).trim(),d=parseInt(p.slice(4).trim(),10),e.a(2,h&&!isNaN(d)?{name:h,gid:d}:null);case 5:return e.p=5,e.v,e.a(2,null)}},e,null,[[0,5]])}))).apply(this,arguments)}function wo(e){return _o.apply(this,arguments)}function _o(){return(_o=Rr(wr().m(function e(t){var r,o,i,s;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,n.e(994).then(()=>n.t(994,19));case 1:if(r=e.v,o=r.spawnSync,0===(i=o("id",["-un",String(t)],{encoding:"utf8",timeout:3e3})).status&&i.stdout){e.n=2;break}return e.a(2,null);case 2:return s=i.stdout.trim(),e.a(2,s||null);case 3:return e.p=3,e.v,e.a(2,null)}},e,null,[[0,3]])}))).apply(this,arguments)}function Eo(e){return Oo.apply(this,arguments)}function Oo(){return(Oo=Rr(wr().m(function e(t){var n;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,vo("gid",t);case 1:return n=e.v,e.a(2,n?n.name:null)}},e)}))).apply(this,arguments)}var So="/opt/appmesh/ssl/ca.pem";function To(e){return null==e||"string"==typeof e||"undefined"!=typeof Buffer&&Buffer.isBuffer(e)}function Ro(e){if(!e)return null;var t="function"==typeof e.get?e.get($r.HTTP_HEADER_KEY_AUTH):e[$r.HTTP_HEADER_KEY_AUTH]||e.authorization;return"string"==typeof t&&t.startsWith("Bearer ")?t.slice(7):null}function ko(e){return"string"!=typeof e||e.includes("-----BEGIN")?e:Gr.readFileSync(e)}function Po(e){if(!1===e)return{rejectUnauthorized:!1};if(!e)return Gr.existsSync(So)?{ca:Gr.readFileSync(So),rejectUnauthorized:!0}:{rejectUnauthorized:!0};for(var t=Or({},e),n=0,r=["ca","cert","key"];n<r.length;n++){var o=r[n];t[o]&&(t[o]=ko(t[o]))}return"boolean"!=typeof t.rejectUnauthorized&&(t.rejectUnauthorized=!0),t}var Ao=Cr(function e(t){var n,r,o,i,s,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ur(this,e),this.reason=t,this.exitCode=null!==(n=a.exitCode)&&void 0!==n?n:null,this.position=null!==(r=a.position)&&void 0!==r?r:null,this.httpStatus=null!==(o=a.httpStatus)&&void 0!==o?o:null,this.message=null!==(i=a.message)&&void 0!==i?i:null,this.result=null!==(s=a.result)&&void 0!==s?s:null});function jo(e){return Co.apply(this,arguments)}function Co(){return(Co=qr(wr().m(function e(t){var n,r,o,i,s,a,u,c,l,f,p,h,d,y,m,b;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:n=new TextDecoder("utf-8"),r="",o="message",i=[],s=!1,a=!1,e.p=1,c=Xr(t);case 2:return e.n=3,Hr(c.next());case 3:if(!(s=!(l=e.v).done)){e.n=12;break}f=l.value,r+="string"==typeof f?f:n.decode(f,{stream:!0}),p=void 0;case 4:if(!((p=r.indexOf("\n"))>=0)){e.n=11;break}if(h=r.slice(0,p).replace(/\r$/,""),r=r.slice(p+1),""!==h){e.n=9;break}if(!("message"!==o||i.length>0)){e.n=8;break}if(d=i.join("\n"),y={},!d){e.n=7;break}e.p=5,y=JSON.parse(d),e.n=7;break;case 6:throw e.p=6,m=e.v,new Zr("malformed SSE frame (".concat(o,"): ").concat(m.message));case 7:return e.n=8,[o,y];case 8:o="message",i=[],e.n=10;break;case 9:h.startsWith(":")||(h.startsWith("event:")?o=h.slice(6).trim():h.startsWith("data:")&&i.push(h.slice(5).trimStart()));case 10:e.n=4;break;case 11:s=!1,e.n=2;break;case 12:e.n=14;break;case 13:e.p=13,b=e.v,a=!0,u=b;case 14:if(e.p=14,e.p=15,!s||null==c.return){e.n=16;break}return e.n=16,Hr(c.return());case 16:if(e.p=16,!a){e.n=17;break}throw u;case 17:return e.f(16);case 18:return e.f(14);case 19:return e.a(2)}},e,null,[[15,,16,18],[5,6],[1,13,14,19]])}))).apply(this,arguments)}function No(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new Ao(String(null!==(t=e.reason)&&void 0!==t?t:"closed"),Or({exitCode:e.exit_code,position:e.position,httpStatus:e.status,message:e.message},n))}function Uo(e){var t;if("error"===e.reason)throw new no(e.message||"stream failed with an error",null!==(t=e.httpStatus)&&void 0!==t?t:null);if("timeout"===e.reason)throw new ro(e.message||"stream timed out");if(!["exit","removed","eof","final","disconnected","closed"].includes(e.reason))throw new Zr("stream ended with unknown reason: ".concat(e.reason))}var xo=function(){return Cr(function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jr.isNode?"https://127.0.0.1:6060":window.location.origin,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;Ur(this,e),this.baseURL=r,this.forwardingHost=null,this._requestSigner=null,this._tokenProvider=null,i&&this.setTokenProvider(i);var s={baseURL:r,timeout:3e5,validateStatus:function(e){return!0},transformResponse:[po]};this._sslConfig=o,this._client=An.create(s),Jr.isNode&&!Yr&&(Yr=Promise.all([n.e(453).then(()=>n.t(453,19)),n.e(603).then(()=>n.t(603,19))]).then(function(e){var t=gr(e,2),n=t[0],r=t[1];Kr=n.default||n,Gr=r.default||r}).catch(function(){})),this._client.interceptors.request.use(function(){var e=Rr(wr().m(function e(n){var r,o,i;return wr().w(function(e){for(;;)switch(e.n){case 0:return r=n,o=Or,i=Or({},n.headers),e.n=1,t._commonHeaders();case 1:return r.headers=o(i,e.v),e.a(2,n)}},e)}));return function(t){return e.apply(this,arguments)}}(),function(e){var t=new Zr("Request configuration error: "+(e.message||"Unknown error"));return Promise.reject(t)}),this._client.interceptors.response.use(function(e){return t._handleUnauthorizedRetry(e)},function(e){var t,n,r,o;if(e instanceof Zr)return Promise.reject(e);var i=new Zr("Request failed: "+(e.message||"Unknown error"),null!==(t=null===(n=e.response)||void 0===n?void 0:n.status)&&void 0!==t?t:null,null!==(r=null===(o=e.response)||void 0===o?void 0:o.data)&&void 0!==r?r:null);return i.cause=e,Promise.reject(i)})},[{key:"setTokenProvider",value:function(e){if(!e||"function"!=typeof e.getAccessToken)throw new TypeError("tokenProvider must implement async getAccessToken()");this._tokenProvider=e}},{key:"setBearerToken",value:function(e){null!=e?this.setTokenProvider(new Ln(e)):this.clearBearerToken()}},{key:"clearBearerToken",value:function(){var e=this._tokenProvider;e&&"function"==typeof e.clear&&e.clear(),this._tokenProvider=null}},{key:"enableRequestSignature",value:function(e,t){this._requestSigner=new fr(e,t)}},{key:"disableRequestSignature",value:function(){this._requestSigner=null}},{key:"isRequestSignatureEnabled",value:function(){return null!==this._requestSigner}},{key:"_applyRequestSignature",value:(W=Rr(wr().m(function e(t){var n,r,o,i,s,a,u,c,l,f,p,h;return wr().w(function(e){for(;;)switch(e.n){case 0:if((n=this._requestSigner)&&t){e.n=1;break}return e.a(2);case 1:return r=Qr(t.baseURL||this._client.defaults.baseURL||this.baseURL,t.url),o="",t.params&&"object"===vr(t.params)&&Object.keys(t.params).length>0&&(t.paramsSerializer=br,o=yr(br(t.params))),i=this._headerValue(t.headers,"content-type"),s=cr(r)?Buffer.alloc(0):this._wireBodyBytes(t.data,i),a=String(t.method||"get").toUpperCase(),u={},e.n=2,n.attach(u,a,r,o,s);case 2:for(c=0,l=Object.entries(u);c<l.length;c++)f=gr(l[c],2),p=f[0],h=f[1],t.headers&&"function"==typeof t.headers.set?t.headers.set(p,h):t.headers=Or(Or({},t.headers),{},Sr({},p,h));case 3:return e.a(2)}},e,this)})),function(e){return W.apply(this,arguments)})},{key:"_headerValue",value:function(e,t){if(e){if("function"==typeof e.get)return e.get(t);var n=Object.keys(e).find(function(e){return e.toLowerCase()===t.toLowerCase()});return void 0===n?void 0:e[n]}}},{key:"_wireBodyBytes",value:function(e,t){if(null==e)return Buffer.alloc(0);if("string"==typeof e){if(String(t||"").toLowerCase().includes("application/json"))try{return JSON.parse(e),Buffer.from(e.trim(),"utf8")}catch(t){if("SyntaxError"!==t.name)throw t;return Buffer.from(JSON.stringify(e),"utf8")}return Buffer.from(e,"utf8")}if(Buffer.isBuffer(e)||e instanceof Uint8Array||e instanceof ArrayBuffer)return Buffer.from(e);if("object"===vr(e))return Buffer.from(JSON.stringify(e),"utf8");throw new Zr("cannot sign a streaming request body; only the /appmesh/files endpoints accept unbound bodies")}},{key:"_getAccessToken",value:(X=Rr(wr().m(function e(){var t;return wr().w(function(e){for(;;)switch(e.n){case 0:if(!this._tokenProvider){e.n=2;break}return e.n=1,this._tokenProvider.getAccessToken();case 1:t=e.v,e.n=3;break;case 2:t=null;case 3:return e.a(2,t)}},e,this)})),function(){return X.apply(this,arguments)})},{key:"_handleUnauthorizedRetry",value:(z=Rr(wr().m(function e(t){var n,r,o,i,s,a,u,c,l,f;return wr().w(function(e){for(;;)switch(e.n){case 0:if(r=t.config||{},o=this._tokenProvider,401===t.status&&!r.__appmeshRetried&&o){e.n=1;break}return e.a(2,t);case 1:if("function"!=typeof o.canRefresh){e.n=3;break}return e.n=2,o.canRefresh();case 2:l=e.v,e.n=4;break;case 3:l=!!o.canRefresh;case 4:if(l&&"function"==typeof o.refreshAccessToken&&To(r.data)){e.n=5;break}return e.a(2,t);case 5:if(!this._requestSigner){e.n=6;break}if(i=t.headers||{},(s="function"==typeof i.get?i.get("WWW-Authenticate"):i["WWW-Authenticate"]||i["www-authenticate"])&&s.includes("invalid_token")){e.n=6;break}return e.a(2,t);case 6:if(null===(n=Ro(r.headers))||void 0===n){e.n=7;break}f=n,e.n=9;break;case 7:return e.n=8,this._getAccessToken();case 8:f=e.v;case 9:return a=f,e.n=10,o.refreshAccessToken(a);case 10:if("string"==typeof(u=e.v)&&u.trim()){e.n=11;break}return e.a(2,t);case 11:if(r.__appmeshRetried=!0,c="Bearer ".concat(u.trim()),r.headers&&"function"==typeof r.headers.set?r.headers.set($r.HTTP_HEADER_KEY_AUTH,c):r.headers=Or(Or({},r.headers),{},Sr({},$r.HTTP_HEADER_KEY_AUTH,c)),!this._requestSigner){e.n=12;break}return e.n=12,this._applyRequestSignature(r);case 12:return e.a(2,this._client(r))}},e,this)})),function(e){return z.apply(this,arguments)})},{key:"getAuthConfig",value:(M=Rr(wr().m(function e(){var t,n=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.n=1,this._request("get","/appmesh/auth/config",null,t);case 1:return e.a(2,e.v.data)}},e,this)})),function(){return M.apply(this,arguments)})},{key:"getCurrentPrincipal",value:(q=Rr(wr().m(function e(){var t,n=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return t=n.length>0&&void 0!==n[0]?n[0]:{},e.n=1,this._request("get","/appmesh/principals/self",null,t);case 1:return e.a(2,e.v.data)}},e,this)})),function(){return q.apply(this,arguments)})},{key:"listApps",value:(H=Rr(wr().m(function e(){var t;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/apps");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return H.apply(this,arguments)})},{key:"getApp",value:(I=Rr(wr().m(function e(t){var n;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/apps/".concat(t));case 1:return n=e.v,e.a(2,n.data)}},e,this)})),function(e){return I.apply(this,arguments)})},{key:"checkAppHealth",value:(F=Rr(wr().m(function e(t){var n;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/apps/".concat(t,"/health"));case 1:return n=e.v,e.a(2,0===parseInt(n.data,10))}},e,this)})),function(e){return F.apply(this,arguments)})},{key:"addApp",value:(B=Rr(wr().m(function e(t,n){var r;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("put","/appmesh/apps/".concat(t),n);case 1:return r=e.v,e.a(2,r.data)}},e,this)})),function(e,t){return B.apply(this,arguments)})},{key:"deleteApp",value:(L=Rr(wr().m(function e(t){var n,r;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,this._request("delete","/appmesh/apps/".concat(t));case 1:return n=e.v,e.a(2,200===n.status);case 2:if(e.p=2,404!==(r=e.v).statusCode){e.n=3;break}return e.a(2,!1);case 3:throw r;case 4:return e.a(2)}},e,this,[[0,2]])})),function(e){return L.apply(this,arguments)})},{key:"enableApp",value:(D=Rr(wr().m(function e(t){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("post","/appmesh/apps/".concat(t,"/enable"));case 1:return e.a(2,!0)}},e,this)})),function(e){return D.apply(this,arguments)})},{key:"disableApp",value:(x=Rr(wr().m(function e(t){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("post","/appmesh/apps/".concat(t,"/disable"));case 1:return e.a(2,!0)}},e,this)})),function(e){return x.apply(this,arguments)})},{key:"getAppOutput",value:(U=Rr(wr().m(function e(t){var n,r,o,i,s,a,u,c,l,f,p=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return n=p.length>2&&void 0!==p[2]?p[2]:0,r=p.length>3&&void 0!==p[3]?p[3]:10240,o=p.length>4&&void 0!==p[4]?p[4]:"",i=p.length>5&&void 0!==p[5]?p[5]:0,s={stdout_position:(p.length>1&&void 0!==p[1]?p[1]:0).toString(),stdout_index:n.toString(),stdout_maxsize:r.toString(),process_uuid:o,timeout:io(i).toString()},e.n=1,this._request("get","/appmesh/apps/".concat(t,"/output"),null,{params:s});case 1:return a=e.v,u=fo(a.headers,$r.HTTP_HEADER_KEY_X_OUTPUT_POSITION),c=fo(a.headers,$r.HTTP_HEADER_KEY_X_EXIT_CODE),l=u?parseInt(u,10):null,f=c?parseInt(c,10):null,e.a(2,new Do(a.status,a.data,l,f))}},e,this)})),function(e){return U.apply(this,arguments)})},{key:"runAppSync",value:(N=Rr(wr().m(function e(t){var n,r,o,i,s,a,u,c,l,f,p,h,d,y=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return n=y.length>1&&void 0!==y[1]?y[1]:oo,r=y.length>2&&void 0!==y[2]?y[2]:$r.DEFAULT_RUN_APP_TIMEOUT_SECONDS,o=y.length>3&&void 0!==y[3]?y[3]:$r.DEFAULT_RUN_APP_LIFECYCLE_SECONDS,i=y.length>4&&void 0!==y[4]?y[4]:null,s={timeout:io(r),lifecycle:io(o),sync:1},e.n=1,this._request("post","/appmesh/apps/run",t,{params:s,config:{responseType:"arraybuffer"}});case 1:if(a=e.v,u=null,200!==a.status){e.n=3;break}if((c=fo(a.headers,$r.HTTP_HEADER_KEY_X_EXIT_CODE))&&(u=parseInt(c,10)),l=fo(a.headers,$r.HTTP_HEADER_KEY_X_APP_NAME),f=fo(a.headers,$r.HTTP_HEADER_KEY_X_OUTPUT_TRUNCATED),!l||"1"!==String(f)){e.n=3;break}return p=fo(a.headers,$r.HTTP_HEADER_KEY_X_OUTPUT_POSITION),e.n=2,this._readTruncatedRunOutput(a,l,i,p?parseInt(p,10):NaN);case 2:return h=e.v,n&&n(h,0),e.a(2,u);case 3:if(d=so(a.data),!(null!=i&&d.byteLength>i)){e.n=4;break}throw new no("run output exceeds maxOutputBytes=".concat(i," (").concat(d.byteLength," bytes)"),a.status);case 4:return n&&n(lo(d,co(uo(a))),0),e.a(2,u)}},e,this)})),function(e){return N.apply(this,arguments)})},{key:"_readTruncatedRunOutput",value:(C=Rr(wr().m(function e(t,n,r,o){var i,s,a,u,c,l;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:i=[so(t.data)],Number.isFinite(o)||(o=i[0].byteLength),(s=function(){var e=i.reduce(function(e,t){return e+t.byteLength},0);if(null!=r&&e>r)throw new no("run output exceeds maxOutputBytes=".concat(r,"; the rest stays readable on application ")+"'".concat(n,"' for ").concat($r.SYNC_RUN_TRUNCATED_RETENTION_SECONDS," seconds"),t.status)})(),a=!1,e.p=1;case 2:return e.n=3,this._request("get","/appmesh/apps/".concat(n,"/output"),null,{params:{stdout_position:String(o)},config:{responseType:"arraybuffer"}});case 3:if(u=e.v,c=so(u.data),i.push(c),o+=c.byteLength,s(),!(c.byteLength<$r.SYNC_RUN_OUTPUT_PAGE_BYTES)){e.n=4;break}return a=!0,e.a(3,5);case 4:e.n=2;break;case 5:if(e.p=5,!a){e.n=9;break}return e.p=6,e.n=7,this.deleteApp(n);case 7:e.n=9;break;case 8:e.p=8,l=e.v,console.warn("Warning: Failed to remove sync run application '".concat(n,"':"),l.message);case 9:return e.f(5);case 10:return e.a(2,lo(ao(i),co(uo(t))))}},e,this,[[6,8],[1,,5,10]])})),function(e,t,n,r){return C.apply(this,arguments)})},{key:"runAppAsync",value:(j=Rr(wr().m(function e(t){var n,r,o,i,s=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:$r.DEFAULT_RUN_APP_TIMEOUT_SECONDS,r=s.length>2&&void 0!==s[2]?s[2]:$r.DEFAULT_RUN_APP_LIFECYCLE_SECONDS,o={timeout:io(n),lifecycle:io(r)},e.n=1,this._request("post","/appmesh/apps/run",t,{params:o});case 1:return i=e.v,e.a(2,new Lo(this,i.data.name,i.data.process_uuid))}},e,this)})),function(e){return j.apply(this,arguments)})},{key:"waitForAsyncRun",value:(A=Rr(wr().m(function e(t){var n,r,o,i,s,a,u=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:if(n=u.length>1&&void 0!==u[1]?u[1]:oo,r=u.length>2&&void 0!==u[2]?u[2]:0,!t){e.n=7;break}o=0,i=new Date,s=1;case 1:if(!(t.procUid.length>0)){e.n=7;break}return e.n=2,this.getAppOutput(t.appName,o,0,20480,t.procUid,s);case 2:if((a=e.v).output&&n&&n(a.output,o),null!==a.outPosition&&(o=a.outPosition),null===a.exitCode){e.n=4;break}return e.n=3,this.deleteApp(t.appName);case 3:return e.a(2,a.exitCode);case 4:if(!(r>0&&(new Date-i)/1e3>r)){e.n=5;break}return e.a(3,7);case 5:return e.n=6,new Promise(function(e){return setTimeout(e,100)});case 6:e.n=1;break;case 7:return e.a(2,null)}},e,this)})),function(e){return A.apply(this,arguments)})},{key:"runTask",value:(P=Rr(wr().m(function e(t,n){var r,o,i=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return(r=i.length>2&&void 0!==i[2]?i[2]:300)<=0&&(r=300),e.n=1,this._request("post","/appmesh/apps/".concat(t,"/task"),n,{params:{timeout:r.toString()}});case 1:return o=e.v,e.a(2,o.data)}},e,this)})),function(e,t){return P.apply(this,arguments)})},{key:"cancelTask",value:(k=Rr(wr().m(function e(t){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("delete","/appmesh/apps/".concat(t,"/task"));case 1:return e.a(2,!0)}},e,this)})),function(e){return k.apply(this,arguments)})},{key:"followOutput",value:function(e){var t=this;return qr(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return wr().m(function r(){var o,i,s,a,u,c,l,f,p,h,d,y,m,b,v,g,w,_,E,O,S,T,R,k;return wr().w(function(r){for(;;)switch(r.p=r.n){case 0:return o=n.stdoutPosition,i=void 0===o?0:o,s=n.processUuid,a=void 0===s?"":s,u=n.follow,c=void 0===u||u,l=n.timeout,f=void 0===l?3600:l,p={stdout_position:String(i),follow:c?"true":"false",timeout:String(f)},a&&(p.process_uuid=a),r.n=1,Hr(t._sseRequest("get","/appmesh/apps/".concat(e,"/output/stream"),{params:p}));case 1:h=r.v,d=null,r.p=2,y=!1,m=!1,r.p=3,v=Xr(jo(h.data));case 4:return r.n=5,Hr(v.next());case 5:if(!(y=!(g=r.v).done)){r.n=9;break}if(w=gr(g.value,2),_=w[0],E=w[1],"stdout"!==_){r.n=7;break}return r.n=6,String(null!==(O=E.output)&&void 0!==O?O:"");case 6:r.n=8;break;case 7:if("end"!==_){r.n=8;break}return d=No(E),r.a(3,9);case 8:y=!1,r.n=4;break;case 9:r.n=11;break;case 10:r.p=10,R=r.v,m=!0,b=R;case 11:if(r.p=11,r.p=12,!y||null==v.return){r.n=13;break}return r.n=13,Hr(v.return());case 13:if(r.p=13,!m){r.n=14;break}throw b;case 14:return r.f(13);case 15:return r.f(11);case 16:r.n=18;break;case 17:throw r.p=17,k=r.v,t.onError(k);case 18:return r.p=18,null===(S=h.data)||void 0===S||null===(T=S.destroy)||void 0===T||T.call(S),r.f(18);case 19:return null===d&&(d=new Ao("closed")),Uo(d),r.a(2,d)}},r,null,[[12,,13,15],[3,10,11,16],[2,17,18,19]])})()}).apply(this,arguments)}},{key:"runTaskStream",value:function(e,t){var n=this;return qr(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return wr().m(function o(){var i,s,a,u,c,l,f,p,h,d,y,m,b,v,g,w,_,E,O,S;return wr().w(function(o){for(;;)switch(o.p=o.n){case 0:return i=r.timeout,a=(s=void 0===i?300:i)&&s>0?{timeout:String(s)}:{},o.n=1,Hr(n._sseRequest("post","/appmesh/apps/".concat(e,"/task/stream"),{params:a,body:t}));case 1:u=o.v,c=null,l=null,o.p=2,f=!1,p=!1,o.p=3,d=Xr(jo(u.data));case 4:return o.n=5,Hr(d.next());case 5:if(!(f=!(y=o.v).done)){o.n=10;break}if(m=gr(y.value,2),b=m[0],v=m[1],"partial"!==b){o.n=7;break}return o.n=6,String(null!==(g=v.data)&&void 0!==g?g:"");case 6:o.n=9;break;case 7:if("final"!==b){o.n=8;break}l=null!==(w=v.result)&&void 0!==w?w:null,o.n=9;break;case 8:if("end"!==b){o.n=9;break}return c=No(v,{result:l}),o.a(3,10);case 9:f=!1,o.n=4;break;case 10:o.n=12;break;case 11:o.p=11,O=o.v,p=!0,h=O;case 12:if(o.p=12,o.p=13,!f||null==d.return){o.n=14;break}return o.n=14,Hr(d.return());case 14:if(o.p=14,!p){o.n=15;break}throw h;case 15:return o.f(14);case 16:return o.f(12);case 17:o.n=19;break;case 18:throw o.p=18,S=o.v,n.onError(S);case 19:return o.p=19,null===(_=u.data)||void 0===_||null===(E=_.destroy)||void 0===E||E.call(_),o.f(19);case 20:return null===c&&(c=new Ao("closed",{result:l})),Uo(c),o.a(2,c)}},o,null,[[13,,14,16],[3,11,12,17],[2,18,19,20]])})()}).apply(this,arguments)}},{key:"runAppStream",value:function(e){var t=this;return qr(function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$r.DEFAULT_RUN_APP_TIMEOUT_SECONDS,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$r.DEFAULT_RUN_APP_LIFECYCLE_SECONDS;return wr().m(function o(){var i,s,a,u,c;return wr().w(function(o){for(;;)switch(o.p=o.n){case 0:return i="string"==typeof e?{command:e,shell:!0}:e,o.n=1,Hr(t.runAppAsync(i,n,r));case 1:return s=o.v,o.p=2,u=t.followOutput(s.appName,{processUuid:s.procUid,follow:!0,timeout:Math.max(io(n),io(r))}),o.n=3,Hr(u.next());case 3:c=o.v;case 4:if(c.done){o.n=7;break}return o.n=5,c.value;case 5:return o.n=6,Hr(u.next());case 6:c=o.v,o.n=4;break;case 7:a=c.value;case 8:return o.p=8,o.p=9,o.n=10,Hr(t.deleteApp(s.appName));case 10:o.n=12;break;case 11:o.p=11,o.v;case 12:return o.f(8);case 13:return o.a(2,a)}},o,null,[[9,11],[2,,8,13]])})()}).apply(this,arguments)}},{key:"sendInput",value:(R=Rr(wr().m(function e(t,n){var r,o,i,s,a,u,c,l,f,p,h=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return s=(i=h.length>2&&void 0!==h[2]?h[2]:{}).close,a=void 0!==s&&s,u=i.processUuid,c=void 0===u?"":u,l=a?Sr({},$r.HTTP_HEADER_KEY_X_INPUT_CLOSE,"true"):{},f=c?{process_uuid:c}:{},e.n=1,this._request("post","/appmesh/apps/".concat(t,"/input"),n,{headers:l,params:f});case 1:return p=e.v,e.a(2,parseInt(null!==(r=null===(o=p.data)||void 0===o?void 0:o.bytes_written)&&void 0!==r?r:0,10))}},e,this)})),function(e,t){return R.apply(this,arguments)})},{key:"downloadFile",value:(T=Rr(wr().m(function e(t){var r,o,i,s,a,u,c,l,f,p,h,d,y,m,b,v,g,w,_,E,O,S,T,R,k,P,A=arguments;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:return a=A.length>2&&void 0!==A[2]&&A[2],(s=A.length>1&&void 0!==A[1]?A[1]:null)||(s=t.split(/[\\/]/).pop()),u=Sr({},$r.HTTP_HEADER_KEY_X_FILE_PATH,encodeURIComponent(t)),e.n=1,this._request("get","/appmesh/files",null,{headers:u,config:{responseType:Jr.isNode?"stream":"arraybuffer"}});case 1:if(c=e.v,l=Jr.isNode?"":c.data,200!==c.status||null!==(r=c.headers)&&void 0!==r&&r["content-disposition"]||!String(null!==(o=null===(i=c.headers)||void 0===i?void 0:i["content-type"])&&void 0!==o?o:"").toLowerCase().includes("json")){e.n=2;break}throw Jr.isNode&&c.data.destroy(),new Zr("File download is not supported by this server surface: ".concat(t),c.status,l);case 2:if(200===c.status){e.n=3;break}throw new Zr("Failed to download file: ".concat(t),c.status,l);case 3:if(!Jr.isNode){e.n=20;break}return e.n=4,n.e(603).then(()=>n.t(603,19));case 4:return f=e.v,e.n=5,n.e(582).then(()=>n.t(582,19));case 5:return p=e.v,h=p.promisify,R=h,e.n=6,n.e(770).then(()=>n.t(770,19));case 6:return d=R(e.v.pipeline),y=f.promises,e.p=7,e.n=8,d(c.data,f.createWriteStream(s));case 8:if(!a||"win32"===process.platform){e.n=17;break}if(m=c.headers,e.p=9,!(b=m["x-file-mode"])){e.n=12;break}if(v=parseInt(b,10),!(Number.isInteger(v)&&v>=0&&v<=511)){e.n=11;break}return e.n=10,y.chmod(s,v);case 10:e.n=12;break;case 11:console.warn("Warning: Invalid x-file-mode value:",b);case 12:if(g=m["x-file-user"],w=m["x-file-group"],!g||!w){e.n=15;break}return e.n=13,ho(g);case 13:return _=e.v,e.n=14,mo(w);case 14:if(E=e.v,null===_||null===E){e.n=15;break}return e.n=15,y.chown(s,_,E);case 15:e.n=17;break;case 16:e.p=16,k=e.v,console.warn("Warning: Unable to apply file attributes to",s,k.message);case 17:e.n=19;break;case 18:throw e.p=18,P=e.v,new Zr("Failed to write file to ".concat(s,": ").concat(P.message),c.status);case 19:e.n=21;break;case 20:O=new Blob([c.data]),S=window.URL.createObjectURL(O),(T=document.createElement("a")).style.display="none",T.href=S,T.download=s.split("/").pop(),document.body.appendChild(T),T.click(),window.URL.revokeObjectURL(S),document.body.removeChild(T);case 21:return e.a(2)}},e,this,[[9,16],[7,18]])})),function(e){return T.apply(this,arguments)})},{key:"uploadFile",value:(S=Rr(wr().m(function e(t){var r,o,i,s,a,u,c,l,f,p,h,d,y,m,b=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:if(s=b.length>2&&void 0!==b[2]&&b[2],a=b.length>3&&void 0!==b[3]&&b[3],i=b.length>1&&void 0!==b[1]?b[1]:null){e.n=2;break}if(u="string"==typeof t?t:t&&t.name){e.n=1;break}throw new Zr("filePath is required when localFile is a Blob without a name");case 1:i=u.split(/[\\/]/).pop();case 2:if(c=Sr({},$r.HTTP_HEADER_KEY_X_FILE_PATH,encodeURIComponent(i)),a&&(c[$r.HTTP_HEADER_KEY_X_FILE_OVERWRITE]="true"),!Jr.isNode){e.n=7;break}return e.n=3,n.e(603).then(()=>n.t(603,19));case 3:if(f=e.v,p=f.statSync(t),!s){e.n=6;break}return c["X-File-Mode"]=(511&p.mode).toString(),e.n=4,wo(p.uid);case 4:return h=e.v,e.n=5,Eo(p.gid);case 5:d=e.v,c["X-File-User"]=h||String(p.uid),c["X-File-Group"]=d||String(p.gid);case 6:l=p.size<10485760?f.readFileSync(t):f.createReadStream(t),e.n=9;break;case 7:if(!(t instanceof File||t instanceof Blob)){e.n=8;break}l=t,e.n=9;break;case 8:throw new Zr("In browser, localFile must be File or Blob");case 9:return e.n=10,this._request("post","/appmesh/files",l,{headers:c,config:{maxBodyLength:1/0,maxContentLength:1/0}});case 10:if(200===(y=e.v).status||201===y.status){e.n=11;break}throw new Zr("Failed to upload file: ".concat(i),y.status,y.data);case 11:if(m=String(null!==(r=null===(o=y.headers)||void 0===o?void 0:o["content-type"])&&void 0!==r?r:"").toLowerCase(),!(200===y.status&&m.includes("json")&&y.data&&"object"===vr(y.data)&&"message"in y.data)){e.n=12;break}throw new Zr("File upload is not supported by this server surface: ".concat(i),y.status,y.data);case 12:return e.a(2)}},e,this)})),function(e){return S.apply(this,arguments)})},{key:"getHostResources",value:(O=Rr(wr().m(function e(){var t;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/resources");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return O.apply(this,arguments)})},{key:"getConfig",value:(E=Rr(wr().m(function e(){var t;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/config");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return E.apply(this,arguments)})},{key:"setConfig",value:(_=Rr(wr().m(function e(t){var n;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("put","/appmesh/config",t);case 1:return n=e.v,e.a(2,n.data)}},e,this)})),function(e){return _.apply(this,arguments)})},{key:"setLogLevel",value:(w=Rr(wr().m(function e(){var t,n,r=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:"DEBUG",e.n=1,this.setConfig({BaseConfig:{LogLevel:t}});case 1:return n=e.v,e.a(2,n.BaseConfig.LogLevel)}},e,this)})),function(){return w.apply(this,arguments)})},{key:"updateLabel",value:(g=Rr(wr().m(function e(t,n){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("put","/appmesh/labels/".concat(t),null,{params:{value:n}});case 1:return e.a(2,!0)}},e,this)})),function(e,t){return g.apply(this,arguments)})},{key:"deleteLabel",value:(v=Rr(wr().m(function e(t){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("delete","/appmesh/labels/".concat(t));case 1:return e.a(2,!0)}},e,this)})),function(e){return v.apply(this,arguments)})},{key:"listLabels",value:(b=Rr(wr().m(function e(){var t;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/labels");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return b.apply(this,arguments)})},{key:"listPrincipals",value:(m=Rr(wr().m(function e(){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/principals");case 1:return e.a(2,e.v.data)}},e,this)})),function(){return m.apply(this,arguments)})},{key:"updatePrincipal",value:(y=Rr(wr().m(function e(t,n){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("patch","/appmesh/principals/".concat(encodeURIComponent(t)),n);case 1:return e.a(2,!0)}},e,this)})),function(e,t){return y.apply(this,arguments)})},{key:"deletePrincipal",value:(d=Rr(wr().m(function e(t){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("delete","/appmesh/principals/".concat(encodeURIComponent(t)));case 1:return e.a(2,!0)}},e,this)})),function(e){return d.apply(this,arguments)})},{key:"listPermissions",value:(h=Rr(wr().m(function e(){var t;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/permissions");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return h.apply(this,arguments)})},{key:"getEffectivePermissions",value:(p=Rr(wr().m(function e(){var t,n,r=arguments;return wr().w(function(e){for(;;)switch(e.n){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:{},e.n=1,this._request("get","/appmesh/principals/self/permissions",null,t);case 1:return n=e.v,e.a(2,n.data)}},e,this)})),function(){return p.apply(this,arguments)})},{key:"listRoles",value:(f=Rr(wr().m(function e(){var t;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/roles");case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return f.apply(this,arguments)})},{key:"updateRole",value:(l=Rr(wr().m(function e(t,n){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("put","/appmesh/roles/".concat(t),n);case 1:return e.a(2,!0)}},e,this)})),function(e,t){return l.apply(this,arguments)})},{key:"deleteRole",value:(c=Rr(wr().m(function e(t){return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("delete","/appmesh/roles/".concat(t));case 1:return e.a(2,!0)}},e,this)})),function(e){return c.apply(this,arguments)})},{key:"getMetrics",value:(u=Rr(wr().m(function e(){var t;return wr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this._request("get","/appmesh/metrics",null,{config:{responseType:"text"}});case 1:return t=e.v,e.a(2,t.data)}},e,this)})),function(){return u.apply(this,arguments)})},{key:"subscribe",value:(a=Rr(wr().m(function e(){return wr().w(function(e){for(;;)switch(e.n){case 0:throw new Zr("subscribe requires the TCP client (AppMeshClientTCP, imported from 'appmesh/tcp'); the HTTP client does not support event subscriptions");case 1:return e.a(2)}},e)})),function(){return a.apply(this,arguments)})},{key:"unsubscribe",value:(s=Rr(wr().m(function e(){return wr().w(function(e){for(;;)switch(e.n){case 0:throw new Zr("unsubscribe requires the TCP client (AppMeshClientTCP, imported from 'appmesh/tcp'); the HTTP client does not support event subscriptions");case 1:return e.a(2)}},e)})),function(){return s.apply(this,arguments)})},{key:"request",value:(i=Rr(wr().m(function e(t,n){var r,o,i=arguments;return wr().w(function(e){for(;;)if(0===e.n)return r=i.length>2&&void 0!==i[2]?i[2]:null,o=i.length>3&&void 0!==i[3]?i[3]:{},e.a(2,this._request(t,n,r,o))},e,this)})),function(e,t){return i.apply(this,arguments)})},{key:"_commonHeaders",value:(o=Rr(wr().m(function e(){var t,n;return wr().w(function(e){for(;;)switch(e.n){case 0:return t={},Jr.isNode&&(t[$r.HTTP_USER_AGENT_HEADER_NAME]=$r.HTTP_USER_AGENT),e.n=1,this._getAccessToken();case 1:return(n=e.v)&&(t[$r.HTTP_HEADER_KEY_AUTH]="Bearer ".concat(n)),this.forwardingHost&&(t[$r.HTTP_HEADER_KEY_X_TARGET_HOST]=this.forwardingHost),e.a(2,t)}},e,this)})),function(){return o.apply(this,arguments)})},{key:"_request",value:(r=Rr(wr().m(function e(t,n){var r,o,i,s,a,u,c,l,f,p,h,d,y=arguments;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=y.length>2&&void 0!==y[2]?y[2]:null,o=y.length>3&&void 0!==y[3]?y[3]:{},e.n=1,this._ensureHttpsAgent();case 1:if(i=o.headers,s=void 0===i?{}:i,a=o.params,u=void 0===a?{}:a,c=o.config,l=void 0===c?{}:c,e.p=2,f=Or(Or({method:t,url:n,withCredentials:!1},l),{},{headers:Or({},s),params:Or({},u)}),null!==r&&(f.data=r),!this._requestSigner){e.n=3;break}return e.n=3,this._applyRequestSignature(f);case 3:return e.n=4,this._client(f);case 4:if(!((p=e.v).status<200||p.status>=300)){e.n=5;break}throw h=this._extractErrorMessage(p.data),new Zr(h,p.status,p.data);case 5:return e.a(2,p);case 6:throw e.p=6,d=e.v,this.onError(d);case 7:return e.a(2)}},e,this,[[2,6]])})),function(e,t){return r.apply(this,arguments)})},{key:"_ensureHttpsAgent",value:(t=Rr(wr().m(function e(){return wr().w(function(e){for(;;)switch(e.n){case 0:if(!Jr.isNode||!Yr||this._client.defaults.httpsAgent){e.n=2;break}return e.n=1,Yr;case 1:Kr&&(this._client.defaults.httpsAgent=new Kr.Agent(Or(Or({},Po(this._sslConfig)),{},{keepAlive:!0,keepAliveMsecs:3e3})));case 2:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"_sseRequest",value:(e=Rr(wr().m(function e(t,n){var r,o,i,s,a,u,c,l,f,p,h,d,y,m,b,v,g,w,_,E=arguments;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=E.length>2&&void 0!==E[2]?E[2]:{},e.n=1,this._ensureHttpsAgent();case 1:if(o=r.params,i=void 0===o?{}:o,s=r.headers,a=void 0===s?{}:s,u=r.body,c={method:t,url:n,withCredentials:!1,responseType:"stream",timeout:0,headers:Or({},a),params:Or({},i)},null!=u&&(c.data=u),!this._requestSigner){e.n=2;break}return e.n=2,this._applyRequestSignature(c);case 2:return e.p=2,e.n=3,this._client(c);case 3:l=e.v,e.n=5;break;case 4:throw e.p=4,w=e.v,this.onError(w);case 5:if(200===l.status){e.n=21;break}f="",e.p=6,p=[],h=!1,d=!1,e.p=7,m=Xr(l.data);case 8:return e.n=9,m.next();case 9:if(!(h=!(b=e.v).done)){e.n=11;break}v=b.value,p.push(v);case 10:h=!1,e.n=8;break;case 11:e.n=13;break;case 12:e.p=12,_=e.v,d=!0,y=_;case 13:if(e.p=13,e.p=14,!h||null==m.return){e.n=15;break}return e.n=15,m.return();case 15:if(e.p=15,!d){e.n=16;break}throw y;case 16:return e.f(15);case 17:return e.f(13);case 18:f=Buffer.concat(p).toString("utf8"),e.n=20;break;case 19:e.p=19,e.v;case 20:throw g=f?this._extractErrorMessage(f):"SSE request failed with status ".concat(l.status),this.forwardingHost&&(400===l.status?g+="; streaming through node forwarding (forwardingHost=".concat(this.forwardingHost,") is relayed by")+" the agent REST listener (default port 6060): point the client at it, not at the engine listener":404!==l.status&&405!==l.status||(g+="; a forwarded stream needs X-Target-Host to name the target without its TCP port"+" (forwardingHost=".concat(this.forwardingHost,"): use a bare host or the target's agent REST port (6060)"))),new Zr(g,l.status,f||null);case 21:return e.a(2,l)}},e,this,[[14,,15,17],[7,12,13,18],[6,19],[2,4]])})),function(t,n){return e.apply(this,arguments)})},{key:"_extractErrorMessage",value:function(e){if(!e)return"Unknown error";if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))return this._extractErrorMessage(e.toString("utf8"));if(e instanceof ArrayBuffer)try{var t=new TextDecoder("utf-8").decode(e);return t?this._extractJsonErrorText(t):"Unknown error"}catch(e){return"Binary response error (could not decode)"}return"string"==typeof e?this._extractJsonErrorText(e):"object"===vr(e)?e.message||e.error||JSON.stringify(e):String(e)}},{key:"_extractJsonErrorText",value:function(e){try{var t=JSON.parse(e);return t&&"object"===vr(t)?t.message||t.error||e:"string"==typeof t?t:e}catch(t){return e}}},{key:"onError",value:function(e){return e instanceof Zr?e:new Zr(e.message||"Unknown error")}}]);var e,t,r,o,i,s,a,u,c,l,f,p,h,d,y,m,b,v,g,w,_,E,O,S,T,R,k,P,A,j,C,N,U,x,D,L,B,F,I,H,q,M,z,X,W}(),Do=Cr(function e(t,n,r,o){Ur(this,e),this.statusCode=Number(t),this.output=String(n),this.outPosition=null!==r?Number(r):null,this.exitCode=null!==o?Number(o):null}),Lo=function(){return Cr(function e(t,n,r){Ur(this,e),this.appName=n,this.procUid=r,this._client=t,this._forwardingHost=t.forwardingHost},[{key:"withForwardingHost",value:(t=Rr(wr().m(function e(t){var n;return wr().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=this._client.forwardingHost,this._client.forwardingHost=this._forwardingHost,e.p=1,e.n=2,t();case 2:return e.a(2,e.v);case 3:return e.p=3,this._client.forwardingHost=n,e.f(3);case 4:return e.a(2)}},e,this,[[1,,3,4]])})),function(e){return t.apply(this,arguments)})},{key:"wait",value:(e=Rr(wr().m(function e(){var t,n,r=this,o=arguments;return wr().w(function(e){for(;;)if(0===e.n)return t=o.length>0&&void 0!==o[0]?o[0]:oo,n=o.length>1&&void 0!==o[1]?o[1]:0,e.a(2,this.withForwardingHost(function(){return r._client.waitForAsyncRun(r,t,n)}))},e,this)})),function(){return e.apply(this,arguments)})}]);var e,t}();const Bo=xo;export{xo as AppMeshClient,Zr as AppMeshError,no as AppMeshRequestError,ro as AppMeshTimeoutError,Do as AppOutput,eo as AppRemovedError,Lo as AppRun,$r as CONSTANTS,So as DEFAULT_CA_FILE,Wn as RefreshTokenProvider,fr as RequestSigner,Ao as SseEnd,Ln as StaticAccessTokenProvider,to as TransportDisconnectedError,mo as _resolveGid,Eo as _resolveGroupName,ho as _resolveUid,wo as _resolveUserName,Bo as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "appmesh",
3
- "version": "3.1.23",
3
+ "version": "3.2.0",
4
4
  "description": "JavaScript SDK for App Mesh (https://github.com/laoshanxi/app-mesh)",
5
5
  "main": "./src/appmesh.js",
6
6
  "module": "./dist/appmesh.esm.js",
package/src/appmesh.js CHANGED
@@ -34,7 +34,6 @@ const CONSTANTS = Object.freeze({
34
34
  HTTP_HEADER_KEY_X_APP_NAME: "X-App-Name",
35
35
  HTTP_HEADER_KEY_X_INPUT_CLOSE: "X-Input-Close",
36
36
  HTTP_HEADER_KEY_X_SUBSCRIPTION_ID: "X-Subscription-Id",
37
- HTTP_HEADER_KEY_X_APPMESH_PROCESS_KEY: "X-AppMesh-Process-Key",
38
37
  });
39
38
 
40
39
  // Environment detection
@@ -495,7 +494,7 @@ class SseEnd {
495
494
  * @param {Object} [fields] - Fields carried by the terminal `end` frame
496
495
  * @param {number|null} [fields.exitCode] - Process exit code when reason is 'exit'
497
496
  * @param {number|null} [fields.position] - Output streams: final stdout byte cursor
498
- * @param {number|null} [fields.status] - Task streams: HTTP status carried by an error end frame
497
+ * @param {number|null} [fields.httpStatus] - Task streams: HTTP status carried by an error end frame
499
498
  * @param {string|null} [fields.message] - Task streams: error message
500
499
  * @param {string|null} [fields.result] - Task streams: the final result payload
501
500
  */
@@ -506,8 +505,8 @@ class SseEnd {
506
505
  this.exitCode = fields.exitCode ?? null;
507
506
  /** @type {number|null} Output streams: final stdout byte cursor */
508
507
  this.position = fields.position ?? null;
509
- /** @type {number|null} Task streams: HTTP status carried by an error end frame */
510
- this.status = fields.status ?? null;
508
+ /** @type {number|null} Task streams: HTTP status carried by an error end frame (wire field ``status``) */
509
+ this.httpStatus = fields.httpStatus ?? null;
511
510
  /** @type {string|null} Task streams: error message */
512
511
  this.message = fields.message ?? null;
513
512
  /** @type {string|null} Task streams: the final result payload (the same string runTask would return) */
@@ -569,7 +568,7 @@ function _endFromPayload(payload, extra = {}) {
569
568
  return new SseEnd(String(payload.reason ?? 'closed'), {
570
569
  exitCode: payload.exit_code,
571
570
  position: payload.position,
572
- status: payload.status,
571
+ httpStatus: payload.status,
573
572
  message: payload.message,
574
573
  ...extra
575
574
  });
@@ -585,7 +584,7 @@ function _endFromPayload(payload, extra = {}) {
585
584
  */
586
585
  function _raiseOnErrorEnd(end) {
587
586
  if (end.reason === 'error') {
588
- throw new AppMeshRequestError(end.message || 'stream failed with an error', end.status ?? null);
587
+ throw new AppMeshRequestError(end.message || 'stream failed with an error', end.httpStatus ?? null);
589
588
  }
590
589
  if (end.reason === 'timeout') {
591
590
  throw new AppMeshTimeoutError(end.message || 'stream timed out');
@@ -709,11 +708,6 @@ class AppMeshClient {
709
708
  this.setTokenProvider(new StaticAccessTokenProvider(token));
710
709
  }
711
710
 
712
- /** Source-compatible alias for setBearerToken(). */
713
- setToken(token) {
714
- this.setBearerToken(token);
715
- }
716
-
717
711
  /** Remove the locally attached bearer without contacting Engine or the authentication service. */
718
712
  clearBearerToken() {
719
713
  const provider = this._tokenProvider;
@@ -1028,17 +1022,17 @@ class AppMeshClient {
1028
1022
  * @param {number} [stdout_position=0] - Output cursor; use the previous `AppOutput.outPosition`
1029
1023
  * value to continue reading
1030
1024
  * @param {number} [stdout_index=0] - History slot; `0` targets the current process
1031
- * @param {number} [stdout_maxsize=10240] - Max output size
1025
+ * @param {number} [maxSize=10240] - Max output size in bytes (wire query ``stdout_maxsize``)
1032
1026
  * @param {string} [process_uuid=""] - Process UUID
1033
1027
  * @param {number} [timeout=0] - Server long-poll timeout in seconds
1034
1028
  * @returns {Promise<AppOutput>} Output body, next cursor, and exit code when available
1035
1029
  */
1036
- async getAppOutput(app_name, stdout_position = 0, stdout_index = 0, stdout_maxsize = 10240,
1030
+ async getAppOutput(app_name, stdout_position = 0, stdout_index = 0, maxSize = 10240,
1037
1031
  process_uuid = "", timeout = 0) {
1038
1032
  const params = {
1039
1033
  stdout_position: stdout_position.toString(),
1040
1034
  stdout_index: stdout_index.toString(),
1041
- stdout_maxsize: stdout_maxsize.toString(),
1035
+ stdout_maxsize: maxSize.toString(),
1042
1036
  process_uuid: process_uuid,
1043
1037
  timeout: parseDuration(timeout).toString()
1044
1038
  };
@@ -1236,15 +1230,15 @@ class AppMeshClient {
1236
1230
  /**
1237
1231
  * Send task to running application
1238
1232
  * @param {string} appName - App name
1239
- * @param {string} data - Task data
1233
+ * @param {string} payload - Payload to deliver to the application
1240
1234
  * @param {number} [timeout=300] - Timeout in seconds
1241
1235
  * @returns {Promise<string>} Response from app
1242
1236
  */
1243
- async runTask(appName, data, timeout = 300) {
1237
+ async runTask(appName, payload, timeout = 300) {
1244
1238
  if (timeout <= 0) {
1245
1239
  timeout = 300;
1246
1240
  }
1247
- const response = await this._request("post", `/appmesh/apps/${appName}/task`, data, {
1241
+ const response = await this._request("post", `/appmesh/apps/${appName}/task`, payload, {
1248
1242
  params: { timeout: timeout.toString() }
1249
1243
  });
1250
1244
  return response.data;
@@ -1318,7 +1312,7 @@ class AppMeshClient {
1318
1312
  * pushes partial results (`worker.sendTaskPartial`) before its final reply, in order.
1319
1313
  *
1320
1314
  * @param {string} appName - Name of the target application
1321
- * @param {string} data - Payload to deliver to the application (same contract as runTask)
1315
+ * @param {string} payload - Payload to deliver to the application (same contract as runTask)
1322
1316
  * @param {Object} [opts={}] - Stream options
1323
1317
  * @param {number} [opts.timeout=300] - Maximum seconds for the whole call; the stream ends
1324
1318
  * with `SseEnd(reason='timeout')` (raised as AppMeshTimeoutError) when exceeded
@@ -1327,10 +1321,10 @@ class AppMeshClient {
1327
1321
  * @throws {AppMeshTimeoutError} The task did not finish within `timeout`
1328
1322
  * @throws {AppMeshRequestError} The stream ended with an error
1329
1323
  */
1330
- async *runTaskStream(appName, data, opts = {}) {
1324
+ async *runTaskStream(appName, payload, opts = {}) {
1331
1325
  const { timeout = 300 } = opts;
1332
1326
  const params = timeout && timeout > 0 ? { timeout: String(timeout) } : {};
1333
- const response = await this._sseRequest("post", `/appmesh/apps/${appName}/task/stream`, { params, body: data });
1327
+ const response = await this._sseRequest("post", `/appmesh/apps/${appName}/task/stream`, { params, body: payload });
1334
1328
  let end = null;
1335
1329
  let finalResult = null;
1336
1330
  try {
@@ -1370,7 +1364,7 @@ class AppMeshClient {
1370
1364
  * {@link SseEnd} (`exitCode` on a natural exit). The temporary app is always deleted on exit.
1371
1365
  * @throws {AppMeshRequestError} The stream ended with an error
1372
1366
  */
1373
- async *streamRun(app, maxTime = CONSTANTS.DEFAULT_RUN_APP_TIMEOUT_SECONDS,
1367
+ async *runAppStream(app, maxTime = CONSTANTS.DEFAULT_RUN_APP_TIMEOUT_SECONDS,
1374
1368
  lifecycle = CONSTANTS.DEFAULT_RUN_APP_LIFECYCLE_SECONDS) {
1375
1369
  const appConfig = typeof app === "string" ? { command: app, shell: true } : app;
1376
1370
  const run = await this.runAppAsync(appConfig, maxTime, lifecycle);
@@ -1625,12 +1619,12 @@ class AppMeshClient {
1625
1619
  }
1626
1620
 
1627
1621
  /**
1628
- * Add label to server
1622
+ * Create or update a label
1629
1623
  * @param {string} labelName - Label name
1630
1624
  * @param {string} labelValue - Label value
1631
1625
  * @returns {Promise<boolean>} true on success; failures throw AppMeshError
1632
1626
  */
1633
- async addLabel(labelName, labelValue) {
1627
+ async updateLabel(labelName, labelValue) {
1634
1628
  await this._request("put", `/appmesh/labels/${labelName}`, null, { params: { value: labelValue } });
1635
1629
  return true;
1636
1630
  }
@@ -1674,11 +1668,6 @@ class AppMeshClient {
1674
1668
  return true;
1675
1669
  }
1676
1670
 
1677
- /** Safe compatibility alias returning a Principal, not an IdP user. */
1678
- async getCurrentUser() {
1679
- return this.getCurrentPrincipal();
1680
- }
1681
-
1682
1671
  /**
1683
1672
  * Get available permissions
1684
1673
  * @returns {Object[]} Permission list
@@ -1692,16 +1681,11 @@ class AppMeshClient {
1692
1681
  * Get effective permissions for the current verified principal.
1693
1682
  * @param {Object} [options] - Request options forwarded to the transport (e.g. { config: { timeout } })
1694
1683
  */
1695
- async getPrincipalPermissions(options = {}) {
1684
+ async getEffectivePermissions(options = {}) {
1696
1685
  const response = await this._request("get", "/appmesh/principals/self/permissions", null, options);
1697
1686
  return response.data;
1698
1687
  }
1699
1688
 
1700
- /** Safe compatibility alias for getPrincipalPermissions(). */
1701
- async getUserPermissions(options = {}) {
1702
- return this.getPrincipalPermissions(options);
1703
- }
1704
-
1705
1689
  /**
1706
1690
  * Get all roles and permissions
1707
1691
  * @returns {Object[]} Role array
@@ -549,7 +549,7 @@ class AppMeshClientTCP extends AppMeshClient {
549
549
  * (null=default CA, object=custom ca/cert/key, false=insecure).
550
550
  * @param {Array<string, number>|{host: string, port: number}} [tcpAddress=['127.0.0.1', 6062]] - TCP server address
551
551
  * @param {number} [restPort=6063] - REST port of the same daemon for the streaming side channel
552
- * (followOutput / runTaskStream / streamRun) for local streams; also honored as a `restPort` key on the
552
+ * (followOutput / runTaskStream / runAppStream) for local streams; also honored as a `restPort` key on the
553
553
  * `{host, port}` address object
554
554
  * @param {number} [agentPort=6060] - Agent REST port on the same host for the streaming side channel when
555
555
  * `forwardingHost` is set (the engine listener does not stream through node forwarding, the agent relays it);
package/src/worker.js CHANGED
@@ -6,7 +6,10 @@ if (typeof window !== 'undefined' && typeof window.document !== 'undefined') {
6
6
  throw new Error('AppMeshWorker is only available in Node.js environment. Use AppMeshClient for browser applications.')
7
7
  }
8
8
 
9
- import AppMeshClient, { AppMeshError, CONSTANTS } from './appmesh.js'
9
+ import AppMeshClient, { AppMeshError } from './appmesh.js'
10
+
11
+ // Wire header the daemon stamps on worker tasks (X-AppMesh-Process-Key); module-private.
12
+ const _HTTP_HEADER_KEY_X_APPMESH_PROCESS_KEY = 'X-AppMesh-Process-Key'
10
13
 
11
14
  /**
12
15
  * Error thrown when the daemon reports HTTP 412: this process key was superseded
@@ -189,7 +192,7 @@ class AppMeshWorker {
189
192
  const attemptStart = Date.now()
190
193
  try {
191
194
  const response = await this._client.request('get', path, null, {
192
- headers: { [CONSTANTS.HTTP_HEADER_KEY_X_APPMESH_PROCESS_KEY]: processKey }
195
+ headers: { [_HTTP_HEADER_KEY_X_APPMESH_PROCESS_KEY]: processKey }
193
196
  })
194
197
 
195
198
  if (response.status === 200) {
@@ -255,7 +258,7 @@ class AppMeshWorker {
255
258
  let response
256
259
  try {
257
260
  response = await this._client.request('put', path, result, {
258
- headers: { [CONSTANTS.HTTP_HEADER_KEY_X_APPMESH_PROCESS_KEY]: processKey }
261
+ headers: { [_HTTP_HEADER_KEY_X_APPMESH_PROCESS_KEY]: processKey }
259
262
  })
260
263
  } catch (error) {
261
264
  // request() throws AppMeshError on non-200
@@ -285,7 +288,7 @@ class AppMeshWorker {
285
288
  let response
286
289
  try {
287
290
  response = await this._client.request('post', path, partial, {
288
- headers: { [CONSTANTS.HTTP_HEADER_KEY_X_APPMESH_PROCESS_KEY]: processKey }
291
+ headers: { [_HTTP_HEADER_KEY_X_APPMESH_PROCESS_KEY]: processKey }
289
292
  })
290
293
  } catch (error) {
291
294
  // request() throws AppMeshError on non-200