deepai
Version:
[](https://www.npmjs.org/package/deepai) [](https://github.com/deepai-org/deepai-js-cl
2 lines • 217 kB
JavaScript
/*! For license information please see deepai.min.node.js.LICENSE.txt */
!function(e,a){"object"==typeof exports&&"object"==typeof module?module.exports=a():"function"==typeof define&&define.amd?define([],a):"object"==typeof exports?exports.deepai=a():e.deepai=a()}(this,(function(){return(()=>{var e={9118:(e,a,i)=>{e.exports={parallel:i(9162),serial:i(1357),serialOrdered:i(9087)}},7651:e=>{function a(e){"function"==typeof this.jobs[e]&&this.jobs[e]()}e.exports=function(e){Object.keys(e.jobs).forEach(a.bind(e)),e.jobs={}}},5912:(e,a,i)=>{var n=i(9265);e.exports=function(e){var a=!1;return n((function(){a=!0})),function(i,o){a?e(i,o):n((function(){e(i,o)}))}}},9265:e=>{e.exports=function(e){var a="function"==typeof setImmediate?setImmediate:"object"==typeof process&&"function"==typeof process.nextTick?process.nextTick:null;a?a(e):setTimeout(e,0)}},7594:(e,a,i)=>{var n=i(5912),o=i(7651);e.exports=function(e,a,i,s){var t=i.keyedList?i.keyedList[i.index]:i.index;i.jobs[t]=function(e,a,i,o){return 2==e.length?e(i,n(o)):e(i,a,n(o))}(a,t,e[t],(function(e,a){t in i.jobs&&(delete i.jobs[t],e?o(i):i.results[t]=a,s(e,i.results))}))}},4528:e=>{e.exports=function(e,a){var i=!Array.isArray(e),n={index:0,keyedList:i||a?Object.keys(e):null,jobs:{},results:i?{}:[],size:i?Object.keys(e).length:e.length};return a&&n.keyedList.sort(i?a:function(i,n){return a(e[i],e[n])}),n}},5353:(e,a,i)=>{var n=i(7651),o=i(5912);e.exports=function(e){Object.keys(this.jobs).length&&(this.index=this.size,n(this),o(e)(null,this.results))}},9162:(e,a,i)=>{var n=i(7594),o=i(4528),s=i(5353);e.exports=function(e,a,i){for(var t=o(e);t.index<(t.keyedList||e).length;)n(e,a,t,(function(e,a){e?i(e,a):0!==Object.keys(t.jobs).length||i(null,t.results)})),t.index++;return s.bind(t,i)}},1357:(e,a,i)=>{var n=i(9087);e.exports=function(e,a,i){return n(e,a,null,i)}},9087:(e,a,i)=>{var n=i(7594),o=i(4528),s=i(5353);function t(e,a){return e<a?-1:e>a?1:0}e.exports=function(e,a,i,t){var r=o(e,i);return n(e,a,r,(function i(o,s){o?t(o,s):(r.index++,r.index<(r.keyedList||e).length?n(e,a,r,i):t(null,r.results))})),s.bind(r,t)},e.exports.ascending=t,e.exports.descending=function(e,a){return-1*t(e,a)}},9669:(e,a,i)=>{e.exports=i(1609)},7970:(e,a,i)=>{"use strict";var n=i(4867),o=i(6026),s=i(4097),t=i(5327),r=i(3685),c=i(5687),p=i(938).http,l=i(938).https,u=i(7310),m=i(9796),d=i(7288).version,x=i(5061),f=i(481),v=i(5655),h=i(5263),b=/https:?/;function g(e,a,i){if(e.hostname=a.host,e.host=a.host,e.port=a.port,e.path=i,a.auth){var n=Buffer.from(a.auth.username+":"+a.auth.password,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+n}e.beforeRedirect=function(e){e.headers.host=e.host,g(e,a,e.href)}}e.exports=function(e){return new Promise((function(a,i){var y;function w(){e.cancelToken&&e.cancelToken.unsubscribe(y),e.signal&&e.signal.removeEventListener("abort",y)}var k=function(e){w(),a(e)},j=!1,_=function(e){w(),j=!0,i(e)},E=e.data,C=e.headers,z={};if(Object.keys(C).forEach((function(e){z[e.toLowerCase()]=e})),"user-agent"in z?C[z["user-agent"]]||delete C[z["user-agent"]]:C["User-Agent"]="axios/"+d,E&&!n.isStream(E)){if(Buffer.isBuffer(E));else if(n.isArrayBuffer(E))E=Buffer.from(new Uint8Array(E));else{if(!n.isString(E))return _(x("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",e));E=Buffer.from(E,"utf-8")}if(e.maxBodyLength>-1&&E.length>e.maxBodyLength)return _(x("Request body larger than maxBodyLength limit",e));z["content-length"]||(C["Content-Length"]=E.length)}var S=void 0;e.auth&&(S=(e.auth.username||"")+":"+(e.auth.password||""));var O=s(e.baseURL,e.url),T=u.parse(O),R=T.protocol||"http:";if(!S&&T.auth){var q=T.auth.split(":");S=(q[0]||"")+":"+(q[1]||"")}S&&z.authorization&&delete C[z.authorization];var L=b.test(R),F=L?e.httpsAgent:e.httpAgent,N={path:t(T.path,e.params,e.paramsSerializer).replace(/^\?/,""),method:e.method.toUpperCase(),headers:C,agent:F,agents:{http:e.httpAgent,https:e.httpsAgent},auth:S};e.socketPath?N.socketPath=e.socketPath:(N.hostname=T.hostname,N.port=T.port);var A,B=e.proxy;if(!B&&!1!==B){var U=R.slice(0,-1)+"_proxy",P=process.env[U]||process.env[U.toUpperCase()];if(P){var I=u.parse(P),D=process.env.no_proxy||process.env.NO_PROXY,M=!0;if(D&&(M=!D.split(",").map((function(e){return e.trim()})).some((function(e){return!!e&&("*"===e||"."===e[0]&&T.hostname.substr(T.hostname.length-e.length)===e||T.hostname===e)}))),M&&(B={host:I.hostname,port:I.port,protocol:I.protocol},I.auth)){var H=I.auth.split(":");B.auth={username:H[0],password:H[1]}}}}B&&(N.headers.host=T.hostname+(T.port?":"+T.port:""),g(N,B,R+"//"+T.hostname+(T.port?":"+T.port:"")+N.path));var J=L&&(!B||b.test(B.protocol));e.transport?A=e.transport:0===e.maxRedirects?A=J?c:r:(e.maxRedirects&&(N.maxRedirects=e.maxRedirects),A=J?l:p),e.maxBodyLength>-1&&(N.maxBodyLength=e.maxBodyLength),e.insecureHTTPParser&&(N.insecureHTTPParser=e.insecureHTTPParser);var G=A.request(N,(function(a){if(!G.aborted){var i=a,s=a.req||G;if(204!==a.statusCode&&"HEAD"!==s.method&&!1!==e.decompress)switch(a.headers["content-encoding"]){case"gzip":case"compress":case"deflate":i=i.pipe(m.createUnzip()),delete a.headers["content-encoding"]}var t={status:a.statusCode,statusText:a.statusMessage,headers:a.headers,config:e,request:s};if("stream"===e.responseType)t.data=i,o(k,_,t);else{var r=[],c=0;i.on("data",(function(a){r.push(a),c+=a.length,e.maxContentLength>-1&&c>e.maxContentLength&&(j=!0,i.destroy(),_(x("maxContentLength size of "+e.maxContentLength+" exceeded",e,null,s)))})),i.on("aborted",(function(){j||(i.destroy(),_(x("error request aborted",e,"ERR_REQUEST_ABORTED",s)))})),i.on("error",(function(a){G.aborted||_(f(a,e,null,s))})),i.on("end",(function(){try{var a=1===r.length?r[0]:Buffer.concat(r);"arraybuffer"!==e.responseType&&(a=a.toString(e.responseEncoding),e.responseEncoding&&"utf8"!==e.responseEncoding||(a=n.stripBOM(a))),t.data=a}catch(a){_(f(a,e,a.code,t.request,t))}o(k,_,t)}))}}}));if(G.on("error",(function(a){G.aborted&&"ERR_FR_TOO_MANY_REDIRECTS"!==a.code||_(f(a,e,null,G))})),G.on("socket",(function(e){e.setKeepAlive(!0,6e4)})),e.timeout){var $=parseInt(e.timeout,10);if(isNaN($))return void _(x("error trying to parse `config.timeout` to int",e,"ERR_PARSE_TIMEOUT",G));G.setTimeout($,(function(){G.abort();var a=e.transitional||v.transitional;_(x("timeout of "+$+"ms exceeded",e,a.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",G))}))}(e.cancelToken||e.signal)&&(y=function(e){G.aborted||(G.abort(),_(!e||e&&e.type?new h("canceled"):e))},e.cancelToken&&e.cancelToken.subscribe(y),e.signal&&(e.signal.aborted?y():e.signal.addEventListener("abort",y))),n.isStream(E)?E.on("error",(function(a){_(f(a,e,null,G))})).pipe(G):G.end(E)}))}},5448:(e,a,i)=>{"use strict";var n=i(4867),o=i(6026),s=i(4372),t=i(5327),r=i(4097),c=i(4109),p=i(7985),l=i(5061),u=i(5655),m=i(5263);e.exports=function(e){return new Promise((function(a,i){var d,x=e.data,f=e.headers,v=e.responseType;function h(){e.cancelToken&&e.cancelToken.unsubscribe(d),e.signal&&e.signal.removeEventListener("abort",d)}n.isFormData(x)&&delete f["Content-Type"];var b=new XMLHttpRequest;if(e.auth){var g=e.auth.username||"",y=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";f.Authorization="Basic "+btoa(g+":"+y)}var w=r(e.baseURL,e.url);function k(){if(b){var n="getAllResponseHeaders"in b?c(b.getAllResponseHeaders()):null,s={data:v&&"text"!==v&&"json"!==v?b.response:b.responseText,status:b.status,statusText:b.statusText,headers:n,config:e,request:b};o((function(e){a(e),h()}),(function(e){i(e),h()}),s),b=null}}if(b.open(e.method.toUpperCase(),t(w,e.params,e.paramsSerializer),!0),b.timeout=e.timeout,"onloadend"in b?b.onloadend=k:b.onreadystatechange=function(){b&&4===b.readyState&&(0!==b.status||b.responseURL&&0===b.responseURL.indexOf("file:"))&&setTimeout(k)},b.onabort=function(){b&&(i(l("Request aborted",e,"ECONNABORTED",b)),b=null)},b.onerror=function(){i(l("Network Error",e,null,b)),b=null},b.ontimeout=function(){var a=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",n=e.transitional||u.transitional;e.timeoutErrorMessage&&(a=e.timeoutErrorMessage),i(l(a,e,n.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",b)),b=null},n.isStandardBrowserEnv()){var j=(e.withCredentials||p(w))&&e.xsrfCookieName?s.read(e.xsrfCookieName):void 0;j&&(f[e.xsrfHeaderName]=j)}"setRequestHeader"in b&&n.forEach(f,(function(e,a){void 0===x&&"content-type"===a.toLowerCase()?delete f[a]:b.setRequestHeader(a,e)})),n.isUndefined(e.withCredentials)||(b.withCredentials=!!e.withCredentials),v&&"json"!==v&&(b.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&b.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&b.upload&&b.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(d=function(e){b&&(i(!e||e&&e.type?new m("canceled"):e),b.abort(),b=null)},e.cancelToken&&e.cancelToken.subscribe(d),e.signal&&(e.signal.aborted?d():e.signal.addEventListener("abort",d))),x||(x=null),b.send(x)}))}},1609:(e,a,i)=>{"use strict";var n=i(4867),o=i(1849),s=i(321),t=i(7185),r=function e(a){var i=new s(a),r=o(s.prototype.request,i);return n.extend(r,s.prototype,i),n.extend(r,i),r.create=function(i){return e(t(a,i))},r}(i(5655));r.Axios=s,r.Cancel=i(5263),r.CancelToken=i(4972),r.isCancel=i(6502),r.VERSION=i(7288).version,r.all=function(e){return Promise.all(e)},r.spread=i(8713),r.isAxiosError=i(6268),e.exports=r,e.exports.default=r},5263:e=>{"use strict";function a(e){this.message=e}a.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},a.prototype.__CANCEL__=!0,e.exports=a},4972:(e,a,i)=>{"use strict";var n=i(5263);function o(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var a;this.promise=new Promise((function(e){a=e}));var i=this;this.promise.then((function(e){if(i._listeners){var a,n=i._listeners.length;for(a=0;a<n;a++)i._listeners[a](e);i._listeners=null}})),this.promise.then=function(e){var a,n=new Promise((function(e){i.subscribe(e),a=e})).then(e);return n.cancel=function(){i.unsubscribe(a)},n},e((function(e){i.reason||(i.reason=new n(e),a(i.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},o.prototype.unsubscribe=function(e){if(this._listeners){var a=this._listeners.indexOf(e);-1!==a&&this._listeners.splice(a,1)}},o.source=function(){var e;return{token:new o((function(a){e=a})),cancel:e}},e.exports=o},6502:e=>{"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},321:(e,a,i)=>{"use strict";var n=i(4867),o=i(5327),s=i(782),t=i(3572),r=i(7185),c=i(4875),p=c.validators;function l(e){this.defaults=e,this.interceptors={request:new s,response:new s}}l.prototype.request=function(e,a){if("string"==typeof e?(a=a||{}).url=e:a=e||{},!a.url)throw new Error("Provided config url is not valid");(a=r(this.defaults,a)).method?a.method=a.method.toLowerCase():this.defaults.method?a.method=this.defaults.method.toLowerCase():a.method="get";var i=a.transitional;void 0!==i&&c.assertOptions(i,{silentJSONParsing:p.transitional(p.boolean),forcedJSONParsing:p.transitional(p.boolean),clarifyTimeoutError:p.transitional(p.boolean)},!1);var n=[],o=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(a)||(o=o&&e.synchronous,n.unshift(e.fulfilled,e.rejected))}));var s,l=[];if(this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)})),!o){var u=[t,void 0];for(Array.prototype.unshift.apply(u,n),u=u.concat(l),s=Promise.resolve(a);u.length;)s=s.then(u.shift(),u.shift());return s}for(var m=a;n.length;){var d=n.shift(),x=n.shift();try{m=d(m)}catch(e){x(e);break}}try{s=t(m)}catch(e){return Promise.reject(e)}for(;l.length;)s=s.then(l.shift(),l.shift());return s},l.prototype.getUri=function(e){if(!e.url)throw new Error("Provided config url is not valid");return e=r(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){l.prototype[e]=function(a,i){return this.request(r(i||{},{method:e,url:a,data:(i||{}).data}))}})),n.forEach(["post","put","patch"],(function(e){l.prototype[e]=function(a,i,n){return this.request(r(n||{},{method:e,url:a,data:i}))}})),e.exports=l},782:(e,a,i)=>{"use strict";var n=i(4867);function o(){this.handlers=[]}o.prototype.use=function(e,a,i){return this.handlers.push({fulfilled:e,rejected:a,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,(function(a){null!==a&&e(a)}))},e.exports=o},4097:(e,a,i)=>{"use strict";var n=i(1793),o=i(7303);e.exports=function(e,a){return e&&!n(a)?o(e,a):a}},5061:(e,a,i)=>{"use strict";var n=i(481);e.exports=function(e,a,i,o,s){var t=new Error(e);return n(t,a,i,o,s)}},3572:(e,a,i)=>{"use strict";var n=i(4867),o=i(8527),s=i(6502),t=i(5655),r=i(5263);function c(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new r("canceled")}e.exports=function(e){return c(e),e.headers=e.headers||{},e.data=o.call(e,e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(a){delete e.headers[a]})),(e.adapter||t.adapter)(e).then((function(a){return c(e),a.data=o.call(e,a.data,a.headers,e.transformResponse),a}),(function(a){return s(a)||(c(e),a&&a.response&&(a.response.data=o.call(e,a.response.data,a.response.headers,e.transformResponse))),Promise.reject(a)}))}},481:e=>{"use strict";e.exports=function(e,a,i,n,o){return e.config=a,i&&(e.code=i),e.request=n,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},e}},7185:(e,a,i)=>{"use strict";var n=i(4867);e.exports=function(e,a){a=a||{};var i={};function o(e,a){return n.isPlainObject(e)&&n.isPlainObject(a)?n.merge(e,a):n.isPlainObject(a)?n.merge({},a):n.isArray(a)?a.slice():a}function s(i){return n.isUndefined(a[i])?n.isUndefined(e[i])?void 0:o(void 0,e[i]):o(e[i],a[i])}function t(e){if(!n.isUndefined(a[e]))return o(void 0,a[e])}function r(i){return n.isUndefined(a[i])?n.isUndefined(e[i])?void 0:o(void 0,e[i]):o(void 0,a[i])}function c(i){return i in a?o(e[i],a[i]):i in e?o(void 0,e[i]):void 0}var p={url:t,method:t,data:t,baseURL:r,transformRequest:r,transformResponse:r,paramsSerializer:r,timeout:r,timeoutMessage:r,withCredentials:r,adapter:r,responseType:r,xsrfCookieName:r,xsrfHeaderName:r,onUploadProgress:r,onDownloadProgress:r,decompress:r,maxContentLength:r,maxBodyLength:r,transport:r,httpAgent:r,httpsAgent:r,cancelToken:r,socketPath:r,responseEncoding:r,validateStatus:c};return n.forEach(Object.keys(e).concat(Object.keys(a)),(function(e){var a=p[e]||s,o=a(e);n.isUndefined(o)&&a!==c||(i[e]=o)})),i}},6026:(e,a,i)=>{"use strict";var n=i(5061);e.exports=function(e,a,i){var o=i.config.validateStatus;i.status&&o&&!o(i.status)?a(n("Request failed with status code "+i.status,i.config,null,i.request,i)):e(i)}},8527:(e,a,i)=>{"use strict";var n=i(4867),o=i(5655);e.exports=function(e,a,i){var s=this||o;return n.forEach(i,(function(i){e=i.call(s,e,a)})),e}},5655:(e,a,i)=>{"use strict";var n=i(4867),o=i(6016),s=i(481),t={"Content-Type":"application/x-www-form-urlencoded"};function r(e,a){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=a)}var c,p={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:("undefined"!=typeof XMLHttpRequest?c=i(5448):"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)&&(c=i(7970)),c),transformRequest:[function(e,a){return o(a,"Accept"),o(a,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(r(a,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)||a&&"application/json"===a["Content-Type"]?(r(a,"application/json"),function(e,a,i){if(n.isString(e))try{return(0,JSON.parse)(e),n.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var a=this.transitional||p.transitional,i=a&&a.silentJSONParsing,o=a&&a.forcedJSONParsing,t=!i&&"json"===this.responseType;if(t||o&&n.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(t){if("SyntaxError"===e.name)throw s(e,this,"E_JSON_PARSE");throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){p.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){p.headers[e]=n.merge(t)})),e.exports=p},7288:e=>{e.exports={version:"0.25.0"}},1849:e=>{"use strict";e.exports=function(e,a){return function(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];return e.apply(a,i)}}},5327:(e,a,i)=>{"use strict";var n=i(4867);function o(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,a,i){if(!a)return e;var s;if(i)s=i(a);else if(n.isURLSearchParams(a))s=a.toString();else{var t=[];n.forEach(a,(function(e,a){null!=e&&(n.isArray(e)?a+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),t.push(o(a)+"="+o(e))})))})),s=t.join("&")}if(s){var r=e.indexOf("#");-1!==r&&(e=e.slice(0,r)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}},7303:e=>{"use strict";e.exports=function(e,a){return a?e.replace(/\/+$/,"")+"/"+a.replace(/^\/+/,""):e}},4372:(e,a,i)=>{"use strict";var n=i(4867);e.exports=n.isStandardBrowserEnv()?{write:function(e,a,i,o,s,t){var r=[];r.push(e+"="+encodeURIComponent(a)),n.isNumber(i)&&r.push("expires="+new Date(i).toGMTString()),n.isString(o)&&r.push("path="+o),n.isString(s)&&r.push("domain="+s),!0===t&&r.push("secure"),document.cookie=r.join("; ")},read:function(e){var a=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return a?decodeURIComponent(a[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},1793:e=>{"use strict";e.exports=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}},6268:(e,a,i)=>{"use strict";var n=i(4867);e.exports=function(e){return n.isObject(e)&&!0===e.isAxiosError}},7985:(e,a,i)=>{"use strict";var n=i(4867);e.exports=n.isStandardBrowserEnv()?function(){var e,a=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function o(e){var n=e;return a&&(i.setAttribute("href",n),n=i.href),i.setAttribute("href",n),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}return e=o(window.location.href),function(a){var i=n.isString(a)?o(a):a;return i.protocol===e.protocol&&i.host===e.host}}():function(){return!0}},6016:(e,a,i)=>{"use strict";var n=i(4867);e.exports=function(e,a){n.forEach(e,(function(i,n){n!==a&&n.toUpperCase()===a.toUpperCase()&&(e[a]=i,delete e[n])}))}},4109:(e,a,i)=>{"use strict";var n=i(4867),o=["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"];e.exports=function(e){var a,i,s,t={};return e?(n.forEach(e.split("\n"),(function(e){if(s=e.indexOf(":"),a=n.trim(e.substr(0,s)).toLowerCase(),i=n.trim(e.substr(s+1)),a){if(t[a]&&o.indexOf(a)>=0)return;t[a]="set-cookie"===a?(t[a]?t[a]:[]).concat([i]):t[a]?t[a]+", "+i:i}})),t):t}},8713:e=>{"use strict";e.exports=function(e){return function(a){return e.apply(null,a)}}},4875:(e,a,i)=>{"use strict";var n=i(7288).version,o={};["object","boolean","number","function","string","symbol"].forEach((function(e,a){o[e]=function(i){return typeof i===e||"a"+(a<1?"n ":" ")+e}}));var s={};o.transitional=function(e,a,i){function o(e,a){return"[Axios v"+n+"] Transitional option '"+e+"'"+a+(i?". "+i:"")}return function(i,n,t){if(!1===e)throw new Error(o(n," has been removed"+(a?" in "+a:"")));return a&&!s[n]&&(s[n]=!0,console.warn(o(n," has been deprecated since v"+a+" and will be removed in the near future"))),!e||e(i,n,t)}},e.exports={assertOptions:function(e,a,i){if("object"!=typeof e)throw new TypeError("options must be an object");for(var n=Object.keys(e),o=n.length;o-- >0;){var s=n[o],t=a[s];if(t){var r=e[s],c=void 0===r||t(r,s,e);if(!0!==c)throw new TypeError("option "+s+" must be "+c)}else if(!0!==i)throw Error("Unknown option "+s)}},validators:o}},4867:(e,a,i)=>{"use strict";var n=i(1849),o=Object.prototype.toString;function s(e){return Array.isArray(e)}function t(e){return void 0===e}function r(e){return"[object ArrayBuffer]"===o.call(e)}function c(e){return null!==e&&"object"==typeof e}function p(e){if("[object Object]"!==o.call(e))return!1;var a=Object.getPrototypeOf(e);return null===a||a===Object.prototype}function l(e){return"[object Function]"===o.call(e)}function u(e,a){if(null!=e)if("object"!=typeof e&&(e=[e]),s(e))for(var i=0,n=e.length;i<n;i++)a.call(null,e[i],i,e);else for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&a.call(null,e[o],o,e)}e.exports={isArray:s,isArrayBuffer:r,isBuffer:function(e){return null!==e&&!t(e)&&null!==e.constructor&&!t(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"[object FormData]"===o.call(e)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&r(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:c,isPlainObject:p,isUndefined:t,isDate:function(e){return"[object Date]"===o.call(e)},isFile:function(e){return"[object File]"===o.call(e)},isBlob:function(e){return"[object Blob]"===o.call(e)},isFunction:l,isStream:function(e){return c(e)&&l(e.pipe)},isURLSearchParams:function(e){return"[object URLSearchParams]"===o.call(e)},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:u,merge:function e(){var a={};function i(i,n){p(a[n])&&p(i)?a[n]=e(a[n],i):p(i)?a[n]=e({},i):s(i)?a[n]=i.slice():a[n]=i}for(var n=0,o=arguments.length;n<o;n++)u(arguments[n],i);return a},extend:function(e,a,i){return u(a,(function(a,o){e[o]=i&&"function"==typeof a?n(a,i):a})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e}}},2142:(e,a,i)=>{"use strict";e.exports=i(4365)},2297:(e,a,i)=>{"use strict";function n(e,a,i,n,o,s,t){try{var r=e[s](t),c=r.value}catch(e){return void i(e)}r.done?a(c):Promise.resolve(c).then(n,o)}var o,s=i(9669),t=i(4732).baseUrl,r=i(2244),c="undefined"!=typeof window,p=c?window:global;if("undefined"!=typeof window&&window.FormData)o=window.FormData;else try{o=i(6882)}catch(e){console.error("Error requiring form-data:",e)}function l(e){this.axiosInstance=e||s.create({headers:{"client-library":"deepai-js-client"}})}function u(e){return t+"/api/"+e}l.prototype.setApiKey=function(e){this.apiKey=e,this.axiosInstance.defaults.headers.common["api-key"]=e},l.prototype.callStandardApi=function(){var e,a=(e=regeneratorRuntime.mark((function e(a,i){var n,s,t,r,l,m,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=new o,s=0,t=Object.keys(i);case 2:if(!(s<t.length)){e.next=43;break}if(r=t[s],l=i[r]){e.next=7;break}return e.abrupt("continue",40);case 7:if("string"!=typeof l){e.next=11;break}n.append(r,l),e.next=40;break;case 11:if(!(c&&l instanceof p.Element)){e.next=31;break}if("IMG"!==l.tagName){e.next=20;break}if(!l.src){e.next=17;break}n.append(r,l.src),e.next=18;break;case 17:throw new Error("DeepAI error: Image element has no SRC: ".concat(r));case 18:e.next=29;break;case 20:if("INPUT"!==l.tagName||!l.files){e.next=28;break}if(!(l.files.length>0)){e.next=25;break}n.append(r,l.files[0],"file.jpeg"),e.next=26;break;case 25:throw new Error("DeepAI error: File picker has no file picked: ".concat(r));case 26:e.next=29;break;case 28:throw new Error("DeepAI error: DOM Element type for key: ".concat(r));case 29:e.next=40;break;case 31:if(!l.hasOwnProperty("fd")){e.next=35;break}n.append(r,l),e.next=40;break;case 35:if(!p.Buffer||!p.Buffer.isBuffer(l)){e.next=39;break}n.append(r,l,"file.jpeg"),e.next=40;break;case 39:throw new Error("DeepAI error: unknown input type for key: ".concat(r));case 40:s++,e.next=2;break;case 43:return m={withCredentials:!0},void 0!==n.getHeaders&&(m.headers=n.getHeaders()),e.next=47,this.axiosInstance.post(u(a),n,m);case 47:return d=e.sent,e.abrupt("return",d.data);case 49:case"end":return e.stop()}}),e,this)})),function(){var a=this,i=arguments;return new Promise((function(o,s){var t=e.apply(a,i);function r(e){n(t,o,s,r,c,"next",e)}function c(e){n(t,o,s,r,c,"throw",e)}r(void 0)}))});return function(e,i){return a.apply(this,arguments)}}(),l.prototype.renderResultIntoElement=r.renderResultIntoElement,l.prototype.renderAnnotatedResultIntoElement=r.renderAnnotatedResultIntoElement,e.exports=l},4732:e=>{"use strict";e.exports={baseUrl:"https://api.deepai.org"}},2244:(e,a,i)=>{"use strict";function n(e){return n="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},n(e)}function o(e,a,i,n,o,s,t){try{var r=e[s](t),c=r.value}catch(e){return void i(e)}r.done?a(c):Promise.resolve(c).then(n,o)}function s(e){return function(){var a=this,i=arguments;return new Promise((function(n,s){var t=e.apply(a,i);function r(e){o(t,n,s,r,c,"next",e)}function c(e){o(t,n,s,r,c,"throw",e)}r(void 0)}))}}function t(e,a){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,a){if(e){if("string"==typeof e)return r(e,a);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?r(e,a):void 0}}(e))||a&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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 s,t=!0,c=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return t=e.done,e},e:function(e){c=!0,s=e},f:function(){try{t||null==i.return||i.return()}finally{if(c)throw s}}}}function r(e,a){(null==a||a>e.length)&&(a=e.length);for(var i=0,n=new Array(a);i<a;i++)n[i]=e[i];return n}var c=i(4732).baseUrl,p=["rgb(173, 35, 35)","rgb(42, 75, 215)","rgb(87, 87, 87)","rgb(29, 105, 20)","rgb(129, 74, 25)","rgb(129, 38, 192)","rgb(160, 160, 160)","rgb(129, 197, 122)","rgb(157, 175, 255)","rgb(41, 208, 208)","rgb(255, 146, 51)","rgb(199, 183, 0)","rgb(233, 222, 187)","rgb(255, 205, 243)"],l=new RegExp("^([a-z]+://|//)","i"),u=new RegExp("^(data|blob):","i");function m(e){return l.test(e)||u.test(e)?e:c+e}function d(e,a,i){var n,o=[],s=t(e);try{for(s.s();!(n=s.n()).done;){var r=n.value;if(!(r.length<2)){o.push("M");var c,p=!0,l=t(r);try{for(l.s();!(c=l.n()).done;){var u=c.value;if(o.push(u[0]-a+","+(u[1]-i)),isNaN(u[0])||isNaN(u[1]))return console.log("not showing invalid polygon, found NaN"),"";p&&(o.push("L"),p=!1)}}catch(e){l.e(e)}finally{l.f()}o.push("z")}}}catch(e){s.e(e)}finally{s.f()}return o.join(" ")}function x(e){return f.apply(this,arguments)}function f(){return(f=s(regeneratorRuntime.mark((function e(a){var i,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!a.err){e.next=3;break}return console.log("cannot get result page data for error result"),e.abrupt("return",a);case 3:return e.next=5,fetch(c+"/get_standard_api_result_data/"+a.id,{credentials:"include"});case 5:return i=e.sent,e.next=8,i.json();case 8:return i=e.sent,n=i.result_data,e.abrupt("return",{err:a.err,output:a.output,output_url:a.output_url,id:a.id,inputs:n.inputs,visualizer_data:n.visualizer_data,scale_applied:n.scale_applied});case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e,a){if(a.innerHTML="",e.err)return a.innerHTML=err,!1;if(e.output){if(console.log("got json or text output"),"string"==typeof e.output){(r=document.createElement("div")).style.width="100%",r.style.height="100%",r.style.overflow="auto",r.style.display="flex",r.style.alignItems="center",r.style.flexDirection="column",a.appendChild(r),(c=document.createElement("pre")).textContent=e.output,c.style.whiteSpace="pre-wrap",c.style.margin="0px",r.appendChild(c);var i,o=t(e.inputs);try{for(o.s();!(i=o.n()).done;)(x=i.value).is_img&&((f=document.createElement("img")).src=m(x.url),f.style.position="relative",f.style.width="100%",f.style.height="100%",f.style.objectFit="contain",r.appendChild(f))}catch(e){o.e(e)}finally{o.f()}return!0}if("object"===n(e.output)){if(1==e.inputs.length&&e.inputs[0].is_img&&e.visualizer_data){console.log("have visualizer for result JSON");var s=document.createElement("iframe");return s.onload=function(){var a=s.contentDocument.body;a.style.margin="0px",a.style.overflow="hidden";var i=document.createElement("boundingboxcontainer");i.style.position="relative",i.style.opacity="0.001",a.appendChild(i);var n=document.createElement("img");n.src=m(e.inputs[0].url),n.style.position="absolute",i.appendChild(n);var o=function(){console.log("iframe resize"),s.contentDocument.body.style.transform=null;var e=s.contentDocument.body.scrollWidth,a=s.contentDocument.body.scrollHeight,o=n.offsetWidth,t=n.offsetHeight,r=s.offsetWidth,c=s.offsetHeight,p=0,l=0;if(o<e&&t<a){var u=r/o,m=c/t;p=r-o*(d=Math.min(u,m)),l=c-t*d}else{var d;u=r/e,m=c/a,p=r-e*(d=Math.min(u,m)),l=c-a*d}p/=d,l/=d,s.contentDocument.body.style.transformOrigin="top left",s.contentDocument.body.style.transform="scale("+d+")",i.style.setProperty("--scaleapplied",d),i.style.setProperty("--fontscale",100/d+"%"),i.style.left=p/2+"px",i.style.top=l/2+"px",i.style.opacity="1"};s.contentWindow.onresize=o,n.onload=o;var r=function(e,a,i){var n,o=(e=JSON.parse(JSON.stringify(e)))[a.list_key];o.sort((function(e,a){return a.confidence-e.confidence}));for(var s=o.length,r=[],c=0;c<s;c++){var p,l=o[c];if("demographic"==a.label_key)p=l[a.label_key]?l[a.label_key]:l.cultural_appearance+" "+l.gender+", "+l.age_range[0]+"-"+l.age_range[1];else if("people"==a.label_key){var u=[];l["facial-expression-recognition"]&&null!=l["facial-expression-recognition"].emotion&&u.push((n=l["facial-expression-recognition"].emotion).charAt(0).toUpperCase()+n.slice(1)),l["demographic-recognition"]&&null!=l["demographic-recognition"].cultural_appearance&&u.push(l["demographic-recognition"].cultural_appearance+" "+l["demographic-recognition"].gender+", "+l["demographic-recognition"].age_range[0]+"-"+l["demographic-recognition"].age_range[1]),l["celebrity-recognition"]&&null!=l["celebrity-recognition"].name&&"unknown"!=l["celebrity-recognition"].name&&u.push(l["celebrity-recognition"].name.replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))),p=u.length>0?u.join(", "):"Face"}else if("pose"==a.label_key){p="";for(var m=[],d=0,x=[["nose","right_eye"],["nose","left_eye"],["right_eye","right_ear"],["left_eye","left_ear"],["right_shoulder","right_elbow"],["left_shoulder","left_elbow"],["right_elbow","right_hand"],["left_elbow","left_hand"],["right_hip","right_knee"],["left_hip","left_knee"],["right_knee","right_foot"],["left_knee","left_foot"]];d<x.length;d++){var f=x[d],v=l[a.label_key][f[0]],h=l[a.label_key][f[1]];if(v&&h){var b=[v=JSON.parse(JSON.stringify(v)),h=JSON.parse(JSON.stringify(h))];m.push(b)}}l.mask_vertices=m}else if((p=l[a.label_key])&&p.constructor===String);else{var g=Object.keys(p);p=1==g.length?p[g[0]]:JSON.stringify(p)}if(l.bounding_box&&(l.bounding_box[0]*=i,l.bounding_box[1]*=i,l.bounding_box[2]*=i,l.bounding_box[3]*=i),l.mask_vertices){var y,w=t(l.mask_vertices);try{for(w.s();!(y=w.n()).done;){var k,j=t(y.value);try{for(j.s();!(k=j.n()).done;){var _=k.value;_[0]*=i,_[1]*=i}}catch(e){j.e(e)}finally{j.f()}}}catch(e){w.e(e)}finally{w.f()}}r.push({bounding_box:l.bounding_box,mask_vertices:l.mask_vertices,caption:p})}return r}(e.output,e.visualizer_data,e.scale_applied);console.log("processed annotations",r);var c,l=0,u=t(r);try{for(u.s();!(c=u.n()).done;){var x,f,v,h,b=c.value,g=document.createElement("boundingbox");g.style.position="absolute";var y=p[l++%p.length];if(b.mask_vertices){var w,k=null,j=null,_=null,E=null,C=t(b.mask_vertices);try{for(C.s();!(w=C.n()).done;){var z,S=t(w.value);try{for(S.s();!(z=S.n()).done;){var O=z.value,T=O[0],R=O[1];(null===k||T<k)&&(k=T),(null===j||R<j)&&(j=R),(null===_||T>_)&&(_=T),(null===E||R>E)&&(E=R)}}catch(e){S.e(e)}finally{S.f()}}}catch(e){C.e(e)}finally{C.f()}v=_-k,h=E-j,x=k,f=j;var q=document.createElementNS("http://www.w3.org/2000/svg","svg");q.style.position="absolute",q.style.overflow="visible",q.style.width=v+"px",q.style.height=h+"px";var L=document.createElementNS("http://www.w3.org/2000/svg","path");L.setAttributeNS(null,"d",d(b.mask_vertices,x,f)),L.style.fill="none",L.style.stroke=y,L.style.strokeWidth="calc(2px / var(--scaleapplied))",q.appendChild(L),g.appendChild(q),g.style.border="none"}else{if(!b.bounding_box)throw new Exception("Neither mask_vertices or bounding_box is passed, unknown annotation format");x=b.bounding_box[0],f=b.bounding_box[1],v=b.bounding_box[2],h=b.bounding_box[3],g.style.border="calc(2px / var(--scaleapplied)) solid "+y}g.style.left=x+"px",g.style.top=f+"px",g.style.width=v+"px",g.style.height=h+"px",i.appendChild(g);var F=document.createElement("boundingboxlabel");F.textContent=b.caption,F.style.color="white",F.style.fontFamily="arial",F.style.backgroundColor=y,F.style.fontSize="var(--fontscale)",F.style.position="absolute",g.appendChild(F)}}catch(e){u.e(e)}finally{u.f()}},s.src="about:blank",s.style.border="none",s.style.width="100%",s.style.height="100%",a.appendChild(s),!0}var r,c;console.log("no visualizer for result JSON"),(r=document.createElement("div")).style.width="100%",r.style.height="100%",r.style.overflow="auto",r.style.display="flex",r.style.alignItems="center",r.style.flexDirection="column",a.appendChild(r),(c=document.createElement("pre")).style.margin="0px",c.textContent=JSON.stringify(e.output,null,4),r.appendChild(c);var l,u=t(e.inputs);try{for(u.s();!(l=u.n()).done;){var x;(x=l.value).is_img&&((f=document.createElement("img")).src=m(x.url),f.style.width="100%",f.style.height="79%",f.style.objectFit="contain",r.appendChild(f))}}catch(e){u.e(e)}finally{u.f()}return!0}return a.innerHTML="Model returned an unknown data type.",!1}var f;return e.output_url?(console.log("got image output"),(f=document.createElement("img")).src=e.output_url,f.style.position="relative",f.style.width="100%",f.style.height="100%",f.style.objectFit="contain",a.appendChild(f),!0):(a.innerHTML="Model did not return an output or an error.",!1)}function h(){return(h=s(regeneratorRuntime.mark((function e(a,i){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("getting result page data"),e.next=3,x(a);case 3:return n=e.sent,console.log("got result page data"),e.abrupt("return",v(n,i));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}e.exports={renderResultIntoElement:function(e,a){return h.apply(this,arguments)},renderAnnotatedResultIntoElement:v}},4365:(e,a,i)=>{"use strict";var n=new(i(2297));e.exports=n},9779:(e,a,i)=>{var n=i(3837),o=i(2781).Stream,s=i(3463);function t(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2097152,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}e.exports=t,n.inherits(t,o),t.create=function(e){var a=new this;for(var i in e=e||{})a[i]=e[i];return a},t.isStreamLike=function(e){return"function"!=typeof e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Buffer.isBuffer(e)},t.prototype.append=function(e){if(t.isStreamLike(e)){if(!(e instanceof s)){var a=s.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=a}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this},t.prototype.pipe=function(e,a){return o.prototype.pipe.call(this,e,a),this.resume(),e},t.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop)this._pendingNext=!0;else{this._insideLoop=!0;try{do{this._pendingNext=!1,this._realGetNext()}while(this._pendingNext)}finally{this._insideLoop=!1}}},t.prototype._realGetNext=function(){var e=this._streams.shift();void 0!==e?"function"==typeof e?e(function(e){t.isStreamLike(e)&&(e.on("data",this._checkDataSize.bind(this)),this._handleErrors(e)),this._pipeNext(e)}.bind(this)):this._pipeNext(e):this.end()},t.prototype._pipeNext=function(e){if(this._currentStream=e,t.isStreamLike(e))return e.on("end",this._getNext.bind(this)),void e.pipe(this,{end:!1});var a=e;this.write(a),this._getNext()},t.prototype._handleErrors=function(e){var a=this;e.on("error",(function(e){a._emitError(e)}))},t.prototype.write=function(e){this.emit("data",e)},t.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.pause&&this._currentStream.pause(),this.emit("pause"))},t.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&"function"==typeof this._currentStream.resume&&this._currentStream.resume(),this.emit("resume")},t.prototype.end=function(){this._reset(),this.emit("end")},t.prototype.destroy=function(){this._reset(),this.emit("close")},t.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null},t.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}},t.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach((function(a){a.dataSize&&(e.dataSize+=a.dataSize)})),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)},t.prototype._emitError=function(e){this._reset(),this.emit("error",e)}},1227:(e,a,i)=>{a.formatArgs=function(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;a.splice(1,0,i,"color: inherit");let n=0,o=0;a[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))})),a.splice(o,0,i)},a.save=function(e){try{e?a.storage.setItem("debug",e):a.storage.removeItem("debug")}catch(e){}},a.load=function(){let e;try{e=a.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},a.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},a.storage=function(){try{return localStorage}catch(e){}}(),a.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),a.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],a.log=console.debug||console.log||(()=>{}),e.exports=i(2447)(a);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2447:(e,a,i)=>{e.exports=function(e){function a(e){let i,o,s,t=null;function r(...e){if(!r.enabled)return;const n=r,o=Number(new Date),s=o-(i||o);n.diff=s,n.prev=i,n.curr=o,i=o,e[0]=a.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let t=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((i,o)=>{if("%%"===i)return"%";t++;const s=a.formatters[o];if("function"==typeof s){const a=e[t];i=s.call(n,a),e.splice(t,1),t--}return i})),a.formatArgs.call(n,e),(n.log||a.log).apply(n,e)}return r.namespace=e,r.useColors=a.useColors(),r.color=a.selectColor(e),r.extend=n,r.destroy=a.destroy,Object.defineProperty(r,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==t?t:(o!==a.namespaces&&(o=a.namespaces,s=a.enabled(e)),s),set:e=>{t=e}}),"function"==typeof a.init&&a.init(r),r}function n(e,i){const n=a(this.namespace+(void 0===i?":":i)+e);return n.log=this.log,n}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return a.debug=a,a.default=a,a.coerce=function(e){return e instanceof Error?e.stack||e.message:e},a.disable=function(){const e=[...a.names.map(o),...a.skips.map(o).map((e=>"-"+e))].join(",");return a.enable(""),e},a.enable=function(e){let i;a.save(e),a.namespaces=e,a.names=[],a.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(i=0;i<o;i++)n[i]&&("-"===(e=n[i].replace(/\*/g,".*?"))[0]?a.skips.push(new RegExp("^"+e.substr(1)+"$")):a.names.push(new RegExp("^"+e+"$")))},a.enabled=function(e){if("*"===e[e.length-1])return!0;let i,n;for(i=0,n=a.skips.length;i<n;i++)if(a.skips[i].test(e))return!1;for(i=0,n=a.names.length;i<n;i++)if(a.names[i].test(e))return!0;return!1},a.humanize=i(7824),a.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((i=>{a[i]=e[i]})),a.names=[],a.skips=[],a.formatters={},a.selectColor=function(e){let i=0;for(let a=0;a<e.length;a++)i=(i<<5)-i+e.charCodeAt(a),i|=0;return a.colors[Math.abs(i)%a.colors.length]},a.enable(a.load()),a}},5158:(e,a,i)=>{"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?e.exports=i(1227):e.exports=i(39)},39:(e,a,i)=>{const n=i(6224),o=i(3837);a.init=function(e){e.inspectOpts={};const i=Object.keys(a.inspectOpts);for(let n=0;n<i.length;n++)e.inspectOpts[i[n]]=a.inspectOpts[i[n]]},a.log=function(...e){return process.stderr.write(o.format(...e)+"\n")},a.formatArgs=function(i){const{namespace:n,useColors:o}=this;if(o){const a=this.color,o="[3"+(a<8?a:"8;5;"+a),s=` ${o};1m${n} [0m`;i[0]=s+i[0].split("\n").join("\n"+s),i.push(o+"m+"+e.exports.humanize(this.diff)+"[0m")}else i[0]=(a.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+n+" "+i[0]},a.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},a.load=function(){return process.env.DEBUG},a.useColors=function(){return"colors"in a.inspectOpts?Boolean(a.inspectOpts.colors):n.isatty(process.stderr.fd)},a.destroy=o.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),a.colors=[6,2,3,4,5,1];try{const e=i(2130);e&&(e.stderr||e).level>=2&&(a.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}a.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,a)=>{const i=a.substring(6).toLowerCase().replace(/_([a-z])/g,((e,a)=>a.toUpperCase()));let n=process.env[a];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[i]=n,e}),{}),e.exports=i(2447)(a);const{formatters:s}=e.exports;s.o=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},s.O=function(e){return this.inspectOpts.colors=this.useColors,o.inspect(e,this.inspectOpts)}},3463:(e,a,i)=>{var n=i(2781).Stream,o=i(3837);function s(){this.source=null,this.dataSize=0,this.maxDataSize=1048576,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}e.exports=s,o.inherits(s,n),s.create=function(e,a){var i=new this;for(var n in a=a||{})i[n]=a[n];i.source=e;var o=e.emit;return e.emit=function(){return i._handleEmit(arguments),o.apply(e,arguments)},e.on("error",(function(){})),i.pauseStream&&e.pause(),i},Object.defineProperty(s.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}}),s.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)},s.prototype.resume=function(){this._released||this.release(),this.source.resume()},s.prototype.pause=function(){this.source.pause()},s.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]},s.prototype.pipe=function(){var e=n.prototype.pipe.apply(this,arguments);return this.resume(),e},s.prototype._handleEmit=function(e){this._released?this.emit.apply(this,e):("data"===e[0]&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e))},s.prototype._checkIfMaxDataSizeExceeded=function(){if(!(this._maxDataSizeExceeded||this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}},2261:(e,a,i)=>{var n;e.exports=function(){if(!n){try{n=i(5158)("follow-redirects")}catch(e){}"function"!=typeof n&&(n=function(){})}n.apply(null,arguments)}},938:(e,a,i)=>{var n=i(7310),o=n.URL,s=i(3685),t=i(5687),r=i(2781).Writable,c=i(9491),p=i(2261),l=["abort","aborted","connect","error","socket","timeout"],u=Object.create(null);l.forEach((function(e){u[e]=function(a,i,n){this._redirectable.emit(e,a,i,n)}}));var m=w("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),d=w("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),x=w("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),f=w("ERR_STREAM_WRITE_AFTER_END","write after end");function v(e,a){r.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],a&&this.on("response",a);var i=this;this._onNativeResponse=function(e){i._processResponse(e)},this._performRequest()}function h(e){var a={maxRedirects:21,maxBodyLength:10485760},i={};return Object.keys(e).forEach((function(s){var t=s+":",r=i[t]=e[s],l=a[s]=Object.create(r);Object.defineProperties(l,{request:{value:function(e,s,r){if("string"==typeof e){var l=e;try{e=g(new o(l))}catch(a){e=n.parse(l)}}else o&&e instanceof o?e=g(e):(r=s,s=e,e={protocol:t});return"function"==typeof s&&(r=s,s=null),(s=Object.assign({maxRedirects:a.maxRedirects,maxBodyLength:a.maxBodyLength},e,s)).nativeProtocols=i,c.equal(s.protocol,t,"protocol mismatch"),p("options",s),new v(s,r)},configurable:!0,enumerable:!0,writable:!0},get:{value:function(e,a,i){var n=l.request(e,a,i);return n.end(),n},configurable:!0,enumerable:!0,writable:!0}})})),a}function b(){}function g(e){var a={protocol:e.protocol,hostname:e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:e.pathname+e.search,href:e.href};return""!==e.port&&(a.port=Number(e.port)),a}function y(e,a){var i;for(var n in a)e.test(n)&&(i=a[n],delete a[n]);return null==i?void 0:String(i).trim()}function w(e,a){function i(e){Error.captureStackTrace(this,this.constructor),e?(this.message=a+": "+e.message,this.cause=e):this.message=a}return i.prototype=new Error,i.prototype.constructor=i,i.prototype.name="Error ["+e+"]",i.prototype.code=e,i}f