@shipengine/react-api 1.0.0-next.0 → 1.0.0-next.1
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/{shipengine-api-react/src/hooks → hooks}/use-update-billing.d.ts +1 -4
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/package.json +2 -2
- /package/{shipengine-api-react/src/hooks → hooks}/index.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-add-funds.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-calculate-rates.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-connect-carrier.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-create-label.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-create-sales-order-shipment.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-create-warehouse.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-delete-warehouse.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-get-account-settings.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-get-auto-funding-configuration.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-get-carrier-by-id.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-get-insurance-account.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-get-label.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-get-sales-order-shipment.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-get-sales-order.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-get-shipment.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-get-wallet-transaction-history.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-list-carriers.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-list-custom-package-types.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-list-labels.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-list-order-sources.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-list-sales-order-shipments.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-list-sales-orders.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-list-warehouses.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-notify-sales-order.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-parse-address.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-refresh-order-source.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-shipengine.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-update-auto-funding.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-update-sales-order-shipment.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-update-warehouse.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-validate-addresses.d.ts +0 -0
- /package/{shipengine-api-react/src/hooks → hooks}/use-void-label.d.ts +0 -0
- /package/{shipengine-api-react/src/index.d.ts → index.d.ts} +0 -0
- /package/{shipengine-api-react/src/providers → providers}/index.d.ts +0 -0
- /package/{shipengine-api-react/src/providers → providers}/shipengine.d.ts +0 -0
- /package/{shipengine-api-react/src/utilities → utilities}/delay.d.ts +0 -0
- /package/{shipengine-api-react/src/utilities → utilities}/error.d.ts +0 -0
- /package/{shipengine-api-react/src/utilities → utilities}/index.d.ts +0 -0
- /package/{shipengine-api-react/src/utilities → utilities}/logger.d.ts +0 -0
- /package/{shipengine-api-react/src/utilities → utilities}/retry.d.ts +0 -0
|
@@ -2,7 +2,4 @@ import { SE } from "@shipengine/js-api";
|
|
|
2
2
|
/**
|
|
3
3
|
* @category ShipEngine API Hooks
|
|
4
4
|
*/
|
|
5
|
-
export declare const useUpdateBilling: () => import("react-query").UseMutationResult<{}, SE.CodedError[],
|
|
6
|
-
address: SE.Address;
|
|
7
|
-
creditCard: SE.CreditCard;
|
|
8
|
-
}, unknown>;
|
|
5
|
+
export declare const useUpdateBilling: () => import("react-query").UseMutationResult<{}, SE.CodedError[], void, unknown>;
|
package/index.js
CHANGED
|
@@ -13,4 +13,4 @@ Caused by: `+$n(r))}return e}ce.prototype.trace=ye(10),ce.prototype.debug=ye(20)
|
|
|
13
13
|
`),function(f){if(o=f.indexOf(":"),a=t.trim(f.substr(0,o)).toLowerCase(),s=t.trim(f.substr(o+1)),a){if(i[a]&&e.indexOf(a)>=0)return;a==="set-cookie"?i[a]=(i[a]?i[a]:[]).concat([s]):i[a]=i[a]?i[a]+", "+s:s}}),i},vt}var mt,Qr;function xa(){if(Qr)return mt;Qr=1;var t=K;return mt=t.isStandardBrowserEnv()?function(){var r=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a"),i;function a(s){var o=s;return r&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{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(o){var l=t.isString(o)?a(o):o;return l.protocol===i.protocol&&l.host===i.host}}():function(){return function(){return!0}}(),mt}var gt,kr;function it(){if(kr)return gt;kr=1;function t(e){this.message=e}return t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,gt=t,gt}var bt,Br;function jr(){if(Br)return bt;Br=1;var t=K,e=Pa(),r=Ea(),n=Bn,i=Ca(),a=Fa(),s=xa(),o=Kn(),l=zn,f=it();return bt=function(u){return new Promise(function(d,p){var v=u.data,m=u.headers,y=u.responseType,g;function S(){u.cancelToken&&u.cancelToken.unsubscribe(g),u.signal&&u.signal.removeEventListener("abort",g)}t.isFormData(v)&&delete m["Content-Type"];var b=new XMLHttpRequest;if(u.auth){var C=u.auth.username||"",P=u.auth.password?unescape(encodeURIComponent(u.auth.password)):"";m.Authorization="Basic "+btoa(C+":"+P)}var _=i(u.baseURL,u.url);b.open(u.method.toUpperCase(),n(_,u.params,u.paramsSerializer),!0),b.timeout=u.timeout;function W(){if(b){var R="getAllResponseHeaders"in b?a(b.getAllResponseHeaders()):null,M=!y||y==="text"||y==="json"?b.responseText:b.response,x={data:M,status:b.status,statusText:b.statusText,headers:R,config:u,request:b};e(function(q){d(q),S()},function(q){p(q),S()},x),b=null}}if("onloadend"in b?b.onloadend=W:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(W)},b.onabort=function(){b&&(p(o("Request aborted",u,"ECONNABORTED",b)),b=null)},b.onerror=function(){p(o("Network Error",u,null,b)),b=null},b.ontimeout=function(){var M=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",x=u.transitional||l;u.timeoutErrorMessage&&(M=u.timeoutErrorMessage),p(o(M,u,x.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",b)),b=null},t.isStandardBrowserEnv()){var Q=(u.withCredentials||s(_))&&u.xsrfCookieName?r.read(u.xsrfCookieName):void 0;Q&&(m[u.xsrfHeaderName]=Q)}"setRequestHeader"in b&&t.forEach(m,function(M,x){typeof v>"u"&&x.toLowerCase()==="content-type"?delete m[x]:b.setRequestHeader(x,M)}),t.isUndefined(u.withCredentials)||(b.withCredentials=!!u.withCredentials),y&&y!=="json"&&(b.responseType=u.responseType),typeof u.onDownloadProgress=="function"&&b.addEventListener("progress",u.onDownloadProgress),typeof u.onUploadProgress=="function"&&b.upload&&b.upload.addEventListener("progress",u.onUploadProgress),(u.cancelToken||u.signal)&&(g=function(R){b&&(p(!R||R&&R.type?new f("canceled"):R),b.abort(),b=null)},u.cancelToken&&u.cancelToken.subscribe(g),u.signal&&(u.signal.aborted?g():u.signal.addEventListener("abort",g))),v||(v=null),b.send(v)})},bt}var N=K,zr=Oa,Ia=jn,qa=zn,_a={"Content-Type":"application/x-www-form-urlencoded"};function Kr(t,e){!N.isUndefined(t)&&N.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function $a(){var t;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(t=jr()),t}function Ma(t,e,r){if(N.isString(t))try{return(e||JSON.parse)(t),N.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(r||JSON.stringify)(t)}var at={transitional:qa,adapter:$a(),transformRequest:[function(e,r){return zr(r,"Accept"),zr(r,"Content-Type"),N.isFormData(e)||N.isArrayBuffer(e)||N.isBuffer(e)||N.isStream(e)||N.isFile(e)||N.isBlob(e)?e:N.isArrayBufferView(e)?e.buffer:N.isURLSearchParams(e)?(Kr(r,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):N.isObject(e)||r&&r["Content-Type"]==="application/json"?(Kr(r,"application/json"),Ma(e)):e}],transformResponse:[function(e){var r=this.transitional||at.transitional,n=r&&r.silentJSONParsing,i=r&&r.forcedJSONParsing,a=!n&&this.responseType==="json";if(a||i&&N.isString(e)&&e.length)try{return JSON.parse(e)}catch(s){if(a)throw s.name==="SyntaxError"?Ia(s,this,"E_JSON_PARSE"):s}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};N.forEach(["delete","get","head"],function(e){at.headers[e]={}});N.forEach(["post","put","patch"],function(e){at.headers[e]=N.merge(_a)});var hr=at,Da=K,Ta=hr,Ua=function(e,r,n){var i=this||Ta;return Da.forEach(n,function(s){e=s.call(i,e,r)}),e},St,Gr;function Gn(){return Gr||(Gr=1,St=function(e){return!!(e&&e.__CANCEL__)}),St}var Wr=K,wt=Ua,Na=Gn(),La=hr,Qa=it();function Ot(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Qa("canceled")}var ka=function(e){Ot(e),e.headers=e.headers||{},e.data=wt.call(e,e.data,e.headers,e.transformRequest),e.headers=Wr.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Wr.forEach(["delete","get","head","post","put","patch","common"],function(i){delete e.headers[i]});var r=e.adapter||La.adapter;return r(e).then(function(i){return Ot(e),i.data=wt.call(e,i.data,i.headers,e.transformResponse),i},function(i){return Na(i)||(Ot(e),i&&i.response&&(i.response.data=wt.call(e,i.response.data,i.response.headers,e.transformResponse))),Promise.reject(i)})},G=K,Wn=function(e,r){r=r||{};var n={};function i(c,u){return G.isPlainObject(c)&&G.isPlainObject(u)?G.merge(c,u):G.isPlainObject(u)?G.merge({},u):G.isArray(u)?u.slice():u}function a(c){if(G.isUndefined(r[c])){if(!G.isUndefined(e[c]))return i(void 0,e[c])}else return i(e[c],r[c])}function s(c){if(!G.isUndefined(r[c]))return i(void 0,r[c])}function o(c){if(G.isUndefined(r[c])){if(!G.isUndefined(e[c]))return i(void 0,e[c])}else return i(void 0,r[c])}function l(c){if(c in r)return i(e[c],r[c]);if(c in e)return i(void 0,e[c])}var f={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:l};return G.forEach(Object.keys(e).concat(Object.keys(r)),function(u){var h=f[u]||a,d=h(u);G.isUndefined(d)&&h!==l||(n[u]=d)}),n},Pt,Hr;function Hn(){return Hr||(Hr=1,Pt={version:"0.26.1"}),Pt}var Ba=Hn().version,dr={};["object","boolean","number","function","string","symbol"].forEach(function(t,e){dr[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});var Vr={};dr.transitional=function(e,r,n){function i(a,s){return"[Axios v"+Ba+"] Transitional option '"+a+"'"+s+(n?". "+n:"")}return function(a,s,o){if(e===!1)throw new Error(i(s," has been removed"+(r?" in "+r:"")));return r&&!Vr[s]&&(Vr[s]=!0,console.warn(i(s," has been deprecated since v"+r+" and will be removed in the near future"))),e?e(a,s,o):!0}};function ja(t,e,r){if(typeof t!="object")throw new TypeError("options must be an object");for(var n=Object.keys(t),i=n.length;i-- >0;){var a=n[i],s=e[a];if(s){var o=t[a],l=o===void 0||s(o,a,t);if(l!==!0)throw new TypeError("option "+a+" must be "+l);continue}if(r!==!0)throw Error("Unknown option "+a)}}var za={assertOptions:ja,validators:dr},Vn=K,Ka=Bn,Jr=Sa,Xr=ka,st=Wn,Jn=za,me=Jn.validators;function Me(t){this.defaults=t,this.interceptors={request:new Jr,response:new Jr}}Me.prototype.request=function(e,r){typeof e=="string"?(r=r||{},r.url=e):r=e||{},r=st(this.defaults,r),r.method?r.method=r.method.toLowerCase():this.defaults.method?r.method=this.defaults.method.toLowerCase():r.method="get";var n=r.transitional;n!==void 0&&Jn.assertOptions(n,{silentJSONParsing:me.transitional(me.boolean),forcedJSONParsing:me.transitional(me.boolean),clarifyTimeoutError:me.transitional(me.boolean)},!1);var i=[],a=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(r)===!1||(a=a&&d.synchronous,i.unshift(d.fulfilled,d.rejected))});var s=[];this.interceptors.response.forEach(function(d){s.push(d.fulfilled,d.rejected)});var o;if(!a){var l=[Xr,void 0];for(Array.prototype.unshift.apply(l,i),l=l.concat(s),o=Promise.resolve(r);l.length;)o=o.then(l.shift(),l.shift());return o}for(var f=r;i.length;){var c=i.shift(),u=i.shift();try{f=c(f)}catch(h){u(h);break}}try{o=Xr(f)}catch(h){return Promise.reject(h)}for(;s.length;)o=o.then(s.shift(),s.shift());return o};Me.prototype.getUri=function(e){return e=st(this.defaults,e),Ka(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")};Vn.forEach(["delete","get","head","options"],function(e){Me.prototype[e]=function(r,n){return this.request(st(n||{},{method:e,url:r,data:(n||{}).data}))}});Vn.forEach(["post","put","patch"],function(e){Me.prototype[e]=function(r,n,i){return this.request(st(i||{},{method:e,url:r,data:n}))}});var Ga=Me,Et,Yr;function Wa(){if(Yr)return Et;Yr=1;var t=it();function e(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var n;this.promise=new Promise(function(s){n=s});var i=this;this.promise.then(function(a){if(i._listeners){var s,o=i._listeners.length;for(s=0;s<o;s++)i._listeners[s](a);i._listeners=null}}),this.promise.then=function(a){var s,o=new Promise(function(l){i.subscribe(l),s=l}).then(a);return o.cancel=function(){i.unsubscribe(s)},o},r(function(s){i.reason||(i.reason=new t(s),n(i.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.prototype.subscribe=function(n){if(this.reason){n(this.reason);return}this._listeners?this._listeners.push(n):this._listeners=[n]},e.prototype.unsubscribe=function(n){if(this._listeners){var i=this._listeners.indexOf(n);i!==-1&&this._listeners.splice(i,1)}},e.source=function(){var n,i=new e(function(s){n=s});return{token:i,cancel:n}},Et=e,Et}var At,Zr;function Ha(){return Zr||(Zr=1,At=function(e){return function(n){return e.apply(null,n)}}),At}var Rt,en;function Va(){if(en)return Rt;en=1;var t=K;return Rt=function(r){return t.isObject(r)&&r.isAxiosError===!0},Rt}var tn=K,Ja=Nn,ze=Ga,Xa=Wn,Ya=hr;function Xn(t){var e=new ze(t),r=Ja(ze.prototype.request,e);return tn.extend(r,ze.prototype,e),tn.extend(r,e),r.create=function(i){return Xn(Xa(t,i))},r}var Z=Xn(Ya);Z.Axios=ze;Z.Cancel=it();Z.CancelToken=Wa();Z.isCancel=Gn();Z.VERSION=Hn().version;Z.all=function(e){return Promise.all(e)};Z.spread=Ha();Z.isAxiosError=Va();na.exports=Z;Xe.default=Z;(function(t){t.exports=Xe})(ra);const Jt=ea(Wt);var Ye={},Za={get exports(){return Ye},set exports(t){Ye=t}};(function(t){(function(){var e,r,n,i,a,s,o,l,f;r={},l=this,t!==null&&t.exports?t.exports=r:l.ipaddr=r,o=function(c,u,h,d){var p,v;if(c.length!==u.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");for(p=0;d>0;){if(v=h-d,v<0&&(v=0),c[p]>>v!==u[p]>>v)return!1;d-=h,p+=1}return!0},r.subnetMatch=function(c,u,h){var d,p,v,m,y;h==null&&(h="unicast");for(v in u)for(m=u[v],m[0]&&!(m[0]instanceof Array)&&(m=[m]),d=0,p=m.length;d<p;d++)if(y=m[d],c.kind()===y[0].kind()&&c.match.apply(c,y))return v;return h},r.IPv4=function(){function c(u){var h,d,p;if(u.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");for(h=0,d=u.length;h<d;h++)if(p=u[h],!(0<=p&&p<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=u}return c.prototype.kind=function(){return"ipv4"},c.prototype.toString=function(){return this.octets.join(".")},c.prototype.toNormalizedString=function(){return this.toString()},c.prototype.toByteArray=function(){return this.octets.slice(0)},c.prototype.match=function(u,h){var d;if(h===void 0&&(d=u,u=d[0],h=d[1]),u.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return o(this.octets,u.octets,8,h)},c.prototype.SpecialRanges={unspecified:[[new c([0,0,0,0]),8]],broadcast:[[new c([255,255,255,255]),32]],multicast:[[new c([224,0,0,0]),4]],linkLocal:[[new c([169,254,0,0]),16]],loopback:[[new c([127,0,0,0]),8]],carrierGradeNat:[[new c([100,64,0,0]),10]],private:[[new c([10,0,0,0]),8],[new c([172,16,0,0]),12],[new c([192,168,0,0]),16]],reserved:[[new c([192,0,0,0]),24],[new c([192,0,2,0]),24],[new c([192,88,99,0]),24],[new c([198,51,100,0]),24],[new c([203,0,113,0]),24],[new c([240,0,0,0]),4]]},c.prototype.range=function(){return r.subnetMatch(this,this.SpecialRanges)},c.prototype.toIPv4MappedAddress=function(){return r.IPv6.parse("::ffff:"+this.toString())},c.prototype.prefixLengthFromSubnetMask=function(){var u,h,d,p,v,m,y;for(y={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},u=0,v=!1,h=d=3;d>=0;h=d+=-1)if(p=this.octets[h],p in y){if(m=y[p],v&&m!==0)return null;m!==8&&(v=!0),u+=m}else return null;return 32-u},c}(),n="(0?\\d+|0x[a-f0-9]+)",i={fourOctet:new RegExp("^"+n+"\\."+n+"\\."+n+"\\."+n+"$","i"),longValue:new RegExp("^"+n+"$","i")},r.IPv4.parser=function(c){var u,h,d,p,v;if(h=function(m){return m[0]==="0"&&m[1]!=="x"?parseInt(m,8):parseInt(m)},u=c.match(i.fourOctet))return function(){var m,y,g,S;for(g=u.slice(1,6),S=[],m=0,y=g.length;m<y;m++)d=g[m],S.push(h(d));return S}();if(u=c.match(i.longValue)){if(v=h(u[1]),v>4294967295||v<0)throw new Error("ipaddr: address outside defined range");return function(){var m,y;for(y=[],p=m=0;m<=24;p=m+=8)y.push(v>>p&255);return y}().reverse()}else return null},r.IPv6=function(){function c(u,h){var d,p,v,m,y,g;if(u.length===16)for(this.parts=[],d=p=0;p<=14;d=p+=2)this.parts.push(u[d]<<8|u[d+1]);else if(u.length===8)this.parts=u;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(g=this.parts,v=0,m=g.length;v<m;v++)if(y=g[v],!(0<=y&&y<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");h&&(this.zoneId=h)}return c.prototype.kind=function(){return"ipv6"},c.prototype.toString=function(){return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/,"::")},c.prototype.toRFC5952String=function(){var u,h,d,p,v;for(p=/((^|:)(0(:|$)){2,})/g,v=this.toNormalizedString(),u=0,h=-1;d=p.exec(v);)d[0].length>h&&(u=d.index,h=d[0].length);return h<0?v:v.substring(0,u)+"::"+v.substring(u+h)},c.prototype.toByteArray=function(){var u,h,d,p,v;for(u=[],v=this.parts,h=0,d=v.length;h<d;h++)p=v[h],u.push(p>>8),u.push(p&255);return u},c.prototype.toNormalizedString=function(){var u,h,d;return u=function(){var p,v,m,y;for(m=this.parts,y=[],p=0,v=m.length;p<v;p++)h=m[p],y.push(h.toString(16));return y}.call(this).join(":"),d="",this.zoneId&&(d="%"+this.zoneId),u+d},c.prototype.toFixedLengthString=function(){var u,h,d;return u=function(){var p,v,m,y;for(m=this.parts,y=[],p=0,v=m.length;p<v;p++)h=m[p],y.push(h.toString(16).padStart(4,"0"));return y}.call(this).join(":"),d="",this.zoneId&&(d="%"+this.zoneId),u+d},c.prototype.match=function(u,h){var d;if(h===void 0&&(d=u,u=d[0],h=d[1]),u.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return o(this.parts,u.parts,16,h)},c.prototype.SpecialRanges={unspecified:[new c([0,0,0,0,0,0,0,0]),128],linkLocal:[new c([65152,0,0,0,0,0,0,0]),10],multicast:[new c([65280,0,0,0,0,0,0,0]),8],loopback:[new c([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new c([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new c([0,0,0,0,0,65535,0,0]),96],rfc6145:[new c([0,0,0,0,65535,0,0,0]),96],rfc6052:[new c([100,65435,0,0,0,0,0,0]),96],"6to4":[new c([8194,0,0,0,0,0,0,0]),16],teredo:[new c([8193,0,0,0,0,0,0,0]),32],reserved:[[new c([8193,3512,0,0,0,0,0,0]),32]]},c.prototype.range=function(){return r.subnetMatch(this,this.SpecialRanges)},c.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},c.prototype.toIPv4Address=function(){var u,h,d;if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");return d=this.parts.slice(-2),u=d[0],h=d[1],new r.IPv4([u>>8,u&255,h>>8,h&255])},c.prototype.prefixLengthFromSubnetMask=function(){var u,h,d,p,v,m,y;for(y={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},u=0,v=!1,h=d=7;d>=0;h=d+=-1)if(p=this.parts[h],p in y){if(m=y[p],v&&m!==0)return null;m!==16&&(v=!0),u+=m}else return null;return 128-u},c}(),a="(?:[0-9a-f]+::?)+",f="%[0-9a-z]{1,}",s={zoneIndex:new RegExp(f,"i"),native:new RegExp("^(::)?("+a+")?([0-9a-f]+)?(::)?("+f+")?$","i"),transitional:new RegExp("^((?:"+a+")|(?:::)(?:"+a+")?)"+(n+"\\."+n+"\\."+n+"\\."+n)+("("+f+")?$"),"i")},e=function(c,u){var h,d,p,v,m,y;if(c.indexOf("::")!==c.lastIndexOf("::"))return null;for(y=(c.match(s.zoneIndex)||[])[0],y&&(y=y.substring(1),c=c.replace(/%.+$/,"")),h=0,d=-1;(d=c.indexOf(":",d+1))>=0;)h++;if(c.substr(0,2)==="::"&&h--,c.substr(-2,2)==="::"&&h--,h>u)return null;for(m=u-h,v=":";m--;)v+="0:";return c=c.replace("::",v),c[0]===":"&&(c=c.slice(1)),c[c.length-1]===":"&&(c=c.slice(0,-1)),u=function(){var g,S,b,C;for(b=c.split(":"),C=[],g=0,S=b.length;g<S;g++)p=b[g],C.push(parseInt(p,16));return C}(),{parts:u,zoneId:y}},r.IPv6.parser=function(c){var u,h,d,p,v,m,y;if(s.native.test(c))return e(c,8);if((p=c.match(s.transitional))&&(y=p[6]||"",u=e(p[1].slice(0,-1)+y,6),u.parts)){for(m=[parseInt(p[2]),parseInt(p[3]),parseInt(p[4]),parseInt(p[5])],h=0,d=m.length;h<d;h++)if(v=m[h],!(0<=v&&v<=255))return null;return u.parts.push(m[0]<<8|m[1]),u.parts.push(m[2]<<8|m[3]),{parts:u.parts,zoneId:u.zoneId}}return null},r.IPv4.isIPv4=r.IPv6.isIPv6=function(c){return this.parser(c)!==null},r.IPv4.isValid=function(c){try{return new this(this.parser(c)),!0}catch{return!1}},r.IPv4.isValidFourPartDecimal=function(c){return!!(r.IPv4.isValid(c)&&c.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},r.IPv6.isValid=function(c){var u;if(typeof c=="string"&&c.indexOf(":")===-1)return!1;try{return u=this.parser(c),new this(u.parts,u.zoneId),!0}catch{return!1}},r.IPv4.parse=function(c){var u;if(u=this.parser(c),u===null)throw new Error("ipaddr: string is not formatted like ip address");return new this(u)},r.IPv6.parse=function(c){var u;if(u=this.parser(c),u.parts===null)throw new Error("ipaddr: string is not formatted like ip address");return new this(u.parts,u.zoneId)},r.IPv4.parseCIDR=function(c){var u,h,d;if((h=c.match(/^(.+)\/(\d+)$/))&&(u=parseInt(h[2]),u>=0&&u<=32))return d=[this.parse(h[1]),u],Object.defineProperty(d,"toString",{value:function(){return this.join("/")}}),d;throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},r.IPv4.subnetMaskFromPrefixLength=function(c){var u,h,d;if(c=parseInt(c),c<0||c>32)throw new Error("ipaddr: invalid IPv4 prefix length");for(d=[0,0,0,0],h=0,u=Math.floor(c/8);h<u;)d[h]=255,h++;return u<4&&(d[u]=Math.pow(2,c%8)-1<<8-c%8),new this(d)},r.IPv4.broadcastAddressFromCIDR=function(c){var u,h,d,p,v;try{for(u=this.parseCIDR(c),d=u[0].toByteArray(),v=this.subnetMaskFromPrefixLength(u[1]).toByteArray(),p=[],h=0;h<4;)p.push(parseInt(d[h],10)|parseInt(v[h],10)^255),h++;return new this(p)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},r.IPv4.networkAddressFromCIDR=function(c){var u,h,d,p,v;try{for(u=this.parseCIDR(c),d=u[0].toByteArray(),v=this.subnetMaskFromPrefixLength(u[1]).toByteArray(),p=[],h=0;h<4;)p.push(parseInt(d[h],10)&parseInt(v[h],10)),h++;return new this(p)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},r.IPv6.parseCIDR=function(c){var u,h,d;if((h=c.match(/^(.+)\/(\d+)$/))&&(u=parseInt(h[2]),u>=0&&u<=128))return d=[this.parse(h[1]),u],Object.defineProperty(d,"toString",{value:function(){return this.join("/")}}),d;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},r.isValid=function(c){return r.IPv6.isValid(c)||r.IPv4.isValid(c)},r.parse=function(c){if(r.IPv6.isValid(c))return r.IPv6.parse(c);if(r.IPv4.isValid(c))return r.IPv4.parse(c);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},r.parseCIDR=function(c){try{return r.IPv6.parseCIDR(c)}catch{try{return r.IPv4.parseCIDR(c)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},r.fromByteArray=function(c){var u;if(u=c.length,u===4)return new r.IPv4(c);if(u===16)return new r.IPv6(c);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},r.process=function(c){var u;return u=this.parse(c),u.kind()==="ipv6"&&u.isIPv4MappedAddress()?u.toIPv4Address():u}}).call(Un)})(Za);const Yn=t=>Array.isArray(t)&&t.every(e=>Zn(e)),Zn=t=>!!t.errorCode,es=async()=>{try{const t=await Jt.get("https://api.ipify.org/?format=json");return t.data.ip&&Ye.isValid(t.data.ip)?Ye.parse(t.data.ip).toString():void 0}catch{return}};class ts{constructor(e){this.client=e,this.list=()=>this.client.get("/v1/carriers"),this.get=r=>this.client.get(`/v1/carriers/${r}`),this.connect=async({carrierCode:r,...n})=>{const i=await es();return i?await this.client.post(`/v1/registration/${r}`,{...n,endUserIpAddress:i}):Promise.reject([new te("Unable to get IP address")])},this.addFunds=(r,n)=>this.client.put(`/v1/carriers/${r}/add_funds`,n),this.updateAutoFunding=(r,n)=>this.client.post(`/v1/carriers/${r}/auto_funding`,n),this.getAutoFunding=r=>this.client.get(`/v1/carriers/${r}/auto_funding`),this.client=e}}var xe={},rs={get exports(){return xe},set exports(t){xe=t}};(function(t){(function(e){var r=function(y,g,S){if(!f(g)||u(g)||h(g)||d(g)||l(g))return g;var b,C=0,P=0;if(c(g))for(b=[],P=g.length;C<P;C++)b.push(r(y,g[C],S));else{b={};for(var _ in g)Object.prototype.hasOwnProperty.call(g,_)&&(b[y(_,S)]=r(y,g[_],S))}return b},n=function(y,g){g=g||{};var S=g.separator||"_",b=g.split||/(?=[A-Z])/;return y.split(b).join(S)},i=function(y){return p(y)?y:(y=y.replace(/[\-_\s]+(.)?/g,function(g,S){return S?S.toUpperCase():""}),y.substr(0,1).toLowerCase()+y.substr(1))},a=function(y){var g=i(y);return g.substr(0,1).toUpperCase()+g.substr(1)},s=function(y,g){return n(y,g).toLowerCase()},o=Object.prototype.toString,l=function(y){return typeof y=="function"},f=function(y){return y===Object(y)},c=function(y){return o.call(y)=="[object Array]"},u=function(y){return o.call(y)=="[object Date]"},h=function(y){return o.call(y)=="[object RegExp]"},d=function(y){return o.call(y)=="[object Boolean]"},p=function(y){return y=y-0,y===y},v=function(y,g){var S=g&&"process"in g?g.process:g;return typeof S!="function"?y:function(b,C){return S(b,y,C)}},m={camelize:i,decamelize:s,pascalize:a,depascalize:s,camelizeKeys:function(y,g){return r(v(i,g),y)},decamelizeKeys:function(y,g){return r(v(s,g),y,g)},pascalizeKeys:function(y,g){return r(v(a,g),y)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};t.exports?t.exports=m:e.humps=m})(Un)})(rs);var ns=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==i||s.enumerable!==!0)return!1}return!0},rn=typeof Symbol<"u"&&Symbol,is=ns,as=function(){return typeof rn!="function"||typeof Symbol!="function"||typeof rn("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:is()},ss="Function.prototype.bind called on incompatible ",Ct=Array.prototype.slice,os=Object.prototype.toString,us="[object Function]",cs=function(e){var r=this;if(typeof r!="function"||os.call(r)!==us)throw new TypeError(ss+r);for(var n=Ct.call(arguments,1),i,a=function(){if(this instanceof i){var c=r.apply(this,n.concat(Ct.call(arguments)));return Object(c)===c?c:this}else return r.apply(e,n.concat(Ct.call(arguments)))},s=Math.max(0,r.length-n.length),o=[],l=0;l<s;l++)o.push("$"+l);if(i=Function("binder","return function ("+o.join(",")+"){ return binder.apply(this,arguments); }")(a),r.prototype){var f=function(){};f.prototype=r.prototype,i.prototype=new f,f.prototype=null}return i},ls=cs,pr=Function.prototype.bind||ls,fs=pr,hs=fs.call(Function.call,Object.prototype.hasOwnProperty),O,we=SyntaxError,ei=Function,Se=TypeError,Ft=function(t){try{return ei('"use strict"; return ('+t+").constructor;")()}catch{}},de=Object.getOwnPropertyDescriptor;if(de)try{de({},"")}catch{de=null}var xt=function(){throw new Se},ds=de?function(){try{return arguments.callee,xt}catch{try{return de(arguments,"callee").get}catch{return xt}}}():xt,ge=as(),X=Object.getPrototypeOf||function(t){return t.__proto__},be={},ps=typeof Uint8Array>"u"?O:X(Uint8Array),pe={"%AggregateError%":typeof AggregateError>"u"?O:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?O:ArrayBuffer,"%ArrayIteratorPrototype%":ge?X([][Symbol.iterator]()):O,"%AsyncFromSyncIteratorPrototype%":O,"%AsyncFunction%":be,"%AsyncGenerator%":be,"%AsyncGeneratorFunction%":be,"%AsyncIteratorPrototype%":be,"%Atomics%":typeof Atomics>"u"?O:Atomics,"%BigInt%":typeof BigInt>"u"?O:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?O:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?O:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?O:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?O:Float32Array,"%Float64Array%":typeof Float64Array>"u"?O:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?O:FinalizationRegistry,"%Function%":ei,"%GeneratorFunction%":be,"%Int8Array%":typeof Int8Array>"u"?O:Int8Array,"%Int16Array%":typeof Int16Array>"u"?O:Int16Array,"%Int32Array%":typeof Int32Array>"u"?O:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ge?X(X([][Symbol.iterator]())):O,"%JSON%":typeof JSON=="object"?JSON:O,"%Map%":typeof Map>"u"?O:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ge?O:X(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?O:Promise,"%Proxy%":typeof Proxy>"u"?O:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?O:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?O:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ge?O:X(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?O:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ge?X(""[Symbol.iterator]()):O,"%Symbol%":ge?Symbol:O,"%SyntaxError%":we,"%ThrowTypeError%":ds,"%TypedArray%":ps,"%TypeError%":Se,"%Uint8Array%":typeof Uint8Array>"u"?O:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?O:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?O:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?O:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?O:WeakMap,"%WeakRef%":typeof WeakRef>"u"?O:WeakRef,"%WeakSet%":typeof WeakSet>"u"?O:WeakSet};try{null.error}catch(t){var ys=X(X(t));pe["%Error.prototype%"]=ys}var vs=function t(e){var r;if(e==="%AsyncFunction%")r=Ft("async function () {}");else if(e==="%GeneratorFunction%")r=Ft("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Ft("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&(r=X(i.prototype))}return pe[e]=r,r},nn={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},De=pr,Ze=hs,ms=De.call(Function.call,Array.prototype.concat),gs=De.call(Function.apply,Array.prototype.splice),an=De.call(Function.call,String.prototype.replace),et=De.call(Function.call,String.prototype.slice),bs=De.call(Function.call,RegExp.prototype.exec),Ss=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ws=/\\(\\)?/g,Os=function(e){var r=et(e,0,1),n=et(e,-1);if(r==="%"&&n!=="%")throw new we("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new we("invalid intrinsic syntax, expected opening `%`");var i=[];return an(e,Ss,function(a,s,o,l){i[i.length]=o?an(l,ws,"$1"):s||a}),i},Ps=function(e,r){var n=e,i;if(Ze(nn,n)&&(i=nn[n],n="%"+i[0]+"%"),Ze(pe,n)){var a=pe[n];if(a===be&&(a=vs(n)),typeof a>"u"&&!r)throw new Se("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new we("intrinsic "+e+" does not exist!")},yr=function(e,r){if(typeof e!="string"||e.length===0)throw new Se("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Se('"allowMissing" argument must be a boolean');if(bs(/^%?[^%]*%?$/,e)===null)throw new we("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Os(e),i=n.length>0?n[0]:"",a=Ps("%"+i+"%",r),s=a.name,o=a.value,l=!1,f=a.alias;f&&(i=f[0],gs(n,ms([0,1],f)));for(var c=1,u=!0;c<n.length;c+=1){var h=n[c],d=et(h,0,1),p=et(h,-1);if((d==='"'||d==="'"||d==="`"||p==='"'||p==="'"||p==="`")&&d!==p)throw new we("property names with quotes must have matching quotes");if((h==="constructor"||!u)&&(l=!0),i+="."+h,s="%"+i+"%",Ze(pe,s))o=pe[s];else if(o!=null){if(!(h in o)){if(!r)throw new Se("base intrinsic for "+e+" exists, but the property is not available.");return}if(de&&c+1>=n.length){var v=de(o,h);u=!!v,u&&"get"in v&&!("originalValue"in v.get)?o=v.get:o=o[h]}else u=Ze(o,h),o=o[h];u&&!l&&(pe[s]=o)}}return o},Xt={},Es={get exports(){return Xt},set exports(t){Xt=t}};(function(t){var e=pr,r=yr,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),a=r("%Reflect.apply%",!0)||e.call(i,n),s=r("%Object.getOwnPropertyDescriptor%",!0),o=r("%Object.defineProperty%",!0),l=r("%Math.max%");if(o)try{o({},"a",{value:1})}catch{o=null}t.exports=function(u){var h=a(e,i,arguments);if(s&&o){var d=s(h,"length");d.configurable&&o(h,"length",{value:1+l(0,u.length-(arguments.length-1))})}return h};var f=function(){return a(e,n,arguments)};o?o(t.exports,"apply",{value:f}):t.exports.apply=f})(Es);var ti=yr,ri=Xt,As=ri(ti("String.prototype.indexOf")),Rs=function(e,r){var n=ti(e,!!r);return typeof n=="function"&&As(e,".prototype.")>-1?ri(n):n};const Cs={},Fs=Object.freeze(Object.defineProperty({__proto__:null,default:Cs},Symbol.toStringTag,{value:"Module"})),xs=ta(Fs);var vr=typeof Map=="function"&&Map.prototype,It=Object.getOwnPropertyDescriptor&&vr?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,tt=vr&&It&&typeof It.get=="function"?It.get:null,sn=vr&&Map.prototype.forEach,mr=typeof Set=="function"&&Set.prototype,qt=Object.getOwnPropertyDescriptor&&mr?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,rt=mr&&qt&&typeof qt.get=="function"?qt.get:null,on=mr&&Set.prototype.forEach,Is=typeof WeakMap=="function"&&WeakMap.prototype,Ie=Is?WeakMap.prototype.has:null,qs=typeof WeakSet=="function"&&WeakSet.prototype,qe=qs?WeakSet.prototype.has:null,_s=typeof WeakRef=="function"&&WeakRef.prototype,un=_s?WeakRef.prototype.deref:null,$s=Boolean.prototype.valueOf,Ms=Object.prototype.toString,Ds=Function.prototype.toString,Ts=String.prototype.match,gr=String.prototype.slice,ie=String.prototype.replace,Us=String.prototype.toUpperCase,cn=String.prototype.toLowerCase,ni=RegExp.prototype.test,ln=Array.prototype.concat,Y=Array.prototype.join,Ns=Array.prototype.slice,fn=Math.floor,Yt=typeof BigInt=="function"?BigInt.prototype.valueOf:null,_t=Object.getOwnPropertySymbols,Zt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Oe=typeof Symbol=="function"&&typeof Symbol.iterator=="object",j=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Oe||"symbol")?Symbol.toStringTag:null,ii=Object.prototype.propertyIsEnumerable,hn=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function dn(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||ni.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-fn(-t):fn(t);if(n!==t){var i=String(n),a=gr.call(e,i.length+1);return ie.call(i,r,"$&_")+"."+ie.call(ie.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ie.call(e,r,"$&_")}var er=xs,pn=er.custom,yn=si(pn)?pn:null,Ls=function t(e,r,n,i){var a=r||{};if(ne(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ne(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=ne(a,"customInspect")?a.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ne(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ne(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var o=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return ui(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return o?dn(e,l):l}if(typeof e=="bigint"){var f=String(e)+"n";return o?dn(e,f):f}var c=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=c&&c>0&&typeof e=="object")return tr(e)?"[Array]":"[Object]";var u=no(a,n);if(typeof i>"u")i=[];else if(oi(i,e)>=0)return"[Circular]";function h($,q,k){if(q&&(i=Ns.call(i),i.push(q)),k){var B={depth:a.depth};return ne(a,"quoteStyle")&&(B.quoteStyle=a.quoteStyle),t($,B,n+1,i)}return t($,a,n+1,i)}if(typeof e=="function"&&!vn(e)){var d=Hs(e),p=Ue(e,h);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(p.length>0?" { "+Y.call(p,", ")+" }":"")}if(si(e)){var v=Oe?ie.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Zt.call(e);return typeof e=="object"&&!Oe?Ce(v):v}if(eo(e)){for(var m="<"+cn.call(String(e.nodeName)),y=e.attributes||[],g=0;g<y.length;g++)m+=" "+y[g].name+"="+ai(Qs(y[g].value),"double",a);return m+=">",e.childNodes&&e.childNodes.length&&(m+="..."),m+="</"+cn.call(String(e.nodeName))+">",m}if(tr(e)){if(e.length===0)return"[]";var S=Ue(e,h);return u&&!ro(S)?"["+rr(S,u)+"]":"[ "+Y.call(S,", ")+" ]"}if(Bs(e)){var b=Ue(e,h);return!("cause"in Error.prototype)&&"cause"in e&&!ii.call(e,"cause")?"{ ["+String(e)+"] "+Y.call(ln.call("[cause]: "+h(e.cause),b),", ")+" }":b.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Y.call(b,", ")+" }"}if(typeof e=="object"&&s){if(yn&&typeof e[yn]=="function"&&er)return er(e,{depth:c-n});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Vs(e)){var C=[];return sn&&sn.call(e,function($,q){C.push(h(q,e,!0)+" => "+h($,e))}),mn("Map",tt.call(e),C,u)}if(Ys(e)){var P=[];return on&&on.call(e,function($){P.push(h($,e))}),mn("Set",rt.call(e),P,u)}if(Js(e))return $t("WeakMap");if(Zs(e))return $t("WeakSet");if(Xs(e))return $t("WeakRef");if(zs(e))return Ce(h(Number(e)));if(Gs(e))return Ce(h(Yt.call(e)));if(Ks(e))return Ce($s.call(e));if(js(e))return Ce(h(String(e)));if(!ks(e)&&!vn(e)){var _=Ue(e,h),W=hn?hn(e)===Object.prototype:e instanceof Object||e.constructor===Object,Q=e instanceof Object?"":"null prototype",R=!W&&j&&Object(e)===e&&j in e?gr.call(se(e),8,-1):Q?"Object":"",M=W||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",x=M+(R||Q?"["+Y.call(ln.call([],R||[],Q||[]),": ")+"] ":"");return _.length===0?x+"{}":u?x+"{"+rr(_,u)+"}":x+"{ "+Y.call(_,", ")+" }"}return String(e)};function ai(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function Qs(t){return ie.call(String(t),/"/g,""")}function tr(t){return se(t)==="[object Array]"&&(!j||!(typeof t=="object"&&j in t))}function ks(t){return se(t)==="[object Date]"&&(!j||!(typeof t=="object"&&j in t))}function vn(t){return se(t)==="[object RegExp]"&&(!j||!(typeof t=="object"&&j in t))}function Bs(t){return se(t)==="[object Error]"&&(!j||!(typeof t=="object"&&j in t))}function js(t){return se(t)==="[object String]"&&(!j||!(typeof t=="object"&&j in t))}function zs(t){return se(t)==="[object Number]"&&(!j||!(typeof t=="object"&&j in t))}function Ks(t){return se(t)==="[object Boolean]"&&(!j||!(typeof t=="object"&&j in t))}function si(t){if(Oe)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Zt)return!1;try{return Zt.call(t),!0}catch{}return!1}function Gs(t){if(!t||typeof t!="object"||!Yt)return!1;try{return Yt.call(t),!0}catch{}return!1}var Ws=Object.prototype.hasOwnProperty||function(t){return t in this};function ne(t,e){return Ws.call(t,e)}function se(t){return Ms.call(t)}function Hs(t){if(t.name)return t.name;var e=Ts.call(Ds.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function oi(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function Vs(t){if(!tt||!t||typeof t!="object")return!1;try{tt.call(t);try{rt.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function Js(t){if(!Ie||!t||typeof t!="object")return!1;try{Ie.call(t,Ie);try{qe.call(t,qe)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function Xs(t){if(!un||!t||typeof t!="object")return!1;try{return un.call(t),!0}catch{}return!1}function Ys(t){if(!rt||!t||typeof t!="object")return!1;try{rt.call(t);try{tt.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function Zs(t){if(!qe||!t||typeof t!="object")return!1;try{qe.call(t,qe);try{Ie.call(t,Ie)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function eo(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function ui(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return ui(gr.call(t,0,e.maxStringLength),e)+n}var i=ie.call(ie.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,to);return ai(i,"single",e)}function to(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Us.call(e.toString(16))}function Ce(t){return"Object("+t+")"}function $t(t){return t+" { ? }"}function mn(t,e,r,n){var i=n?rr(r,n):Y.call(r,", ");return t+" ("+e+") {"+i+"}"}function ro(t){for(var e=0;e<t.length;e++)if(oi(t[e],`
|
|
14
14
|
`)>=0)return!1;return!0}function no(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=Y.call(Array(t.indent+1)," ");else return null;return{base:r,prev:Y.call(Array(e+1),r)}}function rr(t,e){if(t.length===0)return"";var r=`
|
|
15
15
|
`+e.prev+e.base;return r+Y.call(t,","+r)+`
|
|
16
|
-
`+e.prev}function Ue(t,e){var r=tr(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=ne(t,i)?e(t[i],t):""}var a=typeof _t=="function"?_t(t):[],s;if(Oe){s={};for(var o=0;o<a.length;o++)s["$"+a[o]]=a[o]}for(var l in t)ne(t,l)&&(r&&String(Number(l))===l&&l<t.length||Oe&&s["$"+l]instanceof Symbol||(ni.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if(typeof _t=="function")for(var f=0;f<a.length;f++)ii.call(t,a[f])&&n.push("["+e(a[f])+"]: "+e(t[a[f]],t));return n}var br=yr,Re=Rs,io=Ls,ao=br("%TypeError%"),Ne=br("%WeakMap%",!0),Le=br("%Map%",!0),so=Re("WeakMap.prototype.get",!0),oo=Re("WeakMap.prototype.set",!0),uo=Re("WeakMap.prototype.has",!0),co=Re("Map.prototype.get",!0),lo=Re("Map.prototype.set",!0),fo=Re("Map.prototype.has",!0),Sr=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},ho=function(t,e){var r=Sr(t,e);return r&&r.value},po=function(t,e,r){var n=Sr(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},yo=function(t,e){return!!Sr(t,e)},vo=function(){var e,r,n,i={assert:function(a){if(!i.has(a))throw new ao("Side channel does not contain "+io(a))},get:function(a){if(Ne&&a&&(typeof a=="object"||typeof a=="function")){if(e)return so(e,a)}else if(Le){if(r)return co(r,a)}else if(n)return ho(n,a)},has:function(a){if(Ne&&a&&(typeof a=="object"||typeof a=="function")){if(e)return uo(e,a)}else if(Le){if(r)return fo(r,a)}else if(n)return yo(n,a);return!1},set:function(a,s){Ne&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new Ne),oo(e,a,s)):Le?(r||(r=new Le),lo(r,a,s)):(n||(n={key:{},next:null}),po(n,a,s))}};return i},mo=String.prototype.replace,go=/%20/g,Mt={RFC1738:"RFC1738",RFC3986:"RFC3986"},wr={default:Mt.RFC3986,formatters:{RFC1738:function(t){return mo.call(t,go,"+")},RFC3986:function(t){return String(t)}},RFC1738:Mt.RFC1738,RFC3986:Mt.RFC3986},bo=wr,Dt=Object.prototype.hasOwnProperty,fe=Array.isArray,J=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),So=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(fe(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);r.obj[r.prop]=i}}},ci=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},wo=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(fe(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Dt.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var i=e;return fe(e)&&!fe(r)&&(i=ci(e,n)),fe(e)&&fe(r)?(r.forEach(function(a,s){if(Dt.call(e,s)){var o=e[s];o&&typeof o=="object"&&a&&typeof a=="object"?e[s]=t(o,a,n):e.push(a)}else e[s]=a}),e):Object.keys(r).reduce(function(a,s){var o=r[s];return Dt.call(a,s)?a[s]=t(a[s],o,n):a[s]=o,a},i)},Oo=function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},Po=function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Eo=function(e,r,n,i,a){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),n==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(c){return"%26%23"+parseInt(c.slice(2),16)+"%3B"});for(var o="",l=0;l<s.length;++l){var f=s.charCodeAt(l);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||a===bo.RFC1738&&(f===40||f===41)){o+=s.charAt(l);continue}if(f<128){o=o+J[f];continue}if(f<2048){o=o+(J[192|f>>6]+J[128|f&63]);continue}if(f<55296||f>=57344){o=o+(J[224|f>>12]+J[128|f>>6&63]+J[128|f&63]);continue}l+=1,f=65536+((f&1023)<<10|s.charCodeAt(l)&1023),o+=J[240|f>>18]+J[128|f>>12&63]+J[128|f>>6&63]+J[128|f&63]}return o},Ao=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var a=r[i],s=a.obj[a.prop],o=Object.keys(s),l=0;l<o.length;++l){var f=o[l],c=s[f];typeof c=="object"&&c!==null&&n.indexOf(c)===-1&&(r.push({obj:s,prop:f}),n.push(c))}return So(r),e},Ro=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Co=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Fo=function(e,r){return[].concat(e,r)},xo=function(e,r){if(fe(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(r(e[i]));return n}return r(e)},li={arrayToObject:ci,assign:Oo,combine:Fo,compact:Ao,decode:Po,encode:Eo,isBuffer:Co,isRegExp:Ro,maybeMap:xo,merge:wo},fi=vo,nr=li,_e=wr,Io=Object.prototype.hasOwnProperty,gn={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},ee=Array.isArray,qo=String.prototype.split,_o=Array.prototype.push,hi=function(t,e){_o.apply(t,ee(e)?e:[e])},$o=Date.prototype.toISOString,bn=_e.default,T={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:nr.encode,encodeValuesOnly:!1,format:bn,formatter:_e.formatters[bn],indices:!1,serializeDate:function(e){return $o.call(e)},skipNulls:!1,strictNullHandling:!1},Mo=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Tt={},Do=function t(e,r,n,i,a,s,o,l,f,c,u,h,d,p,v,m){for(var y=e,g=m,S=0,b=!1;(g=g.get(Tt))!==void 0&&!b;){var C=g.get(e);if(S+=1,typeof C<"u"){if(C===S)throw new RangeError("Cyclic object value");b=!0}typeof g.get(Tt)>"u"&&(S=0)}if(typeof l=="function"?y=l(r,y):y instanceof Date?y=u(y):n==="comma"&&ee(y)&&(y=nr.maybeMap(y,function(V){return V instanceof Date?u(V):V})),y===null){if(a)return o&&!p?o(r,T.encoder,v,"key",h):r;y=""}if(Mo(y)||nr.isBuffer(y)){if(o){var P=p?r:o(r,T.encoder,v,"key",h);if(n==="comma"&&p){for(var _=qo.call(String(y),","),W="",Q=0;Q<_.length;++Q)W+=(Q===0?"":",")+d(o(_[Q],T.encoder,v,"value",h));return[d(P)+(i&&ee(y)&&_.length===1?"[]":"")+"="+W]}return[d(P)+"="+d(o(y,T.encoder,v,"value",h))]}return[d(r)+"="+d(String(y))]}var R=[];if(typeof y>"u")return R;var M;if(n==="comma"&&ee(y))M=[{value:y.length>0?y.join(",")||null:void 0}];else if(ee(l))M=l;else{var x=Object.keys(y);M=f?x.sort(f):x}for(var $=i&&ee(y)&&y.length===1?r+"[]":r,q=0;q<M.length;++q){var k=M[q],B=typeof k=="object"&&typeof k.value<"u"?k.value:y[k];if(!(s&&B===null)){var oe=ee(y)?typeof n=="function"?n($,k):$:$+(c?"."+k:"["+k+"]");m.set(e,S);var H=fi();H.set(Tt,m),hi(R,t(B,oe,n,i,a,s,o,l,f,c,u,h,d,p,v,H))}}return R},To=function(e){if(!e)return T;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||T.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=_e.default;if(typeof e.format<"u"){if(!Io.call(_e.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=_e.formatters[n],a=T.filter;return(typeof e.filter=="function"||ee(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:T.addQueryPrefix,allowDots:typeof e.allowDots>"u"?T.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:T.charsetSentinel,delimiter:typeof e.delimiter>"u"?T.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:T.encode,encoder:typeof e.encoder=="function"?e.encoder:T.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:T.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:T.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:T.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:T.strictNullHandling}},Uo=function(t,e){var r=t,n=To(e),i,a;typeof n.filter=="function"?(a=n.filter,r=a("",r)):ee(n.filter)&&(a=n.filter,i=a);var s=[];if(typeof r!="object"||r===null)return"";var o;e&&e.arrayFormat in gn?o=e.arrayFormat:e&&"indices"in e?o=e.indices?"indices":"repeat":o="indices";var l=gn[o];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var f=l==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var c=fi(),u=0;u<i.length;++u){var h=i[u];n.skipNulls&&r[h]===null||hi(s,Do(r[h],h,l,f,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,c))}var d=s.join(n.delimiter),p=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),d.length>0?p+d:""},Pe=li,ir=Object.prototype.hasOwnProperty,No=Array.isArray,D={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Pe.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Lo=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},di=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Qo="utf8=%26%2310003%3B",ko="utf8=%E2%9C%93",Bo=function(e,r){var n={},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=r.parameterLimit===1/0?void 0:r.parameterLimit,s=i.split(r.delimiter,a),o=-1,l,f=r.charset;if(r.charsetSentinel)for(l=0;l<s.length;++l)s[l].indexOf("utf8=")===0&&(s[l]===ko?f="utf-8":s[l]===Qo&&(f="iso-8859-1"),o=l,l=s.length);for(l=0;l<s.length;++l)if(l!==o){var c=s[l],u=c.indexOf("]="),h=u===-1?c.indexOf("="):u+1,d,p;h===-1?(d=r.decoder(c,D.decoder,f,"key"),p=r.strictNullHandling?null:""):(d=r.decoder(c.slice(0,h),D.decoder,f,"key"),p=Pe.maybeMap(di(c.slice(h+1),r),function(v){return r.decoder(v,D.decoder,f,"value")})),p&&r.interpretNumericEntities&&f==="iso-8859-1"&&(p=Lo(p)),c.indexOf("[]=")>-1&&(p=No(p)?[p]:p),ir.call(n,d)?n[d]=Pe.combine(n[d],p):n[d]=p}return n},jo=function(t,e,r,n){for(var i=n?e:di(e,r),a=t.length-1;a>=0;--a){var s,o=t[a];if(o==="[]"&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var l=o.charAt(0)==="["&&o.charAt(o.length-1)==="]"?o.slice(1,-1):o,f=parseInt(l,10);!r.parseArrays&&l===""?s={0:i}:!isNaN(f)&&o!==l&&String(f)===l&&f>=0&&r.parseArrays&&f<=r.arrayLimit?(s=[],s[f]=i):l!=="__proto__"&&(s[l]=i)}i=s}return i},zo=function(e,r,n,i){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,l=n.depth>0&&s.exec(a),f=l?a.slice(0,l.index):a,c=[];if(f){if(!n.plainObjects&&ir.call(Object.prototype,f)&&!n.allowPrototypes)return;c.push(f)}for(var u=0;n.depth>0&&(l=o.exec(a))!==null&&u<n.depth;){if(u+=1,!n.plainObjects&&ir.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(l[1])}return l&&c.push("["+a.slice(l.index)+"]"),jo(c,r,n,i)}},Ko=function(e){if(!e)return D;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset>"u"?D.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?D.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:D.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:D.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:D.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:D.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:D.comma,decoder:typeof e.decoder=="function"?e.decoder:D.decoder,delimiter:typeof e.delimiter=="string"||Pe.isRegExp(e.delimiter)?e.delimiter:D.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:D.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:D.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:D.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:D.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:D.strictNullHandling}},Go=function(t,e){var r=Ko(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?Bo(t,r):t,i=r.plainObjects?Object.create(null):{},a=Object.keys(n),s=0;s<a.length;++s){var o=a[s],l=zo(o,n[o],r,typeof t=="string");i=Pe.merge(i,l,r)}return r.allowSparse===!0?i:Pe.compact(i)},Wo=Uo,Ho=Go,Vo=wr,Jo={formats:Vo,parse:Ho,stringify:Wo};class Xo{constructor(e){this.client=e,this.list=()=>this.client.get("/v1/packages"),this.client=e}}class Yo{constructor(e){this.client=e,this.get=r=>this.client.get(`/v1/insurance/${r}/balance`),this.client=e}}class Zo{constructor(e){this.client=e,this.get=r=>this.client.get(`/v1/labels/${r}`),this.list=(r={})=>this.client.get("/v1/labels",{params:r}),this.createByRateId=(r,n)=>this.client.post(`/v1/labels/rates/${r}`,n),this.void=r=>this.client.put(`/v1/labels/${r}/void`),this.client=e}}class eu{constructor(e){this.client=e,this.list=()=>this.client.get("/v-beta/order_sources"),this.get=r=>this.client.get(`/v-beta/order_sources/${r}`),this.refresh=r=>this.client.put(`/v-beta/order_sources/${r}/refresh`),this.client=e}}class tu{constructor(e){this.client=e,this.calculateByShipmentId=(r,n)=>this.client.post("/v1/rates",{rateOptions:n,shipmentId:r}),this.client=e}}class ru{constructor(e){this.client=e,this.list=(r={})=>this.client.post("/v-beta/shipments/list",r),this.get=r=>this.client.get(`/v-beta/shipments/${r}`),this.create=(r,n)=>this.client.post(`/v-beta/shipments/sales_order/${r}`,n),this.update=(r,n)=>this.client.put(`/v-beta/shipments/${r}`,n),this.client=e}}class nu{constructor(e){this.client=e,this.list=(r={})=>this.client.get("/v-beta/sales_orders",{params:r}),this.get=r=>this.client.get(`/v-beta/sales_orders/${r}`),this.notifyShipped=(r,n)=>this.client.post(`/v-beta/sales_orders/${r}/notify`,n),this.client=e}}class iu{constructor(e){this.client=e,this.list=()=>this.client.get("/v1/warehouses"),this.create=r=>this.client.post("/v1/warehouses",r),this.update=(r,n)=>this.client.put(`/v1/warehouses/${r}`,n),this.delete=r=>this.client.delete(`/v1/warehouses/${r}`),this.client=e}}const Sn=Mn({name:"shipengine-api",serializers:{...cr,req:t=>({headers:t.headers,method:t.method,url:t.url}),res:t=>({data:t.data,headers:t.config.headers,method:t.config.method,statusCode:t.status,url:t.config.url})},streams:[{stream:new Dn}]}),au=t=>!!t.errors&&Yn(t.errors);class wn{constructor(e,{baseURL:r,headers:n,getToken:i}){const a=Jt.create({baseURL:r,headers:{...n,Authorization:`Bearer ${e}`,"Content-Type":"application/json"},paramsSerializer:s=>Jo.stringify(xe.decamelizeKeys(s),{arrayFormat:"brackets"}),transformRequest:[s=>xe.decamelizeKeys(s),s=>JSON.stringify(s)],transformResponse:[s=>{if(s)return JSON.parse(s)},s=>xe.camelizeKeys(s)]});a.interceptors.response.use(s=>(Sn.info({req:s.config,res:s},"%s %s: %s %s",s.config.method?.toUpperCase(),s.config.url,s.status,s.statusText),s),async s=>{if(Sn.error({err:s,req:s.config,res:s.response},"%s %s: %s %s - %s",s.config?.method?.toUpperCase(),s.config?.url,s.response?.status,s.response?.statusText,s.message),s.response?.status===401){const o=await i(),l=s.config;return l&&(l.headers||={},l.headers.Authorization=`Bearer ${o}`),Jt(l)}return s.response?.data?au(s.response.data)?Promise.reject(s.response.data.errors.map(o=>te.fromObject(o))):Yn(s.response.data)?Promise.reject(s.response.data.map(o=>te.fromObject(o))):Zn(s.response.data)?Promise.reject([te.fromObject(s.response.data)]):Promise.reject([new te(s.response.data)]):Promise.reject([new te(s.message)])}),this.client=a}set token(e){this.client.defaults.headers.common.Authorization=`Bearer ${e}`}get addresses(){return new Zi(this.client)}get accountSettings(){return new Yi(this.client)}get carriers(){return new ts(this.client)}get customPackages(){return new Xo(this.client)}get insurance(){return new Yo(this.client)}get labels(){return new Zo(this.client)}get orderSources(){return new eu(this.client)}get rates(){return new tu(this.client)}get salesOrderShipments(){return new ru(this.client)}get salesOrders(){return new nu(this.client)}get warehouses(){return new iu(this.client)}}const Or=I.createContext(void 0),su=({baseURL:t,children:e,headers:r,getToken:n})=>{const[i,a]=I.useState(()=>{const o=n();if(typeof o=="string")return new wn(o,{baseURL:t,getToken:n,headers:r??{}});o.then(l=>a(new wn(l,{baseURL:t,getToken:n,headers:r??{}})))}),s=new Di;return i?ut.jsx(Or.Provider,{value:{client:i},children:ut.jsx(ki,{client:s,children:e})}):ut.jsx("div",{style:{alignItems:"center",display:"flex",height:"100%",justifyContent:"center",width:"100%"},children:"Loading..."})},A=()=>{const t=I.useContext(Or);if(!t)throw new Error("useShipEngine must be called within a ShipEngineProvider");return t},ou=t=>{const{client:e}=A();return L({mutationFn:async r=>(await e.carriers.addFunds(t,r)).data,mutationKey:["useAddFunds"],onError:E})},uu=()=>{const{client:t}=A();return L({mutationFn:async({rateOptions:e,shipmentId:r})=>(await t.rates.calculateByShipmentId(r,e)).data,mutationKey:["useCalculateRates"],onError:E})},cu=t=>{const{client:e}=A(),r=or();return L({mutationFn:async n=>(await e.carriers.updateAutoFunding(t,n)).data,mutationKey:["useUpdateAutoFunding"],onError:E,onSuccess:n=>{r.invalidateQueries(["useGetAutoFunding",t],{exact:!0})}})},lu=()=>{const{client:t}=A();return L({mutationFn:async e=>(await t.carriers.connect(e)).data,mutationKey:["useConnectCarrier"],onError:E})},fu=()=>{const{client:t}=A();return L({mutationFn:async({rateId:e,...r})=>(await t.labels.createByRateId(e,r)).data,mutationKey:["useCreateLabel"],onError:E})},hu=()=>{const{client:t}=A();return L({mutationFn:async({salesOrderId:e,...r})=>(await t.salesOrderShipments.create(e,r)).data,mutationKey:["useCreateSalesOrderShipment"],onError:E})},du=()=>{const{client:t}=A();return L({mutationFn:async e=>(await t.warehouses.create(e)).data,mutationKey:["useCreateWarehouse"],onError:E})},pu=()=>{const{client:t}=A();return L({mutationFn:async({warehouseId:e})=>(await t.warehouses.delete(e)).data,mutationKey:["useDeleteWarehouse"],onError:E})},yu=t=>{const{client:e}=A();return z({enabled:t!==void 0,onError:E,queryFn:()=>t?e.carriers.getAutoFunding(t):Promise.reject(new Error("carrierId is required.")),queryKey:["useGetAutoFundingConfiguration",t],select:r=>r.data})},vu=t=>{const{client:e}=A();return z({enabled:!!t,onError:E,queryFn:()=>t?e.carriers.get(t):Promise.reject(new Error("carrierId is require")),queryKey:["useGetCarrierById",t],select:r=>r.data,staleTime:5*60*1e3})},mu=t=>{const{client:e}=A();return z({enabled:t!==void 0,onError:E,queryFn:()=>t?e.insurance.get(t):Promise.reject(new Error("insuranceProvider is required")),queryKey:["useGetInsuranceAccount",t],select:r=>r.data})},gu=t=>{const{client:e}=A();return z({enabled:t!==void 0,onError:E,queryFn:()=>t?e.labels.get(t):Promise.reject(new Error("labelId is require")),queryKey:["useGetLabel",t],select:r=>r.data})},bu=()=>{const{client:t}=A();return z({onError:E,queryFn:()=>t.accountSettings.getAccountSettings(),queryKey:["getAccountSettings"],select:e=>e.data})},Su=()=>({links:{transactionHistoryReport:"http://link.to.entire.dataset.as.csv"},page:1,pages:4,total:275,transactions:[{amount:50.65,balance:10,carrierId:"string",carrierProvider:"string carrier name",labelId:"string",transactionDate:"",transactionId:"string",transactionType:"fund"},{amount:50.65,balance:10,carrierId:"string",carrierProvider:"string carrier name",labelId:"string",transactionDate:"",transactionId:"string",transactionType:"purchase"}]}),wu=t=>{const{client:e}=A();return z({enabled:t!==void 0,onError:E,queryFn:()=>t?e.salesOrders.get(t):Promise.reject(new Error("salesOrderId is required")),queryKey:["useGetSalesOrder",t],select:r=>r.data})},Ou=t=>{const{client:e}=A();return z({enabled:t!==void 0,onError:E,queryFn:()=>t?e.salesOrderShipments.get(t):Promise.reject(new Error("shipmentId is required")),queryKey:["useGetSalesOrderShipment",t],select:r=>r.data})},Pu=()=>{const{client:t}=A();return z({onError:E,queryFn:()=>t.carriers.list(),queryKey:["useListCarriers"],select:e=>e.data.carriers})},Eu=t=>{const{client:e}=A();return z({enabled:t&&Object.values(t).some(r=>r!==void 0),onError:E,queryFn:()=>e.labels.list(t),queryKey:["useListLabels",t],select:r=>r.data.labels})},Au=()=>{const{client:t}=A();return z({onError:E,queryFn:()=>t.orderSources.list(),queryKey:["useListOrderSources"],select:e=>e.data.orderSources})},Ru=()=>{const{client:t}=A();return z({onError:E,queryFn:()=>t.customPackages.list(),queryKey:["useListCustomPackageTypes"],select:e=>e.data.packages})},Cu=(t={})=>{const{client:e}=A();return z({enabled:t&&Object.values(t).some(r=>r!==void 0),onError:E,queryFn:()=>e.salesOrders.list(t),queryKey:["useListSalesOrders",t],select:r=>r.data.salesOrders})},Fu=t=>{const{client:e}=A();return z({enabled:t&&Object.values(t).some(r=>r!==void 0),onError:E,queryFn:()=>e.salesOrderShipments.list(t),queryKey:["useListSalesOrderShipments",t],select:r=>r.data.shipments})},xu=()=>{const{client:t}=A();return z({onError:E,queryFn:()=>t.warehouses.list(),queryKey:["useListWarehouses"],select:e=>e.data.warehouses})},Iu=()=>{const{client:t}=A();return L({mutationFn:async({salesOrderId:e,...r})=>(await t.salesOrders.notifyShipped(e,r)).data,mutationKey:["useNotifySalesOrder"],onError:E})},qu=()=>{const{client:t}=A();return L({mutationFn:async({address:e,text:r})=>(await t.addresses.parse(r,e)).data,mutationKey:["useParseAddress"],onError:E})},pi=()=>{const{client:t}=A();return L({mutationFn:async e=>(await t.orderSources.refresh(e)).data,mutationKey:["useRefreshOrderSourceAsync"]})},_u=()=>{const{client:t}=A(),{mutateAsync:e}=pi();return L({mutationFn:async r=>(await e(r),await Tn(async()=>{const{data:i}=await t.orderSources.get(r);if(["preparing_update","updating"].includes(i.refreshInfo.status))throw new te("Order source is still refreshing");return i},20)),mutationKey:["useRefreshOrderSource"],onError:E})},$u=()=>L({mutationFn:async t=>(await Promise.resolve({data:{},errors:[],isLoading:!1,isValidating:!1})).data,mutationKey:["useUpdateBilling"],onError:E}),Mu=()=>{const{client:t}=A();return L({mutationFn:async({shipmentId:e,...r})=>(await t.salesOrderShipments.update(e,r)).data,mutationKey:["useUpdateSalesOrderShipment"],onError:E})},Du=()=>{const{client:t}=A();return L({mutationFn:async({warehouseId:e,...r})=>(await t.warehouses.update(e,r)).data,mutationKey:["useUpdateWarehouse"],onError:E})},Tu=()=>{const{client:t}=A();return L({mutationFn:async e=>(await t.addresses.validate(e)).data,mutationKey:["useValidateAddresses"],onError:E})},Uu=()=>{const{client:t}=A();return L({mutationFn:async e=>(await t.labels.void(e)).data,mutationKey:["useVoidLabel"],onError:E})},Nu=t=>{const{client:e}=A();return z({enabled:t!==void 0,onError:E,queryFn:()=>t?e.salesOrderShipments.get(t):Promise.reject(new Error("shipmentId is required")),queryKey:["useGetShipment",t],select:r=>r.data})};exports.ShipEngineContext=Or;exports.ShipEngineProvider=su;exports.delay=_n;exports.logger=Xi;exports.onError=E;exports.retryUntil=Tn;exports.useAddFunds=ou;exports.useCalculateRates=uu;exports.useConnectCarrier=lu;exports.useCreateLabel=fu;exports.useCreateSalesOrderShipment=hu;exports.useCreateWarehouse=du;exports.useDeleteWarehouse=pu;exports.useGetAccountSettings=bu;exports.useGetAutoFundingConfiguration=yu;exports.useGetCarrierById=vu;exports.useGetInsuranceAccount=mu;exports.useGetLabel=gu;exports.useGetSalesOrder=wu;exports.useGetSalesOrderShipment=Ou;exports.useGetShipment=Nu;exports.useGetWalletTransactionHistory=Su;exports.useListCarriers=Pu;exports.useListCustomPackageTypes=Ru;exports.useListLabels=Eu;exports.useListOrderSources=Au;exports.useListSalesOrderShipments=Fu;exports.useListSalesOrders=Cu;exports.useListWarehouses=xu;exports.useNotifySalesOrderShipped=Iu;exports.useParseAddress=qu;exports.useRefreshOrderSource=_u;exports.useRefreshOrderSourceAsync=pi;exports.useUpdateAutoFunding=cu;exports.useUpdateBilling=$u;exports.useUpdateSalesOrderShipment=Mu;exports.useUpdateWarehouse=Du;exports.useValidateAddresses=Tu;exports.useVoidLabel=Uu;
|
|
16
|
+
`+e.prev}function Ue(t,e){var r=tr(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=ne(t,i)?e(t[i],t):""}var a=typeof _t=="function"?_t(t):[],s;if(Oe){s={};for(var o=0;o<a.length;o++)s["$"+a[o]]=a[o]}for(var l in t)ne(t,l)&&(r&&String(Number(l))===l&&l<t.length||Oe&&s["$"+l]instanceof Symbol||(ni.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if(typeof _t=="function")for(var f=0;f<a.length;f++)ii.call(t,a[f])&&n.push("["+e(a[f])+"]: "+e(t[a[f]],t));return n}var br=yr,Re=Rs,io=Ls,ao=br("%TypeError%"),Ne=br("%WeakMap%",!0),Le=br("%Map%",!0),so=Re("WeakMap.prototype.get",!0),oo=Re("WeakMap.prototype.set",!0),uo=Re("WeakMap.prototype.has",!0),co=Re("Map.prototype.get",!0),lo=Re("Map.prototype.set",!0),fo=Re("Map.prototype.has",!0),Sr=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},ho=function(t,e){var r=Sr(t,e);return r&&r.value},po=function(t,e,r){var n=Sr(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},yo=function(t,e){return!!Sr(t,e)},vo=function(){var e,r,n,i={assert:function(a){if(!i.has(a))throw new ao("Side channel does not contain "+io(a))},get:function(a){if(Ne&&a&&(typeof a=="object"||typeof a=="function")){if(e)return so(e,a)}else if(Le){if(r)return co(r,a)}else if(n)return ho(n,a)},has:function(a){if(Ne&&a&&(typeof a=="object"||typeof a=="function")){if(e)return uo(e,a)}else if(Le){if(r)return fo(r,a)}else if(n)return yo(n,a);return!1},set:function(a,s){Ne&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new Ne),oo(e,a,s)):Le?(r||(r=new Le),lo(r,a,s)):(n||(n={key:{},next:null}),po(n,a,s))}};return i},mo=String.prototype.replace,go=/%20/g,Mt={RFC1738:"RFC1738",RFC3986:"RFC3986"},wr={default:Mt.RFC3986,formatters:{RFC1738:function(t){return mo.call(t,go,"+")},RFC3986:function(t){return String(t)}},RFC1738:Mt.RFC1738,RFC3986:Mt.RFC3986},bo=wr,Dt=Object.prototype.hasOwnProperty,fe=Array.isArray,J=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),So=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(fe(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);r.obj[r.prop]=i}}},ci=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},wo=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(fe(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Dt.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var i=e;return fe(e)&&!fe(r)&&(i=ci(e,n)),fe(e)&&fe(r)?(r.forEach(function(a,s){if(Dt.call(e,s)){var o=e[s];o&&typeof o=="object"&&a&&typeof a=="object"?e[s]=t(o,a,n):e.push(a)}else e[s]=a}),e):Object.keys(r).reduce(function(a,s){var o=r[s];return Dt.call(a,s)?a[s]=t(a[s],o,n):a[s]=o,a},i)},Oo=function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},Po=function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Eo=function(e,r,n,i,a){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),n==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(c){return"%26%23"+parseInt(c.slice(2),16)+"%3B"});for(var o="",l=0;l<s.length;++l){var f=s.charCodeAt(l);if(f===45||f===46||f===95||f===126||f>=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||a===bo.RFC1738&&(f===40||f===41)){o+=s.charAt(l);continue}if(f<128){o=o+J[f];continue}if(f<2048){o=o+(J[192|f>>6]+J[128|f&63]);continue}if(f<55296||f>=57344){o=o+(J[224|f>>12]+J[128|f>>6&63]+J[128|f&63]);continue}l+=1,f=65536+((f&1023)<<10|s.charCodeAt(l)&1023),o+=J[240|f>>18]+J[128|f>>12&63]+J[128|f>>6&63]+J[128|f&63]}return o},Ao=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var a=r[i],s=a.obj[a.prop],o=Object.keys(s),l=0;l<o.length;++l){var f=o[l],c=s[f];typeof c=="object"&&c!==null&&n.indexOf(c)===-1&&(r.push({obj:s,prop:f}),n.push(c))}return So(r),e},Ro=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Co=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Fo=function(e,r){return[].concat(e,r)},xo=function(e,r){if(fe(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(r(e[i]));return n}return r(e)},li={arrayToObject:ci,assign:Oo,combine:Fo,compact:Ao,decode:Po,encode:Eo,isBuffer:Co,isRegExp:Ro,maybeMap:xo,merge:wo},fi=vo,nr=li,_e=wr,Io=Object.prototype.hasOwnProperty,gn={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},ee=Array.isArray,qo=String.prototype.split,_o=Array.prototype.push,hi=function(t,e){_o.apply(t,ee(e)?e:[e])},$o=Date.prototype.toISOString,bn=_e.default,T={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:nr.encode,encodeValuesOnly:!1,format:bn,formatter:_e.formatters[bn],indices:!1,serializeDate:function(e){return $o.call(e)},skipNulls:!1,strictNullHandling:!1},Mo=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Tt={},Do=function t(e,r,n,i,a,s,o,l,f,c,u,h,d,p,v,m){for(var y=e,g=m,S=0,b=!1;(g=g.get(Tt))!==void 0&&!b;){var C=g.get(e);if(S+=1,typeof C<"u"){if(C===S)throw new RangeError("Cyclic object value");b=!0}typeof g.get(Tt)>"u"&&(S=0)}if(typeof l=="function"?y=l(r,y):y instanceof Date?y=u(y):n==="comma"&&ee(y)&&(y=nr.maybeMap(y,function(V){return V instanceof Date?u(V):V})),y===null){if(a)return o&&!p?o(r,T.encoder,v,"key",h):r;y=""}if(Mo(y)||nr.isBuffer(y)){if(o){var P=p?r:o(r,T.encoder,v,"key",h);if(n==="comma"&&p){for(var _=qo.call(String(y),","),W="",Q=0;Q<_.length;++Q)W+=(Q===0?"":",")+d(o(_[Q],T.encoder,v,"value",h));return[d(P)+(i&&ee(y)&&_.length===1?"[]":"")+"="+W]}return[d(P)+"="+d(o(y,T.encoder,v,"value",h))]}return[d(r)+"="+d(String(y))]}var R=[];if(typeof y>"u")return R;var M;if(n==="comma"&&ee(y))M=[{value:y.length>0?y.join(",")||null:void 0}];else if(ee(l))M=l;else{var x=Object.keys(y);M=f?x.sort(f):x}for(var $=i&&ee(y)&&y.length===1?r+"[]":r,q=0;q<M.length;++q){var k=M[q],B=typeof k=="object"&&typeof k.value<"u"?k.value:y[k];if(!(s&&B===null)){var oe=ee(y)?typeof n=="function"?n($,k):$:$+(c?"."+k:"["+k+"]");m.set(e,S);var H=fi();H.set(Tt,m),hi(R,t(B,oe,n,i,a,s,o,l,f,c,u,h,d,p,v,H))}}return R},To=function(e){if(!e)return T;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||T.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=_e.default;if(typeof e.format<"u"){if(!Io.call(_e.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=_e.formatters[n],a=T.filter;return(typeof e.filter=="function"||ee(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:T.addQueryPrefix,allowDots:typeof e.allowDots>"u"?T.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:T.charsetSentinel,delimiter:typeof e.delimiter>"u"?T.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:T.encode,encoder:typeof e.encoder=="function"?e.encoder:T.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:T.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:T.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:T.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:T.strictNullHandling}},Uo=function(t,e){var r=t,n=To(e),i,a;typeof n.filter=="function"?(a=n.filter,r=a("",r)):ee(n.filter)&&(a=n.filter,i=a);var s=[];if(typeof r!="object"||r===null)return"";var o;e&&e.arrayFormat in gn?o=e.arrayFormat:e&&"indices"in e?o=e.indices?"indices":"repeat":o="indices";var l=gn[o];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var f=l==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var c=fi(),u=0;u<i.length;++u){var h=i[u];n.skipNulls&&r[h]===null||hi(s,Do(r[h],h,l,f,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,c))}var d=s.join(n.delimiter),p=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?p+="utf8=%26%2310003%3B&":p+="utf8=%E2%9C%93&"),d.length>0?p+d:""},Pe=li,ir=Object.prototype.hasOwnProperty,No=Array.isArray,D={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Pe.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Lo=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},di=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Qo="utf8=%26%2310003%3B",ko="utf8=%E2%9C%93",Bo=function(e,r){var n={},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=r.parameterLimit===1/0?void 0:r.parameterLimit,s=i.split(r.delimiter,a),o=-1,l,f=r.charset;if(r.charsetSentinel)for(l=0;l<s.length;++l)s[l].indexOf("utf8=")===0&&(s[l]===ko?f="utf-8":s[l]===Qo&&(f="iso-8859-1"),o=l,l=s.length);for(l=0;l<s.length;++l)if(l!==o){var c=s[l],u=c.indexOf("]="),h=u===-1?c.indexOf("="):u+1,d,p;h===-1?(d=r.decoder(c,D.decoder,f,"key"),p=r.strictNullHandling?null:""):(d=r.decoder(c.slice(0,h),D.decoder,f,"key"),p=Pe.maybeMap(di(c.slice(h+1),r),function(v){return r.decoder(v,D.decoder,f,"value")})),p&&r.interpretNumericEntities&&f==="iso-8859-1"&&(p=Lo(p)),c.indexOf("[]=")>-1&&(p=No(p)?[p]:p),ir.call(n,d)?n[d]=Pe.combine(n[d],p):n[d]=p}return n},jo=function(t,e,r,n){for(var i=n?e:di(e,r),a=t.length-1;a>=0;--a){var s,o=t[a];if(o==="[]"&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var l=o.charAt(0)==="["&&o.charAt(o.length-1)==="]"?o.slice(1,-1):o,f=parseInt(l,10);!r.parseArrays&&l===""?s={0:i}:!isNaN(f)&&o!==l&&String(f)===l&&f>=0&&r.parseArrays&&f<=r.arrayLimit?(s=[],s[f]=i):l!=="__proto__"&&(s[l]=i)}i=s}return i},zo=function(e,r,n,i){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,l=n.depth>0&&s.exec(a),f=l?a.slice(0,l.index):a,c=[];if(f){if(!n.plainObjects&&ir.call(Object.prototype,f)&&!n.allowPrototypes)return;c.push(f)}for(var u=0;n.depth>0&&(l=o.exec(a))!==null&&u<n.depth;){if(u+=1,!n.plainObjects&&ir.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(l[1])}return l&&c.push("["+a.slice(l.index)+"]"),jo(c,r,n,i)}},Ko=function(e){if(!e)return D;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset>"u"?D.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?D.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:D.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:D.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:D.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:D.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:D.comma,decoder:typeof e.decoder=="function"?e.decoder:D.decoder,delimiter:typeof e.delimiter=="string"||Pe.isRegExp(e.delimiter)?e.delimiter:D.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:D.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:D.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:D.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:D.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:D.strictNullHandling}},Go=function(t,e){var r=Ko(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?Bo(t,r):t,i=r.plainObjects?Object.create(null):{},a=Object.keys(n),s=0;s<a.length;++s){var o=a[s],l=zo(o,n[o],r,typeof t=="string");i=Pe.merge(i,l,r)}return r.allowSparse===!0?i:Pe.compact(i)},Wo=Uo,Ho=Go,Vo=wr,Jo={formats:Vo,parse:Ho,stringify:Wo};class Xo{constructor(e){this.client=e,this.list=()=>this.client.get("/v1/packages"),this.client=e}}class Yo{constructor(e){this.client=e,this.get=r=>this.client.get(`/v1/insurance/${r}/balance`),this.client=e}}class Zo{constructor(e){this.client=e,this.get=r=>this.client.get(`/v1/labels/${r}`),this.list=(r={})=>this.client.get("/v1/labels",{params:r}),this.createByRateId=(r,n)=>this.client.post(`/v1/labels/rates/${r}`,n),this.void=r=>this.client.put(`/v1/labels/${r}/void`),this.client=e}}class eu{constructor(e){this.client=e,this.list=()=>this.client.get("/v-beta/order_sources"),this.get=r=>this.client.get(`/v-beta/order_sources/${r}`),this.refresh=r=>this.client.put(`/v-beta/order_sources/${r}/refresh`),this.client=e}}class tu{constructor(e){this.client=e,this.calculateByShipmentId=(r,n)=>this.client.post("/v1/rates",{rateOptions:n,shipmentId:r}),this.client=e}}class ru{constructor(e){this.client=e,this.list=(r={})=>this.client.post("/v-beta/shipments/list",r),this.get=r=>this.client.get(`/v-beta/shipments/${r}`),this.create=(r,n)=>this.client.post(`/v-beta/shipments/sales_order/${r}`,n),this.update=(r,n)=>this.client.put(`/v-beta/shipments/${r}`,n),this.client=e}}class nu{constructor(e){this.client=e,this.list=(r={})=>this.client.get("/v-beta/sales_orders",{params:r}),this.get=r=>this.client.get(`/v-beta/sales_orders/${r}`),this.notifyShipped=(r,n)=>this.client.post(`/v-beta/sales_orders/${r}/notify`,n),this.client=e}}class iu{constructor(e){this.client=e,this.list=()=>this.client.get("/v1/warehouses"),this.create=r=>this.client.post("/v1/warehouses",r),this.update=(r,n)=>this.client.put(`/v1/warehouses/${r}`,n),this.delete=r=>this.client.delete(`/v1/warehouses/${r}`),this.client=e}}const Sn=Mn({name:"shipengine-api",serializers:{...cr,req:t=>({headers:t.headers,method:t.method,url:t.url}),res:t=>({data:t.data,headers:t.config.headers,method:t.config.method,statusCode:t.status,url:t.config.url})},streams:[{stream:new Dn}]}),au=t=>!!t.errors&&Yn(t.errors);class wn{constructor(e,{baseURL:r,headers:n,getToken:i}){const a=Jt.create({baseURL:r,headers:{...n,Authorization:`Bearer ${e}`,"Content-Type":"application/json"},paramsSerializer:s=>Jo.stringify(xe.decamelizeKeys(s),{arrayFormat:"brackets"}),transformRequest:[s=>xe.decamelizeKeys(s),s=>JSON.stringify(s)],transformResponse:[s=>{if(s)return JSON.parse(s)},s=>xe.camelizeKeys(s)]});a.interceptors.response.use(s=>(Sn.info({req:s.config,res:s},"%s %s: %s %s",s.config.method?.toUpperCase(),s.config.url,s.status,s.statusText),s),async s=>{if(Sn.error({err:s,req:s.config,res:s.response},"%s %s: %s %s - %s",s.config?.method?.toUpperCase(),s.config?.url,s.response?.status,s.response?.statusText,s.message),s.response?.status===401){const o=await i(),l=s.config;return l&&(l.headers||={},l.headers.Authorization=`Bearer ${o}`),Jt(l)}return s.response?.data?au(s.response.data)?Promise.reject(s.response.data.errors.map(o=>te.fromObject(o))):Yn(s.response.data)?Promise.reject(s.response.data.map(o=>te.fromObject(o))):Zn(s.response.data)?Promise.reject([te.fromObject(s.response.data)]):Promise.reject([new te(s.response.data)]):Promise.reject([new te(s.message)])}),this.client=a}set token(e){this.client.defaults.headers.common.Authorization=`Bearer ${e}`}get addresses(){return new Zi(this.client)}get accountSettings(){return new Yi(this.client)}get carriers(){return new ts(this.client)}get customPackages(){return new Xo(this.client)}get insurance(){return new Yo(this.client)}get labels(){return new Zo(this.client)}get orderSources(){return new eu(this.client)}get rates(){return new tu(this.client)}get salesOrderShipments(){return new ru(this.client)}get salesOrders(){return new nu(this.client)}get warehouses(){return new iu(this.client)}}const Or=I.createContext(void 0),su=({baseURL:t,children:e,headers:r,getToken:n})=>{const[i,a]=I.useState(()=>{const o=n();if(typeof o=="string")return new wn(o,{baseURL:t,getToken:n,headers:r??{}});o.then(l=>a(new wn(l,{baseURL:t,getToken:n,headers:r??{}})))}),s=new Di;return i?ut.jsx(Or.Provider,{value:{client:i},children:ut.jsx(ki,{client:s,children:e})}):ut.jsx("div",{style:{alignItems:"center",display:"flex",height:"100%",justifyContent:"center",width:"100%"},children:"Loading..."})},A=()=>{const t=I.useContext(Or);if(!t)throw new Error("useShipEngine must be called within a ShipEngineProvider");return t},ou=t=>{const{client:e}=A();return L({mutationFn:async r=>(await e.carriers.addFunds(t,r)).data,mutationKey:["useAddFunds"],onError:E})},uu=()=>{const{client:t}=A();return L({mutationFn:async({rateOptions:e,shipmentId:r})=>(await t.rates.calculateByShipmentId(r,e)).data,mutationKey:["useCalculateRates"],onError:E})},cu=t=>{const{client:e}=A(),r=or();return L({mutationFn:async n=>(await e.carriers.updateAutoFunding(t,n)).data,mutationKey:["useUpdateAutoFunding"],onError:E,onSuccess:n=>{r.invalidateQueries(["useGetAutoFunding",t],{exact:!0})}})},lu=()=>{const{client:t}=A();return L({mutationFn:async e=>(await t.carriers.connect(e)).data,mutationKey:["useConnectCarrier"],onError:E})},fu=()=>{const{client:t}=A();return L({mutationFn:async({rateId:e,...r})=>(await t.labels.createByRateId(e,r)).data,mutationKey:["useCreateLabel"],onError:E})},hu=()=>{const{client:t}=A();return L({mutationFn:async({salesOrderId:e,...r})=>(await t.salesOrderShipments.create(e,r)).data,mutationKey:["useCreateSalesOrderShipment"],onError:E})},du=()=>{const{client:t}=A();return L({mutationFn:async e=>(await t.warehouses.create(e)).data,mutationKey:["useCreateWarehouse"],onError:E})},pu=()=>{const{client:t}=A();return L({mutationFn:async({warehouseId:e})=>(await t.warehouses.delete(e)).data,mutationKey:["useDeleteWarehouse"],onError:E})},yu=t=>{const{client:e}=A();return z({enabled:t!==void 0,onError:E,queryFn:()=>t?e.carriers.getAutoFunding(t):Promise.reject(new Error("carrierId is required.")),queryKey:["useGetAutoFundingConfiguration",t],select:r=>r.data})},vu=t=>{const{client:e}=A();return z({enabled:!!t,onError:E,queryFn:()=>t?e.carriers.get(t):Promise.reject(new Error("carrierId is require")),queryKey:["useGetCarrierById",t],select:r=>r.data,staleTime:5*60*1e3})},mu=t=>{const{client:e}=A();return z({enabled:t!==void 0,onError:E,queryFn:()=>t?e.insurance.get(t):Promise.reject(new Error("insuranceProvider is required")),queryKey:["useGetInsuranceAccount",t],select:r=>r.data})},gu=t=>{const{client:e}=A();return z({enabled:t!==void 0,onError:E,queryFn:()=>t?e.labels.get(t):Promise.reject(new Error("labelId is require")),queryKey:["useGetLabel",t],select:r=>r.data})},bu=()=>{const{client:t}=A();return z({onError:E,queryFn:()=>t.accountSettings.getAccountSettings(),queryKey:["getAccountSettings"],select:e=>e.data})},Su=()=>({links:{transactionHistoryReport:"http://link.to.entire.dataset.as.csv"},page:1,pages:4,total:275,transactions:[{amount:50.65,balance:10,carrierId:"string",carrierProvider:"string carrier name",labelId:"string",transactionDate:"",transactionId:"string",transactionType:"fund"},{amount:50.65,balance:10,carrierId:"string",carrierProvider:"string carrier name",labelId:"string",transactionDate:"",transactionId:"string",transactionType:"purchase"}]}),wu=t=>{const{client:e}=A();return z({enabled:t!==void 0,onError:E,queryFn:()=>t?e.salesOrders.get(t):Promise.reject(new Error("salesOrderId is required")),queryKey:["useGetSalesOrder",t],select:r=>r.data})},Ou=t=>{const{client:e}=A();return z({enabled:t!==void 0,onError:E,queryFn:()=>t?e.salesOrderShipments.get(t):Promise.reject(new Error("shipmentId is required")),queryKey:["useGetSalesOrderShipment",t],select:r=>r.data})},Pu=()=>{const{client:t}=A();return z({onError:E,queryFn:()=>t.carriers.list(),queryKey:["useListCarriers"],select:e=>e.data.carriers})},Eu=t=>{const{client:e}=A();return z({enabled:t&&Object.values(t).some(r=>r!==void 0),onError:E,queryFn:()=>e.labels.list(t),queryKey:["useListLabels",t],select:r=>r.data.labels})},Au=()=>{const{client:t}=A();return z({onError:E,queryFn:()=>t.orderSources.list(),queryKey:["useListOrderSources"],select:e=>e.data.orderSources})},Ru=()=>{const{client:t}=A();return z({onError:E,queryFn:()=>t.customPackages.list(),queryKey:["useListCustomPackageTypes"],select:e=>e.data.packages})},Cu=(t={})=>{const{client:e}=A();return z({enabled:t&&Object.values(t).some(r=>r!==void 0),onError:E,queryFn:()=>e.salesOrders.list(t),queryKey:["useListSalesOrders",t],select:r=>r.data.salesOrders})},Fu=t=>{const{client:e}=A();return z({enabled:t&&Object.values(t).some(r=>r!==void 0),onError:E,queryFn:()=>e.salesOrderShipments.list(t),queryKey:["useListSalesOrderShipments",t],select:r=>r.data.shipments})},xu=()=>{const{client:t}=A();return z({onError:E,queryFn:()=>t.warehouses.list(),queryKey:["useListWarehouses"],select:e=>e.data.warehouses})},Iu=()=>{const{client:t}=A();return L({mutationFn:async({salesOrderId:e,...r})=>(await t.salesOrders.notifyShipped(e,r)).data,mutationKey:["useNotifySalesOrder"],onError:E})},qu=()=>{const{client:t}=A();return L({mutationFn:async({address:e,text:r})=>(await t.addresses.parse(r,e)).data,mutationKey:["useParseAddress"],onError:E})},pi=()=>{const{client:t}=A();return L({mutationFn:async e=>(await t.orderSources.refresh(e)).data,mutationKey:["useRefreshOrderSourceAsync"]})},_u=()=>{const{client:t}=A(),{mutateAsync:e}=pi();return L({mutationFn:async r=>(await e(r),await Tn(async()=>{const{data:i}=await t.orderSources.get(r);if(["preparing_update","updating"].includes(i.refreshInfo.status))throw new te("Order source is still refreshing");return i},20)),mutationKey:["useRefreshOrderSource"],onError:E})},$u=()=>L({mutationFn:async()=>(await Promise.resolve({data:{},errors:[],isLoading:!1,isValidating:!1})).data,mutationKey:["useUpdateBilling"],onError:E}),Mu=()=>{const{client:t}=A();return L({mutationFn:async({shipmentId:e,...r})=>(await t.salesOrderShipments.update(e,r)).data,mutationKey:["useUpdateSalesOrderShipment"],onError:E})},Du=()=>{const{client:t}=A();return L({mutationFn:async({warehouseId:e,...r})=>(await t.warehouses.update(e,r)).data,mutationKey:["useUpdateWarehouse"],onError:E})},Tu=()=>{const{client:t}=A();return L({mutationFn:async e=>(await t.addresses.validate(e)).data,mutationKey:["useValidateAddresses"],onError:E})},Uu=()=>{const{client:t}=A();return L({mutationFn:async e=>(await t.labels.void(e)).data,mutationKey:["useVoidLabel"],onError:E})},Nu=t=>{const{client:e}=A();return z({enabled:t!==void 0,onError:E,queryFn:()=>t?e.salesOrderShipments.get(t):Promise.reject(new Error("shipmentId is required")),queryKey:["useGetShipment",t],select:r=>r.data})};exports.ShipEngineContext=Or;exports.ShipEngineProvider=su;exports.delay=_n;exports.logger=Xi;exports.onError=E;exports.retryUntil=Tn;exports.useAddFunds=ou;exports.useCalculateRates=uu;exports.useConnectCarrier=lu;exports.useCreateLabel=fu;exports.useCreateSalesOrderShipment=hu;exports.useCreateWarehouse=du;exports.useDeleteWarehouse=pu;exports.useGetAccountSettings=bu;exports.useGetAutoFundingConfiguration=yu;exports.useGetCarrierById=vu;exports.useGetInsuranceAccount=mu;exports.useGetLabel=gu;exports.useGetSalesOrder=wu;exports.useGetSalesOrderShipment=Ou;exports.useGetShipment=Nu;exports.useGetWalletTransactionHistory=Su;exports.useListCarriers=Pu;exports.useListCustomPackageTypes=Ru;exports.useListLabels=Eu;exports.useListOrderSources=Au;exports.useListSalesOrderShipments=Fu;exports.useListSalesOrders=Cu;exports.useListWarehouses=xu;exports.useNotifySalesOrderShipped=Iu;exports.useParseAddress=qu;exports.useRefreshOrderSource=_u;exports.useRefreshOrderSourceAsync=pi;exports.useUpdateAutoFunding=cu;exports.useUpdateBilling=$u;exports.useUpdateSalesOrderShipment=Mu;exports.useUpdateWarehouse=Du;exports.useValidateAddresses=Tu;exports.useVoidLabel=Uu;
|
package/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipengine/react-api",
|
|
3
|
-
"version": "1.0.0-next.
|
|
3
|
+
"version": "1.0.0-next.1",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -15,4 +15,4 @@
|
|
|
15
15
|
"readmeFile": "./README.md",
|
|
16
16
|
"tsconfig": "./tsconfig.lib.json"
|
|
17
17
|
}
|
|
18
|
-
}
|
|
18
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|