@rechargeapps/storefront-client 0.20.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/api/address.js +2 -2
- package/dist/cjs/api/address.js.map +1 -1
- package/dist/cjs/api/charge.js +2 -2
- package/dist/cjs/api/charge.js.map +1 -1
- package/dist/cjs/api/paymentMethod.js +3 -2
- package/dist/cjs/api/paymentMethod.js.map +1 -1
- package/dist/cjs/api/subscription.js +3 -2
- package/dist/cjs/api/subscription.js.map +1 -1
- package/dist/esm/api/address.js +2 -2
- package/dist/esm/api/address.js.map +1 -1
- package/dist/esm/api/charge.js +2 -2
- package/dist/esm/api/charge.js.map +1 -1
- package/dist/esm/api/paymentMethod.js +3 -2
- package/dist/esm/api/paymentMethod.js.map +1 -1
- package/dist/esm/api/subscription.js +3 -2
- package/dist/esm/api/subscription.js.map +1 -1
- package/dist/index.d.ts +712 -666
- package/dist/umd/recharge-client.min.js +3 -3
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* recharge-client-0.
|
|
2
|
+
* recharge-client-0.21.0.min.js
|
|
3
3
|
* Copyright (c) Recharge
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
`)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function Kt(r){return Array.isArray(r)}function qr(r){return typeof r=="boolean"}function Qe(r){return r===null}function Vi(r){return r==null}function Zt(r){return typeof r=="number"}function er(r){return typeof r=="string"}function Gi(r){return typeof r=="symbol"}function K(r){return r===void 0}function rr(r){return Ae(r)&&Jt(r)==="[object RegExp]"}function Ae(r){return typeof r=="object"&&r!==null}function Vr(r){return Ae(r)&&Jt(r)==="[object Date]"}function tr(r){return Ae(r)&&(Jt(r)==="[object Error]"||r instanceof Error)}function nr(r){return typeof r=="function"}function Hi(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function Wi(r){return y.isBuffer(r)}function Jt(r){return Object.prototype.toString.call(r)}function Qt(r){return r<10?"0"+r.toString(10):r.toString(10)}var Xf=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Yf(){var r=new Date,e=[Qt(r.getHours()),Qt(r.getMinutes()),Qt(r.getSeconds())].join(":");return[r.getDate(),Xf[r.getMonth()],e].join(" ")}function zi(){console.log("%s - %s",Yf(),Lr.apply(null,arguments))}function en(r,e){if(!e||!Ae(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function Xi(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Kf={inherits:ki,_extend:en,log:zi,isBuffer:Wi,isPrimitive:Hi,isFunction:nr,isError:tr,isDate:Vr,isObject:Ae,isRegExp:rr,isUndefined:K,isSymbol:Gi,isString:er,isNumber:Zt,isNullOrUndefined:Vi,isNull:Qe,isBoolean:qr,isArray:Kt,inspect:Y,deprecate:Wt,format:Lr,debuglog:qi},Zf=Object.freeze({__proto__:null,format:Lr,deprecate:Wt,debuglog:qi,inspect:Y,isArray:Kt,isBoolean:qr,isNull:Qe,isNullOrUndefined:Vi,isNumber:Zt,isString:er,isSymbol:Gi,isUndefined:K,isRegExp:rr,isObject:Ae,isDate:Vr,isError:tr,isFunction:nr,isPrimitive:Hi,isBuffer:Wi,log:zi,inherits:ki,_extend:en,default:Kf}),Jf=Ke(Zf),Qf=Jf.inspect,rn=typeof Map=="function"&&Map.prototype,tn=Object.getOwnPropertyDescriptor&&rn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Gr=rn&&tn&&typeof tn.get=="function"?tn.get:null,ec=rn&&Map.prototype.forEach,nn=typeof Set=="function"&&Set.prototype,an=Object.getOwnPropertyDescriptor&&nn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Hr=nn&&an&&typeof an.get=="function"?an.get:null,rc=nn&&Set.prototype.forEach,tc=typeof WeakMap=="function"&&WeakMap.prototype,ir=tc?WeakMap.prototype.has:null,nc=typeof WeakSet=="function"&&WeakSet.prototype,ar=nc?WeakSet.prototype.has:null,ic=typeof WeakRef=="function"&&WeakRef.prototype,Yi=ic?WeakRef.prototype.deref:null,ac=Boolean.prototype.valueOf,oc=Object.prototype.toString,uc=Function.prototype.toString,sc=String.prototype.match,on=String.prototype.slice,he=String.prototype.replace,fc=String.prototype.toUpperCase,Ki=String.prototype.toLowerCase,Zi=RegExp.prototype.test,Ji=Array.prototype.concat,Z=Array.prototype.join,cc=Array.prototype.slice,Qi=Math.floor,un=typeof BigInt=="function"?BigInt.prototype.valueOf:null,sn=Object.getOwnPropertySymbols,fn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Le=typeof Symbol=="function"&&typeof Symbol.iterator=="object",k=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Le?"object":"symbol")?Symbol.toStringTag:null,ea=Object.prototype.propertyIsEnumerable,ra=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function ta(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Zi.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-Qi(-r):Qi(r);if(n!==r){var i=String(n),a=on.call(e,i.length+1);return he.call(i,t,"$&_")+"."+he.call(he.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return he.call(e,t,"$&_")}var cn=Qf,na=cn.custom,ia=ua(na)?na:null,lc=function r(e,t,n,i){var a=t||{};if(ye(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ye(a,"maxStringLength")&&(typeof a.maxStringLength=="number"?a.maxStringLength<0&&a.maxStringLength!==1/0:a.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=ye(a,"customInspect")?a.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ye(a,"indent")&&a.indent!==null&&a.indent!==" "&&!(parseInt(a.indent,10)===a.indent&&a.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ye(a,"numericSeparator")&&typeof a.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=a.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return fa(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return s?ta(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return s?ta(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 ln(e)?"[Array]":"[Object]";var u=xc(a,n);if(typeof i>"u")i=[];else if(sa(i,e)>=0)return"[Circular]";function p(ee,ge,fe){if(ge&&(i=cc.call(i),i.push(ge)),fe){var Ir={depth:a.depth};return ye(a,"quoteStyle")&&(Ir.quoteStyle=a.quoteStyle),r(ee,Ir,n+1,i)}return r(ee,a,n+1,i)}if(typeof e=="function"&&!oa(e)){var d=wc(e),g=Wr(e,p);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(g.length>0?" { "+Z.call(g,", ")+" }":"")}if(ua(e)){var b=Le?he.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):fn.call(e);return typeof e=="object"&&!Le?or(b):b}if(Sc(e)){for(var E="<"+Ki.call(String(e.nodeName)),w=e.attributes||[],S=0;S<w.length;S++)E+=" "+w[S].name+"="+aa(pc(w[S].value),"double",a);return E+=">",e.childNodes&&e.childNodes.length&&(E+="..."),E+="</"+Ki.call(String(e.nodeName))+">",E}if(ln(e)){if(e.length===0)return"[]";var h=Wr(e,p);return u&&!Ic(h)?"["+hn(h,u)+"]":"[ "+Z.call(h,", ")+" ]"}if(yc(e)){var O=Wr(e,p);return!("cause"in Error.prototype)&&"cause"in e&&!ea.call(e,"cause")?"{ ["+String(e)+"] "+Z.call(Ji.call("[cause]: "+p(e.cause),O),", ")+" }":O.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Z.call(O,", ")+" }"}if(typeof e=="object"&&o){if(ia&&typeof e[ia]=="function"&&cn)return cn(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(bc(e)){var x=[];return ec.call(e,function(ee,ge){x.push(p(ge,e,!0)+" => "+p(ee,e))}),ca("Map",Gr.call(e),x,u)}if(Ac(e)){var R=[];return rc.call(e,function(ee){R.push(p(ee,e))}),ca("Set",Hr.call(e),R,u)}if($c(e))return pn("WeakMap");if(Oc(e))return pn("WeakSet");if(Ec(e))return pn("WeakRef");if(vc(e))return or(p(Number(e)));if(_c(e))return or(p(un.call(e)));if(gc(e))return or(ac.call(e));if(dc(e))return or(p(String(e)));if(!hc(e)&&!oa(e)){var m=Wr(e,p),v=ra?ra(e)===Object.prototype:e instanceof Object||e.constructor===Object,_=e instanceof Object?"":"null prototype",$=!v&&k&&Object(e)===e&&k in e?on.call(de(e),8,-1):_?"Object":"",A=v||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",L=A+($||_?"["+Z.call(Ji.call([],$||[],_||[]),": ")+"] ":"");return m.length===0?L+"{}":u?L+"{"+hn(m,u)+"}":L+"{ "+Z.call(m,", ")+" }"}return String(e)};function aa(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function pc(r){return he.call(String(r),/"/g,""")}function ln(r){return de(r)==="[object Array]"&&(!k||!(typeof r=="object"&&k in r))}function hc(r){return de(r)==="[object Date]"&&(!k||!(typeof r=="object"&&k in r))}function oa(r){return de(r)==="[object RegExp]"&&(!k||!(typeof r=="object"&&k in r))}function yc(r){return de(r)==="[object Error]"&&(!k||!(typeof r=="object"&&k in r))}function dc(r){return de(r)==="[object String]"&&(!k||!(typeof r=="object"&&k in r))}function vc(r){return de(r)==="[object Number]"&&(!k||!(typeof r=="object"&&k in r))}function gc(r){return de(r)==="[object Boolean]"&&(!k||!(typeof r=="object"&&k in r))}function ua(r){if(Le)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!fn)return!1;try{return fn.call(r),!0}catch{}return!1}function _c(r){if(!r||typeof r!="object"||!un)return!1;try{return un.call(r),!0}catch{}return!1}var mc=Object.prototype.hasOwnProperty||function(r){return r in this};function ye(r,e){return mc.call(r,e)}function de(r){return oc.call(r)}function wc(r){if(r.name)return r.name;var e=sc.call(uc.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function sa(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 bc(r){if(!Gr||!r||typeof r!="object")return!1;try{Gr.call(r);try{Hr.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function $c(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 Ec(r){if(!Yi||!r||typeof r!="object")return!1;try{return Yi.call(r),!0}catch{}return!1}function Ac(r){if(!Hr||!r||typeof r!="object")return!1;try{Hr.call(r);try{Gr.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Oc(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 Sc(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function fa(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return fa(on.call(r,0,e.maxStringLength),e)+n}var i=he.call(he.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Tc);return aa(i,"single",e)}function Tc(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":"")+fc.call(e.toString(16))}function or(r){return"Object("+r+")"}function pn(r){return r+" { ? }"}function ca(r,e,t,n){var i=n?hn(t,n):Z.call(t,", ");return r+" ("+e+") {"+i+"}"}function Ic(r){for(var e=0;e<r.length;e++)if(sa(r[e],`
|
|
22
22
|
`)>=0)return!1;return!0}function xc(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=Z.call(Array(r.indent+1)," ");else return null;return{base:t,prev:Z.call(Array(e+1),t)}}function hn(r,e){if(r.length===0)return"";var t=`
|
|
23
23
|
`+e.prev+e.base;return t+Z.call(r,","+t)+`
|
|
24
|
-
`+e.prev}function Wr(r,e){var t=ln(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=ye(r,i)?e(r[i],r):""}var a=typeof sn=="function"?sn(r):[],o;if(Le){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var f in r)!ye(r,f)||t&&String(Number(f))===f&&f<r.length||Le&&o["$"+f]instanceof Symbol||(Zi.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r)));if(typeof sn=="function")for(var c=0;c<a.length;c++)ea.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var yn=jt,je=Ns,Pc=lc,Fc=yn("%TypeError%"),zr=yn("%WeakMap%",!0),Xr=yn("%Map%",!0),Rc=je("WeakMap.prototype.get",!0),Mc=je("WeakMap.prototype.set",!0),Dc=je("WeakMap.prototype.has",!0),Nc=je("Map.prototype.get",!0),Bc=je("Map.prototype.set",!0),Uc=je("Map.prototype.has",!0),dn=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},Cc=function(r,e){var t=dn(r,e);return t&&t.value},Lc=function(r,e,t){var n=dn(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},jc=function(r,e){return!!dn(r,e)},kc=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new Fc("Side channel does not contain "+Pc(a))},get:function(a){if(zr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Rc(e,a)}else if(Xr){if(t)return Nc(t,a)}else if(n)return Cc(n,a)},has:function(a){if(zr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Dc(e,a)}else if(Xr){if(t)return Uc(t,a)}else if(n)return jc(n,a);return!1},set:function(a,o){zr&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new zr),Mc(e,a,o)):Xr?(t||(t=new Xr),Bc(t,a,o)):(n||(n={key:{},next:null}),Lc(n,a,o))}};return i},qc=String.prototype.replace,Vc=/%20/g,vn={RFC1738:"RFC1738",RFC3986:"RFC3986"},gn={default:vn.RFC3986,formatters:{RFC1738:function(r){return qc.call(r,Vc,"+")},RFC3986:function(r){return String(r)}},RFC1738:vn.RFC1738,RFC3986:vn.RFC3986},Gc=gn,_n=Object.prototype.hasOwnProperty,Oe=Array.isArray,J=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),Hc=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}}},la=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},Wc=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)||!_n.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=la(e,n)),Oe(e)&&Oe(t)?(t.forEach(function(a,o){if(_n.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 _n.call(a,o)?a[o]=r(a[o],s,n):a[o]=s,a},i)},zc=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},Xc=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}},Yc=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===Gc.RFC1738&&(c===40||c===41)){s+=o.charAt(f);continue}if(c<128){s=s+J[c];continue}if(c<2048){s=s+(J[192|c>>6]+J[128|c&63]);continue}if(c<55296||c>=57344){s=s+(J[224|c>>12]+J[128|c>>6&63]+J[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),s+=J[240|c>>18]+J[128|c>>12&63]+J[128|c>>6&63]+J[128|c&63]}return s},Kc=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 Hc(t),e},Zc=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Jc=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Qc=function(e,t){return[].concat(e,t)},el=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)},pa={arrayToObject:la,assign:zc,combine:Qc,compact:Kc,decode:Xc,encode:Yc,isBuffer:Jc,isRegExp:Zc,maybeMap:el,merge:Wc},ha=kc,mn=pa,ur=gn,rl=Object.prototype.hasOwnProperty,ya={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},ie=Array.isArray,tl=String.prototype.split,nl=Array.prototype.push,da=function(r,e){nl.apply(r,ie(e)?e:[e])},il=Date.prototype.toISOString,va=ur.default,U={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:mn.encode,encodeValuesOnly:!1,format:va,formatter:ur.formatters[va],indices:!1,serializeDate:function(e){return il.call(e)},skipNulls:!1,strictNullHandling:!1},al=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},wn={},ol=function r(e,t,n,i,a,o,s,f,c,l,u,p,d,g,b,E){for(var w=e,S=E,h=0,O=!1;(S=S.get(wn))!==void 0&&!O;){var x=S.get(e);if(h+=1,typeof x<"u"){if(x===h)throw new RangeError("Cyclic object value");O=!0}typeof S.get(wn)>"u"&&(h=0)}if(typeof f=="function"?w=f(t,w):w instanceof Date?w=u(w):n==="comma"&&ie(w)&&(w=mn.maybeMap(w,function(ui){return ui instanceof Date?u(ui):ui})),w===null){if(a)return s&&!g?s(t,U.encoder,b,"key",p):t;w=""}if(al(w)||mn.isBuffer(w)){if(s){var R=g?t:s(t,U.encoder,b,"key",p);if(n==="comma"&&g){for(var m=tl.call(String(w),","),v="",_=0;_<m.length;++_)v+=(_===0?"":",")+d(s(m[_],U.encoder,b,"value",p));return[d(R)+(i&&ie(w)&&m.length===1?"[]":"")+"="+v]}return[d(R)+"="+d(s(w,U.encoder,b,"value",p))]}return[d(t)+"="+d(String(w))]}var $=[];if(typeof w>"u")return $;var A;if(n==="comma"&&ie(w))A=[{value:w.length>0?w.join(",")||null:void 0}];else if(ie(f))A=f;else{var L=Object.keys(w);A=c?L.sort(c):L}for(var ee=i&&ie(w)&&w.length===1?t+"[]":t,ge=0;ge<A.length;++ge){var fe=A[ge],Ir=typeof fe=="object"&&typeof fe.value<"u"?fe.value:w[fe];if(!(o&&Ir===null)){var U2=ie(w)?typeof n=="function"?n(ee,fe):ee:ee+(l?"."+fe:"["+fe+"]");E.set(e,h);var ts=ha();ts.set(wn,E),da($,r(Ir,U2,n,i,a,o,s,f,c,l,u,p,d,g,b,ts))}}return $},ul=function(e){if(!e)return U;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||U.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=ur.default;if(typeof e.format<"u"){if(!rl.call(ur.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=ur.formatters[n],a=U.filter;return(typeof e.filter=="function"||ie(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:U.addQueryPrefix,allowDots:typeof e.allowDots>"u"?U.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:U.charsetSentinel,delimiter:typeof e.delimiter>"u"?U.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:U.encode,encoder:typeof e.encoder=="function"?e.encoder:U.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:U.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:U.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:U.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:U.strictNullHandling}},sl=function(r,e){var t=r,n=ul(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):ie(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var s;e&&e.arrayFormat in ya?s=e.arrayFormat:e&&"indices"in e?s=e.indices?"indices":"repeat":s="indices";var f=ya[s];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=f==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var l=ha(),u=0;u<i.length;++u){var p=i[u];n.skipNulls&&t[p]===null||da(o,ol(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),g=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?g+="utf8=%26%2310003%3B&":g+="utf8=%E2%9C%93&"),d.length>0?g+d:""},ke=pa,bn=Object.prototype.hasOwnProperty,fl=Array.isArray,B={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:ke.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},cl=function(r){return r.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},ga=function(r,e){return r&&typeof r=="string"&&e.comma&&r.indexOf(",")>-1?r.split(","):r},ll="utf8=%26%2310003%3B",pl="utf8=%E2%9C%93",hl=function(e,t){var n={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,a),s=-1,f,c=t.charset;if(t.charsetSentinel)for(f=0;f<o.length;++f)o[f].indexOf("utf8=")===0&&(o[f]===pl?c="utf-8":o[f]===ll&&(c="iso-8859-1"),s=f,f=o.length);for(f=0;f<o.length;++f)if(f!==s){var l=o[f],u=l.indexOf("]="),p=u===-1?l.indexOf("="):u+1,d,g;p===-1?(d=t.decoder(l,B.decoder,c,"key"),g=t.strictNullHandling?null:""):(d=t.decoder(l.slice(0,p),B.decoder,c,"key"),g=ke.maybeMap(ga(l.slice(p+1),t),function(b){return t.decoder(b,B.decoder,c,"value")})),g&&t.interpretNumericEntities&&c==="iso-8859-1"&&(g=cl(g)),l.indexOf("[]=")>-1&&(g=fl(g)?[g]:g),bn.call(n,d)?n[d]=ke.combine(n[d],g):n[d]=g}return n},yl=function(r,e,t,n){for(var i=n?e:ga(e,t),a=r.length-1;a>=0;--a){var o,s=r[a];if(s==="[]"&&t.parseArrays)o=[].concat(i);else{o=t.plainObjects?Object.create(null):{};var f=s.charAt(0)==="["&&s.charAt(s.length-1)==="]"?s.slice(1,-1):s,c=parseInt(f,10);!t.parseArrays&&f===""?o={0:i}:!isNaN(c)&&s!==f&&String(c)===f&&c>=0&&t.parseArrays&&c<=t.arrayLimit?(o=[],o[c]=i):f!=="__proto__"&&(o[f]=i)}i=o}return i},dl=function(e,t,n,i){if(!!e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,f=n.depth>0&&o.exec(a),c=f?a.slice(0,f.index):a,l=[];if(c){if(!n.plainObjects&&bn.call(Object.prototype,c)&&!n.allowPrototypes)return;l.push(c)}for(var u=0;n.depth>0&&(f=s.exec(a))!==null&&u<n.depth;){if(u+=1,!n.plainObjects&&bn.call(Object.prototype,f[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(f[1])}return f&&l.push("["+a.slice(f.index)+"]"),yl(l,t,n,i)}},vl=function(e){if(!e)return B;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=typeof e.charset>"u"?B.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?B.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:B.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:B.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:B.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:B.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:B.comma,decoder:typeof e.decoder=="function"?e.decoder:B.decoder,delimiter:typeof e.delimiter=="string"||ke.isRegExp(e.delimiter)?e.delimiter:B.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:B.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:B.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:B.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:B.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:B.strictNullHandling}},gl=function(r,e){var t=vl(e);if(r===""||r===null||typeof r>"u")return t.plainObjects?Object.create(null):{};for(var n=typeof r=="string"?hl(r,t):r,i=t.plainObjects?Object.create(null):{},a=Object.keys(n),o=0;o<a.length;++o){var s=a[o],f=dl(s,n[s],t,typeof r=="string");i=ke.merge(i,f,t)}return t.allowSparse===!0?i:ke.compact(i)},_l=sl,ml=gl,wl=gn,bl={formats:wl,parse:ml,stringify:_l};let _a={storeIdentifier:"",environment:"prod"};function $l(r){_a=r}function sr(){return _a}const El=r=>r==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",Al=r=>r==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",Ol=r=>r==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",Sl="/tools/recurring";class $n{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}var Tl=Object.defineProperty,Il=Object.defineProperties,xl=Object.getOwnPropertyDescriptors,ma=Object.getOwnPropertySymbols,Pl=Object.prototype.hasOwnProperty,Fl=Object.prototype.propertyIsEnumerable,wa=(r,e,t)=>e in r?Tl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Yr=(r,e)=>{for(var t in e||(e={}))Pl.call(e,t)&&wa(r,t,e[t]);if(ma)for(var t of ma(e))Fl.call(e,t)&&wa(r,t,e[t]);return r},Rl=(r,e)=>Il(r,xl(e));function Ml(r){return bl.stringify(r,{encode:!1,indices:!1,arrayFormat:"comma"})}async function Kr(r,e,t={}){const n=sr();return ae(r,`${Ol(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function T(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:s,storeIdentifier:f,loginRetryFn:c}=sr(),l=o.apiToken,u=El(s),p=Yr({"X-Recharge-Access-Token":l,"X-Recharge-Version":"2021-11"},a||{}),d=Yr({shop_url:f},n);try{return await ae(r,`${u}${e}`,{id:t,query:d,data:i,headers:p})}catch(g){if(c&&g instanceof $n&&g.status===401)return c().then(b=>{if(b)return ae(r,`${u}${e}`,{id:t,query:d,data:i,headers:Rl(Yr({},p),{"X-Recharge-Access-Token":b.apiToken})});throw g});throw g}}async function En(r,e,t={}){return ae(r,`${Sl}${e}`,t)}async function ae(r,e,{id:t,query:n,data:i,headers:a}={}){let o=e.trim();if(t&&(o=[o,`${t}`.trim()].join("/")),n){let u;[o,u]=o.split("?");const p=[u,Ml(n)].join("&").replace(/^&/,"");o=`${o}${p?`?${p}`:""}`}let s;i&&r!=="get"&&(s=JSON.stringify(i));const f=Yr({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},a||{}),c=await fetch(o,{method:r,headers:f,body:s,mode:"cors"});let l;try{l=await c.json()}catch{}if(!c.ok)throw l&&l.error?new $n(l.error,c.status):new $n("A connection error occurred while making the request");return l}function Dl(r,e){return T("get","/addresses",{query:e},r)}async function Nl(r,e){const{address:t}=await T("get","/addresses",{id:e},r);return t}async function Bl(r,e){const{address:t}=await T("post","/addresses",{data:e},r);return t}async function An(r,e,t){const{address:n}=await T("put","/addresses",{id:e,data:t},r);return n}async function Ul(r,e,t){return An(r,e,{discounts:[{code:t}]})}async function Cl(r,e){return An(r,e,{discounts:[]})}function Ll(r,e){return T("delete","/addresses",{id:e},r)}async function jl(r,e){const{address:t}=await T("post","/addresses/merge",{data:e},r);return t}async function kl(r,e,t){const{charge:n}=await T("post",`/addresses/${e}/charges/skip`,{data:t},r);return n}var ql=Object.freeze({__proto__:null,listAddresses:Dl,getAddress:Nl,createAddress:Bl,updateAddress:An,applyDiscountToAddress:Ul,removeDiscountsFromAddress:Cl,deleteAddress:Ll,mergeAddresses:jl,skipFutureCharge:kl});async function Vl(){const{storefrontAccessToken:r}=sr(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await En("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id}}async function Gl(r,e){const{environment:t,storeIdentifier:n}=sr(),i=Al(t),a=await ae("post",`${i}/shopify_storefront_access`,{data:{customer_token:e,storefront_token:r,shop_url:n},headers:{"X-Recharge-App":"storefront-client"}});return a.api_token?{apiToken:a.api_token,customerId:a.customer_id}:null}var Hl=Object.freeze({__proto__:null,loginShopifyAppProxy:Vl,loginShopifyApi:Gl}),ba={},On={},oe={},Wl=typeof re=="object"&&re&&re.Object===Object&&re,$a=Wl,zl=$a,Xl=typeof self=="object"&&self&&self.Object===Object&&self,Yl=zl||Xl||Function("return this")(),Q=Yl,Kl=Q,Zl=Kl.Symbol,qe=Zl,Ea=qe,Aa=Object.prototype,Jl=Aa.hasOwnProperty,Ql=Aa.toString,fr=Ea?Ea.toStringTag:void 0;function ep(r){var e=Jl.call(r,fr),t=r[fr];try{r[fr]=void 0;var n=!0}catch{}var i=Ql.call(r);return n&&(e?r[fr]=t:delete r[fr]),i}var rp=ep,tp=Object.prototype,np=tp.toString;function ip(r){return np.call(r)}var ap=ip,Oa=qe,op=rp,up=ap,sp="[object Null]",fp="[object Undefined]",Sa=Oa?Oa.toStringTag:void 0;function cp(r){return r==null?r===void 0?fp:sp:Sa&&Sa in Object(r)?op(r):up(r)}var ue=cp;function lp(r){return r!=null&&typeof r=="object"}var H=lp,pp=ue,hp=H,yp="[object Number]";function dp(r){return typeof r=="number"||hp(r)&&pp(r)==yp}var Zr=dp,M={},Ta={exports:{}};function vp(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var ve=vp,gp=ue,_p=ve,mp="[object AsyncFunction]",wp="[object Function]",bp="[object GeneratorFunction]",$p="[object Proxy]";function Ep(r){if(!_p(r))return!1;var e=gp(r);return e==wp||e==bp||e==mp||e==$p}var Sn=Ep,Ap=Q,Op=Ap["__core-js_shared__"],Sp=Op,Tn=Sp,Ia=function(){var r=/[^.]+$/.exec(Tn&&Tn.keys&&Tn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function Tp(r){return!!Ia&&Ia in r}var Ip=Tp,xp=Function.prototype,Pp=xp.toString;function Fp(r){if(r!=null){try{return Pp.call(r)}catch{}try{return r+""}catch{}}return""}var xa=Fp,Rp=Sn,Mp=Ip,Dp=ve,Np=xa,Bp=/[\\^$.*+?()[\]{}|]/g,Up=/^\[object .+?Constructor\]$/,Cp=Function.prototype,Lp=Object.prototype,jp=Cp.toString,kp=Lp.hasOwnProperty,qp=RegExp("^"+jp.call(kp).replace(Bp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Vp(r){if(!Dp(r)||Mp(r))return!1;var e=Rp(r)?qp:Up;return e.test(Np(r))}var Gp=Vp;function Hp(r,e){return r?.[e]}var Wp=Hp,zp=Gp,Xp=Wp;function Yp(r,e){var t=Xp(r,e);return zp(t)?t:void 0}var Se=Yp,Kp=Se,Zp=function(){try{var r=Kp(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Pa=Zp,Fa=Pa;function Jp(r,e,t){e=="__proto__"&&Fa?Fa(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Ra=Jp;function Qp(r,e){return r===e||r!==r&&e!==e}var Jr=Qp,eh=Ra,rh=Jr,th=Object.prototype,nh=th.hasOwnProperty;function ih(r,e,t){var n=r[e];(!(nh.call(r,e)&&rh(n,t))||t===void 0&&!(e in r))&&eh(r,e,t)}var Ma=ih,ah=Ma,oh=Ra;function uh(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?oh(t,s,f):ah(t,s,f)}return t}var Ve=uh;function sh(r){return r}var Qr=sh;function fh(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 ch=fh,lh=ch,Da=Math.max;function ph(r,e,t){return e=Da(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=Da(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),lh(r,this,s)}}var Na=ph;function hh(r){return function(){return r}}var yh=hh,dh=yh,Ba=Pa,vh=Qr,gh=Ba?function(r,e){return Ba(r,"toString",{configurable:!0,enumerable:!1,value:dh(e),writable:!0})}:vh,_h=gh,mh=800,wh=16,bh=Date.now;function $h(r){var e=0,t=0;return function(){var n=bh(),i=wh-(n-t);if(t=n,i>0){if(++e>=mh)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var Eh=$h,Ah=_h,Oh=Eh,Sh=Oh(Ah),Ua=Sh,Th=Qr,Ih=Na,xh=Ua;function Ph(r,e){return xh(Ih(r,e,Th),r+"")}var Fh=Ph,Rh=9007199254740991;function Mh(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Rh}var In=Mh,Dh=Sn,Nh=In;function Bh(r){return r!=null&&Nh(r.length)&&!Dh(r)}var cr=Bh,Uh=9007199254740991,Ch=/^(?:0|[1-9]\d*)$/;function Lh(r,e){var t=typeof r;return e=e??Uh,!!e&&(t=="number"||t!="symbol"&&Ch.test(r))&&r>-1&&r%1==0&&r<e}var xn=Lh,jh=Jr,kh=cr,qh=xn,Vh=ve;function Gh(r,e,t){if(!Vh(t))return!1;var n=typeof e;return(n=="number"?kh(t)&&qh(e,t.length):n=="string"&&e in t)?jh(t[e],r):!1}var Ca=Gh,Hh=Fh,Wh=Ca;function zh(r){return Hh(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&&Wh(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 Xh=zh;function Yh(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var La=Yh,Kh=ue,Zh=H,Jh="[object Arguments]";function Qh(r){return Zh(r)&&Kh(r)==Jh}var ey=Qh,ja=ey,ry=H,ka=Object.prototype,ty=ka.hasOwnProperty,ny=ka.propertyIsEnumerable,iy=ja(function(){return arguments}())?ja:function(r){return ry(r)&&ty.call(r,"callee")&&!ny.call(r,"callee")},Pn=iy,ay=Array.isArray,C=ay,lr={exports:{}};function oy(){return!1}var uy=oy;(function(r,e){var t=Q,n=uy,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})(lr,lr.exports);var sy=ue,fy=In,cy=H,ly="[object Arguments]",py="[object Array]",hy="[object Boolean]",yy="[object Date]",dy="[object Error]",vy="[object Function]",gy="[object Map]",_y="[object Number]",my="[object Object]",wy="[object RegExp]",by="[object Set]",$y="[object String]",Ey="[object WeakMap]",Ay="[object ArrayBuffer]",Oy="[object DataView]",Sy="[object Float32Array]",Ty="[object Float64Array]",Iy="[object Int8Array]",xy="[object Int16Array]",Py="[object Int32Array]",Fy="[object Uint8Array]",Ry="[object Uint8ClampedArray]",My="[object Uint16Array]",Dy="[object Uint32Array]",F={};F[Sy]=F[Ty]=F[Iy]=F[xy]=F[Py]=F[Fy]=F[Ry]=F[My]=F[Dy]=!0,F[ly]=F[py]=F[Ay]=F[hy]=F[Oy]=F[yy]=F[dy]=F[vy]=F[gy]=F[_y]=F[my]=F[wy]=F[by]=F[$y]=F[Ey]=!1;function Ny(r){return cy(r)&&fy(r.length)&&!!F[sy(r)]}var By=Ny;function Uy(r){return function(e){return r(e)}}var Fn=Uy,pr={exports:{}};(function(r,e){var t=$a,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a&&t.process,s=function(){try{var f=i&&i.require&&i.require("util").types;return f||o&&o.binding&&o.binding("util")}catch{}}();r.exports=s})(pr,pr.exports);var Cy=By,Ly=Fn,qa=pr.exports,Va=qa&&qa.isTypedArray,jy=Va?Ly(Va):Cy,Ga=jy,ky=La,qy=Pn,Vy=C,Gy=lr.exports,Hy=xn,Wy=Ga,zy=Object.prototype,Xy=zy.hasOwnProperty;function Yy(r,e){var t=Vy(r),n=!t&&qy(r),i=!t&&!n&&Gy(r),a=!t&&!n&&!i&&Wy(r),o=t||n||i||a,s=o?ky(r.length,String):[],f=s.length;for(var c in r)(e||Xy.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Hy(c,f)))&&s.push(c);return s}var Ha=Yy,Ky=Object.prototype;function Zy(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Ky;return r===t}var Rn=Zy;function Jy(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var Qy=Jy,ed=ve,rd=Rn,td=Qy,nd=Object.prototype,id=nd.hasOwnProperty;function ad(r){if(!ed(r))return td(r);var e=rd(r),t=[];for(var n in r)n=="constructor"&&(e||!id.call(r,n))||t.push(n);return t}var od=ad,ud=Ha,sd=od,fd=cr;function cd(r){return fd(r)?ud(r,!0):sd(r)}var et=cd,ld=Ve,pd=Xh,hd=et,yd=pd(function(r,e){ld(e,hd(e),r)}),dd=yd;(function(r){r.exports=dd})(Ta);var rt={},Te={};function vd(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 gd=vd;function _d(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 md=_d,wd=md,bd=wd(),$d=bd;function Ed(r,e){return function(t){return r(e(t))}}var Wa=Ed,Ad=Wa,Od=Ad(Object.keys,Object),Sd=Od,Td=Rn,Id=Sd,xd=Object.prototype,Pd=xd.hasOwnProperty;function Fd(r){if(!Td(r))return Id(r);var e=[];for(var t in Object(r))Pd.call(r,t)&&t!="constructor"&&e.push(t);return e}var Rd=Fd,Md=Ha,Dd=Rd,Nd=cr;function Bd(r){return Nd(r)?Md(r):Dd(r)}var Ge=Bd,Ud=$d,Cd=Ge;function Ld(r,e){return r&&Ud(r,e,Cd)}var jd=Ld,kd=cr;function qd(r,e){return function(t,n){if(t==null)return t;if(!kd(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 Vd=qd,Gd=jd,Hd=Vd,Wd=Hd(Gd),Mn=Wd,zd=Mn;function Xd(r,e){var t=!0;return zd(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var Yd=Xd;function Kd(){this.__data__=[],this.size=0}var Zd=Kd,Jd=Jr;function Qd(r,e){for(var t=r.length;t--;)if(Jd(r[t][0],e))return t;return-1}var tt=Qd,ev=tt,rv=Array.prototype,tv=rv.splice;function nv(r){var e=this.__data__,t=ev(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():tv.call(e,t,1),--this.size,!0}var iv=nv,av=tt;function ov(r){var e=this.__data__,t=av(e,r);return t<0?void 0:e[t][1]}var uv=ov,sv=tt;function fv(r){return sv(this.__data__,r)>-1}var cv=fv,lv=tt;function pv(r,e){var t=this.__data__,n=lv(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var hv=pv,yv=Zd,dv=iv,vv=uv,gv=cv,_v=hv;function He(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}He.prototype.clear=yv,He.prototype.delete=dv,He.prototype.get=vv,He.prototype.has=gv,He.prototype.set=_v;var nt=He,mv=nt;function wv(){this.__data__=new mv,this.size=0}var bv=wv;function $v(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var Ev=$v;function Av(r){return this.__data__.get(r)}var Ov=Av;function Sv(r){return this.__data__.has(r)}var Tv=Sv,Iv=Se,xv=Q,Pv=Iv(xv,"Map"),Dn=Pv,Fv=Se,Rv=Fv(Object,"create"),it=Rv,za=it;function Mv(){this.__data__=za?za(null):{},this.size=0}var Dv=Mv;function Nv(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var Bv=Nv,Uv=it,Cv="__lodash_hash_undefined__",Lv=Object.prototype,jv=Lv.hasOwnProperty;function kv(r){var e=this.__data__;if(Uv){var t=e[r];return t===Cv?void 0:t}return jv.call(e,r)?e[r]:void 0}var qv=kv,Vv=it,Gv=Object.prototype,Hv=Gv.hasOwnProperty;function Wv(r){var e=this.__data__;return Vv?e[r]!==void 0:Hv.call(e,r)}var zv=Wv,Xv=it,Yv="__lodash_hash_undefined__";function Kv(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Xv&&e===void 0?Yv:e,this}var Zv=Kv,Jv=Dv,Qv=Bv,eg=qv,rg=zv,tg=Zv;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=Jv,We.prototype.delete=Qv,We.prototype.get=eg,We.prototype.has=rg,We.prototype.set=tg;var ng=We,Xa=ng,ig=nt,ag=Dn;function og(){this.size=0,this.__data__={hash:new Xa,map:new(ag||ig),string:new Xa}}var ug=og;function sg(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var fg=sg,cg=fg;function lg(r,e){var t=r.__data__;return cg(e)?t[typeof e=="string"?"string":"hash"]:t.map}var at=lg,pg=at;function hg(r){var e=pg(this,r).delete(r);return this.size-=e?1:0,e}var yg=hg,dg=at;function vg(r){return dg(this,r).get(r)}var gg=vg,_g=at;function mg(r){return _g(this,r).has(r)}var wg=mg,bg=at;function $g(r,e){var t=bg(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var Eg=$g,Ag=ug,Og=yg,Sg=gg,Tg=wg,Ig=Eg;function ze(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}ze.prototype.clear=Ag,ze.prototype.delete=Og,ze.prototype.get=Sg,ze.prototype.has=Tg,ze.prototype.set=Ig;var Nn=ze,xg=nt,Pg=Dn,Fg=Nn,Rg=200;function Mg(r,e){var t=this.__data__;if(t instanceof xg){var n=t.__data__;if(!Pg||n.length<Rg-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Fg(n)}return t.set(r,e),this.size=t.size,this}var Dg=Mg,Ng=nt,Bg=bv,Ug=Ev,Cg=Ov,Lg=Tv,jg=Dg;function Xe(r){var e=this.__data__=new Ng(r);this.size=e.size}Xe.prototype.clear=Bg,Xe.prototype.delete=Ug,Xe.prototype.get=Cg,Xe.prototype.has=Lg,Xe.prototype.set=jg;var Bn=Xe,kg="__lodash_hash_undefined__";function qg(r){return this.__data__.set(r,kg),this}var Vg=qg;function Gg(r){return this.__data__.has(r)}var Hg=Gg,Wg=Nn,zg=Vg,Xg=Hg;function ot(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new Wg;++e<t;)this.add(r[e])}ot.prototype.add=ot.prototype.push=zg,ot.prototype.has=Xg;var Yg=ot;function Kg(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 Zg=Kg;function Jg(r,e){return r.has(e)}var Qg=Jg,e_=Yg,r_=Zg,t_=Qg,n_=1,i_=2;function a_(r,e,t,n,i,a){var o=t&n_,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&i_?new e_:void 0;for(a.set(r,e),a.set(e,r);++u<s;){var g=r[u],b=e[u];if(n)var E=o?n(b,g,u,e,r,a):n(g,b,u,r,e,a);if(E!==void 0){if(E)continue;p=!1;break}if(d){if(!r_(e,function(w,S){if(!t_(d,S)&&(g===w||i(g,w,t,n,a)))return d.push(S)})){p=!1;break}}else if(!(g===b||i(g,b,t,n,a))){p=!1;break}}return a.delete(r),a.delete(e),p}var Ya=a_,o_=Q,u_=o_.Uint8Array,Ka=u_;function s_(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var f_=s_;function c_(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var l_=c_,Za=qe,Ja=Ka,p_=Jr,h_=Ya,y_=f_,d_=l_,v_=1,g_=2,__="[object Boolean]",m_="[object Date]",w_="[object Error]",b_="[object Map]",$_="[object Number]",E_="[object RegExp]",A_="[object Set]",O_="[object String]",S_="[object Symbol]",T_="[object ArrayBuffer]",I_="[object DataView]",Qa=Za?Za.prototype:void 0,Un=Qa?Qa.valueOf:void 0;function x_(r,e,t,n,i,a,o){switch(t){case I_:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case T_:return!(r.byteLength!=e.byteLength||!a(new Ja(r),new Ja(e)));case __:case m_:case $_:return p_(+r,+e);case w_:return r.name==e.name&&r.message==e.message;case E_:case O_:return r==e+"";case b_:var s=y_;case A_:var f=n&v_;if(s||(s=d_),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=g_,o.set(r,e);var l=h_(s(r),s(e),n,i,a,o);return o.delete(r),l;case S_:if(Un)return Un.call(r)==Un.call(e)}return!1}var P_=x_;function F_(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Cn=F_,R_=Cn,M_=C;function D_(r,e,t){var n=e(r);return M_(r)?n:R_(n,t(r))}var eo=D_;function N_(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 B_=N_;function U_(){return[]}var ro=U_,C_=B_,L_=ro,j_=Object.prototype,k_=j_.propertyIsEnumerable,to=Object.getOwnPropertySymbols,q_=to?function(r){return r==null?[]:(r=Object(r),C_(to(r),function(e){return k_.call(r,e)}))}:L_,Ln=q_,V_=eo,G_=Ln,H_=Ge;function W_(r){return V_(r,H_,G_)}var no=W_,io=no,z_=1,X_=Object.prototype,Y_=X_.hasOwnProperty;function K_(r,e,t,n,i,a){var o=t&z_,s=io(r),f=s.length,c=io(e),l=c.length;if(f!=l&&!o)return!1;for(var u=f;u--;){var p=s[u];if(!(o?p in e:Y_.call(e,p)))return!1}var d=a.get(r),g=a.get(e);if(d&&g)return d==e&&g==r;var b=!0;a.set(r,e),a.set(e,r);for(var E=o;++u<f;){p=s[u];var w=r[p],S=e[p];if(n)var h=o?n(S,w,p,e,r,a):n(w,S,p,r,e,a);if(!(h===void 0?w===S||i(w,S,t,n,a):h)){b=!1;break}E||(E=p=="constructor")}if(b&&!E){var O=r.constructor,x=e.constructor;O!=x&&"constructor"in r&&"constructor"in e&&!(typeof O=="function"&&O instanceof O&&typeof x=="function"&&x instanceof x)&&(b=!1)}return a.delete(r),a.delete(e),b}var Z_=K_,J_=Se,Q_=Q,em=J_(Q_,"DataView"),rm=em,tm=Se,nm=Q,im=tm(nm,"Promise"),am=im,om=Se,um=Q,sm=om(um,"Set"),fm=sm,cm=Se,lm=Q,pm=cm(lm,"WeakMap"),hm=pm,jn=rm,kn=Dn,qn=am,Vn=fm,Gn=hm,ao=ue,Ye=xa,oo="[object Map]",ym="[object Object]",uo="[object Promise]",so="[object Set]",fo="[object WeakMap]",co="[object DataView]",dm=Ye(jn),vm=Ye(kn),gm=Ye(qn),_m=Ye(Vn),mm=Ye(Gn),Ie=ao;(jn&&Ie(new jn(new ArrayBuffer(1)))!=co||kn&&Ie(new kn)!=oo||qn&&Ie(qn.resolve())!=uo||Vn&&Ie(new Vn)!=so||Gn&&Ie(new Gn)!=fo)&&(Ie=function(r){var e=ao(r),t=e==ym?r.constructor:void 0,n=t?Ye(t):"";if(n)switch(n){case dm:return co;case vm:return oo;case gm:return uo;case _m:return so;case mm:return fo}return e});var ut=Ie,Hn=Bn,wm=Ya,bm=P_,$m=Z_,lo=ut,po=C,ho=lr.exports,Em=Ga,Am=1,yo="[object Arguments]",vo="[object Array]",st="[object Object]",Om=Object.prototype,go=Om.hasOwnProperty;function Sm(r,e,t,n,i,a){var o=po(r),s=po(e),f=o?vo:lo(r),c=s?vo:lo(e);f=f==yo?st:f,c=c==yo?st:c;var l=f==st,u=c==st,p=f==c;if(p&&ho(r)){if(!ho(e))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new Hn),o||Em(r)?wm(r,e,t,n,i,a):bm(r,e,f,t,n,i,a);if(!(t&Am)){var d=l&&go.call(r,"__wrapped__"),g=u&&go.call(e,"__wrapped__");if(d||g){var b=d?r.value():r,E=g?e.value():e;return a||(a=new Hn),i(b,E,t,n,a)}}return p?(a||(a=new Hn),$m(r,e,t,n,i,a)):!1}var Tm=Sm,Im=Tm,_o=H;function mo(r,e,t,n,i){return r===e?!0:r==null||e==null||!_o(r)&&!_o(e)?r!==r&&e!==e:Im(r,e,t,n,mo,i)}var wo=mo,xm=Bn,Pm=wo,Fm=1,Rm=2;function Mm(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 xm;if(n)var p=n(c,l,f,r,e,u);if(!(p===void 0?Pm(l,c,Fm|Rm,n,u):p))return!1}}return!0}var Dm=Mm,Nm=ve;function Bm(r){return r===r&&!Nm(r)}var bo=Bm,Um=bo,Cm=Ge;function Lm(r){for(var e=Cm(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,Um(i)]}return e}var jm=Lm;function km(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var $o=km,qm=Dm,Vm=jm,Gm=$o;function Hm(r){var e=Vm(r);return e.length==1&&e[0][2]?Gm(e[0][0],e[0][1]):function(t){return t===r||qm(t,r,e)}}var Wm=Hm,zm=ue,Xm=H,Ym="[object Symbol]";function Km(r){return typeof r=="symbol"||Xm(r)&&zm(r)==Ym}var ft=Km,Zm=C,Jm=ft,Qm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,e0=/^\w*$/;function r0(r,e){if(Zm(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||Jm(r)?!0:e0.test(r)||!Qm.test(r)||e!=null&&r in Object(e)}var Wn=r0,Eo=Nn,t0="Expected a function";function zn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(t0);var t=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=t.cache;if(a.has(i))return a.get(i);var o=r.apply(this,n);return t.cache=a.set(i,o)||a,o};return t.cache=new(zn.Cache||Eo),t}zn.Cache=Eo;var n0=zn,i0=n0,a0=500;function o0(r){var e=i0(r,function(n){return t.size===a0&&t.clear(),n}),t=e.cache;return e}var u0=o0,s0=u0,f0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,c0=/\\(\\)?/g,l0=s0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(f0,function(t,n,i,a){e.push(i?a.replace(c0,"$1"):n||t)}),e}),p0=l0;function h0(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}var ct=h0,Ao=qe,y0=ct,d0=C,v0=ft,g0=1/0,Oo=Ao?Ao.prototype:void 0,So=Oo?Oo.toString:void 0;function To(r){if(typeof r=="string")return r;if(d0(r))return y0(r,To)+"";if(v0(r))return So?So.call(r):"";var e=r+"";return e=="0"&&1/r==-g0?"-0":e}var _0=To,m0=_0;function w0(r){return r==null?"":m0(r)}var b0=w0,$0=C,E0=Wn,A0=p0,O0=b0;function S0(r,e){return $0(r)?r:E0(r,e)?[r]:A0(O0(r))}var lt=S0,T0=ft,I0=1/0;function x0(r){if(typeof r=="string"||T0(r))return r;var e=r+"";return e=="0"&&1/r==-I0?"-0":e}var hr=x0,P0=lt,F0=hr;function R0(r,e){e=P0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[F0(e[t++])];return t&&t==n?r:void 0}var Xn=R0,M0=Xn;function D0(r,e,t){var n=r==null?void 0:M0(r,e);return n===void 0?t:n}var N0=D0;function B0(r,e){return r!=null&&e in Object(r)}var U0=B0,C0=lt,L0=Pn,j0=C,k0=xn,q0=In,V0=hr;function G0(r,e,t){e=C0(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=V0(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&&q0(i)&&k0(o,i)&&(j0(r)||L0(r)))}var H0=G0,W0=U0,z0=H0;function X0(r,e){return r!=null&&z0(r,e,W0)}var Y0=X0,K0=wo,Z0=N0,J0=Y0,Q0=Wn,ew=bo,rw=$o,tw=hr,nw=1,iw=2;function aw(r,e){return Q0(r)&&ew(e)?rw(tw(r),e):function(t){var n=Z0(t,r);return n===void 0&&n===e?J0(t,r):K0(e,n,nw|iw)}}var ow=aw;function uw(r){return function(e){return e?.[r]}}var sw=uw,fw=Xn;function cw(r){return function(e){return fw(e,r)}}var lw=cw,pw=sw,hw=lw,yw=Wn,dw=hr;function vw(r){return yw(r)?pw(dw(r)):hw(r)}var gw=vw,_w=Wm,mw=ow,ww=Qr,bw=C,$w=gw;function Ew(r){return typeof r=="function"?r:r==null?ww:typeof r=="object"?bw(r)?mw(r[0],r[1]):_w(r):$w(r)}var Io=Ew,Aw=gd,Ow=Yd,Sw=Io,Tw=C,Iw=Ca;function xw(r,e,t){var n=Tw(r)?Aw:Ow;return t&&Iw(r,e,t)&&(e=void 0),n(r,Sw(e))}var Yn=xw;Object.defineProperty(Te,"__esModule",{value:!0}),Te.calculatePadding=Mw,Te.slicePadding=Dw;var Pw=Yn,Fw=Rw(Pw);function Rw(r){return r&&r.__esModule?r:{default:r}}function Mw(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function Dw(r,e){var t=r.slice(e),n=(0,Fw.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(rt,"__esModule",{value:!0}),rt.Cursor=void 0;var Nw=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}}(),Bw=Te;function Uw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Kn=function(){function r(e){Uw(this,r),e instanceof y||(e=typeof e=="number"?y.alloc(e):y.from(e)),this._setBuffer(e),this.rewind()}return Nw(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,Bw.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){Kn.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){Kn.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),rt.Cursor=Kn,Object.defineProperty(M,"__esModule",{value:!0}),M.default=Gw;var Cw=Ta.exports,xo=Fo(Cw),Lw=Sn,jw=Fo(Lw),Po=rt;function Fo(r){return r&&r.__esModule?r:{default:r}}var kw=Math.pow(2,16),qw={toXDR:function(e){var t=new Po.Cursor(kw);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 Po.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}}},Vw={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 Gw(r){(0,xo.default)(r,qw),(0,jw.default)(r)&&(0,xo.default)(r.prototype,Vw)}Object.defineProperty(oe,"__esModule",{value:!0}),oe.Int=void 0;var Hw=Zr,Ro=Mo(Hw),Ww=M,zw=Mo(Ww);function Mo(r){return r&&r.__esModule?r:{default:r}}var yr=oe.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,Ro.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");t.writeInt32BE(e)},isValid:function(e){return!(0,Ro.default)(e)||Math.floor(e)!==e?!1:e>=yr.MIN_VALUE&&e<=yr.MAX_VALUE}};yr.MAX_VALUE=Math.pow(2,31)-1,yr.MIN_VALUE=-Math.pow(2,31),(0,zw.default)(yr);var pt={};function Xw(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Zn={exports:{}};(function(r){/**
|
|
24
|
+
`+e.prev}function Wr(r,e){var t=ln(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=ye(r,i)?e(r[i],r):""}var a=typeof sn=="function"?sn(r):[],o;if(Le){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var f in r)!ye(r,f)||t&&String(Number(f))===f&&f<r.length||Le&&o["$"+f]instanceof Symbol||(Zi.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r)));if(typeof sn=="function")for(var c=0;c<a.length;c++)ea.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var yn=jt,je=Ns,Pc=lc,Fc=yn("%TypeError%"),zr=yn("%WeakMap%",!0),Xr=yn("%Map%",!0),Rc=je("WeakMap.prototype.get",!0),Mc=je("WeakMap.prototype.set",!0),Dc=je("WeakMap.prototype.has",!0),Nc=je("Map.prototype.get",!0),Bc=je("Map.prototype.set",!0),Uc=je("Map.prototype.has",!0),dn=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},Cc=function(r,e){var t=dn(r,e);return t&&t.value},Lc=function(r,e,t){var n=dn(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},jc=function(r,e){return!!dn(r,e)},kc=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new Fc("Side channel does not contain "+Pc(a))},get:function(a){if(zr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Rc(e,a)}else if(Xr){if(t)return Nc(t,a)}else if(n)return Cc(n,a)},has:function(a){if(zr&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Dc(e,a)}else if(Xr){if(t)return Uc(t,a)}else if(n)return jc(n,a);return!1},set:function(a,o){zr&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new zr),Mc(e,a,o)):Xr?(t||(t=new Xr),Bc(t,a,o)):(n||(n={key:{},next:null}),Lc(n,a,o))}};return i},qc=String.prototype.replace,Vc=/%20/g,vn={RFC1738:"RFC1738",RFC3986:"RFC3986"},gn={default:vn.RFC3986,formatters:{RFC1738:function(r){return qc.call(r,Vc,"+")},RFC3986:function(r){return String(r)}},RFC1738:vn.RFC1738,RFC3986:vn.RFC3986},Gc=gn,_n=Object.prototype.hasOwnProperty,Oe=Array.isArray,J=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),Hc=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}}},la=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},Wc=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)||!_n.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=la(e,n)),Oe(e)&&Oe(t)?(t.forEach(function(a,o){if(_n.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 _n.call(a,o)?a[o]=r(a[o],s,n):a[o]=s,a},i)},zc=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},Xc=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}},Yc=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===Gc.RFC1738&&(c===40||c===41)){s+=o.charAt(f);continue}if(c<128){s=s+J[c];continue}if(c<2048){s=s+(J[192|c>>6]+J[128|c&63]);continue}if(c<55296||c>=57344){s=s+(J[224|c>>12]+J[128|c>>6&63]+J[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),s+=J[240|c>>18]+J[128|c>>12&63]+J[128|c>>6&63]+J[128|c&63]}return s},Kc=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 Hc(t),e},Zc=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Jc=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Qc=function(e,t){return[].concat(e,t)},el=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)},pa={arrayToObject:la,assign:zc,combine:Qc,compact:Kc,decode:Xc,encode:Yc,isBuffer:Jc,isRegExp:Zc,maybeMap:el,merge:Wc},ha=kc,mn=pa,ur=gn,rl=Object.prototype.hasOwnProperty,ya={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},ie=Array.isArray,tl=String.prototype.split,nl=Array.prototype.push,da=function(r,e){nl.apply(r,ie(e)?e:[e])},il=Date.prototype.toISOString,va=ur.default,U={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:mn.encode,encodeValuesOnly:!1,format:va,formatter:ur.formatters[va],indices:!1,serializeDate:function(e){return il.call(e)},skipNulls:!1,strictNullHandling:!1},al=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},wn={},ol=function r(e,t,n,i,a,o,s,f,c,l,u,p,d,g,b,E){for(var w=e,S=E,h=0,O=!1;(S=S.get(wn))!==void 0&&!O;){var x=S.get(e);if(h+=1,typeof x<"u"){if(x===h)throw new RangeError("Cyclic object value");O=!0}typeof S.get(wn)>"u"&&(h=0)}if(typeof f=="function"?w=f(t,w):w instanceof Date?w=u(w):n==="comma"&&ie(w)&&(w=mn.maybeMap(w,function(ui){return ui instanceof Date?u(ui):ui})),w===null){if(a)return s&&!g?s(t,U.encoder,b,"key",p):t;w=""}if(al(w)||mn.isBuffer(w)){if(s){var R=g?t:s(t,U.encoder,b,"key",p);if(n==="comma"&&g){for(var m=tl.call(String(w),","),v="",_=0;_<m.length;++_)v+=(_===0?"":",")+d(s(m[_],U.encoder,b,"value",p));return[d(R)+(i&&ie(w)&&m.length===1?"[]":"")+"="+v]}return[d(R)+"="+d(s(w,U.encoder,b,"value",p))]}return[d(t)+"="+d(String(w))]}var $=[];if(typeof w>"u")return $;var A;if(n==="comma"&&ie(w))A=[{value:w.length>0?w.join(",")||null:void 0}];else if(ie(f))A=f;else{var L=Object.keys(w);A=c?L.sort(c):L}for(var ee=i&&ie(w)&&w.length===1?t+"[]":t,ge=0;ge<A.length;++ge){var fe=A[ge],Ir=typeof fe=="object"&&typeof fe.value<"u"?fe.value:w[fe];if(!(o&&Ir===null)){var U2=ie(w)?typeof n=="function"?n(ee,fe):ee:ee+(l?"."+fe:"["+fe+"]");E.set(e,h);var ts=ha();ts.set(wn,E),da($,r(Ir,U2,n,i,a,o,s,f,c,l,u,p,d,g,b,ts))}}return $},ul=function(e){if(!e)return U;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||U.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=ur.default;if(typeof e.format<"u"){if(!rl.call(ur.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=ur.formatters[n],a=U.filter;return(typeof e.filter=="function"||ie(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:U.addQueryPrefix,allowDots:typeof e.allowDots>"u"?U.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:U.charsetSentinel,delimiter:typeof e.delimiter>"u"?U.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:U.encode,encoder:typeof e.encoder=="function"?e.encoder:U.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:U.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:U.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:U.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:U.strictNullHandling}},sl=function(r,e){var t=r,n=ul(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):ie(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var s;e&&e.arrayFormat in ya?s=e.arrayFormat:e&&"indices"in e?s=e.indices?"indices":"repeat":s="indices";var f=ya[s];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=f==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var l=ha(),u=0;u<i.length;++u){var p=i[u];n.skipNulls&&t[p]===null||da(o,ol(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),g=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?g+="utf8=%26%2310003%3B&":g+="utf8=%E2%9C%93&"),d.length>0?g+d:""},ke=pa,bn=Object.prototype.hasOwnProperty,fl=Array.isArray,B={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:ke.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},cl=function(r){return r.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},ga=function(r,e){return r&&typeof r=="string"&&e.comma&&r.indexOf(",")>-1?r.split(","):r},ll="utf8=%26%2310003%3B",pl="utf8=%E2%9C%93",hl=function(e,t){var n={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,a=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,a),s=-1,f,c=t.charset;if(t.charsetSentinel)for(f=0;f<o.length;++f)o[f].indexOf("utf8=")===0&&(o[f]===pl?c="utf-8":o[f]===ll&&(c="iso-8859-1"),s=f,f=o.length);for(f=0;f<o.length;++f)if(f!==s){var l=o[f],u=l.indexOf("]="),p=u===-1?l.indexOf("="):u+1,d,g;p===-1?(d=t.decoder(l,B.decoder,c,"key"),g=t.strictNullHandling?null:""):(d=t.decoder(l.slice(0,p),B.decoder,c,"key"),g=ke.maybeMap(ga(l.slice(p+1),t),function(b){return t.decoder(b,B.decoder,c,"value")})),g&&t.interpretNumericEntities&&c==="iso-8859-1"&&(g=cl(g)),l.indexOf("[]=")>-1&&(g=fl(g)?[g]:g),bn.call(n,d)?n[d]=ke.combine(n[d],g):n[d]=g}return n},yl=function(r,e,t,n){for(var i=n?e:ga(e,t),a=r.length-1;a>=0;--a){var o,s=r[a];if(s==="[]"&&t.parseArrays)o=[].concat(i);else{o=t.plainObjects?Object.create(null):{};var f=s.charAt(0)==="["&&s.charAt(s.length-1)==="]"?s.slice(1,-1):s,c=parseInt(f,10);!t.parseArrays&&f===""?o={0:i}:!isNaN(c)&&s!==f&&String(c)===f&&c>=0&&t.parseArrays&&c<=t.arrayLimit?(o=[],o[c]=i):f!=="__proto__"&&(o[f]=i)}i=o}return i},dl=function(e,t,n,i){if(!!e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,f=n.depth>0&&o.exec(a),c=f?a.slice(0,f.index):a,l=[];if(c){if(!n.plainObjects&&bn.call(Object.prototype,c)&&!n.allowPrototypes)return;l.push(c)}for(var u=0;n.depth>0&&(f=s.exec(a))!==null&&u<n.depth;){if(u+=1,!n.plainObjects&&bn.call(Object.prototype,f[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(f[1])}return f&&l.push("["+a.slice(f.index)+"]"),yl(l,t,n,i)}},vl=function(e){if(!e)return B;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=typeof e.charset>"u"?B.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?B.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:B.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:B.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:B.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:B.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:B.comma,decoder:typeof e.decoder=="function"?e.decoder:B.decoder,delimiter:typeof e.delimiter=="string"||ke.isRegExp(e.delimiter)?e.delimiter:B.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:B.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:B.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:B.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:B.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:B.strictNullHandling}},gl=function(r,e){var t=vl(e);if(r===""||r===null||typeof r>"u")return t.plainObjects?Object.create(null):{};for(var n=typeof r=="string"?hl(r,t):r,i=t.plainObjects?Object.create(null):{},a=Object.keys(n),o=0;o<a.length;++o){var s=a[o],f=dl(s,n[s],t,typeof r=="string");i=ke.merge(i,f,t)}return t.allowSparse===!0?i:ke.compact(i)},_l=sl,ml=gl,wl=gn,bl={formats:wl,parse:ml,stringify:_l};let _a={storeIdentifier:"",environment:"prod"};function $l(r){_a=r}function sr(){return _a}const El=r=>r==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",Al=r=>r==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",Ol=r=>r==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",Sl="/tools/recurring";class $n{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}var Tl=Object.defineProperty,Il=Object.defineProperties,xl=Object.getOwnPropertyDescriptors,ma=Object.getOwnPropertySymbols,Pl=Object.prototype.hasOwnProperty,Fl=Object.prototype.propertyIsEnumerable,wa=(r,e,t)=>e in r?Tl(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Yr=(r,e)=>{for(var t in e||(e={}))Pl.call(e,t)&&wa(r,t,e[t]);if(ma)for(var t of ma(e))Fl.call(e,t)&&wa(r,t,e[t]);return r},Rl=(r,e)=>Il(r,xl(e));function Ml(r){return bl.stringify(r,{encode:!1,indices:!1,arrayFormat:"comma"})}async function Kr(r,e,t={}){const n=sr();return ae(r,`${Ol(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function T(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:s,storeIdentifier:f,loginRetryFn:c}=sr(),l=o.apiToken,u=El(s),p=Yr({"X-Recharge-Access-Token":l,"X-Recharge-Version":"2021-11"},a||{}),d=Yr({shop_url:f},n);try{return await ae(r,`${u}${e}`,{id:t,query:d,data:i,headers:p})}catch(g){if(c&&g instanceof $n&&g.status===401)return c().then(b=>{if(b)return ae(r,`${u}${e}`,{id:t,query:d,data:i,headers:Rl(Yr({},p),{"X-Recharge-Access-Token":b.apiToken})});throw g});throw g}}async function En(r,e,t={}){return ae(r,`${Sl}${e}`,t)}async function ae(r,e,{id:t,query:n,data:i,headers:a}={}){let o=e.trim();if(t&&(o=[o,`${t}`.trim()].join("/")),n){let u;[o,u]=o.split("?");const p=[u,Ml(n)].join("&").replace(/^&/,"");o=`${o}${p?`?${p}`:""}`}let s;i&&r!=="get"&&(s=JSON.stringify(i));const f=Yr({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},a||{}),c=await fetch(o,{method:r,headers:f,body:s,mode:"cors"});let l;try{l=await c.json()}catch{}if(!c.ok)throw l&&l.error?new $n(l.error,c.status):new $n("A connection error occurred while making the request");return l}function Dl(r,e){return T("get","/addresses",{query:e},r)}async function Nl(r,e,t){const{address:n}=await T("get","/addresses",{id:e,query:{include:t?.include}},r);return n}async function Bl(r,e){const{address:t}=await T("post","/addresses",{data:e},r);return t}async function An(r,e,t){const{address:n}=await T("put","/addresses",{id:e,data:t},r);return n}async function Ul(r,e,t){return An(r,e,{discounts:[{code:t}]})}async function Cl(r,e){return An(r,e,{discounts:[]})}function Ll(r,e){return T("delete","/addresses",{id:e},r)}async function jl(r,e){const{address:t}=await T("post","/addresses/merge",{data:e},r);return t}async function kl(r,e,t){const{charge:n}=await T("post",`/addresses/${e}/charges/skip`,{data:t},r);return n}var ql=Object.freeze({__proto__:null,listAddresses:Dl,getAddress:Nl,createAddress:Bl,updateAddress:An,applyDiscountToAddress:Ul,removeDiscountsFromAddress:Cl,deleteAddress:Ll,mergeAddresses:jl,skipFutureCharge:kl});async function Vl(){const{storefrontAccessToken:r}=sr(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await En("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id}}async function Gl(r,e){const{environment:t,storeIdentifier:n}=sr(),i=Al(t),a=await ae("post",`${i}/shopify_storefront_access`,{data:{customer_token:e,storefront_token:r,shop_url:n},headers:{"X-Recharge-App":"storefront-client"}});return a.api_token?{apiToken:a.api_token,customerId:a.customer_id}:null}var Hl=Object.freeze({__proto__:null,loginShopifyAppProxy:Vl,loginShopifyApi:Gl}),ba={},On={},oe={},Wl=typeof re=="object"&&re&&re.Object===Object&&re,$a=Wl,zl=$a,Xl=typeof self=="object"&&self&&self.Object===Object&&self,Yl=zl||Xl||Function("return this")(),Q=Yl,Kl=Q,Zl=Kl.Symbol,qe=Zl,Ea=qe,Aa=Object.prototype,Jl=Aa.hasOwnProperty,Ql=Aa.toString,fr=Ea?Ea.toStringTag:void 0;function ep(r){var e=Jl.call(r,fr),t=r[fr];try{r[fr]=void 0;var n=!0}catch{}var i=Ql.call(r);return n&&(e?r[fr]=t:delete r[fr]),i}var rp=ep,tp=Object.prototype,np=tp.toString;function ip(r){return np.call(r)}var ap=ip,Oa=qe,op=rp,up=ap,sp="[object Null]",fp="[object Undefined]",Sa=Oa?Oa.toStringTag:void 0;function cp(r){return r==null?r===void 0?fp:sp:Sa&&Sa in Object(r)?op(r):up(r)}var ue=cp;function lp(r){return r!=null&&typeof r=="object"}var H=lp,pp=ue,hp=H,yp="[object Number]";function dp(r){return typeof r=="number"||hp(r)&&pp(r)==yp}var Zr=dp,M={},Ta={exports:{}};function vp(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var ve=vp,gp=ue,_p=ve,mp="[object AsyncFunction]",wp="[object Function]",bp="[object GeneratorFunction]",$p="[object Proxy]";function Ep(r){if(!_p(r))return!1;var e=gp(r);return e==wp||e==bp||e==mp||e==$p}var Sn=Ep,Ap=Q,Op=Ap["__core-js_shared__"],Sp=Op,Tn=Sp,Ia=function(){var r=/[^.]+$/.exec(Tn&&Tn.keys&&Tn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function Tp(r){return!!Ia&&Ia in r}var Ip=Tp,xp=Function.prototype,Pp=xp.toString;function Fp(r){if(r!=null){try{return Pp.call(r)}catch{}try{return r+""}catch{}}return""}var xa=Fp,Rp=Sn,Mp=Ip,Dp=ve,Np=xa,Bp=/[\\^$.*+?()[\]{}|]/g,Up=/^\[object .+?Constructor\]$/,Cp=Function.prototype,Lp=Object.prototype,jp=Cp.toString,kp=Lp.hasOwnProperty,qp=RegExp("^"+jp.call(kp).replace(Bp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Vp(r){if(!Dp(r)||Mp(r))return!1;var e=Rp(r)?qp:Up;return e.test(Np(r))}var Gp=Vp;function Hp(r,e){return r?.[e]}var Wp=Hp,zp=Gp,Xp=Wp;function Yp(r,e){var t=Xp(r,e);return zp(t)?t:void 0}var Se=Yp,Kp=Se,Zp=function(){try{var r=Kp(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Pa=Zp,Fa=Pa;function Jp(r,e,t){e=="__proto__"&&Fa?Fa(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var Ra=Jp;function Qp(r,e){return r===e||r!==r&&e!==e}var Jr=Qp,eh=Ra,rh=Jr,th=Object.prototype,nh=th.hasOwnProperty;function ih(r,e,t){var n=r[e];(!(nh.call(r,e)&&rh(n,t))||t===void 0&&!(e in r))&&eh(r,e,t)}var Ma=ih,ah=Ma,oh=Ra;function uh(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?oh(t,s,f):ah(t,s,f)}return t}var Ve=uh;function sh(r){return r}var Qr=sh;function fh(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 ch=fh,lh=ch,Da=Math.max;function ph(r,e,t){return e=Da(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=Da(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),lh(r,this,s)}}var Na=ph;function hh(r){return function(){return r}}var yh=hh,dh=yh,Ba=Pa,vh=Qr,gh=Ba?function(r,e){return Ba(r,"toString",{configurable:!0,enumerable:!1,value:dh(e),writable:!0})}:vh,_h=gh,mh=800,wh=16,bh=Date.now;function $h(r){var e=0,t=0;return function(){var n=bh(),i=wh-(n-t);if(t=n,i>0){if(++e>=mh)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var Eh=$h,Ah=_h,Oh=Eh,Sh=Oh(Ah),Ua=Sh,Th=Qr,Ih=Na,xh=Ua;function Ph(r,e){return xh(Ih(r,e,Th),r+"")}var Fh=Ph,Rh=9007199254740991;function Mh(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Rh}var In=Mh,Dh=Sn,Nh=In;function Bh(r){return r!=null&&Nh(r.length)&&!Dh(r)}var cr=Bh,Uh=9007199254740991,Ch=/^(?:0|[1-9]\d*)$/;function Lh(r,e){var t=typeof r;return e=e??Uh,!!e&&(t=="number"||t!="symbol"&&Ch.test(r))&&r>-1&&r%1==0&&r<e}var xn=Lh,jh=Jr,kh=cr,qh=xn,Vh=ve;function Gh(r,e,t){if(!Vh(t))return!1;var n=typeof e;return(n=="number"?kh(t)&&qh(e,t.length):n=="string"&&e in t)?jh(t[e],r):!1}var Ca=Gh,Hh=Fh,Wh=Ca;function zh(r){return Hh(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&&Wh(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 Xh=zh;function Yh(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var La=Yh,Kh=ue,Zh=H,Jh="[object Arguments]";function Qh(r){return Zh(r)&&Kh(r)==Jh}var ey=Qh,ja=ey,ry=H,ka=Object.prototype,ty=ka.hasOwnProperty,ny=ka.propertyIsEnumerable,iy=ja(function(){return arguments}())?ja:function(r){return ry(r)&&ty.call(r,"callee")&&!ny.call(r,"callee")},Pn=iy,ay=Array.isArray,C=ay,lr={exports:{}};function oy(){return!1}var uy=oy;(function(r,e){var t=Q,n=uy,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})(lr,lr.exports);var sy=ue,fy=In,cy=H,ly="[object Arguments]",py="[object Array]",hy="[object Boolean]",yy="[object Date]",dy="[object Error]",vy="[object Function]",gy="[object Map]",_y="[object Number]",my="[object Object]",wy="[object RegExp]",by="[object Set]",$y="[object String]",Ey="[object WeakMap]",Ay="[object ArrayBuffer]",Oy="[object DataView]",Sy="[object Float32Array]",Ty="[object Float64Array]",Iy="[object Int8Array]",xy="[object Int16Array]",Py="[object Int32Array]",Fy="[object Uint8Array]",Ry="[object Uint8ClampedArray]",My="[object Uint16Array]",Dy="[object Uint32Array]",F={};F[Sy]=F[Ty]=F[Iy]=F[xy]=F[Py]=F[Fy]=F[Ry]=F[My]=F[Dy]=!0,F[ly]=F[py]=F[Ay]=F[hy]=F[Oy]=F[yy]=F[dy]=F[vy]=F[gy]=F[_y]=F[my]=F[wy]=F[by]=F[$y]=F[Ey]=!1;function Ny(r){return cy(r)&&fy(r.length)&&!!F[sy(r)]}var By=Ny;function Uy(r){return function(e){return r(e)}}var Fn=Uy,pr={exports:{}};(function(r,e){var t=$a,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a&&t.process,s=function(){try{var f=i&&i.require&&i.require("util").types;return f||o&&o.binding&&o.binding("util")}catch{}}();r.exports=s})(pr,pr.exports);var Cy=By,Ly=Fn,qa=pr.exports,Va=qa&&qa.isTypedArray,jy=Va?Ly(Va):Cy,Ga=jy,ky=La,qy=Pn,Vy=C,Gy=lr.exports,Hy=xn,Wy=Ga,zy=Object.prototype,Xy=zy.hasOwnProperty;function Yy(r,e){var t=Vy(r),n=!t&&qy(r),i=!t&&!n&&Gy(r),a=!t&&!n&&!i&&Wy(r),o=t||n||i||a,s=o?ky(r.length,String):[],f=s.length;for(var c in r)(e||Xy.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Hy(c,f)))&&s.push(c);return s}var Ha=Yy,Ky=Object.prototype;function Zy(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Ky;return r===t}var Rn=Zy;function Jy(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var Qy=Jy,ed=ve,rd=Rn,td=Qy,nd=Object.prototype,id=nd.hasOwnProperty;function ad(r){if(!ed(r))return td(r);var e=rd(r),t=[];for(var n in r)n=="constructor"&&(e||!id.call(r,n))||t.push(n);return t}var od=ad,ud=Ha,sd=od,fd=cr;function cd(r){return fd(r)?ud(r,!0):sd(r)}var et=cd,ld=Ve,pd=Xh,hd=et,yd=pd(function(r,e){ld(e,hd(e),r)}),dd=yd;(function(r){r.exports=dd})(Ta);var rt={},Te={};function vd(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 gd=vd;function _d(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 md=_d,wd=md,bd=wd(),$d=bd;function Ed(r,e){return function(t){return r(e(t))}}var Wa=Ed,Ad=Wa,Od=Ad(Object.keys,Object),Sd=Od,Td=Rn,Id=Sd,xd=Object.prototype,Pd=xd.hasOwnProperty;function Fd(r){if(!Td(r))return Id(r);var e=[];for(var t in Object(r))Pd.call(r,t)&&t!="constructor"&&e.push(t);return e}var Rd=Fd,Md=Ha,Dd=Rd,Nd=cr;function Bd(r){return Nd(r)?Md(r):Dd(r)}var Ge=Bd,Ud=$d,Cd=Ge;function Ld(r,e){return r&&Ud(r,e,Cd)}var jd=Ld,kd=cr;function qd(r,e){return function(t,n){if(t==null)return t;if(!kd(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 Vd=qd,Gd=jd,Hd=Vd,Wd=Hd(Gd),Mn=Wd,zd=Mn;function Xd(r,e){var t=!0;return zd(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var Yd=Xd;function Kd(){this.__data__=[],this.size=0}var Zd=Kd,Jd=Jr;function Qd(r,e){for(var t=r.length;t--;)if(Jd(r[t][0],e))return t;return-1}var tt=Qd,ev=tt,rv=Array.prototype,tv=rv.splice;function nv(r){var e=this.__data__,t=ev(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():tv.call(e,t,1),--this.size,!0}var iv=nv,av=tt;function ov(r){var e=this.__data__,t=av(e,r);return t<0?void 0:e[t][1]}var uv=ov,sv=tt;function fv(r){return sv(this.__data__,r)>-1}var cv=fv,lv=tt;function pv(r,e){var t=this.__data__,n=lv(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var hv=pv,yv=Zd,dv=iv,vv=uv,gv=cv,_v=hv;function He(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}He.prototype.clear=yv,He.prototype.delete=dv,He.prototype.get=vv,He.prototype.has=gv,He.prototype.set=_v;var nt=He,mv=nt;function wv(){this.__data__=new mv,this.size=0}var bv=wv;function $v(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var Ev=$v;function Av(r){return this.__data__.get(r)}var Ov=Av;function Sv(r){return this.__data__.has(r)}var Tv=Sv,Iv=Se,xv=Q,Pv=Iv(xv,"Map"),Dn=Pv,Fv=Se,Rv=Fv(Object,"create"),it=Rv,za=it;function Mv(){this.__data__=za?za(null):{},this.size=0}var Dv=Mv;function Nv(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var Bv=Nv,Uv=it,Cv="__lodash_hash_undefined__",Lv=Object.prototype,jv=Lv.hasOwnProperty;function kv(r){var e=this.__data__;if(Uv){var t=e[r];return t===Cv?void 0:t}return jv.call(e,r)?e[r]:void 0}var qv=kv,Vv=it,Gv=Object.prototype,Hv=Gv.hasOwnProperty;function Wv(r){var e=this.__data__;return Vv?e[r]!==void 0:Hv.call(e,r)}var zv=Wv,Xv=it,Yv="__lodash_hash_undefined__";function Kv(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Xv&&e===void 0?Yv:e,this}var Zv=Kv,Jv=Dv,Qv=Bv,eg=qv,rg=zv,tg=Zv;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=Jv,We.prototype.delete=Qv,We.prototype.get=eg,We.prototype.has=rg,We.prototype.set=tg;var ng=We,Xa=ng,ig=nt,ag=Dn;function og(){this.size=0,this.__data__={hash:new Xa,map:new(ag||ig),string:new Xa}}var ug=og;function sg(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var fg=sg,cg=fg;function lg(r,e){var t=r.__data__;return cg(e)?t[typeof e=="string"?"string":"hash"]:t.map}var at=lg,pg=at;function hg(r){var e=pg(this,r).delete(r);return this.size-=e?1:0,e}var yg=hg,dg=at;function vg(r){return dg(this,r).get(r)}var gg=vg,_g=at;function mg(r){return _g(this,r).has(r)}var wg=mg,bg=at;function $g(r,e){var t=bg(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var Eg=$g,Ag=ug,Og=yg,Sg=gg,Tg=wg,Ig=Eg;function ze(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}ze.prototype.clear=Ag,ze.prototype.delete=Og,ze.prototype.get=Sg,ze.prototype.has=Tg,ze.prototype.set=Ig;var Nn=ze,xg=nt,Pg=Dn,Fg=Nn,Rg=200;function Mg(r,e){var t=this.__data__;if(t instanceof xg){var n=t.__data__;if(!Pg||n.length<Rg-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Fg(n)}return t.set(r,e),this.size=t.size,this}var Dg=Mg,Ng=nt,Bg=bv,Ug=Ev,Cg=Ov,Lg=Tv,jg=Dg;function Xe(r){var e=this.__data__=new Ng(r);this.size=e.size}Xe.prototype.clear=Bg,Xe.prototype.delete=Ug,Xe.prototype.get=Cg,Xe.prototype.has=Lg,Xe.prototype.set=jg;var Bn=Xe,kg="__lodash_hash_undefined__";function qg(r){return this.__data__.set(r,kg),this}var Vg=qg;function Gg(r){return this.__data__.has(r)}var Hg=Gg,Wg=Nn,zg=Vg,Xg=Hg;function ot(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new Wg;++e<t;)this.add(r[e])}ot.prototype.add=ot.prototype.push=zg,ot.prototype.has=Xg;var Yg=ot;function Kg(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 Zg=Kg;function Jg(r,e){return r.has(e)}var Qg=Jg,e_=Yg,r_=Zg,t_=Qg,n_=1,i_=2;function a_(r,e,t,n,i,a){var o=t&n_,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&i_?new e_:void 0;for(a.set(r,e),a.set(e,r);++u<s;){var g=r[u],b=e[u];if(n)var E=o?n(b,g,u,e,r,a):n(g,b,u,r,e,a);if(E!==void 0){if(E)continue;p=!1;break}if(d){if(!r_(e,function(w,S){if(!t_(d,S)&&(g===w||i(g,w,t,n,a)))return d.push(S)})){p=!1;break}}else if(!(g===b||i(g,b,t,n,a))){p=!1;break}}return a.delete(r),a.delete(e),p}var Ya=a_,o_=Q,u_=o_.Uint8Array,Ka=u_;function s_(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var f_=s_;function c_(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var l_=c_,Za=qe,Ja=Ka,p_=Jr,h_=Ya,y_=f_,d_=l_,v_=1,g_=2,__="[object Boolean]",m_="[object Date]",w_="[object Error]",b_="[object Map]",$_="[object Number]",E_="[object RegExp]",A_="[object Set]",O_="[object String]",S_="[object Symbol]",T_="[object ArrayBuffer]",I_="[object DataView]",Qa=Za?Za.prototype:void 0,Un=Qa?Qa.valueOf:void 0;function x_(r,e,t,n,i,a,o){switch(t){case I_:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case T_:return!(r.byteLength!=e.byteLength||!a(new Ja(r),new Ja(e)));case __:case m_:case $_:return p_(+r,+e);case w_:return r.name==e.name&&r.message==e.message;case E_:case O_:return r==e+"";case b_:var s=y_;case A_:var f=n&v_;if(s||(s=d_),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=g_,o.set(r,e);var l=h_(s(r),s(e),n,i,a,o);return o.delete(r),l;case S_:if(Un)return Un.call(r)==Un.call(e)}return!1}var P_=x_;function F_(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Cn=F_,R_=Cn,M_=C;function D_(r,e,t){var n=e(r);return M_(r)?n:R_(n,t(r))}var eo=D_;function N_(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 B_=N_;function U_(){return[]}var ro=U_,C_=B_,L_=ro,j_=Object.prototype,k_=j_.propertyIsEnumerable,to=Object.getOwnPropertySymbols,q_=to?function(r){return r==null?[]:(r=Object(r),C_(to(r),function(e){return k_.call(r,e)}))}:L_,Ln=q_,V_=eo,G_=Ln,H_=Ge;function W_(r){return V_(r,H_,G_)}var no=W_,io=no,z_=1,X_=Object.prototype,Y_=X_.hasOwnProperty;function K_(r,e,t,n,i,a){var o=t&z_,s=io(r),f=s.length,c=io(e),l=c.length;if(f!=l&&!o)return!1;for(var u=f;u--;){var p=s[u];if(!(o?p in e:Y_.call(e,p)))return!1}var d=a.get(r),g=a.get(e);if(d&&g)return d==e&&g==r;var b=!0;a.set(r,e),a.set(e,r);for(var E=o;++u<f;){p=s[u];var w=r[p],S=e[p];if(n)var h=o?n(S,w,p,e,r,a):n(w,S,p,r,e,a);if(!(h===void 0?w===S||i(w,S,t,n,a):h)){b=!1;break}E||(E=p=="constructor")}if(b&&!E){var O=r.constructor,x=e.constructor;O!=x&&"constructor"in r&&"constructor"in e&&!(typeof O=="function"&&O instanceof O&&typeof x=="function"&&x instanceof x)&&(b=!1)}return a.delete(r),a.delete(e),b}var Z_=K_,J_=Se,Q_=Q,em=J_(Q_,"DataView"),rm=em,tm=Se,nm=Q,im=tm(nm,"Promise"),am=im,om=Se,um=Q,sm=om(um,"Set"),fm=sm,cm=Se,lm=Q,pm=cm(lm,"WeakMap"),hm=pm,jn=rm,kn=Dn,qn=am,Vn=fm,Gn=hm,ao=ue,Ye=xa,oo="[object Map]",ym="[object Object]",uo="[object Promise]",so="[object Set]",fo="[object WeakMap]",co="[object DataView]",dm=Ye(jn),vm=Ye(kn),gm=Ye(qn),_m=Ye(Vn),mm=Ye(Gn),Ie=ao;(jn&&Ie(new jn(new ArrayBuffer(1)))!=co||kn&&Ie(new kn)!=oo||qn&&Ie(qn.resolve())!=uo||Vn&&Ie(new Vn)!=so||Gn&&Ie(new Gn)!=fo)&&(Ie=function(r){var e=ao(r),t=e==ym?r.constructor:void 0,n=t?Ye(t):"";if(n)switch(n){case dm:return co;case vm:return oo;case gm:return uo;case _m:return so;case mm:return fo}return e});var ut=Ie,Hn=Bn,wm=Ya,bm=P_,$m=Z_,lo=ut,po=C,ho=lr.exports,Em=Ga,Am=1,yo="[object Arguments]",vo="[object Array]",st="[object Object]",Om=Object.prototype,go=Om.hasOwnProperty;function Sm(r,e,t,n,i,a){var o=po(r),s=po(e),f=o?vo:lo(r),c=s?vo:lo(e);f=f==yo?st:f,c=c==yo?st:c;var l=f==st,u=c==st,p=f==c;if(p&&ho(r)){if(!ho(e))return!1;o=!0,l=!1}if(p&&!l)return a||(a=new Hn),o||Em(r)?wm(r,e,t,n,i,a):bm(r,e,f,t,n,i,a);if(!(t&Am)){var d=l&&go.call(r,"__wrapped__"),g=u&&go.call(e,"__wrapped__");if(d||g){var b=d?r.value():r,E=g?e.value():e;return a||(a=new Hn),i(b,E,t,n,a)}}return p?(a||(a=new Hn),$m(r,e,t,n,i,a)):!1}var Tm=Sm,Im=Tm,_o=H;function mo(r,e,t,n,i){return r===e?!0:r==null||e==null||!_o(r)&&!_o(e)?r!==r&&e!==e:Im(r,e,t,n,mo,i)}var wo=mo,xm=Bn,Pm=wo,Fm=1,Rm=2;function Mm(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 xm;if(n)var p=n(c,l,f,r,e,u);if(!(p===void 0?Pm(l,c,Fm|Rm,n,u):p))return!1}}return!0}var Dm=Mm,Nm=ve;function Bm(r){return r===r&&!Nm(r)}var bo=Bm,Um=bo,Cm=Ge;function Lm(r){for(var e=Cm(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,Um(i)]}return e}var jm=Lm;function km(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var $o=km,qm=Dm,Vm=jm,Gm=$o;function Hm(r){var e=Vm(r);return e.length==1&&e[0][2]?Gm(e[0][0],e[0][1]):function(t){return t===r||qm(t,r,e)}}var Wm=Hm,zm=ue,Xm=H,Ym="[object Symbol]";function Km(r){return typeof r=="symbol"||Xm(r)&&zm(r)==Ym}var ft=Km,Zm=C,Jm=ft,Qm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,e0=/^\w*$/;function r0(r,e){if(Zm(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||Jm(r)?!0:e0.test(r)||!Qm.test(r)||e!=null&&r in Object(e)}var Wn=r0,Eo=Nn,t0="Expected a function";function zn(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(t0);var t=function(){var n=arguments,i=e?e.apply(this,n):n[0],a=t.cache;if(a.has(i))return a.get(i);var o=r.apply(this,n);return t.cache=a.set(i,o)||a,o};return t.cache=new(zn.Cache||Eo),t}zn.Cache=Eo;var n0=zn,i0=n0,a0=500;function o0(r){var e=i0(r,function(n){return t.size===a0&&t.clear(),n}),t=e.cache;return e}var u0=o0,s0=u0,f0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,c0=/\\(\\)?/g,l0=s0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(f0,function(t,n,i,a){e.push(i?a.replace(c0,"$1"):n||t)}),e}),p0=l0;function h0(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}var ct=h0,Ao=qe,y0=ct,d0=C,v0=ft,g0=1/0,Oo=Ao?Ao.prototype:void 0,So=Oo?Oo.toString:void 0;function To(r){if(typeof r=="string")return r;if(d0(r))return y0(r,To)+"";if(v0(r))return So?So.call(r):"";var e=r+"";return e=="0"&&1/r==-g0?"-0":e}var _0=To,m0=_0;function w0(r){return r==null?"":m0(r)}var b0=w0,$0=C,E0=Wn,A0=p0,O0=b0;function S0(r,e){return $0(r)?r:E0(r,e)?[r]:A0(O0(r))}var lt=S0,T0=ft,I0=1/0;function x0(r){if(typeof r=="string"||T0(r))return r;var e=r+"";return e=="0"&&1/r==-I0?"-0":e}var hr=x0,P0=lt,F0=hr;function R0(r,e){e=P0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[F0(e[t++])];return t&&t==n?r:void 0}var Xn=R0,M0=Xn;function D0(r,e,t){var n=r==null?void 0:M0(r,e);return n===void 0?t:n}var N0=D0;function B0(r,e){return r!=null&&e in Object(r)}var U0=B0,C0=lt,L0=Pn,j0=C,k0=xn,q0=In,V0=hr;function G0(r,e,t){e=C0(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=V0(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&&q0(i)&&k0(o,i)&&(j0(r)||L0(r)))}var H0=G0,W0=U0,z0=H0;function X0(r,e){return r!=null&&z0(r,e,W0)}var Y0=X0,K0=wo,Z0=N0,J0=Y0,Q0=Wn,ew=bo,rw=$o,tw=hr,nw=1,iw=2;function aw(r,e){return Q0(r)&&ew(e)?rw(tw(r),e):function(t){var n=Z0(t,r);return n===void 0&&n===e?J0(t,r):K0(e,n,nw|iw)}}var ow=aw;function uw(r){return function(e){return e?.[r]}}var sw=uw,fw=Xn;function cw(r){return function(e){return fw(e,r)}}var lw=cw,pw=sw,hw=lw,yw=Wn,dw=hr;function vw(r){return yw(r)?pw(dw(r)):hw(r)}var gw=vw,_w=Wm,mw=ow,ww=Qr,bw=C,$w=gw;function Ew(r){return typeof r=="function"?r:r==null?ww:typeof r=="object"?bw(r)?mw(r[0],r[1]):_w(r):$w(r)}var Io=Ew,Aw=gd,Ow=Yd,Sw=Io,Tw=C,Iw=Ca;function xw(r,e,t){var n=Tw(r)?Aw:Ow;return t&&Iw(r,e,t)&&(e=void 0),n(r,Sw(e))}var Yn=xw;Object.defineProperty(Te,"__esModule",{value:!0}),Te.calculatePadding=Mw,Te.slicePadding=Dw;var Pw=Yn,Fw=Rw(Pw);function Rw(r){return r&&r.__esModule?r:{default:r}}function Mw(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function Dw(r,e){var t=r.slice(e),n=(0,Fw.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(rt,"__esModule",{value:!0}),rt.Cursor=void 0;var Nw=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}}(),Bw=Te;function Uw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Kn=function(){function r(e){Uw(this,r),e instanceof y||(e=typeof e=="number"?y.alloc(e):y.from(e)),this._setBuffer(e),this.rewind()}return Nw(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,Bw.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){Kn.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){Kn.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),rt.Cursor=Kn,Object.defineProperty(M,"__esModule",{value:!0}),M.default=Gw;var Cw=Ta.exports,xo=Fo(Cw),Lw=Sn,jw=Fo(Lw),Po=rt;function Fo(r){return r&&r.__esModule?r:{default:r}}var kw=Math.pow(2,16),qw={toXDR:function(e){var t=new Po.Cursor(kw);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 Po.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}}},Vw={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 Gw(r){(0,xo.default)(r,qw),(0,jw.default)(r)&&(0,xo.default)(r.prototype,Vw)}Object.defineProperty(oe,"__esModule",{value:!0}),oe.Int=void 0;var Hw=Zr,Ro=Mo(Hw),Ww=M,zw=Mo(Ww);function Mo(r){return r&&r.__esModule?r:{default:r}}var yr=oe.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,Ro.default)(e))throw new Error("XDR Write Error: not a number");if(Math.floor(e)!==e)throw new Error("XDR Write Error: not an integer");t.writeInt32BE(e)},isValid:function(e){return!(0,Ro.default)(e)||Math.floor(e)!==e?!1:e>=yr.MIN_VALUE&&e<=yr.MAX_VALUE}};yr.MAX_VALUE=Math.pow(2,31)-1,yr.MIN_VALUE=-Math.pow(2,31),(0,zw.default)(yr);var pt={};function Xw(r){throw new Error('Could not dynamically require "'+r+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Zn={exports:{}};(function(r){/**
|
|
25
25
|
* @license Long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
|
|
26
26
|
* Released under the Apache License, Version 2.0
|
|
27
27
|
* see: https://github.com/dcodeIO/Long.js for details
|
|
28
|
-
*/(function(e,t){typeof Xw=="function"&&!0&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(re,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,g;return p?(u=u>>>0,0<=u&&u<256&&(g=n[u],g)?g:(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&&(g=t[u],g)?g:(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 g;if((g=u.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+u);if(g===0)return e.fromString(u.substring(1),p,d).negate();for(var b=e.fromNumber(Math.pow(d,8)),E=e.ZERO,w=0;w<u.length;w+=8){var S=Math.min(8,u.length-w),h=parseInt(u.substring(w,w+S),d);if(S<8){var O=e.fromNumber(Math.pow(d,S));E=E.multiply(O).add(e.fromNumber(h))}else E=E.multiply(b),E=E.add(e.fromNumber(h))}return E.unsigned=p,E},e.fromValue=function(u){return u instanceof e?u:typeof u=="number"?e.fromNumber(u):typeof u=="string"?e.fromString(u):new e(u.low,u.high,u.unsigned)};var i=1<<16,a=1<<24,o=i*i,s=o*o,f=s/2,c=e.fromInt(a);return e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)},e.prototype.toString=function(u){if(u=u||10,u<2||36<u)throw RangeError("radix out of range: "+u);if(this.isZero())return"0";var p;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var d=e.fromNumber(u),g=this.divide(d);return p=g.multiply(d).subtract(this),g.toString(u)+p.toInt().toString(u)}else return"-"+this.negate().toString(u);var b=e.fromNumber(Math.pow(u,6),this.unsigned);p=this;for(var E="";;){var w=p.divide(b),S=p.subtract(w.multiply(b)).toInt()>>>0,h=S.toString(u);if(p=w,p.isZero())return h+E;for(;h.length<6;)h="0"+h;E=""+h+E}},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(e.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var u=this.high!=0?this.high:this.low,p=31;p>0&&(u&1<<p)==0;p--);return this.high!=0?p+33:p+1},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.equals=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.unsigned!==u.unsigned&&this.high>>>31===1&&u.high>>>31===1?!1:this.high===u.high&&this.low===u.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(u){return!this.equals(u)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(u){return this.compare(u)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(u){return this.compare(u)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(u){return this.compare(u)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(u){return this.compare(u)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compare=function(u){if(e.isLong(u)||(u=e.fromValue(u)),this.equals(u))return 0;var p=this.isNegative(),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,g=this.low>>>16,b=this.low&65535,E=u.high>>>16,w=u.high&65535,S=u.low>>>16,h=u.low&65535,O=0,x=0,R=0,m=0;return m+=b+h,R+=m>>>16,m&=65535,R+=g+S,x+=R>>>16,R&=65535,x+=d+w,O+=x>>>16,x&=65535,O+=p+E,O&=65535,e.fromBits(R<<16|m,O<<16|x,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,g=this.low>>>16,b=this.low&65535,E=u.high>>>16,w=u.high&65535,S=u.low>>>16,h=u.low&65535,O=0,x=0,R=0,m=0;return m+=b*h,R+=m>>>16,m&=65535,R+=g*h,x+=R>>>16,R&=65535,R+=b*S,x+=R>>>16,R&=65535,x+=d*h,O+=x>>>16,x&=65535,x+=g*S,O+=x>>>16,x&=65535,x+=b*w,O+=x>>>16,x&=65535,O+=p*h+d*S+g*w+b*E,O&=65535,e.fromBits(R<<16|m,O<<16|x,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,g;if(this.equals(e.MIN_VALUE)){if(u.equals(e.ONE)||u.equals(e.NEG_ONE))return e.MIN_VALUE;if(u.equals(e.MIN_VALUE))return e.ONE;var b=this.shiftRight(1);return p=b.divide(u).shiftLeft(1),p.equals(e.ZERO)?u.isNegative()?e.ONE:e.NEG_ONE:(d=this.subtract(u.multiply(p)),g=p.add(d.divide(u)),g)}else if(u.equals(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().divide(u.negate()):this.negate().divide(u).negate();if(u.isNegative())return this.divide(u.negate()).negate();for(g=e.ZERO,d=this;d.greaterThanOrEqual(u);){p=Math.max(1,Math.floor(d.toNumber()/u.toNumber()));for(var E=Math.ceil(Math.log(p)/Math.LN2),w=E<=48?1:Math.pow(2,E-48),S=e.fromNumber(p),h=S.multiply(u);h.isNegative()||h.greaterThan(d);)p-=w,S=e.fromNumber(p,this.unsigned),h=S.multiply(u);S.isZero()&&(S=e.ONE),g=g.add(S),d=d.subtract(h)}return g},e.prototype.div=e.prototype.divide,e.prototype.modulo=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.subtract(this.divide(u).multiply(u))},e.prototype.mod=e.prototype.modulo,e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.and=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low&u.low,this.high&u.high,this.unsigned)},e.prototype.or=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low|u.low,this.high|u.high,this.unsigned)},e.prototype.xor=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low^u.low,this.high^u.high,this.unsigned)},e.prototype.shiftLeft=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low<<u,this.high<<u|this.low>>>32-u,this.unsigned):e.fromBits(0,this.low<<u-32,this.unsigned)},e.prototype.shl=e.prototype.shiftLeft,e.prototype.shiftRight=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low>>>u|this.high<<32-u,this.high>>u,this.unsigned):e.fromBits(this.high>>u-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=e.prototype.shiftRight,e.prototype.shiftRightUnsigned=function(u){if(e.isLong(u)&&(u=u.toInt()),u&=63,u===0)return this;var p=this.high;if(u<32){var 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})})(Zn),Object.defineProperty(pt,"__esModule",{value:!0}),pt.Hyper=void 0;var Yw=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}}(),Do=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)}},Kw=Zn.exports,dr=No(Kw),Zw=M,Jw=No(Zw);function No(r){return r&&r.__esModule?r:{default:r}}function Qw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function eb(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 rb(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 vr=pt.Hyper=function(r){rb(e,r),Yw(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=Do(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=Do(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 Qw(this,e),eb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(dr.default);(0,Jw.default)(vr),vr.MAX_VALUE=new vr(dr.default.MAX_VALUE.low,dr.default.MAX_VALUE.high),vr.MIN_VALUE=new vr(dr.default.MIN_VALUE.low,dr.default.MIN_VALUE.high);var xe={};Object.defineProperty(xe,"__esModule",{value:!0}),xe.UnsignedInt=void 0;var tb=Zr,Bo=Uo(tb),nb=M,ib=Uo(nb);function Uo(r){return r&&r.__esModule?r:{default:r}}var gr=xe.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,Bo.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,Bo.default)(e)||Math.floor(e)!==e?!1:e>=gr.MIN_VALUE&&e<=gr.MAX_VALUE}};gr.MAX_VALUE=Math.pow(2,32)-1,gr.MIN_VALUE=0,(0,ib.default)(gr);var ht={};Object.defineProperty(ht,"__esModule",{value:!0}),ht.UnsignedHyper=void 0;var ab=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}}(),Co=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)}},ob=Zn.exports,_r=Lo(ob),ub=M,sb=Lo(ub);function Lo(r){return r&&r.__esModule?r:{default:r}}function fb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function cb(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 lb(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 mr=ht.UnsignedHyper=function(r){lb(e,r),ab(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=Co(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=Co(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 fb(this,e),cb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(_r.default);(0,sb.default)(mr),mr.MAX_VALUE=new mr(_r.default.MAX_UNSIGNED_VALUE.low,_r.default.MAX_UNSIGNED_VALUE.high),mr.MIN_VALUE=new mr(_r.default.MIN_VALUE.low,_r.default.MIN_VALUE.high);var yt={};Object.defineProperty(yt,"__esModule",{value:!0}),yt.Float=void 0;var pb=Zr,jo=ko(pb),hb=M,yb=ko(hb);function ko(r){return r&&r.__esModule?r:{default:r}}var db=yt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,jo.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,jo.default)(e)}};(0,yb.default)(db);var dt={};Object.defineProperty(dt,"__esModule",{value:!0}),dt.Double=void 0;var vb=Zr,qo=Vo(vb),gb=M,_b=Vo(gb);function Vo(r){return r&&r.__esModule?r:{default:r}}var mb=dt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,qo.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,qo.default)(e)}};(0,_b.default)(mb);var vt={};Object.defineProperty(vt,"__esModule",{value:!0}),vt.Quadruple=void 0;var wb=M,bb=$b(wb);function $b(r){return r&&r.__esModule?r:{default:r}}var Eb=vt.Quadruple={read:function(){throw new Error("XDR Read Error: quadruple not supported")},write:function(){throw new Error("XDR Write Error: quadruple not supported")},isValid:function(){return!1}};(0,bb.default)(Eb);var wr={},Ab=ue,Ob=H,Sb="[object Boolean]";function Tb(r){return r===!0||r===!1||Ob(r)&&Ab(r)==Sb}var Ib=Tb;Object.defineProperty(wr,"__esModule",{value:!0}),wr.Bool=void 0;var xb=Ib,Pb=Ho(xb),Go=oe,Fb=M,Rb=Ho(Fb);function Ho(r){return r&&r.__esModule?r:{default:r}}var Mb=wr.Bool={read:function(e){var t=Go.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 Go.Int.write(n,t)},isValid:function(e){return(0,Pb.default)(e)}};(0,Rb.default)(Mb);var gt={},Db=ue,Nb=C,Bb=H,Ub="[object String]";function Cb(r){return typeof r=="string"||!Nb(r)&&Bb(r)&&Db(r)==Ub}var Wo=Cb;Object.defineProperty(gt,"__esModule",{value:!0}),gt.String=void 0;var Lb=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}}(),jb=Wo,zo=Jn(jb),kb=C,qb=Jn(kb),Xo=oe,Vb=xe,Yo=Te,Gb=M,Hb=Jn(Gb);function Jn(r){return r&&r.__esModule?r:{default:r}}function Wb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var zb=gt.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Vb.UnsignedInt.MAX_VALUE;Wb(this,r),this._maxLength=e}return Lb(r,[{key:"read",value:function(t){var n=Xo.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length String,"+("max allowed is "+this._maxLength));var i=(0,Yo.calculatePadding)(n),a=t.slice(n);return(0,Yo.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,zo.default)(t)?i=y.from(t,"utf8"):i=y.from(t),Xo.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,zo.default)(t))n=y.from(t,"utf8");else if((0,qb.default)(t)||y.isBuffer(t))n=y.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,Hb.default)(zb.prototype);var _t={};Object.defineProperty(_t,"__esModule",{value:!0}),_t.Opaque=void 0;var Xb=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}}(),Ko=Te,Yb=M,Kb=Zb(Yb);function Zb(r){return r&&r.__esModule?r:{default:r}}function Jb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Qb=_t.Opaque=function(){function r(e){Jb(this,r),this._length=e,this._padding=(0,Ko.calculatePadding)(e)}return Xb(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Ko.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,Kb.default)(Qb.prototype);var mt={};Object.defineProperty(mt,"__esModule",{value:!0}),mt.VarOpaque=void 0;var e1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Zo=oe,r1=xe,Jo=Te,t1=M,n1=i1(t1);function i1(r){return r&&r.__esModule?r:{default:r}}function a1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var o1=mt.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r1.UnsignedInt.MAX_VALUE;a1(this,r),this._maxLength=e}return e1(r,[{key:"read",value:function(t){var n=Zo.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,Jo.calculatePadding)(n),a=t.slice(n);return(0,Jo.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));Zo.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return y.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,n1.default)(o1.prototype);var wt={},Pe={exports:{}};function u1(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var Qo=u1,s1=Qr;function f1(r){return typeof r=="function"?r:s1}var eu=f1,c1=Qo,l1=Mn,p1=eu,h1=C;function y1(r,e){var t=h1(r)?c1:l1;return t(r,p1(e))}var d1=y1;(function(r){r.exports=d1})(Pe);var v1=/\s/;function g1(r){for(var e=r.length;e--&&v1.test(r.charAt(e)););return e}var _1=g1,m1=_1,w1=/^\s+/;function b1(r){return r&&r.slice(0,m1(r)+1).replace(w1,"")}var $1=b1,E1=$1,ru=ve,A1=ft,tu=0/0,O1=/^[-+]0x[0-9a-f]+$/i,S1=/^0b[01]+$/i,T1=/^0o[0-7]+$/i,I1=parseInt;function x1(r){if(typeof r=="number")return r;if(A1(r))return tu;if(ru(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=ru(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=E1(r);var t=S1.test(r);return t||T1.test(r)?I1(r.slice(2),t?2:8):O1.test(r)?tu:+r}var P1=x1,F1=P1,nu=1/0,R1=17976931348623157e292;function M1(r){if(!r)return r===0?r:0;if(r=F1(r),r===nu||r===-nu){var e=r<0?-1:1;return e*R1}return r===r?r:0}var D1=M1,N1=D1;function B1(r){var e=N1(r),t=e%1;return e===e?t?e-t:e:0}var U1=B1,C1=La,L1=eu,j1=U1,k1=9007199254740991,Qn=4294967295,q1=Math.min;function V1(r,e){if(r=j1(r),r<1||r>k1)return[];var t=Qn,n=q1(r,Qn);e=L1(e),r-=Qn;for(var i=C1(n,e);++t<r;)e(t);return i}var iu=V1;Object.defineProperty(wt,"__esModule",{value:!0}),wt.Array=void 0;var G1=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}}(),H1=Yn,W1=br(H1),z1=Pe.exports,X1=br(z1),Y1=iu,K1=br(Y1),Z1=C,au=br(Z1),J1=M,Q1=br(J1);function br(r){return r&&r.__esModule?r:{default:r}}function e$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var r$=wt.Array=function(){function r(e,t){e$(this,r),this._childType=e,this._length=t}return G1(r,[{key:"read",value:function(t){var n=this;return(0,K1.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,au.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length!==this._length)throw new Error("XDR Write Error: Got array of size "+t.length+","+("expected "+this._length));(0,X1.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,au.default)(t)||t.length!==this._length?!1:(0,W1.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,Q1.default)(r$.prototype);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.VarArray=void 0;var t$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),n$=Yn,i$=$r(n$),a$=Pe.exports,o$=$r(a$),u$=iu,s$=$r(u$),f$=C,ou=$r(f$),c$=xe,uu=oe,l$=M,p$=$r(l$);function $r(r){return r&&r.__esModule?r:{default:r}}function h$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var y$=bt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c$.UnsignedInt.MAX_VALUE;h$(this,r),this._childType=e,this._maxLength=t}return t$(r,[{key:"read",value:function(t){var n=this,i=uu.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,s$.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,ou.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length>this._maxLength)throw new Error("XDR Write Error: Got array of size "+t.length+","+("max allowed is "+this._maxLength));uu.Int.write(t.length,n),(0,o$.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,ou.default)(t)||t.length>this._maxLength?!1:(0,i$.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,p$.default)(y$.prototype);var $t={};function d$(r){return r===null}var v$=d$;function g$(r){return r===void 0}var Er=g$;Object.defineProperty($t,"__esModule",{value:!0}),$t.Option=void 0;var _$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),m$=v$,su=ei(m$),w$=Er,fu=ei(w$),cu=wr,b$=M,$$=ei(b$);function ei(r){return r&&r.__esModule?r:{default:r}}function E$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var A$=$t.Option=function(){function r(e){E$(this,r),this._childType=e}return _$(r,[{key:"read",value:function(t){if(cu.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,su.default)(t)||(0,fu.default)(t));cu.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,su.default)(t)||(0,fu.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,$$.default)(A$.prototype);var Ar={};Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.Void=void 0;var O$=Er,lu=pu(O$),S$=M,T$=pu(S$);function pu(r){return r&&r.__esModule?r:{default:r}}var I$=Ar.Void={read:function(){},write:function(e){if(!(0,lu.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,lu.default)(e)}};(0,T$.default)(I$);var Et={},x$=ct;function P$(r,e){return x$(e,function(t){return r[t]})}var F$=P$,R$=F$,M$=Ge;function D$(r){return r==null?[]:R$(r,M$(r))}var N$=D$;Object.defineProperty(Et,"__esModule",{value:!0}),Et.Enum=void 0;var B$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),U$=Pe.exports,C$=ri(U$),L$=N$,j$=ri(L$),hu=oe,k$=M,q$=ri(k$);function ri(r){return r&&r.__esModule?r:{default:r}}function V$(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 G$(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function yu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var H$=Et.Enum=function(){function r(e,t){yu(this,r),this.name=e,this.value=t}return B$(r,null,[{key:"read",value:function(t){var n=hu.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);hu.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,j$.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){G$(s,o);function s(){return yu(this,s),V$(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,C$.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,q$.default)(H$);var At={},W$=Mn,z$=cr;function X$(r,e){var t=-1,n=z$(r)?Array(r.length):[];return W$(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var Y$=X$,K$=ct,Z$=Io,J$=Y$,Q$=C;function eE(r,e){var t=Q$(r)?K$:J$;return t(r,Z$(e))}var rE=eE;function tE(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 nE=tE,Or={};Object.defineProperty(Or,"__esModule",{value:!0});var iE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function aE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Or.Reference=function(){function r(){aE(this,r)}return iE(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(At,"__esModule",{value:!0}),At.Struct=void 0;var Ot=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),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}}(),uE=Pe.exports,du=Sr(uE),sE=rE,fE=Sr(sE),cE=Er,lE=Sr(cE),pE=nE,hE=Sr(pE),yE=Or,dE=M,vE=Sr(dE);function Sr(r){return r&&r.__esModule?r:{default:r}}function gE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function _E(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function vu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var mE=At.Struct=function(){function r(e){vu(this,r),this._attributes=e||{}}return oE(r,null,[{key:"read",value:function(t){var n=(0,fE.default)(this._fields,function(i){var a=Ot(i,2),o=a[0],s=a[1],f=s.read(t);return[o,f]});return new this((0,hE.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,du.default)(this._fields,function(i){var a=Ot(i,2),o=a[0],s=a[1],f=t._attributes[o];s.write(f,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){_E(s,o);function s(){return vu(this,s),gE(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var s=Ot(o,2),f=s[0],c=s[1];return c instanceof yE.Reference&&(c=c.resolve(t)),[f,c]}),(0,du.default)(a._fields,function(o){var s=Ot(o,1),f=s[0];a.prototype[f]=wE(f)}),a}}]),r}();(0,vE.default)(mE);function wE(r){return function(t){return(0,lE.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var St={};Object.defineProperty(St,"__esModule",{value:!0}),St.Union=void 0;var bE=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")}}(),$E=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),EE=Pe.exports,Tt=xt(EE),AE=Er,gu=xt(AE),OE=Wo,_u=xt(OE),It=Ar,ti=Or,SE=M,TE=xt(SE);function xt(r){return r&&r.__esModule?r:{default:r}}function IE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function xE(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 mu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var PE=St.Union=function(){function r(e,t){mu(this,r),this.set(e,t)}return $E(r,[{key:"set",value:function(t,n){(0,_u.default)(t)&&(t=this.constructor._switchOn.fromName(t)),this._switch=t,this._arm=this.constructor.armForSwitch(this._switch),this._armType=this.constructor.armTypeForArm(this._arm),this._value=n}},{key:"get",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._arm;if(this._arm!==It.Void&&this._arm!==t)throw new Error(t+" not set");return this._value}},{key:"switch",value:function(){return this._switch}},{key:"arm",value:function(){return this._arm}},{key:"armType",value:function(){return this._armType}},{key:"value",value:function(){return this._value}}],[{key:"armForSwitch",value:function(t){if(this._switches.has(t))return this._switches.get(t);if(this._defaultArm)return this._defaultArm;throw new Error("Bad union switch: "+t)}},{key:"armTypeForArm",value:function(t){return t===It.Void?It.Void:this._arms[t]}},{key:"read",value:function(t){var n=this._switchOn.read(t),i=this.armForSwitch(n),a=this.armTypeForArm(i),o=void 0;return(0,gu.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){xE(f,s);function f(){return mu(this,f),IE(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof ti.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,Tt.default)(i.arms,function(s,f){s instanceof ti.Reference&&(s=s.resolve(t)),a._arms[f]=s});var o=i.defaultArm;return o instanceof ti.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Tt.default)(i.switches,function(s){var f=bE(s,2),c=f[0],l=f[1];(0,_u.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,gu.default)(a._switchOn.values)||(0,Tt.default)(a._switchOn.values(),function(s){a[s.name]=function(f){return new a(s,f)},a.prototype[s.name]=function(c){return this.set(s,c)}}),(0,Tt.default)(a._arms,function(s,f){s!==It.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,TE.default)(PE),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=oe;Object.keys(e).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return e[h]}})});var t=pt;Object.keys(t).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return t[h]}})});var n=xe;Object.keys(n).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return n[h]}})});var i=ht;Object.keys(i).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return i[h]}})});var a=yt;Object.keys(a).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return a[h]}})});var o=dt;Object.keys(o).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return o[h]}})});var s=vt;Object.keys(s).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return s[h]}})});var f=wr;Object.keys(f).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return f[h]}})});var c=gt;Object.keys(c).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return c[h]}})});var l=_t;Object.keys(l).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return l[h]}})});var u=mt;Object.keys(u).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return u[h]}})});var p=wt;Object.keys(p).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return p[h]}})});var d=bt;Object.keys(d).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return d[h]}})});var g=$t;Object.keys(g).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return g[h]}})});var b=Ar;Object.keys(b).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return b[h]}})});var E=Et;Object.keys(E).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return E[h]}})});var w=At;Object.keys(w).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return w[h]}})});var S=St;Object.keys(S).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return S[h]}})})}(On);var wu={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(v,_){for(var $=0;$<_.length;$++){var A=_[$];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(v,A.key,A)}}return function(v,_,$){return _&&m(v.prototype,_),$&&m(v,$),v}}(),t=Or;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=g;var n=Er,i=l(n),a=Pe.exports,o=l(a),s=On,f=c(s);function c(m){if(m&&m.__esModule)return m;var v={};if(m!=null)for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(v[_]=m[_]);return v.default=m,v}function l(m){return m&&m.__esModule?m:{default:m}}function u(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function p(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function 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 g(m){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var _=new R(v);m(_),_.resolve()}return v}var b=function(m){d(v,m);function v(_){u(this,v);var $=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return $.name=_,$}return e(v,[{key:"resolve",value:function($){var A=$.definitions[this.name];return A.resolve($)}}]),v}(t.Reference),E=function(m){d(v,m);function v(_,$){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,v);var L=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return L.childReference=_,L.length=$,L.variable=A,L}return e(v,[{key:"resolve",value:function($){var A=this.childReference,L=this.length;return A instanceof t.Reference&&(A=A.resolve($)),L instanceof t.Reference&&(L=L.resolve($)),this.variable?new f.VarArray(A,L):new f.Array(A,L)}}]),v}(t.Reference),w=function(m){d(v,m);function v(_){u(this,v);var $=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return $.childReference=_,$.name=_.name,$}return e(v,[{key:"resolve",value:function($){var A=this.childReference;return A instanceof t.Reference&&(A=A.resolve($)),new f.Option(A)}}]),v}(t.Reference),S=function(m){d(v,m);function v(_,$){u(this,v);var A=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return A.sizedType=_,A.length=$,A}return e(v,[{key:"resolve",value:function($){var A=this.length;return A instanceof t.Reference&&(A=A.resolve($)),new this.sizedType(A)}}]),v}(t.Reference),h=function(){function m(v,_,$){u(this,m),this.constructor=v,this.name=_,this.config=$}return e(m,[{key:"resolve",value:function(_){return this.name in _.results?_.results[this.name]:this.constructor(_,this.name,this.config)}}]),m}();function O(m,v,_){return _ instanceof t.Reference&&(_=_.resolve(m)),m.results[v]=_,_}function x(m,v,_){return m.results[v]=_,_}var R=function(){function m(v){u(this,m),this._destination=v,this._definitions={}}return e(m,[{key:"enum",value:function(_,$){var A=new h(f.Enum.create,_,$);this.define(_,A)}},{key:"struct",value:function(_,$){var A=new h(f.Struct.create,_,$);this.define(_,A)}},{key:"union",value:function(_,$){var A=new h(f.Union.create,_,$);this.define(_,A)}},{key:"typedef",value:function(_,$){var A=new h(O,_,$);this.define(_,A)}},{key:"const",value:function(_,$){var A=new h(x,_,$);this.define(_,A)}},{key:"void",value:function(){return f.Void}},{key:"bool",value:function(){return f.Bool}},{key:"int",value:function(){return f.Int}},{key:"hyper",value:function(){return f.Hyper}},{key:"uint",value:function(){return f.UnsignedInt}},{key:"uhyper",value:function(){return f.UnsignedHyper}},{key:"float",value:function(){return f.Float}},{key:"double",value:function(){return f.Double}},{key:"quadruple",value:function(){return f.Quadruple}},{key:"string",value:function(_){return new S(f.String,_)}},{key:"opaque",value:function(_){return new S(f.Opaque,_)}},{key:"varOpaque",value:function(_){return new S(f.VarOpaque,_)}},{key:"array",value:function(_,$){return new E(_,$)}},{key:"varArray",value:function(_,$){return new E(_,$,!0)}},{key:"option",value:function(_){return new w(_)}},{key:"define",value:function(_,$){if((0,i.default)(this._destination[_]))this._definitions[_]=$;else throw new Error("XDRTypes Error:"+_+" is already defined")}},{key:"lookup",value:function(_){return new b(_)}},{key:"resolve",value:function(){var _=this;(0,o.default)(this._definitions,function($){$.resolve({definitions:_._definitions,results:_._destination})})}}]),m}()})(wu),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=On;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=wu;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(ba);const FE=ba.config(r=>{r.enum("EnvelopeType",{envelopeTypeBundle:0}),r.typedef("Uint32",r.uint()),r.typedef("Uint64",r.uhyper()),r.union("BundleItemExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("BundleItem",[["collectionId",r.lookup("Uint64")],["productId",r.lookup("Uint64")],["variantId",r.lookup("Uint64")],["sku",r.string()],["quantity",r.lookup("Uint32")],["ext",r.lookup("BundleItemExt")]]),r.union("BundleExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("Bundle",[["variantId",r.lookup("Uint64")],["items",r.varArray(r.lookup("BundleItem"),500)],["version",r.lookup("Uint32")],["ext",r.lookup("BundleExt")]]),r.union("BundleEnvelope",{switchOn:r.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeBundle","v1"]],arms:{v1:r.lookup("Bundle")}})}),se=FE;function RE(r){let e={variantId:se.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new se.BundleItem({collectionId:se.Uint64.fromString(n.collectionId.toString()),productId:se.Uint64.fromString(n.productId.toString()),variantId:se.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new se.BundleItemExt(0)})),ext:new se.BundleExt(0)};const t=new se.Bundle(e);return se.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}let ME=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");var DE=Ve,NE=Ge;function BE(r,e){return r&&DE(e,NE(e),r)}var UE=BE,CE=Ve,LE=et;function jE(r,e){return r&&CE(e,LE(e),r)}var kE=jE,ni={exports:{}};(function(r,e){var t=Q,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function f(c,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})(ni,ni.exports);function qE(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var VE=qE,GE=Ve,HE=Ln;function WE(r,e){return GE(r,HE(r),e)}var zE=WE,XE=Wa,YE=XE(Object.getPrototypeOf,Object),ii=YE,KE=Cn,ZE=ii,JE=Ln,QE=ro,eA=Object.getOwnPropertySymbols,rA=eA?function(r){for(var e=[];r;)KE(e,JE(r)),r=ZE(r);return e}:QE,bu=rA,tA=Ve,nA=bu;function iA(r,e){return tA(r,nA(r),e)}var aA=iA,oA=eo,uA=bu,sA=et;function fA(r){return oA(r,sA,uA)}var $u=fA,cA=Object.prototype,lA=cA.hasOwnProperty;function pA(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&lA.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var hA=pA,Eu=Ka;function yA(r){var e=new r.constructor(r.byteLength);return new Eu(e).set(new Eu(r)),e}var ai=yA,dA=ai;function vA(r,e){var t=e?dA(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}var gA=vA,_A=/\w*$/;function mA(r){var e=new r.constructor(r.source,_A.exec(r));return e.lastIndex=r.lastIndex,e}var wA=mA,Au=qe,Ou=Au?Au.prototype:void 0,Su=Ou?Ou.valueOf:void 0;function bA(r){return Su?Object(Su.call(r)):{}}var $A=bA,EA=ai;function AA(r,e){var t=e?EA(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var OA=AA,SA=ai,TA=gA,IA=wA,xA=$A,PA=OA,FA="[object Boolean]",RA="[object Date]",MA="[object Map]",DA="[object Number]",NA="[object RegExp]",BA="[object Set]",UA="[object String]",CA="[object Symbol]",LA="[object ArrayBuffer]",jA="[object DataView]",kA="[object Float32Array]",qA="[object Float64Array]",VA="[object Int8Array]",GA="[object Int16Array]",HA="[object Int32Array]",WA="[object Uint8Array]",zA="[object Uint8ClampedArray]",XA="[object Uint16Array]",YA="[object Uint32Array]";function KA(r,e,t){var n=r.constructor;switch(e){case LA:return SA(r);case FA:case RA:return new n(+r);case jA:return TA(r,t);case kA:case qA:case VA:case GA:case HA:case WA:case zA:case XA:case YA:return PA(r,t);case MA:return new n;case DA:case UA:return new n(r);case NA:return IA(r);case BA:return new n;case CA:return xA(r)}}var ZA=KA,JA=ve,Tu=Object.create,QA=function(){function r(){}return function(e){if(!JA(e))return{};if(Tu)return Tu(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}(),eO=QA,rO=eO,tO=ii,nO=Rn;function iO(r){return typeof r.constructor=="function"&&!nO(r)?rO(tO(r)):{}}var aO=iO,oO=ut,uO=H,sO="[object Map]";function fO(r){return uO(r)&&oO(r)==sO}var cO=fO,lO=cO,pO=Fn,Iu=pr.exports,xu=Iu&&Iu.isMap,hO=xu?pO(xu):lO,yO=hO,dO=ut,vO=H,gO="[object Set]";function _O(r){return vO(r)&&dO(r)==gO}var mO=_O,wO=mO,bO=Fn,Pu=pr.exports,Fu=Pu&&Pu.isSet,$O=Fu?bO(Fu):wO,EO=$O,AO=Bn,OO=Qo,SO=Ma,TO=UE,IO=kE,xO=ni.exports,PO=VE,FO=zE,RO=aA,MO=no,DO=$u,NO=ut,BO=hA,UO=ZA,CO=aO,LO=C,jO=lr.exports,kO=yO,qO=ve,VO=EO,GO=Ge,HO=et,WO=1,zO=2,XO=4,Ru="[object Arguments]",YO="[object Array]",KO="[object Boolean]",ZO="[object Date]",JO="[object Error]",Mu="[object Function]",QO="[object GeneratorFunction]",eS="[object Map]",rS="[object Number]",Du="[object Object]",tS="[object RegExp]",nS="[object Set]",iS="[object String]",aS="[object Symbol]",oS="[object WeakMap]",uS="[object ArrayBuffer]",sS="[object DataView]",fS="[object Float32Array]",cS="[object Float64Array]",lS="[object Int8Array]",pS="[object Int16Array]",hS="[object Int32Array]",yS="[object Uint8Array]",dS="[object Uint8ClampedArray]",vS="[object Uint16Array]",gS="[object Uint32Array]",P={};P[Ru]=P[YO]=P[uS]=P[sS]=P[KO]=P[ZO]=P[fS]=P[cS]=P[lS]=P[pS]=P[hS]=P[eS]=P[rS]=P[Du]=P[tS]=P[nS]=P[iS]=P[aS]=P[yS]=P[dS]=P[vS]=P[gS]=!0,P[JO]=P[Mu]=P[oS]=!1;function Pt(r,e,t,n,i,a){var o,s=e&WO,f=e&zO,c=e&XO;if(t&&(o=i?t(r,n,i,a):t(r)),o!==void 0)return o;if(!qO(r))return r;var l=LO(r);if(l){if(o=BO(r),!s)return PO(r,o)}else{var u=NO(r),p=u==Mu||u==QO;if(jO(r))return xO(r,s);if(u==Du||u==Ru||p&&!i){if(o=f||p?{}:CO(r),!s)return f?RO(r,IO(o,r)):FO(r,TO(o,r))}else{if(!P[u])return i?r:{};o=UO(r,u,s)}}a||(a=new AO);var d=a.get(r);if(d)return d;a.set(r,o),VO(r)?r.forEach(function(E){o.add(Pt(E,e,t,E,r,a))}):kO(r)&&r.forEach(function(E,w){o.set(w,Pt(E,e,t,w,r,a))});var g=c?f?DO:MO:f?HO:GO,b=l?void 0:g(r);return OO(b||r,function(E,w){b&&(w=E,E=r[w]),SO(o,w,Pt(E,e,t,w,r,a))}),o}var _S=Pt;function mS(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var wS=mS;function bS(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 $S=bS,ES=Xn,AS=$S;function OS(r,e){return e.length<2?r:ES(r,AS(e,0,-1))}var SS=OS,TS=lt,IS=wS,xS=SS,PS=hr;function FS(r,e){return e=TS(e,r),r=xS(r,e),r==null||delete r[PS(IS(e))]}var RS=FS,MS=ue,DS=ii,NS=H,BS="[object Object]",US=Function.prototype,CS=Object.prototype,Nu=US.toString,LS=CS.hasOwnProperty,jS=Nu.call(Object);function kS(r){if(!NS(r)||MS(r)!=BS)return!1;var e=DS(r);if(e===null)return!0;var t=LS.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Nu.call(t)==jS}var qS=kS,VS=qS;function GS(r){return VS(r)?void 0:r}var HS=GS,Bu=qe,WS=Pn,zS=C,Uu=Bu?Bu.isConcatSpreadable:void 0;function XS(r){return zS(r)||WS(r)||!!(Uu&&r&&r[Uu])}var YS=XS,KS=Cn,ZS=YS;function Cu(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=ZS),i||(i=[]);++a<o;){var s=r[a];e>0&&t(s)?e>1?Cu(s,e-1,t,n,i):KS(i,s):n||(i[i.length]=s)}return i}var JS=Cu,QS=JS;function eT(r){var e=r==null?0:r.length;return e?QS(r,1):[]}var rT=eT,tT=rT,nT=Na,iT=Ua;function aT(r){return iT(nT(r,void 0,tT),r+"")}var oT=aT,uT=ct,sT=_S,fT=RS,cT=lt,lT=Ve,pT=HS,hT=oT,yT=$u,dT=1,vT=2,gT=4,_T=hT(function(r,e){var t={};if(r==null)return t;var n=!1;e=uT(e,function(a){return a=cT(a,r),n||(n=a.length>1),a}),lT(r,yT(r),t),n&&(t=sT(t,dT|vT|gT,pT));for(var i=e.length;i--;)fT(t,e[i]);return t}),mT=_T,wT=Object.defineProperty,bT=Object.defineProperties,$T=Object.getOwnPropertyDescriptors,Lu=Object.getOwnPropertySymbols,ET=Object.prototype.hasOwnProperty,AT=Object.prototype.propertyIsEnumerable,ju=(r,e,t)=>e in r?wT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,OT=(r,e)=>{for(var t in e||(e={}))ET.call(e,t)&&ju(r,t,e[t]);if(Lu)for(var t of Lu(e))AT.call(e,t)&&ju(r,t,e[t]);return r},ST=(r,e)=>bT(r,$T(e));function TT(r){try{return JSON.parse(r)}catch{return r}}function IT(r){return Object.entries(r).reduce((e,[t,n])=>ST(OT({},e),{[t]:TT(n)}),{})}var xT=Object.defineProperty,PT=Object.defineProperties,FT=Object.getOwnPropertyDescriptors,ku=Object.getOwnPropertySymbols,RT=Object.prototype.hasOwnProperty,MT=Object.prototype.propertyIsEnumerable,qu=(r,e,t)=>e in r?xT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Vu=(r,e)=>{for(var t in e||(e={}))RT.call(e,t)&&qu(r,t,e[t]);if(ku)for(var t of ku(e))MT.call(e,t)&&qu(r,t,e[t]);return r},Gu=(r,e)=>PT(r,FT(e));function Hu(r){var e;const t=IT(r),n=t.auto_inject===void 0?!0:t.auto_inject,i=(e=t.display_on)!=null?e:[],a=t.first_option==="autodeliver";return Gu(Vu({},mT(t,["display_on","first_option"])),{auto_inject:n,valid_pages:i,is_subscription_first:a,autoInject:n,validPages:i,isSubscriptionFirst:a})}function Wu(r){var e;const t=((e=r.subscription_options)==null?void 0:e.storefront_purchase_options)==="subscription_only";return Gu(Vu({},r),{is_subscription_only:t,isSubscriptionOnly:t})}function DT(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=Wu(i)}),t})}const Ft="2020-12",NT={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Tr=new Map;function Rt(r,e){return Tr.has(r)||Tr.set(r,e()),Tr.get(r)}async function oi(r){const{product:e}=await Rt(`product.${r}`,()=>Kr("get",`/product/${Ft}/${r}.json`));return Wu(e)}async function zu(){return await Rt("storeSettings",()=>Kr("get",`/${Ft}/store_settings.json`).catch(()=>NT))}async function Xu(){const{widget_settings:r}=await Rt("widgetSettings",()=>Kr("get",`/${Ft}/widget_settings.json`));return Hu(r)}async function Yu(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await Rt("productsAndSettings",()=>Kr("get",`/product/${Ft}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:DT(r),widget_settings:Hu(e),store_settings:t??{}}}async function BT(){const{products:r}=await Yu();return r}async function UT(r){const[e,t,n]=await Promise.all([oi(r),zu(),Xu()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function Ku(r){const{bundle_product:e}=await oi(r);return e}async function Zu(){return Array.from(Tr.keys()).forEach(r=>Tr.delete(r))}var CT=Object.freeze({__proto__:null,getCDNProduct:oi,getCDNStoreSettings:zu,getCDNWidgetSettings:Xu,getCDNProductsAndSettings:Yu,getCDNProducts:BT,getCDNProductAndSettings:UT,getCDNBundleSettings:Ku,resetCDNCache:Zu});const Ju="/bundling-storefront-manager";function LT(){return Math.ceil(Date.now()/1e3)}async function jT(){try{const{timestamp:r}=await En("get",`${Ju}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),LT()}}async function kT(r){const e=sr();if(!await Qu(r))throw new Error("Bundle is invalid.");const t=await jT(),n=RE({variantId:r.externalVariantId,version:t,items:r.selections.map(i=>({collectionId:i.collectionId,productId:i.externalProductId,variantId:i.externalVariantId,quantity:i.quantity,sku:""}))});try{const i=await En("post",`${Ju}/api/v1/bundles`,{data:{bundle:n},headers:{Origin:`https://${e.storeIdentifier}`}});if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}function qT(r,e){const t=es(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${ME(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 Qu(r){try{const e=await Ku(r.externalProductId);return!!r&&!!e}catch{return console.error("Error fetching bundle settings"),!1}}const VT={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 es(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=VT[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}var GT=Object.freeze({__proto__:null,getBundleId:kT,getDynamicBundleItems:qT,validateBundle:Qu,validateDynamicBundle:es});async function HT(r,e){const{charge:t}=await T("get","/charges",{id:e},r);return t}function WT(r,e){return T("get","/charges",{query:e},r)}async function zT(r,e,t){const{charge:n}=await T("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},r);return n}async function XT(r,e){const{charge:t}=await T("post",`/charges/${e}/remove_discount`,{},r);return t}async function YT(r,e){const{charge:t}=await T("post",`/charges/${e}/skip`,{},r);return t}async function KT(r,e){const{charge:t}=await T("post",`/charges/${e}/unskip`,{},r);return t}async function ZT(r,e){const{charge:t}=await T("post",`/charges/${e}/process`,{},r);return t}var JT=Object.freeze({__proto__:null,getCharge:HT,listCharges:WT,applyDiscountToCharge:zT,removeDiscountsFromCharge:XT,skipCharge:YT,unskipCharge:KT,processCharge:ZT});async function QT(r,e){const{membership:t}=await T("get","/memberships",{id:e},r);return t}function e2(r,e){return T("get","/memberships",{query:e},r)}async function r2(r,e,t){const{membership:n}=await T("post",`/memberships/${e}/cancel`,{data:t},r);return n}async function t2(r,e,t){const{membership:n}=await T("post",`/memberships/${e}/activate`,{data:t},r);return n}var n2=Object.freeze({__proto__:null,getMembership:QT,listMemberships:e2,cancelMembership:r2,activateMembership:t2});async function i2(r,e){const{onetime:t}=await T("get","/onetimes",{id:e},r);return t}function a2(r,e){return T("get","/onetimes",{query:e},r)}async function o2(r,e){const{onetime:t}=await T("post","/onetimes",{data:e},r);return t}async function u2(r,e,t){const{onetime:n}=await T("put","/onetimes",{id:e,data:t},r);return n}function s2(r,e){return T("delete","/onetime",{id:e},r)}var f2=Object.freeze({__proto__:null,getOnetime:i2,listOnetimes:a2,createOnetime:o2,updateOnetime:u2,deleteOnetime:s2});async function c2(r,e){const{order:t}=await T("get","/orders",{id:e},r);return t}function l2(r,e){return T("get","/orders",{query:e},r)}var p2=Object.freeze({__proto__:null,getOrder:c2,listOrders:l2});async function h2(r,e){const{payment_method:t}=await T("get","/payment_methods",{id:e},r);return t}async function y2(r,e,t){const{payment_method:n}=await T("put","/payment_methods",{id:e,data:t},r);return n}function d2(r,e){return T("get","/payment_methods",{query:e},r)}var v2=Object.freeze({__proto__:null,getPaymentMethod:h2,updatePaymentMethod:y2,listPaymentMethods:d2});async function g2(r,e){const{plan:t}=await T("get","/plans",{id:e},r);return t}function _2(r,e){return T("get","/plans",{query:e},r)}var m2=Object.freeze({__proto__:null,getPlan:g2,listPlans:_2});async function w2(r,e){const{subscription:t}=await T("get","/subscriptions",{id:e},r);return t}function b2(r,e){return T("get","/subscriptions",{query:e},r)}async function $2(r,e){const{subscription:t}=await T("post","/subscriptions",{data:e},r);return t}async function E2(r,e,t,n){const{subscription:i}=await T("put","/subscriptions",{id:e,data:t,query:n},r);return i}async function A2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t}},r);return n}async function O2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},r);return n}async function S2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/cancel`,{data:t},r);return n}async function T2(r,e){const{subscription:t}=await T("post",`/subscriptions/${e}/activate`,{},r);return t}async function I2(r,e,t){const{charge:n}=await T("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},r);return n}var x2=Object.freeze({__proto__:null,getSubscription:w2,listSubscriptions:b2,createSubscription:$2,updateSubscription:E2,updateSubscriptionChargeDate:A2,updateSubscriptionAddress:O2,cancelSubscription:S2,activateSubscription:T2,skipSubscriptionCharge:I2});async function P2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await T("get","/customers",{id:t,query:{include:e?.include}},r);return n}async function F2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await T("put","/customers",{id:t,data:e},r);return n}async function R2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await T("get",`/customers/${t}/delivery_schedule`,{query:e},r);return n}var M2=Object.freeze({__proto__:null,getCustomer:P2,updateCustomer:F2,getDeliverySchedule:R2});const D2={get(r,e){return ae("get",r,e)},post(r,e){return ae("post",r,e)},put(r,e){return ae("put",r,e)},delete(r,e){return ae("delete",r,e)}};function N2(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 B2(r={}){const e=r;$l({storeIdentifier:N2(r.storeIdentifier),loginRetryFn:r.loginRetryFn,storefrontAccessToken:r.storefrontAccessToken,environment:e.environment?e.environment:"prod"}),Zu()}const rs={init:B2,api:D2,address:ql,auth:Hl,bundle:GT,charge:JT,cdn:CT,customer:M2,membership:n2,onetime:f2,order:p2,paymentMethod:v2,plan:m2,subscription:x2};try{rs.init()}catch{}return rs});
|
|
28
|
+
*/(function(e,t){typeof Xw=="function"&&!0&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(re,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,g;return p?(u=u>>>0,0<=u&&u<256&&(g=n[u],g)?g:(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&&(g=t[u],g)?g:(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 g;if((g=u.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+u);if(g===0)return e.fromString(u.substring(1),p,d).negate();for(var b=e.fromNumber(Math.pow(d,8)),E=e.ZERO,w=0;w<u.length;w+=8){var S=Math.min(8,u.length-w),h=parseInt(u.substring(w,w+S),d);if(S<8){var O=e.fromNumber(Math.pow(d,S));E=E.multiply(O).add(e.fromNumber(h))}else E=E.multiply(b),E=E.add(e.fromNumber(h))}return E.unsigned=p,E},e.fromValue=function(u){return u instanceof e?u:typeof u=="number"?e.fromNumber(u):typeof u=="string"?e.fromString(u):new e(u.low,u.high,u.unsigned)};var i=1<<16,a=1<<24,o=i*i,s=o*o,f=s/2,c=e.fromInt(a);return e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)},e.prototype.toString=function(u){if(u=u||10,u<2||36<u)throw RangeError("radix out of range: "+u);if(this.isZero())return"0";var p;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var d=e.fromNumber(u),g=this.divide(d);return p=g.multiply(d).subtract(this),g.toString(u)+p.toInt().toString(u)}else return"-"+this.negate().toString(u);var b=e.fromNumber(Math.pow(u,6),this.unsigned);p=this;for(var E="";;){var w=p.divide(b),S=p.subtract(w.multiply(b)).toInt()>>>0,h=S.toString(u);if(p=w,p.isZero())return h+E;for(;h.length<6;)h="0"+h;E=""+h+E}},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(e.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var u=this.high!=0?this.high:this.low,p=31;p>0&&(u&1<<p)==0;p--);return this.high!=0?p+33:p+1},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.equals=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.unsigned!==u.unsigned&&this.high>>>31===1&&u.high>>>31===1?!1:this.high===u.high&&this.low===u.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(u){return!this.equals(u)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(u){return this.compare(u)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(u){return this.compare(u)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(u){return this.compare(u)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(u){return this.compare(u)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compare=function(u){if(e.isLong(u)||(u=e.fromValue(u)),this.equals(u))return 0;var p=this.isNegative(),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,g=this.low>>>16,b=this.low&65535,E=u.high>>>16,w=u.high&65535,S=u.low>>>16,h=u.low&65535,O=0,x=0,R=0,m=0;return m+=b+h,R+=m>>>16,m&=65535,R+=g+S,x+=R>>>16,R&=65535,x+=d+w,O+=x>>>16,x&=65535,O+=p+E,O&=65535,e.fromBits(R<<16|m,O<<16|x,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,g=this.low>>>16,b=this.low&65535,E=u.high>>>16,w=u.high&65535,S=u.low>>>16,h=u.low&65535,O=0,x=0,R=0,m=0;return m+=b*h,R+=m>>>16,m&=65535,R+=g*h,x+=R>>>16,R&=65535,R+=b*S,x+=R>>>16,R&=65535,x+=d*h,O+=x>>>16,x&=65535,x+=g*S,O+=x>>>16,x&=65535,x+=b*w,O+=x>>>16,x&=65535,O+=p*h+d*S+g*w+b*E,O&=65535,e.fromBits(R<<16|m,O<<16|x,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,g;if(this.equals(e.MIN_VALUE)){if(u.equals(e.ONE)||u.equals(e.NEG_ONE))return e.MIN_VALUE;if(u.equals(e.MIN_VALUE))return e.ONE;var b=this.shiftRight(1);return p=b.divide(u).shiftLeft(1),p.equals(e.ZERO)?u.isNegative()?e.ONE:e.NEG_ONE:(d=this.subtract(u.multiply(p)),g=p.add(d.divide(u)),g)}else if(u.equals(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return u.isNegative()?this.negate().divide(u.negate()):this.negate().divide(u).negate();if(u.isNegative())return this.divide(u.negate()).negate();for(g=e.ZERO,d=this;d.greaterThanOrEqual(u);){p=Math.max(1,Math.floor(d.toNumber()/u.toNumber()));for(var E=Math.ceil(Math.log(p)/Math.LN2),w=E<=48?1:Math.pow(2,E-48),S=e.fromNumber(p),h=S.multiply(u);h.isNegative()||h.greaterThan(d);)p-=w,S=e.fromNumber(p,this.unsigned),h=S.multiply(u);S.isZero()&&(S=e.ONE),g=g.add(S),d=d.subtract(h)}return g},e.prototype.div=e.prototype.divide,e.prototype.modulo=function(u){return e.isLong(u)||(u=e.fromValue(u)),this.subtract(this.divide(u).multiply(u))},e.prototype.mod=e.prototype.modulo,e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.and=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low&u.low,this.high&u.high,this.unsigned)},e.prototype.or=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low|u.low,this.high|u.high,this.unsigned)},e.prototype.xor=function(u){return e.isLong(u)||(u=e.fromValue(u)),e.fromBits(this.low^u.low,this.high^u.high,this.unsigned)},e.prototype.shiftLeft=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low<<u,this.high<<u|this.low>>>32-u,this.unsigned):e.fromBits(0,this.low<<u-32,this.unsigned)},e.prototype.shl=e.prototype.shiftLeft,e.prototype.shiftRight=function(u){return e.isLong(u)&&(u=u.toInt()),(u&=63)===0?this:u<32?e.fromBits(this.low>>>u|this.high<<32-u,this.high>>u,this.unsigned):e.fromBits(this.high>>u-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=e.prototype.shiftRight,e.prototype.shiftRightUnsigned=function(u){if(e.isLong(u)&&(u=u.toInt()),u&=63,u===0)return this;var p=this.high;if(u<32){var 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})})(Zn),Object.defineProperty(pt,"__esModule",{value:!0}),pt.Hyper=void 0;var Yw=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}}(),Do=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)}},Kw=Zn.exports,dr=No(Kw),Zw=M,Jw=No(Zw);function No(r){return r&&r.__esModule?r:{default:r}}function Qw(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function eb(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 rb(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 vr=pt.Hyper=function(r){rb(e,r),Yw(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=Do(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=Do(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 Qw(this,e),eb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(dr.default);(0,Jw.default)(vr),vr.MAX_VALUE=new vr(dr.default.MAX_VALUE.low,dr.default.MAX_VALUE.high),vr.MIN_VALUE=new vr(dr.default.MIN_VALUE.low,dr.default.MIN_VALUE.high);var xe={};Object.defineProperty(xe,"__esModule",{value:!0}),xe.UnsignedInt=void 0;var tb=Zr,Bo=Uo(tb),nb=M,ib=Uo(nb);function Uo(r){return r&&r.__esModule?r:{default:r}}var gr=xe.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,Bo.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,Bo.default)(e)||Math.floor(e)!==e?!1:e>=gr.MIN_VALUE&&e<=gr.MAX_VALUE}};gr.MAX_VALUE=Math.pow(2,32)-1,gr.MIN_VALUE=0,(0,ib.default)(gr);var ht={};Object.defineProperty(ht,"__esModule",{value:!0}),ht.UnsignedHyper=void 0;var ab=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}}(),Co=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)}},ob=Zn.exports,_r=Lo(ob),ub=M,sb=Lo(ub);function Lo(r){return r&&r.__esModule?r:{default:r}}function fb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function cb(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 lb(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 mr=ht.UnsignedHyper=function(r){lb(e,r),ab(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=Co(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=Co(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 fb(this,e),cb(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(_r.default);(0,sb.default)(mr),mr.MAX_VALUE=new mr(_r.default.MAX_UNSIGNED_VALUE.low,_r.default.MAX_UNSIGNED_VALUE.high),mr.MIN_VALUE=new mr(_r.default.MIN_VALUE.low,_r.default.MIN_VALUE.high);var yt={};Object.defineProperty(yt,"__esModule",{value:!0}),yt.Float=void 0;var pb=Zr,jo=ko(pb),hb=M,yb=ko(hb);function ko(r){return r&&r.__esModule?r:{default:r}}var db=yt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,jo.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,jo.default)(e)}};(0,yb.default)(db);var dt={};Object.defineProperty(dt,"__esModule",{value:!0}),dt.Double=void 0;var vb=Zr,qo=Vo(vb),gb=M,_b=Vo(gb);function Vo(r){return r&&r.__esModule?r:{default:r}}var mb=dt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,qo.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,qo.default)(e)}};(0,_b.default)(mb);var vt={};Object.defineProperty(vt,"__esModule",{value:!0}),vt.Quadruple=void 0;var wb=M,bb=$b(wb);function $b(r){return r&&r.__esModule?r:{default:r}}var Eb=vt.Quadruple={read:function(){throw new Error("XDR Read Error: quadruple not supported")},write:function(){throw new Error("XDR Write Error: quadruple not supported")},isValid:function(){return!1}};(0,bb.default)(Eb);var wr={},Ab=ue,Ob=H,Sb="[object Boolean]";function Tb(r){return r===!0||r===!1||Ob(r)&&Ab(r)==Sb}var Ib=Tb;Object.defineProperty(wr,"__esModule",{value:!0}),wr.Bool=void 0;var xb=Ib,Pb=Ho(xb),Go=oe,Fb=M,Rb=Ho(Fb);function Ho(r){return r&&r.__esModule?r:{default:r}}var Mb=wr.Bool={read:function(e){var t=Go.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 Go.Int.write(n,t)},isValid:function(e){return(0,Pb.default)(e)}};(0,Rb.default)(Mb);var gt={},Db=ue,Nb=C,Bb=H,Ub="[object String]";function Cb(r){return typeof r=="string"||!Nb(r)&&Bb(r)&&Db(r)==Ub}var Wo=Cb;Object.defineProperty(gt,"__esModule",{value:!0}),gt.String=void 0;var Lb=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}}(),jb=Wo,zo=Jn(jb),kb=C,qb=Jn(kb),Xo=oe,Vb=xe,Yo=Te,Gb=M,Hb=Jn(Gb);function Jn(r){return r&&r.__esModule?r:{default:r}}function Wb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var zb=gt.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Vb.UnsignedInt.MAX_VALUE;Wb(this,r),this._maxLength=e}return Lb(r,[{key:"read",value:function(t){var n=Xo.Int.read(t);if(n>this._maxLength)throw new Error("XDR Read Error: Saw "+n+" length String,"+("max allowed is "+this._maxLength));var i=(0,Yo.calculatePadding)(n),a=t.slice(n);return(0,Yo.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,zo.default)(t)?i=y.from(t,"utf8"):i=y.from(t),Xo.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,zo.default)(t))n=y.from(t,"utf8");else if((0,qb.default)(t)||y.isBuffer(t))n=y.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,Hb.default)(zb.prototype);var _t={};Object.defineProperty(_t,"__esModule",{value:!0}),_t.Opaque=void 0;var Xb=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}}(),Ko=Te,Yb=M,Kb=Zb(Yb);function Zb(r){return r&&r.__esModule?r:{default:r}}function Jb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var Qb=_t.Opaque=function(){function r(e){Jb(this,r),this._length=e,this._padding=(0,Ko.calculatePadding)(e)}return Xb(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Ko.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,Kb.default)(Qb.prototype);var mt={};Object.defineProperty(mt,"__esModule",{value:!0}),mt.VarOpaque=void 0;var e1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Zo=oe,r1=xe,Jo=Te,t1=M,n1=i1(t1);function i1(r){return r&&r.__esModule?r:{default:r}}function a1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var o1=mt.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:r1.UnsignedInt.MAX_VALUE;a1(this,r),this._maxLength=e}return e1(r,[{key:"read",value:function(t){var n=Zo.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,Jo.calculatePadding)(n),a=t.slice(n);return(0,Jo.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));Zo.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return y.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,n1.default)(o1.prototype);var wt={},Pe={exports:{}};function u1(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var Qo=u1,s1=Qr;function f1(r){return typeof r=="function"?r:s1}var eu=f1,c1=Qo,l1=Mn,p1=eu,h1=C;function y1(r,e){var t=h1(r)?c1:l1;return t(r,p1(e))}var d1=y1;(function(r){r.exports=d1})(Pe);var v1=/\s/;function g1(r){for(var e=r.length;e--&&v1.test(r.charAt(e)););return e}var _1=g1,m1=_1,w1=/^\s+/;function b1(r){return r&&r.slice(0,m1(r)+1).replace(w1,"")}var $1=b1,E1=$1,ru=ve,A1=ft,tu=0/0,O1=/^[-+]0x[0-9a-f]+$/i,S1=/^0b[01]+$/i,T1=/^0o[0-7]+$/i,I1=parseInt;function x1(r){if(typeof r=="number")return r;if(A1(r))return tu;if(ru(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=ru(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=E1(r);var t=S1.test(r);return t||T1.test(r)?I1(r.slice(2),t?2:8):O1.test(r)?tu:+r}var P1=x1,F1=P1,nu=1/0,R1=17976931348623157e292;function M1(r){if(!r)return r===0?r:0;if(r=F1(r),r===nu||r===-nu){var e=r<0?-1:1;return e*R1}return r===r?r:0}var D1=M1,N1=D1;function B1(r){var e=N1(r),t=e%1;return e===e?t?e-t:e:0}var U1=B1,C1=La,L1=eu,j1=U1,k1=9007199254740991,Qn=4294967295,q1=Math.min;function V1(r,e){if(r=j1(r),r<1||r>k1)return[];var t=Qn,n=q1(r,Qn);e=L1(e),r-=Qn;for(var i=C1(n,e);++t<r;)e(t);return i}var iu=V1;Object.defineProperty(wt,"__esModule",{value:!0}),wt.Array=void 0;var G1=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}}(),H1=Yn,W1=br(H1),z1=Pe.exports,X1=br(z1),Y1=iu,K1=br(Y1),Z1=C,au=br(Z1),J1=M,Q1=br(J1);function br(r){return r&&r.__esModule?r:{default:r}}function e$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var r$=wt.Array=function(){function r(e,t){e$(this,r),this._childType=e,this._length=t}return G1(r,[{key:"read",value:function(t){var n=this;return(0,K1.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,au.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length!==this._length)throw new Error("XDR Write Error: Got array of size "+t.length+","+("expected "+this._length));(0,X1.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,au.default)(t)||t.length!==this._length?!1:(0,W1.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,Q1.default)(r$.prototype);var bt={};Object.defineProperty(bt,"__esModule",{value:!0}),bt.VarArray=void 0;var t$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),n$=Yn,i$=$r(n$),a$=Pe.exports,o$=$r(a$),u$=iu,s$=$r(u$),f$=C,ou=$r(f$),c$=xe,uu=oe,l$=M,p$=$r(l$);function $r(r){return r&&r.__esModule?r:{default:r}}function h$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var y$=bt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c$.UnsignedInt.MAX_VALUE;h$(this,r),this._childType=e,this._maxLength=t}return t$(r,[{key:"read",value:function(t){var n=this,i=uu.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,s$.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,ou.default)(t))throw new Error("XDR Write Error: value is not array");if(t.length>this._maxLength)throw new Error("XDR Write Error: Got array of size "+t.length+","+("max allowed is "+this._maxLength));uu.Int.write(t.length,n),(0,o$.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,ou.default)(t)||t.length>this._maxLength?!1:(0,i$.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,p$.default)(y$.prototype);var $t={};function d$(r){return r===null}var v$=d$;function g$(r){return r===void 0}var Er=g$;Object.defineProperty($t,"__esModule",{value:!0}),$t.Option=void 0;var _$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),m$=v$,su=ei(m$),w$=Er,fu=ei(w$),cu=wr,b$=M,$$=ei(b$);function ei(r){return r&&r.__esModule?r:{default:r}}function E$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var A$=$t.Option=function(){function r(e){E$(this,r),this._childType=e}return _$(r,[{key:"read",value:function(t){if(cu.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,su.default)(t)||(0,fu.default)(t));cu.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,su.default)(t)||(0,fu.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,$$.default)(A$.prototype);var Ar={};Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.Void=void 0;var O$=Er,lu=pu(O$),S$=M,T$=pu(S$);function pu(r){return r&&r.__esModule?r:{default:r}}var I$=Ar.Void={read:function(){},write:function(e){if(!(0,lu.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,lu.default)(e)}};(0,T$.default)(I$);var Et={},x$=ct;function P$(r,e){return x$(e,function(t){return r[t]})}var F$=P$,R$=F$,M$=Ge;function D$(r){return r==null?[]:R$(r,M$(r))}var N$=D$;Object.defineProperty(Et,"__esModule",{value:!0}),Et.Enum=void 0;var B$=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),U$=Pe.exports,C$=ri(U$),L$=N$,j$=ri(L$),hu=oe,k$=M,q$=ri(k$);function ri(r){return r&&r.__esModule?r:{default:r}}function V$(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 G$(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function yu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var H$=Et.Enum=function(){function r(e,t){yu(this,r),this.name=e,this.value=t}return B$(r,null,[{key:"read",value:function(t){var n=hu.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);hu.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,j$.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){G$(s,o);function s(){return yu(this,s),V$(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,C$.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,q$.default)(H$);var At={},W$=Mn,z$=cr;function X$(r,e){var t=-1,n=z$(r)?Array(r.length):[];return W$(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var Y$=X$,K$=ct,Z$=Io,J$=Y$,Q$=C;function eE(r,e){var t=Q$(r)?K$:J$;return t(r,Z$(e))}var rE=eE;function tE(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 nE=tE,Or={};Object.defineProperty(Or,"__esModule",{value:!0});var iE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}();function aE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Or.Reference=function(){function r(){aE(this,r)}return iE(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(At,"__esModule",{value:!0}),At.Struct=void 0;var Ot=function(){function r(e,t){var n=[],i=!0,a=!1,o=void 0;try{for(var s=e[Symbol.iterator](),f;!(i=(f=s.next()).done)&&(n.push(f.value),!(t&&n.length===t));i=!0);}catch(c){a=!0,o=c}finally{try{!i&&s.return&&s.return()}finally{if(a)throw o}}return n}return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return r(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),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}}(),uE=Pe.exports,du=Sr(uE),sE=rE,fE=Sr(sE),cE=Er,lE=Sr(cE),pE=nE,hE=Sr(pE),yE=Or,dE=M,vE=Sr(dE);function Sr(r){return r&&r.__esModule?r:{default:r}}function gE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function _E(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof e);r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e)}function vu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var mE=At.Struct=function(){function r(e){vu(this,r),this._attributes=e||{}}return oE(r,null,[{key:"read",value:function(t){var n=(0,fE.default)(this._fields,function(i){var a=Ot(i,2),o=a[0],s=a[1],f=s.read(t);return[o,f]});return new this((0,hE.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,du.default)(this._fields,function(i){var a=Ot(i,2),o=a[0],s=a[1],f=t._attributes[o];s.write(f,n)})}},{key:"isValid",value:function(t){return t instanceof this}},{key:"create",value:function(t,n,i){var a=function(o){_E(s,o);function s(){return vu(this,s),gE(this,(s.__proto__||Object.getPrototypeOf(s)).apply(this,arguments))}return s}(r);return a.structName=n,t.results[n]=a,a._fields=i.map(function(o){var s=Ot(o,2),f=s[0],c=s[1];return c instanceof yE.Reference&&(c=c.resolve(t)),[f,c]}),(0,du.default)(a._fields,function(o){var s=Ot(o,1),f=s[0];a.prototype[f]=wE(f)}),a}}]),r}();(0,vE.default)(mE);function wE(r){return function(t){return(0,lE.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var St={};Object.defineProperty(St,"__esModule",{value:!0}),St.Union=void 0;var bE=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")}}(),$E=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),EE=Pe.exports,Tt=xt(EE),AE=Er,gu=xt(AE),OE=Wo,_u=xt(OE),It=Ar,ti=Or,SE=M,TE=xt(SE);function xt(r){return r&&r.__esModule?r:{default:r}}function IE(r,e){if(!r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e&&(typeof e=="object"||typeof e=="function")?e:r}function xE(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 mu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var PE=St.Union=function(){function r(e,t){mu(this,r),this.set(e,t)}return $E(r,[{key:"set",value:function(t,n){(0,_u.default)(t)&&(t=this.constructor._switchOn.fromName(t)),this._switch=t,this._arm=this.constructor.armForSwitch(this._switch),this._armType=this.constructor.armTypeForArm(this._arm),this._value=n}},{key:"get",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._arm;if(this._arm!==It.Void&&this._arm!==t)throw new Error(t+" not set");return this._value}},{key:"switch",value:function(){return this._switch}},{key:"arm",value:function(){return this._arm}},{key:"armType",value:function(){return this._armType}},{key:"value",value:function(){return this._value}}],[{key:"armForSwitch",value:function(t){if(this._switches.has(t))return this._switches.get(t);if(this._defaultArm)return this._defaultArm;throw new Error("Bad union switch: "+t)}},{key:"armTypeForArm",value:function(t){return t===It.Void?It.Void:this._arms[t]}},{key:"read",value:function(t){var n=this._switchOn.read(t),i=this.armForSwitch(n),a=this.armTypeForArm(i),o=void 0;return(0,gu.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){xE(f,s);function f(){return mu(this,f),IE(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof ti.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,Tt.default)(i.arms,function(s,f){s instanceof ti.Reference&&(s=s.resolve(t)),a._arms[f]=s});var o=i.defaultArm;return o instanceof ti.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Tt.default)(i.switches,function(s){var f=bE(s,2),c=f[0],l=f[1];(0,_u.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,gu.default)(a._switchOn.values)||(0,Tt.default)(a._switchOn.values(),function(s){a[s.name]=function(f){return new a(s,f)},a.prototype[s.name]=function(c){return this.set(s,c)}}),(0,Tt.default)(a._arms,function(s,f){s!==It.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,TE.default)(PE),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=oe;Object.keys(e).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return e[h]}})});var t=pt;Object.keys(t).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return t[h]}})});var n=xe;Object.keys(n).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return n[h]}})});var i=ht;Object.keys(i).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return i[h]}})});var a=yt;Object.keys(a).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return a[h]}})});var o=dt;Object.keys(o).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return o[h]}})});var s=vt;Object.keys(s).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return s[h]}})});var f=wr;Object.keys(f).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return f[h]}})});var c=gt;Object.keys(c).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return c[h]}})});var l=_t;Object.keys(l).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return l[h]}})});var u=mt;Object.keys(u).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return u[h]}})});var p=wt;Object.keys(p).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return p[h]}})});var d=bt;Object.keys(d).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return d[h]}})});var g=$t;Object.keys(g).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return g[h]}})});var b=Ar;Object.keys(b).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return b[h]}})});var E=Et;Object.keys(E).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return E[h]}})});var w=At;Object.keys(w).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return w[h]}})});var S=St;Object.keys(S).forEach(function(h){h==="default"||h==="__esModule"||Object.defineProperty(r,h,{enumerable:!0,get:function(){return S[h]}})})}(On);var wu={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(v,_){for(var $=0;$<_.length;$++){var A=_[$];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(v,A.key,A)}}return function(v,_,$){return _&&m(v.prototype,_),$&&m(v,$),v}}(),t=Or;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=g;var n=Er,i=l(n),a=Pe.exports,o=l(a),s=On,f=c(s);function c(m){if(m&&m.__esModule)return m;var v={};if(m!=null)for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(v[_]=m[_]);return v.default=m,v}function l(m){return m&&m.__esModule?m:{default:m}}function u(m,v){if(!(m instanceof v))throw new TypeError("Cannot call a class as a function")}function p(m,v){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:m}function 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 g(m){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var _=new R(v);m(_),_.resolve()}return v}var b=function(m){d(v,m);function v(_){u(this,v);var $=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return $.name=_,$}return e(v,[{key:"resolve",value:function($){var A=$.definitions[this.name];return A.resolve($)}}]),v}(t.Reference),E=function(m){d(v,m);function v(_,$){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,v);var L=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return L.childReference=_,L.length=$,L.variable=A,L}return e(v,[{key:"resolve",value:function($){var A=this.childReference,L=this.length;return A instanceof t.Reference&&(A=A.resolve($)),L instanceof t.Reference&&(L=L.resolve($)),this.variable?new f.VarArray(A,L):new f.Array(A,L)}}]),v}(t.Reference),w=function(m){d(v,m);function v(_){u(this,v);var $=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return $.childReference=_,$.name=_.name,$}return e(v,[{key:"resolve",value:function($){var A=this.childReference;return A instanceof t.Reference&&(A=A.resolve($)),new f.Option(A)}}]),v}(t.Reference),S=function(m){d(v,m);function v(_,$){u(this,v);var A=p(this,(v.__proto__||Object.getPrototypeOf(v)).call(this));return A.sizedType=_,A.length=$,A}return e(v,[{key:"resolve",value:function($){var A=this.length;return A instanceof t.Reference&&(A=A.resolve($)),new this.sizedType(A)}}]),v}(t.Reference),h=function(){function m(v,_,$){u(this,m),this.constructor=v,this.name=_,this.config=$}return e(m,[{key:"resolve",value:function(_){return this.name in _.results?_.results[this.name]:this.constructor(_,this.name,this.config)}}]),m}();function O(m,v,_){return _ instanceof t.Reference&&(_=_.resolve(m)),m.results[v]=_,_}function x(m,v,_){return m.results[v]=_,_}var R=function(){function m(v){u(this,m),this._destination=v,this._definitions={}}return e(m,[{key:"enum",value:function(_,$){var A=new h(f.Enum.create,_,$);this.define(_,A)}},{key:"struct",value:function(_,$){var A=new h(f.Struct.create,_,$);this.define(_,A)}},{key:"union",value:function(_,$){var A=new h(f.Union.create,_,$);this.define(_,A)}},{key:"typedef",value:function(_,$){var A=new h(O,_,$);this.define(_,A)}},{key:"const",value:function(_,$){var A=new h(x,_,$);this.define(_,A)}},{key:"void",value:function(){return f.Void}},{key:"bool",value:function(){return f.Bool}},{key:"int",value:function(){return f.Int}},{key:"hyper",value:function(){return f.Hyper}},{key:"uint",value:function(){return f.UnsignedInt}},{key:"uhyper",value:function(){return f.UnsignedHyper}},{key:"float",value:function(){return f.Float}},{key:"double",value:function(){return f.Double}},{key:"quadruple",value:function(){return f.Quadruple}},{key:"string",value:function(_){return new S(f.String,_)}},{key:"opaque",value:function(_){return new S(f.Opaque,_)}},{key:"varOpaque",value:function(_){return new S(f.VarOpaque,_)}},{key:"array",value:function(_,$){return new E(_,$)}},{key:"varArray",value:function(_,$){return new E(_,$,!0)}},{key:"option",value:function(_){return new w(_)}},{key:"define",value:function(_,$){if((0,i.default)(this._destination[_]))this._definitions[_]=$;else throw new Error("XDRTypes Error:"+_+" is already defined")}},{key:"lookup",value:function(_){return new b(_)}},{key:"resolve",value:function(){var _=this;(0,o.default)(this._definitions,function($){$.resolve({definitions:_._definitions,results:_._destination})})}}]),m}()})(wu),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=On;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=wu;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(ba);const FE=ba.config(r=>{r.enum("EnvelopeType",{envelopeTypeBundle:0}),r.typedef("Uint32",r.uint()),r.typedef("Uint64",r.uhyper()),r.union("BundleItemExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("BundleItem",[["collectionId",r.lookup("Uint64")],["productId",r.lookup("Uint64")],["variantId",r.lookup("Uint64")],["sku",r.string()],["quantity",r.lookup("Uint32")],["ext",r.lookup("BundleItemExt")]]),r.union("BundleExt",{switchOn:r.int(),switchName:"v",switches:[[0,r.void()]],arms:{}}),r.struct("Bundle",[["variantId",r.lookup("Uint64")],["items",r.varArray(r.lookup("BundleItem"),500)],["version",r.lookup("Uint32")],["ext",r.lookup("BundleExt")]]),r.union("BundleEnvelope",{switchOn:r.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeBundle","v1"]],arms:{v1:r.lookup("Bundle")}})}),se=FE;function RE(r){let e={variantId:se.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new se.BundleItem({collectionId:se.Uint64.fromString(n.collectionId.toString()),productId:se.Uint64.fromString(n.productId.toString()),variantId:se.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new se.BundleItemExt(0)})),ext:new se.BundleExt(0)};const t=new se.Bundle(e);return se.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}let ME=(r=21)=>crypto.getRandomValues(new Uint8Array(r)).reduce((e,t)=>(t&=63,t<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");var DE=Ve,NE=Ge;function BE(r,e){return r&&DE(e,NE(e),r)}var UE=BE,CE=Ve,LE=et;function jE(r,e){return r&&CE(e,LE(e),r)}var kE=jE,ni={exports:{}};(function(r,e){var t=Q,n=e&&!e.nodeType&&e,i=n&&!0&&r&&!r.nodeType&&r,a=i&&i.exports===n,o=a?t.Buffer:void 0,s=o?o.allocUnsafe:void 0;function f(c,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})(ni,ni.exports);function qE(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}var VE=qE,GE=Ve,HE=Ln;function WE(r,e){return GE(r,HE(r),e)}var zE=WE,XE=Wa,YE=XE(Object.getPrototypeOf,Object),ii=YE,KE=Cn,ZE=ii,JE=Ln,QE=ro,eA=Object.getOwnPropertySymbols,rA=eA?function(r){for(var e=[];r;)KE(e,JE(r)),r=ZE(r);return e}:QE,bu=rA,tA=Ve,nA=bu;function iA(r,e){return tA(r,nA(r),e)}var aA=iA,oA=eo,uA=bu,sA=et;function fA(r){return oA(r,sA,uA)}var $u=fA,cA=Object.prototype,lA=cA.hasOwnProperty;function pA(r){var e=r.length,t=new r.constructor(e);return e&&typeof r[0]=="string"&&lA.call(r,"index")&&(t.index=r.index,t.input=r.input),t}var hA=pA,Eu=Ka;function yA(r){var e=new r.constructor(r.byteLength);return new Eu(e).set(new Eu(r)),e}var ai=yA,dA=ai;function vA(r,e){var t=e?dA(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}var gA=vA,_A=/\w*$/;function mA(r){var e=new r.constructor(r.source,_A.exec(r));return e.lastIndex=r.lastIndex,e}var wA=mA,Au=qe,Ou=Au?Au.prototype:void 0,Su=Ou?Ou.valueOf:void 0;function bA(r){return Su?Object(Su.call(r)):{}}var $A=bA,EA=ai;function AA(r,e){var t=e?EA(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}var OA=AA,SA=ai,TA=gA,IA=wA,xA=$A,PA=OA,FA="[object Boolean]",RA="[object Date]",MA="[object Map]",DA="[object Number]",NA="[object RegExp]",BA="[object Set]",UA="[object String]",CA="[object Symbol]",LA="[object ArrayBuffer]",jA="[object DataView]",kA="[object Float32Array]",qA="[object Float64Array]",VA="[object Int8Array]",GA="[object Int16Array]",HA="[object Int32Array]",WA="[object Uint8Array]",zA="[object Uint8ClampedArray]",XA="[object Uint16Array]",YA="[object Uint32Array]";function KA(r,e,t){var n=r.constructor;switch(e){case LA:return SA(r);case FA:case RA:return new n(+r);case jA:return TA(r,t);case kA:case qA:case VA:case GA:case HA:case WA:case zA:case XA:case YA:return PA(r,t);case MA:return new n;case DA:case UA:return new n(r);case NA:return IA(r);case BA:return new n;case CA:return xA(r)}}var ZA=KA,JA=ve,Tu=Object.create,QA=function(){function r(){}return function(e){if(!JA(e))return{};if(Tu)return Tu(e);r.prototype=e;var t=new r;return r.prototype=void 0,t}}(),eO=QA,rO=eO,tO=ii,nO=Rn;function iO(r){return typeof r.constructor=="function"&&!nO(r)?rO(tO(r)):{}}var aO=iO,oO=ut,uO=H,sO="[object Map]";function fO(r){return uO(r)&&oO(r)==sO}var cO=fO,lO=cO,pO=Fn,Iu=pr.exports,xu=Iu&&Iu.isMap,hO=xu?pO(xu):lO,yO=hO,dO=ut,vO=H,gO="[object Set]";function _O(r){return vO(r)&&dO(r)==gO}var mO=_O,wO=mO,bO=Fn,Pu=pr.exports,Fu=Pu&&Pu.isSet,$O=Fu?bO(Fu):wO,EO=$O,AO=Bn,OO=Qo,SO=Ma,TO=UE,IO=kE,xO=ni.exports,PO=VE,FO=zE,RO=aA,MO=no,DO=$u,NO=ut,BO=hA,UO=ZA,CO=aO,LO=C,jO=lr.exports,kO=yO,qO=ve,VO=EO,GO=Ge,HO=et,WO=1,zO=2,XO=4,Ru="[object Arguments]",YO="[object Array]",KO="[object Boolean]",ZO="[object Date]",JO="[object Error]",Mu="[object Function]",QO="[object GeneratorFunction]",eS="[object Map]",rS="[object Number]",Du="[object Object]",tS="[object RegExp]",nS="[object Set]",iS="[object String]",aS="[object Symbol]",oS="[object WeakMap]",uS="[object ArrayBuffer]",sS="[object DataView]",fS="[object Float32Array]",cS="[object Float64Array]",lS="[object Int8Array]",pS="[object Int16Array]",hS="[object Int32Array]",yS="[object Uint8Array]",dS="[object Uint8ClampedArray]",vS="[object Uint16Array]",gS="[object Uint32Array]",P={};P[Ru]=P[YO]=P[uS]=P[sS]=P[KO]=P[ZO]=P[fS]=P[cS]=P[lS]=P[pS]=P[hS]=P[eS]=P[rS]=P[Du]=P[tS]=P[nS]=P[iS]=P[aS]=P[yS]=P[dS]=P[vS]=P[gS]=!0,P[JO]=P[Mu]=P[oS]=!1;function Pt(r,e,t,n,i,a){var o,s=e&WO,f=e&zO,c=e&XO;if(t&&(o=i?t(r,n,i,a):t(r)),o!==void 0)return o;if(!qO(r))return r;var l=LO(r);if(l){if(o=BO(r),!s)return PO(r,o)}else{var u=NO(r),p=u==Mu||u==QO;if(jO(r))return xO(r,s);if(u==Du||u==Ru||p&&!i){if(o=f||p?{}:CO(r),!s)return f?RO(r,IO(o,r)):FO(r,TO(o,r))}else{if(!P[u])return i?r:{};o=UO(r,u,s)}}a||(a=new AO);var d=a.get(r);if(d)return d;a.set(r,o),VO(r)?r.forEach(function(E){o.add(Pt(E,e,t,E,r,a))}):kO(r)&&r.forEach(function(E,w){o.set(w,Pt(E,e,t,w,r,a))});var g=c?f?DO:MO:f?HO:GO,b=l?void 0:g(r);return OO(b||r,function(E,w){b&&(w=E,E=r[w]),SO(o,w,Pt(E,e,t,w,r,a))}),o}var _S=Pt;function mS(r){var e=r==null?0:r.length;return e?r[e-1]:void 0}var wS=mS;function bS(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 $S=bS,ES=Xn,AS=$S;function OS(r,e){return e.length<2?r:ES(r,AS(e,0,-1))}var SS=OS,TS=lt,IS=wS,xS=SS,PS=hr;function FS(r,e){return e=TS(e,r),r=xS(r,e),r==null||delete r[PS(IS(e))]}var RS=FS,MS=ue,DS=ii,NS=H,BS="[object Object]",US=Function.prototype,CS=Object.prototype,Nu=US.toString,LS=CS.hasOwnProperty,jS=Nu.call(Object);function kS(r){if(!NS(r)||MS(r)!=BS)return!1;var e=DS(r);if(e===null)return!0;var t=LS.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&Nu.call(t)==jS}var qS=kS,VS=qS;function GS(r){return VS(r)?void 0:r}var HS=GS,Bu=qe,WS=Pn,zS=C,Uu=Bu?Bu.isConcatSpreadable:void 0;function XS(r){return zS(r)||WS(r)||!!(Uu&&r&&r[Uu])}var YS=XS,KS=Cn,ZS=YS;function Cu(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=ZS),i||(i=[]);++a<o;){var s=r[a];e>0&&t(s)?e>1?Cu(s,e-1,t,n,i):KS(i,s):n||(i[i.length]=s)}return i}var JS=Cu,QS=JS;function eT(r){var e=r==null?0:r.length;return e?QS(r,1):[]}var rT=eT,tT=rT,nT=Na,iT=Ua;function aT(r){return iT(nT(r,void 0,tT),r+"")}var oT=aT,uT=ct,sT=_S,fT=RS,cT=lt,lT=Ve,pT=HS,hT=oT,yT=$u,dT=1,vT=2,gT=4,_T=hT(function(r,e){var t={};if(r==null)return t;var n=!1;e=uT(e,function(a){return a=cT(a,r),n||(n=a.length>1),a}),lT(r,yT(r),t),n&&(t=sT(t,dT|vT|gT,pT));for(var i=e.length;i--;)fT(t,e[i]);return t}),mT=_T,wT=Object.defineProperty,bT=Object.defineProperties,$T=Object.getOwnPropertyDescriptors,Lu=Object.getOwnPropertySymbols,ET=Object.prototype.hasOwnProperty,AT=Object.prototype.propertyIsEnumerable,ju=(r,e,t)=>e in r?wT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,OT=(r,e)=>{for(var t in e||(e={}))ET.call(e,t)&&ju(r,t,e[t]);if(Lu)for(var t of Lu(e))AT.call(e,t)&&ju(r,t,e[t]);return r},ST=(r,e)=>bT(r,$T(e));function TT(r){try{return JSON.parse(r)}catch{return r}}function IT(r){return Object.entries(r).reduce((e,[t,n])=>ST(OT({},e),{[t]:TT(n)}),{})}var xT=Object.defineProperty,PT=Object.defineProperties,FT=Object.getOwnPropertyDescriptors,ku=Object.getOwnPropertySymbols,RT=Object.prototype.hasOwnProperty,MT=Object.prototype.propertyIsEnumerable,qu=(r,e,t)=>e in r?xT(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Vu=(r,e)=>{for(var t in e||(e={}))RT.call(e,t)&&qu(r,t,e[t]);if(ku)for(var t of ku(e))MT.call(e,t)&&qu(r,t,e[t]);return r},Gu=(r,e)=>PT(r,FT(e));function Hu(r){var e;const t=IT(r),n=t.auto_inject===void 0?!0:t.auto_inject,i=(e=t.display_on)!=null?e:[],a=t.first_option==="autodeliver";return Gu(Vu({},mT(t,["display_on","first_option"])),{auto_inject:n,valid_pages:i,is_subscription_first:a,autoInject:n,validPages:i,isSubscriptionFirst:a})}function Wu(r){var e;const t=((e=r.subscription_options)==null?void 0:e.storefront_purchase_options)==="subscription_only";return Gu(Vu({},r),{is_subscription_only:t,isSubscriptionOnly:t})}function DT(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=Wu(i)}),t})}const Ft="2020-12",NT={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Tr=new Map;function Rt(r,e){return Tr.has(r)||Tr.set(r,e()),Tr.get(r)}async function oi(r){const{product:e}=await Rt(`product.${r}`,()=>Kr("get",`/product/${Ft}/${r}.json`));return Wu(e)}async function zu(){return await Rt("storeSettings",()=>Kr("get",`/${Ft}/store_settings.json`).catch(()=>NT))}async function Xu(){const{widget_settings:r}=await Rt("widgetSettings",()=>Kr("get",`/${Ft}/widget_settings.json`));return Hu(r)}async function Yu(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await Rt("productsAndSettings",()=>Kr("get",`/product/${Ft}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:DT(r),widget_settings:Hu(e),store_settings:t??{}}}async function BT(){const{products:r}=await Yu();return r}async function UT(r){const[e,t,n]=await Promise.all([oi(r),zu(),Xu()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function Ku(r){const{bundle_product:e}=await oi(r);return e}async function Zu(){return Array.from(Tr.keys()).forEach(r=>Tr.delete(r))}var CT=Object.freeze({__proto__:null,getCDNProduct:oi,getCDNStoreSettings:zu,getCDNWidgetSettings:Xu,getCDNProductsAndSettings:Yu,getCDNProducts:BT,getCDNProductAndSettings:UT,getCDNBundleSettings:Ku,resetCDNCache:Zu});const Ju="/bundling-storefront-manager";function LT(){return Math.ceil(Date.now()/1e3)}async function jT(){try{const{timestamp:r}=await En("get",`${Ju}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return r}catch(r){return console.error(`Fetch failed: ${r}. Using client-side date.`),LT()}}async function kT(r){const e=sr();if(!await Qu(r))throw new Error("Bundle is invalid.");const t=await jT(),n=RE({variantId:r.externalVariantId,version:t,items:r.selections.map(i=>({collectionId:i.collectionId,productId:i.externalProductId,variantId:i.externalVariantId,quantity:i.quantity,sku:""}))});try{const i=await En("post",`${Ju}/api/v1/bundles`,{data:{bundle:n},headers:{Origin:`https://${e.storeIdentifier}`}});if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}function qT(r,e){const t=es(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${ME(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 Qu(r){try{const e=await Ku(r.externalProductId);return!!r&&!!e}catch{return console.error("Error fetching bundle settings"),!1}}const VT={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 es(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=VT[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}var GT=Object.freeze({__proto__:null,getBundleId:kT,getDynamicBundleItems:qT,validateBundle:Qu,validateDynamicBundle:es});async function HT(r,e,t){const{charge:n}=await T("get","/charges",{id:e,query:{include:t?.include}},r);return n}function WT(r,e){return T("get","/charges",{query:e},r)}async function zT(r,e,t){const{charge:n}=await T("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},r);return n}async function XT(r,e){const{charge:t}=await T("post",`/charges/${e}/remove_discount`,{},r);return t}async function YT(r,e){const{charge:t}=await T("post",`/charges/${e}/skip`,{},r);return t}async function KT(r,e){const{charge:t}=await T("post",`/charges/${e}/unskip`,{},r);return t}async function ZT(r,e){const{charge:t}=await T("post",`/charges/${e}/process`,{},r);return t}var JT=Object.freeze({__proto__:null,getCharge:HT,listCharges:WT,applyDiscountToCharge:zT,removeDiscountsFromCharge:XT,skipCharge:YT,unskipCharge:KT,processCharge:ZT});async function QT(r,e){const{membership:t}=await T("get","/memberships",{id:e},r);return t}function e2(r,e){return T("get","/memberships",{query:e},r)}async function r2(r,e,t){const{membership:n}=await T("post",`/memberships/${e}/cancel`,{data:t},r);return n}async function t2(r,e,t){const{membership:n}=await T("post",`/memberships/${e}/activate`,{data:t},r);return n}var n2=Object.freeze({__proto__:null,getMembership:QT,listMemberships:e2,cancelMembership:r2,activateMembership:t2});async function i2(r,e){const{onetime:t}=await T("get","/onetimes",{id:e},r);return t}function a2(r,e){return T("get","/onetimes",{query:e},r)}async function o2(r,e){const{onetime:t}=await T("post","/onetimes",{data:e},r);return t}async function u2(r,e,t){const{onetime:n}=await T("put","/onetimes",{id:e,data:t},r);return n}function s2(r,e){return T("delete","/onetime",{id:e},r)}var f2=Object.freeze({__proto__:null,getOnetime:i2,listOnetimes:a2,createOnetime:o2,updateOnetime:u2,deleteOnetime:s2});async function c2(r,e){const{order:t}=await T("get","/orders",{id:e},r);return t}function l2(r,e){return T("get","/orders",{query:e},r)}var p2=Object.freeze({__proto__:null,getOrder:c2,listOrders:l2});async function h2(r,e,t){const{payment_method:n}=await T("get","/payment_methods",{id:e,query:{include:t?.include}},r);return n}async function y2(r,e,t){const{payment_method:n}=await T("put","/payment_methods",{id:e,data:t},r);return n}function d2(r,e){return T("get","/payment_methods",{query:e},r)}var v2=Object.freeze({__proto__:null,getPaymentMethod:h2,updatePaymentMethod:y2,listPaymentMethods:d2});async function g2(r,e){const{plan:t}=await T("get","/plans",{id:e},r);return t}function _2(r,e){return T("get","/plans",{query:e},r)}var m2=Object.freeze({__proto__:null,getPlan:g2,listPlans:_2});async function w2(r,e,t){const{subscription:n}=await T("get","/subscriptions",{id:e,query:{include:t?.include}},r);return n}function b2(r,e){return T("get","/subscriptions",{query:e},r)}async function $2(r,e){const{subscription:t}=await T("post","/subscriptions",{data:e},r);return t}async function E2(r,e,t,n){const{subscription:i}=await T("put","/subscriptions",{id:e,data:t,query:n},r);return i}async function A2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t}},r);return n}async function O2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},r);return n}async function S2(r,e,t){const{subscription:n}=await T("post",`/subscriptions/${e}/cancel`,{data:t},r);return n}async function T2(r,e){const{subscription:t}=await T("post",`/subscriptions/${e}/activate`,{},r);return t}async function I2(r,e,t){const{charge:n}=await T("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},r);return n}var x2=Object.freeze({__proto__:null,getSubscription:w2,listSubscriptions:b2,createSubscription:$2,updateSubscription:E2,updateSubscriptionChargeDate:A2,updateSubscriptionAddress:O2,cancelSubscription:S2,activateSubscription:T2,skipSubscriptionCharge:I2});async function P2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await T("get","/customers",{id:t,query:{include:e?.include}},r);return n}async function F2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await T("put","/customers",{id:t,data:e},r);return n}async function R2(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await T("get",`/customers/${t}/delivery_schedule`,{query:e},r);return n}var M2=Object.freeze({__proto__:null,getCustomer:P2,updateCustomer:F2,getDeliverySchedule:R2});const D2={get(r,e){return ae("get",r,e)},post(r,e){return ae("post",r,e)},put(r,e){return ae("put",r,e)},delete(r,e){return ae("delete",r,e)}};function N2(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 B2(r={}){const e=r;$l({storeIdentifier:N2(r.storeIdentifier),loginRetryFn:r.loginRetryFn,storefrontAccessToken:r.storefrontAccessToken,environment:e.environment?e.environment:"prod"}),Zu()}const rs={init:B2,api:D2,address:ql,auth:Hl,bundle:GT,charge:JT,cdn:CT,customer:M2,membership:n2,onetime:f2,order:p2,paymentMethod:v2,plan:m2,subscription:x2};try{rs.init()}catch{}return rs});
|