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