@rechargeapps/storefront-client 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/auth.js +22 -6
- package/dist/cjs/api/auth.js.map +1 -1
- package/dist/cjs/api/charge.js +12 -4
- package/dist/cjs/api/charge.js.map +1 -1
- package/dist/esm/api/auth.js +22 -6
- package/dist/esm/api/auth.js.map +1 -1
- package/dist/esm/api/charge.js +12 -4
- package/dist/esm/api/charge.js.map +1 -1
- package/dist/index.d.ts +41 -37
- package/dist/umd/recharge-client.min.js +10 -10
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
// recharge-client-1.1.
|
|
2
|
-
(function(ne,Ke){typeof exports=="object"&&typeof module<"u"?module.exports=Ke():typeof define=="function"&&define.amd?define(Ke):(ne=typeof globalThis<"u"?globalThis:ne||self,ne.recharge=Ke())})(this,function(){"use strict";var ne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ke(r){var e=r.default;if(typeof e=="function"){var t=function(){return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var L=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof L<"u"&&L,k={searchParams:"URLSearchParams"in L,iterable:"Symbol"in L&&"iterator"in Symbol,blob:"FileReader"in L&&"Blob"in L&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in L,arrayBuffer:"ArrayBuffer"in L};function
|
|
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}Ii.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 D(e.headers),this.url=e.url||"",this._initBody(r)}Ii.call(Y.prototype),Y.prototype.clone=function(){return new Y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new D(this.headers),url:this.url})},Y.error=function(){var r=new Y(null,{status:0,statusText:""});return r.type="error",r};var hf=[301,302,303,307,308];Y.redirect=function(r,e){if(hf.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 Pi(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:pf(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 s(f){try{return f===""&&L.location.href?L.location.href:f}catch{return f}}a.open(i.method,s(i.url),!0),i.credentials==="include"?a.withCredentials=!0:i.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(k.blob?a.responseType="blob":k.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(a.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof D)?Object.getOwnPropertyNames(e.headers).forEach(function(f){a.setRequestHeader(f,kt(e.headers[f]))}):i.headers.forEach(function(f,c){a.setRequestHeader(c,f)}),i.signal&&(i.signal.addEventListener("abort",o),a.onreadystatechange=function(){a.readyState===4&&i.signal.removeEventListener("abort",o)}),a.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}Pi.polyfill=!0,L.fetch||(L.fetch=Pi,L.Headers=D,L.Request=_e,L.Response=Y),self.fetch.bind(self);var df=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},Ti=typeof Symbol<"u"&&Symbol,yf=df,vf=function(){return typeof Ti!="function"||typeof Symbol!="function"||typeof Ti("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:yf()},gf="Function.prototype.bind called on incompatible ",Wt=Array.prototype.slice,_f=Object.prototype.toString,mf="[object Function]",wf=function(e){var t=this;if(typeof t!="function"||_f.call(t)!==mf)throw new TypeError(gf+t);for(var n=Wt.call(arguments,1),i,a=function(){if(this instanceof i){var l=t.apply(this,n.concat(Wt.call(arguments)));return Object(l)===l?l:this}else return t.apply(e,n.concat(Wt.call(arguments)))},o=Math.max(0,t.length-n.length),s=[],f=0;f<o;f++)s.push("$"+f);if(i=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var c=function(){};c.prototype=t.prototype,i.prototype=new c,c.prototype=null}return i},bf=wf,Vt=Function.prototype.bind||bf,$f=Vt,Af=$f.call(Function.call,Object.prototype.hasOwnProperty),T,Fe=SyntaxError,xi=Function,Me=TypeError,Ht=function(r){try{return xi('"use strict"; return ('+r+").constructor;")()}catch{}},we=Object.getOwnPropertyDescriptor;if(we)try{we({},"")}catch{we=null}var zt=function(){throw new Me},Ef=we?function(){try{return arguments.callee,zt}catch{try{return we(arguments,"callee").get}catch{return zt}}}():zt,De=vf(),pe=Object.getPrototypeOf||function(r){return r.__proto__},Be={},Of=typeof Uint8Array>"u"?T:pe(Uint8Array),Ne={"%AggregateError%":typeof AggregateError>"u"?T:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?T:ArrayBuffer,"%ArrayIteratorPrototype%":De?pe([][Symbol.iterator]()):T,"%AsyncFromSyncIteratorPrototype%":T,"%AsyncFunction%":Be,"%AsyncGenerator%":Be,"%AsyncGeneratorFunction%":Be,"%AsyncIteratorPrototype%":Be,"%Atomics%":typeof Atomics>"u"?T:Atomics,"%BigInt%":typeof BigInt>"u"?T:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?T:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?T:Float32Array,"%Float64Array%":typeof Float64Array>"u"?T:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?T:FinalizationRegistry,"%Function%":xi,"%GeneratorFunction%":Be,"%Int8Array%":typeof Int8Array>"u"?T:Int8Array,"%Int16Array%":typeof Int16Array>"u"?T:Int16Array,"%Int32Array%":typeof Int32Array>"u"?T:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":De?pe(pe([][Symbol.iterator]())):T,"%JSON%":typeof JSON=="object"?JSON:T,"%Map%":typeof Map>"u"?T:Map,"%MapIteratorPrototype%":typeof Map>"u"||!De?T:pe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?T:Promise,"%Proxy%":typeof Proxy>"u"?T:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?T:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?T:Set,"%SetIteratorPrototype%":typeof Set>"u"||!De?T:pe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?T:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":De?pe(""[Symbol.iterator]()):T,"%Symbol%":De?Symbol:T,"%SyntaxError%":Fe,"%ThrowTypeError%":Ef,"%TypedArray%":Of,"%TypeError%":Me,"%Uint8Array%":typeof Uint8Array>"u"?T:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?T:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?T:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?T:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?T:WeakMap,"%WeakRef%":typeof WeakRef>"u"?T:WeakRef,"%WeakSet%":typeof WeakSet>"u"?T:WeakSet},Sf=function r(e){var t;if(e==="%AsyncFunction%")t=Ht("async function () {}");else if(e==="%GeneratorFunction%")t=Ht("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Ht("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&(t=pe(i.prototype))}return Ne[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"]},Je=Vt,xr=Af,If=Je.call(Function.call,Array.prototype.concat),Pf=Je.call(Function.apply,Array.prototype.splice),Fi=Je.call(Function.call,String.prototype.replace),Rr=Je.call(Function.call,String.prototype.slice),Tf=Je.call(Function.call,RegExp.prototype.exec),xf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Rf=/\\(\\)?/g,Ff=function(e){var t=Rr(e,0,1),n=Rr(e,-1);if(t==="%"&&n!=="%")throw new Fe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Fe("invalid intrinsic syntax, expected opening `%`");var i=[];return Fi(e,xf,function(a,o,s,f){i[i.length]=s?Fi(f,Rf,"$1"):o||a}),i},Mf=function(e,t){var n=e,i;if(xr(Ri,n)&&(i=Ri[n],n="%"+i[0]+"%"),xr(Ne,n)){var a=Ne[n];if(a===Be&&(a=Sf(n)),typeof a>"u"&&!t)throw new Me("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Fe("intrinsic "+e+" does not exist!")},Xt=function(e,t){if(typeof e!="string"||e.length===0)throw new Me("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Me('"allowMissing" argument must be a boolean');if(Tf(/^%?[^%]*%?$/,e)===null)throw new Fe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Ff(e),i=n.length>0?n[0]:"",a=Mf("%"+i+"%",t),o=a.name,s=a.value,f=!1,c=a.alias;c&&(i=c[0],Pf(n,If([0,1],c)));for(var l=1,u=!0;l<n.length;l+=1){var p=n[l],d=Rr(p,0,1),_=Rr(p,-1);if((d==='"'||d==="'"||d==="`"||_==='"'||_==="'"||_==="`")&&d!==_)throw new Fe("property names with quotes must have matching quotes");if((p==="constructor"||!u)&&(f=!0),i+="."+p,o="%"+i+"%",xr(Ne,o))s=Ne[o];else if(s!=null){if(!(p in s)){if(!t)throw new Me("base intrinsic for "+e+" exists, but the property is not available.");return}if(we&&l+1>=n.length){var $=we(s,p);u=!!$,u&&"get"in $&&!("originalValue"in $.get)?s=$.get:s=s[p]}else u=xr(s,p),s=s[p];u&&!f&&(Ne[o]=s)}}return s},Mi={exports:{}};(function(r){var e=Vt,t=Xt,n=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(i,n),o=t("%Object.getOwnPropertyDescriptor%",!0),s=t("%Object.defineProperty%",!0),f=t("%Math.max%");if(s)try{s({},"a",{value:1})}catch{s=null}r.exports=function(u){var p=a(e,i,arguments);if(o&&s){var d=o(p,"length");d.configurable&&s(p,"length",{value:1+f(0,u.length-(arguments.length-1))})}return p};var c=function(){return a(e,n,arguments)};s?s(r.exports,"apply",{value:c}):r.exports.apply=c})(Mi);var Di=Xt,Bi=Mi.exports,Df=Bi(Di("String.prototype.indexOf")),Bf=function(e,t){var n=Di(e,!!t);return typeof n=="function"&&Df(e,".prototype.")>-1?Bi(n):n},Ue=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},K=[],W=[],Nf=typeof Uint8Array<"u"?Uint8Array:Array,Yt=!1;function Ni(){Yt=!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 Uf(r){Yt||Ni();var e,t,n,i,a,o,s=r.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[s-2]==="="?2:r[s-1]==="="?1:0,o=new Nf(s*3/4-a),n=a>0?s-4:s;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)i=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 Cf(r){return K[r>>18&63]+K[r>>12&63]+K[r>>6&63]+K[r&63]}function Lf(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(Cf(n));return i.join("")}function Ui(r){Yt||Ni();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,s=0,f=t-n;s<f;s+=o)a.push(Lf(r,s,s+o>f?f:s+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 Fr(r,e,t,n,i){var a,o,s=i*8-n-1,f=(1<<s)-1,c=f>>1,l=-7,u=t?i-1:0,p=t?-1:1,d=r[e+u];for(u+=p,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=a*256+r[e+u],u+=p,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=o*256+r[e+u],u+=p,l-=8);if(a===0)a=1-c;else{if(a===f)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-c}return(d?-1:1)*o*Math.pow(2,a-n)}function Ci(r,e,t,n,i,a){var o,s,f,c=a*8-i-1,l=(1<<c)-1,u=l>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,_=n?1:-1,$=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+u>=1?e+=p/f:e+=p*Math.pow(2,1-u),e*f>=2&&(o++,f/=2),o+u>=l?(s=0,o=l):o+u>=1?(s=(e*f-1)*Math.pow(2,i),o=o+u):(s=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+d]=s&255,d+=_,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;r[t+d]=o&255,d+=_,o/=256,c-=8);r[t+d-_]|=$*128}var jf={}.toString,Li=Array.isArray||function(r){return jf.call(r)=="[object Array]"};/*!
|
|
1
|
+
// recharge-client-1.2.1.min.js | MIT License | © Recharge Inc.
|
|
2
|
+
(function(ne,Ke){typeof exports=="object"&&typeof module<"u"?module.exports=Ke():typeof define=="function"&&define.amd?define(Ke):(ne=typeof globalThis<"u"?globalThis:ne||self,ne.recharge=Ke())})(this,function(){"use strict";var ne=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ke(r){var e=r.default;if(typeof e=="function"){var t=function(){return e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var L=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof L<"u"&&L,k={searchParams:"URLSearchParams"in L,iterable:"Symbol"in L&&"iterator"in Symbol,blob:"FileReader"in L&&"Blob"in L&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in L,arrayBuffer:"ArrayBuffer"in L};function of(r){return r&&DataView.prototype.isPrototypeOf(r)}if(k.arrayBuffer)var uf=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],sf=ArrayBuffer.isView||function(r){return r&&uf.indexOf(Object.prototype.toString.call(r))>-1};function Ze(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 kt(r){return typeof r!="string"&&(r=String(r)),r}function qt(r){var e={next:function(){var t=r.shift();return{done:t===void 0,value:t}}};return k.iterable&&(e[Symbol.iterator]=function(){return e}),e}function D(r){this.map={},r instanceof D?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)}D.prototype.append=function(r,e){r=Ze(r),e=kt(e);var t=this.map[r];this.map[r]=t?t+", "+e:e},D.prototype.delete=function(r){delete this.map[Ze(r)]},D.prototype.get=function(r){return r=Ze(r),this.has(r)?this.map[r]:null},D.prototype.has=function(r){return this.map.hasOwnProperty(Ze(r))},D.prototype.set=function(r,e){this.map[Ze(r)]=kt(e)},D.prototype.forEach=function(r,e){for(var t in this.map)this.map.hasOwnProperty(t)&&r.call(e,this.map[t],t,this)},D.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),qt(r)},D.prototype.values=function(){var r=[];return this.forEach(function(e){r.push(e)}),qt(r)},D.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),qt(r)},k.iterable&&(D.prototype[Symbol.iterator]=D.prototype.entries);function Gt(r){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}function Oi(r){return new Promise(function(e,t){r.onload=function(){e(r.result)},r.onerror=function(){t(r.error)}})}function ff(r){var e=new FileReader,t=Oi(e);return e.readAsArrayBuffer(r),t}function cf(r){var e=new FileReader,t=Oi(e);return e.readAsText(r),t}function lf(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 Si(r){if(r.slice)return r.slice(0);var e=new Uint8Array(r.byteLength);return e.set(new Uint8Array(r)),e.buffer}function Pi(){return this.bodyUsed=!1,this._initBody=function(r){this.bodyUsed=this.bodyUsed,this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:k.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:k.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:k.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():k.arrayBuffer&&k.blob&&of(r)?(this._bodyArrayBuffer=Si(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):k.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||sf(r))?this._bodyArrayBuffer=Si(r):this._bodyText=r=Object.prototype.toString.call(r):this._bodyText="",this.headers.get("content-type")||(typeof r=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):k.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},k.blob&&(this.blob=function(){var r=Gt(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=Gt(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(ff)}),this.text=function(){var r=Gt(this);if(r)return r;if(this._bodyBlob)return cf(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(lf(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},k.formData&&(this.formData=function(){return this.text().then(df)}),this.json=function(){return this.text().then(JSON.parse)},this}var pf=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function hf(r){var e=r.toUpperCase();return pf.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 D(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 D(e.headers)),this.method=hf(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 df(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 yf(r){var e=new D,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}Pi.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 D(e.headers),this.url=e.url||"",this._initBody(r)}Pi.call(Y.prototype),Y.prototype.clone=function(){return new Y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new D(this.headers),url:this.url})},Y.error=function(){var r=new Y(null,{status:0,statusText:""});return r.type="error",r};var vf=[301,302,303,307,308];Y.redirect=function(r,e){if(vf.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:yf(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 s(f){try{return f===""&&L.location.href?L.location.href:f}catch{return f}}a.open(i.method,s(i.url),!0),i.credentials==="include"?a.withCredentials=!0:i.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(k.blob?a.responseType="blob":k.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(a.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof D)?Object.getOwnPropertyNames(e.headers).forEach(function(f){a.setRequestHeader(f,kt(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=D,L.Request=_e,L.Response=Y),self.fetch.bind(self);var gf=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},Ti=typeof Symbol<"u"&&Symbol,_f=gf,mf=function(){return typeof Ti!="function"||typeof Symbol!="function"||typeof Ti("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:_f()},wf="Function.prototype.bind called on incompatible ",Wt=Array.prototype.slice,bf=Object.prototype.toString,$f="[object Function]",Af=function(e){var t=this;if(typeof t!="function"||bf.call(t)!==$f)throw new TypeError(wf+t);for(var n=Wt.call(arguments,1),i,a=function(){if(this instanceof i){var l=t.apply(this,n.concat(Wt.call(arguments)));return Object(l)===l?l:this}else return t.apply(e,n.concat(Wt.call(arguments)))},o=Math.max(0,t.length-n.length),s=[],f=0;f<o;f++)s.push("$"+f);if(i=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var c=function(){};c.prototype=t.prototype,i.prototype=new c,c.prototype=null}return i},Ef=Af,Vt=Function.prototype.bind||Ef,Of=Vt,Sf=Of.call(Function.call,Object.prototype.hasOwnProperty),T,Fe=SyntaxError,xi=Function,Me=TypeError,Ht=function(r){try{return xi('"use strict"; return ('+r+").constructor;")()}catch{}},we=Object.getOwnPropertyDescriptor;if(we)try{we({},"")}catch{we=null}var zt=function(){throw new Me},Pf=we?function(){try{return arguments.callee,zt}catch{try{return we(arguments,"callee").get}catch{return zt}}}():zt,De=mf(),pe=Object.getPrototypeOf||function(r){return r.__proto__},Be={},If=typeof Uint8Array>"u"?T:pe(Uint8Array),Ne={"%AggregateError%":typeof AggregateError>"u"?T:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?T:ArrayBuffer,"%ArrayIteratorPrototype%":De?pe([][Symbol.iterator]()):T,"%AsyncFromSyncIteratorPrototype%":T,"%AsyncFunction%":Be,"%AsyncGenerator%":Be,"%AsyncGeneratorFunction%":Be,"%AsyncIteratorPrototype%":Be,"%Atomics%":typeof Atomics>"u"?T:Atomics,"%BigInt%":typeof BigInt>"u"?T:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?T:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?T:Float32Array,"%Float64Array%":typeof Float64Array>"u"?T:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?T:FinalizationRegistry,"%Function%":xi,"%GeneratorFunction%":Be,"%Int8Array%":typeof Int8Array>"u"?T:Int8Array,"%Int16Array%":typeof Int16Array>"u"?T:Int16Array,"%Int32Array%":typeof Int32Array>"u"?T:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":De?pe(pe([][Symbol.iterator]())):T,"%JSON%":typeof JSON=="object"?JSON:T,"%Map%":typeof Map>"u"?T:Map,"%MapIteratorPrototype%":typeof Map>"u"||!De?T:pe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?T:Promise,"%Proxy%":typeof Proxy>"u"?T:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?T:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?T:Set,"%SetIteratorPrototype%":typeof Set>"u"||!De?T:pe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?T:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":De?pe(""[Symbol.iterator]()):T,"%Symbol%":De?Symbol:T,"%SyntaxError%":Fe,"%ThrowTypeError%":Pf,"%TypedArray%":If,"%TypeError%":Me,"%Uint8Array%":typeof Uint8Array>"u"?T:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?T:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?T:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?T:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?T:WeakMap,"%WeakRef%":typeof WeakRef>"u"?T:WeakRef,"%WeakSet%":typeof WeakSet>"u"?T:WeakSet},Tf=function r(e){var t;if(e==="%AsyncFunction%")t=Ht("async function () {}");else if(e==="%GeneratorFunction%")t=Ht("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Ht("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&(t=pe(i.prototype))}return Ne[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"]},Je=Vt,xr=Sf,xf=Je.call(Function.call,Array.prototype.concat),Rf=Je.call(Function.apply,Array.prototype.splice),Fi=Je.call(Function.call,String.prototype.replace),Rr=Je.call(Function.call,String.prototype.slice),Ff=Je.call(Function.call,RegExp.prototype.exec),Mf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Df=/\\(\\)?/g,Bf=function(e){var t=Rr(e,0,1),n=Rr(e,-1);if(t==="%"&&n!=="%")throw new Fe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Fe("invalid intrinsic syntax, expected opening `%`");var i=[];return Fi(e,Mf,function(a,o,s,f){i[i.length]=s?Fi(f,Df,"$1"):o||a}),i},Nf=function(e,t){var n=e,i;if(xr(Ri,n)&&(i=Ri[n],n="%"+i[0]+"%"),xr(Ne,n)){var a=Ne[n];if(a===Be&&(a=Tf(n)),typeof a>"u"&&!t)throw new Me("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Fe("intrinsic "+e+" does not exist!")},Xt=function(e,t){if(typeof e!="string"||e.length===0)throw new Me("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Me('"allowMissing" argument must be a boolean');if(Ff(/^%?[^%]*%?$/,e)===null)throw new Fe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Bf(e),i=n.length>0?n[0]:"",a=Nf("%"+i+"%",t),o=a.name,s=a.value,f=!1,c=a.alias;c&&(i=c[0],Rf(n,xf([0,1],c)));for(var l=1,u=!0;l<n.length;l+=1){var p=n[l],d=Rr(p,0,1),_=Rr(p,-1);if((d==='"'||d==="'"||d==="`"||_==='"'||_==="'"||_==="`")&&d!==_)throw new Fe("property names with quotes must have matching quotes");if((p==="constructor"||!u)&&(f=!0),i+="."+p,o="%"+i+"%",xr(Ne,o))s=Ne[o];else if(s!=null){if(!(p in s)){if(!t)throw new Me("base intrinsic for "+e+" exists, but the property is not available.");return}if(we&&l+1>=n.length){var $=we(s,p);u=!!$,u&&"get"in $&&!("originalValue"in $.get)?s=$.get:s=s[p]}else u=xr(s,p),s=s[p];u&&!f&&(Ne[o]=s)}}return s},Mi={exports:{}};(function(r){var e=Vt,t=Xt,n=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(i,n),o=t("%Object.getOwnPropertyDescriptor%",!0),s=t("%Object.defineProperty%",!0),f=t("%Math.max%");if(s)try{s({},"a",{value:1})}catch{s=null}r.exports=function(u){var p=a(e,i,arguments);if(o&&s){var d=o(p,"length");d.configurable&&s(p,"length",{value:1+f(0,u.length-(arguments.length-1))})}return p};var c=function(){return a(e,n,arguments)};s?s(r.exports,"apply",{value:c}):r.exports.apply=c})(Mi);var Di=Xt,Bi=Mi.exports,Uf=Bi(Di("String.prototype.indexOf")),Cf=function(e,t){var n=Di(e,!!t);return typeof n=="function"&&Uf(e,".prototype.")>-1?Bi(n):n},Ue=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},K=[],W=[],Lf=typeof Uint8Array<"u"?Uint8Array:Array,Yt=!1;function Ni(){Yt=!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 jf(r){Yt||Ni();var e,t,n,i,a,o,s=r.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[s-2]==="="?2:r[s-1]==="="?1:0,o=new Lf(s*3/4-a),n=a>0?s-4:s;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)i=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 kf(r){return K[r>>18&63]+K[r>>12&63]+K[r>>6&63]+K[r&63]}function qf(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(kf(n));return i.join("")}function Ui(r){Yt||Ni();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,s=0,f=t-n;s<f;s+=o)a.push(qf(r,s,s+o>f?f:s+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 Fr(r,e,t,n,i){var a,o,s=i*8-n-1,f=(1<<s)-1,c=f>>1,l=-7,u=t?i-1:0,p=t?-1:1,d=r[e+u];for(u+=p,a=d&(1<<-l)-1,d>>=-l,l+=s;l>0;a=a*256+r[e+u],u+=p,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=o*256+r[e+u],u+=p,l-=8);if(a===0)a=1-c;else{if(a===f)return o?NaN:(d?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-c}return(d?-1:1)*o*Math.pow(2,a-n)}function Ci(r,e,t,n,i,a){var o,s,f,c=a*8-i-1,l=(1<<c)-1,u=l>>1,p=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,_=n?1:-1,$=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+u>=1?e+=p/f:e+=p*Math.pow(2,1-u),e*f>=2&&(o++,f/=2),o+u>=l?(s=0,o=l):o+u>=1?(s=(e*f-1)*Math.pow(2,i),o=o+u):(s=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+d]=s&255,d+=_,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;r[t+d]=o&255,d+=_,o/=256,c-=8);r[t+d-_]|=$*128}var Gf={}.toString,Li=Array.isArray||function(r){return Gf.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 kf=50;y.TYPED_ARRAY_SUPPORT=Ue.TYPED_ARRAY_SUPPORT!==void 0?Ue.TYPED_ARRAY_SUPPORT:!0,Mr();function Mr(){return y.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ie(r,e){if(Mr()<e)throw new RangeError("Invalid typed array length");return y.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=y.prototype):(r===null&&(r=new y(e)),r.length=e),r}function y(r,e,t){if(!y.TYPED_ARRAY_SUPPORT&&!(this instanceof y))return new y(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 Kt(this,r)}return ji(this,r,e,t)}y.poolSize=8192,y._augment=function(r){return r.__proto__=y.prototype,r};function ji(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?Wf(r,e,t,n):typeof e=="string"?Gf(r,e,t):Vf(r,e)}y.from=function(r,e,t){return ji(null,r,e,t)},y.TYPED_ARRAY_SUPPORT&&(y.prototype.__proto__=Uint8Array.prototype,y.__proto__=Uint8Array);function ki(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 qf(r,e,t,n){return ki(e),e<=0?ie(r,e):t!==void 0?typeof n=="string"?ie(r,e).fill(t,n):ie(r,e).fill(t):ie(r,e)}y.alloc=function(r,e,t){return qf(null,r,e,t)};function Kt(r,e){if(ki(e),r=ie(r,e<0?0:Jt(e)|0),!y.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}y.allocUnsafe=function(r){return Kt(null,r)},y.allocUnsafeSlow=function(r){return Kt(null,r)};function Gf(r,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!y.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=qi(e,t)|0;r=ie(r,n);var i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function Zt(r,e){var t=e.length<0?0:Jt(e.length)|0;r=ie(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function Wf(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),y.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=y.prototype):r=Zt(r,e),r}function Vf(r,e){if(Z(e)){var t=Jt(e.length)|0;return r=ie(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"||cc(e.length)?ie(r,0):Zt(r,e);if(e.type==="Buffer"&&Li(e.data))return Zt(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Jt(r){if(r>=Mr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Mr().toString(16)+" bytes");return r|0}y.isBuffer=lc;function Z(r){return!!(r!=null&&r._isBuffer)}y.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},y.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}},y.concat=function(e,t){if(!Li(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return y.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=y.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 qi(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 Nr(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Zi(r).length;default:if(n)return Nr(r).length;e=(""+e).toLowerCase(),n=!0}}y.byteLength=qi;function Hf(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 tc(this,e,t);case"utf8":case"utf-8":return Hi(this,e,t);case"ascii":return ec(this,e,t);case"latin1":case"binary":return rc(this,e,t);case"base64":return Jf(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nc(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}y.prototype._isBuffer=!0;function be(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}y.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)be(this,t,t+1);return this},y.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)be(this,t,t+3),be(this,t+1,t+2);return this},y.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)be(this,t,t+7),be(this,t+1,t+6),be(this,t+2,t+5),be(this,t+3,t+4);return this},y.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Hi(this,0,e):Hf.apply(this,arguments)},y.prototype.equals=function(e){if(!Z(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:y.compare(this,e)===0},y.prototype.inspect=function(){var e="",t=kf;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},y.prototype.compare=function(e,t,n,i,a){if(!Z(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),t<0||n>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=n)return 0;if(i>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,a>>>=0,this===e)return 0;for(var o=a-i,s=n-t,f=Math.min(o,s),c=this.slice(i,a),l=e.slice(t,n),u=0;u<f;++u)if(c[u]!==l[u]){o=c[u],s=l[u];break}return o<s?-1:s<o?1:0};function 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=y.from(e,n)),Z(e))return e.length===0?-1:Wi(r,e,t,n,i);if(typeof e=="number")return e=e&255,y.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Wi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Wi(r,e,t,n,i){var a=1,o=r.length,s=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;a=2,o/=2,s/=2,t/=2}function f(d,_){return a===1?d[_]:d.readUInt16BE(_*a)}var c;if(i){var l=-1;for(c=t;c<o;c++)if(f(r,c)===f(e,l===-1?0:c-l)){if(l===-1&&(l=c),c-l+1===s)return l*a}else l!==-1&&(c-=c-l),l=-1}else for(t+s>o&&(t=o-s),c=t;c>=0;c--){for(var u=!0,p=0;p<s;p++)if(f(r,c+p)!==f(e,p)){u=!1;break}if(u)return c}return-1}y.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},y.prototype.indexOf=function(e,t,n){return Gi(this,e,t,n,!0)},y.prototype.lastIndexOf=function(e,t,n){return Gi(this,e,t,n,!1)};function zf(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(o*2,2),16);if(isNaN(s))return o;r[t+o]=s}return o}function Xf(r,e,t,n){return Ur(Nr(e,r.length-t),r,t,n)}function Vi(r,e,t,n){return Ur(sc(e),r,t,n)}function Yf(r,e,t,n){return Vi(r,e,t,n)}function Kf(r,e,t,n){return Ur(Zi(e),r,t,n)}function Zf(r,e,t,n){return Ur(fc(e,r.length-t),r,t,n)}y.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 zf(this,e,t,n);case"utf8":case"utf-8":return Xf(this,e,t,n);case"ascii":return Vi(this,e,t,n);case"latin1":case"binary":return Yf(this,e,t,n);case"base64":return Kf(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Zf(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Jf(r,e,t){return e===0&&t===r.length?Ui(r):Ui(r.slice(e,t))}function Hi(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var a=r[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=t){var f,c,l,u;switch(s){case 1:a<128&&(o=a);break;case 2:f=r[i+1],(f&192)===128&&(u=(a&31)<<6|f&63,u>127&&(o=u));break;case 3:f=r[i+1],c=r[i+2],(f&192)===128&&(c&192)===128&&(u=(a&15)<<12|(f&63)<<6|c&63,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:f=r[i+1],c=r[i+2],l=r[i+3],(f&192)===128&&(c&192)===128&&(l&192)===128&&(u=(a&15)<<18|(f&63)<<12|(c&63)<<6|l&63,u>65535&&u<1114112&&(o=u))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return Qf(n)}var zi=4096;function Qf(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 ec(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 rc(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 tc(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+=uc(r[a]);return i}function nc(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}y.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(y.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=y.prototype;else{var a=t-e;i=new y(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+e]}return i};function N(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")}y.prototype.readUIntLE=function(e,t,n){e=e|0,t=t|0,n||N(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return i},y.prototype.readUIntBE=function(e,t,n){e=e|0,t=t|0,n||N(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},y.prototype.readUInt8=function(e,t){return t||N(e,1,this.length),this[e]},y.prototype.readUInt16LE=function(e,t){return t||N(e,2,this.length),this[e]|this[e+1]<<8},y.prototype.readUInt16BE=function(e,t){return t||N(e,2,this.length),this[e]<<8|this[e+1]},y.prototype.readUInt32LE=function(e,t){return t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},y.prototype.readUInt32BE=function(e,t){return t||N(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},y.prototype.readIntLE=function(e,t,n){e=e|0,t=t|0,n||N(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},y.prototype.readIntBE=function(e,t,n){e=e|0,t=t|0,n||N(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},y.prototype.readInt8=function(e,t){return t||N(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},y.prototype.readInt16LE=function(e,t){t||N(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},y.prototype.readInt16BE=function(e,t){t||N(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},y.prototype.readInt32LE=function(e,t){return t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},y.prototype.readInt32BE=function(e,t){return t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},y.prototype.readFloatLE=function(e,t){return t||N(e,4,this.length),Fr(this,e,!0,23,4)},y.prototype.readFloatBE=function(e,t){return t||N(e,4,this.length),Fr(this,e,!1,23,4)},y.prototype.readDoubleLE=function(e,t){return t||N(e,8,this.length),Fr(this,e,!0,52,8)},y.prototype.readDoubleBE=function(e,t){return t||N(e,8,this.length),Fr(this,e,!1,52,8)};function q(r,e,t,n,i,a){if(!Z(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}y.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;q(this,e,t,n,a,0)}var o=1,s=0;for(this[t]=e&255;++s<n&&(o*=256);)this[t+s]=e/o&255;return t+n},y.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;q(this,e,t,n,a,0)}var o=n-1,s=1;for(this[t+o]=e&255;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+n},y.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,1,255,0),y.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function Dr(r,e,t,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(r.length-t,2);i<a;++i)r[t+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}y.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Dr(this,e,t,!0),t+2},y.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Dr(this,e,t,!1),t+2};function Br(r,e,t,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(r.length-t,4);i<a;++i)r[t+i]=e>>>(n?i:3-i)*8&255}y.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):Br(this,e,t,!0),t+4},y.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Br(this,e,t,!1),t+4},y.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);q(this,e,t,n,a-1,-a)}var o=0,s=1,f=0;for(this[t]=e&255;++o<n&&(s*=256);)e<0&&f===0&&this[t+o-1]!==0&&(f=1),this[t+o]=(e/s>>0)-f&255;return t+n},y.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);q(this,e,t,n,a-1,-a)}var o=n-1,s=1,f=0;for(this[t+o]=e&255;--o>=0&&(s*=256);)e<0&&f===0&&this[t+o+1]!==0&&(f=1),this[t+o]=(e/s>>0)-f&255;return t+n},y.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,1,127,-128),y.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1},y.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Dr(this,e,t,!0),t+2},y.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Dr(this,e,t,!1),t+2},y.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,2147483647,-2147483648),y.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Br(this,e,t,!0),t+4},y.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Br(this,e,t,!1),t+4};function Xi(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 Yi(r,e,t,n,i){return i||Xi(r,e,t,4),Ci(r,e,t,n,23,4),t+4}y.prototype.writeFloatLE=function(e,t,n){return Yi(this,e,t,!0,n)},y.prototype.writeFloatBE=function(e,t,n){return Yi(this,e,t,!1,n)};function Ki(r,e,t,n,i){return i||Xi(r,e,t,8),Ci(r,e,t,n,52,8),t+8}y.prototype.writeDoubleLE=function(e,t,n){return Ki(this,e,t,!0,n)},y.prototype.writeDoubleBE=function(e,t,n){return Ki(this,e,t,!1,n)},y.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||!y.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},y.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"&&!y.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{var s=Z(e)?e:Nr(new y(e,i).toString()),f=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%f]}return this};var ic=/[^+\/0-9A-Za-z-_]/g;function ac(r){if(r=oc(r).replace(ic,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function oc(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function uc(r){return r<16?"0"+r.toString(16):r.toString(16)}function Nr(r,e){e=e||1/0;for(var t,n=r.length,i=null,a=[],o=0;o<n;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&a.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;a.push(t)}else if(t<2048){if((e-=2)<0)break;a.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;a.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;a.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return a}function sc(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function fc(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 Zi(r){return Uf(ac(r))}function Ur(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}function cc(r){return r!==r}function lc(r){return r!=null&&(!!r._isBuffer||Ji(r)||pc(r))}function Ji(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function pc(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Ji(r.slice(0,0))}function Qi(){throw new Error("setTimeout has not been defined")}function ea(){throw new Error("clearTimeout has not been defined")}var he=Qi,de=ea;typeof Ue.setTimeout=="function"&&(he=setTimeout),typeof Ue.clearTimeout=="function"&&(de=clearTimeout);function ra(r){if(he===setTimeout)return setTimeout(r,0);if((he===Qi||!he)&&setTimeout)return he=setTimeout,setTimeout(r,0);try{return he(r,0)}catch{try{return he.call(null,r,0)}catch{return he.call(this,r,0)}}}function hc(r){if(de===clearTimeout)return clearTimeout(r);if((de===ea||!de)&&clearTimeout)return de=clearTimeout,clearTimeout(r);try{return de(r)}catch{try{return de.call(null,r)}catch{return de.call(this,r)}}}var ae=[],Ce=!1,$e,Cr=-1;function dc(){!Ce||!$e||(Ce=!1,$e.length?ae=$e.concat(ae):Cr=-1,ae.length&&ta())}function ta(){if(!Ce){var r=ra(dc);Ce=!0;for(var e=ae.length;e;){for($e=ae,ae=[];++Cr<e;)$e&&$e[Cr].run();Cr=-1,e=ae.length}$e=null,Ce=!1,hc(r)}}function yc(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];ae.push(new na(r,e)),ae.length===1&&!Ce&&ra(ta)}function na(r,e){this.fun=r,this.array=e}na.prototype.run=function(){this.fun.apply(null,this.array)};var vc="browser",gc="browser",_c=!0,mc={},wc=[],bc="",$c={},Ac={},Ec={};function Ae(){}var Oc=Ae,Sc=Ae,Ic=Ae,Pc=Ae,Tc=Ae,xc=Ae,Rc=Ae;function Fc(r){throw new Error("process.binding is not supported")}function Mc(){return"/"}function Dc(r){throw new Error("process.chdir is not supported")}function Bc(){return 0}var Le=Ue.performance||{},Nc=Le.now||Le.mozNow||Le.msNow||Le.oNow||Le.webkitNow||function(){return new Date().getTime()};function Uc(r){var e=Nc.call(Le)*.001,t=Math.floor(e),n=Math.floor(e%1*1e9);return r&&(t=t-r[0],n=n-r[1],n<0&&(t--,n+=1e9)),[t,n]}var Cc=new Date;function Lc(){var r=new Date,e=r-Cc;return e/1e3}var Lr={nextTick:yc,title:vc,browser:_c,env:mc,argv:wc,version:bc,versions:$c,on:Oc,addListener:Sc,once:Ic,off:Pc,removeListener:Tc,removeAllListeners:xc,emit:Rc,binding:Fc,cwd:Mc,chdir:Dc,umask:Bc,hrtime:Uc,platform:gc,release:Ac,config:Ec,uptime:Lc},Qt;typeof Object.create=="function"?Qt=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:Qt=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var ia=Qt,jc=/%[sdj%]/g;function jr(r){if(!er(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(jc,function(s){if(s==="%%")return"%";if(t>=i)return s;switch(s){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch{return"[Circular]"}default:return s}}),o=n[t];t<i;o=n[++t])Qe(o)||!Ee(o)?a+=" "+o:a+=" "+J(o);return a}function en(r,e){if(Q(Ue.process))return function(){return en(r,e).apply(this,arguments)};if(Lr.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(Lr.throwDeprecation)throw new Error(e);Lr.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n}var kr={},rn;function aa(r){if(Q(rn)&&(rn=Lr.env.NODE_DEBUG||""),r=r.toUpperCase(),!kr[r])if(new RegExp("\\b"+r+"\\b","i").test(rn)){var e=0;kr[r]=function(){var t=jr.apply(null,arguments);console.error("%s %d: %s",r,e,t)}}else kr[r]=function(){};return kr[r]}function J(r,e){var t={seen:[],stylize:qc};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),Gr(e)?t.showHidden=e:e&&fn(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=kc),qr(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 kc(r,e){var t=J.styles[e];return t?"\x1B["+J.colors[t][0]+"m"+r+"\x1B["+J.colors[t][1]+"m":r}function qc(r,e){return r}function Gc(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function qr(r,e,t){if(r.customInspect&&e&&nr(e.inspect)&&e.inspect!==J&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return er(n)||(n=qr(r,n,t)),n}var i=Wc(r,e);if(i)return i;var a=Object.keys(e),o=Gc(a);if(r.showHidden&&(a=Object.getOwnPropertyNames(e)),tr(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return tn(e);if(a.length===0){if(nr(e)){var s=e.name?": "+e.name:"";return r.stylize("[Function"+s+"]","special")}if(rr(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(Wr(e))return r.stylize(Date.prototype.toString.call(e),"date");if(tr(e))return tn(e)}var f="",c=!1,l=["{","}"];if(an(e)&&(c=!0,l=["[","]"]),nr(e)){var u=e.name?": "+e.name:"";f=" [Function"+u+"]"}if(rr(e)&&(f=" "+RegExp.prototype.toString.call(e)),Wr(e)&&(f=" "+Date.prototype.toUTCString.call(e)),tr(e)&&(f=" "+tn(e)),a.length===0&&(!c||e.length==0))return l[0]+f+l[1];if(t<0)return rr(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special");r.seen.push(e);var p;return c?p=Vc(r,e,t,o,a):p=a.map(function(d){return nn(r,e,t,o,d,c)}),r.seen.pop(),Hc(p,f,l)}function Wc(r,e){if(Q(e))return r.stylize("undefined","undefined");if(er(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if(on(e))return r.stylize(""+e,"number");if(Gr(e))return r.stylize(""+e,"boolean");if(Qe(e))return r.stylize("null","null")}function tn(r){return"["+Error.prototype.toString.call(r)+"]"}function Vc(r,e,t,n,i){for(var a=[],o=0,s=e.length;o<s;++o)la(e,String(o))?a.push(nn(r,e,t,n,String(o),!0)):a.push("");return i.forEach(function(f){f.match(/^\d+$/)||a.push(nn(r,e,t,n,f,!0))}),a}function nn(r,e,t,n,i,a){var o,s,f;if(f=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},f.get?f.set?s=r.stylize("[Getter/Setter]","special"):s=r.stylize("[Getter]","special"):f.set&&(s=r.stylize("[Setter]","special")),la(n,i)||(o="["+i+"]"),s||(r.seen.indexOf(f.value)<0?(Qe(t)?s=qr(r,f.value,null):s=qr(r,f.value,t-1),s.indexOf(`
|
|
8
|
+
*/var Wf=50;y.TYPED_ARRAY_SUPPORT=Ue.TYPED_ARRAY_SUPPORT!==void 0?Ue.TYPED_ARRAY_SUPPORT:!0,Mr();function Mr(){return y.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ie(r,e){if(Mr()<e)throw new RangeError("Invalid typed array length");return y.TYPED_ARRAY_SUPPORT?(r=new Uint8Array(e),r.__proto__=y.prototype):(r===null&&(r=new y(e)),r.length=e),r}function y(r,e,t){if(!y.TYPED_ARRAY_SUPPORT&&!(this instanceof y))return new y(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 Kt(this,r)}return ji(this,r,e,t)}y.poolSize=8192,y._augment=function(r){return r.__proto__=y.prototype,r};function ji(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?zf(r,e,t,n):typeof e=="string"?Hf(r,e,t):Xf(r,e)}y.from=function(r,e,t){return ji(null,r,e,t)},y.TYPED_ARRAY_SUPPORT&&(y.prototype.__proto__=Uint8Array.prototype,y.__proto__=Uint8Array);function ki(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 Vf(r,e,t,n){return ki(e),e<=0?ie(r,e):t!==void 0?typeof n=="string"?ie(r,e).fill(t,n):ie(r,e).fill(t):ie(r,e)}y.alloc=function(r,e,t){return Vf(null,r,e,t)};function Kt(r,e){if(ki(e),r=ie(r,e<0?0:Jt(e)|0),!y.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)r[t]=0;return r}y.allocUnsafe=function(r){return Kt(null,r)},y.allocUnsafeSlow=function(r){return Kt(null,r)};function Hf(r,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!y.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=qi(e,t)|0;r=ie(r,n);var i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function Zt(r,e){var t=e.length<0?0:Jt(e.length)|0;r=ie(r,t);for(var n=0;n<t;n+=1)r[n]=e[n]&255;return r}function zf(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),y.TYPED_ARRAY_SUPPORT?(r=e,r.__proto__=y.prototype):r=Zt(r,e),r}function Xf(r,e){if(Z(e)){var t=Jt(e.length)|0;return r=ie(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"||hc(e.length)?ie(r,0):Zt(r,e);if(e.type==="Buffer"&&Li(e.data))return Zt(r,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Jt(r){if(r>=Mr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Mr().toString(16)+" bytes");return r|0}y.isBuffer=dc;function Z(r){return!!(r!=null&&r._isBuffer)}y.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},y.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}},y.concat=function(e,t){if(!Li(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return y.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var i=y.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 qi(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 Nr(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Zi(r).length;default:if(n)return Nr(r).length;e=(""+e).toLowerCase(),n=!0}}y.byteLength=qi;function Yf(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 ac(this,e,t);case"utf8":case"utf-8":return Hi(this,e,t);case"ascii":return nc(this,e,t);case"latin1":case"binary":return ic(this,e,t);case"base64":return rc(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return oc(this,e,t);default:if(n)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),n=!0}}y.prototype._isBuffer=!0;function be(r,e,t){var n=r[e];r[e]=r[t],r[t]=n}y.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)be(this,t,t+1);return this},y.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)be(this,t,t+3),be(this,t+1,t+2);return this},y.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)be(this,t,t+7),be(this,t+1,t+6),be(this,t+2,t+5),be(this,t+3,t+4);return this},y.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Hi(this,0,e):Yf.apply(this,arguments)},y.prototype.equals=function(e){if(!Z(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:y.compare(this,e)===0},y.prototype.inspect=function(){var e="",t=Wf;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},y.prototype.compare=function(e,t,n,i,a){if(!Z(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),a===void 0&&(a=this.length),t<0||n>e.length||i<0||a>this.length)throw new RangeError("out of range index");if(i>=a&&t>=n)return 0;if(i>=a)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,a>>>=0,this===e)return 0;for(var o=a-i,s=n-t,f=Math.min(o,s),c=this.slice(i,a),l=e.slice(t,n),u=0;u<f;++u)if(c[u]!==l[u]){o=c[u],s=l[u];break}return o<s?-1:s<o?1:0};function 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=y.from(e,n)),Z(e))return e.length===0?-1:Wi(r,e,t,n,i);if(typeof e=="number")return e=e&255,y.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):Wi(r,[e],t,n,i);throw new TypeError("val must be string, number or Buffer")}function Wi(r,e,t,n,i){var a=1,o=r.length,s=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(r.length<2||e.length<2)return-1;a=2,o/=2,s/=2,t/=2}function f(d,_){return a===1?d[_]:d.readUInt16BE(_*a)}var c;if(i){var l=-1;for(c=t;c<o;c++)if(f(r,c)===f(e,l===-1?0:c-l)){if(l===-1&&(l=c),c-l+1===s)return l*a}else l!==-1&&(c-=c-l),l=-1}else for(t+s>o&&(t=o-s),c=t;c>=0;c--){for(var u=!0,p=0;p<s;p++)if(f(r,c+p)!==f(e,p)){u=!1;break}if(u)return c}return-1}y.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},y.prototype.indexOf=function(e,t,n){return Gi(this,e,t,n,!0)},y.prototype.lastIndexOf=function(e,t,n){return Gi(this,e,t,n,!1)};function Kf(r,e,t,n){t=Number(t)||0;var i=r.length-t;n?(n=Number(n),n>i&&(n=i)):n=i;var a=e.length;if(a%2!==0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(e.substr(o*2,2),16);if(isNaN(s))return o;r[t+o]=s}return o}function Zf(r,e,t,n){return Ur(Nr(e,r.length-t),r,t,n)}function Vi(r,e,t,n){return Ur(lc(e),r,t,n)}function Jf(r,e,t,n){return Vi(r,e,t,n)}function Qf(r,e,t,n){return Ur(Zi(e),r,t,n)}function ec(r,e,t,n){return Ur(pc(e,r.length-t),r,t,n)}y.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 Kf(this,e,t,n);case"utf8":case"utf-8":return Zf(this,e,t,n);case"ascii":return Vi(this,e,t,n);case"latin1":case"binary":return Jf(this,e,t,n);case"base64":return Qf(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ec(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function rc(r,e,t){return e===0&&t===r.length?Ui(r):Ui(r.slice(e,t))}function Hi(r,e,t){t=Math.min(r.length,t);for(var n=[],i=e;i<t;){var a=r[i],o=null,s=a>239?4:a>223?3:a>191?2:1;if(i+s<=t){var f,c,l,u;switch(s){case 1:a<128&&(o=a);break;case 2:f=r[i+1],(f&192)===128&&(u=(a&31)<<6|f&63,u>127&&(o=u));break;case 3:f=r[i+1],c=r[i+2],(f&192)===128&&(c&192)===128&&(u=(a&15)<<12|(f&63)<<6|c&63,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:f=r[i+1],c=r[i+2],l=r[i+3],(f&192)===128&&(c&192)===128&&(l&192)===128&&(u=(a&15)<<18|(f&63)<<12|(c&63)<<6|l&63,u>65535&&u<1114112&&(o=u))}}o===null?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),i+=s}return tc(n)}var zi=4096;function tc(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 nc(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 ic(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 ac(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+=cc(r[a]);return i}function oc(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}y.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(y.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=y.prototype;else{var a=t-e;i=new y(a,void 0);for(var o=0;o<a;++o)i[o]=this[o+e]}return i};function N(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")}y.prototype.readUIntLE=function(e,t,n){e=e|0,t=t|0,n||N(e,t,this.length);for(var i=this[e],a=1,o=0;++o<t&&(a*=256);)i+=this[e+o]*a;return i},y.prototype.readUIntBE=function(e,t,n){e=e|0,t=t|0,n||N(e,t,this.length);for(var i=this[e+--t],a=1;t>0&&(a*=256);)i+=this[e+--t]*a;return i},y.prototype.readUInt8=function(e,t){return t||N(e,1,this.length),this[e]},y.prototype.readUInt16LE=function(e,t){return t||N(e,2,this.length),this[e]|this[e+1]<<8},y.prototype.readUInt16BE=function(e,t){return t||N(e,2,this.length),this[e]<<8|this[e+1]},y.prototype.readUInt32LE=function(e,t){return t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},y.prototype.readUInt32BE=function(e,t){return t||N(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},y.prototype.readIntLE=function(e,t,n){e=e|0,t=t|0,n||N(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},y.prototype.readIntBE=function(e,t,n){e=e|0,t=t|0,n||N(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},y.prototype.readInt8=function(e,t){return t||N(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},y.prototype.readInt16LE=function(e,t){t||N(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},y.prototype.readInt16BE=function(e,t){t||N(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},y.prototype.readInt32LE=function(e,t){return t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},y.prototype.readInt32BE=function(e,t){return t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},y.prototype.readFloatLE=function(e,t){return t||N(e,4,this.length),Fr(this,e,!0,23,4)},y.prototype.readFloatBE=function(e,t){return t||N(e,4,this.length),Fr(this,e,!1,23,4)},y.prototype.readDoubleLE=function(e,t){return t||N(e,8,this.length),Fr(this,e,!0,52,8)},y.prototype.readDoubleBE=function(e,t){return t||N(e,8,this.length),Fr(this,e,!1,52,8)};function q(r,e,t,n,i,a){if(!Z(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(t+n>r.length)throw new RangeError("Index out of range")}y.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;q(this,e,t,n,a,0)}var o=1,s=0;for(this[t]=e&255;++s<n&&(o*=256);)this[t+s]=e/o&255;return t+n},y.prototype.writeUIntBE=function(e,t,n,i){if(e=+e,t=t|0,n=n|0,!i){var a=Math.pow(2,8*n)-1;q(this,e,t,n,a,0)}var o=n-1,s=1;for(this[t+o]=e&255;--o>=0&&(s*=256);)this[t+o]=e/s&255;return t+n},y.prototype.writeUInt8=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,1,255,0),y.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function Dr(r,e,t,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(r.length-t,2);i<a;++i)r[t+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}y.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Dr(this,e,t,!0),t+2},y.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Dr(this,e,t,!1),t+2};function Br(r,e,t,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(r.length-t,4);i<a;++i)r[t+i]=e>>>(n?i:3-i)*8&255}y.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):Br(this,e,t,!0),t+4},y.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Br(this,e,t,!1),t+4},y.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);q(this,e,t,n,a-1,-a)}var o=0,s=1,f=0;for(this[t]=e&255;++o<n&&(s*=256);)e<0&&f===0&&this[t+o-1]!==0&&(f=1),this[t+o]=(e/s>>0)-f&255;return t+n},y.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=t|0,!i){var a=Math.pow(2,8*n-1);q(this,e,t,n,a-1,-a)}var o=n-1,s=1,f=0;for(this[t+o]=e&255;--o>=0&&(s*=256);)e<0&&f===0&&this[t+o+1]!==0&&(f=1),this[t+o]=(e/s>>0)-f&255;return t+n},y.prototype.writeInt8=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,1,127,-128),y.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1},y.prototype.writeInt16LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):Dr(this,e,t,!0),t+2},y.prototype.writeInt16BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):Dr(this,e,t,!1),t+2},y.prototype.writeInt32LE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,2147483647,-2147483648),y.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Br(this,e,t,!0),t+4},y.prototype.writeInt32BE=function(e,t,n){return e=+e,t=t|0,n||q(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):Br(this,e,t,!1),t+4};function Xi(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 Yi(r,e,t,n,i){return i||Xi(r,e,t,4),Ci(r,e,t,n,23,4),t+4}y.prototype.writeFloatLE=function(e,t,n){return Yi(this,e,t,!0,n)},y.prototype.writeFloatBE=function(e,t,n){return Yi(this,e,t,!1,n)};function Ki(r,e,t,n,i){return i||Xi(r,e,t,8),Ci(r,e,t,n,52,8),t+8}y.prototype.writeDoubleLE=function(e,t,n){return Ki(this,e,t,!0,n)},y.prototype.writeDoubleBE=function(e,t,n){return Ki(this,e,t,!1,n)},y.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||!y.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},y.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"&&!y.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var o;if(typeof e=="number")for(o=t;o<n;++o)this[o]=e;else{var s=Z(e)?e:Nr(new y(e,i).toString()),f=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%f]}return this};var uc=/[^+\/0-9A-Za-z-_]/g;function sc(r){if(r=fc(r).replace(uc,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function fc(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function cc(r){return r<16?"0"+r.toString(16):r.toString(16)}function Nr(r,e){e=e||1/0;for(var t,n=r.length,i=null,a=[],o=0;o<n;++o){if(t=r.charCodeAt(o),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&a.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;a.push(t)}else if(t<2048){if((e-=2)<0)break;a.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;a.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;a.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return a}function lc(r){for(var e=[],t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function pc(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 Zi(r){return jf(sc(r))}function Ur(r,e,t,n){for(var i=0;i<n&&!(i+t>=e.length||i>=r.length);++i)e[i+t]=r[i];return i}function hc(r){return r!==r}function dc(r){return r!=null&&(!!r._isBuffer||Ji(r)||yc(r))}function Ji(r){return!!r.constructor&&typeof r.constructor.isBuffer=="function"&&r.constructor.isBuffer(r)}function yc(r){return typeof r.readFloatLE=="function"&&typeof r.slice=="function"&&Ji(r.slice(0,0))}function Qi(){throw new Error("setTimeout has not been defined")}function ea(){throw new Error("clearTimeout has not been defined")}var he=Qi,de=ea;typeof Ue.setTimeout=="function"&&(he=setTimeout),typeof Ue.clearTimeout=="function"&&(de=clearTimeout);function ra(r){if(he===setTimeout)return setTimeout(r,0);if((he===Qi||!he)&&setTimeout)return he=setTimeout,setTimeout(r,0);try{return he(r,0)}catch{try{return he.call(null,r,0)}catch{return he.call(this,r,0)}}}function vc(r){if(de===clearTimeout)return clearTimeout(r);if((de===ea||!de)&&clearTimeout)return de=clearTimeout,clearTimeout(r);try{return de(r)}catch{try{return de.call(null,r)}catch{return de.call(this,r)}}}var ae=[],Ce=!1,$e,Cr=-1;function gc(){!Ce||!$e||(Ce=!1,$e.length?ae=$e.concat(ae):Cr=-1,ae.length&&ta())}function ta(){if(!Ce){var r=ra(gc);Ce=!0;for(var e=ae.length;e;){for($e=ae,ae=[];++Cr<e;)$e&&$e[Cr].run();Cr=-1,e=ae.length}$e=null,Ce=!1,vc(r)}}function _c(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];ae.push(new na(r,e)),ae.length===1&&!Ce&&ra(ta)}function na(r,e){this.fun=r,this.array=e}na.prototype.run=function(){this.fun.apply(null,this.array)};var mc="browser",wc="browser",bc=!0,$c={},Ac=[],Ec="",Oc={},Sc={},Pc={};function Ae(){}var Ic=Ae,Tc=Ae,xc=Ae,Rc=Ae,Fc=Ae,Mc=Ae,Dc=Ae;function Bc(r){throw new Error("process.binding is not supported")}function Nc(){return"/"}function Uc(r){throw new Error("process.chdir is not supported")}function Cc(){return 0}var Le=Ue.performance||{},Lc=Le.now||Le.mozNow||Le.msNow||Le.oNow||Le.webkitNow||function(){return new Date().getTime()};function jc(r){var e=Lc.call(Le)*.001,t=Math.floor(e),n=Math.floor(e%1*1e9);return r&&(t=t-r[0],n=n-r[1],n<0&&(t--,n+=1e9)),[t,n]}var kc=new Date;function qc(){var r=new Date,e=r-kc;return e/1e3}var Lr={nextTick:_c,title:mc,browser:bc,env:$c,argv:Ac,version:Ec,versions:Oc,on:Ic,addListener:Tc,once:xc,off:Rc,removeListener:Fc,removeAllListeners:Mc,emit:Dc,binding:Bc,cwd:Nc,chdir:Uc,umask:Cc,hrtime:jc,platform:wc,release:Sc,config:Pc,uptime:qc},Qt;typeof Object.create=="function"?Qt=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:Qt=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var ia=Qt,Gc=/%[sdj%]/g;function jr(r){if(!er(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(Gc,function(s){if(s==="%%")return"%";if(t>=i)return s;switch(s){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch{return"[Circular]"}default:return s}}),o=n[t];t<i;o=n[++t])Qe(o)||!Ee(o)?a+=" "+o:a+=" "+J(o);return a}function en(r,e){if(Q(Ue.process))return function(){return en(r,e).apply(this,arguments)};if(Lr.noDeprecation===!0)return r;var t=!1;function n(){if(!t){if(Lr.throwDeprecation)throw new Error(e);Lr.traceDeprecation?console.trace(e):console.error(e),t=!0}return r.apply(this,arguments)}return n}var kr={},rn;function aa(r){if(Q(rn)&&(rn=Lr.env.NODE_DEBUG||""),r=r.toUpperCase(),!kr[r])if(new RegExp("\\b"+r+"\\b","i").test(rn)){var e=0;kr[r]=function(){var t=jr.apply(null,arguments);console.error("%s %d: %s",r,e,t)}}else kr[r]=function(){};return kr[r]}function J(r,e){var t={seen:[],stylize:Vc};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),Gr(e)?t.showHidden=e:e&&fn(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=Wc),qr(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 Wc(r,e){var t=J.styles[e];return t?"\x1B["+J.colors[t][0]+"m"+r+"\x1B["+J.colors[t][1]+"m":r}function Vc(r,e){return r}function Hc(r){var e={};return r.forEach(function(t,n){e[t]=!0}),e}function qr(r,e,t){if(r.customInspect&&e&&nr(e.inspect)&&e.inspect!==J&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(t,r);return er(n)||(n=qr(r,n,t)),n}var i=zc(r,e);if(i)return i;var a=Object.keys(e),o=Hc(a);if(r.showHidden&&(a=Object.getOwnPropertyNames(e)),tr(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return tn(e);if(a.length===0){if(nr(e)){var s=e.name?": "+e.name:"";return r.stylize("[Function"+s+"]","special")}if(rr(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(Wr(e))return r.stylize(Date.prototype.toString.call(e),"date");if(tr(e))return tn(e)}var f="",c=!1,l=["{","}"];if(an(e)&&(c=!0,l=["[","]"]),nr(e)){var u=e.name?": "+e.name:"";f=" [Function"+u+"]"}if(rr(e)&&(f=" "+RegExp.prototype.toString.call(e)),Wr(e)&&(f=" "+Date.prototype.toUTCString.call(e)),tr(e)&&(f=" "+tn(e)),a.length===0&&(!c||e.length==0))return l[0]+f+l[1];if(t<0)return rr(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(d){return nn(r,e,t,o,d,c)}),r.seen.pop(),Yc(p,f,l)}function zc(r,e){if(Q(e))return r.stylize("undefined","undefined");if(er(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return r.stylize(t,"string")}if(on(e))return r.stylize(""+e,"number");if(Gr(e))return r.stylize(""+e,"boolean");if(Qe(e))return r.stylize("null","null")}function tn(r){return"["+Error.prototype.toString.call(r)+"]"}function Xc(r,e,t,n,i){for(var a=[],o=0,s=e.length;o<s;++o)la(e,String(o))?a.push(nn(r,e,t,n,String(o),!0)):a.push("");return i.forEach(function(f){f.match(/^\d+$/)||a.push(nn(r,e,t,n,f,!0))}),a}function nn(r,e,t,n,i,a){var o,s,f;if(f=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},f.get?f.set?s=r.stylize("[Getter/Setter]","special"):s=r.stylize("[Getter]","special"):f.set&&(s=r.stylize("[Setter]","special")),la(n,i)||(o="["+i+"]"),s||(r.seen.indexOf(f.value)<0?(Qe(t)?s=qr(r,f.value,null):s=qr(r,f.value,t-1),s.indexOf(`
|
|
9
9
|
`)>-1&&(a?s=s.split(`
|
|
10
10
|
`).map(function(c){return" "+c}).join(`
|
|
11
11
|
`).substr(2):s=`
|
|
12
12
|
`+s.split(`
|
|
13
13
|
`).map(function(c){return" "+c}).join(`
|
|
14
|
-
`))):s=r.stylize("[Circular]","special")),Q(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=r.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=r.stylize(o,"string"))}return o+": "+s}function
|
|
14
|
+
`))):s=r.stylize("[Circular]","special")),Q(o)){if(a&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=r.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=r.stylize(o,"string"))}return o+": "+s}function Yc(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 an(r){return Array.isArray(r)}function Gr(r){return typeof r=="boolean"}function Qe(r){return r===null}function oa(r){return r==null}function on(r){return typeof r=="number"}function er(r){return typeof r=="string"}function ua(r){return typeof r=="symbol"}function Q(r){return r===void 0}function rr(r){return Ee(r)&&un(r)==="[object RegExp]"}function Ee(r){return typeof r=="object"&&r!==null}function Wr(r){return Ee(r)&&un(r)==="[object Date]"}function tr(r){return Ee(r)&&(un(r)==="[object Error]"||r instanceof Error)}function nr(r){return typeof r=="function"}function sa(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function fa(r){return y.isBuffer(r)}function un(r){return Object.prototype.toString.call(r)}function sn(r){return r<10?"0"+r.toString(10):r.toString(10)}var zc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Xc(){var r=new Date,e=[sn(r.getHours()),sn(r.getMinutes()),sn(r.getSeconds())].join(":");return[r.getDate(),zc[r.getMonth()],e].join(" ")}function ca(){console.log("%s - %s",Xc(),jr.apply(null,arguments))}function fn(r,e){if(!e||!Ee(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function la(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Yc={inherits:ia,_extend:fn,log:ca,isBuffer:fa,isPrimitive:sa,isFunction:nr,isError:tr,isDate:Wr,isObject:Ee,isRegExp:rr,isUndefined:Q,isSymbol:ua,isString:er,isNumber:on,isNullOrUndefined:oa,isNull:Qe,isBoolean:Gr,isArray:an,inspect:J,deprecate:en,format:jr,debuglog:aa},Kc=Object.freeze({__proto__:null,format:jr,deprecate:en,debuglog:aa,inspect:J,isArray:an,isBoolean:Gr,isNull:Qe,isNullOrUndefined:oa,isNumber:on,isString:er,isSymbol:ua,isUndefined:Q,isRegExp:rr,isObject:Ee,isDate:Wr,isError:tr,isFunction:nr,isPrimitive:sa,isBuffer:fa,log:ca,inherits:ia,_extend:fn,default:Yc}),Zc=Ke(Kc),Jc=Zc.inspect,cn=typeof Map=="function"&&Map.prototype,ln=Object.getOwnPropertyDescriptor&&cn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Vr=cn&&ln&&typeof ln.get=="function"?ln.get:null,Qc=cn&&Map.prototype.forEach,pn=typeof Set=="function"&&Set.prototype,hn=Object.getOwnPropertyDescriptor&&pn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Hr=pn&&hn&&typeof hn.get=="function"?hn.get:null,el=pn&&Set.prototype.forEach,rl=typeof WeakMap=="function"&&WeakMap.prototype,ir=rl?WeakMap.prototype.has:null,tl=typeof WeakSet=="function"&&WeakSet.prototype,ar=tl?WeakSet.prototype.has:null,nl=typeof WeakRef=="function"&&WeakRef.prototype,pa=nl?WeakRef.prototype.deref:null,il=Boolean.prototype.valueOf,al=Object.prototype.toString,ol=Function.prototype.toString,ul=String.prototype.match,dn=String.prototype.slice,ye=String.prototype.replace,sl=String.prototype.toUpperCase,ha=String.prototype.toLowerCase,da=RegExp.prototype.test,ya=Array.prototype.concat,ee=Array.prototype.join,fl=Array.prototype.slice,va=Math.floor,yn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,vn=Object.getOwnPropertySymbols,gn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,je=typeof Symbol=="function"&&typeof Symbol.iterator=="object",j=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===je?"object":"symbol")?Symbol.toStringTag:null,ga=Object.prototype.propertyIsEnumerable,_a=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function ma(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||da.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-va(-r):va(r);if(n!==r){var i=String(n),a=dn.call(e,i.length+1);return ye.call(i,t,"$&_")+"."+ye.call(ye.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ye.call(e,t,"$&_")}var _n=Jc,wa=_n.custom,ba=Ea(wa)?wa:null,cl=function r(e,t,n,i){var a=t||{};if(ve(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ve(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=ve(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(ve(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(ve(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Sa(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return s?ma(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return s?ma(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 mn(e)?"[Array]":"[Object]";var u=Pl(a,n);if(typeof i>"u")i=[];else if(Oa(i,e)>=0)return"[Circular]";function p(H,te,X){if(te&&(i=fl.call(i),i.push(te)),X){var Re={depth:a.depth};return ve(a,"quoteStyle")&&(Re.quoteStyle=a.quoteStyle),r(H,Re,n+1,i)}return r(H,a,n+1,i)}if(typeof e=="function"&&!Aa(e)){var d=ml(e),_=zr(e,p);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(_.length>0?" { "+ee.call(_,", ")+" }":"")}if(Ea(e)){var $=je?ye.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):gn.call(e);return typeof e=="object"&&!je?or($):$}if(Ol(e)){for(var b="<"+ha.call(String(e.nodeName)),w=e.attributes||[],A=0;A<w.length;A++)b+=" "+w[A].name+"="+$a(ll(w[A].value),"double",a);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+ha.call(String(e.nodeName))+">",b}if(mn(e)){if(e.length===0)return"[]";var h=zr(e,p);return u&&!Il(h)?"["+bn(h,u)+"]":"[ "+ee.call(h,", ")+" ]"}if(hl(e)){var I=zr(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!ga.call(e,"cause")?"{ ["+String(e)+"] "+ee.call(ya.call("[cause]: "+p(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ee.call(I,", ")+" }"}if(typeof e=="object"&&o){if(ba&&typeof e[ba]=="function"&&_n)return _n(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(wl(e)){var P=[];return Qc.call(e,function(H,te){P.push(p(te,e,!0)+" => "+p(H,e))}),Ia("Map",Vr.call(e),P,u)}if(Al(e)){var R=[];return el.call(e,function(H){R.push(p(H,e))}),Ia("Set",Hr.call(e),R,u)}if(bl(e))return wn("WeakMap");if(El(e))return wn("WeakSet");if($l(e))return wn("WeakRef");if(yl(e))return or(p(Number(e)));if(gl(e))return or(p(yn.call(e)));if(vl(e))return or(il.call(e));if(dl(e))return or(p(String(e)));if(!pl(e)&&!Aa(e)){var m=zr(e,p),v=_a?_a(e)===Object.prototype:e instanceof Object||e.constructor===Object,g=e instanceof Object?"":"null prototype",O=!v&&j&&Object(e)===e&&j in e?dn.call(ge(e),8,-1):g?"Object":"",S=v||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",B=S+(O||g?"["+ee.call(ya.call([],O||[],g||[]),": ")+"] ":"");return m.length===0?B+"{}":u?B+"{"+bn(m,u)+"}":B+"{ "+ee.call(m,", ")+" }"}return String(e)};function $a(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function ll(r){return ye.call(String(r),/"/g,""")}function mn(r){return ge(r)==="[object Array]"&&(!j||!(typeof r=="object"&&j in r))}function pl(r){return ge(r)==="[object Date]"&&(!j||!(typeof r=="object"&&j in r))}function Aa(r){return ge(r)==="[object RegExp]"&&(!j||!(typeof r=="object"&&j in r))}function hl(r){return ge(r)==="[object Error]"&&(!j||!(typeof r=="object"&&j in r))}function dl(r){return ge(r)==="[object String]"&&(!j||!(typeof r=="object"&&j in r))}function yl(r){return ge(r)==="[object Number]"&&(!j||!(typeof r=="object"&&j in r))}function vl(r){return ge(r)==="[object Boolean]"&&(!j||!(typeof r=="object"&&j in r))}function Ea(r){if(je)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!gn)return!1;try{return gn.call(r),!0}catch{}return!1}function gl(r){if(!r||typeof r!="object"||!yn)return!1;try{return yn.call(r),!0}catch{}return!1}var _l=Object.prototype.hasOwnProperty||function(r){return r in this};function ve(r,e){return _l.call(r,e)}function ge(r){return al.call(r)}function ml(r){if(r.name)return r.name;var e=ul.call(ol.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function Oa(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 wl(r){if(!Vr||!r||typeof r!="object")return!1;try{Vr.call(r);try{Hr.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function bl(r){if(!ir||!r||typeof r!="object")return!1;try{ir.call(r,ir);try{ar.call(r,ar)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function $l(r){if(!pa||!r||typeof r!="object")return!1;try{return pa.call(r),!0}catch{}return!1}function Al(r){if(!Hr||!r||typeof r!="object")return!1;try{Hr.call(r);try{Vr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function El(r){if(!ar||!r||typeof r!="object")return!1;try{ar.call(r,ar);try{ir.call(r,ir)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Ol(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function Sa(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Sa(dn.call(r,0,e.maxStringLength),e)+n}var i=ye.call(ye.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Sl);return $a(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":"")+sl.call(e.toString(16))}function or(r){return"Object("+r+")"}function wn(r){return r+" { ? }"}function Ia(r,e,t,n){var i=n?bn(t,n):ee.call(t,", ");return r+" ("+e+") {"+i+"}"}function Il(r){for(var e=0;e<r.length;e++)if(Oa(r[e],`
|
|
18
|
-
`)>=0)return!1;return!0}function
|
|
17
|
+
`)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function an(r){return Array.isArray(r)}function Gr(r){return typeof r=="boolean"}function Qe(r){return r===null}function oa(r){return r==null}function on(r){return typeof r=="number"}function er(r){return typeof r=="string"}function ua(r){return typeof r=="symbol"}function Q(r){return r===void 0}function rr(r){return Ee(r)&&un(r)==="[object RegExp]"}function Ee(r){return typeof r=="object"&&r!==null}function Wr(r){return Ee(r)&&un(r)==="[object Date]"}function tr(r){return Ee(r)&&(un(r)==="[object Error]"||r instanceof Error)}function nr(r){return typeof r=="function"}function sa(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function fa(r){return y.isBuffer(r)}function un(r){return Object.prototype.toString.call(r)}function sn(r){return r<10?"0"+r.toString(10):r.toString(10)}var Kc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Zc(){var r=new Date,e=[sn(r.getHours()),sn(r.getMinutes()),sn(r.getSeconds())].join(":");return[r.getDate(),Kc[r.getMonth()],e].join(" ")}function ca(){console.log("%s - %s",Zc(),jr.apply(null,arguments))}function fn(r,e){if(!e||!Ee(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function la(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Jc={inherits:ia,_extend:fn,log:ca,isBuffer:fa,isPrimitive:sa,isFunction:nr,isError:tr,isDate:Wr,isObject:Ee,isRegExp:rr,isUndefined:Q,isSymbol:ua,isString:er,isNumber:on,isNullOrUndefined:oa,isNull:Qe,isBoolean:Gr,isArray:an,inspect:J,deprecate:en,format:jr,debuglog:aa},Qc=Object.freeze({__proto__:null,format:jr,deprecate:en,debuglog:aa,inspect:J,isArray:an,isBoolean:Gr,isNull:Qe,isNullOrUndefined:oa,isNumber:on,isString:er,isSymbol:ua,isUndefined:Q,isRegExp:rr,isObject:Ee,isDate:Wr,isError:tr,isFunction:nr,isPrimitive:sa,isBuffer:fa,log:ca,inherits:ia,_extend:fn,default:Jc}),el=Ke(Qc),rl=el.inspect,cn=typeof Map=="function"&&Map.prototype,ln=Object.getOwnPropertyDescriptor&&cn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Vr=cn&&ln&&typeof ln.get=="function"?ln.get:null,tl=cn&&Map.prototype.forEach,pn=typeof Set=="function"&&Set.prototype,hn=Object.getOwnPropertyDescriptor&&pn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Hr=pn&&hn&&typeof hn.get=="function"?hn.get:null,nl=pn&&Set.prototype.forEach,il=typeof WeakMap=="function"&&WeakMap.prototype,ir=il?WeakMap.prototype.has:null,al=typeof WeakSet=="function"&&WeakSet.prototype,ar=al?WeakSet.prototype.has:null,ol=typeof WeakRef=="function"&&WeakRef.prototype,pa=ol?WeakRef.prototype.deref:null,ul=Boolean.prototype.valueOf,sl=Object.prototype.toString,fl=Function.prototype.toString,cl=String.prototype.match,dn=String.prototype.slice,ye=String.prototype.replace,ll=String.prototype.toUpperCase,ha=String.prototype.toLowerCase,da=RegExp.prototype.test,ya=Array.prototype.concat,ee=Array.prototype.join,pl=Array.prototype.slice,va=Math.floor,yn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,vn=Object.getOwnPropertySymbols,gn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,je=typeof Symbol=="function"&&typeof Symbol.iterator=="object",j=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===je?"object":"symbol")?Symbol.toStringTag:null,ga=Object.prototype.propertyIsEnumerable,_a=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function ma(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||da.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-va(-r):va(r);if(n!==r){var i=String(n),a=dn.call(e,i.length+1);return ye.call(i,t,"$&_")+"."+ye.call(ye.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ye.call(e,t,"$&_")}var _n=rl,wa=_n.custom,ba=Ea(wa)?wa:null,hl=function r(e,t,n,i){var a=t||{};if(ve(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ve(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=ve(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(ve(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(ve(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Sa(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return s?ma(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return s?ma(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 mn(e)?"[Array]":"[Object]";var u=Rl(a,n);if(typeof i>"u")i=[];else if(Oa(i,e)>=0)return"[Circular]";function p(H,te,X){if(te&&(i=pl.call(i),i.push(te)),X){var Re={depth:a.depth};return ve(a,"quoteStyle")&&(Re.quoteStyle=a.quoteStyle),r(H,Re,n+1,i)}return r(H,a,n+1,i)}if(typeof e=="function"&&!Aa(e)){var d=$l(e),_=zr(e,p);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(_.length>0?" { "+ee.call(_,", ")+" }":"")}if(Ea(e)){var $=je?ye.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):gn.call(e);return typeof e=="object"&&!je?or($):$}if(Il(e)){for(var b="<"+ha.call(String(e.nodeName)),w=e.attributes||[],A=0;A<w.length;A++)b+=" "+w[A].name+"="+$a(dl(w[A].value),"double",a);return b+=">",e.childNodes&&e.childNodes.length&&(b+="..."),b+="</"+ha.call(String(e.nodeName))+">",b}if(mn(e)){if(e.length===0)return"[]";var h=zr(e,p);return u&&!xl(h)?"["+bn(h,u)+"]":"[ "+ee.call(h,", ")+" ]"}if(vl(e)){var P=zr(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!ga.call(e,"cause")?"{ ["+String(e)+"] "+ee.call(ya.call("[cause]: "+p(e.cause),P),", ")+" }":P.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+ee.call(P,", ")+" }"}if(typeof e=="object"&&o){if(ba&&typeof e[ba]=="function"&&_n)return _n(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Al(e)){var I=[];return tl.call(e,function(H,te){I.push(p(te,e,!0)+" => "+p(H,e))}),Pa("Map",Vr.call(e),I,u)}if(Sl(e)){var R=[];return nl.call(e,function(H){R.push(p(H,e))}),Pa("Set",Hr.call(e),R,u)}if(El(e))return wn("WeakMap");if(Pl(e))return wn("WeakSet");if(Ol(e))return wn("WeakRef");if(_l(e))return or(p(Number(e)));if(wl(e))return or(p(yn.call(e)));if(ml(e))return or(ul.call(e));if(gl(e))return or(p(String(e)));if(!yl(e)&&!Aa(e)){var m=zr(e,p),v=_a?_a(e)===Object.prototype:e instanceof Object||e.constructor===Object,g=e instanceof Object?"":"null prototype",O=!v&&j&&Object(e)===e&&j in e?dn.call(ge(e),8,-1):g?"Object":"",S=v||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",B=S+(O||g?"["+ee.call(ya.call([],O||[],g||[]),": ")+"] ":"");return m.length===0?B+"{}":u?B+"{"+bn(m,u)+"}":B+"{ "+ee.call(m,", ")+" }"}return String(e)};function $a(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function dl(r){return ye.call(String(r),/"/g,""")}function mn(r){return ge(r)==="[object Array]"&&(!j||!(typeof r=="object"&&j in r))}function yl(r){return ge(r)==="[object Date]"&&(!j||!(typeof r=="object"&&j in r))}function Aa(r){return ge(r)==="[object RegExp]"&&(!j||!(typeof r=="object"&&j in r))}function vl(r){return ge(r)==="[object Error]"&&(!j||!(typeof r=="object"&&j in r))}function gl(r){return ge(r)==="[object String]"&&(!j||!(typeof r=="object"&&j in r))}function _l(r){return ge(r)==="[object Number]"&&(!j||!(typeof r=="object"&&j in r))}function ml(r){return ge(r)==="[object Boolean]"&&(!j||!(typeof r=="object"&&j in r))}function Ea(r){if(je)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!gn)return!1;try{return gn.call(r),!0}catch{}return!1}function wl(r){if(!r||typeof r!="object"||!yn)return!1;try{return yn.call(r),!0}catch{}return!1}var bl=Object.prototype.hasOwnProperty||function(r){return r in this};function ve(r,e){return bl.call(r,e)}function ge(r){return sl.call(r)}function $l(r){if(r.name)return r.name;var e=cl.call(fl.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function Oa(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 Al(r){if(!Vr||!r||typeof r!="object")return!1;try{Vr.call(r);try{Hr.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function El(r){if(!ir||!r||typeof r!="object")return!1;try{ir.call(r,ir);try{ar.call(r,ar)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function Ol(r){if(!pa||!r||typeof r!="object")return!1;try{return pa.call(r),!0}catch{}return!1}function Sl(r){if(!Hr||!r||typeof r!="object")return!1;try{Hr.call(r);try{Vr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Pl(r){if(!ar||!r||typeof r!="object")return!1;try{ar.call(r,ar);try{ir.call(r,ir)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Il(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function Sa(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Sa(dn.call(r,0,e.maxStringLength),e)+n}var i=ye.call(ye.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Tl);return $a(i,"single",e)}function Tl(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":"")+ll.call(e.toString(16))}function or(r){return"Object("+r+")"}function wn(r){return r+" { ? }"}function Pa(r,e,t,n){var i=n?bn(t,n):ee.call(t,", ");return r+" ("+e+") {"+i+"}"}function xl(r){for(var e=0;e<r.length;e++)if(Oa(r[e],`
|
|
18
|
+
`)>=0)return!1;return!0}function Rl(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 bn(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 zr(r,e){var t=mn(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=ve(r,i)?e(r[i],r):""}var a=typeof vn=="function"?vn(r):[],o;if(je){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var f in r)!ve(r,f)||t&&String(Number(f))===f&&f<r.length||je&&o["$"+f]instanceof Symbol||(da.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r)));if(typeof vn=="function")for(var c=0;c<a.length;c++)ga.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var $n=Xt,ke=Bf,Tl=cl,xl=$n("%TypeError%"),Xr=$n("%WeakMap%",!0),Yr=$n("%Map%",!0),Rl=ke("WeakMap.prototype.get",!0),Fl=ke("WeakMap.prototype.set",!0),Ml=ke("WeakMap.prototype.has",!0),Dl=ke("Map.prototype.get",!0),Bl=ke("Map.prototype.set",!0),Nl=ke("Map.prototype.has",!0),An=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},Ul=function(r,e){var t=An(r,e);return t&&t.value},Cl=function(r,e,t){var n=An(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},Ll=function(r,e){return!!An(r,e)},jl=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new xl("Side channel does not contain "+Tl(a))},get:function(a){if(Xr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Rl(e,a)}else if(Yr){if(t)return Dl(t,a)}else if(n)return Ul(n,a)},has:function(a){if(Xr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Ml(e,a)}else if(Yr){if(t)return Nl(t,a)}else if(n)return Ll(n,a);return!1},set:function(a,o){Xr&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new Xr),Fl(e,a,o)):Yr?(t||(t=new Yr),Bl(t,a,o)):(n||(n={key:{},next:null}),Cl(n,a,o))}};return i},kl=String.prototype.replace,ql=/%20/g,En={RFC1738:"RFC1738",RFC3986:"RFC3986"},Pa={default:En.RFC3986,formatters:{RFC1738:function(r){return kl.call(r,ql,"+")},RFC3986:function(r){return String(r)}},RFC1738:En.RFC1738,RFC3986:En.RFC3986},Gl=Pa,On=Object.prototype.hasOwnProperty,Oe=Array.isArray,re=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),Wl=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Oe(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},Ta=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},Vl=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Oe(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!On.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var i=e;return Oe(e)&&!Oe(t)&&(i=Ta(e,n)),Oe(e)&&Oe(t)?(t.forEach(function(a,o){if(On.call(e,o)){var s=e[o];s&&typeof s=="object"&&a&&typeof a=="object"?e[o]=r(s,a,n):e.push(a)}else e[o]=a}),e):Object.keys(t).reduce(function(a,o){var s=t[o];return On.call(a,o)?a[o]=r(a[o],s,n):a[o]=s,a},i)},Hl=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},zl=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}},Xl=function(e,t,n,i,a){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var s="",f=0;f<o.length;++f){var c=o.charCodeAt(f);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||a===Gl.RFC1738&&(c===40||c===41)){s+=o.charAt(f);continue}if(c<128){s=s+re[c];continue}if(c<2048){s=s+(re[192|c>>6]+re[128|c&63]);continue}if(c<55296||c>=57344){s=s+(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),s+=re[240|c>>18]+re[128|c>>12&63]+re[128|c>>6&63]+re[128|c&63]}return s},Yl=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i<t.length;++i)for(var a=t[i],o=a.obj[a.prop],s=Object.keys(o),f=0;f<s.length;++f){var c=s[f],l=o[c];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(t.push({obj:o,prop:c}),n.push(l))}return Wl(t),e},Kl=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Zl=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Jl=function(e,t){return[].concat(e,t)},Ql=function(e,t){if(Oe(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},ep={arrayToObject:Ta,assign:Hl,combine:Jl,compact:Yl,decode:zl,encode:Xl,isBuffer:Zl,isRegExp:Kl,maybeMap:Ql,merge:Vl},xa=jl,Sn=ep,ur=Pa,rp=Object.prototype.hasOwnProperty,Ra={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},oe=Array.isArray,tp=String.prototype.split,np=Array.prototype.push,Fa=function(r,e){np.apply(r,oe(e)?e:[e])},ip=Date.prototype.toISOString,Ma=ur.default,C={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Sn.encode,encodeValuesOnly:!1,format:Ma,formatter:ur.formatters[Ma],indices:!1,serializeDate:function(e){return ip.call(e)},skipNulls:!1,strictNullHandling:!1},ap=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},In={},op=function r(e,t,n,i,a,o,s,f,c,l,u,p,d,_,$,b){for(var w=e,A=b,h=0,I=!1;(A=A.get(In))!==void 0&&!I;){var P=A.get(e);if(h+=1,typeof P<"u"){if(P===h)throw new RangeError("Cyclic object value");I=!0}typeof A.get(In)>"u"&&(h=0)}if(typeof f=="function"?w=f(t,w):w instanceof Date?w=u(w):n==="comma"&&oe(w)&&(w=Sn.maybeMap(w,function(Ei){return Ei instanceof Date?u(Ei):Ei})),w===null){if(a)return s&&!_?s(t,C.encoder,$,"key",p):t;w=""}if(ap(w)||Sn.isBuffer(w)){if(s){var R=_?t:s(t,C.encoder,$,"key",p);if(n==="comma"&&_){for(var m=tp.call(String(w),","),v="",g=0;g<m.length;++g)v+=(g===0?"":",")+d(s(m[g],C.encoder,$,"value",p));return[d(R)+(i&&oe(w)&&m.length===1?"[]":"")+"="+v]}return[d(R)+"="+d(s(w,C.encoder,$,"value",p))]}return[d(t)+"="+d(String(w))]}var O=[];if(typeof w>"u")return O;var S;if(n==="comma"&&oe(w))S=[{value:w.length>0?w.join(",")||null:void 0}];else if(oe(f))S=f;else{var B=Object.keys(w);S=c?B.sort(c):B}for(var H=i&&oe(w)&&w.length===1?t+"[]":t,te=0;te<S.length;++te){var X=S[te],Re=typeof X=="object"&&typeof X.value<"u"?X.value:w[X];if(!(o&&Re===null)){var GR=oe(w)?typeof n=="function"?n(H,X):H:H+(l?"."+X:"["+X+"]");b.set(e,h);var rf=xa();rf.set(In,b),Fa(O,r(Re,GR,n,i,a,o,s,f,c,l,u,p,d,_,$,rf))}}return O},up=function(e){if(!e)return C;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||C.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=ur.default;if(typeof e.format<"u"){if(!rp.call(ur.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=ur.formatters[n],a=C.filter;return(typeof e.filter=="function"||oe(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:C.addQueryPrefix,allowDots:typeof e.allowDots>"u"?C.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:C.charsetSentinel,delimiter:typeof e.delimiter>"u"?C.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:C.encode,encoder:typeof e.encoder=="function"?e.encoder:C.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:C.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:C.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:C.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:C.strictNullHandling}},sp=function(r,e){var t=r,n=up(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):oe(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var s;e&&e.arrayFormat in Ra?s=e.arrayFormat:e&&"indices"in e?s=e.indices?"indices":"repeat":s="indices";var f=Ra[s];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=f==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var l=xa(),u=0;u<i.length;++u){var p=i[u];n.skipNulls&&t[p]===null||Fa(o,op(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 d=o.join(n.delimiter),_=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),d.length>0?_+d:""};let Da={storeIdentifier:"",environment:"prod"};function fp(r){Da=r}function ue(){return Da}const cp=r=>r==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",Pn=r=>r==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",lp=r=>r==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",pp="/tools/recurring";class Kr{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}var hp=Object.defineProperty,dp=Object.defineProperties,yp=Object.getOwnPropertyDescriptors,Ba=Object.getOwnPropertySymbols,vp=Object.prototype.hasOwnProperty,gp=Object.prototype.propertyIsEnumerable,Na=(r,e,t)=>e in r?hp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Zr=(r,e)=>{for(var t in e||(e={}))vp.call(e,t)&&Na(r,t,e[t]);if(Ba)for(var t of Ba(e))gp.call(e,t)&&Na(r,t,e[t]);return r},_p=(r,e)=>dp(r,yp(e));function mp(r){return sp(r,{encode:!1,indices:!1,arrayFormat:"comma"})}async function Jr(r,e,t={}){const n=ue();return z(r,`${lp(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function E(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:s,storeIdentifier:f,loginRetryFn:c}=ue(),l=o.apiToken,u=cp(s),p=Zr({"X-Recharge-Access-Token":l,"X-Recharge-Version":"2021-11"},a||{}),d=Zr({shop_url:f},n);try{return await z(r,`${u}${e}`,{id:t,query:d,data:i,headers:p})}catch(_){if(c&&_ instanceof Kr&&_.status===401)return c().then($=>{if($)return z(r,`${u}${e}`,{id:t,query:d,data:i,headers:_p(Zr({},p),{"X-Recharge-Access-Token":$.apiToken})});throw _});throw _}}async function sr(r,e,t={}){return z(r,`${pp}${e}`,t)}async function z(r,e,{id:t,query:n,data:i,headers:a}={}){let o=e.trim();if(t&&(o=[o,`${t}`.trim()].join("/")),n){let u;[o,u]=o.split("?");const p=[u,mp(n)].join("&").replace(/^&/,"");o=`${o}${p?`?${p}`:""}`}let s;i&&r!=="get"&&(s=JSON.stringify(i));const f=Zr({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},a||{}),c=await fetch(o,{method:r,headers:f,body:s,mode:"cors"});let l;try{l=await c.json()}catch{}if(!c.ok)throw l&&l.error?new Kr(l.error,c.status):l&&l.errors?new Kr(JSON.stringify(l.errors),c.status):new Kr("A connection error occurred while making the request");return l}function wp(r,e){return E("get","/addresses",{query:e},r)}async function bp(r,e,t){const{address:n}=await E("get","/addresses",{id:e,query:{include:t?.include}},r);return n}async function $p(r,e){const{address:t}=await E("post","/addresses",{data:e},r);return t}async function Tn(r,e,t){const{address:n}=await E("put","/addresses",{id:e,data:t},r);return n}async function Ap(r,e,t){return Tn(r,e,{discounts:[{code:t}]})}async function Ep(r,e){return Tn(r,e,{discounts:[]})}function Op(r,e){return E("delete","/addresses",{id:e},r)}async function Sp(r,e){const{address:t}=await E("post","/addresses/merge",{data:e},r);return t}async function Ip(r,e,t){const{charge:n}=await E("post",`/addresses/${e}/charges/skip`,{data:t},r);return n}var Pp=Object.freeze({__proto__:null,listAddresses:wp,getAddress:bp,createAddress:$p,updateAddress:Tn,applyDiscountToAddress:Ap,removeDiscountsFromAddress:Ep,deleteAddress:Op,mergeAddresses:Sp,skipFutureCharge:Ip});async function Tp(){const{storefrontAccessToken:r}=ue(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await sr("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id}}async function xp(r,e){const{environment:t,storefrontAccessToken:n,storeIdentifier:i}=ue(),a=Pn(t),o={};n&&(o["X-Recharge-Storefront-Access-Token"]=n);const s=await z("post",`${a}/shopify_storefront_access`,{data:{customer_token:e,storefront_token:r,shop_url:i},headers:o});return s.api_token?{apiToken:s.api_token,customerId:s.customer_id}:null}async function Rp(r){const{environment:e,storefrontAccessToken:t,storeIdentifier:n}=ue(),i=Pn(e),a={};t&&(a["X-Recharge-Storefront-Access-Token"]=t);const o=await z("post",`${i}/attempt_login`,{data:{email:r,shop:n},headers:a});if(o.errors)throw new Error(o.errors);return o.session_token}async function Fp(r){const{storefrontAccessToken:e,storeIdentifier:t}=ue(),n={};e&&(n["X-Recharge-Storefront-Access-Token"]=e);const i=await sr("post","/attempt_login",{data:{email:r,shop:t},headers:n});if(i.errors)throw new Error(i.errors);return i.session_token}async function Mp(r,e,t){const{environment:n,storefrontAccessToken:i,storeIdentifier:a}=ue(),o=Pn(n),s={};i&&(s["X-Recharge-Storefront-Access-Token"]=i);const f=await z("post",`${o}/validate_login`,{data:{code:t,email:r,session_token:e,shop:a},headers:s});if(f.errors)throw new Error(f.errors);return{apiToken:f.api_token,customerId:f.customer_id}}async function Dp(r,e,t){const{storefrontAccessToken:n,storeIdentifier:i}=ue(),a={};n&&(a["X-Recharge-Storefront-Access-Token"]=n);const o=await sr("post","/validate_login",{data:{code:t,email:r,session_token:e,shop:i},headers:a});if(o.errors)throw new Error(o.errors);return{apiToken:o.api_token,customerId:o.customer_id}}var Bp=Object.freeze({__proto__:null,loginShopifyAppProxy:Tp,loginShopifyApi:xp,sendPasswordlessCode:Rp,sendPasswordlessCodeAppProxy:Fp,validatePasswordlessCode:Mp,validatePasswordlessCodeAppProxy:Dp});let Np=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");function Up(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 Qr=Up;function Cp(){this.__data__=[],this.size=0}var Lp=Cp;function jp(r,e){return r===e||r!==r&&e!==e}var et=jp,kp=et;function qp(r,e){for(var t=r.length;t--;)if(kp(r[t][0],e))return t;return-1}var rt=qp,Gp=rt,Wp=Array.prototype,Vp=Wp.splice;function Hp(r){var e=this.__data__,t=Gp(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Vp.call(e,t,1),--this.size,!0}var zp=Hp,Xp=rt;function Yp(r){var e=this.__data__,t=Xp(e,r);return t<0?void 0:e[t][1]}var Kp=Yp,Zp=rt;function Jp(r){return Zp(this.__data__,r)>-1}var Qp=Jp,eh=rt;function rh(r,e){var t=this.__data__,n=eh(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var th=rh,nh=Lp,ih=zp,ah=Kp,oh=Qp,uh=th;function qe(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])}}qe.prototype.clear=nh,qe.prototype.delete=ih,qe.prototype.get=ah,qe.prototype.has=oh,qe.prototype.set=uh;var tt=qe,sh=tt;function fh(){this.__data__=new sh,this.size=0}var ch=fh;function lh(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var ph=lh;function hh(r){return this.__data__.get(r)}var dh=hh;function yh(r){return this.__data__.has(r)}var vh=yh,gh=typeof ne=="object"&&ne&&ne.Object===Object&&ne,Ua=gh,_h=Ua,mh=typeof self=="object"&&self&&self.Object===Object&&self,wh=_h||mh||Function("return this")(),G=wh,bh=G,$h=bh.Symbol,Ge=$h,Ca=Ge,La=Object.prototype,Ah=La.hasOwnProperty,Eh=La.toString,fr=Ca?Ca.toStringTag:void 0;function Oh(r){var e=Ah.call(r,fr),t=r[fr];try{r[fr]=void 0;var n=!0}catch{}var i=Eh.call(r);return n&&(e?r[fr]=t:delete r[fr]),i}var Sh=Oh,Ih=Object.prototype,Ph=Ih.toString;function Th(r){return Ph.call(r)}var xh=Th,ja=Ge,Rh=Sh,Fh=xh,Mh="[object Null]",Dh="[object Undefined]",ka=ja?ja.toStringTag:void 0;function Bh(r){return r==null?r===void 0?Dh:Mh:ka&&ka in Object(r)?Rh(r):Fh(r)}var se=Bh;function Nh(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var fe=Nh,Uh=se,Ch=fe,Lh="[object AsyncFunction]",jh="[object Function]",kh="[object GeneratorFunction]",qh="[object Proxy]";function Gh(r){if(!Ch(r))return!1;var e=Uh(r);return e==jh||e==kh||e==Lh||e==qh}var xn=Gh,Wh=G,Vh=Wh["__core-js_shared__"],Hh=Vh,Rn=Hh,qa=function(){var r=/[^.]+$/.exec(Rn&&Rn.keys&&Rn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function zh(r){return!!qa&&qa in r}var Xh=zh,Yh=Function.prototype,Kh=Yh.toString;function Zh(r){if(r!=null){try{return Kh.call(r)}catch{}try{return r+""}catch{}}return""}var Ga=Zh,Jh=xn,Qh=Xh,ed=fe,rd=Ga,td=/[\\^$.*+?()[\]{}|]/g,nd=/^\[object .+?Constructor\]$/,id=Function.prototype,ad=Object.prototype,od=id.toString,ud=ad.hasOwnProperty,sd=RegExp("^"+od.call(ud).replace(td,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fd(r){if(!ed(r)||Qh(r))return!1;var e=Jh(r)?sd:nd;return e.test(rd(r))}var cd=fd;function ld(r,e){return r?.[e]}var pd=ld,hd=cd,dd=pd;function yd(r,e){var t=dd(r,e);return hd(t)?t:void 0}var Se=yd,vd=Se,gd=G,_d=vd(gd,"Map"),Fn=_d,md=Se,wd=md(Object,"create"),nt=wd,Wa=nt;function bd(){this.__data__=Wa?Wa(null):{},this.size=0}var $d=bd;function Ad(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var Ed=Ad,Od=nt,Sd="__lodash_hash_undefined__",Id=Object.prototype,Pd=Id.hasOwnProperty;function Td(r){var e=this.__data__;if(Od){var t=e[r];return t===Sd?void 0:t}return Pd.call(e,r)?e[r]:void 0}var xd=Td,Rd=nt,Fd=Object.prototype,Md=Fd.hasOwnProperty;function Dd(r){var e=this.__data__;return Rd?e[r]!==void 0:Md.call(e,r)}var Bd=Dd,Nd=nt,Ud="__lodash_hash_undefined__";function Cd(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Nd&&e===void 0?Ud:e,this}var Ld=Cd,jd=$d,kd=Ed,qd=xd,Gd=Bd,Wd=Ld;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=jd,We.prototype.delete=kd,We.prototype.get=qd,We.prototype.has=Gd,We.prototype.set=Wd;var Vd=We,Va=Vd,Hd=tt,zd=Fn;function Xd(){this.size=0,this.__data__={hash:new Va,map:new(zd||Hd),string:new Va}}var Yd=Xd;function Kd(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var Zd=Kd,Jd=Zd;function Qd(r,e){var t=r.__data__;return Jd(e)?t[typeof e=="string"?"string":"hash"]:t.map}var it=Qd,ey=it;function ry(r){var e=ey(this,r).delete(r);return this.size-=e?1:0,e}var ty=ry,ny=it;function iy(r){return ny(this,r).get(r)}var ay=iy,oy=it;function uy(r){return oy(this,r).has(r)}var sy=uy,fy=it;function cy(r,e){var t=fy(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var ly=cy,py=Yd,hy=ty,dy=ay,yy=sy,vy=ly;function Ve(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])}}Ve.prototype.clear=py,Ve.prototype.delete=hy,Ve.prototype.get=dy,Ve.prototype.has=yy,Ve.prototype.set=vy;var Mn=Ve,gy=tt,_y=Fn,my=Mn,wy=200;function by(r,e){var t=this.__data__;if(t instanceof gy){var n=t.__data__;if(!_y||n.length<wy-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new my(n)}return t.set(r,e),this.size=t.size,this}var $y=by,Ay=tt,Ey=ch,Oy=ph,Sy=dh,Iy=vh,Py=$y;function He(r){var e=this.__data__=new Ay(r);this.size=e.size}He.prototype.clear=Ey,He.prototype.delete=Oy,He.prototype.get=Sy,He.prototype.has=Iy,He.prototype.set=Py;var Dn=He;function Ty(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var Bn=Ty,xy=Se,Ry=function(){try{var r=xy(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Ha=Ry,za=Ha;function Fy(r,e,t){e=="__proto__"&&za?za(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Xa=Fy,My=Xa,Dy=et,By=Object.prototype,Ny=By.hasOwnProperty;function Uy(r,e,t){var n=r[e];(!(Ny.call(r,e)&&Dy(n,t))||t===void 0&&!(e in r))&&My(r,e,t)}var Ya=Uy,Cy=Ya,Ly=Xa;function jy(r,e,t,n){var i=!t;t||(t={});for(var a=-1,o=e.length;++a<o;){var s=e[a],f=n?n(t[s],r[s],s,t,r):void 0;f===void 0&&(f=r[s]),i?Ly(t,s,f):Cy(t,s,f)}return t}var ze=jy;function ky(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var Ka=ky;function qy(r){return r!=null&&typeof r=="object"}var V=qy,Gy=se,Wy=V,Vy="[object Arguments]";function Hy(r){return Wy(r)&&Gy(r)==Vy}var zy=Hy,Za=zy,Xy=V,Ja=Object.prototype,Yy=Ja.hasOwnProperty,Ky=Ja.propertyIsEnumerable,Zy=Za(function(){return arguments}())?Za:function(r){return Xy(r)&&Yy.call(r,"callee")&&!Ky.call(r,"callee")},Nn=Zy,Jy=Array.isArray,U=Jy,cr={exports:{}};function Qy(){return!1}var ev=Qy;(function(r,e){var t=G,n=ev,i=e&&!e.nodeType&&e,a=i&&!0&&r&&!r.nodeType&&r,o=a&&a.exports===i,s=o?t.Buffer:void 0,f=s?s.isBuffer:void 0,c=f||n;r.exports=c})(cr,cr.exports);var rv=9007199254740991,tv=/^(?:0|[1-9]\d*)$/;function nv(r,e){var t=typeof r;return e=e??rv,!!e&&(t=="number"||t!="symbol"&&tv.test(r))&&r>-1&&r%1==0&&r<e}var at=nv,iv=9007199254740991;function av(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=iv}var Un=av,ov=se,uv=Un,sv=V,fv="[object Arguments]",cv="[object Array]",lv="[object Boolean]",pv="[object Date]",hv="[object Error]",dv="[object Function]",yv="[object Map]",vv="[object Number]",gv="[object Object]",_v="[object RegExp]",mv="[object Set]",wv="[object String]",bv="[object WeakMap]",$v="[object ArrayBuffer]",Av="[object DataView]",Ev="[object Float32Array]",Ov="[object Float64Array]",Sv="[object Int8Array]",Iv="[object Int16Array]",Pv="[object Int32Array]",Tv="[object Uint8Array]",xv="[object Uint8ClampedArray]",Rv="[object Uint16Array]",Fv="[object Uint32Array]",F={};F[Ev]=F[Ov]=F[Sv]=F[Iv]=F[Pv]=F[Tv]=F[xv]=F[Rv]=F[Fv]=!0,F[fv]=F[cv]=F[$v]=F[lv]=F[Av]=F[pv]=F[hv]=F[dv]=F[yv]=F[vv]=F[gv]=F[_v]=F[mv]=F[wv]=F[bv]=!1;function Mv(r){return sv(r)&&uv(r.length)&&!!F[ov(r)]}var Dv=Mv;function Bv(r){return function(e){return r(e)}}var Cn=Bv,lr={exports:{}};(function(r,e){var t=Ua,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a&&t.process,s=function(){try{var f=i&&i.require&&i.require("util").types;return f||o&&o.binding&&o.binding("util")}catch{}}();r.exports=s})(lr,lr.exports);var Nv=Dv,Uv=Cn,Qa=lr.exports,eo=Qa&&Qa.isTypedArray,Cv=eo?Uv(eo):Nv,ro=Cv,Lv=Ka,jv=Nn,kv=U,qv=cr.exports,Gv=at,Wv=ro,Vv=Object.prototype,Hv=Vv.hasOwnProperty;function zv(r,e){var t=kv(r),n=!t&&jv(r),i=!t&&!n&&qv(r),a=!t&&!n&&!i&&Wv(r),o=t||n||i||a,s=o?Lv(r.length,String):[],f=s.length;for(var c in r)(e||Hv.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Gv(c,f)))&&s.push(c);return s}var to=zv,Xv=Object.prototype;function Yv(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Xv;return r===t}var Ln=Yv;function Kv(r,e){return function(t){return r(e(t))}}var no=Kv,Zv=no,Jv=Zv(Object.keys,Object),Qv=Jv,eg=Ln,rg=Qv,tg=Object.prototype,ng=tg.hasOwnProperty;function ig(r){if(!eg(r))return rg(r);var e=[];for(var t in Object(r))ng.call(r,t)&&t!="constructor"&&e.push(t);return e}var ag=ig,og=xn,ug=Un;function sg(r){return r!=null&&ug(r.length)&&!og(r)}var pr=sg,fg=to,cg=ag,lg=pr;function pg(r){return lg(r)?fg(r):cg(r)}var Xe=pg,hg=ze,dg=Xe;function yg(r,e){return r&&hg(e,dg(e),r)}var vg=yg;function gg(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var _g=gg,mg=fe,wg=Ln,bg=_g,$g=Object.prototype,Ag=$g.hasOwnProperty;function Eg(r){if(!mg(r))return bg(r);var e=wg(r),t=[];for(var n in r)n=="constructor"&&(e||!Ag.call(r,n))||t.push(n);return t}var Og=Eg,Sg=to,Ig=Og,Pg=pr;function Tg(r){return Pg(r)?Sg(r,!0):Ig(r)}var ot=Tg,xg=ze,Rg=ot;function Fg(r,e){return r&&xg(e,Rg(e),r)}var Mg=Fg,jn={exports:{}};(function(r,e){var t=G,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function f(c,l){if(l)return c.slice();var u=c.length,p=s?s(u):new c.constructor(u);return c.copy(p),p}r.exports=f})(jn,jn.exports);function Dg(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var kn=Dg;function Bg(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 Ng=Bg;function Ug(){return[]}var io=Ug,Cg=Ng,Lg=io,jg=Object.prototype,kg=jg.propertyIsEnumerable,ao=Object.getOwnPropertySymbols,qg=ao?function(r){return r==null?[]:(r=Object(r),Cg(ao(r),function(e){return kg.call(r,e)}))}:Lg,qn=qg,Gg=ze,Wg=qn;function Vg(r,e){return Gg(r,Wg(r),e)}var Hg=Vg;function zg(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Gn=zg,Xg=no,Yg=Xg(Object.getPrototypeOf,Object),Wn=Yg,Kg=Gn,Zg=Wn,Jg=qn,Qg=io,e_=Object.getOwnPropertySymbols,r_=e_?function(r){for(var e=[];r;)Kg(e,Jg(r)),r=Zg(r);return e}:Qg,oo=r_,t_=ze,n_=oo;function i_(r,e){return t_(r,n_(r),e)}var a_=i_,o_=Gn,u_=U;function s_(r,e,t){var n=e(r);return u_(r)?n:o_(n,t(r))}var uo=s_,f_=uo,c_=qn,l_=Xe;function p_(r){return f_(r,l_,c_)}var so=p_,h_=uo,d_=oo,y_=ot;function v_(r){return h_(r,y_,d_)}var fo=v_,g_=Se,__=G,m_=g_(__,"DataView"),w_=m_,b_=Se,$_=G,A_=b_($_,"Promise"),E_=A_,O_=Se,S_=G,I_=O_(S_,"Set"),P_=I_,T_=Se,x_=G,R_=T_(x_,"WeakMap"),co=R_,Vn=w_,Hn=Fn,zn=E_,Xn=P_,Yn=co,lo=se,Ye=Ga,po="[object Map]",F_="[object Object]",ho="[object Promise]",yo="[object Set]",vo="[object WeakMap]",go="[object DataView]",M_=Ye(Vn),D_=Ye(Hn),B_=Ye(zn),N_=Ye(Xn),U_=Ye(Yn),Ie=lo;(Vn&&Ie(new Vn(new ArrayBuffer(1)))!=go||Hn&&Ie(new Hn)!=po||zn&&Ie(zn.resolve())!=ho||Xn&&Ie(new Xn)!=yo||Yn&&Ie(new Yn)!=vo)&&(Ie=function(r){var e=lo(r),t=e==F_?r.constructor:void 0,n=t?Ye(t):"";if(n)switch(n){case M_:return go;case D_:return po;case B_:return ho;case N_:return yo;case U_:return vo}return e});var ut=Ie,C_=Object.prototype,L_=C_.hasOwnProperty;function j_(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&L_.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var k_=j_,q_=G,G_=q_.Uint8Array,_o=G_,mo=_o;function W_(r){var e=new r.constructor(r.byteLength);return new mo(e).set(new mo(r)),e}var Kn=W_,V_=Kn;function H_(r,e){var t=e?V_(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}var z_=H_,X_=/\w*$/;function Y_(r){var e=new r.constructor(r.source,X_.exec(r));return e.lastIndex=r.lastIndex,e}var K_=Y_,wo=Ge,bo=wo?wo.prototype:void 0,$o=bo?bo.valueOf:void 0;function Z_(r){return $o?Object($o.call(r)):{}}var J_=Z_,Q_=Kn;function em(r,e){var t=e?Q_(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var rm=em,tm=Kn,nm=z_,im=K_,am=J_,om=rm,um="[object Boolean]",sm="[object Date]",fm="[object Map]",cm="[object Number]",lm="[object RegExp]",pm="[object Set]",hm="[object String]",dm="[object Symbol]",ym="[object ArrayBuffer]",vm="[object DataView]",gm="[object Float32Array]",_m="[object Float64Array]",mm="[object Int8Array]",wm="[object Int16Array]",bm="[object Int32Array]",$m="[object Uint8Array]",Am="[object Uint8ClampedArray]",Em="[object Uint16Array]",Om="[object Uint32Array]";function Sm(r,e,t){var n=r.constructor;switch(e){case ym:return tm(r);case um:case sm:return new n(+r);case vm:return nm(r,t);case gm:case _m:case mm:case wm:case bm:case $m:case Am:case Em:case Om:return om(r,t);case fm:return new n;case cm:case hm:return new n(r);case lm:return im(r);case pm:return new n;case dm:return am(r)}}var Im=Sm,Pm=fe,Ao=Object.create,Tm=function(){function r(){}return function(e){if(!Pm(e))return{};if(Ao)return Ao(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}(),st=Tm,xm=st,Rm=Wn,Fm=Ln;function Mm(r){return typeof r.constructor=="function"&&!Fm(r)?xm(Rm(r)):{}}var Dm=Mm,Bm=ut,Nm=V,Um="[object Map]";function Cm(r){return Nm(r)&&Bm(r)==Um}var Lm=Cm,jm=Lm,km=Cn,Eo=lr.exports,Oo=Eo&&Eo.isMap,qm=Oo?km(Oo):jm,Gm=qm,Wm=ut,Vm=V,Hm="[object Set]";function zm(r){return Vm(r)&&Wm(r)==Hm}var Xm=zm,Ym=Xm,Km=Cn,So=lr.exports,Io=So&&So.isSet,Zm=Io?Km(Io):Ym,Jm=Zm,Qm=Dn,ew=Bn,rw=Ya,tw=vg,nw=Mg,iw=jn.exports,aw=kn,ow=Hg,uw=a_,sw=so,fw=fo,cw=ut,lw=k_,pw=Im,hw=Dm,dw=U,yw=cr.exports,vw=Gm,gw=fe,_w=Jm,mw=Xe,ww=ot,bw=1,$w=2,Aw=4,Po="[object Arguments]",Ew="[object Array]",Ow="[object Boolean]",Sw="[object Date]",Iw="[object Error]",To="[object Function]",Pw="[object GeneratorFunction]",Tw="[object Map]",xw="[object Number]",xo="[object Object]",Rw="[object RegExp]",Fw="[object Set]",Mw="[object String]",Dw="[object Symbol]",Bw="[object WeakMap]",Nw="[object ArrayBuffer]",Uw="[object DataView]",Cw="[object Float32Array]",Lw="[object Float64Array]",jw="[object Int8Array]",kw="[object Int16Array]",qw="[object Int32Array]",Gw="[object Uint8Array]",Ww="[object Uint8ClampedArray]",Vw="[object Uint16Array]",Hw="[object Uint32Array]",x={};x[Po]=x[Ew]=x[Nw]=x[Uw]=x[Ow]=x[Sw]=x[Cw]=x[Lw]=x[jw]=x[kw]=x[qw]=x[Tw]=x[xw]=x[xo]=x[Rw]=x[Fw]=x[Mw]=x[Dw]=x[Gw]=x[Ww]=x[Vw]=x[Hw]=!0,x[Iw]=x[To]=x[Bw]=!1;function ft(r,e,t,n,i,a){var o,s=e&bw,f=e&$w,c=e&Aw;if(t&&(o=i?t(r,n,i,a):t(r)),o!==void 0)return o;if(!gw(r))return r;var l=dw(r);if(l){if(o=lw(r),!s)return aw(r,o)}else{var u=cw(r),p=u==To||u==Pw;if(yw(r))return iw(r,s);if(u==xo||u==Po||p&&!i){if(o=f||p?{}:hw(r),!s)return f?uw(r,nw(o,r)):ow(r,tw(o,r))}else{if(!x[u])return i?r:{};o=pw(r,u,s)}}a||(a=new Qm);var d=a.get(r);if(d)return d;a.set(r,o),_w(r)?r.forEach(function(b){o.add(ft(b,e,t,b,r,a))}):vw(r)&&r.forEach(function(b,w){o.set(w,ft(b,e,t,w,r,a))});var _=c?f?fw:sw:f?ww:mw,$=l?void 0:_(r);return ew($||r,function(b,w){$&&(w=b,b=r[w]),rw(o,w,ft(b,e,t,w,r,a))}),o}var zw=ft,Xw=se,Yw=V,Kw="[object Symbol]";function Zw(r){return typeof r=="symbol"||Yw(r)&&Xw(r)==Kw}var ct=Zw,Jw=U,Qw=ct,e0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r0=/^\w*$/;function t0(r,e){if(Jw(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||Qw(r)?!0:r0.test(r)||!e0.test(r)||e!=null&&r in Object(e)}var Zn=t0,Ro=Mn,n0="Expected a function";function Jn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(n0);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(Jn.Cache||Ro),t}Jn.Cache=Ro;var i0=Jn,a0=i0,o0=500;function u0(r){var e=a0(r,function(n){return t.size===o0&&t.clear(),n}),t=e.cache;return e}var s0=u0,f0=s0,c0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,l0=/\\(\\)?/g,p0=f0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(c0,function(t,n,i,a){e.push(i?a.replace(l0,"$1"):n||t)}),e}),h0=p0,Fo=Ge,d0=Qr,y0=U,v0=ct,g0=1/0,Mo=Fo?Fo.prototype:void 0,Do=Mo?Mo.toString:void 0;function Bo(r){if(typeof r=="string")return r;if(y0(r))return d0(r,Bo)+"";if(v0(r))return Do?Do.call(r):"";var e=r+"";return e=="0"&&1/r==-g0?"-0":e}var _0=Bo,m0=_0;function w0(r){return r==null?"":m0(r)}var b0=w0,$0=U,A0=Zn,E0=h0,O0=b0;function S0(r,e){return $0(r)?r:A0(r,e)?[r]:E0(O0(r))}var lt=S0;function I0(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var P0=I0,T0=ct,x0=1/0;function R0(r){if(typeof r=="string"||T0(r))return r;var e=r+"";return e=="0"&&1/r==-x0?"-0":e}var hr=R0,F0=lt,M0=hr;function D0(r,e){e=F0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[M0(e[t++])];return t&&t==n?r:void 0}var Qn=D0;function B0(r,e,t){var n=-1,i=r.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=r[n+e];return a}var N0=B0,U0=Qn,C0=N0;function L0(r,e){return e.length<2?r:U0(r,C0(e,0,-1))}var j0=L0,k0=lt,q0=P0,G0=j0,W0=hr;function V0(r,e){return e=k0(e,r),r=G0(r,e),r==null||delete r[W0(q0(e))]}var H0=V0,z0=se,X0=Wn,Y0=V,K0="[object Object]",Z0=Function.prototype,J0=Object.prototype,No=Z0.toString,Q0=J0.hasOwnProperty,eb=No.call(Object);function rb(r){if(!Y0(r)||z0(r)!=K0)return!1;var e=X0(r);if(e===null)return!0;var t=Q0.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&No.call(t)==eb}var tb=rb,nb=tb;function ib(r){return nb(r)?void 0:r}var ab=ib,Uo=Ge,ob=Nn,ub=U,Co=Uo?Uo.isConcatSpreadable:void 0;function sb(r){return ub(r)||ob(r)||!!(Co&&r&&r[Co])}var fb=sb,cb=Gn,lb=fb;function Lo(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=lb),i||(i=[]);++a<o;){var s=r[a];e>0&&t(s)?e>1?Lo(s,e-1,t,n,i):cb(i,s):n||(i[i.length]=s)}return i}var pb=Lo,hb=pb;function db(r){var e=r==null?0:r.length;return e?hb(r,1):[]}var yb=db;function vb(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 ei=vb,gb=ei,jo=Math.max;function _b(r,e,t){return e=jo(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=jo(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=t(o),gb(r,this,s)}}var ko=_b;function mb(r){return function(){return r}}var wb=mb;function bb(r){return r}var dr=bb,$b=wb,qo=Ha,Ab=dr,Eb=qo?function(r,e){return qo(r,"toString",{configurable:!0,enumerable:!1,value:$b(e),writable:!0})}:Ab,Ob=Eb,Sb=800,Ib=16,Pb=Date.now;function Tb(r){var e=0,t=0;return function(){var n=Pb(),i=Ib-(n-t);if(t=n,i>0){if(++e>=Sb)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var Go=Tb,xb=Ob,Rb=Go,Fb=Rb(xb),ri=Fb,Mb=yb,Db=ko,Bb=ri;function Nb(r){return Bb(Db(r,void 0,Mb),r+"")}var Ub=Nb,Cb=Qr,Lb=zw,jb=H0,kb=lt,qb=ze,Gb=ab,Wb=Ub,Vb=fo,Hb=1,zb=2,Xb=4,Yb=Wb(function(r,e){var t={};if(r==null)return t;var n=!1;e=Cb(e,function(a){return a=kb(a,r),n||(n=a.length>1),a}),qb(r,Vb(r),t),n&&(t=Lb(t,Hb|zb|Xb,Gb));for(var i=e.length;i--;)jb(t,e[i]);return t}),ti=Yb,Kb=Object.defineProperty,Zb=Object.defineProperties,Jb=Object.getOwnPropertyDescriptors,Wo=Object.getOwnPropertySymbols,Qb=Object.prototype.hasOwnProperty,e1=Object.prototype.propertyIsEnumerable,Vo=(r,e,t)=>e in r?Kb(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,r1=(r,e)=>{for(var t in e||(e={}))Qb.call(e,t)&&Vo(r,t,e[t]);if(Wo)for(var t of Wo(e))e1.call(e,t)&&Vo(r,t,e[t]);return r},t1=(r,e)=>Zb(r,Jb(e));function n1(r){try{return JSON.parse(r)}catch{return r}}function i1(r){return Object.entries(r).reduce((e,[t,n])=>t1(r1({},e),{[t]:n1(n)}),{})}const Ho=r=>typeof r=="string"?r!=="0"&&r!=="false":!!r;var a1=Object.defineProperty,o1=Object.defineProperties,u1=Object.getOwnPropertyDescriptors,zo=Object.getOwnPropertySymbols,s1=Object.prototype.hasOwnProperty,f1=Object.prototype.propertyIsEnumerable,Xo=(r,e,t)=>e in r?a1(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Yo=(r,e)=>{for(var t in e||(e={}))s1.call(e,t)&&Xo(r,t,e[t]);if(zo)for(var t of zo(e))f1.call(e,t)&&Xo(r,t,e[t]);return r},Ko=(r,e)=>o1(r,u1(e));function Zo(r){var e;const t=i1(r),n=t.auto_inject===void 0?!0:t.auto_inject,i=(e=t.display_on)!=null?e:[],a=t.first_option==="autodeliver";return Ko(Yo({},ti(t,["display_on","first_option"])),{auto_inject:n,valid_pages:i,is_subscription_first:a,autoInject:n,validPages:i,isSubscriptionFirst:a})}function Jo(r){var e;const t=((e=r.subscription_options)==null?void 0:e.storefront_purchase_options)==="subscription_only";return Ko(Yo({},r),{is_subscription_only:t,isSubscriptionOnly:t})}function c1(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=Jo(i)}),t})}const pt="2020-12",l1={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},yr=new Map;function ht(r,e){return yr.has(r)||yr.set(r,e()),yr.get(r)}async function ni(r){const{product:e}=await ht(`product.${r}`,()=>Jr("get",`/product/${pt}/${r}.json`));return Jo(e)}async function Qo(){return await ht("storeSettings",()=>Jr("get",`/${pt}/store_settings.json`).catch(()=>l1))}async function eu(){const{widget_settings:r}=await ht("widgetSettings",()=>Jr("get",`/${pt}/widget_settings.json`));return Zo(r)}async function ru(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await ht("productsAndSettings",()=>Jr("get",`/product/${pt}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:c1(r),widget_settings:Zo(e),store_settings:t??{}}}async function p1(){const{products:r}=await ru();return r}async function h1(r){const[e,t,n]=await Promise.all([ni(r),Qo(),eu()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function tu(r){const{bundle_product:e}=await ni(r);return e}async function nu(){return Array.from(yr.keys()).forEach(r=>yr.delete(r))}var d1=Object.freeze({__proto__:null,getCDNProduct:ni,getCDNStoreSettings:Qo,getCDNWidgetSettings:eu,getCDNProductsAndSettings:ru,getCDNProducts:p1,getCDNProductAndSettings:h1,getCDNBundleSettings:tu,resetCDNCache:nu}),iu={},ii={},ce={},y1=se,v1=V,g1="[object Number]";function _1(r){return typeof r=="number"||v1(r)&&y1(r)==g1}var dt=_1,M={},au={exports:{}},m1=dr,w1=ko,b1=ri;function $1(r,e){return b1(w1(r,e,m1),r+"")}var ou=$1,A1=et,E1=pr,O1=at,S1=fe;function I1(r,e,t){if(!S1(t))return!1;var n=typeof e;return(n=="number"?E1(t)&&O1(e,t.length):n=="string"&&e in t)?A1(t[e],r):!1}var uu=I1,P1=ou,T1=uu;function x1(r){return P1(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&&T1(t[0],t[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var s=t[n];s&&r(e,s,n,a)}return e})}var R1=x1,F1=ze,M1=R1,D1=ot,B1=M1(function(r,e){F1(e,D1(e),r)}),N1=B1;(function(r){r.exports=N1})(au);var yt={},Pe={};function U1(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 C1=U1;function L1(r){return function(e,t,n){for(var i=-1,a=Object(e),o=n(e),s=o.length;s--;){var f=o[r?s:++i];if(t(a[f],f,a)===!1)break}return e}}var j1=L1,k1=j1,q1=k1(),G1=q1,W1=G1,V1=Xe;function H1(r,e){return r&&W1(r,e,V1)}var z1=H1,X1=pr;function Y1(r,e){return function(t,n){if(t==null)return t;if(!X1(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 K1=Y1,Z1=z1,J1=K1,Q1=J1(Z1),ai=Q1,e$=ai;function r$(r,e){var t=!0;return e$(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var t$=r$,n$="__lodash_hash_undefined__";function i$(r){return this.__data__.set(r,n$),this}var a$=i$;function o$(r){return this.__data__.has(r)}var u$=o$,s$=Mn,f$=a$,c$=u$;function vt(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new s$;++e<t;)this.add(r[e])}vt.prototype.add=vt.prototype.push=f$,vt.prototype.has=c$;var l$=vt;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 h$=p$;function d$(r,e){return r.has(e)}var y$=d$,v$=l$,g$=h$,_$=y$,m$=1,w$=2;function b$(r,e,t,n,i,a){var o=t&m$,s=r.length,f=e.length;if(s!=f&&!(o&&f>s))return!1;var c=a.get(r),l=a.get(e);if(c&&l)return c==e&&l==r;var u=-1,p=!0,d=t&w$?new v$:void 0;for(a.set(r,e),a.set(e,r);++u<s;){var _=r[u],$=e[u];if(n)var b=o?n($,_,u,e,r,a):n(_,$,u,r,e,a);if(b!==void 0){if(b)continue;p=!1;break}if(d){if(!g$(e,function(w,A){if(!_$(d,A)&&(_===w||i(_,w,t,n,a)))return d.push(A)})){p=!1;break}}else if(!(_===$||i(_,$,t,n,a))){p=!1;break}}return a.delete(r),a.delete(e),p}var su=b$;function $$(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var A$=$$;function E$(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var O$=E$,fu=Ge,cu=_o,S$=et,I$=su,P$=A$,T$=O$,x$=1,R$=2,F$="[object Boolean]",M$="[object Date]",D$="[object Error]",B$="[object Map]",N$="[object Number]",U$="[object RegExp]",C$="[object Set]",L$="[object String]",j$="[object Symbol]",k$="[object ArrayBuffer]",q$="[object DataView]",lu=fu?fu.prototype:void 0,oi=lu?lu.valueOf:void 0;function G$(r,e,t,n,i,a,o){switch(t){case q$:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case k$:return!(r.byteLength!=e.byteLength||!a(new cu(r),new cu(e)));case F$:case M$:case N$:return S$(+r,+e);case D$:return r.name==e.name&&r.message==e.message;case U$:case L$:return r==e+"";case B$:var s=P$;case C$:var f=n&x$;if(s||(s=T$),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=R$,o.set(r,e);var l=I$(s(r),s(e),n,i,a,o);return o.delete(r),l;case j$:if(oi)return oi.call(r)==oi.call(e)}return!1}var W$=G$,pu=so,V$=1,H$=Object.prototype,z$=H$.hasOwnProperty;function X$(r,e,t,n,i,a){var o=t&V$,s=pu(r),f=s.length,c=pu(e),l=c.length;if(f!=l&&!o)return!1;for(var u=f;u--;){var p=s[u];if(!(o?p in e:z$.call(e,p)))return!1}var d=a.get(r),_=a.get(e);if(d&&_)return d==e&&_==r;var $=!0;a.set(r,e),a.set(e,r);for(var b=o;++u<f;){p=s[u];var w=r[p],A=e[p];if(n)var h=o?n(A,w,p,e,r,a):n(w,A,p,r,e,a);if(!(h===void 0?w===A||i(w,A,t,n,a):h)){$=!1;break}b||(b=p=="constructor")}if($&&!b){var I=r.constructor,P=e.constructor;I!=P&&"constructor"in r&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof P=="function"&&P instanceof P)&&($=!1)}return a.delete(r),a.delete(e),$}var Y$=X$,ui=Dn,K$=su,Z$=W$,J$=Y$,hu=ut,du=U,yu=cr.exports,Q$=ro,eA=1,vu="[object Arguments]",gu="[object Array]",gt="[object Object]",rA=Object.prototype,_u=rA.hasOwnProperty;function tA(r,e,t,n,i,a){var o=du(r),s=du(e),f=o?gu:hu(r),c=s?gu:hu(e);f=f==vu?gt:f,c=c==vu?gt:c;var l=f==gt,u=c==gt,p=f==c;if(p&&yu(r)){if(!yu(e))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new ui),o||Q$(r)?K$(r,e,t,n,i,a):Z$(r,e,f,t,n,i,a);if(!(t&eA)){var d=l&&_u.call(r,"__wrapped__"),_=u&&_u.call(e,"__wrapped__");if(d||_){var $=d?r.value():r,b=_?e.value():e;return a||(a=new ui),i($,b,t,n,a)}}return p?(a||(a=new ui),J$(r,e,t,n,i,a)):!1}var nA=tA,iA=nA,mu=V;function wu(r,e,t,n,i){return r===e?!0:r==null||e==null||!mu(r)&&!mu(e)?r!==r&&e!==e:iA(r,e,t,n,wu,i)}var bu=wu,aA=Dn,oA=bu,uA=1,sA=2;function fA(r,e,t,n){var i=t.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var s=t[i];if(o&&s[2]?s[1]!==r[s[0]]:!(s[0]in r))return!1}for(;++i<a;){s=t[i];var f=s[0],c=r[f],l=s[1];if(o&&s[2]){if(c===void 0&&!(f in r))return!1}else{var u=new aA;if(n)var p=n(c,l,f,r,e,u);if(!(p===void 0?oA(l,c,uA|sA,n,u):p))return!1}}return!0}var cA=fA,lA=fe;function pA(r){return r===r&&!lA(r)}var $u=pA,hA=$u,dA=Xe;function yA(r){for(var e=dA(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,hA(i)]}return e}var vA=yA;function gA(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var Au=gA,_A=cA,mA=vA,wA=Au;function bA(r){var e=mA(r);return e.length==1&&e[0][2]?wA(e[0][0],e[0][1]):function(t){return t===r||_A(t,r,e)}}var $A=bA,AA=Qn;function EA(r,e,t){var n=r==null?void 0:AA(r,e);return n===void 0?t:n}var OA=EA;function SA(r,e){return r!=null&&e in Object(r)}var IA=SA,PA=lt,TA=Nn,xA=U,RA=at,FA=Un,MA=hr;function DA(r,e,t){e=PA(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=MA(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&&FA(i)&&RA(o,i)&&(xA(r)||TA(r)))}var BA=DA,NA=IA,UA=BA;function CA(r,e){return r!=null&&UA(r,e,NA)}var LA=CA,jA=bu,kA=OA,qA=LA,GA=Zn,WA=$u,VA=Au,HA=hr,zA=1,XA=2;function YA(r,e){return GA(r)&&WA(e)?VA(HA(r),e):function(t){var n=kA(t,r);return n===void 0&&n===e?qA(t,r):jA(e,n,zA|XA)}}var KA=YA;function ZA(r){return function(e){return e?.[r]}}var JA=ZA,QA=Qn;function eE(r){return function(e){return QA(e,r)}}var rE=eE,tE=JA,nE=rE,iE=Zn,aE=hr;function oE(r){return iE(r)?tE(aE(r)):nE(r)}var uE=oE,sE=$A,fE=KA,cE=dr,lE=U,pE=uE;function hE(r){return typeof r=="function"?r:r==null?cE:typeof r=="object"?lE(r)?fE(r[0],r[1]):sE(r):pE(r)}var Eu=hE,dE=C1,yE=t$,vE=Eu,gE=U,_E=uu;function mE(r,e,t){var n=gE(r)?dE:yE;return t&&_E(r,e,t)&&(e=void 0),n(r,vE(e))}var si=mE;Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.calculatePadding=AE,Pe.slicePadding=EE;var wE=si,bE=$E(wE);function $E(r){return r&&r.__esModule?r:{default:r}}function AE(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function EE(r,e){var t=r.slice(e),n=(0,bE.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(yt,"__esModule",{value:!0}),yt.Cursor=void 0;var OE=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}}(),SE=Pe;function IE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var fi=function(){function r(e){IE(this,r),e instanceof y||(e=typeof e=="number"?y.alloc(e):y.from(e)),this._setBuffer(e),this.rewind()}return OE(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 y?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=y.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,SE.calculatePadding)(t.length),i=y.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){fi.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){fi.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),yt.Cursor=fi,Object.defineProperty(M,"__esModule",{value:!0}),M.default=DE;var PE=au.exports,Ou=Iu(PE),TE=xn,xE=Iu(TE),Su=yt;function Iu(r){return r&&r.__esModule?r:{default:r}}var RE=Math.pow(2,16),FE={toXDR:function(e){var t=new Su.Cursor(RE);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=y.from(e,"hex");break;case"base64":n=y.from(e,"base64");break;default:throw new Error("Invalid format "+t+', must be "raw", "hex", "base64"')}var i=new Su.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}}},ME={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 DE(r){(0,Ou.default)(r,FE),(0,xE.default)(r)&&(0,Ou.default)(r.prototype,ME)}Object.defineProperty(ce,"__esModule",{value:!0}),ce.Int=void 0;var BE=dt,Pu=Tu(BE),NE=M,UE=Tu(NE);function Tu(r){return r&&r.__esModule?r:{default:r}}var vr=ce.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,Pu.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,Pu.default)(e)||Math.floor(e)!==e?!1:e>=vr.MIN_VALUE&&e<=vr.MAX_VALUE}};vr.MAX_VALUE=Math.pow(2,31)-1,vr.MIN_VALUE=-Math.pow(2,31),(0,UE.default)(vr);var _t={};function CE(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 ci={exports:{}};(function(r){/**
|
|
20
|
+
`+e.prev}function zr(r,e){var t=mn(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=ve(r,i)?e(r[i],r):""}var a=typeof vn=="function"?vn(r):[],o;if(je){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var f in r)!ve(r,f)||t&&String(Number(f))===f&&f<r.length||je&&o["$"+f]instanceof Symbol||(da.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r)));if(typeof vn=="function")for(var c=0;c<a.length;c++)ga.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var $n=Xt,ke=Cf,Fl=hl,Ml=$n("%TypeError%"),Xr=$n("%WeakMap%",!0),Yr=$n("%Map%",!0),Dl=ke("WeakMap.prototype.get",!0),Bl=ke("WeakMap.prototype.set",!0),Nl=ke("WeakMap.prototype.has",!0),Ul=ke("Map.prototype.get",!0),Cl=ke("Map.prototype.set",!0),Ll=ke("Map.prototype.has",!0),An=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},jl=function(r,e){var t=An(r,e);return t&&t.value},kl=function(r,e,t){var n=An(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},ql=function(r,e){return!!An(r,e)},Gl=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new Ml("Side channel does not contain "+Fl(a))},get:function(a){if(Xr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Dl(e,a)}else if(Yr){if(t)return Ul(t,a)}else if(n)return jl(n,a)},has:function(a){if(Xr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Nl(e,a)}else if(Yr){if(t)return Ll(t,a)}else if(n)return ql(n,a);return!1},set:function(a,o){Xr&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new Xr),Bl(e,a,o)):Yr?(t||(t=new Yr),Cl(t,a,o)):(n||(n={key:{},next:null}),kl(n,a,o))}};return i},Wl=String.prototype.replace,Vl=/%20/g,En={RFC1738:"RFC1738",RFC3986:"RFC3986"},Ia={default:En.RFC3986,formatters:{RFC1738:function(r){return Wl.call(r,Vl,"+")},RFC3986:function(r){return String(r)}},RFC1738:En.RFC1738,RFC3986:En.RFC3986},Hl=Ia,On=Object.prototype.hasOwnProperty,Oe=Array.isArray,re=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),zl=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Oe(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},Ta=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},Xl=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Oe(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!On.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var i=e;return Oe(e)&&!Oe(t)&&(i=Ta(e,n)),Oe(e)&&Oe(t)?(t.forEach(function(a,o){if(On.call(e,o)){var s=e[o];s&&typeof s=="object"&&a&&typeof a=="object"?e[o]=r(s,a,n):e.push(a)}else e[o]=a}),e):Object.keys(t).reduce(function(a,o){var s=t[o];return On.call(a,o)?a[o]=r(a[o],s,n):a[o]=s,a},i)},Yl=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},Kl=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}},Zl=function(e,t,n,i,a){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var s="",f=0;f<o.length;++f){var c=o.charCodeAt(f);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||a===Hl.RFC1738&&(c===40||c===41)){s+=o.charAt(f);continue}if(c<128){s=s+re[c];continue}if(c<2048){s=s+(re[192|c>>6]+re[128|c&63]);continue}if(c<55296||c>=57344){s=s+(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),s+=re[240|c>>18]+re[128|c>>12&63]+re[128|c>>6&63]+re[128|c&63]}return s},Jl=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i<t.length;++i)for(var a=t[i],o=a.obj[a.prop],s=Object.keys(o),f=0;f<s.length;++f){var c=s[f],l=o[c];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(t.push({obj:o,prop:c}),n.push(l))}return zl(t),e},Ql=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},ep=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},rp=function(e,t){return[].concat(e,t)},tp=function(e,t){if(Oe(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},np={arrayToObject:Ta,assign:Yl,combine:rp,compact:Jl,decode:Kl,encode:Zl,isBuffer:ep,isRegExp:Ql,maybeMap:tp,merge:Xl},xa=Gl,Sn=np,ur=Ia,ip=Object.prototype.hasOwnProperty,Ra={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},oe=Array.isArray,ap=String.prototype.split,op=Array.prototype.push,Fa=function(r,e){op.apply(r,oe(e)?e:[e])},up=Date.prototype.toISOString,Ma=ur.default,C={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Sn.encode,encodeValuesOnly:!1,format:Ma,formatter:ur.formatters[Ma],indices:!1,serializeDate:function(e){return up.call(e)},skipNulls:!1,strictNullHandling:!1},sp=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Pn={},fp=function r(e,t,n,i,a,o,s,f,c,l,u,p,d,_,$,b){for(var w=e,A=b,h=0,P=!1;(A=A.get(Pn))!==void 0&&!P;){var I=A.get(e);if(h+=1,typeof I<"u"){if(I===h)throw new RangeError("Cyclic object value");P=!0}typeof A.get(Pn)>"u"&&(h=0)}if(typeof f=="function"?w=f(t,w):w instanceof Date?w=u(w):n==="comma"&&oe(w)&&(w=Sn.maybeMap(w,function(Ei){return Ei instanceof Date?u(Ei):Ei})),w===null){if(a)return s&&!_?s(t,C.encoder,$,"key",p):t;w=""}if(sp(w)||Sn.isBuffer(w)){if(s){var R=_?t:s(t,C.encoder,$,"key",p);if(n==="comma"&&_){for(var m=ap.call(String(w),","),v="",g=0;g<m.length;++g)v+=(g===0?"":",")+d(s(m[g],C.encoder,$,"value",p));return[d(R)+(i&&oe(w)&&m.length===1?"[]":"")+"="+v]}return[d(R)+"="+d(s(w,C.encoder,$,"value",p))]}return[d(t)+"="+d(String(w))]}var O=[];if(typeof w>"u")return O;var S;if(n==="comma"&&oe(w))S=[{value:w.length>0?w.join(",")||null:void 0}];else if(oe(f))S=f;else{var B=Object.keys(w);S=c?B.sort(c):B}for(var H=i&&oe(w)&&w.length===1?t+"[]":t,te=0;te<S.length;++te){var X=S[te],Re=typeof X=="object"&&typeof X.value<"u"?X.value:w[X];if(!(o&&Re===null)){var YR=oe(w)?typeof n=="function"?n(H,X):H:H+(l?"."+X:"["+X+"]");b.set(e,h);var af=xa();af.set(Pn,b),Fa(O,r(Re,YR,n,i,a,o,s,f,c,l,u,p,d,_,$,af))}}return O},cp=function(e){if(!e)return C;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||C.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=ur.default;if(typeof e.format<"u"){if(!ip.call(ur.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=ur.formatters[n],a=C.filter;return(typeof e.filter=="function"||oe(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:C.addQueryPrefix,allowDots:typeof e.allowDots>"u"?C.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:C.charsetSentinel,delimiter:typeof e.delimiter>"u"?C.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:C.encode,encoder:typeof e.encoder=="function"?e.encoder:C.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:C.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:C.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:C.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:C.strictNullHandling}},lp=function(r,e){var t=r,n=cp(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):oe(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var s;e&&e.arrayFormat in Ra?s=e.arrayFormat:e&&"indices"in e?s=e.indices?"indices":"repeat":s="indices";var f=Ra[s];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=f==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var l=xa(),u=0;u<i.length;++u){var p=i[u];n.skipNulls&&t[p]===null||Fa(o,fp(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 d=o.join(n.delimiter),_=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),d.length>0?_+d:""};let Da={storeIdentifier:"",environment:"prod"};function pp(r){Da=r}function ue(){return Da}const hp=r=>r==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",In=r=>r==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",dp=r=>r==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",yp="/tools/recurring";class Kr{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}var vp=Object.defineProperty,gp=Object.defineProperties,_p=Object.getOwnPropertyDescriptors,Ba=Object.getOwnPropertySymbols,mp=Object.prototype.hasOwnProperty,wp=Object.prototype.propertyIsEnumerable,Na=(r,e,t)=>e in r?vp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Zr=(r,e)=>{for(var t in e||(e={}))mp.call(e,t)&&Na(r,t,e[t]);if(Ba)for(var t of Ba(e))wp.call(e,t)&&Na(r,t,e[t]);return r},bp=(r,e)=>gp(r,_p(e));function $p(r){return lp(r,{encode:!1,indices:!1,arrayFormat:"comma"})}async function Jr(r,e,t={}){const n=ue();return z(r,`${dp(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function E(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:s,storeIdentifier:f,loginRetryFn:c}=ue(),l=o.apiToken,u=hp(s),p=Zr({"X-Recharge-Access-Token":l,"X-Recharge-Version":"2021-11"},a||{}),d=Zr({shop_url:f},n);try{return await z(r,`${u}${e}`,{id:t,query:d,data:i,headers:p})}catch(_){if(c&&_ instanceof Kr&&_.status===401)return c().then($=>{if($)return z(r,`${u}${e}`,{id:t,query:d,data:i,headers:bp(Zr({},p),{"X-Recharge-Access-Token":$.apiToken})});throw _});throw _}}async function sr(r,e,t={}){return z(r,`${yp}${e}`,t)}async function z(r,e,{id:t,query:n,data:i,headers:a}={}){let o=e.trim();if(t&&(o=[o,`${t}`.trim()].join("/")),n){let u;[o,u]=o.split("?");const p=[u,$p(n)].join("&").replace(/^&/,"");o=`${o}${p?`?${p}`:""}`}let s;i&&r!=="get"&&(s=JSON.stringify(i));const f=Zr({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},a||{}),c=await fetch(o,{method:r,headers:f,body:s,mode:"cors"});let l;try{l=await c.json()}catch{}if(!c.ok)throw l&&l.error?new Kr(l.error,c.status):l&&l.errors?new Kr(JSON.stringify(l.errors),c.status):new Kr("A connection error occurred while making the request");return l}function Ap(r,e){return E("get","/addresses",{query:e},r)}async function Ep(r,e,t){const{address:n}=await E("get","/addresses",{id:e,query:{include:t?.include}},r);return n}async function Op(r,e){const{address:t}=await E("post","/addresses",{data:e},r);return t}async function Tn(r,e,t){const{address:n}=await E("put","/addresses",{id:e,data:t},r);return n}async function Sp(r,e,t){return Tn(r,e,{discounts:[{code:t}]})}async function Pp(r,e){return Tn(r,e,{discounts:[]})}function Ip(r,e){return E("delete","/addresses",{id:e},r)}async function Tp(r,e){const{address:t}=await E("post","/addresses/merge",{data:e},r);return t}async function xp(r,e,t){const{charge:n}=await E("post",`/addresses/${e}/charges/skip`,{data:t},r);return n}var Rp=Object.freeze({__proto__:null,listAddresses:Ap,getAddress:Ep,createAddress:Op,updateAddress:Tn,applyDiscountToAddress:Sp,removeDiscountsFromAddress:Pp,deleteAddress:Ip,mergeAddresses:Tp,skipFutureCharge:xp}),Fp=Object.defineProperty,Ua=Object.getOwnPropertySymbols,Mp=Object.prototype.hasOwnProperty,Dp=Object.prototype.propertyIsEnumerable,Ca=(r,e,t)=>e in r?Fp(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,La=(r,e)=>{for(var t in e||(e={}))Mp.call(e,t)&&Ca(r,t,e[t]);if(Ua)for(var t of Ua(e))Dp.call(e,t)&&Ca(r,t,e[t]);return r};async function Bp(){const{storefrontAccessToken:r}=ue(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await sr("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id}}async function Np(r,e){const{environment:t,storefrontAccessToken:n,storeIdentifier:i}=ue(),a=In(t),o={};n&&(o["X-Recharge-Storefront-Access-Token"]=n);const s=await z("post",`${a}/shopify_storefront_access`,{data:{customer_token:e,storefront_token:r,shop_url:i},headers:o});return s.api_token?{apiToken:s.api_token,customerId:s.customer_id}:null}async function Up(r,e={}){const{environment:t,storefrontAccessToken:n,storeIdentifier:i}=ue(),a=In(t),o={};n&&(o["X-Recharge-Storefront-Access-Token"]=n);const s=await z("post",`${a}/attempt_login`,{data:La({email:r,shop:i},e),headers:o});if(s.errors)throw new Error(s.errors);return s.session_token}async function Cp(r,e={}){const{storefrontAccessToken:t,storeIdentifier:n}=ue(),i={};t&&(i["X-Recharge-Storefront-Access-Token"]=t);const a=await sr("post","/attempt_login",{data:La({email:r,shop:n},e),headers:i});if(a.errors)throw new Error(a.errors);return a.session_token}async function Lp(r,e,t){const{environment:n,storefrontAccessToken:i,storeIdentifier:a}=ue(),o=In(n),s={};i&&(s["X-Recharge-Storefront-Access-Token"]=i);const f=await z("post",`${o}/validate_login`,{data:{code:t,email:r,session_token:e,shop:a},headers:s});if(f.errors)throw new Error(f.errors);return{apiToken:f.api_token,customerId:f.customer_id}}async function jp(r,e,t){const{storefrontAccessToken:n,storeIdentifier:i}=ue(),a={};n&&(a["X-Recharge-Storefront-Access-Token"]=n);const o=await sr("post","/validate_login",{data:{code:t,email:r,session_token:e,shop:i},headers:a});if(o.errors)throw new Error(o.errors);return{apiToken:o.api_token,customerId:o.customer_id}}var kp=Object.freeze({__proto__:null,loginShopifyAppProxy:Bp,loginShopifyApi:Np,sendPasswordlessCode:Up,sendPasswordlessCodeAppProxy:Cp,validatePasswordlessCode:Lp,validatePasswordlessCodeAppProxy:jp});let qp=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");function Gp(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 Qr=Gp;function Wp(){this.__data__=[],this.size=0}var Vp=Wp;function Hp(r,e){return r===e||r!==r&&e!==e}var et=Hp,zp=et;function Xp(r,e){for(var t=r.length;t--;)if(zp(r[t][0],e))return t;return-1}var rt=Xp,Yp=rt,Kp=Array.prototype,Zp=Kp.splice;function Jp(r){var e=this.__data__,t=Yp(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():Zp.call(e,t,1),--this.size,!0}var Qp=Jp,eh=rt;function rh(r){var e=this.__data__,t=eh(e,r);return t<0?void 0:e[t][1]}var th=rh,nh=rt;function ih(r){return nh(this.__data__,r)>-1}var ah=ih,oh=rt;function uh(r,e){var t=this.__data__,n=oh(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var sh=uh,fh=Vp,ch=Qp,lh=th,ph=ah,hh=sh;function qe(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])}}qe.prototype.clear=fh,qe.prototype.delete=ch,qe.prototype.get=lh,qe.prototype.has=ph,qe.prototype.set=hh;var tt=qe,dh=tt;function yh(){this.__data__=new dh,this.size=0}var vh=yh;function gh(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var _h=gh;function mh(r){return this.__data__.get(r)}var wh=mh;function bh(r){return this.__data__.has(r)}var $h=bh,Ah=typeof ne=="object"&&ne&&ne.Object===Object&&ne,ja=Ah,Eh=ja,Oh=typeof self=="object"&&self&&self.Object===Object&&self,Sh=Eh||Oh||Function("return this")(),G=Sh,Ph=G,Ih=Ph.Symbol,Ge=Ih,ka=Ge,qa=Object.prototype,Th=qa.hasOwnProperty,xh=qa.toString,fr=ka?ka.toStringTag:void 0;function Rh(r){var e=Th.call(r,fr),t=r[fr];try{r[fr]=void 0;var n=!0}catch{}var i=xh.call(r);return n&&(e?r[fr]=t:delete r[fr]),i}var Fh=Rh,Mh=Object.prototype,Dh=Mh.toString;function Bh(r){return Dh.call(r)}var Nh=Bh,Ga=Ge,Uh=Fh,Ch=Nh,Lh="[object Null]",jh="[object Undefined]",Wa=Ga?Ga.toStringTag:void 0;function kh(r){return r==null?r===void 0?jh:Lh:Wa&&Wa in Object(r)?Uh(r):Ch(r)}var se=kh;function qh(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var fe=qh,Gh=se,Wh=fe,Vh="[object AsyncFunction]",Hh="[object Function]",zh="[object GeneratorFunction]",Xh="[object Proxy]";function Yh(r){if(!Wh(r))return!1;var e=Gh(r);return e==Hh||e==zh||e==Vh||e==Xh}var xn=Yh,Kh=G,Zh=Kh["__core-js_shared__"],Jh=Zh,Rn=Jh,Va=function(){var r=/[^.]+$/.exec(Rn&&Rn.keys&&Rn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function Qh(r){return!!Va&&Va in r}var ed=Qh,rd=Function.prototype,td=rd.toString;function nd(r){if(r!=null){try{return td.call(r)}catch{}try{return r+""}catch{}}return""}var Ha=nd,id=xn,ad=ed,od=fe,ud=Ha,sd=/[\\^$.*+?()[\]{}|]/g,fd=/^\[object .+?Constructor\]$/,cd=Function.prototype,ld=Object.prototype,pd=cd.toString,hd=ld.hasOwnProperty,dd=RegExp("^"+pd.call(hd).replace(sd,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function yd(r){if(!od(r)||ad(r))return!1;var e=id(r)?dd:fd;return e.test(ud(r))}var vd=yd;function gd(r,e){return r?.[e]}var _d=gd,md=vd,wd=_d;function bd(r,e){var t=wd(r,e);return md(t)?t:void 0}var Se=bd,$d=Se,Ad=G,Ed=$d(Ad,"Map"),Fn=Ed,Od=Se,Sd=Od(Object,"create"),nt=Sd,za=nt;function Pd(){this.__data__=za?za(null):{},this.size=0}var Id=Pd;function Td(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var xd=Td,Rd=nt,Fd="__lodash_hash_undefined__",Md=Object.prototype,Dd=Md.hasOwnProperty;function Bd(r){var e=this.__data__;if(Rd){var t=e[r];return t===Fd?void 0:t}return Dd.call(e,r)?e[r]:void 0}var Nd=Bd,Ud=nt,Cd=Object.prototype,Ld=Cd.hasOwnProperty;function jd(r){var e=this.__data__;return Ud?e[r]!==void 0:Ld.call(e,r)}var kd=jd,qd=nt,Gd="__lodash_hash_undefined__";function Wd(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=qd&&e===void 0?Gd:e,this}var Vd=Wd,Hd=Id,zd=xd,Xd=Nd,Yd=kd,Kd=Vd;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=Hd,We.prototype.delete=zd,We.prototype.get=Xd,We.prototype.has=Yd,We.prototype.set=Kd;var Zd=We,Xa=Zd,Jd=tt,Qd=Fn;function ey(){this.size=0,this.__data__={hash:new Xa,map:new(Qd||Jd),string:new Xa}}var ry=ey;function ty(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var ny=ty,iy=ny;function ay(r,e){var t=r.__data__;return iy(e)?t[typeof e=="string"?"string":"hash"]:t.map}var it=ay,oy=it;function uy(r){var e=oy(this,r).delete(r);return this.size-=e?1:0,e}var sy=uy,fy=it;function cy(r){return fy(this,r).get(r)}var ly=cy,py=it;function hy(r){return py(this,r).has(r)}var dy=hy,yy=it;function vy(r,e){var t=yy(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var gy=vy,_y=ry,my=sy,wy=ly,by=dy,$y=gy;function Ve(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])}}Ve.prototype.clear=_y,Ve.prototype.delete=my,Ve.prototype.get=wy,Ve.prototype.has=by,Ve.prototype.set=$y;var Mn=Ve,Ay=tt,Ey=Fn,Oy=Mn,Sy=200;function Py(r,e){var t=this.__data__;if(t instanceof Ay){var n=t.__data__;if(!Ey||n.length<Sy-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Oy(n)}return t.set(r,e),this.size=t.size,this}var Iy=Py,Ty=tt,xy=vh,Ry=_h,Fy=wh,My=$h,Dy=Iy;function He(r){var e=this.__data__=new Ty(r);this.size=e.size}He.prototype.clear=xy,He.prototype.delete=Ry,He.prototype.get=Fy,He.prototype.has=My,He.prototype.set=Dy;var Dn=He;function By(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var Bn=By,Ny=Se,Uy=function(){try{var r=Ny(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Ya=Uy,Ka=Ya;function Cy(r,e,t){e=="__proto__"&&Ka?Ka(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Za=Cy,Ly=Za,jy=et,ky=Object.prototype,qy=ky.hasOwnProperty;function Gy(r,e,t){var n=r[e];(!(qy.call(r,e)&&jy(n,t))||t===void 0&&!(e in r))&&Ly(r,e,t)}var Ja=Gy,Wy=Ja,Vy=Za;function Hy(r,e,t,n){var i=!t;t||(t={});for(var a=-1,o=e.length;++a<o;){var s=e[a],f=n?n(t[s],r[s],s,t,r):void 0;f===void 0&&(f=r[s]),i?Vy(t,s,f):Wy(t,s,f)}return t}var ze=Hy;function zy(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var Qa=zy;function Xy(r){return r!=null&&typeof r=="object"}var V=Xy,Yy=se,Ky=V,Zy="[object Arguments]";function Jy(r){return Ky(r)&&Yy(r)==Zy}var Qy=Jy,eo=Qy,ev=V,ro=Object.prototype,rv=ro.hasOwnProperty,tv=ro.propertyIsEnumerable,nv=eo(function(){return arguments}())?eo:function(r){return ev(r)&&rv.call(r,"callee")&&!tv.call(r,"callee")},Nn=nv,iv=Array.isArray,U=iv,cr={exports:{}};function av(){return!1}var ov=av;(function(r,e){var t=G,n=ov,i=e&&!e.nodeType&&e,a=i&&!0&&r&&!r.nodeType&&r,o=a&&a.exports===i,s=o?t.Buffer:void 0,f=s?s.isBuffer:void 0,c=f||n;r.exports=c})(cr,cr.exports);var uv=9007199254740991,sv=/^(?:0|[1-9]\d*)$/;function fv(r,e){var t=typeof r;return e=e??uv,!!e&&(t=="number"||t!="symbol"&&sv.test(r))&&r>-1&&r%1==0&&r<e}var at=fv,cv=9007199254740991;function lv(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=cv}var Un=lv,pv=se,hv=Un,dv=V,yv="[object Arguments]",vv="[object Array]",gv="[object Boolean]",_v="[object Date]",mv="[object Error]",wv="[object Function]",bv="[object Map]",$v="[object Number]",Av="[object Object]",Ev="[object RegExp]",Ov="[object Set]",Sv="[object String]",Pv="[object WeakMap]",Iv="[object ArrayBuffer]",Tv="[object DataView]",xv="[object Float32Array]",Rv="[object Float64Array]",Fv="[object Int8Array]",Mv="[object Int16Array]",Dv="[object Int32Array]",Bv="[object Uint8Array]",Nv="[object Uint8ClampedArray]",Uv="[object Uint16Array]",Cv="[object Uint32Array]",F={};F[xv]=F[Rv]=F[Fv]=F[Mv]=F[Dv]=F[Bv]=F[Nv]=F[Uv]=F[Cv]=!0,F[yv]=F[vv]=F[Iv]=F[gv]=F[Tv]=F[_v]=F[mv]=F[wv]=F[bv]=F[$v]=F[Av]=F[Ev]=F[Ov]=F[Sv]=F[Pv]=!1;function Lv(r){return dv(r)&&hv(r.length)&&!!F[pv(r)]}var jv=Lv;function kv(r){return function(e){return r(e)}}var Cn=kv,lr={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,s=function(){try{var f=i&&i.require&&i.require("util").types;return f||o&&o.binding&&o.binding("util")}catch{}}();r.exports=s})(lr,lr.exports);var qv=jv,Gv=Cn,to=lr.exports,no=to&&to.isTypedArray,Wv=no?Gv(no):qv,io=Wv,Vv=Qa,Hv=Nn,zv=U,Xv=cr.exports,Yv=at,Kv=io,Zv=Object.prototype,Jv=Zv.hasOwnProperty;function Qv(r,e){var t=zv(r),n=!t&&Hv(r),i=!t&&!n&&Xv(r),a=!t&&!n&&!i&&Kv(r),o=t||n||i||a,s=o?Vv(r.length,String):[],f=s.length;for(var c in r)(e||Jv.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Yv(c,f)))&&s.push(c);return s}var ao=Qv,eg=Object.prototype;function rg(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||eg;return r===t}var Ln=rg;function tg(r,e){return function(t){return r(e(t))}}var oo=tg,ng=oo,ig=ng(Object.keys,Object),ag=ig,og=Ln,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=xn,hg=Un;function dg(r){return r!=null&&hg(r.length)&&!pg(r)}var pr=dg,yg=ao,vg=lg,gg=pr;function _g(r){return gg(r)?yg(r):vg(r)}var Xe=_g,mg=ze,wg=Xe;function bg(r,e){return r&&mg(e,wg(e),r)}var $g=bg;function Ag(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var Eg=Ag,Og=fe,Sg=Ln,Pg=Eg,Ig=Object.prototype,Tg=Ig.hasOwnProperty;function xg(r){if(!Og(r))return Pg(r);var e=Sg(r),t=[];for(var n in r)n=="constructor"&&(e||!Tg.call(r,n))||t.push(n);return t}var Rg=xg,Fg=ao,Mg=Rg,Dg=pr;function Bg(r){return Dg(r)?Fg(r,!0):Mg(r)}var ot=Bg,Ng=ze,Ug=ot;function Cg(r,e){return r&&Ng(e,Ug(e),r)}var Lg=Cg,jn={exports:{}};(function(r,e){var t=G,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function f(c,l){if(l)return c.slice();var u=c.length,p=s?s(u):new c.constructor(u);return c.copy(p),p}r.exports=f})(jn,jn.exports);function jg(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var kn=jg;function kg(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 qg=kg;function Gg(){return[]}var uo=Gg,Wg=qg,Vg=uo,Hg=Object.prototype,zg=Hg.propertyIsEnumerable,so=Object.getOwnPropertySymbols,Xg=so?function(r){return r==null?[]:(r=Object(r),Wg(so(r),function(e){return zg.call(r,e)}))}:Vg,qn=Xg,Yg=ze,Kg=qn;function Zg(r,e){return Yg(r,Kg(r),e)}var Jg=Zg;function Qg(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Gn=Qg,e_=oo,r_=e_(Object.getPrototypeOf,Object),Wn=r_,t_=Gn,n_=Wn,i_=qn,a_=uo,o_=Object.getOwnPropertySymbols,u_=o_?function(r){for(var e=[];r;)t_(e,i_(r)),r=n_(r);return e}:a_,fo=u_,s_=ze,f_=fo;function c_(r,e){return s_(r,f_(r),e)}var l_=c_,p_=Gn,h_=U;function d_(r,e,t){var n=e(r);return h_(r)?n:p_(n,t(r))}var co=d_,y_=co,v_=qn,g_=Xe;function __(r){return y_(r,g_,v_)}var lo=__,m_=co,w_=fo,b_=ot;function $_(r){return m_(r,b_,w_)}var po=$_,A_=Se,E_=G,O_=A_(E_,"DataView"),S_=O_,P_=Se,I_=G,T_=P_(I_,"Promise"),x_=T_,R_=Se,F_=G,M_=R_(F_,"Set"),D_=M_,B_=Se,N_=G,U_=B_(N_,"WeakMap"),ho=U_,Vn=S_,Hn=Fn,zn=x_,Xn=D_,Yn=ho,yo=se,Ye=Ha,vo="[object Map]",C_="[object Object]",go="[object Promise]",_o="[object Set]",mo="[object WeakMap]",wo="[object DataView]",L_=Ye(Vn),j_=Ye(Hn),k_=Ye(zn),q_=Ye(Xn),G_=Ye(Yn),Pe=yo;(Vn&&Pe(new Vn(new ArrayBuffer(1)))!=wo||Hn&&Pe(new Hn)!=vo||zn&&Pe(zn.resolve())!=go||Xn&&Pe(new Xn)!=_o||Yn&&Pe(new Yn)!=mo)&&(Pe=function(r){var e=yo(r),t=e==C_?r.constructor:void 0,n=t?Ye(t):"";if(n)switch(n){case L_:return wo;case j_:return vo;case k_:return go;case q_:return _o;case G_:return mo}return e});var ut=Pe,W_=Object.prototype,V_=W_.hasOwnProperty;function H_(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&V_.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var z_=H_,X_=G,Y_=X_.Uint8Array,bo=Y_,$o=bo;function K_(r){var e=new r.constructor(r.byteLength);return new $o(e).set(new $o(r)),e}var Kn=K_,Z_=Kn;function J_(r,e){var t=e?Z_(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}var Q_=J_,em=/\w*$/;function rm(r){var e=new r.constructor(r.source,em.exec(r));return e.lastIndex=r.lastIndex,e}var tm=rm,Ao=Ge,Eo=Ao?Ao.prototype:void 0,Oo=Eo?Eo.valueOf:void 0;function nm(r){return Oo?Object(Oo.call(r)):{}}var im=nm,am=Kn;function om(r,e){var t=e?am(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var um=om,sm=Kn,fm=Q_,cm=tm,lm=im,pm=um,hm="[object Boolean]",dm="[object Date]",ym="[object Map]",vm="[object Number]",gm="[object RegExp]",_m="[object Set]",mm="[object String]",wm="[object Symbol]",bm="[object ArrayBuffer]",$m="[object DataView]",Am="[object Float32Array]",Em="[object Float64Array]",Om="[object Int8Array]",Sm="[object Int16Array]",Pm="[object Int32Array]",Im="[object Uint8Array]",Tm="[object Uint8ClampedArray]",xm="[object Uint16Array]",Rm="[object Uint32Array]";function Fm(r,e,t){var n=r.constructor;switch(e){case bm:return sm(r);case hm:case dm:return new n(+r);case $m:return fm(r,t);case Am:case Em:case Om:case Sm:case Pm:case Im:case Tm:case xm:case Rm:return pm(r,t);case ym:return new n;case vm:case mm:return new n(r);case gm:return cm(r);case _m:return new n;case wm:return lm(r)}}var Mm=Fm,Dm=fe,So=Object.create,Bm=function(){function r(){}return function(e){if(!Dm(e))return{};if(So)return So(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}(),st=Bm,Nm=st,Um=Wn,Cm=Ln;function Lm(r){return typeof r.constructor=="function"&&!Cm(r)?Nm(Um(r)):{}}var jm=Lm,km=ut,qm=V,Gm="[object Map]";function Wm(r){return qm(r)&&km(r)==Gm}var Vm=Wm,Hm=Vm,zm=Cn,Po=lr.exports,Io=Po&&Po.isMap,Xm=Io?zm(Io):Hm,Ym=Xm,Km=ut,Zm=V,Jm="[object Set]";function Qm(r){return Zm(r)&&Km(r)==Jm}var ew=Qm,rw=ew,tw=Cn,To=lr.exports,xo=To&&To.isSet,nw=xo?tw(xo):rw,iw=nw,aw=Dn,ow=Bn,uw=Ja,sw=$g,fw=Lg,cw=jn.exports,lw=kn,pw=Jg,hw=l_,dw=lo,yw=po,vw=ut,gw=z_,_w=Mm,mw=jm,ww=U,bw=cr.exports,$w=Ym,Aw=fe,Ew=iw,Ow=Xe,Sw=ot,Pw=1,Iw=2,Tw=4,Ro="[object Arguments]",xw="[object Array]",Rw="[object Boolean]",Fw="[object Date]",Mw="[object Error]",Fo="[object Function]",Dw="[object GeneratorFunction]",Bw="[object Map]",Nw="[object Number]",Mo="[object Object]",Uw="[object RegExp]",Cw="[object Set]",Lw="[object String]",jw="[object Symbol]",kw="[object WeakMap]",qw="[object ArrayBuffer]",Gw="[object DataView]",Ww="[object Float32Array]",Vw="[object Float64Array]",Hw="[object Int8Array]",zw="[object Int16Array]",Xw="[object Int32Array]",Yw="[object Uint8Array]",Kw="[object Uint8ClampedArray]",Zw="[object Uint16Array]",Jw="[object Uint32Array]",x={};x[Ro]=x[xw]=x[qw]=x[Gw]=x[Rw]=x[Fw]=x[Ww]=x[Vw]=x[Hw]=x[zw]=x[Xw]=x[Bw]=x[Nw]=x[Mo]=x[Uw]=x[Cw]=x[Lw]=x[jw]=x[Yw]=x[Kw]=x[Zw]=x[Jw]=!0,x[Mw]=x[Fo]=x[kw]=!1;function ft(r,e,t,n,i,a){var o,s=e&Pw,f=e&Iw,c=e&Tw;if(t&&(o=i?t(r,n,i,a):t(r)),o!==void 0)return o;if(!Aw(r))return r;var l=ww(r);if(l){if(o=gw(r),!s)return lw(r,o)}else{var u=vw(r),p=u==Fo||u==Dw;if(bw(r))return cw(r,s);if(u==Mo||u==Ro||p&&!i){if(o=f||p?{}:mw(r),!s)return f?hw(r,fw(o,r)):pw(r,sw(o,r))}else{if(!x[u])return i?r:{};o=_w(r,u,s)}}a||(a=new aw);var d=a.get(r);if(d)return d;a.set(r,o),Ew(r)?r.forEach(function(b){o.add(ft(b,e,t,b,r,a))}):$w(r)&&r.forEach(function(b,w){o.set(w,ft(b,e,t,w,r,a))});var _=c?f?yw:dw:f?Sw:Ow,$=l?void 0:_(r);return ow($||r,function(b,w){$&&(w=b,b=r[w]),uw(o,w,ft(b,e,t,w,r,a))}),o}var Qw=ft,e0=se,r0=V,t0="[object Symbol]";function n0(r){return typeof r=="symbol"||r0(r)&&e0(r)==t0}var ct=n0,i0=U,a0=ct,o0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,u0=/^\w*$/;function s0(r,e){if(i0(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||a0(r)?!0:u0.test(r)||!o0.test(r)||e!=null&&r in Object(e)}var Zn=s0,Do=Mn,f0="Expected a function";function Jn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(f0);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(Jn.Cache||Do),t}Jn.Cache=Do;var c0=Jn,l0=c0,p0=500;function h0(r){var e=l0(r,function(n){return t.size===p0&&t.clear(),n}),t=e.cache;return e}var d0=h0,y0=d0,v0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,g0=/\\(\\)?/g,_0=y0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(v0,function(t,n,i,a){e.push(i?a.replace(g0,"$1"):n||t)}),e}),m0=_0,Bo=Ge,w0=Qr,b0=U,$0=ct,A0=1/0,No=Bo?Bo.prototype:void 0,Uo=No?No.toString:void 0;function Co(r){if(typeof r=="string")return r;if(b0(r))return w0(r,Co)+"";if($0(r))return Uo?Uo.call(r):"";var e=r+"";return e=="0"&&1/r==-A0?"-0":e}var E0=Co,O0=E0;function S0(r){return r==null?"":O0(r)}var P0=S0,I0=U,T0=Zn,x0=m0,R0=P0;function F0(r,e){return I0(r)?r:T0(r,e)?[r]:x0(R0(r))}var lt=F0;function M0(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var D0=M0,B0=ct,N0=1/0;function U0(r){if(typeof r=="string"||B0(r))return r;var e=r+"";return e=="0"&&1/r==-N0?"-0":e}var hr=U0,C0=lt,L0=hr;function j0(r,e){e=C0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[L0(e[t++])];return t&&t==n?r:void 0}var Qn=j0;function k0(r,e,t){var n=-1,i=r.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=r[n+e];return a}var q0=k0,G0=Qn,W0=q0;function V0(r,e){return e.length<2?r:G0(r,W0(e,0,-1))}var H0=V0,z0=lt,X0=D0,Y0=H0,K0=hr;function Z0(r,e){return e=z0(e,r),r=Y0(r,e),r==null||delete r[K0(X0(e))]}var J0=Z0,Q0=se,eb=Wn,rb=V,tb="[object Object]",nb=Function.prototype,ib=Object.prototype,Lo=nb.toString,ab=ib.hasOwnProperty,ob=Lo.call(Object);function ub(r){if(!rb(r)||Q0(r)!=tb)return!1;var e=eb(r);if(e===null)return!0;var t=ab.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Lo.call(t)==ob}var sb=ub,fb=sb;function cb(r){return fb(r)?void 0:r}var lb=cb,jo=Ge,pb=Nn,hb=U,ko=jo?jo.isConcatSpreadable:void 0;function db(r){return hb(r)||pb(r)||!!(ko&&r&&r[ko])}var yb=db,vb=Gn,gb=yb;function qo(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=gb),i||(i=[]);++a<o;){var s=r[a];e>0&&t(s)?e>1?qo(s,e-1,t,n,i):vb(i,s):n||(i[i.length]=s)}return i}var _b=qo,mb=_b;function wb(r){var e=r==null?0:r.length;return e?mb(r,1):[]}var bb=wb;function $b(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 ei=$b,Ab=ei,Go=Math.max;function Eb(r,e,t){return e=Go(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=Go(n.length-e,0),o=Array(a);++i<a;)o[i]=n[e+i];i=-1;for(var s=Array(e+1);++i<e;)s[i]=n[i];return s[e]=t(o),Ab(r,this,s)}}var Wo=Eb;function Ob(r){return function(){return r}}var Sb=Ob;function Pb(r){return r}var dr=Pb,Ib=Sb,Vo=Ya,Tb=dr,xb=Vo?function(r,e){return Vo(r,"toString",{configurable:!0,enumerable:!1,value:Ib(e),writable:!0})}:Tb,Rb=xb,Fb=800,Mb=16,Db=Date.now;function Bb(r){var e=0,t=0;return function(){var n=Db(),i=Mb-(n-t);if(t=n,i>0){if(++e>=Fb)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var Ho=Bb,Nb=Rb,Ub=Ho,Cb=Ub(Nb),ri=Cb,Lb=bb,jb=Wo,kb=ri;function qb(r){return kb(jb(r,void 0,Lb),r+"")}var Gb=qb,Wb=Qr,Vb=Qw,Hb=J0,zb=lt,Xb=ze,Yb=lb,Kb=Gb,Zb=po,Jb=1,Qb=2,e1=4,r1=Kb(function(r,e){var t={};if(r==null)return t;var n=!1;e=Wb(e,function(a){return a=zb(a,r),n||(n=a.length>1),a}),Xb(r,Zb(r),t),n&&(t=Vb(t,Jb|Qb|e1,Yb));for(var i=e.length;i--;)Hb(t,e[i]);return t}),ti=r1,t1=Object.defineProperty,n1=Object.defineProperties,i1=Object.getOwnPropertyDescriptors,zo=Object.getOwnPropertySymbols,a1=Object.prototype.hasOwnProperty,o1=Object.prototype.propertyIsEnumerable,Xo=(r,e,t)=>e in r?t1(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,u1=(r,e)=>{for(var t in e||(e={}))a1.call(e,t)&&Xo(r,t,e[t]);if(zo)for(var t of zo(e))o1.call(e,t)&&Xo(r,t,e[t]);return r},s1=(r,e)=>n1(r,i1(e));function f1(r){try{return JSON.parse(r)}catch{return r}}function c1(r){return Object.entries(r).reduce((e,[t,n])=>s1(u1({},e),{[t]:f1(n)}),{})}const Yo=r=>typeof r=="string"?r!=="0"&&r!=="false":!!r;var l1=Object.defineProperty,p1=Object.defineProperties,h1=Object.getOwnPropertyDescriptors,Ko=Object.getOwnPropertySymbols,d1=Object.prototype.hasOwnProperty,y1=Object.prototype.propertyIsEnumerable,Zo=(r,e,t)=>e in r?l1(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Jo=(r,e)=>{for(var t in e||(e={}))d1.call(e,t)&&Zo(r,t,e[t]);if(Ko)for(var t of Ko(e))y1.call(e,t)&&Zo(r,t,e[t]);return r},Qo=(r,e)=>p1(r,h1(e));function eu(r){var e;const t=c1(r),n=t.auto_inject===void 0?!0:t.auto_inject,i=(e=t.display_on)!=null?e:[],a=t.first_option==="autodeliver";return Qo(Jo({},ti(t,["display_on","first_option"])),{auto_inject:n,valid_pages:i,is_subscription_first:a,autoInject:n,validPages:i,isSubscriptionFirst:a})}function ru(r){var e;const t=((e=r.subscription_options)==null?void 0:e.storefront_purchase_options)==="subscription_only";return Qo(Jo({},r),{is_subscription_only:t,isSubscriptionOnly:t})}function v1(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=ru(i)}),t})}const pt="2020-12",g1={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},yr=new Map;function ht(r,e){return yr.has(r)||yr.set(r,e()),yr.get(r)}async function ni(r){const{product:e}=await ht(`product.${r}`,()=>Jr("get",`/product/${pt}/${r}.json`));return ru(e)}async function tu(){return await ht("storeSettings",()=>Jr("get",`/${pt}/store_settings.json`).catch(()=>g1))}async function nu(){const{widget_settings:r}=await ht("widgetSettings",()=>Jr("get",`/${pt}/widget_settings.json`));return eu(r)}async function iu(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await ht("productsAndSettings",()=>Jr("get",`/product/${pt}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:v1(r),widget_settings:eu(e),store_settings:t??{}}}async function _1(){const{products:r}=await iu();return r}async function m1(r){const[e,t,n]=await Promise.all([ni(r),tu(),nu()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function au(r){const{bundle_product:e}=await ni(r);return e}async function ou(){return Array.from(yr.keys()).forEach(r=>yr.delete(r))}var w1=Object.freeze({__proto__:null,getCDNProduct:ni,getCDNStoreSettings:tu,getCDNWidgetSettings:nu,getCDNProductsAndSettings:iu,getCDNProducts:_1,getCDNProductAndSettings:m1,getCDNBundleSettings:au,resetCDNCache:ou}),uu={},ii={},ce={},b1=se,$1=V,A1="[object Number]";function E1(r){return typeof r=="number"||$1(r)&&b1(r)==A1}var dt=E1,M={},su={exports:{}},O1=dr,S1=Wo,P1=ri;function I1(r,e){return P1(S1(r,e,O1),r+"")}var fu=I1,T1=et,x1=pr,R1=at,F1=fe;function M1(r,e,t){if(!F1(t))return!1;var n=typeof e;return(n=="number"?x1(t)&&R1(e,t.length):n=="string"&&e in t)?T1(t[e],r):!1}var cu=M1,D1=fu,B1=cu;function N1(r){return D1(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&&B1(t[0],t[1],o)&&(a=i<3?void 0:a,i=1),e=Object(e);++n<i;){var s=t[n];s&&r(e,s,n,a)}return e})}var U1=N1,C1=ze,L1=U1,j1=ot,k1=L1(function(r,e){C1(e,j1(e),r)}),q1=k1;(function(r){r.exports=q1})(su);var yt={},Ie={};function G1(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 W1=G1;function V1(r){return function(e,t,n){for(var i=-1,a=Object(e),o=n(e),s=o.length;s--;){var f=o[r?s:++i];if(t(a[f],f,a)===!1)break}return e}}var H1=V1,z1=H1,X1=z1(),Y1=X1,K1=Y1,Z1=Xe;function J1(r,e){return r&&K1(r,e,Z1)}var Q1=J1,e$=pr;function r$(r,e){return function(t,n){if(t==null)return t;if(!e$(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 t$=r$,n$=Q1,i$=t$,a$=i$(n$),ai=a$,o$=ai;function u$(r,e){var t=!0;return o$(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var s$=u$,f$="__lodash_hash_undefined__";function c$(r){return this.__data__.set(r,f$),this}var l$=c$;function p$(r){return this.__data__.has(r)}var h$=p$,d$=Mn,y$=l$,v$=h$;function vt(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new d$;++e<t;)this.add(r[e])}vt.prototype.add=vt.prototype.push=y$,vt.prototype.has=v$;var g$=vt;function _$(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 m$=_$;function w$(r,e){return r.has(e)}var b$=w$,$$=g$,A$=m$,E$=b$,O$=1,S$=2;function P$(r,e,t,n,i,a){var o=t&O$,s=r.length,f=e.length;if(s!=f&&!(o&&f>s))return!1;var c=a.get(r),l=a.get(e);if(c&&l)return c==e&&l==r;var u=-1,p=!0,d=t&S$?new $$:void 0;for(a.set(r,e),a.set(e,r);++u<s;){var _=r[u],$=e[u];if(n)var b=o?n($,_,u,e,r,a):n(_,$,u,r,e,a);if(b!==void 0){if(b)continue;p=!1;break}if(d){if(!A$(e,function(w,A){if(!E$(d,A)&&(_===w||i(_,w,t,n,a)))return d.push(A)})){p=!1;break}}else if(!(_===$||i(_,$,t,n,a))){p=!1;break}}return a.delete(r),a.delete(e),p}var lu=P$;function I$(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var T$=I$;function x$(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var R$=x$,pu=Ge,hu=bo,F$=et,M$=lu,D$=T$,B$=R$,N$=1,U$=2,C$="[object Boolean]",L$="[object Date]",j$="[object Error]",k$="[object Map]",q$="[object Number]",G$="[object RegExp]",W$="[object Set]",V$="[object String]",H$="[object Symbol]",z$="[object ArrayBuffer]",X$="[object DataView]",du=pu?pu.prototype:void 0,oi=du?du.valueOf:void 0;function Y$(r,e,t,n,i,a,o){switch(t){case X$:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case z$:return!(r.byteLength!=e.byteLength||!a(new hu(r),new hu(e)));case C$:case L$:case q$:return F$(+r,+e);case j$:return r.name==e.name&&r.message==e.message;case G$:case V$:return r==e+"";case k$:var s=D$;case W$:var f=n&N$;if(s||(s=B$),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=U$,o.set(r,e);var l=M$(s(r),s(e),n,i,a,o);return o.delete(r),l;case H$:if(oi)return oi.call(r)==oi.call(e)}return!1}var K$=Y$,yu=lo,Z$=1,J$=Object.prototype,Q$=J$.hasOwnProperty;function eA(r,e,t,n,i,a){var o=t&Z$,s=yu(r),f=s.length,c=yu(e),l=c.length;if(f!=l&&!o)return!1;for(var u=f;u--;){var p=s[u];if(!(o?p in e:Q$.call(e,p)))return!1}var d=a.get(r),_=a.get(e);if(d&&_)return d==e&&_==r;var $=!0;a.set(r,e),a.set(e,r);for(var b=o;++u<f;){p=s[u];var w=r[p],A=e[p];if(n)var h=o?n(A,w,p,e,r,a):n(w,A,p,r,e,a);if(!(h===void 0?w===A||i(w,A,t,n,a):h)){$=!1;break}b||(b=p=="constructor")}if($&&!b){var P=r.constructor,I=e.constructor;P!=I&&"constructor"in r&&"constructor"in e&&!(typeof P=="function"&&P instanceof P&&typeof I=="function"&&I instanceof I)&&($=!1)}return a.delete(r),a.delete(e),$}var rA=eA,ui=Dn,tA=lu,nA=K$,iA=rA,vu=ut,gu=U,_u=cr.exports,aA=io,oA=1,mu="[object Arguments]",wu="[object Array]",gt="[object Object]",uA=Object.prototype,bu=uA.hasOwnProperty;function sA(r,e,t,n,i,a){var o=gu(r),s=gu(e),f=o?wu:vu(r),c=s?wu:vu(e);f=f==mu?gt:f,c=c==mu?gt:c;var l=f==gt,u=c==gt,p=f==c;if(p&&_u(r)){if(!_u(e))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new ui),o||aA(r)?tA(r,e,t,n,i,a):nA(r,e,f,t,n,i,a);if(!(t&oA)){var d=l&&bu.call(r,"__wrapped__"),_=u&&bu.call(e,"__wrapped__");if(d||_){var $=d?r.value():r,b=_?e.value():e;return a||(a=new ui),i($,b,t,n,a)}}return p?(a||(a=new ui),iA(r,e,t,n,i,a)):!1}var fA=sA,cA=fA,$u=V;function Au(r,e,t,n,i){return r===e?!0:r==null||e==null||!$u(r)&&!$u(e)?r!==r&&e!==e:cA(r,e,t,n,Au,i)}var Eu=Au,lA=Dn,pA=Eu,hA=1,dA=2;function yA(r,e,t,n){var i=t.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var s=t[i];if(o&&s[2]?s[1]!==r[s[0]]:!(s[0]in r))return!1}for(;++i<a;){s=t[i];var f=s[0],c=r[f],l=s[1];if(o&&s[2]){if(c===void 0&&!(f in r))return!1}else{var u=new lA;if(n)var p=n(c,l,f,r,e,u);if(!(p===void 0?pA(l,c,hA|dA,n,u):p))return!1}}return!0}var vA=yA,gA=fe;function _A(r){return r===r&&!gA(r)}var Ou=_A,mA=Ou,wA=Xe;function bA(r){for(var e=wA(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,mA(i)]}return e}var $A=bA;function AA(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var Su=AA,EA=vA,OA=$A,SA=Su;function PA(r){var e=OA(r);return e.length==1&&e[0][2]?SA(e[0][0],e[0][1]):function(t){return t===r||EA(t,r,e)}}var IA=PA,TA=Qn;function xA(r,e,t){var n=r==null?void 0:TA(r,e);return n===void 0?t:n}var RA=xA;function FA(r,e){return r!=null&&e in Object(r)}var MA=FA,DA=lt,BA=Nn,NA=U,UA=at,CA=Un,LA=hr;function jA(r,e,t){e=DA(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=LA(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&&CA(i)&&UA(o,i)&&(NA(r)||BA(r)))}var kA=jA,qA=MA,GA=kA;function WA(r,e){return r!=null&&GA(r,e,qA)}var VA=WA,HA=Eu,zA=RA,XA=VA,YA=Zn,KA=Ou,ZA=Su,JA=hr,QA=1,eE=2;function rE(r,e){return YA(r)&&KA(e)?ZA(JA(r),e):function(t){var n=zA(t,r);return n===void 0&&n===e?XA(t,r):HA(e,n,QA|eE)}}var tE=rE;function nE(r){return function(e){return e?.[r]}}var iE=nE,aE=Qn;function oE(r){return function(e){return aE(e,r)}}var uE=oE,sE=iE,fE=uE,cE=Zn,lE=hr;function pE(r){return cE(r)?sE(lE(r)):fE(r)}var hE=pE,dE=IA,yE=tE,vE=dr,gE=U,_E=hE;function mE(r){return typeof r=="function"?r:r==null?vE:typeof r=="object"?gE(r)?yE(r[0],r[1]):dE(r):_E(r)}var Pu=mE,wE=W1,bE=s$,$E=Pu,AE=U,EE=cu;function OE(r,e,t){var n=AE(r)?wE:bE;return t&&EE(r,e,t)&&(e=void 0),n(r,$E(e))}var si=OE;Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.calculatePadding=TE,Ie.slicePadding=xE;var SE=si,PE=IE(SE);function IE(r){return r&&r.__esModule?r:{default:r}}function TE(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function xE(r,e){var t=r.slice(e),n=(0,PE.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(yt,"__esModule",{value:!0}),yt.Cursor=void 0;var RE=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}}(),FE=Ie;function ME(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var fi=function(){function r(e){ME(this,r),e instanceof y||(e=typeof e=="number"?y.alloc(e):y.from(e)),this._setBuffer(e),this.rewind()}return RE(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 y?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=y.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,FE.calculatePadding)(t.length),i=y.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){fi.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){fi.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),yt.Cursor=fi,Object.defineProperty(M,"__esModule",{value:!0}),M.default=jE;var DE=su.exports,Iu=xu(DE),BE=xn,NE=xu(BE),Tu=yt;function xu(r){return r&&r.__esModule?r:{default:r}}var UE=Math.pow(2,16),CE={toXDR:function(e){var t=new Tu.Cursor(UE);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=y.from(e,"hex");break;case"base64":n=y.from(e,"base64");break;default:throw new Error("Invalid format "+t+', must be "raw", "hex", "base64"')}var i=new Tu.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}}},LE={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 jE(r){(0,Iu.default)(r,CE),(0,NE.default)(r)&&(0,Iu.default)(r.prototype,LE)}Object.defineProperty(ce,"__esModule",{value:!0}),ce.Int=void 0;var kE=dt,Ru=Fu(kE),qE=M,GE=Fu(qE);function Fu(r){return r&&r.__esModule?r:{default:r}}var vr=ce.Int={read:function(e){return e.readInt32BE()},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");t.writeInt32BE(e)},isValid:function(e){return!(0,Ru.default)(e)||Math.floor(e)!==e?!1:e>=vr.MIN_VALUE&&e<=vr.MAX_VALUE}};vr.MAX_VALUE=Math.pow(2,31)-1,vr.MIN_VALUE=-Math.pow(2,31),(0,GE.default)(vr);var _t={};function WE(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 ci={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 CE=="function"&&!0&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(ne,function(){function e(l,u,p){this.low=l|0,this.high=u|0,this.unsigned=!!p}e.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=function(u){return(u&&u.__isLong__)===!0};var t={},n={};e.fromInt=function(u,p){var d,_;return p?(u=u>>>0,0<=u&&u<256&&(_=n[u],_)?_:(d=new e(u,(u|0)<0?-1:0,!0),0<=u&&u<256&&(n[u]=d),d)):(u=u|0,-128<=u&&u<128&&(_=t[u],_)?_:(d=new e(u,u<0?-1:0,!1),-128<=u&&u<128&&(t[u]=d),d))},e.fromNumber=function(u,p){return p=!!p,isNaN(u)||!isFinite(u)?e.ZERO:!p&&u<=-f?e.MIN_VALUE:!p&&u+1>=f?e.MAX_VALUE:p&&u>=s?e.MAX_UNSIGNED_VALUE:u<0?e.fromNumber(-u,p).negate():new e(u%o|0,u/o|0,p)},e.fromBits=function(u,p,d){return new e(u,p,d)},e.fromString=function(u,p,d){if(u.length===0)throw Error("number format error: empty string");if(u==="NaN"||u==="Infinity"||u==="+Infinity"||u==="-Infinity")return e.ZERO;if(typeof p=="number"&&(d=p,p=!1),d=d||10,d<2||36<d)throw Error("radix out of range: "+d);var _;if((_=u.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+u);if(_===0)return e.fromString(u.substring(1),p,d).negate();for(var $=e.fromNumber(Math.pow(d,8)),b=e.ZERO,w=0;w<u.length;w+=8){var A=Math.min(8,u.length-w),h=parseInt(u.substring(w,w+A),d);if(A<8){var I=e.fromNumber(Math.pow(d,A));b=b.multiply(I).add(e.fromNumber(h))}else b=b.multiply($),b=b.add(e.fromNumber(h))}return b.unsigned=p,b},e.fromValue=function(u){return u instanceof e?u:typeof u=="number"?e.fromNumber(u):typeof u=="string"?e.fromString(u):new e(u.low,u.high,u.unsigned)};var i=1<<16,a=1<<24,o=i*i,s=o*o,f=s/2,c=e.fromInt(a);return e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)},e.prototype.toString=function(u){if(u=u||10,u<2||36<u)throw RangeError("radix out of range: "+u);if(this.isZero())return"0";var p;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var d=e.fromNumber(u),_=this.divide(d);return p=_.multiply(d).subtract(this),_.toString(u)+p.toInt().toString(u)}else return"-"+this.negate().toString(u);var $=e.fromNumber(Math.pow(u,6),this.unsigned);p=this;for(var b="";;){var w=p.divide($),A=p.subtract(w.multiply($)).toInt()>>>0,h=A.toString(u);if(p=w,p.isZero())return h+b;for(;h.length<6;)h="0"+h;b=""+h+b}},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(e.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var u=this.high!=0?this.high:this.low,p=31;p>0&&(u&1<<p)==0;p--);return this.high!=0?p+33:p+1},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.equals=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.unsigned!==u.unsigned&&this.high>>>31===1&&u.high>>>31===1?!1:this.high===u.high&&this.low===u.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(u){return!this.equals(u)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(u){return this.compare(u)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(u){return this.compare(u)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(u){return this.compare(u)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(u){return this.compare(u)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compare=function(u){if(e.isLong(u)||(u=e.fromValue(u)),this.equals(u))return 0;var p=this.isNegative(),d=u.isNegative();return p&&!d?-1:!p&&d?1:this.unsigned?u.high>>>0>this.high>>>0||u.high===this.high&&u.low>>>0>this.low>>>0?-1:1:this.subtract(u).isNegative()?-1:1},e.prototype.negate=function(){return!this.unsigned&&this.equals(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=e.prototype.negate,e.prototype.add=function(u){e.isLong(u)||(u=e.fromValue(u));var p=this.high>>>16,d=this.high&65535,_=this.low>>>16,$=this.low&65535,b=u.high>>>16,w=u.high&65535,A=u.low>>>16,h=u.low&65535,I=0,P=0,R=0,m=0;return m+=$+h,R+=m>>>16,m&=65535,R+=_+A,P+=R>>>16,R&=65535,P+=d+w,I+=P>>>16,P&=65535,I+=p+b,I&=65535,e.fromBits(R<<16|m,I<<16|P,this.unsigned)},e.prototype.subtract=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.add(u.negate())},e.prototype.sub=e.prototype.subtract,e.prototype.multiply=function(u){if(this.isZero()||(e.isLong(u)||(u=e.fromValue(u)),u.isZero()))return e.ZERO;if(this.equals(e.MIN_VALUE))return u.isOdd()?e.MIN_VALUE:e.ZERO;if(u.equals(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().multiply(u.negate()):this.negate().multiply(u).negate();if(u.isNegative())return this.multiply(u.negate()).negate();if(this.lessThan(c)&&u.lessThan(c))return e.fromNumber(this.toNumber()*u.toNumber(),this.unsigned);var p=this.high>>>16,d=this.high&65535,_=this.low>>>16,$=this.low&65535,b=u.high>>>16,w=u.high&65535,A=u.low>>>16,h=u.low&65535,I=0,P=0,R=0,m=0;return m+=$*h,R+=m>>>16,m&=65535,R+=_*h,P+=R>>>16,R&=65535,R+=$*A,P+=R>>>16,R&=65535,P+=d*h,I+=P>>>16,P&=65535,P+=_*A,I+=P>>>16,P&=65535,P+=$*w,I+=P>>>16,P&=65535,I+=p*h+d*A+_*w+$*b,I&=65535,e.fromBits(R<<16|m,I<<16|P,this.unsigned)},e.prototype.mul=e.prototype.multiply,e.prototype.divide=function(u){if(e.isLong(u)||(u=e.fromValue(u)),u.isZero())throw new Error("division by zero");if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var p,d,_;if(this.equals(e.MIN_VALUE)){if(u.equals(e.ONE)||u.equals(e.NEG_ONE))return e.MIN_VALUE;if(u.equals(e.MIN_VALUE))return e.ONE;var $=this.shiftRight(1);return p=$.divide(u).shiftLeft(1),p.equals(e.ZERO)?u.isNegative()?e.ONE:e.NEG_ONE:(d=this.subtract(u.multiply(p)),_=p.add(d.divide(u)),_)}else if(u.equals(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().divide(u.negate()):this.negate().divide(u).negate();if(u.isNegative())return this.divide(u.negate()).negate();for(_=e.ZERO,d=this;d.greaterThanOrEqual(u);){p=Math.max(1,Math.floor(d.toNumber()/u.toNumber()));for(var b=Math.ceil(Math.log(p)/Math.LN2),w=b<=48?1:Math.pow(2,b-48),A=e.fromNumber(p),h=A.multiply(u);h.isNegative()||h.greaterThan(d);)p-=w,A=e.fromNumber(p,this.unsigned),h=A.multiply(u);A.isZero()&&(A=e.ONE),_=_.add(A),d=d.subtract(h)}return _},e.prototype.div=e.prototype.divide,e.prototype.modulo=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.subtract(this.divide(u).multiply(u))},e.prototype.mod=e.prototype.modulo,e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.and=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low&u.low,this.high&u.high,this.unsigned)},e.prototype.or=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low|u.low,this.high|u.high,this.unsigned)},e.prototype.xor=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low^u.low,this.high^u.high,this.unsigned)},e.prototype.shiftLeft=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low<<u,this.high<<u|this.low>>>32-u,this.unsigned):e.fromBits(0,this.low<<u-32,this.unsigned)},e.prototype.shl=e.prototype.shiftLeft,e.prototype.shiftRight=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low>>>u|this.high<<32-u,this.high>>u,this.unsigned):e.fromBits(this.high>>u-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=e.prototype.shiftRight,e.prototype.shiftRightUnsigned=function(u){if(e.isLong(u)&&(u=u.toInt()),u&=63,u===0)return this;var p=this.high;if(u<32){var d=this.low;return e.fromBits(d>>>u|p<<32-u,p>>>u,this.unsigned)}else return u===32?e.fromBits(p,0,this.unsigned):e.fromBits(p>>>u-32,0,this.unsigned)},e.prototype.shru=e.prototype.shiftRightUnsigned,e.prototype.toSigned=function(){return this.unsigned?new e(this.low,this.high,!1):this},e.prototype.toUnsigned=function(){return this.unsigned?this:new e(this.low,this.high,!0)},e})})(ci),Object.defineProperty(_t,"__esModule",{value:!0}),_t.Hyper=void 0;var LE=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}}(),xu=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)}},jE=ci.exports,gr=Ru(jE),kE=M,qE=Ru(kE);function Ru(r){return r&&r.__esModule?r:{default:r}}function GE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function WE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function VE(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}var _r=_t.Hyper=function(r){VE(e,r),LE(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=xu(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=xu(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 GE(this,e),WE(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(gr.default);(0,qE.default)(_r),_r.MAX_VALUE=new _r(gr.default.MAX_VALUE.low,gr.default.MAX_VALUE.high),_r.MIN_VALUE=new _r(gr.default.MIN_VALUE.low,gr.default.MIN_VALUE.high);var Te={};Object.defineProperty(Te,"__esModule",{value:!0}),Te.UnsignedInt=void 0;var HE=dt,Fu=Mu(HE),zE=M,XE=Mu(zE);function Mu(r){return r&&r.__esModule?r:{default:r}}var mr=Te.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,Fu.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,Fu.default)(e)||Math.floor(e)!==e?!1:e>=mr.MIN_VALUE&&e<=mr.MAX_VALUE}};mr.MAX_VALUE=Math.pow(2,32)-1,mr.MIN_VALUE=0,(0,XE.default)(mr);var mt={};Object.defineProperty(mt,"__esModule",{value:!0}),mt.UnsignedHyper=void 0;var YE=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}}(),Du=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)}},KE=ci.exports,wr=Bu(KE),ZE=M,JE=Bu(ZE);function Bu(r){return r&&r.__esModule?r:{default:r}}function QE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function eO(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 rO(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 br=mt.UnsignedHyper=function(r){rO(e,r),YE(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=Du(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=Du(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 QE(this,e),eO(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(wr.default);(0,JE.default)(br),br.MAX_VALUE=new br(wr.default.MAX_UNSIGNED_VALUE.low,wr.default.MAX_UNSIGNED_VALUE.high),br.MIN_VALUE=new br(wr.default.MIN_VALUE.low,wr.default.MIN_VALUE.high);var wt={};Object.defineProperty(wt,"__esModule",{value:!0}),wt.Float=void 0;var tO=dt,Nu=Uu(tO),nO=M,iO=Uu(nO);function Uu(r){return r&&r.__esModule?r:{default:r}}var aO=wt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,Nu.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,Nu.default)(e)}};(0,iO.default)(aO);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.Double=void 0;var oO=dt,Cu=Lu(oO),uO=M,sO=Lu(uO);function Lu(r){return r&&r.__esModule?r:{default:r}}var fO=bt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,Cu.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,Cu.default)(e)}};(0,sO.default)(fO);var $t={};Object.defineProperty($t,"__esModule",{value:!0}),$t.Quadruple=void 0;var cO=M,lO=pO(cO);function pO(r){return r&&r.__esModule?r:{default:r}}var hO=$t.Quadruple={read:function(){throw new Error("XDR Read Error: quadruple not supported")},write:function(){throw new Error("XDR Write Error: quadruple not supported")},isValid:function(){return!1}};(0,lO.default)(hO);var $r={},dO=se,yO=V,vO="[object Boolean]";function gO(r){return r===!0||r===!1||yO(r)&&dO(r)==vO}var _O=gO;Object.defineProperty($r,"__esModule",{value:!0}),$r.Bool=void 0;var mO=_O,wO=ku(mO),ju=ce,bO=M,$O=ku(bO);function ku(r){return r&&r.__esModule?r:{default:r}}var AO=$r.Bool={read:function(e){var t=ju.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 ju.Int.write(n,t)},isValid:function(e){return(0,wO.default)(e)}};(0,$O.default)(AO);var At={},EO=se,OO=U,SO=V,IO="[object String]";function PO(r){return typeof r=="string"||!OO(r)&&SO(r)&&EO(r)==IO}var qu=PO;Object.defineProperty(At,"__esModule",{value:!0}),At.String=void 0;var TO=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),xO=qu,Gu=li(xO),RO=U,FO=li(RO),Wu=ce,MO=Te,Vu=Pe,DO=M,BO=li(DO);function li(r){return r&&r.__esModule?r:{default:r}}function NO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var UO=At.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:MO.UnsignedInt.MAX_VALUE;NO(this,r),this._maxLength=e}return TO(r,[{key:"read",value:function(t){var n=Wu.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,Vu.calculatePadding)(n),a=t.slice(n);return(0,Vu.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,Gu.default)(t)?i=y.from(t,"utf8"):i=y.from(t),Wu.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,Gu.default)(t))n=y.from(t,"utf8");else if((0,FO.default)(t)||y.isBuffer(t))n=y.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,BO.default)(UO.prototype);var Et={};Object.defineProperty(Et,"__esModule",{value:!0}),Et.Opaque=void 0;var CO=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}}(),Hu=Pe,LO=M,jO=kO(LO);function kO(r){return r&&r.__esModule?r:{default:r}}function qO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var GO=Et.Opaque=function(){function r(e){qO(this,r),this._length=e,this._padding=(0,Hu.calculatePadding)(e)}return CO(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Hu.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 y.isBuffer(t)&&t.length===this._length}}]),r}();(0,jO.default)(GO.prototype);var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.VarOpaque=void 0;var WO=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}}(),zu=ce,VO=Te,Xu=Pe,HO=M,zO=XO(HO);function XO(r){return r&&r.__esModule?r:{default:r}}function YO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var KO=Ot.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:VO.UnsignedInt.MAX_VALUE;YO(this,r),this._maxLength=e}return WO(r,[{key:"read",value:function(t){var n=zu.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,Xu.calculatePadding)(n),a=t.slice(n);return(0,Xu.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));zu.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return y.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,zO.default)(KO.prototype);var St={},xe={exports:{}},ZO=dr;function JO(r){return typeof r=="function"?r:ZO}var Yu=JO,QO=Bn,eS=ai,rS=Yu,tS=U;function nS(r,e){var t=tS(r)?QO:eS;return t(r,rS(e))}var iS=nS;(function(r){r.exports=iS})(xe);var aS=/\s/;function oS(r){for(var e=r.length;e--&&aS.test(r.charAt(e)););return e}var uS=oS,sS=uS,fS=/^\s+/;function cS(r){return r&&r.slice(0,sS(r)+1).replace(fS,"")}var lS=cS,pS=lS,Ku=fe,hS=ct,Zu=0/0,dS=/^[-+]0x[0-9a-f]+$/i,yS=/^0b[01]+$/i,vS=/^0o[0-7]+$/i,gS=parseInt;function _S(r){if(typeof r=="number")return r;if(hS(r))return Zu;if(Ku(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Ku(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=pS(r);var t=yS.test(r);return t||vS.test(r)?gS(r.slice(2),t?2:8):dS.test(r)?Zu:+r}var mS=_S,wS=mS,Ju=1/0,bS=17976931348623157e292;function $S(r){if(!r)return r===0?r:0;if(r=wS(r),r===Ju||r===-Ju){var e=r<0?-1:1;return e*bS}return r===r?r:0}var AS=$S,ES=AS;function OS(r){var e=ES(r),t=e%1;return e===e?t?e-t:e:0}var Qu=OS,SS=Ka,IS=Yu,PS=Qu,TS=9007199254740991,pi=4294967295,xS=Math.min;function RS(r,e){if(r=PS(r),r<1||r>TS)return[];var t=pi,n=xS(r,pi);e=IS(e),r-=pi;for(var i=SS(n,e);++t<r;)e(t);return i}var es=RS;Object.defineProperty(St,"__esModule",{value:!0}),St.Array=void 0;var FS=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}}(),MS=si,DS=Ar(MS),BS=xe.exports,NS=Ar(BS),US=es,CS=Ar(US),LS=U,rs=Ar(LS),jS=M,kS=Ar(jS);function Ar(r){return r&&r.__esModule?r:{default:r}}function qS(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var GS=St.Array=function(){function r(e,t){qS(this,r),this._childType=e,this._length=t}return FS(r,[{key:"read",value:function(t){var n=this;return(0,CS.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,rs.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,NS.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,rs.default)(t)||t.length!==this._length?!1:(0,DS.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,kS.default)(GS.prototype);var It={};Object.defineProperty(It,"__esModule",{value:!0}),It.VarArray=void 0;var WS=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}}(),VS=si,HS=Er(VS),zS=xe.exports,XS=Er(zS),YS=es,KS=Er(YS),ZS=U,ts=Er(ZS),JS=Te,ns=ce,QS=M,e2=Er(QS);function Er(r){return r&&r.__esModule?r:{default:r}}function r2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var t2=It.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:JS.UnsignedInt.MAX_VALUE;r2(this,r),this._childType=e,this._maxLength=t}return WS(r,[{key:"read",value:function(t){var n=this,i=ns.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,KS.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,ts.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));ns.Int.write(t.length,n),(0,XS.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,ts.default)(t)||t.length>this._maxLength?!1:(0,HS.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,e2.default)(t2.prototype);var Pt={};function n2(r){return r===null}var i2=n2;function a2(r){return r===void 0}var Or=a2;Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.Option=void 0;var o2=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}}(),u2=i2,is=hi(u2),s2=Or,as=hi(s2),os=$r,f2=M,c2=hi(f2);function hi(r){return r&&r.__esModule?r:{default:r}}function l2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var p2=Pt.Option=function(){function r(e){l2(this,r),this._childType=e}return o2(r,[{key:"read",value:function(t){if(os.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,is.default)(t)||(0,as.default)(t));os.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,is.default)(t)||(0,as.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,c2.default)(p2.prototype);var Sr={};Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.Void=void 0;var h2=Or,us=ss(h2),d2=M,y2=ss(d2);function ss(r){return r&&r.__esModule?r:{default:r}}var v2=Sr.Void={read:function(){},write:function(e){if(!(0,us.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,us.default)(e)}};(0,y2.default)(v2);var Tt={},g2=Qr;function _2(r,e){return g2(e,function(t){return r[t]})}var m2=_2,w2=m2,b2=Xe;function $2(r){return r==null?[]:w2(r,b2(r))}var A2=$2;Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.Enum=void 0;var E2=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}}(),O2=xe.exports,S2=di(O2),I2=A2,P2=di(I2),fs=ce,T2=M,x2=di(T2);function di(r){return r&&r.__esModule?r:{default:r}}function R2(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 F2(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 cs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var M2=Tt.Enum=function(){function r(e,t){cs(this,r),this.name=e,this.value=t}return E2(r,null,[{key:"read",value:function(t){var n=fs.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);fs.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,P2.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){F2(s,o);function s(){return cs(this,s),R2(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.enumName=n,t.results[n]=a,a._members={},a._byValue=new Map,(0,S2.default)(i,function(o,s){var f=new a(s,o);a._members[s]=f,a._byValue.set(o,f),a[s]=function(){return f}}),a}}]),r}();(0,x2.default)(M2);var xt={},D2=ai,B2=pr;function N2(r,e){var t=-1,n=B2(r)?Array(r.length):[];return D2(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var U2=N2,C2=Qr,L2=Eu,j2=U2,k2=U;function q2(r,e){var t=k2(r)?C2:j2;return t(r,L2(e))}var G2=q2;function W2(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 V2=W2,Ir={};Object.defineProperty(Ir,"__esModule",{value:!0});var H2=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 z2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Ir.Reference=function(){function r(){z2(this,r)}return H2(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(xt,"__esModule",{value:!0}),xt.Struct=void 0;var Rt=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),X2=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}}(),Y2=xe.exports,ls=Pr(Y2),K2=G2,Z2=Pr(K2),J2=Or,Q2=Pr(J2),eI=V2,rI=Pr(eI),tI=Ir,nI=M,iI=Pr(nI);function Pr(r){return r&&r.__esModule?r:{default:r}}function aI(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 oI(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 ps(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var uI=xt.Struct=function(){function r(e){ps(this,r),this._attributes=e||{}}return X2(r,null,[{key:"read",value:function(t){var n=(0,Z2.default)(this._fields,function(i){var a=Rt(i,2),o=a[0],s=a[1],f=s.read(t);return[o,f]});return new this((0,rI.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,ls.default)(this._fields,function(i){var a=Rt(i,2),o=a[0],s=a[1],f=t._attributes[o];s.write(f,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){oI(s,o);function s(){return ps(this,s),aI(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var s=Rt(o,2),f=s[0],c=s[1];return c instanceof tI.Reference&&(c=c.resolve(t)),[f,c]}),(0,ls.default)(a._fields,function(o){var s=Rt(o,1),f=s[0];a.prototype[f]=sI(f)}),a}}]),r}();(0,iI.default)(uI);function sI(r){return function(t){return(0,Q2.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.Union=void 0;var fI=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),cI=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}}(),lI=xe.exports,Mt=Bt(lI),pI=Or,hs=Bt(pI),hI=qu,ds=Bt(hI),Dt=Sr,yi=Ir,dI=M,yI=Bt(dI);function Bt(r){return r&&r.__esModule?r:{default:r}}function vI(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 gI(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 ys(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var _I=Ft.Union=function(){function r(e,t){ys(this,r),this.set(e,t)}return cI(r,[{key:"set",value:function(t,n){(0,ds.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!==Dt.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===Dt.Void?Dt.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,hs.default)(a)?o=i.read(t):o=a.read(t),new this(n,o)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.unionName);this._switchOn.write(t.switch(),n),t.armType().write(t.value(),n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(s){gI(f,s);function f(){return ys(this,f),vI(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof yi.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,Mt.default)(i.arms,function(s,f){s instanceof yi.Reference&&(s=s.resolve(t)),a._arms[f]=s});var o=i.defaultArm;return o instanceof yi.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Mt.default)(i.switches,function(s){var f=fI(s,2),c=f[0],l=f[1];(0,ds.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,hs.default)(a._switchOn.values)||(0,Mt.default)(a._switchOn.values(),function(s){a[s.name]=function(f){return new a(s,f)},a.prototype[s.name]=function(c){return this.set(s,c)}}),(0,Mt.default)(a._arms,function(s,f){s!==Dt.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,yI.default)(_I),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ce;Object.keys(e).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return e[h]}})});var t=_t;Object.keys(t).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return t[h]}})});var n=Te;Object.keys(n).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return n[h]}})});var i=mt;Object.keys(i).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return i[h]}})});var a=wt;Object.keys(a).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return a[h]}})});var o=bt;Object.keys(o).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return o[h]}})});var s=$t;Object.keys(s).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return s[h]}})});var f=$r;Object.keys(f).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return f[h]}})});var c=At;Object.keys(c).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return c[h]}})});var l=Et;Object.keys(l).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return l[h]}})});var u=Ot;Object.keys(u).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return u[h]}})});var p=St;Object.keys(p).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return p[h]}})});var d=It;Object.keys(d).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return d[h]}})});var _=Pt;Object.keys(_).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return _[h]}})});var $=Sr;Object.keys($).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return $[h]}})});var b=Tt;Object.keys(b).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return b[h]}})});var w=xt;Object.keys(w).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return w[h]}})});var A=Ft;Object.keys(A).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return A[h]}})})}(ii);var vs={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(v,g){for(var O=0;O<g.length;O++){var S=g[O];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(v,S.key,S)}}return function(v,g,O){return g&&m(v.prototype,g),O&&m(v,O),v}}(),t=Ir;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=_;var n=Or,i=l(n),a=xe.exports,o=l(a),s=ii,f=c(s);function c(m){if(m&&m.__esModule)return m;var v={};if(m!=null)for(var g in m)Object.prototype.hasOwnProperty.call(m,g)&&(v[g]=m[g]);return v.default=m,v}function l(m){return m&&m.__esModule?m:{default:m}}function u(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function p(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function d(m,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);m.prototype=Object.create(v&&v.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(m,v):m.__proto__=v)}function _(m){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var g=new R(v);m(g),g.resolve()}return v}var $=function(m){d(v,m);function v(g){u(this,v);var O=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return O.name=g,O}return e(v,[{key:"resolve",value:function(O){var S=O.definitions[this.name];return S.resolve(O)}}]),v}(t.Reference),b=function(m){d(v,m);function v(g,O){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,v);var B=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return B.childReference=g,B.length=O,B.variable=S,B}return e(v,[{key:"resolve",value:function(O){var S=this.childReference,B=this.length;return S instanceof t.Reference&&(S=S.resolve(O)),B instanceof t.Reference&&(B=B.resolve(O)),this.variable?new f.VarArray(S,B):new f.Array(S,B)}}]),v}(t.Reference),w=function(m){d(v,m);function v(g){u(this,v);var O=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return O.childReference=g,O.name=g.name,O}return e(v,[{key:"resolve",value:function(O){var S=this.childReference;return S instanceof t.Reference&&(S=S.resolve(O)),new f.Option(S)}}]),v}(t.Reference),A=function(m){d(v,m);function v(g,O){u(this,v);var S=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return S.sizedType=g,S.length=O,S}return e(v,[{key:"resolve",value:function(O){var S=this.length;return S instanceof t.Reference&&(S=S.resolve(O)),new this.sizedType(S)}}]),v}(t.Reference),h=function(){function m(v,g,O){u(this,m),this.constructor=v,this.name=g,this.config=O}return e(m,[{key:"resolve",value:function(g){return this.name in g.results?g.results[this.name]:this.constructor(g,this.name,this.config)}}]),m}();function I(m,v,g){return g instanceof t.Reference&&(g=g.resolve(m)),m.results[v]=g,g}function P(m,v,g){return m.results[v]=g,g}var R=function(){function m(v){u(this,m),this._destination=v,this._definitions={}}return e(m,[{key:"enum",value:function(g,O){var S=new h(f.Enum.create,g,O);this.define(g,S)}},{key:"struct",value:function(g,O){var S=new h(f.Struct.create,g,O);this.define(g,S)}},{key:"union",value:function(g,O){var S=new h(f.Union.create,g,O);this.define(g,S)}},{key:"typedef",value:function(g,O){var S=new h(I,g,O);this.define(g,S)}},{key:"const",value:function(g,O){var S=new h(P,g,O);this.define(g,S)}},{key:"void",value:function(){return f.Void}},{key:"bool",value:function(){return f.Bool}},{key:"int",value:function(){return f.Int}},{key:"hyper",value:function(){return f.Hyper}},{key:"uint",value:function(){return f.UnsignedInt}},{key:"uhyper",value:function(){return f.UnsignedHyper}},{key:"float",value:function(){return f.Float}},{key:"double",value:function(){return f.Double}},{key:"quadruple",value:function(){return f.Quadruple}},{key:"string",value:function(g){return new A(f.String,g)}},{key:"opaque",value:function(g){return new A(f.Opaque,g)}},{key:"varOpaque",value:function(g){return new A(f.VarOpaque,g)}},{key:"array",value:function(g,O){return new b(g,O)}},{key:"varArray",value:function(g,O){return new b(g,O,!0)}},{key:"option",value:function(g){return new w(g)}},{key:"define",value:function(g,O){if((0,i.default)(this._destination[g]))this._definitions[g]=O;else throw new Error("XDRTypes Error:"+g+" is already defined")}},{key:"lookup",value:function(g){return new $(g)}},{key:"resolve",value:function(){var g=this;(0,o.default)(this._definitions,function(O){O.resolve({definitions:g._definitions,results:g._destination})})}}]),m}()})(vs),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ii;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=vs;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(iu);function mI(r){const e={variantId:le.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new le.BundleItem({collectionId:le.Uint64.fromString(n.collectionId.toString()),productId:le.Uint64.fromString(n.productId.toString()),variantId:le.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new le.BundleItemExt(0)})),ext:new le.BundleExt(0)},t=new le.Bundle(e);return le.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const le=iu.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")}})}),gs="/bundling-storefront-manager";function wI(){return Math.ceil(Date.now()/1e3)}async function bI(){try{const{timestamp:r}=await sr("get",`${gs}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),wI()}}async function $I(r){const e=ue(),t=await _s(r);if(t!==!0)throw new Error(t);const n=await bI(),i=mI({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 sr("post",`${gs}/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 AI(r,e){const t=ms(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${Np(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 _s(r){try{return r?await tu(r.externalProductId)?!0:"Bundle settings do not exist for the given product":"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}const EI={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 ms(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=EI[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 OI(r,e){const{bundle_selection:t}=await E("get","/bundle_selections",{id:e},r);return t}function SI(r,e){return E("get","/bundle_selections",{query:e},r)}async function II(r,e){const{bundle_selection:t}=await E("post","/bundle_selections",{data:e},r);return t}async function PI(r,e,t){const{bundle_selection:n}=await E("put","/bundle_selections",{id:e,data:t},r);return n}function TI(r,e){return E("delete","/bundle_selections",{id:e},r)}var xI=Object.freeze({__proto__:null,getBundleId:$I,getDynamicBundleItems:AI,validateBundle:_s,validateDynamicBundle:ms,getBundleSelection:OI,listBundleSelections:SI,createBundleSelection:II,updateBundleSelection:PI,deleteBundleSelection:TI});async function RI(r,e,t){const{charge:n}=await E("get","/charges",{id:e,query:{include:t?.include}},r);return n}function FI(r,e){return E("get","/charges",{query:e},r)}async function MI(r,e,t){const{charge:n}=await E("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},r);return n}async function DI(r,e){const{charge:t}=await E("post",`/charges/${e}/remove_discount`,{},r);return t}async function BI(r,e){const{charge:t}=await E("post",`/charges/${e}/skip`,{},r);return t}async function NI(r,e){const{charge:t}=await E("post",`/charges/${e}/unskip`,{},r);return t}async function UI(r,e){const{charge:t}=await E("post",`/charges/${e}/process`,{},r);return t}var CI=Object.freeze({__proto__:null,getCharge:RI,listCharges:FI,applyDiscountToCharge:MI,removeDiscountsFromCharge:DI,skipCharge:BI,unskipCharge:NI,processCharge:UI});async function LI(r,e){const{membership:t}=await E("get","/memberships",{id:e},r);return t}function jI(r,e){return E("get","/memberships",{query:e},r)}async function kI(r,e,t){const{membership:n}=await E("post",`/memberships/${e}/cancel`,{data:t},r);return n}async function qI(r,e,t){const{membership:n}=await E("post",`/memberships/${e}/activate`,{data:t},r);return n}async function GI(r,e,t){const{membership:n}=await E("post",`/memberships/${e}/change`,{data:t},r);return n}var WI=Object.freeze({__proto__:null,getMembership:LI,listMemberships:jI,cancelMembership:kI,activateMembership:qI,changeMembership:GI});async function VI(r,e,t){const{membership_program:n}=await E("get","/membership_programs",{id:e,query:{include:t?.include}},r);return n}function HI(r,e){return E("get","/membership_programs",{query:e},r)}var zI=Object.freeze({__proto__:null,getMembershipProgram:VI,listMembershipPrograms:HI});async function XI(r,e){const{metafield:t}=await E("post","/metafields",{data:{metafield:e}},r);return t}async function YI(r,e,t){const{metafield:n}=await E("put","/metafields",{id:e,data:{metafield:t}},r);return n}function KI(r,e){return E("delete","/metafields",{id:e},r)}var ZI=Object.freeze({__proto__:null,createMetafield:XI,updateMetafield:YI,deleteMetafield:KI});async function JI(r,e){const{onetime:t}=await E("get","/onetimes",{id:e},r);return t}function QI(r,e){return E("get","/onetimes",{query:e},r)}async function eP(r,e){const{onetime:t}=await E("post","/onetimes",{data:e},r);return t}async function rP(r,e,t){const{onetime:n}=await E("put","/onetimes",{id:e,data:t},r);return n}function tP(r,e){return E("delete","/onetimes",{id:e},r)}var nP=Object.freeze({__proto__:null,getOnetime:JI,listOnetimes:QI,createOnetime:eP,updateOnetime:rP,deleteOnetime:tP});async function iP(r,e){const{order:t}=await E("get","/orders",{id:e},r);return t}function aP(r,e){return E("get","/orders",{query:e},r)}var oP=Object.freeze({__proto__:null,getOrder:iP,listOrders:aP});async function uP(r,e,t){const{payment_method:n}=await E("get","/payment_methods",{id:e,query:{include:t?.include}},r);return n}async function sP(r,e,t){const{payment_method:n}=await E("put","/payment_methods",{id:e,data:t},r);return n}function fP(r,e){return E("get","/payment_methods",{query:e},r)}var cP=Object.freeze({__proto__:null,getPaymentMethod:uP,updatePaymentMethod:sP,listPaymentMethods:fP});async function lP(r,e){const{plan:t}=await E("get","/plans",{id:e},r);return t}function pP(r,e){return E("get","/plans",{query:e},r)}var hP=Object.freeze({__proto__:null,getPlan:lP,listPlans:pP}),ws=co,dP=ws&&new ws,bs=dP,yP=dr,$s=bs,vP=$s?function(r,e){return $s.set(r,e),r}:yP,As=vP,gP=st,_P=fe;function mP(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=gP(r.prototype),n=r.apply(t,e);return _P(n)?n:t}}var Nt=mP,wP=Nt,bP=G,$P=1;function AP(r,e,t){var n=e&$P,i=wP(r);function a(){var o=this&&this!==bP&&this instanceof a?i:r;return o.apply(n?t:this,arguments)}return a}var EP=AP,OP=Math.max;function SP(r,e,t,n){for(var i=-1,a=r.length,o=t.length,s=-1,f=e.length,c=OP(a-o,0),l=Array(f+c),u=!n;++s<f;)l[s]=e[s];for(;++i<o;)(u||i<a)&&(l[t[i]]=r[i]);for(;c--;)l[s++]=r[i++];return l}var Es=SP,IP=Math.max;function PP(r,e,t,n){for(var i=-1,a=r.length,o=-1,s=t.length,f=-1,c=e.length,l=IP(a-s,0),u=Array(l+c),p=!n;++i<l;)u[i]=r[i];for(var d=i;++f<c;)u[d+f]=e[f];for(;++o<s;)(p||i<a)&&(u[d+t[o]]=r[i++]);return u}var Os=PP;function TP(r,e){for(var t=r.length,n=0;t--;)r[t]===e&&++n;return n}var xP=TP;function RP(){}var vi=RP,FP=st,MP=vi,DP=4294967295;function Ut(r){this.__wrapped__=r,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=DP,this.__views__=[]}Ut.prototype=FP(MP.prototype),Ut.prototype.constructor=Ut;var gi=Ut;function BP(){}var NP=BP,Ss=bs,UP=NP,CP=Ss?function(r){return Ss.get(r)}:UP,Is=CP,LP={},jP=LP,Ps=jP,kP=Object.prototype,qP=kP.hasOwnProperty;function GP(r){for(var e=r.name+"",t=Ps[e],n=qP.call(Ps,e)?t.length:0;n--;){var i=t[n],a=i.func;if(a==null||a==r)return i.name}return e}var WP=GP,VP=st,HP=vi;function Ct(r,e){this.__wrapped__=r,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}Ct.prototype=VP(HP.prototype),Ct.prototype.constructor=Ct;var Ts=Ct,zP=gi,XP=Ts,YP=kn;function KP(r){if(r instanceof zP)return r.clone();var e=new XP(r.__wrapped__,r.__chain__);return e.__actions__=YP(r.__actions__),e.__index__=r.__index__,e.__values__=r.__values__,e}var ZP=KP,JP=gi,xs=Ts,QP=vi,eT=U,rT=V,tT=ZP,nT=Object.prototype,iT=nT.hasOwnProperty;function Lt(r){if(rT(r)&&!eT(r)&&!(r instanceof JP)){if(r instanceof xs)return r;if(iT.call(r,"__wrapped__"))return tT(r)}return new xs(r)}Lt.prototype=QP.prototype,Lt.prototype.constructor=Lt;var aT=Lt,oT=gi,uT=Is,sT=WP,fT=aT;function cT(r){var e=sT(r),t=fT[e];if(typeof t!="function"||!(e in oT.prototype))return!1;if(r===t)return!0;var n=uT(t);return!!n&&r===n[0]}var lT=cT,pT=As,hT=Go,dT=hT(pT),Rs=dT,yT=/\{\n\/\* \[wrapped with (.+)\] \*/,vT=/,? & /;function gT(r){var e=r.match(yT);return e?e[1].split(vT):[]}var _T=gT,mT=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function wT(r,e){var t=e.length;if(!t)return r;var n=t-1;return e[n]=(t>1?"& ":"")+e[n],e=e.join(t>2?", ":" "),r.replace(mT,`{
|
|
24
|
+
*/(function(e,t){typeof WE=="function"&&!0&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(ne,function(){function e(l,u,p){this.low=l|0,this.high=u|0,this.unsigned=!!p}e.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=function(u){return(u&&u.__isLong__)===!0};var t={},n={};e.fromInt=function(u,p){var d,_;return p?(u=u>>>0,0<=u&&u<256&&(_=n[u],_)?_:(d=new e(u,(u|0)<0?-1:0,!0),0<=u&&u<256&&(n[u]=d),d)):(u=u|0,-128<=u&&u<128&&(_=t[u],_)?_:(d=new e(u,u<0?-1:0,!1),-128<=u&&u<128&&(t[u]=d),d))},e.fromNumber=function(u,p){return p=!!p,isNaN(u)||!isFinite(u)?e.ZERO:!p&&u<=-f?e.MIN_VALUE:!p&&u+1>=f?e.MAX_VALUE:p&&u>=s?e.MAX_UNSIGNED_VALUE:u<0?e.fromNumber(-u,p).negate():new e(u%o|0,u/o|0,p)},e.fromBits=function(u,p,d){return new e(u,p,d)},e.fromString=function(u,p,d){if(u.length===0)throw Error("number format error: empty string");if(u==="NaN"||u==="Infinity"||u==="+Infinity"||u==="-Infinity")return e.ZERO;if(typeof p=="number"&&(d=p,p=!1),d=d||10,d<2||36<d)throw Error("radix out of range: "+d);var _;if((_=u.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+u);if(_===0)return e.fromString(u.substring(1),p,d).negate();for(var $=e.fromNumber(Math.pow(d,8)),b=e.ZERO,w=0;w<u.length;w+=8){var A=Math.min(8,u.length-w),h=parseInt(u.substring(w,w+A),d);if(A<8){var P=e.fromNumber(Math.pow(d,A));b=b.multiply(P).add(e.fromNumber(h))}else b=b.multiply($),b=b.add(e.fromNumber(h))}return b.unsigned=p,b},e.fromValue=function(u){return u instanceof e?u:typeof u=="number"?e.fromNumber(u):typeof u=="string"?e.fromString(u):new e(u.low,u.high,u.unsigned)};var i=1<<16,a=1<<24,o=i*i,s=o*o,f=s/2,c=e.fromInt(a);return e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)},e.prototype.toString=function(u){if(u=u||10,u<2||36<u)throw RangeError("radix out of range: "+u);if(this.isZero())return"0";var p;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var d=e.fromNumber(u),_=this.divide(d);return p=_.multiply(d).subtract(this),_.toString(u)+p.toInt().toString(u)}else return"-"+this.negate().toString(u);var $=e.fromNumber(Math.pow(u,6),this.unsigned);p=this;for(var b="";;){var w=p.divide($),A=p.subtract(w.multiply($)).toInt()>>>0,h=A.toString(u);if(p=w,p.isZero())return h+b;for(;h.length<6;)h="0"+h;b=""+h+b}},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(e.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var u=this.high!=0?this.high:this.low,p=31;p>0&&(u&1<<p)==0;p--);return this.high!=0?p+33:p+1},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.equals=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.unsigned!==u.unsigned&&this.high>>>31===1&&u.high>>>31===1?!1:this.high===u.high&&this.low===u.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(u){return!this.equals(u)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(u){return this.compare(u)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(u){return this.compare(u)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(u){return this.compare(u)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(u){return this.compare(u)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compare=function(u){if(e.isLong(u)||(u=e.fromValue(u)),this.equals(u))return 0;var p=this.isNegative(),d=u.isNegative();return p&&!d?-1:!p&&d?1:this.unsigned?u.high>>>0>this.high>>>0||u.high===this.high&&u.low>>>0>this.low>>>0?-1:1:this.subtract(u).isNegative()?-1:1},e.prototype.negate=function(){return!this.unsigned&&this.equals(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=e.prototype.negate,e.prototype.add=function(u){e.isLong(u)||(u=e.fromValue(u));var p=this.high>>>16,d=this.high&65535,_=this.low>>>16,$=this.low&65535,b=u.high>>>16,w=u.high&65535,A=u.low>>>16,h=u.low&65535,P=0,I=0,R=0,m=0;return m+=$+h,R+=m>>>16,m&=65535,R+=_+A,I+=R>>>16,R&=65535,I+=d+w,P+=I>>>16,I&=65535,P+=p+b,P&=65535,e.fromBits(R<<16|m,P<<16|I,this.unsigned)},e.prototype.subtract=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.add(u.negate())},e.prototype.sub=e.prototype.subtract,e.prototype.multiply=function(u){if(this.isZero()||(e.isLong(u)||(u=e.fromValue(u)),u.isZero()))return e.ZERO;if(this.equals(e.MIN_VALUE))return u.isOdd()?e.MIN_VALUE:e.ZERO;if(u.equals(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().multiply(u.negate()):this.negate().multiply(u).negate();if(u.isNegative())return this.multiply(u.negate()).negate();if(this.lessThan(c)&&u.lessThan(c))return e.fromNumber(this.toNumber()*u.toNumber(),this.unsigned);var p=this.high>>>16,d=this.high&65535,_=this.low>>>16,$=this.low&65535,b=u.high>>>16,w=u.high&65535,A=u.low>>>16,h=u.low&65535,P=0,I=0,R=0,m=0;return m+=$*h,R+=m>>>16,m&=65535,R+=_*h,I+=R>>>16,R&=65535,R+=$*A,I+=R>>>16,R&=65535,I+=d*h,P+=I>>>16,I&=65535,I+=_*A,P+=I>>>16,I&=65535,I+=$*w,P+=I>>>16,I&=65535,P+=p*h+d*A+_*w+$*b,P&=65535,e.fromBits(R<<16|m,P<<16|I,this.unsigned)},e.prototype.mul=e.prototype.multiply,e.prototype.divide=function(u){if(e.isLong(u)||(u=e.fromValue(u)),u.isZero())throw new Error("division by zero");if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var p,d,_;if(this.equals(e.MIN_VALUE)){if(u.equals(e.ONE)||u.equals(e.NEG_ONE))return e.MIN_VALUE;if(u.equals(e.MIN_VALUE))return e.ONE;var $=this.shiftRight(1);return p=$.divide(u).shiftLeft(1),p.equals(e.ZERO)?u.isNegative()?e.ONE:e.NEG_ONE:(d=this.subtract(u.multiply(p)),_=p.add(d.divide(u)),_)}else if(u.equals(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().divide(u.negate()):this.negate().divide(u).negate();if(u.isNegative())return this.divide(u.negate()).negate();for(_=e.ZERO,d=this;d.greaterThanOrEqual(u);){p=Math.max(1,Math.floor(d.toNumber()/u.toNumber()));for(var b=Math.ceil(Math.log(p)/Math.LN2),w=b<=48?1:Math.pow(2,b-48),A=e.fromNumber(p),h=A.multiply(u);h.isNegative()||h.greaterThan(d);)p-=w,A=e.fromNumber(p,this.unsigned),h=A.multiply(u);A.isZero()&&(A=e.ONE),_=_.add(A),d=d.subtract(h)}return _},e.prototype.div=e.prototype.divide,e.prototype.modulo=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.subtract(this.divide(u).multiply(u))},e.prototype.mod=e.prototype.modulo,e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.and=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low&u.low,this.high&u.high,this.unsigned)},e.prototype.or=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low|u.low,this.high|u.high,this.unsigned)},e.prototype.xor=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low^u.low,this.high^u.high,this.unsigned)},e.prototype.shiftLeft=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low<<u,this.high<<u|this.low>>>32-u,this.unsigned):e.fromBits(0,this.low<<u-32,this.unsigned)},e.prototype.shl=e.prototype.shiftLeft,e.prototype.shiftRight=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low>>>u|this.high<<32-u,this.high>>u,this.unsigned):e.fromBits(this.high>>u-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=e.prototype.shiftRight,e.prototype.shiftRightUnsigned=function(u){if(e.isLong(u)&&(u=u.toInt()),u&=63,u===0)return this;var p=this.high;if(u<32){var d=this.low;return e.fromBits(d>>>u|p<<32-u,p>>>u,this.unsigned)}else return u===32?e.fromBits(p,0,this.unsigned):e.fromBits(p>>>u-32,0,this.unsigned)},e.prototype.shru=e.prototype.shiftRightUnsigned,e.prototype.toSigned=function(){return this.unsigned?new e(this.low,this.high,!1):this},e.prototype.toUnsigned=function(){return this.unsigned?this:new e(this.low,this.high,!0)},e})})(ci),Object.defineProperty(_t,"__esModule",{value:!0}),_t.Hyper=void 0;var VE=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}}(),Mu=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)}},HE=ci.exports,gr=Du(HE),zE=M,XE=Du(zE);function Du(r){return r&&r.__esModule?r:{default:r}}function YE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function KE(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 ZE(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=_t.Hyper=function(r){ZE(e,r),VE(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=Mu(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=Mu(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 YE(this,e),KE(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(gr.default);(0,XE.default)(_r),_r.MAX_VALUE=new _r(gr.default.MAX_VALUE.low,gr.default.MAX_VALUE.high),_r.MIN_VALUE=new _r(gr.default.MIN_VALUE.low,gr.default.MIN_VALUE.high);var Te={};Object.defineProperty(Te,"__esModule",{value:!0}),Te.UnsignedInt=void 0;var JE=dt,Bu=Nu(JE),QE=M,eO=Nu(QE);function Nu(r){return r&&r.__esModule?r:{default:r}}var mr=Te.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,Bu.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,Bu.default)(e)||Math.floor(e)!==e?!1:e>=mr.MIN_VALUE&&e<=mr.MAX_VALUE}};mr.MAX_VALUE=Math.pow(2,32)-1,mr.MIN_VALUE=0,(0,eO.default)(mr);var mt={};Object.defineProperty(mt,"__esModule",{value:!0}),mt.UnsignedHyper=void 0;var rO=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}}(),Uu=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)}},tO=ci.exports,wr=Cu(tO),nO=M,iO=Cu(nO);function Cu(r){return r&&r.__esModule?r:{default:r}}function aO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function oO(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 uO(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 br=mt.UnsignedHyper=function(r){uO(e,r),rO(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=Uu(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=Uu(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 aO(this,e),oO(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(wr.default);(0,iO.default)(br),br.MAX_VALUE=new br(wr.default.MAX_UNSIGNED_VALUE.low,wr.default.MAX_UNSIGNED_VALUE.high),br.MIN_VALUE=new br(wr.default.MIN_VALUE.low,wr.default.MIN_VALUE.high);var wt={};Object.defineProperty(wt,"__esModule",{value:!0}),wt.Float=void 0;var sO=dt,Lu=ju(sO),fO=M,cO=ju(fO);function ju(r){return r&&r.__esModule?r:{default:r}}var lO=wt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,Lu.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,Lu.default)(e)}};(0,cO.default)(lO);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.Double=void 0;var pO=dt,ku=qu(pO),hO=M,dO=qu(hO);function qu(r){return r&&r.__esModule?r:{default:r}}var yO=bt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,ku.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,ku.default)(e)}};(0,dO.default)(yO);var $t={};Object.defineProperty($t,"__esModule",{value:!0}),$t.Quadruple=void 0;var vO=M,gO=_O(vO);function _O(r){return r&&r.__esModule?r:{default:r}}var mO=$t.Quadruple={read:function(){throw new Error("XDR Read Error: quadruple not supported")},write:function(){throw new Error("XDR Write Error: quadruple not supported")},isValid:function(){return!1}};(0,gO.default)(mO);var $r={},wO=se,bO=V,$O="[object Boolean]";function AO(r){return r===!0||r===!1||bO(r)&&wO(r)==$O}var EO=AO;Object.defineProperty($r,"__esModule",{value:!0}),$r.Bool=void 0;var OO=EO,SO=Wu(OO),Gu=ce,PO=M,IO=Wu(PO);function Wu(r){return r&&r.__esModule?r:{default:r}}var TO=$r.Bool={read:function(e){var t=Gu.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 Gu.Int.write(n,t)},isValid:function(e){return(0,SO.default)(e)}};(0,IO.default)(TO);var At={},xO=se,RO=U,FO=V,MO="[object String]";function DO(r){return typeof r=="string"||!RO(r)&&FO(r)&&xO(r)==MO}var Vu=DO;Object.defineProperty(At,"__esModule",{value:!0}),At.String=void 0;var BO=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}}(),NO=Vu,Hu=li(NO),UO=U,CO=li(UO),zu=ce,LO=Te,Xu=Ie,jO=M,kO=li(jO);function li(r){return r&&r.__esModule?r:{default:r}}function qO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var GO=At.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:LO.UnsignedInt.MAX_VALUE;qO(this,r),this._maxLength=e}return BO(r,[{key:"read",value:function(t){var n=zu.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,Xu.calculatePadding)(n),a=t.slice(n);return(0,Xu.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,Hu.default)(t)?i=y.from(t,"utf8"):i=y.from(t),zu.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,Hu.default)(t))n=y.from(t,"utf8");else if((0,CO.default)(t)||y.isBuffer(t))n=y.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,kO.default)(GO.prototype);var Et={};Object.defineProperty(Et,"__esModule",{value:!0}),Et.Opaque=void 0;var WO=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=Ie,VO=M,HO=zO(VO);function zO(r){return r&&r.__esModule?r:{default:r}}function XO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var YO=Et.Opaque=function(){function r(e){XO(this,r),this._length=e,this._padding=(0,Yu.calculatePadding)(e)}return WO(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 y.isBuffer(t)&&t.length===this._length}}]),r}();(0,HO.default)(YO.prototype);var Ot={};Object.defineProperty(Ot,"__esModule",{value:!0}),Ot.VarOpaque=void 0;var KO=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}}(),Ku=ce,ZO=Te,Zu=Ie,JO=M,QO=eS(JO);function eS(r){return r&&r.__esModule?r:{default:r}}function rS(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var tS=Ot.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ZO.UnsignedInt.MAX_VALUE;rS(this,r),this._maxLength=e}return KO(r,[{key:"read",value:function(t){var n=Ku.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,Zu.calculatePadding)(n),a=t.slice(n);return(0,Zu.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));Ku.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return y.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,QO.default)(tS.prototype);var St={},xe={exports:{}},nS=dr;function iS(r){return typeof r=="function"?r:nS}var Ju=iS,aS=Bn,oS=ai,uS=Ju,sS=U;function fS(r,e){var t=sS(r)?aS:oS;return t(r,uS(e))}var cS=fS;(function(r){r.exports=cS})(xe);var lS=/\s/;function pS(r){for(var e=r.length;e--&&lS.test(r.charAt(e)););return e}var hS=pS,dS=hS,yS=/^\s+/;function vS(r){return r&&r.slice(0,dS(r)+1).replace(yS,"")}var gS=vS,_S=gS,Qu=fe,mS=ct,es=0/0,wS=/^[-+]0x[0-9a-f]+$/i,bS=/^0b[01]+$/i,$S=/^0o[0-7]+$/i,AS=parseInt;function ES(r){if(typeof r=="number")return r;if(mS(r))return es;if(Qu(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Qu(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=_S(r);var t=bS.test(r);return t||$S.test(r)?AS(r.slice(2),t?2:8):wS.test(r)?es:+r}var OS=ES,SS=OS,rs=1/0,PS=17976931348623157e292;function IS(r){if(!r)return r===0?r:0;if(r=SS(r),r===rs||r===-rs){var e=r<0?-1:1;return e*PS}return r===r?r:0}var TS=IS,xS=TS;function RS(r){var e=xS(r),t=e%1;return e===e?t?e-t:e:0}var ts=RS,FS=Qa,MS=Ju,DS=ts,BS=9007199254740991,pi=4294967295,NS=Math.min;function US(r,e){if(r=DS(r),r<1||r>BS)return[];var t=pi,n=NS(r,pi);e=MS(e),r-=pi;for(var i=FS(n,e);++t<r;)e(t);return i}var ns=US;Object.defineProperty(St,"__esModule",{value:!0}),St.Array=void 0;var CS=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}}(),LS=si,jS=Ar(LS),kS=xe.exports,qS=Ar(kS),GS=ns,WS=Ar(GS),VS=U,is=Ar(VS),HS=M,zS=Ar(HS);function Ar(r){return r&&r.__esModule?r:{default:r}}function XS(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var YS=St.Array=function(){function r(e,t){XS(this,r),this._childType=e,this._length=t}return CS(r,[{key:"read",value:function(t){var n=this;return(0,WS.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,is.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,qS.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,is.default)(t)||t.length!==this._length?!1:(0,jS.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,zS.default)(YS.prototype);var Pt={};Object.defineProperty(Pt,"__esModule",{value:!0}),Pt.VarArray=void 0;var KS=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}}(),ZS=si,JS=Er(ZS),QS=xe.exports,e2=Er(QS),r2=ns,t2=Er(r2),n2=U,as=Er(n2),i2=Te,os=ce,a2=M,o2=Er(a2);function Er(r){return r&&r.__esModule?r:{default:r}}function u2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var s2=Pt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:i2.UnsignedInt.MAX_VALUE;u2(this,r),this._childType=e,this._maxLength=t}return KS(r,[{key:"read",value:function(t){var n=this,i=os.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,t2.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,as.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));os.Int.write(t.length,n),(0,e2.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,as.default)(t)||t.length>this._maxLength?!1:(0,JS.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,o2.default)(s2.prototype);var It={};function f2(r){return r===null}var c2=f2;function l2(r){return r===void 0}var Or=l2;Object.defineProperty(It,"__esModule",{value:!0}),It.Option=void 0;var p2=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}}(),h2=c2,us=hi(h2),d2=Or,ss=hi(d2),fs=$r,y2=M,v2=hi(y2);function hi(r){return r&&r.__esModule?r:{default:r}}function g2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var _2=It.Option=function(){function r(e){g2(this,r),this._childType=e}return p2(r,[{key:"read",value:function(t){if(fs.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,us.default)(t)||(0,ss.default)(t));fs.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,us.default)(t)||(0,ss.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,v2.default)(_2.prototype);var Sr={};Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.Void=void 0;var m2=Or,cs=ls(m2),w2=M,b2=ls(w2);function ls(r){return r&&r.__esModule?r:{default:r}}var $2=Sr.Void={read:function(){},write:function(e){if(!(0,cs.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,cs.default)(e)}};(0,b2.default)($2);var Tt={},A2=Qr;function E2(r,e){return A2(e,function(t){return r[t]})}var O2=E2,S2=O2,P2=Xe;function I2(r){return r==null?[]:S2(r,P2(r))}var T2=I2;Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.Enum=void 0;var x2=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}}(),R2=xe.exports,F2=di(R2),M2=T2,D2=di(M2),ps=ce,B2=M,N2=di(B2);function di(r){return r&&r.__esModule?r:{default:r}}function U2(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 C2(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 hs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var L2=Tt.Enum=function(){function r(e,t){hs(this,r),this.name=e,this.value=t}return x2(r,null,[{key:"read",value:function(t){var n=ps.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);ps.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,D2.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){C2(s,o);function s(){return hs(this,s),U2(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.enumName=n,t.results[n]=a,a._members={},a._byValue=new Map,(0,F2.default)(i,function(o,s){var f=new a(s,o);a._members[s]=f,a._byValue.set(o,f),a[s]=function(){return f}}),a}}]),r}();(0,N2.default)(L2);var xt={},j2=ai,k2=pr;function q2(r,e){var t=-1,n=k2(r)?Array(r.length):[];return j2(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var G2=q2,W2=Qr,V2=Pu,H2=G2,z2=U;function X2(r,e){var t=z2(r)?W2:H2;return t(r,V2(e))}var Y2=X2;function K2(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 Z2=K2,Pr={};Object.defineProperty(Pr,"__esModule",{value:!0});var J2=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 Q2(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Pr.Reference=function(){function r(){Q2(this,r)}return J2(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(xt,"__esModule",{value:!0}),xt.Struct=void 0;var Rt=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),eP=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}}(),rP=xe.exports,ds=Ir(rP),tP=Y2,nP=Ir(tP),iP=Or,aP=Ir(iP),oP=Z2,uP=Ir(oP),sP=Pr,fP=M,cP=Ir(fP);function Ir(r){return r&&r.__esModule?r:{default:r}}function lP(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 pP(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 ys(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var hP=xt.Struct=function(){function r(e){ys(this,r),this._attributes=e||{}}return eP(r,null,[{key:"read",value:function(t){var n=(0,nP.default)(this._fields,function(i){var a=Rt(i,2),o=a[0],s=a[1],f=s.read(t);return[o,f]});return new this((0,uP.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,ds.default)(this._fields,function(i){var a=Rt(i,2),o=a[0],s=a[1],f=t._attributes[o];s.write(f,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){pP(s,o);function s(){return ys(this,s),lP(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var s=Rt(o,2),f=s[0],c=s[1];return c instanceof sP.Reference&&(c=c.resolve(t)),[f,c]}),(0,ds.default)(a._fields,function(o){var s=Rt(o,1),f=s[0];a.prototype[f]=dP(f)}),a}}]),r}();(0,cP.default)(hP);function dP(r){return function(t){return(0,aP.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.Union=void 0;var yP=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),vP=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}}(),gP=xe.exports,Mt=Bt(gP),_P=Or,vs=Bt(_P),mP=Vu,gs=Bt(mP),Dt=Sr,yi=Pr,wP=M,bP=Bt(wP);function Bt(r){return r&&r.__esModule?r:{default:r}}function $P(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 AP(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 _s(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var EP=Ft.Union=function(){function r(e,t){_s(this,r),this.set(e,t)}return vP(r,[{key:"set",value:function(t,n){(0,gs.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!==Dt.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===Dt.Void?Dt.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,vs.default)(a)?o=i.read(t):o=a.read(t),new this(n,o)}},{key:"write",value:function(t,n){if(!(t instanceof this))throw new Error("XDR Write Error: "+t+" is not a "+this.unionName);this._switchOn.write(t.switch(),n),t.armType().write(t.value(),n)}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(s){AP(f,s);function f(){return _s(this,f),$P(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof yi.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,Mt.default)(i.arms,function(s,f){s instanceof yi.Reference&&(s=s.resolve(t)),a._arms[f]=s});var o=i.defaultArm;return o instanceof yi.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Mt.default)(i.switches,function(s){var f=yP(s,2),c=f[0],l=f[1];(0,gs.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,vs.default)(a._switchOn.values)||(0,Mt.default)(a._switchOn.values(),function(s){a[s.name]=function(f){return new a(s,f)},a.prototype[s.name]=function(c){return this.set(s,c)}}),(0,Mt.default)(a._arms,function(s,f){s!==Dt.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,bP.default)(EP),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ce;Object.keys(e).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return e[h]}})});var t=_t;Object.keys(t).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return t[h]}})});var n=Te;Object.keys(n).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return n[h]}})});var i=mt;Object.keys(i).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return i[h]}})});var a=wt;Object.keys(a).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return a[h]}})});var o=bt;Object.keys(o).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return o[h]}})});var s=$t;Object.keys(s).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return s[h]}})});var f=$r;Object.keys(f).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return f[h]}})});var c=At;Object.keys(c).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return c[h]}})});var l=Et;Object.keys(l).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return l[h]}})});var u=Ot;Object.keys(u).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return u[h]}})});var p=St;Object.keys(p).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return p[h]}})});var d=Pt;Object.keys(d).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return d[h]}})});var _=It;Object.keys(_).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return _[h]}})});var $=Sr;Object.keys($).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return $[h]}})});var b=Tt;Object.keys(b).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return b[h]}})});var w=xt;Object.keys(w).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return w[h]}})});var A=Ft;Object.keys(A).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return A[h]}})})}(ii);var ms={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(v,g){for(var O=0;O<g.length;O++){var S=g[O];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(v,S.key,S)}}return function(v,g,O){return g&&m(v.prototype,g),O&&m(v,O),v}}(),t=Pr;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=_;var n=Or,i=l(n),a=xe.exports,o=l(a),s=ii,f=c(s);function c(m){if(m&&m.__esModule)return m;var v={};if(m!=null)for(var g in m)Object.prototype.hasOwnProperty.call(m,g)&&(v[g]=m[g]);return v.default=m,v}function l(m){return m&&m.__esModule?m:{default:m}}function u(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function p(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function d(m,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);m.prototype=Object.create(v&&v.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(m,v):m.__proto__=v)}function _(m){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var g=new R(v);m(g),g.resolve()}return v}var $=function(m){d(v,m);function v(g){u(this,v);var O=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return O.name=g,O}return e(v,[{key:"resolve",value:function(O){var S=O.definitions[this.name];return S.resolve(O)}}]),v}(t.Reference),b=function(m){d(v,m);function v(g,O){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,v);var B=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return B.childReference=g,B.length=O,B.variable=S,B}return e(v,[{key:"resolve",value:function(O){var S=this.childReference,B=this.length;return S instanceof t.Reference&&(S=S.resolve(O)),B instanceof t.Reference&&(B=B.resolve(O)),this.variable?new f.VarArray(S,B):new f.Array(S,B)}}]),v}(t.Reference),w=function(m){d(v,m);function v(g){u(this,v);var O=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return O.childReference=g,O.name=g.name,O}return e(v,[{key:"resolve",value:function(O){var S=this.childReference;return S instanceof t.Reference&&(S=S.resolve(O)),new f.Option(S)}}]),v}(t.Reference),A=function(m){d(v,m);function v(g,O){u(this,v);var S=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return S.sizedType=g,S.length=O,S}return e(v,[{key:"resolve",value:function(O){var S=this.length;return S instanceof t.Reference&&(S=S.resolve(O)),new this.sizedType(S)}}]),v}(t.Reference),h=function(){function m(v,g,O){u(this,m),this.constructor=v,this.name=g,this.config=O}return e(m,[{key:"resolve",value:function(g){return this.name in g.results?g.results[this.name]:this.constructor(g,this.name,this.config)}}]),m}();function P(m,v,g){return g instanceof t.Reference&&(g=g.resolve(m)),m.results[v]=g,g}function I(m,v,g){return m.results[v]=g,g}var R=function(){function m(v){u(this,m),this._destination=v,this._definitions={}}return e(m,[{key:"enum",value:function(g,O){var S=new h(f.Enum.create,g,O);this.define(g,S)}},{key:"struct",value:function(g,O){var S=new h(f.Struct.create,g,O);this.define(g,S)}},{key:"union",value:function(g,O){var S=new h(f.Union.create,g,O);this.define(g,S)}},{key:"typedef",value:function(g,O){var S=new h(P,g,O);this.define(g,S)}},{key:"const",value:function(g,O){var S=new h(I,g,O);this.define(g,S)}},{key:"void",value:function(){return f.Void}},{key:"bool",value:function(){return f.Bool}},{key:"int",value:function(){return f.Int}},{key:"hyper",value:function(){return f.Hyper}},{key:"uint",value:function(){return f.UnsignedInt}},{key:"uhyper",value:function(){return f.UnsignedHyper}},{key:"float",value:function(){return f.Float}},{key:"double",value:function(){return f.Double}},{key:"quadruple",value:function(){return f.Quadruple}},{key:"string",value:function(g){return new A(f.String,g)}},{key:"opaque",value:function(g){return new A(f.Opaque,g)}},{key:"varOpaque",value:function(g){return new A(f.VarOpaque,g)}},{key:"array",value:function(g,O){return new b(g,O)}},{key:"varArray",value:function(g,O){return new b(g,O,!0)}},{key:"option",value:function(g){return new w(g)}},{key:"define",value:function(g,O){if((0,i.default)(this._destination[g]))this._definitions[g]=O;else throw new Error("XDRTypes Error:"+g+" is already defined")}},{key:"lookup",value:function(g){return new $(g)}},{key:"resolve",value:function(){var g=this;(0,o.default)(this._definitions,function(O){O.resolve({definitions:g._definitions,results:g._destination})})}}]),m}()})(ms),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ii;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=ms;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(uu);function OP(r){const e={variantId:le.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new le.BundleItem({collectionId:le.Uint64.fromString(n.collectionId.toString()),productId:le.Uint64.fromString(n.productId.toString()),variantId:le.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new le.BundleItemExt(0)})),ext:new le.BundleExt(0)},t=new le.Bundle(e);return le.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const le=uu.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")}})}),ws="/bundling-storefront-manager";function SP(){return Math.ceil(Date.now()/1e3)}async function PP(){try{const{timestamp:r}=await sr("get",`${ws}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),SP()}}async function IP(r){const e=ue(),t=await bs(r);if(t!==!0)throw new Error(t);const n=await PP(),i=OP({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 sr("post",`${ws}/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 TP(r,e){const t=$s(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${qp(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 bs(r){try{return r?await au(r.externalProductId)?!0:"Bundle settings do not exist for the given product":"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}const xP={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 $s(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=xP[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 RP(r,e){const{bundle_selection:t}=await E("get","/bundle_selections",{id:e},r);return t}function FP(r,e){return E("get","/bundle_selections",{query:e},r)}async function MP(r,e){const{bundle_selection:t}=await E("post","/bundle_selections",{data:e},r);return t}async function DP(r,e,t){const{bundle_selection:n}=await E("put","/bundle_selections",{id:e,data:t},r);return n}function BP(r,e){return E("delete","/bundle_selections",{id:e},r)}var NP=Object.freeze({__proto__:null,getBundleId:IP,getDynamicBundleItems:TP,validateBundle:bs,validateDynamicBundle:$s,getBundleSelection:RP,listBundleSelections:FP,createBundleSelection:MP,updateBundleSelection:DP,deleteBundleSelection:BP});async function UP(r,e,t){const{charge:n}=await E("get","/charges",{id:e,query:{include:t?.include}},r);return n}function CP(r,e){return E("get","/charges",{query:e},r)}async function LP(r,e,t){const{charge:n}=await E("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},r);return n}async function jP(r,e){const{charge:t}=await E("post",`/charges/${e}/remove_discount`,{},r);return t}async function kP(r,e,t){const{charge:n}=await E("post",`/charges/${e}/skip`,{data:{purchase_item_ids:t.map(i=>Number(i))}},r);return n}async function qP(r,e,t){const{charge:n}=await E("post",`/charges/${e}/unskip`,{data:{purchase_item_ids:t.map(i=>Number(i))}},r);return n}async function GP(r,e){const{charge:t}=await E("post",`/charges/${e}/process`,{},r);return t}var WP=Object.freeze({__proto__:null,getCharge:UP,listCharges:CP,applyDiscountToCharge:LP,removeDiscountsFromCharge:jP,skipCharge:kP,unskipCharge:qP,processCharge:GP});async function VP(r,e){const{membership:t}=await E("get","/memberships",{id:e},r);return t}function HP(r,e){return E("get","/memberships",{query:e},r)}async function zP(r,e,t){const{membership:n}=await E("post",`/memberships/${e}/cancel`,{data:t},r);return n}async function XP(r,e,t){const{membership:n}=await E("post",`/memberships/${e}/activate`,{data:t},r);return n}async function YP(r,e,t){const{membership:n}=await E("post",`/memberships/${e}/change`,{data:t},r);return n}var KP=Object.freeze({__proto__:null,getMembership:VP,listMemberships:HP,cancelMembership:zP,activateMembership:XP,changeMembership:YP});async function ZP(r,e,t){const{membership_program:n}=await E("get","/membership_programs",{id:e,query:{include:t?.include}},r);return n}function JP(r,e){return E("get","/membership_programs",{query:e},r)}var QP=Object.freeze({__proto__:null,getMembershipProgram:ZP,listMembershipPrograms:JP});async function eI(r,e){const{metafield:t}=await E("post","/metafields",{data:{metafield:e}},r);return t}async function rI(r,e,t){const{metafield:n}=await E("put","/metafields",{id:e,data:{metafield:t}},r);return n}function tI(r,e){return E("delete","/metafields",{id:e},r)}var nI=Object.freeze({__proto__:null,createMetafield:eI,updateMetafield:rI,deleteMetafield:tI});async function iI(r,e){const{onetime:t}=await E("get","/onetimes",{id:e},r);return t}function aI(r,e){return E("get","/onetimes",{query:e},r)}async function oI(r,e){const{onetime:t}=await E("post","/onetimes",{data:e},r);return t}async function uI(r,e,t){const{onetime:n}=await E("put","/onetimes",{id:e,data:t},r);return n}function sI(r,e){return E("delete","/onetimes",{id:e},r)}var fI=Object.freeze({__proto__:null,getOnetime:iI,listOnetimes:aI,createOnetime:oI,updateOnetime:uI,deleteOnetime:sI});async function cI(r,e){const{order:t}=await E("get","/orders",{id:e},r);return t}function lI(r,e){return E("get","/orders",{query:e},r)}var pI=Object.freeze({__proto__:null,getOrder:cI,listOrders:lI});async function hI(r,e,t){const{payment_method:n}=await E("get","/payment_methods",{id:e,query:{include:t?.include}},r);return n}async function dI(r,e,t){const{payment_method:n}=await E("put","/payment_methods",{id:e,data:t},r);return n}function yI(r,e){return E("get","/payment_methods",{query:e},r)}var vI=Object.freeze({__proto__:null,getPaymentMethod:hI,updatePaymentMethod:dI,listPaymentMethods:yI});async function gI(r,e){const{plan:t}=await E("get","/plans",{id:e},r);return t}function _I(r,e){return E("get","/plans",{query:e},r)}var mI=Object.freeze({__proto__:null,getPlan:gI,listPlans:_I}),As=ho,wI=As&&new As,Es=wI,bI=dr,Os=Es,$I=Os?function(r,e){return Os.set(r,e),r}:bI,Ss=$I,AI=st,EI=fe;function OI(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=AI(r.prototype),n=r.apply(t,e);return EI(n)?n:t}}var Nt=OI,SI=Nt,PI=G,II=1;function TI(r,e,t){var n=e&II,i=SI(r);function a(){var o=this&&this!==PI&&this instanceof a?i:r;return o.apply(n?t:this,arguments)}return a}var xI=TI,RI=Math.max;function FI(r,e,t,n){for(var i=-1,a=r.length,o=t.length,s=-1,f=e.length,c=RI(a-o,0),l=Array(f+c),u=!n;++s<f;)l[s]=e[s];for(;++i<o;)(u||i<a)&&(l[t[i]]=r[i]);for(;c--;)l[s++]=r[i++];return l}var Ps=FI,MI=Math.max;function DI(r,e,t,n){for(var i=-1,a=r.length,o=-1,s=t.length,f=-1,c=e.length,l=MI(a-s,0),u=Array(l+c),p=!n;++i<l;)u[i]=r[i];for(var d=i;++f<c;)u[d+f]=e[f];for(;++o<s;)(p||i<a)&&(u[d+t[o]]=r[i++]);return u}var Is=DI;function BI(r,e){for(var t=r.length,n=0;t--;)r[t]===e&&++n;return n}var NI=BI;function UI(){}var vi=UI,CI=st,LI=vi,jI=4294967295;function Ut(r){this.__wrapped__=r,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=jI,this.__views__=[]}Ut.prototype=CI(LI.prototype),Ut.prototype.constructor=Ut;var gi=Ut;function kI(){}var qI=kI,Ts=Es,GI=qI,WI=Ts?function(r){return Ts.get(r)}:GI,xs=WI,VI={},HI=VI,Rs=HI,zI=Object.prototype,XI=zI.hasOwnProperty;function YI(r){for(var e=r.name+"",t=Rs[e],n=XI.call(Rs,e)?t.length:0;n--;){var i=t[n],a=i.func;if(a==null||a==r)return i.name}return e}var KI=YI,ZI=st,JI=vi;function Ct(r,e){this.__wrapped__=r,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}Ct.prototype=ZI(JI.prototype),Ct.prototype.constructor=Ct;var Fs=Ct,QI=gi,eT=Fs,rT=kn;function tT(r){if(r instanceof QI)return r.clone();var e=new eT(r.__wrapped__,r.__chain__);return e.__actions__=rT(r.__actions__),e.__index__=r.__index__,e.__values__=r.__values__,e}var nT=tT,iT=gi,Ms=Fs,aT=vi,oT=U,uT=V,sT=nT,fT=Object.prototype,cT=fT.hasOwnProperty;function Lt(r){if(uT(r)&&!oT(r)&&!(r instanceof iT)){if(r instanceof Ms)return r;if(cT.call(r,"__wrapped__"))return sT(r)}return new Ms(r)}Lt.prototype=aT.prototype,Lt.prototype.constructor=Lt;var lT=Lt,pT=gi,hT=xs,dT=KI,yT=lT;function vT(r){var e=dT(r),t=yT[e];if(typeof t!="function"||!(e in pT.prototype))return!1;if(r===t)return!0;var n=hT(t);return!!n&&r===n[0]}var gT=vT,_T=Ss,mT=Ho,wT=mT(_T),Ds=wT,bT=/\{\n\/\* \[wrapped with (.+)\] \*/,$T=/,? & /;function AT(r){var e=r.match(bT);return e?e[1].split($T):[]}var ET=AT,OT=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function ST(r,e){var t=e.length;if(!t)return r;var n=t-1;return e[n]=(t>1?"& ":"")+e[n],e=e.join(t>2?", ":" "),r.replace(OT,`{
|
|
25
25
|
/* [wrapped with `+e+`] */
|
|
26
|
-
`)}var bT=wT;function $T(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}var AT=$T;function ET(r){return r!==r}var OT=ET;function ST(r,e,t){for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}var IT=ST,PT=AT,TT=OT,xT=IT;function RT(r,e,t){return e===e?xT(r,e,t):PT(r,TT,t)}var FT=RT,MT=FT;function DT(r,e){var t=r==null?0:r.length;return!!t&&MT(r,e,0)>-1}var BT=DT,NT=Bn,UT=BT,CT=1,LT=2,jT=8,kT=16,qT=32,GT=64,WT=128,VT=256,HT=512,zT=[["ary",WT],["bind",CT],["bindKey",LT],["curry",jT],["curryRight",kT],["flip",HT],["partial",qT],["partialRight",GT],["rearg",VT]];function XT(r,e){return NT(zT,function(t){var n="_."+t[0];e&t[1]&&!UT(r,n)&&r.push(n)}),r.sort()}var YT=XT,KT=_T,ZT=bT,JT=ri,QT=YT;function ex(r,e,t){var n=e+"";return JT(r,ZT(n,QT(KT(n),t)))}var Fs=ex,rx=lT,tx=Rs,nx=Fs,ix=1,ax=2,ox=4,ux=8,Ms=32,Ds=64;function sx(r,e,t,n,i,a,o,s,f,c){var l=e&ux,u=l?o:void 0,p=l?void 0:o,d=l?a:void 0,_=l?void 0:a;e|=l?Ms:Ds,e&=~(l?Ds:Ms),e&ox||(e&=~(ix|ax));var $=[r,e,i,d,u,_,p,s,f,c],b=t.apply(void 0,$);return rx(r)&&tx(b,$),b.placeholder=n,nx(b,r,e)}var Bs=sx;function fx(r){var e=r;return e.placeholder}var _i=fx,cx=kn,lx=at,px=Math.min;function hx(r,e){for(var t=r.length,n=px(e.length,t),i=cx(r);n--;){var a=e[n];r[n]=lx(a,t)?i[a]:void 0}return r}var dx=hx,Ns="__lodash_placeholder__";function yx(r,e){for(var t=-1,n=r.length,i=0,a=[];++t<n;){var o=r[t];(o===e||o===Ns)&&(r[t]=Ns,a[i++]=t)}return a}var jt=yx,vx=Es,gx=Os,_x=xP,Us=Nt,mx=Bs,wx=_i,bx=dx,$x=jt,Ax=G,Ex=1,Ox=2,Sx=8,Ix=16,Px=128,Tx=512;function Cs(r,e,t,n,i,a,o,s,f,c){var l=e&Px,u=e&Ex,p=e&Ox,d=e&(Sx|Ix),_=e&Tx,$=p?void 0:Us(r);function b(){for(var w=arguments.length,A=Array(w),h=w;h--;)A[h]=arguments[h];if(d)var I=wx(b),P=_x(A,I);if(n&&(A=vx(A,n,i,d)),a&&(A=gx(A,a,o,d)),w-=P,d&&w<c){var R=$x(A,I);return mx(r,e,Cs,b.placeholder,t,A,R,s,f,c-w)}var m=u?t:this,v=p?m[r]:r;return w=A.length,s?A=bx(A,s):_&&w>1&&A.reverse(),l&&f<w&&(A.length=f),this&&this!==Ax&&this instanceof b&&(v=$||Us(v)),v.apply(m,A)}return b}var Ls=Cs,xx=ei,Rx=Nt,Fx=Ls,Mx=Bs,Dx=_i,Bx=jt,Nx=G;function Ux(r,e,t){var n=Rx(r);function i(){for(var a=arguments.length,o=Array(a),s=a,f=Dx(i);s--;)o[s]=arguments[s];var c=a<3&&o[0]!==f&&o[a-1]!==f?[]:Bx(o,f);if(a-=c.length,a<t)return Mx(r,e,Fx,i.placeholder,void 0,o,c,void 0,void 0,t-a);var l=this&&this!==Nx&&this instanceof i?n:r;return xx(l,this,o)}return i}var Cx=Ux,Lx=ei,jx=Nt,kx=G,qx=1;function Gx(r,e,t,n){var i=e&qx,a=jx(r);function o(){for(var s=-1,f=arguments.length,c=-1,l=n.length,u=Array(l+f),p=this&&this!==kx&&this instanceof o?a:r;++c<l;)u[c]=n[c];for(;f--;)u[c++]=arguments[++s];return Lx(p,i?t:this,u)}return o}var Wx=Gx,Vx=Es,Hx=Os,js=jt,ks="__lodash_placeholder__",mi=1,zx=2,Xx=4,qs=8,Tr=128,Gs=256,Yx=Math.min;function Kx(r,e){var t=r[1],n=e[1],i=t|n,a=i<(mi|zx|Tr),o=n==Tr&&t==qs||n==Tr&&t==Gs&&r[7].length<=e[8]||n==(Tr|Gs)&&e[7].length<=e[8]&&t==qs;if(!(a||o))return r;n&mi&&(r[2]=e[2],i|=t&mi?0:Xx);var s=e[3];if(s){var f=r[3];r[3]=f?Vx(f,s,e[4]):s,r[4]=f?js(r[3],ks):e[4]}return s=e[5],s&&(f=r[5],r[5]=f?Hx(f,s,e[6]):s,r[6]=f?js(r[5],ks):e[6]),s=e[7],s&&(r[7]=s),n&Tr&&(r[8]=r[8]==null?e[8]:Yx(r[8],e[8])),r[9]==null&&(r[9]=e[9]),r[0]=e[0],r[1]=i,r}var Zx=Kx,Jx=As,Qx=EP,eR=Cx,rR=Ls,tR=Wx,nR=Is,iR=Zx,aR=Rs,oR=Fs,Ws=Qu,uR="Expected a function",Vs=1,sR=2,wi=8,bi=16,$i=32,Hs=64,zs=Math.max;function fR(r,e,t,n,i,a,o,s){var f=e&sR;if(!f&&typeof r!="function")throw new TypeError(uR);var c=n?n.length:0;if(c||(e&=~($i|Hs),n=i=void 0),o=o===void 0?o:zs(Ws(o),0),s=s===void 0?s:Ws(s),c-=i?i.length:0,e&Hs){var l=n,u=i;n=i=void 0}var p=f?void 0:nR(r),d=[r,e,t,n,i,l,u,a,o,s];if(p&&iR(d,p),r=d[0],e=d[1],t=d[2],n=d[3],i=d[4],s=d[9]=d[9]===void 0?f?0:r.length:zs(d[9]-c,0),!s&&e&(wi|bi)&&(e&=~(wi|bi)),!e||e==Vs)var _=Qx(r,e,t);else e==wi||e==bi?_=eR(r,e,s):(e==$i||e==(Vs|$i))&&!i.length?_=tR(r,e,t,n):_=rR.apply(void 0,d);var $=p?Jx:aR;return oR($(_,d),r,e)}var cR=fR,lR=ou,pR=cR,hR=_i,dR=jt,yR=32,Ai=lR(function(r,e){var t=dR(e,hR(Ai));return pR(r,yR,void 0,e,t)});Ai.placeholder={};var Xs=Ai,vR=Object.defineProperty,gR=Object.defineProperties,_R=Object.getOwnPropertyDescriptors,Ys=Object.getOwnPropertySymbols,mR=Object.prototype.hasOwnProperty,wR=Object.prototype.propertyIsEnumerable,Ks=(r,e,t)=>e in r?vR(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Zs=(r,e)=>{for(var t in e||(e={}))mR.call(e,t)&&Ks(r,t,e[t]);if(Ys)for(var t of Ys(e))wR.call(e,t)&&Ks(r,t,e[t]);return r},Js=(r,e)=>gR(r,_R(e));function bR(r,e){return Js(Zs({},ti(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 $R(r,e){var t;return Js(Zs({},ti(e,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"])),{shopify_variant_id:(t=e.external_variant_id)!=null&&t.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 Qs(r){const{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:f,created_at:c,expire_after_specific_number_of_charges:l,shopify_product_id:u,shopify_variant_id:p,has_queued_charges:d,is_prepaid:_,is_skippable:$,is_swappable:b,max_retries_reached:w,next_charge_scheduled_at:A,order_day_of_month:h,order_day_of_week:I,order_interval_frequency:P,order_interval_unit:R,presentment_currency:m,price:v,product_title:g,properties:O,quantity:S,sku:B,sku_override:H,status:te,updated_at:X,variant_title:Re}=r;return{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:parseInt(f,10),created_at:c,expire_after_specific_number_of_charges:l,external_product_id:{ecommerce:`${u}`},external_variant_id:{ecommerce:`${p}`},has_queued_charges:Ho(d),is_prepaid:_,is_skippable:$,is_swappable:b,max_retries_reached:Ho(w),next_charge_scheduled_at:A,order_day_of_month:h,order_day_of_week:I,order_interval_frequency:parseInt(P,10),order_interval_unit:R,presentment_currency:m,price:`${v}`,product_title:g??"",properties:O,quantity:S,sku:B,sku_override:H,status:te.toLowerCase(),updated_at:X,variant_title:Re}}async function AR(r,e,t){const{subscription:n}=await E("get","/subscriptions",{id:e,query:{include:t?.include}},r);return n}function ER(r,e){return E("get","/subscriptions",{query:e},r)}async function OR(r,e,t){const{subscription:n}=await E("post","/subscriptions",{data:e,query:t},r);return n}async function SR(r,e,t,n){const{subscription:i}=await E("put","/subscriptions",{id:e,data:t,query:n},r);return i}async function IR(r,e,t,n){const{subscription:i}=await E("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t},query:n},r);return i}async function PR(r,e,t){const{subscription:n}=await E("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},r);return n}async function TR(r,e,t,n){const{subscription:i}=await E("post",`/subscriptions/${e}/cancel`,{data:t,query:n},r);return i}async function xR(r,e,t){const{subscription:n}=await E("post",`/subscriptions/${e}/activate`,{query:t},r);return n}async function RR(r,e,t){const{charge:n}=await E("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},r);return n}async function FR(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=Xs(bR,n),o=e.map(a),{subscriptions:s}=await E("post",`/addresses/${i}/subscriptions-bulk`,{data:{subscriptions:o},headers:{"X-Recharge-Version":"2021-01"}},r);return s.map(Qs)}async function MR(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=Xs($R,!!(n!=null&&n.force_update)),s=t.map(o),{subscriptions:f}=await E("put",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:s},headers:{"X-Recharge-Version":"2021-01"}},r);return f.map(Qs)}var DR=Object.freeze({__proto__:null,getSubscription:AR,listSubscriptions:ER,createSubscription:OR,updateSubscription:SR,updateSubscriptionChargeDate:IR,updateSubscriptionAddress:PR,cancelSubscription:TR,activateSubscription:xR,skipSubscriptionCharge:RR,createSubscriptions:FR,updateSubscriptions:MR});async function BR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await E("get","/customers",{id:t,query:{include:e?.include}},r);return n}async function NR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await E("put","/customers",{id:t,data:e},r);return n}async function UR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await E("get",`/customers/${t}/delivery_schedule`,{query:e},r);return n}async function CR(r){return await E("get","/portal_access",{},r)}var LR=Object.freeze({__proto__:null,getCustomer:BR,updateCustomer:NR,getDeliverySchedule:UR,getCustomerPortalAccess:CR});const jR={get(r,e){return z("get",r,e)},post(r,e){return z("post",r,e)},put(r,e){return z("put",r,e)},delete(r,e){return z("delete",r,e)}};function kR(r){var e,t;if(r)return r;if((e=window?.Shopify)!=null&&e.shop)return window.Shopify.shop;let n=window?.domain;if(!n){const i=(t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i))==null?void 0:t[1].replace(/-sp$/,"");i&&(n=`${i}.myshopify.com`)}if(n)return n;throw new Error("No storeIdentifier was passed into init.")}function qR(r={}){const e=r;fp({storeIdentifier:kR(r.storeIdentifier),loginRetryFn:r.loginRetryFn,storefrontAccessToken:r.storefrontAccessToken,environment:e.environment?e.environment:"prod"}),nu()}const ef={init:qR,api:jR,address:Pp,auth:Bp,bundle:xI,charge:CI,cdn:d1,customer:LR,membership:WI,membershipProgram:zI,metafield:ZI,onetime:nP,order:oP,paymentMethod:cP,plan:hP,subscription:DR};try{ef.init()}catch{}return ef});
|
|
26
|
+
`)}var PT=ST;function IT(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}var TT=IT;function xT(r){return r!==r}var RT=xT;function FT(r,e,t){for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}var MT=FT,DT=TT,BT=RT,NT=MT;function UT(r,e,t){return e===e?NT(r,e,t):DT(r,BT,t)}var CT=UT,LT=CT;function jT(r,e){var t=r==null?0:r.length;return!!t&<(r,e,0)>-1}var kT=jT,qT=Bn,GT=kT,WT=1,VT=2,HT=8,zT=16,XT=32,YT=64,KT=128,ZT=256,JT=512,QT=[["ary",KT],["bind",WT],["bindKey",VT],["curry",HT],["curryRight",zT],["flip",JT],["partial",XT],["partialRight",YT],["rearg",ZT]];function ex(r,e){return qT(QT,function(t){var n="_."+t[0];e&t[1]&&!GT(r,n)&&r.push(n)}),r.sort()}var rx=ex,tx=ET,nx=PT,ix=ri,ax=rx;function ox(r,e,t){var n=e+"";return ix(r,nx(n,ax(tx(n),t)))}var Bs=ox,ux=gT,sx=Ds,fx=Bs,cx=1,lx=2,px=4,hx=8,Ns=32,Us=64;function dx(r,e,t,n,i,a,o,s,f,c){var l=e&hx,u=l?o:void 0,p=l?void 0:o,d=l?a:void 0,_=l?void 0:a;e|=l?Ns:Us,e&=~(l?Us:Ns),e&px||(e&=~(cx|lx));var $=[r,e,i,d,u,_,p,s,f,c],b=t.apply(void 0,$);return ux(r)&&sx(b,$),b.placeholder=n,fx(b,r,e)}var Cs=dx;function yx(r){var e=r;return e.placeholder}var _i=yx,vx=kn,gx=at,_x=Math.min;function mx(r,e){for(var t=r.length,n=_x(e.length,t),i=vx(r);n--;){var a=e[n];r[n]=gx(a,t)?i[a]:void 0}return r}var wx=mx,Ls="__lodash_placeholder__";function bx(r,e){for(var t=-1,n=r.length,i=0,a=[];++t<n;){var o=r[t];(o===e||o===Ls)&&(r[t]=Ls,a[i++]=t)}return a}var jt=bx,$x=Ps,Ax=Is,Ex=NI,js=Nt,Ox=Cs,Sx=_i,Px=wx,Ix=jt,Tx=G,xx=1,Rx=2,Fx=8,Mx=16,Dx=128,Bx=512;function ks(r,e,t,n,i,a,o,s,f,c){var l=e&Dx,u=e&xx,p=e&Rx,d=e&(Fx|Mx),_=e&Bx,$=p?void 0:js(r);function b(){for(var w=arguments.length,A=Array(w),h=w;h--;)A[h]=arguments[h];if(d)var P=Sx(b),I=Ex(A,P);if(n&&(A=$x(A,n,i,d)),a&&(A=Ax(A,a,o,d)),w-=I,d&&w<c){var R=Ix(A,P);return Ox(r,e,ks,b.placeholder,t,A,R,s,f,c-w)}var m=u?t:this,v=p?m[r]:r;return w=A.length,s?A=Px(A,s):_&&w>1&&A.reverse(),l&&f<w&&(A.length=f),this&&this!==Tx&&this instanceof b&&(v=$||js(v)),v.apply(m,A)}return b}var qs=ks,Nx=ei,Ux=Nt,Cx=qs,Lx=Cs,jx=_i,kx=jt,qx=G;function Gx(r,e,t){var n=Ux(r);function i(){for(var a=arguments.length,o=Array(a),s=a,f=jx(i);s--;)o[s]=arguments[s];var c=a<3&&o[0]!==f&&o[a-1]!==f?[]:kx(o,f);if(a-=c.length,a<t)return Lx(r,e,Cx,i.placeholder,void 0,o,c,void 0,void 0,t-a);var l=this&&this!==qx&&this instanceof i?n:r;return Nx(l,this,o)}return i}var Wx=Gx,Vx=ei,Hx=Nt,zx=G,Xx=1;function Yx(r,e,t,n){var i=e&Xx,a=Hx(r);function o(){for(var s=-1,f=arguments.length,c=-1,l=n.length,u=Array(l+f),p=this&&this!==zx&&this instanceof o?a:r;++c<l;)u[c]=n[c];for(;f--;)u[c++]=arguments[++s];return Vx(p,i?t:this,u)}return o}var Kx=Yx,Zx=Ps,Jx=Is,Gs=jt,Ws="__lodash_placeholder__",mi=1,Qx=2,eR=4,Vs=8,Tr=128,Hs=256,rR=Math.min;function tR(r,e){var t=r[1],n=e[1],i=t|n,a=i<(mi|Qx|Tr),o=n==Tr&&t==Vs||n==Tr&&t==Hs&&r[7].length<=e[8]||n==(Tr|Hs)&&e[7].length<=e[8]&&t==Vs;if(!(a||o))return r;n&mi&&(r[2]=e[2],i|=t&mi?0:eR);var s=e[3];if(s){var f=r[3];r[3]=f?Zx(f,s,e[4]):s,r[4]=f?Gs(r[3],Ws):e[4]}return s=e[5],s&&(f=r[5],r[5]=f?Jx(f,s,e[6]):s,r[6]=f?Gs(r[5],Ws):e[6]),s=e[7],s&&(r[7]=s),n&Tr&&(r[8]=r[8]==null?e[8]:rR(r[8],e[8])),r[9]==null&&(r[9]=e[9]),r[0]=e[0],r[1]=i,r}var nR=tR,iR=Ss,aR=xI,oR=Wx,uR=qs,sR=Kx,fR=xs,cR=nR,lR=Ds,pR=Bs,zs=ts,hR="Expected a function",Xs=1,dR=2,wi=8,bi=16,$i=32,Ys=64,Ks=Math.max;function yR(r,e,t,n,i,a,o,s){var f=e&dR;if(!f&&typeof r!="function")throw new TypeError(hR);var c=n?n.length:0;if(c||(e&=~($i|Ys),n=i=void 0),o=o===void 0?o:Ks(zs(o),0),s=s===void 0?s:zs(s),c-=i?i.length:0,e&Ys){var l=n,u=i;n=i=void 0}var p=f?void 0:fR(r),d=[r,e,t,n,i,l,u,a,o,s];if(p&&cR(d,p),r=d[0],e=d[1],t=d[2],n=d[3],i=d[4],s=d[9]=d[9]===void 0?f?0:r.length:Ks(d[9]-c,0),!s&&e&(wi|bi)&&(e&=~(wi|bi)),!e||e==Xs)var _=aR(r,e,t);else e==wi||e==bi?_=oR(r,e,s):(e==$i||e==(Xs|$i))&&!i.length?_=sR(r,e,t,n):_=uR.apply(void 0,d);var $=p?iR:lR;return pR($(_,d),r,e)}var vR=yR,gR=fu,_R=vR,mR=_i,wR=jt,bR=32,Ai=gR(function(r,e){var t=wR(e,mR(Ai));return _R(r,bR,void 0,e,t)});Ai.placeholder={};var Zs=Ai,$R=Object.defineProperty,AR=Object.defineProperties,ER=Object.getOwnPropertyDescriptors,Js=Object.getOwnPropertySymbols,OR=Object.prototype.hasOwnProperty,SR=Object.prototype.propertyIsEnumerable,Qs=(r,e,t)=>e in r?$R(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,ef=(r,e)=>{for(var t in e||(e={}))OR.call(e,t)&&Qs(r,t,e[t]);if(Js)for(var t of Js(e))SR.call(e,t)&&Qs(r,t,e[t]);return r},rf=(r,e)=>AR(r,ER(e));function PR(r,e){return rf(ef({},ti(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 IR(r,e){var t;return rf(ef({},ti(e,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"])),{shopify_variant_id:(t=e.external_variant_id)!=null&&t.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 tf(r){const{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:f,created_at:c,expire_after_specific_number_of_charges:l,shopify_product_id:u,shopify_variant_id:p,has_queued_charges:d,is_prepaid:_,is_skippable:$,is_swappable:b,max_retries_reached:w,next_charge_scheduled_at:A,order_day_of_month:h,order_day_of_week:P,order_interval_frequency:I,order_interval_unit:R,presentment_currency:m,price:v,product_title:g,properties:O,quantity:S,sku:B,sku_override:H,status:te,updated_at:X,variant_title:Re}=r;return{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:parseInt(f,10),created_at:c,expire_after_specific_number_of_charges:l,external_product_id:{ecommerce:`${u}`},external_variant_id:{ecommerce:`${p}`},has_queued_charges:Yo(d),is_prepaid:_,is_skippable:$,is_swappable:b,max_retries_reached:Yo(w),next_charge_scheduled_at:A,order_day_of_month:h,order_day_of_week:P,order_interval_frequency:parseInt(I,10),order_interval_unit:R,presentment_currency:m,price:`${v}`,product_title:g??"",properties:O,quantity:S,sku:B,sku_override:H,status:te.toLowerCase(),updated_at:X,variant_title:Re}}async function TR(r,e,t){const{subscription:n}=await E("get","/subscriptions",{id:e,query:{include:t?.include}},r);return n}function xR(r,e){return E("get","/subscriptions",{query:e},r)}async function RR(r,e,t){const{subscription:n}=await E("post","/subscriptions",{data:e,query:t},r);return n}async function FR(r,e,t,n){const{subscription:i}=await E("put","/subscriptions",{id:e,data:t,query:n},r);return i}async function MR(r,e,t,n){const{subscription:i}=await E("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t},query:n},r);return i}async function DR(r,e,t){const{subscription:n}=await E("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},r);return n}async function BR(r,e,t,n){const{subscription:i}=await E("post",`/subscriptions/${e}/cancel`,{data:t,query:n},r);return i}async function NR(r,e,t){const{subscription:n}=await E("post",`/subscriptions/${e}/activate`,{query:t},r);return n}async function UR(r,e,t){const{charge:n}=await E("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},r);return n}async function CR(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=Zs(PR,n),o=e.map(a),{subscriptions:s}=await E("post",`/addresses/${i}/subscriptions-bulk`,{data:{subscriptions:o},headers:{"X-Recharge-Version":"2021-01"}},r);return s.map(tf)}async function LR(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=Zs(IR,!!(n!=null&&n.force_update)),s=t.map(o),{subscriptions:f}=await E("put",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:s},headers:{"X-Recharge-Version":"2021-01"}},r);return f.map(tf)}var jR=Object.freeze({__proto__:null,getSubscription:TR,listSubscriptions:xR,createSubscription:RR,updateSubscription:FR,updateSubscriptionChargeDate:MR,updateSubscriptionAddress:DR,cancelSubscription:BR,activateSubscription:NR,skipSubscriptionCharge:UR,createSubscriptions:CR,updateSubscriptions:LR});async function kR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await E("get","/customers",{id:t,query:{include:e?.include}},r);return n}async function qR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await E("put","/customers",{id:t,data:e},r);return n}async function GR(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await E("get",`/customers/${t}/delivery_schedule`,{query:e},r);return n}async function WR(r){return await E("get","/portal_access",{},r)}var VR=Object.freeze({__proto__:null,getCustomer:kR,updateCustomer:qR,getDeliverySchedule:GR,getCustomerPortalAccess:WR});const HR={get(r,e){return z("get",r,e)},post(r,e){return z("post",r,e)},put(r,e){return z("put",r,e)},delete(r,e){return z("delete",r,e)}};function zR(r){var e,t;if(r)return r;if((e=window?.Shopify)!=null&&e.shop)return window.Shopify.shop;let n=window?.domain;if(!n){const i=(t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i))==null?void 0:t[1].replace(/-sp$/,"");i&&(n=`${i}.myshopify.com`)}if(n)return n;throw new Error("No storeIdentifier was passed into init.")}function XR(r={}){const e=r;pp({storeIdentifier:zR(r.storeIdentifier),loginRetryFn:r.loginRetryFn,storefrontAccessToken:r.storefrontAccessToken,environment:e.environment?e.environment:"prod"}),ou()}const nf={init:XR,api:HR,address:Rp,auth:kp,bundle:NP,charge:WP,cdn:w1,customer:VR,membership:KP,membershipProgram:QP,metafield:nI,onetime:fI,order:pI,paymentMethod:vI,plan:mI,subscription:jR};try{nf.init()}catch{}return nf});
|