@nhost/nhost-js 0.3.10 → 0.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
- var or=Object.create;var oe=Object.defineProperty;var ir=Object.getOwnPropertyDescriptor;var ar=Object.getOwnPropertyNames;var ur=Object.getPrototypeOf,cr=Object.prototype.hasOwnProperty;var lr=r=>oe(r,"__esModule",{value:!0});var j=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var fr=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ar(e))!cr.call(r,n)&&(t||n!=="default")&&oe(r,n,{get:()=>e[n],enumerable:!(o=ir(e,n))||o.enumerable});return r},Pe=(r,e)=>fr(lr(oe(r!=null?or(ur(r)):{},"default",!e&&r&&r.__esModule?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var ce=j((bs,Ye)=>{"use strict";Ye.exports=function(e,t){return function(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];return e.apply(t,n)}}});var L=j((ws,tt)=>{"use strict";var En=ce(),M=Object.prototype.toString;function he(r){return M.call(r)==="[object Array]"}function le(r){return typeof r>"u"}function kn(r){return r!==null&&!le(r)&&r.constructor!==null&&!le(r.constructor)&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function Cn(r){return M.call(r)==="[object ArrayBuffer]"}function Tn(r){return typeof FormData<"u"&&r instanceof FormData}function An(r){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&r.buffer instanceof ArrayBuffer,e}function On(r){return typeof r=="string"}function jn(r){return typeof r=="number"}function Ze(r){return r!==null&&typeof r=="object"}function Y(r){if(M.call(r)!=="[object Object]")return!1;var e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}function Nn(r){return M.call(r)==="[object Date]"}function Rn(r){return M.call(r)==="[object File]"}function Pn(r){return M.call(r)==="[object Blob]"}function et(r){return M.call(r)==="[object Function]"}function In(r){return Ze(r)&&et(r.pipe)}function qn(r){return typeof URLSearchParams<"u"&&r instanceof URLSearchParams}function Un(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Ln(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function pe(r,e){if(!(r===null||typeof r>"u"))if(typeof r!="object"&&(r=[r]),he(r))for(var t=0,o=r.length;t<o;t++)e.call(null,r[t],t,r);else for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.call(null,r[n],n,r)}function fe(){var r={};function e(n,i){Y(r[i])&&Y(n)?r[i]=fe(r[i],n):Y(n)?r[i]=fe({},n):he(n)?r[i]=n.slice():r[i]=n}for(var t=0,o=arguments.length;t<o;t++)pe(arguments[t],e);return r}function Fn(r,e,t){return pe(e,function(n,i){t&&typeof n=="function"?r[i]=En(n,t):r[i]=n}),r}function Bn(r){return r.charCodeAt(0)===65279&&(r=r.slice(1)),r}tt.exports={isArray:he,isArrayBuffer:Cn,isBuffer:kn,isFormData:Tn,isArrayBufferView:An,isString:On,isNumber:jn,isObject:Ze,isPlainObject:Y,isUndefined:le,isDate:Nn,isFile:Rn,isBlob:Pn,isFunction:et,isStream:In,isURLSearchParams:qn,isStandardBrowserEnv:Ln,forEach:pe,merge:fe,extend:Fn,trim:Un,stripBOM:Bn}});var de=j((xs,nt)=>{"use strict";var J=L();function rt(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}nt.exports=function(e,t,o){if(!t)return e;var n;if(o)n=o(t);else if(J.isURLSearchParams(t))n=t.toString();else{var i=[];J.forEach(t,function(u,l){u===null||typeof u>"u"||(J.isArray(u)?l=l+"[]":u=[u],J.forEach(u,function(p){J.isDate(p)?p=p.toISOString():J.isObject(p)&&(p=JSON.stringify(p)),i.push(rt(l)+"="+rt(p))}))}),n=i.join("&")}if(n){var a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+n}return e}});var ot=j((Ss,st)=>{"use strict";var _n=L();function Z(){this.handlers=[]}Z.prototype.use=function(e,t,o){return this.handlers.push({fulfilled:e,rejected:t,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1};Z.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};Z.prototype.forEach=function(e){_n.forEach(this.handlers,function(o){o!==null&&e(o)})};st.exports=Z});var at=j((Es,it)=>{"use strict";var Dn=L();it.exports=function(e,t){Dn.forEach(e,function(n,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[i])})}});var me=j((ks,ut)=>{"use strict";ut.exports=function(e,t,o,n,i){return e.config=t,o&&(e.code=o),e.request=n,e.response=i,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}});var ge=j((Cs,ct)=>{"use strict";var Hn=me();ct.exports=function(e,t,o,n,i){var a=new Error(e);return Hn(a,t,o,n,i)}});var ft=j((Ts,lt)=>{"use strict";var Mn=ge();lt.exports=function(e,t,o){var n=o.config.validateStatus;!o.status||!n||n(o.status)?e(o):t(Mn("Request failed with status code "+o.status,o.config,null,o.request,o))}});var pt=j((As,ht)=>{"use strict";var ee=L();ht.exports=ee.isStandardBrowserEnv()?function(){return{write:function(t,o,n,i,a,c){var u=[];u.push(t+"="+encodeURIComponent(o)),ee.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),ee.isString(i)&&u.push("path="+i),ee.isString(a)&&u.push("domain="+a),c===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(t){var o=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return o?decodeURIComponent(o[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var mt=j((Os,dt)=>{"use strict";dt.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}});var vt=j((js,gt)=>{"use strict";gt.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}});var bt=j((Ns,yt)=>{"use strict";var Jn=mt(),$n=vt();yt.exports=function(e,t){return e&&!Jn(t)?$n(e,t):t}});var xt=j((Rs,wt)=>{"use strict";var ve=L(),zn=["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"];wt.exports=function(e){var t={},o,n,i;return e&&ve.forEach(e.split(`
2
- `),function(c){if(i=c.indexOf(":"),o=ve.trim(c.substr(0,i)).toLowerCase(),n=ve.trim(c.substr(i+1)),o){if(t[o]&&zn.indexOf(o)>=0)return;o==="set-cookie"?t[o]=(t[o]?t[o]:[]).concat([n]):t[o]=t[o]?t[o]+", "+n:n}}),t}});var kt=j((Ps,Et)=>{"use strict";var St=L();Et.exports=St.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),o;function n(i){var a=i;return e&&(t.setAttribute("href",a),a=t.href),t.setAttribute("href",a),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return o=n(window.location.href),function(a){var c=St.isString(a)?n(a):a;return c.protocol===o.protocol&&c.host===o.host}}():function(){return function(){return!0}}()});var V=j((Is,Ct)=>{"use strict";function ye(r){this.message=r}ye.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};ye.prototype.__CANCEL__=!0;Ct.exports=ye});var we=j((qs,Tt)=>{"use strict";var te=L(),Vn=ft(),Gn=pt(),Wn=de(),Xn=bt(),Kn=xt(),Qn=kt(),be=ge(),Yn=G(),Zn=V();Tt.exports=function(e){return new Promise(function(o,n){var i=e.data,a=e.headers,c=e.responseType,u;function l(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}te.isFormData(i)&&delete a["Content-Type"];var s=new XMLHttpRequest;if(e.auth){var p=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.Authorization="Basic "+btoa(p+":"+h)}var x=Xn(e.baseURL,e.url);s.open(e.method.toUpperCase(),Wn(x,e.params,e.paramsSerializer),!0),s.timeout=e.timeout;function y(){if(!!s){var b="getAllResponseHeaders"in s?Kn(s.getAllResponseHeaders()):null,T=!c||c==="text"||c==="json"?s.responseText:s.response,m={data:T,status:s.status,statusText:s.statusText,headers:b,config:e,request:s};Vn(function(d){o(d),l()},function(d){n(d),l()},m),s=null}}if("onloadend"in s?s.onloadend=y:s.onreadystatechange=function(){!s||s.readyState!==4||s.status===0&&!(s.responseURL&&s.responseURL.indexOf("file:")===0)||setTimeout(y)},s.onabort=function(){!s||(n(be("Request aborted",e,"ECONNABORTED",s)),s=null)},s.onerror=function(){n(be("Network Error",e,null,s)),s=null},s.ontimeout=function(){var T=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",m=e.transitional||Yn.transitional;e.timeoutErrorMessage&&(T=e.timeoutErrorMessage),n(be(T,e,m.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",s)),s=null},te.isStandardBrowserEnv()){var S=(e.withCredentials||Qn(x))&&e.xsrfCookieName?Gn.read(e.xsrfCookieName):void 0;S&&(a[e.xsrfHeaderName]=S)}"setRequestHeader"in s&&te.forEach(a,function(T,m){typeof i>"u"&&m.toLowerCase()==="content-type"?delete a[m]:s.setRequestHeader(m,T)}),te.isUndefined(e.withCredentials)||(s.withCredentials=!!e.withCredentials),c&&c!=="json"&&(s.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&s.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&s.upload&&s.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(u=function(b){!s||(n(!b||b&&b.type?new Zn("canceled"):b),s.abort(),s=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u))),i||(i=null),s.send(i)})}});var G=j((Us,jt)=>{"use strict";var q=L(),At=at(),es=me(),ts={"Content-Type":"application/x-www-form-urlencoded"};function Ot(r,e){!q.isUndefined(r)&&q.isUndefined(r["Content-Type"])&&(r["Content-Type"]=e)}function rs(){var r;return typeof XMLHttpRequest<"u"?r=we():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(r=we()),r}function ns(r,e,t){if(q.isString(r))try{return(e||JSON.parse)(r),q.trim(r)}catch(o){if(o.name!=="SyntaxError")throw o}return(t||JSON.stringify)(r)}var re={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:rs(),transformRequest:[function(e,t){return At(t,"Accept"),At(t,"Content-Type"),q.isFormData(e)||q.isArrayBuffer(e)||q.isBuffer(e)||q.isStream(e)||q.isFile(e)||q.isBlob(e)?e:q.isArrayBufferView(e)?e.buffer:q.isURLSearchParams(e)?(Ot(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):q.isObject(e)||t&&t["Content-Type"]==="application/json"?(Ot(t,"application/json"),ns(e)):e}],transformResponse:[function(e){var t=this.transitional||re.transitional,o=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,i=!o&&this.responseType==="json";if(i||n&&q.isString(e)&&e.length)try{return JSON.parse(e)}catch(a){if(i)throw a.name==="SyntaxError"?es(a,this,"E_JSON_PARSE"):a}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, */*"}}};q.forEach(["delete","get","head"],function(e){re.headers[e]={}});q.forEach(["post","put","patch"],function(e){re.headers[e]=q.merge(ts)});jt.exports=re});var Rt=j((Ls,Nt)=>{"use strict";var ss=L(),os=G();Nt.exports=function(e,t,o){var n=this||os;return ss.forEach(o,function(a){e=a.call(n,e,t)}),e}});var xe=j((Fs,Pt)=>{"use strict";Pt.exports=function(e){return!!(e&&e.__CANCEL__)}});var Ut=j((Bs,qt)=>{"use strict";var It=L(),Se=Rt(),is=xe(),as=G(),us=V();function Ee(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new us("canceled")}qt.exports=function(e){Ee(e),e.headers=e.headers||{},e.data=Se.call(e,e.data,e.headers,e.transformRequest),e.headers=It.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),It.forEach(["delete","get","head","post","put","patch","common"],function(n){delete e.headers[n]});var t=e.adapter||as.adapter;return t(e).then(function(n){return Ee(e),n.data=Se.call(e,n.data,n.headers,e.transformResponse),n},function(n){return is(n)||(Ee(e),n&&n.response&&(n.response.data=Se.call(e,n.response.data,n.response.headers,e.transformResponse))),Promise.reject(n)})}});var ke=j((_s,Lt)=>{"use strict";var _=L();Lt.exports=function(e,t){t=t||{};var o={};function n(s,p){return _.isPlainObject(s)&&_.isPlainObject(p)?_.merge(s,p):_.isPlainObject(p)?_.merge({},p):_.isArray(p)?p.slice():p}function i(s){if(_.isUndefined(t[s])){if(!_.isUndefined(e[s]))return n(void 0,e[s])}else return n(e[s],t[s])}function a(s){if(!_.isUndefined(t[s]))return n(void 0,t[s])}function c(s){if(_.isUndefined(t[s])){if(!_.isUndefined(e[s]))return n(void 0,e[s])}else return n(void 0,t[s])}function u(s){if(s in t)return n(e[s],t[s]);if(s in e)return n(void 0,e[s])}var l={url:a,method:a,data:a,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:u};return _.forEach(Object.keys(e).concat(Object.keys(t)),function(p){var h=l[p]||i,x=h(p);_.isUndefined(x)&&h!==u||(o[p]=x)}),o}});var Ce=j((Ds,Ft)=>{Ft.exports={version:"0.23.0"}});var Dt=j((Hs,_t)=>{"use strict";var cs=Ce().version,Te={};["object","boolean","number","function","string","symbol"].forEach(function(r,e){Te[r]=function(o){return typeof o===r||"a"+(e<1?"n ":" ")+r}});var Bt={};Te.transitional=function(e,t,o){function n(i,a){return"[Axios v"+cs+"] Transitional option '"+i+"'"+a+(o?". "+o:"")}return function(i,a,c){if(e===!1)throw new Error(n(a," has been removed"+(t?" in "+t:"")));return t&&!Bt[a]&&(Bt[a]=!0,console.warn(n(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,a,c):!0}};function ls(r,e,t){if(typeof r!="object")throw new TypeError("options must be an object");for(var o=Object.keys(r),n=o.length;n-- >0;){var i=o[n],a=e[i];if(a){var c=r[i],u=c===void 0||a(c,i,r);if(u!==!0)throw new TypeError("option "+i+" must be "+u);continue}if(t!==!0)throw Error("Unknown option "+i)}}_t.exports={assertOptions:ls,validators:Te}});var Vt=j((Ms,zt)=>{"use strict";var Jt=L(),fs=de(),Ht=ot(),Mt=Ut(),ne=ke(),$t=Dt(),$=$t.validators;function W(r){this.defaults=r,this.interceptors={request:new Ht,response:new Ht}}W.prototype.request=function(e){typeof e=="string"?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=ne(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;t!==void 0&&$t.assertOptions(t,{silentJSONParsing:$.transitional($.boolean),forcedJSONParsing:$.transitional($.boolean),clarifyTimeoutError:$.transitional($.boolean)},!1);var o=[],n=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(e)===!1||(n=n&&h.synchronous,o.unshift(h.fulfilled,h.rejected))});var i=[];this.interceptors.response.forEach(function(h){i.push(h.fulfilled,h.rejected)});var a;if(!n){var c=[Mt,void 0];for(Array.prototype.unshift.apply(c,o),c=c.concat(i),a=Promise.resolve(e);c.length;)a=a.then(c.shift(),c.shift());return a}for(var u=e;o.length;){var l=o.shift(),s=o.shift();try{u=l(u)}catch(p){s(p);break}}try{a=Mt(u)}catch(p){return Promise.reject(p)}for(;i.length;)a=a.then(i.shift(),i.shift());return a};W.prototype.getUri=function(e){return e=ne(this.defaults,e),fs(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")};Jt.forEach(["delete","get","head","options"],function(e){W.prototype[e]=function(t,o){return this.request(ne(o||{},{method:e,url:t,data:(o||{}).data}))}});Jt.forEach(["post","put","patch"],function(e){W.prototype[e]=function(t,o,n){return this.request(ne(n||{},{method:e,url:t,data:o}))}});zt.exports=W});var Wt=j((Js,Gt)=>{"use strict";var hs=V();function z(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(n){e=n});var t=this;this.promise.then(function(o){if(!!t._listeners){var n,i=t._listeners.length;for(n=0;n<i;n++)t._listeners[n](o);t._listeners=null}}),this.promise.then=function(o){var n,i=new Promise(function(a){t.subscribe(a),n=a}).then(o);return i.cancel=function(){t.unsubscribe(n)},i},r(function(n){t.reason||(t.reason=new hs(n),e(t.reason))})}z.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};z.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]};z.prototype.unsubscribe=function(e){if(!!this._listeners){var t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}};z.source=function(){var e,t=new z(function(n){e=n});return{token:t,cancel:e}};Gt.exports=z});var Kt=j(($s,Xt)=>{"use strict";Xt.exports=function(e){return function(o){return e.apply(null,o)}}});var Yt=j((zs,Qt)=>{"use strict";Qt.exports=function(e){return typeof e=="object"&&e.isAxiosError===!0}});var tr=j((Vs,Ae)=>{"use strict";var Zt=L(),ps=ce(),se=Vt(),ds=ke(),ms=G();function er(r){var e=new se(r),t=ps(se.prototype.request,e);return Zt.extend(t,se.prototype,e),Zt.extend(t,e),t.create=function(n){return er(ds(r,n))},t}var D=er(ms);D.Axios=se;D.Cancel=V();D.CancelToken=Wt();D.isCancel=xe();D.VERSION=Ce().version;D.all=function(e){return Promise.all(e)};D.spread=Kt();D.isAxiosError=Yt();Ae.exports=D;Ae.exports.default=D});var Oe=j((Gs,rr)=>{rr.exports=tr()});var hr=Object.create,ie=Object.defineProperty,pr=Object.getOwnPropertyDescriptor,dr=Object.getOwnPropertyNames,mr=Object.getPrototypeOf,gr=Object.prototype.hasOwnProperty,vr=r=>ie(r,"__esModule",{value:!0}),A=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),yr=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of dr(e))!gr.call(r,n)&&(t||n!=="default")&&ie(r,n,{get:()=>e[n],enumerable:!(o=pr(e,n))||o.enumerable});return r},qe=(r,e)=>yr(vr(ie(r!=null?hr(mr(r)):{},"default",!e&&r&&r.__esModule?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r),Ue=A((r,e)=>{"use strict";e.exports=function(t,o){return function(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];return t.apply(o,n)}}}),U=A((r,e)=>{"use strict";var t=Ue(),o=Object.prototype.toString;function n(f){return Array.isArray(f)}function i(f){return typeof f>"u"}function a(f){return f!==null&&!i(f)&&f.constructor!==null&&!i(f.constructor)&&typeof f.constructor.isBuffer=="function"&&f.constructor.isBuffer(f)}function c(f){return o.call(f)==="[object ArrayBuffer]"}function u(f){return o.call(f)==="[object FormData]"}function l(f){var C;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?C=ArrayBuffer.isView(f):C=f&&f.buffer&&c(f.buffer),C}function s(f){return typeof f=="string"}function p(f){return typeof f=="number"}function h(f){return f!==null&&typeof f=="object"}function x(f){if(o.call(f)!=="[object Object]")return!1;var C=Object.getPrototypeOf(f);return C===null||C===Object.prototype}function y(f){return o.call(f)==="[object Date]"}function S(f){return o.call(f)==="[object File]"}function b(f){return o.call(f)==="[object Blob]"}function T(f){return o.call(f)==="[object Function]"}function m(f){return h(f)&&T(f.pipe)}function g(f){return o.call(f)==="[object URLSearchParams]"}function d(f){return f.trim?f.trim():f.replace(/^\s+|\s+$/g,"")}function v(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function w(f,C){if(!(f===null||typeof f>"u"))if(typeof f!="object"&&(f=[f]),n(f))for(var R=0,I=f.length;R<I;R++)C.call(null,f[R],R,f);else for(var O in f)Object.prototype.hasOwnProperty.call(f,O)&&C.call(null,f[O],O,f)}function k(){var f={};function C(O,F){x(f[F])&&x(O)?f[F]=k(f[F],O):x(O)?f[F]=k({},O):n(O)?f[F]=O.slice():f[F]=O}for(var R=0,I=arguments.length;R<I;R++)w(arguments[R],C);return f}function E(f,C,R){return w(C,function(I,O){R&&typeof I=="function"?f[O]=t(I,R):f[O]=I}),f}function P(f){return f.charCodeAt(0)===65279&&(f=f.slice(1)),f}e.exports={isArray:n,isArrayBuffer:c,isBuffer:a,isFormData:u,isArrayBufferView:l,isString:s,isNumber:p,isObject:h,isPlainObject:x,isUndefined:i,isDate:y,isFile:S,isBlob:b,isFunction:T,isStream:m,isURLSearchParams:g,isStandardBrowserEnv:v,forEach:w,merge:k,extend:E,trim:d,stripBOM:P}}),Le=A((r,e)=>{"use strict";var t=U();function o(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(n,i,a){if(!i)return n;var c;if(a)c=a(i);else if(t.isURLSearchParams(i))c=i.toString();else{var u=[];t.forEach(i,function(s,p){s===null||typeof s>"u"||(t.isArray(s)?p=p+"[]":s=[s],t.forEach(s,function(h){t.isDate(h)?h=h.toISOString():t.isObject(h)&&(h=JSON.stringify(h)),u.push(o(p)+"="+o(h))}))}),c=u.join("&")}if(c){var l=n.indexOf("#");l!==-1&&(n=n.slice(0,l)),n+=(n.indexOf("?")===-1?"?":"&")+c}return n}}),br=A((r,e)=>{"use strict";var t=U();function o(){this.handlers=[]}o.prototype.use=function(n,i,a){return this.handlers.push({fulfilled:n,rejected:i,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(n){this.handlers[n]&&(this.handlers[n]=null)},o.prototype.forEach=function(n){t.forEach(this.handlers,function(i){i!==null&&n(i)})},e.exports=o}),wr=A((r,e)=>{"use strict";var t=U();e.exports=function(o,n){t.forEach(o,function(i,a){a!==n&&a.toUpperCase()===n.toUpperCase()&&(o[n]=i,delete o[a])})}}),Fe=A((r,e)=>{"use strict";e.exports=function(t,o,n,i,a){return t.config=o,n&&(t.code=n),t.request=i,t.response=a,t.isAxiosError=!0,t.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}},t}}),Be=A((r,e)=>{"use strict";var t=Fe();e.exports=function(o,n,i,a,c){var u=new Error(o);return t(u,n,i,a,c)}}),xr=A((r,e)=>{"use strict";var t=Be();e.exports=function(o,n,i){var a=i.config.validateStatus;!i.status||!a||a(i.status)?o(i):n(t("Request failed with status code "+i.status,i.config,null,i.request,i))}}),Sr=A((r,e)=>{"use strict";var t=U();e.exports=t.isStandardBrowserEnv()?function(){return{write:function(o,n,i,a,c,u){var l=[];l.push(o+"="+encodeURIComponent(n)),t.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),t.isString(a)&&l.push("path="+a),t.isString(c)&&l.push("domain="+c),u===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(o){var n=document.cookie.match(new RegExp("(^|;\\s*)("+o+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(o){this.write(o,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()}),Er=A((r,e)=>{"use strict";e.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}}),kr=A((r,e)=>{"use strict";e.exports=function(t,o){return o?t.replace(/\/+$/,"")+"/"+o.replace(/^\/+/,""):t}}),Cr=A((r,e)=>{"use strict";var t=Er(),o=kr();e.exports=function(n,i){return n&&!t(i)?o(n,i):i}}),Tr=A((r,e)=>{"use strict";var t=U(),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(n){var i={},a,c,u;return n&&t.forEach(n.split(`
3
- `),function(l){if(u=l.indexOf(":"),a=t.trim(l.substr(0,u)).toLowerCase(),c=t.trim(l.substr(u+1)),a){if(i[a]&&o.indexOf(a)>=0)return;a==="set-cookie"?i[a]=(i[a]?i[a]:[]).concat([c]):i[a]=i[a]?i[a]+", "+c:c}}),i}}),Ar=A((r,e)=>{"use strict";var t=U();e.exports=t.isStandardBrowserEnv()?function(){var o=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a"),i;function a(c){var u=c;return o&&(n.setAttribute("href",u),u=n.href),n.setAttribute("href",u),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return i=a(window.location.href),function(c){var u=t.isString(c)?a(c):c;return u.protocol===i.protocol&&u.host===i.host}}():function(){return function(){return!0}}()}),K=A((r,e)=>{"use strict";function t(o){this.message=o}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t}),Ie=A((r,e)=>{"use strict";var t=U(),o=xr(),n=Sr(),i=Le(),a=Cr(),c=Tr(),u=Ar(),l=Be(),s=Q(),p=K();e.exports=function(h){return new Promise(function(x,y){var S=h.data,b=h.headers,T=h.responseType,m;function g(){h.cancelToken&&h.cancelToken.unsubscribe(m),h.signal&&h.signal.removeEventListener("abort",m)}t.isFormData(S)&&delete b["Content-Type"];var d=new XMLHttpRequest;if(h.auth){var v=h.auth.username||"",w=h.auth.password?unescape(encodeURIComponent(h.auth.password)):"";b.Authorization="Basic "+btoa(v+":"+w)}var k=a(h.baseURL,h.url);d.open(h.method.toUpperCase(),i(k,h.params,h.paramsSerializer),!0),d.timeout=h.timeout;function E(){if(d){var f="getAllResponseHeaders"in d?c(d.getAllResponseHeaders()):null,C=!T||T==="text"||T==="json"?d.responseText:d.response,R={data:C,status:d.status,statusText:d.statusText,headers:f,config:h,request:d};o(function(I){x(I),g()},function(I){y(I),g()},R),d=null}}if("onloadend"in d?d.onloadend=E:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(E)},d.onabort=function(){!d||(y(l("Request aborted",h,"ECONNABORTED",d)),d=null)},d.onerror=function(){y(l("Network Error",h,null,d)),d=null},d.ontimeout=function(){var f=h.timeout?"timeout of "+h.timeout+"ms exceeded":"timeout exceeded",C=h.transitional||s.transitional;h.timeoutErrorMessage&&(f=h.timeoutErrorMessage),y(l(f,h,C.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",d)),d=null},t.isStandardBrowserEnv()){var P=(h.withCredentials||u(k))&&h.xsrfCookieName?n.read(h.xsrfCookieName):void 0;P&&(b[h.xsrfHeaderName]=P)}"setRequestHeader"in d&&t.forEach(b,function(f,C){typeof S>"u"&&C.toLowerCase()==="content-type"?delete b[C]:d.setRequestHeader(C,f)}),t.isUndefined(h.withCredentials)||(d.withCredentials=!!h.withCredentials),T&&T!=="json"&&(d.responseType=h.responseType),typeof h.onDownloadProgress=="function"&&d.addEventListener("progress",h.onDownloadProgress),typeof h.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",h.onUploadProgress),(h.cancelToken||h.signal)&&(m=function(f){!d||(y(!f||f&&f.type?new p("canceled"):f),d.abort(),d=null)},h.cancelToken&&h.cancelToken.subscribe(m),h.signal&&(h.signal.aborted?m():h.signal.addEventListener("abort",m))),S||(S=null),d.send(S)})}}),Q=A((r,e)=>{"use strict";var t=U(),o=wr(),n=Fe(),i={"Content-Type":"application/x-www-form-urlencoded"};function a(s,p){!t.isUndefined(s)&&t.isUndefined(s["Content-Type"])&&(s["Content-Type"]=p)}function c(){var s;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(s=Ie()),s}function u(s,p,h){if(t.isString(s))try{return(p||JSON.parse)(s),t.trim(s)}catch(x){if(x.name!=="SyntaxError")throw x}return(h||JSON.stringify)(s)}var l={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:c(),transformRequest:[function(s,p){return o(p,"Accept"),o(p,"Content-Type"),t.isFormData(s)||t.isArrayBuffer(s)||t.isBuffer(s)||t.isStream(s)||t.isFile(s)||t.isBlob(s)?s:t.isArrayBufferView(s)?s.buffer:t.isURLSearchParams(s)?(a(p,"application/x-www-form-urlencoded;charset=utf-8"),s.toString()):t.isObject(s)||p&&p["Content-Type"]==="application/json"?(a(p,"application/json"),u(s)):s}],transformResponse:[function(s){var p=this.transitional||l.transitional,h=p&&p.silentJSONParsing,x=p&&p.forcedJSONParsing,y=!h&&this.responseType==="json";if(y||x&&t.isString(s)&&s.length)try{return JSON.parse(s)}catch(S){if(y)throw S.name==="SyntaxError"?n(S,this,"E_JSON_PARSE"):S}return s}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(s){return s>=200&&s<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};t.forEach(["delete","get","head"],function(s){l.headers[s]={}}),t.forEach(["post","put","patch"],function(s){l.headers[s]=t.merge(i)}),e.exports=l}),Or=A((r,e)=>{"use strict";var t=U(),o=Q();e.exports=function(n,i,a){var c=this||o;return t.forEach(a,function(u){n=u.call(c,n,i)}),n}}),_e=A((r,e)=>{"use strict";e.exports=function(t){return!!(t&&t.__CANCEL__)}}),jr=A((r,e)=>{"use strict";var t=U(),o=Or(),n=_e(),i=Q(),a=K();function c(u){if(u.cancelToken&&u.cancelToken.throwIfRequested(),u.signal&&u.signal.aborted)throw new a("canceled")}e.exports=function(u){c(u),u.headers=u.headers||{},u.data=o.call(u,u.data,u.headers,u.transformRequest),u.headers=t.merge(u.headers.common||{},u.headers[u.method]||{},u.headers),t.forEach(["delete","get","head","post","put","patch","common"],function(s){delete u.headers[s]});var l=u.adapter||i.adapter;return l(u).then(function(s){return c(u),s.data=o.call(u,s.data,s.headers,u.transformResponse),s},function(s){return n(s)||(c(u),s&&s.response&&(s.response.data=o.call(u,s.response.data,s.response.headers,u.transformResponse))),Promise.reject(s)})}}),De=A((r,e)=>{"use strict";var t=U();e.exports=function(o,n){n=n||{};var i={};function a(h,x){return t.isPlainObject(h)&&t.isPlainObject(x)?t.merge(h,x):t.isPlainObject(x)?t.merge({},x):t.isArray(x)?x.slice():x}function c(h){if(t.isUndefined(n[h])){if(!t.isUndefined(o[h]))return a(void 0,o[h])}else return a(o[h],n[h])}function u(h){if(!t.isUndefined(n[h]))return a(void 0,n[h])}function l(h){if(t.isUndefined(n[h])){if(!t.isUndefined(o[h]))return a(void 0,o[h])}else return a(void 0,n[h])}function s(h){if(h in n)return a(o[h],n[h]);if(h in o)return a(void 0,o[h])}var p={url:u,method:u,data:u,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:s};return t.forEach(Object.keys(o).concat(Object.keys(n)),function(h){var x=p[h]||c,y=x(h);t.isUndefined(y)&&x!==s||(i[h]=y)}),i}}),He=A((r,e)=>{e.exports={version:"0.25.0"}}),Nr=A((r,e)=>{"use strict";var t=He().version,o={};["object","boolean","number","function","string","symbol"].forEach(function(a,c){o[a]=function(u){return typeof u===a||"a"+(c<1?"n ":" ")+a}});var n={};o.transitional=function(a,c,u){function l(s,p){return"[Axios v"+t+"] Transitional option '"+s+"'"+p+(u?". "+u:"")}return function(s,p,h){if(a===!1)throw new Error(l(p," has been removed"+(c?" in "+c:"")));return c&&!n[p]&&(n[p]=!0,console.warn(l(p," has been deprecated since v"+c+" and will be removed in the near future"))),a?a(s,p,h):!0}};function i(a,c,u){if(typeof a!="object")throw new TypeError("options must be an object");for(var l=Object.keys(a),s=l.length;s-- >0;){var p=l[s],h=c[p];if(h){var x=a[p],y=x===void 0||h(x,p,a);if(y!==!0)throw new TypeError("option "+p+" must be "+y);continue}if(u!==!0)throw Error("Unknown option "+p)}}e.exports={assertOptions:i,validators:o}}),Rr=A((r,e)=>{"use strict";var t=U(),o=Le(),n=br(),i=jr(),a=De(),c=Nr(),u=c.validators;function l(s){this.defaults=s,this.interceptors={request:new n,response:new n}}l.prototype.request=function(s,p){if(typeof s=="string"?(p=p||{},p.url=s):p=s||{},!p.url)throw new Error("Provided config url is not valid");p=a(this.defaults,p),p.method?p.method=p.method.toLowerCase():this.defaults.method?p.method=this.defaults.method.toLowerCase():p.method="get";var h=p.transitional;h!==void 0&&c.assertOptions(h,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var x=[],y=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(p)===!1||(y=y&&v.synchronous,x.unshift(v.fulfilled,v.rejected))});var S=[];this.interceptors.response.forEach(function(v){S.push(v.fulfilled,v.rejected)});var b;if(!y){var T=[i,void 0];for(Array.prototype.unshift.apply(T,x),T=T.concat(S),b=Promise.resolve(p);T.length;)b=b.then(T.shift(),T.shift());return b}for(var m=p;x.length;){var g=x.shift(),d=x.shift();try{m=g(m)}catch(v){d(v);break}}try{b=i(m)}catch(v){return Promise.reject(v)}for(;S.length;)b=b.then(S.shift(),S.shift());return b},l.prototype.getUri=function(s){if(!s.url)throw new Error("Provided config url is not valid");return s=a(this.defaults,s),o(s.url,s.params,s.paramsSerializer).replace(/^\?/,"")},t.forEach(["delete","get","head","options"],function(s){l.prototype[s]=function(p,h){return this.request(a(h||{},{method:s,url:p,data:(h||{}).data}))}}),t.forEach(["post","put","patch"],function(s){l.prototype[s]=function(p,h,x){return this.request(a(x||{},{method:s,url:p,data:h}))}}),e.exports=l}),Pr=A((r,e)=>{"use strict";var t=K();function o(n){if(typeof n!="function")throw new TypeError("executor must be a function.");var i;this.promise=new Promise(function(c){i=c});var a=this;this.promise.then(function(c){if(a._listeners){var u,l=a._listeners.length;for(u=0;u<l;u++)a._listeners[u](c);a._listeners=null}}),this.promise.then=function(c){var u,l=new Promise(function(s){a.subscribe(s),u=s}).then(c);return l.cancel=function(){a.unsubscribe(u)},l},n(function(c){a.reason||(a.reason=new t(c),i(a.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.prototype.subscribe=function(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]},o.prototype.unsubscribe=function(n){if(this._listeners){var i=this._listeners.indexOf(n);i!==-1&&this._listeners.splice(i,1)}},o.source=function(){var n,i=new o(function(a){n=a});return{token:i,cancel:n}},e.exports=o}),Ir=A((r,e)=>{"use strict";e.exports=function(t){return function(o){return t.apply(null,o)}}}),qr=A((r,e)=>{"use strict";var t=U();e.exports=function(o){return t.isObject(o)&&o.isAxiosError===!0}}),Ur=A((r,e)=>{"use strict";var t=U(),o=Ue(),n=Rr(),i=De(),a=Q();function c(l){var s=new n(l),p=o(n.prototype.request,s);return t.extend(p,n.prototype,s),t.extend(p,s),p.create=function(h){return c(i(l,h))},p}var u=c(a);u.Axios=n,u.Cancel=K(),u.CancelToken=Pr(),u.isCancel=_e(),u.VERSION=He().version,u.all=function(l){return Promise.all(l)},u.spread=Ir(),u.isAxiosError=qr(),e.exports=u,e.exports.default=u}),Lr=A((r,e)=>{e.exports=Ur()}),Fr=A((r,e)=>{"use strict";e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,o=>`%${o.charCodeAt(0).toString(16).toUpperCase()}`)}),Br=A((r,e)=>{"use strict";var t="%[a-f0-9]{2}",o=new RegExp(t,"gi"),n=new RegExp("("+t+")+","gi");function i(u,l){try{return decodeURIComponent(u.join(""))}catch{}if(u.length===1)return u;l=l||1;var s=u.slice(0,l),p=u.slice(l);return Array.prototype.concat.call([],i(s),i(p))}function a(u){try{return decodeURIComponent(u)}catch{for(var l=u.match(o),s=1;s<l.length;s++)u=i(l,s).join(""),l=u.match(o);return u}}function c(u){for(var l={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},s=n.exec(u);s;){try{l[s[0]]=decodeURIComponent(s[0])}catch{var p=a(s[0]);p!==s[0]&&(l[s[0]]=p)}s=n.exec(u)}l["%C2"]="\uFFFD";for(var h=Object.keys(l),x=0;x<h.length;x++){var y=h[x];u=u.replace(new RegExp(y,"g"),l[y])}return u}e.exports=function(u){if(typeof u!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof u+"`");try{return u=u.replace(/\+/g," "),decodeURIComponent(u)}catch{return c(u)}}}),_r=A((r,e)=>{"use strict";e.exports=(t,o)=>{if(!(typeof t=="string"&&typeof o=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(o==="")return[t];let n=t.indexOf(o);return n===-1?[t]:[t.slice(0,n),t.slice(n+o.length)]}}),Dr=A((r,e)=>{"use strict";e.exports=function(t,o){for(var n={},i=Object.keys(t),a=Array.isArray(o),c=0;c<i.length;c++){var u=i[c],l=t[u];(a?o.indexOf(u)!==-1:o(u,l,t))&&(n[u]=l)}return n}}),Hr=A(r=>{"use strict";var e=Fr(),t=Br(),o=_r(),n=Dr(),i=m=>m==null,a=Symbol("encodeFragmentIdentifier");function c(m){switch(m.arrayFormat){case"index":return g=>(d,v)=>{let w=d.length;return v===void 0||m.skipNull&&v===null||m.skipEmptyString&&v===""?d:v===null?[...d,[s(g,m),"[",w,"]"].join("")]:[...d,[s(g,m),"[",s(w,m),"]=",s(v,m)].join("")]};case"bracket":return g=>(d,v)=>v===void 0||m.skipNull&&v===null||m.skipEmptyString&&v===""?d:v===null?[...d,[s(g,m),"[]"].join("")]:[...d,[s(g,m),"[]=",s(v,m)].join("")];case"colon-list-separator":return g=>(d,v)=>v===void 0||m.skipNull&&v===null||m.skipEmptyString&&v===""?d:v===null?[...d,[s(g,m),":list="].join("")]:[...d,[s(g,m),":list=",s(v,m)].join("")];case"comma":case"separator":case"bracket-separator":{let g=m.arrayFormat==="bracket-separator"?"[]=":"=";return d=>(v,w)=>w===void 0||m.skipNull&&w===null||m.skipEmptyString&&w===""?v:(w=w===null?"":w,v.length===0?[[s(d,m),g,s(w,m)].join("")]:[[v,s(w,m)].join(m.arrayFormatSeparator)])}default:return g=>(d,v)=>v===void 0||m.skipNull&&v===null||m.skipEmptyString&&v===""?d:v===null?[...d,s(g,m)]:[...d,[s(g,m),"=",s(v,m)].join("")]}}function u(m){let g;switch(m.arrayFormat){case"index":return(d,v,w)=>{if(g=/\[(\d*)\]$/.exec(d),d=d.replace(/\[\d*\]$/,""),!g){w[d]=v;return}w[d]===void 0&&(w[d]={}),w[d][g[1]]=v};case"bracket":return(d,v,w)=>{if(g=/(\[\])$/.exec(d),d=d.replace(/\[\]$/,""),!g){w[d]=v;return}if(w[d]===void 0){w[d]=[v];return}w[d]=[].concat(w[d],v)};case"colon-list-separator":return(d,v,w)=>{if(g=/(:list)$/.exec(d),d=d.replace(/:list$/,""),!g){w[d]=v;return}if(w[d]===void 0){w[d]=[v];return}w[d]=[].concat(w[d],v)};case"comma":case"separator":return(d,v,w)=>{let k=typeof v=="string"&&v.includes(m.arrayFormatSeparator),E=typeof v=="string"&&!k&&p(v,m).includes(m.arrayFormatSeparator);v=E?p(v,m):v;let P=k||E?v.split(m.arrayFormatSeparator).map(f=>p(f,m)):v===null?v:p(v,m);w[d]=P};case"bracket-separator":return(d,v,w)=>{let k=/(\[\])$/.test(d);if(d=d.replace(/\[\]$/,""),!k){w[d]=v&&p(v,m);return}let E=v===null?[]:v.split(m.arrayFormatSeparator).map(P=>p(P,m));if(w[d]===void 0){w[d]=E;return}w[d]=[].concat(w[d],E)};default:return(d,v,w)=>{if(w[d]===void 0){w[d]=v;return}w[d]=[].concat(w[d],v)}}}function l(m){if(typeof m!="string"||m.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function s(m,g){return g.encode?g.strict?e(m):encodeURIComponent(m):m}function p(m,g){return g.decode?t(m):m}function h(m){return Array.isArray(m)?m.sort():typeof m=="object"?h(Object.keys(m)).sort((g,d)=>Number(g)-Number(d)).map(g=>m[g]):m}function x(m){let g=m.indexOf("#");return g!==-1&&(m=m.slice(0,g)),m}function y(m){let g="",d=m.indexOf("#");return d!==-1&&(g=m.slice(d)),g}function S(m){m=x(m);let g=m.indexOf("?");return g===-1?"":m.slice(g+1)}function b(m,g){return g.parseNumbers&&!Number.isNaN(Number(m))&&typeof m=="string"&&m.trim()!==""?m=Number(m):g.parseBooleans&&m!==null&&(m.toLowerCase()==="true"||m.toLowerCase()==="false")&&(m=m.toLowerCase()==="true"),m}function T(m,g){g=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},g),l(g.arrayFormatSeparator);let d=u(g),v=Object.create(null);if(typeof m!="string"||(m=m.trim().replace(/^[?#&]/,""),!m))return v;for(let w of m.split("&")){if(w==="")continue;let[k,E]=o(g.decode?w.replace(/\+/g," "):w,"=");E=E===void 0?null:["comma","separator","bracket-separator"].includes(g.arrayFormat)?E:p(E,g),d(p(k,g),E,v)}for(let w of Object.keys(v)){let k=v[w];if(typeof k=="object"&&k!==null)for(let E of Object.keys(k))k[E]=b(k[E],g);else v[w]=b(k,g)}return g.sort===!1?v:(g.sort===!0?Object.keys(v).sort():Object.keys(v).sort(g.sort)).reduce((w,k)=>{let E=v[k];return Boolean(E)&&typeof E=="object"&&!Array.isArray(E)?w[k]=h(E):w[k]=E,w},Object.create(null))}r.extract=S,r.parse=T,r.stringify=(m,g)=>{if(!m)return"";g=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},g),l(g.arrayFormatSeparator);let d=E=>g.skipNull&&i(m[E])||g.skipEmptyString&&m[E]==="",v=c(g),w={};for(let E of Object.keys(m))d(E)||(w[E]=m[E]);let k=Object.keys(w);return g.sort!==!1&&k.sort(g.sort),k.map(E=>{let P=m[E];return P===void 0?"":P===null?s(E,g):Array.isArray(P)?P.length===0&&g.arrayFormat==="bracket-separator"?s(E,g)+"[]":P.reduce(v(E),[]).join("&"):s(E,g)+"="+s(P,g)}).filter(E=>E.length>0).join("&")},r.parseUrl=(m,g)=>{g=Object.assign({decode:!0},g);let[d,v]=o(m,"#");return Object.assign({url:d.split("?")[0]||"",query:T(S(m),g)},g&&g.parseFragmentIdentifier&&v?{fragmentIdentifier:p(v,g)}:{})},r.stringifyUrl=(m,g)=>{g=Object.assign({encode:!0,strict:!0,[a]:!0},g);let d=x(m.url).split("?")[0]||"",v=r.extract(m.url),w=r.parse(v,{sort:!1}),k=Object.assign(w,m.query),E=r.stringify(k,g);E&&(E=`?${E}`);let P=y(m.url);return m.fragmentIdentifier&&(P=`#${g[a]?s(m.fragmentIdentifier,g):m.fragmentIdentifier}`),`${d}${E}${P}`},r.pick=(m,g,d)=>{d=Object.assign({parseFragmentIdentifier:!0,[a]:!1},d);let{url:v,query:w,fragmentIdentifier:k}=r.parseUrl(m,d);return r.stringifyUrl({url:v,query:n(w,g),fragmentIdentifier:k},d)},r.exclude=(m,g,d)=>{let v=Array.isArray(g)?w=>!g.includes(w):(w,k)=>!g(w,k);return r.pick(m,v,d)}}),Mr=qe(Lr()),Jr=500,$r=class{url;httpClient;accessToken;constructor({url:r=""}){this.url=r,this.httpClient=Mr.default.create({baseURL:this.url}),this.httpClient.interceptors.response.use(e=>e,e=>Promise.reject({message:e.response?.data?.message??e.message??JSON.stringify(e),status:e.response?.status??Jr}))}async signUpEmailPassword(r){try{return{data:(await this.httpClient.post("/signup/email-password",r)).data,error:null}}catch(e){return{data:null,error:e}}}async signInEmailPassword(r){try{return{data:(await this.httpClient.post("/signin/email-password",r)).data,error:null}}catch(e){return{data:null,error:e}}}async signInPasswordlessEmail(r){try{return{data:(await this.httpClient.post("/signin/passwordless/email",r)).data,error:null}}catch(e){return{data:null,error:e}}}async signInPasswordlessSms(r){try{return{data:(await this.httpClient.post("/signin/passwordless/sms",r)).data,error:null}}catch(e){return{data:null,error:e}}}async signInPasswordlessSmsOtp(r){try{return{data:(await this.httpClient.post("/signin/passwordless/sms/otp",r)).data,error:null}}catch(e){return{data:null,error:e}}}async signOut(r){try{return await this.httpClient.post("/signout",r),{error:null}}catch(e){return{error:e}}}async refreshToken(r){try{let e=await this.httpClient.post("/token",r);return{error:null,session:e.data}}catch(e){return{error:e,session:null}}}async resetPassword(r){try{return await this.httpClient.post("/user/password/reset",r),{error:null}}catch(e){return{error:e}}}async changePassword(r){try{return await this.httpClient.post("/user/password",r,{headers:{...this.generateAuthHeaders()}}),{error:null}}catch(e){return{error:e}}}async sendVerificationEmail(r){try{return await this.httpClient.post("/user/email/send-verification-email",r),{error:null}}catch(e){return{error:e}}}async changeEmail(r){try{return await this.httpClient.post("/user/email/change",r,{headers:{...this.generateAuthHeaders()}}),{error:null}}catch(e){return{error:e}}}async deanonymize(r){try{return await this.httpClient.post("/user/deanonymize",r),{error:null}}catch(e){return{error:e}}}async verifyEmail(r){try{return{data:(await this.httpClient.post("/user/email/verify",r)).data,error:null}}catch(e){return{data:null,error:e}}}setAccessToken(r){this.accessToken=r}generateAuthHeaders(){return this.accessToken?{Authorization:`Bearer ${this.accessToken}`}:null}},zr=qe(Hr()),H="nhostRefreshToken",X=()=>typeof window<"u",Vr=class{memory;constructor(){this.memory={}}setItem(r,e){this.memory[r]=e}getItem(r){return this.memory[r]}removeItem(r){delete this.memory[r]}},Me=class{api;onTokenChangedFunctions;onAuthChangedFunctions;refreshInterval;refreshIntervalTime;clientStorage;clientStorageType;url;autoRefreshToken;session;initAuthLoading;refreshSleepCheckInterval;refreshIntervalSleepCheckLastSample;sampleRate;constructor({url:r,autoRefreshToken:e=!0,autoLogin:t=!0,refreshIntervalTime:o,clientStorage:n,clientStorageType:i="web"}){this.refreshIntervalTime=o,n?this.clientStorage=n:this.clientStorage=X()?localStorage:new Vr,this.clientStorageType=i,this.onTokenChangedFunctions=[],this.onAuthChangedFunctions=[],this.refreshInterval,this.refreshSleepCheckInterval=0,this.refreshIntervalSleepCheckLastSample=Date.now(),this.sampleRate=2e3,this.url=r,this.autoRefreshToken=e,this.initAuthLoading=!0,this.session=null,this.api=new $r({url:this.url});let a=null,c=!1;if(t&&X()&&window.location){let u=zr.default.parse(window.location.toString().split("#")[1]);if("refreshToken"in u&&(a=u.refreshToken),"otp"in u&&"email"in u){let{otp:l,email:s}=u;this.signIn({otp:l,email:s}),c=!0}}!c&&t?this._autoLogin(a):a&&this._setItem(H,a)}async signUp(r){let{email:e,password:t}=r;if(e&&t){let{data:o,error:n}=await this.api.signUpEmailPassword(r);if(n)return{session:null,error:n};if(!o)return{session:null,error:{message:"An error occurred on sign up.",status:500}};let{session:i}=o;return i&&await this._setSession(i),{session:i,error:null}}return{session:null,error:{message:"Incorrect parameters",status:500}}}async signIn(r){if("provider"in r){let{provider:e}=r,t=`${this.url}/signin/provider/${e}`;return X()&&(window.location.href=t),{providerUrl:t,provider:e,session:null,mfa:null,error:null}}if("email"in r&&"password"in r){let{data:e,error:t}=await this.api.signInEmailPassword(r);if(t)return{session:null,mfa:null,error:t};if(!e)return{session:null,mfa:null,error:{message:"Incorrect Data",status:500}};let{session:o,mfa:n}=e;return o&&await this._setSession(o),{session:o,mfa:n,error:null}}if("email"in r&&!("otp"in r)){let{error:e}=await this.api.signInPasswordlessEmail(r);return e?{session:null,mfa:null,error:e}:{session:null,mfa:null,error:null}}if("phoneNumber"in r&&!("otp"in r)){let{error:e}=await this.api.signInPasswordlessSms(r);return e?{session:null,mfa:null,error:e}:{session:null,mfa:null,error:null}}if("otp"in r){let{data:e,error:t}=await this.api.signInPasswordlessSmsOtp(r);if(t)return{session:null,mfa:null,error:t};if(!e)return{session:null,mfa:null,error:{message:"Incorrect data",status:500}};let{session:o,mfa:n}=e;return o&&await this._setSession(o),{session:o,mfa:n,error:null}}return{session:null,mfa:null,error:{message:"Incorrect parameters",status:500}}}async signOut(r){let e=await this._getItem(H);this._clearSession();let{error:t}=await this.api.signOut({refreshToken:e,all:r?.all});return{error:t}}async verifyEmail(r){return await this.api.verifyEmail(r)}async resetPassword(r){let{error:e}=await this.api.resetPassword(r);return{error:e}}async changePassword(r){let{error:e}=await this.api.changePassword(r);return{error:e}}async sendVerificationEmail(r){let{error:e}=await this.api.sendVerificationEmail(r);return{error:e}}async changeEmail(r){let{error:e}=await this.api.changeEmail(r);return{error:e}}async deanonymize(r){let{error:e}=await this.api.deanonymize(r);return{error:e}}onTokenChanged(r){this.onTokenChangedFunctions.push(r);let e=this.onTokenChangedFunctions.length-1;return()=>{try{this.onTokenChangedFunctions[e]=()=>{}}catch{console.warn("Unable to unsubscribe onTokenChanged function. Maybe the functions is already unsubscribed?")}}}onAuthStateChanged(r){this.onAuthChangedFunctions.push(r);let e=this.onAuthChangedFunctions.length-1;return()=>{try{this.onAuthChangedFunctions[e]=()=>{}}catch{console.warn("Unable to unsubscribe onAuthStateChanged function. Maybe you already did?")}}}isAuthenticated(){return this.session!==null}async isAuthenticatedAsync(){return new Promise(r=>{if(!this.initAuthLoading)r(this.isAuthenticated());else{let e=this.onAuthStateChanged((t,o)=>{r(t==="SIGNED_IN"),e()})}})}getAuthenticationStatus(){return this.initAuthLoading?{isAuthenticated:!1,isLoading:!0}:{isAuthenticated:this.session!==null,isLoading:!1}}getJWTToken(){return this.getAccessToken()}getAccessToken(){if(this.session)return this.session.accessToken}async refreshSession(r){let e=r||await this._getItem(H);return e||console.warn("no refresh token found. No way of refreshing session"),this._refreshTokens(e)}getSession(){return this.session}getUser(){return this.session?this.session.user:null}async _setItem(r,e){if(typeof e!="string"){console.error('value is not of type "string"');return}switch(this.clientStorageType){case"web":if(typeof this.clientStorage.setItem!="function"){console.error("this.clientStorage.setItem is not a function");break}this.clientStorage.setItem(r,e);break;case"custom":case"react-native":if(typeof this.clientStorage.setItem!="function"){console.error("this.clientStorage.setItem is not a function");break}await this.clientStorage.setItem(r,e);break;case"capacitor":if(typeof this.clientStorage.set!="function"){console.error("this.clientStorage.set is not a function");break}await this.clientStorage.set({key:r,value:e});break;case"expo-secure-storage":if(typeof this.clientStorage.setItemAsync!="function"){console.error("this.clientStorage.setItemAsync is not a function");break}this.clientStorage.setItemAsync(r,e);break;default:break}}async _getItem(r){switch(this.clientStorageType){case"web":if(typeof this.clientStorage.getItem!="function"){console.error("this.clientStorage.getItem is not a function");break}return this.clientStorage.getItem(r);case"custom":case"react-native":if(typeof this.clientStorage.getItem!="function"){console.error("this.clientStorage.getItem is not a function");break}return await this.clientStorage.getItem(r);case"capacitor":if(typeof this.clientStorage.get!="function"){console.error("this.clientStorage.get is not a function");break}return(await this.clientStorage.get({key:r})).value;case"expo-secure-storage":if(typeof this.clientStorage.getItemAsync!="function"){console.error("this.clientStorage.getItemAsync is not a function");break}return this.clientStorage.getItemAsync(r);default:return""}return""}async _removeItem(r){switch(this.clientStorageType){case"web":if(typeof this.clientStorage.removeItem!="function"){console.error("this.clientStorage.removeItem is not a function");break}return void this.clientStorage.removeItem(r);case"custom":case"react-native":if(typeof this.clientStorage.removeItem!="function"){console.error("this.clientStorage.removeItem is not a function");break}return void this.clientStorage.removeItem(r);case"capacitor":if(typeof this.clientStorage.remove!="function"){console.error("this.clientStorage.remove is not a function");break}await this.clientStorage.remove({key:r});break;case"expo-secure-storage":if(typeof this.clientStorage.deleteItemAsync!="function"){console.error("this.clientStorage.deleteItemAsync is not a function");break}this.clientStorage.deleteItemAsync(r);break;default:break}}_autoLogin(r){!X()||this._refreshTokens(r)}async _refreshTokens(r){let e=r||await this._getItem(H);if(!e){setTimeout(async()=>{await this._clearSession()},0);return}try{let{session:t,error:o}=await this.api.refreshToken({refreshToken:e});if(o&&o.status===401){await this._clearSession();return}if(!t)throw new Error("Invalid session data");await this._setSession(t),this.tokenChanged()}catch{}}tokenChanged(){for(let r of this.onTokenChangedFunctions)r(this.session)}authStateChanged({event:r,session:e}){r==="SIGNED_IN"&&e?this.api.setAccessToken(e.accessToken):this.api.setAccessToken(void 0);for(let t of this.onAuthChangedFunctions)t(r,e)}async _clearSession(){let{isLoading:r,isAuthenticated:e}=this.getAuthenticationStatus();this.session=null,this.initAuthLoading=!1,await this._removeItem(H),(r||e)&&(clearInterval(this.refreshInterval),clearInterval(this.refreshSleepCheckInterval),this.authStateChanged({event:"SIGNED_OUT",session:null}))}async _setSession(r){let{isAuthenticated:e}=this.getAuthenticationStatus();if(this.session=r,await this._setItem(H,r.refreshToken),this.autoRefreshToken&&!e){let t=r.accessTokenExpiresIn,o=this.refreshIntervalTime?this.refreshIntervalTime:Math.max(1,t-1);this.refreshInterval=setInterval(async()=>{let n=await this._getItem(H);await this._refreshTokens(n)},o*1e3),this.refreshIntervalSleepCheckLastSample=Date.now(),this.refreshSleepCheckInterval=setInterval(async()=>{if(Date.now()-this.refreshIntervalSleepCheckLastSample>=this.sampleRate*2){let n=await this._getItem(H);await this._refreshTokens(n)}this.refreshIntervalSleepCheckLastSample=Date.now()},this.sampleRate),this.authStateChanged({event:"SIGNED_IN",session:this.session})}this.initAuthLoading=!1}};var Gr=Object.create,ae=Object.defineProperty,Wr=Object.getOwnPropertyDescriptor,Xr=Object.getOwnPropertyNames,Kr=Object.getPrototypeOf,Qr=Object.prototype.hasOwnProperty,Yr=r=>ae(r,"__esModule",{value:!0}),N=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Zr=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Xr(e))!Qr.call(r,n)&&(t||n!=="default")&&ae(r,n,{get:()=>e[n],enumerable:!(o=Wr(e,n))||o.enumerable});return r},en=(r,e)=>Zr(Yr(ae(r!=null?Gr(Kr(r)):{},"default",!e&&r&&r.__esModule?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r),$e=N((r,e)=>{"use strict";e.exports=function(t,o){return function(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];return t.apply(o,n)}}}),B=N((r,e)=>{"use strict";var t=$e(),o=Object.prototype.toString;function n(f){return o.call(f)==="[object Array]"}function i(f){return typeof f>"u"}function a(f){return f!==null&&!i(f)&&f.constructor!==null&&!i(f.constructor)&&typeof f.constructor.isBuffer=="function"&&f.constructor.isBuffer(f)}function c(f){return o.call(f)==="[object ArrayBuffer]"}function u(f){return typeof FormData<"u"&&f instanceof FormData}function l(f){var C;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?C=ArrayBuffer.isView(f):C=f&&f.buffer&&f.buffer instanceof ArrayBuffer,C}function s(f){return typeof f=="string"}function p(f){return typeof f=="number"}function h(f){return f!==null&&typeof f=="object"}function x(f){if(o.call(f)!=="[object Object]")return!1;var C=Object.getPrototypeOf(f);return C===null||C===Object.prototype}function y(f){return o.call(f)==="[object Date]"}function S(f){return o.call(f)==="[object File]"}function b(f){return o.call(f)==="[object Blob]"}function T(f){return o.call(f)==="[object Function]"}function m(f){return h(f)&&T(f.pipe)}function g(f){return typeof URLSearchParams<"u"&&f instanceof URLSearchParams}function d(f){return f.trim?f.trim():f.replace(/^\s+|\s+$/g,"")}function v(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function w(f,C){if(!(f===null||typeof f>"u"))if(typeof f!="object"&&(f=[f]),n(f))for(var R=0,I=f.length;R<I;R++)C.call(null,f[R],R,f);else for(var O in f)Object.prototype.hasOwnProperty.call(f,O)&&C.call(null,f[O],O,f)}function k(){var f={};function C(O,F){x(f[F])&&x(O)?f[F]=k(f[F],O):x(O)?f[F]=k({},O):n(O)?f[F]=O.slice():f[F]=O}for(var R=0,I=arguments.length;R<I;R++)w(arguments[R],C);return f}function E(f,C,R){return w(C,function(I,O){R&&typeof I=="function"?f[O]=t(I,R):f[O]=I}),f}function P(f){return f.charCodeAt(0)===65279&&(f=f.slice(1)),f}e.exports={isArray:n,isArrayBuffer:c,isBuffer:a,isFormData:u,isArrayBufferView:l,isString:s,isNumber:p,isObject:h,isPlainObject:x,isUndefined:i,isDate:y,isFile:S,isBlob:b,isFunction:T,isStream:m,isURLSearchParams:g,isStandardBrowserEnv:v,forEach:w,merge:k,extend:E,trim:d,stripBOM:P}}),ze=N((r,e)=>{"use strict";var t=B();function o(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(n,i,a){if(!i)return n;var c;if(a)c=a(i);else if(t.isURLSearchParams(i))c=i.toString();else{var u=[];t.forEach(i,function(s,p){s===null||typeof s>"u"||(t.isArray(s)?p=p+"[]":s=[s],t.forEach(s,function(h){t.isDate(h)?h=h.toISOString():t.isObject(h)&&(h=JSON.stringify(h)),u.push(o(p)+"="+o(h))}))}),c=u.join("&")}if(c){var l=n.indexOf("#");l!==-1&&(n=n.slice(0,l)),n+=(n.indexOf("?")===-1?"?":"&")+c}return n}}),tn=N((r,e)=>{"use strict";var t=B();function o(){this.handlers=[]}o.prototype.use=function(n,i,a){return this.handlers.push({fulfilled:n,rejected:i,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(n){this.handlers[n]&&(this.handlers[n]=null)},o.prototype.forEach=function(n){t.forEach(this.handlers,function(i){i!==null&&n(i)})},e.exports=o}),rn=N((r,e)=>{"use strict";var t=B();e.exports=function(o,n){t.forEach(o,function(i,a){a!==n&&a.toUpperCase()===n.toUpperCase()&&(o[n]=i,delete o[a])})}}),Ve=N((r,e)=>{"use strict";e.exports=function(t,o,n,i,a){return t.config=o,n&&(t.code=n),t.request=i,t.response=a,t.isAxiosError=!0,t.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}},t}}),Ge=N((r,e)=>{"use strict";var t=Ve();e.exports=function(o,n,i,a,c){var u=new Error(o);return t(u,n,i,a,c)}}),nn=N((r,e)=>{"use strict";var t=Ge();e.exports=function(o,n,i){var a=i.config.validateStatus;!i.status||!a||a(i.status)?o(i):n(t("Request failed with status code "+i.status,i.config,null,i.request,i))}}),sn=N((r,e)=>{"use strict";var t=B();e.exports=t.isStandardBrowserEnv()?function(){return{write:function(o,n,i,a,c,u){var l=[];l.push(o+"="+encodeURIComponent(n)),t.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),t.isString(a)&&l.push("path="+a),t.isString(c)&&l.push("domain="+c),u===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(o){var n=document.cookie.match(new RegExp("(^|;\\s*)("+o+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(o){this.write(o,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()}),on=N((r,e)=>{"use strict";e.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}}),an=N((r,e)=>{"use strict";e.exports=function(t,o){return o?t.replace(/\/+$/,"")+"/"+o.replace(/^\/+/,""):t}}),un=N((r,e)=>{"use strict";var t=on(),o=an();e.exports=function(n,i){return n&&!t(i)?o(n,i):i}}),cn=N((r,e)=>{"use strict";var t=B(),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(n){var i={},a,c,u;return n&&t.forEach(n.split(`
4
- `),function(l){if(u=l.indexOf(":"),a=t.trim(l.substr(0,u)).toLowerCase(),c=t.trim(l.substr(u+1)),a){if(i[a]&&o.indexOf(a)>=0)return;a==="set-cookie"?i[a]=(i[a]?i[a]:[]).concat([c]):i[a]=i[a]?i[a]+", "+c:c}}),i}}),ln=N((r,e)=>{"use strict";var t=B();e.exports=t.isStandardBrowserEnv()?function(){var o=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a"),i;function a(c){var u=c;return o&&(n.setAttribute("href",u),u=n.href),n.setAttribute("href",u),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return i=a(window.location.href),function(c){var u=t.isString(c)?a(c):c;return u.protocol===i.protocol&&u.host===i.host}}():function(){return function(){return!0}}()}),Je=N((r,e)=>{"use strict";var t=B(),o=nn(),n=sn(),i=ze(),a=un(),c=cn(),u=ln(),l=Ge();e.exports=function(s){return new Promise(function(p,h){var x=s.data,y=s.headers,S=s.responseType;t.isFormData(x)&&delete y["Content-Type"];var b=new XMLHttpRequest;if(s.auth){var T=s.auth.username||"",m=s.auth.password?unescape(encodeURIComponent(s.auth.password)):"";y.Authorization="Basic "+btoa(T+":"+m)}var g=a(s.baseURL,s.url);b.open(s.method.toUpperCase(),i(g,s.params,s.paramsSerializer),!0),b.timeout=s.timeout;function d(){if(b){var w="getAllResponseHeaders"in b?c(b.getAllResponseHeaders()):null,k=!S||S==="text"||S==="json"?b.responseText:b.response,E={data:k,status:b.status,statusText:b.statusText,headers:w,config:s,request:b};o(p,h,E),b=null}}if("onloadend"in b?b.onloadend=d:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(d)},b.onabort=function(){!b||(h(l("Request aborted",s,"ECONNABORTED",b)),b=null)},b.onerror=function(){h(l("Network Error",s,null,b)),b=null},b.ontimeout=function(){var w="timeout of "+s.timeout+"ms exceeded";s.timeoutErrorMessage&&(w=s.timeoutErrorMessage),h(l(w,s,s.transitional&&s.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",b)),b=null},t.isStandardBrowserEnv()){var v=(s.withCredentials||u(g))&&s.xsrfCookieName?n.read(s.xsrfCookieName):void 0;v&&(y[s.xsrfHeaderName]=v)}"setRequestHeader"in b&&t.forEach(y,function(w,k){typeof x>"u"&&k.toLowerCase()==="content-type"?delete y[k]:b.setRequestHeader(k,w)}),t.isUndefined(s.withCredentials)||(b.withCredentials=!!s.withCredentials),S&&S!=="json"&&(b.responseType=s.responseType),typeof s.onDownloadProgress=="function"&&b.addEventListener("progress",s.onDownloadProgress),typeof s.onUploadProgress=="function"&&b.upload&&b.upload.addEventListener("progress",s.onUploadProgress),s.cancelToken&&s.cancelToken.promise.then(function(w){!b||(b.abort(),h(w),b=null)}),x||(x=null),b.send(x)})}}),ue=N((r,e)=>{"use strict";var t=B(),o=rn(),n=Ve(),i={"Content-Type":"application/x-www-form-urlencoded"};function a(s,p){!t.isUndefined(s)&&t.isUndefined(s["Content-Type"])&&(s["Content-Type"]=p)}function c(){var s;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(s=Je()),s}function u(s,p,h){if(t.isString(s))try{return(p||JSON.parse)(s),t.trim(s)}catch(x){if(x.name!=="SyntaxError")throw x}return(h||JSON.stringify)(s)}var l={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:c(),transformRequest:[function(s,p){return o(p,"Accept"),o(p,"Content-Type"),t.isFormData(s)||t.isArrayBuffer(s)||t.isBuffer(s)||t.isStream(s)||t.isFile(s)||t.isBlob(s)?s:t.isArrayBufferView(s)?s.buffer:t.isURLSearchParams(s)?(a(p,"application/x-www-form-urlencoded;charset=utf-8"),s.toString()):t.isObject(s)||p&&p["Content-Type"]==="application/json"?(a(p,"application/json"),u(s)):s}],transformResponse:[function(s){var p=this.transitional,h=p&&p.silentJSONParsing,x=p&&p.forcedJSONParsing,y=!h&&this.responseType==="json";if(y||x&&t.isString(s)&&s.length)try{return JSON.parse(s)}catch(S){if(y)throw S.name==="SyntaxError"?n(S,this,"E_JSON_PARSE"):S}return s}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(s){return s>=200&&s<300}};l.headers={common:{Accept:"application/json, text/plain, */*"}},t.forEach(["delete","get","head"],function(s){l.headers[s]={}}),t.forEach(["post","put","patch"],function(s){l.headers[s]=t.merge(i)}),e.exports=l}),fn=N((r,e)=>{"use strict";var t=B(),o=ue();e.exports=function(n,i,a){var c=this||o;return t.forEach(a,function(u){n=u.call(c,n,i)}),n}}),We=N((r,e)=>{"use strict";e.exports=function(t){return!!(t&&t.__CANCEL__)}}),hn=N((r,e)=>{"use strict";var t=B(),o=fn(),n=We(),i=ue();function a(c){c.cancelToken&&c.cancelToken.throwIfRequested()}e.exports=function(c){a(c),c.headers=c.headers||{},c.data=o.call(c,c.data,c.headers,c.transformRequest),c.headers=t.merge(c.headers.common||{},c.headers[c.method]||{},c.headers),t.forEach(["delete","get","head","post","put","patch","common"],function(l){delete c.headers[l]});var u=c.adapter||i.adapter;return u(c).then(function(l){return a(c),l.data=o.call(c,l.data,l.headers,c.transformResponse),l},function(l){return n(l)||(a(c),l&&l.response&&(l.response.data=o.call(c,l.response.data,l.response.headers,c.transformResponse))),Promise.reject(l)})}}),Xe=N((r,e)=>{"use strict";var t=B();e.exports=function(o,n){n=n||{};var i={},a=["url","method","data"],c=["headers","auth","proxy","params"],u=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],l=["validateStatus"];function s(y,S){return t.isPlainObject(y)&&t.isPlainObject(S)?t.merge(y,S):t.isPlainObject(S)?t.merge({},S):t.isArray(S)?S.slice():S}function p(y){t.isUndefined(n[y])?t.isUndefined(o[y])||(i[y]=s(void 0,o[y])):i[y]=s(o[y],n[y])}t.forEach(a,function(y){t.isUndefined(n[y])||(i[y]=s(void 0,n[y]))}),t.forEach(c,p),t.forEach(u,function(y){t.isUndefined(n[y])?t.isUndefined(o[y])||(i[y]=s(void 0,o[y])):i[y]=s(void 0,n[y])}),t.forEach(l,function(y){y in n?i[y]=s(o[y],n[y]):y in o&&(i[y]=s(void 0,o[y]))});var h=a.concat(c).concat(u).concat(l),x=Object.keys(o).concat(Object.keys(n)).filter(function(y){return h.indexOf(y)===-1});return t.forEach(x,p),i}}),pn=N((r,e)=>{e.exports={name:"axios",version:"0.21.4",description:"Promise based HTTP client for the browser and node.js",main:"index.js",scripts:{test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},repository:{type:"git",url:"https://github.com/axios/axios.git"},keywords:["xhr","http","ajax","promise","node"],author:"Matt Zabriskie",license:"MIT",bugs:{url:"https://github.com/axios/axios/issues"},homepage:"https://axios-http.com",devDependencies:{coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},browser:{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},jsdelivr:"dist/axios.min.js",unpkg:"dist/axios.min.js",typings:"./index.d.ts",dependencies:{"follow-redirects":"^1.14.0"},bundlesize:[{path:"./dist/axios.min.js",threshold:"5kB"}]}}),dn=N((r,e)=>{"use strict";var t=pn(),o={};["object","boolean","number","function","string","symbol"].forEach(function(u,l){o[u]=function(s){return typeof s===u||"a"+(l<1?"n ":" ")+u}});var n={},i=t.version.split(".");function a(u,l){for(var s=l?l.split("."):i,p=u.split("."),h=0;h<3;h++){if(s[h]>p[h])return!0;if(s[h]<p[h])return!1}return!1}o.transitional=function(u,l,s){var p=l&&a(l);function h(x,y){return"[Axios v"+t.version+"] Transitional option '"+x+"'"+y+(s?". "+s:"")}return function(x,y,S){if(u===!1)throw new Error(h(y," has been removed in "+l));return p&&!n[y]&&(n[y]=!0,console.warn(h(y," has been deprecated since v"+l+" and will be removed in the near future"))),u?u(x,y,S):!0}};function c(u,l,s){if(typeof u!="object")throw new TypeError("options must be an object");for(var p=Object.keys(u),h=p.length;h-- >0;){var x=p[h],y=l[x];if(y){var S=u[x],b=S===void 0||y(S,x,u);if(b!==!0)throw new TypeError("option "+x+" must be "+b);continue}if(s!==!0)throw Error("Unknown option "+x)}}e.exports={isOlderVersion:a,assertOptions:c,validators:o}}),mn=N((r,e)=>{"use strict";var t=B(),o=ze(),n=tn(),i=hn(),a=Xe(),c=dn(),u=c.validators;function l(s){this.defaults=s,this.interceptors={request:new n,response:new n}}l.prototype.request=function(s){typeof s=="string"?(s=arguments[1]||{},s.url=arguments[0]):s=s||{},s=a(this.defaults,s),s.method?s.method=s.method.toLowerCase():this.defaults.method?s.method=this.defaults.method.toLowerCase():s.method="get";var p=s.transitional;p!==void 0&&c.assertOptions(p,{silentJSONParsing:u.transitional(u.boolean,"1.0.0"),forcedJSONParsing:u.transitional(u.boolean,"1.0.0"),clarifyTimeoutError:u.transitional(u.boolean,"1.0.0")},!1);var h=[],x=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(s)===!1||(x=x&&d.synchronous,h.unshift(d.fulfilled,d.rejected))});var y=[];this.interceptors.response.forEach(function(d){y.push(d.fulfilled,d.rejected)});var S;if(!x){var b=[i,void 0];for(Array.prototype.unshift.apply(b,h),b=b.concat(y),S=Promise.resolve(s);b.length;)S=S.then(b.shift(),b.shift());return S}for(var T=s;h.length;){var m=h.shift(),g=h.shift();try{T=m(T)}catch(d){g(d);break}}try{S=i(T)}catch(d){return Promise.reject(d)}for(;y.length;)S=S.then(y.shift(),y.shift());return S},l.prototype.getUri=function(s){return s=a(this.defaults,s),o(s.url,s.params,s.paramsSerializer).replace(/^\?/,"")},t.forEach(["delete","get","head","options"],function(s){l.prototype[s]=function(p,h){return this.request(a(h||{},{method:s,url:p,data:(h||{}).data}))}}),t.forEach(["post","put","patch"],function(s){l.prototype[s]=function(p,h,x){return this.request(a(x||{},{method:s,url:p,data:h}))}}),e.exports=l}),Ke=N((r,e)=>{"use strict";function t(o){this.message=o}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t}),gn=N((r,e)=>{"use strict";var t=Ke();function o(n){if(typeof n!="function")throw new TypeError("executor must be a function.");var i;this.promise=new Promise(function(c){i=c});var a=this;n(function(c){a.reason||(a.reason=new t(c),i(a.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var n,i=new o(function(a){n=a});return{token:i,cancel:n}},e.exports=o}),vn=N((r,e)=>{"use strict";e.exports=function(t){return function(o){return t.apply(null,o)}}}),yn=N((r,e)=>{"use strict";e.exports=function(t){return typeof t=="object"&&t.isAxiosError===!0}}),bn=N((r,e)=>{"use strict";var t=B(),o=$e(),n=mn(),i=Xe(),a=ue();function c(l){var s=new n(l),p=o(n.prototype.request,s);return t.extend(p,n.prototype,s),t.extend(p,s),p}var u=c(a);u.Axios=n,u.create=function(l){return c(i(u.defaults,l))},u.Cancel=Ke(),u.CancelToken=gn(),u.isCancel=We(),u.all=function(l){return Promise.all(l)},u.spread=vn(),u.isAxiosError=yn(),e.exports=u,e.exports.default=u}),wn=N((r,e)=>{e.exports=bn()}),xn=en(wn()),Sn=class{url;httpClient;accessToken;constructor({url:r}){this.url=r,this.httpClient=xn.default.create({baseURL:this.url})}async upload(r){try{return{fileMetadata:(await this.httpClient.post("/files",r.file,{headers:{...this.generateUploadHeaders(r),...this.generateAuthHeaders()}})).data,error:null}}catch(e){return{fileMetadata:null,error:e}}}async getPresignedUrl(r){try{let{fileId:e}=r;return{presignedUrl:(await this.httpClient.get(`/files/${e}/presignedurl`,{headers:{...this.generateAuthHeaders()}})).data,error:null}}catch(e){return{presignedUrl:null,error:e}}}async delete(r){try{let{fileId:e}=r;return await this.httpClient.delete(`/files/${e}`,{headers:{...this.generateAuthHeaders()}}),{error:null}}catch(e){return{error:e}}}setAccessToken(r){this.accessToken=r}generateUploadHeaders(r){let{bucketId:e,name:t,id:o}=r,n={};return e&&(n["x-nhost-bucket-id"]=e),o&&(n["x-nhost-file-id"]=o),t&&(n["x-nhost-file-name"]=t),n}generateAuthHeaders(){return this.accessToken?{Authorization:`Bearer ${this.accessToken}`}:null}},Qe=class{url;api;constructor({url:r}){this.url=r,this.api=new Sn({url:r})}async upload(r){let e=new FormData;e.append("file",r.file);let{fileMetadata:t,error:o}=await this.api.upload({...r,file:e});return o?{fileMetadata:null,error:o}:t?{fileMetadata:t,error:null}:{fileMetadata:null,error:new Error("Invalid file returned")}}getUrl(r){let{fileId:e}=r;return`${this.url}/files/${e}`}async getPresignedUrl(r){let{presignedUrl:e,error:t}=await this.api.getPresignedUrl(r);return t?{presignedUrl:null,error:t}:e?{presignedUrl:e,error:null}:{presignedUrl:null,error:new Error("Invalid file id")}}async delete(r){let{error:e}=await this.api.delete(r);return e?{error:e}:{error:null}}setAccessToken(r){this.api.setAccessToken(r)}};var nr=Pe(Oe()),je=class{instance;accessToken;constructor(e){let{url:t}=e;this.accessToken=null,this.instance=nr.default.create({baseURL:t})}async call(e,t,o){let n={...this.generateAccessTokenHeaders(),...o?.headers},i;try{i=await this.instance.post(e,t,{...o,headers:n})}catch(a){if(a instanceof Error)return{res:null,error:a}}return i?{res:i,error:null}:{res:null,error:new Error("Unable to make post request to funtion")}}setAccessToken(e){if(!e){this.accessToken=null;return}this.accessToken=e}generateAccessTokenHeaders(){if(!!this.accessToken)return{Authorization:`Bearer ${this.accessToken}`}}};var sr=Pe(Oe()),Ne=class{url;instance;accessToken;constructor(e){let{url:t}=e;this.url=t,this.accessToken=null,this.instance=sr.default.create({baseURL:t})}async request(e,t,o){let n={...o?.headers,...this.generateAccessTokenHeaders()},i="",a;try{a=(await this.instance.post("",{operationName:i||void 0,query:e,variables:t},{...o,headers:n})).data}catch(c){return c instanceof Error?{data:null,error:c}:(console.error(c),{data:null,error:new Error("Unable to get do GraphQL request")})}return typeof a!="object"||Array.isArray(a)||a===null?{data:null,error:new Error("incorrect response data from GraphQL server")}:(a=a,a.errors?{data:null,error:a.errors}:{data:a.data,error:null})}getUrl(){return this.url}setAccessToken(e){if(!e){this.accessToken=null;return}this.accessToken=e}generateAccessTokenHeaders(){if(!!this.accessToken)return{Authorization:`Bearer ${this.accessToken}`}}};var Re=class{auth;storage;functions;graphql;constructor(e){if(!e.backendUrl)throw new Error("Please specify a `backendUrl`. Docs: [todo]!");let{backendUrl:t,refreshIntervalTime:o,clientStorage:n,clientStorageType:i,autoRefreshToken:a,autoLogin:c}=e;this.auth=new Me({url:`${t}/v1/auth`,refreshIntervalTime:o,clientStorage:n,clientStorageType:i,autoRefreshToken:a,autoLogin:c}),this.storage=new Qe({url:`${t}/v1/storage`}),this.functions=new je({url:`${t}/v1/functions`}),this.graphql=new Ne({url:`${t}/v1/graphql`}),this.storage.setAccessToken(this.auth.getAccessToken()),this.functions.setAccessToken(this.auth.getAccessToken()),this.graphql.setAccessToken(this.auth.getAccessToken()),this.auth.onAuthStateChanged((u,l)=>{this.storage.setAccessToken(l?.accessToken),this.functions.setAccessToken(l?.accessToken),this.graphql.setAccessToken(l?.accessToken)}),this.auth.onTokenChanged(u=>{this.storage.setAccessToken(u?.accessToken),this.functions.setAccessToken(u?.accessToken),this.graphql.setAccessToken(u?.accessToken)})}};var fo=r=>new Re(r);export{Re as NhostClient,fo as createClient};
1
+ var or=Object.create;var oe=Object.defineProperty;var ir=Object.getOwnPropertyDescriptor;var ar=Object.getOwnPropertyNames;var ur=Object.getPrototypeOf,cr=Object.prototype.hasOwnProperty;var lr=r=>oe(r,"__esModule",{value:!0});var j=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var fr=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ar(e))!cr.call(r,n)&&(t||n!=="default")&&oe(r,n,{get:()=>e[n],enumerable:!(o=ir(e,n))||o.enumerable});return r},Ie=(r,e)=>fr(lr(oe(r!=null?or(ur(r)):{},"default",!e&&r&&r.__esModule?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r);var ce=j((bs,Ye)=>{"use strict";Ye.exports=function(e,t){return function(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];return e.apply(t,n)}}});var L=j((ws,tt)=>{"use strict";var En=ce(),M=Object.prototype.toString;function he(r){return M.call(r)==="[object Array]"}function le(r){return typeof r>"u"}function kn(r){return r!==null&&!le(r)&&r.constructor!==null&&!le(r.constructor)&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function Cn(r){return M.call(r)==="[object ArrayBuffer]"}function An(r){return typeof FormData<"u"&&r instanceof FormData}function Tn(r){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&r.buffer instanceof ArrayBuffer,e}function On(r){return typeof r=="string"}function jn(r){return typeof r=="number"}function Ze(r){return r!==null&&typeof r=="object"}function Y(r){if(M.call(r)!=="[object Object]")return!1;var e=Object.getPrototypeOf(r);return e===null||e===Object.prototype}function Nn(r){return M.call(r)==="[object Date]"}function Rn(r){return M.call(r)==="[object File]"}function In(r){return M.call(r)==="[object Blob]"}function et(r){return M.call(r)==="[object Function]"}function Pn(r){return Ze(r)&&et(r.pipe)}function qn(r){return typeof URLSearchParams<"u"&&r instanceof URLSearchParams}function Un(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Ln(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function pe(r,e){if(!(r===null||typeof r>"u"))if(typeof r!="object"&&(r=[r]),he(r))for(var t=0,o=r.length;t<o;t++)e.call(null,r[t],t,r);else for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.call(null,r[n],n,r)}function fe(){var r={};function e(n,i){Y(r[i])&&Y(n)?r[i]=fe(r[i],n):Y(n)?r[i]=fe({},n):he(n)?r[i]=n.slice():r[i]=n}for(var t=0,o=arguments.length;t<o;t++)pe(arguments[t],e);return r}function Fn(r,e,t){return pe(e,function(n,i){t&&typeof n=="function"?r[i]=En(n,t):r[i]=n}),r}function Bn(r){return r.charCodeAt(0)===65279&&(r=r.slice(1)),r}tt.exports={isArray:he,isArrayBuffer:Cn,isBuffer:kn,isFormData:An,isArrayBufferView:Tn,isString:On,isNumber:jn,isObject:Ze,isPlainObject:Y,isUndefined:le,isDate:Nn,isFile:Rn,isBlob:In,isFunction:et,isStream:Pn,isURLSearchParams:qn,isStandardBrowserEnv:Ln,forEach:pe,merge:fe,extend:Fn,trim:Un,stripBOM:Bn}});var de=j((xs,nt)=>{"use strict";var J=L();function rt(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}nt.exports=function(e,t,o){if(!t)return e;var n;if(o)n=o(t);else if(J.isURLSearchParams(t))n=t.toString();else{var i=[];J.forEach(t,function(u,l){u===null||typeof u>"u"||(J.isArray(u)?l=l+"[]":u=[u],J.forEach(u,function(p){J.isDate(p)?p=p.toISOString():J.isObject(p)&&(p=JSON.stringify(p)),i.push(rt(l)+"="+rt(p))}))}),n=i.join("&")}if(n){var a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+n}return e}});var ot=j((Ss,st)=>{"use strict";var _n=L();function Z(){this.handlers=[]}Z.prototype.use=function(e,t,o){return this.handlers.push({fulfilled:e,rejected:t,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1};Z.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};Z.prototype.forEach=function(e){_n.forEach(this.handlers,function(o){o!==null&&e(o)})};st.exports=Z});var at=j((Es,it)=>{"use strict";var Dn=L();it.exports=function(e,t){Dn.forEach(e,function(n,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[i])})}});var me=j((ks,ut)=>{"use strict";ut.exports=function(e,t,o,n,i){return e.config=t,o&&(e.code=o),e.request=n,e.response=i,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}});var ge=j((Cs,ct)=>{"use strict";var Hn=me();ct.exports=function(e,t,o,n,i){var a=new Error(e);return Hn(a,t,o,n,i)}});var ft=j((As,lt)=>{"use strict";var Mn=ge();lt.exports=function(e,t,o){var n=o.config.validateStatus;!o.status||!n||n(o.status)?e(o):t(Mn("Request failed with status code "+o.status,o.config,null,o.request,o))}});var pt=j((Ts,ht)=>{"use strict";var ee=L();ht.exports=ee.isStandardBrowserEnv()?function(){return{write:function(t,o,n,i,a,c){var u=[];u.push(t+"="+encodeURIComponent(o)),ee.isNumber(n)&&u.push("expires="+new Date(n).toGMTString()),ee.isString(i)&&u.push("path="+i),ee.isString(a)&&u.push("domain="+a),c===!0&&u.push("secure"),document.cookie=u.join("; ")},read:function(t){var o=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return o?decodeURIComponent(o[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()});var mt=j((Os,dt)=>{"use strict";dt.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}});var vt=j((js,gt)=>{"use strict";gt.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}});var bt=j((Ns,yt)=>{"use strict";var Jn=mt(),$n=vt();yt.exports=function(e,t){return e&&!Jn(t)?$n(e,t):t}});var xt=j((Rs,wt)=>{"use strict";var ve=L(),zn=["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"];wt.exports=function(e){var t={},o,n,i;return e&&ve.forEach(e.split(`
2
+ `),function(c){if(i=c.indexOf(":"),o=ve.trim(c.substr(0,i)).toLowerCase(),n=ve.trim(c.substr(i+1)),o){if(t[o]&&zn.indexOf(o)>=0)return;o==="set-cookie"?t[o]=(t[o]?t[o]:[]).concat([n]):t[o]=t[o]?t[o]+", "+n:n}}),t}});var kt=j((Is,Et)=>{"use strict";var St=L();Et.exports=St.isStandardBrowserEnv()?function(){var e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a"),o;function n(i){var a=i;return e&&(t.setAttribute("href",a),a=t.href),t.setAttribute("href",a),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:t.pathname.charAt(0)==="/"?t.pathname:"/"+t.pathname}}return o=n(window.location.href),function(a){var c=St.isString(a)?n(a):a;return c.protocol===o.protocol&&c.host===o.host}}():function(){return function(){return!0}}()});var V=j((Ps,Ct)=>{"use strict";function ye(r){this.message=r}ye.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")};ye.prototype.__CANCEL__=!0;Ct.exports=ye});var we=j((qs,At)=>{"use strict";var te=L(),Vn=ft(),Gn=pt(),Wn=de(),Xn=bt(),Kn=xt(),Qn=kt(),be=ge(),Yn=G(),Zn=V();At.exports=function(e){return new Promise(function(o,n){var i=e.data,a=e.headers,c=e.responseType,u;function l(){e.cancelToken&&e.cancelToken.unsubscribe(u),e.signal&&e.signal.removeEventListener("abort",u)}te.isFormData(i)&&delete a["Content-Type"];var s=new XMLHttpRequest;if(e.auth){var p=e.auth.username||"",h=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";a.Authorization="Basic "+btoa(p+":"+h)}var x=Xn(e.baseURL,e.url);s.open(e.method.toUpperCase(),Wn(x,e.params,e.paramsSerializer),!0),s.timeout=e.timeout;function y(){if(!!s){var b="getAllResponseHeaders"in s?Kn(s.getAllResponseHeaders()):null,A=!c||c==="text"||c==="json"?s.responseText:s.response,m={data:A,status:s.status,statusText:s.statusText,headers:b,config:e,request:s};Vn(function(d){o(d),l()},function(d){n(d),l()},m),s=null}}if("onloadend"in s?s.onloadend=y:s.onreadystatechange=function(){!s||s.readyState!==4||s.status===0&&!(s.responseURL&&s.responseURL.indexOf("file:")===0)||setTimeout(y)},s.onabort=function(){!s||(n(be("Request aborted",e,"ECONNABORTED",s)),s=null)},s.onerror=function(){n(be("Network Error",e,null,s)),s=null},s.ontimeout=function(){var A=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded",m=e.transitional||Yn.transitional;e.timeoutErrorMessage&&(A=e.timeoutErrorMessage),n(be(A,e,m.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",s)),s=null},te.isStandardBrowserEnv()){var S=(e.withCredentials||Qn(x))&&e.xsrfCookieName?Gn.read(e.xsrfCookieName):void 0;S&&(a[e.xsrfHeaderName]=S)}"setRequestHeader"in s&&te.forEach(a,function(A,m){typeof i>"u"&&m.toLowerCase()==="content-type"?delete a[m]:s.setRequestHeader(m,A)}),te.isUndefined(e.withCredentials)||(s.withCredentials=!!e.withCredentials),c&&c!=="json"&&(s.responseType=e.responseType),typeof e.onDownloadProgress=="function"&&s.addEventListener("progress",e.onDownloadProgress),typeof e.onUploadProgress=="function"&&s.upload&&s.upload.addEventListener("progress",e.onUploadProgress),(e.cancelToken||e.signal)&&(u=function(b){!s||(n(!b||b&&b.type?new Zn("canceled"):b),s.abort(),s=null)},e.cancelToken&&e.cancelToken.subscribe(u),e.signal&&(e.signal.aborted?u():e.signal.addEventListener("abort",u))),i||(i=null),s.send(i)})}});var G=j((Us,jt)=>{"use strict";var q=L(),Tt=at(),es=me(),ts={"Content-Type":"application/x-www-form-urlencoded"};function Ot(r,e){!q.isUndefined(r)&&q.isUndefined(r["Content-Type"])&&(r["Content-Type"]=e)}function rs(){var r;return typeof XMLHttpRequest<"u"?r=we():typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]"&&(r=we()),r}function ns(r,e,t){if(q.isString(r))try{return(e||JSON.parse)(r),q.trim(r)}catch(o){if(o.name!=="SyntaxError")throw o}return(t||JSON.stringify)(r)}var re={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:rs(),transformRequest:[function(e,t){return Tt(t,"Accept"),Tt(t,"Content-Type"),q.isFormData(e)||q.isArrayBuffer(e)||q.isBuffer(e)||q.isStream(e)||q.isFile(e)||q.isBlob(e)?e:q.isArrayBufferView(e)?e.buffer:q.isURLSearchParams(e)?(Ot(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):q.isObject(e)||t&&t["Content-Type"]==="application/json"?(Ot(t,"application/json"),ns(e)):e}],transformResponse:[function(e){var t=this.transitional||re.transitional,o=t&&t.silentJSONParsing,n=t&&t.forcedJSONParsing,i=!o&&this.responseType==="json";if(i||n&&q.isString(e)&&e.length)try{return JSON.parse(e)}catch(a){if(i)throw a.name==="SyntaxError"?es(a,this,"E_JSON_PARSE"):a}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, */*"}}};q.forEach(["delete","get","head"],function(e){re.headers[e]={}});q.forEach(["post","put","patch"],function(e){re.headers[e]=q.merge(ts)});jt.exports=re});var Rt=j((Ls,Nt)=>{"use strict";var ss=L(),os=G();Nt.exports=function(e,t,o){var n=this||os;return ss.forEach(o,function(a){e=a.call(n,e,t)}),e}});var xe=j((Fs,It)=>{"use strict";It.exports=function(e){return!!(e&&e.__CANCEL__)}});var Ut=j((Bs,qt)=>{"use strict";var Pt=L(),Se=Rt(),is=xe(),as=G(),us=V();function Ee(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new us("canceled")}qt.exports=function(e){Ee(e),e.headers=e.headers||{},e.data=Se.call(e,e.data,e.headers,e.transformRequest),e.headers=Pt.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Pt.forEach(["delete","get","head","post","put","patch","common"],function(n){delete e.headers[n]});var t=e.adapter||as.adapter;return t(e).then(function(n){return Ee(e),n.data=Se.call(e,n.data,n.headers,e.transformResponse),n},function(n){return is(n)||(Ee(e),n&&n.response&&(n.response.data=Se.call(e,n.response.data,n.response.headers,e.transformResponse))),Promise.reject(n)})}});var ke=j((_s,Lt)=>{"use strict";var _=L();Lt.exports=function(e,t){t=t||{};var o={};function n(s,p){return _.isPlainObject(s)&&_.isPlainObject(p)?_.merge(s,p):_.isPlainObject(p)?_.merge({},p):_.isArray(p)?p.slice():p}function i(s){if(_.isUndefined(t[s])){if(!_.isUndefined(e[s]))return n(void 0,e[s])}else return n(e[s],t[s])}function a(s){if(!_.isUndefined(t[s]))return n(void 0,t[s])}function c(s){if(_.isUndefined(t[s])){if(!_.isUndefined(e[s]))return n(void 0,e[s])}else return n(void 0,t[s])}function u(s){if(s in t)return n(e[s],t[s]);if(s in e)return n(void 0,e[s])}var l={url:a,method:a,data:a,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:u};return _.forEach(Object.keys(e).concat(Object.keys(t)),function(p){var h=l[p]||i,x=h(p);_.isUndefined(x)&&h!==u||(o[p]=x)}),o}});var Ce=j((Ds,Ft)=>{Ft.exports={version:"0.23.0"}});var Dt=j((Hs,_t)=>{"use strict";var cs=Ce().version,Ae={};["object","boolean","number","function","string","symbol"].forEach(function(r,e){Ae[r]=function(o){return typeof o===r||"a"+(e<1?"n ":" ")+r}});var Bt={};Ae.transitional=function(e,t,o){function n(i,a){return"[Axios v"+cs+"] Transitional option '"+i+"'"+a+(o?". "+o:"")}return function(i,a,c){if(e===!1)throw new Error(n(a," has been removed"+(t?" in "+t:"")));return t&&!Bt[a]&&(Bt[a]=!0,console.warn(n(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(i,a,c):!0}};function ls(r,e,t){if(typeof r!="object")throw new TypeError("options must be an object");for(var o=Object.keys(r),n=o.length;n-- >0;){var i=o[n],a=e[i];if(a){var c=r[i],u=c===void 0||a(c,i,r);if(u!==!0)throw new TypeError("option "+i+" must be "+u);continue}if(t!==!0)throw Error("Unknown option "+i)}}_t.exports={assertOptions:ls,validators:Ae}});var Vt=j((Ms,zt)=>{"use strict";var Jt=L(),fs=de(),Ht=ot(),Mt=Ut(),ne=ke(),$t=Dt(),$=$t.validators;function W(r){this.defaults=r,this.interceptors={request:new Ht,response:new Ht}}W.prototype.request=function(e){typeof e=="string"?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=ne(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional;t!==void 0&&$t.assertOptions(t,{silentJSONParsing:$.transitional($.boolean),forcedJSONParsing:$.transitional($.boolean),clarifyTimeoutError:$.transitional($.boolean)},!1);var o=[],n=!0;this.interceptors.request.forEach(function(h){typeof h.runWhen=="function"&&h.runWhen(e)===!1||(n=n&&h.synchronous,o.unshift(h.fulfilled,h.rejected))});var i=[];this.interceptors.response.forEach(function(h){i.push(h.fulfilled,h.rejected)});var a;if(!n){var c=[Mt,void 0];for(Array.prototype.unshift.apply(c,o),c=c.concat(i),a=Promise.resolve(e);c.length;)a=a.then(c.shift(),c.shift());return a}for(var u=e;o.length;){var l=o.shift(),s=o.shift();try{u=l(u)}catch(p){s(p);break}}try{a=Mt(u)}catch(p){return Promise.reject(p)}for(;i.length;)a=a.then(i.shift(),i.shift());return a};W.prototype.getUri=function(e){return e=ne(this.defaults,e),fs(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")};Jt.forEach(["delete","get","head","options"],function(e){W.prototype[e]=function(t,o){return this.request(ne(o||{},{method:e,url:t,data:(o||{}).data}))}});Jt.forEach(["post","put","patch"],function(e){W.prototype[e]=function(t,o,n){return this.request(ne(n||{},{method:e,url:t,data:o}))}});zt.exports=W});var Wt=j((Js,Gt)=>{"use strict";var hs=V();function z(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(n){e=n});var t=this;this.promise.then(function(o){if(!!t._listeners){var n,i=t._listeners.length;for(n=0;n<i;n++)t._listeners[n](o);t._listeners=null}}),this.promise.then=function(o){var n,i=new Promise(function(a){t.subscribe(a),n=a}).then(o);return i.cancel=function(){t.unsubscribe(n)},i},r(function(n){t.reason||(t.reason=new hs(n),e(t.reason))})}z.prototype.throwIfRequested=function(){if(this.reason)throw this.reason};z.prototype.subscribe=function(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]};z.prototype.unsubscribe=function(e){if(!!this._listeners){var t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}};z.source=function(){var e,t=new z(function(n){e=n});return{token:t,cancel:e}};Gt.exports=z});var Kt=j(($s,Xt)=>{"use strict";Xt.exports=function(e){return function(o){return e.apply(null,o)}}});var Yt=j((zs,Qt)=>{"use strict";Qt.exports=function(e){return typeof e=="object"&&e.isAxiosError===!0}});var tr=j((Vs,Te)=>{"use strict";var Zt=L(),ps=ce(),se=Vt(),ds=ke(),ms=G();function er(r){var e=new se(r),t=ps(se.prototype.request,e);return Zt.extend(t,se.prototype,e),Zt.extend(t,e),t.create=function(n){return er(ds(r,n))},t}var D=er(ms);D.Axios=se;D.Cancel=V();D.CancelToken=Wt();D.isCancel=xe();D.VERSION=Ce().version;D.all=function(e){return Promise.all(e)};D.spread=Kt();D.isAxiosError=Yt();Te.exports=D;Te.exports.default=D});var Oe=j((Gs,rr)=>{rr.exports=tr()});var hr=Object.create,ie=Object.defineProperty,pr=Object.getOwnPropertyDescriptor,dr=Object.getOwnPropertyNames,mr=Object.getPrototypeOf,gr=Object.prototype.hasOwnProperty,vr=r=>ie(r,"__esModule",{value:!0}),T=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),yr=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of dr(e))!gr.call(r,n)&&(t||n!=="default")&&ie(r,n,{get:()=>e[n],enumerable:!(o=pr(e,n))||o.enumerable});return r},qe=(r,e)=>yr(vr(ie(r!=null?hr(mr(r)):{},"default",!e&&r&&r.__esModule?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r),Ue=T((r,e)=>{"use strict";e.exports=function(t,o){return function(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];return t.apply(o,n)}}}),U=T((r,e)=>{"use strict";var t=Ue(),o=Object.prototype.toString;function n(f){return Array.isArray(f)}function i(f){return typeof f>"u"}function a(f){return f!==null&&!i(f)&&f.constructor!==null&&!i(f.constructor)&&typeof f.constructor.isBuffer=="function"&&f.constructor.isBuffer(f)}function c(f){return o.call(f)==="[object ArrayBuffer]"}function u(f){return o.call(f)==="[object FormData]"}function l(f){var C;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?C=ArrayBuffer.isView(f):C=f&&f.buffer&&c(f.buffer),C}function s(f){return typeof f=="string"}function p(f){return typeof f=="number"}function h(f){return f!==null&&typeof f=="object"}function x(f){if(o.call(f)!=="[object Object]")return!1;var C=Object.getPrototypeOf(f);return C===null||C===Object.prototype}function y(f){return o.call(f)==="[object Date]"}function S(f){return o.call(f)==="[object File]"}function b(f){return o.call(f)==="[object Blob]"}function A(f){return o.call(f)==="[object Function]"}function m(f){return h(f)&&A(f.pipe)}function g(f){return o.call(f)==="[object URLSearchParams]"}function d(f){return f.trim?f.trim():f.replace(/^\s+|\s+$/g,"")}function v(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function w(f,C){if(!(f===null||typeof f>"u"))if(typeof f!="object"&&(f=[f]),n(f))for(var R=0,P=f.length;R<P;R++)C.call(null,f[R],R,f);else for(var O in f)Object.prototype.hasOwnProperty.call(f,O)&&C.call(null,f[O],O,f)}function k(){var f={};function C(O,F){x(f[F])&&x(O)?f[F]=k(f[F],O):x(O)?f[F]=k({},O):n(O)?f[F]=O.slice():f[F]=O}for(var R=0,P=arguments.length;R<P;R++)w(arguments[R],C);return f}function E(f,C,R){return w(C,function(P,O){R&&typeof P=="function"?f[O]=t(P,R):f[O]=P}),f}function I(f){return f.charCodeAt(0)===65279&&(f=f.slice(1)),f}e.exports={isArray:n,isArrayBuffer:c,isBuffer:a,isFormData:u,isArrayBufferView:l,isString:s,isNumber:p,isObject:h,isPlainObject:x,isUndefined:i,isDate:y,isFile:S,isBlob:b,isFunction:A,isStream:m,isURLSearchParams:g,isStandardBrowserEnv:v,forEach:w,merge:k,extend:E,trim:d,stripBOM:I}}),Le=T((r,e)=>{"use strict";var t=U();function o(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(n,i,a){if(!i)return n;var c;if(a)c=a(i);else if(t.isURLSearchParams(i))c=i.toString();else{var u=[];t.forEach(i,function(s,p){s===null||typeof s>"u"||(t.isArray(s)?p=p+"[]":s=[s],t.forEach(s,function(h){t.isDate(h)?h=h.toISOString():t.isObject(h)&&(h=JSON.stringify(h)),u.push(o(p)+"="+o(h))}))}),c=u.join("&")}if(c){var l=n.indexOf("#");l!==-1&&(n=n.slice(0,l)),n+=(n.indexOf("?")===-1?"?":"&")+c}return n}}),br=T((r,e)=>{"use strict";var t=U();function o(){this.handlers=[]}o.prototype.use=function(n,i,a){return this.handlers.push({fulfilled:n,rejected:i,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(n){this.handlers[n]&&(this.handlers[n]=null)},o.prototype.forEach=function(n){t.forEach(this.handlers,function(i){i!==null&&n(i)})},e.exports=o}),wr=T((r,e)=>{"use strict";var t=U();e.exports=function(o,n){t.forEach(o,function(i,a){a!==n&&a.toUpperCase()===n.toUpperCase()&&(o[n]=i,delete o[a])})}}),Fe=T((r,e)=>{"use strict";e.exports=function(t,o,n,i,a){return t.config=o,n&&(t.code=n),t.request=i,t.response=a,t.isAxiosError=!0,t.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}},t}}),Be=T((r,e)=>{"use strict";var t=Fe();e.exports=function(o,n,i,a,c){var u=new Error(o);return t(u,n,i,a,c)}}),xr=T((r,e)=>{"use strict";var t=Be();e.exports=function(o,n,i){var a=i.config.validateStatus;!i.status||!a||a(i.status)?o(i):n(t("Request failed with status code "+i.status,i.config,null,i.request,i))}}),Sr=T((r,e)=>{"use strict";var t=U();e.exports=t.isStandardBrowserEnv()?function(){return{write:function(o,n,i,a,c,u){var l=[];l.push(o+"="+encodeURIComponent(n)),t.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),t.isString(a)&&l.push("path="+a),t.isString(c)&&l.push("domain="+c),u===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(o){var n=document.cookie.match(new RegExp("(^|;\\s*)("+o+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(o){this.write(o,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()}),Er=T((r,e)=>{"use strict";e.exports=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}}),kr=T((r,e)=>{"use strict";e.exports=function(t,o){return o?t.replace(/\/+$/,"")+"/"+o.replace(/^\/+/,""):t}}),Cr=T((r,e)=>{"use strict";var t=Er(),o=kr();e.exports=function(n,i){return n&&!t(i)?o(n,i):i}}),Ar=T((r,e)=>{"use strict";var t=U(),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(n){var i={},a,c,u;return n&&t.forEach(n.split(`
3
+ `),function(l){if(u=l.indexOf(":"),a=t.trim(l.substr(0,u)).toLowerCase(),c=t.trim(l.substr(u+1)),a){if(i[a]&&o.indexOf(a)>=0)return;a==="set-cookie"?i[a]=(i[a]?i[a]:[]).concat([c]):i[a]=i[a]?i[a]+", "+c:c}}),i}}),Tr=T((r,e)=>{"use strict";var t=U();e.exports=t.isStandardBrowserEnv()?function(){var o=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a"),i;function a(c){var u=c;return o&&(n.setAttribute("href",u),u=n.href),n.setAttribute("href",u),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return i=a(window.location.href),function(c){var u=t.isString(c)?a(c):c;return u.protocol===i.protocol&&u.host===i.host}}():function(){return function(){return!0}}()}),K=T((r,e)=>{"use strict";function t(o){this.message=o}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t}),Pe=T((r,e)=>{"use strict";var t=U(),o=xr(),n=Sr(),i=Le(),a=Cr(),c=Ar(),u=Tr(),l=Be(),s=Q(),p=K();e.exports=function(h){return new Promise(function(x,y){var S=h.data,b=h.headers,A=h.responseType,m;function g(){h.cancelToken&&h.cancelToken.unsubscribe(m),h.signal&&h.signal.removeEventListener("abort",m)}t.isFormData(S)&&delete b["Content-Type"];var d=new XMLHttpRequest;if(h.auth){var v=h.auth.username||"",w=h.auth.password?unescape(encodeURIComponent(h.auth.password)):"";b.Authorization="Basic "+btoa(v+":"+w)}var k=a(h.baseURL,h.url);d.open(h.method.toUpperCase(),i(k,h.params,h.paramsSerializer),!0),d.timeout=h.timeout;function E(){if(d){var f="getAllResponseHeaders"in d?c(d.getAllResponseHeaders()):null,C=!A||A==="text"||A==="json"?d.responseText:d.response,R={data:C,status:d.status,statusText:d.statusText,headers:f,config:h,request:d};o(function(P){x(P),g()},function(P){y(P),g()},R),d=null}}if("onloadend"in d?d.onloadend=E:d.onreadystatechange=function(){!d||d.readyState!==4||d.status===0&&!(d.responseURL&&d.responseURL.indexOf("file:")===0)||setTimeout(E)},d.onabort=function(){!d||(y(l("Request aborted",h,"ECONNABORTED",d)),d=null)},d.onerror=function(){y(l("Network Error",h,null,d)),d=null},d.ontimeout=function(){var f=h.timeout?"timeout of "+h.timeout+"ms exceeded":"timeout exceeded",C=h.transitional||s.transitional;h.timeoutErrorMessage&&(f=h.timeoutErrorMessage),y(l(f,h,C.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",d)),d=null},t.isStandardBrowserEnv()){var I=(h.withCredentials||u(k))&&h.xsrfCookieName?n.read(h.xsrfCookieName):void 0;I&&(b[h.xsrfHeaderName]=I)}"setRequestHeader"in d&&t.forEach(b,function(f,C){typeof S>"u"&&C.toLowerCase()==="content-type"?delete b[C]:d.setRequestHeader(C,f)}),t.isUndefined(h.withCredentials)||(d.withCredentials=!!h.withCredentials),A&&A!=="json"&&(d.responseType=h.responseType),typeof h.onDownloadProgress=="function"&&d.addEventListener("progress",h.onDownloadProgress),typeof h.onUploadProgress=="function"&&d.upload&&d.upload.addEventListener("progress",h.onUploadProgress),(h.cancelToken||h.signal)&&(m=function(f){!d||(y(!f||f&&f.type?new p("canceled"):f),d.abort(),d=null)},h.cancelToken&&h.cancelToken.subscribe(m),h.signal&&(h.signal.aborted?m():h.signal.addEventListener("abort",m))),S||(S=null),d.send(S)})}}),Q=T((r,e)=>{"use strict";var t=U(),o=wr(),n=Fe(),i={"Content-Type":"application/x-www-form-urlencoded"};function a(s,p){!t.isUndefined(s)&&t.isUndefined(s["Content-Type"])&&(s["Content-Type"]=p)}function c(){var s;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(s=Pe()),s}function u(s,p,h){if(t.isString(s))try{return(p||JSON.parse)(s),t.trim(s)}catch(x){if(x.name!=="SyntaxError")throw x}return(h||JSON.stringify)(s)}var l={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:c(),transformRequest:[function(s,p){return o(p,"Accept"),o(p,"Content-Type"),t.isFormData(s)||t.isArrayBuffer(s)||t.isBuffer(s)||t.isStream(s)||t.isFile(s)||t.isBlob(s)?s:t.isArrayBufferView(s)?s.buffer:t.isURLSearchParams(s)?(a(p,"application/x-www-form-urlencoded;charset=utf-8"),s.toString()):t.isObject(s)||p&&p["Content-Type"]==="application/json"?(a(p,"application/json"),u(s)):s}],transformResponse:[function(s){var p=this.transitional||l.transitional,h=p&&p.silentJSONParsing,x=p&&p.forcedJSONParsing,y=!h&&this.responseType==="json";if(y||x&&t.isString(s)&&s.length)try{return JSON.parse(s)}catch(S){if(y)throw S.name==="SyntaxError"?n(S,this,"E_JSON_PARSE"):S}return s}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(s){return s>=200&&s<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};t.forEach(["delete","get","head"],function(s){l.headers[s]={}}),t.forEach(["post","put","patch"],function(s){l.headers[s]=t.merge(i)}),e.exports=l}),Or=T((r,e)=>{"use strict";var t=U(),o=Q();e.exports=function(n,i,a){var c=this||o;return t.forEach(a,function(u){n=u.call(c,n,i)}),n}}),_e=T((r,e)=>{"use strict";e.exports=function(t){return!!(t&&t.__CANCEL__)}}),jr=T((r,e)=>{"use strict";var t=U(),o=Or(),n=_e(),i=Q(),a=K();function c(u){if(u.cancelToken&&u.cancelToken.throwIfRequested(),u.signal&&u.signal.aborted)throw new a("canceled")}e.exports=function(u){c(u),u.headers=u.headers||{},u.data=o.call(u,u.data,u.headers,u.transformRequest),u.headers=t.merge(u.headers.common||{},u.headers[u.method]||{},u.headers),t.forEach(["delete","get","head","post","put","patch","common"],function(s){delete u.headers[s]});var l=u.adapter||i.adapter;return l(u).then(function(s){return c(u),s.data=o.call(u,s.data,s.headers,u.transformResponse),s},function(s){return n(s)||(c(u),s&&s.response&&(s.response.data=o.call(u,s.response.data,s.response.headers,u.transformResponse))),Promise.reject(s)})}}),De=T((r,e)=>{"use strict";var t=U();e.exports=function(o,n){n=n||{};var i={};function a(h,x){return t.isPlainObject(h)&&t.isPlainObject(x)?t.merge(h,x):t.isPlainObject(x)?t.merge({},x):t.isArray(x)?x.slice():x}function c(h){if(t.isUndefined(n[h])){if(!t.isUndefined(o[h]))return a(void 0,o[h])}else return a(o[h],n[h])}function u(h){if(!t.isUndefined(n[h]))return a(void 0,n[h])}function l(h){if(t.isUndefined(n[h])){if(!t.isUndefined(o[h]))return a(void 0,o[h])}else return a(void 0,n[h])}function s(h){if(h in n)return a(o[h],n[h]);if(h in o)return a(void 0,o[h])}var p={url:u,method:u,data:u,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:s};return t.forEach(Object.keys(o).concat(Object.keys(n)),function(h){var x=p[h]||c,y=x(h);t.isUndefined(y)&&x!==s||(i[h]=y)}),i}}),He=T((r,e)=>{e.exports={version:"0.25.0"}}),Nr=T((r,e)=>{"use strict";var t=He().version,o={};["object","boolean","number","function","string","symbol"].forEach(function(a,c){o[a]=function(u){return typeof u===a||"a"+(c<1?"n ":" ")+a}});var n={};o.transitional=function(a,c,u){function l(s,p){return"[Axios v"+t+"] Transitional option '"+s+"'"+p+(u?". "+u:"")}return function(s,p,h){if(a===!1)throw new Error(l(p," has been removed"+(c?" in "+c:"")));return c&&!n[p]&&(n[p]=!0,console.warn(l(p," has been deprecated since v"+c+" and will be removed in the near future"))),a?a(s,p,h):!0}};function i(a,c,u){if(typeof a!="object")throw new TypeError("options must be an object");for(var l=Object.keys(a),s=l.length;s-- >0;){var p=l[s],h=c[p];if(h){var x=a[p],y=x===void 0||h(x,p,a);if(y!==!0)throw new TypeError("option "+p+" must be "+y);continue}if(u!==!0)throw Error("Unknown option "+p)}}e.exports={assertOptions:i,validators:o}}),Rr=T((r,e)=>{"use strict";var t=U(),o=Le(),n=br(),i=jr(),a=De(),c=Nr(),u=c.validators;function l(s){this.defaults=s,this.interceptors={request:new n,response:new n}}l.prototype.request=function(s,p){if(typeof s=="string"?(p=p||{},p.url=s):p=s||{},!p.url)throw new Error("Provided config url is not valid");p=a(this.defaults,p),p.method?p.method=p.method.toLowerCase():this.defaults.method?p.method=this.defaults.method.toLowerCase():p.method="get";var h=p.transitional;h!==void 0&&c.assertOptions(h,{silentJSONParsing:u.transitional(u.boolean),forcedJSONParsing:u.transitional(u.boolean),clarifyTimeoutError:u.transitional(u.boolean)},!1);var x=[],y=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(p)===!1||(y=y&&v.synchronous,x.unshift(v.fulfilled,v.rejected))});var S=[];this.interceptors.response.forEach(function(v){S.push(v.fulfilled,v.rejected)});var b;if(!y){var A=[i,void 0];for(Array.prototype.unshift.apply(A,x),A=A.concat(S),b=Promise.resolve(p);A.length;)b=b.then(A.shift(),A.shift());return b}for(var m=p;x.length;){var g=x.shift(),d=x.shift();try{m=g(m)}catch(v){d(v);break}}try{b=i(m)}catch(v){return Promise.reject(v)}for(;S.length;)b=b.then(S.shift(),S.shift());return b},l.prototype.getUri=function(s){if(!s.url)throw new Error("Provided config url is not valid");return s=a(this.defaults,s),o(s.url,s.params,s.paramsSerializer).replace(/^\?/,"")},t.forEach(["delete","get","head","options"],function(s){l.prototype[s]=function(p,h){return this.request(a(h||{},{method:s,url:p,data:(h||{}).data}))}}),t.forEach(["post","put","patch"],function(s){l.prototype[s]=function(p,h,x){return this.request(a(x||{},{method:s,url:p,data:h}))}}),e.exports=l}),Ir=T((r,e)=>{"use strict";var t=K();function o(n){if(typeof n!="function")throw new TypeError("executor must be a function.");var i;this.promise=new Promise(function(c){i=c});var a=this;this.promise.then(function(c){if(a._listeners){var u,l=a._listeners.length;for(u=0;u<l;u++)a._listeners[u](c);a._listeners=null}}),this.promise.then=function(c){var u,l=new Promise(function(s){a.subscribe(s),u=s}).then(c);return l.cancel=function(){a.unsubscribe(u)},l},n(function(c){a.reason||(a.reason=new t(c),i(a.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.prototype.subscribe=function(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]},o.prototype.unsubscribe=function(n){if(this._listeners){var i=this._listeners.indexOf(n);i!==-1&&this._listeners.splice(i,1)}},o.source=function(){var n,i=new o(function(a){n=a});return{token:i,cancel:n}},e.exports=o}),Pr=T((r,e)=>{"use strict";e.exports=function(t){return function(o){return t.apply(null,o)}}}),qr=T((r,e)=>{"use strict";var t=U();e.exports=function(o){return t.isObject(o)&&o.isAxiosError===!0}}),Ur=T((r,e)=>{"use strict";var t=U(),o=Ue(),n=Rr(),i=De(),a=Q();function c(l){var s=new n(l),p=o(n.prototype.request,s);return t.extend(p,n.prototype,s),t.extend(p,s),p.create=function(h){return c(i(l,h))},p}var u=c(a);u.Axios=n,u.Cancel=K(),u.CancelToken=Ir(),u.isCancel=_e(),u.VERSION=He().version,u.all=function(l){return Promise.all(l)},u.spread=Pr(),u.isAxiosError=qr(),e.exports=u,e.exports.default=u}),Lr=T((r,e)=>{e.exports=Ur()}),Fr=T((r,e)=>{"use strict";e.exports=t=>encodeURIComponent(t).replace(/[!'()*]/g,o=>`%${o.charCodeAt(0).toString(16).toUpperCase()}`)}),Br=T((r,e)=>{"use strict";var t="%[a-f0-9]{2}",o=new RegExp(t,"gi"),n=new RegExp("("+t+")+","gi");function i(u,l){try{return decodeURIComponent(u.join(""))}catch{}if(u.length===1)return u;l=l||1;var s=u.slice(0,l),p=u.slice(l);return Array.prototype.concat.call([],i(s),i(p))}function a(u){try{return decodeURIComponent(u)}catch{for(var l=u.match(o),s=1;s<l.length;s++)u=i(l,s).join(""),l=u.match(o);return u}}function c(u){for(var l={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},s=n.exec(u);s;){try{l[s[0]]=decodeURIComponent(s[0])}catch{var p=a(s[0]);p!==s[0]&&(l[s[0]]=p)}s=n.exec(u)}l["%C2"]="\uFFFD";for(var h=Object.keys(l),x=0;x<h.length;x++){var y=h[x];u=u.replace(new RegExp(y,"g"),l[y])}return u}e.exports=function(u){if(typeof u!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof u+"`");try{return u=u.replace(/\+/g," "),decodeURIComponent(u)}catch{return c(u)}}}),_r=T((r,e)=>{"use strict";e.exports=(t,o)=>{if(!(typeof t=="string"&&typeof o=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(o==="")return[t];let n=t.indexOf(o);return n===-1?[t]:[t.slice(0,n),t.slice(n+o.length)]}}),Dr=T((r,e)=>{"use strict";e.exports=function(t,o){for(var n={},i=Object.keys(t),a=Array.isArray(o),c=0;c<i.length;c++){var u=i[c],l=t[u];(a?o.indexOf(u)!==-1:o(u,l,t))&&(n[u]=l)}return n}}),Hr=T(r=>{"use strict";var e=Fr(),t=Br(),o=_r(),n=Dr(),i=m=>m==null,a=Symbol("encodeFragmentIdentifier");function c(m){switch(m.arrayFormat){case"index":return g=>(d,v)=>{let w=d.length;return v===void 0||m.skipNull&&v===null||m.skipEmptyString&&v===""?d:v===null?[...d,[s(g,m),"[",w,"]"].join("")]:[...d,[s(g,m),"[",s(w,m),"]=",s(v,m)].join("")]};case"bracket":return g=>(d,v)=>v===void 0||m.skipNull&&v===null||m.skipEmptyString&&v===""?d:v===null?[...d,[s(g,m),"[]"].join("")]:[...d,[s(g,m),"[]=",s(v,m)].join("")];case"colon-list-separator":return g=>(d,v)=>v===void 0||m.skipNull&&v===null||m.skipEmptyString&&v===""?d:v===null?[...d,[s(g,m),":list="].join("")]:[...d,[s(g,m),":list=",s(v,m)].join("")];case"comma":case"separator":case"bracket-separator":{let g=m.arrayFormat==="bracket-separator"?"[]=":"=";return d=>(v,w)=>w===void 0||m.skipNull&&w===null||m.skipEmptyString&&w===""?v:(w=w===null?"":w,v.length===0?[[s(d,m),g,s(w,m)].join("")]:[[v,s(w,m)].join(m.arrayFormatSeparator)])}default:return g=>(d,v)=>v===void 0||m.skipNull&&v===null||m.skipEmptyString&&v===""?d:v===null?[...d,s(g,m)]:[...d,[s(g,m),"=",s(v,m)].join("")]}}function u(m){let g;switch(m.arrayFormat){case"index":return(d,v,w)=>{if(g=/\[(\d*)\]$/.exec(d),d=d.replace(/\[\d*\]$/,""),!g){w[d]=v;return}w[d]===void 0&&(w[d]={}),w[d][g[1]]=v};case"bracket":return(d,v,w)=>{if(g=/(\[\])$/.exec(d),d=d.replace(/\[\]$/,""),!g){w[d]=v;return}if(w[d]===void 0){w[d]=[v];return}w[d]=[].concat(w[d],v)};case"colon-list-separator":return(d,v,w)=>{if(g=/(:list)$/.exec(d),d=d.replace(/:list$/,""),!g){w[d]=v;return}if(w[d]===void 0){w[d]=[v];return}w[d]=[].concat(w[d],v)};case"comma":case"separator":return(d,v,w)=>{let k=typeof v=="string"&&v.includes(m.arrayFormatSeparator),E=typeof v=="string"&&!k&&p(v,m).includes(m.arrayFormatSeparator);v=E?p(v,m):v;let I=k||E?v.split(m.arrayFormatSeparator).map(f=>p(f,m)):v===null?v:p(v,m);w[d]=I};case"bracket-separator":return(d,v,w)=>{let k=/(\[\])$/.test(d);if(d=d.replace(/\[\]$/,""),!k){w[d]=v&&p(v,m);return}let E=v===null?[]:v.split(m.arrayFormatSeparator).map(I=>p(I,m));if(w[d]===void 0){w[d]=E;return}w[d]=[].concat(w[d],E)};default:return(d,v,w)=>{if(w[d]===void 0){w[d]=v;return}w[d]=[].concat(w[d],v)}}}function l(m){if(typeof m!="string"||m.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function s(m,g){return g.encode?g.strict?e(m):encodeURIComponent(m):m}function p(m,g){return g.decode?t(m):m}function h(m){return Array.isArray(m)?m.sort():typeof m=="object"?h(Object.keys(m)).sort((g,d)=>Number(g)-Number(d)).map(g=>m[g]):m}function x(m){let g=m.indexOf("#");return g!==-1&&(m=m.slice(0,g)),m}function y(m){let g="",d=m.indexOf("#");return d!==-1&&(g=m.slice(d)),g}function S(m){m=x(m);let g=m.indexOf("?");return g===-1?"":m.slice(g+1)}function b(m,g){return g.parseNumbers&&!Number.isNaN(Number(m))&&typeof m=="string"&&m.trim()!==""?m=Number(m):g.parseBooleans&&m!==null&&(m.toLowerCase()==="true"||m.toLowerCase()==="false")&&(m=m.toLowerCase()==="true"),m}function A(m,g){g=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},g),l(g.arrayFormatSeparator);let d=u(g),v=Object.create(null);if(typeof m!="string"||(m=m.trim().replace(/^[?#&]/,""),!m))return v;for(let w of m.split("&")){if(w==="")continue;let[k,E]=o(g.decode?w.replace(/\+/g," "):w,"=");E=E===void 0?null:["comma","separator","bracket-separator"].includes(g.arrayFormat)?E:p(E,g),d(p(k,g),E,v)}for(let w of Object.keys(v)){let k=v[w];if(typeof k=="object"&&k!==null)for(let E of Object.keys(k))k[E]=b(k[E],g);else v[w]=b(k,g)}return g.sort===!1?v:(g.sort===!0?Object.keys(v).sort():Object.keys(v).sort(g.sort)).reduce((w,k)=>{let E=v[k];return Boolean(E)&&typeof E=="object"&&!Array.isArray(E)?w[k]=h(E):w[k]=E,w},Object.create(null))}r.extract=S,r.parse=A,r.stringify=(m,g)=>{if(!m)return"";g=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},g),l(g.arrayFormatSeparator);let d=E=>g.skipNull&&i(m[E])||g.skipEmptyString&&m[E]==="",v=c(g),w={};for(let E of Object.keys(m))d(E)||(w[E]=m[E]);let k=Object.keys(w);return g.sort!==!1&&k.sort(g.sort),k.map(E=>{let I=m[E];return I===void 0?"":I===null?s(E,g):Array.isArray(I)?I.length===0&&g.arrayFormat==="bracket-separator"?s(E,g)+"[]":I.reduce(v(E),[]).join("&"):s(E,g)+"="+s(I,g)}).filter(E=>E.length>0).join("&")},r.parseUrl=(m,g)=>{g=Object.assign({decode:!0},g);let[d,v]=o(m,"#");return Object.assign({url:d.split("?")[0]||"",query:A(S(m),g)},g&&g.parseFragmentIdentifier&&v?{fragmentIdentifier:p(v,g)}:{})},r.stringifyUrl=(m,g)=>{g=Object.assign({encode:!0,strict:!0,[a]:!0},g);let d=x(m.url).split("?")[0]||"",v=r.extract(m.url),w=r.parse(v,{sort:!1}),k=Object.assign(w,m.query),E=r.stringify(k,g);E&&(E=`?${E}`);let I=y(m.url);return m.fragmentIdentifier&&(I=`#${g[a]?s(m.fragmentIdentifier,g):m.fragmentIdentifier}`),`${d}${E}${I}`},r.pick=(m,g,d)=>{d=Object.assign({parseFragmentIdentifier:!0,[a]:!1},d);let{url:v,query:w,fragmentIdentifier:k}=r.parseUrl(m,d);return r.stringifyUrl({url:v,query:n(w,g),fragmentIdentifier:k},d)},r.exclude=(m,g,d)=>{let v=Array.isArray(g)?w=>!g.includes(w):(w,k)=>!g(w,k);return r.pick(m,v,d)}}),Mr=qe(Lr()),Jr=500,$r=class{url;httpClient;accessToken;constructor({url:r=""}){this.url=r,this.httpClient=Mr.default.create({baseURL:this.url}),this.httpClient.interceptors.response.use(e=>e,e=>Promise.reject({message:e.response?.data?.message??e.message??JSON.stringify(e),status:e.response?.status??Jr}))}async signUpEmailPassword(r){try{return{data:(await this.httpClient.post("/signup/email-password",r)).data,error:null}}catch(e){return{data:null,error:e}}}async signInEmailPassword(r){try{return{data:(await this.httpClient.post("/signin/email-password",r)).data,error:null}}catch(e){return{data:null,error:e}}}async signInPasswordlessEmail(r){try{return{data:(await this.httpClient.post("/signin/passwordless/email",r)).data,error:null}}catch(e){return{data:null,error:e}}}async signInPasswordlessSms(r){try{return{data:(await this.httpClient.post("/signin/passwordless/sms",r)).data,error:null}}catch(e){return{data:null,error:e}}}async signInPasswordlessSmsOtp(r){try{return{data:(await this.httpClient.post("/signin/passwordless/sms/otp",r)).data,error:null}}catch(e){return{data:null,error:e}}}async signOut(r){try{return await this.httpClient.post("/signout",r),{error:null}}catch(e){return{error:e}}}async refreshToken(r){try{let e=await this.httpClient.post("/token",r);return{error:null,session:e.data}}catch(e){return{error:e,session:null}}}async resetPassword(r){try{return await this.httpClient.post("/user/password/reset",r),{error:null}}catch(e){return{error:e}}}async changePassword(r){try{return await this.httpClient.post("/user/password",r,{headers:{...this.generateAuthHeaders()}}),{error:null}}catch(e){return{error:e}}}async sendVerificationEmail(r){try{return await this.httpClient.post("/user/email/send-verification-email",r),{error:null}}catch(e){return{error:e}}}async changeEmail(r){try{return await this.httpClient.post("/user/email/change",r,{headers:{...this.generateAuthHeaders()}}),{error:null}}catch(e){return{error:e}}}async deanonymize(r){try{return await this.httpClient.post("/user/deanonymize",r),{error:null}}catch(e){return{error:e}}}async verifyEmail(r){try{return{data:(await this.httpClient.post("/user/email/verify",r)).data,error:null}}catch(e){return{data:null,error:e}}}setAccessToken(r){this.accessToken=r}generateAuthHeaders(){return this.accessToken?{Authorization:`Bearer ${this.accessToken}`}:null}},zr=qe(Hr()),H="nhostRefreshToken",X=()=>typeof window<"u",Vr=class{memory;constructor(){this.memory={}}setItem(r,e){this.memory[r]=e}getItem(r){return this.memory[r]}removeItem(r){delete this.memory[r]}},Me=class{api;onTokenChangedFunctions;onAuthChangedFunctions;refreshInterval;refreshIntervalTime;clientStorage;clientStorageType;url;autoRefreshToken;session;initAuthLoading;refreshSleepCheckInterval;refreshIntervalSleepCheckLastSample;sampleRate;constructor({url:r,autoRefreshToken:e=!0,autoLogin:t=!0,refreshIntervalTime:o,clientStorage:n,clientStorageType:i="web"}){this.refreshIntervalTime=o,n?this.clientStorage=n:this.clientStorage=X()?localStorage:new Vr,this.clientStorageType=i,this.onTokenChangedFunctions=[],this.onAuthChangedFunctions=[],this.refreshInterval,this.refreshSleepCheckInterval=0,this.refreshIntervalSleepCheckLastSample=Date.now(),this.sampleRate=2e3,this.url=r,this.autoRefreshToken=e,this.initAuthLoading=!0,this.session=null,this.api=new $r({url:this.url});let a=null,c=!1;if(t&&X()&&window.location){let u=zr.default.parse(window.location.toString().split("#")[1]);if("refreshToken"in u&&(a=u.refreshToken),"otp"in u&&"email"in u){let{otp:l,email:s}=u;this.signIn({otp:l,email:s}),c=!0}}!c&&t?this._autoLogin(a):a&&this._setItem(H,a)}async signUp(r){let{email:e,password:t}=r;if(e&&t){let{data:o,error:n}=await this.api.signUpEmailPassword(r);if(n)return{session:null,error:n};if(!o)return{session:null,error:{message:"An error occurred on sign up.",status:500}};let{session:i}=o;return i&&await this._setSession(i),{session:i,error:null}}return{session:null,error:{message:"Incorrect parameters",status:500}}}async signIn(r){if("provider"in r){let{provider:e}=r,t=`${this.url}/signin/provider/${e}`;return X()&&(window.location.href=t),{providerUrl:t,provider:e,session:null,mfa:null,error:null}}if("email"in r&&"password"in r){let{data:e,error:t}=await this.api.signInEmailPassword(r);if(t)return{session:null,mfa:null,error:t};if(!e)return{session:null,mfa:null,error:{message:"Incorrect Data",status:500}};let{session:o,mfa:n}=e;return o&&await this._setSession(o),{session:o,mfa:n,error:null}}if("email"in r&&!("otp"in r)){let{error:e}=await this.api.signInPasswordlessEmail(r);return e?{session:null,mfa:null,error:e}:{session:null,mfa:null,error:null}}if("phoneNumber"in r&&!("otp"in r)){let{error:e}=await this.api.signInPasswordlessSms(r);return e?{session:null,mfa:null,error:e}:{session:null,mfa:null,error:null}}if("otp"in r){let{data:e,error:t}=await this.api.signInPasswordlessSmsOtp(r);if(t)return{session:null,mfa:null,error:t};if(!e)return{session:null,mfa:null,error:{message:"Incorrect data",status:500}};let{session:o,mfa:n}=e;return o&&await this._setSession(o),{session:o,mfa:n,error:null}}return{session:null,mfa:null,error:{message:"Incorrect parameters",status:500}}}async signOut(r){let e=await this._getItem(H);this._clearSession();let{error:t}=await this.api.signOut({refreshToken:e,all:r?.all});return{error:t}}async verifyEmail(r){return await this.api.verifyEmail(r)}async resetPassword(r){let{error:e}=await this.api.resetPassword(r);return{error:e}}async changePassword(r){let{error:e}=await this.api.changePassword(r);return{error:e}}async sendVerificationEmail(r){let{error:e}=await this.api.sendVerificationEmail(r);return{error:e}}async changeEmail(r){let{error:e}=await this.api.changeEmail(r);return{error:e}}async deanonymize(r){let{error:e}=await this.api.deanonymize(r);return{error:e}}onTokenChanged(r){this.onTokenChangedFunctions.push(r);let e=this.onTokenChangedFunctions.length-1;return()=>{try{this.onTokenChangedFunctions[e]=()=>{}}catch{console.warn("Unable to unsubscribe onTokenChanged function. Maybe the functions is already unsubscribed?")}}}onAuthStateChanged(r){this.onAuthChangedFunctions.push(r);let e=this.onAuthChangedFunctions.length-1;return()=>{try{this.onAuthChangedFunctions[e]=()=>{}}catch{console.warn("Unable to unsubscribe onAuthStateChanged function. Maybe you already did?")}}}isAuthenticated(){return this.session!==null}async isAuthenticatedAsync(){return new Promise(r=>{if(!this.initAuthLoading)r(this.isAuthenticated());else{let e=this.onAuthStateChanged((t,o)=>{r(t==="SIGNED_IN"),e()})}})}getAuthenticationStatus(){return this.initAuthLoading?{isAuthenticated:!1,isLoading:!0}:{isAuthenticated:this.session!==null,isLoading:!1}}getJWTToken(){return this.getAccessToken()}getAccessToken(){if(this.session)return this.session.accessToken}async refreshSession(r){let e=r||await this._getItem(H);return e||console.warn("no refresh token found. No way of refreshing session"),this._refreshTokens(e)}getSession(){return this.session}getUser(){return this.session?this.session.user:null}async _setItem(r,e){if(typeof e!="string"){console.error('value is not of type "string"');return}switch(this.clientStorageType){case"web":if(typeof this.clientStorage.setItem!="function"){console.error("this.clientStorage.setItem is not a function");break}this.clientStorage.setItem(r,e);break;case"custom":case"react-native":if(typeof this.clientStorage.setItem!="function"){console.error("this.clientStorage.setItem is not a function");break}await this.clientStorage.setItem(r,e);break;case"capacitor":if(typeof this.clientStorage.set!="function"){console.error("this.clientStorage.set is not a function");break}await this.clientStorage.set({key:r,value:e});break;case"expo-secure-storage":if(typeof this.clientStorage.setItemAsync!="function"){console.error("this.clientStorage.setItemAsync is not a function");break}this.clientStorage.setItemAsync(r,e);break;default:break}}async _getItem(r){switch(this.clientStorageType){case"web":if(typeof this.clientStorage.getItem!="function"){console.error("this.clientStorage.getItem is not a function");break}return this.clientStorage.getItem(r);case"custom":case"react-native":if(typeof this.clientStorage.getItem!="function"){console.error("this.clientStorage.getItem is not a function");break}return await this.clientStorage.getItem(r);case"capacitor":if(typeof this.clientStorage.get!="function"){console.error("this.clientStorage.get is not a function");break}return(await this.clientStorage.get({key:r})).value;case"expo-secure-storage":if(typeof this.clientStorage.getItemAsync!="function"){console.error("this.clientStorage.getItemAsync is not a function");break}return this.clientStorage.getItemAsync(r);default:return""}return""}async _removeItem(r){switch(this.clientStorageType){case"web":if(typeof this.clientStorage.removeItem!="function"){console.error("this.clientStorage.removeItem is not a function");break}return void this.clientStorage.removeItem(r);case"custom":case"react-native":if(typeof this.clientStorage.removeItem!="function"){console.error("this.clientStorage.removeItem is not a function");break}return void this.clientStorage.removeItem(r);case"capacitor":if(typeof this.clientStorage.remove!="function"){console.error("this.clientStorage.remove is not a function");break}await this.clientStorage.remove({key:r});break;case"expo-secure-storage":if(typeof this.clientStorage.deleteItemAsync!="function"){console.error("this.clientStorage.deleteItemAsync is not a function");break}this.clientStorage.deleteItemAsync(r);break;default:break}}_autoLogin(r){!X()||this._refreshTokens(r)}async _refreshTokens(r){let e=r||await this._getItem(H);if(!e){setTimeout(async()=>{await this._clearSession()},0);return}try{let{session:t,error:o}=await this.api.refreshToken({refreshToken:e});if(o&&o.status===401){await this._clearSession();return}if(!t)throw new Error("Invalid session data");await this._setSession(t),this.tokenChanged()}catch{}}tokenChanged(){for(let r of this.onTokenChangedFunctions)r(this.session)}authStateChanged({event:r,session:e}){r==="SIGNED_IN"&&e?this.api.setAccessToken(e.accessToken):this.api.setAccessToken(void 0);for(let t of this.onAuthChangedFunctions)t(r,e)}async _clearSession(){let{isLoading:r,isAuthenticated:e}=this.getAuthenticationStatus();this.session=null,this.initAuthLoading=!1,await this._removeItem(H),(r||e)&&(clearInterval(this.refreshInterval),clearInterval(this.refreshSleepCheckInterval),this.authStateChanged({event:"SIGNED_OUT",session:null}))}async _setSession(r){let{isAuthenticated:e}=this.getAuthenticationStatus();if(this.session=r,await this._setItem(H,r.refreshToken),this.autoRefreshToken&&!e){let t=r.accessTokenExpiresIn,o=this.refreshIntervalTime?this.refreshIntervalTime:Math.max(1,t-1);this.refreshInterval=setInterval(async()=>{let n=await this._getItem(H);await this._refreshTokens(n)},o*1e3),this.refreshIntervalSleepCheckLastSample=Date.now(),this.refreshSleepCheckInterval=setInterval(async()=>{if(Date.now()-this.refreshIntervalSleepCheckLastSample>=this.sampleRate*2){let n=await this._getItem(H);await this._refreshTokens(n)}this.refreshIntervalSleepCheckLastSample=Date.now()},this.sampleRate),this.authStateChanged({event:"SIGNED_IN",session:this.session})}this.initAuthLoading=!1}};var Gr=Object.create,ae=Object.defineProperty,Wr=Object.getOwnPropertyDescriptor,Xr=Object.getOwnPropertyNames,Kr=Object.getPrototypeOf,Qr=Object.prototype.hasOwnProperty,Yr=r=>ae(r,"__esModule",{value:!0}),N=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Zr=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Xr(e))!Qr.call(r,n)&&(t||n!=="default")&&ae(r,n,{get:()=>e[n],enumerable:!(o=Wr(e,n))||o.enumerable});return r},en=(r,e)=>Zr(Yr(ae(r!=null?Gr(Kr(r)):{},"default",!e&&r&&r.__esModule?{get:()=>r.default,enumerable:!0}:{value:r,enumerable:!0})),r),$e=N((r,e)=>{"use strict";e.exports=function(t,o){return function(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];return t.apply(o,n)}}}),B=N((r,e)=>{"use strict";var t=$e(),o=Object.prototype.toString;function n(f){return o.call(f)==="[object Array]"}function i(f){return typeof f>"u"}function a(f){return f!==null&&!i(f)&&f.constructor!==null&&!i(f.constructor)&&typeof f.constructor.isBuffer=="function"&&f.constructor.isBuffer(f)}function c(f){return o.call(f)==="[object ArrayBuffer]"}function u(f){return typeof FormData<"u"&&f instanceof FormData}function l(f){var C;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?C=ArrayBuffer.isView(f):C=f&&f.buffer&&f.buffer instanceof ArrayBuffer,C}function s(f){return typeof f=="string"}function p(f){return typeof f=="number"}function h(f){return f!==null&&typeof f=="object"}function x(f){if(o.call(f)!=="[object Object]")return!1;var C=Object.getPrototypeOf(f);return C===null||C===Object.prototype}function y(f){return o.call(f)==="[object Date]"}function S(f){return o.call(f)==="[object File]"}function b(f){return o.call(f)==="[object Blob]"}function A(f){return o.call(f)==="[object Function]"}function m(f){return h(f)&&A(f.pipe)}function g(f){return typeof URLSearchParams<"u"&&f instanceof URLSearchParams}function d(f){return f.trim?f.trim():f.replace(/^\s+|\s+$/g,"")}function v(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function w(f,C){if(!(f===null||typeof f>"u"))if(typeof f!="object"&&(f=[f]),n(f))for(var R=0,P=f.length;R<P;R++)C.call(null,f[R],R,f);else for(var O in f)Object.prototype.hasOwnProperty.call(f,O)&&C.call(null,f[O],O,f)}function k(){var f={};function C(O,F){x(f[F])&&x(O)?f[F]=k(f[F],O):x(O)?f[F]=k({},O):n(O)?f[F]=O.slice():f[F]=O}for(var R=0,P=arguments.length;R<P;R++)w(arguments[R],C);return f}function E(f,C,R){return w(C,function(P,O){R&&typeof P=="function"?f[O]=t(P,R):f[O]=P}),f}function I(f){return f.charCodeAt(0)===65279&&(f=f.slice(1)),f}e.exports={isArray:n,isArrayBuffer:c,isBuffer:a,isFormData:u,isArrayBufferView:l,isString:s,isNumber:p,isObject:h,isPlainObject:x,isUndefined:i,isDate:y,isFile:S,isBlob:b,isFunction:A,isStream:m,isURLSearchParams:g,isStandardBrowserEnv:v,forEach:w,merge:k,extend:E,trim:d,stripBOM:I}}),ze=N((r,e)=>{"use strict";var t=B();function o(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(n,i,a){if(!i)return n;var c;if(a)c=a(i);else if(t.isURLSearchParams(i))c=i.toString();else{var u=[];t.forEach(i,function(s,p){s===null||typeof s>"u"||(t.isArray(s)?p=p+"[]":s=[s],t.forEach(s,function(h){t.isDate(h)?h=h.toISOString():t.isObject(h)&&(h=JSON.stringify(h)),u.push(o(p)+"="+o(h))}))}),c=u.join("&")}if(c){var l=n.indexOf("#");l!==-1&&(n=n.slice(0,l)),n+=(n.indexOf("?")===-1?"?":"&")+c}return n}}),tn=N((r,e)=>{"use strict";var t=B();function o(){this.handlers=[]}o.prototype.use=function(n,i,a){return this.handlers.push({fulfilled:n,rejected:i,synchronous:a?a.synchronous:!1,runWhen:a?a.runWhen:null}),this.handlers.length-1},o.prototype.eject=function(n){this.handlers[n]&&(this.handlers[n]=null)},o.prototype.forEach=function(n){t.forEach(this.handlers,function(i){i!==null&&n(i)})},e.exports=o}),rn=N((r,e)=>{"use strict";var t=B();e.exports=function(o,n){t.forEach(o,function(i,a){a!==n&&a.toUpperCase()===n.toUpperCase()&&(o[n]=i,delete o[a])})}}),Ve=N((r,e)=>{"use strict";e.exports=function(t,o,n,i,a){return t.config=o,n&&(t.code=n),t.request=i,t.response=a,t.isAxiosError=!0,t.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}},t}}),Ge=N((r,e)=>{"use strict";var t=Ve();e.exports=function(o,n,i,a,c){var u=new Error(o);return t(u,n,i,a,c)}}),nn=N((r,e)=>{"use strict";var t=Ge();e.exports=function(o,n,i){var a=i.config.validateStatus;!i.status||!a||a(i.status)?o(i):n(t("Request failed with status code "+i.status,i.config,null,i.request,i))}}),sn=N((r,e)=>{"use strict";var t=B();e.exports=t.isStandardBrowserEnv()?function(){return{write:function(o,n,i,a,c,u){var l=[];l.push(o+"="+encodeURIComponent(n)),t.isNumber(i)&&l.push("expires="+new Date(i).toGMTString()),t.isString(a)&&l.push("path="+a),t.isString(c)&&l.push("domain="+c),u===!0&&l.push("secure"),document.cookie=l.join("; ")},read:function(o){var n=document.cookie.match(new RegExp("(^|;\\s*)("+o+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(o){this.write(o,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()}),on=N((r,e)=>{"use strict";e.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}}),an=N((r,e)=>{"use strict";e.exports=function(t,o){return o?t.replace(/\/+$/,"")+"/"+o.replace(/^\/+/,""):t}}),un=N((r,e)=>{"use strict";var t=on(),o=an();e.exports=function(n,i){return n&&!t(i)?o(n,i):i}}),cn=N((r,e)=>{"use strict";var t=B(),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(n){var i={},a,c,u;return n&&t.forEach(n.split(`
4
+ `),function(l){if(u=l.indexOf(":"),a=t.trim(l.substr(0,u)).toLowerCase(),c=t.trim(l.substr(u+1)),a){if(i[a]&&o.indexOf(a)>=0)return;a==="set-cookie"?i[a]=(i[a]?i[a]:[]).concat([c]):i[a]=i[a]?i[a]+", "+c:c}}),i}}),ln=N((r,e)=>{"use strict";var t=B();e.exports=t.isStandardBrowserEnv()?function(){var o=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a"),i;function a(c){var u=c;return o&&(n.setAttribute("href",u),u=n.href),n.setAttribute("href",u),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return i=a(window.location.href),function(c){var u=t.isString(c)?a(c):c;return u.protocol===i.protocol&&u.host===i.host}}():function(){return function(){return!0}}()}),Je=N((r,e)=>{"use strict";var t=B(),o=nn(),n=sn(),i=ze(),a=un(),c=cn(),u=ln(),l=Ge();e.exports=function(s){return new Promise(function(p,h){var x=s.data,y=s.headers,S=s.responseType;t.isFormData(x)&&delete y["Content-Type"];var b=new XMLHttpRequest;if(s.auth){var A=s.auth.username||"",m=s.auth.password?unescape(encodeURIComponent(s.auth.password)):"";y.Authorization="Basic "+btoa(A+":"+m)}var g=a(s.baseURL,s.url);b.open(s.method.toUpperCase(),i(g,s.params,s.paramsSerializer),!0),b.timeout=s.timeout;function d(){if(b){var w="getAllResponseHeaders"in b?c(b.getAllResponseHeaders()):null,k=!S||S==="text"||S==="json"?b.responseText:b.response,E={data:k,status:b.status,statusText:b.statusText,headers:w,config:s,request:b};o(p,h,E),b=null}}if("onloadend"in b?b.onloadend=d:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(d)},b.onabort=function(){!b||(h(l("Request aborted",s,"ECONNABORTED",b)),b=null)},b.onerror=function(){h(l("Network Error",s,null,b)),b=null},b.ontimeout=function(){var w="timeout of "+s.timeout+"ms exceeded";s.timeoutErrorMessage&&(w=s.timeoutErrorMessage),h(l(w,s,s.transitional&&s.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",b)),b=null},t.isStandardBrowserEnv()){var v=(s.withCredentials||u(g))&&s.xsrfCookieName?n.read(s.xsrfCookieName):void 0;v&&(y[s.xsrfHeaderName]=v)}"setRequestHeader"in b&&t.forEach(y,function(w,k){typeof x>"u"&&k.toLowerCase()==="content-type"?delete y[k]:b.setRequestHeader(k,w)}),t.isUndefined(s.withCredentials)||(b.withCredentials=!!s.withCredentials),S&&S!=="json"&&(b.responseType=s.responseType),typeof s.onDownloadProgress=="function"&&b.addEventListener("progress",s.onDownloadProgress),typeof s.onUploadProgress=="function"&&b.upload&&b.upload.addEventListener("progress",s.onUploadProgress),s.cancelToken&&s.cancelToken.promise.then(function(w){!b||(b.abort(),h(w),b=null)}),x||(x=null),b.send(x)})}}),ue=N((r,e)=>{"use strict";var t=B(),o=rn(),n=Ve(),i={"Content-Type":"application/x-www-form-urlencoded"};function a(s,p){!t.isUndefined(s)&&t.isUndefined(s["Content-Type"])&&(s["Content-Type"]=p)}function c(){var s;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(s=Je()),s}function u(s,p,h){if(t.isString(s))try{return(p||JSON.parse)(s),t.trim(s)}catch(x){if(x.name!=="SyntaxError")throw x}return(h||JSON.stringify)(s)}var l={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:c(),transformRequest:[function(s,p){return o(p,"Accept"),o(p,"Content-Type"),t.isFormData(s)||t.isArrayBuffer(s)||t.isBuffer(s)||t.isStream(s)||t.isFile(s)||t.isBlob(s)?s:t.isArrayBufferView(s)?s.buffer:t.isURLSearchParams(s)?(a(p,"application/x-www-form-urlencoded;charset=utf-8"),s.toString()):t.isObject(s)||p&&p["Content-Type"]==="application/json"?(a(p,"application/json"),u(s)):s}],transformResponse:[function(s){var p=this.transitional,h=p&&p.silentJSONParsing,x=p&&p.forcedJSONParsing,y=!h&&this.responseType==="json";if(y||x&&t.isString(s)&&s.length)try{return JSON.parse(s)}catch(S){if(y)throw S.name==="SyntaxError"?n(S,this,"E_JSON_PARSE"):S}return s}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(s){return s>=200&&s<300}};l.headers={common:{Accept:"application/json, text/plain, */*"}},t.forEach(["delete","get","head"],function(s){l.headers[s]={}}),t.forEach(["post","put","patch"],function(s){l.headers[s]=t.merge(i)}),e.exports=l}),fn=N((r,e)=>{"use strict";var t=B(),o=ue();e.exports=function(n,i,a){var c=this||o;return t.forEach(a,function(u){n=u.call(c,n,i)}),n}}),We=N((r,e)=>{"use strict";e.exports=function(t){return!!(t&&t.__CANCEL__)}}),hn=N((r,e)=>{"use strict";var t=B(),o=fn(),n=We(),i=ue();function a(c){c.cancelToken&&c.cancelToken.throwIfRequested()}e.exports=function(c){a(c),c.headers=c.headers||{},c.data=o.call(c,c.data,c.headers,c.transformRequest),c.headers=t.merge(c.headers.common||{},c.headers[c.method]||{},c.headers),t.forEach(["delete","get","head","post","put","patch","common"],function(l){delete c.headers[l]});var u=c.adapter||i.adapter;return u(c).then(function(l){return a(c),l.data=o.call(c,l.data,l.headers,c.transformResponse),l},function(l){return n(l)||(a(c),l&&l.response&&(l.response.data=o.call(c,l.response.data,l.response.headers,c.transformResponse))),Promise.reject(l)})}}),Xe=N((r,e)=>{"use strict";var t=B();e.exports=function(o,n){n=n||{};var i={},a=["url","method","data"],c=["headers","auth","proxy","params"],u=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],l=["validateStatus"];function s(y,S){return t.isPlainObject(y)&&t.isPlainObject(S)?t.merge(y,S):t.isPlainObject(S)?t.merge({},S):t.isArray(S)?S.slice():S}function p(y){t.isUndefined(n[y])?t.isUndefined(o[y])||(i[y]=s(void 0,o[y])):i[y]=s(o[y],n[y])}t.forEach(a,function(y){t.isUndefined(n[y])||(i[y]=s(void 0,n[y]))}),t.forEach(c,p),t.forEach(u,function(y){t.isUndefined(n[y])?t.isUndefined(o[y])||(i[y]=s(void 0,o[y])):i[y]=s(void 0,n[y])}),t.forEach(l,function(y){y in n?i[y]=s(o[y],n[y]):y in o&&(i[y]=s(void 0,o[y]))});var h=a.concat(c).concat(u).concat(l),x=Object.keys(o).concat(Object.keys(n)).filter(function(y){return h.indexOf(y)===-1});return t.forEach(x,p),i}}),pn=N((r,e)=>{e.exports={name:"axios",version:"0.21.4",description:"Promise based HTTP client for the browser and node.js",main:"index.js",scripts:{test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},repository:{type:"git",url:"https://github.com/axios/axios.git"},keywords:["xhr","http","ajax","promise","node"],author:"Matt Zabriskie",license:"MIT",bugs:{url:"https://github.com/axios/axios/issues"},homepage:"https://axios-http.com",devDependencies:{coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},browser:{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},jsdelivr:"dist/axios.min.js",unpkg:"dist/axios.min.js",typings:"./index.d.ts",dependencies:{"follow-redirects":"^1.14.0"},bundlesize:[{path:"./dist/axios.min.js",threshold:"5kB"}]}}),dn=N((r,e)=>{"use strict";var t=pn(),o={};["object","boolean","number","function","string","symbol"].forEach(function(u,l){o[u]=function(s){return typeof s===u||"a"+(l<1?"n ":" ")+u}});var n={},i=t.version.split(".");function a(u,l){for(var s=l?l.split("."):i,p=u.split("."),h=0;h<3;h++){if(s[h]>p[h])return!0;if(s[h]<p[h])return!1}return!1}o.transitional=function(u,l,s){var p=l&&a(l);function h(x,y){return"[Axios v"+t.version+"] Transitional option '"+x+"'"+y+(s?". "+s:"")}return function(x,y,S){if(u===!1)throw new Error(h(y," has been removed in "+l));return p&&!n[y]&&(n[y]=!0,console.warn(h(y," has been deprecated since v"+l+" and will be removed in the near future"))),u?u(x,y,S):!0}};function c(u,l,s){if(typeof u!="object")throw new TypeError("options must be an object");for(var p=Object.keys(u),h=p.length;h-- >0;){var x=p[h],y=l[x];if(y){var S=u[x],b=S===void 0||y(S,x,u);if(b!==!0)throw new TypeError("option "+x+" must be "+b);continue}if(s!==!0)throw Error("Unknown option "+x)}}e.exports={isOlderVersion:a,assertOptions:c,validators:o}}),mn=N((r,e)=>{"use strict";var t=B(),o=ze(),n=tn(),i=hn(),a=Xe(),c=dn(),u=c.validators;function l(s){this.defaults=s,this.interceptors={request:new n,response:new n}}l.prototype.request=function(s){typeof s=="string"?(s=arguments[1]||{},s.url=arguments[0]):s=s||{},s=a(this.defaults,s),s.method?s.method=s.method.toLowerCase():this.defaults.method?s.method=this.defaults.method.toLowerCase():s.method="get";var p=s.transitional;p!==void 0&&c.assertOptions(p,{silentJSONParsing:u.transitional(u.boolean,"1.0.0"),forcedJSONParsing:u.transitional(u.boolean,"1.0.0"),clarifyTimeoutError:u.transitional(u.boolean,"1.0.0")},!1);var h=[],x=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(s)===!1||(x=x&&d.synchronous,h.unshift(d.fulfilled,d.rejected))});var y=[];this.interceptors.response.forEach(function(d){y.push(d.fulfilled,d.rejected)});var S;if(!x){var b=[i,void 0];for(Array.prototype.unshift.apply(b,h),b=b.concat(y),S=Promise.resolve(s);b.length;)S=S.then(b.shift(),b.shift());return S}for(var A=s;h.length;){var m=h.shift(),g=h.shift();try{A=m(A)}catch(d){g(d);break}}try{S=i(A)}catch(d){return Promise.reject(d)}for(;y.length;)S=S.then(y.shift(),y.shift());return S},l.prototype.getUri=function(s){return s=a(this.defaults,s),o(s.url,s.params,s.paramsSerializer).replace(/^\?/,"")},t.forEach(["delete","get","head","options"],function(s){l.prototype[s]=function(p,h){return this.request(a(h||{},{method:s,url:p,data:(h||{}).data}))}}),t.forEach(["post","put","patch"],function(s){l.prototype[s]=function(p,h,x){return this.request(a(x||{},{method:s,url:p,data:h}))}}),e.exports=l}),Ke=N((r,e)=>{"use strict";function t(o){this.message=o}t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,e.exports=t}),gn=N((r,e)=>{"use strict";var t=Ke();function o(n){if(typeof n!="function")throw new TypeError("executor must be a function.");var i;this.promise=new Promise(function(c){i=c});var a=this;n(function(c){a.reason||(a.reason=new t(c),i(a.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var n,i=new o(function(a){n=a});return{token:i,cancel:n}},e.exports=o}),vn=N((r,e)=>{"use strict";e.exports=function(t){return function(o){return t.apply(null,o)}}}),yn=N((r,e)=>{"use strict";e.exports=function(t){return typeof t=="object"&&t.isAxiosError===!0}}),bn=N((r,e)=>{"use strict";var t=B(),o=$e(),n=mn(),i=Xe(),a=ue();function c(l){var s=new n(l),p=o(n.prototype.request,s);return t.extend(p,n.prototype,s),t.extend(p,s),p}var u=c(a);u.Axios=n,u.create=function(l){return c(i(u.defaults,l))},u.Cancel=Ke(),u.CancelToken=gn(),u.isCancel=We(),u.all=function(l){return Promise.all(l)},u.spread=vn(),u.isAxiosError=yn(),e.exports=u,e.exports.default=u}),wn=N((r,e)=>{e.exports=bn()}),xn=en(wn()),Sn=class{url;httpClient;accessToken;constructor({url:r}){this.url=r,this.httpClient=xn.default.create({baseURL:this.url})}async upload(r){try{return{fileMetadata:(await this.httpClient.post("/files",r.file,{headers:{...this.generateUploadHeaders(r),...this.generateAuthHeaders()}})).data,error:null}}catch(e){return{fileMetadata:null,error:e}}}async getPresignedUrl(r){try{let{fileId:e}=r;return{presignedUrl:(await this.httpClient.get(`/files/${e}/presignedurl`,{headers:{...this.generateAuthHeaders()}})).data,error:null}}catch(e){return{presignedUrl:null,error:e}}}async delete(r){try{let{fileId:e}=r;return await this.httpClient.delete(`/files/${e}`,{headers:{...this.generateAuthHeaders()}}),{error:null}}catch(e){return{error:e}}}setAccessToken(r){this.accessToken=r}generateUploadHeaders(r){let{bucketId:e,name:t,id:o}=r,n={};return e&&(n["x-nhost-bucket-id"]=e),o&&(n["x-nhost-file-id"]=o),t&&(n["x-nhost-file-name"]=t),n}generateAuthHeaders(){return this.accessToken?{Authorization:`Bearer ${this.accessToken}`}:null}},Qe=class{url;api;constructor({url:r}){this.url=r,this.api=new Sn({url:r})}async upload(r){let e=new FormData;e.append("file",r.file);let{fileMetadata:t,error:o}=await this.api.upload({...r,file:e});return o?{fileMetadata:null,error:o}:t?{fileMetadata:t,error:null}:{fileMetadata:null,error:new Error("Invalid file returned")}}getUrl(r){return this.getPublicUrl(r)}getPublicUrl(r){let{fileId:e}=r;return`${this.url}/files/${e}`}async getPresignedUrl(r){let{presignedUrl:e,error:t}=await this.api.getPresignedUrl(r);return t?{presignedUrl:null,error:t}:e?{presignedUrl:e,error:null}:{presignedUrl:null,error:new Error("Invalid file id")}}async delete(r){let{error:e}=await this.api.delete(r);return e?{error:e}:{error:null}}setAccessToken(r){this.api.setAccessToken(r)}};var nr=Ie(Oe()),je=class{instance;accessToken;constructor(e){let{url:t}=e;this.accessToken=null,this.instance=nr.default.create({baseURL:t})}async call(e,t,o){let n={...this.generateAccessTokenHeaders(),...o?.headers},i;try{i=await this.instance.post(e,t,{...o,headers:n})}catch(a){if(a instanceof Error)return{res:null,error:a}}return i?{res:i,error:null}:{res:null,error:new Error("Unable to make post request to funtion")}}setAccessToken(e){if(!e){this.accessToken=null;return}this.accessToken=e}generateAccessTokenHeaders(){if(!!this.accessToken)return{Authorization:`Bearer ${this.accessToken}`}}};var sr=Ie(Oe()),Ne=class{url;instance;accessToken;constructor(e){let{url:t}=e;this.url=t,this.accessToken=null,this.instance=sr.default.create({baseURL:t})}async request(e,t,o){let n={...o?.headers,...this.generateAccessTokenHeaders()},i="",a;try{a=(await this.instance.post("",{operationName:i||void 0,query:e,variables:t},{...o,headers:n})).data}catch(c){return c instanceof Error?{data:null,error:c}:(console.error(c),{data:null,error:new Error("Unable to get do GraphQL request")})}return typeof a!="object"||Array.isArray(a)||a===null?{data:null,error:new Error("incorrect response data from GraphQL server")}:(a=a,a.errors?{data:null,error:a.errors}:{data:a.data,error:null})}getUrl(){return this.url}setAccessToken(e){if(!e){this.accessToken=null;return}this.accessToken=e}generateAccessTokenHeaders(){if(!!this.accessToken)return{Authorization:`Bearer ${this.accessToken}`}}};var Re=class{auth;storage;functions;graphql;constructor(e){if(!e.backendUrl)throw new Error("Please specify a `backendUrl`. Docs: [todo]!");let{backendUrl:t,refreshIntervalTime:o,clientStorage:n,clientStorageType:i,autoRefreshToken:a,autoLogin:c}=e;this.auth=new Me({url:`${t}/v1/auth`,refreshIntervalTime:o,clientStorage:n,clientStorageType:i,autoRefreshToken:a,autoLogin:c}),this.storage=new Qe({url:`${t}/v1/storage`}),this.functions=new je({url:`${t}/v1/functions`}),this.graphql=new Ne({url:`${t}/v1/graphql`}),this.storage.setAccessToken(this.auth.getAccessToken()),this.functions.setAccessToken(this.auth.getAccessToken()),this.graphql.setAccessToken(this.auth.getAccessToken()),this.auth.onAuthStateChanged((u,l)=>{this.storage.setAccessToken(l?.accessToken),this.functions.setAccessToken(l?.accessToken),this.graphql.setAccessToken(l?.accessToken)}),this.auth.onTokenChanged(u=>{this.storage.setAccessToken(u?.accessToken),this.functions.setAccessToken(u?.accessToken),this.graphql.setAccessToken(u?.accessToken)})}};var fo=r=>new Re(r);export{Re as NhostClient,fo as createClient};
5
5
  //# sourceMappingURL=index.es.js.map