denotify-client 1.0.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 +1 -0
- package/dist/alertbuilder.js +44 -0
- package/dist/denotifyclient.js +108 -0
- package/dist/examples/aave-healthcheck.js +50 -0
- package/dist/examples/delete-alert.js +13 -0
- package/dist/functionbuilder.js +30 -0
- package/dist/index.js +4215 -0
- package/dist/index.min.js +1 -0
- package/dist/index.mjs +4201 -0
- package/dist/notifications/notification.js +8 -0
- package/dist/notifications/notify_discord_webhook.js +10 -0
- package/dist/triggers/handler_function_call.js +1 -0
- package/dist/triggers/handler_function_call_v2.js +12 -0
- package/dist/triggers/handler_onchain_event.js +1 -0
- package/dist/triggers/trigger.js +10 -0
- package/dist/types/types.js +1 -0
- package/dist/util/filter.js +131 -0
- package/license +9 -0
- package/package.json +64 -0
- package/types/alertbuilder.d.ts +17 -0
- package/types/client.d.ts +14 -0
- package/types/denotifyclient.d.ts +27 -0
- package/types/examples/aave-healthcheck.d.ts +1 -0
- package/types/examples/delete-alert.d.ts +1 -0
- package/types/functionbuilder.d.ts +16 -0
- package/types/index.d.ts +2 -0
- package/types/notifications/notification.d.ts +15 -0
- package/types/notifications/notify_discord_webhook.d.ts +32 -0
- package/types/temp.d.ts +1 -0
- package/types/triggers/handler_function_call.d.ts +39 -0
- package/types/triggers/handler_function_call_v2.d.ts +65 -0
- package/types/triggers/handler_onchain_event.d.ts +31 -0
- package/types/triggers/trigger.d.ts +20 -0
- package/types/types/notification.d.ts +7 -0
- package/types/types/trigger.d.ts +29 -0
- package/types/types/types.d.ts +20 -0
- package/types/util/filter.d.ts +35 -0
@@ -0,0 +1 @@
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@supabase/supabase-js"),require("form-data"),require("url"),require("proxy-from-env"),require("http"),require("https"),require("util"),require("follow-redirects"),require("zlib"),require("stream"),require("events")):"function"==typeof define&&define.amd?define(["exports","@supabase/supabase-js","form-data","url","proxy-from-env","http","https","util","follow-redirects","zlib","stream","events"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["denotify-client"]={},e.supabaseJs,e.FormData$1,e.url,e.proxyFromEnv,e.http,e.https,e.util,e.followRedirects,e.zlib,e.stream,e.EventEmitter)}(this,(function(e,t,n,r,o,s,i,a,c,u,l,f){"use strict";function d(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var h=d(n),p=d(r),m=d(s),y=d(i),g=d(a),b=d(c),w=d(u),R=d(l),E=d(f);function O(e,t){return function(){return e.apply(t,arguments)}}const{toString:S}=Object.prototype,{getPrototypeOf:T}=Object,A=(x=Object.create(null),e=>{const t=S.call(e);return x[t]||(x[t]=t.slice(8,-1).toLowerCase())});var x;const C=e=>(e=e.toLowerCase(),t=>A(t)===e),_=e=>t=>typeof t===e,{isArray:L}=Array,v=_("undefined");const N=C("ArrayBuffer");const P=_("string"),B=_("function"),j=_("number"),k=e=>null!==e&&"object"==typeof e,U=e=>{if("object"!==A(e))return!1;const t=T(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},D=C("Date"),F=C("File"),I=C("Blob"),z=C("FileList"),q=C("URLSearchParams");function M(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),L(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const o=n?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(r=0;r<s;r++)i=o[r],t.call(null,e[i],i,e)}}function H(e,t){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}const J="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,$=e=>!v(e)&&e!==J;const V=(W="undefined"!=typeof Uint8Array&&T(Uint8Array),e=>W&&e instanceof W);var W;const K=C("HTMLFormElement"),G=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Z=C("RegExp"),Q=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};M(n,((n,o)=>{!1!==t(n,o,e)&&(r[o]=n)})),Object.defineProperties(e,r)},X="abcdefghijklmnopqrstuvwxyz",Y="0123456789",ee={DIGIT:Y,ALPHA:X,ALPHA_DIGIT:X+X.toUpperCase()+Y};var te={isArray:L,isArrayBuffer:N,isBuffer:function(e){return null!==e&&!v(e)&&null!==e.constructor&&!v(e.constructor)&&B(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{const t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||S.call(e)===t||B(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&N(e.buffer),t},isString:P,isNumber:j,isBoolean:e=>!0===e||!1===e,isObject:k,isPlainObject:U,isUndefined:v,isDate:D,isFile:F,isBlob:I,isRegExp:Z,isFunction:B,isStream:e=>k(e)&&B(e.pipe),isURLSearchParams:q,isTypedArray:V,isFileList:z,forEach:M,merge:function e(){const{caseless:t}=$(this)&&this||{},n={},r=(r,o)=>{const s=t&&H(n,o)||o;U(n[s])&&U(r)?n[s]=e(n[s],r):U(r)?n[s]=e({},r):L(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&M(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(M(t,((t,r)=>{n&&B(t)?e[r]=O(t,n):e[r]=t}),{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),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],r&&!r(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==n&&T(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:A,kindOfTest:C,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(L(e))return e;let t=e.length;if(!j(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).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:K,hasOwnProperty:G,hasOwnProp:G,reduceDescriptors:Q,freezeMethods:e=>{Q(e,((t,n)=>{if(B(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];B(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 L(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)=>(e=+e,Number.isFinite(e)?e:t),findKey:H,global:J,isContextDefined:$,ALPHABET:ee,generateString:(e=16,t=ee.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&B(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(k(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const o=L(e)?[]:{};return M(e,((e,t)=>{const s=n(e,r+1);!v(s)&&(o[t]=s)})),t[r]=void 0,o}}return e};return n(e,0)}};function ne(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o)}te.inherits(ne,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:te.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const re=ne.prototype,oe={};function se(e){return te.isPlainObject(e)||te.isArray(e)}function ie(e){return te.endsWith(e,"[]")?e.slice(0,-2):e}function ae(e,t,n){return e?e.concat(t).map((function(e,t){return e=ie(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{oe[e]={value:e}})),Object.defineProperties(ne,oe),Object.defineProperty(re,"isAxiosError",{value:!0}),ne.from=(e,t,n,r,o,s)=>{const i=Object.create(re);return te.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),ne.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};const ce=te.toFlatObject(te,{},null,(function(e){return/^is[A-Z]/.test(e)}));function ue(e,t,n){if(!te.isObject(e))throw new TypeError("target must be an object");t=t||new(h.default||FormData);const r=(n=te.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!te.isUndefined(t[e])}))).metaTokens,o=n.visitor||u,s=n.dots,i=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&te.isSpecCompliantForm(t);if(!te.isFunction(o))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(te.isDate(e))return e.toISOString();if(!a&&te.isBlob(e))throw new ne("Blob is not supported. Use a Buffer instead.");return te.isArrayBuffer(e)||te.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let a=e;if(e&&!o&&"object"==typeof e)if(te.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(te.isArray(e)&&function(e){return te.isArray(e)&&!e.some(se)}(e)||(te.isFileList(e)||te.endsWith(n,"[]"))&&(a=te.toArray(e)))return n=ie(n),a.forEach((function(e,r){!te.isUndefined(e)&&null!==e&&t.append(!0===i?ae([n],r,s):null===i?n:n+"[]",c(e))})),!1;return!!se(e)||(t.append(ae(o,n,s),c(e)),!1)}const l=[],f=Object.assign(ce,{defaultVisitor:u,convertValue:c,isVisitable:se});if(!te.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!te.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),te.forEach(n,(function(n,s){!0===(!(te.isUndefined(n)||null===n)&&o.call(t,n,te.isString(s)?s.trim():s,r,f))&&e(n,r?r.concat(s):[s])})),l.pop()}}(e),t}function le(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function fe(e,t){this._pairs=[],e&&ue(e,this,t)}const de=fe.prototype;function he(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function pe(e,t,n){if(!t)return e;const r=n&&n.encode||he,o=n&&n.serialize;let s;if(s=o?o(t,n):te.isURLSearchParams(t)?t.toString():new fe(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}de.append=function(e,t){this._pairs.push([e,t])},de.toString=function(e){const t=e?function(t){return e.call(this,t,le)}:le;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var me=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){te.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ye={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ge={isNode:!0,classes:{URLSearchParams:p.default.URLSearchParams,FormData:h.default,Blob:"undefined"!=typeof Blob&&Blob||null},protocols:["http","https","file","data"]};function be(e){function t(e,n,r,o){let s=e[o++];const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&te.isArray(r)?r.length:s,a)return te.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i;r[s]&&te.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],o)&&te.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let s;for(r=0;r<o;r++)s=n[r],t[s]=e[s];return t}(r[s])),!i}if(te.isFormData(e)&&te.isFunction(e.entries)){const n={};return te.forEachEntry(e,((e,r)=>{t(function(e){return te.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const we={"Content-Type":void 0};const Re={transitional:ye,adapter:["xhr","http"],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&&r?JSON.stringify(be(e)):e;if(te.isArrayBuffer(e)||te.isBuffer(e)||te.isStream(e)||te.isFile(e)||te.isBlob(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 s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return ue(e,new ge.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return te.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=te.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return ue(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}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=this.transitional||Re.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&te.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw ne.from(e,ne.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ge.classes.FormData,Blob:ge.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};te.forEach(["delete","get","head"],(function(e){Re.headers[e]={}})),te.forEach(["post","put","patch"],(function(e){Re.headers[e]=te.merge(we)}));var Ee=Re;const Oe=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 Se=Symbol("internals");function Te(e){return e&&String(e).trim().toLowerCase()}function Ae(e){return!1===e||null==e?e:te.isArray(e)?e.map(Ae):String(e)}function xe(e,t,n,r,o){return te.isFunction(r)?r.call(this,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 Ce{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=Te(t);if(!o)throw new Error("header name must be a non-empty string");const s=te.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=Ae(e))}const s=(e,t)=>te.forEach(e,((e,n)=>o(e,n,t)));return te.isPlainObject(e)||e instanceof this.constructor?s(e,t):te.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z]+$/.test(e.trim())?s((e=>{const t={};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(),!n||t[n]&&Oe[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&o(t,e,n),this}get(e,t){if(e=Te(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=Te(e)){const n=te.findKey(this,e);return!(!n||void 0===this[n]||t&&!xe(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=Te(e)){const o=te.findKey(n,e);!o||t&&!xe(0,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&&!xe(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return te.forEach(this,((r,o)=>{const s=te.findKey(n,o);if(s)return t[s]=Ae(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(o):String(o).trim();i!==o&&delete t[o],t[i]=Ae(r),n[i]=!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")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[Se]=this[Se]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Te(e);t[r]||(!function(e,t){const n=te.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{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}}Ce.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),te.freezeMethods(Ce.prototype),te.freezeMethods(Ce);var _e=Ce;function Le(e,t){const n=this||Ee,r=t||n,o=_e.from(r.headers);let s=r.data;return te.forEach(e,(function(e){s=e.call(n,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function ve(e){return!(!e||!e.__CANCEL__)}function Ne(e,t,n){ne.call(this,null==e?"canceled":e,ne.ERR_CANCELED,t,n),this.name="CanceledError"}function Pe(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new ne("Request failed with status code "+n.status,[ne.ERR_BAD_REQUEST,ne.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}function Be(e,t){return e&&!function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}te.inherits(Ne,ne,{__CANCEL__:!0});const je="1.3.4";function ke(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}const Ue=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function De(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const c=Date.now(),u=r[i];o||(o=c),n[s]=a,r[s]=c;let l=i,f=0;for(;l!==s;)f+=n[l++],l%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),c-o<t)return;const d=u&&c-u;return d?Math.round(1e3*f/d):void 0}}const Fe=Symbol("internals");class Ie extends R.default.Transform{constructor(e){super({readableHighWaterMark:(e=te.toFlatObject(e,{maxRate:0,chunkSize:65536,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,((e,t)=>!te.isUndefined(t[e])))).chunkSize});const t=this,n=this[Fe]={length:e.length,timeWindow:e.timeWindow,ticksRate:e.ticksRate,chunkSize:e.chunkSize,maxRate:e.maxRate,minChunkSize:e.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null},r=De(n.ticksRate*e.samplesCount,n.timeWindow);this.on("newListener",(e=>{"progress"===e&&(n.isCaptured||(n.isCaptured=!0))}));let o=0;n.updateProgress=function(e,t){let n=0;const r=1e3/t;let o=null;return function(t,s){const i=Date.now();if(t||i-n>r)return o&&(clearTimeout(o),o=null),n=i,e.apply(null,s);o||(o=setTimeout((()=>(o=null,n=Date.now(),e.apply(null,s))),r-(i-n)))}}((function(){const e=n.length,s=n.bytesSeen,i=s-o;if(!i||t.destroyed)return;const a=r(i);o=s,process.nextTick((()=>{t.emit("progress",{loaded:s,total:e,progress:e?s/e:void 0,bytes:i,rate:a||void 0,estimated:a&&e&&s<=e?(e-s)/a:void 0})}))}),n.ticksRate);const s=()=>{n.updateProgress(!0)};this.once("end",s),this.once("error",s)}_read(e){const t=this[Fe];return t.onReadCallback&&t.onReadCallback(),super._read(e)}_transform(e,t,n){const r=this,o=this[Fe],s=o.maxRate,i=this.readableHighWaterMark,a=o.timeWindow,c=s/(1e3/a),u=!1!==o.minChunkSize?Math.max(o.minChunkSize,.01*c):0;const l=(e,t)=>{const n=Buffer.byteLength(e);let l,f=null,d=i,h=0;if(s){const e=Date.now();(!o.ts||(h=e-o.ts)>=a)&&(o.ts=e,l=c-o.bytes,o.bytes=l<0?-l:0,h=0),l=c-o.bytes}if(s){if(l<=0)return setTimeout((()=>{t(null,e)}),a-h);l<d&&(d=l)}d&&n>d&&n-d>u&&(f=e.subarray(d),e=e.subarray(0,d)),function(e,t){const n=Buffer.byteLength(e);o.bytesSeen+=n,o.bytes+=n,o.isCaptured&&o.updateProgress(),r.push(e)?process.nextTick(t):o.onReadCallback=()=>{o.onReadCallback=null,process.nextTick(t)}}(e,f?()=>{process.nextTick(t,null,f)}:t)};l(e,(function e(t,r){if(t)return n(t);r?l(r,e):n(null)}))}setLength(e){return this[Fe].length=+e,this}}var ze=Ie;const{asyncIterator:qe}=Symbol;var Me=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[qe]?yield*e[qe]():yield e};const He=te.ALPHABET.ALPHA_DIGIT+"-_",Je=new a.TextEncoder,$e="\r\n",Ve=Je.encode($e);class We{constructor(e,t){const{escapeName:n}=this.constructor,r=te.isString(t);let o=`Content-Disposition: form-data; name="${n(e)}"${!r&&t.name?`; filename="${n(t.name)}"`:""}${$e}`;r?t=Je.encode(String(t).replace(/\r?\n|\r\n?/g,$e)):o+=`Content-Type: ${t.type||"application/octet-stream"}${$e}`,this.headers=Je.encode(o+$e),this.contentLength=r?t.byteLength:t.size,this.size=this.headers.byteLength+this.contentLength+2,this.name=e,this.value=t}async*encode(){yield this.headers;const{value:e}=this;te.isTypedArray(e)?yield e:yield*Me(e),yield Ve}static escapeName(e){return String(e).replace(/[\r\n"]/g,(e=>({"\r":"%0D","\n":"%0A",'"':"%22"}[e])))}}var Ke=(e,t,n)=>{const{tag:r="form-data-boundary",size:o=25,boundary:s=r+"-"+te.generateString(o,He)}=n||{};if(!te.isFormData(e))throw TypeError("FormData instance required");if(s.length<1||s.length>70)throw Error("boundary must be 10-70 characters long");const i=Je.encode("--"+s+$e),a=Je.encode("--"+s+"--"+$e+$e);let c=a.byteLength;const u=Array.from(e.entries()).map((([e,t])=>{const n=new We(e,t);return c+=n.size,n}));c+=i.byteLength*u.length,c=te.toFiniteNumber(c);const f={"Content-Type":`multipart/form-data; boundary=${s}`};return Number.isFinite(c)&&(f["Content-Length"]=c),t&&t(f),l.Readable.from(async function*(){for(const e of u)yield i,yield*e.encode();yield a}())};class Ge extends R.default.Transform{__transform(e,t,n){this.push(e),n()}_transform(e,t,n){if(0!==e.length&&(this._transform=this.__transform,120!==e[0])){const e=Buffer.alloc(2);e[0]=120,e[1]=156,this.push(e,t)}this.__transform(e,t,n)}}var Ze=Ge;const Qe={flush:w.default.constants.Z_SYNC_FLUSH,finishFlush:w.default.constants.Z_SYNC_FLUSH},Xe={flush:w.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:w.default.constants.BROTLI_OPERATION_FLUSH},Ye=te.isFunction(w.default.createBrotliDecompress),{http:et,https:tt}=b.default,nt=/https:?/,rt=ge.protocols.map((e=>e+":"));function ot(e){e.beforeRedirects.proxy&&e.beforeRedirects.proxy(e),e.beforeRedirects.config&&e.beforeRedirects.config(e)}function st(e,t,n){let r=t;if(!r&&!1!==r){const e=o.getProxyForUrl(n);e&&(r=new URL(e))}if(r){if(r.username&&(r.auth=(r.username||"")+":"+(r.password||"")),r.auth){(r.auth.username||r.auth.password)&&(r.auth=(r.auth.username||"")+":"+(r.auth.password||""));const t=Buffer.from(r.auth,"utf8").toString("base64");e.headers["Proxy-Authorization"]="Basic "+t}e.headers.host=e.hostname+(e.port?":"+e.port:"");const t=r.hostname||r.host;e.hostname=t,e.host=t,e.port=r.port,e.path=n,r.protocol&&(e.protocol=r.protocol.includes(":")?r.protocol:`${r.protocol}:`)}e.beforeRedirects.proxy=function(e){st(e,t,e.href)}}const it="undefined"!=typeof process&&"process"===te.kindOf(process);function at(e,t){let n=0;const r=De(50,250);return o=>{const s=o.loaded,i=o.lengthComputable?o.total:void 0,a=s-n,c=r(a);n=s;const u={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:c||void 0,estimated:c&&i&&s<=i?(i-s)/c:void 0,event:o};u[t?"download":"upload"]=!0,e(u)}}const ct={http:it&&function(e){return t=async function(t,n,r){let{data:o}=e;const{responseType:s,responseEncoding:i}=e,a=e.method.toUpperCase();let c,u,l=!1;const f=new E.default,d=()=>{e.cancelToken&&e.cancelToken.unsubscribe(h),e.signal&&e.signal.removeEventListener("abort",h),f.removeAllListeners()};function h(t){f.emit("abort",!t||t.type?new Ne(null,e,u):t)}r(((e,t)=>{c=!0,t&&(l=!0,d())})),f.once("abort",n),(e.cancelToken||e.signal)&&(e.cancelToken&&e.cancelToken.subscribe(h),e.signal&&(e.signal.aborted?h():e.signal.addEventListener("abort",h)));const p=Be(e.baseURL,e.url),b=new URL(p,"http://localhost"),O=b.protocol||rt[0];if("data:"===O){let r;if("GET"!==a)return Pe(t,n,{status:405,statusText:"method not allowed",headers:{},config:e});try{r=function(e,t,n){const r=n&&n.Blob||ge.classes.Blob,o=ke(e);if(void 0===t&&r&&(t=!0),"data"===o){e=o.length?e.slice(o.length+1):e;const n=Ue.exec(e);if(!n)throw new ne("Invalid URL",ne.ERR_INVALID_URL);const s=n[1],i=n[2],a=n[3],c=Buffer.from(decodeURIComponent(a),i?"base64":"utf8");if(t){if(!r)throw new ne("Blob is not supported",ne.ERR_NOT_SUPPORT);return new r([c],{type:s})}return c}throw new ne("Unsupported protocol "+o,ne.ERR_NOT_SUPPORT)}(e.url,"blob"===s,{Blob:e.env&&e.env.Blob})}catch(t){throw ne.from(t,ne.ERR_BAD_REQUEST,e)}return"text"===s?(r=r.toString(i),i&&"utf8"!==i||(r=te.stripBOM(r))):"stream"===s&&(r=R.default.Readable.from(r)),Pe(t,n,{data:r,status:200,statusText:"OK",headers:new _e,config:e})}if(-1===rt.indexOf(O))return n(new ne("Unsupported protocol "+O,ne.ERR_BAD_REQUEST,e));const S=_e.from(e.headers).normalize();S.set("User-Agent","axios/"+je,!1);const T=e.onDownloadProgress,A=e.onUploadProgress,x=e.maxRate;let C,_;if(te.isSpecCompliantForm(o)){const e=S.getContentType(/boundary=([-_\w\d]{10,70})/i);o=Ke(o,(e=>{S.set(e)}),{tag:`axios-${je}-boundary`,boundary:e&&e[1]||void 0})}else if(te.isFormData(o)&&te.isFunction(o.getHeaders)){if(S.set(o.getHeaders()),!S.hasContentLength())try{const e=await g.default.promisify(o.getLength).call(o);Number.isFinite(e)&&e>=0&&S.setContentLength(e)}catch(e){}}else if(te.isBlob(o))o.size&&S.setContentType(o.type||"application/octet-stream"),S.setContentLength(o.size||0),o=R.default.Readable.from(Me(o));else if(o&&!te.isStream(o)){if(Buffer.isBuffer(o));else if(te.isArrayBuffer(o))o=Buffer.from(new Uint8Array(o));else{if(!te.isString(o))return n(new ne("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream",ne.ERR_BAD_REQUEST,e));o=Buffer.from(o,"utf-8")}if(S.setContentLength(o.length,!1),e.maxBodyLength>-1&&o.length>e.maxBodyLength)return n(new ne("Request body larger than maxBodyLength limit",ne.ERR_BAD_REQUEST,e))}const L=te.toFiniteNumber(S.getContentLength());let v,N;te.isArray(x)?(C=x[0],_=x[1]):C=_=x,o&&(A||C)&&(te.isStream(o)||(o=R.default.Readable.from(o,{objectMode:!1})),o=R.default.pipeline([o,new ze({length:L,maxRate:te.toFiniteNumber(C)})],te.noop),A&&o.on("progress",(e=>{A(Object.assign(e,{upload:!0}))}))),e.auth&&(v=(e.auth.username||"")+":"+(e.auth.password||"")),!v&&b.username&&(v=b.username+":"+b.password),v&&S.delete("authorization");try{N=pe(b.pathname+b.search,e.params,e.paramsSerializer).replace(/^\?/,"")}catch(t){const r=new Error(t.message);return r.config=e,r.url=e.url,r.exists=!0,n(r)}S.set("Accept-Encoding","gzip, compress, deflate"+(Ye?", br":""),!1);const P={path:N,method:a,headers:S.toJSON(),agents:{http:e.httpAgent,https:e.httpsAgent},auth:v,protocol:O,beforeRedirect:ot,beforeRedirects:{}};let B;e.socketPath?P.socketPath=e.socketPath:(P.hostname=b.hostname,P.port=b.port,st(P,e.proxy,O+"//"+b.hostname+(b.port?":"+b.port:"")+P.path));const j=nt.test(P.protocol);if(P.agent=j?e.httpsAgent:e.httpAgent,e.transport?B=e.transport:0===e.maxRedirects?B=j?y.default:m.default:(e.maxRedirects&&(P.maxRedirects=e.maxRedirects),e.beforeRedirect&&(P.beforeRedirects.config=e.beforeRedirect),B=j?tt:et),e.maxBodyLength>-1?P.maxBodyLength=e.maxBodyLength:P.maxBodyLength=1/0,e.insecureHTTPParser&&(P.insecureHTTPParser=e.insecureHTTPParser),u=B.request(P,(function(r){if(u.destroyed)return;const o=[r],c=+r.headers["content-length"];if(T){const e=new ze({length:te.toFiniteNumber(c),maxRate:te.toFiniteNumber(_)});T&&e.on("progress",(e=>{T(Object.assign(e,{download:!0}))})),o.push(e)}let h=r;const p=r.req||u;if(!1!==e.decompress&&r.headers["content-encoding"])switch("HEAD"!==a&&204!==r.statusCode||delete r.headers["content-encoding"],r.headers["content-encoding"]){case"gzip":case"x-gzip":case"compress":case"x-compress":o.push(w.default.createUnzip(Qe)),delete r.headers["content-encoding"];break;case"deflate":o.push(new Ze),o.push(w.default.createUnzip(Qe)),delete r.headers["content-encoding"];break;case"br":Ye&&(o.push(w.default.createBrotliDecompress(Xe)),delete r.headers["content-encoding"])}h=o.length>1?R.default.pipeline(o,te.noop):o[0];const m=R.default.finished(h,(()=>{m(),d()})),y={status:r.statusCode,statusText:r.statusMessage,headers:new _e(r.headers),config:e,request:p};if("stream"===s)y.data=h,Pe(t,n,y);else{const r=[];let o=0;h.on("data",(function(t){r.push(t),o+=t.length,e.maxContentLength>-1&&o>e.maxContentLength&&(l=!0,h.destroy(),n(new ne("maxContentLength size of "+e.maxContentLength+" exceeded",ne.ERR_BAD_RESPONSE,e,p)))})),h.on("aborted",(function(){if(l)return;const t=new ne("maxContentLength size of "+e.maxContentLength+" exceeded",ne.ERR_BAD_RESPONSE,e,p);h.destroy(t),n(t)})),h.on("error",(function(t){u.destroyed||n(ne.from(t,null,e,p))})),h.on("end",(function(){try{let e=1===r.length?r[0]:Buffer.concat(r);"arraybuffer"!==s&&(e=e.toString(i),i&&"utf8"!==i||(e=te.stripBOM(e))),y.data=e}catch(t){n(ne.from(t,null,e,y.request,y))}Pe(t,n,y)}))}f.once("abort",(e=>{h.destroyed||(h.emit("error",e),h.destroy())}))})),f.once("abort",(e=>{n(e),u.destroy(e)})),u.on("error",(function(t){n(ne.from(t,null,e,u))})),u.on("socket",(function(e){e.setKeepAlive(!0,6e4)})),e.timeout){const t=parseInt(e.timeout,10);if(isNaN(t))return void n(new ne("error trying to parse `config.timeout` to int",ne.ERR_BAD_OPTION_VALUE,e,u));u.setTimeout(t,(function(){if(c)return;let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||ye;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new ne(t,r.clarifyTimeoutError?ne.ETIMEDOUT:ne.ECONNABORTED,e,u)),h()}))}if(te.isStream(o)){let t=!1,n=!1;o.on("end",(()=>{t=!0})),o.once("error",(e=>{n=!0,u.destroy(e)})),o.on("close",(()=>{t||n||h(new Ne("Request stream has been aborted",e,u))})),o.pipe(u)}else u.end(o)},new Promise(((e,n)=>{let r,o;const s=(e,t)=>{o||(o=!0,r&&r(e,t))},i=e=>{s(e,!0),n(e)};t((t=>{s(t),e(t)}),i,(e=>r=e)).catch(i)}));var t},xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const o=_e.from(e.headers).normalize(),s=e.responseType;let i;function a(){e.cancelToken&&e.cancelToken.unsubscribe(i),e.signal&&e.signal.removeEventListener("abort",i)}te.isFormData(r)&&ge.isStandardBrowserWebWorkerEnv&&o.setContentType(!1);let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+n))}const u=Be(e.baseURL,e.url);function l(){if(!c)return;const r=_e.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());Pe((function(e){t(e),a()}),(function(e){n(e),a()}),{data:s&&"text"!==s&&"json"!==s?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}c.open(e.method.toUpperCase(),pe(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=l:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(l)},c.onabort=function(){c&&(n(new ne("Request aborted",ne.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new ne("Network Error",ne.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||ye;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new ne(t,r.clarifyTimeoutError?ne.ETIMEDOUT:ne.ECONNABORTED,e,c)),c=null},void 0===r&&o.setContentType(null),"setRequestHeader"in c&&te.forEach(o.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),te.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),s&&"json"!==s&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",at(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",at(e.onUploadProgress)),(e.cancelToken||e.signal)&&(i=t=>{c&&(n(!t||t.type?new Ne(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(i),e.signal&&(e.signal.aborted?i():e.signal.addEventListener("abort",i)));const f=ke(u);f&&-1===ge.protocols.indexOf(f)?n(new ne("Unsupported protocol "+f+":",ne.ERR_BAD_REQUEST,e)):c.send(r||null)}))}};te.forEach(ct,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var ut={getAdapter:e=>{e=te.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let o=0;o<t&&(n=e[o],!(r=te.isString(n)?ct[n.toLowerCase()]:n));o++);if(!r){if(!1===r)throw new ne(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(te.hasOwnProp(ct,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!te.isFunction(r))throw new TypeError("adapter is not a function");return r},adapters:ct};function lt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ne(null,e)}function ft(e){lt(e),e.headers=_e.from(e.headers),e.data=Le.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return ut.getAdapter(e.adapter||Ee.adapter)(e).then((function(t){return lt(e),t.data=Le.call(e,e.transformResponse,t),t.headers=_e.from(t.headers),t}),(function(t){return ve(t)||(lt(e),t&&t.response&&(t.response.data=Le.call(e,e.transformResponse,t.response),t.response.headers=_e.from(t.response.headers))),Promise.reject(t)}))}const dt=e=>e instanceof _e?e.toJSON():e;function ht(e,t){t=t||{};const n={};function r(e,t,n){return te.isPlainObject(e)&&te.isPlainObject(t)?te.merge.call({caseless:n},e,t):te.isPlainObject(t)?te.merge({},t):te.isArray(t)?t.slice():t}function o(e,t,n){return te.isUndefined(t)?te.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function s(e,t){if(!te.isUndefined(t))return r(void 0,t)}function i(e,t){return te.isUndefined(t)?te.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,o,s){return s in t?r(n,o):s in e?r(void 0,n):void 0}const c={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>o(dt(e),dt(t),!0)};return te.forEach(Object.keys(e).concat(Object.keys(t)),(function(r){const s=c[r]||o,i=s(e[r],t[r],r);te.isUndefined(i)&&s!==a||(n[r]=i)})),n}const pt={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{pt[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const mt={};pt.transitional=function(e,t,n){function r(e,t){return"[Axios v"+je+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,s)=>{if(!1===e)throw new ne(r(o," has been removed"+(t?" in "+t:"")),ne.ERR_DEPRECATED);return t&&!mt[o]&&(mt[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,s)}};var yt={assertOptions:function(e,t,n){if("object"!=typeof e)throw new ne("options must be an object",ne.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const t=e[s],n=void 0===t||i(t,s,e);if(!0!==n)throw new ne("option "+s+" must be "+n,ne.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new ne("Unknown option "+s,ne.ERR_BAD_OPTION)}},validators:pt};const gt=yt.validators;class bt{constructor(e){this.defaults=e,this.interceptors={request:new me,response:new me}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ht(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;let s;void 0!==n&&yt.assertOptions(n,{silentJSONParsing:gt.transitional(gt.boolean),forcedJSONParsing:gt.transitional(gt.boolean),clarifyTimeoutError:gt.transitional(gt.boolean)},!1),void 0!==r&&yt.assertOptions(r,{encode:gt.function,serialize:gt.function},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase(),s=o&&te.merge(o.common,o[t.method]),s&&te.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=_e.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let l,f=0;if(!a){const e=[ft.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,c),l=e.length,u=Promise.resolve(t);f<l;)u=u.then(e[f++],e[f++]);return u}l=i.length;let d=t;for(f=0;f<l;){const e=i[f++],t=i[f++];try{d=e(d)}catch(e){t.call(this,e);break}}try{u=ft.call(this,d)}catch(e){return Promise.reject(e)}for(f=0,l=c.length;f<l;)u=u.then(c[f++],c[f++]);return u}getUri(e){return pe(Be((e=ht(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}te.forEach(["delete","get","head","options"],(function(e){bt.prototype[e]=function(t,n){return this.request(ht(n||{},{method:e,url:t,data:(n||{}).data}))}})),te.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,o){return this.request(ht(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}bt.prototype[e]=t(),bt.prototype[e+"Form"]=t(!0)}));var wt=bt;class Rt{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 Ne(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)}static source(){let e;return{token:new Rt((function(t){e=t})),cancel:e}}}var Et=Rt;const Ot={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ot).forEach((([e,t])=>{Ot[t]=e}));var St=Ot;const Tt=function e(t){const n=new wt(t),r=O(wt.prototype.request,n);return te.extend(r,wt.prototype,n,{allOwnKeys:!0}),te.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ht(t,n))},r}(Ee);Tt.Axios=wt,Tt.CanceledError=Ne,Tt.CancelToken=Et,Tt.isCancel=ve,Tt.VERSION=je,Tt.toFormData=ue,Tt.AxiosError=ne,Tt.Cancel=Tt.CanceledError,Tt.all=function(e){return Promise.all(e)},Tt.spread=function(e){return function(t){return e.apply(null,t)}},Tt.isAxiosError=function(e){return te.isObject(e)&&!0===e.isAxiosError},Tt.mergeConfig=ht,Tt.AxiosHeaders=_e,Tt.formToJSON=e=>be(te.isHTMLForm(e)?new FormData(e):e),Tt.HttpStatusCode=St,Tt.default=Tt;var At=Tt;class xt{static SimpleToRaw(e){return{name:"",notify_type:"notify_discord_webhook",notify:e}}}class Ct{static SimpleToRaw(e,t){if("Discord"===e)return xt.SimpleToRaw(t)}}class _t{static SimpleToRaw(e,t,n){return{alertType:"event",network:t,nickname:e,type:"handler_function_call_v2",handler:n}}}class Lt{static SimpleToRaw(e,t,n,r){if("PollFunctionV2"===t)return _t.SimpleToRaw(e,n,r);throw new Error("Invalid Trigger ID")}}const vt=e=>`https://${e}.functions.supabase.co/`,Nt=e=>`https://${e}.supabase.co/`,Pt="fdgtrxmmrtlokhgkvcjz";class Bt{url;token;headers={};constructor(e,t){this.url=e,this.token=t,this.headers={Authorization:`Bearer ${t}`,"Content-Type":"application/json"}}static async create(e){if(e.key)throw new Error("Auth by key not yet supported");if(e.email&&e.password){const n=e.projectId?Nt(e.projectId):Nt(Pt),r=e.projectId?vt(e.projectId):vt(Pt),o=e.anonKey?e.anonKey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImZkZ3RyeG1tcnRsb2toZ2t2Y2p6Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2NzMwODcwNzYsImV4cCI6MTk4ODY2MzA3Nn0.sAMxjlcJSSozBGr-LNcsudyxzUEM9e-UspMHHQLqLr4",s=t.createClient(n,o),{data:i,error:a}=await s.auth.signInWithPassword({email:e.email,password:e.password});if(a)throw a;if(void 0===i.session?.access_token)throw new Error("Access token not found");return new Bt(r,i.session?.access_token)}throw new Error("Authentication Required. DeNotify supports either username/password or API key authentication")}async alertHistory(e,t={}){return await this.request("get","alert-history"+(e?"/"+e:""),{params:t})}async getAlert(e){return(await this.request("get",`alerts/${e}`))[0]}async getAlerts(){return await this.request("get","alerts")}async createAlert(e){const t=Lt.SimpleToRaw(e.name,e.triggerId,e.network,e.trigger),n=Ct.SimpleToRaw(e.notificationId,e.notification);return await this.request("post","alerts",{body:{trigger:t,notification:n}})}async deleteAlert(e){return await this.request("delete",`alerts/${e}`)}async request(e,t,n={}){const r=new URL(`${this.url}${t}`);if(n.params)for(const e of Object.keys(n.params))r.searchParams.append(e,n.params[e]);const o={method:e,url:r.toString(),headers:this.headers};n.body&&(o.data=n.body);return(await At(o)).data}async getAbi(e,t){return await this.request("get",`abi/${e}/${t}`)}async getAbiHash(e){return(await this.request("post","abi",{body:e})).hash}async setAlertName(e,t){}async enableAlert(e){}async disableAlert(e){}async updateTrigger(e,t){return await this.request("patch",`alerts/trigger-handler/${e}`,{body:t})}}e.DeNotifyClient=Bt}));
|