@rechargeapps/storefront-client 1.18.2 → 1.19.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/dist/cjs/api/auth.js +2 -1
- package/dist/cjs/api/auth.js.map +1 -1
- package/dist/cjs/api/credit.js +51 -0
- package/dist/cjs/api/credit.js.map +1 -0
- package/dist/cjs/api/customer.js +0 -16
- package/dist/cjs/api/customer.js.map +1 -1
- package/dist/cjs/index.js +4 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/init.js +2 -1
- package/dist/cjs/utils/init.js.map +1 -1
- package/dist/esm/api/auth.js +2 -1
- package/dist/esm/api/auth.js.map +1 -1
- package/dist/esm/api/credit.js +47 -0
- package/dist/esm/api/credit.js.map +1 -0
- package/dist/esm/api/customer.js +1 -16
- package/dist/esm/api/customer.js.map +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/init.js +2 -1
- package/dist/esm/utils/init.js.map +1 -1
- package/dist/index.d.ts +73 -45
- package/dist/umd/recharge-client.min.js +10 -10
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
// recharge-client-1.
|
|
2
|
-
(function(U,ve){typeof exports=="object"&&typeof module<"u"?module.exports=ve():typeof define=="function"&&define.amd?define(ve):(U=typeof globalThis<"u"?globalThis:U||self,U.recharge=ve())})(this,function(){"use strict";var U=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ve(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function
|
|
3
|
-
`)===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}Si.call(_e.prototype);function Y(r,e){if(!(this instanceof Y))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 N(e.headers),this.url=e.url||"",this._initBody(r)}Si.call(Y.prototype),Y.prototype.clone=function(){return new Y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new N(this.headers),url:this.url})},Y.error=function(){var r=new Y(null,{status:0,statusText:""});return r.type="error",r};var Vs=[301,302,303,307,308];Y.redirect=function(r,e){if(Vs.indexOf(e)===-1)throw new RangeError("Invalid status code");return new Y(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 Ii(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:js(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 Y(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 u(f){try{return f===""&&L.location.href?L.location.href:f}catch{return f}}a.open(i.method,u(i.url),!0),i.credentials==="include"?a.withCredentials=!0:i.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(V.blob?a.responseType="blob":V.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 N)?Object.getOwnPropertyNames(e.headers).forEach(function(f){a.setRequestHeader(f,Xt(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)})}Ii.polyfill=!0,L.fetch||(L.fetch=Ii,L.Headers=N,L.Request=_e,L.Response=Y),self.fetch.bind(self);let Gs="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Pi=(r=21)=>{let e="",t=r;for(;t--;)e+=Gs[Math.random()*64|0];return e};var Hs=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},xi=typeof Symbol<"u"&&Symbol,Ws=Hs,Xs=function(){return typeof xi!="function"||typeof Symbol!="function"||typeof xi("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Ws()},Ti={foo:{}},zs=Object,Ys=function(){return{__proto__:Ti}.foo===Ti.foo&&!({__proto__:null}instanceof zs)},Ks="Function.prototype.bind called on incompatible ",Kt=Array.prototype.slice,Zs=Object.prototype.toString,Js="[object Function]",Qs=function(e){var t=this;if(typeof t!="function"||Zs.call(t)!==Js)throw new TypeError(Ks+t);for(var n=Kt.call(arguments,1),i,a=function(){if(this instanceof i){var l=t.apply(this,n.concat(Kt.call(arguments)));return Object(l)===l?l:this}else return t.apply(e,n.concat(Kt.call(arguments)))},o=Math.max(0,t.length-n.length),u=[],f=0;f<o;f++)u.push("$"+f);if(i=Function("binder","return function ("+u.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},ef=Qs,Zt=Function.prototype.bind||ef,rf=Zt,tf=rf.call(Function.call,Object.prototype.hasOwnProperty),x,Ne=SyntaxError,Fi=Function,Be=TypeError,Jt=function(r){try{return Fi('"use strict"; return ('+r+").constructor;")()}catch{}},we=Object.getOwnPropertyDescriptor;if(we)try{we({},"")}catch{we=null}var Qt=function(){throw new Be},nf=we?function(){try{return arguments.callee,Qt}catch{try{return we(arguments,"callee").get}catch{return Qt}}}():Qt,De=Xs(),af=Ys(),B=Object.getPrototypeOf||(af?function(r){return r.__proto__}:null),Ue={},of=typeof Uint8Array>"u"||!B?x:B(Uint8Array),be={"%AggregateError%":typeof AggregateError>"u"?x:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?x:ArrayBuffer,"%ArrayIteratorPrototype%":De&&B?B([][Symbol.iterator]()):x,"%AsyncFromSyncIteratorPrototype%":x,"%AsyncFunction%":Ue,"%AsyncGenerator%":Ue,"%AsyncGeneratorFunction%":Ue,"%AsyncIteratorPrototype%":Ue,"%Atomics%":typeof Atomics>"u"?x:Atomics,"%BigInt%":typeof BigInt>"u"?x:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?x:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?x:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?x:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?x:Float32Array,"%Float64Array%":typeof Float64Array>"u"?x:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?x:FinalizationRegistry,"%Function%":Fi,"%GeneratorFunction%":Ue,"%Int8Array%":typeof Int8Array>"u"?x:Int8Array,"%Int16Array%":typeof Int16Array>"u"?x:Int16Array,"%Int32Array%":typeof Int32Array>"u"?x:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":De&&B?B(B([][Symbol.iterator]())):x,"%JSON%":typeof JSON=="object"?JSON:x,"%Map%":typeof Map>"u"?x:Map,"%MapIteratorPrototype%":typeof Map>"u"||!De||!B?x:B(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?x:Promise,"%Proxy%":typeof Proxy>"u"?x:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?x:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?x:Set,"%SetIteratorPrototype%":typeof Set>"u"||!De||!B?x:B(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?x:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":De&&B?B(""[Symbol.iterator]()):x,"%Symbol%":De?Symbol:x,"%SyntaxError%":Ne,"%ThrowTypeError%":nf,"%TypedArray%":of,"%TypeError%":Be,"%Uint8Array%":typeof Uint8Array>"u"?x:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?x:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?x:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?x:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?x:WeakMap,"%WeakRef%":typeof WeakRef>"u"?x:WeakRef,"%WeakSet%":typeof WeakSet>"u"?x:WeakSet};if(B)try{null.error}catch(r){var uf=B(B(r));be["%Error.prototype%"]=uf}var sf=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&&B&&(t=B(i.prototype))}return be[e]=t,t},Ri={"%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"]},or=Zt,Lr=tf,ff=or.call(Function.call,Array.prototype.concat),cf=or.call(Function.apply,Array.prototype.splice),Mi=or.call(Function.call,String.prototype.replace),kr=or.call(Function.call,String.prototype.slice),lf=or.call(Function.call,RegExp.prototype.exec),pf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,hf=/\\(\\)?/g,df=function(e){var t=kr(e,0,1),n=kr(e,-1);if(t==="%"&&n!=="%")throw new Ne("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Ne("invalid intrinsic syntax, expected opening `%`");var i=[];return Mi(e,pf,function(a,o,u,f){i[i.length]=u?Mi(f,hf,"$1"):o||a}),i},yf=function(e,t){var n=e,i;if(Lr(Ri,n)&&(i=Ri[n],n="%"+i[0]+"%"),Lr(be,n)){var a=be[n];if(a===Ue&&(a=sf(n)),typeof a>"u"&&!t)throw new Be("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Ne("intrinsic "+e+" does not exist!")},en=function(e,t){if(typeof e!="string"||e.length===0)throw new Be("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Be('"allowMissing" argument must be a boolean');if(lf(/^%?[^%]*%?$/,e)===null)throw new Ne("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=df(e),i=n.length>0?n[0]:"",a=yf("%"+i+"%",t),o=a.name,u=a.value,f=!1,c=a.alias;c&&(i=c[0],cf(n,ff([0,1],c)));for(var l=1,s=!0;l<n.length;l+=1){var p=n[l],y=kr(p,0,1),m=kr(p,-1);if((y==='"'||y==="'"||y==="`"||m==='"'||m==="'"||m==="`")&&y!==m)throw new Ne("property names with quotes must have matching quotes");if((p==="constructor"||!s)&&(f=!0),i+="."+p,o="%"+i+"%",Lr(be,o))u=be[o];else if(u!=null){if(!(p in u)){if(!t)throw new Be("base intrinsic for "+e+" exists, but the property is not available.");return}if(we&&l+1>=n.length){var A=we(u,p);s=!!A,s&&"get"in A&&!("originalValue"in A.get)?u=A.get:u=u[p]}else s=Lr(u,p),u=u[p];s&&!f&&(be[o]=u)}}return u},Ci={exports:{}};(function(r){var e=Zt,t=en,n=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(i,n),o=t("%Object.getOwnPropertyDescriptor%",!0),u=t("%Object.defineProperty%",!0),f=t("%Math.max%");if(u)try{u({},"a",{value:1})}catch{u=null}r.exports=function(s){var p=a(e,i,arguments);if(o&&u){var y=o(p,"length");y.configurable&&u(p,"length",{value:1+f(0,s.length-(arguments.length-1))})}return p};var c=function(){return a(e,n,arguments)};u?u(r.exports,"apply",{value:c}):r.exports.apply=c})(Ci);var gf=Ci.exports,Ni=en,Bi=gf,vf=Bi(Ni("String.prototype.indexOf")),_f=function(e,t){var n=Ni(e,!!t);return typeof n=="function"&&vf(e,".prototype.")>-1?Bi(n):n},Le=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},K=[],W=[],mf=typeof Uint8Array<"u"?Uint8Array:Array,rn=!1;function Di(){rn=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)K[e]=r[e],W[r.charCodeAt(e)]=e;W["-".charCodeAt(0)]=62,W["_".charCodeAt(0)]=63}function wf(r){rn||Di();var e,t,n,i,a,o,u=r.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[u-2]==="="?2:r[u-1]==="="?1:0,o=new mf(u*3/4-a),n=a>0?u-4:u;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)i=W[r.charCodeAt(e)]<<18|W[r.charCodeAt(e+1)]<<12|W[r.charCodeAt(e+2)]<<6|W[r.charCodeAt(e+3)],o[f++]=i>>16&255,o[f++]=i>>8&255,o[f++]=i&255;return a===2?(i=W[r.charCodeAt(e)]<<2|W[r.charCodeAt(e+1)]>>4,o[f++]=i&255):a===1&&(i=W[r.charCodeAt(e)]<<10|W[r.charCodeAt(e+1)]<<4|W[r.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=i&255),o}function bf(r){return K[r>>18&63]+K[r>>12&63]+K[r>>6&63]+K[r&63]}function $f(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(bf(n));return i.join("")}function Ui(r){rn||Di();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,u=0,f=t-n;u<f;u+=o)a.push($f(r,u,u+o>f?f:u+o));return n===1?(e=r[t-1],i+=K[e>>2],i+=K[e<<4&63],i+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],i+=K[e>>10],i+=K[e>>4&63],i+=K[e<<2&63],i+="="),a.push(i),a.join("")}function qr(r,e,t,n,i){var a,o,u=i*8-n-1,f=(1<<u)-1,c=f>>1,l=-7,s=t?i-1:0,p=t?-1:1,y=r[e+s];for(s+=p,a=y&(1<<-l)-1,y>>=-l,l+=u;l>0;a=a*256+r[e+s],s+=p,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=o*256+r[e+s],s+=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 Li(r,e,t,n,i,a){var o,u,f,c=a*8-i-1,l=(1<<c)-1,s=l>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,m=n?1:-1,A=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=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+s>=1?e+=p/f:e+=p*Math.pow(2,1-s),e*f>=2&&(o++,f/=2),o+s>=l?(u=0,o=l):o+s>=1?(u=(e*f-1)*Math.pow(2,i),o=o+s):(u=e*Math.pow(2,s-1)*Math.pow(2,i),o=0));i>=8;r[t+y]=u&255,y+=m,u/=256,i-=8);for(o=o<<i|u,c+=i;c>0;r[t+y]=o&255,y+=m,o/=256,c-=8);r[t+y-m]|=A*128}var Ef={}.toString,ki=Array.isArray||function(r){return Ef.call(r)=="[object Array]"};/*!
|
|
1
|
+
// recharge-client-1.19.0.min.js | MIT License | © Recharge Inc.
|
|
2
|
+
(function(U,ve){typeof exports=="object"&&typeof module<"u"?module.exports=ve():typeof define=="function"&&define.amd?define(ve):(U=typeof globalThis<"u"?globalThis:U||self,U.recharge=ve())})(this,function(){"use strict";var U=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ve(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Ms(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):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,V={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 Cs(r){return r&&DataView.prototype.isPrototypeOf(r)}if(V.arrayBuffer)var Ns=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Bs=ArrayBuffer.isView||function(r){return r&&Ns.indexOf(Object.prototype.toString.call(r))>-1};function ar(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 Xt(r){return typeof r!="string"&&(r=String(r)),r}function zt(r){var e={next:function(){var t=r.shift();return{done:t===void 0,value:t}}};return V.iterable&&(e[Symbol.iterator]=function(){return e}),e}function N(r){this.map={},r instanceof N?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)}N.prototype.append=function(r,e){r=ar(r),e=Xt(e);var t=this.map[r];this.map[r]=t?t+", "+e:e},N.prototype.delete=function(r){delete this.map[ar(r)]},N.prototype.get=function(r){return r=ar(r),this.has(r)?this.map[r]:null},N.prototype.has=function(r){return this.map.hasOwnProperty(ar(r))},N.prototype.set=function(r,e){this.map[ar(r)]=Xt(e)},N.prototype.forEach=function(r,e){for(var t in this.map)this.map.hasOwnProperty(t)&&r.call(e,this.map[t],t,this)},N.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),zt(r)},N.prototype.values=function(){var r=[];return this.forEach(function(e){r.push(e)}),zt(r)},N.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),zt(r)},V.iterable&&(N.prototype[Symbol.iterator]=N.prototype.entries);function Yt(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 Ds(r){var e=new FileReader,t=Ai(e);return e.readAsArrayBuffer(r),t}function Us(r){var e=new FileReader,t=Ai(e);return e.readAsText(r),t}function Ls(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 Si(){return this.bodyUsed=!1,this._initBody=function(r){this.bodyUsed=this.bodyUsed,this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:V.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:V.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:V.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():V.arrayBuffer&&V.blob&&Cs(r)?(this._bodyArrayBuffer=Oi(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):V.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||Bs(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):V.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},V.blob&&(this.blob=function(){var r=Yt(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=Yt(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(Ds)}),this.text=function(){var r=Yt(this);if(r)return r;if(this._bodyBlob)return Us(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Ls(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},V.formData&&(this.formData=function(){return this.text().then(js)}),this.json=function(){return this.text().then(JSON.parse)},this}var ks=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function qs(r){var e=r.toUpperCase();return ks.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 N(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 N(e.headers)),this.method=qs(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 js(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 Vs(r){var e=new N,t=r.replace(/\r?\n[\t ]+/g," ");return t.split("\r").map(function(n){return n.indexOf(`
|
|
3
|
+
`)===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}Si.call(_e.prototype);function Y(r,e){if(!(this instanceof Y))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 N(e.headers),this.url=e.url||"",this._initBody(r)}Si.call(Y.prototype),Y.prototype.clone=function(){return new Y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new N(this.headers),url:this.url})},Y.error=function(){var r=new Y(null,{status:0,statusText:""});return r.type="error",r};var Gs=[301,302,303,307,308];Y.redirect=function(r,e){if(Gs.indexOf(e)===-1)throw new RangeError("Invalid status code");return new Y(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 Ii(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:Vs(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 Y(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 u(f){try{return f===""&&L.location.href?L.location.href:f}catch{return f}}a.open(i.method,u(i.url),!0),i.credentials==="include"?a.withCredentials=!0:i.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(V.blob?a.responseType="blob":V.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 N)?Object.getOwnPropertyNames(e.headers).forEach(function(f){a.setRequestHeader(f,Xt(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)})}Ii.polyfill=!0,L.fetch||(L.fetch=Ii,L.Headers=N,L.Request=_e,L.Response=Y),self.fetch.bind(self);let Hs="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Pi=(r=21)=>{let e="",t=r;for(;t--;)e+=Hs[Math.random()*64|0];return e};var Ws=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},xi=typeof Symbol<"u"&&Symbol,Xs=Ws,zs=function(){return typeof xi!="function"||typeof Symbol!="function"||typeof xi("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Xs()},Ti={foo:{}},Ys=Object,Ks=function(){return{__proto__:Ti}.foo===Ti.foo&&!({__proto__:null}instanceof Ys)},Zs="Function.prototype.bind called on incompatible ",Kt=Array.prototype.slice,Js=Object.prototype.toString,Qs="[object Function]",ef=function(e){var t=this;if(typeof t!="function"||Js.call(t)!==Qs)throw new TypeError(Zs+t);for(var n=Kt.call(arguments,1),i,a=function(){if(this instanceof i){var l=t.apply(this,n.concat(Kt.call(arguments)));return Object(l)===l?l:this}else return t.apply(e,n.concat(Kt.call(arguments)))},o=Math.max(0,t.length-n.length),u=[],f=0;f<o;f++)u.push("$"+f);if(i=Function("binder","return function ("+u.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},rf=ef,Zt=Function.prototype.bind||rf,tf=Zt,nf=tf.call(Function.call,Object.prototype.hasOwnProperty),x,Ne=SyntaxError,Fi=Function,Be=TypeError,Jt=function(r){try{return Fi('"use strict"; return ('+r+").constructor;")()}catch{}},we=Object.getOwnPropertyDescriptor;if(we)try{we({},"")}catch{we=null}var Qt=function(){throw new Be},af=we?function(){try{return arguments.callee,Qt}catch{try{return we(arguments,"callee").get}catch{return Qt}}}():Qt,De=zs(),of=Ks(),B=Object.getPrototypeOf||(of?function(r){return r.__proto__}:null),Ue={},uf=typeof Uint8Array>"u"||!B?x:B(Uint8Array),be={"%AggregateError%":typeof AggregateError>"u"?x:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?x:ArrayBuffer,"%ArrayIteratorPrototype%":De&&B?B([][Symbol.iterator]()):x,"%AsyncFromSyncIteratorPrototype%":x,"%AsyncFunction%":Ue,"%AsyncGenerator%":Ue,"%AsyncGeneratorFunction%":Ue,"%AsyncIteratorPrototype%":Ue,"%Atomics%":typeof Atomics>"u"?x:Atomics,"%BigInt%":typeof BigInt>"u"?x:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?x:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?x:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?x:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?x:Float32Array,"%Float64Array%":typeof Float64Array>"u"?x:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?x:FinalizationRegistry,"%Function%":Fi,"%GeneratorFunction%":Ue,"%Int8Array%":typeof Int8Array>"u"?x:Int8Array,"%Int16Array%":typeof Int16Array>"u"?x:Int16Array,"%Int32Array%":typeof Int32Array>"u"?x:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":De&&B?B(B([][Symbol.iterator]())):x,"%JSON%":typeof JSON=="object"?JSON:x,"%Map%":typeof Map>"u"?x:Map,"%MapIteratorPrototype%":typeof Map>"u"||!De||!B?x:B(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?x:Promise,"%Proxy%":typeof Proxy>"u"?x:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?x:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?x:Set,"%SetIteratorPrototype%":typeof Set>"u"||!De||!B?x:B(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?x:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":De&&B?B(""[Symbol.iterator]()):x,"%Symbol%":De?Symbol:x,"%SyntaxError%":Ne,"%ThrowTypeError%":af,"%TypedArray%":uf,"%TypeError%":Be,"%Uint8Array%":typeof Uint8Array>"u"?x:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?x:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?x:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?x:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?x:WeakMap,"%WeakRef%":typeof WeakRef>"u"?x:WeakRef,"%WeakSet%":typeof WeakSet>"u"?x:WeakSet};if(B)try{null.error}catch(r){var sf=B(B(r));be["%Error.prototype%"]=sf}var ff=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&&B&&(t=B(i.prototype))}return be[e]=t,t},Ri={"%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"]},or=Zt,Lr=nf,cf=or.call(Function.call,Array.prototype.concat),lf=or.call(Function.apply,Array.prototype.splice),Mi=or.call(Function.call,String.prototype.replace),kr=or.call(Function.call,String.prototype.slice),pf=or.call(Function.call,RegExp.prototype.exec),hf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,df=/\\(\\)?/g,yf=function(e){var t=kr(e,0,1),n=kr(e,-1);if(t==="%"&&n!=="%")throw new Ne("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Ne("invalid intrinsic syntax, expected opening `%`");var i=[];return Mi(e,hf,function(a,o,u,f){i[i.length]=u?Mi(f,df,"$1"):o||a}),i},gf=function(e,t){var n=e,i;if(Lr(Ri,n)&&(i=Ri[n],n="%"+i[0]+"%"),Lr(be,n)){var a=be[n];if(a===Ue&&(a=ff(n)),typeof a>"u"&&!t)throw new Be("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Ne("intrinsic "+e+" does not exist!")},en=function(e,t){if(typeof e!="string"||e.length===0)throw new Be("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Be('"allowMissing" argument must be a boolean');if(pf(/^%?[^%]*%?$/,e)===null)throw new Ne("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=yf(e),i=n.length>0?n[0]:"",a=gf("%"+i+"%",t),o=a.name,u=a.value,f=!1,c=a.alias;c&&(i=c[0],lf(n,cf([0,1],c)));for(var l=1,s=!0;l<n.length;l+=1){var p=n[l],y=kr(p,0,1),m=kr(p,-1);if((y==='"'||y==="'"||y==="`"||m==='"'||m==="'"||m==="`")&&y!==m)throw new Ne("property names with quotes must have matching quotes");if((p==="constructor"||!s)&&(f=!0),i+="."+p,o="%"+i+"%",Lr(be,o))u=be[o];else if(u!=null){if(!(p in u)){if(!t)throw new Be("base intrinsic for "+e+" exists, but the property is not available.");return}if(we&&l+1>=n.length){var A=we(u,p);s=!!A,s&&"get"in A&&!("originalValue"in A.get)?u=A.get:u=u[p]}else s=Lr(u,p),u=u[p];s&&!f&&(be[o]=u)}}return u},Ci={exports:{}};(function(r){var e=Zt,t=en,n=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(i,n),o=t("%Object.getOwnPropertyDescriptor%",!0),u=t("%Object.defineProperty%",!0),f=t("%Math.max%");if(u)try{u({},"a",{value:1})}catch{u=null}r.exports=function(s){var p=a(e,i,arguments);if(o&&u){var y=o(p,"length");y.configurable&&u(p,"length",{value:1+f(0,s.length-(arguments.length-1))})}return p};var c=function(){return a(e,n,arguments)};u?u(r.exports,"apply",{value:c}):r.exports.apply=c})(Ci);var vf=Ci.exports,Ni=en,Bi=vf,_f=Bi(Ni("String.prototype.indexOf")),mf=function(e,t){var n=Ni(e,!!t);return typeof n=="function"&&_f(e,".prototype.")>-1?Bi(n):n},Le=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},K=[],W=[],wf=typeof Uint8Array<"u"?Uint8Array:Array,rn=!1;function Di(){rn=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)K[e]=r[e],W[r.charCodeAt(e)]=e;W["-".charCodeAt(0)]=62,W["_".charCodeAt(0)]=63}function bf(r){rn||Di();var e,t,n,i,a,o,u=r.length;if(u%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[u-2]==="="?2:r[u-1]==="="?1:0,o=new wf(u*3/4-a),n=a>0?u-4:u;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)i=W[r.charCodeAt(e)]<<18|W[r.charCodeAt(e+1)]<<12|W[r.charCodeAt(e+2)]<<6|W[r.charCodeAt(e+3)],o[f++]=i>>16&255,o[f++]=i>>8&255,o[f++]=i&255;return a===2?(i=W[r.charCodeAt(e)]<<2|W[r.charCodeAt(e+1)]>>4,o[f++]=i&255):a===1&&(i=W[r.charCodeAt(e)]<<10|W[r.charCodeAt(e+1)]<<4|W[r.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=i&255),o}function $f(r){return K[r>>18&63]+K[r>>12&63]+K[r>>6&63]+K[r&63]}function Ef(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($f(n));return i.join("")}function Ui(r){rn||Di();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,u=0,f=t-n;u<f;u+=o)a.push(Ef(r,u,u+o>f?f:u+o));return n===1?(e=r[t-1],i+=K[e>>2],i+=K[e<<4&63],i+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],i+=K[e>>10],i+=K[e>>4&63],i+=K[e<<2&63],i+="="),a.push(i),a.join("")}function qr(r,e,t,n,i){var a,o,u=i*8-n-1,f=(1<<u)-1,c=f>>1,l=-7,s=t?i-1:0,p=t?-1:1,y=r[e+s];for(s+=p,a=y&(1<<-l)-1,y>>=-l,l+=u;l>0;a=a*256+r[e+s],s+=p,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=o*256+r[e+s],s+=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 Li(r,e,t,n,i,a){var o,u,f,c=a*8-i-1,l=(1<<c)-1,s=l>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,m=n?1:-1,A=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=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+s>=1?e+=p/f:e+=p*Math.pow(2,1-s),e*f>=2&&(o++,f/=2),o+s>=l?(u=0,o=l):o+s>=1?(u=(e*f-1)*Math.pow(2,i),o=o+s):(u=e*Math.pow(2,s-1)*Math.pow(2,i),o=0));i>=8;r[t+y]=u&255,y+=m,u/=256,i-=8);for(o=o<<i|u,c+=i;c>0;r[t+y]=o&255,y+=m,o/=256,c-=8);r[t+y-m]|=A*128}var Af={}.toString,ki=Array.isArray||function(r){return Af.call(r)=="[object Array]"};/*!
|
|
4
4
|
* The buffer module from node.js, for the browser.
|
|
5
5
|
*
|
|
6
6
|
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
7
7
|
* @license MIT
|
|
8
|
-
*/var Af=50;d.TYPED_ARRAY_SUPPORT=Le.TYPED_ARRAY_SUPPORT!==void 0?Le.TYPED_ARRAY_SUPPORT:!0,jr();function jr(){return d.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function te(r,e){if(jr()<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 tn(this,r)}return qi(this,r,e,t)}d.poolSize=8192,d._augment=function(r){return r.__proto__=d.prototype,r};function qi(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?If(r,e,t,n):typeof e=="string"?Sf(r,e,t):Pf(r,e)}d.from=function(r,e,t){return qi(null,r,e,t)},d.TYPED_ARRAY_SUPPORT&&(d.prototype.__proto__=Uint8Array.prototype,d.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&d[Symbol.species]);function ji(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 Of(r,e,t,n){return ji(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 Of(null,r,e,t)};function tn(r,e){if(ji(e),r=te(r,e<0?0:an(e)|0),!d.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}d.allocUnsafe=function(r){return tn(null,r)},d.allocUnsafeSlow=function(r){return tn(null,r)};function Sf(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=Vi(e,t)|0;r=te(r,n);var i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function nn(r,e){var t=e.length<0?0:an(e.length)|0;r=te(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function If(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=nn(r,e),r}function Pf(r,e){if(Z(e)){var t=an(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"||Xf(e.length)?te(r,0):nn(r,e);if(e.type==="Buffer"&&ki(e.data))return nn(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function an(r){if(r>=jr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+jr().toString(16)+" bytes");return r|0}d.isBuffer=zf;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(!ki(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 Vi(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 Hr(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ji(r).length;default:if(n)return Hr(r).length;e=(""+e).toLowerCase(),n=!0}}d.byteLength=Vi;function xf(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 Lf(this,e,t);case"utf8":case"utf-8":return Xi(this,e,t);case"ascii":return Df(this,e,t);case"latin1":case"binary":return Uf(this,e,t);case"base64":return Nf(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kf(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):xf.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=Af;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,u=n-t,f=Math.min(o,u),c=this.slice(i,a),l=e.slice(t,n),s=0;s<f;++s)if(c[s]!==l[s]){o=c[s],u=l[s];break}return o<u?-1:u<o?1:0};function Gi(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:Hi(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):Hi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Hi(r,e,t,n,i){var a=1,o=r.length,u=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,u/=2,t/=2}function f(y,m){return a===1?y[m]:y.readUInt16BE(m*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===u)return l*a}else l!==-1&&(c-=c-l),l=-1}else for(t+u>o&&(t=o-u),c=t;c>=0;c--){for(var s=!0,p=0;p<u;p++)if(f(r,c+p)!==f(e,p)){s=!1;break}if(s)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 Gi(this,e,t,n,!0)},d.prototype.lastIndexOf=function(e,t,n){return Gi(this,e,t,n,!1)};function Tf(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 u=parseInt(e.substr(o*2,2),16);if(isNaN(u))return o;r[t+o]=u}return o}function Ff(r,e,t,n){return Wr(Hr(e,r.length-t),r,t,n)}function Wi(r,e,t,n){return Wr(Hf(e),r,t,n)}function Rf(r,e,t,n){return Wi(r,e,t,n)}function Mf(r,e,t,n){return Wr(Ji(e),r,t,n)}function Cf(r,e,t,n){return Wr(Wf(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 Tf(this,e,t,n);case"utf8":case"utf-8":return Ff(this,e,t,n);case"ascii":return Wi(this,e,t,n);case"latin1":case"binary":return Rf(this,e,t,n);case"base64":return Mf(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Cf(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 Nf(r,e,t){return e===0&&t===r.length?Ui(r):Ui(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,u=a>239?4:a>223?3:a>191?2:1;if(i+u<=t){var f,c,l,s;switch(u){case 1:a<128&&(o=a);break;case 2:f=r[i+1],(f&192)===128&&(s=(a&31)<<6|f&63,s>127&&(o=s));break;case 3:f=r[i+1],c=r[i+2],(f&192)===128&&(c&192)===128&&(s=(a&15)<<12|(f&63)<<6|c&63,s>2047&&(s<55296||s>57343)&&(o=s));break;case 4:f=r[i+1],c=r[i+2],l=r[i+3],(f&192)===128&&(c&192)===128&&(l&192)===128&&(s=(a&15)<<18|(f&63)<<12|(c&63)<<6|l&63,s>65535&&s<1114112&&(o=s))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=u}return Bf(n)}var zi=4096;function Bf(r){var e=r.length;if(e<=zi)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=zi));return t}function Df(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 Uf(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 Lf(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+=Gf(r[a]);return i}function kf(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),qr(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return t||D(e,4,this.length),qr(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return t||D(e,8,this.length),qr(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return t||D(e,8,this.length),qr(this,e,!1,52,8)};function G(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;G(this,e,t,n,a,0)}var o=1,u=0;for(this[t]=e&255;++u<n&&(o*=256);)this[t+u]=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;G(this,e,t,n,a,0)}var o=n-1,u=1;for(this[t+o]=e&255;--o>=0&&(u*=256);)this[t+o]=e/u&255;return t+n},d.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||G(this,e,t,1,255,0),d.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function Vr(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||G(this,e,t,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Vr(this,e,t,!0),t+2},d.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||G(this,e,t,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Vr(this,e,t,!1),t+2};function Gr(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||G(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):Gr(this,e,t,!0),t+4},d.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||G(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):Gr(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);G(this,e,t,n,a-1,-a)}var o=0,u=1,f=0;for(this[t]=e&255;++o<n&&(u*=256);)e<0&&f===0&&this[t+o-1]!==0&&(f=1),this[t+o]=(e/u>>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);G(this,e,t,n,a-1,-a)}var o=n-1,u=1,f=0;for(this[t+o]=e&255;--o>=0&&(u*=256);)e<0&&f===0&&this[t+o+1]!==0&&(f=1),this[t+o]=(e/u>>0)-f&255;return t+n},d.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||G(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||G(this,e,t,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Vr(this,e,t,!0),t+2},d.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||G(this,e,t,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Vr(this,e,t,!1),t+2},d.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||G(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):Gr(this,e,t,!0),t+4},d.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||G(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):Gr(this,e,t,!1),t+4};function Yi(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 Ki(r,e,t,n,i){return i||Yi(r,e,t,4),Li(r,e,t,n,23,4),t+4}d.prototype.writeFloatLE=function(e,t,n){return Ki(this,e,t,!0,n)},d.prototype.writeFloatBE=function(e,t,n){return Ki(this,e,t,!1,n)};function Zi(r,e,t,n,i){return i||Yi(r,e,t,8),Li(r,e,t,n,52,8),t+8}d.prototype.writeDoubleLE=function(e,t,n){return Zi(this,e,t,!0,n)},d.prototype.writeDoubleBE=function(e,t,n){return Zi(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 u=Z(e)?e:Hr(new d(e,i).toString()),f=u.length;for(o=0;o<n-t;++o)this[o+t]=u[o%f]}return this};var qf=/[^+\/0-9A-Za-z-_]/g;function jf(r){if(r=Vf(r).replace(qf,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Vf(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Gf(r){return r<16?"0"+r.toString(16):r.toString(16)}function Hr(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 Hf(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function Wf(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 Ji(r){return wf(jf(r))}function Wr(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 Xf(r){return r!==r}function zf(r){return r!=null&&(!!r._isBuffer||Qi(r)||Yf(r))}function Qi(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function Yf(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Qi(r.slice(0,0))}function ea(){throw new Error("setTimeout has not been defined")}function ra(){throw new Error("clearTimeout has not been defined")}var se=ea,fe=ra;typeof Le.setTimeout=="function"&&(se=setTimeout),typeof Le.clearTimeout=="function"&&(fe=clearTimeout);function ta(r){if(se===setTimeout)return setTimeout(r,0);if((se===ea||!se)&&setTimeout)return se=setTimeout,setTimeout(r,0);try{return se(r,0)}catch{try{return se.call(null,r,0)}catch{return se.call(this,r,0)}}}function Kf(r){if(fe===clearTimeout)return clearTimeout(r);if((fe===ra||!fe)&&clearTimeout)return fe=clearTimeout,clearTimeout(r);try{return fe(r)}catch{try{return fe.call(null,r)}catch{return fe.call(this,r)}}}var ne=[],ke=!1,Ee,Xr=-1;function Zf(){!ke||!Ee||(ke=!1,Ee.length?ne=Ee.concat(ne):Xr=-1,ne.length&&na())}function na(){if(!ke){var r=ta(Zf);ke=!0;for(var e=ne.length;e;){for(Ee=ne,ne=[];++Xr<e;)Ee&&Ee[Xr].run();Xr=-1,e=ne.length}Ee=null,ke=!1,Kf(r)}}function Jf(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 ia(r,e)),ne.length===1&&!ke&&ta(na)}function ia(r,e){this.fun=r,this.array=e}ia.prototype.run=function(){this.fun.apply(null,this.array)};var Qf="browser",ec="browser",rc=!0,tc={},nc=[],ic="",ac={},oc={},uc={};function Ae(){}var sc=Ae,fc=Ae,cc=Ae,lc=Ae,pc=Ae,hc=Ae,dc=Ae;function yc(r){throw new Error("process.binding is not supported")}function gc(){return"/"}function vc(r){throw new Error("process.chdir is not supported")}function _c(){return 0}var qe=Le.performance||{},mc=qe.now||qe.mozNow||qe.msNow||qe.oNow||qe.webkitNow||function(){return new Date().getTime()};function wc(r){var e=mc.call(qe)*.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 bc=new Date;function $c(){var r=new Date,e=r-bc;return e/1e3}var je={nextTick:Jf,title:Qf,browser:rc,env:tc,argv:nc,version:ic,versions:ac,on:sc,addListener:fc,once:cc,off:lc,removeListener:pc,removeAllListeners:hc,emit:dc,binding:yc,cwd:gc,chdir:vc,umask:_c,hrtime:wc,platform:ec,release:oc,config:uc,uptime:$c},on;typeof Object.create=="function"?on=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:on=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var aa=on,oa=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},i=0;i<t.length;i++)n[t[i]]=Object.getOwnPropertyDescriptor(e,t[i]);return n},Ec=/%[sdj%]/g;function zr(r){if(!sr(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(J(arguments[t]));return e.join(" ")}for(var t=1,n=arguments,i=n.length,a=String(r).replace(Ec,function(u){if(u==="%%")return"%";if(t>=i)return u;switch(u){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 u}}),o=n[t];t<i;o=n[++t])ur(o)||!Oe(o)?a+=" "+o:a+=" "+J(o);return a}function un(r,e){if(Q(Le.process))return function(){return un(r,e).apply(this,arguments)};if(je.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(je.throwDeprecation)throw new Error(e);je.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n}var Yr={},sn;function ua(r){if(Q(sn)&&(sn=je.env.NODE_DEBUG||""),r=r.toUpperCase(),!Yr[r])if(new RegExp("\\b"+r+"\\b","i").test(sn)){var e=0;Yr[r]=function(){var t=zr.apply(null,arguments);console.error("%s %d: %s",r,e,t)}}else Yr[r]=function(){};return Yr[r]}function J(r,e){var t={seen:[],stylize:Oc};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),Zr(e)?t.showHidden=e:e&&yn(t,e),Q(t.showHidden)&&(t.showHidden=!1),Q(t.depth)&&(t.depth=2),Q(t.colors)&&(t.colors=!1),Q(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=Ac),Kr(t,r,t.depth)}J.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]},J.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Ac(r,e){var t=J.styles[e];return t?"\x1B["+J.colors[t][0]+"m"+r+"\x1B["+J.colors[t][1]+"m":r}function Oc(r,e){return r}function Sc(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function Kr(r,e,t){if(r.customInspect&&e&&lr(e.inspect)&&e.inspect!==J&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return sr(n)||(n=Kr(r,n,t)),n}var i=Ic(r,e);if(i)return i;var a=Object.keys(e),o=Sc(a);if(r.showHidden&&(a=Object.getOwnPropertyNames(e)),cr(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return fn(e);if(a.length===0){if(lr(e)){var u=e.name?": "+e.name:"";return r.stylize("[Function"+u+"]","special")}if(fr(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(Jr(e))return r.stylize(Date.prototype.toString.call(e),"date");if(cr(e))return fn(e)}var f="",c=!1,l=["{","}"];if(ln(e)&&(c=!0,l=["[","]"]),lr(e)){var s=e.name?": "+e.name:"";f=" [Function"+s+"]"}if(fr(e)&&(f=" "+RegExp.prototype.toString.call(e)),Jr(e)&&(f=" "+Date.prototype.toUTCString.call(e)),cr(e)&&(f=" "+fn(e)),a.length===0&&(!c||e.length==0))return l[0]+f+l[1];if(t<0)return fr(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special");r.seen.push(e);var p;return c?p=Pc(r,e,t,o,a):p=a.map(function(y){return cn(r,e,t,o,y,c)}),r.seen.pop(),xc(p,f,l)}function Ic(r,e){if(Q(e))return r.stylize("undefined","undefined");if(sr(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if(pn(e))return r.stylize(""+e,"number");if(Zr(e))return r.stylize(""+e,"boolean");if(ur(e))return r.stylize("null","null")}function fn(r){return"["+Error.prototype.toString.call(r)+"]"}function Pc(r,e,t,n,i){for(var a=[],o=0,u=e.length;o<u;++o)ha(e,String(o))?a.push(cn(r,e,t,n,String(o),!0)):a.push("");return i.forEach(function(f){f.match(/^\d+$/)||a.push(cn(r,e,t,n,f,!0))}),a}function cn(r,e,t,n,i,a){var o,u,f;if(f=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},f.get?f.set?u=r.stylize("[Getter/Setter]","special"):u=r.stylize("[Getter]","special"):f.set&&(u=r.stylize("[Setter]","special")),ha(n,i)||(o="["+i+"]"),u||(r.seen.indexOf(f.value)<0?(ur(t)?u=Kr(r,f.value,null):u=Kr(r,f.value,t-1),u.indexOf(`
|
|
8
|
+
*/var Of=50;d.TYPED_ARRAY_SUPPORT=Le.TYPED_ARRAY_SUPPORT!==void 0?Le.TYPED_ARRAY_SUPPORT:!0,jr();function jr(){return d.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function te(r,e){if(jr()<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 tn(this,r)}return qi(this,r,e,t)}d.poolSize=8192,d._augment=function(r){return r.__proto__=d.prototype,r};function qi(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?Pf(r,e,t,n):typeof e=="string"?If(r,e,t):xf(r,e)}d.from=function(r,e,t){return qi(null,r,e,t)},d.TYPED_ARRAY_SUPPORT&&(d.prototype.__proto__=Uint8Array.prototype,d.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&d[Symbol.species]);function ji(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 Sf(r,e,t,n){return ji(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 Sf(null,r,e,t)};function tn(r,e){if(ji(e),r=te(r,e<0?0:an(e)|0),!d.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}d.allocUnsafe=function(r){return tn(null,r)},d.allocUnsafeSlow=function(r){return tn(null,r)};function If(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=Vi(e,t)|0;r=te(r,n);var i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function nn(r,e){var t=e.length<0?0:an(e.length)|0;r=te(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Pf(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=nn(r,e),r}function xf(r,e){if(Z(e)){var t=an(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"||zf(e.length)?te(r,0):nn(r,e);if(e.type==="Buffer"&&ki(e.data))return nn(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function an(r){if(r>=jr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+jr().toString(16)+" bytes");return r|0}d.isBuffer=Yf;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(!ki(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 Vi(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 Hr(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ji(r).length;default:if(n)return Hr(r).length;e=(""+e).toLowerCase(),n=!0}}d.byteLength=Vi;function Tf(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 kf(this,e,t);case"utf8":case"utf-8":return Xi(this,e,t);case"ascii":return Uf(this,e,t);case"latin1":case"binary":return Lf(this,e,t);case"base64":return Bf(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qf(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):Tf.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=Of;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,u=n-t,f=Math.min(o,u),c=this.slice(i,a),l=e.slice(t,n),s=0;s<f;++s)if(c[s]!==l[s]){o=c[s],u=l[s];break}return o<u?-1:u<o?1:0};function Gi(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:Hi(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):Hi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Hi(r,e,t,n,i){var a=1,o=r.length,u=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,u/=2,t/=2}function f(y,m){return a===1?y[m]:y.readUInt16BE(m*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===u)return l*a}else l!==-1&&(c-=c-l),l=-1}else for(t+u>o&&(t=o-u),c=t;c>=0;c--){for(var s=!0,p=0;p<u;p++)if(f(r,c+p)!==f(e,p)){s=!1;break}if(s)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 Gi(this,e,t,n,!0)},d.prototype.lastIndexOf=function(e,t,n){return Gi(this,e,t,n,!1)};function Ff(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 u=parseInt(e.substr(o*2,2),16);if(isNaN(u))return o;r[t+o]=u}return o}function Rf(r,e,t,n){return Wr(Hr(e,r.length-t),r,t,n)}function Wi(r,e,t,n){return Wr(Wf(e),r,t,n)}function Mf(r,e,t,n){return Wi(r,e,t,n)}function Cf(r,e,t,n){return Wr(Ji(e),r,t,n)}function Nf(r,e,t,n){return Wr(Xf(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 Ff(this,e,t,n);case"utf8":case"utf-8":return Rf(this,e,t,n);case"ascii":return Wi(this,e,t,n);case"latin1":case"binary":return Mf(this,e,t,n);case"base64":return Cf(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nf(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 Bf(r,e,t){return e===0&&t===r.length?Ui(r):Ui(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,u=a>239?4:a>223?3:a>191?2:1;if(i+u<=t){var f,c,l,s;switch(u){case 1:a<128&&(o=a);break;case 2:f=r[i+1],(f&192)===128&&(s=(a&31)<<6|f&63,s>127&&(o=s));break;case 3:f=r[i+1],c=r[i+2],(f&192)===128&&(c&192)===128&&(s=(a&15)<<12|(f&63)<<6|c&63,s>2047&&(s<55296||s>57343)&&(o=s));break;case 4:f=r[i+1],c=r[i+2],l=r[i+3],(f&192)===128&&(c&192)===128&&(l&192)===128&&(s=(a&15)<<18|(f&63)<<12|(c&63)<<6|l&63,s>65535&&s<1114112&&(o=s))}}o===null?(o=65533,u=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=u}return Df(n)}var zi=4096;function Df(r){var e=r.length;if(e<=zi)return String.fromCharCode.apply(String,r);for(var t="",n=0;n<e;)t+=String.fromCharCode.apply(String,r.slice(n,n+=zi));return t}function Uf(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 Lf(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 kf(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+=Hf(r[a]);return i}function qf(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),qr(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return t||D(e,4,this.length),qr(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return t||D(e,8,this.length),qr(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return t||D(e,8,this.length),qr(this,e,!1,52,8)};function G(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;G(this,e,t,n,a,0)}var o=1,u=0;for(this[t]=e&255;++u<n&&(o*=256);)this[t+u]=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;G(this,e,t,n,a,0)}var o=n-1,u=1;for(this[t+o]=e&255;--o>=0&&(u*=256);)this[t+o]=e/u&255;return t+n},d.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||G(this,e,t,1,255,0),d.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function Vr(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||G(this,e,t,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Vr(this,e,t,!0),t+2},d.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||G(this,e,t,2,65535,0),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Vr(this,e,t,!1),t+2};function Gr(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||G(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):Gr(this,e,t,!0),t+4},d.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||G(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):Gr(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);G(this,e,t,n,a-1,-a)}var o=0,u=1,f=0;for(this[t]=e&255;++o<n&&(u*=256);)e<0&&f===0&&this[t+o-1]!==0&&(f=1),this[t+o]=(e/u>>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);G(this,e,t,n,a-1,-a)}var o=n-1,u=1,f=0;for(this[t+o]=e&255;--o>=0&&(u*=256);)e<0&&f===0&&this[t+o+1]!==0&&(f=1),this[t+o]=(e/u>>0)-f&255;return t+n},d.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||G(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||G(this,e,t,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Vr(this,e,t,!0),t+2},d.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||G(this,e,t,2,32767,-32768),d.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Vr(this,e,t,!1),t+2},d.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||G(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):Gr(this,e,t,!0),t+4},d.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||G(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):Gr(this,e,t,!1),t+4};function Yi(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 Ki(r,e,t,n,i){return i||Yi(r,e,t,4),Li(r,e,t,n,23,4),t+4}d.prototype.writeFloatLE=function(e,t,n){return Ki(this,e,t,!0,n)},d.prototype.writeFloatBE=function(e,t,n){return Ki(this,e,t,!1,n)};function Zi(r,e,t,n,i){return i||Yi(r,e,t,8),Li(r,e,t,n,52,8),t+8}d.prototype.writeDoubleLE=function(e,t,n){return Zi(this,e,t,!0,n)},d.prototype.writeDoubleBE=function(e,t,n){return Zi(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 u=Z(e)?e:Hr(new d(e,i).toString()),f=u.length;for(o=0;o<n-t;++o)this[o+t]=u[o%f]}return this};var jf=/[^+\/0-9A-Za-z-_]/g;function Vf(r){if(r=Gf(r).replace(jf,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function Gf(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function Hf(r){return r<16?"0"+r.toString(16):r.toString(16)}function Hr(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 Wf(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function Xf(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 Ji(r){return bf(Vf(r))}function Wr(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 zf(r){return r!==r}function Yf(r){return r!=null&&(!!r._isBuffer||Qi(r)||Kf(r))}function Qi(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function Kf(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Qi(r.slice(0,0))}function ea(){throw new Error("setTimeout has not been defined")}function ra(){throw new Error("clearTimeout has not been defined")}var se=ea,fe=ra;typeof Le.setTimeout=="function"&&(se=setTimeout),typeof Le.clearTimeout=="function"&&(fe=clearTimeout);function ta(r){if(se===setTimeout)return setTimeout(r,0);if((se===ea||!se)&&setTimeout)return se=setTimeout,setTimeout(r,0);try{return se(r,0)}catch{try{return se.call(null,r,0)}catch{return se.call(this,r,0)}}}function Zf(r){if(fe===clearTimeout)return clearTimeout(r);if((fe===ra||!fe)&&clearTimeout)return fe=clearTimeout,clearTimeout(r);try{return fe(r)}catch{try{return fe.call(null,r)}catch{return fe.call(this,r)}}}var ne=[],ke=!1,Ee,Xr=-1;function Jf(){!ke||!Ee||(ke=!1,Ee.length?ne=Ee.concat(ne):Xr=-1,ne.length&&na())}function na(){if(!ke){var r=ta(Jf);ke=!0;for(var e=ne.length;e;){for(Ee=ne,ne=[];++Xr<e;)Ee&&Ee[Xr].run();Xr=-1,e=ne.length}Ee=null,ke=!1,Zf(r)}}function Qf(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 ia(r,e)),ne.length===1&&!ke&&ta(na)}function ia(r,e){this.fun=r,this.array=e}ia.prototype.run=function(){this.fun.apply(null,this.array)};var ec="browser",rc="browser",tc=!0,nc={},ic=[],ac="",oc={},uc={},sc={};function Ae(){}var fc=Ae,cc=Ae,lc=Ae,pc=Ae,hc=Ae,dc=Ae,yc=Ae;function gc(r){throw new Error("process.binding is not supported")}function vc(){return"/"}function _c(r){throw new Error("process.chdir is not supported")}function mc(){return 0}var qe=Le.performance||{},wc=qe.now||qe.mozNow||qe.msNow||qe.oNow||qe.webkitNow||function(){return new Date().getTime()};function bc(r){var e=wc.call(qe)*.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 $c=new Date;function Ec(){var r=new Date,e=r-$c;return e/1e3}var je={nextTick:Qf,title:ec,browser:tc,env:nc,argv:ic,version:ac,versions:oc,on:fc,addListener:cc,once:lc,off:pc,removeListener:hc,removeAllListeners:dc,emit:yc,binding:gc,cwd:vc,chdir:_c,umask:mc,hrtime:bc,platform:rc,release:uc,config:sc,uptime:Ec},on;typeof Object.create=="function"?on=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:on=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var aa=on,oa=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},i=0;i<t.length;i++)n[t[i]]=Object.getOwnPropertyDescriptor(e,t[i]);return n},Ac=/%[sdj%]/g;function zr(r){if(!sr(r)){for(var e=[],t=0;t<arguments.length;t++)e.push(J(arguments[t]));return e.join(" ")}for(var t=1,n=arguments,i=n.length,a=String(r).replace(Ac,function(u){if(u==="%%")return"%";if(t>=i)return u;switch(u){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 u}}),o=n[t];t<i;o=n[++t])ur(o)||!Oe(o)?a+=" "+o:a+=" "+J(o);return a}function un(r,e){if(Q(Le.process))return function(){return un(r,e).apply(this,arguments)};if(je.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(je.throwDeprecation)throw new Error(e);je.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n}var Yr={},sn;function ua(r){if(Q(sn)&&(sn=je.env.NODE_DEBUG||""),r=r.toUpperCase(),!Yr[r])if(new RegExp("\\b"+r+"\\b","i").test(sn)){var e=0;Yr[r]=function(){var t=zr.apply(null,arguments);console.error("%s %d: %s",r,e,t)}}else Yr[r]=function(){};return Yr[r]}function J(r,e){var t={seen:[],stylize:Sc};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),Zr(e)?t.showHidden=e:e&&yn(t,e),Q(t.showHidden)&&(t.showHidden=!1),Q(t.depth)&&(t.depth=2),Q(t.colors)&&(t.colors=!1),Q(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=Oc),Kr(t,r,t.depth)}J.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]},J.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Oc(r,e){var t=J.styles[e];return t?"\x1B["+J.colors[t][0]+"m"+r+"\x1B["+J.colors[t][1]+"m":r}function Sc(r,e){return r}function Ic(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function Kr(r,e,t){if(r.customInspect&&e&&lr(e.inspect)&&e.inspect!==J&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return sr(n)||(n=Kr(r,n,t)),n}var i=Pc(r,e);if(i)return i;var a=Object.keys(e),o=Ic(a);if(r.showHidden&&(a=Object.getOwnPropertyNames(e)),cr(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return fn(e);if(a.length===0){if(lr(e)){var u=e.name?": "+e.name:"";return r.stylize("[Function"+u+"]","special")}if(fr(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(Jr(e))return r.stylize(Date.prototype.toString.call(e),"date");if(cr(e))return fn(e)}var f="",c=!1,l=["{","}"];if(ln(e)&&(c=!0,l=["[","]"]),lr(e)){var s=e.name?": "+e.name:"";f=" [Function"+s+"]"}if(fr(e)&&(f=" "+RegExp.prototype.toString.call(e)),Jr(e)&&(f=" "+Date.prototype.toUTCString.call(e)),cr(e)&&(f=" "+fn(e)),a.length===0&&(!c||e.length==0))return l[0]+f+l[1];if(t<0)return fr(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special");r.seen.push(e);var p;return c?p=xc(r,e,t,o,a):p=a.map(function(y){return cn(r,e,t,o,y,c)}),r.seen.pop(),Tc(p,f,l)}function Pc(r,e){if(Q(e))return r.stylize("undefined","undefined");if(sr(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if(pn(e))return r.stylize(""+e,"number");if(Zr(e))return r.stylize(""+e,"boolean");if(ur(e))return r.stylize("null","null")}function fn(r){return"["+Error.prototype.toString.call(r)+"]"}function xc(r,e,t,n,i){for(var a=[],o=0,u=e.length;o<u;++o)ha(e,String(o))?a.push(cn(r,e,t,n,String(o),!0)):a.push("");return i.forEach(function(f){f.match(/^\d+$/)||a.push(cn(r,e,t,n,f,!0))}),a}function cn(r,e,t,n,i,a){var o,u,f;if(f=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},f.get?f.set?u=r.stylize("[Getter/Setter]","special"):u=r.stylize("[Getter]","special"):f.set&&(u=r.stylize("[Setter]","special")),ha(n,i)||(o="["+i+"]"),u||(r.seen.indexOf(f.value)<0?(ur(t)?u=Kr(r,f.value,null):u=Kr(r,f.value,t-1),u.indexOf(`
|
|
9
9
|
`)>-1&&(a?u=u.split(`
|
|
10
10
|
`).map(function(c){return" "+c}).join(`
|
|
11
11
|
`).substr(2):u=`
|
|
12
12
|
`+u.split(`
|
|
13
13
|
`).map(function(c){return" "+c}).join(`
|
|
14
|
-
`))):u=r.stylize("[Circular]","special")),Q(o)){if(a&&i.match(/^\d+$/))return u;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+": "+u}function
|
|
14
|
+
`))):u=r.stylize("[Circular]","special")),Q(o)){if(a&&i.match(/^\d+$/))return u;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+": "+u}function Tc(r,e,t){var n=r.reduce(function(i,a){return a.indexOf(`
|
|
15
15
|
`)>=0,i+a.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?t[0]+(e===""?"":e+`
|
|
16
16
|
`)+" "+r.join(`,
|
|
17
|
-
`)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function ln(r){return Array.isArray(r)}function Zr(r){return typeof r=="boolean"}function ur(r){return r===null}function sa(r){return r==null}function pn(r){return typeof r=="number"}function sr(r){return typeof r=="string"}function fa(r){return typeof r=="symbol"}function Q(r){return r===void 0}function fr(r){return Oe(r)&&hn(r)==="[object RegExp]"}function Oe(r){return typeof r=="object"&&r!==null}function Jr(r){return Oe(r)&&hn(r)==="[object Date]"}function cr(r){return Oe(r)&&(hn(r)==="[object Error]"||r instanceof Error)}function lr(r){return typeof r=="function"}function ca(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function la(r){return d.isBuffer(r)}function hn(r){return Object.prototype.toString.call(r)}function dn(r){return r<10?"0"+r.toString(10):r.toString(10)}var Tc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Fc(){var r=new Date,e=[dn(r.getHours()),dn(r.getMinutes()),dn(r.getSeconds())].join(":");return[r.getDate(),Tc[r.getMonth()],e].join(" ")}function pa(){console.log("%s - %s",Fc(),zr.apply(null,arguments))}function yn(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 ha(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Se=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function gn(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');if(Se&&r[Se]){var e=r[Se];if(typeof e!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Se,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var t,n,i=new Promise(function(u,f){t=u,n=f}),a=[],o=0;o<arguments.length;o++)a.push(arguments[o]);a.push(function(u,f){u?n(u):t(f)});try{r.apply(this,a)}catch(u){n(u)}return i}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Se&&Object.defineProperty(e,Se,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,oa(r))}gn.custom=Se;function Rc(r,e){if(!r){var t=new Error("Promise was rejected with a falsy value");t.reason=r,r=t}return e(r)}function da(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var i=t.pop();if(typeof i!="function")throw new TypeError("The last argument must be of type Function");var a=this,o=function(){return i.apply(a,arguments)};r.apply(this,t).then(function(u){je.nextTick(o.bind(null,null,u))},function(u){je.nextTick(Rc.bind(null,u,o))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Object.defineProperties(e,oa(r)),e}var Mc={inherits:aa,_extend:yn,log:pa,isBuffer:la,isPrimitive:ca,isFunction:lr,isError:cr,isDate:Jr,isObject:Oe,isRegExp:fr,isUndefined:Q,isSymbol:fa,isString:sr,isNumber:pn,isNullOrUndefined:sa,isNull:ur,isBoolean:Zr,isArray:ln,inspect:J,deprecate:un,format:zr,debuglog:ua,promisify:gn,callbackify:da},Cc=Object.freeze({__proto__:null,_extend:yn,callbackify:da,debuglog:ua,default:Mc,deprecate:un,format:zr,inherits:aa,inspect:J,isArray:ln,isBoolean:Zr,isBuffer:la,isDate:Jr,isError:cr,isFunction:lr,isNull:ur,isNullOrUndefined:sa,isNumber:pn,isObject:Oe,isPrimitive:ca,isRegExp:fr,isString:sr,isSymbol:fa,isUndefined:Q,log:pa,promisify:gn}),Nc=Rs(Cc),Bc=Nc.inspect,vn=typeof Map=="function"&&Map.prototype,_n=Object.getOwnPropertyDescriptor&&vn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Qr=vn&&_n&&typeof _n.get=="function"?_n.get:null,ya=vn&&Map.prototype.forEach,mn=typeof Set=="function"&&Set.prototype,wn=Object.getOwnPropertyDescriptor&&mn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,et=mn&&wn&&typeof wn.get=="function"?wn.get:null,ga=mn&&Set.prototype.forEach,Dc=typeof WeakMap=="function"&&WeakMap.prototype,pr=Dc?WeakMap.prototype.has:null,Uc=typeof WeakSet=="function"&&WeakSet.prototype,hr=Uc?WeakSet.prototype.has:null,Lc=typeof WeakRef=="function"&&WeakRef.prototype,va=Lc?WeakRef.prototype.deref:null,kc=Boolean.prototype.valueOf,qc=Object.prototype.toString,jc=Function.prototype.toString,Vc=String.prototype.match,bn=String.prototype.slice,ce=String.prototype.replace,Gc=String.prototype.toUpperCase,_a=String.prototype.toLowerCase,ma=RegExp.prototype.test,wa=Array.prototype.concat,ee=Array.prototype.join,Hc=Array.prototype.slice,ba=Math.floor,$n=typeof BigInt=="function"?BigInt.prototype.valueOf:null,En=Object.getOwnPropertySymbols,An=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ve=typeof Symbol=="function"&&typeof Symbol.iterator=="object",k=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ve||"symbol")?Symbol.toStringTag:null,$a=Object.prototype.propertyIsEnumerable,Ea=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Aa(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||ma.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-ba(-r):ba(r);if(n!==r){var i=String(n),a=bn.call(e,i.length+1);return ce.call(i,t,"$&_")+"."+ce.call(ce.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ce.call(e,t,"$&_")}var On=Bc,Oa=On.custom,Sa=xa(Oa)?Oa:null,Wc=function r(e,t,n,i){var a=t||{};if(le(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(le(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=le(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(le(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(le(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=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 Fa(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return u?Aa(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return u?Aa(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 Sn(e)?"[Array]":"[Object]";var s=cl(a,n);if(typeof i>"u")i=[];else if(Ta(i,e)>=0)return"[Circular]";function p(z,ye,ir){if(ye&&(i=Hc.call(i),i.push(ye)),ir){var ge={depth:a.depth};return le(a,"quoteStyle")&&(ge.quoteStyle=a.quoteStyle),r(z,ge,n+1,i)}return r(z,a,n+1,i)}if(typeof e=="function"&&!Pa(e)){var y=rl(e),m=rt(e,p);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(m.length>0?" { "+ee.call(m,", ")+" }":"")}if(xa(e)){var A=Ve?ce.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):An.call(e);return typeof e=="object"&&!Ve?dr(A):A}if(ul(e)){for(var S="<"+_a.call(String(e.nodeName)),b=e.attributes||[],E=0;E<b.length;E++)S+=" "+b[E].name+"="+Ia(Xc(b[E].value),"double",a);return S+=">",e.childNodes&&e.childNodes.length&&(S+="..."),S+="</"+_a.call(String(e.nodeName))+">",S}if(Sn(e)){if(e.length===0)return"[]";var h=rt(e,p);return s&&!fl(h)?"["+Pn(h,s)+"]":"[ "+ee.call(h,", ")+" ]"}if(Yc(e)){var I=rt(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!$a.call(e,"cause")?"{ ["+String(e)+"] "+ee.call(wa.call("[cause]: "+p(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ee.call(I,", ")+" }"}if(typeof e=="object"&&o){if(Sa&&typeof e[Sa]=="function"&&On)return On(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(tl(e)){var T=[];return ya&&ya.call(e,function(z,ye){T.push(p(ye,e,!0)+" => "+p(z,e))}),Ra("Map",Qr.call(e),T,s)}if(al(e)){var R=[];return ga&&ga.call(e,function(z){R.push(p(z,e))}),Ra("Set",et.call(e),R,s)}if(nl(e))return In("WeakMap");if(ol(e))return In("WeakSet");if(il(e))return In("WeakRef");if(Zc(e))return dr(p(Number(e)));if(Qc(e))return dr(p($n.call(e)));if(Jc(e))return dr(kc.call(e));if(Kc(e))return dr(p(String(e)));if(!zc(e)&&!Pa(e)){var _=rt(e,p),g=Ea?Ea(e)===Object.prototype:e instanceof Object||e.constructor===Object,v=e instanceof Object?"":"null prototype",O=!g&&k&&Object(e)===e&&k in e?bn.call(pe(e),8,-1):v?"Object":"",P=g||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",M=P+(O||v?"["+ee.call(wa.call([],O||[],v||[]),": ")+"] ":"");return _.length===0?M+"{}":s?M+"{"+Pn(_,s)+"}":M+"{ "+ee.call(_,", ")+" }"}return String(e)};function Ia(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function Xc(r){return ce.call(String(r),/"/g,""")}function Sn(r){return pe(r)==="[object Array]"&&(!k||!(typeof r=="object"&&k in r))}function zc(r){return pe(r)==="[object Date]"&&(!k||!(typeof r=="object"&&k in r))}function Pa(r){return pe(r)==="[object RegExp]"&&(!k||!(typeof r=="object"&&k in r))}function Yc(r){return pe(r)==="[object Error]"&&(!k||!(typeof r=="object"&&k in r))}function Kc(r){return pe(r)==="[object String]"&&(!k||!(typeof r=="object"&&k in r))}function Zc(r){return pe(r)==="[object Number]"&&(!k||!(typeof r=="object"&&k in r))}function Jc(r){return pe(r)==="[object Boolean]"&&(!k||!(typeof r=="object"&&k in r))}function xa(r){if(Ve)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!An)return!1;try{return An.call(r),!0}catch{}return!1}function Qc(r){if(!r||typeof r!="object"||!$n)return!1;try{return $n.call(r),!0}catch{}return!1}var el=Object.prototype.hasOwnProperty||function(r){return r in this};function le(r,e){return el.call(r,e)}function pe(r){return qc.call(r)}function rl(r){if(r.name)return r.name;var e=Vc.call(jc.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function Ta(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 tl(r){if(!Qr||!r||typeof r!="object")return!1;try{Qr.call(r);try{et.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function nl(r){if(!pr||!r||typeof r!="object")return!1;try{pr.call(r,pr);try{hr.call(r,hr)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function il(r){if(!va||!r||typeof r!="object")return!1;try{return va.call(r),!0}catch{}return!1}function al(r){if(!et||!r||typeof r!="object")return!1;try{et.call(r);try{Qr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function ol(r){if(!hr||!r||typeof r!="object")return!1;try{hr.call(r,hr);try{pr.call(r,pr)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function ul(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function Fa(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Fa(bn.call(r,0,e.maxStringLength),e)+n}var i=ce.call(ce.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,sl);return Ia(i,"single",e)}function sl(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":"")+Gc.call(e.toString(16))}function dr(r){return"Object("+r+")"}function In(r){return r+" { ? }"}function Ra(r,e,t,n){var i=n?Pn(t,n):ee.call(t,", ");return r+" ("+e+") {"+i+"}"}function fl(r){for(var e=0;e<r.length;e++)if(Ta(r[e],`
|
|
18
|
-
`)>=0)return!1;return!0}function
|
|
17
|
+
`)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function ln(r){return Array.isArray(r)}function Zr(r){return typeof r=="boolean"}function ur(r){return r===null}function sa(r){return r==null}function pn(r){return typeof r=="number"}function sr(r){return typeof r=="string"}function fa(r){return typeof r=="symbol"}function Q(r){return r===void 0}function fr(r){return Oe(r)&&hn(r)==="[object RegExp]"}function Oe(r){return typeof r=="object"&&r!==null}function Jr(r){return Oe(r)&&hn(r)==="[object Date]"}function cr(r){return Oe(r)&&(hn(r)==="[object Error]"||r instanceof Error)}function lr(r){return typeof r=="function"}function ca(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function la(r){return d.isBuffer(r)}function hn(r){return Object.prototype.toString.call(r)}function dn(r){return r<10?"0"+r.toString(10):r.toString(10)}var Fc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Rc(){var r=new Date,e=[dn(r.getHours()),dn(r.getMinutes()),dn(r.getSeconds())].join(":");return[r.getDate(),Fc[r.getMonth()],e].join(" ")}function pa(){console.log("%s - %s",Rc(),zr.apply(null,arguments))}function yn(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 ha(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Se=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function gn(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');if(Se&&r[Se]){var e=r[Se];if(typeof e!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Se,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var t,n,i=new Promise(function(u,f){t=u,n=f}),a=[],o=0;o<arguments.length;o++)a.push(arguments[o]);a.push(function(u,f){u?n(u):t(f)});try{r.apply(this,a)}catch(u){n(u)}return i}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Se&&Object.defineProperty(e,Se,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,oa(r))}gn.custom=Se;function Mc(r,e){if(!r){var t=new Error("Promise was rejected with a falsy value");t.reason=r,r=t}return e(r)}function da(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var i=t.pop();if(typeof i!="function")throw new TypeError("The last argument must be of type Function");var a=this,o=function(){return i.apply(a,arguments)};r.apply(this,t).then(function(u){je.nextTick(o.bind(null,null,u))},function(u){je.nextTick(Mc.bind(null,u,o))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Object.defineProperties(e,oa(r)),e}var Cc={inherits:aa,_extend:yn,log:pa,isBuffer:la,isPrimitive:ca,isFunction:lr,isError:cr,isDate:Jr,isObject:Oe,isRegExp:fr,isUndefined:Q,isSymbol:fa,isString:sr,isNumber:pn,isNullOrUndefined:sa,isNull:ur,isBoolean:Zr,isArray:ln,inspect:J,deprecate:un,format:zr,debuglog:ua,promisify:gn,callbackify:da},Nc=Object.freeze({__proto__:null,_extend:yn,callbackify:da,debuglog:ua,default:Cc,deprecate:un,format:zr,inherits:aa,inspect:J,isArray:ln,isBoolean:Zr,isBuffer:la,isDate:Jr,isError:cr,isFunction:lr,isNull:ur,isNullOrUndefined:sa,isNumber:pn,isObject:Oe,isPrimitive:ca,isRegExp:fr,isString:sr,isSymbol:fa,isUndefined:Q,log:pa,promisify:gn}),Bc=Ms(Nc),Dc=Bc.inspect,vn=typeof Map=="function"&&Map.prototype,_n=Object.getOwnPropertyDescriptor&&vn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Qr=vn&&_n&&typeof _n.get=="function"?_n.get:null,ya=vn&&Map.prototype.forEach,mn=typeof Set=="function"&&Set.prototype,wn=Object.getOwnPropertyDescriptor&&mn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,et=mn&&wn&&typeof wn.get=="function"?wn.get:null,ga=mn&&Set.prototype.forEach,Uc=typeof WeakMap=="function"&&WeakMap.prototype,pr=Uc?WeakMap.prototype.has:null,Lc=typeof WeakSet=="function"&&WeakSet.prototype,hr=Lc?WeakSet.prototype.has:null,kc=typeof WeakRef=="function"&&WeakRef.prototype,va=kc?WeakRef.prototype.deref:null,qc=Boolean.prototype.valueOf,jc=Object.prototype.toString,Vc=Function.prototype.toString,Gc=String.prototype.match,bn=String.prototype.slice,ce=String.prototype.replace,Hc=String.prototype.toUpperCase,_a=String.prototype.toLowerCase,ma=RegExp.prototype.test,wa=Array.prototype.concat,ee=Array.prototype.join,Wc=Array.prototype.slice,ba=Math.floor,$n=typeof BigInt=="function"?BigInt.prototype.valueOf:null,En=Object.getOwnPropertySymbols,An=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ve=typeof Symbol=="function"&&typeof Symbol.iterator=="object",k=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ve||"symbol")?Symbol.toStringTag:null,$a=Object.prototype.propertyIsEnumerable,Ea=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Aa(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||ma.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-ba(-r):ba(r);if(n!==r){var i=String(n),a=bn.call(e,i.length+1);return ce.call(i,t,"$&_")+"."+ce.call(ce.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ce.call(e,t,"$&_")}var On=Dc,Oa=On.custom,Sa=xa(Oa)?Oa:null,Xc=function r(e,t,n,i){var a=t||{};if(le(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(le(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=le(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(le(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(le(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var u=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 Fa(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return u?Aa(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return u?Aa(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 Sn(e)?"[Array]":"[Object]";var s=ll(a,n);if(typeof i>"u")i=[];else if(Ta(i,e)>=0)return"[Circular]";function p(z,ye,ir){if(ye&&(i=Wc.call(i),i.push(ye)),ir){var ge={depth:a.depth};return le(a,"quoteStyle")&&(ge.quoteStyle=a.quoteStyle),r(z,ge,n+1,i)}return r(z,a,n+1,i)}if(typeof e=="function"&&!Pa(e)){var y=tl(e),m=rt(e,p);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(m.length>0?" { "+ee.call(m,", ")+" }":"")}if(xa(e)){var A=Ve?ce.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):An.call(e);return typeof e=="object"&&!Ve?dr(A):A}if(sl(e)){for(var S="<"+_a.call(String(e.nodeName)),b=e.attributes||[],E=0;E<b.length;E++)S+=" "+b[E].name+"="+Ia(zc(b[E].value),"double",a);return S+=">",e.childNodes&&e.childNodes.length&&(S+="..."),S+="</"+_a.call(String(e.nodeName))+">",S}if(Sn(e)){if(e.length===0)return"[]";var h=rt(e,p);return s&&!cl(h)?"["+Pn(h,s)+"]":"[ "+ee.call(h,", ")+" ]"}if(Kc(e)){var I=rt(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!$a.call(e,"cause")?"{ ["+String(e)+"] "+ee.call(wa.call("[cause]: "+p(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ee.call(I,", ")+" }"}if(typeof e=="object"&&o){if(Sa&&typeof e[Sa]=="function"&&On)return On(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(nl(e)){var T=[];return ya&&ya.call(e,function(z,ye){T.push(p(ye,e,!0)+" => "+p(z,e))}),Ra("Map",Qr.call(e),T,s)}if(ol(e)){var R=[];return ga&&ga.call(e,function(z){R.push(p(z,e))}),Ra("Set",et.call(e),R,s)}if(il(e))return In("WeakMap");if(ul(e))return In("WeakSet");if(al(e))return In("WeakRef");if(Jc(e))return dr(p(Number(e)));if(el(e))return dr(p($n.call(e)));if(Qc(e))return dr(qc.call(e));if(Zc(e))return dr(p(String(e)));if(!Yc(e)&&!Pa(e)){var _=rt(e,p),g=Ea?Ea(e)===Object.prototype:e instanceof Object||e.constructor===Object,v=e instanceof Object?"":"null prototype",O=!g&&k&&Object(e)===e&&k in e?bn.call(pe(e),8,-1):v?"Object":"",P=g||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",M=P+(O||v?"["+ee.call(wa.call([],O||[],v||[]),": ")+"] ":"");return _.length===0?M+"{}":s?M+"{"+Pn(_,s)+"}":M+"{ "+ee.call(_,", ")+" }"}return String(e)};function Ia(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function zc(r){return ce.call(String(r),/"/g,""")}function Sn(r){return pe(r)==="[object Array]"&&(!k||!(typeof r=="object"&&k in r))}function Yc(r){return pe(r)==="[object Date]"&&(!k||!(typeof r=="object"&&k in r))}function Pa(r){return pe(r)==="[object RegExp]"&&(!k||!(typeof r=="object"&&k in r))}function Kc(r){return pe(r)==="[object Error]"&&(!k||!(typeof r=="object"&&k in r))}function Zc(r){return pe(r)==="[object String]"&&(!k||!(typeof r=="object"&&k in r))}function Jc(r){return pe(r)==="[object Number]"&&(!k||!(typeof r=="object"&&k in r))}function Qc(r){return pe(r)==="[object Boolean]"&&(!k||!(typeof r=="object"&&k in r))}function xa(r){if(Ve)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!An)return!1;try{return An.call(r),!0}catch{}return!1}function el(r){if(!r||typeof r!="object"||!$n)return!1;try{return $n.call(r),!0}catch{}return!1}var rl=Object.prototype.hasOwnProperty||function(r){return r in this};function le(r,e){return rl.call(r,e)}function pe(r){return jc.call(r)}function tl(r){if(r.name)return r.name;var e=Gc.call(Vc.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function Ta(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 nl(r){if(!Qr||!r||typeof r!="object")return!1;try{Qr.call(r);try{et.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function il(r){if(!pr||!r||typeof r!="object")return!1;try{pr.call(r,pr);try{hr.call(r,hr)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function al(r){if(!va||!r||typeof r!="object")return!1;try{return va.call(r),!0}catch{}return!1}function ol(r){if(!et||!r||typeof r!="object")return!1;try{et.call(r);try{Qr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function ul(r){if(!hr||!r||typeof r!="object")return!1;try{hr.call(r,hr);try{pr.call(r,pr)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function sl(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function Fa(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Fa(bn.call(r,0,e.maxStringLength),e)+n}var i=ce.call(ce.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,fl);return Ia(i,"single",e)}function fl(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":"")+Hc.call(e.toString(16))}function dr(r){return"Object("+r+")"}function In(r){return r+" { ? }"}function Ra(r,e,t,n){var i=n?Pn(t,n):ee.call(t,", ");return r+" ("+e+") {"+i+"}"}function cl(r){for(var e=0;e<r.length;e++)if(Ta(r[e],`
|
|
18
|
+
`)>=0)return!1;return!0}function ll(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=ee.call(Array(r.indent+1)," ");else return null;return{base:t,prev:ee.call(Array(e+1),t)}}function Pn(r,e){if(r.length===0)return"";var t=`
|
|
19
19
|
`+e.prev+e.base;return t+ee.call(r,","+t)+`
|
|
20
|
-
`+e.prev}function rt(r,e){var t=Sn(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=le(r,i)?e(r[i],r):""}var a=typeof En=="function"?En(r):[],o;if(Ve){o={};for(var u=0;u<a.length;u++)o["$"+a[u]]=a[u]}for(var f in r)le(r,f)&&(t&&String(Number(f))===f&&f<r.length||Ve&&o["$"+f]instanceof Symbol||(ma.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r))));if(typeof En=="function")for(var c=0;c<a.length;c++)$a.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var xn=en,Ge=_f,ll=Wc,pl=xn("%TypeError%"),tt=xn("%WeakMap%",!0),nt=xn("%Map%",!0),hl=Ge("WeakMap.prototype.get",!0),dl=Ge("WeakMap.prototype.set",!0),yl=Ge("WeakMap.prototype.has",!0),gl=Ge("Map.prototype.get",!0),vl=Ge("Map.prototype.set",!0),_l=Ge("Map.prototype.has",!0),Tn=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},ml=function(r,e){var t=Tn(r,e);return t&&t.value},wl=function(r,e,t){var n=Tn(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},bl=function(r,e){return!!Tn(r,e)},$l=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new pl("Side channel does not contain "+ll(a))},get:function(a){if(tt&&a&&(typeof a=="object"||typeof a=="function")){if(e)return hl(e,a)}else if(nt){if(t)return gl(t,a)}else if(n)return ml(n,a)},has:function(a){if(tt&&a&&(typeof a=="object"||typeof a=="function")){if(e)return yl(e,a)}else if(nt){if(t)return _l(t,a)}else if(n)return bl(n,a);return!1},set:function(a,o){tt&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new tt),dl(e,a,o)):nt?(t||(t=new nt),vl(t,a,o)):(n||(n={key:{},next:null}),wl(n,a,o))}};return i},El=String.prototype.replace,Al=/%20/g,Fn={RFC1738:"RFC1738",RFC3986:"RFC3986"},Ma={default:Fn.RFC3986,formatters:{RFC1738:function(r){return El.call(r,Al,"+")},RFC3986:function(r){return String(r)}},RFC1738:Fn.RFC1738,RFC3986:Fn.RFC3986},Ol=Ma,Rn=Object.prototype.hasOwnProperty,Ie=Array.isArray,re=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),Sl=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Ie(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},Ca=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},Il=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Ie(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Rn.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 Ie(e)&&!Ie(t)&&(i=Ca(e,n)),Ie(e)&&Ie(t)?(t.forEach(function(a,o){if(Rn.call(e,o)){var u=e[o];u&&typeof u=="object"&&a&&typeof a=="object"?e[o]=r(u,a,n):e.push(a)}else e[o]=a}),e):Object.keys(t).reduce(function(a,o){var u=t[o];return Rn.call(a,o)?a[o]=r(a[o],u,n):a[o]=u,a},i)},Pl=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},xl=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}},Tl=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 u="",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===Ol.RFC1738&&(c===40||c===41)){u+=o.charAt(f);continue}if(c<128){u=u+re[c];continue}if(c<2048){u=u+(re[192|c>>6]+re[128|c&63]);continue}if(c<55296||c>=57344){u=u+(re[224|c>>12]+re[128|c>>6&63]+re[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),u+=re[240|c>>18]+re[128|c>>12&63]+re[128|c>>6&63]+re[128|c&63]}return u},Fl=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],u=Object.keys(o),f=0;f<u.length;++f){var c=u[f],l=o[c];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(t.push({obj:o,prop:c}),n.push(l))}return Sl(t),e},Rl=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Ml=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Cl=function(e,t){return[].concat(e,t)},Nl=function(e,t){if(Ie(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},Bl={arrayToObject:Ca,assign:Pl,combine:Cl,compact:Fl,decode:xl,encode:Tl,isBuffer:Ml,isRegExp:Rl,maybeMap:Nl,merge:Il},Na=$l,it=Bl,yr=Ma,Dl=Object.prototype.hasOwnProperty,Ba={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},ie=Array.isArray,Ul=Array.prototype.push,Da=function(r,e){Ul.apply(r,ie(e)?e:[e])},Ll=Date.prototype.toISOString,Ua=yr.default,q={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:it.encode,encodeValuesOnly:!1,format:Ua,formatter:yr.formatters[Ua],indices:!1,serializeDate:function(e){return Ll.call(e)},skipNulls:!1,strictNullHandling:!1},kl=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Mn={},ql=function r(e,t,n,i,a,o,u,f,c,l,s,p,y,m,A,S){for(var b=e,E=S,h=0,I=!1;(E=E.get(Mn))!==void 0&&!I;){var T=E.get(e);if(h+=1,typeof T<"u"){if(T===h)throw new RangeError("Cyclic object value");I=!0}typeof E.get(Mn)>"u"&&(h=0)}if(typeof f=="function"?b=f(t,b):b instanceof Date?b=s(b):n==="comma"&&ie(b)&&(b=it.maybeMap(b,function(ge){return ge instanceof Date?s(ge):ge})),b===null){if(a)return u&&!m?u(t,q.encoder,A,"key",p):t;b=""}if(kl(b)||it.isBuffer(b)){if(u){var R=m?t:u(t,q.encoder,A,"key",p);return[y(R)+"="+y(u(b,q.encoder,A,"value",p))]}return[y(t)+"="+y(String(b))]}var _=[];if(typeof b>"u")return _;var g;if(n==="comma"&&ie(b))m&&u&&(b=it.maybeMap(b,u)),g=[{value:b.length>0?b.join(",")||null:void 0}];else if(ie(f))g=f;else{var v=Object.keys(b);g=c?v.sort(c):v}for(var O=i&&ie(b)&&b.length===1?t+"[]":t,P=0;P<g.length;++P){var M=g[P],z=typeof M=="object"&&typeof M.value<"u"?M.value:b[M];if(!(o&&z===null)){var ye=ie(b)?typeof n=="function"?n(O,M):O:O+(l?"."+M:"["+M+"]");S.set(e,h);var ir=Na();ir.set(Mn,S),Da(_,r(z,ye,n,i,a,o,n==="comma"&&m&&ie(b)?null:u,f,c,l,s,p,y,m,A,ir))}}return _},jl=function(e){if(!e)return q;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||q.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=yr.default;if(typeof e.format<"u"){if(!Dl.call(yr.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=yr.formatters[n],a=q.filter;return(typeof e.filter=="function"||ie(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:q.addQueryPrefix,allowDots:typeof e.allowDots>"u"?q.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:q.charsetSentinel,delimiter:typeof e.delimiter>"u"?q.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:q.encode,encoder:typeof e.encoder=="function"?e.encoder:q.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:q.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:q.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:q.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:q.strictNullHandling}},Vl=function(r,e){var t=r,n=jl(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 u;e&&e.arrayFormat in Ba?u=e.arrayFormat:e&&"indices"in e?u=e.indices?"indices":"repeat":u="indices";var f=Ba[u];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=Na(),s=0;s<i.length;++s){var p=i[s];n.skipNulls&&t[p]===null||Da(o,ql(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),m=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?m+="utf8=%26%2310003%3B&":m+="utf8=%E2%9C%93&"),y.length>0?m+y:""},Gl=ve(Vl);let La={storeIdentifier:"",environment:"prod"};function Hl(r){La=r}function X(){return La}const Wl=(r,e="")=>{switch(r){case"prod":return"https://api.rechargeapps.com";case"stage":return"https://api.stage.rechargeapps.com";case"preprod":case"prestage":return`${e}/api`}},gr=(r,e="")=>{switch(r){case"prod":return"https://admin.rechargeapps.com";case"stage":return"https://admin.stage.rechargeapps.com";case"preprod":case"prestage":return e}},Xl=r=>{switch(r){case"prod":case"preprod":return"https://static.rechargecdn.com";case"stage":case"prestage":return"https://static.stage.rechargecdn.com"}},zl="/tools/recurring";class at{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}function Yl(r){return Gl(r,{encode:!1,indices:!1,arrayFormat:"comma"})}function w(r,e){return{...r,internalFnCall:r.internalFnCall??e,internalRequestId:r.internalRequestId??Pi()}}async function ot(r,e,t={}){const n=X();return H(r,`${Xl(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function $(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:u,environmentUri:f,storeIdentifier:c,loginRetryFn:l}=X(),s=o.apiToken,p=Wl(u,f),y={"X-Recharge-Access-Token":s,"X-Recharge-Version":"2021-11","X-Recharge-Fn":o.internalFnCall,"X-Request-Id":o.internalRequestId,...a||{}},m={shop_url:c,...n};try{return await H(r,`${p}${e}`,{id:t,query:m,data:i,headers:y})}catch(A){if(l&&A instanceof at&&A.status===401)return l().then(S=>{if(S)return H(r,`${p}${e}`,{id:t,query:m,data:i,headers:{...y,"X-Recharge-Access-Token":S.apiToken}});throw A});throw A}}async function vr(r,e,t={}){return H(r,`${zl}${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 s;[o,s]=o.split("?");const p=[s,Yl(n)].join("&").replace(/^&/,"");o=`${o}${p?`?${p}`:""}`}let u;i&&r!=="get"&&(u=JSON.stringify(i));const f={Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client",...a||{}},c=await fetch(o,{method:r,headers:f,body:u});let l;try{l=await c.json()}catch{}if(!c.ok)throw l&&l.error?new at(l.error,c.status):l&&l.errors?new at(JSON.stringify(l.errors),c.status):new at("A connection error occurred while making the request");return l}function Kl(r,e){return $("get","/addresses",{query:e},w(r,"listAddresses"))}async function Zl(r,e,t){const{address:n}=await $("get","/addresses",{id:e,query:{include:t?.include}},w(r,"getAddress"));return n}async function Jl(r,e){const{address:t}=await $("post","/addresses",{data:{customer_id:r.customerId?Number(r.customerId):void 0,...e}},w(r,"createAddress"));return t}async function Cn(r,e,t){const{address:n}=await $("put","/addresses",{id:e,data:t},w(r,"updateAddress"));return n}async function Ql(r,e,t){return Cn(w(r,"applyDiscountToAddress"),e,{discounts:[{code:t}]})}async function ep(r,e){return Cn(w(r,"removeDiscountsFromAddress"),e,{discounts:[]})}function rp(r,e){return $("delete","/addresses",{id:e},w(r,"deleteAddress"))}async function tp(r,e){const{address:t}=await $("post","/addresses/merge",{data:e},w(r,"mergeAddresses"));return t}async function np(r,e,t){const{charge:n}=await $("post",`/addresses/${e}/charges/skip`,{data:t},w(r,"skipFutureCharge"));return n}var ip=Object.freeze({__proto__:null,applyDiscountToAddress:Ql,createAddress:Jl,deleteAddress:rp,getAddress:Zl,listAddresses:Kl,mergeAddresses:tp,removeDiscountsFromAddress:ep,skipFutureCharge:np,updateAddress:Cn});async function ap(){const{storefrontAccessToken:r}=X(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await vr("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id,message:t.message}}async function op(r,e){return ka(r,e)}async function ka(r,e){const{environment:t,environmentUri:n,storefrontAccessToken:i,storeIdentifier:a}=X(),o=gr(t,n),u={};i&&(u["X-Recharge-Storefront-Access-Token"]=i);const{api_token:f,customer_id:c,message:l}=await H("post",`${o}/shopify_storefront_access`,{data:{customer_token:e,storefront_token:r,shop_url:a},headers:u});return f?{apiToken:f,customerId:c,message:l}:null}async function up(r){const{environment:e,environmentUri:t,storefrontAccessToken:n,storeIdentifier:i}=X(),a=gr(e,t),o={};n&&(o["X-Recharge-Storefront-Access-Token"]=n);const{api_token:u,customer_id:f,message:c}=await H("post",`${a}/shopify_customer_account_api_access`,{data:{customer_token:r,shop_url:i},headers:o});return u?{apiToken:u,customerId:f,message:c}:null}async function sp(r,e={}){const{environment:t,environmentUri:n,storefrontAccessToken:i,storeIdentifier:a}=X(),o=gr(t,n),u={};i&&(u["X-Recharge-Storefront-Access-Token"]=i);const f=await H("post",`${o}/attempt_login`,{data:{email:r,shop:a,...e},headers:u});if(f.errors)throw new Error(f.errors);return f.session_token}async function fp(r,e={}){const{storefrontAccessToken:t}=X(),n={};t&&(n["X-Recharge-Storefront-Access-Token"]=t);const i=await vr("post","/attempt_login",{data:{email:r,...e},headers:n});if(i.errors)throw new Error(i.errors);return i.session_token}async function cp(r,e,t){const{environment:n,environmentUri:i,storefrontAccessToken:a,storeIdentifier:o}=X(),u=gr(n,i),f={};a&&(f["X-Recharge-Storefront-Access-Token"]=a);const c=await H("post",`${u}/validate_login`,{data:{code:t,email:r,session_token:e,shop:o},headers:f});if(c.errors)throw new Error(c.errors);return{apiToken:c.api_token,customerId:c.customer_id}}async function lp(r,e,t){const{storefrontAccessToken:n}=X(),i={};n&&(i["X-Recharge-Storefront-Access-Token"]=n);const a=await vr("post","/validate_login",{data:{code:t,email:r,session_token:e},headers:i});if(a.errors)throw new Error(a.errors);return{apiToken:a.api_token,customerId:a.customer_id}}function pp(){const{pathname:r,search:e}=window.location,t=new URLSearchParams(e).get("token"),n=r.split("/").filter(Boolean),i=n.findIndex(o=>o==="portal"),a=i!==-1?n[i+1]:void 0;if(!t||!a)throw new Error("Not in context of Recharge Customer Portal or URL did not contain correct params");return{customerHash:a,token:t}}async function hp(){const{customerHash:r,token:e}=pp(),{environment:t,environmentUri:n,storefrontAccessToken:i,storeIdentifier:a}=X(),o=gr(t,n),u={};i&&(u["X-Recharge-Storefront-Access-Token"]=i);const f=await H("post",`${o}/customers/${r}/access`,{headers:u,data:{token:e,shop:a}});return{apiToken:f.api_token,customerId:f.customer_id}}var dp=Object.freeze({__proto__:null,loginCustomerPortal:hp,loginShopifyApi:op,loginShopifyAppProxy:ap,loginWithShopifyCustomerAccount:up,loginWithShopifyStorefront:ka,sendPasswordlessCode:sp,sendPasswordlessCodeAppProxy:fp,validatePasswordlessCode:cp,validatePasswordlessCodeAppProxy:lp}),qa={},Nn={},ae={},yp=typeof U=="object"&&U&&U.Object===Object&&U,ja=yp,gp=ja,vp=typeof self=="object"&&self&&self.Object===Object&&self,_p=gp||vp||Function("return this")(),oe=_p,mp=oe,wp=mp.Symbol,ut=wp,Va=ut,Ga=Object.prototype,bp=Ga.hasOwnProperty,$p=Ga.toString,_r=Va?Va.toStringTag:void 0;function Ep(r){var e=bp.call(r,_r),t=r[_r];try{r[_r]=void 0;var n=!0}catch{}var i=$p.call(r);return n&&(e?r[_r]=t:delete r[_r]),i}var Ap=Ep,Op=Object.prototype,Sp=Op.toString;function Ip(r){return Sp.call(r)}var Pp=Ip,Ha=ut,xp=Ap,Tp=Pp,Fp="[object Null]",Rp="[object Undefined]",Wa=Ha?Ha.toStringTag:void 0;function Mp(r){return r==null?r===void 0?Rp:Fp:Wa&&Wa in Object(r)?xp(r):Tp(r)}var he=Mp;function Cp(r){return r!=null&&typeof r=="object"}var de=Cp,Np=he,Bp=de,Dp="[object Number]";function Up(r){return typeof r=="number"||Bp(r)&&Np(r)==Dp}var st=Up,C={};function Lp(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var He=Lp,kp=he,qp=He,jp="[object AsyncFunction]",Vp="[object Function]",Gp="[object GeneratorFunction]",Hp="[object Proxy]";function Wp(r){if(!qp(r))return!1;var e=kp(r);return e==Vp||e==Gp||e==jp||e==Hp}var Bn=Wp,Xp=oe,zp=Xp["__core-js_shared__"],Yp=zp,Dn=Yp,Xa=function(){var r=/[^.]+$/.exec(Dn&&Dn.keys&&Dn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function Kp(r){return!!Xa&&Xa in r}var Zp=Kp,Jp=Function.prototype,Qp=Jp.toString;function eh(r){if(r!=null){try{return Qp.call(r)}catch{}try{return r+""}catch{}}return""}var za=eh,rh=Bn,th=Zp,nh=He,ih=za,ah=/[\\^$.*+?()[\]{}|]/g,oh=/^\[object .+?Constructor\]$/,uh=Function.prototype,sh=Object.prototype,fh=uh.toString,ch=sh.hasOwnProperty,lh=RegExp("^"+fh.call(ch).replace(ah,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ph(r){if(!nh(r)||th(r))return!1;var e=rh(r)?lh:oh;return e.test(ih(r))}var hh=ph;function dh(r,e){return r?.[e]}var yh=dh,gh=hh,vh=yh;function _h(r,e){var t=vh(r,e);return gh(t)?t:void 0}var Pe=_h,mh=Pe,wh=function(){try{var r=mh(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Ya=wh,Ka=Ya;function bh(r,e,t){e=="__proto__"&&Ka?Ka(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Za=bh;function $h(r,e){return r===e||r!==r&&e!==e}var ft=$h,Eh=Za,Ah=ft,Oh=Object.prototype,Sh=Oh.hasOwnProperty;function Ih(r,e,t){var n=r[e];(!(Sh.call(r,e)&&Ah(n,t))||t===void 0&&!(e in r))&&Eh(r,e,t)}var Ph=Ih,xh=Ph,Th=Za;function Fh(r,e,t,n){var i=!t;t||(t={});for(var a=-1,o=e.length;++a<o;){var u=e[a],f=n?n(t[u],r[u],u,t,r):void 0;f===void 0&&(f=r[u]),i?Th(t,u,f):xh(t,u,f)}return t}var Rh=Fh;function Mh(r){return r}var ct=Mh;function Ch(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 Nh=Ch,Bh=Nh,Ja=Math.max;function Dh(r,e,t){return e=Ja(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=Ja(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var u=Array(e+1);++i<e;)u[i]=n[i];return u[e]=t(o),Bh(r,this,u)}}var Uh=Dh;function Lh(r){return function(){return r}}var kh=Lh,qh=kh,Qa=Ya,jh=ct,Vh=Qa?function(r,e){return Qa(r,"toString",{configurable:!0,enumerable:!1,value:qh(e),writable:!0})}:jh,Gh=Vh,Hh=800,Wh=16,Xh=Date.now;function zh(r){var e=0,t=0;return function(){var n=Xh(),i=Wh-(n-t);if(t=n,i>0){if(++e>=Hh)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var Yh=zh,Kh=Gh,Zh=Yh,Jh=Zh(Kh),Qh=Jh,ed=ct,rd=Uh,td=Qh;function nd(r,e){return td(rd(r,e,ed),r+"")}var id=nd,ad=9007199254740991;function od(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=ad}var Un=od,ud=Bn,sd=Un;function fd(r){return r!=null&&sd(r.length)&&!ud(r)}var mr=fd,cd=9007199254740991,ld=/^(?:0|[1-9]\d*)$/;function pd(r,e){var t=typeof r;return e=e??cd,!!e&&(t=="number"||t!="symbol"&&ld.test(r))&&r>-1&&r%1==0&&r<e}var Ln=pd,hd=ft,dd=mr,yd=Ln,gd=He;function vd(r,e,t){if(!gd(t))return!1;var n=typeof e;return(n=="number"?dd(t)&&yd(e,t.length):n=="string"&&e in t)?hd(t[e],r):!1}var eo=vd,_d=id,md=eo;function wd(r){return _d(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&&md(t[0],t[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var u=t[n];u&&r(e,u,n,a)}return e})}var bd=wd;function $d(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var ro=$d,Ed=he,Ad=de,Od="[object Arguments]";function Sd(r){return Ad(r)&&Ed(r)==Od}var Id=Sd,to=Id,Pd=de,no=Object.prototype,xd=no.hasOwnProperty,Td=no.propertyIsEnumerable,Fd=to(function(){return arguments}())?to:function(r){return Pd(r)&&xd.call(r,"callee")&&!Td.call(r,"callee")},io=Fd,Rd=Array.isArray,j=Rd,lt={exports:{}};function Md(){return!1}var Cd=Md;lt.exports,function(r,e){var t=oe,n=Cd,i=e&&!e.nodeType&&e,a=i&&!0&&r&&!r.nodeType&&r,o=a&&a.exports===i,u=o?t.Buffer:void 0,f=u?u.isBuffer:void 0,c=f||n;r.exports=c}(lt,lt.exports);var ao=lt.exports,Nd=he,Bd=Un,Dd=de,Ud="[object Arguments]",Ld="[object Array]",kd="[object Boolean]",qd="[object Date]",jd="[object Error]",Vd="[object Function]",Gd="[object Map]",Hd="[object Number]",Wd="[object Object]",Xd="[object RegExp]",zd="[object Set]",Yd="[object String]",Kd="[object WeakMap]",Zd="[object ArrayBuffer]",Jd="[object DataView]",Qd="[object Float32Array]",ey="[object Float64Array]",ry="[object Int8Array]",ty="[object Int16Array]",ny="[object Int32Array]",iy="[object Uint8Array]",ay="[object Uint8ClampedArray]",oy="[object Uint16Array]",uy="[object Uint32Array]",F={};F[Qd]=F[ey]=F[ry]=F[ty]=F[ny]=F[iy]=F[ay]=F[oy]=F[uy]=!0,F[Ud]=F[Ld]=F[Zd]=F[kd]=F[Jd]=F[qd]=F[jd]=F[Vd]=F[Gd]=F[Hd]=F[Wd]=F[Xd]=F[zd]=F[Yd]=F[Kd]=!1;function sy(r){return Dd(r)&&Bd(r.length)&&!!F[Nd(r)]}var fy=sy;function cy(r){return function(e){return r(e)}}var ly=cy,pt={exports:{}};pt.exports,function(r,e){var t=ja,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a&&t.process,u=function(){try{var f=i&&i.require&&i.require("util").types;return f||o&&o.binding&&o.binding("util")}catch{}}();r.exports=u}(pt,pt.exports);var py=pt.exports,hy=fy,dy=ly,oo=py,uo=oo&&oo.isTypedArray,yy=uo?dy(uo):hy,so=yy,gy=ro,vy=io,_y=j,my=ao,wy=Ln,by=so,$y=Object.prototype,Ey=$y.hasOwnProperty;function Ay(r,e){var t=_y(r),n=!t&&vy(r),i=!t&&!n&&my(r),a=!t&&!n&&!i&&by(r),o=t||n||i||a,u=o?gy(r.length,String):[],f=u.length;for(var c in r)(e||Ey.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||wy(c,f)))&&u.push(c);return u}var fo=Ay,Oy=Object.prototype;function Sy(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Oy;return r===t}var co=Sy;function Iy(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var Py=Iy,xy=He,Ty=co,Fy=Py,Ry=Object.prototype,My=Ry.hasOwnProperty;function Cy(r){if(!xy(r))return Fy(r);var e=Ty(r),t=[];for(var n in r)n=="constructor"&&(e||!My.call(r,n))||t.push(n);return t}var Ny=Cy,By=fo,Dy=Ny,Uy=mr;function Ly(r){return Uy(r)?By(r,!0):Dy(r)}var ky=Ly,qy=Rh,jy=bd,Vy=ky,Gy=jy(function(r,e){qy(e,Vy(e),r)}),Hy=Gy,Wy=Hy,ht={},xe={};function Xy(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 zy=Xy;function Yy(r){return function(e,t,n){for(var i=-1,a=Object(e),o=n(e),u=o.length;u--;){var f=o[r?u:++i];if(t(a[f],f,a)===!1)break}return e}}var Ky=Yy,Zy=Ky,Jy=Zy(),Qy=Jy;function eg(r,e){return function(t){return r(e(t))}}var rg=eg,tg=rg,ng=tg(Object.keys,Object),ig=ng,ag=co,og=ig,ug=Object.prototype,sg=ug.hasOwnProperty;function fg(r){if(!ag(r))return og(r);var e=[];for(var t in Object(r))sg.call(r,t)&&t!="constructor"&&e.push(t);return e}var cg=fg,lg=fo,pg=cg,hg=mr;function dg(r){return hg(r)?lg(r):pg(r)}var dt=dg,yg=Qy,gg=dt;function vg(r,e){return r&&yg(r,e,gg)}var _g=vg,mg=mr;function wg(r,e){return function(t,n){if(t==null)return t;if(!mg(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 bg=wg,$g=_g,Eg=bg,Ag=Eg($g),kn=Ag,Og=kn;function Sg(r,e){var t=!0;return Og(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var Ig=Sg;function Pg(){this.__data__=[],this.size=0}var xg=Pg,Tg=ft;function Fg(r,e){for(var t=r.length;t--;)if(Tg(r[t][0],e))return t;return-1}var yt=Fg,Rg=yt,Mg=Array.prototype,Cg=Mg.splice;function Ng(r){var e=this.__data__,t=Rg(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Cg.call(e,t,1),--this.size,!0}var Bg=Ng,Dg=yt;function Ug(r){var e=this.__data__,t=Dg(e,r);return t<0?void 0:e[t][1]}var Lg=Ug,kg=yt;function qg(r){return kg(this.__data__,r)>-1}var jg=qg,Vg=yt;function Gg(r,e){var t=this.__data__,n=Vg(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Hg=Gg,Wg=xg,Xg=Bg,zg=Lg,Yg=jg,Kg=Hg;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=Wg,We.prototype.delete=Xg,We.prototype.get=zg,We.prototype.has=Yg,We.prototype.set=Kg;var gt=We,Zg=gt;function Jg(){this.__data__=new Zg,this.size=0}var Qg=Jg;function ev(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var rv=ev;function tv(r){return this.__data__.get(r)}var nv=tv;function iv(r){return this.__data__.has(r)}var av=iv,ov=Pe,uv=oe,sv=ov(uv,"Map"),qn=sv,fv=Pe,cv=fv(Object,"create"),vt=cv,lo=vt;function lv(){this.__data__=lo?lo(null):{},this.size=0}var pv=lv;function hv(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var dv=hv,yv=vt,gv="__lodash_hash_undefined__",vv=Object.prototype,_v=vv.hasOwnProperty;function mv(r){var e=this.__data__;if(yv){var t=e[r];return t===gv?void 0:t}return _v.call(e,r)?e[r]:void 0}var wv=mv,bv=vt,$v=Object.prototype,Ev=$v.hasOwnProperty;function Av(r){var e=this.__data__;return bv?e[r]!==void 0:Ev.call(e,r)}var Ov=Av,Sv=vt,Iv="__lodash_hash_undefined__";function Pv(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Sv&&e===void 0?Iv:e,this}var xv=Pv,Tv=pv,Fv=dv,Rv=wv,Mv=Ov,Cv=xv;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=Tv,Xe.prototype.delete=Fv,Xe.prototype.get=Rv,Xe.prototype.has=Mv,Xe.prototype.set=Cv;var Nv=Xe,po=Nv,Bv=gt,Dv=qn;function Uv(){this.size=0,this.__data__={hash:new po,map:new(Dv||Bv),string:new po}}var Lv=Uv;function kv(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var qv=kv,jv=qv;function Vv(r,e){var t=r.__data__;return jv(e)?t[typeof e=="string"?"string":"hash"]:t.map}var _t=Vv,Gv=_t;function Hv(r){var e=Gv(this,r).delete(r);return this.size-=e?1:0,e}var Wv=Hv,Xv=_t;function zv(r){return Xv(this,r).get(r)}var Yv=zv,Kv=_t;function Zv(r){return Kv(this,r).has(r)}var Jv=Zv,Qv=_t;function e_(r,e){var t=Qv(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var r_=e_,t_=Lv,n_=Wv,i_=Yv,a_=Jv,o_=r_;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=t_,ze.prototype.delete=n_,ze.prototype.get=i_,ze.prototype.has=a_,ze.prototype.set=o_;var jn=ze,u_=gt,s_=qn,f_=jn,c_=200;function l_(r,e){var t=this.__data__;if(t instanceof u_){var n=t.__data__;if(!s_||n.length<c_-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new f_(n)}return t.set(r,e),this.size=t.size,this}var p_=l_,h_=gt,d_=Qg,y_=rv,g_=nv,v_=av,__=p_;function Ye(r){var e=this.__data__=new h_(r);this.size=e.size}Ye.prototype.clear=d_,Ye.prototype.delete=y_,Ye.prototype.get=g_,Ye.prototype.has=v_,Ye.prototype.set=__;var ho=Ye,m_="__lodash_hash_undefined__";function w_(r){return this.__data__.set(r,m_),this}var b_=w_;function $_(r){return this.__data__.has(r)}var E_=$_,A_=jn,O_=b_,S_=E_;function mt(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new A_;++e<t;)this.add(r[e])}mt.prototype.add=mt.prototype.push=O_,mt.prototype.has=S_;var I_=mt;function P_(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 x_=P_;function T_(r,e){return r.has(e)}var F_=T_,R_=I_,M_=x_,C_=F_,N_=1,B_=2;function D_(r,e,t,n,i,a){var o=t&N_,u=r.length,f=e.length;if(u!=f&&!(o&&f>u))return!1;var c=a.get(r),l=a.get(e);if(c&&l)return c==e&&l==r;var s=-1,p=!0,y=t&B_?new R_:void 0;for(a.set(r,e),a.set(e,r);++s<u;){var m=r[s],A=e[s];if(n)var S=o?n(A,m,s,e,r,a):n(m,A,s,r,e,a);if(S!==void 0){if(S)continue;p=!1;break}if(y){if(!M_(e,function(b,E){if(!C_(y,E)&&(m===b||i(m,b,t,n,a)))return y.push(E)})){p=!1;break}}else if(!(m===A||i(m,A,t,n,a))){p=!1;break}}return a.delete(r),a.delete(e),p}var yo=D_,U_=oe,L_=U_.Uint8Array,k_=L_;function q_(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var j_=q_;function V_(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var G_=V_,go=ut,vo=k_,H_=ft,W_=yo,X_=j_,z_=G_,Y_=1,K_=2,Z_="[object Boolean]",J_="[object Date]",Q_="[object Error]",em="[object Map]",rm="[object Number]",tm="[object RegExp]",nm="[object Set]",im="[object String]",am="[object Symbol]",om="[object ArrayBuffer]",um="[object DataView]",_o=go?go.prototype:void 0,Vn=_o?_o.valueOf:void 0;function sm(r,e,t,n,i,a,o){switch(t){case um:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case om:return!(r.byteLength!=e.byteLength||!a(new vo(r),new vo(e)));case Z_:case J_:case rm:return H_(+r,+e);case Q_:return r.name==e.name&&r.message==e.message;case tm:case im:return r==e+"";case em:var u=X_;case nm:var f=n&Y_;if(u||(u=z_),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=K_,o.set(r,e);var l=W_(u(r),u(e),n,i,a,o);return o.delete(r),l;case am:if(Vn)return Vn.call(r)==Vn.call(e)}return!1}var fm=sm;function cm(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var lm=cm,pm=lm,hm=j;function dm(r,e,t){var n=e(r);return hm(r)?n:pm(n,t(r))}var ym=dm;function gm(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 vm=gm;function _m(){return[]}var mm=_m,wm=vm,bm=mm,$m=Object.prototype,Em=$m.propertyIsEnumerable,mo=Object.getOwnPropertySymbols,Am=mo?function(r){return r==null?[]:(r=Object(r),wm(mo(r),function(e){return Em.call(r,e)}))}:bm,Om=Am,Sm=ym,Im=Om,Pm=dt;function xm(r){return Sm(r,Pm,Im)}var Tm=xm,wo=Tm,Fm=1,Rm=Object.prototype,Mm=Rm.hasOwnProperty;function Cm(r,e,t,n,i,a){var o=t&Fm,u=wo(r),f=u.length,c=wo(e),l=c.length;if(f!=l&&!o)return!1;for(var s=f;s--;){var p=u[s];if(!(o?p in e:Mm.call(e,p)))return!1}var y=a.get(r),m=a.get(e);if(y&&m)return y==e&&m==r;var A=!0;a.set(r,e),a.set(e,r);for(var S=o;++s<f;){p=u[s];var b=r[p],E=e[p];if(n)var h=o?n(E,b,p,e,r,a):n(b,E,p,r,e,a);if(!(h===void 0?b===E||i(b,E,t,n,a):h)){A=!1;break}S||(S=p=="constructor")}if(A&&!S){var I=r.constructor,T=e.constructor;I!=T&&"constructor"in r&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof T=="function"&&T instanceof T)&&(A=!1)}return a.delete(r),a.delete(e),A}var Nm=Cm,Bm=Pe,Dm=oe,Um=Bm(Dm,"DataView"),Lm=Um,km=Pe,qm=oe,jm=km(qm,"Promise"),Vm=jm,Gm=Pe,Hm=oe,Wm=Gm(Hm,"Set"),Xm=Wm,zm=Pe,Ym=oe,Km=zm(Ym,"WeakMap"),Zm=Km,Gn=Lm,Hn=qn,Wn=Vm,Xn=Xm,zn=Zm,bo=he,Ke=za,$o="[object Map]",Jm="[object Object]",Eo="[object Promise]",Ao="[object Set]",Oo="[object WeakMap]",So="[object DataView]",Qm=Ke(Gn),ew=Ke(Hn),rw=Ke(Wn),tw=Ke(Xn),nw=Ke(zn),Te=bo;(Gn&&Te(new Gn(new ArrayBuffer(1)))!=So||Hn&&Te(new Hn)!=$o||Wn&&Te(Wn.resolve())!=Eo||Xn&&Te(new Xn)!=Ao||zn&&Te(new zn)!=Oo)&&(Te=function(r){var e=bo(r),t=e==Jm?r.constructor:void 0,n=t?Ke(t):"";if(n)switch(n){case Qm:return So;case ew:return $o;case rw:return Eo;case tw:return Ao;case nw:return Oo}return e});var iw=Te,Yn=ho,aw=yo,ow=fm,uw=Nm,Io=iw,Po=j,xo=ao,sw=so,fw=1,To="[object Arguments]",Fo="[object Array]",wt="[object Object]",cw=Object.prototype,Ro=cw.hasOwnProperty;function lw(r,e,t,n,i,a){var o=Po(r),u=Po(e),f=o?Fo:Io(r),c=u?Fo:Io(e);f=f==To?wt:f,c=c==To?wt:c;var l=f==wt,s=c==wt,p=f==c;if(p&&xo(r)){if(!xo(e))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new Yn),o||sw(r)?aw(r,e,t,n,i,a):ow(r,e,f,t,n,i,a);if(!(t&fw)){var y=l&&Ro.call(r,"__wrapped__"),m=s&&Ro.call(e,"__wrapped__");if(y||m){var A=y?r.value():r,S=m?e.value():e;return a||(a=new Yn),i(A,S,t,n,a)}}return p?(a||(a=new Yn),uw(r,e,t,n,i,a)):!1}var pw=lw,hw=pw,Mo=de;function Co(r,e,t,n,i){return r===e?!0:r==null||e==null||!Mo(r)&&!Mo(e)?r!==r&&e!==e:hw(r,e,t,n,Co,i)}var No=Co,dw=ho,yw=No,gw=1,vw=2;function _w(r,e,t,n){var i=t.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var u=t[i];if(o&&u[2]?u[1]!==r[u[0]]:!(u[0]in r))return!1}for(;++i<a;){u=t[i];var f=u[0],c=r[f],l=u[1];if(o&&u[2]){if(c===void 0&&!(f in r))return!1}else{var s=new dw;if(n)var p=n(c,l,f,r,e,s);if(!(p===void 0?yw(l,c,gw|vw,n,s):p))return!1}}return!0}var mw=_w,ww=He;function bw(r){return r===r&&!ww(r)}var Bo=bw,$w=Bo,Ew=dt;function Aw(r){for(var e=Ew(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,$w(i)]}return e}var Ow=Aw;function Sw(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var Do=Sw,Iw=mw,Pw=Ow,xw=Do;function Tw(r){var e=Pw(r);return e.length==1&&e[0][2]?xw(e[0][0],e[0][1]):function(t){return t===r||Iw(t,r,e)}}var Fw=Tw,Rw=he,Mw=de,Cw="[object Symbol]";function Nw(r){return typeof r=="symbol"||Mw(r)&&Rw(r)==Cw}var bt=Nw,Bw=j,Dw=bt,Uw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Lw=/^\w*$/;function kw(r,e){if(Bw(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||Dw(r)?!0:Lw.test(r)||!Uw.test(r)||e!=null&&r in Object(e)}var Kn=kw,Uo=jn,qw="Expected a function";function Zn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(qw);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(Zn.Cache||Uo),t}Zn.Cache=Uo;var jw=Zn,Vw=jw,Gw=500;function Hw(r){var e=Vw(r,function(n){return t.size===Gw&&t.clear(),n}),t=e.cache;return e}var Ww=Hw,Xw=Ww,zw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Yw=/\\(\\)?/g,Kw=Xw(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(zw,function(t,n,i,a){e.push(i?a.replace(Yw,"$1"):n||t)}),e}),Zw=Kw;function Jw(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 Jn=Jw,Lo=ut,Qw=Jn,e0=j,r0=bt,t0=1/0,ko=Lo?Lo.prototype:void 0,qo=ko?ko.toString:void 0;function jo(r){if(typeof r=="string")return r;if(e0(r))return Qw(r,jo)+"";if(r0(r))return qo?qo.call(r):"";var e=r+"";return e=="0"&&1/r==-t0?"-0":e}var n0=jo,i0=n0;function a0(r){return r==null?"":i0(r)}var o0=a0,u0=j,s0=Kn,f0=Zw,c0=o0;function l0(r,e){return u0(r)?r:s0(r,e)?[r]:f0(c0(r))}var Vo=l0,p0=bt,h0=1/0;function d0(r){if(typeof r=="string"||p0(r))return r;var e=r+"";return e=="0"&&1/r==-h0?"-0":e}var $t=d0,y0=Vo,g0=$t;function v0(r,e){e=y0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[g0(e[t++])];return t&&t==n?r:void 0}var Go=v0,_0=Go;function m0(r,e,t){var n=r==null?void 0:_0(r,e);return n===void 0?t:n}var w0=m0;function b0(r,e){return r!=null&&e in Object(r)}var $0=b0,E0=Vo,A0=io,O0=j,S0=Ln,I0=Un,P0=$t;function x0(r,e,t){e=E0(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=P0(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&&I0(i)&&S0(o,i)&&(O0(r)||A0(r)))}var T0=x0,F0=$0,R0=T0;function M0(r,e){return r!=null&&R0(r,e,F0)}var C0=M0,N0=No,B0=w0,D0=C0,U0=Kn,L0=Bo,k0=Do,q0=$t,j0=1,V0=2;function G0(r,e){return U0(r)&&L0(e)?k0(q0(r),e):function(t){var n=B0(t,r);return n===void 0&&n===e?D0(t,r):N0(e,n,j0|V0)}}var H0=G0;function W0(r){return function(e){return e?.[r]}}var X0=W0,z0=Go;function Y0(r){return function(e){return z0(e,r)}}var K0=Y0,Z0=X0,J0=K0,Q0=Kn,eb=$t;function rb(r){return Q0(r)?Z0(eb(r)):J0(r)}var tb=rb,nb=Fw,ib=H0,ab=ct,ob=j,ub=tb;function sb(r){return typeof r=="function"?r:r==null?ab:typeof r=="object"?ob(r)?ib(r[0],r[1]):nb(r):ub(r)}var Ho=sb,fb=zy,cb=Ig,lb=Ho,pb=j,hb=eo;function db(r,e,t){var n=pb(r)?fb:cb;return t&&hb(r,e,t)&&(e=void 0),n(r,lb(e))}var Qn=db;Object.defineProperty(xe,"__esModule",{value:!0}),xe.calculatePadding=_b,xe.slicePadding=mb;var yb=Qn,gb=vb(yb);function vb(r){return r&&r.__esModule?r:{default:r}}function _b(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function mb(r,e){var t=r.slice(e),n=(0,gb.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(ht,"__esModule",{value:!0}),ht.Cursor=void 0;var wb=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}}(),bb=xe;function $b(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var ei=function(){function r(e){$b(this,r),e instanceof d||(e=typeof e=="number"?d.alloc(e):d.from(e)),this._setBuffer(e),this.rewind()}return wb(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,bb.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){ei.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){ei.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),ht.Cursor=ei,Object.defineProperty(C,"__esModule",{value:!0}),C.default=xb;var Eb=Wy,Wo=zo(Eb),Ab=Bn,Ob=zo(Ab),Xo=ht;function zo(r){return r&&r.__esModule?r:{default:r}}var Sb=Math.pow(2,16),Ib={toXDR:function(e){var t=new Xo.Cursor(Sb);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 Xo.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}}},Pb={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 xb(r){(0,Wo.default)(r,Ib),(0,Ob.default)(r)&&(0,Wo.default)(r.prototype,Pb)}Object.defineProperty(ae,"__esModule",{value:!0}),ae.Int=void 0;var Tb=st,Yo=Ko(Tb),Fb=C,Rb=Ko(Fb);function Ko(r){return r&&r.__esModule?r:{default:r}}var wr=ae.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,Yo.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,Yo.default)(e)||Math.floor(e)!==e?!1:e>=wr.MIN_VALUE&&e<=wr.MAX_VALUE}};wr.MAX_VALUE=Math.pow(2,31)-1,wr.MIN_VALUE=-Math.pow(2,31),(0,Rb.default)(wr);var Et={};function Mb(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 Zo={exports:{}};(function(r){/**
|
|
20
|
+
`+e.prev}function rt(r,e){var t=Sn(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=le(r,i)?e(r[i],r):""}var a=typeof En=="function"?En(r):[],o;if(Ve){o={};for(var u=0;u<a.length;u++)o["$"+a[u]]=a[u]}for(var f in r)le(r,f)&&(t&&String(Number(f))===f&&f<r.length||Ve&&o["$"+f]instanceof Symbol||(ma.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r))));if(typeof En=="function")for(var c=0;c<a.length;c++)$a.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var xn=en,Ge=mf,pl=Xc,hl=xn("%TypeError%"),tt=xn("%WeakMap%",!0),nt=xn("%Map%",!0),dl=Ge("WeakMap.prototype.get",!0),yl=Ge("WeakMap.prototype.set",!0),gl=Ge("WeakMap.prototype.has",!0),vl=Ge("Map.prototype.get",!0),_l=Ge("Map.prototype.set",!0),ml=Ge("Map.prototype.has",!0),Tn=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},wl=function(r,e){var t=Tn(r,e);return t&&t.value},bl=function(r,e,t){var n=Tn(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},$l=function(r,e){return!!Tn(r,e)},El=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new hl("Side channel does not contain "+pl(a))},get:function(a){if(tt&&a&&(typeof a=="object"||typeof a=="function")){if(e)return dl(e,a)}else if(nt){if(t)return vl(t,a)}else if(n)return wl(n,a)},has:function(a){if(tt&&a&&(typeof a=="object"||typeof a=="function")){if(e)return gl(e,a)}else if(nt){if(t)return ml(t,a)}else if(n)return $l(n,a);return!1},set:function(a,o){tt&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new tt),yl(e,a,o)):nt?(t||(t=new nt),_l(t,a,o)):(n||(n={key:{},next:null}),bl(n,a,o))}};return i},Al=String.prototype.replace,Ol=/%20/g,Fn={RFC1738:"RFC1738",RFC3986:"RFC3986"},Ma={default:Fn.RFC3986,formatters:{RFC1738:function(r){return Al.call(r,Ol,"+")},RFC3986:function(r){return String(r)}},RFC1738:Fn.RFC1738,RFC3986:Fn.RFC3986},Sl=Ma,Rn=Object.prototype.hasOwnProperty,Ie=Array.isArray,re=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),Il=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Ie(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},Ca=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},Pl=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Ie(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Rn.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 Ie(e)&&!Ie(t)&&(i=Ca(e,n)),Ie(e)&&Ie(t)?(t.forEach(function(a,o){if(Rn.call(e,o)){var u=e[o];u&&typeof u=="object"&&a&&typeof a=="object"?e[o]=r(u,a,n):e.push(a)}else e[o]=a}),e):Object.keys(t).reduce(function(a,o){var u=t[o];return Rn.call(a,o)?a[o]=r(a[o],u,n):a[o]=u,a},i)},xl=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},Tl=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}},Fl=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 u="",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===Sl.RFC1738&&(c===40||c===41)){u+=o.charAt(f);continue}if(c<128){u=u+re[c];continue}if(c<2048){u=u+(re[192|c>>6]+re[128|c&63]);continue}if(c<55296||c>=57344){u=u+(re[224|c>>12]+re[128|c>>6&63]+re[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),u+=re[240|c>>18]+re[128|c>>12&63]+re[128|c>>6&63]+re[128|c&63]}return u},Rl=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],u=Object.keys(o),f=0;f<u.length;++f){var c=u[f],l=o[c];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(t.push({obj:o,prop:c}),n.push(l))}return Il(t),e},Ml=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Cl=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Nl=function(e,t){return[].concat(e,t)},Bl=function(e,t){if(Ie(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},Dl={arrayToObject:Ca,assign:xl,combine:Nl,compact:Rl,decode:Tl,encode:Fl,isBuffer:Cl,isRegExp:Ml,maybeMap:Bl,merge:Pl},Na=El,it=Dl,yr=Ma,Ul=Object.prototype.hasOwnProperty,Ba={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},ie=Array.isArray,Ll=Array.prototype.push,Da=function(r,e){Ll.apply(r,ie(e)?e:[e])},kl=Date.prototype.toISOString,Ua=yr.default,q={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:it.encode,encodeValuesOnly:!1,format:Ua,formatter:yr.formatters[Ua],indices:!1,serializeDate:function(e){return kl.call(e)},skipNulls:!1,strictNullHandling:!1},ql=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Mn={},jl=function r(e,t,n,i,a,o,u,f,c,l,s,p,y,m,A,S){for(var b=e,E=S,h=0,I=!1;(E=E.get(Mn))!==void 0&&!I;){var T=E.get(e);if(h+=1,typeof T<"u"){if(T===h)throw new RangeError("Cyclic object value");I=!0}typeof E.get(Mn)>"u"&&(h=0)}if(typeof f=="function"?b=f(t,b):b instanceof Date?b=s(b):n==="comma"&&ie(b)&&(b=it.maybeMap(b,function(ge){return ge instanceof Date?s(ge):ge})),b===null){if(a)return u&&!m?u(t,q.encoder,A,"key",p):t;b=""}if(ql(b)||it.isBuffer(b)){if(u){var R=m?t:u(t,q.encoder,A,"key",p);return[y(R)+"="+y(u(b,q.encoder,A,"value",p))]}return[y(t)+"="+y(String(b))]}var _=[];if(typeof b>"u")return _;var g;if(n==="comma"&&ie(b))m&&u&&(b=it.maybeMap(b,u)),g=[{value:b.length>0?b.join(",")||null:void 0}];else if(ie(f))g=f;else{var v=Object.keys(b);g=c?v.sort(c):v}for(var O=i&&ie(b)&&b.length===1?t+"[]":t,P=0;P<g.length;++P){var M=g[P],z=typeof M=="object"&&typeof M.value<"u"?M.value:b[M];if(!(o&&z===null)){var ye=ie(b)?typeof n=="function"?n(O,M):O:O+(l?"."+M:"["+M+"]");S.set(e,h);var ir=Na();ir.set(Mn,S),Da(_,r(z,ye,n,i,a,o,n==="comma"&&m&&ie(b)?null:u,f,c,l,s,p,y,m,A,ir))}}return _},Vl=function(e){if(!e)return q;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||q.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=yr.default;if(typeof e.format<"u"){if(!Ul.call(yr.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=yr.formatters[n],a=q.filter;return(typeof e.filter=="function"||ie(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:q.addQueryPrefix,allowDots:typeof e.allowDots>"u"?q.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:q.charsetSentinel,delimiter:typeof e.delimiter>"u"?q.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:q.encode,encoder:typeof e.encoder=="function"?e.encoder:q.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:q.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:q.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:q.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:q.strictNullHandling}},Gl=function(r,e){var t=r,n=Vl(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 u;e&&e.arrayFormat in Ba?u=e.arrayFormat:e&&"indices"in e?u=e.indices?"indices":"repeat":u="indices";var f=Ba[u];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=Na(),s=0;s<i.length;++s){var p=i[s];n.skipNulls&&t[p]===null||Da(o,jl(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),m=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?m+="utf8=%26%2310003%3B&":m+="utf8=%E2%9C%93&"),y.length>0?m+y:""},Hl=ve(Gl);let La={storeIdentifier:"",environment:"prod"};function Wl(r){La=r}function X(){return La}const Xl=(r,e="")=>{switch(r){case"prod":return"https://api.rechargeapps.com";case"stage":return"https://api.stage.rechargeapps.com";case"preprod":case"prestage":return`${e}/api`}},gr=(r,e="")=>{switch(r){case"prod":return"https://admin.rechargeapps.com";case"stage":return"https://admin.stage.rechargeapps.com";case"preprod":case"prestage":return e}},zl=r=>{switch(r){case"prod":case"preprod":return"https://static.rechargecdn.com";case"stage":case"prestage":return"https://static.stage.rechargecdn.com"}},Yl="/tools/recurring";class at{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}function Kl(r){return Hl(r,{encode:!1,indices:!1,arrayFormat:"comma"})}function w(r,e){return{...r,internalFnCall:r.internalFnCall??e,internalRequestId:r.internalRequestId??Pi()}}async function ot(r,e,t={}){const n=X();return H(r,`${zl(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function $(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:u,environmentUri:f,storeIdentifier:c,loginRetryFn:l}=X(),s=o.apiToken,p=Xl(u,f),y={"X-Recharge-Access-Token":s,"X-Recharge-Version":"2021-11","X-Recharge-Fn":o.internalFnCall,"X-Request-Id":o.internalRequestId,...a||{}},m={shop_url:c,...n};try{return await H(r,`${p}${e}`,{id:t,query:m,data:i,headers:y})}catch(A){if(l&&A instanceof at&&A.status===401)return l().then(S=>{if(S)return H(r,`${p}${e}`,{id:t,query:m,data:i,headers:{...y,"X-Recharge-Access-Token":S.apiToken}});throw A});throw A}}async function vr(r,e,t={}){return H(r,`${Yl}${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 s;[o,s]=o.split("?");const p=[s,Kl(n)].join("&").replace(/^&/,"");o=`${o}${p?`?${p}`:""}`}let u;i&&r!=="get"&&(u=JSON.stringify(i));const f={Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client",...a||{}},c=await fetch(o,{method:r,headers:f,body:u});let l;try{l=await c.json()}catch{}if(!c.ok)throw l&&l.error?new at(l.error,c.status):l&&l.errors?new at(JSON.stringify(l.errors),c.status):new at("A connection error occurred while making the request");return l}function Zl(r,e){return $("get","/addresses",{query:e},w(r,"listAddresses"))}async function Jl(r,e,t){const{address:n}=await $("get","/addresses",{id:e,query:{include:t?.include}},w(r,"getAddress"));return n}async function Ql(r,e){const{address:t}=await $("post","/addresses",{data:{customer_id:r.customerId?Number(r.customerId):void 0,...e}},w(r,"createAddress"));return t}async function Cn(r,e,t){const{address:n}=await $("put","/addresses",{id:e,data:t},w(r,"updateAddress"));return n}async function ep(r,e,t){return Cn(w(r,"applyDiscountToAddress"),e,{discounts:[{code:t}]})}async function rp(r,e){return Cn(w(r,"removeDiscountsFromAddress"),e,{discounts:[]})}function tp(r,e){return $("delete","/addresses",{id:e},w(r,"deleteAddress"))}async function np(r,e){const{address:t}=await $("post","/addresses/merge",{data:e},w(r,"mergeAddresses"));return t}async function ip(r,e,t){const{charge:n}=await $("post",`/addresses/${e}/charges/skip`,{data:t},w(r,"skipFutureCharge"));return n}var ap=Object.freeze({__proto__:null,applyDiscountToAddress:ep,createAddress:Ql,deleteAddress:tp,getAddress:Jl,listAddresses:Zl,mergeAddresses:np,removeDiscountsFromAddress:rp,skipFutureCharge:ip,updateAddress:Cn});async function op(){const{storefrontAccessToken:r}=X(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await vr("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id,message:t.message}}async function up(r,e){return ka(r,e)}async function ka(r,e){const{environment:t,environmentUri:n,storefrontAccessToken:i,storeIdentifier:a}=X(),o=gr(t,n),u={};i&&(u["X-Recharge-Storefront-Access-Token"]=i);const{api_token:f,customer_id:c,message:l}=await H("post",`${o}/shopify_storefront_access`,{data:{customer_token:e,storefront_token:r,shop_url:a},headers:u});return f?{apiToken:f,customerId:c,message:l}:null}async function sp(r){const{environment:e,environmentUri:t,storefrontAccessToken:n,storeIdentifier:i}=X(),a=gr(e,t),o={};n&&(o["X-Recharge-Storefront-Access-Token"]=n);const{api_token:u,customer_id:f,message:c}=await H("post",`${a}/shopify_customer_account_api_access`,{data:{customer_token:r,shop_url:i},headers:o});return u?{apiToken:u,customerId:f,message:c}:null}async function fp(r,e={}){const{environment:t,environmentUri:n,storefrontAccessToken:i,storeIdentifier:a}=X(),o=gr(t,n),u={};i&&(u["X-Recharge-Storefront-Access-Token"]=i);const f=await H("post",`${o}/attempt_login`,{data:{email:r,shop:a,...e},headers:u});if(f.errors)throw new Error(f.errors);return f.session_token}async function cp(r,e={}){const{storefrontAccessToken:t}=X(),n={};t&&(n["X-Recharge-Storefront-Access-Token"]=t);const i=await vr("post","/attempt_login",{data:{email:r,...e},headers:n});if(i.errors)throw new Error(i.errors);return i.session_token}async function lp(r,e,t){const{environment:n,environmentUri:i,storefrontAccessToken:a,storeIdentifier:o}=X(),u=gr(n,i),f={};a&&(f["X-Recharge-Storefront-Access-Token"]=a);const c=await H("post",`${u}/validate_login`,{data:{code:t,email:r,session_token:e,shop:o},headers:f});if(c.errors)throw new Error(c.errors);return{apiToken:c.api_token,customerId:c.customer_id}}async function pp(r,e,t){const{storefrontAccessToken:n}=X(),i={};n&&(i["X-Recharge-Storefront-Access-Token"]=n);const a=await vr("post","/validate_login",{data:{code:t,email:r,session_token:e},headers:i});if(a.errors)throw new Error(a.errors);return{apiToken:a.api_token,customerId:a.customer_id}}function hp(){const{customerHash:r}=X(),{pathname:e,search:t}=window.location,n=new URLSearchParams(t).get("token"),i=e.split("/").filter(Boolean),a=i.findIndex(u=>u==="portal"),o=a!==-1?i[a+1]:r;if(!n||!o)throw new Error("Not in context of Recharge Customer Portal or URL did not contain correct params");return{customerHash:o,token:n}}async function dp(){const{customerHash:r,token:e}=hp(),{environment:t,environmentUri:n,storefrontAccessToken:i,storeIdentifier:a}=X(),o=gr(t,n),u={};i&&(u["X-Recharge-Storefront-Access-Token"]=i);const f=await H("post",`${o}/customers/${r}/access`,{headers:u,data:{token:e,shop:a}});return{apiToken:f.api_token,customerId:f.customer_id}}var yp=Object.freeze({__proto__:null,loginCustomerPortal:dp,loginShopifyApi:up,loginShopifyAppProxy:op,loginWithShopifyCustomerAccount:sp,loginWithShopifyStorefront:ka,sendPasswordlessCode:fp,sendPasswordlessCodeAppProxy:cp,validatePasswordlessCode:lp,validatePasswordlessCodeAppProxy:pp}),qa={},Nn={},ae={},gp=typeof U=="object"&&U&&U.Object===Object&&U,ja=gp,vp=ja,_p=typeof self=="object"&&self&&self.Object===Object&&self,mp=vp||_p||Function("return this")(),oe=mp,wp=oe,bp=wp.Symbol,ut=bp,Va=ut,Ga=Object.prototype,$p=Ga.hasOwnProperty,Ep=Ga.toString,_r=Va?Va.toStringTag:void 0;function Ap(r){var e=$p.call(r,_r),t=r[_r];try{r[_r]=void 0;var n=!0}catch{}var i=Ep.call(r);return n&&(e?r[_r]=t:delete r[_r]),i}var Op=Ap,Sp=Object.prototype,Ip=Sp.toString;function Pp(r){return Ip.call(r)}var xp=Pp,Ha=ut,Tp=Op,Fp=xp,Rp="[object Null]",Mp="[object Undefined]",Wa=Ha?Ha.toStringTag:void 0;function Cp(r){return r==null?r===void 0?Mp:Rp:Wa&&Wa in Object(r)?Tp(r):Fp(r)}var he=Cp;function Np(r){return r!=null&&typeof r=="object"}var de=Np,Bp=he,Dp=de,Up="[object Number]";function Lp(r){return typeof r=="number"||Dp(r)&&Bp(r)==Up}var st=Lp,C={};function kp(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var He=kp,qp=he,jp=He,Vp="[object AsyncFunction]",Gp="[object Function]",Hp="[object GeneratorFunction]",Wp="[object Proxy]";function Xp(r){if(!jp(r))return!1;var e=qp(r);return e==Gp||e==Hp||e==Vp||e==Wp}var Bn=Xp,zp=oe,Yp=zp["__core-js_shared__"],Kp=Yp,Dn=Kp,Xa=function(){var r=/[^.]+$/.exec(Dn&&Dn.keys&&Dn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function Zp(r){return!!Xa&&Xa in r}var Jp=Zp,Qp=Function.prototype,eh=Qp.toString;function rh(r){if(r!=null){try{return eh.call(r)}catch{}try{return r+""}catch{}}return""}var za=rh,th=Bn,nh=Jp,ih=He,ah=za,oh=/[\\^$.*+?()[\]{}|]/g,uh=/^\[object .+?Constructor\]$/,sh=Function.prototype,fh=Object.prototype,ch=sh.toString,lh=fh.hasOwnProperty,ph=RegExp("^"+ch.call(lh).replace(oh,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function hh(r){if(!ih(r)||nh(r))return!1;var e=th(r)?ph:uh;return e.test(ah(r))}var dh=hh;function yh(r,e){return r?.[e]}var gh=yh,vh=dh,_h=gh;function mh(r,e){var t=_h(r,e);return vh(t)?t:void 0}var Pe=mh,wh=Pe,bh=function(){try{var r=wh(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Ya=bh,Ka=Ya;function $h(r,e,t){e=="__proto__"&&Ka?Ka(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Za=$h;function Eh(r,e){return r===e||r!==r&&e!==e}var ft=Eh,Ah=Za,Oh=ft,Sh=Object.prototype,Ih=Sh.hasOwnProperty;function Ph(r,e,t){var n=r[e];(!(Ih.call(r,e)&&Oh(n,t))||t===void 0&&!(e in r))&&Ah(r,e,t)}var xh=Ph,Th=xh,Fh=Za;function Rh(r,e,t,n){var i=!t;t||(t={});for(var a=-1,o=e.length;++a<o;){var u=e[a],f=n?n(t[u],r[u],u,t,r):void 0;f===void 0&&(f=r[u]),i?Fh(t,u,f):Th(t,u,f)}return t}var Mh=Rh;function Ch(r){return r}var ct=Ch;function Nh(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 Bh=Nh,Dh=Bh,Ja=Math.max;function Uh(r,e,t){return e=Ja(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=Ja(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var u=Array(e+1);++i<e;)u[i]=n[i];return u[e]=t(o),Dh(r,this,u)}}var Lh=Uh;function kh(r){return function(){return r}}var qh=kh,jh=qh,Qa=Ya,Vh=ct,Gh=Qa?function(r,e){return Qa(r,"toString",{configurable:!0,enumerable:!1,value:jh(e),writable:!0})}:Vh,Hh=Gh,Wh=800,Xh=16,zh=Date.now;function Yh(r){var e=0,t=0;return function(){var n=zh(),i=Xh-(n-t);if(t=n,i>0){if(++e>=Wh)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var Kh=Yh,Zh=Hh,Jh=Kh,Qh=Jh(Zh),ed=Qh,rd=ct,td=Lh,nd=ed;function id(r,e){return nd(td(r,e,rd),r+"")}var ad=id,od=9007199254740991;function ud(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=od}var Un=ud,sd=Bn,fd=Un;function cd(r){return r!=null&&fd(r.length)&&!sd(r)}var mr=cd,ld=9007199254740991,pd=/^(?:0|[1-9]\d*)$/;function hd(r,e){var t=typeof r;return e=e??ld,!!e&&(t=="number"||t!="symbol"&&pd.test(r))&&r>-1&&r%1==0&&r<e}var Ln=hd,dd=ft,yd=mr,gd=Ln,vd=He;function _d(r,e,t){if(!vd(t))return!1;var n=typeof e;return(n=="number"?yd(t)&&gd(e,t.length):n=="string"&&e in t)?dd(t[e],r):!1}var eo=_d,md=ad,wd=eo;function bd(r){return md(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&&wd(t[0],t[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var u=t[n];u&&r(e,u,n,a)}return e})}var $d=bd;function Ed(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var ro=Ed,Ad=he,Od=de,Sd="[object Arguments]";function Id(r){return Od(r)&&Ad(r)==Sd}var Pd=Id,to=Pd,xd=de,no=Object.prototype,Td=no.hasOwnProperty,Fd=no.propertyIsEnumerable,Rd=to(function(){return arguments}())?to:function(r){return xd(r)&&Td.call(r,"callee")&&!Fd.call(r,"callee")},io=Rd,Md=Array.isArray,j=Md,lt={exports:{}};function Cd(){return!1}var Nd=Cd;lt.exports,function(r,e){var t=oe,n=Nd,i=e&&!e.nodeType&&e,a=i&&!0&&r&&!r.nodeType&&r,o=a&&a.exports===i,u=o?t.Buffer:void 0,f=u?u.isBuffer:void 0,c=f||n;r.exports=c}(lt,lt.exports);var ao=lt.exports,Bd=he,Dd=Un,Ud=de,Ld="[object Arguments]",kd="[object Array]",qd="[object Boolean]",jd="[object Date]",Vd="[object Error]",Gd="[object Function]",Hd="[object Map]",Wd="[object Number]",Xd="[object Object]",zd="[object RegExp]",Yd="[object Set]",Kd="[object String]",Zd="[object WeakMap]",Jd="[object ArrayBuffer]",Qd="[object DataView]",ey="[object Float32Array]",ry="[object Float64Array]",ty="[object Int8Array]",ny="[object Int16Array]",iy="[object Int32Array]",ay="[object Uint8Array]",oy="[object Uint8ClampedArray]",uy="[object Uint16Array]",sy="[object Uint32Array]",F={};F[ey]=F[ry]=F[ty]=F[ny]=F[iy]=F[ay]=F[oy]=F[uy]=F[sy]=!0,F[Ld]=F[kd]=F[Jd]=F[qd]=F[Qd]=F[jd]=F[Vd]=F[Gd]=F[Hd]=F[Wd]=F[Xd]=F[zd]=F[Yd]=F[Kd]=F[Zd]=!1;function fy(r){return Ud(r)&&Dd(r.length)&&!!F[Bd(r)]}var cy=fy;function ly(r){return function(e){return r(e)}}var py=ly,pt={exports:{}};pt.exports,function(r,e){var t=ja,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a&&t.process,u=function(){try{var f=i&&i.require&&i.require("util").types;return f||o&&o.binding&&o.binding("util")}catch{}}();r.exports=u}(pt,pt.exports);var hy=pt.exports,dy=cy,yy=py,oo=hy,uo=oo&&oo.isTypedArray,gy=uo?yy(uo):dy,so=gy,vy=ro,_y=io,my=j,wy=ao,by=Ln,$y=so,Ey=Object.prototype,Ay=Ey.hasOwnProperty;function Oy(r,e){var t=my(r),n=!t&&_y(r),i=!t&&!n&&wy(r),a=!t&&!n&&!i&&$y(r),o=t||n||i||a,u=o?vy(r.length,String):[],f=u.length;for(var c in r)(e||Ay.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||by(c,f)))&&u.push(c);return u}var fo=Oy,Sy=Object.prototype;function Iy(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Sy;return r===t}var co=Iy;function Py(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var xy=Py,Ty=He,Fy=co,Ry=xy,My=Object.prototype,Cy=My.hasOwnProperty;function Ny(r){if(!Ty(r))return Ry(r);var e=Fy(r),t=[];for(var n in r)n=="constructor"&&(e||!Cy.call(r,n))||t.push(n);return t}var By=Ny,Dy=fo,Uy=By,Ly=mr;function ky(r){return Ly(r)?Dy(r,!0):Uy(r)}var qy=ky,jy=Mh,Vy=$d,Gy=qy,Hy=Vy(function(r,e){jy(e,Gy(e),r)}),Wy=Hy,Xy=Wy,ht={},xe={};function zy(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 Yy=zy;function Ky(r){return function(e,t,n){for(var i=-1,a=Object(e),o=n(e),u=o.length;u--;){var f=o[r?u:++i];if(t(a[f],f,a)===!1)break}return e}}var Zy=Ky,Jy=Zy,Qy=Jy(),eg=Qy;function rg(r,e){return function(t){return r(e(t))}}var tg=rg,ng=tg,ig=ng(Object.keys,Object),ag=ig,og=co,ug=ag,sg=Object.prototype,fg=sg.hasOwnProperty;function cg(r){if(!og(r))return ug(r);var e=[];for(var t in Object(r))fg.call(r,t)&&t!="constructor"&&e.push(t);return e}var lg=cg,pg=fo,hg=lg,dg=mr;function yg(r){return dg(r)?pg(r):hg(r)}var dt=yg,gg=eg,vg=dt;function _g(r,e){return r&&gg(r,e,vg)}var mg=_g,wg=mr;function bg(r,e){return function(t,n){if(t==null)return t;if(!wg(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 $g=bg,Eg=mg,Ag=$g,Og=Ag(Eg),kn=Og,Sg=kn;function Ig(r,e){var t=!0;return Sg(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var Pg=Ig;function xg(){this.__data__=[],this.size=0}var Tg=xg,Fg=ft;function Rg(r,e){for(var t=r.length;t--;)if(Fg(r[t][0],e))return t;return-1}var yt=Rg,Mg=yt,Cg=Array.prototype,Ng=Cg.splice;function Bg(r){var e=this.__data__,t=Mg(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Ng.call(e,t,1),--this.size,!0}var Dg=Bg,Ug=yt;function Lg(r){var e=this.__data__,t=Ug(e,r);return t<0?void 0:e[t][1]}var kg=Lg,qg=yt;function jg(r){return qg(this.__data__,r)>-1}var Vg=jg,Gg=yt;function Hg(r,e){var t=this.__data__,n=Gg(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var Wg=Hg,Xg=Tg,zg=Dg,Yg=kg,Kg=Vg,Zg=Wg;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=Xg,We.prototype.delete=zg,We.prototype.get=Yg,We.prototype.has=Kg,We.prototype.set=Zg;var gt=We,Jg=gt;function Qg(){this.__data__=new Jg,this.size=0}var ev=Qg;function rv(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var tv=rv;function nv(r){return this.__data__.get(r)}var iv=nv;function av(r){return this.__data__.has(r)}var ov=av,uv=Pe,sv=oe,fv=uv(sv,"Map"),qn=fv,cv=Pe,lv=cv(Object,"create"),vt=lv,lo=vt;function pv(){this.__data__=lo?lo(null):{},this.size=0}var hv=pv;function dv(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var yv=dv,gv=vt,vv="__lodash_hash_undefined__",_v=Object.prototype,mv=_v.hasOwnProperty;function wv(r){var e=this.__data__;if(gv){var t=e[r];return t===vv?void 0:t}return mv.call(e,r)?e[r]:void 0}var bv=wv,$v=vt,Ev=Object.prototype,Av=Ev.hasOwnProperty;function Ov(r){var e=this.__data__;return $v?e[r]!==void 0:Av.call(e,r)}var Sv=Ov,Iv=vt,Pv="__lodash_hash_undefined__";function xv(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Iv&&e===void 0?Pv:e,this}var Tv=xv,Fv=hv,Rv=yv,Mv=bv,Cv=Sv,Nv=Tv;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=Fv,Xe.prototype.delete=Rv,Xe.prototype.get=Mv,Xe.prototype.has=Cv,Xe.prototype.set=Nv;var Bv=Xe,po=Bv,Dv=gt,Uv=qn;function Lv(){this.size=0,this.__data__={hash:new po,map:new(Uv||Dv),string:new po}}var kv=Lv;function qv(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var jv=qv,Vv=jv;function Gv(r,e){var t=r.__data__;return Vv(e)?t[typeof e=="string"?"string":"hash"]:t.map}var _t=Gv,Hv=_t;function Wv(r){var e=Hv(this,r).delete(r);return this.size-=e?1:0,e}var Xv=Wv,zv=_t;function Yv(r){return zv(this,r).get(r)}var Kv=Yv,Zv=_t;function Jv(r){return Zv(this,r).has(r)}var Qv=Jv,e_=_t;function r_(r,e){var t=e_(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var t_=r_,n_=kv,i_=Xv,a_=Kv,o_=Qv,u_=t_;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=n_,ze.prototype.delete=i_,ze.prototype.get=a_,ze.prototype.has=o_,ze.prototype.set=u_;var jn=ze,s_=gt,f_=qn,c_=jn,l_=200;function p_(r,e){var t=this.__data__;if(t instanceof s_){var n=t.__data__;if(!f_||n.length<l_-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new c_(n)}return t.set(r,e),this.size=t.size,this}var h_=p_,d_=gt,y_=ev,g_=tv,v_=iv,__=ov,m_=h_;function Ye(r){var e=this.__data__=new d_(r);this.size=e.size}Ye.prototype.clear=y_,Ye.prototype.delete=g_,Ye.prototype.get=v_,Ye.prototype.has=__,Ye.prototype.set=m_;var ho=Ye,w_="__lodash_hash_undefined__";function b_(r){return this.__data__.set(r,w_),this}var $_=b_;function E_(r){return this.__data__.has(r)}var A_=E_,O_=jn,S_=$_,I_=A_;function mt(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new O_;++e<t;)this.add(r[e])}mt.prototype.add=mt.prototype.push=S_,mt.prototype.has=I_;var P_=mt;function x_(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 T_=x_;function F_(r,e){return r.has(e)}var R_=F_,M_=P_,C_=T_,N_=R_,B_=1,D_=2;function U_(r,e,t,n,i,a){var o=t&B_,u=r.length,f=e.length;if(u!=f&&!(o&&f>u))return!1;var c=a.get(r),l=a.get(e);if(c&&l)return c==e&&l==r;var s=-1,p=!0,y=t&D_?new M_:void 0;for(a.set(r,e),a.set(e,r);++s<u;){var m=r[s],A=e[s];if(n)var S=o?n(A,m,s,e,r,a):n(m,A,s,r,e,a);if(S!==void 0){if(S)continue;p=!1;break}if(y){if(!C_(e,function(b,E){if(!N_(y,E)&&(m===b||i(m,b,t,n,a)))return y.push(E)})){p=!1;break}}else if(!(m===A||i(m,A,t,n,a))){p=!1;break}}return a.delete(r),a.delete(e),p}var yo=U_,L_=oe,k_=L_.Uint8Array,q_=k_;function j_(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var V_=j_;function G_(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var H_=G_,go=ut,vo=q_,W_=ft,X_=yo,z_=V_,Y_=H_,K_=1,Z_=2,J_="[object Boolean]",Q_="[object Date]",em="[object Error]",rm="[object Map]",tm="[object Number]",nm="[object RegExp]",im="[object Set]",am="[object String]",om="[object Symbol]",um="[object ArrayBuffer]",sm="[object DataView]",_o=go?go.prototype:void 0,Vn=_o?_o.valueOf:void 0;function fm(r,e,t,n,i,a,o){switch(t){case sm:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case um:return!(r.byteLength!=e.byteLength||!a(new vo(r),new vo(e)));case J_:case Q_:case tm:return W_(+r,+e);case em:return r.name==e.name&&r.message==e.message;case nm:case am:return r==e+"";case rm:var u=z_;case im:var f=n&K_;if(u||(u=Y_),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=Z_,o.set(r,e);var l=X_(u(r),u(e),n,i,a,o);return o.delete(r),l;case om:if(Vn)return Vn.call(r)==Vn.call(e)}return!1}var cm=fm;function lm(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var pm=lm,hm=pm,dm=j;function ym(r,e,t){var n=e(r);return dm(r)?n:hm(n,t(r))}var gm=ym;function vm(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 _m=vm;function mm(){return[]}var wm=mm,bm=_m,$m=wm,Em=Object.prototype,Am=Em.propertyIsEnumerable,mo=Object.getOwnPropertySymbols,Om=mo?function(r){return r==null?[]:(r=Object(r),bm(mo(r),function(e){return Am.call(r,e)}))}:$m,Sm=Om,Im=gm,Pm=Sm,xm=dt;function Tm(r){return Im(r,xm,Pm)}var Fm=Tm,wo=Fm,Rm=1,Mm=Object.prototype,Cm=Mm.hasOwnProperty;function Nm(r,e,t,n,i,a){var o=t&Rm,u=wo(r),f=u.length,c=wo(e),l=c.length;if(f!=l&&!o)return!1;for(var s=f;s--;){var p=u[s];if(!(o?p in e:Cm.call(e,p)))return!1}var y=a.get(r),m=a.get(e);if(y&&m)return y==e&&m==r;var A=!0;a.set(r,e),a.set(e,r);for(var S=o;++s<f;){p=u[s];var b=r[p],E=e[p];if(n)var h=o?n(E,b,p,e,r,a):n(b,E,p,r,e,a);if(!(h===void 0?b===E||i(b,E,t,n,a):h)){A=!1;break}S||(S=p=="constructor")}if(A&&!S){var I=r.constructor,T=e.constructor;I!=T&&"constructor"in r&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof T=="function"&&T instanceof T)&&(A=!1)}return a.delete(r),a.delete(e),A}var Bm=Nm,Dm=Pe,Um=oe,Lm=Dm(Um,"DataView"),km=Lm,qm=Pe,jm=oe,Vm=qm(jm,"Promise"),Gm=Vm,Hm=Pe,Wm=oe,Xm=Hm(Wm,"Set"),zm=Xm,Ym=Pe,Km=oe,Zm=Ym(Km,"WeakMap"),Jm=Zm,Gn=km,Hn=qn,Wn=Gm,Xn=zm,zn=Jm,bo=he,Ke=za,$o="[object Map]",Qm="[object Object]",Eo="[object Promise]",Ao="[object Set]",Oo="[object WeakMap]",So="[object DataView]",ew=Ke(Gn),rw=Ke(Hn),tw=Ke(Wn),nw=Ke(Xn),iw=Ke(zn),Te=bo;(Gn&&Te(new Gn(new ArrayBuffer(1)))!=So||Hn&&Te(new Hn)!=$o||Wn&&Te(Wn.resolve())!=Eo||Xn&&Te(new Xn)!=Ao||zn&&Te(new zn)!=Oo)&&(Te=function(r){var e=bo(r),t=e==Qm?r.constructor:void 0,n=t?Ke(t):"";if(n)switch(n){case ew:return So;case rw:return $o;case tw:return Eo;case nw:return Ao;case iw:return Oo}return e});var aw=Te,Yn=ho,ow=yo,uw=cm,sw=Bm,Io=aw,Po=j,xo=ao,fw=so,cw=1,To="[object Arguments]",Fo="[object Array]",wt="[object Object]",lw=Object.prototype,Ro=lw.hasOwnProperty;function pw(r,e,t,n,i,a){var o=Po(r),u=Po(e),f=o?Fo:Io(r),c=u?Fo:Io(e);f=f==To?wt:f,c=c==To?wt:c;var l=f==wt,s=c==wt,p=f==c;if(p&&xo(r)){if(!xo(e))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new Yn),o||fw(r)?ow(r,e,t,n,i,a):uw(r,e,f,t,n,i,a);if(!(t&cw)){var y=l&&Ro.call(r,"__wrapped__"),m=s&&Ro.call(e,"__wrapped__");if(y||m){var A=y?r.value():r,S=m?e.value():e;return a||(a=new Yn),i(A,S,t,n,a)}}return p?(a||(a=new Yn),sw(r,e,t,n,i,a)):!1}var hw=pw,dw=hw,Mo=de;function Co(r,e,t,n,i){return r===e?!0:r==null||e==null||!Mo(r)&&!Mo(e)?r!==r&&e!==e:dw(r,e,t,n,Co,i)}var No=Co,yw=ho,gw=No,vw=1,_w=2;function mw(r,e,t,n){var i=t.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var u=t[i];if(o&&u[2]?u[1]!==r[u[0]]:!(u[0]in r))return!1}for(;++i<a;){u=t[i];var f=u[0],c=r[f],l=u[1];if(o&&u[2]){if(c===void 0&&!(f in r))return!1}else{var s=new yw;if(n)var p=n(c,l,f,r,e,s);if(!(p===void 0?gw(l,c,vw|_w,n,s):p))return!1}}return!0}var ww=mw,bw=He;function $w(r){return r===r&&!bw(r)}var Bo=$w,Ew=Bo,Aw=dt;function Ow(r){for(var e=Aw(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,Ew(i)]}return e}var Sw=Ow;function Iw(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var Do=Iw,Pw=ww,xw=Sw,Tw=Do;function Fw(r){var e=xw(r);return e.length==1&&e[0][2]?Tw(e[0][0],e[0][1]):function(t){return t===r||Pw(t,r,e)}}var Rw=Fw,Mw=he,Cw=de,Nw="[object Symbol]";function Bw(r){return typeof r=="symbol"||Cw(r)&&Mw(r)==Nw}var bt=Bw,Dw=j,Uw=bt,Lw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kw=/^\w*$/;function qw(r,e){if(Dw(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||Uw(r)?!0:kw.test(r)||!Lw.test(r)||e!=null&&r in Object(e)}var Kn=qw,Uo=jn,jw="Expected a function";function Zn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(jw);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(Zn.Cache||Uo),t}Zn.Cache=Uo;var Vw=Zn,Gw=Vw,Hw=500;function Ww(r){var e=Gw(r,function(n){return t.size===Hw&&t.clear(),n}),t=e.cache;return e}var Xw=Ww,zw=Xw,Yw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Kw=/\\(\\)?/g,Zw=zw(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(Yw,function(t,n,i,a){e.push(i?a.replace(Kw,"$1"):n||t)}),e}),Jw=Zw;function Qw(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 Jn=Qw,Lo=ut,e0=Jn,r0=j,t0=bt,n0=1/0,ko=Lo?Lo.prototype:void 0,qo=ko?ko.toString:void 0;function jo(r){if(typeof r=="string")return r;if(r0(r))return e0(r,jo)+"";if(t0(r))return qo?qo.call(r):"";var e=r+"";return e=="0"&&1/r==-n0?"-0":e}var i0=jo,a0=i0;function o0(r){return r==null?"":a0(r)}var u0=o0,s0=j,f0=Kn,c0=Jw,l0=u0;function p0(r,e){return s0(r)?r:f0(r,e)?[r]:c0(l0(r))}var Vo=p0,h0=bt,d0=1/0;function y0(r){if(typeof r=="string"||h0(r))return r;var e=r+"";return e=="0"&&1/r==-d0?"-0":e}var $t=y0,g0=Vo,v0=$t;function _0(r,e){e=g0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[v0(e[t++])];return t&&t==n?r:void 0}var Go=_0,m0=Go;function w0(r,e,t){var n=r==null?void 0:m0(r,e);return n===void 0?t:n}var b0=w0;function $0(r,e){return r!=null&&e in Object(r)}var E0=$0,A0=Vo,O0=io,S0=j,I0=Ln,P0=Un,x0=$t;function T0(r,e,t){e=A0(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)&&(S0(r)||O0(r)))}var F0=T0,R0=E0,M0=F0;function C0(r,e){return r!=null&&M0(r,e,R0)}var N0=C0,B0=No,D0=b0,U0=N0,L0=Kn,k0=Bo,q0=Do,j0=$t,V0=1,G0=2;function H0(r,e){return L0(r)&&k0(e)?q0(j0(r),e):function(t){var n=D0(t,r);return n===void 0&&n===e?U0(t,r):B0(e,n,V0|G0)}}var W0=H0;function X0(r){return function(e){return e?.[r]}}var z0=X0,Y0=Go;function K0(r){return function(e){return Y0(e,r)}}var Z0=K0,J0=z0,Q0=Z0,eb=Kn,rb=$t;function tb(r){return eb(r)?J0(rb(r)):Q0(r)}var nb=tb,ib=Rw,ab=W0,ob=ct,ub=j,sb=nb;function fb(r){return typeof r=="function"?r:r==null?ob:typeof r=="object"?ub(r)?ab(r[0],r[1]):ib(r):sb(r)}var Ho=fb,cb=Yy,lb=Pg,pb=Ho,hb=j,db=eo;function yb(r,e,t){var n=hb(r)?cb:lb;return t&&db(r,e,t)&&(e=void 0),n(r,pb(e))}var Qn=yb;Object.defineProperty(xe,"__esModule",{value:!0}),xe.calculatePadding=mb,xe.slicePadding=wb;var gb=Qn,vb=_b(gb);function _b(r){return r&&r.__esModule?r:{default:r}}function mb(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function wb(r,e){var t=r.slice(e),n=(0,vb.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(ht,"__esModule",{value:!0}),ht.Cursor=void 0;var bb=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}}(),$b=xe;function Eb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var ei=function(){function r(e){Eb(this,r),e instanceof d||(e=typeof e=="number"?d.alloc(e):d.from(e)),this._setBuffer(e),this.rewind()}return bb(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,$b.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){ei.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){ei.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),ht.Cursor=ei,Object.defineProperty(C,"__esModule",{value:!0}),C.default=Tb;var Ab=Xy,Wo=zo(Ab),Ob=Bn,Sb=zo(Ob),Xo=ht;function zo(r){return r&&r.__esModule?r:{default:r}}var Ib=Math.pow(2,16),Pb={toXDR:function(e){var t=new Xo.Cursor(Ib);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 Xo.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}}},xb={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 Tb(r){(0,Wo.default)(r,Pb),(0,Sb.default)(r)&&(0,Wo.default)(r.prototype,xb)}Object.defineProperty(ae,"__esModule",{value:!0}),ae.Int=void 0;var Fb=st,Yo=Ko(Fb),Rb=C,Mb=Ko(Rb);function Ko(r){return r&&r.__esModule?r:{default:r}}var wr=ae.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,Yo.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,Yo.default)(e)||Math.floor(e)!==e?!1:e>=wr.MIN_VALUE&&e<=wr.MAX_VALUE}};wr.MAX_VALUE=Math.pow(2,31)-1,wr.MIN_VALUE=-Math.pow(2,31),(0,Mb.default)(wr);var Et={};function Cb(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 Zo={exports:{}};(function(r){/**
|
|
21
21
|
* @license Long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
|
|
22
22
|
* Released under the Apache License, Version 2.0
|
|
23
23
|
* see: https://github.com/dcodeIO/Long.js for details
|
|
24
|
-
*/(function(e,t){typeof Mb=="function"&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(U,function(){function e(l,s,p){this.low=l|0,this.high=s|0,this.unsigned=!!p}e.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=function(s){return(s&&s.__isLong__)===!0};var t={},n={};e.fromInt=function(s,p){var y,m;return p?(s=s>>>0,0<=s&&s<256&&(m=n[s],m)?m:(y=new e(s,(s|0)<0?-1:0,!0),0<=s&&s<256&&(n[s]=y),y)):(s=s|0,-128<=s&&s<128&&(m=t[s],m)?m:(y=new e(s,s<0?-1:0,!1),-128<=s&&s<128&&(t[s]=y),y))},e.fromNumber=function(s,p){return p=!!p,isNaN(s)||!isFinite(s)?e.ZERO:!p&&s<=-f?e.MIN_VALUE:!p&&s+1>=f?e.MAX_VALUE:p&&s>=u?e.MAX_UNSIGNED_VALUE:s<0?e.fromNumber(-s,p).negate():new e(s%o|0,s/o|0,p)},e.fromBits=function(s,p,y){return new e(s,p,y)},e.fromString=function(s,p,y){if(s.length===0)throw Error("number format error: empty string");if(s==="NaN"||s==="Infinity"||s==="+Infinity"||s==="-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 m;if((m=s.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+s);if(m===0)return e.fromString(s.substring(1),p,y).negate();for(var A=e.fromNumber(Math.pow(y,8)),S=e.ZERO,b=0;b<s.length;b+=8){var E=Math.min(8,s.length-b),h=parseInt(s.substring(b,b+E),y);if(E<8){var I=e.fromNumber(Math.pow(y,E));S=S.multiply(I).add(e.fromNumber(h))}else S=S.multiply(A),S=S.add(e.fromNumber(h))}return S.unsigned=p,S},e.fromValue=function(s){return s instanceof e?s:typeof s=="number"?e.fromNumber(s):typeof s=="string"?e.fromString(s):new e(s.low,s.high,s.unsigned)};var i=65536,a=1<<24,o=i*i,u=o*o,f=u/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(s){if(s=s||10,s<2||36<s)throw RangeError("radix out of range: "+s);if(this.isZero())return"0";var p;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var y=e.fromNumber(s),m=this.divide(y);return p=m.multiply(y).subtract(this),m.toString(s)+p.toInt().toString(s)}else return"-"+this.negate().toString(s);var A=e.fromNumber(Math.pow(s,6),this.unsigned);p=this;for(var S="";;){var b=p.divide(A),E=p.subtract(b.multiply(A)).toInt()>>>0,h=E.toString(s);if(p=b,p.isZero())return h+S;for(;h.length<6;)h="0"+h;S=""+h+S}},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 s=this.high!=0?this.high:this.low,p=31;p>0&&!(s&1<<p);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(s){return e.isLong(s)||(s=e.fromValue(s)),this.unsigned!==s.unsigned&&this.high>>>31===1&&s.high>>>31===1?!1:this.high===s.high&&this.low===s.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(s){return!this.equals(s)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(s){return this.compare(s)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(s){return this.compare(s)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(s){return this.compare(s)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(s){return this.compare(s)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compare=function(s){if(e.isLong(s)||(s=e.fromValue(s)),this.equals(s))return 0;var p=this.isNegative(),y=s.isNegative();return p&&!y?-1:!p&&y?1:this.unsigned?s.high>>>0>this.high>>>0||s.high===this.high&&s.low>>>0>this.low>>>0?-1:1:this.subtract(s).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(s){e.isLong(s)||(s=e.fromValue(s));var p=this.high>>>16,y=this.high&65535,m=this.low>>>16,A=this.low&65535,S=s.high>>>16,b=s.high&65535,E=s.low>>>16,h=s.low&65535,I=0,T=0,R=0,_=0;return _+=A+h,R+=_>>>16,_&=65535,R+=m+E,T+=R>>>16,R&=65535,T+=y+b,I+=T>>>16,T&=65535,I+=p+S,I&=65535,e.fromBits(R<<16|_,I<<16|T,this.unsigned)},e.prototype.subtract=function(s){return e.isLong(s)||(s=e.fromValue(s)),this.add(s.negate())},e.prototype.sub=e.prototype.subtract,e.prototype.multiply=function(s){if(this.isZero()||(e.isLong(s)||(s=e.fromValue(s)),s.isZero()))return e.ZERO;if(this.equals(e.MIN_VALUE))return s.isOdd()?e.MIN_VALUE:e.ZERO;if(s.equals(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return s.isNegative()?this.negate().multiply(s.negate()):this.negate().multiply(s).negate();if(s.isNegative())return this.multiply(s.negate()).negate();if(this.lessThan(c)&&s.lessThan(c))return e.fromNumber(this.toNumber()*s.toNumber(),this.unsigned);var p=this.high>>>16,y=this.high&65535,m=this.low>>>16,A=this.low&65535,S=s.high>>>16,b=s.high&65535,E=s.low>>>16,h=s.low&65535,I=0,T=0,R=0,_=0;return _+=A*h,R+=_>>>16,_&=65535,R+=m*h,T+=R>>>16,R&=65535,R+=A*E,T+=R>>>16,R&=65535,T+=y*h,I+=T>>>16,T&=65535,T+=m*E,I+=T>>>16,T&=65535,T+=A*b,I+=T>>>16,T&=65535,I+=p*h+y*E+m*b+A*S,I&=65535,e.fromBits(R<<16|_,I<<16|T,this.unsigned)},e.prototype.mul=e.prototype.multiply,e.prototype.divide=function(s){if(e.isLong(s)||(s=e.fromValue(s)),s.isZero())throw new Error("division by zero");if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var p,y,m;if(this.equals(e.MIN_VALUE)){if(s.equals(e.ONE)||s.equals(e.NEG_ONE))return e.MIN_VALUE;if(s.equals(e.MIN_VALUE))return e.ONE;var A=this.shiftRight(1);return p=A.divide(s).shiftLeft(1),p.equals(e.ZERO)?s.isNegative()?e.ONE:e.NEG_ONE:(y=this.subtract(s.multiply(p)),m=p.add(y.divide(s)),m)}else if(s.equals(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return s.isNegative()?this.negate().divide(s.negate()):this.negate().divide(s).negate();if(s.isNegative())return this.divide(s.negate()).negate();for(m=e.ZERO,y=this;y.greaterThanOrEqual(s);){p=Math.max(1,Math.floor(y.toNumber()/s.toNumber()));for(var S=Math.ceil(Math.log(p)/Math.LN2),b=S<=48?1:Math.pow(2,S-48),E=e.fromNumber(p),h=E.multiply(s);h.isNegative()||h.greaterThan(y);)p-=b,E=e.fromNumber(p,this.unsigned),h=E.multiply(s);E.isZero()&&(E=e.ONE),m=m.add(E),y=y.subtract(h)}return m},e.prototype.div=e.prototype.divide,e.prototype.modulo=function(s){return e.isLong(s)||(s=e.fromValue(s)),this.subtract(this.divide(s).multiply(s))},e.prototype.mod=e.prototype.modulo,e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.and=function(s){return e.isLong(s)||(s=e.fromValue(s)),e.fromBits(this.low&s.low,this.high&s.high,this.unsigned)},e.prototype.or=function(s){return e.isLong(s)||(s=e.fromValue(s)),e.fromBits(this.low|s.low,this.high|s.high,this.unsigned)},e.prototype.xor=function(s){return e.isLong(s)||(s=e.fromValue(s)),e.fromBits(this.low^s.low,this.high^s.high,this.unsigned)},e.prototype.shiftLeft=function(s){return e.isLong(s)&&(s=s.toInt()),(s&=63)===0?this:s<32?e.fromBits(this.low<<s,this.high<<s|this.low>>>32-s,this.unsigned):e.fromBits(0,this.low<<s-32,this.unsigned)},e.prototype.shl=e.prototype.shiftLeft,e.prototype.shiftRight=function(s){return e.isLong(s)&&(s=s.toInt()),(s&=63)===0?this:s<32?e.fromBits(this.low>>>s|this.high<<32-s,this.high>>s,this.unsigned):e.fromBits(this.high>>s-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=e.prototype.shiftRight,e.prototype.shiftRightUnsigned=function(s){if(e.isLong(s)&&(s=s.toInt()),s&=63,s===0)return this;var p=this.high;if(s<32){var y=this.low;return e.fromBits(y>>>s|p<<32-s,p>>>s,this.unsigned)}else return s===32?e.fromBits(p,0,this.unsigned):e.fromBits(p>>>s-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})})(Zo);var Jo=Zo.exports;Object.defineProperty(Et,"__esModule",{value:!0}),Et.Hyper=void 0;var Cb=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}}(),Qo=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)}},Nb=Jo,br=eu(Nb),Bb=C,Db=eu(Bb);function eu(r){return r&&r.__esModule?r:{default:r}}function Ub(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Lb(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 kb(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=Et.Hyper=function(r){kb(e,r),Cb(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=Qo(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=Qo(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 Ub(this,e),Lb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(br.default);(0,Db.default)($r),$r.MAX_VALUE=new $r(br.default.MAX_VALUE.low,br.default.MAX_VALUE.high),$r.MIN_VALUE=new $r(br.default.MIN_VALUE.low,br.default.MIN_VALUE.high);var Fe={};Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.UnsignedInt=void 0;var qb=st,ru=tu(qb),jb=C,Vb=tu(jb);function tu(r){return r&&r.__esModule?r:{default:r}}var Er=Fe.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,ru.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,ru.default)(e)||Math.floor(e)!==e?!1:e>=Er.MIN_VALUE&&e<=Er.MAX_VALUE}};Er.MAX_VALUE=Math.pow(2,32)-1,Er.MIN_VALUE=0,(0,Vb.default)(Er);var At={};Object.defineProperty(At,"__esModule",{value:!0}),At.UnsignedHyper=void 0;var Gb=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}}(),nu=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)}},Hb=Jo,Ar=iu(Hb),Wb=C,Xb=iu(Wb);function iu(r){return r&&r.__esModule?r:{default:r}}function zb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Yb(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 Kb(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 Or=At.UnsignedHyper=function(r){Kb(e,r),Gb(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=nu(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=nu(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 zb(this,e),Yb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(Ar.default);(0,Xb.default)(Or),Or.MAX_VALUE=new Or(Ar.default.MAX_UNSIGNED_VALUE.low,Ar.default.MAX_UNSIGNED_VALUE.high),Or.MIN_VALUE=new Or(Ar.default.MIN_VALUE.low,Ar.default.MIN_VALUE.high);var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.Float=void 0;var Zb=st,au=ou(Zb),Jb=C,Qb=ou(Jb);function ou(r){return r&&r.__esModule?r:{default:r}}var e1=Ot.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,au.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,au.default)(e)}};(0,Qb.default)(e1);var St={};Object.defineProperty(St,"__esModule",{value:!0}),St.Double=void 0;var r1=st,uu=su(r1),t1=C,n1=su(t1);function su(r){return r&&r.__esModule?r:{default:r}}var i1=St.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,uu.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,uu.default)(e)}};(0,n1.default)(i1);var It={};Object.defineProperty(It,"__esModule",{value:!0}),It.Quadruple=void 0;var a1=C,o1=u1(a1);function u1(r){return r&&r.__esModule?r:{default:r}}var s1=It.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,o1.default)(s1);var Sr={},f1=he,c1=de,l1="[object Boolean]";function p1(r){return r===!0||r===!1||c1(r)&&f1(r)==l1}var h1=p1;Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.Bool=void 0;var d1=h1,y1=cu(d1),fu=ae,g1=C,v1=cu(g1);function cu(r){return r&&r.__esModule?r:{default:r}}var _1=Sr.Bool={read:function(e){var t=fu.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 fu.Int.write(n,t)},isValid:function(e){return(0,y1.default)(e)}};(0,v1.default)(_1);var Pt={},m1=he,w1=j,b1=de,$1="[object String]";function E1(r){return typeof r=="string"||!w1(r)&&b1(r)&&m1(r)==$1}var lu=E1;Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.String=void 0;var A1=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}}(),O1=lu,pu=ri(O1),S1=j,I1=ri(S1),hu=ae,P1=Fe,du=xe,x1=C,T1=ri(x1);function ri(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 R1=Pt.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:P1.UnsignedInt.MAX_VALUE;F1(this,r),this._maxLength=e}return A1(r,[{key:"read",value:function(t){var n=hu.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,du.calculatePadding)(n),a=t.slice(n);return(0,du.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,pu.default)(t)?i=d.from(t,"utf8"):i=d.from(t),hu.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,pu.default)(t))n=d.from(t,"utf8");else if((0,I1.default)(t)||d.isBuffer(t))n=d.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,T1.default)(R1.prototype);var xt={};Object.defineProperty(xt,"__esModule",{value:!0}),xt.Opaque=void 0;var M1=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}}(),yu=xe,C1=C,N1=B1(C1);function B1(r){return r&&r.__esModule?r:{default:r}}function D1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var U1=xt.Opaque=function(){function r(e){D1(this,r),this._length=e,this._padding=(0,yu.calculatePadding)(e)}return M1(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,yu.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,N1.default)(U1.prototype);var Tt={};Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.VarOpaque=void 0;var L1=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}}(),gu=ae,k1=Fe,vu=xe,q1=C,j1=V1(q1);function V1(r){return r&&r.__esModule?r:{default:r}}function G1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var H1=Tt.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:k1.UnsignedInt.MAX_VALUE;G1(this,r),this._maxLength=e}return L1(r,[{key:"read",value:function(t){var n=gu.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,vu.calculatePadding)(n),a=t.slice(n);return(0,vu.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));gu.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return d.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,j1.default)(H1.prototype);var Ft={};function W1(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var X1=W1,z1=ct;function Y1(r){return typeof r=="function"?r:z1}var _u=Y1,K1=X1,Z1=kn,J1=_u,Q1=j;function e$(r,e){var t=Q1(r)?K1:Z1;return t(r,J1(e))}var r$=e$,Ze=r$,t$=/\s/;function n$(r){for(var e=r.length;e--&&t$.test(r.charAt(e)););return e}var i$=n$,a$=i$,o$=/^\s+/;function u$(r){return r&&r.slice(0,a$(r)+1).replace(o$,"")}var s$=u$,f$=s$,mu=He,c$=bt,wu=0/0,l$=/^[-+]0x[0-9a-f]+$/i,p$=/^0b[01]+$/i,h$=/^0o[0-7]+$/i,d$=parseInt;function y$(r){if(typeof r=="number")return r;if(c$(r))return wu;if(mu(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=mu(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=f$(r);var t=p$.test(r);return t||h$.test(r)?d$(r.slice(2),t?2:8):l$.test(r)?wu:+r}var g$=y$,v$=g$,bu=1/0,_$=17976931348623157e292;function m$(r){if(!r)return r===0?r:0;if(r=v$(r),r===bu||r===-bu){var e=r<0?-1:1;return e*_$}return r===r?r:0}var w$=m$,b$=w$;function $$(r){var e=b$(r),t=e%1;return e===e?t?e-t:e:0}var E$=$$,A$=ro,O$=_u,S$=E$,I$=9007199254740991,ti=4294967295,P$=Math.min;function x$(r,e){if(r=S$(r),r<1||r>I$)return[];var t=ti,n=P$(r,ti);e=O$(e),r-=ti;for(var i=A$(n,e);++t<r;)e(t);return i}var $u=x$;Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.Array=void 0;var T$=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}}(),F$=Qn,R$=Ir(F$),M$=Ze,C$=Ir(M$),N$=$u,B$=Ir(N$),D$=j,Eu=Ir(D$),U$=C,L$=Ir(U$);function Ir(r){return r&&r.__esModule?r:{default:r}}function k$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var q$=Ft.Array=function(){function r(e,t){k$(this,r),this._childType=e,this._length=t}return T$(r,[{key:"read",value:function(t){var n=this;return(0,B$.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,Eu.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,C$.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,Eu.default)(t)||t.length!==this._length?!1:(0,R$.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,L$.default)(q$.prototype);var Rt={};Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.VarArray=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}}(),V$=Qn,G$=Pr(V$),H$=Ze,W$=Pr(H$),X$=$u,z$=Pr(X$),Y$=j,Au=Pr(Y$),K$=Fe,Ou=ae,Z$=C,J$=Pr(Z$);function Pr(r){return r&&r.__esModule?r:{default:r}}function Q$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var eE=Rt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:K$.UnsignedInt.MAX_VALUE;Q$(this,r),this._childType=e,this._maxLength=t}return j$(r,[{key:"read",value:function(t){var n=this,i=Ou.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,z$.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,Au.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));Ou.Int.write(t.length,n),(0,W$.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,Au.default)(t)||t.length>this._maxLength?!1:(0,G$.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,J$.default)(eE.prototype);var Mt={};function rE(r){return r===null}var tE=rE;function nE(r){return r===void 0}var xr=nE;Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.Option=void 0;var iE=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}}(),aE=tE,Su=ni(aE),oE=xr,Iu=ni(oE),Pu=Sr,uE=C,sE=ni(uE);function ni(r){return r&&r.__esModule?r:{default:r}}function fE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var cE=Mt.Option=function(){function r(e){fE(this,r),this._childType=e}return iE(r,[{key:"read",value:function(t){if(Pu.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,Su.default)(t)||(0,Iu.default)(t));Pu.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,Su.default)(t)||(0,Iu.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,sE.default)(cE.prototype);var Tr={};Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.Void=void 0;var lE=xr,xu=Tu(lE),pE=C,hE=Tu(pE);function Tu(r){return r&&r.__esModule?r:{default:r}}var dE=Tr.Void={read:function(){},write:function(e){if(!(0,xu.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,xu.default)(e)}};(0,hE.default)(dE);var Ct={},yE=Jn;function gE(r,e){return yE(e,function(t){return r[t]})}var vE=gE,_E=vE,mE=dt;function wE(r){return r==null?[]:_E(r,mE(r))}var bE=wE;Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.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}}(),EE=Ze,AE=ii(EE),OE=bE,SE=ii(OE),Fu=ae,IE=C,PE=ii(IE);function ii(r){return r&&r.__esModule?r:{default:r}}function xE(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 TE(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 Ru(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var FE=Ct.Enum=function(){function r(e,t){Ru(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,SE.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){TE(u,o);function u(){return Ru(this,u),xE(this,(u.__proto__||Object.getPrototypeOf(u)).apply(this,arguments))}return u}(r);return a.enumName=n,t.results[n]=a,a._members={},a._byValue=new Map,(0,AE.default)(i,function(o,u){var f=new a(u,o);a._members[u]=f,a._byValue.set(o,f),a[u]=function(){return f}}),a}}]),r}();(0,PE.default)(FE);var Nt={},RE=kn,ME=mr;function CE(r,e){var t=-1,n=ME(r)?Array(r.length):[];return RE(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var NE=CE,BE=Jn,DE=Ho,UE=NE,LE=j;function kE(r,e){var t=LE(r)?BE:UE;return t(r,DE(e))}var qE=kE;function jE(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 VE=jE,Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});var GE=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 HE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Fr.Reference=function(){function r(){HE(this,r)}return GE(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.Struct=void 0;var Bt=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var u=e[Symbol.iterator](),f;!(i=(f=u.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&u.return&&u.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")}}(),WE=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}}(),XE=Ze,Mu=Rr(XE),zE=qE,YE=Rr(zE),KE=xr,ZE=Rr(KE),JE=VE,QE=Rr(JE),eA=Fr,rA=C,tA=Rr(rA);function Rr(r){return r&&r.__esModule?r:{default:r}}function nA(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 iA(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 aA=Nt.Struct=function(){function r(e){Cu(this,r),this._attributes=e||{}}return WE(r,null,[{key:"read",value:function(t){var n=(0,YE.default)(this._fields,function(i){var a=Bt(i,2),o=a[0],u=a[1],f=u.read(t);return[o,f]});return new this((0,QE.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,Mu.default)(this._fields,function(i){var a=Bt(i,2),o=a[0],u=a[1],f=t._attributes[o];u.write(f,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){iA(u,o);function u(){return Cu(this,u),nA(this,(u.__proto__||Object.getPrototypeOf(u)).apply(this,arguments))}return u}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var u=Bt(o,2),f=u[0],c=u[1];return c instanceof eA.Reference&&(c=c.resolve(t)),[f,c]}),(0,Mu.default)(a._fields,function(o){var u=Bt(o,1),f=u[0];a.prototype[f]=oA(f)}),a}}]),r}();(0,tA.default)(aA);function oA(r){return function(t){return(0,ZE.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.Union=void 0;var uA=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var u=e[Symbol.iterator](),f;!(i=(f=u.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&u.return&&u.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")}}(),sA=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}}(),fA=Ze,Ut=kt(fA),cA=xr,Nu=kt(cA),lA=lu,Bu=kt(lA),Lt=Tr,ai=Fr,pA=C,hA=kt(pA);function kt(r){return r&&r.__esModule?r:{default:r}}function dA(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 yA(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 Du(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var gA=Dt.Union=function(){function r(e,t){Du(this,r),this.set(e,t)}return sA(r,[{key:"set",value:function(t,n){(0,Bu.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!==Lt.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===Lt.Void?Lt.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,Nu.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(u){yA(f,u);function f(){return Du(this,f),dA(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof ai.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,Ut.default)(i.arms,function(u,f){u instanceof ai.Reference&&(u=u.resolve(t)),a._arms[f]=u});var o=i.defaultArm;return o instanceof ai.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Ut.default)(i.switches,function(u){var f=uA(u,2),c=f[0],l=f[1];(0,Bu.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,Nu.default)(a._switchOn.values)||(0,Ut.default)(a._switchOn.values(),function(u){a[u.name]=function(f){return new a(u,f)},a.prototype[u.name]=function(c){return this.set(u,c)}}),(0,Ut.default)(a._arms,function(u,f){u!==Lt.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,hA.default)(gA),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ae;Object.keys(e).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return e[h]}})});var t=Et;Object.keys(t).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return t[h]}})});var n=Fe;Object.keys(n).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return n[h]}})});var i=At;Object.keys(i).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return i[h]}})});var a=Ot;Object.keys(a).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return a[h]}})});var o=St;Object.keys(o).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return o[h]}})});var u=It;Object.keys(u).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return u[h]}})});var f=Sr;Object.keys(f).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return f[h]}})});var c=Pt;Object.keys(c).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return c[h]}})});var l=xt;Object.keys(l).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return l[h]}})});var s=Tt;Object.keys(s).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return s[h]}})});var p=Ft;Object.keys(p).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return p[h]}})});var y=Rt;Object.keys(y).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return y[h]}})});var m=Mt;Object.keys(m).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return m[h]}})});var A=Tr;Object.keys(A).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return A[h]}})});var S=Ct;Object.keys(S).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return S[h]}})});var b=Nt;Object.keys(b).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return b[h]}})});var E=Dt;Object.keys(E).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return E[h]}})})}(Nn);var Uu={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function _(g,v){for(var O=0;O<v.length;O++){var P=v[O];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(g,P.key,P)}}return function(g,v,O){return v&&_(g.prototype,v),O&&_(g,O),g}}(),t=Fr;Object.keys(t).forEach(function(_){_==="default"||_==="__esModule"||Object.defineProperty(r,_,{enumerable:!0,get:function(){return t[_]}})}),r.config=m;var n=xr,i=l(n),a=Ze,o=l(a),u=Nn,f=c(u);function c(_){if(_&&_.__esModule)return _;var g={};if(_!=null)for(var v in _)Object.prototype.hasOwnProperty.call(_,v)&&(g[v]=_[v]);return g.default=_,g}function l(_){return _&&_.__esModule?_:{default:_}}function s(_,g){if(!(_ instanceof g))throw new TypeError("Cannot call a class as a function")}function p(_,g){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:_}function y(_,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);_.prototype=Object.create(g&&g.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(_,g):_.__proto__=g)}function m(_){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(_){var v=new R(g);_(v),v.resolve()}return g}var A=function(_){y(g,_);function g(v){s(this,g);var O=p(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return O.name=v,O}return e(g,[{key:"resolve",value:function(O){var P=O.definitions[this.name];return P.resolve(O)}}]),g}(t.Reference),S=function(_){y(g,_);function g(v,O){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s(this,g);var M=p(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return M.childReference=v,M.length=O,M.variable=P,M}return e(g,[{key:"resolve",value:function(O){var P=this.childReference,M=this.length;return P instanceof t.Reference&&(P=P.resolve(O)),M instanceof t.Reference&&(M=M.resolve(O)),this.variable?new f.VarArray(P,M):new f.Array(P,M)}}]),g}(t.Reference),b=function(_){y(g,_);function g(v){s(this,g);var O=p(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return O.childReference=v,O.name=v.name,O}return e(g,[{key:"resolve",value:function(O){var P=this.childReference;return P instanceof t.Reference&&(P=P.resolve(O)),new f.Option(P)}}]),g}(t.Reference),E=function(_){y(g,_);function g(v,O){s(this,g);var P=p(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return P.sizedType=v,P.length=O,P}return e(g,[{key:"resolve",value:function(O){var P=this.length;return P instanceof t.Reference&&(P=P.resolve(O)),new this.sizedType(P)}}]),g}(t.Reference),h=function(){function _(g,v,O){s(this,_),this.constructor=g,this.name=v,this.config=O}return e(_,[{key:"resolve",value:function(v){return this.name in v.results?v.results[this.name]:this.constructor(v,this.name,this.config)}}]),_}();function I(_,g,v){return v instanceof t.Reference&&(v=v.resolve(_)),_.results[g]=v,v}function T(_,g,v){return _.results[g]=v,v}var R=function(){function _(g){s(this,_),this._destination=g,this._definitions={}}return e(_,[{key:"enum",value:function(v,O){var P=new h(f.Enum.create,v,O);this.define(v,P)}},{key:"struct",value:function(v,O){var P=new h(f.Struct.create,v,O);this.define(v,P)}},{key:"union",value:function(v,O){var P=new h(f.Union.create,v,O);this.define(v,P)}},{key:"typedef",value:function(v,O){var P=new h(I,v,O);this.define(v,P)}},{key:"const",value:function(v,O){var P=new h(T,v,O);this.define(v,P)}},{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(v){return new E(f.String,v)}},{key:"opaque",value:function(v){return new E(f.Opaque,v)}},{key:"varOpaque",value:function(v){return new E(f.VarOpaque,v)}},{key:"array",value:function(v,O){return new S(v,O)}},{key:"varArray",value:function(v,O){return new S(v,O,!0)}},{key:"option",value:function(v){return new b(v)}},{key:"define",value:function(v,O){if((0,i.default)(this._destination[v]))this._definitions[v]=O;else throw new Error("XDRTypes Error:"+v+" is already defined")}},{key:"lookup",value:function(v){return new A(v)}},{key:"resolve",value:function(){var v=this;(0,o.default)(this._definitions,function(O){O.resolve({definitions:v._definitions,results:v._destination})})}}]),_}()})(Uu),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Nn;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=Uu;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(qa);function vA(r){const e={variantId:ue.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new ue.BundleItem({collectionId:ue.Uint64.fromString(n.collectionId.toString()),productId:ue.Uint64.fromString(n.productId.toString()),variantId:ue.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new ue.BundleItemExt(0)})),ext:new ue.BundleExt(0)},t=new ue.Bundle(e);return ue.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const ue=qa.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")}})}),Lu="/bundling-storefront-manager";function _A(){return Math.ceil(Date.now()/1e3)}async function mA(){try{const{timestamp:r}=await vr("get",`${Lu}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),_A()}}async function wA(r){const e=X(),t=await ku(r);if(t!==!0)throw new Error(t);const n=await mA(),i=vA({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 vr("post",`${Lu}/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 bA(r,e){const t=qu(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${Pi(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 ku(r){try{return r?!0:"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}const $A={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 qu(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=$A[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 EA(r,e){const{bundle_selection:t}=await $("get","/bundle_selections",{id:e},w(r,"getBundleSelection"));return t}function AA(r,e){return $("get","/bundle_selections",{query:e},w(r,"listBundleSelections"))}async function OA(r,e){const{bundle_selection:t}=await $("post","/bundle_selections",{data:e},w(r,"createBundleSelection"));return t}async function SA(r,e,t){const{bundle_selection:n}=await $("put","/bundle_selections",{id:e,data:t},w(r,"updateBundleSelection"));return n}function IA(r,e){return $("delete","/bundle_selections",{id:e},w(r,"deleteBundleSelection"))}async function PA(r,e,t,n){const{subscription:i}=await $("put","/bundles",{id:e,data:t,query:n},w(r,"updateBundle"));return i}var xA=Object.freeze({__proto__:null,createBundleSelection:OA,deleteBundleSelection:IA,getBundleId:wA,getBundleSelection:EA,getDynamicBundleItems:bA,listBundleSelections:AA,updateBundle:PA,updateBundleSelection:SA,validateBundle:ku,validateDynamicBundle:qu}),TA=200,oi="__lodash_hash_undefined__",FA=1/0,ju=9007199254740991,RA="[object Arguments]",MA="[object Function]",CA="[object GeneratorFunction]",NA="[object Symbol]",BA=/[\\^$.*+?()[\]{}|]/g,DA=/^\[object .+?Constructor\]$/,UA=/^(?:0|[1-9]\d*)$/,LA=typeof U=="object"&&U&&U.Object===Object&&U,kA=typeof self=="object"&&self&&self.Object===Object&&self,ui=LA||kA||Function("return this")();function qA(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)}function jA(r,e){var t=r?r.length:0;return!!t&&HA(r,e,0)>-1}function VA(r,e,t){for(var n=-1,i=r?r.length:0;++n<i;)if(t(e,r[n]))return!0;return!1}function Vu(r,e){for(var t=-1,n=r?r.length:0,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}function si(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}function GA(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}function HA(r,e,t){if(e!==e)return GA(r,WA,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function WA(r){return r!==r}function XA(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}function zA(r){return function(e){return r(e)}}function YA(r,e){return r.has(e)}function KA(r,e){return r?.[e]}function ZA(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function Gu(r,e){return function(t){return r(e(t))}}var JA=Array.prototype,QA=Function.prototype,qt=Object.prototype,fi=ui["__core-js_shared__"],Hu=function(){var r=/[^.]+$/.exec(fi&&fi.keys&&fi.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Wu=QA.toString,Je=qt.hasOwnProperty,ci=qt.toString,eO=RegExp("^"+Wu.call(Je).replace(BA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xu=ui.Symbol,rO=Gu(Object.getPrototypeOf,Object),tO=qt.propertyIsEnumerable,nO=JA.splice,zu=Xu?Xu.isConcatSpreadable:void 0,li=Object.getOwnPropertySymbols,Yu=Math.max,iO=Zu(ui,"Map"),Mr=Zu(Object,"create");function Re(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function aO(){this.__data__=Mr?Mr(null):{}}function oO(r){return this.has(r)&&delete this.__data__[r]}function uO(r){var e=this.__data__;if(Mr){var t=e[r];return t===oi?void 0:t}return Je.call(e,r)?e[r]:void 0}function sO(r){var e=this.__data__;return Mr?e[r]!==void 0:Je.call(e,r)}function fO(r,e){var t=this.__data__;return t[r]=Mr&&e===void 0?oi:e,this}Re.prototype.clear=aO,Re.prototype.delete=oO,Re.prototype.get=uO,Re.prototype.has=sO,Re.prototype.set=fO;function Qe(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function cO(){this.__data__=[]}function lO(r){var e=this.__data__,t=Vt(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():nO.call(e,t,1),!0}function pO(r){var e=this.__data__,t=Vt(e,r);return t<0?void 0:e[t][1]}function hO(r){return Vt(this.__data__,r)>-1}function dO(r,e){var t=this.__data__,n=Vt(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}Qe.prototype.clear=cO,Qe.prototype.delete=lO,Qe.prototype.get=pO,Qe.prototype.has=hO,Qe.prototype.set=dO;function er(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function yO(){this.__data__={hash:new Re,map:new(iO||Qe),string:new Re}}function gO(r){return Gt(this,r).delete(r)}function vO(r){return Gt(this,r).get(r)}function _O(r){return Gt(this,r).has(r)}function mO(r,e){return Gt(this,r).set(r,e),this}er.prototype.clear=yO,er.prototype.delete=gO,er.prototype.get=vO,er.prototype.has=_O,er.prototype.set=mO;function jt(r){var e=-1,t=r?r.length:0;for(this.__data__=new er;++e<t;)this.add(r[e])}function wO(r){return this.__data__.set(r,oi),this}function bO(r){return this.__data__.has(r)}jt.prototype.add=jt.prototype.push=wO,jt.prototype.has=bO;function $O(r,e){var t=pi(r)||Ju(r)?XA(r.length,String):[],n=t.length,i=!!n;for(var a in r)(e||Je.call(r,a))&&!(i&&(a=="length"||CO(a,n)))&&t.push(a);return t}function Vt(r,e){for(var t=r.length;t--;)if(qO(r[t][0],e))return t;return-1}function EO(r,e,t,n){var i=-1,a=jA,o=!0,u=r.length,f=[],c=e.length;if(!u)return f;t&&(e=Vu(e,zA(t))),n?(a=VA,o=!1):e.length>=TA&&(a=YA,o=!1,e=new jt(e));e:for(;++i<u;){var l=r[i],s=t?t(l):l;if(l=n||l!==0?l:0,o&&s===s){for(var p=c;p--;)if(e[p]===s)continue e;f.push(l)}else a(e,s,n)||f.push(l)}return f}function Ku(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=MO),i||(i=[]);++a<o;){var u=r[a];e>0&&t(u)?e>1?Ku(u,e-1,t,n,i):si(i,u):n||(i[i.length]=u)}return i}function AO(r,e,t){var n=e(r);return pi(r)?n:si(n,t(r))}function OO(r){if(!hi(r)||BO(r))return!1;var e=es(r)||ZA(r)?eO:DA;return e.test(kO(r))}function SO(r){if(!hi(r))return UO(r);var e=DO(r),t=[];for(var n in r)n=="constructor"&&(e||!Je.call(r,n))||t.push(n);return t}function IO(r,e){return r=Object(r),PO(r,e,function(t,n){return n in r})}function PO(r,e,t){for(var n=-1,i=e.length,a={};++n<i;){var o=e[n],u=r[o];t(u,o)&&(a[o]=u)}return a}function xO(r,e){return e=Yu(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=Yu(t.length-e,0),a=Array(i);++n<i;)a[n]=t[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=t[n];return o[e]=a,qA(r,this,o)}}function TO(r){return AO(r,HO,RO)}function Gt(r,e){var t=r.__data__;return NO(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Zu(r,e){var t=KA(r,e);return OO(t)?t:void 0}var FO=li?Gu(li,Object):ts,RO=li?function(r){for(var e=[];r;)si(e,FO(r)),r=rO(r);return e}:ts;function MO(r){return pi(r)||Ju(r)||!!(zu&&r&&r[zu])}function CO(r,e){return e=e??ju,!!e&&(typeof r=="number"||UA.test(r))&&r>-1&&r%1==0&&r<e}function NO(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function BO(r){return!!Hu&&Hu in r}function DO(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||qt;return r===t}function UO(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}function LO(r){if(typeof r=="string"||GO(r))return r;var e=r+"";return e=="0"&&1/r==-FA?"-0":e}function kO(r){if(r!=null){try{return Wu.call(r)}catch{}try{return r+""}catch{}}return""}function qO(r,e){return r===e||r!==r&&e!==e}function Ju(r){return jO(r)&&Je.call(r,"callee")&&(!tO.call(r,"callee")||ci.call(r)==RA)}var pi=Array.isArray;function Qu(r){return r!=null&&VO(r.length)&&!es(r)}function jO(r){return rs(r)&&Qu(r)}function es(r){var e=hi(r)?ci.call(r):"";return e==MA||e==CA}function VO(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=ju}function hi(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}function rs(r){return!!r&&typeof r=="object"}function GO(r){return typeof r=="symbol"||rs(r)&&ci.call(r)==NA}function HO(r){return Qu(r)?$O(r,!0):SO(r)}var WO=xO(function(r,e){return r==null?{}:(e=Vu(Ku(e,1),LO),IO(r,EO(TO(r),e)))});function ts(){return[]}var XO=WO,di=ve(XO);function zO(r){try{return JSON.parse(r)}catch{return r}}function YO(r){return Object.entries(r).reduce((e,[t,n])=>({...e,[t]:zO(n)}),{})}const ns=r=>typeof r=="string"?r!=="0"&&r!=="false":!!r;function is(r){const e=YO(r),t=e.auto_inject===void 0?!0:e.auto_inject,n=e.display_on??[],i=e.first_option==="autodeliver";return{...di(e,["display_on","first_option"]),auto_inject:t,valid_pages:n,is_subscription_first:i,autoInject:t,validPages:n,isSubscriptionFirst:i}}function as(r){const e=r.subscription_options?.storefront_purchase_options==="subscription_only";return{...r,is_subscription_only:e,isSubscriptionOnly:e}}function KO(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=as(i)}),t})}const yi="2020-12",ZO={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Cr=new Map;function Ht(r,e){return Cr.has(r)||Cr.set(r,e()),Cr.get(r)}async function gi(r,e){const t=e?.version??"2020-12",{product:n}=await Ht(`product.${r}.${t}`,()=>ot("get",`/product/${t}/${r}.json`));return t==="2020-12"?as(n):n}async function os(){return await Ht("storeSettings",()=>ot("get",`/${yi}/store_settings.json`).catch(()=>ZO))}async function us(){const{widget_settings:r}=await Ht("widgetSettings",()=>ot("get",`/${yi}/widget_settings.json`));return is(r)}async function ss(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await Ht("productsAndSettings",()=>ot("get",`/product/${yi}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:KO(r),widget_settings:is(e),store_settings:t??{}}}async function JO(){const{products:r}=await ss();return r}async function QO(r){const[e,t,n]=await Promise.all([gi(r),os(),us()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function eS(r){const{bundle_product:e}=await gi(r);return e}async function fs(){return Array.from(Cr.keys()).forEach(r=>Cr.delete(r))}var rS=Object.freeze({__proto__:null,getCDNBundleSettings:eS,getCDNProduct:gi,getCDNProductAndSettings:QO,getCDNProducts:JO,getCDNProductsAndSettings:ss,getCDNStoreSettings:os,getCDNWidgetSettings:us,resetCDNCache:fs});async function tS(r,e,t){const{charge:n}=await $("get","/charges",{id:e,query:{include:t?.include}},w(r,"getCharge"));return n}function nS(r,e){return $("get","/charges",{query:e},w(r,"listCharges"))}async function iS(r,e,t){const{charge:n}=await $("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},w(r,"applyDiscountToCharge"));return n}async function aS(r,e){const{charge:t}=await $("post",`/charges/${e}/remove_discount`,{},w(r,"removeDiscountsFromCharge"));return t}async function oS(r,e,t,n){const{charge:i}=await $("post",`/charges/${e}/skip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},w(r,"skipCharge"));return i}async function uS(r,e,t,n){const{charge:i}=await $("post",`/charges/${e}/unskip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},w(r,"unskipCharge"));return i}async function sS(r,e){const{charge:t}=await $("post",`/charges/${e}/process`,{},w(r,"processCharge"));return t}var fS=Object.freeze({__proto__:null,applyDiscountToCharge:iS,getCharge:tS,listCharges:nS,processCharge:sS,removeDiscountsFromCharge:aS,skipCharge:oS,unskipCharge:uS});async function cs(r,e){if(!["2020-12","2022-06"].includes(e.format_version))throw new Error("Missing or unsupported format_version.");return $("get","/product_search",{query:e,headers:{"X-Recharge-Version":"2021-01"}},w(r,"productSearch"))}var cS=Object.freeze({__proto__:null,productSearch:cs});async function ls(r,e){const{collection:t}=await $("get","/collections",{id:e},w(r,"getCollection"));return t}function lS(r,e){return $("get","/collections",{query:e},w(r,"listCollections"))}async function pS(r,e,t){if(!["2020-12","2022-06"].includes(t.format_version))throw new Error("Missing or unsupported format_version.");const n=w(r,"listCollectionProducts"),[{sort_order:i,manual_sort_order:a},{products:o}]=await Promise.all([ls(n,e),cs(n,{...t,collection_ids:[e],limit:250})]);if(i==="manual")return{products:a.reduce((u,f)=>{const c=o.find(l=>l.external_product_id===f);return c&&u.push(c),u},[])};{const u=hS(i);return{products:o.slice().sort(u)}}}function ps(r,e){const t=r.external_created_at,n=e.external_created_at;return t<n?-1:n>t?1:0}function hs(r,e){const t=r.external_product_id,n=e.external_product_id;return t<n?-1:n>t?1:0}function ds(r,e){const t=r.title.toLowerCase(),n=e.title.toLowerCase();return t<n?-1:n>t?1:0}function hS(r){switch(r){case"created_at-asc":return ps;case"created_at-desc":return(e,t)=>ps(t,e);case"id-asc":return hs;case"id-desc":return(e,t)=>hs(t,e);case"title-asc":return ds;case"title-desc":return(e,t)=>ds(t,e)}}var dS=Object.freeze({__proto__:null,getCollection:ls,listCollectionProducts:pS,listCollections:lS});async function yS(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await $("get","/customers",{id:t,query:{include:e?.include}},w(r,"getCustomer"));return n}async function gS(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await $("put","/customers",{id:t,data:e},w(r,"updateCustomer"));return n}async function vS(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await $("get",`/customers/${t}/delivery_schedule`,{query:e},w(r,"getDeliverySchedule"));return n}async function vi(r){return $("get","/portal_access",{},w(r,"getCustomerPortalAccess"))}async function _S(r,e,t){const{base_url:n,customer_hash:i,temp_token:a}=await vi(w(r,"getActiveChurnLandingPageURL"));return`${n.replace("portal","pages")}${i}/subscriptions/${e}/cancel?token=${a}&subscription=${e}&redirect_to=${t}`}async function mS(r,e,t){const{base_url:n,customer_hash:i,temp_token:a}=await vi(w(r,"getGiftRedemptionLandingPageURL"));return`${n.replace("portal","pages")}${i}/gifts/${e}?token=${a}&redirect_to=${t}`}const wS={SHOPIFY_UPDATE_PAYMENT_INFO:{type:"email",template_type:"shopify_update_payment_information"}};async function bS(r,e,t){const n=r.customerId;if(!n)throw new Error("Not logged in.");const i=wS[e];if(!i)throw new Error("Notification not supported.");return $("post",`/customers/${n}/notifications`,{data:{...i,template_vars:t}},w(r,"sendCustomerNotification"))}async function $S(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{credit_summary:n}=await $("get",`/customers/${t}/credit_summary`,{query:{include:e?.include}},w(r,"getCreditSummary"));return n}var ES=Object.freeze({__proto__:null,getActiveChurnLandingPageURL:_S,getCreditSummary:$S,getCustomer:yS,getCustomerPortalAccess:vi,getDeliverySchedule:vS,getGiftRedemptionLandingPageURL:mS,sendCustomerNotification:bS,updateCustomer:gS});function AS(r,e){if(!r.customerId)throw new Error("Not logged in.");return $("get","/gift_purchases",{query:e},w(r,"listGiftPurchases"))}async function OS(r,e){if(!r.customerId)throw new Error("Not logged in.");const{gift_purchase:t}=await $("get","/gift_purchases",{id:e},w(r,"getGiftPurchase"));return t}var SS=Object.freeze({__proto__:null,getGiftPurchase:OS,listGiftPurchases:AS});async function IS(r,e){const{membership:t}=await $("get","/memberships",{id:e},w(r,"getMembership"));return t}function PS(r,e){return $("get","/memberships",{query:e},w(r,"listMemberships"))}async function xS(r,e,t){const{membership:n}=await $("post",`/memberships/${e}/cancel`,{data:t},w(r,"cancelMembership"));return n}async function TS(r,e,t){const{membership:n}=await $("post",`/memberships/${e}/activate`,{data:t},w(r,"activateMembership"));return n}async function FS(r,e,t){const{membership:n}=await $("post",`/memberships/${e}/change`,{data:t},w(r,"changeMembership"));return n}var RS=Object.freeze({__proto__:null,activateMembership:TS,cancelMembership:xS,changeMembership:FS,getMembership:IS,listMemberships:PS});async function MS(r,e,t){const{membership_program:n}=await $("get","/membership_programs",{id:e,query:{include:t?.include}},w(r,"getMembershipProgram"));return n}function CS(r,e){return $("get","/membership_programs",{query:e},w(r,"listMembershipPrograms"))}var NS=Object.freeze({__proto__:null,getMembershipProgram:MS,listMembershipPrograms:CS});async function BS(r,e){const{metafield:t}=await $("post","/metafields",{data:{metafield:e}},w(r,"createMetafield"));return t}async function DS(r,e,t){const{metafield:n}=await $("put","/metafields",{id:e,data:{metafield:t}},w(r,"updateMetafield"));return n}function US(r,e){return $("delete","/metafields",{id:e},w(r,"deleteMetafield"))}var LS=Object.freeze({__proto__:null,createMetafield:BS,deleteMetafield:US,updateMetafield:DS});async function kS(r,e){const{onetime:t}=await $("get","/onetimes",{id:e},w(r,"getOnetime"));return t}function qS(r,e){return $("get","/onetimes",{query:e},w(r,"listOnetimes"))}async function jS(r,e){const{onetime:t}=await $("post","/onetimes",{data:e},w(r,"createOnetime"));return t}async function VS(r,e,t){const{onetime:n}=await $("put","/onetimes",{id:e,data:t},w(r,"updateOnetime"));return n}function GS(r,e){return $("delete","/onetimes",{id:e},w(r,"deleteOnetime"))}var HS=Object.freeze({__proto__:null,createOnetime:jS,deleteOnetime:GS,getOnetime:kS,listOnetimes:qS,updateOnetime:VS});async function WS(r,e){const{order:t}=await $("get","/orders",{id:e},w(r,"getOrder"));return t}function XS(r,e){return $("get","/orders",{query:e},w(r,"listOrders"))}var zS=Object.freeze({__proto__:null,getOrder:WS,listOrders:XS});async function YS(r,e,t){const{payment_method:n}=await $("get","/payment_methods",{id:e,query:{include:t?.include}},w(r,"getPaymentMethod"));return n}async function KS(r,e){const{payment_method:t}=await $("post","/payment_methods",{data:{...e,customer_id:r.customerId}},w(r,"createPaymentMethod"));return t}async function ZS(r,e,t){const{payment_method:n}=await $("put","/payment_methods",{id:e,data:t},w(r,"updatePaymentMethod"));return n}function JS(r,e){return $("get","/payment_methods",{query:e},w(r,"listPaymentMethods"))}var QS=Object.freeze({__proto__:null,createPaymentMethod:KS,getPaymentMethod:YS,listPaymentMethods:JS,updatePaymentMethod:ZS});async function eI(r,e){const{plan:t}=await $("get","/plans",{id:e},w(r,"getPlan"));return t}function rI(r,e){return $("get","/plans",{query:e},w(r,"listPlans"))}var tI=Object.freeze({__proto__:null,getPlan:eI,listPlans:rI});async function nI(r,e){return await $("get","/shop/shipping_countries",{query:e,headers:{"X-Recharge-Version":"2021-01"}},w(r,"getShippingCountries"))}var iI=Object.freeze({__proto__:null,getShippingCountries:nI}),aI="Expected a function",ys="__lodash_placeholder__",Me=1,Wt=2,oI=4,rr=8,Nr=16,Ce=32,Br=64,gs=128,uI=256,vs=512,_s=1/0,sI=9007199254740991,fI=17976931348623157e292,ms=0/0,cI=[["ary",gs],["bind",Me],["bindKey",Wt],["curry",rr],["curryRight",Nr],["flip",vs],["partial",Ce],["partialRight",Br],["rearg",uI]],lI="[object Function]",pI="[object GeneratorFunction]",hI="[object Symbol]",dI=/[\\^$.*+?()[\]{}|]/g,yI=/^\s+|\s+$/g,gI=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,vI=/\{\n\/\* \[wrapped with (.+)\] \*/,_I=/,? & /,mI=/^[-+]0x[0-9a-f]+$/i,wI=/^0b[01]+$/i,bI=/^\[object .+?Constructor\]$/,$I=/^0o[0-7]+$/i,EI=/^(?:0|[1-9]\d*)$/,AI=parseInt,OI=typeof U=="object"&&U&&U.Object===Object&&U,SI=typeof self=="object"&&self&&self.Object===Object&&self,Dr=OI||SI||Function("return this")();function _i(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)}function II(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}function PI(r,e){var t=r?r.length:0;return!!t&&TI(r,e,0)>-1}function xI(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}function TI(r,e,t){if(e!==e)return xI(r,FI,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function FI(r){return r!==r}function RI(r,e){for(var t=r.length,n=0;t--;)r[t]===e&&n++;return n}function MI(r,e){return r?.[e]}function CI(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function mi(r,e){for(var t=-1,n=r.length,i=0,a=[];++t<n;){var o=r[t];(o===e||o===ys)&&(r[t]=ys,a[i++]=t)}return a}var NI=Function.prototype,ws=Object.prototype,wi=Dr["__core-js_shared__"],bs=function(){var r=/[^.]+$/.exec(wi&&wi.keys&&wi.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),$s=NI.toString,BI=ws.hasOwnProperty,Es=ws.toString,DI=RegExp("^"+$s.call(BI).replace(dI,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),UI=Object.create,tr=Math.max,LI=Math.min,As=function(){var r=Ss(Object,"defineProperty"),e=Ss.name;return e&&e.length>2?r:void 0}();function kI(r){return nr(r)?UI(r):{}}function qI(r){if(!nr(r)||QI(r))return!1;var e=n2(r)||CI(r)?DI:bI;return e.test(r2(r))}function jI(r,e){return e=tr(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=tr(t.length-e,0),a=Array(i);++n<i;)a[n]=t[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=t[n];return o[e]=a,_i(r,this,o)}}function VI(r,e,t,n){for(var i=-1,a=r.length,o=t.length,u=-1,f=e.length,c=tr(a-o,0),l=Array(f+c),s=!n;++u<f;)l[u]=e[u];for(;++i<o;)(s||i<a)&&(l[t[i]]=r[i]);for(;c--;)l[u++]=r[i++];return l}function GI(r,e,t,n){for(var i=-1,a=r.length,o=-1,u=t.length,f=-1,c=e.length,l=tr(a-u,0),s=Array(l+c),p=!n;++i<l;)s[i]=r[i];for(var y=i;++f<c;)s[y+f]=e[f];for(;++o<u;)(p||i<a)&&(s[y+t[o]]=r[i++]);return s}function HI(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}function WI(r,e,t){var n=e&Me,i=Ur(r);function a(){var o=this&&this!==Dr&&this instanceof a?i:r;return o.apply(n?t:this,arguments)}return a}function Ur(r){return function(){var e=arguments;switch(e.length){case 0:return new r;case 1:return new r(e[0]);case 2:return new r(e[0],e[1]);case 3:return new r(e[0],e[1],e[2]);case 4:return new r(e[0],e[1],e[2],e[3]);case 5:return new r(e[0],e[1],e[2],e[3],e[4]);case 6:return new r(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new r(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=kI(r.prototype),n=r.apply(t,e);return nr(n)?n:t}}function XI(r,e,t){var n=Ur(r);function i(){for(var a=arguments.length,o=Array(a),u=a,f=$i(i);u--;)o[u]=arguments[u];var c=a<3&&o[0]!==f&&o[a-1]!==f?[]:mi(o,f);if(a-=c.length,a<t)return Os(r,e,bi,i.placeholder,void 0,o,c,void 0,void 0,t-a);var l=this&&this!==Dr&&this instanceof i?n:r;return _i(l,this,o)}return i}function bi(r,e,t,n,i,a,o,u,f,c){var l=e&gs,s=e&Me,p=e&Wt,y=e&(rr|Nr),m=e&vs,A=p?void 0:Ur(r);function S(){for(var b=arguments.length,E=Array(b),h=b;h--;)E[h]=arguments[h];if(y)var I=$i(S),T=RI(E,I);if(n&&(E=VI(E,n,i,y)),a&&(E=GI(E,a,o,y)),b-=T,y&&b<c){var R=mi(E,I);return Os(r,e,bi,S.placeholder,t,E,R,u,f,c-b)}var _=s?t:this,g=p?_[r]:r;return b=E.length,u?E=e2(E,u):m&&b>1&&E.reverse(),l&&f<b&&(E.length=f),this&&this!==Dr&&this instanceof S&&(g=A||Ur(g)),g.apply(_,E)}return S}function zI(r,e,t,n){var i=e&Me,a=Ur(r);function o(){for(var u=-1,f=arguments.length,c=-1,l=n.length,s=Array(l+f),p=this&&this!==Dr&&this instanceof o?a:r;++c<l;)s[c]=n[c];for(;f--;)s[c++]=arguments[++u];return _i(p,i?t:this,s)}return o}function Os(r,e,t,n,i,a,o,u,f,c){var l=e&rr,s=l?o:void 0,p=l?void 0:o,y=l?a:void 0,m=l?void 0:a;e|=l?Ce:Br,e&=~(l?Br:Ce),e&oI||(e&=~(Me|Wt));var A=t(r,e,i,y,s,m,p,u,f,c);return A.placeholder=n,Is(A,r,e)}function YI(r,e,t,n,i,a,o,u){var f=e&Wt;if(!f&&typeof r!="function")throw new TypeError(aI);var c=n?n.length:0;if(c||(e&=~(Ce|Br),n=i=void 0),o=o===void 0?o:tr(Ps(o),0),u=u===void 0?u:Ps(u),c-=i?i.length:0,e&Br){var l=n,s=i;n=i=void 0}var p=[r,e,t,n,i,l,s,a,o,u];if(r=p[0],e=p[1],t=p[2],n=p[3],i=p[4],u=p[9]=p[9]==null?f?0:r.length:tr(p[9]-c,0),!u&&e&(rr|Nr)&&(e&=~(rr|Nr)),!e||e==Me)var y=WI(r,e,t);else e==rr||e==Nr?y=XI(r,e,u):(e==Ce||e==(Me|Ce))&&!i.length?y=zI(r,e,t,n):y=bi.apply(void 0,p);return Is(y,r,e)}function $i(r){var e=r;return e.placeholder}function Ss(r,e){var t=MI(r,e);return qI(t)?t:void 0}function KI(r){var e=r.match(vI);return e?e[1].split(_I):[]}function ZI(r,e){var t=e.length,n=t-1;return e[n]=(t>1?"& ":"")+e[n],e=e.join(t>2?", ":" "),r.replace(gI,`{
|
|
24
|
+
*/(function(e,t){typeof Cb=="function"&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(U,function(){function e(l,s,p){this.low=l|0,this.high=s|0,this.unsigned=!!p}e.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=function(s){return(s&&s.__isLong__)===!0};var t={},n={};e.fromInt=function(s,p){var y,m;return p?(s=s>>>0,0<=s&&s<256&&(m=n[s],m)?m:(y=new e(s,(s|0)<0?-1:0,!0),0<=s&&s<256&&(n[s]=y),y)):(s=s|0,-128<=s&&s<128&&(m=t[s],m)?m:(y=new e(s,s<0?-1:0,!1),-128<=s&&s<128&&(t[s]=y),y))},e.fromNumber=function(s,p){return p=!!p,isNaN(s)||!isFinite(s)?e.ZERO:!p&&s<=-f?e.MIN_VALUE:!p&&s+1>=f?e.MAX_VALUE:p&&s>=u?e.MAX_UNSIGNED_VALUE:s<0?e.fromNumber(-s,p).negate():new e(s%o|0,s/o|0,p)},e.fromBits=function(s,p,y){return new e(s,p,y)},e.fromString=function(s,p,y){if(s.length===0)throw Error("number format error: empty string");if(s==="NaN"||s==="Infinity"||s==="+Infinity"||s==="-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 m;if((m=s.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+s);if(m===0)return e.fromString(s.substring(1),p,y).negate();for(var A=e.fromNumber(Math.pow(y,8)),S=e.ZERO,b=0;b<s.length;b+=8){var E=Math.min(8,s.length-b),h=parseInt(s.substring(b,b+E),y);if(E<8){var I=e.fromNumber(Math.pow(y,E));S=S.multiply(I).add(e.fromNumber(h))}else S=S.multiply(A),S=S.add(e.fromNumber(h))}return S.unsigned=p,S},e.fromValue=function(s){return s instanceof e?s:typeof s=="number"?e.fromNumber(s):typeof s=="string"?e.fromString(s):new e(s.low,s.high,s.unsigned)};var i=65536,a=1<<24,o=i*i,u=o*o,f=u/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(s){if(s=s||10,s<2||36<s)throw RangeError("radix out of range: "+s);if(this.isZero())return"0";var p;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var y=e.fromNumber(s),m=this.divide(y);return p=m.multiply(y).subtract(this),m.toString(s)+p.toInt().toString(s)}else return"-"+this.negate().toString(s);var A=e.fromNumber(Math.pow(s,6),this.unsigned);p=this;for(var S="";;){var b=p.divide(A),E=p.subtract(b.multiply(A)).toInt()>>>0,h=E.toString(s);if(p=b,p.isZero())return h+S;for(;h.length<6;)h="0"+h;S=""+h+S}},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 s=this.high!=0?this.high:this.low,p=31;p>0&&!(s&1<<p);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(s){return e.isLong(s)||(s=e.fromValue(s)),this.unsigned!==s.unsigned&&this.high>>>31===1&&s.high>>>31===1?!1:this.high===s.high&&this.low===s.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(s){return!this.equals(s)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(s){return this.compare(s)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(s){return this.compare(s)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(s){return this.compare(s)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(s){return this.compare(s)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compare=function(s){if(e.isLong(s)||(s=e.fromValue(s)),this.equals(s))return 0;var p=this.isNegative(),y=s.isNegative();return p&&!y?-1:!p&&y?1:this.unsigned?s.high>>>0>this.high>>>0||s.high===this.high&&s.low>>>0>this.low>>>0?-1:1:this.subtract(s).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(s){e.isLong(s)||(s=e.fromValue(s));var p=this.high>>>16,y=this.high&65535,m=this.low>>>16,A=this.low&65535,S=s.high>>>16,b=s.high&65535,E=s.low>>>16,h=s.low&65535,I=0,T=0,R=0,_=0;return _+=A+h,R+=_>>>16,_&=65535,R+=m+E,T+=R>>>16,R&=65535,T+=y+b,I+=T>>>16,T&=65535,I+=p+S,I&=65535,e.fromBits(R<<16|_,I<<16|T,this.unsigned)},e.prototype.subtract=function(s){return e.isLong(s)||(s=e.fromValue(s)),this.add(s.negate())},e.prototype.sub=e.prototype.subtract,e.prototype.multiply=function(s){if(this.isZero()||(e.isLong(s)||(s=e.fromValue(s)),s.isZero()))return e.ZERO;if(this.equals(e.MIN_VALUE))return s.isOdd()?e.MIN_VALUE:e.ZERO;if(s.equals(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return s.isNegative()?this.negate().multiply(s.negate()):this.negate().multiply(s).negate();if(s.isNegative())return this.multiply(s.negate()).negate();if(this.lessThan(c)&&s.lessThan(c))return e.fromNumber(this.toNumber()*s.toNumber(),this.unsigned);var p=this.high>>>16,y=this.high&65535,m=this.low>>>16,A=this.low&65535,S=s.high>>>16,b=s.high&65535,E=s.low>>>16,h=s.low&65535,I=0,T=0,R=0,_=0;return _+=A*h,R+=_>>>16,_&=65535,R+=m*h,T+=R>>>16,R&=65535,R+=A*E,T+=R>>>16,R&=65535,T+=y*h,I+=T>>>16,T&=65535,T+=m*E,I+=T>>>16,T&=65535,T+=A*b,I+=T>>>16,T&=65535,I+=p*h+y*E+m*b+A*S,I&=65535,e.fromBits(R<<16|_,I<<16|T,this.unsigned)},e.prototype.mul=e.prototype.multiply,e.prototype.divide=function(s){if(e.isLong(s)||(s=e.fromValue(s)),s.isZero())throw new Error("division by zero");if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var p,y,m;if(this.equals(e.MIN_VALUE)){if(s.equals(e.ONE)||s.equals(e.NEG_ONE))return e.MIN_VALUE;if(s.equals(e.MIN_VALUE))return e.ONE;var A=this.shiftRight(1);return p=A.divide(s).shiftLeft(1),p.equals(e.ZERO)?s.isNegative()?e.ONE:e.NEG_ONE:(y=this.subtract(s.multiply(p)),m=p.add(y.divide(s)),m)}else if(s.equals(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return s.isNegative()?this.negate().divide(s.negate()):this.negate().divide(s).negate();if(s.isNegative())return this.divide(s.negate()).negate();for(m=e.ZERO,y=this;y.greaterThanOrEqual(s);){p=Math.max(1,Math.floor(y.toNumber()/s.toNumber()));for(var S=Math.ceil(Math.log(p)/Math.LN2),b=S<=48?1:Math.pow(2,S-48),E=e.fromNumber(p),h=E.multiply(s);h.isNegative()||h.greaterThan(y);)p-=b,E=e.fromNumber(p,this.unsigned),h=E.multiply(s);E.isZero()&&(E=e.ONE),m=m.add(E),y=y.subtract(h)}return m},e.prototype.div=e.prototype.divide,e.prototype.modulo=function(s){return e.isLong(s)||(s=e.fromValue(s)),this.subtract(this.divide(s).multiply(s))},e.prototype.mod=e.prototype.modulo,e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.and=function(s){return e.isLong(s)||(s=e.fromValue(s)),e.fromBits(this.low&s.low,this.high&s.high,this.unsigned)},e.prototype.or=function(s){return e.isLong(s)||(s=e.fromValue(s)),e.fromBits(this.low|s.low,this.high|s.high,this.unsigned)},e.prototype.xor=function(s){return e.isLong(s)||(s=e.fromValue(s)),e.fromBits(this.low^s.low,this.high^s.high,this.unsigned)},e.prototype.shiftLeft=function(s){return e.isLong(s)&&(s=s.toInt()),(s&=63)===0?this:s<32?e.fromBits(this.low<<s,this.high<<s|this.low>>>32-s,this.unsigned):e.fromBits(0,this.low<<s-32,this.unsigned)},e.prototype.shl=e.prototype.shiftLeft,e.prototype.shiftRight=function(s){return e.isLong(s)&&(s=s.toInt()),(s&=63)===0?this:s<32?e.fromBits(this.low>>>s|this.high<<32-s,this.high>>s,this.unsigned):e.fromBits(this.high>>s-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=e.prototype.shiftRight,e.prototype.shiftRightUnsigned=function(s){if(e.isLong(s)&&(s=s.toInt()),s&=63,s===0)return this;var p=this.high;if(s<32){var y=this.low;return e.fromBits(y>>>s|p<<32-s,p>>>s,this.unsigned)}else return s===32?e.fromBits(p,0,this.unsigned):e.fromBits(p>>>s-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})})(Zo);var Jo=Zo.exports;Object.defineProperty(Et,"__esModule",{value:!0}),Et.Hyper=void 0;var Nb=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}}(),Qo=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)}},Bb=Jo,br=eu(Bb),Db=C,Ub=eu(Db);function eu(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")}function kb(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 qb(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=Et.Hyper=function(r){qb(e,r),Nb(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=Qo(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=Qo(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 Lb(this,e),kb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(br.default);(0,Ub.default)($r),$r.MAX_VALUE=new $r(br.default.MAX_VALUE.low,br.default.MAX_VALUE.high),$r.MIN_VALUE=new $r(br.default.MIN_VALUE.low,br.default.MIN_VALUE.high);var Fe={};Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.UnsignedInt=void 0;var jb=st,ru=tu(jb),Vb=C,Gb=tu(Vb);function tu(r){return r&&r.__esModule?r:{default:r}}var Er=Fe.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,ru.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,ru.default)(e)||Math.floor(e)!==e?!1:e>=Er.MIN_VALUE&&e<=Er.MAX_VALUE}};Er.MAX_VALUE=Math.pow(2,32)-1,Er.MIN_VALUE=0,(0,Gb.default)(Er);var At={};Object.defineProperty(At,"__esModule",{value:!0}),At.UnsignedHyper=void 0;var Hb=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}}(),nu=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)}},Wb=Jo,Ar=iu(Wb),Xb=C,zb=iu(Xb);function iu(r){return r&&r.__esModule?r:{default:r}}function Yb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Kb(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 Zb(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 Or=At.UnsignedHyper=function(r){Zb(e,r),Hb(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=nu(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=nu(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 Yb(this,e),Kb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(Ar.default);(0,zb.default)(Or),Or.MAX_VALUE=new Or(Ar.default.MAX_UNSIGNED_VALUE.low,Ar.default.MAX_UNSIGNED_VALUE.high),Or.MIN_VALUE=new Or(Ar.default.MIN_VALUE.low,Ar.default.MIN_VALUE.high);var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.Float=void 0;var Jb=st,au=ou(Jb),Qb=C,e1=ou(Qb);function ou(r){return r&&r.__esModule?r:{default:r}}var r1=Ot.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,au.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,au.default)(e)}};(0,e1.default)(r1);var St={};Object.defineProperty(St,"__esModule",{value:!0}),St.Double=void 0;var t1=st,uu=su(t1),n1=C,i1=su(n1);function su(r){return r&&r.__esModule?r:{default:r}}var a1=St.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,uu.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,uu.default)(e)}};(0,i1.default)(a1);var It={};Object.defineProperty(It,"__esModule",{value:!0}),It.Quadruple=void 0;var o1=C,u1=s1(o1);function s1(r){return r&&r.__esModule?r:{default:r}}var f1=It.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,u1.default)(f1);var Sr={},c1=he,l1=de,p1="[object Boolean]";function h1(r){return r===!0||r===!1||l1(r)&&c1(r)==p1}var d1=h1;Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.Bool=void 0;var y1=d1,g1=cu(y1),fu=ae,v1=C,_1=cu(v1);function cu(r){return r&&r.__esModule?r:{default:r}}var m1=Sr.Bool={read:function(e){var t=fu.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 fu.Int.write(n,t)},isValid:function(e){return(0,g1.default)(e)}};(0,_1.default)(m1);var Pt={},w1=he,b1=j,$1=de,E1="[object String]";function A1(r){return typeof r=="string"||!b1(r)&&$1(r)&&w1(r)==E1}var lu=A1;Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.String=void 0;var O1=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}}(),S1=lu,pu=ri(S1),I1=j,P1=ri(I1),hu=ae,x1=Fe,du=xe,T1=C,F1=ri(T1);function ri(r){return r&&r.__esModule?r:{default:r}}function R1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var M1=Pt.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:x1.UnsignedInt.MAX_VALUE;R1(this,r),this._maxLength=e}return O1(r,[{key:"read",value:function(t){var n=hu.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,du.calculatePadding)(n),a=t.slice(n);return(0,du.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,pu.default)(t)?i=d.from(t,"utf8"):i=d.from(t),hu.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,pu.default)(t))n=d.from(t,"utf8");else if((0,P1.default)(t)||d.isBuffer(t))n=d.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,F1.default)(M1.prototype);var xt={};Object.defineProperty(xt,"__esModule",{value:!0}),xt.Opaque=void 0;var C1=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}}(),yu=xe,N1=C,B1=D1(N1);function D1(r){return r&&r.__esModule?r:{default:r}}function U1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var L1=xt.Opaque=function(){function r(e){U1(this,r),this._length=e,this._padding=(0,yu.calculatePadding)(e)}return C1(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,yu.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,B1.default)(L1.prototype);var Tt={};Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.VarOpaque=void 0;var k1=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}}(),gu=ae,q1=Fe,vu=xe,j1=C,V1=G1(j1);function G1(r){return r&&r.__esModule?r:{default:r}}function H1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var W1=Tt.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:q1.UnsignedInt.MAX_VALUE;H1(this,r),this._maxLength=e}return k1(r,[{key:"read",value:function(t){var n=gu.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,vu.calculatePadding)(n),a=t.slice(n);return(0,vu.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));gu.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return d.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,V1.default)(W1.prototype);var Ft={};function X1(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var z1=X1,Y1=ct;function K1(r){return typeof r=="function"?r:Y1}var _u=K1,Z1=z1,J1=kn,Q1=_u,e$=j;function r$(r,e){var t=e$(r)?Z1:J1;return t(r,Q1(e))}var t$=r$,Ze=t$,n$=/\s/;function i$(r){for(var e=r.length;e--&&n$.test(r.charAt(e)););return e}var a$=i$,o$=a$,u$=/^\s+/;function s$(r){return r&&r.slice(0,o$(r)+1).replace(u$,"")}var f$=s$,c$=f$,mu=He,l$=bt,wu=0/0,p$=/^[-+]0x[0-9a-f]+$/i,h$=/^0b[01]+$/i,d$=/^0o[0-7]+$/i,y$=parseInt;function g$(r){if(typeof r=="number")return r;if(l$(r))return wu;if(mu(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=mu(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=c$(r);var t=h$.test(r);return t||d$.test(r)?y$(r.slice(2),t?2:8):p$.test(r)?wu:+r}var v$=g$,_$=v$,bu=1/0,m$=17976931348623157e292;function w$(r){if(!r)return r===0?r:0;if(r=_$(r),r===bu||r===-bu){var e=r<0?-1:1;return e*m$}return r===r?r:0}var b$=w$,$$=b$;function E$(r){var e=$$(r),t=e%1;return e===e?t?e-t:e:0}var A$=E$,O$=ro,S$=_u,I$=A$,P$=9007199254740991,ti=4294967295,x$=Math.min;function T$(r,e){if(r=I$(r),r<1||r>P$)return[];var t=ti,n=x$(r,ti);e=S$(e),r-=ti;for(var i=O$(n,e);++t<r;)e(t);return i}var $u=T$;Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.Array=void 0;var F$=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}}(),R$=Qn,M$=Ir(R$),C$=Ze,N$=Ir(C$),B$=$u,D$=Ir(B$),U$=j,Eu=Ir(U$),L$=C,k$=Ir(L$);function Ir(r){return r&&r.__esModule?r:{default:r}}function q$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var j$=Ft.Array=function(){function r(e,t){q$(this,r),this._childType=e,this._length=t}return F$(r,[{key:"read",value:function(t){var n=this;return(0,D$.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,Eu.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,N$.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,Eu.default)(t)||t.length!==this._length?!1:(0,M$.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,k$.default)(j$.prototype);var Rt={};Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.VarArray=void 0;var V$=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}}(),G$=Qn,H$=Pr(G$),W$=Ze,X$=Pr(W$),z$=$u,Y$=Pr(z$),K$=j,Au=Pr(K$),Z$=Fe,Ou=ae,J$=C,Q$=Pr(J$);function Pr(r){return r&&r.__esModule?r:{default:r}}function eE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var rE=Rt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Z$.UnsignedInt.MAX_VALUE;eE(this,r),this._childType=e,this._maxLength=t}return V$(r,[{key:"read",value:function(t){var n=this,i=Ou.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,Y$.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,Au.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));Ou.Int.write(t.length,n),(0,X$.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,Au.default)(t)||t.length>this._maxLength?!1:(0,H$.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,Q$.default)(rE.prototype);var Mt={};function tE(r){return r===null}var nE=tE;function iE(r){return r===void 0}var xr=iE;Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.Option=void 0;var aE=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}}(),oE=nE,Su=ni(oE),uE=xr,Iu=ni(uE),Pu=Sr,sE=C,fE=ni(sE);function ni(r){return r&&r.__esModule?r:{default:r}}function cE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var lE=Mt.Option=function(){function r(e){cE(this,r),this._childType=e}return aE(r,[{key:"read",value:function(t){if(Pu.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,Su.default)(t)||(0,Iu.default)(t));Pu.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,Su.default)(t)||(0,Iu.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,fE.default)(lE.prototype);var Tr={};Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.Void=void 0;var pE=xr,xu=Tu(pE),hE=C,dE=Tu(hE);function Tu(r){return r&&r.__esModule?r:{default:r}}var yE=Tr.Void={read:function(){},write:function(e){if(!(0,xu.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,xu.default)(e)}};(0,dE.default)(yE);var Ct={},gE=Jn;function vE(r,e){return gE(e,function(t){return r[t]})}var _E=vE,mE=_E,wE=dt;function bE(r){return r==null?[]:mE(r,wE(r))}var $E=bE;Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.Enum=void 0;var EE=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}}(),AE=Ze,OE=ii(AE),SE=$E,IE=ii(SE),Fu=ae,PE=C,xE=ii(PE);function ii(r){return r&&r.__esModule?r:{default:r}}function TE(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 FE(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 Ru(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var RE=Ct.Enum=function(){function r(e,t){Ru(this,r),this.name=e,this.value=t}return EE(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,IE.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){FE(u,o);function u(){return Ru(this,u),TE(this,(u.__proto__||Object.getPrototypeOf(u)).apply(this,arguments))}return u}(r);return a.enumName=n,t.results[n]=a,a._members={},a._byValue=new Map,(0,OE.default)(i,function(o,u){var f=new a(u,o);a._members[u]=f,a._byValue.set(o,f),a[u]=function(){return f}}),a}}]),r}();(0,xE.default)(RE);var Nt={},ME=kn,CE=mr;function NE(r,e){var t=-1,n=CE(r)?Array(r.length):[];return ME(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var BE=NE,DE=Jn,UE=Ho,LE=BE,kE=j;function qE(r,e){var t=kE(r)?DE:LE;return t(r,UE(e))}var jE=qE;function VE(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 GE=VE,Fr={};Object.defineProperty(Fr,"__esModule",{value:!0});var HE=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 WE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Fr.Reference=function(){function r(){WE(this,r)}return HE(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.Struct=void 0;var Bt=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var u=e[Symbol.iterator](),f;!(i=(f=u.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&u.return&&u.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")}}(),XE=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}}(),zE=Ze,Mu=Rr(zE),YE=jE,KE=Rr(YE),ZE=xr,JE=Rr(ZE),QE=GE,eA=Rr(QE),rA=Fr,tA=C,nA=Rr(tA);function Rr(r){return r&&r.__esModule?r:{default:r}}function iA(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 aA(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 oA=Nt.Struct=function(){function r(e){Cu(this,r),this._attributes=e||{}}return XE(r,null,[{key:"read",value:function(t){var n=(0,KE.default)(this._fields,function(i){var a=Bt(i,2),o=a[0],u=a[1],f=u.read(t);return[o,f]});return new this((0,eA.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,Mu.default)(this._fields,function(i){var a=Bt(i,2),o=a[0],u=a[1],f=t._attributes[o];u.write(f,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){aA(u,o);function u(){return Cu(this,u),iA(this,(u.__proto__||Object.getPrototypeOf(u)).apply(this,arguments))}return u}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var u=Bt(o,2),f=u[0],c=u[1];return c instanceof rA.Reference&&(c=c.resolve(t)),[f,c]}),(0,Mu.default)(a._fields,function(o){var u=Bt(o,1),f=u[0];a.prototype[f]=uA(f)}),a}}]),r}();(0,nA.default)(oA);function uA(r){return function(t){return(0,JE.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.Union=void 0;var sA=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var u=e[Symbol.iterator](),f;!(i=(f=u.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&u.return&&u.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")}}(),fA=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}}(),cA=Ze,Ut=kt(cA),lA=xr,Nu=kt(lA),pA=lu,Bu=kt(pA),Lt=Tr,ai=Fr,hA=C,dA=kt(hA);function kt(r){return r&&r.__esModule?r:{default:r}}function yA(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 gA(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 Du(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var vA=Dt.Union=function(){function r(e,t){Du(this,r),this.set(e,t)}return fA(r,[{key:"set",value:function(t,n){(0,Bu.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!==Lt.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===Lt.Void?Lt.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,Nu.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(u){gA(f,u);function f(){return Du(this,f),yA(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof ai.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,Ut.default)(i.arms,function(u,f){u instanceof ai.Reference&&(u=u.resolve(t)),a._arms[f]=u});var o=i.defaultArm;return o instanceof ai.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Ut.default)(i.switches,function(u){var f=sA(u,2),c=f[0],l=f[1];(0,Bu.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,Nu.default)(a._switchOn.values)||(0,Ut.default)(a._switchOn.values(),function(u){a[u.name]=function(f){return new a(u,f)},a.prototype[u.name]=function(c){return this.set(u,c)}}),(0,Ut.default)(a._arms,function(u,f){u!==Lt.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,dA.default)(vA),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ae;Object.keys(e).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return e[h]}})});var t=Et;Object.keys(t).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return t[h]}})});var n=Fe;Object.keys(n).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return n[h]}})});var i=At;Object.keys(i).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return i[h]}})});var a=Ot;Object.keys(a).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return a[h]}})});var o=St;Object.keys(o).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return o[h]}})});var u=It;Object.keys(u).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return u[h]}})});var f=Sr;Object.keys(f).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return f[h]}})});var c=Pt;Object.keys(c).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return c[h]}})});var l=xt;Object.keys(l).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return l[h]}})});var s=Tt;Object.keys(s).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return s[h]}})});var p=Ft;Object.keys(p).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return p[h]}})});var y=Rt;Object.keys(y).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return y[h]}})});var m=Mt;Object.keys(m).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return m[h]}})});var A=Tr;Object.keys(A).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return A[h]}})});var S=Ct;Object.keys(S).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return S[h]}})});var b=Nt;Object.keys(b).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return b[h]}})});var E=Dt;Object.keys(E).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return E[h]}})})}(Nn);var Uu={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function _(g,v){for(var O=0;O<v.length;O++){var P=v[O];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(g,P.key,P)}}return function(g,v,O){return v&&_(g.prototype,v),O&&_(g,O),g}}(),t=Fr;Object.keys(t).forEach(function(_){_==="default"||_==="__esModule"||Object.defineProperty(r,_,{enumerable:!0,get:function(){return t[_]}})}),r.config=m;var n=xr,i=l(n),a=Ze,o=l(a),u=Nn,f=c(u);function c(_){if(_&&_.__esModule)return _;var g={};if(_!=null)for(var v in _)Object.prototype.hasOwnProperty.call(_,v)&&(g[v]=_[v]);return g.default=_,g}function l(_){return _&&_.__esModule?_:{default:_}}function s(_,g){if(!(_ instanceof g))throw new TypeError("Cannot call a class as a function")}function p(_,g){if(!_)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:_}function y(_,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);_.prototype=Object.create(g&&g.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(_,g):_.__proto__=g)}function m(_){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(_){var v=new R(g);_(v),v.resolve()}return g}var A=function(_){y(g,_);function g(v){s(this,g);var O=p(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return O.name=v,O}return e(g,[{key:"resolve",value:function(O){var P=O.definitions[this.name];return P.resolve(O)}}]),g}(t.Reference),S=function(_){y(g,_);function g(v,O){var P=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;s(this,g);var M=p(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return M.childReference=v,M.length=O,M.variable=P,M}return e(g,[{key:"resolve",value:function(O){var P=this.childReference,M=this.length;return P instanceof t.Reference&&(P=P.resolve(O)),M instanceof t.Reference&&(M=M.resolve(O)),this.variable?new f.VarArray(P,M):new f.Array(P,M)}}]),g}(t.Reference),b=function(_){y(g,_);function g(v){s(this,g);var O=p(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return O.childReference=v,O.name=v.name,O}return e(g,[{key:"resolve",value:function(O){var P=this.childReference;return P instanceof t.Reference&&(P=P.resolve(O)),new f.Option(P)}}]),g}(t.Reference),E=function(_){y(g,_);function g(v,O){s(this,g);var P=p(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return P.sizedType=v,P.length=O,P}return e(g,[{key:"resolve",value:function(O){var P=this.length;return P instanceof t.Reference&&(P=P.resolve(O)),new this.sizedType(P)}}]),g}(t.Reference),h=function(){function _(g,v,O){s(this,_),this.constructor=g,this.name=v,this.config=O}return e(_,[{key:"resolve",value:function(v){return this.name in v.results?v.results[this.name]:this.constructor(v,this.name,this.config)}}]),_}();function I(_,g,v){return v instanceof t.Reference&&(v=v.resolve(_)),_.results[g]=v,v}function T(_,g,v){return _.results[g]=v,v}var R=function(){function _(g){s(this,_),this._destination=g,this._definitions={}}return e(_,[{key:"enum",value:function(v,O){var P=new h(f.Enum.create,v,O);this.define(v,P)}},{key:"struct",value:function(v,O){var P=new h(f.Struct.create,v,O);this.define(v,P)}},{key:"union",value:function(v,O){var P=new h(f.Union.create,v,O);this.define(v,P)}},{key:"typedef",value:function(v,O){var P=new h(I,v,O);this.define(v,P)}},{key:"const",value:function(v,O){var P=new h(T,v,O);this.define(v,P)}},{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(v){return new E(f.String,v)}},{key:"opaque",value:function(v){return new E(f.Opaque,v)}},{key:"varOpaque",value:function(v){return new E(f.VarOpaque,v)}},{key:"array",value:function(v,O){return new S(v,O)}},{key:"varArray",value:function(v,O){return new S(v,O,!0)}},{key:"option",value:function(v){return new b(v)}},{key:"define",value:function(v,O){if((0,i.default)(this._destination[v]))this._definitions[v]=O;else throw new Error("XDRTypes Error:"+v+" is already defined")}},{key:"lookup",value:function(v){return new A(v)}},{key:"resolve",value:function(){var v=this;(0,o.default)(this._definitions,function(O){O.resolve({definitions:v._definitions,results:v._destination})})}}]),_}()})(Uu),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Nn;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=Uu;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(qa);function _A(r){const e={variantId:ue.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new ue.BundleItem({collectionId:ue.Uint64.fromString(n.collectionId.toString()),productId:ue.Uint64.fromString(n.productId.toString()),variantId:ue.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new ue.BundleItemExt(0)})),ext:new ue.BundleExt(0)},t=new ue.Bundle(e);return ue.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const ue=qa.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")}})}),Lu="/bundling-storefront-manager";function mA(){return Math.ceil(Date.now()/1e3)}async function wA(){try{const{timestamp:r}=await vr("get",`${Lu}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),mA()}}async function bA(r){const e=X(),t=await ku(r);if(t!==!0)throw new Error(t);const n=await wA(),i=_A({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 vr("post",`${Lu}/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 $A(r,e){const t=qu(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${Pi(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 ku(r){try{return r?!0:"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}const EA={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 qu(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=EA[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 AA(r,e){const{bundle_selection:t}=await $("get","/bundle_selections",{id:e},w(r,"getBundleSelection"));return t}function OA(r,e){return $("get","/bundle_selections",{query:e},w(r,"listBundleSelections"))}async function SA(r,e){const{bundle_selection:t}=await $("post","/bundle_selections",{data:e},w(r,"createBundleSelection"));return t}async function IA(r,e,t){const{bundle_selection:n}=await $("put","/bundle_selections",{id:e,data:t},w(r,"updateBundleSelection"));return n}function PA(r,e){return $("delete","/bundle_selections",{id:e},w(r,"deleteBundleSelection"))}async function xA(r,e,t,n){const{subscription:i}=await $("put","/bundles",{id:e,data:t,query:n},w(r,"updateBundle"));return i}var TA=Object.freeze({__proto__:null,createBundleSelection:SA,deleteBundleSelection:PA,getBundleId:bA,getBundleSelection:AA,getDynamicBundleItems:$A,listBundleSelections:OA,updateBundle:xA,updateBundleSelection:IA,validateBundle:ku,validateDynamicBundle:qu}),FA=200,oi="__lodash_hash_undefined__",RA=1/0,ju=9007199254740991,MA="[object Arguments]",CA="[object Function]",NA="[object GeneratorFunction]",BA="[object Symbol]",DA=/[\\^$.*+?()[\]{}|]/g,UA=/^\[object .+?Constructor\]$/,LA=/^(?:0|[1-9]\d*)$/,kA=typeof U=="object"&&U&&U.Object===Object&&U,qA=typeof self=="object"&&self&&self.Object===Object&&self,ui=kA||qA||Function("return this")();function jA(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)}function VA(r,e){var t=r?r.length:0;return!!t&&WA(r,e,0)>-1}function GA(r,e,t){for(var n=-1,i=r?r.length:0;++n<i;)if(t(e,r[n]))return!0;return!1}function Vu(r,e){for(var t=-1,n=r?r.length:0,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}function si(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}function HA(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}function WA(r,e,t){if(e!==e)return HA(r,XA,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function XA(r){return r!==r}function zA(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}function YA(r){return function(e){return r(e)}}function KA(r,e){return r.has(e)}function ZA(r,e){return r?.[e]}function JA(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function Gu(r,e){return function(t){return r(e(t))}}var QA=Array.prototype,eO=Function.prototype,qt=Object.prototype,fi=ui["__core-js_shared__"],Hu=function(){var r=/[^.]+$/.exec(fi&&fi.keys&&fi.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Wu=eO.toString,Je=qt.hasOwnProperty,ci=qt.toString,rO=RegExp("^"+Wu.call(Je).replace(DA,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Xu=ui.Symbol,tO=Gu(Object.getPrototypeOf,Object),nO=qt.propertyIsEnumerable,iO=QA.splice,zu=Xu?Xu.isConcatSpreadable:void 0,li=Object.getOwnPropertySymbols,Yu=Math.max,aO=Zu(ui,"Map"),Mr=Zu(Object,"create");function Re(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function oO(){this.__data__=Mr?Mr(null):{}}function uO(r){return this.has(r)&&delete this.__data__[r]}function sO(r){var e=this.__data__;if(Mr){var t=e[r];return t===oi?void 0:t}return Je.call(e,r)?e[r]:void 0}function fO(r){var e=this.__data__;return Mr?e[r]!==void 0:Je.call(e,r)}function cO(r,e){var t=this.__data__;return t[r]=Mr&&e===void 0?oi:e,this}Re.prototype.clear=oO,Re.prototype.delete=uO,Re.prototype.get=sO,Re.prototype.has=fO,Re.prototype.set=cO;function Qe(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function lO(){this.__data__=[]}function pO(r){var e=this.__data__,t=Vt(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():iO.call(e,t,1),!0}function hO(r){var e=this.__data__,t=Vt(e,r);return t<0?void 0:e[t][1]}function dO(r){return Vt(this.__data__,r)>-1}function yO(r,e){var t=this.__data__,n=Vt(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}Qe.prototype.clear=lO,Qe.prototype.delete=pO,Qe.prototype.get=hO,Qe.prototype.has=dO,Qe.prototype.set=yO;function er(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function gO(){this.__data__={hash:new Re,map:new(aO||Qe),string:new Re}}function vO(r){return Gt(this,r).delete(r)}function _O(r){return Gt(this,r).get(r)}function mO(r){return Gt(this,r).has(r)}function wO(r,e){return Gt(this,r).set(r,e),this}er.prototype.clear=gO,er.prototype.delete=vO,er.prototype.get=_O,er.prototype.has=mO,er.prototype.set=wO;function jt(r){var e=-1,t=r?r.length:0;for(this.__data__=new er;++e<t;)this.add(r[e])}function bO(r){return this.__data__.set(r,oi),this}function $O(r){return this.__data__.has(r)}jt.prototype.add=jt.prototype.push=bO,jt.prototype.has=$O;function EO(r,e){var t=pi(r)||Ju(r)?zA(r.length,String):[],n=t.length,i=!!n;for(var a in r)(e||Je.call(r,a))&&!(i&&(a=="length"||NO(a,n)))&&t.push(a);return t}function Vt(r,e){for(var t=r.length;t--;)if(jO(r[t][0],e))return t;return-1}function AO(r,e,t,n){var i=-1,a=VA,o=!0,u=r.length,f=[],c=e.length;if(!u)return f;t&&(e=Vu(e,YA(t))),n?(a=GA,o=!1):e.length>=FA&&(a=KA,o=!1,e=new jt(e));e:for(;++i<u;){var l=r[i],s=t?t(l):l;if(l=n||l!==0?l:0,o&&s===s){for(var p=c;p--;)if(e[p]===s)continue e;f.push(l)}else a(e,s,n)||f.push(l)}return f}function Ku(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=CO),i||(i=[]);++a<o;){var u=r[a];e>0&&t(u)?e>1?Ku(u,e-1,t,n,i):si(i,u):n||(i[i.length]=u)}return i}function OO(r,e,t){var n=e(r);return pi(r)?n:si(n,t(r))}function SO(r){if(!hi(r)||DO(r))return!1;var e=es(r)||JA(r)?rO:UA;return e.test(qO(r))}function IO(r){if(!hi(r))return LO(r);var e=UO(r),t=[];for(var n in r)n=="constructor"&&(e||!Je.call(r,n))||t.push(n);return t}function PO(r,e){return r=Object(r),xO(r,e,function(t,n){return n in r})}function xO(r,e,t){for(var n=-1,i=e.length,a={};++n<i;){var o=e[n],u=r[o];t(u,o)&&(a[o]=u)}return a}function TO(r,e){return e=Yu(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=Yu(t.length-e,0),a=Array(i);++n<i;)a[n]=t[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=t[n];return o[e]=a,jA(r,this,o)}}function FO(r){return OO(r,WO,MO)}function Gt(r,e){var t=r.__data__;return BO(e)?t[typeof e=="string"?"string":"hash"]:t.map}function Zu(r,e){var t=ZA(r,e);return SO(t)?t:void 0}var RO=li?Gu(li,Object):ts,MO=li?function(r){for(var e=[];r;)si(e,RO(r)),r=tO(r);return e}:ts;function CO(r){return pi(r)||Ju(r)||!!(zu&&r&&r[zu])}function NO(r,e){return e=e??ju,!!e&&(typeof r=="number"||LA.test(r))&&r>-1&&r%1==0&&r<e}function BO(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function DO(r){return!!Hu&&Hu in r}function UO(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||qt;return r===t}function LO(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}function kO(r){if(typeof r=="string"||HO(r))return r;var e=r+"";return e=="0"&&1/r==-RA?"-0":e}function qO(r){if(r!=null){try{return Wu.call(r)}catch{}try{return r+""}catch{}}return""}function jO(r,e){return r===e||r!==r&&e!==e}function Ju(r){return VO(r)&&Je.call(r,"callee")&&(!nO.call(r,"callee")||ci.call(r)==MA)}var pi=Array.isArray;function Qu(r){return r!=null&&GO(r.length)&&!es(r)}function VO(r){return rs(r)&&Qu(r)}function es(r){var e=hi(r)?ci.call(r):"";return e==CA||e==NA}function GO(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=ju}function hi(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}function rs(r){return!!r&&typeof r=="object"}function HO(r){return typeof r=="symbol"||rs(r)&&ci.call(r)==BA}function WO(r){return Qu(r)?EO(r,!0):IO(r)}var XO=TO(function(r,e){return r==null?{}:(e=Vu(Ku(e,1),kO),PO(r,AO(FO(r),e)))});function ts(){return[]}var zO=XO,di=ve(zO);function YO(r){try{return JSON.parse(r)}catch{return r}}function KO(r){return Object.entries(r).reduce((e,[t,n])=>({...e,[t]:YO(n)}),{})}const ns=r=>typeof r=="string"?r!=="0"&&r!=="false":!!r;function is(r){const e=KO(r),t=e.auto_inject===void 0?!0:e.auto_inject,n=e.display_on??[],i=e.first_option==="autodeliver";return{...di(e,["display_on","first_option"]),auto_inject:t,valid_pages:n,is_subscription_first:i,autoInject:t,validPages:n,isSubscriptionFirst:i}}function as(r){const e=r.subscription_options?.storefront_purchase_options==="subscription_only";return{...r,is_subscription_only:e,isSubscriptionOnly:e}}function ZO(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=as(i)}),t})}const yi="2020-12",JO={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Cr=new Map;function Ht(r,e){return Cr.has(r)||Cr.set(r,e()),Cr.get(r)}async function gi(r,e){const t=e?.version??"2020-12",{product:n}=await Ht(`product.${r}.${t}`,()=>ot("get",`/product/${t}/${r}.json`));return t==="2020-12"?as(n):n}async function os(){return await Ht("storeSettings",()=>ot("get",`/${yi}/store_settings.json`).catch(()=>JO))}async function us(){const{widget_settings:r}=await Ht("widgetSettings",()=>ot("get",`/${yi}/widget_settings.json`));return is(r)}async function ss(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await Ht("productsAndSettings",()=>ot("get",`/product/${yi}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:ZO(r),widget_settings:is(e),store_settings:t??{}}}async function QO(){const{products:r}=await ss();return r}async function eS(r){const[e,t,n]=await Promise.all([gi(r),os(),us()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function rS(r){const{bundle_product:e}=await gi(r);return e}async function fs(){return Array.from(Cr.keys()).forEach(r=>Cr.delete(r))}var tS=Object.freeze({__proto__:null,getCDNBundleSettings:rS,getCDNProduct:gi,getCDNProductAndSettings:eS,getCDNProducts:QO,getCDNProductsAndSettings:ss,getCDNStoreSettings:os,getCDNWidgetSettings:us,resetCDNCache:fs});async function nS(r,e,t){const{charge:n}=await $("get","/charges",{id:e,query:{include:t?.include}},w(r,"getCharge"));return n}function iS(r,e){return $("get","/charges",{query:e},w(r,"listCharges"))}async function aS(r,e,t){const{charge:n}=await $("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},w(r,"applyDiscountToCharge"));return n}async function oS(r,e){const{charge:t}=await $("post",`/charges/${e}/remove_discount`,{},w(r,"removeDiscountsFromCharge"));return t}async function uS(r,e,t,n){const{charge:i}=await $("post",`/charges/${e}/skip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},w(r,"skipCharge"));return i}async function sS(r,e,t,n){const{charge:i}=await $("post",`/charges/${e}/unskip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},w(r,"unskipCharge"));return i}async function fS(r,e){const{charge:t}=await $("post",`/charges/${e}/process`,{},w(r,"processCharge"));return t}var cS=Object.freeze({__proto__:null,applyDiscountToCharge:aS,getCharge:nS,listCharges:iS,processCharge:fS,removeDiscountsFromCharge:oS,skipCharge:uS,unskipCharge:sS});async function cs(r,e){if(!["2020-12","2022-06"].includes(e.format_version))throw new Error("Missing or unsupported format_version.");return $("get","/product_search",{query:e,headers:{"X-Recharge-Version":"2021-01"}},w(r,"productSearch"))}var lS=Object.freeze({__proto__:null,productSearch:cs});async function ls(r,e){const{collection:t}=await $("get","/collections",{id:e},w(r,"getCollection"));return t}function pS(r,e){return $("get","/collections",{query:e},w(r,"listCollections"))}async function hS(r,e,t){if(!["2020-12","2022-06"].includes(t.format_version))throw new Error("Missing or unsupported format_version.");const n=w(r,"listCollectionProducts"),[{sort_order:i,manual_sort_order:a},{products:o}]=await Promise.all([ls(n,e),cs(n,{...t,collection_ids:[e],limit:250})]);if(i==="manual")return{products:a.reduce((u,f)=>{const c=o.find(l=>l.external_product_id===f);return c&&u.push(c),u},[])};{const u=dS(i);return{products:o.slice().sort(u)}}}function ps(r,e){const t=r.external_created_at,n=e.external_created_at;return t<n?-1:n>t?1:0}function hs(r,e){const t=r.external_product_id,n=e.external_product_id;return t<n?-1:n>t?1:0}function ds(r,e){const t=r.title.toLowerCase(),n=e.title.toLowerCase();return t<n?-1:n>t?1:0}function dS(r){switch(r){case"created_at-asc":return ps;case"created_at-desc":return(e,t)=>ps(t,e);case"id-asc":return hs;case"id-desc":return(e,t)=>hs(t,e);case"title-asc":return ds;case"title-desc":return(e,t)=>ds(t,e)}}var yS=Object.freeze({__proto__:null,getCollection:ls,listCollectionProducts:hS,listCollections:pS});async function gS(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await $("get","/customers",{id:t,query:{include:e?.include}},w(r,"getCustomer"));return n}async function ys(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await $("put","/customers",{id:t,data:e},w(r,"updateCustomer"));return n}async function vS(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await $("get",`/customers/${t}/delivery_schedule`,{query:e},w(r,"getDeliverySchedule"));return n}async function vi(r){return $("get","/portal_access",{},w(r,"getCustomerPortalAccess"))}async function _S(r,e,t){const{base_url:n,customer_hash:i,temp_token:a}=await vi(w(r,"getActiveChurnLandingPageURL"));return`${n.replace("portal","pages")}${i}/subscriptions/${e}/cancel?token=${a}&subscription=${e}&redirect_to=${t}`}async function mS(r,e,t){const{base_url:n,customer_hash:i,temp_token:a}=await vi(w(r,"getGiftRedemptionLandingPageURL"));return`${n.replace("portal","pages")}${i}/gifts/${e}?token=${a}&redirect_to=${t}`}const wS={SHOPIFY_UPDATE_PAYMENT_INFO:{type:"email",template_type:"shopify_update_payment_information"}};async function bS(r,e,t){const n=r.customerId;if(!n)throw new Error("Not logged in.");const i=wS[e];if(!i)throw new Error("Notification not supported.");return $("post",`/customers/${n}/notifications`,{data:{...i,template_vars:t}},w(r,"sendCustomerNotification"))}async function $S(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{credit_summary:n}=await $("get",`/customers/${t}/credit_summary`,{query:{include:e?.include}},w(r,"getCreditSummary"));return n}var ES=Object.freeze({__proto__:null,getActiveChurnLandingPageURL:_S,getCreditSummary:$S,getCustomer:gS,getCustomerPortalAccess:vi,getDeliverySchedule:vS,getGiftRedemptionLandingPageURL:mS,sendCustomerNotification:bS,updateCustomer:ys});async function AS(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{credit_summary:n}=await $("get",`/customers/${t}/credit_summary`,{query:{include:e?.include}},w(r,"getCreditSummary"));return n}function OS(r,{recurring:e}){if(!r.customerId)throw new Error("Not logged in.");const t={};return e!==void 0&&(t.apply_credit_to_next_recurring_charge=e),ys(w(r,"setApplyCreditsToNextCharge"),t)}async function SS(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");return await $("get","/credit_accounts",{query:{customer_id:t,...e}},w(r,"listCreditAccounts"))}var IS=Object.freeze({__proto__:null,getCreditSummary:AS,listCreditAccounts:SS,setApplyCreditsToNextCharge:OS});function PS(r,e){if(!r.customerId)throw new Error("Not logged in.");return $("get","/gift_purchases",{query:e},w(r,"listGiftPurchases"))}async function xS(r,e){if(!r.customerId)throw new Error("Not logged in.");const{gift_purchase:t}=await $("get","/gift_purchases",{id:e},w(r,"getGiftPurchase"));return t}var TS=Object.freeze({__proto__:null,getGiftPurchase:xS,listGiftPurchases:PS});async function FS(r,e){const{membership:t}=await $("get","/memberships",{id:e},w(r,"getMembership"));return t}function RS(r,e){return $("get","/memberships",{query:e},w(r,"listMemberships"))}async function MS(r,e,t){const{membership:n}=await $("post",`/memberships/${e}/cancel`,{data:t},w(r,"cancelMembership"));return n}async function CS(r,e,t){const{membership:n}=await $("post",`/memberships/${e}/activate`,{data:t},w(r,"activateMembership"));return n}async function NS(r,e,t){const{membership:n}=await $("post",`/memberships/${e}/change`,{data:t},w(r,"changeMembership"));return n}var BS=Object.freeze({__proto__:null,activateMembership:CS,cancelMembership:MS,changeMembership:NS,getMembership:FS,listMemberships:RS});async function DS(r,e,t){const{membership_program:n}=await $("get","/membership_programs",{id:e,query:{include:t?.include}},w(r,"getMembershipProgram"));return n}function US(r,e){return $("get","/membership_programs",{query:e},w(r,"listMembershipPrograms"))}var LS=Object.freeze({__proto__:null,getMembershipProgram:DS,listMembershipPrograms:US});async function kS(r,e){const{metafield:t}=await $("post","/metafields",{data:{metafield:e}},w(r,"createMetafield"));return t}async function qS(r,e,t){const{metafield:n}=await $("put","/metafields",{id:e,data:{metafield:t}},w(r,"updateMetafield"));return n}function jS(r,e){return $("delete","/metafields",{id:e},w(r,"deleteMetafield"))}var VS=Object.freeze({__proto__:null,createMetafield:kS,deleteMetafield:jS,updateMetafield:qS});async function GS(r,e){const{onetime:t}=await $("get","/onetimes",{id:e},w(r,"getOnetime"));return t}function HS(r,e){return $("get","/onetimes",{query:e},w(r,"listOnetimes"))}async function WS(r,e){const{onetime:t}=await $("post","/onetimes",{data:e},w(r,"createOnetime"));return t}async function XS(r,e,t){const{onetime:n}=await $("put","/onetimes",{id:e,data:t},w(r,"updateOnetime"));return n}function zS(r,e){return $("delete","/onetimes",{id:e},w(r,"deleteOnetime"))}var YS=Object.freeze({__proto__:null,createOnetime:WS,deleteOnetime:zS,getOnetime:GS,listOnetimes:HS,updateOnetime:XS});async function KS(r,e){const{order:t}=await $("get","/orders",{id:e},w(r,"getOrder"));return t}function ZS(r,e){return $("get","/orders",{query:e},w(r,"listOrders"))}var JS=Object.freeze({__proto__:null,getOrder:KS,listOrders:ZS});async function QS(r,e,t){const{payment_method:n}=await $("get","/payment_methods",{id:e,query:{include:t?.include}},w(r,"getPaymentMethod"));return n}async function eI(r,e){const{payment_method:t}=await $("post","/payment_methods",{data:{...e,customer_id:r.customerId}},w(r,"createPaymentMethod"));return t}async function rI(r,e,t){const{payment_method:n}=await $("put","/payment_methods",{id:e,data:t},w(r,"updatePaymentMethod"));return n}function tI(r,e){return $("get","/payment_methods",{query:e},w(r,"listPaymentMethods"))}var nI=Object.freeze({__proto__:null,createPaymentMethod:eI,getPaymentMethod:QS,listPaymentMethods:tI,updatePaymentMethod:rI});async function iI(r,e){const{plan:t}=await $("get","/plans",{id:e},w(r,"getPlan"));return t}function aI(r,e){return $("get","/plans",{query:e},w(r,"listPlans"))}var oI=Object.freeze({__proto__:null,getPlan:iI,listPlans:aI});async function uI(r,e){return await $("get","/shop/shipping_countries",{query:e,headers:{"X-Recharge-Version":"2021-01"}},w(r,"getShippingCountries"))}var sI=Object.freeze({__proto__:null,getShippingCountries:uI}),fI="Expected a function",gs="__lodash_placeholder__",Me=1,Wt=2,cI=4,rr=8,Nr=16,Ce=32,Br=64,vs=128,lI=256,_s=512,ms=1/0,pI=9007199254740991,hI=17976931348623157e292,ws=0/0,dI=[["ary",vs],["bind",Me],["bindKey",Wt],["curry",rr],["curryRight",Nr],["flip",_s],["partial",Ce],["partialRight",Br],["rearg",lI]],yI="[object Function]",gI="[object GeneratorFunction]",vI="[object Symbol]",_I=/[\\^$.*+?()[\]{}|]/g,mI=/^\s+|\s+$/g,wI=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,bI=/\{\n\/\* \[wrapped with (.+)\] \*/,$I=/,? & /,EI=/^[-+]0x[0-9a-f]+$/i,AI=/^0b[01]+$/i,OI=/^\[object .+?Constructor\]$/,SI=/^0o[0-7]+$/i,II=/^(?:0|[1-9]\d*)$/,PI=parseInt,xI=typeof U=="object"&&U&&U.Object===Object&&U,TI=typeof self=="object"&&self&&self.Object===Object&&self,Dr=xI||TI||Function("return this")();function _i(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)}function FI(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}function RI(r,e){var t=r?r.length:0;return!!t&&CI(r,e,0)>-1}function MI(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}function CI(r,e,t){if(e!==e)return MI(r,NI,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function NI(r){return r!==r}function BI(r,e){for(var t=r.length,n=0;t--;)r[t]===e&&n++;return n}function DI(r,e){return r?.[e]}function UI(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function mi(r,e){for(var t=-1,n=r.length,i=0,a=[];++t<n;){var o=r[t];(o===e||o===gs)&&(r[t]=gs,a[i++]=t)}return a}var LI=Function.prototype,bs=Object.prototype,wi=Dr["__core-js_shared__"],$s=function(){var r=/[^.]+$/.exec(wi&&wi.keys&&wi.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),Es=LI.toString,kI=bs.hasOwnProperty,As=bs.toString,qI=RegExp("^"+Es.call(kI).replace(_I,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),jI=Object.create,tr=Math.max,VI=Math.min,Os=function(){var r=Is(Object,"defineProperty"),e=Is.name;return e&&e.length>2?r:void 0}();function GI(r){return nr(r)?jI(r):{}}function HI(r){if(!nr(r)||n2(r))return!1;var e=u2(r)||UI(r)?qI:OI;return e.test(a2(r))}function WI(r,e){return e=tr(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=tr(t.length-e,0),a=Array(i);++n<i;)a[n]=t[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=t[n];return o[e]=a,_i(r,this,o)}}function XI(r,e,t,n){for(var i=-1,a=r.length,o=t.length,u=-1,f=e.length,c=tr(a-o,0),l=Array(f+c),s=!n;++u<f;)l[u]=e[u];for(;++i<o;)(s||i<a)&&(l[t[i]]=r[i]);for(;c--;)l[u++]=r[i++];return l}function zI(r,e,t,n){for(var i=-1,a=r.length,o=-1,u=t.length,f=-1,c=e.length,l=tr(a-u,0),s=Array(l+c),p=!n;++i<l;)s[i]=r[i];for(var y=i;++f<c;)s[y+f]=e[f];for(;++o<u;)(p||i<a)&&(s[y+t[o]]=r[i++]);return s}function YI(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}function KI(r,e,t){var n=e&Me,i=Ur(r);function a(){var o=this&&this!==Dr&&this instanceof a?i:r;return o.apply(n?t:this,arguments)}return a}function Ur(r){return function(){var e=arguments;switch(e.length){case 0:return new r;case 1:return new r(e[0]);case 2:return new r(e[0],e[1]);case 3:return new r(e[0],e[1],e[2]);case 4:return new r(e[0],e[1],e[2],e[3]);case 5:return new r(e[0],e[1],e[2],e[3],e[4]);case 6:return new r(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new r(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=GI(r.prototype),n=r.apply(t,e);return nr(n)?n:t}}function ZI(r,e,t){var n=Ur(r);function i(){for(var a=arguments.length,o=Array(a),u=a,f=$i(i);u--;)o[u]=arguments[u];var c=a<3&&o[0]!==f&&o[a-1]!==f?[]:mi(o,f);if(a-=c.length,a<t)return Ss(r,e,bi,i.placeholder,void 0,o,c,void 0,void 0,t-a);var l=this&&this!==Dr&&this instanceof i?n:r;return _i(l,this,o)}return i}function bi(r,e,t,n,i,a,o,u,f,c){var l=e&vs,s=e&Me,p=e&Wt,y=e&(rr|Nr),m=e&_s,A=p?void 0:Ur(r);function S(){for(var b=arguments.length,E=Array(b),h=b;h--;)E[h]=arguments[h];if(y)var I=$i(S),T=BI(E,I);if(n&&(E=XI(E,n,i,y)),a&&(E=zI(E,a,o,y)),b-=T,y&&b<c){var R=mi(E,I);return Ss(r,e,bi,S.placeholder,t,E,R,u,f,c-b)}var _=s?t:this,g=p?_[r]:r;return b=E.length,u?E=i2(E,u):m&&b>1&&E.reverse(),l&&f<b&&(E.length=f),this&&this!==Dr&&this instanceof S&&(g=A||Ur(g)),g.apply(_,E)}return S}function JI(r,e,t,n){var i=e&Me,a=Ur(r);function o(){for(var u=-1,f=arguments.length,c=-1,l=n.length,s=Array(l+f),p=this&&this!==Dr&&this instanceof o?a:r;++c<l;)s[c]=n[c];for(;f--;)s[c++]=arguments[++u];return _i(p,i?t:this,s)}return o}function Ss(r,e,t,n,i,a,o,u,f,c){var l=e&rr,s=l?o:void 0,p=l?void 0:o,y=l?a:void 0,m=l?void 0:a;e|=l?Ce:Br,e&=~(l?Br:Ce),e&cI||(e&=~(Me|Wt));var A=t(r,e,i,y,s,m,p,u,f,c);return A.placeholder=n,Ps(A,r,e)}function QI(r,e,t,n,i,a,o,u){var f=e&Wt;if(!f&&typeof r!="function")throw new TypeError(fI);var c=n?n.length:0;if(c||(e&=~(Ce|Br),n=i=void 0),o=o===void 0?o:tr(xs(o),0),u=u===void 0?u:xs(u),c-=i?i.length:0,e&Br){var l=n,s=i;n=i=void 0}var p=[r,e,t,n,i,l,s,a,o,u];if(r=p[0],e=p[1],t=p[2],n=p[3],i=p[4],u=p[9]=p[9]==null?f?0:r.length:tr(p[9]-c,0),!u&&e&(rr|Nr)&&(e&=~(rr|Nr)),!e||e==Me)var y=KI(r,e,t);else e==rr||e==Nr?y=ZI(r,e,u):(e==Ce||e==(Me|Ce))&&!i.length?y=JI(r,e,t,n):y=bi.apply(void 0,p);return Ps(y,r,e)}function $i(r){var e=r;return e.placeholder}function Is(r,e){var t=DI(r,e);return HI(t)?t:void 0}function e2(r){var e=r.match(bI);return e?e[1].split($I):[]}function r2(r,e){var t=e.length,n=t-1;return e[n]=(t>1?"& ":"")+e[n],e=e.join(t>2?", ":" "),r.replace(wI,`{
|
|
25
25
|
/* [wrapped with `+e+`] */
|
|
26
|
-
`)}function
|
|
26
|
+
`)}function t2(r,e){return e=e??pI,!!e&&(typeof r=="number"||II.test(r))&&r>-1&&r%1==0&&r<e}function n2(r){return!!$s&&$s in r}function i2(r,e){for(var t=r.length,n=VI(e.length,t),i=YI(r);n--;){var a=e[n];r[n]=t2(a,t)?i[a]:void 0}return r}var Ps=Os?function(r,e,t){var n=e+"";return Os(r,"toString",{configurable:!0,enumerable:!1,value:p2(r2(n,o2(e2(n),t)))})}:h2;function a2(r){if(r!=null){try{return Es.call(r)}catch{}try{return r+""}catch{}}return""}function o2(r,e){return FI(dI,function(t){var n="_."+t[0];e&t[1]&&!RI(r,n)&&r.push(n)}),r.sort()}var Ei=WI(function(r,e){var t=mi(e,$i(Ei));return QI(r,Ce,void 0,e,t)});function u2(r){var e=nr(r)?As.call(r):"";return e==yI||e==gI}function nr(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}function s2(r){return!!r&&typeof r=="object"}function f2(r){return typeof r=="symbol"||s2(r)&&As.call(r)==vI}function c2(r){if(!r)return r===0?r:0;if(r=l2(r),r===ms||r===-ms){var e=r<0?-1:1;return e*hI}return r===r?r:0}function xs(r){var e=c2(r),t=e%1;return e===e?t?e-t:e:0}function l2(r){if(typeof r=="number")return r;if(f2(r))return ws;if(nr(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=nr(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=r.replace(mI,"");var t=AI.test(r);return t||SI.test(r)?PI(r.slice(2),t?2:8):EI.test(r)?ws:+r}function p2(r){return function(){return r}}function h2(r){return r}Ei.placeholder={};var d2=Ei,Ts=ve(d2);function y2(r,e){return{...di(e,["address_id","external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","status"]),customer_id:parseInt(r,10),shopify_variant_id:e.external_variant_id.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:`${e.charge_interval_frequency}`,order_interval_frequency:`${e.order_interval_frequency}`,status:e.status?e.status.toUpperCase():void 0}}function g2(r,e){return{...di(e,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"]),shopify_variant_id:e.external_variant_id?.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:e.charge_interval_frequency?`${e.charge_interval_frequency}`:void 0,order_interval_frequency:e.order_interval_frequency?`${e.order_interval_frequency}`:void 0,force_update:r}}function Fs(r){const{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:u,charge_interval_frequency:f,created_at:c,expire_after_specific_number_of_charges:l,shopify_product_id:s,shopify_variant_id:p,has_queued_charges:y,is_prepaid:m,is_skippable:A,is_swappable:S,max_retries_reached:b,next_charge_scheduled_at:E,order_day_of_month:h,order_day_of_week:I,order_interval_frequency:T,order_interval_unit:R,presentment_currency:_,price:g,product_title:v,properties:O,quantity:P,sku:M,sku_override:z,status:ye,updated_at:ir,variant_title:ge}=r;return{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:u,charge_interval_frequency:parseInt(f,10),created_at:c,expire_after_specific_number_of_charges:l,external_product_id:{ecommerce:`${s}`},external_variant_id:{ecommerce:`${p}`},has_queued_charges:ns(y),is_prepaid:m,is_skippable:A,is_swappable:S,max_retries_reached:ns(b),next_charge_scheduled_at:E,order_day_of_month:h,order_day_of_week:I,order_interval_frequency:parseInt(T,10),order_interval_unit:R,presentment_currency:_,price:`${g}`,product_title:v??"",properties:O,quantity:P,sku:M,sku_override:z,status:ye.toLowerCase(),updated_at:ir,variant_title:ge}}async function v2(r,e,t){const{subscription:n}=await $("get","/subscriptions",{id:e,query:{include:t?.include}},w(r,"getSubscription"));return n}function _2(r,e){return $("get","/subscriptions",{query:e},w(r,"listSubscriptions"))}async function m2(r,e,t){const{subscription:n}=await $("post","/subscriptions",{data:e,query:t},w(r,"createSubscription"));return n}async function w2(r,e,t,n){const{subscription:i}=await $("put","/subscriptions",{id:e,data:t,query:n},w(r,"updateSubscription"));return i}async function b2(r,e,t,n){const{subscription:i}=await $("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t},query:n},w(r,"updateSubscriptionChargeDate"));return i}async function $2(r,e,t){const{subscription:n}=await $("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},w(r,"updateSubscriptionAddress"));return n}async function E2(r,e,t,n){const{subscription:i}=await $("post",`/subscriptions/${e}/cancel`,{data:t,query:n},w(r,"cancelSubscription"));return i}async function A2(r,e,t){const{subscription:n}=await $("post",`/subscriptions/${e}/activate`,{query:t},w(r,"activateSubscription"));return n}async function O2(r,e,t){const{charge:n}=await $("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},w(r,"skipSubscriptionCharge"));return n}async function S2(r,e,t){const{onetimes:n}=await $("post","/purchase_items/skip_gift",{data:{purchase_item_ids:e.map(Number),recipient_address:t}},w(r,"skipGiftSubscriptionCharge"));return n}async function I2(r,e){const t=e.length;if(t<1||t>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:n}=r;if(!n)throw new Error("No customerId in session.");const i=e[0].address_id;if(!e.every(f=>f.address_id===i))throw new Error("All subscriptions must have the same address_id.");const a=Ts(y2,n),o=e.map(a),{subscriptions:u}=await $("post",`/addresses/${i}/subscriptions-bulk`,{data:{subscriptions:o},headers:{"X-Recharge-Version":"2021-01"}},w(r,"createSubscriptions"));return u.map(Fs)}async function P2(r,e,t,n){const i=t.length;if(i<1||i>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:a}=r;if(!a)throw new Error("No customerId in session.");const o=Ts(g2,!!n?.force_update),u=t.map(o),{subscriptions:f}=await $("put",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:u},headers:{"X-Recharge-Version":"2021-01"}},w(r,"updateSubscriptions"));return f.map(Fs)}var x2=Object.freeze({__proto__:null,activateSubscription:A2,cancelSubscription:E2,createSubscription:m2,createSubscriptions:I2,getSubscription:v2,listSubscriptions:_2,skipGiftSubscriptionCharge:S2,skipSubscriptionCharge:O2,updateSubscription:w2,updateSubscriptionAddress:$2,updateSubscriptionChargeDate:b2,updateSubscriptions:P2});const T2={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 F2(r){if(r)return r;if(window?.Shopify?.shop)return window.Shopify.shop;let e=window?.domain;if(!e){const t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i)?.[1].replace(/-sp$/,"");t&&(e=`${t}.myshopify.com`)}if(e)return e;throw new Error("No storeIdentifier was passed into init.")}function R2(r={}){const e=r,{storefrontAccessToken:t}=r;if(t&&!t.startsWith("strfnt"))throw new Error("Incorrect storefront access token used. See https://storefront.rechargepayments.com/client/docs/getting_started/package_setup/#initialization-- for more information.");Wl({storeIdentifier:F2(r.storeIdentifier),loginRetryFn:r.loginRetryFn,storefrontAccessToken:t,environment:e.environment?e.environment:"prod",environmentUri:e.environmentUri,customerHash:e.customerHash}),fs()}const Rs={init:R2,api:T2,address:ap,auth:yp,bundle:TA,charge:cS,cdn:tS,collection:yS,credit:IS,customer:ES,gift:TS,membership:BS,membershipProgram:LS,metafield:VS,onetime:YS,order:JS,paymentMethod:nI,plan:oI,product:lS,store:sI,subscription:x2};try{Rs.init()}catch{}return Rs});
|