@rechargeapps/storefront-client 0.25.0 → 0.27.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/api/auth.js +7 -2
- package/dist/cjs/api/auth.js.map +1 -1
- package/dist/cjs/api/bundle.js +10 -5
- package/dist/cjs/api/bundle.js.map +1 -1
- package/dist/cjs/api/customer.js +5 -0
- package/dist/cjs/api/customer.js.map +1 -1
- package/dist/cjs/index.js +1 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/request.js +6 -2
- package/dist/cjs/utils/request.js.map +1 -1
- package/dist/esm/api/auth.js +7 -2
- package/dist/esm/api/auth.js.map +1 -1
- package/dist/esm/api/bundle.js +10 -5
- package/dist/esm/api/bundle.js.map +1 -1
- package/dist/esm/api/customer.js +5 -1
- package/dist/esm/api/customer.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/utils/request.js +1 -1
- package/dist/esm/utils/request.js.map +1 -1
- package/dist/index.d.ts +26 -6
- package/dist/umd/recharge-client.min.js +10 -10
- package/package.json +1 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* recharge-client-0.
|
|
2
|
+
* recharge-client-0.27.0.min.js
|
|
3
3
|
* Copyright (c) Recharge
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
(function(
|
|
7
|
-
`)===0?n.substr(1,n.length):n}).forEach(function(n){var i=n.split(":"),a=i.shift().trim();if(a){var o=i.join(":").trim();e.append(a,o)}}),e}li.call(me.prototype);function z(r,e){if(!(this instanceof z))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new D(e.headers),this.url=e.url||"",this._initBody(r)}li.call(z.prototype),z.prototype.clone=function(){return new z(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new D(this.headers),url:this.url})},z.error=function(){var r=new z(null,{status:0,statusText:""});return r.type="error",r};var ds=[301,302,303,307,308];z.redirect=function(r,e){if(ds.indexOf(e)===-1)throw new RangeError("Invalid status code");return new z(null,{status:e,headers:{location:r}})};var we=j.DOMException;try{new we}catch{we=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},we.prototype=Object.create(Error.prototype),we.prototype.constructor=we}function pi(r,e){return new Promise(function(t,n){var i=new me(r,e);if(i.signal&&i.signal.aborted)return n(new we("Aborted","AbortError"));var a=new XMLHttpRequest;function o(){a.abort()}a.onload=function(){var f={status:a.status,statusText:a.statusText,headers:hs(a.getAllResponseHeaders()||"")};f.url="responseURL"in a?a.responseURL:f.headers.get("X-Request-URL");var c="response"in a?a.response:a.responseText;setTimeout(function(){t(new z(c,f))},0)},a.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.onabort=function(){setTimeout(function(){n(new we("Aborted","AbortError"))},0)};function s(f){try{return f===""&&j.location.href?j.location.href:f}catch{return f}}a.open(i.method,s(i.url),!0),i.credentials==="include"?a.withCredentials=!0:i.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(q.blob?a.responseType="blob":q.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(a.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof D)?Object.getOwnPropertyNames(e.headers).forEach(function(f){a.setRequestHeader(f,Bt(e.headers[f]))}):i.headers.forEach(function(f,c){a.setRequestHeader(c,f)}),i.signal&&(i.signal.addEventListener("abort",o),a.onreadystatechange=function(){a.readyState===4&&i.signal.removeEventListener("abort",o)}),a.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}pi.polyfill=!0,j.fetch||(j.fetch=pi,j.Headers=D,j.Request=me,j.Response=z),self.fetch.bind(self);var ys=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(t 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]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==i||o.enumerable!==!0)return!1}return!0},hi=typeof Symbol<"u"&&Symbol,vs=ys,gs=function(){return typeof hi!="function"||typeof Symbol!="function"||typeof hi("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:vs()},_s="Function.prototype.bind called on incompatible ",Ct=Array.prototype.slice,ms=Object.prototype.toString,ws="[object Function]",bs=function(e){var t=this;if(typeof t!="function"||ms.call(t)!==ws)throw new TypeError(_s+t);for(var n=Ct.call(arguments,1),i,a=function(){if(this instanceof i){var l=t.apply(this,n.concat(Ct.call(arguments)));return Object(l)===l?l:this}else return t.apply(e,n.concat(Ct.call(arguments)))},o=Math.max(0,t.length-n.length),s=[],f=0;f<o;f++)s.push("$"+f);if(i=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var c=function(){};c.prototype=t.prototype,i.prototype=new c,c.prototype=null}return i},$s=bs,Lt=Function.prototype.bind||$s,Es=Lt,As=Es.call(Function.call,Object.prototype.hasOwnProperty),P,Re=SyntaxError,di=Function,Me=TypeError,jt=function(r){try{return di('"use strict"; return ('+r+").constructor;")()}catch{}},be=Object.getOwnPropertyDescriptor;if(be)try{be({},"")}catch{be=null}var kt=function(){throw new Me},Os=be?function(){try{return arguments.callee,kt}catch{try{return be(arguments,"callee").get}catch{return kt}}}():kt,De=gs(),le=Object.getPrototypeOf||function(r){return r.__proto__},Be={},Ss=typeof Uint8Array>"u"?P:le(Uint8Array),Ne={"%AggregateError%":typeof AggregateError>"u"?P:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?P:ArrayBuffer,"%ArrayIteratorPrototype%":De?le([][Symbol.iterator]()):P,"%AsyncFromSyncIteratorPrototype%":P,"%AsyncFunction%":Be,"%AsyncGenerator%":Be,"%AsyncGeneratorFunction%":Be,"%AsyncIteratorPrototype%":Be,"%Atomics%":typeof Atomics>"u"?P:Atomics,"%BigInt%":typeof BigInt>"u"?P:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?P:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?P:Float32Array,"%Float64Array%":typeof Float64Array>"u"?P:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?P:FinalizationRegistry,"%Function%":di,"%GeneratorFunction%":Be,"%Int8Array%":typeof Int8Array>"u"?P:Int8Array,"%Int16Array%":typeof Int16Array>"u"?P:Int16Array,"%Int32Array%":typeof Int32Array>"u"?P:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":De?le(le([][Symbol.iterator]())):P,"%JSON%":typeof JSON=="object"?JSON:P,"%Map%":typeof Map>"u"?P:Map,"%MapIteratorPrototype%":typeof Map>"u"||!De?P:le(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?P:Promise,"%Proxy%":typeof Proxy>"u"?P:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?P:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?P:Set,"%SetIteratorPrototype%":typeof Set>"u"||!De?P:le(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?P:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":De?le(""[Symbol.iterator]()):P,"%Symbol%":De?Symbol:P,"%SyntaxError%":Re,"%ThrowTypeError%":Os,"%TypedArray%":Ss,"%TypeError%":Me,"%Uint8Array%":typeof Uint8Array>"u"?P:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?P:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?P:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?P:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?P:WeakMap,"%WeakRef%":typeof WeakRef>"u"?P:WeakRef,"%WeakSet%":typeof WeakSet>"u"?P:WeakSet},Ts=function r(e){var t;if(e==="%AsyncFunction%")t=jt("async function () {}");else if(e==="%GeneratorFunction%")t=jt("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=jt("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&(t=le(i.prototype))}return Ne[e]=t,t},yi={"%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"]},Qe=Lt,xr=As,Ps=Qe.call(Function.call,Array.prototype.concat),Is=Qe.call(Function.apply,Array.prototype.splice),vi=Qe.call(Function.call,String.prototype.replace),Fr=Qe.call(Function.call,String.prototype.slice),xs=Qe.call(Function.call,RegExp.prototype.exec),Fs=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Rs=/\\(\\)?/g,Ms=function(e){var t=Fr(e,0,1),n=Fr(e,-1);if(t==="%"&&n!=="%")throw new Re("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Re("invalid intrinsic syntax, expected opening `%`");var i=[];return vi(e,Fs,function(a,o,s,f){i[i.length]=s?vi(f,Rs,"$1"):o||a}),i},Ds=function(e,t){var n=e,i;if(xr(yi,n)&&(i=yi[n],n="%"+i[0]+"%"),xr(Ne,n)){var a=Ne[n];if(a===Be&&(a=Ts(n)),typeof a>"u"&&!t)throw new Me("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Re("intrinsic "+e+" does not exist!")},qt=function(e,t){if(typeof e!="string"||e.length===0)throw new Me("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Me('"allowMissing" argument must be a boolean');if(xs(/^%?[^%]*%?$/,e)===null)throw new Re("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ms(e),i=n.length>0?n[0]:"",a=Ds("%"+i+"%",t),o=a.name,s=a.value,f=!1,c=a.alias;c&&(i=c[0],Is(n,Ps([0,1],c)));for(var l=1,u=!0;l<n.length;l+=1){var p=n[l],y=Fr(p,0,1),g=Fr(p,-1);if((y==='"'||y==="'"||y==="`"||g==='"'||g==="'"||g==="`")&&y!==g)throw new Re("property names with quotes must have matching quotes");if((p==="constructor"||!u)&&(f=!0),i+="."+p,o="%"+i+"%",xr(Ne,o))s=Ne[o];else if(s!=null){if(!(p in s)){if(!t)throw new Me("base intrinsic for "+e+" exists, but the property is not available.");return}if(be&&l+1>=n.length){var b=be(s,p);u=!!b,u&&"get"in b&&!("originalValue"in b.get)?s=b.get:s=s[p]}else u=xr(s,p),s=s[p];u&&!f&&(Ne[o]=s)}}return s},gi={exports:{}};(function(r){var e=Lt,t=qt,n=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(i,n),o=t("%Object.getOwnPropertyDescriptor%",!0),s=t("%Object.defineProperty%",!0),f=t("%Math.max%");if(s)try{s({},"a",{value:1})}catch{s=null}r.exports=function(u){var p=a(e,i,arguments);if(o&&s){var y=o(p,"length");y.configurable&&s(p,"length",{value:1+f(0,u.length-(arguments.length-1))})}return p};var c=function(){return a(e,n,arguments)};s?s(r.exports,"apply",{value:c}):r.exports.apply=c})(gi);var _i=qt,mi=gi.exports,Bs=mi(_i("String.prototype.indexOf")),Ns=function(e,t){var n=_i(e,!!t);return typeof n=="function"&&Bs(e,".prototype.")>-1?mi(n):n},Ue=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},X=[],G=[],Us=typeof Uint8Array<"u"?Uint8Array:Array,Vt=!1;function wi(){Vt=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)X[e]=r[e],G[r.charCodeAt(e)]=e;G["-".charCodeAt(0)]=62,G["_".charCodeAt(0)]=63}function Cs(r){Vt||wi();var e,t,n,i,a,o,s=r.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[s-2]==="="?2:r[s-1]==="="?1:0,o=new Us(s*3/4-a),n=a>0?s-4:s;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)i=G[r.charCodeAt(e)]<<18|G[r.charCodeAt(e+1)]<<12|G[r.charCodeAt(e+2)]<<6|G[r.charCodeAt(e+3)],o[f++]=i>>16&255,o[f++]=i>>8&255,o[f++]=i&255;return a===2?(i=G[r.charCodeAt(e)]<<2|G[r.charCodeAt(e+1)]>>4,o[f++]=i&255):a===1&&(i=G[r.charCodeAt(e)]<<10|G[r.charCodeAt(e+1)]<<4|G[r.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=i&255),o}function Ls(r){return X[r>>18&63]+X[r>>12&63]+X[r>>6&63]+X[r&63]}function js(r,e,t){for(var n,i=[],a=e;a<t;a+=3)n=(r[a]<<16)+(r[a+1]<<8)+r[a+2],i.push(Ls(n));return i.join("")}function bi(r){Vt||wi();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,s=0,f=t-n;s<f;s+=o)a.push(js(r,s,s+o>f?f:s+o));return n===1?(e=r[t-1],i+=X[e>>2],i+=X[e<<4&63],i+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],i+=X[e>>10],i+=X[e>>4&63],i+=X[e<<2&63],i+="="),a.push(i),a.join("")}function Rr(r,e,t,n,i){var a,o,s=i*8-n-1,f=(1<<s)-1,c=f>>1,l=-7,u=t?i-1:0,p=t?-1:1,y=r[e+u];for(u+=p,a=y&(1<<-l)-1,y>>=-l,l+=s;l>0;a=a*256+r[e+u],u+=p,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=o*256+r[e+u],u+=p,l-=8);if(a===0)a=1-c;else{if(a===f)return o?NaN:(y?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-c}return(y?-1:1)*o*Math.pow(2,a-n)}function $i(r,e,t,n,i,a){var o,s,f,c=a*8-i-1,l=(1<<c)-1,u=l>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,g=n?1:-1,b=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+u>=1?e+=p/f:e+=p*Math.pow(2,1-u),e*f>=2&&(o++,f/=2),o+u>=l?(s=0,o=l):o+u>=1?(s=(e*f-1)*Math.pow(2,i),o=o+u):(s=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+y]=s&255,y+=g,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;r[t+y]=o&255,y+=g,o/=256,c-=8);r[t+y-g]|=b*128}var ks={}.toString,Ei=Array.isArray||function(r){return ks.call(r)=="[object Array]"};/*!
|
|
6
|
+
(function(re,Ye){typeof exports=="object"&&typeof module<"u"?module.exports=Ye():typeof define=="function"&&define.amd?define(Ye):(re=typeof globalThis<"u"?globalThis:re||self,re.recharge=Ye())})(this,function(){"use strict";var re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ye(r){var e=r.default;if(typeof e=="function"){var t=function(){return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var L=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof L<"u"&&L,k={searchParams:"URLSearchParams"in L,iterable:"Symbol"in L&&"iterator"in Symbol,blob:"FileReader"in L&&"Blob"in L&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in L,arrayBuffer:"ArrayBuffer"in L};function Qu(r){return r&&DataView.prototype.isPrototypeOf(r)}if(k.arrayBuffer)var es=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],rs=ArrayBuffer.isView||function(r){return r&&es.indexOf(Object.prototype.toString.call(r))>-1};function Ke(r){if(typeof r!="string"&&(r=String(r)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(r)||r==="")throw new TypeError('Invalid character in header field name: "'+r+'"');return r.toLowerCase()}function Mt(r){return typeof r!="string"&&(r=String(r)),r}function Bt(r){var e={next:function(){var t=r.shift();return{done:t===void 0,value:t}}};return k.iterable&&(e[Symbol.iterator]=function(){return e}),e}function B(r){this.map={},r instanceof B?r.forEach(function(e,t){this.append(t,e)},this):Array.isArray(r)?r.forEach(function(e){this.append(e[0],e[1])},this):r&&Object.getOwnPropertyNames(r).forEach(function(e){this.append(e,r[e])},this)}B.prototype.append=function(r,e){r=Ke(r),e=Mt(e);var t=this.map[r];this.map[r]=t?t+", "+e:e},B.prototype.delete=function(r){delete this.map[Ke(r)]},B.prototype.get=function(r){return r=Ke(r),this.has(r)?this.map[r]:null},B.prototype.has=function(r){return this.map.hasOwnProperty(Ke(r))},B.prototype.set=function(r,e){this.map[Ke(r)]=Mt(e)},B.prototype.forEach=function(r,e){for(var t in this.map)this.map.hasOwnProperty(t)&&r.call(e,this.map[t],t,this)},B.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),Bt(r)},B.prototype.values=function(){var r=[];return this.forEach(function(e){r.push(e)}),Bt(r)},B.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),Bt(r)},k.iterable&&(B.prototype[Symbol.iterator]=B.prototype.entries);function Dt(r){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}function ai(r){return new Promise(function(e,t){r.onload=function(){e(r.result)},r.onerror=function(){t(r.error)}})}function ts(r){var e=new FileReader,t=ai(e);return e.readAsArrayBuffer(r),t}function ns(r){var e=new FileReader,t=ai(e);return e.readAsText(r),t}function is(r){for(var e=new Uint8Array(r),t=new Array(e.length),n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return t.join("")}function oi(r){if(r.slice)return r.slice(0);var e=new Uint8Array(r.byteLength);return e.set(new Uint8Array(r)),e.buffer}function ui(){return this.bodyUsed=!1,this._initBody=function(r){this.bodyUsed=this.bodyUsed,this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:k.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:k.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:k.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():k.arrayBuffer&&k.blob&&Qu(r)?(this._bodyArrayBuffer=oi(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):k.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||rs(r))?this._bodyArrayBuffer=oi(r):this._bodyText=r=Object.prototype.toString.call(r):this._bodyText="",this.headers.get("content-type")||(typeof r=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):k.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},k.blob&&(this.blob=function(){var r=Dt(this);if(r)return r;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var r=Dt(this);return r||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(ts)}),this.text=function(){var r=Dt(this);if(r)return r;if(this._bodyBlob)return ns(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(is(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},k.formData&&(this.formData=function(){return this.text().then(us)}),this.json=function(){return this.text().then(JSON.parse)},this}var as=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function os(r){var e=r.toUpperCase();return as.indexOf(e)>-1?e:r}function _e(r,e){if(!(this instanceof _e))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var t=e.body;if(r instanceof _e){if(r.bodyUsed)throw new TypeError("Already read");this.url=r.url,this.credentials=r.credentials,e.headers||(this.headers=new B(r.headers)),this.method=r.method,this.mode=r.mode,this.signal=r.signal,!t&&r._bodyInit!=null&&(t=r._bodyInit,r.bodyUsed=!0)}else this.url=String(r);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new B(e.headers)),this.method=os(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&t)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(t),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}_e.prototype.clone=function(){return new _e(this,{body:this._bodyInit})};function us(r){var e=new FormData;return r.trim().split("&").forEach(function(t){if(t){var n=t.split("="),i=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(a))}}),e}function ss(r){var e=new B,t=r.replace(/\r?\n[\t ]+/g," ");return t.split("\r").map(function(n){return n.indexOf(`
|
|
7
|
+
`)===0?n.substr(1,n.length):n}).forEach(function(n){var i=n.split(":"),a=i.shift().trim();if(a){var o=i.join(":").trim();e.append(a,o)}}),e}ui.call(_e.prototype);function H(r,e){if(!(this instanceof H))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new B(e.headers),this.url=e.url||"",this._initBody(r)}ui.call(H.prototype),H.prototype.clone=function(){return new H(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new B(this.headers),url:this.url})},H.error=function(){var r=new H(null,{status:0,statusText:""});return r.type="error",r};var fs=[301,302,303,307,308];H.redirect=function(r,e){if(fs.indexOf(e)===-1)throw new RangeError("Invalid status code");return new H(null,{status:e,headers:{location:r}})};var me=L.DOMException;try{new me}catch{me=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},me.prototype=Object.create(Error.prototype),me.prototype.constructor=me}function si(r,e){return new Promise(function(t,n){var i=new _e(r,e);if(i.signal&&i.signal.aborted)return n(new me("Aborted","AbortError"));var a=new XMLHttpRequest;function o(){a.abort()}a.onload=function(){var f={status:a.status,statusText:a.statusText,headers:ss(a.getAllResponseHeaders()||"")};f.url="responseURL"in a?a.responseURL:f.headers.get("X-Request-URL");var c="response"in a?a.response:a.responseText;setTimeout(function(){t(new H(c,f))},0)},a.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.onabort=function(){setTimeout(function(){n(new me("Aborted","AbortError"))},0)};function s(f){try{return f===""&&L.location.href?L.location.href:f}catch{return f}}a.open(i.method,s(i.url),!0),i.credentials==="include"?a.withCredentials=!0:i.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(k.blob?a.responseType="blob":k.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(a.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof B)?Object.getOwnPropertyNames(e.headers).forEach(function(f){a.setRequestHeader(f,Mt(e.headers[f]))}):i.headers.forEach(function(f,c){a.setRequestHeader(c,f)}),i.signal&&(i.signal.addEventListener("abort",o),a.onreadystatechange=function(){a.readyState===4&&i.signal.removeEventListener("abort",o)}),a.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}si.polyfill=!0,L.fetch||(L.fetch=si,L.Headers=B,L.Request=_e,L.Response=H),self.fetch.bind(self);var cs=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(t 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]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==i||o.enumerable!==!0)return!1}return!0},fi=typeof Symbol<"u"&&Symbol,ls=cs,ps=function(){return typeof fi!="function"||typeof Symbol!="function"||typeof fi("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:ls()},hs="Function.prototype.bind called on incompatible ",Ut=Array.prototype.slice,ds=Object.prototype.toString,ys="[object Function]",vs=function(e){var t=this;if(typeof t!="function"||ds.call(t)!==ys)throw new TypeError(hs+t);for(var n=Ut.call(arguments,1),i,a=function(){if(this instanceof i){var p=t.apply(this,n.concat(Ut.call(arguments)));return Object(p)===p?p:this}else return t.apply(e,n.concat(Ut.call(arguments)))},o=Math.max(0,t.length-n.length),s=[],f=0;f<o;f++)s.push("$"+f);if(i=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var c=function(){};c.prototype=t.prototype,i.prototype=new c,c.prototype=null}return i},gs=vs,Nt=Function.prototype.bind||gs,_s=Nt,ms=_s.call(Function.call,Object.prototype.hasOwnProperty),I,Fe=SyntaxError,ci=Function,Re=TypeError,Ct=function(r){try{return ci('"use strict"; return ('+r+").constructor;")()}catch{}},we=Object.getOwnPropertyDescriptor;if(we)try{we({},"")}catch{we=null}var Lt=function(){throw new Re},ws=we?function(){try{return arguments.callee,Lt}catch{try{return we(arguments,"callee").get}catch{return Lt}}}():Lt,Me=ps(),ce=Object.getPrototypeOf||function(r){return r.__proto__},Be={},bs=typeof Uint8Array>"u"?I:ce(Uint8Array),De={"%AggregateError%":typeof AggregateError>"u"?I:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?I:ArrayBuffer,"%ArrayIteratorPrototype%":Me?ce([][Symbol.iterator]()):I,"%AsyncFromSyncIteratorPrototype%":I,"%AsyncFunction%":Be,"%AsyncGenerator%":Be,"%AsyncGeneratorFunction%":Be,"%AsyncIteratorPrototype%":Be,"%Atomics%":typeof Atomics>"u"?I:Atomics,"%BigInt%":typeof BigInt>"u"?I:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?I:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?I:Float32Array,"%Float64Array%":typeof Float64Array>"u"?I:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?I:FinalizationRegistry,"%Function%":ci,"%GeneratorFunction%":Be,"%Int8Array%":typeof Int8Array>"u"?I:Int8Array,"%Int16Array%":typeof Int16Array>"u"?I:Int16Array,"%Int32Array%":typeof Int32Array>"u"?I:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Me?ce(ce([][Symbol.iterator]())):I,"%JSON%":typeof JSON=="object"?JSON:I,"%Map%":typeof Map>"u"?I:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Me?I:ce(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?I:Promise,"%Proxy%":typeof Proxy>"u"?I:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?I:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?I:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Me?I:ce(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?I:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Me?ce(""[Symbol.iterator]()):I,"%Symbol%":Me?Symbol:I,"%SyntaxError%":Fe,"%ThrowTypeError%":ws,"%TypedArray%":bs,"%TypeError%":Re,"%Uint8Array%":typeof Uint8Array>"u"?I:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?I:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?I:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?I:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?I:WeakMap,"%WeakRef%":typeof WeakRef>"u"?I:WeakRef,"%WeakSet%":typeof WeakSet>"u"?I:WeakSet},$s=function r(e){var t;if(e==="%AsyncFunction%")t=Ct("async function () {}");else if(e==="%GeneratorFunction%")t=Ct("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Ct("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&(t=ce(i.prototype))}return De[e]=t,t},li={"%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"]},Ze=Nt,Ir=ms,Es=Ze.call(Function.call,Array.prototype.concat),As=Ze.call(Function.apply,Array.prototype.splice),pi=Ze.call(Function.call,String.prototype.replace),Pr=Ze.call(Function.call,String.prototype.slice),Os=Ze.call(Function.call,RegExp.prototype.exec),Ss=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ts=/\\(\\)?/g,Is=function(e){var t=Pr(e,0,1),n=Pr(e,-1);if(t==="%"&&n!=="%")throw new Fe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Fe("invalid intrinsic syntax, expected opening `%`");var i=[];return pi(e,Ss,function(a,o,s,f){i[i.length]=s?pi(f,Ts,"$1"):o||a}),i},Ps=function(e,t){var n=e,i;if(Ir(li,n)&&(i=li[n],n="%"+i[0]+"%"),Ir(De,n)){var a=De[n];if(a===Be&&(a=$s(n)),typeof a>"u"&&!t)throw new Re("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Fe("intrinsic "+e+" does not exist!")},jt=function(e,t){if(typeof e!="string"||e.length===0)throw new Re("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Re('"allowMissing" argument must be a boolean');if(Os(/^%?[^%]*%?$/,e)===null)throw new Fe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Is(e),i=n.length>0?n[0]:"",a=Ps("%"+i+"%",t),o=a.name,s=a.value,f=!1,c=a.alias;c&&(i=c[0],As(n,Es([0,1],c)));for(var p=1,u=!0;p<n.length;p+=1){var l=n[p],y=Pr(l,0,1),_=Pr(l,-1);if((y==='"'||y==="'"||y==="`"||_==='"'||_==="'"||_==="`")&&y!==_)throw new Fe("property names with quotes must have matching quotes");if((l==="constructor"||!u)&&(f=!0),i+="."+l,o="%"+i+"%",Ir(De,o))s=De[o];else if(s!=null){if(!(l in s)){if(!t)throw new Re("base intrinsic for "+e+" exists, but the property is not available.");return}if(we&&p+1>=n.length){var E=we(s,l);u=!!E,u&&"get"in E&&!("originalValue"in E.get)?s=E.get:s=s[l]}else u=Ir(s,l),s=s[l];u&&!f&&(De[o]=s)}}return s},hi={exports:{}};(function(r){var e=Nt,t=jt,n=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(i,n),o=t("%Object.getOwnPropertyDescriptor%",!0),s=t("%Object.defineProperty%",!0),f=t("%Math.max%");if(s)try{s({},"a",{value:1})}catch{s=null}r.exports=function(u){var l=a(e,i,arguments);if(o&&s){var y=o(l,"length");y.configurable&&s(l,"length",{value:1+f(0,u.length-(arguments.length-1))})}return l};var c=function(){return a(e,n,arguments)};s?s(r.exports,"apply",{value:c}):r.exports.apply=c})(hi);var di=jt,yi=hi.exports,xs=yi(di("String.prototype.indexOf")),Fs=function(e,t){var n=di(e,!!t);return typeof n=="function"&&xs(e,".prototype.")>-1?yi(n):n},Ue=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},X=[],V=[],Rs=typeof Uint8Array<"u"?Uint8Array:Array,kt=!1;function vi(){kt=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)X[e]=r[e],V[r.charCodeAt(e)]=e;V["-".charCodeAt(0)]=62,V["_".charCodeAt(0)]=63}function Ms(r){kt||vi();var e,t,n,i,a,o,s=r.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[s-2]==="="?2:r[s-1]==="="?1:0,o=new Rs(s*3/4-a),n=a>0?s-4:s;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)i=V[r.charCodeAt(e)]<<18|V[r.charCodeAt(e+1)]<<12|V[r.charCodeAt(e+2)]<<6|V[r.charCodeAt(e+3)],o[f++]=i>>16&255,o[f++]=i>>8&255,o[f++]=i&255;return a===2?(i=V[r.charCodeAt(e)]<<2|V[r.charCodeAt(e+1)]>>4,o[f++]=i&255):a===1&&(i=V[r.charCodeAt(e)]<<10|V[r.charCodeAt(e+1)]<<4|V[r.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=i&255),o}function Bs(r){return X[r>>18&63]+X[r>>12&63]+X[r>>6&63]+X[r&63]}function Ds(r,e,t){for(var n,i=[],a=e;a<t;a+=3)n=(r[a]<<16)+(r[a+1]<<8)+r[a+2],i.push(Bs(n));return i.join("")}function gi(r){kt||vi();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,s=0,f=t-n;s<f;s+=o)a.push(Ds(r,s,s+o>f?f:s+o));return n===1?(e=r[t-1],i+=X[e>>2],i+=X[e<<4&63],i+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],i+=X[e>>10],i+=X[e>>4&63],i+=X[e<<2&63],i+="="),a.push(i),a.join("")}function xr(r,e,t,n,i){var a,o,s=i*8-n-1,f=(1<<s)-1,c=f>>1,p=-7,u=t?i-1:0,l=t?-1:1,y=r[e+u];for(u+=l,a=y&(1<<-p)-1,y>>=-p,p+=s;p>0;a=a*256+r[e+u],u+=l,p-=8);for(o=a&(1<<-p)-1,a>>=-p,p+=n;p>0;o=o*256+r[e+u],u+=l,p-=8);if(a===0)a=1-c;else{if(a===f)return o?NaN:(y?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-c}return(y?-1:1)*o*Math.pow(2,a-n)}function _i(r,e,t,n,i,a){var o,s,f,c=a*8-i-1,p=(1<<c)-1,u=p>>1,l=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,_=n?1:-1,E=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=p):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+u>=1?e+=l/f:e+=l*Math.pow(2,1-u),e*f>=2&&(o++,f/=2),o+u>=p?(s=0,o=p):o+u>=1?(s=(e*f-1)*Math.pow(2,i),o=o+u):(s=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+y]=s&255,y+=_,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;r[t+y]=o&255,y+=_,o/=256,c-=8);r[t+y-_]|=E*128}var Us={}.toString,mi=Array.isArray||function(r){return Us.call(r)=="[object Array]"};/*!
|
|
8
8
|
* The buffer module from node.js, for the browser.
|
|
9
9
|
*
|
|
10
10
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
11
11
|
* @license MIT
|
|
12
|
-
*/var qs=50;d.TYPED_ARRAY_SUPPORT=Ue.TYPED_ARRAY_SUPPORT!==void 0?Ue.TYPED_ARRAY_SUPPORT:!0,Mr();function Mr(){return d.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ne(r,e){if(Mr()<e)throw new RangeError("Invalid typed array length");return d.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=d.prototype):(r===null&&(r=new d(e)),r.length=e),r}function d(r,e,t){if(!d.TYPED_ARRAY_SUPPORT&&!(this instanceof d))return new d(r,e,t);if(typeof r=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return Gt(this,r)}return Ai(this,r,e,t)}d.poolSize=8192,d._augment=function(r){return r.__proto__=d.prototype,r};function Ai(r,e,t,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Hs(r,e,t,n):typeof e=="string"?Gs(r,e,t):Ws(r,e)}d.from=function(r,e,t){return Ai(null,r,e,t)},d.TYPED_ARRAY_SUPPORT&&(d.prototype.__proto__=Uint8Array.prototype,d.__proto__=Uint8Array);function Oi(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function Vs(r,e,t,n){return Oi(e),e<=0?ne(r,e):t!==void 0?typeof n=="string"?ne(r,e).fill(t,n):ne(r,e).fill(t):ne(r,e)}d.alloc=function(r,e,t){return Vs(null,r,e,t)};function Gt(r,e){if(Oi(e),r=ne(r,e<0?0:Wt(e)|0),!d.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}d.allocUnsafe=function(r){return Gt(null,r)},d.allocUnsafeSlow=function(r){return Gt(null,r)};function Gs(r,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!d.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=Si(e,t)|0;r=ne(r,n);var i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function Ht(r,e){var t=e.length<0?0:Wt(e.length)|0;r=ne(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Hs(r,e,t,n){if(e.byteLength,t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");return t===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,t):e=new Uint8Array(e,t,n),d.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=d.prototype):r=Ht(r,e),r}function Ws(r,e){if(Y(e)){var t=Wt(e.length)|0;return r=ne(r,t),r.length===0||e.copy(r,0,0,t),r}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||pf(e.length)?ne(r,0):Ht(r,e);if(e.type==="Buffer"&&Ei(e.data))return Ht(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Wt(r){if(r>=Mr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Mr().toString(16)+" bytes");return r|0}d.isBuffer=hf;function Y(r){return!!(r!=null&&r._isBuffer)}d.compare=function(e,t){if(!Y(e)||!Y(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,a=0,o=Math.min(n,i);a<o;++a)if(e[a]!==t[a]){n=e[a],i=t[a];break}return n<i?-1:i<n?1:0},d.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(e,t){if(!Ei(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return d.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=d.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(!Y(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function Si(r,e){if(Y(r))return r.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var t=r.length;if(t===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return Nr(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Bi(r).length;default:if(n)return Nr(r).length;e=(""+e).toLowerCase(),n=!0}}d.byteLength=Si;function zs(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return nf(this,e,t);case"utf8":case"utf-8":return xi(this,e,t);case"ascii":return rf(this,e,t);case"latin1":case"binary":return tf(this,e,t);case"base64":return Qs(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return af(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}d.prototype._isBuffer=!0;function $e(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}d.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)$e(this,t,t+1);return this},d.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)$e(this,t,t+3),$e(this,t+1,t+2);return this},d.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)$e(this,t,t+7),$e(this,t+1,t+6),$e(this,t+2,t+5),$e(this,t+3,t+4);return this},d.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?xi(this,0,e):zs.apply(this,arguments)},d.prototype.equals=function(e){if(!Y(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:d.compare(this,e)===0},d.prototype.inspect=function(){var e="",t=qs;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},d.prototype.compare=function(e,t,n,i,a){if(!Y(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),t<0||n>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=n)return 0;if(i>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,a>>>=0,this===e)return 0;for(var o=a-i,s=n-t,f=Math.min(o,s),c=this.slice(i,a),l=e.slice(t,n),u=0;u<f;++u)if(c[u]!==l[u]){o=c[u],s=l[u];break}return o<s?-1:s<o?1:0};function Ti(r,e,t,n,i){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=d.from(e,n)),Y(e))return e.length===0?-1:Pi(r,e,t,n,i);if(typeof e=="number")return e=e&255,d.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Pi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Pi(r,e,t,n,i){var a=1,o=r.length,s=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;a=2,o/=2,s/=2,t/=2}function f(y,g){return a===1?y[g]:y.readUInt16BE(g*a)}var c;if(i){var l=-1;for(c=t;c<o;c++)if(f(r,c)===f(e,l===-1?0:c-l)){if(l===-1&&(l=c),c-l+1===s)return l*a}else l!==-1&&(c-=c-l),l=-1}else for(t+s>o&&(t=o-s),c=t;c>=0;c--){for(var u=!0,p=0;p<s;p++)if(f(r,c+p)!==f(e,p)){u=!1;break}if(u)return c}return-1}d.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},d.prototype.indexOf=function(e,t,n){return Ti(this,e,t,n,!0)},d.prototype.lastIndexOf=function(e,t,n){return Ti(this,e,t,n,!1)};function Xs(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(o*2,2),16);if(isNaN(s))return o;r[t+o]=s}return o}function Ys(r,e,t,n){return Ur(Nr(e,r.length-t),r,t,n)}function Ii(r,e,t,n){return Ur(cf(e),r,t,n)}function Ks(r,e,t,n){return Ii(r,e,t,n)}function Zs(r,e,t,n){return Ur(Bi(e),r,t,n)}function Js(r,e,t,n){return Ur(lf(e,r.length-t),r,t,n)}d.prototype.write=function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-t;if((n===void 0||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return Xs(this,e,t,n);case"utf8":case"utf-8":return Ys(this,e,t,n);case"ascii":return Ii(this,e,t,n);case"latin1":case"binary":return Ks(this,e,t,n);case"base64":return Zs(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Js(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Qs(r,e,t){return e===0&&t===r.length?bi(r):bi(r.slice(e,t))}function xi(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var a=r[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=t){var f,c,l,u;switch(s){case 1:a<128&&(o=a);break;case 2:f=r[i+1],(f&192)===128&&(u=(a&31)<<6|f&63,u>127&&(o=u));break;case 3:f=r[i+1],c=r[i+2],(f&192)===128&&(c&192)===128&&(u=(a&15)<<12|(f&63)<<6|c&63,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:f=r[i+1],c=r[i+2],l=r[i+3],(f&192)===128&&(c&192)===128&&(l&192)===128&&(u=(a&15)<<18|(f&63)<<12|(c&63)<<6|l&63,u>65535&&u<1114112&&(o=u))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return ef(n)}var Fi=4096;function ef(r){var e=r.length;if(e<=Fi)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=Fi));return t}function rf(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]&127);return n}function tf(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}function nf(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var i="",a=e;a<t;++a)i+=ff(r[a]);return i}function af(r,e,t){for(var n=r.slice(e,t),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}d.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var i;if(d.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=d.prototype;else{var a=t-e;i=new d(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+e]}return i};function B(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUIntLE=function(e,t,n){e=e|0,t=t|0,n||B(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return i},d.prototype.readUIntBE=function(e,t,n){e=e|0,t=t|0,n||B(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},d.prototype.readUInt8=function(e,t){return t||B(e,1,this.length),this[e]},d.prototype.readUInt16LE=function(e,t){return t||B(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUInt16BE=function(e,t){return t||B(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUInt32LE=function(e,t){return t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},d.prototype.readUInt32BE=function(e,t){return t||B(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readIntLE=function(e,t,n){e=e|0,t=t|0,n||B(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*t)),i},d.prototype.readIntBE=function(e,t,n){e=e|0,t=t|0,n||B(e,t,this.length);for(var i=t,a=1,o=this[e+--i];i>0&&(a*=256);)o+=this[e+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*t)),o},d.prototype.readInt8=function(e,t){return t||B(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},d.prototype.readInt16LE=function(e,t){t||B(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},d.prototype.readInt16BE=function(e,t){t||B(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},d.prototype.readInt32LE=function(e,t){return t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readFloatLE=function(e,t){return t||B(e,4,this.length),Rr(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return t||B(e,4,this.length),Rr(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return t||B(e,8,this.length),Rr(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return t||B(e,8,this.length),Rr(this,e,!1,52,8)};function V(r,e,t,n,i,a){if(!Y(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}d.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;V(this,e,t,n,a,0)}var o=1,s=0;for(this[t]=e&255;++s<n&&(o*=256);)this[t+s]=e/o&255;return t+n},d.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;V(this,e,t,n,a,0)}var o=n-1,s=1;for(this[t+o]=e&255;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+n},d.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,1,255,0),d.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function Dr(r,e,t,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(r.length-t,2);i<a;++i)r[t+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}d.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Dr(this,e,t,!0),t+2},d.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Dr(this,e,t,!1),t+2};function Br(r,e,t,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(r.length-t,4);i<a;++i)r[t+i]=e>>>(n?i:3-i)*8&255}d.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):Br(this,e,t,!0),t+4},d.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Br(this,e,t,!1),t+4},d.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);V(this,e,t,n,a-1,-a)}var o=0,s=1,f=0;for(this[t]=e&255;++o<n&&(s*=256);)e<0&&f===0&&this[t+o-1]!==0&&(f=1),this[t+o]=(e/s>>0)-f&255;return t+n},d.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);V(this,e,t,n,a-1,-a)}var o=n-1,s=1,f=0;for(this[t+o]=e&255;--o>=0&&(s*=256);)e<0&&f===0&&this[t+o+1]!==0&&(f=1),this[t+o]=(e/s>>0)-f&255;return t+n},d.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,1,127,-128),d.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1},d.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Dr(this,e,t,!0),t+2},d.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Dr(this,e,t,!1),t+2},d.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,4,2147483647,-2147483648),d.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Br(this,e,t,!0),t+4},d.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||V(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Br(this,e,t,!1),t+4};function Ri(r,e,t,n,i,a){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Mi(r,e,t,n,i){return i||Ri(r,e,t,4),$i(r,e,t,n,23,4),t+4}d.prototype.writeFloatLE=function(e,t,n){return Mi(this,e,t,!0,n)},d.prototype.writeFloatBE=function(e,t,n){return Mi(this,e,t,!1,n)};function Di(r,e,t,n,i){return i||Ri(r,e,t,8),$i(r,e,t,n,52,8),t+8}d.prototype.writeDoubleLE=function(e,t,n){return Di(this,e,t,!0,n)},d.prototype.writeDoubleBE=function(e,t,n){return Di(this,e,t,!1,n)},d.prototype.copy=function(e,t,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var a=i-n,o;if(this===e&&n<t&&t<i)for(o=a-1;o>=0;--o)e[o+t]=this[o+n];else if(a<1e3||!d.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},d.prototype.fill=function(e,t,n,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var a=e.charCodeAt(0);a<256&&(e=a)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!d.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{var s=Y(e)?e:Nr(new d(e,i).toString()),f=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%f]}return this};var of=/[^+\/0-9A-Za-z-_]/g;function uf(r){if(r=sf(r).replace(of,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function sf(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function ff(r){return r<16?"0"+r.toString(16):r.toString(16)}function Nr(r,e){e=e||1/0;for(var t,n=r.length,i=null,a=[],o=0;o<n;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&a.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;a.push(t)}else if(t<2048){if((e-=2)<0)break;a.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;a.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;a.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return a}function cf(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function lf(r,e){for(var t,n,i,a=[],o=0;o<r.length&&!((e-=2)<0);++o)t=r.charCodeAt(o),n=t>>8,i=t%256,a.push(i),a.push(n);return a}function Bi(r){return Cs(uf(r))}function Ur(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}function pf(r){return r!==r}function hf(r){return r!=null&&(!!r._isBuffer||Ni(r)||df(r))}function Ni(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function df(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Ni(r.slice(0,0))}function Ui(){throw new Error("setTimeout has not been defined")}function Ci(){throw new Error("clearTimeout has not been defined")}var pe=Ui,he=Ci;typeof Ue.setTimeout=="function"&&(pe=setTimeout),typeof Ue.clearTimeout=="function"&&(he=clearTimeout);function Li(r){if(pe===setTimeout)return setTimeout(r,0);if((pe===Ui||!pe)&&setTimeout)return pe=setTimeout,setTimeout(r,0);try{return pe(r,0)}catch{try{return pe.call(null,r,0)}catch{return pe.call(this,r,0)}}}function yf(r){if(he===clearTimeout)return clearTimeout(r);if((he===Ci||!he)&&clearTimeout)return he=clearTimeout,clearTimeout(r);try{return he(r)}catch{try{return he.call(null,r)}catch{return he.call(this,r)}}}var ie=[],Ce=!1,Ee,Cr=-1;function vf(){!Ce||!Ee||(Ce=!1,Ee.length?ie=Ee.concat(ie):Cr=-1,ie.length&&ji())}function ji(){if(!Ce){var r=Li(vf);Ce=!0;for(var e=ie.length;e;){for(Ee=ie,ie=[];++Cr<e;)Ee&&Ee[Cr].run();Cr=-1,e=ie.length}Ee=null,Ce=!1,yf(r)}}function gf(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];ie.push(new ki(r,e)),ie.length===1&&!Ce&&Li(ji)}function ki(r,e){this.fun=r,this.array=e}ki.prototype.run=function(){this.fun.apply(null,this.array)};var _f="browser",mf="browser",wf=!0,bf={},$f=[],Ef="",Af={},Of={},Sf={};function Ae(){}var Tf=Ae,Pf=Ae,If=Ae,xf=Ae,Ff=Ae,Rf=Ae,Mf=Ae;function Df(r){throw new Error("process.binding is not supported")}function Bf(){return"/"}function Nf(r){throw new Error("process.chdir is not supported")}function Uf(){return 0}var Le=Ue.performance||{},Cf=Le.now||Le.mozNow||Le.msNow||Le.oNow||Le.webkitNow||function(){return new Date().getTime()};function Lf(r){var e=Cf.call(Le)*.001,t=Math.floor(e),n=Math.floor(e%1*1e9);return r&&(t=t-r[0],n=n-r[1],n<0&&(t--,n+=1e9)),[t,n]}var jf=new Date;function kf(){var r=new Date,e=r-jf;return e/1e3}var Lr={nextTick:gf,title:_f,browser:wf,env:bf,argv:$f,version:Ef,versions:Af,on:Tf,addListener:Pf,once:If,off:xf,removeListener:Ff,removeAllListeners:Rf,emit:Mf,binding:Df,cwd:Bf,chdir:Nf,umask:Uf,hrtime:Lf,platform:mf,release:Of,config:Sf,uptime:kf},zt;typeof Object.create=="function"?zt=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:zt=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var qi=zt,qf=/%[sdj%]/g;function jr(r){if(!rr(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(K(arguments[t]));return e.join(" ")}for(var t=1,n=arguments,i=n.length,a=String(r).replace(qf,function(s){if(s==="%%")return"%";if(t>=i)return s;switch(s){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch{return"[Circular]"}default:return s}}),o=n[t];t<i;o=n[++t])er(o)||!Oe(o)?a+=" "+o:a+=" "+K(o);return a}function Xt(r,e){if(Z(Ue.process))return function(){return Xt(r,e).apply(this,arguments)};if(Lr.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(Lr.throwDeprecation)throw new Error(e);Lr.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n}var kr={},Yt;function Vi(r){if(Z(Yt)&&(Yt=Lr.env.NODE_DEBUG||""),r=r.toUpperCase(),!kr[r])if(new RegExp("\\b"+r+"\\b","i").test(Yt)){var e=0;kr[r]=function(){var t=jr.apply(null,arguments);console.error("%s %d: %s",r,e,t)}}else kr[r]=function(){};return kr[r]}function K(r,e){var t={seen:[],stylize:Gf};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),Vr(e)?t.showHidden=e:e&&tn(t,e),Z(t.showHidden)&&(t.showHidden=!1),Z(t.depth)&&(t.depth=2),Z(t.colors)&&(t.colors=!1),Z(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=Vf),qr(t,r,t.depth)}K.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},K.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Vf(r,e){var t=K.styles[e];return t?"\x1B["+K.colors[t][0]+"m"+r+"\x1B["+K.colors[t][1]+"m":r}function Gf(r,e){return r}function Hf(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function qr(r,e,t){if(r.customInspect&&e&&ir(e.inspect)&&e.inspect!==K&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return rr(n)||(n=qr(r,n,t)),n}var i=Wf(r,e);if(i)return i;var a=Object.keys(e),o=Hf(a);if(r.showHidden&&(a=Object.getOwnPropertyNames(e)),nr(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return Kt(e);if(a.length===0){if(ir(e)){var s=e.name?": "+e.name:"";return r.stylize("[Function"+s+"]","special")}if(tr(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(Gr(e))return r.stylize(Date.prototype.toString.call(e),"date");if(nr(e))return Kt(e)}var f="",c=!1,l=["{","}"];if(Jt(e)&&(c=!0,l=["[","]"]),ir(e)){var u=e.name?": "+e.name:"";f=" [Function"+u+"]"}if(tr(e)&&(f=" "+RegExp.prototype.toString.call(e)),Gr(e)&&(f=" "+Date.prototype.toUTCString.call(e)),nr(e)&&(f=" "+Kt(e)),a.length===0&&(!c||e.length==0))return l[0]+f+l[1];if(t<0)return tr(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special");r.seen.push(e);var p;return c?p=zf(r,e,t,o,a):p=a.map(function(y){return Zt(r,e,t,o,y,c)}),r.seen.pop(),Xf(p,f,l)}function Wf(r,e){if(Z(e))return r.stylize("undefined","undefined");if(rr(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if(Qt(e))return r.stylize(""+e,"number");if(Vr(e))return r.stylize(""+e,"boolean");if(er(e))return r.stylize("null","null")}function Kt(r){return"["+Error.prototype.toString.call(r)+"]"}function zf(r,e,t,n,i){for(var a=[],o=0,s=e.length;o<s;++o)Yi(e,String(o))?a.push(Zt(r,e,t,n,String(o),!0)):a.push("");return i.forEach(function(f){f.match(/^\d+$/)||a.push(Zt(r,e,t,n,f,!0))}),a}function Zt(r,e,t,n,i,a){var o,s,f;if(f=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},f.get?f.set?s=r.stylize("[Getter/Setter]","special"):s=r.stylize("[Getter]","special"):f.set&&(s=r.stylize("[Setter]","special")),Yi(n,i)||(o="["+i+"]"),s||(r.seen.indexOf(f.value)<0?(er(t)?s=qr(r,f.value,null):s=qr(r,f.value,t-1),s.indexOf(`
|
|
12
|
+
*/var Ns=50;d.TYPED_ARRAY_SUPPORT=Ue.TYPED_ARRAY_SUPPORT!==void 0?Ue.TYPED_ARRAY_SUPPORT:!0,Fr();function Fr(){return d.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function te(r,e){if(Fr()<e)throw new RangeError("Invalid typed array length");return d.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=d.prototype):(r===null&&(r=new d(e)),r.length=e),r}function d(r,e,t){if(!d.TYPED_ARRAY_SUPPORT&&!(this instanceof d))return new d(r,e,t);if(typeof r=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return qt(this,r)}return wi(this,r,e,t)}d.poolSize=8192,d._augment=function(r){return r.__proto__=d.prototype,r};function wi(r,e,t,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?js(r,e,t,n):typeof e=="string"?Ls(r,e,t):ks(r,e)}d.from=function(r,e,t){return wi(null,r,e,t)},d.TYPED_ARRAY_SUPPORT&&(d.prototype.__proto__=Uint8Array.prototype,d.__proto__=Uint8Array);function bi(r){if(typeof r!="number")throw new TypeError('"size" argument must be a number');if(r<0)throw new RangeError('"size" argument must not be negative')}function Cs(r,e,t,n){return bi(e),e<=0?te(r,e):t!==void 0?typeof n=="string"?te(r,e).fill(t,n):te(r,e).fill(t):te(r,e)}d.alloc=function(r,e,t){return Cs(null,r,e,t)};function qt(r,e){if(bi(e),r=te(r,e<0?0:Gt(e)|0),!d.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}d.allocUnsafe=function(r){return qt(null,r)},d.allocUnsafeSlow=function(r){return qt(null,r)};function Ls(r,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!d.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=$i(e,t)|0;r=te(r,n);var i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function Vt(r,e){var t=e.length<0?0:Gt(e.length)|0;r=te(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function js(r,e,t,n){if(e.byteLength,t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");return t===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,t):e=new Uint8Array(e,t,n),d.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=d.prototype):r=Vt(r,e),r}function ks(r,e){if(z(e)){var t=Gt(e.length)|0;return r=te(r,t),r.length===0||e.copy(r,0,0,t),r}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||uf(e.length)?te(r,0):Vt(r,e);if(e.type==="Buffer"&&mi(e.data))return Vt(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Gt(r){if(r>=Fr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Fr().toString(16)+" bytes");return r|0}d.isBuffer=sf;function z(r){return!!(r!=null&&r._isBuffer)}d.compare=function(e,t){if(!z(e)||!z(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,a=0,o=Math.min(n,i);a<o;++a)if(e[a]!==t[a]){n=e[a],i=t[a];break}return n<i?-1:i<n?1:0},d.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(e,t){if(!mi(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return d.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=d.allocUnsafe(t),a=0;for(n=0;n<e.length;++n){var o=e[n];if(!z(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,a),a+=o.length}return i};function $i(r,e){if(z(r))return r.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;typeof r!="string"&&(r=""+r);var t=r.length;if(t===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return Br(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Fi(r).length;default:if(n)return Br(r).length;e=(""+e).toLowerCase(),n=!0}}d.byteLength=$i;function qs(r,e,t){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return Js(this,e,t);case"utf8":case"utf-8":return Si(this,e,t);case"ascii":return Ks(this,e,t);case"latin1":case"binary":return Zs(this,e,t);case"base64":return zs(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Qs(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}d.prototype._isBuffer=!0;function be(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}d.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)be(this,t,t+1);return this},d.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)be(this,t,t+3),be(this,t+1,t+2);return this},d.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)be(this,t,t+7),be(this,t+1,t+6),be(this,t+2,t+5),be(this,t+3,t+4);return this},d.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Si(this,0,e):qs.apply(this,arguments)},d.prototype.equals=function(e){if(!z(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:d.compare(this,e)===0},d.prototype.inspect=function(){var e="",t=Ns;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},d.prototype.compare=function(e,t,n,i,a){if(!z(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),t<0||n>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=n)return 0;if(i>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,a>>>=0,this===e)return 0;for(var o=a-i,s=n-t,f=Math.min(o,s),c=this.slice(i,a),p=e.slice(t,n),u=0;u<f;++u)if(c[u]!==p[u]){o=c[u],s=p[u];break}return o<s?-1:s<o?1:0};function Ei(r,e,t,n,i){if(r.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=i?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(i)return-1;t=r.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=d.from(e,n)),z(e))return e.length===0?-1:Ai(r,e,t,n,i);if(typeof e=="number")return e=e&255,d.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Ai(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Ai(r,e,t,n,i){var a=1,o=r.length,s=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;a=2,o/=2,s/=2,t/=2}function f(y,_){return a===1?y[_]:y.readUInt16BE(_*a)}var c;if(i){var p=-1;for(c=t;c<o;c++)if(f(r,c)===f(e,p===-1?0:c-p)){if(p===-1&&(p=c),c-p+1===s)return p*a}else p!==-1&&(c-=c-p),p=-1}else for(t+s>o&&(t=o-s),c=t;c>=0;c--){for(var u=!0,l=0;l<s;l++)if(f(r,c+l)!==f(e,l)){u=!1;break}if(u)return c}return-1}d.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},d.prototype.indexOf=function(e,t,n){return Ei(this,e,t,n,!0)},d.prototype.lastIndexOf=function(e,t,n){return Ei(this,e,t,n,!1)};function Vs(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(o*2,2),16);if(isNaN(s))return o;r[t+o]=s}return o}function Gs(r,e,t,n){return Dr(Br(e,r.length-t),r,t,n)}function Oi(r,e,t,n){return Dr(af(e),r,t,n)}function Ws(r,e,t,n){return Oi(r,e,t,n)}function Hs(r,e,t,n){return Dr(Fi(e),r,t,n)}function Xs(r,e,t,n){return Dr(of(e,r.length-t),r,t,n)}d.prototype.write=function(e,t,n,i){if(t===void 0)i="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")i=t,n=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(n)?(n=n|0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a=this.length-t;if((n===void 0||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return Vs(this,e,t,n);case"utf8":case"utf-8":return Gs(this,e,t,n);case"ascii":return Oi(this,e,t,n);case"latin1":case"binary":return Ws(this,e,t,n);case"base64":return Hs(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xs(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function zs(r,e,t){return e===0&&t===r.length?gi(r):gi(r.slice(e,t))}function Si(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var a=r[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=t){var f,c,p,u;switch(s){case 1:a<128&&(o=a);break;case 2:f=r[i+1],(f&192)===128&&(u=(a&31)<<6|f&63,u>127&&(o=u));break;case 3:f=r[i+1],c=r[i+2],(f&192)===128&&(c&192)===128&&(u=(a&15)<<12|(f&63)<<6|c&63,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:f=r[i+1],c=r[i+2],p=r[i+3],(f&192)===128&&(c&192)===128&&(p&192)===128&&(u=(a&15)<<18|(f&63)<<12|(c&63)<<6|p&63,u>65535&&u<1114112&&(o=u))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return Ys(n)}var Ti=4096;function Ys(r){var e=r.length;if(e<=Ti)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=Ti));return t}function Ks(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]&127);return n}function Zs(r,e,t){var n="";t=Math.min(r.length,t);for(var i=e;i<t;++i)n+=String.fromCharCode(r[i]);return n}function Js(r,e,t){var n=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>n)&&(t=n);for(var i="",a=e;a<t;++a)i+=nf(r[a]);return i}function Qs(r,e,t){for(var n=r.slice(e,t),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+n[a+1]*256);return i}d.prototype.slice=function(e,t){var n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);var i;if(d.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=d.prototype;else{var a=t-e;i=new d(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+e]}return i};function D(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUIntLE=function(e,t,n){e=e|0,t=t|0,n||D(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return i},d.prototype.readUIntBE=function(e,t,n){e=e|0,t=t|0,n||D(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},d.prototype.readUInt8=function(e,t){return t||D(e,1,this.length),this[e]},d.prototype.readUInt16LE=function(e,t){return t||D(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUInt16BE=function(e,t){return t||D(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUInt32LE=function(e,t){return t||D(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},d.prototype.readUInt32BE=function(e,t){return t||D(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readIntLE=function(e,t,n){e=e|0,t=t|0,n||D(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*t)),i},d.prototype.readIntBE=function(e,t,n){e=e|0,t=t|0,n||D(e,t,this.length);for(var i=t,a=1,o=this[e+--i];i>0&&(a*=256);)o+=this[e+--i]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*t)),o},d.prototype.readInt8=function(e,t){return t||D(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},d.prototype.readInt16LE=function(e,t){t||D(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},d.prototype.readInt16BE=function(e,t){t||D(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},d.prototype.readInt32LE=function(e,t){return t||D(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return t||D(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readFloatLE=function(e,t){return t||D(e,4,this.length),xr(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return t||D(e,4,this.length),xr(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return t||D(e,8,this.length),xr(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return t||D(e,8,this.length),xr(this,e,!1,52,8)};function q(r,e,t,n,i,a){if(!z(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}d.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;q(this,e,t,n,a,0)}var o=1,s=0;for(this[t]=e&255;++s<n&&(o*=256);)this[t+s]=e/o&255;return t+n},d.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;q(this,e,t,n,a,0)}var o=n-1,s=1;for(this[t+o]=e&255;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+n},d.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,1,255,0),d.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function Rr(r,e,t,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(r.length-t,2);i<a;++i)r[t+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}d.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Rr(this,e,t,!0),t+2},d.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Rr(this,e,t,!1),t+2};function Mr(r,e,t,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(r.length-t,4);i<a;++i)r[t+i]=e>>>(n?i:3-i)*8&255}d.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):Mr(this,e,t,!0),t+4},d.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,4294967295,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Mr(this,e,t,!1),t+4},d.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);q(this,e,t,n,a-1,-a)}var o=0,s=1,f=0;for(this[t]=e&255;++o<n&&(s*=256);)e<0&&f===0&&this[t+o-1]!==0&&(f=1),this[t+o]=(e/s>>0)-f&255;return t+n},d.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);q(this,e,t,n,a-1,-a)}var o=n-1,s=1,f=0;for(this[t+o]=e&255;--o>=0&&(s*=256);)e<0&&f===0&&this[t+o+1]!==0&&(f=1),this[t+o]=(e/s>>0)-f&255;return t+n},d.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,1,127,-128),d.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1},d.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Rr(this,e,t,!0),t+2},d.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Rr(this,e,t,!1),t+2},d.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,2147483647,-2147483648),d.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Mr(this,e,t,!0),t+4},d.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Mr(this,e,t,!1),t+4};function Ii(r,e,t,n,i,a){if(t+n>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Pi(r,e,t,n,i){return i||Ii(r,e,t,4),_i(r,e,t,n,23,4),t+4}d.prototype.writeFloatLE=function(e,t,n){return Pi(this,e,t,!0,n)},d.prototype.writeFloatBE=function(e,t,n){return Pi(this,e,t,!1,n)};function xi(r,e,t,n,i){return i||Ii(r,e,t,8),_i(r,e,t,n,52,8),t+8}d.prototype.writeDoubleLE=function(e,t,n){return xi(this,e,t,!0,n)},d.prototype.writeDoubleBE=function(e,t,n){return xi(this,e,t,!1,n)},d.prototype.copy=function(e,t,n,i){if(n||(n=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-n&&(i=e.length-t+n);var a=i-n,o;if(this===e&&n<t&&t<i)for(o=a-1;o>=0;--o)e[o+t]=this[o+n];else if(a<1e3||!d.TYPED_ARRAY_SUPPORT)for(o=0;o<a;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},d.prototype.fill=function(e,t,n,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),e.length===1){var a=e.charCodeAt(0);a<256&&(e=a)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!d.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{var s=z(e)?e:Br(new d(e,i).toString()),f=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%f]}return this};var ef=/[^+\/0-9A-Za-z-_]/g;function rf(r){if(r=tf(r).replace(ef,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function tf(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function nf(r){return r<16?"0"+r.toString(16):r.toString(16)}function Br(r,e){e=e||1/0;for(var t,n=r.length,i=null,a=[],o=0;o<n;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&a.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;a.push(t)}else if(t<2048){if((e-=2)<0)break;a.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;a.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;a.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return a}function af(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function of(r,e){for(var t,n,i,a=[],o=0;o<r.length&&!((e-=2)<0);++o)t=r.charCodeAt(o),n=t>>8,i=t%256,a.push(i),a.push(n);return a}function Fi(r){return Ms(rf(r))}function Dr(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}function uf(r){return r!==r}function sf(r){return r!=null&&(!!r._isBuffer||Ri(r)||ff(r))}function Ri(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function ff(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Ri(r.slice(0,0))}function Mi(){throw new Error("setTimeout has not been defined")}function Bi(){throw new Error("clearTimeout has not been defined")}var le=Mi,pe=Bi;typeof Ue.setTimeout=="function"&&(le=setTimeout),typeof Ue.clearTimeout=="function"&&(pe=clearTimeout);function Di(r){if(le===setTimeout)return setTimeout(r,0);if((le===Mi||!le)&&setTimeout)return le=setTimeout,setTimeout(r,0);try{return le(r,0)}catch{try{return le.call(null,r,0)}catch{return le.call(this,r,0)}}}function cf(r){if(pe===clearTimeout)return clearTimeout(r);if((pe===Bi||!pe)&&clearTimeout)return pe=clearTimeout,clearTimeout(r);try{return pe(r)}catch{try{return pe.call(null,r)}catch{return pe.call(this,r)}}}var ne=[],Ne=!1,$e,Ur=-1;function lf(){!Ne||!$e||(Ne=!1,$e.length?ne=$e.concat(ne):Ur=-1,ne.length&&Ui())}function Ui(){if(!Ne){var r=Di(lf);Ne=!0;for(var e=ne.length;e;){for($e=ne,ne=[];++Ur<e;)$e&&$e[Ur].run();Ur=-1,e=ne.length}$e=null,Ne=!1,cf(r)}}function pf(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];ne.push(new Ni(r,e)),ne.length===1&&!Ne&&Di(Ui)}function Ni(r,e){this.fun=r,this.array=e}Ni.prototype.run=function(){this.fun.apply(null,this.array)};var hf="browser",df="browser",yf=!0,vf={},gf=[],_f="",mf={},wf={},bf={};function Ee(){}var $f=Ee,Ef=Ee,Af=Ee,Of=Ee,Sf=Ee,Tf=Ee,If=Ee;function Pf(r){throw new Error("process.binding is not supported")}function xf(){return"/"}function Ff(r){throw new Error("process.chdir is not supported")}function Rf(){return 0}var Ce=Ue.performance||{},Mf=Ce.now||Ce.mozNow||Ce.msNow||Ce.oNow||Ce.webkitNow||function(){return new Date().getTime()};function Bf(r){var e=Mf.call(Ce)*.001,t=Math.floor(e),n=Math.floor(e%1*1e9);return r&&(t=t-r[0],n=n-r[1],n<0&&(t--,n+=1e9)),[t,n]}var Df=new Date;function Uf(){var r=new Date,e=r-Df;return e/1e3}var Nr={nextTick:pf,title:hf,browser:yf,env:vf,argv:gf,version:_f,versions:mf,on:$f,addListener:Ef,once:Af,off:Of,removeListener:Sf,removeAllListeners:Tf,emit:If,binding:Pf,cwd:xf,chdir:Ff,umask:Rf,hrtime:Bf,platform:df,release:wf,config:bf,uptime:Uf},Wt;typeof Object.create=="function"?Wt=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:Wt=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var Ci=Wt,Nf=/%[sdj%]/g;function Cr(r){if(!Qe(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(Y(arguments[t]));return e.join(" ")}for(var t=1,n=arguments,i=n.length,a=String(r).replace(Nf,function(s){if(s==="%%")return"%";if(t>=i)return s;switch(s){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch{return"[Circular]"}default:return s}}),o=n[t];t<i;o=n[++t])Je(o)||!Ae(o)?a+=" "+o:a+=" "+Y(o);return a}function Ht(r,e){if(K(Ue.process))return function(){return Ht(r,e).apply(this,arguments)};if(Nr.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(Nr.throwDeprecation)throw new Error(e);Nr.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n}var Lr={},Xt;function Li(r){if(K(Xt)&&(Xt=Nr.env.NODE_DEBUG||""),r=r.toUpperCase(),!Lr[r])if(new RegExp("\\b"+r+"\\b","i").test(Xt)){var e=0;Lr[r]=function(){var t=Cr.apply(null,arguments);console.error("%s %d: %s",r,e,t)}}else Lr[r]=function(){};return Lr[r]}function Y(r,e){var t={seen:[],stylize:Lf};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),kr(e)?t.showHidden=e:e&&en(t,e),K(t.showHidden)&&(t.showHidden=!1),K(t.depth)&&(t.depth=2),K(t.colors)&&(t.colors=!1),K(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=Cf),jr(t,r,t.depth)}Y.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Y.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Cf(r,e){var t=Y.styles[e];return t?"\x1B["+Y.colors[t][0]+"m"+r+"\x1B["+Y.colors[t][1]+"m":r}function Lf(r,e){return r}function jf(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function jr(r,e,t){if(r.customInspect&&e&&tr(e.inspect)&&e.inspect!==Y&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return Qe(n)||(n=jr(r,n,t)),n}var i=kf(r,e);if(i)return i;var a=Object.keys(e),o=jf(a);if(r.showHidden&&(a=Object.getOwnPropertyNames(e)),rr(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return zt(e);if(a.length===0){if(tr(e)){var s=e.name?": "+e.name:"";return r.stylize("[Function"+s+"]","special")}if(er(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(qr(e))return r.stylize(Date.prototype.toString.call(e),"date");if(rr(e))return zt(e)}var f="",c=!1,p=["{","}"];if(Kt(e)&&(c=!0,p=["[","]"]),tr(e)){var u=e.name?": "+e.name:"";f=" [Function"+u+"]"}if(er(e)&&(f=" "+RegExp.prototype.toString.call(e)),qr(e)&&(f=" "+Date.prototype.toUTCString.call(e)),rr(e)&&(f=" "+zt(e)),a.length===0&&(!c||e.length==0))return p[0]+f+p[1];if(t<0)return er(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special");r.seen.push(e);var l;return c?l=qf(r,e,t,o,a):l=a.map(function(y){return Yt(r,e,t,o,y,c)}),r.seen.pop(),Vf(l,f,p)}function kf(r,e){if(K(e))return r.stylize("undefined","undefined");if(Qe(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if(Zt(e))return r.stylize(""+e,"number");if(kr(e))return r.stylize(""+e,"boolean");if(Je(e))return r.stylize("null","null")}function zt(r){return"["+Error.prototype.toString.call(r)+"]"}function qf(r,e,t,n,i){for(var a=[],o=0,s=e.length;o<s;++o)Wi(e,String(o))?a.push(Yt(r,e,t,n,String(o),!0)):a.push("");return i.forEach(function(f){f.match(/^\d+$/)||a.push(Yt(r,e,t,n,f,!0))}),a}function Yt(r,e,t,n,i,a){var o,s,f;if(f=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},f.get?f.set?s=r.stylize("[Getter/Setter]","special"):s=r.stylize("[Getter]","special"):f.set&&(s=r.stylize("[Setter]","special")),Wi(n,i)||(o="["+i+"]"),s||(r.seen.indexOf(f.value)<0?(Je(t)?s=jr(r,f.value,null):s=jr(r,f.value,t-1),s.indexOf(`
|
|
13
13
|
`)>-1&&(a?s=s.split(`
|
|
14
14
|
`).map(function(c){return" "+c}).join(`
|
|
15
15
|
`).substr(2):s=`
|
|
16
16
|
`+s.split(`
|
|
17
17
|
`).map(function(c){return" "+c}).join(`
|
|
18
|
-
`))):s=r.stylize("[Circular]","special")),
|
|
18
|
+
`))):s=r.stylize("[Circular]","special")),K(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=r.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=r.stylize(o,"string"))}return o+": "+s}function Vf(r,e,t){var n=r.reduce(function(i,a){return a.indexOf(`
|
|
19
19
|
`)>=0,i+a.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?t[0]+(e===""?"":e+`
|
|
20
20
|
`)+" "+r.join(`,
|
|
21
|
-
`)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function Jt(r){return Array.isArray(r)}function Vr(r){return typeof r=="boolean"}function er(r){return r===null}function Gi(r){return r==null}function Qt(r){return typeof r=="number"}function rr(r){return typeof r=="string"}function Hi(r){return typeof r=="symbol"}function Z(r){return r===void 0}function tr(r){return Oe(r)&&en(r)==="[object RegExp]"}function Oe(r){return typeof r=="object"&&r!==null}function Gr(r){return Oe(r)&&en(r)==="[object Date]"}function nr(r){return Oe(r)&&(en(r)==="[object Error]"||r instanceof Error)}function ir(r){return typeof r=="function"}function Wi(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function zi(r){return d.isBuffer(r)}function en(r){return Object.prototype.toString.call(r)}function rn(r){return r<10?"0"+r.toString(10):r.toString(10)}var Yf=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Kf(){var r=new Date,e=[rn(r.getHours()),rn(r.getMinutes()),rn(r.getSeconds())].join(":");return[r.getDate(),Yf[r.getMonth()],e].join(" ")}function Xi(){console.log("%s - %s",Kf(),jr.apply(null,arguments))}function tn(r,e){if(!e||!Oe(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function Yi(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Zf={inherits:qi,_extend:tn,log:Xi,isBuffer:zi,isPrimitive:Wi,isFunction:ir,isError:nr,isDate:Gr,isObject:Oe,isRegExp:tr,isUndefined:Z,isSymbol:Hi,isString:rr,isNumber:Qt,isNullOrUndefined:Gi,isNull:er,isBoolean:Vr,isArray:Jt,inspect:K,deprecate:Xt,format:jr,debuglog:Vi},Jf=Object.freeze({__proto__:null,format:jr,deprecate:Xt,debuglog:Vi,inspect:K,isArray:Jt,isBoolean:Vr,isNull:er,isNullOrUndefined:Gi,isNumber:Qt,isString:rr,isSymbol:Hi,isUndefined:Z,isRegExp:tr,isObject:Oe,isDate:Gr,isError:nr,isFunction:ir,isPrimitive:Wi,isBuffer:zi,log:Xi,inherits:qi,_extend:tn,default:Zf}),Qf=Ze(Jf),ec=Qf.inspect,nn=typeof Map=="function"&&Map.prototype,an=Object.getOwnPropertyDescriptor&&nn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Hr=nn&&an&&typeof an.get=="function"?an.get:null,rc=nn&&Map.prototype.forEach,on=typeof Set=="function"&&Set.prototype,un=Object.getOwnPropertyDescriptor&&on?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Wr=on&&un&&typeof un.get=="function"?un.get:null,tc=on&&Set.prototype.forEach,nc=typeof WeakMap=="function"&&WeakMap.prototype,ar=nc?WeakMap.prototype.has:null,ic=typeof WeakSet=="function"&&WeakSet.prototype,or=ic?WeakSet.prototype.has:null,ac=typeof WeakRef=="function"&&WeakRef.prototype,Ki=ac?WeakRef.prototype.deref:null,oc=Boolean.prototype.valueOf,uc=Object.prototype.toString,sc=Function.prototype.toString,fc=String.prototype.match,sn=String.prototype.slice,de=String.prototype.replace,cc=String.prototype.toUpperCase,Zi=String.prototype.toLowerCase,Ji=RegExp.prototype.test,Qi=Array.prototype.concat,J=Array.prototype.join,lc=Array.prototype.slice,ea=Math.floor,fn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,cn=Object.getOwnPropertySymbols,ln=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,je=typeof Symbol=="function"&&typeof Symbol.iterator=="object",k=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===je?"object":"symbol")?Symbol.toStringTag:null,ra=Object.prototype.propertyIsEnumerable,ta=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function na(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Ji.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-ea(-r):ea(r);if(n!==r){var i=String(n),a=sn.call(e,i.length+1);return de.call(i,t,"$&_")+"."+de.call(de.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return de.call(e,t,"$&_")}var pn=ec,ia=pn.custom,aa=sa(ia)?ia:null,pc=function r(e,t,n,i){var a=t||{};if(ye(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ye(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 o=ye(a,"customInspect")?a.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ye(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(ye(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=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 ca(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return s?na(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return s?na(e,c):c}var l=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=l&&l>0&&typeof e=="object")return hn(e)?"[Array]":"[Object]";var u=xc(a,n);if(typeof i>"u")i=[];else if(fa(i,e)>=0)return"[Circular]";function p(re,_e,ce){if(_e&&(i=lc.call(i),i.push(_e)),ce){var Ir={depth:a.depth};return ye(a,"quoteStyle")&&(Ir.quoteStyle=a.quoteStyle),r(re,Ir,n+1,i)}return r(re,a,n+1,i)}if(typeof e=="function"&&!ua(e)){var y=bc(e),g=zr(e,p);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(g.length>0?" { "+J.call(g,", ")+" }":"")}if(sa(e)){var b=je?de.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):ln.call(e);return typeof e=="object"&&!je?ur(b):b}if(Tc(e)){for(var E="<"+Zi.call(String(e.nodeName)),w=e.attributes||[],T=0;T<w.length;T++)E+=" "+w[T].name+"="+oa(hc(w[T].value),"double",a);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+Zi.call(String(e.nodeName))+">",E}if(hn(e)){if(e.length===0)return"[]";var h=zr(e,p);return u&&!Ic(h)?"["+yn(h,u)+"]":"[ "+J.call(h,", ")+" ]"}if(yc(e)){var S=zr(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!ra.call(e,"cause")?"{ ["+String(e)+"] "+J.call(Qi.call("[cause]: "+p(e.cause),S),", ")+" }":S.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+J.call(S,", ")+" }"}if(typeof e=="object"&&o){if(aa&&typeof e[aa]=="function"&&pn)return pn(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if($c(e)){var I=[];return rc.call(e,function(re,_e){I.push(p(_e,e,!0)+" => "+p(re,e))}),la("Map",Hr.call(e),I,u)}if(Oc(e)){var R=[];return tc.call(e,function(re){R.push(p(re,e))}),la("Set",Wr.call(e),R,u)}if(Ec(e))return dn("WeakMap");if(Sc(e))return dn("WeakSet");if(Ac(e))return dn("WeakRef");if(gc(e))return ur(p(Number(e)));if(mc(e))return ur(p(fn.call(e)));if(_c(e))return ur(oc.call(e));if(vc(e))return ur(p(String(e)));if(!dc(e)&&!ua(e)){var m=zr(e,p),v=ta?ta(e)===Object.prototype:e instanceof Object||e.constructor===Object,_=e instanceof Object?"":"null prototype",$=!v&&k&&Object(e)===e&&k in e?sn.call(ve(e),8,-1):_?"Object":"",O=v||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",L=O+($||_?"["+J.call(Qi.call([],$||[],_||[]),": ")+"] ":"");return m.length===0?L+"{}":u?L+"{"+yn(m,u)+"}":L+"{ "+J.call(m,", ")+" }"}return String(e)};function oa(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function hc(r){return de.call(String(r),/"/g,""")}function hn(r){return ve(r)==="[object Array]"&&(!k||!(typeof r=="object"&&k in r))}function dc(r){return ve(r)==="[object Date]"&&(!k||!(typeof r=="object"&&k in r))}function ua(r){return ve(r)==="[object RegExp]"&&(!k||!(typeof r=="object"&&k in r))}function yc(r){return ve(r)==="[object Error]"&&(!k||!(typeof r=="object"&&k in r))}function vc(r){return ve(r)==="[object String]"&&(!k||!(typeof r=="object"&&k in r))}function gc(r){return ve(r)==="[object Number]"&&(!k||!(typeof r=="object"&&k in r))}function _c(r){return ve(r)==="[object Boolean]"&&(!k||!(typeof r=="object"&&k in r))}function sa(r){if(je)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!ln)return!1;try{return ln.call(r),!0}catch{}return!1}function mc(r){if(!r||typeof r!="object"||!fn)return!1;try{return fn.call(r),!0}catch{}return!1}var wc=Object.prototype.hasOwnProperty||function(r){return r in this};function ye(r,e){return wc.call(r,e)}function ve(r){return uc.call(r)}function bc(r){if(r.name)return r.name;var e=fc.call(sc.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function fa(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}function $c(r){if(!Hr||!r||typeof r!="object")return!1;try{Hr.call(r);try{Wr.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function Ec(r){if(!ar||!r||typeof r!="object")return!1;try{ar.call(r,ar);try{or.call(r,or)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function Ac(r){if(!Ki||!r||typeof r!="object")return!1;try{return Ki.call(r),!0}catch{}return!1}function Oc(r){if(!Wr||!r||typeof r!="object")return!1;try{Wr.call(r);try{Hr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Sc(r){if(!or||!r||typeof r!="object")return!1;try{or.call(r,or);try{ar.call(r,ar)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Tc(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function ca(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return ca(sn.call(r,0,e.maxStringLength),e)+n}var i=de.call(de.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Pc);return oa(i,"single",e)}function Pc(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+cc.call(e.toString(16))}function ur(r){return"Object("+r+")"}function dn(r){return r+" { ? }"}function la(r,e,t,n){var i=n?yn(t,n):J.call(t,", ");return r+" ("+e+") {"+i+"}"}function Ic(r){for(var e=0;e<r.length;e++)if(fa(r[e],`
|
|
22
|
-
`)>=0)return!1;return!0}function
|
|
23
|
-
`+e.prev+e.base;return t+
|
|
24
|
-
`+e.prev}function zr(r,e){var t=hn(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=ye(r,i)?e(r[i],r):""}var a=typeof cn=="function"?cn(r):[],o;if(je){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var f in r)!ye(r,f)||t&&String(Number(f))===f&&f<r.length||je&&o["$"+f]instanceof Symbol||(Ji.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r)));if(typeof cn=="function")for(var c=0;c<a.length;c++)ra.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var vn=qt,ke=Ns,Fc=pc,Rc=vn("%TypeError%"),Xr=vn("%WeakMap%",!0),Yr=vn("%Map%",!0),Mc=ke("WeakMap.prototype.get",!0),Dc=ke("WeakMap.prototype.set",!0),Bc=ke("WeakMap.prototype.has",!0),Nc=ke("Map.prototype.get",!0),Uc=ke("Map.prototype.set",!0),Cc=ke("Map.prototype.has",!0),gn=function(r,e){for(var t=r,n;(n=t.next)!==null;t=n)if(n.key===e)return t.next=n.next,n.next=r.next,r.next=n,n},Lc=function(r,e){var t=gn(r,e);return t&&t.value},jc=function(r,e,t){var n=gn(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},kc=function(r,e){return!!gn(r,e)},qc=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new Rc("Side channel does not contain "+Fc(a))},get:function(a){if(Xr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Mc(e,a)}else if(Yr){if(t)return Nc(t,a)}else if(n)return Lc(n,a)},has:function(a){if(Xr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Bc(e,a)}else if(Yr){if(t)return Cc(t,a)}else if(n)return kc(n,a);return!1},set:function(a,o){Xr&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new Xr),Dc(e,a,o)):Yr?(t||(t=new Yr),Uc(t,a,o)):(n||(n={key:{},next:null}),jc(n,a,o))}};return i},Vc=String.prototype.replace,Gc=/%20/g,_n={RFC1738:"RFC1738",RFC3986:"RFC3986"},mn={default:_n.RFC3986,formatters:{RFC1738:function(r){return Vc.call(r,Gc,"+")},RFC3986:function(r){return String(r)}},RFC1738:_n.RFC1738,RFC3986:_n.RFC3986},Hc=mn,wn=Object.prototype.hasOwnProperty,Se=Array.isArray,Q=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),Wc=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Se(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},pa=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},zc=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Se(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!wn.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var i=e;return Se(e)&&!Se(t)&&(i=pa(e,n)),Se(e)&&Se(t)?(t.forEach(function(a,o){if(wn.call(e,o)){var s=e[o];s&&typeof s=="object"&&a&&typeof a=="object"?e[o]=r(s,a,n):e.push(a)}else e[o]=a}),e):Object.keys(t).reduce(function(a,o){var s=t[o];return wn.call(a,o)?a[o]=r(a[o],s,n):a[o]=s,a},i)},Xc=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},Yc=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Kc=function(e,t,n,i,a){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var s="",f=0;f<o.length;++f){var c=o.charCodeAt(f);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||a===Hc.RFC1738&&(c===40||c===41)){s+=o.charAt(f);continue}if(c<128){s=s+Q[c];continue}if(c<2048){s=s+(Q[192|c>>6]+Q[128|c&63]);continue}if(c<55296||c>=57344){s=s+(Q[224|c>>12]+Q[128|c>>6&63]+Q[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),s+=Q[240|c>>18]+Q[128|c>>12&63]+Q[128|c>>6&63]+Q[128|c&63]}return s},Zc=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i<t.length;++i)for(var a=t[i],o=a.obj[a.prop],s=Object.keys(o),f=0;f<s.length;++f){var c=s[f],l=o[c];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(t.push({obj:o,prop:c}),n.push(l))}return Wc(t),e},Jc=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Qc=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},el=function(e,t){return[].concat(e,t)},rl=function(e,t){if(Se(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},ha={arrayToObject:pa,assign:Xc,combine:el,compact:Zc,decode:Yc,encode:Kc,isBuffer:Qc,isRegExp:Jc,maybeMap:rl,merge:zc},da=qc,bn=ha,sr=mn,tl=Object.prototype.hasOwnProperty,ya={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},ae=Array.isArray,nl=String.prototype.split,il=Array.prototype.push,va=function(r,e){il.apply(r,ae(e)?e:[e])},al=Date.prototype.toISOString,ga=sr.default,U={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:bn.encode,encodeValuesOnly:!1,format:ga,formatter:sr.formatters[ga],indices:!1,serializeDate:function(e){return al.call(e)},skipNulls:!1,strictNullHandling:!1},ol=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},$n={},ul=function r(e,t,n,i,a,o,s,f,c,l,u,p,y,g,b,E){for(var w=e,T=E,h=0,S=!1;(T=T.get($n))!==void 0&&!S;){var I=T.get(e);if(h+=1,typeof I<"u"){if(I===h)throw new RangeError("Cyclic object value");S=!0}typeof T.get($n)>"u"&&(h=0)}if(typeof f=="function"?w=f(t,w):w instanceof Date?w=u(w):n==="comma"&&ae(w)&&(w=bn.maybeMap(w,function(si){return si instanceof Date?u(si):si})),w===null){if(a)return s&&!g?s(t,U.encoder,b,"key",p):t;w=""}if(ol(w)||bn.isBuffer(w)){if(s){var R=g?t:s(t,U.encoder,b,"key",p);if(n==="comma"&&g){for(var m=nl.call(String(w),","),v="",_=0;_<m.length;++_)v+=(_===0?"":",")+y(s(m[_],U.encoder,b,"value",p));return[y(R)+(i&&ae(w)&&m.length===1?"[]":"")+"="+v]}return[y(R)+"="+y(s(w,U.encoder,b,"value",p))]}return[y(t)+"="+y(String(w))]}var $=[];if(typeof w>"u")return $;var O;if(n==="comma"&&ae(w))O=[{value:w.length>0?w.join(",")||null:void 0}];else if(ae(f))O=f;else{var L=Object.keys(w);O=c?L.sort(c):L}for(var re=i&&ae(w)&&w.length===1?t+"[]":t,_e=0;_e<O.length;++_e){var ce=O[_e],Ir=typeof ce=="object"&&typeof ce.value<"u"?ce.value:w[ce];if(!(o&&Ir===null)){var K2=ae(w)?typeof n=="function"?n(re,ce):re:re+(l?"."+ce:"["+ce+"]");E.set(e,h);var ns=da();ns.set($n,E),va($,r(Ir,K2,n,i,a,o,s,f,c,l,u,p,y,g,b,ns))}}return $},sl=function(e){if(!e)return U;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||U.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=sr.default;if(typeof e.format<"u"){if(!tl.call(sr.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=sr.formatters[n],a=U.filter;return(typeof e.filter=="function"||ae(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:U.addQueryPrefix,allowDots:typeof e.allowDots>"u"?U.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:U.charsetSentinel,delimiter:typeof e.delimiter>"u"?U.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:U.encode,encoder:typeof e.encoder=="function"?e.encoder:U.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:U.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:U.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:U.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:U.strictNullHandling}},fl=function(r,e){var t=r,n=sl(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):ae(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var s;e&&e.arrayFormat in ya?s=e.arrayFormat:e&&"indices"in e?s=e.indices?"indices":"repeat":s="indices";var f=ya[s];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=f==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var l=da(),u=0;u<i.length;++u){var p=i[u];n.skipNulls&&t[p]===null||va(o,ul(t[p],p,f,c,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,l))}var y=o.join(n.delimiter),g=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?g+="utf8=%26%2310003%3B&":g+="utf8=%E2%9C%93&"),y.length>0?g+y:""},qe=ha,En=Object.prototype.hasOwnProperty,cl=Array.isArray,N={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:qe.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},ll=function(r){return r.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},_a=function(r,e){return r&&typeof r=="string"&&e.comma&&r.indexOf(",")>-1?r.split(","):r},pl="utf8=%26%2310003%3B",hl="utf8=%E2%9C%93",dl=function(e,t){var n={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,a),s=-1,f,c=t.charset;if(t.charsetSentinel)for(f=0;f<o.length;++f)o[f].indexOf("utf8=")===0&&(o[f]===hl?c="utf-8":o[f]===pl&&(c="iso-8859-1"),s=f,f=o.length);for(f=0;f<o.length;++f)if(f!==s){var l=o[f],u=l.indexOf("]="),p=u===-1?l.indexOf("="):u+1,y,g;p===-1?(y=t.decoder(l,N.decoder,c,"key"),g=t.strictNullHandling?null:""):(y=t.decoder(l.slice(0,p),N.decoder,c,"key"),g=qe.maybeMap(_a(l.slice(p+1),t),function(b){return t.decoder(b,N.decoder,c,"value")})),g&&t.interpretNumericEntities&&c==="iso-8859-1"&&(g=ll(g)),l.indexOf("[]=")>-1&&(g=cl(g)?[g]:g),En.call(n,y)?n[y]=qe.combine(n[y],g):n[y]=g}return n},yl=function(r,e,t,n){for(var i=n?e:_a(e,t),a=r.length-1;a>=0;--a){var o,s=r[a];if(s==="[]"&&t.parseArrays)o=[].concat(i);else{o=t.plainObjects?Object.create(null):{};var f=s.charAt(0)==="["&&s.charAt(s.length-1)==="]"?s.slice(1,-1):s,c=parseInt(f,10);!t.parseArrays&&f===""?o={0:i}:!isNaN(c)&&s!==f&&String(c)===f&&c>=0&&t.parseArrays&&c<=t.arrayLimit?(o=[],o[c]=i):f!=="__proto__"&&(o[f]=i)}i=o}return i},vl=function(e,t,n,i){if(!!e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,f=n.depth>0&&o.exec(a),c=f?a.slice(0,f.index):a,l=[];if(c){if(!n.plainObjects&&En.call(Object.prototype,c)&&!n.allowPrototypes)return;l.push(c)}for(var u=0;n.depth>0&&(f=s.exec(a))!==null&&u<n.depth;){if(u+=1,!n.plainObjects&&En.call(Object.prototype,f[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(f[1])}return f&&l.push("["+a.slice(f.index)+"]"),yl(l,t,n,i)}},gl=function(e){if(!e)return N;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 t=typeof e.charset>"u"?N.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?N.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:N.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:N.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:N.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:N.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:N.comma,decoder:typeof e.decoder=="function"?e.decoder:N.decoder,delimiter:typeof e.delimiter=="string"||qe.isRegExp(e.delimiter)?e.delimiter:N.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:N.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:N.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:N.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:N.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:N.strictNullHandling}},_l=function(r,e){var t=gl(e);if(r===""||r===null||typeof r>"u")return t.plainObjects?Object.create(null):{};for(var n=typeof r=="string"?dl(r,t):r,i=t.plainObjects?Object.create(null):{},a=Object.keys(n),o=0;o<a.length;++o){var s=a[o],f=vl(s,n[s],t,typeof r=="string");i=qe.merge(i,f,t)}return t.allowSparse===!0?i:qe.compact(i)},ml=fl,wl=_l,bl=mn,$l={formats:bl,parse:wl,stringify:ml};let ma={storeIdentifier:"",environment:"prod"};function El(r){ma=r}function oe(){return ma}const Al=r=>r==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",An=r=>r==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",Ol=r=>r==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",Sl="/tools/recurring";class Kr{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}var Tl=Object.defineProperty,Pl=Object.defineProperties,Il=Object.getOwnPropertyDescriptors,wa=Object.getOwnPropertySymbols,xl=Object.prototype.hasOwnProperty,Fl=Object.prototype.propertyIsEnumerable,ba=(r,e,t)=>e in r?Tl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Zr=(r,e)=>{for(var t in e||(e={}))xl.call(e,t)&&ba(r,t,e[t]);if(wa)for(var t of wa(e))Fl.call(e,t)&&ba(r,t,e[t]);return r},Rl=(r,e)=>Pl(r,Il(e));function Ml(r){return $l.stringify(r,{encode:!1,indices:!1,arrayFormat:"comma"})}async function Jr(r,e,t={}){const n=oe();return H(r,`${Ol(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function A(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:s,storeIdentifier:f,loginRetryFn:c}=oe(),l=o.apiToken,u=Al(s),p=Zr({"X-Recharge-Access-Token":l,"X-Recharge-Version":"2021-11"},a||{}),y=Zr({shop_url:f},n);try{return await H(r,`${u}${e}`,{id:t,query:y,data:i,headers:p})}catch(g){if(c&&g instanceof Kr&&g.status===401)return c().then(b=>{if(b)return H(r,`${u}${e}`,{id:t,query:y,data:i,headers:Rl(Zr({},p),{"X-Recharge-Access-Token":b.apiToken})});throw g});throw g}}async function fr(r,e,t={}){return H(r,`${Sl}${e}`,t)}async function H(r,e,{id:t,query:n,data:i,headers:a}={}){let o=e.trim();if(t&&(o=[o,`${t}`.trim()].join("/")),n){let u;[o,u]=o.split("?");const p=[u,Ml(n)].join("&").replace(/^&/,"");o=`${o}${p?`?${p}`:""}`}let s;i&&r!=="get"&&(s=JSON.stringify(i));const f=Zr({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},a||{}),c=await fetch(o,{method:r,headers:f,body:s,mode:"cors"});let l;try{l=await c.json()}catch{}if(!c.ok)throw l&&l.error?new Kr(l.error,c.status):l&&l.errors?new Kr(JSON.stringify(l.errors),c.status):new Kr("A connection error occurred while making the request");return l}function Dl(r,e){return A("get","/addresses",{query:e},r)}async function Bl(r,e,t){const{address:n}=await A("get","/addresses",{id:e,query:{include:t?.include}},r);return n}async function Nl(r,e){const{address:t}=await A("post","/addresses",{data:e},r);return t}async function On(r,e,t){const{address:n}=await A("put","/addresses",{id:e,data:t},r);return n}async function Ul(r,e,t){return On(r,e,{discounts:[{code:t}]})}async function Cl(r,e){return On(r,e,{discounts:[]})}function Ll(r,e){return A("delete","/addresses",{id:e},r)}async function jl(r,e){const{address:t}=await A("post","/addresses/merge",{data:e},r);return t}async function kl(r,e,t){const{charge:n}=await A("post",`/addresses/${e}/charges/skip`,{data:t},r);return n}var ql=Object.freeze({__proto__:null,listAddresses:Dl,getAddress:Bl,createAddress:Nl,updateAddress:On,applyDiscountToAddress:Ul,removeDiscountsFromAddress:Cl,deleteAddress:Ll,mergeAddresses:jl,skipFutureCharge:kl});async function Vl(){const{storefrontAccessToken:r}=oe(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await fr("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id}}async function Gl(r,e){const{environment:t,storeIdentifier:n}=oe(),i=An(t),a=await H("post",`${i}/shopify_storefront_access`,{data:{customer_token:e,storefront_token:r,shop_url:n}});return a.api_token?{apiToken:a.api_token,customerId:a.customer_id}:null}async function Hl(r){const{environment:e,storefrontAccessToken:t,storeIdentifier:n}=oe(),i=An(e),a={};t&&(a["X-Recharge-Storefront-Access-Token"]=t);const o=await H("post",`${i}/attempt_login`,{data:{email:r,shop:n},headers:a});if(o.errors)throw new Error(o.errors);return o.session_token}async function Wl(r){const{storefrontAccessToken:e,storeIdentifier:t}=oe(),n={};e&&(n["X-Recharge-Storefront-Access-Token"]=e);const i=await fr("post","/attempt_login",{data:{email:r,shop:t},headers:n});if(i.errors)throw new Error(i.errors);return i.session_token}async function zl(r,e,t){const{environment:n,storefrontAccessToken:i,storeIdentifier:a}=oe(),o=An(n),s={};i&&(s["X-Recharge-Storefront-Access-Token"]=i);const f=await H("post",`${o}/validate_login`,{data:{code:t,email:r,session_token:e,shop:a},headers:s});if(f.errors)throw new Error(f.errors);return{apiToken:f.api_token,customerId:f.customer_id}}async function Xl(r,e,t){const{storefrontAccessToken:n,storeIdentifier:i}=oe(),a={};n&&(a["X-Recharge-Storefront-Access-Token"]=n);const o=await fr("post","/validate_login",{data:{code:t,email:r,session_token:e,shop:i},headers:a});if(o.errors)throw new Error(o.errors);return{apiToken:o.api_token,customerId:o.customer_id}}var Yl=Object.freeze({__proto__:null,loginShopifyAppProxy:Vl,loginShopifyApi:Gl,sendPasswordlessCode:Hl,sendPasswordlessCodeAppProxy:Wl,validatePasswordlessCode:zl,validatePasswordlessCodeAppProxy:Xl}),$a={},Sn={},ue={},Kl=typeof te=="object"&&te&&te.Object===Object&&te,Ea=Kl,Zl=Ea,Jl=typeof self=="object"&&self&&self.Object===Object&&self,Ql=Zl||Jl||Function("return this")(),ee=Ql,ep=ee,rp=ep.Symbol,Ve=rp,Aa=Ve,Oa=Object.prototype,tp=Oa.hasOwnProperty,np=Oa.toString,cr=Aa?Aa.toStringTag:void 0;function ip(r){var e=tp.call(r,cr),t=r[cr];try{r[cr]=void 0;var n=!0}catch{}var i=np.call(r);return n&&(e?r[cr]=t:delete r[cr]),i}var ap=ip,op=Object.prototype,up=op.toString;function sp(r){return up.call(r)}var fp=sp,Sa=Ve,cp=ap,lp=fp,pp="[object Null]",hp="[object Undefined]",Ta=Sa?Sa.toStringTag:void 0;function dp(r){return r==null?r===void 0?hp:pp:Ta&&Ta in Object(r)?cp(r):lp(r)}var se=dp;function yp(r){return r!=null&&typeof r=="object"}var W=yp,vp=se,gp=W,_p="[object Number]";function mp(r){return typeof r=="number"||gp(r)&&vp(r)==_p}var Qr=mp,M={},Pa={exports:{}};function wp(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var ge=wp,bp=se,$p=ge,Ep="[object AsyncFunction]",Ap="[object Function]",Op="[object GeneratorFunction]",Sp="[object Proxy]";function Tp(r){if(!$p(r))return!1;var e=bp(r);return e==Ap||e==Op||e==Ep||e==Sp}var Tn=Tp,Pp=ee,Ip=Pp["__core-js_shared__"],xp=Ip,Pn=xp,Ia=function(){var r=/[^.]+$/.exec(Pn&&Pn.keys&&Pn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function Fp(r){return!!Ia&&Ia in r}var Rp=Fp,Mp=Function.prototype,Dp=Mp.toString;function Bp(r){if(r!=null){try{return Dp.call(r)}catch{}try{return r+""}catch{}}return""}var xa=Bp,Np=Tn,Up=Rp,Cp=ge,Lp=xa,jp=/[\\^$.*+?()[\]{}|]/g,kp=/^\[object .+?Constructor\]$/,qp=Function.prototype,Vp=Object.prototype,Gp=qp.toString,Hp=Vp.hasOwnProperty,Wp=RegExp("^"+Gp.call(Hp).replace(jp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function zp(r){if(!Cp(r)||Up(r))return!1;var e=Np(r)?Wp:kp;return e.test(Lp(r))}var Xp=zp;function Yp(r,e){return r?.[e]}var Kp=Yp,Zp=Xp,Jp=Kp;function Qp(r,e){var t=Jp(r,e);return Zp(t)?t:void 0}var Te=Qp,eh=Te,rh=function(){try{var r=eh(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Fa=rh,Ra=Fa;function th(r,e,t){e=="__proto__"&&Ra?Ra(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Ma=th;function nh(r,e){return r===e||r!==r&&e!==e}var et=nh,ih=Ma,ah=et,oh=Object.prototype,uh=oh.hasOwnProperty;function sh(r,e,t){var n=r[e];(!(uh.call(r,e)&&ah(n,t))||t===void 0&&!(e in r))&&ih(r,e,t)}var Da=sh,fh=Da,ch=Ma;function lh(r,e,t,n){var i=!t;t||(t={});for(var a=-1,o=e.length;++a<o;){var s=e[a],f=n?n(t[s],r[s],s,t,r):void 0;f===void 0&&(f=r[s]),i?ch(t,s,f):fh(t,s,f)}return t}var Ge=lh;function ph(r){return r}var rt=ph;function hh(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}var dh=hh,yh=dh,Ba=Math.max;function vh(r,e,t){return e=Ba(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=Ba(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=t(o),yh(r,this,s)}}var Na=vh;function gh(r){return function(){return r}}var _h=gh,mh=_h,Ua=Fa,wh=rt,bh=Ua?function(r,e){return Ua(r,"toString",{configurable:!0,enumerable:!1,value:mh(e),writable:!0})}:wh,$h=bh,Eh=800,Ah=16,Oh=Date.now;function Sh(r){var e=0,t=0;return function(){var n=Oh(),i=Ah-(n-t);if(t=n,i>0){if(++e>=Eh)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var Th=Sh,Ph=$h,Ih=Th,xh=Ih(Ph),Ca=xh,Fh=rt,Rh=Na,Mh=Ca;function Dh(r,e){return Mh(Rh(r,e,Fh),r+"")}var Bh=Dh,Nh=9007199254740991;function Uh(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Nh}var In=Uh,Ch=Tn,Lh=In;function jh(r){return r!=null&&Lh(r.length)&&!Ch(r)}var lr=jh,kh=9007199254740991,qh=/^(?:0|[1-9]\d*)$/;function Vh(r,e){var t=typeof r;return e=e??kh,!!e&&(t=="number"||t!="symbol"&&qh.test(r))&&r>-1&&r%1==0&&r<e}var xn=Vh,Gh=et,Hh=lr,Wh=xn,zh=ge;function Xh(r,e,t){if(!zh(t))return!1;var n=typeof e;return(n=="number"?Hh(t)&&Wh(e,t.length):n=="string"&&e in t)?Gh(t[e],r):!1}var La=Xh,Yh=Bh,Kh=La;function Zh(r){return Yh(function(e,t){var n=-1,i=t.length,a=i>1?t[i-1]:void 0,o=i>2?t[2]:void 0;for(a=r.length>3&&typeof a=="function"?(i--,a):void 0,o&&Kh(t[0],t[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var s=t[n];s&&r(e,s,n,a)}return e})}var Jh=Zh;function Qh(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var ja=Qh,ed=se,rd=W,td="[object Arguments]";function nd(r){return rd(r)&&ed(r)==td}var id=nd,ka=id,ad=W,qa=Object.prototype,od=qa.hasOwnProperty,ud=qa.propertyIsEnumerable,sd=ka(function(){return arguments}())?ka:function(r){return ad(r)&&od.call(r,"callee")&&!ud.call(r,"callee")},Fn=sd,fd=Array.isArray,C=fd,pr={exports:{}};function cd(){return!1}var ld=cd;(function(r,e){var t=ee,n=ld,i=e&&!e.nodeType&&e,a=i&&!0&&r&&!r.nodeType&&r,o=a&&a.exports===i,s=o?t.Buffer:void 0,f=s?s.isBuffer:void 0,c=f||n;r.exports=c})(pr,pr.exports);var pd=se,hd=In,dd=W,yd="[object Arguments]",vd="[object Array]",gd="[object Boolean]",_d="[object Date]",md="[object Error]",wd="[object Function]",bd="[object Map]",$d="[object Number]",Ed="[object Object]",Ad="[object RegExp]",Od="[object Set]",Sd="[object String]",Td="[object WeakMap]",Pd="[object ArrayBuffer]",Id="[object DataView]",xd="[object Float32Array]",Fd="[object Float64Array]",Rd="[object Int8Array]",Md="[object Int16Array]",Dd="[object Int32Array]",Bd="[object Uint8Array]",Nd="[object Uint8ClampedArray]",Ud="[object Uint16Array]",Cd="[object Uint32Array]",F={};F[xd]=F[Fd]=F[Rd]=F[Md]=F[Dd]=F[Bd]=F[Nd]=F[Ud]=F[Cd]=!0,F[yd]=F[vd]=F[Pd]=F[gd]=F[Id]=F[_d]=F[md]=F[wd]=F[bd]=F[$d]=F[Ed]=F[Ad]=F[Od]=F[Sd]=F[Td]=!1;function Ld(r){return dd(r)&&hd(r.length)&&!!F[pd(r)]}var jd=Ld;function kd(r){return function(e){return r(e)}}var Rn=kd,hr={exports:{}};(function(r,e){var t=Ea,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a&&t.process,s=function(){try{var f=i&&i.require&&i.require("util").types;return f||o&&o.binding&&o.binding("util")}catch{}}();r.exports=s})(hr,hr.exports);var qd=jd,Vd=Rn,Va=hr.exports,Ga=Va&&Va.isTypedArray,Gd=Ga?Vd(Ga):qd,Ha=Gd,Hd=ja,Wd=Fn,zd=C,Xd=pr.exports,Yd=xn,Kd=Ha,Zd=Object.prototype,Jd=Zd.hasOwnProperty;function Qd(r,e){var t=zd(r),n=!t&&Wd(r),i=!t&&!n&&Xd(r),a=!t&&!n&&!i&&Kd(r),o=t||n||i||a,s=o?Hd(r.length,String):[],f=s.length;for(var c in r)(e||Jd.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Yd(c,f)))&&s.push(c);return s}var Wa=Qd,ey=Object.prototype;function ry(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||ey;return r===t}var Mn=ry;function ty(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var ny=ty,iy=ge,ay=Mn,oy=ny,uy=Object.prototype,sy=uy.hasOwnProperty;function fy(r){if(!iy(r))return oy(r);var e=ay(r),t=[];for(var n in r)n=="constructor"&&(e||!sy.call(r,n))||t.push(n);return t}var cy=fy,ly=Wa,py=cy,hy=lr;function dy(r){return hy(r)?ly(r,!0):py(r)}var tt=dy,yy=Ge,vy=Jh,gy=tt,_y=vy(function(r,e){yy(e,gy(e),r)}),my=_y;(function(r){r.exports=my})(Pa);var nt={},Pe={};function wy(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(!e(r[t],t,r))return!1;return!0}var by=wy;function $y(r){return function(e,t,n){for(var i=-1,a=Object(e),o=n(e),s=o.length;s--;){var f=o[r?s:++i];if(t(a[f],f,a)===!1)break}return e}}var Ey=$y,Ay=Ey,Oy=Ay(),Sy=Oy;function Ty(r,e){return function(t){return r(e(t))}}var za=Ty,Py=za,Iy=Py(Object.keys,Object),xy=Iy,Fy=Mn,Ry=xy,My=Object.prototype,Dy=My.hasOwnProperty;function By(r){if(!Fy(r))return Ry(r);var e=[];for(var t in Object(r))Dy.call(r,t)&&t!="constructor"&&e.push(t);return e}var Ny=By,Uy=Wa,Cy=Ny,Ly=lr;function jy(r){return Ly(r)?Uy(r):Cy(r)}var He=jy,ky=Sy,qy=He;function Vy(r,e){return r&&ky(r,e,qy)}var Gy=Vy,Hy=lr;function Wy(r,e){return function(t,n){if(t==null)return t;if(!Hy(t))return r(t,n);for(var i=t.length,a=e?i:-1,o=Object(t);(e?a--:++a<i)&&n(o[a],a,o)!==!1;);return t}}var zy=Wy,Xy=Gy,Yy=zy,Ky=Yy(Xy),Dn=Ky,Zy=Dn;function Jy(r,e){var t=!0;return Zy(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var Qy=Jy;function ev(){this.__data__=[],this.size=0}var rv=ev,tv=et;function nv(r,e){for(var t=r.length;t--;)if(tv(r[t][0],e))return t;return-1}var it=nv,iv=it,av=Array.prototype,ov=av.splice;function uv(r){var e=this.__data__,t=iv(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():ov.call(e,t,1),--this.size,!0}var sv=uv,fv=it;function cv(r){var e=this.__data__,t=fv(e,r);return t<0?void 0:e[t][1]}var lv=cv,pv=it;function hv(r){return pv(this.__data__,r)>-1}var dv=hv,yv=it;function vv(r,e){var t=this.__data__,n=yv(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var gv=vv,_v=rv,mv=sv,wv=lv,bv=dv,$v=gv;function We(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}We.prototype.clear=_v,We.prototype.delete=mv,We.prototype.get=wv,We.prototype.has=bv,We.prototype.set=$v;var at=We,Ev=at;function Av(){this.__data__=new Ev,this.size=0}var Ov=Av;function Sv(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var Tv=Sv;function Pv(r){return this.__data__.get(r)}var Iv=Pv;function xv(r){return this.__data__.has(r)}var Fv=xv,Rv=Te,Mv=ee,Dv=Rv(Mv,"Map"),Bn=Dv,Bv=Te,Nv=Bv(Object,"create"),ot=Nv,Xa=ot;function Uv(){this.__data__=Xa?Xa(null):{},this.size=0}var Cv=Uv;function Lv(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var jv=Lv,kv=ot,qv="__lodash_hash_undefined__",Vv=Object.prototype,Gv=Vv.hasOwnProperty;function Hv(r){var e=this.__data__;if(kv){var t=e[r];return t===qv?void 0:t}return Gv.call(e,r)?e[r]:void 0}var Wv=Hv,zv=ot,Xv=Object.prototype,Yv=Xv.hasOwnProperty;function Kv(r){var e=this.__data__;return zv?e[r]!==void 0:Yv.call(e,r)}var Zv=Kv,Jv=ot,Qv="__lodash_hash_undefined__";function eg(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Jv&&e===void 0?Qv:e,this}var rg=eg,tg=Cv,ng=jv,ig=Wv,ag=Zv,og=rg;function ze(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}ze.prototype.clear=tg,ze.prototype.delete=ng,ze.prototype.get=ig,ze.prototype.has=ag,ze.prototype.set=og;var ug=ze,Ya=ug,sg=at,fg=Bn;function cg(){this.size=0,this.__data__={hash:new Ya,map:new(fg||sg),string:new Ya}}var lg=cg;function pg(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var hg=pg,dg=hg;function yg(r,e){var t=r.__data__;return dg(e)?t[typeof e=="string"?"string":"hash"]:t.map}var ut=yg,vg=ut;function gg(r){var e=vg(this,r).delete(r);return this.size-=e?1:0,e}var _g=gg,mg=ut;function wg(r){return mg(this,r).get(r)}var bg=wg,$g=ut;function Eg(r){return $g(this,r).has(r)}var Ag=Eg,Og=ut;function Sg(r,e){var t=Og(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var Tg=Sg,Pg=lg,Ig=_g,xg=bg,Fg=Ag,Rg=Tg;function Xe(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}Xe.prototype.clear=Pg,Xe.prototype.delete=Ig,Xe.prototype.get=xg,Xe.prototype.has=Fg,Xe.prototype.set=Rg;var Nn=Xe,Mg=at,Dg=Bn,Bg=Nn,Ng=200;function Ug(r,e){var t=this.__data__;if(t instanceof Mg){var n=t.__data__;if(!Dg||n.length<Ng-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Bg(n)}return t.set(r,e),this.size=t.size,this}var Cg=Ug,Lg=at,jg=Ov,kg=Tv,qg=Iv,Vg=Fv,Gg=Cg;function Ye(r){var e=this.__data__=new Lg(r);this.size=e.size}Ye.prototype.clear=jg,Ye.prototype.delete=kg,Ye.prototype.get=qg,Ye.prototype.has=Vg,Ye.prototype.set=Gg;var Un=Ye,Hg="__lodash_hash_undefined__";function Wg(r){return this.__data__.set(r,Hg),this}var zg=Wg;function Xg(r){return this.__data__.has(r)}var Yg=Xg,Kg=Nn,Zg=zg,Jg=Yg;function st(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new Kg;++e<t;)this.add(r[e])}st.prototype.add=st.prototype.push=Zg,st.prototype.has=Jg;var Qg=st;function e_(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(e(r[t],t,r))return!0;return!1}var r_=e_;function t_(r,e){return r.has(e)}var n_=t_,i_=Qg,a_=r_,o_=n_,u_=1,s_=2;function f_(r,e,t,n,i,a){var o=t&u_,s=r.length,f=e.length;if(s!=f&&!(o&&f>s))return!1;var c=a.get(r),l=a.get(e);if(c&&l)return c==e&&l==r;var u=-1,p=!0,y=t&s_?new i_:void 0;for(a.set(r,e),a.set(e,r);++u<s;){var g=r[u],b=e[u];if(n)var E=o?n(b,g,u,e,r,a):n(g,b,u,r,e,a);if(E!==void 0){if(E)continue;p=!1;break}if(y){if(!a_(e,function(w,T){if(!o_(y,T)&&(g===w||i(g,w,t,n,a)))return y.push(T)})){p=!1;break}}else if(!(g===b||i(g,b,t,n,a))){p=!1;break}}return a.delete(r),a.delete(e),p}var Ka=f_,c_=ee,l_=c_.Uint8Array,Za=l_;function p_(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var h_=p_;function d_(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var y_=d_,Ja=Ve,Qa=Za,v_=et,g_=Ka,__=h_,m_=y_,w_=1,b_=2,$_="[object Boolean]",E_="[object Date]",A_="[object Error]",O_="[object Map]",S_="[object Number]",T_="[object RegExp]",P_="[object Set]",I_="[object String]",x_="[object Symbol]",F_="[object ArrayBuffer]",R_="[object DataView]",eo=Ja?Ja.prototype:void 0,Cn=eo?eo.valueOf:void 0;function M_(r,e,t,n,i,a,o){switch(t){case R_:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case F_:return!(r.byteLength!=e.byteLength||!a(new Qa(r),new Qa(e)));case $_:case E_:case S_:return v_(+r,+e);case A_:return r.name==e.name&&r.message==e.message;case T_:case I_:return r==e+"";case O_:var s=__;case P_:var f=n&w_;if(s||(s=m_),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=b_,o.set(r,e);var l=g_(s(r),s(e),n,i,a,o);return o.delete(r),l;case x_:if(Cn)return Cn.call(r)==Cn.call(e)}return!1}var D_=M_;function B_(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Ln=B_,N_=Ln,U_=C;function C_(r,e,t){var n=e(r);return U_(r)?n:N_(n,t(r))}var ro=C_;function L_(r,e){for(var t=-1,n=r==null?0:r.length,i=0,a=[];++t<n;){var o=r[t];e(o,t,r)&&(a[i++]=o)}return a}var j_=L_;function k_(){return[]}var to=k_,q_=j_,V_=to,G_=Object.prototype,H_=G_.propertyIsEnumerable,no=Object.getOwnPropertySymbols,W_=no?function(r){return r==null?[]:(r=Object(r),q_(no(r),function(e){return H_.call(r,e)}))}:V_,jn=W_,z_=ro,X_=jn,Y_=He;function K_(r){return z_(r,Y_,X_)}var io=K_,ao=io,Z_=1,J_=Object.prototype,Q_=J_.hasOwnProperty;function em(r,e,t,n,i,a){var o=t&Z_,s=ao(r),f=s.length,c=ao(e),l=c.length;if(f!=l&&!o)return!1;for(var u=f;u--;){var p=s[u];if(!(o?p in e:Q_.call(e,p)))return!1}var y=a.get(r),g=a.get(e);if(y&&g)return y==e&&g==r;var b=!0;a.set(r,e),a.set(e,r);for(var E=o;++u<f;){p=s[u];var w=r[p],T=e[p];if(n)var h=o?n(T,w,p,e,r,a):n(w,T,p,r,e,a);if(!(h===void 0?w===T||i(w,T,t,n,a):h)){b=!1;break}E||(E=p=="constructor")}if(b&&!E){var S=r.constructor,I=e.constructor;S!=I&&"constructor"in r&&"constructor"in e&&!(typeof S=="function"&&S instanceof S&&typeof I=="function"&&I instanceof I)&&(b=!1)}return a.delete(r),a.delete(e),b}var rm=em,tm=Te,nm=ee,im=tm(nm,"DataView"),am=im,om=Te,um=ee,sm=om(um,"Promise"),fm=sm,cm=Te,lm=ee,pm=cm(lm,"Set"),hm=pm,dm=Te,ym=ee,vm=dm(ym,"WeakMap"),gm=vm,kn=am,qn=Bn,Vn=fm,Gn=hm,Hn=gm,oo=se,Ke=xa,uo="[object Map]",_m="[object Object]",so="[object Promise]",fo="[object Set]",co="[object WeakMap]",lo="[object DataView]",mm=Ke(kn),wm=Ke(qn),bm=Ke(Vn),$m=Ke(Gn),Em=Ke(Hn),Ie=oo;(kn&&Ie(new kn(new ArrayBuffer(1)))!=lo||qn&&Ie(new qn)!=uo||Vn&&Ie(Vn.resolve())!=so||Gn&&Ie(new Gn)!=fo||Hn&&Ie(new Hn)!=co)&&(Ie=function(r){var e=oo(r),t=e==_m?r.constructor:void 0,n=t?Ke(t):"";if(n)switch(n){case mm:return lo;case wm:return uo;case bm:return so;case $m:return fo;case Em:return co}return e});var ft=Ie,Wn=Un,Am=Ka,Om=D_,Sm=rm,po=ft,ho=C,yo=pr.exports,Tm=Ha,Pm=1,vo="[object Arguments]",go="[object Array]",ct="[object Object]",Im=Object.prototype,_o=Im.hasOwnProperty;function xm(r,e,t,n,i,a){var o=ho(r),s=ho(e),f=o?go:po(r),c=s?go:po(e);f=f==vo?ct:f,c=c==vo?ct:c;var l=f==ct,u=c==ct,p=f==c;if(p&&yo(r)){if(!yo(e))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new Wn),o||Tm(r)?Am(r,e,t,n,i,a):Om(r,e,f,t,n,i,a);if(!(t&Pm)){var y=l&&_o.call(r,"__wrapped__"),g=u&&_o.call(e,"__wrapped__");if(y||g){var b=y?r.value():r,E=g?e.value():e;return a||(a=new Wn),i(b,E,t,n,a)}}return p?(a||(a=new Wn),Sm(r,e,t,n,i,a)):!1}var Fm=xm,Rm=Fm,mo=W;function wo(r,e,t,n,i){return r===e?!0:r==null||e==null||!mo(r)&&!mo(e)?r!==r&&e!==e:Rm(r,e,t,n,wo,i)}var bo=wo,Mm=Un,Dm=bo,Bm=1,Nm=2;function Um(r,e,t,n){var i=t.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var s=t[i];if(o&&s[2]?s[1]!==r[s[0]]:!(s[0]in r))return!1}for(;++i<a;){s=t[i];var f=s[0],c=r[f],l=s[1];if(o&&s[2]){if(c===void 0&&!(f in r))return!1}else{var u=new Mm;if(n)var p=n(c,l,f,r,e,u);if(!(p===void 0?Dm(l,c,Bm|Nm,n,u):p))return!1}}return!0}var Cm=Um,Lm=ge;function jm(r){return r===r&&!Lm(r)}var $o=jm,km=$o,qm=He;function Vm(r){for(var e=qm(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,km(i)]}return e}var Gm=Vm;function Hm(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var Eo=Hm,Wm=Cm,zm=Gm,Xm=Eo;function Ym(r){var e=zm(r);return e.length==1&&e[0][2]?Xm(e[0][0],e[0][1]):function(t){return t===r||Wm(t,r,e)}}var Km=Ym,Zm=se,Jm=W,Qm="[object Symbol]";function e0(r){return typeof r=="symbol"||Jm(r)&&Zm(r)==Qm}var lt=e0,r0=C,t0=lt,n0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i0=/^\w*$/;function a0(r,e){if(r0(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||t0(r)?!0:i0.test(r)||!n0.test(r)||e!=null&&r in Object(e)}var zn=a0,Ao=Nn,o0="Expected a function";function Xn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(o0);var t=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=t.cache;if(a.has(i))return a.get(i);var o=r.apply(this,n);return t.cache=a.set(i,o)||a,o};return t.cache=new(Xn.Cache||Ao),t}Xn.Cache=Ao;var u0=Xn,s0=u0,f0=500;function c0(r){var e=s0(r,function(n){return t.size===f0&&t.clear(),n}),t=e.cache;return e}var l0=c0,p0=l0,h0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,d0=/\\(\\)?/g,y0=p0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(h0,function(t,n,i,a){e.push(i?a.replace(d0,"$1"):n||t)}),e}),v0=y0;function g0(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}var pt=g0,Oo=Ve,_0=pt,m0=C,w0=lt,b0=1/0,So=Oo?Oo.prototype:void 0,To=So?So.toString:void 0;function Po(r){if(typeof r=="string")return r;if(m0(r))return _0(r,Po)+"";if(w0(r))return To?To.call(r):"";var e=r+"";return e=="0"&&1/r==-b0?"-0":e}var $0=Po,E0=$0;function A0(r){return r==null?"":E0(r)}var O0=A0,S0=C,T0=zn,P0=v0,I0=O0;function x0(r,e){return S0(r)?r:T0(r,e)?[r]:P0(I0(r))}var ht=x0,F0=lt,R0=1/0;function M0(r){if(typeof r=="string"||F0(r))return r;var e=r+"";return e=="0"&&1/r==-R0?"-0":e}var dr=M0,D0=ht,B0=dr;function N0(r,e){e=D0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[B0(e[t++])];return t&&t==n?r:void 0}var Yn=N0,U0=Yn;function C0(r,e,t){var n=r==null?void 0:U0(r,e);return n===void 0?t:n}var L0=C0;function j0(r,e){return r!=null&&e in Object(r)}var k0=j0,q0=ht,V0=Fn,G0=C,H0=xn,W0=In,z0=dr;function X0(r,e,t){e=q0(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=z0(e[n]);if(!(a=r!=null&&t(r,o)))break;r=r[o]}return a||++n!=i?a:(i=r==null?0:r.length,!!i&&W0(i)&&H0(o,i)&&(G0(r)||V0(r)))}var Y0=X0,K0=k0,Z0=Y0;function J0(r,e){return r!=null&&Z0(r,e,K0)}var Q0=J0,ew=bo,rw=L0,tw=Q0,nw=zn,iw=$o,aw=Eo,ow=dr,uw=1,sw=2;function fw(r,e){return nw(r)&&iw(e)?aw(ow(r),e):function(t){var n=rw(t,r);return n===void 0&&n===e?tw(t,r):ew(e,n,uw|sw)}}var cw=fw;function lw(r){return function(e){return e?.[r]}}var pw=lw,hw=Yn;function dw(r){return function(e){return hw(e,r)}}var yw=dw,vw=pw,gw=yw,_w=zn,mw=dr;function ww(r){return _w(r)?vw(mw(r)):gw(r)}var bw=ww,$w=Km,Ew=cw,Aw=rt,Ow=C,Sw=bw;function Tw(r){return typeof r=="function"?r:r==null?Aw:typeof r=="object"?Ow(r)?Ew(r[0],r[1]):$w(r):Sw(r)}var Io=Tw,Pw=by,Iw=Qy,xw=Io,Fw=C,Rw=La;function Mw(r,e,t){var n=Fw(r)?Pw:Iw;return t&&Rw(r,e,t)&&(e=void 0),n(r,xw(e))}var Kn=Mw;Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.calculatePadding=Uw,Pe.slicePadding=Cw;var Dw=Kn,Bw=Nw(Dw);function Nw(r){return r&&r.__esModule?r:{default:r}}function Uw(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function Cw(r,e){var t=r.slice(e),n=(0,Bw.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(nt,"__esModule",{value:!0}),nt.Cursor=void 0;var Lw=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),jw=Pe;function kw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Zn=function(){function r(e){kw(this,r),e instanceof d||(e=typeof e=="number"?d.alloc(e):d.from(e)),this._setBuffer(e),this.rewind()}return Lw(r,[{key:"_setBuffer",value:function(t){this._buffer=t,this.length=t.length}},{key:"buffer",value:function(){return this._buffer}},{key:"tap",value:function(t){return t(this),this}},{key:"clone",value:function(t){var n=new this.constructor(this.buffer());return n.seek(arguments.length===0?this.tell():t),n}},{key:"tell",value:function(){return this._index}},{key:"seek",value:function(t,n){return arguments.length===1&&(n=t,t="="),t==="+"?this._index+=n:t==="-"?this._index-=n:this._index=n,this}},{key:"rewind",value:function(){return this.seek(0)}},{key:"eof",value:function(){return this.tell()===this.buffer().length}},{key:"write",value:function(t,n,i){return this.seek("+",this.buffer().write(t,this.tell(),n,i))}},{key:"fill",value:function(t,n){return arguments.length===1&&(n=this.buffer().length-this.tell()),this.buffer().fill(t,this.tell(),this.tell()+n),this.seek("+",n),this}},{key:"slice",value:function(t){arguments.length===0&&(t=this.length-this.tell());var n=new this.constructor(this.buffer().slice(this.tell(),this.tell()+t));return this.seek("+",t),n}},{key:"copyFrom",value:function(t){var n=t instanceof d?t:t.buffer();return n.copy(this.buffer(),this.tell(),0,n.length),this.seek("+",n.length),this}},{key:"concat",value:function(t){t.forEach(function(i,a){i instanceof r&&(t[a]=i.buffer())}),t.unshift(this.buffer());var n=d.concat(t);return this._setBuffer(n),this}},{key:"toString",value:function(t,n){arguments.length===0?(t="utf8",n=this.buffer().length-this.tell()):arguments.length===1&&(n=this.buffer().length-this.tell());var i=this.buffer().toString(t,this.tell(),this.tell()+n);return this.seek("+",n),i}},{key:"writeBufferPadded",value:function(t){var n=(0,jw.calculatePadding)(t.length),i=d.alloc(n);return this.copyFrom(new r(t)).copyFrom(new r(i))}}]),r}();[[1,["readInt8","readUInt8"]],[2,["readInt16BE","readInt16LE","readUInt16BE","readUInt16LE"]],[4,["readInt32BE","readInt32LE","readUInt32BE","readUInt32LE","readFloatBE","readFloatLE"]],[8,["readDoubleBE","readDoubleLE"]]].forEach(function(r){r[1].forEach(function(e){Zn.prototype[e]=function(){var n=this.buffer()[e](this.tell());return this.seek("+",r[0]),n}})}),[[1,["writeInt8","writeUInt8"]],[2,["writeInt16BE","writeInt16LE","writeUInt16BE","writeUInt16LE"]],[4,["writeInt32BE","writeInt32LE","writeUInt32BE","writeUInt32LE","writeFloatBE","writeFloatLE"]],[8,["writeDoubleBE","writeDoubleLE"]]].forEach(function(r){r[1].forEach(function(e){Zn.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),nt.Cursor=Zn,Object.defineProperty(M,"__esModule",{value:!0}),M.default=Xw;var qw=Pa.exports,xo=Ro(qw),Vw=Tn,Gw=Ro(Vw),Fo=nt;function Ro(r){return r&&r.__esModule?r:{default:r}}var Hw=Math.pow(2,16),Ww={toXDR:function(e){var t=new Fo.Cursor(Hw);this.write(e,t);var n=t.tell();return t.rewind(),t.slice(n).buffer()},fromXDR:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw",n=void 0;switch(t){case"raw":n=e;break;case"hex":n=d.from(e,"hex");break;case"base64":n=d.from(e,"base64");break;default:throw new Error("Invalid format "+t+', must be "raw", "hex", "base64"')}var i=new Fo.Cursor(n),a=this.read(i);return a},validateXDR:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(e,t),!0}catch{return!1}}},zw={toXDR:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"raw",t=this.constructor.toXDR(this);switch(e){case"raw":return t;case"hex":return t.toString("hex");case"base64":return t.toString("base64");default:throw new Error("Invalid format "+e+', must be "raw", "hex", "base64"')}}};function Xw(r){(0,xo.default)(r,Ww),(0,Gw.default)(r)&&(0,xo.default)(r.prototype,zw)}Object.defineProperty(ue,"__esModule",{value:!0}),ue.Int=void 0;var Yw=Qr,Mo=Do(Yw),Kw=M,Zw=Do(Kw);function Do(r){return r&&r.__esModule?r:{default:r}}var yr=ue.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,Mo.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");t.writeInt32BE(e)},isValid:function(e){return!(0,Mo.default)(e)||Math.floor(e)!==e?!1:e>=yr.MIN_VALUE&&e<=yr.MAX_VALUE}};yr.MAX_VALUE=Math.pow(2,31)-1,yr.MIN_VALUE=-Math.pow(2,31),(0,Zw.default)(yr);var dt={};function Jw(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Jn={exports:{}};(function(r){/**
|
|
21
|
+
`)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function Kt(r){return Array.isArray(r)}function kr(r){return typeof r=="boolean"}function Je(r){return r===null}function ji(r){return r==null}function Zt(r){return typeof r=="number"}function Qe(r){return typeof r=="string"}function ki(r){return typeof r=="symbol"}function K(r){return r===void 0}function er(r){return Ae(r)&&Jt(r)==="[object RegExp]"}function Ae(r){return typeof r=="object"&&r!==null}function qr(r){return Ae(r)&&Jt(r)==="[object Date]"}function rr(r){return Ae(r)&&(Jt(r)==="[object Error]"||r instanceof Error)}function tr(r){return typeof r=="function"}function qi(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function Vi(r){return d.isBuffer(r)}function Jt(r){return Object.prototype.toString.call(r)}function Qt(r){return r<10?"0"+r.toString(10):r.toString(10)}var Gf=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Wf(){var r=new Date,e=[Qt(r.getHours()),Qt(r.getMinutes()),Qt(r.getSeconds())].join(":");return[r.getDate(),Gf[r.getMonth()],e].join(" ")}function Gi(){console.log("%s - %s",Wf(),Cr.apply(null,arguments))}function en(r,e){if(!e||!Ae(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function Wi(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Hf={inherits:Ci,_extend:en,log:Gi,isBuffer:Vi,isPrimitive:qi,isFunction:tr,isError:rr,isDate:qr,isObject:Ae,isRegExp:er,isUndefined:K,isSymbol:ki,isString:Qe,isNumber:Zt,isNullOrUndefined:ji,isNull:Je,isBoolean:kr,isArray:Kt,inspect:Y,deprecate:Ht,format:Cr,debuglog:Li},Xf=Object.freeze({__proto__:null,format:Cr,deprecate:Ht,debuglog:Li,inspect:Y,isArray:Kt,isBoolean:kr,isNull:Je,isNullOrUndefined:ji,isNumber:Zt,isString:Qe,isSymbol:ki,isUndefined:K,isRegExp:er,isObject:Ae,isDate:qr,isError:rr,isFunction:tr,isPrimitive:qi,isBuffer:Vi,log:Gi,inherits:Ci,_extend:en,default:Hf}),zf=Ye(Xf),Yf=zf.inspect,rn=typeof Map=="function"&&Map.prototype,tn=Object.getOwnPropertyDescriptor&&rn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Vr=rn&&tn&&typeof tn.get=="function"?tn.get:null,Kf=rn&&Map.prototype.forEach,nn=typeof Set=="function"&&Set.prototype,an=Object.getOwnPropertyDescriptor&&nn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Gr=nn&&an&&typeof an.get=="function"?an.get:null,Zf=nn&&Set.prototype.forEach,Jf=typeof WeakMap=="function"&&WeakMap.prototype,nr=Jf?WeakMap.prototype.has:null,Qf=typeof WeakSet=="function"&&WeakSet.prototype,ir=Qf?WeakSet.prototype.has:null,ec=typeof WeakRef=="function"&&WeakRef.prototype,Hi=ec?WeakRef.prototype.deref:null,rc=Boolean.prototype.valueOf,tc=Object.prototype.toString,nc=Function.prototype.toString,ic=String.prototype.match,on=String.prototype.slice,he=String.prototype.replace,ac=String.prototype.toUpperCase,Xi=String.prototype.toLowerCase,zi=RegExp.prototype.test,Yi=Array.prototype.concat,Z=Array.prototype.join,oc=Array.prototype.slice,Ki=Math.floor,un=typeof BigInt=="function"?BigInt.prototype.valueOf:null,sn=Object.getOwnPropertySymbols,fn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Le=typeof Symbol=="function"&&typeof Symbol.iterator=="object",j=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Le?"object":"symbol")?Symbol.toStringTag:null,Zi=Object.prototype.propertyIsEnumerable,Ji=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Qi(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||zi.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-Ki(-r):Ki(r);if(n!==r){var i=String(n),a=on.call(e,i.length+1);return he.call(i,t,"$&_")+"."+he.call(he.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return he.call(e,t,"$&_")}var cn=Yf,ea=cn.custom,ra=ia(ea)?ea:null,uc=function r(e,t,n,i){var a=t||{};if(de(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(de(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 o=de(a,"customInspect")?a.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(de(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(de(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=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 oa(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return s?Qi(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return s?Qi(e,c):c}var p=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=p&&p>0&&typeof e=="object")return ln(e)?"[Array]":"[Object]";var u=Oc(a,n);if(typeof i>"u")i=[];else if(aa(i,e)>=0)return"[Circular]";function l(ee,ge,fe){if(ge&&(i=oc.call(i),i.push(ge)),fe){var Tr={depth:a.depth};return de(a,"quoteStyle")&&(Tr.quoteStyle=a.quoteStyle),r(ee,Tr,n+1,i)}return r(ee,a,n+1,i)}if(typeof e=="function"&&!na(e)){var y=vc(e),_=Wr(e,l);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(_.length>0?" { "+Z.call(_,", ")+" }":"")}if(ia(e)){var E=Le?he.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):fn.call(e);return typeof e=="object"&&!Le?ar(E):E}if($c(e)){for(var $="<"+Xi.call(String(e.nodeName)),w=e.attributes||[],T=0;T<w.length;T++)$+=" "+w[T].name+"="+ta(sc(w[T].value),"double",a);return $+=">",e.childNodes&&e.childNodes.length&&($+="..."),$+="</"+Xi.call(String(e.nodeName))+">",$}if(ln(e)){if(e.length===0)return"[]";var h=Wr(e,l);return u&&!Ac(h)?"["+hn(h,u)+"]":"[ "+Z.call(h,", ")+" ]"}if(cc(e)){var S=Wr(e,l);return!("cause"in Error.prototype)&&"cause"in e&&!Zi.call(e,"cause")?"{ ["+String(e)+"] "+Z.call(Yi.call("[cause]: "+l(e.cause),S),", ")+" }":S.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Z.call(S,", ")+" }"}if(typeof e=="object"&&o){if(ra&&typeof e[ra]=="function"&&cn)return cn(e,{depth:p-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(gc(e)){var P=[];return Kf.call(e,function(ee,ge){P.push(l(ge,e,!0)+" => "+l(ee,e))}),ua("Map",Vr.call(e),P,u)}if(wc(e)){var R=[];return Zf.call(e,function(ee){R.push(l(ee,e))}),ua("Set",Gr.call(e),R,u)}if(_c(e))return pn("WeakMap");if(bc(e))return pn("WeakSet");if(mc(e))return pn("WeakRef");if(pc(e))return ar(l(Number(e)));if(dc(e))return ar(l(un.call(e)));if(hc(e))return ar(rc.call(e));if(lc(e))return ar(l(String(e)));if(!fc(e)&&!na(e)){var m=Wr(e,l),v=Ji?Ji(e)===Object.prototype:e instanceof Object||e.constructor===Object,g=e instanceof Object?"":"null prototype",b=!v&&j&&Object(e)===e&&j in e?on.call(ye(e),8,-1):g?"Object":"",O=v||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",C=O+(b||g?"["+Z.call(Yi.call([],b||[],g||[]),": ")+"] ":"");return m.length===0?C+"{}":u?C+"{"+hn(m,u)+"}":C+"{ "+Z.call(m,", ")+" }"}return String(e)};function ta(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function sc(r){return he.call(String(r),/"/g,""")}function ln(r){return ye(r)==="[object Array]"&&(!j||!(typeof r=="object"&&j in r))}function fc(r){return ye(r)==="[object Date]"&&(!j||!(typeof r=="object"&&j in r))}function na(r){return ye(r)==="[object RegExp]"&&(!j||!(typeof r=="object"&&j in r))}function cc(r){return ye(r)==="[object Error]"&&(!j||!(typeof r=="object"&&j in r))}function lc(r){return ye(r)==="[object String]"&&(!j||!(typeof r=="object"&&j in r))}function pc(r){return ye(r)==="[object Number]"&&(!j||!(typeof r=="object"&&j in r))}function hc(r){return ye(r)==="[object Boolean]"&&(!j||!(typeof r=="object"&&j in r))}function ia(r){if(Le)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!fn)return!1;try{return fn.call(r),!0}catch{}return!1}function dc(r){if(!r||typeof r!="object"||!un)return!1;try{return un.call(r),!0}catch{}return!1}var yc=Object.prototype.hasOwnProperty||function(r){return r in this};function de(r,e){return yc.call(r,e)}function ye(r){return tc.call(r)}function vc(r){if(r.name)return r.name;var e=ic.call(nc.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function aa(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,n=r.length;t<n;t++)if(r[t]===e)return t;return-1}function gc(r){if(!Vr||!r||typeof r!="object")return!1;try{Vr.call(r);try{Gr.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function _c(r){if(!nr||!r||typeof r!="object")return!1;try{nr.call(r,nr);try{ir.call(r,ir)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function mc(r){if(!Hi||!r||typeof r!="object")return!1;try{return Hi.call(r),!0}catch{}return!1}function wc(r){if(!Gr||!r||typeof r!="object")return!1;try{Gr.call(r);try{Vr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function bc(r){if(!ir||!r||typeof r!="object")return!1;try{ir.call(r,ir);try{nr.call(r,nr)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function $c(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function oa(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return oa(on.call(r,0,e.maxStringLength),e)+n}var i=he.call(he.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Ec);return ta(i,"single",e)}function Ec(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+ac.call(e.toString(16))}function ar(r){return"Object("+r+")"}function pn(r){return r+" { ? }"}function ua(r,e,t,n){var i=n?hn(t,n):Z.call(t,", ");return r+" ("+e+") {"+i+"}"}function Ac(r){for(var e=0;e<r.length;e++)if(aa(r[e],`
|
|
22
|
+
`)>=0)return!1;return!0}function Oc(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=Z.call(Array(r.indent+1)," ");else return null;return{base:t,prev:Z.call(Array(e+1),t)}}function hn(r,e){if(r.length===0)return"";var t=`
|
|
23
|
+
`+e.prev+e.base;return t+Z.call(r,","+t)+`
|
|
24
|
+
`+e.prev}function Wr(r,e){var t=ln(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=de(r,i)?e(r[i],r):""}var a=typeof sn=="function"?sn(r):[],o;if(Le){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var f in r)!de(r,f)||t&&String(Number(f))===f&&f<r.length||Le&&o["$"+f]instanceof Symbol||(zi.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r)));if(typeof sn=="function")for(var c=0;c<a.length;c++)Zi.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var dn=jt,je=Fs,Sc=uc,Tc=dn("%TypeError%"),Hr=dn("%WeakMap%",!0),Xr=dn("%Map%",!0),Ic=je("WeakMap.prototype.get",!0),Pc=je("WeakMap.prototype.set",!0),xc=je("WeakMap.prototype.has",!0),Fc=je("Map.prototype.get",!0),Rc=je("Map.prototype.set",!0),Mc=je("Map.prototype.has",!0),yn=function(r,e){for(var t=r,n;(n=t.next)!==null;t=n)if(n.key===e)return t.next=n.next,n.next=r.next,r.next=n,n},Bc=function(r,e){var t=yn(r,e);return t&&t.value},Dc=function(r,e,t){var n=yn(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},Uc=function(r,e){return!!yn(r,e)},Nc=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new Tc("Side channel does not contain "+Sc(a))},get:function(a){if(Hr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Ic(e,a)}else if(Xr){if(t)return Fc(t,a)}else if(n)return Bc(n,a)},has:function(a){if(Hr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return xc(e,a)}else if(Xr){if(t)return Mc(t,a)}else if(n)return Uc(n,a);return!1},set:function(a,o){Hr&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new Hr),Pc(e,a,o)):Xr?(t||(t=new Xr),Rc(t,a,o)):(n||(n={key:{},next:null}),Dc(n,a,o))}};return i},Cc=String.prototype.replace,Lc=/%20/g,vn={RFC1738:"RFC1738",RFC3986:"RFC3986"},sa={default:vn.RFC3986,formatters:{RFC1738:function(r){return Cc.call(r,Lc,"+")},RFC3986:function(r){return String(r)}},RFC1738:vn.RFC1738,RFC3986:vn.RFC3986},jc=sa,gn=Object.prototype.hasOwnProperty,Oe=Array.isArray,J=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),kc=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Oe(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},fa=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},qc=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Oe(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!gn.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var i=e;return Oe(e)&&!Oe(t)&&(i=fa(e,n)),Oe(e)&&Oe(t)?(t.forEach(function(a,o){if(gn.call(e,o)){var s=e[o];s&&typeof s=="object"&&a&&typeof a=="object"?e[o]=r(s,a,n):e.push(a)}else e[o]=a}),e):Object.keys(t).reduce(function(a,o){var s=t[o];return gn.call(a,o)?a[o]=r(a[o],s,n):a[o]=s,a},i)},Vc=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},Gc=function(r,e,t){var n=r.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Wc=function(e,t,n,i,a){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(p){return"%26%23"+parseInt(p.slice(2),16)+"%3B"});for(var s="",f=0;f<o.length;++f){var c=o.charCodeAt(f);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||a===jc.RFC1738&&(c===40||c===41)){s+=o.charAt(f);continue}if(c<128){s=s+J[c];continue}if(c<2048){s=s+(J[192|c>>6]+J[128|c&63]);continue}if(c<55296||c>=57344){s=s+(J[224|c>>12]+J[128|c>>6&63]+J[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),s+=J[240|c>>18]+J[128|c>>12&63]+J[128|c>>6&63]+J[128|c&63]}return s},Hc=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i<t.length;++i)for(var a=t[i],o=a.obj[a.prop],s=Object.keys(o),f=0;f<s.length;++f){var c=s[f],p=o[c];typeof p=="object"&&p!==null&&n.indexOf(p)===-1&&(t.push({obj:o,prop:c}),n.push(p))}return kc(t),e},Xc=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},zc=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Yc=function(e,t){return[].concat(e,t)},Kc=function(e,t){if(Oe(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},Zc={arrayToObject:fa,assign:Vc,combine:Yc,compact:Hc,decode:Gc,encode:Wc,isBuffer:zc,isRegExp:Xc,maybeMap:Kc,merge:qc},ca=Nc,_n=Zc,or=sa,Jc=Object.prototype.hasOwnProperty,la={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},ie=Array.isArray,Qc=String.prototype.split,el=Array.prototype.push,pa=function(r,e){el.apply(r,ie(e)?e:[e])},rl=Date.prototype.toISOString,ha=or.default,U={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:_n.encode,encodeValuesOnly:!1,format:ha,formatter:or.formatters[ha],indices:!1,serializeDate:function(e){return rl.call(e)},skipNulls:!1,strictNullHandling:!1},tl=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},mn={},nl=function r(e,t,n,i,a,o,s,f,c,p,u,l,y,_,E,$){for(var w=e,T=$,h=0,S=!1;(T=T.get(mn))!==void 0&&!S;){var P=T.get(e);if(h+=1,typeof P<"u"){if(P===h)throw new RangeError("Cyclic object value");S=!0}typeof T.get(mn)>"u"&&(h=0)}if(typeof f=="function"?w=f(t,w):w instanceof Date?w=u(w):n==="comma"&&ie(w)&&(w=_n.maybeMap(w,function(ii){return ii instanceof Date?u(ii):ii})),w===null){if(a)return s&&!_?s(t,U.encoder,E,"key",l):t;w=""}if(tl(w)||_n.isBuffer(w)){if(s){var R=_?t:s(t,U.encoder,E,"key",l);if(n==="comma"&&_){for(var m=Qc.call(String(w),","),v="",g=0;g<m.length;++g)v+=(g===0?"":",")+y(s(m[g],U.encoder,E,"value",l));return[y(R)+(i&&ie(w)&&m.length===1?"[]":"")+"="+v]}return[y(R)+"="+y(s(w,U.encoder,E,"value",l))]}return[y(t)+"="+y(String(w))]}var b=[];if(typeof w>"u")return b;var O;if(n==="comma"&&ie(w))O=[{value:w.length>0?w.join(",")||null:void 0}];else if(ie(f))O=f;else{var C=Object.keys(w);O=c?C.sort(c):C}for(var ee=i&&ie(w)&&w.length===1?t+"[]":t,ge=0;ge<O.length;++ge){var fe=O[ge],Tr=typeof fe=="object"&&typeof fe.value<"u"?fe.value:w[fe];if(!(o&&Tr===null)){var B2=ie(w)?typeof n=="function"?n(ee,fe):ee:ee+(p?"."+fe:"["+fe+"]");$.set(e,h);var Ju=ca();Ju.set(mn,$),pa(b,r(Tr,B2,n,i,a,o,s,f,c,p,u,l,y,_,E,Ju))}}return b},il=function(e){if(!e)return U;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||U.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=or.default;if(typeof e.format<"u"){if(!Jc.call(or.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=or.formatters[n],a=U.filter;return(typeof e.filter=="function"||ie(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:U.addQueryPrefix,allowDots:typeof e.allowDots>"u"?U.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:U.charsetSentinel,delimiter:typeof e.delimiter>"u"?U.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:U.encode,encoder:typeof e.encoder=="function"?e.encoder:U.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:U.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:U.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:U.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:U.strictNullHandling}},al=function(r,e){var t=r,n=il(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):ie(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var s;e&&e.arrayFormat in la?s=e.arrayFormat:e&&"indices"in e?s=e.indices?"indices":"repeat":s="indices";var f=la[s];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=f==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var p=ca(),u=0;u<i.length;++u){var l=i[u];n.skipNulls&&t[l]===null||pa(o,nl(t[l],l,f,c,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,p))}var y=o.join(n.delimiter),_=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),y.length>0?_+y:""};let da={storeIdentifier:"",environment:"prod"};function ol(r){da=r}function ae(){return da}const ul=r=>r==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",wn=r=>r==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",sl=r=>r==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",fl="/tools/recurring";class zr{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}var cl=Object.defineProperty,ll=Object.defineProperties,pl=Object.getOwnPropertyDescriptors,ya=Object.getOwnPropertySymbols,hl=Object.prototype.hasOwnProperty,dl=Object.prototype.propertyIsEnumerable,va=(r,e,t)=>e in r?cl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Yr=(r,e)=>{for(var t in e||(e={}))hl.call(e,t)&&va(r,t,e[t]);if(ya)for(var t of ya(e))dl.call(e,t)&&va(r,t,e[t]);return r},yl=(r,e)=>ll(r,pl(e));function vl(r){return al(r,{encode:!1,indices:!1,arrayFormat:"comma"})}async function Kr(r,e,t={}){const n=ae();return G(r,`${sl(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function A(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:s,storeIdentifier:f,loginRetryFn:c}=ae(),p=o.apiToken,u=ul(s),l=Yr({"X-Recharge-Access-Token":p,"X-Recharge-Version":"2021-11"},a||{}),y=Yr({shop_url:f},n);try{return await G(r,`${u}${e}`,{id:t,query:y,data:i,headers:l})}catch(_){if(c&&_ instanceof zr&&_.status===401)return c().then(E=>{if(E)return G(r,`${u}${e}`,{id:t,query:y,data:i,headers:yl(Yr({},l),{"X-Recharge-Access-Token":E.apiToken})});throw _});throw _}}async function ur(r,e,t={}){return G(r,`${fl}${e}`,t)}async function G(r,e,{id:t,query:n,data:i,headers:a}={}){let o=e.trim();if(t&&(o=[o,`${t}`.trim()].join("/")),n){let u;[o,u]=o.split("?");const l=[u,vl(n)].join("&").replace(/^&/,"");o=`${o}${l?`?${l}`:""}`}let s;i&&r!=="get"&&(s=JSON.stringify(i));const f=Yr({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},a||{}),c=await fetch(o,{method:r,headers:f,body:s,mode:"cors"});let p;try{p=await c.json()}catch{}if(!c.ok)throw p&&p.error?new zr(p.error,c.status):p&&p.errors?new zr(JSON.stringify(p.errors),c.status):new zr("A connection error occurred while making the request");return p}function gl(r,e){return A("get","/addresses",{query:e},r)}async function _l(r,e,t){const{address:n}=await A("get","/addresses",{id:e,query:{include:t?.include}},r);return n}async function ml(r,e){const{address:t}=await A("post","/addresses",{data:e},r);return t}async function bn(r,e,t){const{address:n}=await A("put","/addresses",{id:e,data:t},r);return n}async function wl(r,e,t){return bn(r,e,{discounts:[{code:t}]})}async function bl(r,e){return bn(r,e,{discounts:[]})}function $l(r,e){return A("delete","/addresses",{id:e},r)}async function El(r,e){const{address:t}=await A("post","/addresses/merge",{data:e},r);return t}async function Al(r,e,t){const{charge:n}=await A("post",`/addresses/${e}/charges/skip`,{data:t},r);return n}var Ol=Object.freeze({__proto__:null,listAddresses:gl,getAddress:_l,createAddress:ml,updateAddress:bn,applyDiscountToAddress:wl,removeDiscountsFromAddress:bl,deleteAddress:$l,mergeAddresses:El,skipFutureCharge:Al});async function Sl(){const{storefrontAccessToken:r}=ae(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await ur("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id}}async function Tl(r,e){const{environment:t,storefrontAccessToken:n,storeIdentifier:i}=ae(),a=wn(t),o={};n&&(o["X-Recharge-Storefront-Access-Token"]=n);const s=await G("post",`${a}/shopify_storefront_access`,{data:{customer_token:e,storefront_token:r,shop_url:i},headers:o});return s.api_token?{apiToken:s.api_token,customerId:s.customer_id}:null}async function Il(r){const{environment:e,storefrontAccessToken:t,storeIdentifier:n}=ae(),i=wn(e),a={};t&&(a["X-Recharge-Storefront-Access-Token"]=t);const o=await G("post",`${i}/attempt_login`,{data:{email:r,shop:n},headers:a});if(o.errors)throw new Error(o.errors);return o.session_token}async function Pl(r){const{storefrontAccessToken:e,storeIdentifier:t}=ae(),n={};e&&(n["X-Recharge-Storefront-Access-Token"]=e);const i=await ur("post","/attempt_login",{data:{email:r,shop:t},headers:n});if(i.errors)throw new Error(i.errors);return i.session_token}async function xl(r,e,t){const{environment:n,storefrontAccessToken:i,storeIdentifier:a}=ae(),o=wn(n),s={};i&&(s["X-Recharge-Storefront-Access-Token"]=i);const f=await G("post",`${o}/validate_login`,{data:{code:t,email:r,session_token:e,shop:a},headers:s});if(f.errors)throw new Error(f.errors);return{apiToken:f.api_token,customerId:f.customer_id}}async function Fl(r,e,t){const{storefrontAccessToken:n,storeIdentifier:i}=ae(),a={};n&&(a["X-Recharge-Storefront-Access-Token"]=n);const o=await ur("post","/validate_login",{data:{code:t,email:r,session_token:e,shop:i},headers:a});if(o.errors)throw new Error(o.errors);return{apiToken:o.api_token,customerId:o.customer_id}}var Rl=Object.freeze({__proto__:null,loginShopifyAppProxy:Sl,loginShopifyApi:Tl,sendPasswordlessCode:Il,sendPasswordlessCodeAppProxy:Pl,validatePasswordlessCode:xl,validatePasswordlessCodeAppProxy:Fl}),ga={},$n={},oe={},Ml=typeof re=="object"&&re&&re.Object===Object&&re,_a=Ml,Bl=_a,Dl=typeof self=="object"&&self&&self.Object===Object&&self,Ul=Bl||Dl||Function("return this")(),Q=Ul,Nl=Q,Cl=Nl.Symbol,ke=Cl,ma=ke,wa=Object.prototype,Ll=wa.hasOwnProperty,jl=wa.toString,sr=ma?ma.toStringTag:void 0;function kl(r){var e=Ll.call(r,sr),t=r[sr];try{r[sr]=void 0;var n=!0}catch{}var i=jl.call(r);return n&&(e?r[sr]=t:delete r[sr]),i}var ql=kl,Vl=Object.prototype,Gl=Vl.toString;function Wl(r){return Gl.call(r)}var Hl=Wl,ba=ke,Xl=ql,zl=Hl,Yl="[object Null]",Kl="[object Undefined]",$a=ba?ba.toStringTag:void 0;function Zl(r){return r==null?r===void 0?Kl:Yl:$a&&$a in Object(r)?Xl(r):zl(r)}var ue=Zl;function Jl(r){return r!=null&&typeof r=="object"}var W=Jl,Ql=ue,ep=W,rp="[object Number]";function tp(r){return typeof r=="number"||ep(r)&&Ql(r)==rp}var Zr=tp,M={},Ea={exports:{}};function np(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var ve=np,ip=ue,ap=ve,op="[object AsyncFunction]",up="[object Function]",sp="[object GeneratorFunction]",fp="[object Proxy]";function cp(r){if(!ap(r))return!1;var e=ip(r);return e==up||e==sp||e==op||e==fp}var En=cp,lp=Q,pp=lp["__core-js_shared__"],hp=pp,An=hp,Aa=function(){var r=/[^.]+$/.exec(An&&An.keys&&An.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function dp(r){return!!Aa&&Aa in r}var yp=dp,vp=Function.prototype,gp=vp.toString;function _p(r){if(r!=null){try{return gp.call(r)}catch{}try{return r+""}catch{}}return""}var Oa=_p,mp=En,wp=yp,bp=ve,$p=Oa,Ep=/[\\^$.*+?()[\]{}|]/g,Ap=/^\[object .+?Constructor\]$/,Op=Function.prototype,Sp=Object.prototype,Tp=Op.toString,Ip=Sp.hasOwnProperty,Pp=RegExp("^"+Tp.call(Ip).replace(Ep,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function xp(r){if(!bp(r)||wp(r))return!1;var e=mp(r)?Pp:Ap;return e.test($p(r))}var Fp=xp;function Rp(r,e){return r?.[e]}var Mp=Rp,Bp=Fp,Dp=Mp;function Up(r,e){var t=Dp(r,e);return Bp(t)?t:void 0}var Se=Up,Np=Se,Cp=function(){try{var r=Np(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Sa=Cp,Ta=Sa;function Lp(r,e,t){e=="__proto__"&&Ta?Ta(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Ia=Lp;function jp(r,e){return r===e||r!==r&&e!==e}var Jr=jp,kp=Ia,qp=Jr,Vp=Object.prototype,Gp=Vp.hasOwnProperty;function Wp(r,e,t){var n=r[e];(!(Gp.call(r,e)&&qp(n,t))||t===void 0&&!(e in r))&&kp(r,e,t)}var Pa=Wp,Hp=Pa,Xp=Ia;function zp(r,e,t,n){var i=!t;t||(t={});for(var a=-1,o=e.length;++a<o;){var s=e[a],f=n?n(t[s],r[s],s,t,r):void 0;f===void 0&&(f=r[s]),i?Xp(t,s,f):Hp(t,s,f)}return t}var qe=zp;function Yp(r){return r}var Qr=Yp;function Kp(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}var Zp=Kp,Jp=Zp,xa=Math.max;function Qp(r,e,t){return e=xa(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=xa(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=t(o),Jp(r,this,s)}}var Fa=Qp;function eh(r){return function(){return r}}var rh=eh,th=rh,Ra=Sa,nh=Qr,ih=Ra?function(r,e){return Ra(r,"toString",{configurable:!0,enumerable:!1,value:th(e),writable:!0})}:nh,ah=ih,oh=800,uh=16,sh=Date.now;function fh(r){var e=0,t=0;return function(){var n=sh(),i=uh-(n-t);if(t=n,i>0){if(++e>=oh)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var ch=fh,lh=ah,ph=ch,hh=ph(lh),Ma=hh,dh=Qr,yh=Fa,vh=Ma;function gh(r,e){return vh(yh(r,e,dh),r+"")}var _h=gh,mh=9007199254740991;function wh(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=mh}var On=wh,bh=En,$h=On;function Eh(r){return r!=null&&$h(r.length)&&!bh(r)}var fr=Eh,Ah=9007199254740991,Oh=/^(?:0|[1-9]\d*)$/;function Sh(r,e){var t=typeof r;return e=e??Ah,!!e&&(t=="number"||t!="symbol"&&Oh.test(r))&&r>-1&&r%1==0&&r<e}var Sn=Sh,Th=Jr,Ih=fr,Ph=Sn,xh=ve;function Fh(r,e,t){if(!xh(t))return!1;var n=typeof e;return(n=="number"?Ih(t)&&Ph(e,t.length):n=="string"&&e in t)?Th(t[e],r):!1}var Ba=Fh,Rh=_h,Mh=Ba;function Bh(r){return Rh(function(e,t){var n=-1,i=t.length,a=i>1?t[i-1]:void 0,o=i>2?t[2]:void 0;for(a=r.length>3&&typeof a=="function"?(i--,a):void 0,o&&Mh(t[0],t[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var s=t[n];s&&r(e,s,n,a)}return e})}var Dh=Bh;function Uh(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var Da=Uh,Nh=ue,Ch=W,Lh="[object Arguments]";function jh(r){return Ch(r)&&Nh(r)==Lh}var kh=jh,Ua=kh,qh=W,Na=Object.prototype,Vh=Na.hasOwnProperty,Gh=Na.propertyIsEnumerable,Wh=Ua(function(){return arguments}())?Ua:function(r){return qh(r)&&Vh.call(r,"callee")&&!Gh.call(r,"callee")},Tn=Wh,Hh=Array.isArray,N=Hh,cr={exports:{}};function Xh(){return!1}var zh=Xh;(function(r,e){var t=Q,n=zh,i=e&&!e.nodeType&&e,a=i&&!0&&r&&!r.nodeType&&r,o=a&&a.exports===i,s=o?t.Buffer:void 0,f=s?s.isBuffer:void 0,c=f||n;r.exports=c})(cr,cr.exports);var Yh=ue,Kh=On,Zh=W,Jh="[object Arguments]",Qh="[object Array]",ed="[object Boolean]",rd="[object Date]",td="[object Error]",nd="[object Function]",id="[object Map]",ad="[object Number]",od="[object Object]",ud="[object RegExp]",sd="[object Set]",fd="[object String]",cd="[object WeakMap]",ld="[object ArrayBuffer]",pd="[object DataView]",hd="[object Float32Array]",dd="[object Float64Array]",yd="[object Int8Array]",vd="[object Int16Array]",gd="[object Int32Array]",_d="[object Uint8Array]",md="[object Uint8ClampedArray]",wd="[object Uint16Array]",bd="[object Uint32Array]",F={};F[hd]=F[dd]=F[yd]=F[vd]=F[gd]=F[_d]=F[md]=F[wd]=F[bd]=!0,F[Jh]=F[Qh]=F[ld]=F[ed]=F[pd]=F[rd]=F[td]=F[nd]=F[id]=F[ad]=F[od]=F[ud]=F[sd]=F[fd]=F[cd]=!1;function $d(r){return Zh(r)&&Kh(r.length)&&!!F[Yh(r)]}var Ed=$d;function Ad(r){return function(e){return r(e)}}var In=Ad,lr={exports:{}};(function(r,e){var t=_a,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a&&t.process,s=function(){try{var f=i&&i.require&&i.require("util").types;return f||o&&o.binding&&o.binding("util")}catch{}}();r.exports=s})(lr,lr.exports);var Od=Ed,Sd=In,Ca=lr.exports,La=Ca&&Ca.isTypedArray,Td=La?Sd(La):Od,ja=Td,Id=Da,Pd=Tn,xd=N,Fd=cr.exports,Rd=Sn,Md=ja,Bd=Object.prototype,Dd=Bd.hasOwnProperty;function Ud(r,e){var t=xd(r),n=!t&&Pd(r),i=!t&&!n&&Fd(r),a=!t&&!n&&!i&&Md(r),o=t||n||i||a,s=o?Id(r.length,String):[],f=s.length;for(var c in r)(e||Dd.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Rd(c,f)))&&s.push(c);return s}var ka=Ud,Nd=Object.prototype;function Cd(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Nd;return r===t}var Pn=Cd;function Ld(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var jd=Ld,kd=ve,qd=Pn,Vd=jd,Gd=Object.prototype,Wd=Gd.hasOwnProperty;function Hd(r){if(!kd(r))return Vd(r);var e=qd(r),t=[];for(var n in r)n=="constructor"&&(e||!Wd.call(r,n))||t.push(n);return t}var Xd=Hd,zd=ka,Yd=Xd,Kd=fr;function Zd(r){return Kd(r)?zd(r,!0):Yd(r)}var et=Zd,Jd=qe,Qd=Dh,ey=et,ry=Qd(function(r,e){Jd(e,ey(e),r)}),ty=ry;(function(r){r.exports=ty})(Ea);var rt={},Te={};function ny(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(!e(r[t],t,r))return!1;return!0}var iy=ny;function ay(r){return function(e,t,n){for(var i=-1,a=Object(e),o=n(e),s=o.length;s--;){var f=o[r?s:++i];if(t(a[f],f,a)===!1)break}return e}}var oy=ay,uy=oy,sy=uy(),fy=sy;function cy(r,e){return function(t){return r(e(t))}}var qa=cy,ly=qa,py=ly(Object.keys,Object),hy=py,dy=Pn,yy=hy,vy=Object.prototype,gy=vy.hasOwnProperty;function _y(r){if(!dy(r))return yy(r);var e=[];for(var t in Object(r))gy.call(r,t)&&t!="constructor"&&e.push(t);return e}var my=_y,wy=ka,by=my,$y=fr;function Ey(r){return $y(r)?wy(r):by(r)}var Ve=Ey,Ay=fy,Oy=Ve;function Sy(r,e){return r&&Ay(r,e,Oy)}var Ty=Sy,Iy=fr;function Py(r,e){return function(t,n){if(t==null)return t;if(!Iy(t))return r(t,n);for(var i=t.length,a=e?i:-1,o=Object(t);(e?a--:++a<i)&&n(o[a],a,o)!==!1;);return t}}var xy=Py,Fy=Ty,Ry=xy,My=Ry(Fy),xn=My,By=xn;function Dy(r,e){var t=!0;return By(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var Uy=Dy;function Ny(){this.__data__=[],this.size=0}var Cy=Ny,Ly=Jr;function jy(r,e){for(var t=r.length;t--;)if(Ly(r[t][0],e))return t;return-1}var tt=jy,ky=tt,qy=Array.prototype,Vy=qy.splice;function Gy(r){var e=this.__data__,t=ky(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Vy.call(e,t,1),--this.size,!0}var Wy=Gy,Hy=tt;function Xy(r){var e=this.__data__,t=Hy(e,r);return t<0?void 0:e[t][1]}var zy=Xy,Yy=tt;function Ky(r){return Yy(this.__data__,r)>-1}var Zy=Ky,Jy=tt;function Qy(r,e){var t=this.__data__,n=Jy(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var ev=Qy,rv=Cy,tv=Wy,nv=zy,iv=Zy,av=ev;function Ge(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}Ge.prototype.clear=rv,Ge.prototype.delete=tv,Ge.prototype.get=nv,Ge.prototype.has=iv,Ge.prototype.set=av;var nt=Ge,ov=nt;function uv(){this.__data__=new ov,this.size=0}var sv=uv;function fv(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var cv=fv;function lv(r){return this.__data__.get(r)}var pv=lv;function hv(r){return this.__data__.has(r)}var dv=hv,yv=Se,vv=Q,gv=yv(vv,"Map"),Fn=gv,_v=Se,mv=_v(Object,"create"),it=mv,Va=it;function wv(){this.__data__=Va?Va(null):{},this.size=0}var bv=wv;function $v(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var Ev=$v,Av=it,Ov="__lodash_hash_undefined__",Sv=Object.prototype,Tv=Sv.hasOwnProperty;function Iv(r){var e=this.__data__;if(Av){var t=e[r];return t===Ov?void 0:t}return Tv.call(e,r)?e[r]:void 0}var Pv=Iv,xv=it,Fv=Object.prototype,Rv=Fv.hasOwnProperty;function Mv(r){var e=this.__data__;return xv?e[r]!==void 0:Rv.call(e,r)}var Bv=Mv,Dv=it,Uv="__lodash_hash_undefined__";function Nv(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Dv&&e===void 0?Uv:e,this}var Cv=Nv,Lv=bv,jv=Ev,kv=Pv,qv=Bv,Vv=Cv;function We(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}We.prototype.clear=Lv,We.prototype.delete=jv,We.prototype.get=kv,We.prototype.has=qv,We.prototype.set=Vv;var Gv=We,Ga=Gv,Wv=nt,Hv=Fn;function Xv(){this.size=0,this.__data__={hash:new Ga,map:new(Hv||Wv),string:new Ga}}var zv=Xv;function Yv(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var Kv=Yv,Zv=Kv;function Jv(r,e){var t=r.__data__;return Zv(e)?t[typeof e=="string"?"string":"hash"]:t.map}var at=Jv,Qv=at;function eg(r){var e=Qv(this,r).delete(r);return this.size-=e?1:0,e}var rg=eg,tg=at;function ng(r){return tg(this,r).get(r)}var ig=ng,ag=at;function og(r){return ag(this,r).has(r)}var ug=og,sg=at;function fg(r,e){var t=sg(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var cg=fg,lg=zv,pg=rg,hg=ig,dg=ug,yg=cg;function He(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}He.prototype.clear=lg,He.prototype.delete=pg,He.prototype.get=hg,He.prototype.has=dg,He.prototype.set=yg;var Rn=He,vg=nt,gg=Fn,_g=Rn,mg=200;function wg(r,e){var t=this.__data__;if(t instanceof vg){var n=t.__data__;if(!gg||n.length<mg-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new _g(n)}return t.set(r,e),this.size=t.size,this}var bg=wg,$g=nt,Eg=sv,Ag=cv,Og=pv,Sg=dv,Tg=bg;function Xe(r){var e=this.__data__=new $g(r);this.size=e.size}Xe.prototype.clear=Eg,Xe.prototype.delete=Ag,Xe.prototype.get=Og,Xe.prototype.has=Sg,Xe.prototype.set=Tg;var Mn=Xe,Ig="__lodash_hash_undefined__";function Pg(r){return this.__data__.set(r,Ig),this}var xg=Pg;function Fg(r){return this.__data__.has(r)}var Rg=Fg,Mg=Rn,Bg=xg,Dg=Rg;function ot(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new Mg;++e<t;)this.add(r[e])}ot.prototype.add=ot.prototype.push=Bg,ot.prototype.has=Dg;var Ug=ot;function Ng(r,e){for(var t=-1,n=r==null?0:r.length;++t<n;)if(e(r[t],t,r))return!0;return!1}var Cg=Ng;function Lg(r,e){return r.has(e)}var jg=Lg,kg=Ug,qg=Cg,Vg=jg,Gg=1,Wg=2;function Hg(r,e,t,n,i,a){var o=t&Gg,s=r.length,f=e.length;if(s!=f&&!(o&&f>s))return!1;var c=a.get(r),p=a.get(e);if(c&&p)return c==e&&p==r;var u=-1,l=!0,y=t&Wg?new kg:void 0;for(a.set(r,e),a.set(e,r);++u<s;){var _=r[u],E=e[u];if(n)var $=o?n(E,_,u,e,r,a):n(_,E,u,r,e,a);if($!==void 0){if($)continue;l=!1;break}if(y){if(!qg(e,function(w,T){if(!Vg(y,T)&&(_===w||i(_,w,t,n,a)))return y.push(T)})){l=!1;break}}else if(!(_===E||i(_,E,t,n,a))){l=!1;break}}return a.delete(r),a.delete(e),l}var Wa=Hg,Xg=Q,zg=Xg.Uint8Array,Ha=zg;function Yg(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var Kg=Yg;function Zg(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var Jg=Zg,Xa=ke,za=Ha,Qg=Jr,e_=Wa,r_=Kg,t_=Jg,n_=1,i_=2,a_="[object Boolean]",o_="[object Date]",u_="[object Error]",s_="[object Map]",f_="[object Number]",c_="[object RegExp]",l_="[object Set]",p_="[object String]",h_="[object Symbol]",d_="[object ArrayBuffer]",y_="[object DataView]",Ya=Xa?Xa.prototype:void 0,Bn=Ya?Ya.valueOf:void 0;function v_(r,e,t,n,i,a,o){switch(t){case y_:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case d_:return!(r.byteLength!=e.byteLength||!a(new za(r),new za(e)));case a_:case o_:case f_:return Qg(+r,+e);case u_:return r.name==e.name&&r.message==e.message;case c_:case p_:return r==e+"";case s_:var s=r_;case l_:var f=n&n_;if(s||(s=t_),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=i_,o.set(r,e);var p=e_(s(r),s(e),n,i,a,o);return o.delete(r),p;case h_:if(Bn)return Bn.call(r)==Bn.call(e)}return!1}var g_=v_;function __(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Dn=__,m_=Dn,w_=N;function b_(r,e,t){var n=e(r);return w_(r)?n:m_(n,t(r))}var Ka=b_;function $_(r,e){for(var t=-1,n=r==null?0:r.length,i=0,a=[];++t<n;){var o=r[t];e(o,t,r)&&(a[i++]=o)}return a}var E_=$_;function A_(){return[]}var Za=A_,O_=E_,S_=Za,T_=Object.prototype,I_=T_.propertyIsEnumerable,Ja=Object.getOwnPropertySymbols,P_=Ja?function(r){return r==null?[]:(r=Object(r),O_(Ja(r),function(e){return I_.call(r,e)}))}:S_,Un=P_,x_=Ka,F_=Un,R_=Ve;function M_(r){return x_(r,R_,F_)}var Qa=M_,eo=Qa,B_=1,D_=Object.prototype,U_=D_.hasOwnProperty;function N_(r,e,t,n,i,a){var o=t&B_,s=eo(r),f=s.length,c=eo(e),p=c.length;if(f!=p&&!o)return!1;for(var u=f;u--;){var l=s[u];if(!(o?l in e:U_.call(e,l)))return!1}var y=a.get(r),_=a.get(e);if(y&&_)return y==e&&_==r;var E=!0;a.set(r,e),a.set(e,r);for(var $=o;++u<f;){l=s[u];var w=r[l],T=e[l];if(n)var h=o?n(T,w,l,e,r,a):n(w,T,l,r,e,a);if(!(h===void 0?w===T||i(w,T,t,n,a):h)){E=!1;break}$||($=l=="constructor")}if(E&&!$){var S=r.constructor,P=e.constructor;S!=P&&"constructor"in r&&"constructor"in e&&!(typeof S=="function"&&S instanceof S&&typeof P=="function"&&P instanceof P)&&(E=!1)}return a.delete(r),a.delete(e),E}var C_=N_,L_=Se,j_=Q,k_=L_(j_,"DataView"),q_=k_,V_=Se,G_=Q,W_=V_(G_,"Promise"),H_=W_,X_=Se,z_=Q,Y_=X_(z_,"Set"),K_=Y_,Z_=Se,J_=Q,Q_=Z_(J_,"WeakMap"),em=Q_,Nn=q_,Cn=Fn,Ln=H_,jn=K_,kn=em,ro=ue,ze=Oa,to="[object Map]",rm="[object Object]",no="[object Promise]",io="[object Set]",ao="[object WeakMap]",oo="[object DataView]",tm=ze(Nn),nm=ze(Cn),im=ze(Ln),am=ze(jn),om=ze(kn),Ie=ro;(Nn&&Ie(new Nn(new ArrayBuffer(1)))!=oo||Cn&&Ie(new Cn)!=to||Ln&&Ie(Ln.resolve())!=no||jn&&Ie(new jn)!=io||kn&&Ie(new kn)!=ao)&&(Ie=function(r){var e=ro(r),t=e==rm?r.constructor:void 0,n=t?ze(t):"";if(n)switch(n){case tm:return oo;case nm:return to;case im:return no;case am:return io;case om:return ao}return e});var ut=Ie,qn=Mn,um=Wa,sm=g_,fm=C_,uo=ut,so=N,fo=cr.exports,cm=ja,lm=1,co="[object Arguments]",lo="[object Array]",st="[object Object]",pm=Object.prototype,po=pm.hasOwnProperty;function hm(r,e,t,n,i,a){var o=so(r),s=so(e),f=o?lo:uo(r),c=s?lo:uo(e);f=f==co?st:f,c=c==co?st:c;var p=f==st,u=c==st,l=f==c;if(l&&fo(r)){if(!fo(e))return!1;o=!0,p=!1}if(l&&!p)return a||(a=new qn),o||cm(r)?um(r,e,t,n,i,a):sm(r,e,f,t,n,i,a);if(!(t&lm)){var y=p&&po.call(r,"__wrapped__"),_=u&&po.call(e,"__wrapped__");if(y||_){var E=y?r.value():r,$=_?e.value():e;return a||(a=new qn),i(E,$,t,n,a)}}return l?(a||(a=new qn),fm(r,e,t,n,i,a)):!1}var dm=hm,ym=dm,ho=W;function yo(r,e,t,n,i){return r===e?!0:r==null||e==null||!ho(r)&&!ho(e)?r!==r&&e!==e:ym(r,e,t,n,yo,i)}var vo=yo,vm=Mn,gm=vo,_m=1,mm=2;function wm(r,e,t,n){var i=t.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var s=t[i];if(o&&s[2]?s[1]!==r[s[0]]:!(s[0]in r))return!1}for(;++i<a;){s=t[i];var f=s[0],c=r[f],p=s[1];if(o&&s[2]){if(c===void 0&&!(f in r))return!1}else{var u=new vm;if(n)var l=n(c,p,f,r,e,u);if(!(l===void 0?gm(p,c,_m|mm,n,u):l))return!1}}return!0}var bm=wm,$m=ve;function Em(r){return r===r&&!$m(r)}var go=Em,Am=go,Om=Ve;function Sm(r){for(var e=Om(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,Am(i)]}return e}var Tm=Sm;function Im(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var _o=Im,Pm=bm,xm=Tm,Fm=_o;function Rm(r){var e=xm(r);return e.length==1&&e[0][2]?Fm(e[0][0],e[0][1]):function(t){return t===r||Pm(t,r,e)}}var Mm=Rm,Bm=ue,Dm=W,Um="[object Symbol]";function Nm(r){return typeof r=="symbol"||Dm(r)&&Bm(r)==Um}var ft=Nm,Cm=N,Lm=ft,jm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,km=/^\w*$/;function qm(r,e){if(Cm(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||Lm(r)?!0:km.test(r)||!jm.test(r)||e!=null&&r in Object(e)}var Vn=qm,mo=Rn,Vm="Expected a function";function Gn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(Vm);var t=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=t.cache;if(a.has(i))return a.get(i);var o=r.apply(this,n);return t.cache=a.set(i,o)||a,o};return t.cache=new(Gn.Cache||mo),t}Gn.Cache=mo;var Gm=Gn,Wm=Gm,Hm=500;function Xm(r){var e=Wm(r,function(n){return t.size===Hm&&t.clear(),n}),t=e.cache;return e}var zm=Xm,Ym=zm,Km=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Zm=/\\(\\)?/g,Jm=Ym(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(Km,function(t,n,i,a){e.push(i?a.replace(Zm,"$1"):n||t)}),e}),Qm=Jm;function e0(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}var ct=e0,wo=ke,r0=ct,t0=N,n0=ft,i0=1/0,bo=wo?wo.prototype:void 0,$o=bo?bo.toString:void 0;function Eo(r){if(typeof r=="string")return r;if(t0(r))return r0(r,Eo)+"";if(n0(r))return $o?$o.call(r):"";var e=r+"";return e=="0"&&1/r==-i0?"-0":e}var a0=Eo,o0=a0;function u0(r){return r==null?"":o0(r)}var s0=u0,f0=N,c0=Vn,l0=Qm,p0=s0;function h0(r,e){return f0(r)?r:c0(r,e)?[r]:l0(p0(r))}var lt=h0,d0=ft,y0=1/0;function v0(r){if(typeof r=="string"||d0(r))return r;var e=r+"";return e=="0"&&1/r==-y0?"-0":e}var pr=v0,g0=lt,_0=pr;function m0(r,e){e=g0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[_0(e[t++])];return t&&t==n?r:void 0}var Wn=m0,w0=Wn;function b0(r,e,t){var n=r==null?void 0:w0(r,e);return n===void 0?t:n}var $0=b0;function E0(r,e){return r!=null&&e in Object(r)}var A0=E0,O0=lt,S0=Tn,T0=N,I0=Sn,P0=On,x0=pr;function F0(r,e,t){e=O0(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=x0(e[n]);if(!(a=r!=null&&t(r,o)))break;r=r[o]}return a||++n!=i?a:(i=r==null?0:r.length,!!i&&P0(i)&&I0(o,i)&&(T0(r)||S0(r)))}var R0=F0,M0=A0,B0=R0;function D0(r,e){return r!=null&&B0(r,e,M0)}var U0=D0,N0=vo,C0=$0,L0=U0,j0=Vn,k0=go,q0=_o,V0=pr,G0=1,W0=2;function H0(r,e){return j0(r)&&k0(e)?q0(V0(r),e):function(t){var n=C0(t,r);return n===void 0&&n===e?L0(t,r):N0(e,n,G0|W0)}}var X0=H0;function z0(r){return function(e){return e?.[r]}}var Y0=z0,K0=Wn;function Z0(r){return function(e){return K0(e,r)}}var J0=Z0,Q0=Y0,ew=J0,rw=Vn,tw=pr;function nw(r){return rw(r)?Q0(tw(r)):ew(r)}var iw=nw,aw=Mm,ow=X0,uw=Qr,sw=N,fw=iw;function cw(r){return typeof r=="function"?r:r==null?uw:typeof r=="object"?sw(r)?ow(r[0],r[1]):aw(r):fw(r)}var Ao=cw,lw=iy,pw=Uy,hw=Ao,dw=N,yw=Ba;function vw(r,e,t){var n=dw(r)?lw:pw;return t&&yw(r,e,t)&&(e=void 0),n(r,hw(e))}var Hn=vw;Object.defineProperty(Te,"__esModule",{value:!0}),Te.calculatePadding=ww,Te.slicePadding=bw;var gw=Hn,_w=mw(gw);function mw(r){return r&&r.__esModule?r:{default:r}}function ww(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function bw(r,e){var t=r.slice(e),n=(0,_w.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(rt,"__esModule",{value:!0}),rt.Cursor=void 0;var $w=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Ew=Te;function Aw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Xn=function(){function r(e){Aw(this,r),e instanceof d||(e=typeof e=="number"?d.alloc(e):d.from(e)),this._setBuffer(e),this.rewind()}return $w(r,[{key:"_setBuffer",value:function(t){this._buffer=t,this.length=t.length}},{key:"buffer",value:function(){return this._buffer}},{key:"tap",value:function(t){return t(this),this}},{key:"clone",value:function(t){var n=new this.constructor(this.buffer());return n.seek(arguments.length===0?this.tell():t),n}},{key:"tell",value:function(){return this._index}},{key:"seek",value:function(t,n){return arguments.length===1&&(n=t,t="="),t==="+"?this._index+=n:t==="-"?this._index-=n:this._index=n,this}},{key:"rewind",value:function(){return this.seek(0)}},{key:"eof",value:function(){return this.tell()===this.buffer().length}},{key:"write",value:function(t,n,i){return this.seek("+",this.buffer().write(t,this.tell(),n,i))}},{key:"fill",value:function(t,n){return arguments.length===1&&(n=this.buffer().length-this.tell()),this.buffer().fill(t,this.tell(),this.tell()+n),this.seek("+",n),this}},{key:"slice",value:function(t){arguments.length===0&&(t=this.length-this.tell());var n=new this.constructor(this.buffer().slice(this.tell(),this.tell()+t));return this.seek("+",t),n}},{key:"copyFrom",value:function(t){var n=t instanceof d?t:t.buffer();return n.copy(this.buffer(),this.tell(),0,n.length),this.seek("+",n.length),this}},{key:"concat",value:function(t){t.forEach(function(i,a){i instanceof r&&(t[a]=i.buffer())}),t.unshift(this.buffer());var n=d.concat(t);return this._setBuffer(n),this}},{key:"toString",value:function(t,n){arguments.length===0?(t="utf8",n=this.buffer().length-this.tell()):arguments.length===1&&(n=this.buffer().length-this.tell());var i=this.buffer().toString(t,this.tell(),this.tell()+n);return this.seek("+",n),i}},{key:"writeBufferPadded",value:function(t){var n=(0,Ew.calculatePadding)(t.length),i=d.alloc(n);return this.copyFrom(new r(t)).copyFrom(new r(i))}}]),r}();[[1,["readInt8","readUInt8"]],[2,["readInt16BE","readInt16LE","readUInt16BE","readUInt16LE"]],[4,["readInt32BE","readInt32LE","readUInt32BE","readUInt32LE","readFloatBE","readFloatLE"]],[8,["readDoubleBE","readDoubleLE"]]].forEach(function(r){r[1].forEach(function(e){Xn.prototype[e]=function(){var n=this.buffer()[e](this.tell());return this.seek("+",r[0]),n}})}),[[1,["writeInt8","writeUInt8"]],[2,["writeInt16BE","writeInt16LE","writeUInt16BE","writeUInt16LE"]],[4,["writeInt32BE","writeInt32LE","writeUInt32BE","writeUInt32LE","writeFloatBE","writeFloatLE"]],[8,["writeDoubleBE","writeDoubleLE"]]].forEach(function(r){r[1].forEach(function(e){Xn.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),rt.Cursor=Xn,Object.defineProperty(M,"__esModule",{value:!0}),M.default=Fw;var Ow=Ea.exports,Oo=To(Ow),Sw=En,Tw=To(Sw),So=rt;function To(r){return r&&r.__esModule?r:{default:r}}var Iw=Math.pow(2,16),Pw={toXDR:function(e){var t=new So.Cursor(Iw);this.write(e,t);var n=t.tell();return t.rewind(),t.slice(n).buffer()},fromXDR:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw",n=void 0;switch(t){case"raw":n=e;break;case"hex":n=d.from(e,"hex");break;case"base64":n=d.from(e,"base64");break;default:throw new Error("Invalid format "+t+', must be "raw", "hex", "base64"')}var i=new So.Cursor(n),a=this.read(i);return a},validateXDR:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(e,t),!0}catch{return!1}}},xw={toXDR:function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"raw",t=this.constructor.toXDR(this);switch(e){case"raw":return t;case"hex":return t.toString("hex");case"base64":return t.toString("base64");default:throw new Error("Invalid format "+e+', must be "raw", "hex", "base64"')}}};function Fw(r){(0,Oo.default)(r,Pw),(0,Tw.default)(r)&&(0,Oo.default)(r.prototype,xw)}Object.defineProperty(oe,"__esModule",{value:!0}),oe.Int=void 0;var Rw=Zr,Io=Po(Rw),Mw=M,Bw=Po(Mw);function Po(r){return r&&r.__esModule?r:{default:r}}var hr=oe.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,Io.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");t.writeInt32BE(e)},isValid:function(e){return!(0,Io.default)(e)||Math.floor(e)!==e?!1:e>=hr.MIN_VALUE&&e<=hr.MAX_VALUE}};hr.MAX_VALUE=Math.pow(2,31)-1,hr.MIN_VALUE=-Math.pow(2,31),(0,Bw.default)(hr);var pt={};function Dw(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var zn={exports:{}};(function(r){/**
|
|
25
25
|
* @license Long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
|
|
26
26
|
* Released under the Apache License, Version 2.0
|
|
27
27
|
* see: https://github.com/dcodeIO/Long.js for details
|
|
28
|
-
*/(function(e,t){typeof Jw=="function"&&!0&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(te,function(){function e(l,u,p){this.low=l|0,this.high=u|0,this.unsigned=!!p}e.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=function(u){return(u&&u.__isLong__)===!0};var t={},n={};e.fromInt=function(u,p){var y,g;return p?(u=u>>>0,0<=u&&u<256&&(g=n[u],g)?g:(y=new e(u,(u|0)<0?-1:0,!0),0<=u&&u<256&&(n[u]=y),y)):(u=u|0,-128<=u&&u<128&&(g=t[u],g)?g:(y=new e(u,u<0?-1:0,!1),-128<=u&&u<128&&(t[u]=y),y))},e.fromNumber=function(u,p){return p=!!p,isNaN(u)||!isFinite(u)?e.ZERO:!p&&u<=-f?e.MIN_VALUE:!p&&u+1>=f?e.MAX_VALUE:p&&u>=s?e.MAX_UNSIGNED_VALUE:u<0?e.fromNumber(-u,p).negate():new e(u%o|0,u/o|0,p)},e.fromBits=function(u,p,y){return new e(u,p,y)},e.fromString=function(u,p,y){if(u.length===0)throw Error("number format error: empty string");if(u==="NaN"||u==="Infinity"||u==="+Infinity"||u==="-Infinity")return e.ZERO;if(typeof p=="number"&&(y=p,p=!1),y=y||10,y<2||36<y)throw Error("radix out of range: "+y);var g;if((g=u.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+u);if(g===0)return e.fromString(u.substring(1),p,y).negate();for(var b=e.fromNumber(Math.pow(y,8)),E=e.ZERO,w=0;w<u.length;w+=8){var T=Math.min(8,u.length-w),h=parseInt(u.substring(w,w+T),y);if(T<8){var S=e.fromNumber(Math.pow(y,T));E=E.multiply(S).add(e.fromNumber(h))}else E=E.multiply(b),E=E.add(e.fromNumber(h))}return E.unsigned=p,E},e.fromValue=function(u){return u instanceof e?u:typeof u=="number"?e.fromNumber(u):typeof u=="string"?e.fromString(u):new e(u.low,u.high,u.unsigned)};var i=1<<16,a=1<<24,o=i*i,s=o*o,f=s/2,c=e.fromInt(a);return e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)},e.prototype.toString=function(u){if(u=u||10,u<2||36<u)throw RangeError("radix out of range: "+u);if(this.isZero())return"0";var p;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var y=e.fromNumber(u),g=this.divide(y);return p=g.multiply(y).subtract(this),g.toString(u)+p.toInt().toString(u)}else return"-"+this.negate().toString(u);var b=e.fromNumber(Math.pow(u,6),this.unsigned);p=this;for(var E="";;){var w=p.divide(b),T=p.subtract(w.multiply(b)).toInt()>>>0,h=T.toString(u);if(p=w,p.isZero())return h+E;for(;h.length<6;)h="0"+h;E=""+h+E}},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(e.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var u=this.high!=0?this.high:this.low,p=31;p>0&&(u&1<<p)==0;p--);return this.high!=0?p+33:p+1},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.equals=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.unsigned!==u.unsigned&&this.high>>>31===1&&u.high>>>31===1?!1:this.high===u.high&&this.low===u.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(u){return!this.equals(u)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(u){return this.compare(u)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(u){return this.compare(u)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(u){return this.compare(u)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(u){return this.compare(u)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compare=function(u){if(e.isLong(u)||(u=e.fromValue(u)),this.equals(u))return 0;var p=this.isNegative(),y=u.isNegative();return p&&!y?-1:!p&&y?1:this.unsigned?u.high>>>0>this.high>>>0||u.high===this.high&&u.low>>>0>this.low>>>0?-1:1:this.subtract(u).isNegative()?-1:1},e.prototype.negate=function(){return!this.unsigned&&this.equals(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=e.prototype.negate,e.prototype.add=function(u){e.isLong(u)||(u=e.fromValue(u));var p=this.high>>>16,y=this.high&65535,g=this.low>>>16,b=this.low&65535,E=u.high>>>16,w=u.high&65535,T=u.low>>>16,h=u.low&65535,S=0,I=0,R=0,m=0;return m+=b+h,R+=m>>>16,m&=65535,R+=g+T,I+=R>>>16,R&=65535,I+=y+w,S+=I>>>16,I&=65535,S+=p+E,S&=65535,e.fromBits(R<<16|m,S<<16|I,this.unsigned)},e.prototype.subtract=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.add(u.negate())},e.prototype.sub=e.prototype.subtract,e.prototype.multiply=function(u){if(this.isZero()||(e.isLong(u)||(u=e.fromValue(u)),u.isZero()))return e.ZERO;if(this.equals(e.MIN_VALUE))return u.isOdd()?e.MIN_VALUE:e.ZERO;if(u.equals(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().multiply(u.negate()):this.negate().multiply(u).negate();if(u.isNegative())return this.multiply(u.negate()).negate();if(this.lessThan(c)&&u.lessThan(c))return e.fromNumber(this.toNumber()*u.toNumber(),this.unsigned);var p=this.high>>>16,y=this.high&65535,g=this.low>>>16,b=this.low&65535,E=u.high>>>16,w=u.high&65535,T=u.low>>>16,h=u.low&65535,S=0,I=0,R=0,m=0;return m+=b*h,R+=m>>>16,m&=65535,R+=g*h,I+=R>>>16,R&=65535,R+=b*T,I+=R>>>16,R&=65535,I+=y*h,S+=I>>>16,I&=65535,I+=g*T,S+=I>>>16,I&=65535,I+=b*w,S+=I>>>16,I&=65535,S+=p*h+y*T+g*w+b*E,S&=65535,e.fromBits(R<<16|m,S<<16|I,this.unsigned)},e.prototype.mul=e.prototype.multiply,e.prototype.divide=function(u){if(e.isLong(u)||(u=e.fromValue(u)),u.isZero())throw new Error("division by zero");if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var p,y,g;if(this.equals(e.MIN_VALUE)){if(u.equals(e.ONE)||u.equals(e.NEG_ONE))return e.MIN_VALUE;if(u.equals(e.MIN_VALUE))return e.ONE;var b=this.shiftRight(1);return p=b.divide(u).shiftLeft(1),p.equals(e.ZERO)?u.isNegative()?e.ONE:e.NEG_ONE:(y=this.subtract(u.multiply(p)),g=p.add(y.divide(u)),g)}else if(u.equals(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().divide(u.negate()):this.negate().divide(u).negate();if(u.isNegative())return this.divide(u.negate()).negate();for(g=e.ZERO,y=this;y.greaterThanOrEqual(u);){p=Math.max(1,Math.floor(y.toNumber()/u.toNumber()));for(var E=Math.ceil(Math.log(p)/Math.LN2),w=E<=48?1:Math.pow(2,E-48),T=e.fromNumber(p),h=T.multiply(u);h.isNegative()||h.greaterThan(y);)p-=w,T=e.fromNumber(p,this.unsigned),h=T.multiply(u);T.isZero()&&(T=e.ONE),g=g.add(T),y=y.subtract(h)}return g},e.prototype.div=e.prototype.divide,e.prototype.modulo=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.subtract(this.divide(u).multiply(u))},e.prototype.mod=e.prototype.modulo,e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.and=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low&u.low,this.high&u.high,this.unsigned)},e.prototype.or=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low|u.low,this.high|u.high,this.unsigned)},e.prototype.xor=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low^u.low,this.high^u.high,this.unsigned)},e.prototype.shiftLeft=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low<<u,this.high<<u|this.low>>>32-u,this.unsigned):e.fromBits(0,this.low<<u-32,this.unsigned)},e.prototype.shl=e.prototype.shiftLeft,e.prototype.shiftRight=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low>>>u|this.high<<32-u,this.high>>u,this.unsigned):e.fromBits(this.high>>u-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=e.prototype.shiftRight,e.prototype.shiftRightUnsigned=function(u){if(e.isLong(u)&&(u=u.toInt()),u&=63,u===0)return this;var p=this.high;if(u<32){var y=this.low;return e.fromBits(y>>>u|p<<32-u,p>>>u,this.unsigned)}else return u===32?e.fromBits(p,0,this.unsigned):e.fromBits(p>>>u-32,0,this.unsigned)},e.prototype.shru=e.prototype.shiftRightUnsigned,e.prototype.toSigned=function(){return this.unsigned?new e(this.low,this.high,!1):this},e.prototype.toUnsigned=function(){return this.unsigned?this:new e(this.low,this.high,!0)},e})})(Jn),Object.defineProperty(dt,"__esModule",{value:!0}),dt.Hyper=void 0;var Qw=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Bo=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:r(a,t,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},eb=Jn.exports,vr=No(eb),rb=M,tb=No(rb);function No(r){return r&&r.__esModule?r:{default:r}}function nb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function ib(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function ab(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var gr=dt.Hyper=function(r){ab(e,r),Qw(e,null,[{key:"read",value:function(n){var i=n.readInt32BE(),a=n.readInt32BE();return this.fromBits(a,i)}},{key:"write",value:function(n,i){if(!(n instanceof this))throw new Error("XDR Write Error: "+n+" is not a Hyper");i.writeInt32BE(n.high),i.writeInt32BE(n.low)}},{key:"fromString",value:function(n){if(!/^-?\d+$/.test(n))throw new Error("Invalid hyper string: "+n);var i=Bo(e.__proto__||Object.getPrototypeOf(e),"fromString",this).call(this,n,!1);return new this(i.low,i.high)}},{key:"fromBits",value:function(n,i){var a=Bo(e.__proto__||Object.getPrototypeOf(e),"fromBits",this).call(this,n,i,!1);return new this(a.low,a.high)}},{key:"isValid",value:function(n){return n instanceof this}}]);function e(t,n){return nb(this,e),ib(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(vr.default);(0,tb.default)(gr),gr.MAX_VALUE=new gr(vr.default.MAX_VALUE.low,vr.default.MAX_VALUE.high),gr.MIN_VALUE=new gr(vr.default.MIN_VALUE.low,vr.default.MIN_VALUE.high);var xe={};Object.defineProperty(xe,"__esModule",{value:!0}),xe.UnsignedInt=void 0;var ob=Qr,Uo=Co(ob),ub=M,sb=Co(ub);function Co(r){return r&&r.__esModule?r:{default:r}}var _r=xe.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,Uo.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");if(e<0)throw new Error("XDR Write Error: negative number "+e);t.writeUInt32BE(e)},isValid:function(e){return!(0,Uo.default)(e)||Math.floor(e)!==e?!1:e>=_r.MIN_VALUE&&e<=_r.MAX_VALUE}};_r.MAX_VALUE=Math.pow(2,32)-1,_r.MIN_VALUE=0,(0,sb.default)(_r);var yt={};Object.defineProperty(yt,"__esModule",{value:!0}),yt.UnsignedHyper=void 0;var fb=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Lo=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:r(a,t,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},cb=Jn.exports,mr=jo(cb),lb=M,pb=jo(lb);function jo(r){return r&&r.__esModule?r:{default:r}}function hb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function db(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function yb(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var wr=yt.UnsignedHyper=function(r){yb(e,r),fb(e,null,[{key:"read",value:function(n){var i=n.readInt32BE(),a=n.readInt32BE();return this.fromBits(a,i)}},{key:"write",value:function(n,i){if(!(n instanceof this))throw new Error("XDR Write Error: "+n+" is not an UnsignedHyper");i.writeInt32BE(n.high),i.writeInt32BE(n.low)}},{key:"fromString",value:function(n){if(!/^\d+$/.test(n))throw new Error("Invalid hyper string: "+n);var i=Lo(e.__proto__||Object.getPrototypeOf(e),"fromString",this).call(this,n,!0);return new this(i.low,i.high)}},{key:"fromBits",value:function(n,i){var a=Lo(e.__proto__||Object.getPrototypeOf(e),"fromBits",this).call(this,n,i,!0);return new this(a.low,a.high)}},{key:"isValid",value:function(n){return n instanceof this}}]);function e(t,n){return hb(this,e),db(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(mr.default);(0,pb.default)(wr),wr.MAX_VALUE=new wr(mr.default.MAX_UNSIGNED_VALUE.low,mr.default.MAX_UNSIGNED_VALUE.high),wr.MIN_VALUE=new wr(mr.default.MIN_VALUE.low,mr.default.MIN_VALUE.high);var vt={};Object.defineProperty(vt,"__esModule",{value:!0}),vt.Float=void 0;var vb=Qr,ko=qo(vb),gb=M,_b=qo(gb);function qo(r){return r&&r.__esModule?r:{default:r}}var mb=vt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,ko.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,ko.default)(e)}};(0,_b.default)(mb);var gt={};Object.defineProperty(gt,"__esModule",{value:!0}),gt.Double=void 0;var wb=Qr,Vo=Go(wb),bb=M,$b=Go(bb);function Go(r){return r&&r.__esModule?r:{default:r}}var Eb=gt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,Vo.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,Vo.default)(e)}};(0,$b.default)(Eb);var _t={};Object.defineProperty(_t,"__esModule",{value:!0}),_t.Quadruple=void 0;var Ab=M,Ob=Sb(Ab);function Sb(r){return r&&r.__esModule?r:{default:r}}var Tb=_t.Quadruple={read:function(){throw new Error("XDR Read Error: quadruple not supported")},write:function(){throw new Error("XDR Write Error: quadruple not supported")},isValid:function(){return!1}};(0,Ob.default)(Tb);var br={},Pb=se,Ib=W,xb="[object Boolean]";function Fb(r){return r===!0||r===!1||Ib(r)&&Pb(r)==xb}var Rb=Fb;Object.defineProperty(br,"__esModule",{value:!0}),br.Bool=void 0;var Mb=Rb,Db=Wo(Mb),Ho=ue,Bb=M,Nb=Wo(Bb);function Wo(r){return r&&r.__esModule?r:{default:r}}var Ub=br.Bool={read:function(e){var t=Ho.Int.read(e);switch(t){case 0:return!1;case 1:return!0;default:throw new Error("XDR Read Error: Got "+t+" when trying to read a bool")}},write:function(e,t){var n=e?1:0;return Ho.Int.write(n,t)},isValid:function(e){return(0,Db.default)(e)}};(0,Nb.default)(Ub);var mt={},Cb=se,Lb=C,jb=W,kb="[object String]";function qb(r){return typeof r=="string"||!Lb(r)&&jb(r)&&Cb(r)==kb}var zo=qb;Object.defineProperty(mt,"__esModule",{value:!0}),mt.String=void 0;var Vb=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Gb=zo,Xo=Qn(Gb),Hb=C,Wb=Qn(Hb),Yo=ue,zb=xe,Ko=Pe,Xb=M,Yb=Qn(Xb);function Qn(r){return r&&r.__esModule?r:{default:r}}function Kb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Zb=mt.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:zb.UnsignedInt.MAX_VALUE;Kb(this,r),this._maxLength=e}return Vb(r,[{key:"read",value:function(t){var n=Yo.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length String,"+("max allowed is "+this._maxLength));var i=(0,Ko.calculatePadding)(n),a=t.slice(n);return(0,Ko.slicePadding)(t,i),a.buffer()}},{key:"readString",value:function(t){return this.read(t).toString("utf8")}},{key:"write",value:function(t,n){if(t.length>this._maxLength)throw new Error("XDR Write Error: Got "+t.length+" bytes,"+("max allows is "+this._maxLength));var i=void 0;(0,Xo.default)(t)?i=d.from(t,"utf8"):i=d.from(t),Yo.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,Xo.default)(t))n=d.from(t,"utf8");else if((0,Wb.default)(t)||d.isBuffer(t))n=d.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,Yb.default)(Zb.prototype);var wt={};Object.defineProperty(wt,"__esModule",{value:!0}),wt.Opaque=void 0;var Jb=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Zo=Pe,Qb=M,e1=r1(Qb);function r1(r){return r&&r.__esModule?r:{default:r}}function t1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var n1=wt.Opaque=function(){function r(e){t1(this,r),this._length=e,this._padding=(0,Zo.calculatePadding)(e)}return Jb(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Zo.slicePadding)(t,this._padding),n.buffer()}},{key:"write",value:function(t,n){if(t.length!==this._length)throw new Error("XDR Write Error: Got "+t.length+" bytes, expected "+this._length);n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return d.isBuffer(t)&&t.length===this._length}}]),r}();(0,e1.default)(n1.prototype);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.VarOpaque=void 0;var i1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Jo=ue,a1=xe,Qo=Pe,o1=M,u1=s1(o1);function s1(r){return r&&r.__esModule?r:{default:r}}function f1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var c1=bt.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:a1.UnsignedInt.MAX_VALUE;f1(this,r),this._maxLength=e}return i1(r,[{key:"read",value:function(t){var n=Jo.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length VarOpaque,"+("max allowed is "+this._maxLength));var i=(0,Qo.calculatePadding)(n),a=t.slice(n);return(0,Qo.slicePadding)(t,i),a.buffer()}},{key:"write",value:function(t,n){if(t.length>this._maxLength)throw new Error("XDR Write Error: Got "+t.length+" bytes,"+("max allows is "+this._maxLength));Jo.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return d.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,u1.default)(c1.prototype);var $t={},Fe={exports:{}};function l1(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var eu=l1,p1=rt;function h1(r){return typeof r=="function"?r:p1}var ru=h1,d1=eu,y1=Dn,v1=ru,g1=C;function _1(r,e){var t=g1(r)?d1:y1;return t(r,v1(e))}var m1=_1;(function(r){r.exports=m1})(Fe);var w1=/\s/;function b1(r){for(var e=r.length;e--&&w1.test(r.charAt(e)););return e}var $1=b1,E1=$1,A1=/^\s+/;function O1(r){return r&&r.slice(0,E1(r)+1).replace(A1,"")}var S1=O1,T1=S1,tu=ge,P1=lt,nu=0/0,I1=/^[-+]0x[0-9a-f]+$/i,x1=/^0b[01]+$/i,F1=/^0o[0-7]+$/i,R1=parseInt;function M1(r){if(typeof r=="number")return r;if(P1(r))return nu;if(tu(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=tu(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=T1(r);var t=x1.test(r);return t||F1.test(r)?R1(r.slice(2),t?2:8):I1.test(r)?nu:+r}var D1=M1,B1=D1,iu=1/0,N1=17976931348623157e292;function U1(r){if(!r)return r===0?r:0;if(r=B1(r),r===iu||r===-iu){var e=r<0?-1:1;return e*N1}return r===r?r:0}var C1=U1,L1=C1;function j1(r){var e=L1(r),t=e%1;return e===e?t?e-t:e:0}var k1=j1,q1=ja,V1=ru,G1=k1,H1=9007199254740991,ei=4294967295,W1=Math.min;function z1(r,e){if(r=G1(r),r<1||r>H1)return[];var t=ei,n=W1(r,ei);e=V1(e),r-=ei;for(var i=q1(n,e);++t<r;)e(t);return i}var au=z1;Object.defineProperty($t,"__esModule",{value:!0}),$t.Array=void 0;var X1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Y1=Kn,K1=$r(Y1),Z1=Fe.exports,J1=$r(Z1),Q1=au,e$=$r(Q1),r$=C,ou=$r(r$),t$=M,n$=$r(t$);function $r(r){return r&&r.__esModule?r:{default:r}}function i$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var a$=$t.Array=function(){function r(e,t){i$(this,r),this._childType=e,this._length=t}return X1(r,[{key:"read",value:function(t){var n=this;return(0,e$.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,ou.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length!==this._length)throw new Error("XDR Write Error: Got array of size "+t.length+","+("expected "+this._length));(0,J1.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,ou.default)(t)||t.length!==this._length?!1:(0,K1.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,n$.default)(a$.prototype);var Et={};Object.defineProperty(Et,"__esModule",{value:!0}),Et.VarArray=void 0;var o$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),u$=Kn,s$=Er(u$),f$=Fe.exports,c$=Er(f$),l$=au,p$=Er(l$),h$=C,uu=Er(h$),d$=xe,su=ue,y$=M,v$=Er(y$);function Er(r){return r&&r.__esModule?r:{default:r}}function g$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var _$=Et.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:d$.UnsignedInt.MAX_VALUE;g$(this,r),this._childType=e,this._maxLength=t}return o$(r,[{key:"read",value:function(t){var n=this,i=su.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,p$.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,uu.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length>this._maxLength)throw new Error("XDR Write Error: Got array of size "+t.length+","+("max allowed is "+this._maxLength));su.Int.write(t.length,n),(0,c$.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,uu.default)(t)||t.length>this._maxLength?!1:(0,s$.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,v$.default)(_$.prototype);var At={};function m$(r){return r===null}var w$=m$;function b$(r){return r===void 0}var Ar=b$;Object.defineProperty(At,"__esModule",{value:!0}),At.Option=void 0;var $$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),E$=w$,fu=ri(E$),A$=Ar,cu=ri(A$),lu=br,O$=M,S$=ri(O$);function ri(r){return r&&r.__esModule?r:{default:r}}function T$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var P$=At.Option=function(){function r(e){T$(this,r),this._childType=e}return $$(r,[{key:"read",value:function(t){if(lu.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,fu.default)(t)||(0,cu.default)(t));lu.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,fu.default)(t)||(0,cu.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,S$.default)(P$.prototype);var Or={};Object.defineProperty(Or,"__esModule",{value:!0}),Or.Void=void 0;var I$=Ar,pu=hu(I$),x$=M,F$=hu(x$);function hu(r){return r&&r.__esModule?r:{default:r}}var R$=Or.Void={read:function(){},write:function(e){if(!(0,pu.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,pu.default)(e)}};(0,F$.default)(R$);var Ot={},M$=pt;function D$(r,e){return M$(e,function(t){return r[t]})}var B$=D$,N$=B$,U$=He;function C$(r){return r==null?[]:N$(r,U$(r))}var L$=C$;Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.Enum=void 0;var j$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),k$=Fe.exports,q$=ti(k$),V$=L$,G$=ti(V$),du=ue,H$=M,W$=ti(H$);function ti(r){return r&&r.__esModule?r:{default:r}}function z$(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function X$(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function yu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Y$=Ot.Enum=function(){function r(e,t){yu(this,r),this.name=e,this.value=t}return j$(r,null,[{key:"read",value:function(t){var n=du.Int.read(t);if(!this._byValue.has(n))throw new Error("XDR Read Error: Unknown "+this.enumName+" member for value "+n);return this._byValue.get(n)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: Unknown "+t+" is not a "+this.enumName);du.Int.write(t.value,n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"members",value:function(){return this._members}},{key:"values",value:function(){return(0,G$.default)(this._members)}},{key:"fromName",value:function(t){var n=this._members[t];if(!n)throw new Error(t+" is not a member of "+this.enumName);return n}},{key:"fromValue",value:function(t){var n=this._byValue.get(t);if(!n)throw new Error(t+" is not a value of any member of "+this.enumName);return n}},{key:"create",value:function(t,n,i){var a=function(o){X$(s,o);function s(){return yu(this,s),z$(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.enumName=n,t.results[n]=a,a._members={},a._byValue=new Map,(0,q$.default)(i,function(o,s){var f=new a(s,o);a._members[s]=f,a._byValue.set(o,f),a[s]=function(){return f}}),a}}]),r}();(0,W$.default)(Y$);var St={},K$=Dn,Z$=lr;function J$(r,e){var t=-1,n=Z$(r)?Array(r.length):[];return K$(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var Q$=J$,eE=pt,rE=Io,tE=Q$,nE=C;function iE(r,e){var t=nE(r)?eE:tE;return t(r,rE(e))}var aE=iE;function oE(r){for(var e=-1,t=r==null?0:r.length,n={};++e<t;){var i=r[e];n[i[0]]=i[1]}return n}var uE=oE,Sr={};Object.defineProperty(Sr,"__esModule",{value:!0});var sE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function fE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Sr.Reference=function(){function r(){fE(this,r)}return sE(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(St,"__esModule",{value:!0}),St.Struct=void 0;var Tt=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),cE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),lE=Fe.exports,vu=Tr(lE),pE=aE,hE=Tr(pE),dE=Ar,yE=Tr(dE),vE=uE,gE=Tr(vE),_E=Sr,mE=M,wE=Tr(mE);function Tr(r){return r&&r.__esModule?r:{default:r}}function bE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function $E(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function gu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var EE=St.Struct=function(){function r(e){gu(this,r),this._attributes=e||{}}return cE(r,null,[{key:"read",value:function(t){var n=(0,hE.default)(this._fields,function(i){var a=Tt(i,2),o=a[0],s=a[1],f=s.read(t);return[o,f]});return new this((0,gE.default)(n))}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.structName);(0,vu.default)(this._fields,function(i){var a=Tt(i,2),o=a[0],s=a[1],f=t._attributes[o];s.write(f,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){$E(s,o);function s(){return gu(this,s),bE(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var s=Tt(o,2),f=s[0],c=s[1];return c instanceof _E.Reference&&(c=c.resolve(t)),[f,c]}),(0,vu.default)(a._fields,function(o){var s=Tt(o,1),f=s[0];a.prototype[f]=AE(f)}),a}}]),r}();(0,wE.default)(EE);function AE(r){return function(t){return(0,yE.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.Union=void 0;var OE=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),SE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),TE=Fe.exports,It=Ft(TE),PE=Ar,_u=Ft(PE),IE=zo,mu=Ft(IE),xt=Or,ni=Sr,xE=M,FE=Ft(xE);function Ft(r){return r&&r.__esModule?r:{default:r}}function RE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function ME(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function wu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var DE=Pt.Union=function(){function r(e,t){wu(this,r),this.set(e,t)}return SE(r,[{key:"set",value:function(t,n){(0,mu.default)(t)&&(t=this.constructor._switchOn.fromName(t)),this._switch=t,this._arm=this.constructor.armForSwitch(this._switch),this._armType=this.constructor.armTypeForArm(this._arm),this._value=n}},{key:"get",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._arm;if(this._arm!==xt.Void&&this._arm!==t)throw new Error(t+" not set");return this._value}},{key:"switch",value:function(){return this._switch}},{key:"arm",value:function(){return this._arm}},{key:"armType",value:function(){return this._armType}},{key:"value",value:function(){return this._value}}],[{key:"armForSwitch",value:function(t){if(this._switches.has(t))return this._switches.get(t);if(this._defaultArm)return this._defaultArm;throw new Error("Bad union switch: "+t)}},{key:"armTypeForArm",value:function(t){return t===xt.Void?xt.Void:this._arms[t]}},{key:"read",value:function(t){var n=this._switchOn.read(t),i=this.armForSwitch(n),a=this.armTypeForArm(i),o=void 0;return(0,_u.default)(a)?o=i.read(t):o=a.read(t),new this(n,o)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.unionName);this._switchOn.write(t.switch(),n),t.armType().write(t.value(),n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(s){ME(f,s);function f(){return wu(this,f),RE(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof ni.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,It.default)(i.arms,function(s,f){s instanceof ni.Reference&&(s=s.resolve(t)),a._arms[f]=s});var o=i.defaultArm;return o instanceof ni.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,It.default)(i.switches,function(s){var f=OE(s,2),c=f[0],l=f[1];(0,mu.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,_u.default)(a._switchOn.values)||(0,It.default)(a._switchOn.values(),function(s){a[s.name]=function(f){return new a(s,f)},a.prototype[s.name]=function(c){return this.set(s,c)}}),(0,It.default)(a._arms,function(s,f){s!==xt.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,FE.default)(DE),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ue;Object.keys(e).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return e[h]}})});var t=dt;Object.keys(t).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return t[h]}})});var n=xe;Object.keys(n).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return n[h]}})});var i=yt;Object.keys(i).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return i[h]}})});var a=vt;Object.keys(a).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return a[h]}})});var o=gt;Object.keys(o).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return o[h]}})});var s=_t;Object.keys(s).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return s[h]}})});var f=br;Object.keys(f).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return f[h]}})});var c=mt;Object.keys(c).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return c[h]}})});var l=wt;Object.keys(l).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return l[h]}})});var u=bt;Object.keys(u).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return u[h]}})});var p=$t;Object.keys(p).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return p[h]}})});var y=Et;Object.keys(y).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return y[h]}})});var g=At;Object.keys(g).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return g[h]}})});var b=Or;Object.keys(b).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return b[h]}})});var E=Ot;Object.keys(E).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return E[h]}})});var w=St;Object.keys(w).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return w[h]}})});var T=Pt;Object.keys(T).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return T[h]}})})}(Sn);var bu={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(v,_){for(var $=0;$<_.length;$++){var O=_[$];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(v,O.key,O)}}return function(v,_,$){return _&&m(v.prototype,_),$&&m(v,$),v}}(),t=Sr;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=g;var n=Ar,i=l(n),a=Fe.exports,o=l(a),s=Sn,f=c(s);function c(m){if(m&&m.__esModule)return m;var v={};if(m!=null)for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(v[_]=m[_]);return v.default=m,v}function l(m){return m&&m.__esModule?m:{default:m}}function u(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function p(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function y(m,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);m.prototype=Object.create(v&&v.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(m,v):m.__proto__=v)}function g(m){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var _=new R(v);m(_),_.resolve()}return v}var b=function(m){y(v,m);function v(_){u(this,v);var $=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return $.name=_,$}return e(v,[{key:"resolve",value:function($){var O=$.definitions[this.name];return O.resolve($)}}]),v}(t.Reference),E=function(m){y(v,m);function v(_,$){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,v);var L=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return L.childReference=_,L.length=$,L.variable=O,L}return e(v,[{key:"resolve",value:function($){var O=this.childReference,L=this.length;return O instanceof t.Reference&&(O=O.resolve($)),L instanceof t.Reference&&(L=L.resolve($)),this.variable?new f.VarArray(O,L):new f.Array(O,L)}}]),v}(t.Reference),w=function(m){y(v,m);function v(_){u(this,v);var $=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return $.childReference=_,$.name=_.name,$}return e(v,[{key:"resolve",value:function($){var O=this.childReference;return O instanceof t.Reference&&(O=O.resolve($)),new f.Option(O)}}]),v}(t.Reference),T=function(m){y(v,m);function v(_,$){u(this,v);var O=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return O.sizedType=_,O.length=$,O}return e(v,[{key:"resolve",value:function($){var O=this.length;return O instanceof t.Reference&&(O=O.resolve($)),new this.sizedType(O)}}]),v}(t.Reference),h=function(){function m(v,_,$){u(this,m),this.constructor=v,this.name=_,this.config=$}return e(m,[{key:"resolve",value:function(_){return this.name in _.results?_.results[this.name]:this.constructor(_,this.name,this.config)}}]),m}();function S(m,v,_){return _ instanceof t.Reference&&(_=_.resolve(m)),m.results[v]=_,_}function I(m,v,_){return m.results[v]=_,_}var R=function(){function m(v){u(this,m),this._destination=v,this._definitions={}}return e(m,[{key:"enum",value:function(_,$){var O=new h(f.Enum.create,_,$);this.define(_,O)}},{key:"struct",value:function(_,$){var O=new h(f.Struct.create,_,$);this.define(_,O)}},{key:"union",value:function(_,$){var O=new h(f.Union.create,_,$);this.define(_,O)}},{key:"typedef",value:function(_,$){var O=new h(S,_,$);this.define(_,O)}},{key:"const",value:function(_,$){var O=new h(I,_,$);this.define(_,O)}},{key:"void",value:function(){return f.Void}},{key:"bool",value:function(){return f.Bool}},{key:"int",value:function(){return f.Int}},{key:"hyper",value:function(){return f.Hyper}},{key:"uint",value:function(){return f.UnsignedInt}},{key:"uhyper",value:function(){return f.UnsignedHyper}},{key:"float",value:function(){return f.Float}},{key:"double",value:function(){return f.Double}},{key:"quadruple",value:function(){return f.Quadruple}},{key:"string",value:function(_){return new T(f.String,_)}},{key:"opaque",value:function(_){return new T(f.Opaque,_)}},{key:"varOpaque",value:function(_){return new T(f.VarOpaque,_)}},{key:"array",value:function(_,$){return new E(_,$)}},{key:"varArray",value:function(_,$){return new E(_,$,!0)}},{key:"option",value:function(_){return new w(_)}},{key:"define",value:function(_,$){if((0,i.default)(this._destination[_]))this._definitions[_]=$;else throw new Error("XDRTypes Error:"+_+" is already defined")}},{key:"lookup",value:function(_){return new b(_)}},{key:"resolve",value:function(){var _=this;(0,o.default)(this._definitions,function($){$.resolve({definitions:_._definitions,results:_._destination})})}}]),m}()})(bu),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Sn;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=bu;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}($a);const BE=$a.config(r=>{r.enum("EnvelopeType",{envelopeTypeBundle:0}),r.typedef("Uint32",r.uint()),r.typedef("Uint64",r.uhyper()),r.union("BundleItemExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("BundleItem",[["collectionId",r.lookup("Uint64")],["productId",r.lookup("Uint64")],["variantId",r.lookup("Uint64")],["sku",r.string()],["quantity",r.lookup("Uint32")],["ext",r.lookup("BundleItemExt")]]),r.union("BundleExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("Bundle",[["variantId",r.lookup("Uint64")],["items",r.varArray(r.lookup("BundleItem"),500)],["version",r.lookup("Uint32")],["ext",r.lookup("BundleExt")]]),r.union("BundleEnvelope",{switchOn:r.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeBundle","v1"]],arms:{v1:r.lookup("Bundle")}})}),fe=BE;function NE(r){let e={variantId:fe.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new fe.BundleItem({collectionId:fe.Uint64.fromString(n.collectionId.toString()),productId:fe.Uint64.fromString(n.productId.toString()),variantId:fe.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new fe.BundleItemExt(0)})),ext:new fe.BundleExt(0)};const t=new fe.Bundle(e);return fe.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}let UE=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");var CE=Ge,LE=He;function jE(r,e){return r&&CE(e,LE(e),r)}var kE=jE,qE=Ge,VE=tt;function GE(r,e){return r&&qE(e,VE(e),r)}var HE=GE,ii={exports:{}};(function(r,e){var t=ee,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function f(c,l){if(l)return c.slice();var u=c.length,p=s?s(u):new c.constructor(u);return c.copy(p),p}r.exports=f})(ii,ii.exports);function WE(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var zE=WE,XE=Ge,YE=jn;function KE(r,e){return XE(r,YE(r),e)}var ZE=KE,JE=za,QE=JE(Object.getPrototypeOf,Object),ai=QE,eA=Ln,rA=ai,tA=jn,nA=to,iA=Object.getOwnPropertySymbols,aA=iA?function(r){for(var e=[];r;)eA(e,tA(r)),r=rA(r);return e}:nA,$u=aA,oA=Ge,uA=$u;function sA(r,e){return oA(r,uA(r),e)}var fA=sA,cA=ro,lA=$u,pA=tt;function hA(r){return cA(r,pA,lA)}var Eu=hA,dA=Object.prototype,yA=dA.hasOwnProperty;function vA(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&yA.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var gA=vA,Au=Za;function _A(r){var e=new r.constructor(r.byteLength);return new Au(e).set(new Au(r)),e}var oi=_A,mA=oi;function wA(r,e){var t=e?mA(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}var bA=wA,$A=/\w*$/;function EA(r){var e=new r.constructor(r.source,$A.exec(r));return e.lastIndex=r.lastIndex,e}var AA=EA,Ou=Ve,Su=Ou?Ou.prototype:void 0,Tu=Su?Su.valueOf:void 0;function OA(r){return Tu?Object(Tu.call(r)):{}}var SA=OA,TA=oi;function PA(r,e){var t=e?TA(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var IA=PA,xA=oi,FA=bA,RA=AA,MA=SA,DA=IA,BA="[object Boolean]",NA="[object Date]",UA="[object Map]",CA="[object Number]",LA="[object RegExp]",jA="[object Set]",kA="[object String]",qA="[object Symbol]",VA="[object ArrayBuffer]",GA="[object DataView]",HA="[object Float32Array]",WA="[object Float64Array]",zA="[object Int8Array]",XA="[object Int16Array]",YA="[object Int32Array]",KA="[object Uint8Array]",ZA="[object Uint8ClampedArray]",JA="[object Uint16Array]",QA="[object Uint32Array]";function eO(r,e,t){var n=r.constructor;switch(e){case VA:return xA(r);case BA:case NA:return new n(+r);case GA:return FA(r,t);case HA:case WA:case zA:case XA:case YA:case KA:case ZA:case JA:case QA:return DA(r,t);case UA:return new n;case CA:case kA:return new n(r);case LA:return RA(r);case jA:return new n;case qA:return MA(r)}}var rO=eO,tO=ge,Pu=Object.create,nO=function(){function r(){}return function(e){if(!tO(e))return{};if(Pu)return Pu(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}(),iO=nO,aO=iO,oO=ai,uO=Mn;function sO(r){return typeof r.constructor=="function"&&!uO(r)?aO(oO(r)):{}}var fO=sO,cO=ft,lO=W,pO="[object Map]";function hO(r){return lO(r)&&cO(r)==pO}var dO=hO,yO=dO,vO=Rn,Iu=hr.exports,xu=Iu&&Iu.isMap,gO=xu?vO(xu):yO,_O=gO,mO=ft,wO=W,bO="[object Set]";function $O(r){return wO(r)&&mO(r)==bO}var EO=$O,AO=EO,OO=Rn,Fu=hr.exports,Ru=Fu&&Fu.isSet,SO=Ru?OO(Ru):AO,TO=SO,PO=Un,IO=eu,xO=Da,FO=kE,RO=HE,MO=ii.exports,DO=zE,BO=ZE,NO=fA,UO=io,CO=Eu,LO=ft,jO=gA,kO=rO,qO=fO,VO=C,GO=pr.exports,HO=_O,WO=ge,zO=TO,XO=He,YO=tt,KO=1,ZO=2,JO=4,Mu="[object Arguments]",QO="[object Array]",eS="[object Boolean]",rS="[object Date]",tS="[object Error]",Du="[object Function]",nS="[object GeneratorFunction]",iS="[object Map]",aS="[object Number]",Bu="[object Object]",oS="[object RegExp]",uS="[object Set]",sS="[object String]",fS="[object Symbol]",cS="[object WeakMap]",lS="[object ArrayBuffer]",pS="[object DataView]",hS="[object Float32Array]",dS="[object Float64Array]",yS="[object Int8Array]",vS="[object Int16Array]",gS="[object Int32Array]",_S="[object Uint8Array]",mS="[object Uint8ClampedArray]",wS="[object Uint16Array]",bS="[object Uint32Array]",x={};x[Mu]=x[QO]=x[lS]=x[pS]=x[eS]=x[rS]=x[hS]=x[dS]=x[yS]=x[vS]=x[gS]=x[iS]=x[aS]=x[Bu]=x[oS]=x[uS]=x[sS]=x[fS]=x[_S]=x[mS]=x[wS]=x[bS]=!0,x[tS]=x[Du]=x[cS]=!1;function Rt(r,e,t,n,i,a){var o,s=e&KO,f=e&ZO,c=e&JO;if(t&&(o=i?t(r,n,i,a):t(r)),o!==void 0)return o;if(!WO(r))return r;var l=VO(r);if(l){if(o=jO(r),!s)return DO(r,o)}else{var u=LO(r),p=u==Du||u==nS;if(GO(r))return MO(r,s);if(u==Bu||u==Mu||p&&!i){if(o=f||p?{}:qO(r),!s)return f?NO(r,RO(o,r)):BO(r,FO(o,r))}else{if(!x[u])return i?r:{};o=kO(r,u,s)}}a||(a=new PO);var y=a.get(r);if(y)return y;a.set(r,o),zO(r)?r.forEach(function(E){o.add(Rt(E,e,t,E,r,a))}):HO(r)&&r.forEach(function(E,w){o.set(w,Rt(E,e,t,w,r,a))});var g=c?f?CO:UO:f?YO:XO,b=l?void 0:g(r);return IO(b||r,function(E,w){b&&(w=E,E=r[w]),xO(o,w,Rt(E,e,t,w,r,a))}),o}var $S=Rt;function ES(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var AS=ES;function OS(r,e,t){var n=-1,i=r.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=r[n+e];return a}var SS=OS,TS=Yn,PS=SS;function IS(r,e){return e.length<2?r:TS(r,PS(e,0,-1))}var xS=IS,FS=ht,RS=AS,MS=xS,DS=dr;function BS(r,e){return e=FS(e,r),r=MS(r,e),r==null||delete r[DS(RS(e))]}var NS=BS,US=se,CS=ai,LS=W,jS="[object Object]",kS=Function.prototype,qS=Object.prototype,Nu=kS.toString,VS=qS.hasOwnProperty,GS=Nu.call(Object);function HS(r){if(!LS(r)||US(r)!=jS)return!1;var e=CS(r);if(e===null)return!0;var t=VS.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Nu.call(t)==GS}var WS=HS,zS=WS;function XS(r){return zS(r)?void 0:r}var YS=XS,Uu=Ve,KS=Fn,ZS=C,Cu=Uu?Uu.isConcatSpreadable:void 0;function JS(r){return ZS(r)||KS(r)||!!(Cu&&r&&r[Cu])}var QS=JS,eT=Ln,rT=QS;function Lu(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=rT),i||(i=[]);++a<o;){var s=r[a];e>0&&t(s)?e>1?Lu(s,e-1,t,n,i):eT(i,s):n||(i[i.length]=s)}return i}var tT=Lu,nT=tT;function iT(r){var e=r==null?0:r.length;return e?nT(r,1):[]}var aT=iT,oT=aT,uT=Na,sT=Ca;function fT(r){return sT(uT(r,void 0,oT),r+"")}var cT=fT,lT=pt,pT=$S,hT=NS,dT=ht,yT=Ge,vT=YS,gT=cT,_T=Eu,mT=1,wT=2,bT=4,$T=gT(function(r,e){var t={};if(r==null)return t;var n=!1;e=lT(e,function(a){return a=dT(a,r),n||(n=a.length>1),a}),yT(r,_T(r),t),n&&(t=pT(t,mT|wT|bT,vT));for(var i=e.length;i--;)hT(t,e[i]);return t}),ET=$T,AT=Object.defineProperty,OT=Object.defineProperties,ST=Object.getOwnPropertyDescriptors,ju=Object.getOwnPropertySymbols,TT=Object.prototype.hasOwnProperty,PT=Object.prototype.propertyIsEnumerable,ku=(r,e,t)=>e in r?AT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,IT=(r,e)=>{for(var t in e||(e={}))TT.call(e,t)&&ku(r,t,e[t]);if(ju)for(var t of ju(e))PT.call(e,t)&&ku(r,t,e[t]);return r},xT=(r,e)=>OT(r,ST(e));function FT(r){try{return JSON.parse(r)}catch{return r}}function RT(r){return Object.entries(r).reduce((e,[t,n])=>xT(IT({},e),{[t]:FT(n)}),{})}var MT=Object.defineProperty,DT=Object.defineProperties,BT=Object.getOwnPropertyDescriptors,qu=Object.getOwnPropertySymbols,NT=Object.prototype.hasOwnProperty,UT=Object.prototype.propertyIsEnumerable,Vu=(r,e,t)=>e in r?MT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Gu=(r,e)=>{for(var t in e||(e={}))NT.call(e,t)&&Vu(r,t,e[t]);if(qu)for(var t of qu(e))UT.call(e,t)&&Vu(r,t,e[t]);return r},Hu=(r,e)=>DT(r,BT(e));function Wu(r){var e;const t=RT(r),n=t.auto_inject===void 0?!0:t.auto_inject,i=(e=t.display_on)!=null?e:[],a=t.first_option==="autodeliver";return Hu(Gu({},ET(t,["display_on","first_option"])),{auto_inject:n,valid_pages:i,is_subscription_first:a,autoInject:n,validPages:i,isSubscriptionFirst:a})}function zu(r){var e;const t=((e=r.subscription_options)==null?void 0:e.storefront_purchase_options)==="subscription_only";return Hu(Gu({},r),{is_subscription_only:t,isSubscriptionOnly:t})}function CT(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=zu(i)}),t})}const Mt="2020-12",LT={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Pr=new Map;function Dt(r,e){return Pr.has(r)||Pr.set(r,e()),Pr.get(r)}async function ui(r){const{product:e}=await Dt(`product.${r}`,()=>Jr("get",`/product/${Mt}/${r}.json`));return zu(e)}async function Xu(){return await Dt("storeSettings",()=>Jr("get",`/${Mt}/store_settings.json`).catch(()=>LT))}async function Yu(){const{widget_settings:r}=await Dt("widgetSettings",()=>Jr("get",`/${Mt}/widget_settings.json`));return Wu(r)}async function Ku(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await Dt("productsAndSettings",()=>Jr("get",`/product/${Mt}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:CT(r),widget_settings:Wu(e),store_settings:t??{}}}async function jT(){const{products:r}=await Ku();return r}async function kT(r){const[e,t,n]=await Promise.all([ui(r),Xu(),Yu()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function Zu(r){const{bundle_product:e}=await ui(r);return e}async function Ju(){return Array.from(Pr.keys()).forEach(r=>Pr.delete(r))}var qT=Object.freeze({__proto__:null,getCDNProduct:ui,getCDNStoreSettings:Xu,getCDNWidgetSettings:Yu,getCDNProductsAndSettings:Ku,getCDNProducts:jT,getCDNProductAndSettings:kT,getCDNBundleSettings:Zu,resetCDNCache:Ju});const Qu="/bundling-storefront-manager";function VT(){return Math.ceil(Date.now()/1e3)}async function GT(){try{const{timestamp:r}=await fr("get",`${Qu}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),VT()}}async function HT(r){const e=oe();if(!await es(r))throw new Error("Bundle is invalid.");const t=await GT(),n=NE({variantId:r.externalVariantId,version:t,items:r.selections.map(i=>({collectionId:i.collectionId,productId:i.externalProductId,variantId:i.externalVariantId,quantity:i.quantity,sku:""}))});try{const i=await fr("post",`${Qu}/api/v1/bundles`,{data:{bundle:n},headers:{Origin:`https://${e.storeIdentifier}`}});if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}function WT(r,e){const t=rs(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${UE(9)}:${r.externalProductId}`;return r.selections.map(i=>{const a={id:i.externalVariantId,quantity:i.quantity,properties:{_rc_bundle:n,_rc_bundle_variant:r.externalVariantId,_rc_bundle_parent:e,_rc_bundle_collection_id:i.collectionId}};return i.sellingPlan?a.selling_plan=i.sellingPlan:i.shippingIntervalFrequency&&(a.properties.shipping_interval_frequency=i.shippingIntervalFrequency,a.properties.shipping_interval_unit_type=i.shippingIntervalUnitType,a.id=`${i.discountedVariantId}`),a})}async function es(r){try{const e=await Zu(r.externalProductId);return!!r&&!!e}catch{return console.error("Error fetching bundle settings"),!1}}const zT={day:["day","days","Days"],days:["day","days","Days"],Days:["day","days","Days"],week:["week","weeks","Weeks"],weeks:["week","weeks","Weeks"],Weeks:["week","weeks","Weeks"],month:["month","months","Months"],months:["month","months","Months"],Months:["month","months","Months"]};function rs(r){if(!r)return"No bundle defined.";if(r.selections.length===0)return"No selections defined.";const{shippingIntervalFrequency:e,shippingIntervalUnitType:t}=r.selections.find(n=>n.shippingIntervalFrequency||n.shippingIntervalUnitType)||{};if(e||t){if(!e||!t)return"Shipping intervals do not match on selections.";{const n=zT[t];for(let i=0;i<r.selections.length;i++){const{shippingIntervalFrequency:a,shippingIntervalUnitType:o}=r.selections[i];if(a&&a!==e||o&&!n.includes(o))return"Shipping intervals do not match on selections."}}}return!0}async function XT(r,e){const{bundle_selection:t}=await A("get","/bundle_selections",{id:e},r);return t}function YT(r,e){return A("get","/bundle_selections",{query:e},r)}async function KT(r,e){const{bundle_selection:t}=await A("post","/bundle_selections",{data:e},r);return t}async function ZT(r,e,t){const{bundle_selection:n}=await A("put","/bundle_selections",{id:e,data:t},r);return n}function JT(r,e){return A("delete","/bundle_selections",{id:e},r)}var QT=Object.freeze({__proto__:null,getBundleId:HT,getDynamicBundleItems:WT,validateBundle:es,validateDynamicBundle:rs,getBundleSelection:XT,listBundleSelections:YT,createBundleSelection:KT,updateBundleSelection:ZT,deleteBundleSelection:JT});async function e2(r,e,t){const{charge:n}=await A("get","/charges",{id:e,query:{include:t?.include}},r);return n}function r2(r,e){return A("get","/charges",{query:e},r)}async function t2(r,e,t){const{charge:n}=await A("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},r);return n}async function n2(r,e){const{charge:t}=await A("post",`/charges/${e}/remove_discount`,{},r);return t}async function i2(r,e){const{charge:t}=await A("post",`/charges/${e}/skip`,{},r);return t}async function a2(r,e){const{charge:t}=await A("post",`/charges/${e}/unskip`,{},r);return t}async function o2(r,e){const{charge:t}=await A("post",`/charges/${e}/process`,{},r);return t}var u2=Object.freeze({__proto__:null,getCharge:e2,listCharges:r2,applyDiscountToCharge:t2,removeDiscountsFromCharge:n2,skipCharge:i2,unskipCharge:a2,processCharge:o2});async function s2(r,e){const{membership:t}=await A("get","/memberships",{id:e},r);return t}function f2(r,e){return A("get","/memberships",{query:e},r)}async function c2(r,e,t){const{membership:n}=await A("post",`/memberships/${e}/cancel`,{data:t},r);return n}async function l2(r,e,t){const{membership:n}=await A("post",`/memberships/${e}/activate`,{data:t},r);return n}var p2=Object.freeze({__proto__:null,getMembership:s2,listMemberships:f2,cancelMembership:c2,activateMembership:l2});async function h2(r,e){const{metafield:t}=await A("post","/metafields",{data:{metafield:e}},r);return t}async function d2(r,e,t){const{metafield:n}=await A("put","/metafields",{id:e,data:{metafield:t}},r);return n}function y2(r,e){return A("delete","/metafields",{id:e},r)}var v2=Object.freeze({__proto__:null,createMetafield:h2,updateMetafield:d2,deleteMetafield:y2});async function g2(r,e){const{onetime:t}=await A("get","/onetimes",{id:e},r);return t}function _2(r,e){return A("get","/onetimes",{query:e},r)}async function m2(r,e){const{onetime:t}=await A("post","/onetimes",{data:e},r);return t}async function w2(r,e,t){const{onetime:n}=await A("put","/onetimes",{id:e,data:t},r);return n}function b2(r,e){return A("delete","/onetimes",{id:e},r)}var $2=Object.freeze({__proto__:null,getOnetime:g2,listOnetimes:_2,createOnetime:m2,updateOnetime:w2,deleteOnetime:b2});async function E2(r,e){const{order:t}=await A("get","/orders",{id:e},r);return t}function A2(r,e){return A("get","/orders",{query:e},r)}var O2=Object.freeze({__proto__:null,getOrder:E2,listOrders:A2});async function S2(r,e,t){const{payment_method:n}=await A("get","/payment_methods",{id:e,query:{include:t?.include}},r);return n}async function T2(r,e,t){const{payment_method:n}=await A("put","/payment_methods",{id:e,data:t},r);return n}function P2(r,e){return A("get","/payment_methods",{query:e},r)}var I2=Object.freeze({__proto__:null,getPaymentMethod:S2,updatePaymentMethod:T2,listPaymentMethods:P2});async function x2(r,e){const{plan:t}=await A("get","/plans",{id:e},r);return t}function F2(r,e){return A("get","/plans",{query:e},r)}var R2=Object.freeze({__proto__:null,getPlan:x2,listPlans:F2});async function M2(r,e,t){const{subscription:n}=await A("get","/subscriptions",{id:e,query:{include:t?.include}},r);return n}function D2(r,e){return A("get","/subscriptions",{query:e},r)}async function B2(r,e){const{subscription:t}=await A("post","/subscriptions",{data:e},r);return t}async function N2(r,e,t,n){const{subscription:i}=await A("put","/subscriptions",{id:e,data:t,query:n},r);return i}async function U2(r,e,t){const{subscription:n}=await A("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t}},r);return n}async function C2(r,e,t){const{subscription:n}=await A("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},r);return n}async function L2(r,e,t){const{subscription:n}=await A("post",`/subscriptions/${e}/cancel`,{data:t},r);return n}async function j2(r,e){const{subscription:t}=await A("post",`/subscriptions/${e}/activate`,{},r);return t}async function k2(r,e,t){const{charge:n}=await A("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},r);return n}var q2=Object.freeze({__proto__:null,getSubscription:M2,listSubscriptions:D2,createSubscription:B2,updateSubscription:N2,updateSubscriptionChargeDate:U2,updateSubscriptionAddress:C2,cancelSubscription:L2,activateSubscription:j2,skipSubscriptionCharge:k2});async function V2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await A("get","/customers",{id:t,query:{include:e?.include}},r);return n}async function G2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await A("put","/customers",{id:t,data:e},r);return n}async function H2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await A("get",`/customers/${t}/delivery_schedule`,{query:e},r);return n}var W2=Object.freeze({__proto__:null,getCustomer:V2,updateCustomer:G2,getDeliverySchedule:H2});const z2={get(r,e){return H("get",r,e)},post(r,e){return H("post",r,e)},put(r,e){return H("put",r,e)},delete(r,e){return H("delete",r,e)}};function X2(r){var e,t;if(r)return r;if((e=window?.Shopify)!=null&&e.shop)return window.Shopify.shop;let n=window?.domain;if(!n){const i=(t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i))==null?void 0:t[1].replace(/-sp$/,"");i&&(n=`${i}.myshopify.com`)}if(n)return n;throw new Error("No storeIdentifier was passed into init.")}function Y2(r={}){const e=r;El({storeIdentifier:X2(r.storeIdentifier),loginRetryFn:r.loginRetryFn,storefrontAccessToken:r.storefrontAccessToken,environment:e.environment?e.environment:"prod"}),Ju()}const ts={init:Y2,api:z2,address:ql,auth:Yl,bundle:QT,charge:u2,cdn:qT,customer:W2,membership:p2,metafield:v2,onetime:$2,order:O2,paymentMethod:I2,plan:R2,subscription:q2};try{ts.init()}catch{}return ts});
|
|
28
|
+
*/(function(e,t){typeof Dw=="function"&&!0&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(re,function(){function e(p,u,l){this.low=p|0,this.high=u|0,this.unsigned=!!l}e.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=function(u){return(u&&u.__isLong__)===!0};var t={},n={};e.fromInt=function(u,l){var y,_;return l?(u=u>>>0,0<=u&&u<256&&(_=n[u],_)?_:(y=new e(u,(u|0)<0?-1:0,!0),0<=u&&u<256&&(n[u]=y),y)):(u=u|0,-128<=u&&u<128&&(_=t[u],_)?_:(y=new e(u,u<0?-1:0,!1),-128<=u&&u<128&&(t[u]=y),y))},e.fromNumber=function(u,l){return l=!!l,isNaN(u)||!isFinite(u)?e.ZERO:!l&&u<=-f?e.MIN_VALUE:!l&&u+1>=f?e.MAX_VALUE:l&&u>=s?e.MAX_UNSIGNED_VALUE:u<0?e.fromNumber(-u,l).negate():new e(u%o|0,u/o|0,l)},e.fromBits=function(u,l,y){return new e(u,l,y)},e.fromString=function(u,l,y){if(u.length===0)throw Error("number format error: empty string");if(u==="NaN"||u==="Infinity"||u==="+Infinity"||u==="-Infinity")return e.ZERO;if(typeof l=="number"&&(y=l,l=!1),y=y||10,y<2||36<y)throw Error("radix out of range: "+y);var _;if((_=u.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+u);if(_===0)return e.fromString(u.substring(1),l,y).negate();for(var E=e.fromNumber(Math.pow(y,8)),$=e.ZERO,w=0;w<u.length;w+=8){var T=Math.min(8,u.length-w),h=parseInt(u.substring(w,w+T),y);if(T<8){var S=e.fromNumber(Math.pow(y,T));$=$.multiply(S).add(e.fromNumber(h))}else $=$.multiply(E),$=$.add(e.fromNumber(h))}return $.unsigned=l,$},e.fromValue=function(u){return u instanceof e?u:typeof u=="number"?e.fromNumber(u):typeof u=="string"?e.fromString(u):new e(u.low,u.high,u.unsigned)};var i=1<<16,a=1<<24,o=i*i,s=o*o,f=s/2,c=e.fromInt(a);return e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)},e.prototype.toString=function(u){if(u=u||10,u<2||36<u)throw RangeError("radix out of range: "+u);if(this.isZero())return"0";var l;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var y=e.fromNumber(u),_=this.divide(y);return l=_.multiply(y).subtract(this),_.toString(u)+l.toInt().toString(u)}else return"-"+this.negate().toString(u);var E=e.fromNumber(Math.pow(u,6),this.unsigned);l=this;for(var $="";;){var w=l.divide(E),T=l.subtract(w.multiply(E)).toInt()>>>0,h=T.toString(u);if(l=w,l.isZero())return h+$;for(;h.length<6;)h="0"+h;$=""+h+$}},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(e.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var u=this.high!=0?this.high:this.low,l=31;l>0&&(u&1<<l)==0;l--);return this.high!=0?l+33:l+1},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.equals=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.unsigned!==u.unsigned&&this.high>>>31===1&&u.high>>>31===1?!1:this.high===u.high&&this.low===u.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(u){return!this.equals(u)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(u){return this.compare(u)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(u){return this.compare(u)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(u){return this.compare(u)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(u){return this.compare(u)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compare=function(u){if(e.isLong(u)||(u=e.fromValue(u)),this.equals(u))return 0;var l=this.isNegative(),y=u.isNegative();return l&&!y?-1:!l&&y?1:this.unsigned?u.high>>>0>this.high>>>0||u.high===this.high&&u.low>>>0>this.low>>>0?-1:1:this.subtract(u).isNegative()?-1:1},e.prototype.negate=function(){return!this.unsigned&&this.equals(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=e.prototype.negate,e.prototype.add=function(u){e.isLong(u)||(u=e.fromValue(u));var l=this.high>>>16,y=this.high&65535,_=this.low>>>16,E=this.low&65535,$=u.high>>>16,w=u.high&65535,T=u.low>>>16,h=u.low&65535,S=0,P=0,R=0,m=0;return m+=E+h,R+=m>>>16,m&=65535,R+=_+T,P+=R>>>16,R&=65535,P+=y+w,S+=P>>>16,P&=65535,S+=l+$,S&=65535,e.fromBits(R<<16|m,S<<16|P,this.unsigned)},e.prototype.subtract=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.add(u.negate())},e.prototype.sub=e.prototype.subtract,e.prototype.multiply=function(u){if(this.isZero()||(e.isLong(u)||(u=e.fromValue(u)),u.isZero()))return e.ZERO;if(this.equals(e.MIN_VALUE))return u.isOdd()?e.MIN_VALUE:e.ZERO;if(u.equals(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().multiply(u.negate()):this.negate().multiply(u).negate();if(u.isNegative())return this.multiply(u.negate()).negate();if(this.lessThan(c)&&u.lessThan(c))return e.fromNumber(this.toNumber()*u.toNumber(),this.unsigned);var l=this.high>>>16,y=this.high&65535,_=this.low>>>16,E=this.low&65535,$=u.high>>>16,w=u.high&65535,T=u.low>>>16,h=u.low&65535,S=0,P=0,R=0,m=0;return m+=E*h,R+=m>>>16,m&=65535,R+=_*h,P+=R>>>16,R&=65535,R+=E*T,P+=R>>>16,R&=65535,P+=y*h,S+=P>>>16,P&=65535,P+=_*T,S+=P>>>16,P&=65535,P+=E*w,S+=P>>>16,P&=65535,S+=l*h+y*T+_*w+E*$,S&=65535,e.fromBits(R<<16|m,S<<16|P,this.unsigned)},e.prototype.mul=e.prototype.multiply,e.prototype.divide=function(u){if(e.isLong(u)||(u=e.fromValue(u)),u.isZero())throw new Error("division by zero");if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var l,y,_;if(this.equals(e.MIN_VALUE)){if(u.equals(e.ONE)||u.equals(e.NEG_ONE))return e.MIN_VALUE;if(u.equals(e.MIN_VALUE))return e.ONE;var E=this.shiftRight(1);return l=E.divide(u).shiftLeft(1),l.equals(e.ZERO)?u.isNegative()?e.ONE:e.NEG_ONE:(y=this.subtract(u.multiply(l)),_=l.add(y.divide(u)),_)}else if(u.equals(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().divide(u.negate()):this.negate().divide(u).negate();if(u.isNegative())return this.divide(u.negate()).negate();for(_=e.ZERO,y=this;y.greaterThanOrEqual(u);){l=Math.max(1,Math.floor(y.toNumber()/u.toNumber()));for(var $=Math.ceil(Math.log(l)/Math.LN2),w=$<=48?1:Math.pow(2,$-48),T=e.fromNumber(l),h=T.multiply(u);h.isNegative()||h.greaterThan(y);)l-=w,T=e.fromNumber(l,this.unsigned),h=T.multiply(u);T.isZero()&&(T=e.ONE),_=_.add(T),y=y.subtract(h)}return _},e.prototype.div=e.prototype.divide,e.prototype.modulo=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.subtract(this.divide(u).multiply(u))},e.prototype.mod=e.prototype.modulo,e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.and=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low&u.low,this.high&u.high,this.unsigned)},e.prototype.or=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low|u.low,this.high|u.high,this.unsigned)},e.prototype.xor=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low^u.low,this.high^u.high,this.unsigned)},e.prototype.shiftLeft=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low<<u,this.high<<u|this.low>>>32-u,this.unsigned):e.fromBits(0,this.low<<u-32,this.unsigned)},e.prototype.shl=e.prototype.shiftLeft,e.prototype.shiftRight=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low>>>u|this.high<<32-u,this.high>>u,this.unsigned):e.fromBits(this.high>>u-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=e.prototype.shiftRight,e.prototype.shiftRightUnsigned=function(u){if(e.isLong(u)&&(u=u.toInt()),u&=63,u===0)return this;var l=this.high;if(u<32){var y=this.low;return e.fromBits(y>>>u|l<<32-u,l>>>u,this.unsigned)}else return u===32?e.fromBits(l,0,this.unsigned):e.fromBits(l>>>u-32,0,this.unsigned)},e.prototype.shru=e.prototype.shiftRightUnsigned,e.prototype.toSigned=function(){return this.unsigned?new e(this.low,this.high,!1):this},e.prototype.toUnsigned=function(){return this.unsigned?this:new e(this.low,this.high,!0)},e})})(zn),Object.defineProperty(pt,"__esModule",{value:!0}),pt.Hyper=void 0;var Uw=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),xo=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:r(a,t,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},Nw=zn.exports,dr=Fo(Nw),Cw=M,Lw=Fo(Cw);function Fo(r){return r&&r.__esModule?r:{default:r}}function jw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function kw(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function qw(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var yr=pt.Hyper=function(r){qw(e,r),Uw(e,null,[{key:"read",value:function(n){var i=n.readInt32BE(),a=n.readInt32BE();return this.fromBits(a,i)}},{key:"write",value:function(n,i){if(!(n instanceof this))throw new Error("XDR Write Error: "+n+" is not a Hyper");i.writeInt32BE(n.high),i.writeInt32BE(n.low)}},{key:"fromString",value:function(n){if(!/^-?\d+$/.test(n))throw new Error("Invalid hyper string: "+n);var i=xo(e.__proto__||Object.getPrototypeOf(e),"fromString",this).call(this,n,!1);return new this(i.low,i.high)}},{key:"fromBits",value:function(n,i){var a=xo(e.__proto__||Object.getPrototypeOf(e),"fromBits",this).call(this,n,i,!1);return new this(a.low,a.high)}},{key:"isValid",value:function(n){return n instanceof this}}]);function e(t,n){return jw(this,e),kw(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(dr.default);(0,Lw.default)(yr),yr.MAX_VALUE=new yr(dr.default.MAX_VALUE.low,dr.default.MAX_VALUE.high),yr.MIN_VALUE=new yr(dr.default.MIN_VALUE.low,dr.default.MIN_VALUE.high);var Pe={};Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.UnsignedInt=void 0;var Vw=Zr,Ro=Mo(Vw),Gw=M,Ww=Mo(Gw);function Mo(r){return r&&r.__esModule?r:{default:r}}var vr=Pe.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,Ro.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");if(e<0)throw new Error("XDR Write Error: negative number "+e);t.writeUInt32BE(e)},isValid:function(e){return!(0,Ro.default)(e)||Math.floor(e)!==e?!1:e>=vr.MIN_VALUE&&e<=vr.MAX_VALUE}};vr.MAX_VALUE=Math.pow(2,32)-1,vr.MIN_VALUE=0,(0,Ww.default)(vr);var ht={};Object.defineProperty(ht,"__esModule",{value:!0}),ht.UnsignedHyper=void 0;var Hw=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Bo=function r(e,t,n){e===null&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,t);if(i===void 0){var a=Object.getPrototypeOf(e);return a===null?void 0:r(a,t,n)}else{if("value"in i)return i.value;var o=i.get;return o===void 0?void 0:o.call(n)}},Xw=zn.exports,gr=Do(Xw),zw=M,Yw=Do(zw);function Do(r){return r&&r.__esModule?r:{default:r}}function Kw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Zw(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function Jw(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var _r=ht.UnsignedHyper=function(r){Jw(e,r),Hw(e,null,[{key:"read",value:function(n){var i=n.readInt32BE(),a=n.readInt32BE();return this.fromBits(a,i)}},{key:"write",value:function(n,i){if(!(n instanceof this))throw new Error("XDR Write Error: "+n+" is not an UnsignedHyper");i.writeInt32BE(n.high),i.writeInt32BE(n.low)}},{key:"fromString",value:function(n){if(!/^\d+$/.test(n))throw new Error("Invalid hyper string: "+n);var i=Bo(e.__proto__||Object.getPrototypeOf(e),"fromString",this).call(this,n,!0);return new this(i.low,i.high)}},{key:"fromBits",value:function(n,i){var a=Bo(e.__proto__||Object.getPrototypeOf(e),"fromBits",this).call(this,n,i,!0);return new this(a.low,a.high)}},{key:"isValid",value:function(n){return n instanceof this}}]);function e(t,n){return Kw(this,e),Zw(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(gr.default);(0,Yw.default)(_r),_r.MAX_VALUE=new _r(gr.default.MAX_UNSIGNED_VALUE.low,gr.default.MAX_UNSIGNED_VALUE.high),_r.MIN_VALUE=new _r(gr.default.MIN_VALUE.low,gr.default.MIN_VALUE.high);var dt={};Object.defineProperty(dt,"__esModule",{value:!0}),dt.Float=void 0;var Qw=Zr,Uo=No(Qw),eb=M,rb=No(eb);function No(r){return r&&r.__esModule?r:{default:r}}var tb=dt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,Uo.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,Uo.default)(e)}};(0,rb.default)(tb);var yt={};Object.defineProperty(yt,"__esModule",{value:!0}),yt.Double=void 0;var nb=Zr,Co=Lo(nb),ib=M,ab=Lo(ib);function Lo(r){return r&&r.__esModule?r:{default:r}}var ob=yt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,Co.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,Co.default)(e)}};(0,ab.default)(ob);var vt={};Object.defineProperty(vt,"__esModule",{value:!0}),vt.Quadruple=void 0;var ub=M,sb=fb(ub);function fb(r){return r&&r.__esModule?r:{default:r}}var cb=vt.Quadruple={read:function(){throw new Error("XDR Read Error: quadruple not supported")},write:function(){throw new Error("XDR Write Error: quadruple not supported")},isValid:function(){return!1}};(0,sb.default)(cb);var mr={},lb=ue,pb=W,hb="[object Boolean]";function db(r){return r===!0||r===!1||pb(r)&&lb(r)==hb}var yb=db;Object.defineProperty(mr,"__esModule",{value:!0}),mr.Bool=void 0;var vb=yb,gb=ko(vb),jo=oe,_b=M,mb=ko(_b);function ko(r){return r&&r.__esModule?r:{default:r}}var wb=mr.Bool={read:function(e){var t=jo.Int.read(e);switch(t){case 0:return!1;case 1:return!0;default:throw new Error("XDR Read Error: Got "+t+" when trying to read a bool")}},write:function(e,t){var n=e?1:0;return jo.Int.write(n,t)},isValid:function(e){return(0,gb.default)(e)}};(0,mb.default)(wb);var gt={},bb=ue,$b=N,Eb=W,Ab="[object String]";function Ob(r){return typeof r=="string"||!$b(r)&&Eb(r)&&bb(r)==Ab}var qo=Ob;Object.defineProperty(gt,"__esModule",{value:!0}),gt.String=void 0;var Sb=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Tb=qo,Vo=Yn(Tb),Ib=N,Pb=Yn(Ib),Go=oe,xb=Pe,Wo=Te,Fb=M,Rb=Yn(Fb);function Yn(r){return r&&r.__esModule?r:{default:r}}function Mb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Bb=gt.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:xb.UnsignedInt.MAX_VALUE;Mb(this,r),this._maxLength=e}return Sb(r,[{key:"read",value:function(t){var n=Go.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length String,"+("max allowed is "+this._maxLength));var i=(0,Wo.calculatePadding)(n),a=t.slice(n);return(0,Wo.slicePadding)(t,i),a.buffer()}},{key:"readString",value:function(t){return this.read(t).toString("utf8")}},{key:"write",value:function(t,n){if(t.length>this._maxLength)throw new Error("XDR Write Error: Got "+t.length+" bytes,"+("max allows is "+this._maxLength));var i=void 0;(0,Vo.default)(t)?i=d.from(t,"utf8"):i=d.from(t),Go.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,Vo.default)(t))n=d.from(t,"utf8");else if((0,Pb.default)(t)||d.isBuffer(t))n=d.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,Rb.default)(Bb.prototype);var _t={};Object.defineProperty(_t,"__esModule",{value:!0}),_t.Opaque=void 0;var Db=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Ho=Te,Ub=M,Nb=Cb(Ub);function Cb(r){return r&&r.__esModule?r:{default:r}}function Lb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var jb=_t.Opaque=function(){function r(e){Lb(this,r),this._length=e,this._padding=(0,Ho.calculatePadding)(e)}return Db(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Ho.slicePadding)(t,this._padding),n.buffer()}},{key:"write",value:function(t,n){if(t.length!==this._length)throw new Error("XDR Write Error: Got "+t.length+" bytes, expected "+this._length);n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return d.isBuffer(t)&&t.length===this._length}}]),r}();(0,Nb.default)(jb.prototype);var mt={};Object.defineProperty(mt,"__esModule",{value:!0}),mt.VarOpaque=void 0;var kb=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Xo=oe,qb=Pe,zo=Te,Vb=M,Gb=Wb(Vb);function Wb(r){return r&&r.__esModule?r:{default:r}}function Hb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Xb=mt.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qb.UnsignedInt.MAX_VALUE;Hb(this,r),this._maxLength=e}return kb(r,[{key:"read",value:function(t){var n=Xo.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length VarOpaque,"+("max allowed is "+this._maxLength));var i=(0,zo.calculatePadding)(n),a=t.slice(n);return(0,zo.slicePadding)(t,i),a.buffer()}},{key:"write",value:function(t,n){if(t.length>this._maxLength)throw new Error("XDR Write Error: Got "+t.length+" bytes,"+("max allows is "+this._maxLength));Xo.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return d.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,Gb.default)(Xb.prototype);var wt={},xe={exports:{}};function zb(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var Yo=zb,Yb=Qr;function Kb(r){return typeof r=="function"?r:Yb}var Ko=Kb,Zb=Yo,Jb=xn,Qb=Ko,e1=N;function r1(r,e){var t=e1(r)?Zb:Jb;return t(r,Qb(e))}var t1=r1;(function(r){r.exports=t1})(xe);var n1=/\s/;function i1(r){for(var e=r.length;e--&&n1.test(r.charAt(e)););return e}var a1=i1,o1=a1,u1=/^\s+/;function s1(r){return r&&r.slice(0,o1(r)+1).replace(u1,"")}var f1=s1,c1=f1,Zo=ve,l1=ft,Jo=0/0,p1=/^[-+]0x[0-9a-f]+$/i,h1=/^0b[01]+$/i,d1=/^0o[0-7]+$/i,y1=parseInt;function v1(r){if(typeof r=="number")return r;if(l1(r))return Jo;if(Zo(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Zo(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=c1(r);var t=h1.test(r);return t||d1.test(r)?y1(r.slice(2),t?2:8):p1.test(r)?Jo:+r}var g1=v1,_1=g1,Qo=1/0,m1=17976931348623157e292;function w1(r){if(!r)return r===0?r:0;if(r=_1(r),r===Qo||r===-Qo){var e=r<0?-1:1;return e*m1}return r===r?r:0}var b1=w1,$1=b1;function E1(r){var e=$1(r),t=e%1;return e===e?t?e-t:e:0}var A1=E1,O1=Da,S1=Ko,T1=A1,I1=9007199254740991,Kn=4294967295,P1=Math.min;function x1(r,e){if(r=T1(r),r<1||r>I1)return[];var t=Kn,n=P1(r,Kn);e=S1(e),r-=Kn;for(var i=O1(n,e);++t<r;)e(t);return i}var eu=x1;Object.defineProperty(wt,"__esModule",{value:!0}),wt.Array=void 0;var F1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),R1=Hn,M1=wr(R1),B1=xe.exports,D1=wr(B1),U1=eu,N1=wr(U1),C1=N,ru=wr(C1),L1=M,j1=wr(L1);function wr(r){return r&&r.__esModule?r:{default:r}}function k1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var q1=wt.Array=function(){function r(e,t){k1(this,r),this._childType=e,this._length=t}return F1(r,[{key:"read",value:function(t){var n=this;return(0,N1.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,ru.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length!==this._length)throw new Error("XDR Write Error: Got array of size "+t.length+","+("expected "+this._length));(0,D1.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,ru.default)(t)||t.length!==this._length?!1:(0,M1.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,j1.default)(q1.prototype);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.VarArray=void 0;var V1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),G1=Hn,W1=br(G1),H1=xe.exports,X1=br(H1),z1=eu,Y1=br(z1),K1=N,tu=br(K1),Z1=Pe,nu=oe,J1=M,Q1=br(J1);function br(r){return r&&r.__esModule?r:{default:r}}function e$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var r$=bt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Z1.UnsignedInt.MAX_VALUE;e$(this,r),this._childType=e,this._maxLength=t}return V1(r,[{key:"read",value:function(t){var n=this,i=nu.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,Y1.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,tu.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length>this._maxLength)throw new Error("XDR Write Error: Got array of size "+t.length+","+("max allowed is "+this._maxLength));nu.Int.write(t.length,n),(0,X1.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,tu.default)(t)||t.length>this._maxLength?!1:(0,W1.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,Q1.default)(r$.prototype);var $t={};function t$(r){return r===null}var n$=t$;function i$(r){return r===void 0}var $r=i$;Object.defineProperty($t,"__esModule",{value:!0}),$t.Option=void 0;var a$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),o$=n$,iu=Zn(o$),u$=$r,au=Zn(u$),ou=mr,s$=M,f$=Zn(s$);function Zn(r){return r&&r.__esModule?r:{default:r}}function c$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var l$=$t.Option=function(){function r(e){c$(this,r),this._childType=e}return a$(r,[{key:"read",value:function(t){if(ou.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,iu.default)(t)||(0,au.default)(t));ou.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,iu.default)(t)||(0,au.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,f$.default)(l$.prototype);var Er={};Object.defineProperty(Er,"__esModule",{value:!0}),Er.Void=void 0;var p$=$r,uu=su(p$),h$=M,d$=su(h$);function su(r){return r&&r.__esModule?r:{default:r}}var y$=Er.Void={read:function(){},write:function(e){if(!(0,uu.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,uu.default)(e)}};(0,d$.default)(y$);var Et={},v$=ct;function g$(r,e){return v$(e,function(t){return r[t]})}var _$=g$,m$=_$,w$=Ve;function b$(r){return r==null?[]:m$(r,w$(r))}var $$=b$;Object.defineProperty(Et,"__esModule",{value:!0}),Et.Enum=void 0;var E$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),A$=xe.exports,O$=Jn(A$),S$=$$,T$=Jn(S$),fu=oe,I$=M,P$=Jn(I$);function Jn(r){return r&&r.__esModule?r:{default:r}}function x$(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function F$(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function cu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var R$=Et.Enum=function(){function r(e,t){cu(this,r),this.name=e,this.value=t}return E$(r,null,[{key:"read",value:function(t){var n=fu.Int.read(t);if(!this._byValue.has(n))throw new Error("XDR Read Error: Unknown "+this.enumName+" member for value "+n);return this._byValue.get(n)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: Unknown "+t+" is not a "+this.enumName);fu.Int.write(t.value,n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"members",value:function(){return this._members}},{key:"values",value:function(){return(0,T$.default)(this._members)}},{key:"fromName",value:function(t){var n=this._members[t];if(!n)throw new Error(t+" is not a member of "+this.enumName);return n}},{key:"fromValue",value:function(t){var n=this._byValue.get(t);if(!n)throw new Error(t+" is not a value of any member of "+this.enumName);return n}},{key:"create",value:function(t,n,i){var a=function(o){F$(s,o);function s(){return cu(this,s),x$(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.enumName=n,t.results[n]=a,a._members={},a._byValue=new Map,(0,O$.default)(i,function(o,s){var f=new a(s,o);a._members[s]=f,a._byValue.set(o,f),a[s]=function(){return f}}),a}}]),r}();(0,P$.default)(R$);var At={},M$=xn,B$=fr;function D$(r,e){var t=-1,n=B$(r)?Array(r.length):[];return M$(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var U$=D$,N$=ct,C$=Ao,L$=U$,j$=N;function k$(r,e){var t=j$(r)?N$:L$;return t(r,C$(e))}var q$=k$;function V$(r){for(var e=-1,t=r==null?0:r.length,n={};++e<t;){var i=r[e];n[i[0]]=i[1]}return n}var G$=V$,Ar={};Object.defineProperty(Ar,"__esModule",{value:!0});var W$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function H$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Ar.Reference=function(){function r(){H$(this,r)}return W$(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(At,"__esModule",{value:!0}),At.Struct=void 0;var Ot=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),X$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),z$=xe.exports,lu=Or(z$),Y$=q$,K$=Or(Y$),Z$=$r,J$=Or(Z$),Q$=G$,eE=Or(Q$),rE=Ar,tE=M,nE=Or(tE);function Or(r){return r&&r.__esModule?r:{default:r}}function iE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function aE(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function pu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var oE=At.Struct=function(){function r(e){pu(this,r),this._attributes=e||{}}return X$(r,null,[{key:"read",value:function(t){var n=(0,K$.default)(this._fields,function(i){var a=Ot(i,2),o=a[0],s=a[1],f=s.read(t);return[o,f]});return new this((0,eE.default)(n))}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.structName);(0,lu.default)(this._fields,function(i){var a=Ot(i,2),o=a[0],s=a[1],f=t._attributes[o];s.write(f,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){aE(s,o);function s(){return pu(this,s),iE(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var s=Ot(o,2),f=s[0],c=s[1];return c instanceof rE.Reference&&(c=c.resolve(t)),[f,c]}),(0,lu.default)(a._fields,function(o){var s=Ot(o,1),f=s[0];a.prototype[f]=uE(f)}),a}}]),r}();(0,nE.default)(oE);function uE(r){return function(t){return(0,J$.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var St={};Object.defineProperty(St,"__esModule",{value:!0}),St.Union=void 0;var sE=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),fE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),cE=xe.exports,Tt=Pt(cE),lE=$r,hu=Pt(lE),pE=qo,du=Pt(pE),It=Er,Qn=Ar,hE=M,dE=Pt(hE);function Pt(r){return r&&r.__esModule?r:{default:r}}function yE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function vE(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function yu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var gE=St.Union=function(){function r(e,t){yu(this,r),this.set(e,t)}return fE(r,[{key:"set",value:function(t,n){(0,du.default)(t)&&(t=this.constructor._switchOn.fromName(t)),this._switch=t,this._arm=this.constructor.armForSwitch(this._switch),this._armType=this.constructor.armTypeForArm(this._arm),this._value=n}},{key:"get",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._arm;if(this._arm!==It.Void&&this._arm!==t)throw new Error(t+" not set");return this._value}},{key:"switch",value:function(){return this._switch}},{key:"arm",value:function(){return this._arm}},{key:"armType",value:function(){return this._armType}},{key:"value",value:function(){return this._value}}],[{key:"armForSwitch",value:function(t){if(this._switches.has(t))return this._switches.get(t);if(this._defaultArm)return this._defaultArm;throw new Error("Bad union switch: "+t)}},{key:"armTypeForArm",value:function(t){return t===It.Void?It.Void:this._arms[t]}},{key:"read",value:function(t){var n=this._switchOn.read(t),i=this.armForSwitch(n),a=this.armTypeForArm(i),o=void 0;return(0,hu.default)(a)?o=i.read(t):o=a.read(t),new this(n,o)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.unionName);this._switchOn.write(t.switch(),n),t.armType().write(t.value(),n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(s){vE(f,s);function f(){return yu(this,f),yE(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof Qn.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,Tt.default)(i.arms,function(s,f){s instanceof Qn.Reference&&(s=s.resolve(t)),a._arms[f]=s});var o=i.defaultArm;return o instanceof Qn.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Tt.default)(i.switches,function(s){var f=sE(s,2),c=f[0],p=f[1];(0,du.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,p)}),(0,hu.default)(a._switchOn.values)||(0,Tt.default)(a._switchOn.values(),function(s){a[s.name]=function(f){return new a(s,f)},a.prototype[s.name]=function(c){return this.set(s,c)}}),(0,Tt.default)(a._arms,function(s,f){s!==It.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,dE.default)(gE),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=oe;Object.keys(e).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return e[h]}})});var t=pt;Object.keys(t).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return t[h]}})});var n=Pe;Object.keys(n).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return n[h]}})});var i=ht;Object.keys(i).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return i[h]}})});var a=dt;Object.keys(a).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return a[h]}})});var o=yt;Object.keys(o).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return o[h]}})});var s=vt;Object.keys(s).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return s[h]}})});var f=mr;Object.keys(f).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return f[h]}})});var c=gt;Object.keys(c).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return c[h]}})});var p=_t;Object.keys(p).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return p[h]}})});var u=mt;Object.keys(u).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return u[h]}})});var l=wt;Object.keys(l).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return l[h]}})});var y=bt;Object.keys(y).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return y[h]}})});var _=$t;Object.keys(_).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return _[h]}})});var E=Er;Object.keys(E).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return E[h]}})});var $=Et;Object.keys($).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return $[h]}})});var w=At;Object.keys(w).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return w[h]}})});var T=St;Object.keys(T).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return T[h]}})})}($n);var vu={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(v,g){for(var b=0;b<g.length;b++){var O=g[b];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(v,O.key,O)}}return function(v,g,b){return g&&m(v.prototype,g),b&&m(v,b),v}}(),t=Ar;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=_;var n=$r,i=p(n),a=xe.exports,o=p(a),s=$n,f=c(s);function c(m){if(m&&m.__esModule)return m;var v={};if(m!=null)for(var g in m)Object.prototype.hasOwnProperty.call(m,g)&&(v[g]=m[g]);return v.default=m,v}function p(m){return m&&m.__esModule?m:{default:m}}function u(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function l(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function y(m,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);m.prototype=Object.create(v&&v.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(m,v):m.__proto__=v)}function _(m){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var g=new R(v);m(g),g.resolve()}return v}var E=function(m){y(v,m);function v(g){u(this,v);var b=l(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return b.name=g,b}return e(v,[{key:"resolve",value:function(b){var O=b.definitions[this.name];return O.resolve(b)}}]),v}(t.Reference),$=function(m){y(v,m);function v(g,b){var O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,v);var C=l(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return C.childReference=g,C.length=b,C.variable=O,C}return e(v,[{key:"resolve",value:function(b){var O=this.childReference,C=this.length;return O instanceof t.Reference&&(O=O.resolve(b)),C instanceof t.Reference&&(C=C.resolve(b)),this.variable?new f.VarArray(O,C):new f.Array(O,C)}}]),v}(t.Reference),w=function(m){y(v,m);function v(g){u(this,v);var b=l(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return b.childReference=g,b.name=g.name,b}return e(v,[{key:"resolve",value:function(b){var O=this.childReference;return O instanceof t.Reference&&(O=O.resolve(b)),new f.Option(O)}}]),v}(t.Reference),T=function(m){y(v,m);function v(g,b){u(this,v);var O=l(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return O.sizedType=g,O.length=b,O}return e(v,[{key:"resolve",value:function(b){var O=this.length;return O instanceof t.Reference&&(O=O.resolve(b)),new this.sizedType(O)}}]),v}(t.Reference),h=function(){function m(v,g,b){u(this,m),this.constructor=v,this.name=g,this.config=b}return e(m,[{key:"resolve",value:function(g){return this.name in g.results?g.results[this.name]:this.constructor(g,this.name,this.config)}}]),m}();function S(m,v,g){return g instanceof t.Reference&&(g=g.resolve(m)),m.results[v]=g,g}function P(m,v,g){return m.results[v]=g,g}var R=function(){function m(v){u(this,m),this._destination=v,this._definitions={}}return e(m,[{key:"enum",value:function(g,b){var O=new h(f.Enum.create,g,b);this.define(g,O)}},{key:"struct",value:function(g,b){var O=new h(f.Struct.create,g,b);this.define(g,O)}},{key:"union",value:function(g,b){var O=new h(f.Union.create,g,b);this.define(g,O)}},{key:"typedef",value:function(g,b){var O=new h(S,g,b);this.define(g,O)}},{key:"const",value:function(g,b){var O=new h(P,g,b);this.define(g,O)}},{key:"void",value:function(){return f.Void}},{key:"bool",value:function(){return f.Bool}},{key:"int",value:function(){return f.Int}},{key:"hyper",value:function(){return f.Hyper}},{key:"uint",value:function(){return f.UnsignedInt}},{key:"uhyper",value:function(){return f.UnsignedHyper}},{key:"float",value:function(){return f.Float}},{key:"double",value:function(){return f.Double}},{key:"quadruple",value:function(){return f.Quadruple}},{key:"string",value:function(g){return new T(f.String,g)}},{key:"opaque",value:function(g){return new T(f.Opaque,g)}},{key:"varOpaque",value:function(g){return new T(f.VarOpaque,g)}},{key:"array",value:function(g,b){return new $(g,b)}},{key:"varArray",value:function(g,b){return new $(g,b,!0)}},{key:"option",value:function(g){return new w(g)}},{key:"define",value:function(g,b){if((0,i.default)(this._destination[g]))this._definitions[g]=b;else throw new Error("XDRTypes Error:"+g+" is already defined")}},{key:"lookup",value:function(g){return new E(g)}},{key:"resolve",value:function(){var g=this;(0,o.default)(this._definitions,function(b){b.resolve({definitions:g._definitions,results:g._destination})})}}]),m}()})(vu),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=$n;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=vu;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(ga);const _E=ga.config(r=>{r.enum("EnvelopeType",{envelopeTypeBundle:0}),r.typedef("Uint32",r.uint()),r.typedef("Uint64",r.uhyper()),r.union("BundleItemExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("BundleItem",[["collectionId",r.lookup("Uint64")],["productId",r.lookup("Uint64")],["variantId",r.lookup("Uint64")],["sku",r.string()],["quantity",r.lookup("Uint32")],["ext",r.lookup("BundleItemExt")]]),r.union("BundleExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("Bundle",[["variantId",r.lookup("Uint64")],["items",r.varArray(r.lookup("BundleItem"),500)],["version",r.lookup("Uint32")],["ext",r.lookup("BundleExt")]]),r.union("BundleEnvelope",{switchOn:r.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeBundle","v1"]],arms:{v1:r.lookup("Bundle")}})}),se=_E;function mE(r){let e={variantId:se.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new se.BundleItem({collectionId:se.Uint64.fromString(n.collectionId.toString()),productId:se.Uint64.fromString(n.productId.toString()),variantId:se.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new se.BundleItemExt(0)})),ext:new se.BundleExt(0)};const t=new se.Bundle(e);return se.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}let wE=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");var bE=qe,$E=Ve;function EE(r,e){return r&&bE(e,$E(e),r)}var AE=EE,OE=qe,SE=et;function TE(r,e){return r&&OE(e,SE(e),r)}var IE=TE,ei={exports:{}};(function(r,e){var t=Q,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function f(c,p){if(p)return c.slice();var u=c.length,l=s?s(u):new c.constructor(u);return c.copy(l),l}r.exports=f})(ei,ei.exports);function PE(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var xE=PE,FE=qe,RE=Un;function ME(r,e){return FE(r,RE(r),e)}var BE=ME,DE=qa,UE=DE(Object.getPrototypeOf,Object),ri=UE,NE=Dn,CE=ri,LE=Un,jE=Za,kE=Object.getOwnPropertySymbols,qE=kE?function(r){for(var e=[];r;)NE(e,LE(r)),r=CE(r);return e}:jE,gu=qE,VE=qe,GE=gu;function WE(r,e){return VE(r,GE(r),e)}var HE=WE,XE=Ka,zE=gu,YE=et;function KE(r){return XE(r,YE,zE)}var _u=KE,ZE=Object.prototype,JE=ZE.hasOwnProperty;function QE(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&JE.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var eA=QE,mu=Ha;function rA(r){var e=new r.constructor(r.byteLength);return new mu(e).set(new mu(r)),e}var ti=rA,tA=ti;function nA(r,e){var t=e?tA(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}var iA=nA,aA=/\w*$/;function oA(r){var e=new r.constructor(r.source,aA.exec(r));return e.lastIndex=r.lastIndex,e}var uA=oA,wu=ke,bu=wu?wu.prototype:void 0,$u=bu?bu.valueOf:void 0;function sA(r){return $u?Object($u.call(r)):{}}var fA=sA,cA=ti;function lA(r,e){var t=e?cA(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var pA=lA,hA=ti,dA=iA,yA=uA,vA=fA,gA=pA,_A="[object Boolean]",mA="[object Date]",wA="[object Map]",bA="[object Number]",$A="[object RegExp]",EA="[object Set]",AA="[object String]",OA="[object Symbol]",SA="[object ArrayBuffer]",TA="[object DataView]",IA="[object Float32Array]",PA="[object Float64Array]",xA="[object Int8Array]",FA="[object Int16Array]",RA="[object Int32Array]",MA="[object Uint8Array]",BA="[object Uint8ClampedArray]",DA="[object Uint16Array]",UA="[object Uint32Array]";function NA(r,e,t){var n=r.constructor;switch(e){case SA:return hA(r);case _A:case mA:return new n(+r);case TA:return dA(r,t);case IA:case PA:case xA:case FA:case RA:case MA:case BA:case DA:case UA:return gA(r,t);case wA:return new n;case bA:case AA:return new n(r);case $A:return yA(r);case EA:return new n;case OA:return vA(r)}}var CA=NA,LA=ve,Eu=Object.create,jA=function(){function r(){}return function(e){if(!LA(e))return{};if(Eu)return Eu(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}(),kA=jA,qA=kA,VA=ri,GA=Pn;function WA(r){return typeof r.constructor=="function"&&!GA(r)?qA(VA(r)):{}}var HA=WA,XA=ut,zA=W,YA="[object Map]";function KA(r){return zA(r)&&XA(r)==YA}var ZA=KA,JA=ZA,QA=In,Au=lr.exports,Ou=Au&&Au.isMap,eO=Ou?QA(Ou):JA,rO=eO,tO=ut,nO=W,iO="[object Set]";function aO(r){return nO(r)&&tO(r)==iO}var oO=aO,uO=oO,sO=In,Su=lr.exports,Tu=Su&&Su.isSet,fO=Tu?sO(Tu):uO,cO=fO,lO=Mn,pO=Yo,hO=Pa,dO=AE,yO=IE,vO=ei.exports,gO=xE,_O=BE,mO=HE,wO=Qa,bO=_u,$O=ut,EO=eA,AO=CA,OO=HA,SO=N,TO=cr.exports,IO=rO,PO=ve,xO=cO,FO=Ve,RO=et,MO=1,BO=2,DO=4,Iu="[object Arguments]",UO="[object Array]",NO="[object Boolean]",CO="[object Date]",LO="[object Error]",Pu="[object Function]",jO="[object GeneratorFunction]",kO="[object Map]",qO="[object Number]",xu="[object Object]",VO="[object RegExp]",GO="[object Set]",WO="[object String]",HO="[object Symbol]",XO="[object WeakMap]",zO="[object ArrayBuffer]",YO="[object DataView]",KO="[object Float32Array]",ZO="[object Float64Array]",JO="[object Int8Array]",QO="[object Int16Array]",eS="[object Int32Array]",rS="[object Uint8Array]",tS="[object Uint8ClampedArray]",nS="[object Uint16Array]",iS="[object Uint32Array]",x={};x[Iu]=x[UO]=x[zO]=x[YO]=x[NO]=x[CO]=x[KO]=x[ZO]=x[JO]=x[QO]=x[eS]=x[kO]=x[qO]=x[xu]=x[VO]=x[GO]=x[WO]=x[HO]=x[rS]=x[tS]=x[nS]=x[iS]=!0,x[LO]=x[Pu]=x[XO]=!1;function xt(r,e,t,n,i,a){var o,s=e&MO,f=e&BO,c=e&DO;if(t&&(o=i?t(r,n,i,a):t(r)),o!==void 0)return o;if(!PO(r))return r;var p=SO(r);if(p){if(o=EO(r),!s)return gO(r,o)}else{var u=$O(r),l=u==Pu||u==jO;if(TO(r))return vO(r,s);if(u==xu||u==Iu||l&&!i){if(o=f||l?{}:OO(r),!s)return f?mO(r,yO(o,r)):_O(r,dO(o,r))}else{if(!x[u])return i?r:{};o=AO(r,u,s)}}a||(a=new lO);var y=a.get(r);if(y)return y;a.set(r,o),xO(r)?r.forEach(function($){o.add(xt($,e,t,$,r,a))}):IO(r)&&r.forEach(function($,w){o.set(w,xt($,e,t,w,r,a))});var _=c?f?bO:wO:f?RO:FO,E=p?void 0:_(r);return pO(E||r,function($,w){E&&(w=$,$=r[w]),hO(o,w,xt($,e,t,w,r,a))}),o}var aS=xt;function oS(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var uS=oS;function sS(r,e,t){var n=-1,i=r.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=r[n+e];return a}var fS=sS,cS=Wn,lS=fS;function pS(r,e){return e.length<2?r:cS(r,lS(e,0,-1))}var hS=pS,dS=lt,yS=uS,vS=hS,gS=pr;function _S(r,e){return e=dS(e,r),r=vS(r,e),r==null||delete r[gS(yS(e))]}var mS=_S,wS=ue,bS=ri,$S=W,ES="[object Object]",AS=Function.prototype,OS=Object.prototype,Fu=AS.toString,SS=OS.hasOwnProperty,TS=Fu.call(Object);function IS(r){if(!$S(r)||wS(r)!=ES)return!1;var e=bS(r);if(e===null)return!0;var t=SS.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Fu.call(t)==TS}var PS=IS,xS=PS;function FS(r){return xS(r)?void 0:r}var RS=FS,Ru=ke,MS=Tn,BS=N,Mu=Ru?Ru.isConcatSpreadable:void 0;function DS(r){return BS(r)||MS(r)||!!(Mu&&r&&r[Mu])}var US=DS,NS=Dn,CS=US;function Bu(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=CS),i||(i=[]);++a<o;){var s=r[a];e>0&&t(s)?e>1?Bu(s,e-1,t,n,i):NS(i,s):n||(i[i.length]=s)}return i}var LS=Bu,jS=LS;function kS(r){var e=r==null?0:r.length;return e?jS(r,1):[]}var qS=kS,VS=qS,GS=Fa,WS=Ma;function HS(r){return WS(GS(r,void 0,VS),r+"")}var XS=HS,zS=ct,YS=aS,KS=mS,ZS=lt,JS=qe,QS=RS,eT=XS,rT=_u,tT=1,nT=2,iT=4,aT=eT(function(r,e){var t={};if(r==null)return t;var n=!1;e=zS(e,function(a){return a=ZS(a,r),n||(n=a.length>1),a}),JS(r,rT(r),t),n&&(t=YS(t,tT|nT|iT,QS));for(var i=e.length;i--;)KS(t,e[i]);return t}),oT=aT,uT=Object.defineProperty,sT=Object.defineProperties,fT=Object.getOwnPropertyDescriptors,Du=Object.getOwnPropertySymbols,cT=Object.prototype.hasOwnProperty,lT=Object.prototype.propertyIsEnumerable,Uu=(r,e,t)=>e in r?uT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,pT=(r,e)=>{for(var t in e||(e={}))cT.call(e,t)&&Uu(r,t,e[t]);if(Du)for(var t of Du(e))lT.call(e,t)&&Uu(r,t,e[t]);return r},hT=(r,e)=>sT(r,fT(e));function dT(r){try{return JSON.parse(r)}catch{return r}}function yT(r){return Object.entries(r).reduce((e,[t,n])=>hT(pT({},e),{[t]:dT(n)}),{})}var vT=Object.defineProperty,gT=Object.defineProperties,_T=Object.getOwnPropertyDescriptors,Nu=Object.getOwnPropertySymbols,mT=Object.prototype.hasOwnProperty,wT=Object.prototype.propertyIsEnumerable,Cu=(r,e,t)=>e in r?vT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Lu=(r,e)=>{for(var t in e||(e={}))mT.call(e,t)&&Cu(r,t,e[t]);if(Nu)for(var t of Nu(e))wT.call(e,t)&&Cu(r,t,e[t]);return r},ju=(r,e)=>gT(r,_T(e));function ku(r){var e;const t=yT(r),n=t.auto_inject===void 0?!0:t.auto_inject,i=(e=t.display_on)!=null?e:[],a=t.first_option==="autodeliver";return ju(Lu({},oT(t,["display_on","first_option"])),{auto_inject:n,valid_pages:i,is_subscription_first:a,autoInject:n,validPages:i,isSubscriptionFirst:a})}function qu(r){var e;const t=((e=r.subscription_options)==null?void 0:e.storefront_purchase_options)==="subscription_only";return ju(Lu({},r),{is_subscription_only:t,isSubscriptionOnly:t})}function bT(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=qu(i)}),t})}const Ft="2020-12",$T={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Sr=new Map;function Rt(r,e){return Sr.has(r)||Sr.set(r,e()),Sr.get(r)}async function ni(r){const{product:e}=await Rt(`product.${r}`,()=>Kr("get",`/product/${Ft}/${r}.json`));return qu(e)}async function Vu(){return await Rt("storeSettings",()=>Kr("get",`/${Ft}/store_settings.json`).catch(()=>$T))}async function Gu(){const{widget_settings:r}=await Rt("widgetSettings",()=>Kr("get",`/${Ft}/widget_settings.json`));return ku(r)}async function Wu(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await Rt("productsAndSettings",()=>Kr("get",`/product/${Ft}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:bT(r),widget_settings:ku(e),store_settings:t??{}}}async function ET(){const{products:r}=await Wu();return r}async function AT(r){const[e,t,n]=await Promise.all([ni(r),Vu(),Gu()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function Hu(r){const{bundle_product:e}=await ni(r);return e}async function Xu(){return Array.from(Sr.keys()).forEach(r=>Sr.delete(r))}var OT=Object.freeze({__proto__:null,getCDNProduct:ni,getCDNStoreSettings:Vu,getCDNWidgetSettings:Gu,getCDNProductsAndSettings:Wu,getCDNProducts:ET,getCDNProductAndSettings:AT,getCDNBundleSettings:Hu,resetCDNCache:Xu});const zu="/bundling-storefront-manager";function ST(){return Math.ceil(Date.now()/1e3)}async function TT(){try{const{timestamp:r}=await ur("get",`${zu}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),ST()}}async function IT(r){const e=ae(),t=await Yu(r);if(t!==!0)throw new Error(t);const n=await TT(),i=mE({variantId:r.externalVariantId,version:n,items:r.selections.map(a=>({collectionId:a.collectionId,productId:a.externalProductId,variantId:a.externalVariantId,quantity:a.quantity,sku:""}))});try{const a=await ur("post",`${zu}/api/v1/bundles`,{data:{bundle:i},headers:{Origin:`https://${e.storeIdentifier}`}});if(!a.id||a.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(a)}`);return a.id}catch(a){throw new Error(`2: failed generating rb_id ${a}`)}}function PT(r,e){const t=Ku(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${wE(9)}:${r.externalProductId}`;return r.selections.map(i=>{const a={id:i.externalVariantId,quantity:i.quantity,properties:{_rc_bundle:n,_rc_bundle_variant:r.externalVariantId,_rc_bundle_parent:e,_rc_bundle_collection_id:i.collectionId}};return i.sellingPlan?a.selling_plan=i.sellingPlan:i.shippingIntervalFrequency&&(a.properties.shipping_interval_frequency=i.shippingIntervalFrequency,a.properties.shipping_interval_unit_type=i.shippingIntervalUnitType,a.id=`${i.discountedVariantId}`),a})}async function Yu(r){try{return r?await Hu(r.externalProductId)?!0:"Bundle settings do not exist for the given product":"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}const xT={day:["day","days","Days"],days:["day","days","Days"],Days:["day","days","Days"],week:["week","weeks","Weeks"],weeks:["week","weeks","Weeks"],Weeks:["week","weeks","Weeks"],month:["month","months","Months"],months:["month","months","Months"],Months:["month","months","Months"]};function Ku(r){if(!r)return"No bundle defined.";if(r.selections.length===0)return"No selections defined.";const{shippingIntervalFrequency:e,shippingIntervalUnitType:t}=r.selections.find(n=>n.shippingIntervalFrequency||n.shippingIntervalUnitType)||{};if(e||t){if(!e||!t)return"Shipping intervals do not match on selections.";{const n=xT[t];for(let i=0;i<r.selections.length;i++){const{shippingIntervalFrequency:a,shippingIntervalUnitType:o}=r.selections[i];if(a&&a!==e||o&&!n.includes(o))return"Shipping intervals do not match on selections."}}}return!0}async function FT(r,e){const{bundle_selection:t}=await A("get","/bundle_selections",{id:e},r);return t}function RT(r,e){return A("get","/bundle_selections",{query:e},r)}async function MT(r,e){const{bundle_selection:t}=await A("post","/bundle_selections",{data:e},r);return t}async function BT(r,e,t){const{bundle_selection:n}=await A("put","/bundle_selections",{id:e,data:t},r);return n}function DT(r,e){return A("delete","/bundle_selections",{id:e},r)}var UT=Object.freeze({__proto__:null,getBundleId:IT,getDynamicBundleItems:PT,validateBundle:Yu,validateDynamicBundle:Ku,getBundleSelection:FT,listBundleSelections:RT,createBundleSelection:MT,updateBundleSelection:BT,deleteBundleSelection:DT});async function NT(r,e,t){const{charge:n}=await A("get","/charges",{id:e,query:{include:t?.include}},r);return n}function CT(r,e){return A("get","/charges",{query:e},r)}async function LT(r,e,t){const{charge:n}=await A("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},r);return n}async function jT(r,e){const{charge:t}=await A("post",`/charges/${e}/remove_discount`,{},r);return t}async function kT(r,e){const{charge:t}=await A("post",`/charges/${e}/skip`,{},r);return t}async function qT(r,e){const{charge:t}=await A("post",`/charges/${e}/unskip`,{},r);return t}async function VT(r,e){const{charge:t}=await A("post",`/charges/${e}/process`,{},r);return t}var GT=Object.freeze({__proto__:null,getCharge:NT,listCharges:CT,applyDiscountToCharge:LT,removeDiscountsFromCharge:jT,skipCharge:kT,unskipCharge:qT,processCharge:VT});async function WT(r,e){const{membership:t}=await A("get","/memberships",{id:e},r);return t}function HT(r,e){return A("get","/memberships",{query:e},r)}async function XT(r,e,t){const{membership:n}=await A("post",`/memberships/${e}/cancel`,{data:t},r);return n}async function zT(r,e,t){const{membership:n}=await A("post",`/memberships/${e}/activate`,{data:t},r);return n}var YT=Object.freeze({__proto__:null,getMembership:WT,listMemberships:HT,cancelMembership:XT,activateMembership:zT});async function KT(r,e){const{metafield:t}=await A("post","/metafields",{data:{metafield:e}},r);return t}async function ZT(r,e,t){const{metafield:n}=await A("put","/metafields",{id:e,data:{metafield:t}},r);return n}function JT(r,e){return A("delete","/metafields",{id:e},r)}var QT=Object.freeze({__proto__:null,createMetafield:KT,updateMetafield:ZT,deleteMetafield:JT});async function e2(r,e){const{onetime:t}=await A("get","/onetimes",{id:e},r);return t}function r2(r,e){return A("get","/onetimes",{query:e},r)}async function t2(r,e){const{onetime:t}=await A("post","/onetimes",{data:e},r);return t}async function n2(r,e,t){const{onetime:n}=await A("put","/onetimes",{id:e,data:t},r);return n}function i2(r,e){return A("delete","/onetimes",{id:e},r)}var a2=Object.freeze({__proto__:null,getOnetime:e2,listOnetimes:r2,createOnetime:t2,updateOnetime:n2,deleteOnetime:i2});async function o2(r,e){const{order:t}=await A("get","/orders",{id:e},r);return t}function u2(r,e){return A("get","/orders",{query:e},r)}var s2=Object.freeze({__proto__:null,getOrder:o2,listOrders:u2});async function f2(r,e,t){const{payment_method:n}=await A("get","/payment_methods",{id:e,query:{include:t?.include}},r);return n}async function c2(r,e,t){const{payment_method:n}=await A("put","/payment_methods",{id:e,data:t},r);return n}function l2(r,e){return A("get","/payment_methods",{query:e},r)}var p2=Object.freeze({__proto__:null,getPaymentMethod:f2,updatePaymentMethod:c2,listPaymentMethods:l2});async function h2(r,e){const{plan:t}=await A("get","/plans",{id:e},r);return t}function d2(r,e){return A("get","/plans",{query:e},r)}var y2=Object.freeze({__proto__:null,getPlan:h2,listPlans:d2});async function v2(r,e,t){const{subscription:n}=await A("get","/subscriptions",{id:e,query:{include:t?.include}},r);return n}function g2(r,e){return A("get","/subscriptions",{query:e},r)}async function _2(r,e){const{subscription:t}=await A("post","/subscriptions",{data:e},r);return t}async function m2(r,e,t,n){const{subscription:i}=await A("put","/subscriptions",{id:e,data:t,query:n},r);return i}async function w2(r,e,t){const{subscription:n}=await A("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t}},r);return n}async function b2(r,e,t){const{subscription:n}=await A("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},r);return n}async function $2(r,e,t){const{subscription:n}=await A("post",`/subscriptions/${e}/cancel`,{data:t},r);return n}async function E2(r,e){const{subscription:t}=await A("post",`/subscriptions/${e}/activate`,{},r);return t}async function A2(r,e,t){const{charge:n}=await A("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},r);return n}var O2=Object.freeze({__proto__:null,getSubscription:v2,listSubscriptions:g2,createSubscription:_2,updateSubscription:m2,updateSubscriptionChargeDate:w2,updateSubscriptionAddress:b2,cancelSubscription:$2,activateSubscription:E2,skipSubscriptionCharge:A2});async function S2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await A("get","/customers",{id:t,query:{include:e?.include}},r);return n}async function T2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await A("put","/customers",{id:t,data:e},r);return n}async function I2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await A("get",`/customers/${t}/delivery_schedule`,{query:e},r);return n}async function P2(r){return await A("get","/portal_access",{},r)}var x2=Object.freeze({__proto__:null,getCustomer:S2,updateCustomer:T2,getDeliverySchedule:I2,getCustomerPortalAccess:P2});const F2={get(r,e){return G("get",r,e)},post(r,e){return G("post",r,e)},put(r,e){return G("put",r,e)},delete(r,e){return G("delete",r,e)}};function R2(r){var e,t;if(r)return r;if((e=window?.Shopify)!=null&&e.shop)return window.Shopify.shop;let n=window?.domain;if(!n){const i=(t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i))==null?void 0:t[1].replace(/-sp$/,"");i&&(n=`${i}.myshopify.com`)}if(n)return n;throw new Error("No storeIdentifier was passed into init.")}function M2(r={}){const e=r;ol({storeIdentifier:R2(r.storeIdentifier),loginRetryFn:r.loginRetryFn,storefrontAccessToken:r.storefrontAccessToken,environment:e.environment?e.environment:"prod"}),Xu()}const Zu={init:M2,api:F2,address:Ol,auth:Rl,bundle:UT,charge:GT,cdn:OT,customer:x2,membership:YT,metafield:QT,onetime:a2,order:s2,paymentMethod:p2,plan:y2,subscription:O2};try{Zu.init()}catch{}return Zu});
|