@rechargeapps/storefront-client 1.66.0 → 1.67.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -181,7 +181,7 @@ async function rechargeAdminRequest(method, url, { id, query, data, headers } =
181
181
  ...storefrontAccessToken ? { "X-Recharge-Storefront-Access-Token": storefrontAccessToken } : {},
182
182
  ...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
183
183
  ...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {},
184
- "X-Recharge-Sdk-Version": "1.66.0",
184
+ "X-Recharge-Sdk-Version": "1.67.1",
185
185
  ...headers ? headers : {}
186
186
  };
187
187
  return request.request(method, `${rechargeBaseUrl}${url}`, { id, query, data, headers: reqHeaders });
@@ -15,7 +15,7 @@ async function loadFromOnlineStore(id, country_code) {
15
15
  const { appName, appVersion } = options.getOptions();
16
16
  const headers = {
17
17
  "X-Recharge-Sdk-Fn": "loadFromOnlineStore",
18
- "X-Recharge-Sdk-Version": "1.66.0",
18
+ "X-Recharge-Sdk-Version": "1.67.1",
19
19
  ...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
20
20
  ...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {}
21
21
  };
@@ -49,7 +49,7 @@ async function rechargeApiRequest(method, url, { id, query, data, headers } = {}
49
49
  "X-Recharge-Sdk-Fn": session.internalFnCall,
50
50
  ...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
51
51
  ...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {},
52
- "X-Recharge-Sdk-Version": "1.66.0",
52
+ "X-Recharge-Sdk-Version": "1.67.1",
53
53
  "X-Request-Id": session.internalRequestId,
54
54
  ...session.tmp_fn_identifier ? { "X-Recharge-Sdk-Fn-Identifier": session.tmp_fn_identifier } : {},
55
55
  ...headers ? headers : {}
@@ -179,7 +179,7 @@ async function rechargeAdminRequest(method, url, { id, query, data, headers } =
179
179
  ...storefrontAccessToken ? { "X-Recharge-Storefront-Access-Token": storefrontAccessToken } : {},
180
180
  ...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
181
181
  ...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {},
182
- "X-Recharge-Sdk-Version": "1.66.0",
182
+ "X-Recharge-Sdk-Version": "1.67.1",
183
183
  ...headers ? headers : {}
184
184
  };
185
185
  return request(method, `${rechargeBaseUrl}${url}`, { id, query, data, headers: reqHeaders });
@@ -13,7 +13,7 @@ async function loadFromOnlineStore(id, country_code) {
13
13
  const { appName, appVersion } = getOptions();
14
14
  const headers = {
15
15
  "X-Recharge-Sdk-Fn": "loadFromOnlineStore",
16
- "X-Recharge-Sdk-Version": "1.66.0",
16
+ "X-Recharge-Sdk-Version": "1.67.1",
17
17
  ...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
18
18
  ...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {}
19
19
  };
@@ -47,7 +47,7 @@ async function rechargeApiRequest(method, url, { id, query, data, headers } = {}
47
47
  "X-Recharge-Sdk-Fn": session.internalFnCall,
48
48
  ...appName ? { "X-Recharge-Sdk-App-Name": appName } : {},
49
49
  ...appVersion ? { "X-Recharge-Sdk-App-Version": appVersion } : {},
50
- "X-Recharge-Sdk-Version": "1.66.0",
50
+ "X-Recharge-Sdk-Version": "1.67.1",
51
51
  "X-Request-Id": session.internalRequestId,
52
52
  ...session.tmp_fn_identifier ? { "X-Recharge-Sdk-Fn-Identifier": session.tmp_fn_identifier } : {},
53
53
  ...headers ? headers : {}
package/dist/index.d.ts CHANGED
@@ -1107,7 +1107,7 @@ interface SubscriptionsResponse {
1107
1107
  previous_cursor: null | string;
1108
1108
  subscriptions: Subscription[];
1109
1109
  }
1110
- type SubscriptionIncludes = 'address' | 'customer' | 'metafields' | 'bundle_product' | 'bundle_selections' | 'charge_activities';
1110
+ type SubscriptionIncludes = 'address' | 'customer' | 'metafields' | 'bundle_product' | 'bundle_selections' | 'charge_activities' | 'customer_entitlements';
1111
1111
  interface GetSubscriptionOptions {
1112
1112
  include?: SubscriptionIncludes[];
1113
1113
  }
@@ -1435,7 +1435,7 @@ interface Charge {
1435
1435
  /** An object containing the associated external transaction ID. */
1436
1436
  external_transaction_id: ExternalTransactionId;
1437
1437
  /** Specifies whether the Charge is scheduled for a regeneration (if the Subscription related to the charge was updated in the last 5 seconds using commit=false). */
1438
- has_uncommited_changes?: boolean;
1438
+ has_uncommitted_changes?: boolean;
1439
1439
  /** A list of line_item objects, each containing information about a distinct purchase item. */
1440
1440
  line_items: LineItem[];
1441
1441
  /** The date and time when the Charge was merged (if applicable). */
@@ -1,4 +1,4 @@
1
- // recharge-client-1.66.0.min.js | MIT License | © Recharge Inc.
1
+ // recharge-client-1.67.1.min.js | MIT License | © Recharge Inc.
2
2
  (function(U,be){typeof exports=="object"&&typeof module<"u"?module.exports=be():typeof define=="function"&&define.amd?define(be):(U=typeof globalThis<"u"?globalThis:U||self,U.recharge=be())})(this,function(){"use strict";var U=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function be(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function nf(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var q=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof q<"u"&&q,H={searchParams:"URLSearchParams"in q,iterable:"Symbol"in q&&"iterator"in Symbol,blob:"FileReader"in q&&"Blob"in q&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in q,arrayBuffer:"ArrayBuffer"in q};function af(r){return r&&DataView.prototype.isPrototypeOf(r)}if(H.arrayBuffer)var of=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],sf=ArrayBuffer.isView||function(r){return r&&of.indexOf(Object.prototype.toString.call(r))>-1};function pr(r){if(typeof r!="string"&&(r=String(r)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(r)||r==="")throw new TypeError('Invalid character in header field name: "'+r+'"');return r.toLowerCase()}function an(r){return typeof r!="string"&&(r=String(r)),r}function on(r){var e={next:function(){var t=r.shift();return{done:t===void 0,value:t}}};return H.iterable&&(e[Symbol.iterator]=function(){return e}),e}function C(r){this.map={},r instanceof C?r.forEach(function(e,t){this.append(t,e)},this):Array.isArray(r)?r.forEach(function(e){this.append(e[0],e[1])},this):r&&Object.getOwnPropertyNames(r).forEach(function(e){this.append(e,r[e])},this)}C.prototype.append=function(r,e){r=pr(r),e=an(e);var t=this.map[r];this.map[r]=t?t+", "+e:e},C.prototype.delete=function(r){delete this.map[pr(r)]},C.prototype.get=function(r){return r=pr(r),this.has(r)?this.map[r]:null},C.prototype.has=function(r){return this.map.hasOwnProperty(pr(r))},C.prototype.set=function(r,e){this.map[pr(r)]=an(e)},C.prototype.forEach=function(r,e){for(var t in this.map)this.map.hasOwnProperty(t)&&r.call(e,this.map[t],t,this)},C.prototype.keys=function(){var r=[];return this.forEach(function(e,t){r.push(t)}),on(r)},C.prototype.values=function(){var r=[];return this.forEach(function(e){r.push(e)}),on(r)},C.prototype.entries=function(){var r=[];return this.forEach(function(e,t){r.push([t,e])}),on(r)},H.iterable&&(C.prototype[Symbol.iterator]=C.prototype.entries);function sn(r){if(r.bodyUsed)return Promise.reject(new TypeError("Already read"));r.bodyUsed=!0}function ji(r){return new Promise(function(e,t){r.onload=function(){e(r.result)},r.onerror=function(){t(r.error)}})}function uf(r){var e=new FileReader,t=ji(e);return e.readAsArrayBuffer(r),t}function ff(r){var e=new FileReader,t=ji(e);return e.readAsText(r),t}function cf(r){for(var e=new Uint8Array(r),t=new Array(e.length),n=0;n<e.length;n++)t[n]=String.fromCharCode(e[n]);return t.join("")}function Vi(r){if(r.slice)return r.slice(0);var e=new Uint8Array(r.byteLength);return e.set(new Uint8Array(r)),e.buffer}function Gi(){return this.bodyUsed=!1,this._initBody=function(r){this.bodyUsed=this.bodyUsed,this._bodyInit=r,r?typeof r=="string"?this._bodyText=r:H.blob&&Blob.prototype.isPrototypeOf(r)?this._bodyBlob=r:H.formData&&FormData.prototype.isPrototypeOf(r)?this._bodyFormData=r:H.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)?this._bodyText=r.toString():H.arrayBuffer&&H.blob&&af(r)?(this._bodyArrayBuffer=Vi(r.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):H.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(r)||sf(r))?this._bodyArrayBuffer=Vi(r):this._bodyText=r=Object.prototype.toString.call(r):this._bodyText="",this.headers.get("content-type")||(typeof r=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):H.searchParams&&URLSearchParams.prototype.isPrototypeOf(r)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},H.blob&&(this.blob=function(){var r=sn(this);if(r)return r;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var r=sn(this);return r||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(uf)}),this.text=function(){var r=sn(this);if(r)return r;if(this._bodyBlob)return ff(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(cf(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},H.formData&&(this.formData=function(){return this.text().then(pf)}),this.json=function(){return this.text().then(JSON.parse)},this}var lf=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function df(r){var e=r.toUpperCase();return lf.indexOf(e)>-1?e:r}function $e(r,e){if(!(this instanceof $e))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var t=e.body;if(r instanceof $e){if(r.bodyUsed)throw new TypeError("Already read");this.url=r.url,this.credentials=r.credentials,e.headers||(this.headers=new C(r.headers)),this.method=r.method,this.mode=r.mode,this.signal=r.signal,!t&&r._bodyInit!=null&&(t=r._bodyInit,r.bodyUsed=!0)}else this.url=String(r);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new C(e.headers)),this.method=df(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&t)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(t),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}$e.prototype.clone=function(){return new $e(this,{body:this._bodyInit})};function pf(r){var e=new FormData;return r.trim().split("&").forEach(function(t){if(t){var n=t.split("="),i=n.shift().replace(/\+/g," "),a=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(a))}}),e}function hf(r){var e=new C,t=r.replace(/\r?\n[\t ]+/g," ");return t.split("\r").map(function(n){return n.indexOf(`
3
3
  `)===0?n.substr(1,n.length):n}).forEach(function(n){var i=n.split(":"),a=i.shift().trim();if(a){var o=i.join(":").trim();e.append(a,o)}}),e}Gi.call($e.prototype);function K(r,e){if(!(this instanceof K))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new C(e.headers),this.url=e.url||"",this._initBody(r)}Gi.call(K.prototype),K.prototype.clone=function(){return new K(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new C(this.headers),url:this.url})},K.error=function(){var r=new K(null,{status:0,statusText:""});return r.type="error",r};var yf=[301,302,303,307,308];K.redirect=function(r,e){if(yf.indexOf(e)===-1)throw new RangeError("Invalid status code");return new K(null,{status:e,headers:{location:r}})};var Ee=q.DOMException;try{new Ee}catch{Ee=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},Ee.prototype=Object.create(Error.prototype),Ee.prototype.constructor=Ee}function Hi(r,e){return new Promise(function(t,n){var i=new $e(r,e);if(i.signal&&i.signal.aborted)return n(new Ee("Aborted","AbortError"));var a=new XMLHttpRequest;function o(){a.abort()}a.onload=function(){var f={status:a.status,statusText:a.statusText,headers:hf(a.getAllResponseHeaders()||"")};f.url="responseURL"in a?a.responseURL:f.headers.get("X-Request-URL");var c="response"in a?a.response:a.responseText;setTimeout(function(){t(new K(c,f))},0)},a.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},a.onabort=function(){setTimeout(function(){n(new Ee("Aborted","AbortError"))},0)};function s(f){try{return f===""&&q.location.href?q.location.href:f}catch{return f}}a.open(i.method,s(i.url),!0),i.credentials==="include"?a.withCredentials=!0:i.credentials==="omit"&&(a.withCredentials=!1),"responseType"in a&&(H.blob?a.responseType="blob":H.arrayBuffer&&i.headers.get("Content-Type")&&i.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(a.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof C)?Object.getOwnPropertyNames(e.headers).forEach(function(f){a.setRequestHeader(f,an(e.headers[f]))}):i.headers.forEach(function(f,c){a.setRequestHeader(c,f)}),i.signal&&(i.signal.addEventListener("abort",o),a.onreadystatechange=function(){a.readyState===4&&i.signal.removeEventListener("abort",o)}),a.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}Hi.polyfill=!0,q.fetch||(q.fetch=Hi,q.Headers=C,q.Request=$e,q.Response=K),self.fetch.bind(self);let gf="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Wi=(r=21)=>{let e="",t=r;for(;t--;)e+=gf[Math.random()*64|0];return e};var _f=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),n=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==i||o.enumerable!==!0)return!1}return!0},zi=typeof Symbol<"u"&&Symbol,vf=_f,mf=function(){return typeof zi!="function"||typeof Symbol!="function"||typeof zi("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:vf()},Xi={foo:{}},wf=Object,bf=function(){return{__proto__:Xi}.foo===Xi.foo&&!({__proto__:null}instanceof wf)},$f="Function.prototype.bind called on incompatible ",un=Array.prototype.slice,Ef=Object.prototype.toString,Sf="[object Function]",Af=function(e){var t=this;if(typeof t!="function"||Ef.call(t)!==Sf)throw new TypeError($f+t);for(var n=un.call(arguments,1),i,a=function(){if(this instanceof i){var l=t.apply(this,n.concat(un.call(arguments)));return Object(l)===l?l:this}else return t.apply(e,n.concat(un.call(arguments)))},o=Math.max(0,t.length-n.length),s=[],f=0;f<o;f++)s.push("$"+f);if(i=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")(a),t.prototype){var c=function(){};c.prototype=t.prototype,i.prototype=new c,c.prototype=null}return i},Of=Af,fn=Function.prototype.bind||Of,If=fn,xf=If.call(Function.call,Object.prototype.hasOwnProperty),P,Le=SyntaxError,Yi=Function,je=TypeError,cn=function(r){try{return Yi('"use strict"; return ('+r+").constructor;")()}catch{}},Se=Object.getOwnPropertyDescriptor;if(Se)try{Se({},"")}catch{Se=null}var ln=function(){throw new je},Pf=Se?function(){try{return arguments.callee,ln}catch{try{return Se(arguments,"callee").get}catch{return ln}}}():ln,Ve=mf(),Tf=bf(),N=Object.getPrototypeOf||(Tf?function(r){return r.__proto__}:null),Ge={},Rf=typeof Uint8Array>"u"||!N?P:N(Uint8Array),Ae={"%AggregateError%":typeof AggregateError>"u"?P:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?P:ArrayBuffer,"%ArrayIteratorPrototype%":Ve&&N?N([][Symbol.iterator]()):P,"%AsyncFromSyncIteratorPrototype%":P,"%AsyncFunction%":Ge,"%AsyncGenerator%":Ge,"%AsyncGeneratorFunction%":Ge,"%AsyncIteratorPrototype%":Ge,"%Atomics%":typeof Atomics>"u"?P:Atomics,"%BigInt%":typeof BigInt>"u"?P:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?P:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?P:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?P:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?P:Float32Array,"%Float64Array%":typeof Float64Array>"u"?P:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?P:FinalizationRegistry,"%Function%":Yi,"%GeneratorFunction%":Ge,"%Int8Array%":typeof Int8Array>"u"?P:Int8Array,"%Int16Array%":typeof Int16Array>"u"?P:Int16Array,"%Int32Array%":typeof Int32Array>"u"?P:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ve&&N?N(N([][Symbol.iterator]())):P,"%JSON%":typeof JSON=="object"?JSON:P,"%Map%":typeof Map>"u"?P:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ve||!N?P:N(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?P:Promise,"%Proxy%":typeof Proxy>"u"?P:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?P:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?P:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ve||!N?P:N(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?P:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ve&&N?N(""[Symbol.iterator]()):P,"%Symbol%":Ve?Symbol:P,"%SyntaxError%":Le,"%ThrowTypeError%":Pf,"%TypedArray%":Rf,"%TypeError%":je,"%Uint8Array%":typeof Uint8Array>"u"?P:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?P:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?P:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?P:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?P:WeakMap,"%WeakRef%":typeof WeakRef>"u"?P:WeakRef,"%WeakSet%":typeof WeakSet>"u"?P:WeakSet};if(N)try{null.error}catch(r){var Ff=N(N(r));Ae["%Error.prototype%"]=Ff}var Mf=function r(e){var t;if(e==="%AsyncFunction%")t=cn("async function () {}");else if(e==="%GeneratorFunction%")t=cn("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=cn("async function* () {}");else if(e==="%AsyncGenerator%"){var n=r("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=r("%AsyncGenerator%");i&&N&&(t=N(i.prototype))}return Ae[e]=t,t},Ki={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},hr=fn,Xr=xf,Df=hr.call(Function.call,Array.prototype.concat),Cf=hr.call(Function.apply,Array.prototype.splice),Zi=hr.call(Function.call,String.prototype.replace),Yr=hr.call(Function.call,String.prototype.slice),Nf=hr.call(Function.call,RegExp.prototype.exec),Bf=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Uf=/\\(\\)?/g,qf=function(e){var t=Yr(e,0,1),n=Yr(e,-1);if(t==="%"&&n!=="%")throw new Le("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Le("invalid intrinsic syntax, expected opening `%`");var i=[];return Zi(e,Bf,function(a,o,s,f){i[i.length]=s?Zi(f,Uf,"$1"):o||a}),i},kf=function(e,t){var n=e,i;if(Xr(Ki,n)&&(i=Ki[n],n="%"+i[0]+"%"),Xr(Ae,n)){var a=Ae[n];if(a===Ge&&(a=Mf(n)),typeof a>"u"&&!t)throw new je("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:a}}throw new Le("intrinsic "+e+" does not exist!")},dn=function(e,t){if(typeof e!="string"||e.length===0)throw new je("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new je('"allowMissing" argument must be a boolean');if(Nf(/^%?[^%]*%?$/,e)===null)throw new Le("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=qf(e),i=n.length>0?n[0]:"",a=kf("%"+i+"%",t),o=a.name,s=a.value,f=!1,c=a.alias;c&&(i=c[0],Cf(n,Df([0,1],c)));for(var l=1,u=!0;l<n.length;l+=1){var d=n[l],y=Yr(d,0,1),b=Yr(d,-1);if((y==='"'||y==="'"||y==="`"||b==='"'||b==="'"||b==="`")&&y!==b)throw new Le("property names with quotes must have matching quotes");if((d==="constructor"||!u)&&(f=!0),i+="."+d,o="%"+i+"%",Xr(Ae,o))s=Ae[o];else if(s!=null){if(!(d in s)){if(!t)throw new je("base intrinsic for "+e+" exists, but the property is not available.");return}if(Se&&l+1>=n.length){var S=Se(s,d);u=!!S,u&&"get"in S&&!("originalValue"in S.get)?s=S.get:s=s[d]}else u=Xr(s,d),s=s[d];u&&!f&&(Ae[o]=s)}}return s},Ji={exports:{}};(function(r){var e=fn,t=dn,n=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(i,n),o=t("%Object.getOwnPropertyDescriptor%",!0),s=t("%Object.defineProperty%",!0),f=t("%Math.max%");if(s)try{s({},"a",{value:1})}catch{s=null}r.exports=function(u){var d=a(e,i,arguments);if(o&&s){var y=o(d,"length");y.configurable&&s(d,"length",{value:1+f(0,u.length-(arguments.length-1))})}return d};var c=function(){return a(e,n,arguments)};s?s(r.exports,"apply",{value:c}):r.exports.apply=c})(Ji);var Lf=Ji.exports,Qi=dn,ea=Lf,jf=ea(Qi("String.prototype.indexOf")),Vf=function(e,t){var n=Qi(e,!!t);return typeof n=="function"&&jf(e,".prototype.")>-1?ea(n):n},He=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},Z=[],z=[],Gf=typeof Uint8Array<"u"?Uint8Array:Array,pn=!1;function ra(){pn=!0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=r.length;e<t;++e)Z[e]=r[e],z[r.charCodeAt(e)]=e;z["-".charCodeAt(0)]=62,z["_".charCodeAt(0)]=63}function Hf(r){pn||ra();var e,t,n,i,a,o,s=r.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a=r[s-2]==="="?2:r[s-1]==="="?1:0,o=new Gf(s*3/4-a),n=a>0?s-4:s;var f=0;for(e=0,t=0;e<n;e+=4,t+=3)i=z[r.charCodeAt(e)]<<18|z[r.charCodeAt(e+1)]<<12|z[r.charCodeAt(e+2)]<<6|z[r.charCodeAt(e+3)],o[f++]=i>>16&255,o[f++]=i>>8&255,o[f++]=i&255;return a===2?(i=z[r.charCodeAt(e)]<<2|z[r.charCodeAt(e+1)]>>4,o[f++]=i&255):a===1&&(i=z[r.charCodeAt(e)]<<10|z[r.charCodeAt(e+1)]<<4|z[r.charCodeAt(e+2)]>>2,o[f++]=i>>8&255,o[f++]=i&255),o}function Wf(r){return Z[r>>18&63]+Z[r>>12&63]+Z[r>>6&63]+Z[r&63]}function zf(r,e,t){for(var n,i=[],a=e;a<t;a+=3)n=(r[a]<<16)+(r[a+1]<<8)+r[a+2],i.push(Wf(n));return i.join("")}function ta(r){pn||ra();for(var e,t=r.length,n=t%3,i="",a=[],o=16383,s=0,f=t-n;s<f;s+=o)a.push(zf(r,s,s+o>f?f:s+o));return n===1?(e=r[t-1],i+=Z[e>>2],i+=Z[e<<4&63],i+="=="):n===2&&(e=(r[t-2]<<8)+r[t-1],i+=Z[e>>10],i+=Z[e>>4&63],i+=Z[e<<2&63],i+="="),a.push(i),a.join("")}function Kr(r,e,t,n,i){var a,o,s=i*8-n-1,f=(1<<s)-1,c=f>>1,l=-7,u=t?i-1:0,d=t?-1:1,y=r[e+u];for(u+=d,a=y&(1<<-l)-1,y>>=-l,l+=s;l>0;a=a*256+r[e+u],u+=d,l-=8);for(o=a&(1<<-l)-1,a>>=-l,l+=n;l>0;o=o*256+r[e+u],u+=d,l-=8);if(a===0)a=1-c;else{if(a===f)return o?NaN:(y?-1:1)*(1/0);o=o+Math.pow(2,n),a=a-c}return(y?-1:1)*o*Math.pow(2,a-n)}function na(r,e,t,n,i,a){var o,s,f,c=a*8-i-1,l=(1<<c)-1,u=l>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:a-1,b=n?1:-1,S=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=l):(o=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-o))<1&&(o--,f*=2),o+u>=1?e+=d/f:e+=d*Math.pow(2,1-u),e*f>=2&&(o++,f/=2),o+u>=l?(s=0,o=l):o+u>=1?(s=(e*f-1)*Math.pow(2,i),o=o+u):(s=e*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;r[t+y]=s&255,y+=b,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;r[t+y]=o&255,y+=b,o/=256,c-=8);r[t+y-b]|=S*128}var Xf={}.toString,ia=Array.isArray||function(r){return Xf.call(r)=="[object Array]"};/*!
4
4
  * The buffer module from node.js, for the browser.
@@ -17,10 +17,10 @@
17
17
  `)+" "+t[1]:t[0]+e+" "+r.join(", ")+" "+t[1]}function $n(r){return Array.isArray(r)}function ot(r){return typeof r=="boolean"}function yr(r){return r===null}function Oa(r){return r==null}function En(r){return typeof r=="number"}function gr(r){return typeof r=="string"}function Ia(r){return typeof r=="symbol"}function ee(r){return r===void 0}function _r(r){return Pe(r)&&Sn(r)==="[object RegExp]"}function Pe(r){return typeof r=="object"&&r!==null}function st(r){return Pe(r)&&Sn(r)==="[object Date]"}function vr(r){return Pe(r)&&(Sn(r)==="[object Error]"||r instanceof Error)}function mr(r){return typeof r=="function"}function xa(r){return r===null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||typeof r=="symbol"||typeof r>"u"}function Pa(r){return h.isBuffer(r)}function Sn(r){return Object.prototype.toString.call(r)}function An(r){return r<10?"0"+r.toString(10):r.toString(10)}var rl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function tl(){var r=new Date,e=[An(r.getHours()),An(r.getMinutes()),An(r.getSeconds())].join(":");return[r.getDate(),rl[r.getMonth()],e].join(" ")}function Ta(){console.log("%s - %s",tl(),nt.apply(null,arguments))}function On(r,e){if(!e||!Pe(e))return r;for(var t=Object.keys(e),n=t.length;n--;)r[t[n]]=e[t[n]];return r}function Ra(r,e){return Object.prototype.hasOwnProperty.call(r,e)}var Te=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function In(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');if(Te&&r[Te]){var e=r[Te];if(typeof e!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,Te,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var t,n,i=new Promise(function(s,f){t=s,n=f}),a=[],o=0;o<arguments.length;o++)a.push(arguments[o]);a.push(function(s,f){s?n(s):t(f)});try{r.apply(this,a)}catch(s){n(s)}return i}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Te&&Object.defineProperty(e,Te,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,Sa(r))}In.custom=Te;function nl(r,e){if(!r){var t=new Error("Promise was rejected with a falsy value");t.reason=r,r=t}return e(r)}function Fa(r){if(typeof r!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);var i=t.pop();if(typeof i!="function")throw new TypeError("The last argument must be of type Function");var a=this,o=function(){return i.apply(a,arguments)};r.apply(this,t).then(function(s){Xe.nextTick(o.bind(null,null,s))},function(s){Xe.nextTick(nl.bind(null,s,o))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(r)),Object.defineProperties(e,Sa(r)),e}var il={inherits:Ea,_extend:On,log:Ta,isBuffer:Pa,isPrimitive:xa,isFunction:mr,isError:vr,isDate:st,isObject:Pe,isRegExp:_r,isUndefined:ee,isSymbol:Ia,isString:gr,isNumber:En,isNullOrUndefined:Oa,isNull:yr,isBoolean:ot,isArray:$n,inspect:Q,deprecate:vn,format:nt,debuglog:Aa,promisify:In,callbackify:Fa},al=Object.freeze({__proto__:null,_extend:On,callbackify:Fa,debuglog:Aa,default:il,deprecate:vn,format:nt,inherits:Ea,inspect:Q,isArray:$n,isBoolean:ot,isBuffer:Pa,isDate:st,isError:vr,isFunction:mr,isNull:yr,isNullOrUndefined:Oa,isNumber:En,isObject:Pe,isPrimitive:xa,isRegExp:_r,isString:gr,isSymbol:Ia,isUndefined:ee,log:Ta,promisify:In}),ol=nf(al),sl=ol.inspect,xn=typeof Map=="function"&&Map.prototype,Pn=Object.getOwnPropertyDescriptor&&xn?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ut=xn&&Pn&&typeof Pn.get=="function"?Pn.get:null,Ma=xn&&Map.prototype.forEach,Tn=typeof Set=="function"&&Set.prototype,Rn=Object.getOwnPropertyDescriptor&&Tn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ft=Tn&&Rn&&typeof Rn.get=="function"?Rn.get:null,Da=Tn&&Set.prototype.forEach,ul=typeof WeakMap=="function"&&WeakMap.prototype,wr=ul?WeakMap.prototype.has:null,fl=typeof WeakSet=="function"&&WeakSet.prototype,br=fl?WeakSet.prototype.has:null,cl=typeof WeakRef=="function"&&WeakRef.prototype,Ca=cl?WeakRef.prototype.deref:null,ll=Boolean.prototype.valueOf,dl=Object.prototype.toString,pl=Function.prototype.toString,hl=String.prototype.match,Fn=String.prototype.slice,pe=String.prototype.replace,yl=String.prototype.toUpperCase,Na=String.prototype.toLowerCase,Ba=RegExp.prototype.test,Ua=Array.prototype.concat,re=Array.prototype.join,gl=Array.prototype.slice,qa=Math.floor,Mn=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Dn=Object.getOwnPropertySymbols,Cn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Ye=typeof Symbol=="function"&&typeof Symbol.iterator=="object",k=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Ye||"symbol")?Symbol.toStringTag:null,ka=Object.prototype.propertyIsEnumerable,La=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function ja(r,e){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Ba.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var n=r<0?-qa(-r):qa(r);if(n!==r){var i=String(n),a=Fn.call(e,i.length+1);return pe.call(i,t,"$&_")+"."+pe.call(pe.call(a,/([0-9]{3})/g,"$&_"),/_$/,"")}}return pe.call(e,t,"$&_")}var Nn=sl,Va=Nn.custom,Ga=za(Va)?Va:null,_l=function r(e,t,n,i){var a=t||{};if(he(a,"quoteStyle")&&a.quoteStyle!=="single"&&a.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(he(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=he(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(he(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(he(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 Ya(e,a);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return s?ja(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return s?ja(e,c):c}var l=typeof a.depth>"u"?5:a.depth;if(typeof n>"u"&&(n=0),n>=l&&l>0&&typeof e=="object")return Bn(e)?"[Array]":"[Object]";var u=Cl(a,n);if(typeof i>"u")i=[];else if(Xa(i,e)>=0)return"[Circular]";function d(Y,me,dr){if(me&&(i=gl.call(i),i.push(me)),dr){var we={depth:a.depth};return he(a,"quoteStyle")&&(we.quoteStyle=a.quoteStyle),r(Y,we,n+1,i)}return r(Y,a,n+1,i)}if(typeof e=="function"&&!Wa(e)){var y=Ol(e),b=ct(e,d);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(b.length>0?" { "+re.call(b,", ")+" }":"")}if(za(e)){var S=Ye?pe.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Cn.call(e);return typeof e=="object"&&!Ye?$r(S):S}if(Fl(e)){for(var O="<"+Na.call(String(e.nodeName)),$=e.attributes||[],E=0;E<$.length;E++)O+=" "+$[E].name+"="+Ha(vl($[E].value),"double",a);return O+=">",e.childNodes&&e.childNodes.length&&(O+="..."),O+="</"+Na.call(String(e.nodeName))+">",O}if(Bn(e)){if(e.length===0)return"[]";var p=ct(e,d);return u&&!Dl(p)?"["+qn(p,u)+"]":"[ "+re.call(p,", ")+" ]"}if(wl(e)){var I=ct(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!ka.call(e,"cause")?"{ ["+String(e)+"] "+re.call(Ua.call("[cause]: "+d(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+re.call(I,", ")+" }"}if(typeof e=="object"&&o){if(Ga&&typeof e[Ga]=="function"&&Nn)return Nn(e,{depth:l-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(Il(e)){var T=[];return Ma&&Ma.call(e,function(Y,me){T.push(d(me,e,!0)+" => "+d(Y,e))}),Ka("Map",ut.call(e),T,u)}if(Tl(e)){var F=[];return Da&&Da.call(e,function(Y){F.push(d(Y,e))}),Ka("Set",ft.call(e),F,u)}if(xl(e))return Un("WeakMap");if(Rl(e))return Un("WeakSet");if(Pl(e))return Un("WeakRef");if($l(e))return $r(d(Number(e)));if(Sl(e))return $r(d(Mn.call(e)));if(El(e))return $r(ll.call(e));if(bl(e))return $r(d(String(e)));if(!ml(e)&&!Wa(e)){var m=ct(e,d),g=La?La(e)===Object.prototype:e instanceof Object||e.constructor===Object,_=e instanceof Object?"":"null prototype",A=!g&&k&&Object(e)===e&&k in e?Fn.call(ye(e),8,-1):_?"Object":"",x=g||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",M=x+(A||_?"["+re.call(Ua.call([],A||[],_||[]),": ")+"] ":"");return m.length===0?M+"{}":u?M+"{"+qn(m,u)+"}":M+"{ "+re.call(m,", ")+" }"}return String(e)};function Ha(r,e,t){var n=(t.quoteStyle||e)==="double"?'"':"'";return n+r+n}function vl(r){return pe.call(String(r),/"/g,"&quot;")}function Bn(r){return ye(r)==="[object Array]"&&(!k||!(typeof r=="object"&&k in r))}function ml(r){return ye(r)==="[object Date]"&&(!k||!(typeof r=="object"&&k in r))}function Wa(r){return ye(r)==="[object RegExp]"&&(!k||!(typeof r=="object"&&k in r))}function wl(r){return ye(r)==="[object Error]"&&(!k||!(typeof r=="object"&&k in r))}function bl(r){return ye(r)==="[object String]"&&(!k||!(typeof r=="object"&&k in r))}function $l(r){return ye(r)==="[object Number]"&&(!k||!(typeof r=="object"&&k in r))}function El(r){return ye(r)==="[object Boolean]"&&(!k||!(typeof r=="object"&&k in r))}function za(r){if(Ye)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!Cn)return!1;try{return Cn.call(r),!0}catch{}return!1}function Sl(r){if(!r||typeof r!="object"||!Mn)return!1;try{return Mn.call(r),!0}catch{}return!1}var Al=Object.prototype.hasOwnProperty||function(r){return r in this};function he(r,e){return Al.call(r,e)}function ye(r){return dl.call(r)}function Ol(r){if(r.name)return r.name;var e=hl.call(pl.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function Xa(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 Il(r){if(!ut||!r||typeof r!="object")return!1;try{ut.call(r);try{ft.call(r)}catch{return!0}return r instanceof Map}catch{}return!1}function xl(r){if(!wr||!r||typeof r!="object")return!1;try{wr.call(r,wr);try{br.call(r,br)}catch{return!0}return r instanceof WeakMap}catch{}return!1}function Pl(r){if(!Ca||!r||typeof r!="object")return!1;try{return Ca.call(r),!0}catch{}return!1}function Tl(r){if(!ft||!r||typeof r!="object")return!1;try{ft.call(r);try{ut.call(r)}catch{return!0}return r instanceof Set}catch{}return!1}function Rl(r){if(!br||!r||typeof r!="object")return!1;try{br.call(r,br);try{wr.call(r,wr)}catch{return!0}return r instanceof WeakSet}catch{}return!1}function Fl(r){return!r||typeof r!="object"?!1:typeof HTMLElement<"u"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function Ya(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return Ya(Fn.call(r,0,e.maxStringLength),e)+n}var i=pe.call(pe.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Ml);return Ha(i,"single",e)}function Ml(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":"")+yl.call(e.toString(16))}function $r(r){return"Object("+r+")"}function Un(r){return r+" { ? }"}function Ka(r,e,t,n){var i=n?qn(t,n):re.call(t,", ");return r+" ("+e+") {"+i+"}"}function Dl(r){for(var e=0;e<r.length;e++)if(Xa(r[e],`
18
18
  `)>=0)return!1;return!0}function Cl(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=re.call(Array(r.indent+1)," ");else return null;return{base:t,prev:re.call(Array(e+1),t)}}function qn(r,e){if(r.length===0)return"";var t=`
19
19
  `+e.prev+e.base;return t+re.call(r,","+t)+`
20
- `+e.prev}function ct(r,e){var t=Bn(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=he(r,i)?e(r[i],r):""}var a=typeof Dn=="function"?Dn(r):[],o;if(Ye){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var f in r)he(r,f)&&(t&&String(Number(f))===f&&f<r.length||Ye&&o["$"+f]instanceof Symbol||(Ba.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r))));if(typeof Dn=="function")for(var c=0;c<a.length;c++)ka.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var kn=dn,Ke=Vf,Nl=_l,Bl=kn("%TypeError%"),lt=kn("%WeakMap%",!0),dt=kn("%Map%",!0),Ul=Ke("WeakMap.prototype.get",!0),ql=Ke("WeakMap.prototype.set",!0),kl=Ke("WeakMap.prototype.has",!0),Ll=Ke("Map.prototype.get",!0),jl=Ke("Map.prototype.set",!0),Vl=Ke("Map.prototype.has",!0),Ln=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},Gl=function(r,e){var t=Ln(r,e);return t&&t.value},Hl=function(r,e,t){var n=Ln(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},Wl=function(r,e){return!!Ln(r,e)},zl=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new Bl("Side channel does not contain "+Nl(a))},get:function(a){if(lt&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Ul(e,a)}else if(dt){if(t)return Ll(t,a)}else if(n)return Gl(n,a)},has:function(a){if(lt&&a&&(typeof a=="object"||typeof a=="function")){if(e)return kl(e,a)}else if(dt){if(t)return Vl(t,a)}else if(n)return Wl(n,a);return!1},set:function(a,o){lt&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new lt),ql(e,a,o)):dt?(t||(t=new dt),jl(t,a,o)):(n||(n={key:{},next:null}),Hl(n,a,o))}};return i},Xl=String.prototype.replace,Yl=/%20/g,jn={RFC1738:"RFC1738",RFC3986:"RFC3986"},Za={default:jn.RFC3986,formatters:{RFC1738:function(r){return Xl.call(r,Yl,"+")},RFC3986:function(r){return String(r)}},RFC1738:jn.RFC1738,RFC3986:jn.RFC3986},Kl=Za,Vn=Object.prototype.hasOwnProperty,Re=Array.isArray,te=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),Zl=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Re(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},Ja=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},Jl=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Re(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Vn.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 Re(e)&&!Re(t)&&(i=Ja(e,n)),Re(e)&&Re(t)?(t.forEach(function(a,o){if(Vn.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 Vn.call(a,o)?a[o]=r(a[o],s,n):a[o]=s,a},i)},Ql=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},ed=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}},rd=function(e,t,n,i,a){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var s="",f=0;f<o.length;++f){var c=o.charCodeAt(f);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||a===Kl.RFC1738&&(c===40||c===41)){s+=o.charAt(f);continue}if(c<128){s=s+te[c];continue}if(c<2048){s=s+(te[192|c>>6]+te[128|c&63]);continue}if(c<55296||c>=57344){s=s+(te[224|c>>12]+te[128|c>>6&63]+te[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),s+=te[240|c>>18]+te[128|c>>12&63]+te[128|c>>6&63]+te[128|c&63]}return s},td=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i<t.length;++i)for(var a=t[i],o=a.obj[a.prop],s=Object.keys(o),f=0;f<s.length;++f){var c=s[f],l=o[c];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(t.push({obj:o,prop:c}),n.push(l))}return Zl(t),e},nd=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},id=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},ad=function(e,t){return[].concat(e,t)},od=function(e,t){if(Re(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},sd={arrayToObject:Ja,assign:Ql,combine:ad,compact:td,decode:ed,encode:rd,isBuffer:id,isRegExp:nd,maybeMap:od,merge:Jl},Qa=zl,pt=sd,Er=Za,ud=Object.prototype.hasOwnProperty,eo={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},se=Array.isArray,fd=Array.prototype.push,ro=function(r,e){fd.apply(r,se(e)?e:[e])},cd=Date.prototype.toISOString,to=Er.default,L={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:pt.encode,encodeValuesOnly:!1,format:to,formatter:Er.formatters[to],indices:!1,serializeDate:function(e){return cd.call(e)},skipNulls:!1,strictNullHandling:!1},ld=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Gn={},dd=function r(e,t,n,i,a,o,s,f,c,l,u,d,y,b,S,O){for(var $=e,E=O,p=0,I=!1;(E=E.get(Gn))!==void 0&&!I;){var T=E.get(e);if(p+=1,typeof T<"u"){if(T===p)throw new RangeError("Cyclic object value");I=!0}typeof E.get(Gn)>"u"&&(p=0)}if(typeof f=="function"?$=f(t,$):$ instanceof Date?$=u($):n==="comma"&&se($)&&($=pt.maybeMap($,function(we){return we instanceof Date?u(we):we})),$===null){if(a)return s&&!b?s(t,L.encoder,S,"key",d):t;$=""}if(ld($)||pt.isBuffer($)){if(s){var F=b?t:s(t,L.encoder,S,"key",d);return[y(F)+"="+y(s($,L.encoder,S,"value",d))]}return[y(t)+"="+y(String($))]}var m=[];if(typeof $>"u")return m;var g;if(n==="comma"&&se($))b&&s&&($=pt.maybeMap($,s)),g=[{value:$.length>0?$.join(",")||null:void 0}];else if(se(f))g=f;else{var _=Object.keys($);g=c?_.sort(c):_}for(var A=i&&se($)&&$.length===1?t+"[]":t,x=0;x<g.length;++x){var M=g[x],Y=typeof M=="object"&&typeof M.value<"u"?M.value:$[M];if(!(o&&Y===null)){var me=se($)?typeof n=="function"?n(A,M):A:A+(l?"."+M:"["+M+"]");O.set(e,p);var dr=Qa();dr.set(Gn,O),ro(m,r(Y,me,n,i,a,o,n==="comma"&&b&&se($)?null:s,f,c,l,u,d,y,b,S,dr))}}return m},pd=function(e){if(!e)return L;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||L.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=Er.default;if(typeof e.format<"u"){if(!ud.call(Er.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Er.formatters[n],a=L.filter;return(typeof e.filter=="function"||se(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:L.addQueryPrefix,allowDots:typeof e.allowDots>"u"?L.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:L.charsetSentinel,delimiter:typeof e.delimiter>"u"?L.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:L.encode,encoder:typeof e.encoder=="function"?e.encoder:L.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:L.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:L.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:L.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:L.strictNullHandling}},hd=function(r,e){var t=r,n=pd(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):se(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var s;e&&e.arrayFormat in eo?s=e.arrayFormat:e&&"indices"in e?s=e.indices?"indices":"repeat":s="indices";var f=eo[s];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=f==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var l=Qa(),u=0;u<i.length;++u){var d=i[u];n.skipNulls&&t[d]===null||ro(o,dd(t[d],d,f,c,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}var y=o.join(n.delimiter),b=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?b+="utf8=%26%2310003%3B&":b+="utf8=%E2%9C%93&"),y.length>0?b+y:""},yd=be(hd);let no={storeIdentifier:"",environment:"prod"};function gd(r){no=r}function V(){return no}const _d=(r,e="")=>{switch(r){case"prod":return"https://api.rechargeapps.com";case"stage":return"https://api.stage.rechargeapps.com";case"preprod":case"prestage":return`${e}/api`}},vd=(r,e="")=>{switch(r){case"prod":return"https://admin.rechargeapps.com";case"stage":return"https://admin.stage.rechargeapps.com";case"preprod":case"prestage":return e}},md=r=>{switch(r){case"prod":case"preprod":return"https://static.rechargecdn.com";case"stage":case"prestage":return"https://static.stage.rechargecdn.com"}},io="/tools/recurring";class Ze{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}function wd(r){return yd(r,{encode:!1,indices:!1,arrayFormat:"comma"})}function v(r,e){return{...r,internalFnCall:r.internalFnCall??e,internalRequestId:r.internalRequestId??Wi()}}async function ht(r,e,t={}){const n=V();return X(r,`${md(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function w(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:s,environmentUri:f,storeIdentifier:c,loginRetryFn:l,__unstable_twoFactorRetryFn:u,appName:d,appVersion:y}=V();if(!c)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const b=o.apiToken;if(!b)throw new Error("No API token defined on session.");const S=_d(s,f),O={"X-Recharge-Access-Token":b,"X-Recharge-Version":"2021-11","X-Recharge-Sdk-Fn":o.internalFnCall,...d?{"X-Recharge-Sdk-App-Name":d}:{},...y?{"X-Recharge-Sdk-App-Version":y}:{},"X-Recharge-Sdk-Version":"1.66.0","X-Request-Id":o.internalRequestId,...o.tmp_fn_identifier?{"X-Recharge-Sdk-Fn-Identifier":o.tmp_fn_identifier}:{},...a||{}},$={shop_url:c,...n};try{return await X(r,`${S}${e}`,{id:t,query:$,data:i,headers:O})}catch(E){if(l&&E instanceof Ze&&E.status===401)return l().then(p=>{if(p)return X(r,`${S}${e}`,{id:t,query:$,data:i,headers:{...O,"X-Recharge-Access-Token":p.apiToken}});throw E});if(u&&E instanceof Ze&&E.status===423)return u().then(p=>{if(p)return X(r,`${S}${e}`,{id:t,query:$,data:i,headers:{...O,"X-Recharge-Access-Token":p.apiToken}});throw E});throw E}}async function Fe(r,e,t={}){return X(r,`${io}${e}`,t)}async function X(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 d=[u,wd(n)].join("&").replace(/^&/,"");o=`${o}${d?`?${d}`:""}`}let s;i&&r!=="get"&&(s=JSON.stringify(i));const f={Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client",...a||{}},c=await fetch(o,{method:r,headers:f,body:s});let l;try{l=await c.json()}catch{}if(!c.ok)throw c.status===502||c.status===504?new Ze("A gateway error occurred while making the request",c.status):l&&l.error?new Ze(l.error,c.status):l&&l.errors?new Ze(JSON.stringify(l.errors),c.status):new Ze("A connection error occurred while making the request");return l}function bd(r,e){return w("get","/addresses",{query:e},v(r,"listAddresses"))}async function $d(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{address:n}=await w("get","/addresses",{id:e,query:{include:t?.include}},v(r,"getAddress"));return n}async function Ed(r,e){const{address:t}=await w("post","/addresses",{data:{customer_id:r.customerId?Number(r.customerId):void 0,...e}},v(r,"createAddress"));return t}async function Hn(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{address:i}=await w("put","/addresses",{id:e,data:t,query:n},v(r,"updateAddress"));return i}async function Sd(r,e,t,n){return Hn(v(r,"applyDiscountToAddress"),e,{discounts:[{code:t}]},n)}async function Ad(r,e,t){if(e===void 0||e==="")throw new Error("Id is required");return Hn(v(r,"removeDiscountsFromAddress"),e,{discounts:[]},t)}function Od(r,e){if(e===void 0||e==="")throw new Error("ID is required");return w("delete","/addresses",{id:e},v(r,"deleteAddress"))}async function Id(r,e){const{address:t}=await w("post","/addresses/merge",{data:e},v(r,"mergeAddresses"));return t}async function xd(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("post",`/addresses/${e}/charges/skip`,{data:t},v(r,"skipFutureCharge"));return n}var Pd=Object.freeze({__proto__:null,applyDiscountToAddress:Sd,createAddress:Ed,deleteAddress:Od,getAddress:$d,listAddresses:bd,mergeAddresses:Id,removeDiscountsFromAddress:Ad,skipFutureCharge:xd,updateAddress:Hn});async function Td(){const{storefrontAccessToken:r}=V(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await Fe("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id,message:t.message}}async function Rd(r,e){return ao(r,e)}async function ao(r,e){if(!r)throw new Error("Shopify storefront token is required");const{storeIdentifier:t}=V();if(!t)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const{api_token:n,customer_id:i,message:a}=await Sr("post","/shopify_storefront_access",{data:{customer_token:e,storefront_token:r,shop_url:t}});return n?{apiToken:n,customerId:i,message:a}:null}async function Fd(r){const{storeIdentifier:e}=V();if(!e)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const{api_token:t,customer_id:n,message:i}=await Sr("post","/shopify_customer_account_api_access",{data:{customer_token:r,shop_url:e}});return t?{apiToken:t,customerId:n,message:i}:null}async function Md(r,e={}){if(!r)throw new Error("Email is required.");const{storeIdentifier:t}=V();if(!t)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const n=await Sr("post","/attempt_login",{data:{email:r,shop:t,...e}});if(n.errors)throw new Error(n.errors);return n.session_token}async function Dd(r,e={}){if(!r)throw new Error("Email is required.");const{storefrontAccessToken:t}=V(),n={};t&&(n["X-Recharge-Storefront-Access-Token"]=t);const i=await Fe("post","/attempt_login",{data:{email:r,...e},headers:n});if(i.errors)throw new Error(i.errors);return i.session_token}async function Cd(r,e,t){if(!r)throw new Error("Email is required.");if(!e)throw new Error("Session token is required.");if(!t)throw new Error("Code is required.");const{storeIdentifier:n}=V();if(!n)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const i=await Sr("post","/validate_login",{data:{code:t,email:r,session_token:e,shop:n}});if(i.errors)throw new Error(i.errors);return{apiToken:i.api_token,customerId:i.customer_id}}async function Nd(r,e,t){if(!r)throw new Error("Email is required.");if(!e)throw new Error("Session token is required.");if(!t)throw new Error("Code is required.");const{storefrontAccessToken:n}=V(),i={};n&&(i["X-Recharge-Storefront-Access-Token"]=n);const a=await Fe("post","/validate_login",{data:{code:t,email:r,session_token:e},headers:i});if(a.errors)throw new Error(a.errors);return{apiToken:a.api_token,customerId:a.customer_id}}function Bd(){const{customerHash:r}=V(),{pathname:e,search:t}=window.location,n=new URLSearchParams(t).get("token"),i=e.split("/").filter(Boolean),a=i.findIndex(s=>s==="portal"),o=a!==-1?i[a+1]:r;if(!n||!o)throw new Error("Not in context of Recharge Customer Portal or URL did not contain correct params");return{customerHash:o,token:n}}async function Ud(){const{customerHash:r,token:e}=Bd(),{storeIdentifier:t}=V(),n=await Sr("post",`/customers/${r}/access`,{data:{token:e,shop:t}});return{apiToken:n.api_token,customerId:n.customer_id}}async function Sr(r,e,{id:t,query:n,data:i,headers:a}={}){const{environment:o,environmentUri:s,storefrontAccessToken:f,appName:c,appVersion:l}=V(),u=vd(o,s),d={...f?{"X-Recharge-Storefront-Access-Token":f}:{},...c?{"X-Recharge-Sdk-App-Name":c}:{},...l?{"X-Recharge-Sdk-App-Version":l}:{},"X-Recharge-Sdk-Version":"1.66.0",...a||{}};return X(r,`${u}${e}`,{id:t,query:n,data:i,headers:d})}var qd=Object.freeze({__proto__:null,loginCustomerPortal:Ud,loginShopifyApi:Rd,loginShopifyAppProxy:Td,loginWithShopifyCustomerAccount:Fd,loginWithShopifyStorefront:ao,sendPasswordlessCode:Md,sendPasswordlessCodeAppProxy:Dd,validatePasswordlessCode:Cd,validatePasswordlessCodeAppProxy:Nd}),oo={},Wn={},ue={},kd=typeof U=="object"&&U&&U.Object===Object&&U,so=kd,Ld=so,jd=typeof self=="object"&&self&&self.Object===Object&&self,Vd=Ld||jd||Function("return this")(),fe=Vd,Gd=fe,Hd=Gd.Symbol,yt=Hd,uo=yt,fo=Object.prototype,Wd=fo.hasOwnProperty,zd=fo.toString,Ar=uo?uo.toStringTag:void 0;function Xd(r){var e=Wd.call(r,Ar),t=r[Ar];try{r[Ar]=void 0;var n=!0}catch{}var i=zd.call(r);return n&&(e?r[Ar]=t:delete r[Ar]),i}var Yd=Xd,Kd=Object.prototype,Zd=Kd.toString;function Jd(r){return Zd.call(r)}var Qd=Jd,co=yt,ep=Yd,rp=Qd,tp="[object Null]",np="[object Undefined]",lo=co?co.toStringTag:void 0;function ip(r){return r==null?r===void 0?np:tp:lo&&lo in Object(r)?ep(r):rp(r)}var ge=ip;function ap(r){return r!=null&&typeof r=="object"}var _e=ap,op=ge,sp=_e,up="[object Number]";function fp(r){return typeof r=="number"||sp(r)&&op(r)==up}var gt=fp,D={};function cp(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var Je=cp,lp=ge,dp=Je,pp="[object AsyncFunction]",hp="[object Function]",yp="[object GeneratorFunction]",gp="[object Proxy]";function _p(r){if(!dp(r))return!1;var e=lp(r);return e==hp||e==yp||e==pp||e==gp}var zn=_p,vp=fe,mp=vp["__core-js_shared__"],wp=mp,Xn=wp,po=function(){var r=/[^.]+$/.exec(Xn&&Xn.keys&&Xn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function bp(r){return!!po&&po in r}var $p=bp,Ep=Function.prototype,Sp=Ep.toString;function Ap(r){if(r!=null){try{return Sp.call(r)}catch{}try{return r+""}catch{}}return""}var ho=Ap,Op=zn,Ip=$p,xp=Je,Pp=ho,Tp=/[\\^$.*+?()[\]{}|]/g,Rp=/^\[object .+?Constructor\]$/,Fp=Function.prototype,Mp=Object.prototype,Dp=Fp.toString,Cp=Mp.hasOwnProperty,Np=RegExp("^"+Dp.call(Cp).replace(Tp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Bp(r){if(!xp(r)||Ip(r))return!1;var e=Op(r)?Np:Rp;return e.test(Pp(r))}var Up=Bp;function qp(r,e){return r?.[e]}var kp=qp,Lp=Up,jp=kp;function Vp(r,e){var t=jp(r,e);return Lp(t)?t:void 0}var Me=Vp,Gp=Me,Hp=function(){try{var r=Gp(Object,"defineProperty");return r({},"",{}),r}catch{}}(),yo=Hp,go=yo;function Wp(r,e,t){e=="__proto__"&&go?go(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var _o=Wp;function zp(r,e){return r===e||r!==r&&e!==e}var _t=zp,Xp=_o,Yp=_t,Kp=Object.prototype,Zp=Kp.hasOwnProperty;function Jp(r,e,t){var n=r[e];(!(Zp.call(r,e)&&Yp(n,t))||t===void 0&&!(e in r))&&Xp(r,e,t)}var Qp=Jp,eh=Qp,rh=_o;function th(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?rh(t,s,f):eh(t,s,f)}return t}var nh=th;function ih(r){return r}var vt=ih;function ah(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 oh=ah,sh=oh,vo=Math.max;function uh(r,e,t){return e=vo(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=vo(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),sh(r,this,s)}}var fh=uh;function ch(r){return function(){return r}}var lh=ch,dh=lh,mo=yo,ph=vt,hh=mo?function(r,e){return mo(r,"toString",{configurable:!0,enumerable:!1,value:dh(e),writable:!0})}:ph,yh=hh,gh=800,_h=16,vh=Date.now;function mh(r){var e=0,t=0;return function(){var n=vh(),i=_h-(n-t);if(t=n,i>0){if(++e>=gh)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var wh=mh,bh=yh,$h=wh,Eh=$h(bh),Sh=Eh,Ah=vt,Oh=fh,Ih=Sh;function xh(r,e){return Ih(Oh(r,e,Ah),r+"")}var Ph=xh,Th=9007199254740991;function Rh(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Th}var Yn=Rh,Fh=zn,Mh=Yn;function Dh(r){return r!=null&&Mh(r.length)&&!Fh(r)}var Or=Dh,Ch=9007199254740991,Nh=/^(?:0|[1-9]\d*)$/;function Bh(r,e){var t=typeof r;return e=e??Ch,!!e&&(t=="number"||t!="symbol"&&Nh.test(r))&&r>-1&&r%1==0&&r<e}var Kn=Bh,Uh=_t,qh=Or,kh=Kn,Lh=Je;function jh(r,e,t){if(!Lh(t))return!1;var n=typeof e;return(n=="number"?qh(t)&&kh(e,t.length):n=="string"&&e in t)?Uh(t[e],r):!1}var wo=jh,Vh=Ph,Gh=wo;function Hh(r){return Vh(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&&Gh(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 Wh=Hh;function zh(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var bo=zh,Xh=ge,Yh=_e,Kh="[object Arguments]";function Zh(r){return Yh(r)&&Xh(r)==Kh}var Jh=Zh,$o=Jh,Qh=_e,Eo=Object.prototype,ey=Eo.hasOwnProperty,ry=Eo.propertyIsEnumerable,ty=$o(function(){return arguments}())?$o:function(r){return Qh(r)&&ey.call(r,"callee")&&!ry.call(r,"callee")},So=ty,ny=Array.isArray,G=ny,mt={exports:{}};function iy(){return!1}var ay=iy;mt.exports,function(r,e){var t=fe,n=ay,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}(mt,mt.exports);var Ao=mt.exports,oy=ge,sy=Yn,uy=_e,fy="[object Arguments]",cy="[object Array]",ly="[object Boolean]",dy="[object Date]",py="[object Error]",hy="[object Function]",yy="[object Map]",gy="[object Number]",_y="[object Object]",vy="[object RegExp]",my="[object Set]",wy="[object String]",by="[object WeakMap]",$y="[object ArrayBuffer]",Ey="[object DataView]",Sy="[object Float32Array]",Ay="[object Float64Array]",Oy="[object Int8Array]",Iy="[object Int16Array]",xy="[object Int32Array]",Py="[object Uint8Array]",Ty="[object Uint8ClampedArray]",Ry="[object Uint16Array]",Fy="[object Uint32Array]",R={};R[Sy]=R[Ay]=R[Oy]=R[Iy]=R[xy]=R[Py]=R[Ty]=R[Ry]=R[Fy]=!0,R[fy]=R[cy]=R[$y]=R[ly]=R[Ey]=R[dy]=R[py]=R[hy]=R[yy]=R[gy]=R[_y]=R[vy]=R[my]=R[wy]=R[by]=!1;function My(r){return uy(r)&&sy(r.length)&&!!R[oy(r)]}var Dy=My;function Cy(r){return function(e){return r(e)}}var Ny=Cy,wt={exports:{}};wt.exports,function(r,e){var t=so,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}(wt,wt.exports);var By=wt.exports,Uy=Dy,qy=Ny,Oo=By,Io=Oo&&Oo.isTypedArray,ky=Io?qy(Io):Uy,xo=ky,Ly=bo,jy=So,Vy=G,Gy=Ao,Hy=Kn,Wy=xo,zy=Object.prototype,Xy=zy.hasOwnProperty;function Yy(r,e){var t=Vy(r),n=!t&&jy(r),i=!t&&!n&&Gy(r),a=!t&&!n&&!i&&Wy(r),o=t||n||i||a,s=o?Ly(r.length,String):[],f=s.length;for(var c in r)(e||Xy.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Hy(c,f)))&&s.push(c);return s}var Po=Yy,Ky=Object.prototype;function Zy(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Ky;return r===t}var To=Zy;function Jy(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var Qy=Jy,eg=Je,rg=To,tg=Qy,ng=Object.prototype,ig=ng.hasOwnProperty;function ag(r){if(!eg(r))return tg(r);var e=rg(r),t=[];for(var n in r)n=="constructor"&&(e||!ig.call(r,n))||t.push(n);return t}var og=ag,sg=Po,ug=og,fg=Or;function cg(r){return fg(r)?sg(r,!0):ug(r)}var lg=cg,dg=nh,pg=Wh,hg=lg,yg=pg(function(r,e){dg(e,hg(e),r)}),gg=yg,_g=gg,bt={},De={};function vg(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 mg=vg;function wg(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 bg=wg,$g=bg,Eg=$g(),Sg=Eg;function Ag(r,e){return function(t){return r(e(t))}}var Og=Ag,Ig=Og,xg=Ig(Object.keys,Object),Pg=xg,Tg=To,Rg=Pg,Fg=Object.prototype,Mg=Fg.hasOwnProperty;function Dg(r){if(!Tg(r))return Rg(r);var e=[];for(var t in Object(r))Mg.call(r,t)&&t!="constructor"&&e.push(t);return e}var Cg=Dg,Ng=Po,Bg=Cg,Ug=Or;function qg(r){return Ug(r)?Ng(r):Bg(r)}var $t=qg,kg=Sg,Lg=$t;function jg(r,e){return r&&kg(r,e,Lg)}var Vg=jg,Gg=Or;function Hg(r,e){return function(t,n){if(t==null)return t;if(!Gg(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 Wg=Hg,zg=Vg,Xg=Wg,Yg=Xg(zg),Zn=Yg,Kg=Zn;function Zg(r,e){var t=!0;return Kg(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var Jg=Zg;function Qg(){this.__data__=[],this.size=0}var e_=Qg,r_=_t;function t_(r,e){for(var t=r.length;t--;)if(r_(r[t][0],e))return t;return-1}var Et=t_,n_=Et,i_=Array.prototype,a_=i_.splice;function o_(r){var e=this.__data__,t=n_(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():a_.call(e,t,1),--this.size,!0}var s_=o_,u_=Et;function f_(r){var e=this.__data__,t=u_(e,r);return t<0?void 0:e[t][1]}var c_=f_,l_=Et;function d_(r){return l_(this.__data__,r)>-1}var p_=d_,h_=Et;function y_(r,e){var t=this.__data__,n=h_(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var g_=y_,__=e_,v_=s_,m_=c_,w_=p_,b_=g_;function Qe(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}Qe.prototype.clear=__,Qe.prototype.delete=v_,Qe.prototype.get=m_,Qe.prototype.has=w_,Qe.prototype.set=b_;var St=Qe,$_=St;function E_(){this.__data__=new $_,this.size=0}var S_=E_;function A_(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var O_=A_;function I_(r){return this.__data__.get(r)}var x_=I_;function P_(r){return this.__data__.has(r)}var T_=P_,R_=Me,F_=fe,M_=R_(F_,"Map"),Jn=M_,D_=Me,C_=D_(Object,"create"),At=C_,Ro=At;function N_(){this.__data__=Ro?Ro(null):{},this.size=0}var B_=N_;function U_(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var q_=U_,k_=At,L_="__lodash_hash_undefined__",j_=Object.prototype,V_=j_.hasOwnProperty;function G_(r){var e=this.__data__;if(k_){var t=e[r];return t===L_?void 0:t}return V_.call(e,r)?e[r]:void 0}var H_=G_,W_=At,z_=Object.prototype,X_=z_.hasOwnProperty;function Y_(r){var e=this.__data__;return W_?e[r]!==void 0:X_.call(e,r)}var K_=Y_,Z_=At,J_="__lodash_hash_undefined__";function Q_(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Z_&&e===void 0?J_:e,this}var ev=Q_,rv=B_,tv=q_,nv=H_,iv=K_,av=ev;function er(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])}}er.prototype.clear=rv,er.prototype.delete=tv,er.prototype.get=nv,er.prototype.has=iv,er.prototype.set=av;var ov=er,Fo=ov,sv=St,uv=Jn;function fv(){this.size=0,this.__data__={hash:new Fo,map:new(uv||sv),string:new Fo}}var cv=fv;function lv(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var dv=lv,pv=dv;function hv(r,e){var t=r.__data__;return pv(e)?t[typeof e=="string"?"string":"hash"]:t.map}var Ot=hv,yv=Ot;function gv(r){var e=yv(this,r).delete(r);return this.size-=e?1:0,e}var _v=gv,vv=Ot;function mv(r){return vv(this,r).get(r)}var wv=mv,bv=Ot;function $v(r){return bv(this,r).has(r)}var Ev=$v,Sv=Ot;function Av(r,e){var t=Sv(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var Ov=Av,Iv=cv,xv=_v,Pv=wv,Tv=Ev,Rv=Ov;function rr(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])}}rr.prototype.clear=Iv,rr.prototype.delete=xv,rr.prototype.get=Pv,rr.prototype.has=Tv,rr.prototype.set=Rv;var Qn=rr,Fv=St,Mv=Jn,Dv=Qn,Cv=200;function Nv(r,e){var t=this.__data__;if(t instanceof Fv){var n=t.__data__;if(!Mv||n.length<Cv-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Dv(n)}return t.set(r,e),this.size=t.size,this}var Bv=Nv,Uv=St,qv=S_,kv=O_,Lv=x_,jv=T_,Vv=Bv;function tr(r){var e=this.__data__=new Uv(r);this.size=e.size}tr.prototype.clear=qv,tr.prototype.delete=kv,tr.prototype.get=Lv,tr.prototype.has=jv,tr.prototype.set=Vv;var Mo=tr,Gv="__lodash_hash_undefined__";function Hv(r){return this.__data__.set(r,Gv),this}var Wv=Hv;function zv(r){return this.__data__.has(r)}var Xv=zv,Yv=Qn,Kv=Wv,Zv=Xv;function It(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new Yv;++e<t;)this.add(r[e])}It.prototype.add=It.prototype.push=Kv,It.prototype.has=Zv;var Jv=It;function Qv(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 em=Qv;function rm(r,e){return r.has(e)}var tm=rm,nm=Jv,im=em,am=tm,om=1,sm=2;function um(r,e,t,n,i,a){var o=t&om,s=r.length,f=e.length;if(s!=f&&!(o&&f>s))return!1;var c=a.get(r),l=a.get(e);if(c&&l)return c==e&&l==r;var u=-1,d=!0,y=t&sm?new nm:void 0;for(a.set(r,e),a.set(e,r);++u<s;){var b=r[u],S=e[u];if(n)var O=o?n(S,b,u,e,r,a):n(b,S,u,r,e,a);if(O!==void 0){if(O)continue;d=!1;break}if(y){if(!im(e,function($,E){if(!am(y,E)&&(b===$||i(b,$,t,n,a)))return y.push(E)})){d=!1;break}}else if(!(b===S||i(b,S,t,n,a))){d=!1;break}}return a.delete(r),a.delete(e),d}var Do=um,fm=fe,cm=fm.Uint8Array,lm=cm;function dm(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var pm=dm;function hm(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var ym=hm,Co=yt,No=lm,gm=_t,_m=Do,vm=pm,mm=ym,wm=1,bm=2,$m="[object Boolean]",Em="[object Date]",Sm="[object Error]",Am="[object Map]",Om="[object Number]",Im="[object RegExp]",xm="[object Set]",Pm="[object String]",Tm="[object Symbol]",Rm="[object ArrayBuffer]",Fm="[object DataView]",Bo=Co?Co.prototype:void 0,ei=Bo?Bo.valueOf:void 0;function Mm(r,e,t,n,i,a,o){switch(t){case Fm:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case Rm:return!(r.byteLength!=e.byteLength||!a(new No(r),new No(e)));case $m:case Em:case Om:return gm(+r,+e);case Sm:return r.name==e.name&&r.message==e.message;case Im:case Pm:return r==e+"";case Am:var s=vm;case xm:var f=n&wm;if(s||(s=mm),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=bm,o.set(r,e);var l=_m(s(r),s(e),n,i,a,o);return o.delete(r),l;case Tm:if(ei)return ei.call(r)==ei.call(e)}return!1}var Dm=Mm;function Cm(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Nm=Cm,Bm=Nm,Um=G;function qm(r,e,t){var n=e(r);return Um(r)?n:Bm(n,t(r))}var km=qm;function Lm(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 jm=Lm;function Vm(){return[]}var Gm=Vm,Hm=jm,Wm=Gm,zm=Object.prototype,Xm=zm.propertyIsEnumerable,Uo=Object.getOwnPropertySymbols,Ym=Uo?function(r){return r==null?[]:(r=Object(r),Hm(Uo(r),function(e){return Xm.call(r,e)}))}:Wm,Km=Ym,Zm=km,Jm=Km,Qm=$t;function ew(r){return Zm(r,Qm,Jm)}var rw=ew,qo=rw,tw=1,nw=Object.prototype,iw=nw.hasOwnProperty;function aw(r,e,t,n,i,a){var o=t&tw,s=qo(r),f=s.length,c=qo(e),l=c.length;if(f!=l&&!o)return!1;for(var u=f;u--;){var d=s[u];if(!(o?d in e:iw.call(e,d)))return!1}var y=a.get(r),b=a.get(e);if(y&&b)return y==e&&b==r;var S=!0;a.set(r,e),a.set(e,r);for(var O=o;++u<f;){d=s[u];var $=r[d],E=e[d];if(n)var p=o?n(E,$,d,e,r,a):n($,E,d,r,e,a);if(!(p===void 0?$===E||i($,E,t,n,a):p)){S=!1;break}O||(O=d=="constructor")}if(S&&!O){var I=r.constructor,T=e.constructor;I!=T&&"constructor"in r&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof T=="function"&&T instanceof T)&&(S=!1)}return a.delete(r),a.delete(e),S}var ow=aw,sw=Me,uw=fe,fw=sw(uw,"DataView"),cw=fw,lw=Me,dw=fe,pw=lw(dw,"Promise"),hw=pw,yw=Me,gw=fe,_w=yw(gw,"Set"),vw=_w,mw=Me,ww=fe,bw=mw(ww,"WeakMap"),$w=bw,ri=cw,ti=Jn,ni=hw,ii=vw,ai=$w,ko=ge,nr=ho,Lo="[object Map]",Ew="[object Object]",jo="[object Promise]",Vo="[object Set]",Go="[object WeakMap]",Ho="[object DataView]",Sw=nr(ri),Aw=nr(ti),Ow=nr(ni),Iw=nr(ii),xw=nr(ai),Ce=ko;(ri&&Ce(new ri(new ArrayBuffer(1)))!=Ho||ti&&Ce(new ti)!=Lo||ni&&Ce(ni.resolve())!=jo||ii&&Ce(new ii)!=Vo||ai&&Ce(new ai)!=Go)&&(Ce=function(r){var e=ko(r),t=e==Ew?r.constructor:void 0,n=t?nr(t):"";if(n)switch(n){case Sw:return Ho;case Aw:return Lo;case Ow:return jo;case Iw:return Vo;case xw:return Go}return e});var Pw=Ce,oi=Mo,Tw=Do,Rw=Dm,Fw=ow,Wo=Pw,zo=G,Xo=Ao,Mw=xo,Dw=1,Yo="[object Arguments]",Ko="[object Array]",xt="[object Object]",Cw=Object.prototype,Zo=Cw.hasOwnProperty;function Nw(r,e,t,n,i,a){var o=zo(r),s=zo(e),f=o?Ko:Wo(r),c=s?Ko:Wo(e);f=f==Yo?xt:f,c=c==Yo?xt:c;var l=f==xt,u=c==xt,d=f==c;if(d&&Xo(r)){if(!Xo(e))return!1;o=!0,l=!1}if(d&&!l)return a||(a=new oi),o||Mw(r)?Tw(r,e,t,n,i,a):Rw(r,e,f,t,n,i,a);if(!(t&Dw)){var y=l&&Zo.call(r,"__wrapped__"),b=u&&Zo.call(e,"__wrapped__");if(y||b){var S=y?r.value():r,O=b?e.value():e;return a||(a=new oi),i(S,O,t,n,a)}}return d?(a||(a=new oi),Fw(r,e,t,n,i,a)):!1}var Bw=Nw,Uw=Bw,Jo=_e;function Qo(r,e,t,n,i){return r===e?!0:r==null||e==null||!Jo(r)&&!Jo(e)?r!==r&&e!==e:Uw(r,e,t,n,Qo,i)}var es=Qo,qw=Mo,kw=es,Lw=1,jw=2;function Vw(r,e,t,n){var i=t.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var s=t[i];if(o&&s[2]?s[1]!==r[s[0]]:!(s[0]in r))return!1}for(;++i<a;){s=t[i];var f=s[0],c=r[f],l=s[1];if(o&&s[2]){if(c===void 0&&!(f in r))return!1}else{var u=new qw;if(n)var d=n(c,l,f,r,e,u);if(!(d===void 0?kw(l,c,Lw|jw,n,u):d))return!1}}return!0}var Gw=Vw,Hw=Je;function Ww(r){return r===r&&!Hw(r)}var rs=Ww,zw=rs,Xw=$t;function Yw(r){for(var e=Xw(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,zw(i)]}return e}var Kw=Yw;function Zw(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var ts=Zw,Jw=Gw,Qw=Kw,e0=ts;function r0(r){var e=Qw(r);return e.length==1&&e[0][2]?e0(e[0][0],e[0][1]):function(t){return t===r||Jw(t,r,e)}}var t0=r0,n0=ge,i0=_e,a0="[object Symbol]";function o0(r){return typeof r=="symbol"||i0(r)&&n0(r)==a0}var Pt=o0,s0=G,u0=Pt,f0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c0=/^\w*$/;function l0(r,e){if(s0(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||u0(r)?!0:c0.test(r)||!f0.test(r)||e!=null&&r in Object(e)}var si=l0,ns=Qn,d0="Expected a function";function ui(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(d0);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(ui.Cache||ns),t}ui.Cache=ns;var p0=ui,h0=p0,y0=500;function g0(r){var e=h0(r,function(n){return t.size===y0&&t.clear(),n}),t=e.cache;return e}var _0=g0,v0=_0,m0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,w0=/\\(\\)?/g,b0=v0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(m0,function(t,n,i,a){e.push(i?a.replace(w0,"$1"):n||t)}),e}),$0=b0;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 fi=E0,is=yt,S0=fi,A0=G,O0=Pt,I0=1/0,as=is?is.prototype:void 0,os=as?as.toString:void 0;function ss(r){if(typeof r=="string")return r;if(A0(r))return S0(r,ss)+"";if(O0(r))return os?os.call(r):"";var e=r+"";return e=="0"&&1/r==-I0?"-0":e}var x0=ss,P0=x0;function T0(r){return r==null?"":P0(r)}var R0=T0,F0=G,M0=si,D0=$0,C0=R0;function N0(r,e){return F0(r)?r:M0(r,e)?[r]:D0(C0(r))}var us=N0,B0=Pt,U0=1/0;function q0(r){if(typeof r=="string"||B0(r))return r;var e=r+"";return e=="0"&&1/r==-U0?"-0":e}var Tt=q0,k0=us,L0=Tt;function j0(r,e){e=k0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[L0(e[t++])];return t&&t==n?r:void 0}var fs=j0,V0=fs;function G0(r,e,t){var n=r==null?void 0:V0(r,e);return n===void 0?t:n}var H0=G0;function W0(r,e){return r!=null&&e in Object(r)}var z0=W0,X0=us,Y0=So,K0=G,Z0=Kn,J0=Yn,Q0=Tt;function eb(r,e,t){e=X0(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=Q0(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&&J0(i)&&Z0(o,i)&&(K0(r)||Y0(r)))}var rb=eb,tb=z0,nb=rb;function ib(r,e){return r!=null&&nb(r,e,tb)}var ab=ib,ob=es,sb=H0,ub=ab,fb=si,cb=rs,lb=ts,db=Tt,pb=1,hb=2;function yb(r,e){return fb(r)&&cb(e)?lb(db(r),e):function(t){var n=sb(t,r);return n===void 0&&n===e?ub(t,r):ob(e,n,pb|hb)}}var gb=yb;function _b(r){return function(e){return e?.[r]}}var vb=_b,mb=fs;function wb(r){return function(e){return mb(e,r)}}var bb=wb,$b=vb,Eb=bb,Sb=si,Ab=Tt;function Ob(r){return Sb(r)?$b(Ab(r)):Eb(r)}var Ib=Ob,xb=t0,Pb=gb,Tb=vt,Rb=G,Fb=Ib;function Mb(r){return typeof r=="function"?r:r==null?Tb:typeof r=="object"?Rb(r)?Pb(r[0],r[1]):xb(r):Fb(r)}var cs=Mb,Db=mg,Cb=Jg,Nb=cs,Bb=G,Ub=wo;function qb(r,e,t){var n=Bb(r)?Db:Cb;return t&&Ub(r,e,t)&&(e=void 0),n(r,Nb(e))}var ci=qb;Object.defineProperty(De,"__esModule",{value:!0}),De.calculatePadding=Vb,De.slicePadding=Gb;var kb=ci,Lb=jb(kb);function jb(r){return r&&r.__esModule?r:{default:r}}function Vb(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function Gb(r,e){var t=r.slice(e),n=(0,Lb.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(bt,"__esModule",{value:!0}),bt.Cursor=void 0;var Hb=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Wb=De;function zb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var li=function(){function r(e){zb(this,r),e instanceof h||(e=typeof e=="number"?h.alloc(e):h.from(e)),this._setBuffer(e),this.rewind()}return Hb(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 h?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=h.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,Wb.calculatePadding)(t.length),i=h.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){li.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){li.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),bt.Cursor=li,Object.defineProperty(D,"__esModule",{value:!0}),D.default=e1;var Xb=_g,ls=ps(Xb),Yb=zn,Kb=ps(Yb),ds=bt;function ps(r){return r&&r.__esModule?r:{default:r}}var Zb=Math.pow(2,16),Jb={toXDR:function(e){var t=new ds.Cursor(Zb);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=h.from(e,"hex");break;case"base64":n=h.from(e,"base64");break;default:throw new Error("Invalid format "+t+', must be "raw", "hex", "base64"')}var i=new ds.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}}},Qb={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 e1(r){(0,ls.default)(r,Jb),(0,Kb.default)(r)&&(0,ls.default)(r.prototype,Qb)}Object.defineProperty(ue,"__esModule",{value:!0}),ue.Int=void 0;var r1=gt,hs=ys(r1),t1=D,n1=ys(t1);function ys(r){return r&&r.__esModule?r:{default:r}}var Ir=ue.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,hs.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,hs.default)(e)||Math.floor(e)!==e?!1:e>=Ir.MIN_VALUE&&e<=Ir.MAX_VALUE}};Ir.MAX_VALUE=Math.pow(2,31)-1,Ir.MIN_VALUE=-Math.pow(2,31),(0,n1.default)(Ir);var Rt={};function i1(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 gs={exports:{}};(function(r){/**
20
+ `+e.prev}function ct(r,e){var t=Bn(r),n=[];if(t){n.length=r.length;for(var i=0;i<r.length;i++)n[i]=he(r,i)?e(r[i],r):""}var a=typeof Dn=="function"?Dn(r):[],o;if(Ye){o={};for(var s=0;s<a.length;s++)o["$"+a[s]]=a[s]}for(var f in r)he(r,f)&&(t&&String(Number(f))===f&&f<r.length||Ye&&o["$"+f]instanceof Symbol||(Ba.call(/[^\w$]/,f)?n.push(e(f,r)+": "+e(r[f],r)):n.push(f+": "+e(r[f],r))));if(typeof Dn=="function")for(var c=0;c<a.length;c++)ka.call(r,a[c])&&n.push("["+e(a[c])+"]: "+e(r[a[c]],r));return n}var kn=dn,Ke=Vf,Nl=_l,Bl=kn("%TypeError%"),lt=kn("%WeakMap%",!0),dt=kn("%Map%",!0),Ul=Ke("WeakMap.prototype.get",!0),ql=Ke("WeakMap.prototype.set",!0),kl=Ke("WeakMap.prototype.has",!0),Ll=Ke("Map.prototype.get",!0),jl=Ke("Map.prototype.set",!0),Vl=Ke("Map.prototype.has",!0),Ln=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},Gl=function(r,e){var t=Ln(r,e);return t&&t.value},Hl=function(r,e,t){var n=Ln(r,e);n?n.value=t:r.next={key:e,next:r.next,value:t}},Wl=function(r,e){return!!Ln(r,e)},zl=function(){var e,t,n,i={assert:function(a){if(!i.has(a))throw new Bl("Side channel does not contain "+Nl(a))},get:function(a){if(lt&&a&&(typeof a=="object"||typeof a=="function")){if(e)return Ul(e,a)}else if(dt){if(t)return Ll(t,a)}else if(n)return Gl(n,a)},has:function(a){if(lt&&a&&(typeof a=="object"||typeof a=="function")){if(e)return kl(e,a)}else if(dt){if(t)return Vl(t,a)}else if(n)return Wl(n,a);return!1},set:function(a,o){lt&&a&&(typeof a=="object"||typeof a=="function")?(e||(e=new lt),ql(e,a,o)):dt?(t||(t=new dt),jl(t,a,o)):(n||(n={key:{},next:null}),Hl(n,a,o))}};return i},Xl=String.prototype.replace,Yl=/%20/g,jn={RFC1738:"RFC1738",RFC3986:"RFC3986"},Za={default:jn.RFC3986,formatters:{RFC1738:function(r){return Xl.call(r,Yl,"+")},RFC3986:function(r){return String(r)}},RFC1738:jn.RFC1738,RFC3986:jn.RFC3986},Kl=Za,Vn=Object.prototype.hasOwnProperty,Re=Array.isArray,te=function(){for(var r=[],e=0;e<256;++e)r.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return r}(),Zl=function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Re(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);t.obj[t.prop]=i}}},Ja=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},Jl=function r(e,t,n){if(!t)return e;if(typeof t!="object"){if(Re(e))e.push(t);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Vn.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 Re(e)&&!Re(t)&&(i=Ja(e,n)),Re(e)&&Re(t)?(t.forEach(function(a,o){if(Vn.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 Vn.call(a,o)?a[o]=r(a[o],s,n):a[o]=s,a},i)},Ql=function(e,t){return Object.keys(t).reduce(function(n,i){return n[i]=t[i],n},e)},ed=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}},rd=function(e,t,n,i,a){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var s="",f=0;f<o.length;++f){var c=o.charCodeAt(f);if(c===45||c===46||c===95||c===126||c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||a===Kl.RFC1738&&(c===40||c===41)){s+=o.charAt(f);continue}if(c<128){s=s+te[c];continue}if(c<2048){s=s+(te[192|c>>6]+te[128|c&63]);continue}if(c<55296||c>=57344){s=s+(te[224|c>>12]+te[128|c>>6&63]+te[128|c&63]);continue}f+=1,c=65536+((c&1023)<<10|o.charCodeAt(f)&1023),s+=te[240|c>>18]+te[128|c>>12&63]+te[128|c>>6&63]+te[128|c&63]}return s},td=function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i<t.length;++i)for(var a=t[i],o=a.obj[a.prop],s=Object.keys(o),f=0;f<s.length;++f){var c=s[f],l=o[c];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(t.push({obj:o,prop:c}),n.push(l))}return Zl(t),e},nd=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},id=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},ad=function(e,t){return[].concat(e,t)},od=function(e,t){if(Re(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},sd={arrayToObject:Ja,assign:Ql,combine:ad,compact:td,decode:ed,encode:rd,isBuffer:id,isRegExp:nd,maybeMap:od,merge:Jl},Qa=zl,pt=sd,Er=Za,ud=Object.prototype.hasOwnProperty,eo={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},se=Array.isArray,fd=Array.prototype.push,ro=function(r,e){fd.apply(r,se(e)?e:[e])},cd=Date.prototype.toISOString,to=Er.default,L={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:pt.encode,encodeValuesOnly:!1,format:to,formatter:Er.formatters[to],indices:!1,serializeDate:function(e){return cd.call(e)},skipNulls:!1,strictNullHandling:!1},ld=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Gn={},dd=function r(e,t,n,i,a,o,s,f,c,l,u,d,y,b,S,O){for(var $=e,E=O,p=0,I=!1;(E=E.get(Gn))!==void 0&&!I;){var T=E.get(e);if(p+=1,typeof T<"u"){if(T===p)throw new RangeError("Cyclic object value");I=!0}typeof E.get(Gn)>"u"&&(p=0)}if(typeof f=="function"?$=f(t,$):$ instanceof Date?$=u($):n==="comma"&&se($)&&($=pt.maybeMap($,function(we){return we instanceof Date?u(we):we})),$===null){if(a)return s&&!b?s(t,L.encoder,S,"key",d):t;$=""}if(ld($)||pt.isBuffer($)){if(s){var F=b?t:s(t,L.encoder,S,"key",d);return[y(F)+"="+y(s($,L.encoder,S,"value",d))]}return[y(t)+"="+y(String($))]}var m=[];if(typeof $>"u")return m;var g;if(n==="comma"&&se($))b&&s&&($=pt.maybeMap($,s)),g=[{value:$.length>0?$.join(",")||null:void 0}];else if(se(f))g=f;else{var _=Object.keys($);g=c?_.sort(c):_}for(var A=i&&se($)&&$.length===1?t+"[]":t,x=0;x<g.length;++x){var M=g[x],Y=typeof M=="object"&&typeof M.value<"u"?M.value:$[M];if(!(o&&Y===null)){var me=se($)?typeof n=="function"?n(A,M):A:A+(l?"."+M:"["+M+"]");O.set(e,p);var dr=Qa();dr.set(Gn,O),ro(m,r(Y,me,n,i,a,o,n==="comma"&&b&&se($)?null:s,f,c,l,u,d,y,b,S,dr))}}return m},pd=function(e){if(!e)return L;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||L.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=Er.default;if(typeof e.format<"u"){if(!ud.call(Er.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Er.formatters[n],a=L.filter;return(typeof e.filter=="function"||se(e.filter))&&(a=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:L.addQueryPrefix,allowDots:typeof e.allowDots>"u"?L.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:L.charsetSentinel,delimiter:typeof e.delimiter>"u"?L.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:L.encode,encoder:typeof e.encoder=="function"?e.encoder:L.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:L.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:L.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:L.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:L.strictNullHandling}},hd=function(r,e){var t=r,n=pd(e),i,a;typeof n.filter=="function"?(a=n.filter,t=a("",t)):se(n.filter)&&(a=n.filter,i=a);var o=[];if(typeof t!="object"||t===null)return"";var s;e&&e.arrayFormat in eo?s=e.arrayFormat:e&&"indices"in e?s=e.indices?"indices":"repeat":s="indices";var f=eo[s];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=f==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),n.sort&&i.sort(n.sort);for(var l=Qa(),u=0;u<i.length;++u){var d=i[u];n.skipNulls&&t[d]===null||ro(o,dd(t[d],d,f,c,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,l))}var y=o.join(n.delimiter),b=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?b+="utf8=%26%2310003%3B&":b+="utf8=%E2%9C%93&"),y.length>0?b+y:""},yd=be(hd);let no={storeIdentifier:"",environment:"prod"};function gd(r){no=r}function V(){return no}const _d=(r,e="")=>{switch(r){case"prod":return"https://api.rechargeapps.com";case"stage":return"https://api.stage.rechargeapps.com";case"preprod":case"prestage":return`${e}/api`}},vd=(r,e="")=>{switch(r){case"prod":return"https://admin.rechargeapps.com";case"stage":return"https://admin.stage.rechargeapps.com";case"preprod":case"prestage":return e}},md=r=>{switch(r){case"prod":case"preprod":return"https://static.rechargecdn.com";case"stage":case"prestage":return"https://static.stage.rechargecdn.com"}},io="/tools/recurring";class Ze{constructor(e,t){this.name="RechargeRequestError",this.message=e,this.status=t}}function wd(r){return yd(r,{encode:!1,indices:!1,arrayFormat:"comma"})}function v(r,e){return{...r,internalFnCall:r.internalFnCall??e,internalRequestId:r.internalRequestId??Wi()}}async function ht(r,e,t={}){const n=V();return X(r,`${md(n.environment)}/store/${n.storeIdentifier}${e}`,t)}async function w(r,e,{id:t,query:n,data:i,headers:a}={},o){const{environment:s,environmentUri:f,storeIdentifier:c,loginRetryFn:l,__unstable_twoFactorRetryFn:u,appName:d,appVersion:y}=V();if(!c)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const b=o.apiToken;if(!b)throw new Error("No API token defined on session.");const S=_d(s,f),O={"X-Recharge-Access-Token":b,"X-Recharge-Version":"2021-11","X-Recharge-Sdk-Fn":o.internalFnCall,...d?{"X-Recharge-Sdk-App-Name":d}:{},...y?{"X-Recharge-Sdk-App-Version":y}:{},"X-Recharge-Sdk-Version":"1.67.1","X-Request-Id":o.internalRequestId,...o.tmp_fn_identifier?{"X-Recharge-Sdk-Fn-Identifier":o.tmp_fn_identifier}:{},...a||{}},$={shop_url:c,...n};try{return await X(r,`${S}${e}`,{id:t,query:$,data:i,headers:O})}catch(E){if(l&&E instanceof Ze&&E.status===401)return l().then(p=>{if(p)return X(r,`${S}${e}`,{id:t,query:$,data:i,headers:{...O,"X-Recharge-Access-Token":p.apiToken}});throw E});if(u&&E instanceof Ze&&E.status===423)return u().then(p=>{if(p)return X(r,`${S}${e}`,{id:t,query:$,data:i,headers:{...O,"X-Recharge-Access-Token":p.apiToken}});throw E});throw E}}async function Fe(r,e,t={}){return X(r,`${io}${e}`,t)}async function X(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 d=[u,wd(n)].join("&").replace(/^&/,"");o=`${o}${d?`?${d}`:""}`}let s;i&&r!=="get"&&(s=JSON.stringify(i));const f={Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client",...a||{}},c=await fetch(o,{method:r,headers:f,body:s});let l;try{l=await c.json()}catch{}if(!c.ok)throw c.status===502||c.status===504?new Ze("A gateway error occurred while making the request",c.status):l&&l.error?new Ze(l.error,c.status):l&&l.errors?new Ze(JSON.stringify(l.errors),c.status):new Ze("A connection error occurred while making the request");return l}function bd(r,e){return w("get","/addresses",{query:e},v(r,"listAddresses"))}async function $d(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{address:n}=await w("get","/addresses",{id:e,query:{include:t?.include}},v(r,"getAddress"));return n}async function Ed(r,e){const{address:t}=await w("post","/addresses",{data:{customer_id:r.customerId?Number(r.customerId):void 0,...e}},v(r,"createAddress"));return t}async function Hn(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{address:i}=await w("put","/addresses",{id:e,data:t,query:n},v(r,"updateAddress"));return i}async function Sd(r,e,t,n){return Hn(v(r,"applyDiscountToAddress"),e,{discounts:[{code:t}]},n)}async function Ad(r,e,t){if(e===void 0||e==="")throw new Error("Id is required");return Hn(v(r,"removeDiscountsFromAddress"),e,{discounts:[]},t)}function Od(r,e){if(e===void 0||e==="")throw new Error("ID is required");return w("delete","/addresses",{id:e},v(r,"deleteAddress"))}async function Id(r,e){const{address:t}=await w("post","/addresses/merge",{data:e},v(r,"mergeAddresses"));return t}async function xd(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("post",`/addresses/${e}/charges/skip`,{data:t},v(r,"skipFutureCharge"));return n}var Pd=Object.freeze({__proto__:null,applyDiscountToAddress:Sd,createAddress:Ed,deleteAddress:Od,getAddress:$d,listAddresses:bd,mergeAddresses:Id,removeDiscountsFromAddress:Ad,skipFutureCharge:xd,updateAddress:Hn});async function Td(){const{storefrontAccessToken:r}=V(),e={};r&&(e["X-Recharge-Storefront-Access-Token"]=r);const t=await Fe("get","/access",{headers:e});return{apiToken:t.api_token,customerId:t.customer_id,message:t.message}}async function Rd(r,e){return ao(r,e)}async function ao(r,e){if(!r)throw new Error("Shopify storefront token is required");const{storeIdentifier:t}=V();if(!t)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const{api_token:n,customer_id:i,message:a}=await Sr("post","/shopify_storefront_access",{data:{customer_token:e,storefront_token:r,shop_url:t}});return n?{apiToken:n,customerId:i,message:a}:null}async function Fd(r){const{storeIdentifier:e}=V();if(!e)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const{api_token:t,customer_id:n,message:i}=await Sr("post","/shopify_customer_account_api_access",{data:{customer_token:r,shop_url:e}});return t?{apiToken:t,customerId:n,message:i}:null}async function Md(r,e={}){if(!r)throw new Error("Email is required.");const{storeIdentifier:t}=V();if(!t)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const n=await Sr("post","/attempt_login",{data:{email:r,shop:t,...e}});if(n.errors)throw new Error(n.errors);return n.session_token}async function Dd(r,e={}){if(!r)throw new Error("Email is required.");const{storefrontAccessToken:t}=V(),n={};t&&(n["X-Recharge-Storefront-Access-Token"]=t);const i=await Fe("post","/attempt_login",{data:{email:r,...e},headers:n});if(i.errors)throw new Error(i.errors);return i.session_token}async function Cd(r,e,t){if(!r)throw new Error("Email is required.");if(!e)throw new Error("Session token is required.");if(!t)throw new Error("Code is required.");const{storeIdentifier:n}=V();if(!n)throw new Error("InitRecharge has not been called and/or no store identifier has been defined.");const i=await Sr("post","/validate_login",{data:{code:t,email:r,session_token:e,shop:n}});if(i.errors)throw new Error(i.errors);return{apiToken:i.api_token,customerId:i.customer_id}}async function Nd(r,e,t){if(!r)throw new Error("Email is required.");if(!e)throw new Error("Session token is required.");if(!t)throw new Error("Code is required.");const{storefrontAccessToken:n}=V(),i={};n&&(i["X-Recharge-Storefront-Access-Token"]=n);const a=await Fe("post","/validate_login",{data:{code:t,email:r,session_token:e},headers:i});if(a.errors)throw new Error(a.errors);return{apiToken:a.api_token,customerId:a.customer_id}}function Bd(){const{customerHash:r}=V(),{pathname:e,search:t}=window.location,n=new URLSearchParams(t).get("token"),i=e.split("/").filter(Boolean),a=i.findIndex(s=>s==="portal"),o=a!==-1?i[a+1]:r;if(!n||!o)throw new Error("Not in context of Recharge Customer Portal or URL did not contain correct params");return{customerHash:o,token:n}}async function Ud(){const{customerHash:r,token:e}=Bd(),{storeIdentifier:t}=V(),n=await Sr("post",`/customers/${r}/access`,{data:{token:e,shop:t}});return{apiToken:n.api_token,customerId:n.customer_id}}async function Sr(r,e,{id:t,query:n,data:i,headers:a}={}){const{environment:o,environmentUri:s,storefrontAccessToken:f,appName:c,appVersion:l}=V(),u=vd(o,s),d={...f?{"X-Recharge-Storefront-Access-Token":f}:{},...c?{"X-Recharge-Sdk-App-Name":c}:{},...l?{"X-Recharge-Sdk-App-Version":l}:{},"X-Recharge-Sdk-Version":"1.67.1",...a||{}};return X(r,`${u}${e}`,{id:t,query:n,data:i,headers:d})}var qd=Object.freeze({__proto__:null,loginCustomerPortal:Ud,loginShopifyApi:Rd,loginShopifyAppProxy:Td,loginWithShopifyCustomerAccount:Fd,loginWithShopifyStorefront:ao,sendPasswordlessCode:Md,sendPasswordlessCodeAppProxy:Dd,validatePasswordlessCode:Cd,validatePasswordlessCodeAppProxy:Nd}),oo={},Wn={},ue={},kd=typeof U=="object"&&U&&U.Object===Object&&U,so=kd,Ld=so,jd=typeof self=="object"&&self&&self.Object===Object&&self,Vd=Ld||jd||Function("return this")(),fe=Vd,Gd=fe,Hd=Gd.Symbol,yt=Hd,uo=yt,fo=Object.prototype,Wd=fo.hasOwnProperty,zd=fo.toString,Ar=uo?uo.toStringTag:void 0;function Xd(r){var e=Wd.call(r,Ar),t=r[Ar];try{r[Ar]=void 0;var n=!0}catch{}var i=zd.call(r);return n&&(e?r[Ar]=t:delete r[Ar]),i}var Yd=Xd,Kd=Object.prototype,Zd=Kd.toString;function Jd(r){return Zd.call(r)}var Qd=Jd,co=yt,ep=Yd,rp=Qd,tp="[object Null]",np="[object Undefined]",lo=co?co.toStringTag:void 0;function ip(r){return r==null?r===void 0?np:tp:lo&&lo in Object(r)?ep(r):rp(r)}var ge=ip;function ap(r){return r!=null&&typeof r=="object"}var _e=ap,op=ge,sp=_e,up="[object Number]";function fp(r){return typeof r=="number"||sp(r)&&op(r)==up}var gt=fp,D={};function cp(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var Je=cp,lp=ge,dp=Je,pp="[object AsyncFunction]",hp="[object Function]",yp="[object GeneratorFunction]",gp="[object Proxy]";function _p(r){if(!dp(r))return!1;var e=lp(r);return e==hp||e==yp||e==pp||e==gp}var zn=_p,vp=fe,mp=vp["__core-js_shared__"],wp=mp,Xn=wp,po=function(){var r=/[^.]+$/.exec(Xn&&Xn.keys&&Xn.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function bp(r){return!!po&&po in r}var $p=bp,Ep=Function.prototype,Sp=Ep.toString;function Ap(r){if(r!=null){try{return Sp.call(r)}catch{}try{return r+""}catch{}}return""}var ho=Ap,Op=zn,Ip=$p,xp=Je,Pp=ho,Tp=/[\\^$.*+?()[\]{}|]/g,Rp=/^\[object .+?Constructor\]$/,Fp=Function.prototype,Mp=Object.prototype,Dp=Fp.toString,Cp=Mp.hasOwnProperty,Np=RegExp("^"+Dp.call(Cp).replace(Tp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Bp(r){if(!xp(r)||Ip(r))return!1;var e=Op(r)?Np:Rp;return e.test(Pp(r))}var Up=Bp;function qp(r,e){return r?.[e]}var kp=qp,Lp=Up,jp=kp;function Vp(r,e){var t=jp(r,e);return Lp(t)?t:void 0}var Me=Vp,Gp=Me,Hp=function(){try{var r=Gp(Object,"defineProperty");return r({},"",{}),r}catch{}}(),yo=Hp,go=yo;function Wp(r,e,t){e=="__proto__"&&go?go(r,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):r[e]=t}var _o=Wp;function zp(r,e){return r===e||r!==r&&e!==e}var _t=zp,Xp=_o,Yp=_t,Kp=Object.prototype,Zp=Kp.hasOwnProperty;function Jp(r,e,t){var n=r[e];(!(Zp.call(r,e)&&Yp(n,t))||t===void 0&&!(e in r))&&Xp(r,e,t)}var Qp=Jp,eh=Qp,rh=_o;function th(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?rh(t,s,f):eh(t,s,f)}return t}var nh=th;function ih(r){return r}var vt=ih;function ah(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 oh=ah,sh=oh,vo=Math.max;function uh(r,e,t){return e=vo(e===void 0?r.length-1:e,0),function(){for(var n=arguments,i=-1,a=vo(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),sh(r,this,s)}}var fh=uh;function ch(r){return function(){return r}}var lh=ch,dh=lh,mo=yo,ph=vt,hh=mo?function(r,e){return mo(r,"toString",{configurable:!0,enumerable:!1,value:dh(e),writable:!0})}:ph,yh=hh,gh=800,_h=16,vh=Date.now;function mh(r){var e=0,t=0;return function(){var n=vh(),i=_h-(n-t);if(t=n,i>0){if(++e>=gh)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var wh=mh,bh=yh,$h=wh,Eh=$h(bh),Sh=Eh,Ah=vt,Oh=fh,Ih=Sh;function xh(r,e){return Ih(Oh(r,e,Ah),r+"")}var Ph=xh,Th=9007199254740991;function Rh(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Th}var Yn=Rh,Fh=zn,Mh=Yn;function Dh(r){return r!=null&&Mh(r.length)&&!Fh(r)}var Or=Dh,Ch=9007199254740991,Nh=/^(?:0|[1-9]\d*)$/;function Bh(r,e){var t=typeof r;return e=e??Ch,!!e&&(t=="number"||t!="symbol"&&Nh.test(r))&&r>-1&&r%1==0&&r<e}var Kn=Bh,Uh=_t,qh=Or,kh=Kn,Lh=Je;function jh(r,e,t){if(!Lh(t))return!1;var n=typeof e;return(n=="number"?qh(t)&&kh(e,t.length):n=="string"&&e in t)?Uh(t[e],r):!1}var wo=jh,Vh=Ph,Gh=wo;function Hh(r){return Vh(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&&Gh(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 Wh=Hh;function zh(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}var bo=zh,Xh=ge,Yh=_e,Kh="[object Arguments]";function Zh(r){return Yh(r)&&Xh(r)==Kh}var Jh=Zh,$o=Jh,Qh=_e,Eo=Object.prototype,ey=Eo.hasOwnProperty,ry=Eo.propertyIsEnumerable,ty=$o(function(){return arguments}())?$o:function(r){return Qh(r)&&ey.call(r,"callee")&&!ry.call(r,"callee")},So=ty,ny=Array.isArray,G=ny,mt={exports:{}};function iy(){return!1}var ay=iy;mt.exports,function(r,e){var t=fe,n=ay,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}(mt,mt.exports);var Ao=mt.exports,oy=ge,sy=Yn,uy=_e,fy="[object Arguments]",cy="[object Array]",ly="[object Boolean]",dy="[object Date]",py="[object Error]",hy="[object Function]",yy="[object Map]",gy="[object Number]",_y="[object Object]",vy="[object RegExp]",my="[object Set]",wy="[object String]",by="[object WeakMap]",$y="[object ArrayBuffer]",Ey="[object DataView]",Sy="[object Float32Array]",Ay="[object Float64Array]",Oy="[object Int8Array]",Iy="[object Int16Array]",xy="[object Int32Array]",Py="[object Uint8Array]",Ty="[object Uint8ClampedArray]",Ry="[object Uint16Array]",Fy="[object Uint32Array]",R={};R[Sy]=R[Ay]=R[Oy]=R[Iy]=R[xy]=R[Py]=R[Ty]=R[Ry]=R[Fy]=!0,R[fy]=R[cy]=R[$y]=R[ly]=R[Ey]=R[dy]=R[py]=R[hy]=R[yy]=R[gy]=R[_y]=R[vy]=R[my]=R[wy]=R[by]=!1;function My(r){return uy(r)&&sy(r.length)&&!!R[oy(r)]}var Dy=My;function Cy(r){return function(e){return r(e)}}var Ny=Cy,wt={exports:{}};wt.exports,function(r,e){var t=so,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}(wt,wt.exports);var By=wt.exports,Uy=Dy,qy=Ny,Oo=By,Io=Oo&&Oo.isTypedArray,ky=Io?qy(Io):Uy,xo=ky,Ly=bo,jy=So,Vy=G,Gy=Ao,Hy=Kn,Wy=xo,zy=Object.prototype,Xy=zy.hasOwnProperty;function Yy(r,e){var t=Vy(r),n=!t&&jy(r),i=!t&&!n&&Gy(r),a=!t&&!n&&!i&&Wy(r),o=t||n||i||a,s=o?Ly(r.length,String):[],f=s.length;for(var c in r)(e||Xy.call(r,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||a&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||Hy(c,f)))&&s.push(c);return s}var Po=Yy,Ky=Object.prototype;function Zy(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Ky;return r===t}var To=Zy;function Jy(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}var Qy=Jy,eg=Je,rg=To,tg=Qy,ng=Object.prototype,ig=ng.hasOwnProperty;function ag(r){if(!eg(r))return tg(r);var e=rg(r),t=[];for(var n in r)n=="constructor"&&(e||!ig.call(r,n))||t.push(n);return t}var og=ag,sg=Po,ug=og,fg=Or;function cg(r){return fg(r)?sg(r,!0):ug(r)}var lg=cg,dg=nh,pg=Wh,hg=lg,yg=pg(function(r,e){dg(e,hg(e),r)}),gg=yg,_g=gg,bt={},De={};function vg(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 mg=vg;function wg(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 bg=wg,$g=bg,Eg=$g(),Sg=Eg;function Ag(r,e){return function(t){return r(e(t))}}var Og=Ag,Ig=Og,xg=Ig(Object.keys,Object),Pg=xg,Tg=To,Rg=Pg,Fg=Object.prototype,Mg=Fg.hasOwnProperty;function Dg(r){if(!Tg(r))return Rg(r);var e=[];for(var t in Object(r))Mg.call(r,t)&&t!="constructor"&&e.push(t);return e}var Cg=Dg,Ng=Po,Bg=Cg,Ug=Or;function qg(r){return Ug(r)?Ng(r):Bg(r)}var $t=qg,kg=Sg,Lg=$t;function jg(r,e){return r&&kg(r,e,Lg)}var Vg=jg,Gg=Or;function Hg(r,e){return function(t,n){if(t==null)return t;if(!Gg(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 Wg=Hg,zg=Vg,Xg=Wg,Yg=Xg(zg),Zn=Yg,Kg=Zn;function Zg(r,e){var t=!0;return Kg(r,function(n,i,a){return t=!!e(n,i,a),t}),t}var Jg=Zg;function Qg(){this.__data__=[],this.size=0}var e_=Qg,r_=_t;function t_(r,e){for(var t=r.length;t--;)if(r_(r[t][0],e))return t;return-1}var Et=t_,n_=Et,i_=Array.prototype,a_=i_.splice;function o_(r){var e=this.__data__,t=n_(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():a_.call(e,t,1),--this.size,!0}var s_=o_,u_=Et;function f_(r){var e=this.__data__,t=u_(e,r);return t<0?void 0:e[t][1]}var c_=f_,l_=Et;function d_(r){return l_(this.__data__,r)>-1}var p_=d_,h_=Et;function y_(r,e){var t=this.__data__,n=h_(t,r);return n<0?(++this.size,t.push([r,e])):t[n][1]=e,this}var g_=y_,__=e_,v_=s_,m_=c_,w_=p_,b_=g_;function Qe(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}Qe.prototype.clear=__,Qe.prototype.delete=v_,Qe.prototype.get=m_,Qe.prototype.has=w_,Qe.prototype.set=b_;var St=Qe,$_=St;function E_(){this.__data__=new $_,this.size=0}var S_=E_;function A_(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var O_=A_;function I_(r){return this.__data__.get(r)}var x_=I_;function P_(r){return this.__data__.has(r)}var T_=P_,R_=Me,F_=fe,M_=R_(F_,"Map"),Jn=M_,D_=Me,C_=D_(Object,"create"),At=C_,Ro=At;function N_(){this.__data__=Ro?Ro(null):{},this.size=0}var B_=N_;function U_(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var q_=U_,k_=At,L_="__lodash_hash_undefined__",j_=Object.prototype,V_=j_.hasOwnProperty;function G_(r){var e=this.__data__;if(k_){var t=e[r];return t===L_?void 0:t}return V_.call(e,r)?e[r]:void 0}var H_=G_,W_=At,z_=Object.prototype,X_=z_.hasOwnProperty;function Y_(r){var e=this.__data__;return W_?e[r]!==void 0:X_.call(e,r)}var K_=Y_,Z_=At,J_="__lodash_hash_undefined__";function Q_(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Z_&&e===void 0?J_:e,this}var ev=Q_,rv=B_,tv=q_,nv=H_,iv=K_,av=ev;function er(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])}}er.prototype.clear=rv,er.prototype.delete=tv,er.prototype.get=nv,er.prototype.has=iv,er.prototype.set=av;var ov=er,Fo=ov,sv=St,uv=Jn;function fv(){this.size=0,this.__data__={hash:new Fo,map:new(uv||sv),string:new Fo}}var cv=fv;function lv(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var dv=lv,pv=dv;function hv(r,e){var t=r.__data__;return pv(e)?t[typeof e=="string"?"string":"hash"]:t.map}var Ot=hv,yv=Ot;function gv(r){var e=yv(this,r).delete(r);return this.size-=e?1:0,e}var _v=gv,vv=Ot;function mv(r){return vv(this,r).get(r)}var wv=mv,bv=Ot;function $v(r){return bv(this,r).has(r)}var Ev=$v,Sv=Ot;function Av(r,e){var t=Sv(this,r),n=t.size;return t.set(r,e),this.size+=t.size==n?0:1,this}var Ov=Av,Iv=cv,xv=_v,Pv=wv,Tv=Ev,Rv=Ov;function rr(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])}}rr.prototype.clear=Iv,rr.prototype.delete=xv,rr.prototype.get=Pv,rr.prototype.has=Tv,rr.prototype.set=Rv;var Qn=rr,Fv=St,Mv=Jn,Dv=Qn,Cv=200;function Nv(r,e){var t=this.__data__;if(t instanceof Fv){var n=t.__data__;if(!Mv||n.length<Cv-1)return n.push([r,e]),this.size=++t.size,this;t=this.__data__=new Dv(n)}return t.set(r,e),this.size=t.size,this}var Bv=Nv,Uv=St,qv=S_,kv=O_,Lv=x_,jv=T_,Vv=Bv;function tr(r){var e=this.__data__=new Uv(r);this.size=e.size}tr.prototype.clear=qv,tr.prototype.delete=kv,tr.prototype.get=Lv,tr.prototype.has=jv,tr.prototype.set=Vv;var Mo=tr,Gv="__lodash_hash_undefined__";function Hv(r){return this.__data__.set(r,Gv),this}var Wv=Hv;function zv(r){return this.__data__.has(r)}var Xv=zv,Yv=Qn,Kv=Wv,Zv=Xv;function It(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new Yv;++e<t;)this.add(r[e])}It.prototype.add=It.prototype.push=Kv,It.prototype.has=Zv;var Jv=It;function Qv(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 em=Qv;function rm(r,e){return r.has(e)}var tm=rm,nm=Jv,im=em,am=tm,om=1,sm=2;function um(r,e,t,n,i,a){var o=t&om,s=r.length,f=e.length;if(s!=f&&!(o&&f>s))return!1;var c=a.get(r),l=a.get(e);if(c&&l)return c==e&&l==r;var u=-1,d=!0,y=t&sm?new nm:void 0;for(a.set(r,e),a.set(e,r);++u<s;){var b=r[u],S=e[u];if(n)var O=o?n(S,b,u,e,r,a):n(b,S,u,r,e,a);if(O!==void 0){if(O)continue;d=!1;break}if(y){if(!im(e,function($,E){if(!am(y,E)&&(b===$||i(b,$,t,n,a)))return y.push(E)})){d=!1;break}}else if(!(b===S||i(b,S,t,n,a))){d=!1;break}}return a.delete(r),a.delete(e),d}var Do=um,fm=fe,cm=fm.Uint8Array,lm=cm;function dm(r){var e=-1,t=Array(r.size);return r.forEach(function(n,i){t[++e]=[i,n]}),t}var pm=dm;function hm(r){var e=-1,t=Array(r.size);return r.forEach(function(n){t[++e]=n}),t}var ym=hm,Co=yt,No=lm,gm=_t,_m=Do,vm=pm,mm=ym,wm=1,bm=2,$m="[object Boolean]",Em="[object Date]",Sm="[object Error]",Am="[object Map]",Om="[object Number]",Im="[object RegExp]",xm="[object Set]",Pm="[object String]",Tm="[object Symbol]",Rm="[object ArrayBuffer]",Fm="[object DataView]",Bo=Co?Co.prototype:void 0,ei=Bo?Bo.valueOf:void 0;function Mm(r,e,t,n,i,a,o){switch(t){case Fm:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case Rm:return!(r.byteLength!=e.byteLength||!a(new No(r),new No(e)));case $m:case Em:case Om:return gm(+r,+e);case Sm:return r.name==e.name&&r.message==e.message;case Im:case Pm:return r==e+"";case Am:var s=vm;case xm:var f=n&wm;if(s||(s=mm),r.size!=e.size&&!f)return!1;var c=o.get(r);if(c)return c==e;n|=bm,o.set(r,e);var l=_m(s(r),s(e),n,i,a,o);return o.delete(r),l;case Tm:if(ei)return ei.call(r)==ei.call(e)}return!1}var Dm=Mm;function Cm(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}var Nm=Cm,Bm=Nm,Um=G;function qm(r,e,t){var n=e(r);return Um(r)?n:Bm(n,t(r))}var km=qm;function Lm(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 jm=Lm;function Vm(){return[]}var Gm=Vm,Hm=jm,Wm=Gm,zm=Object.prototype,Xm=zm.propertyIsEnumerable,Uo=Object.getOwnPropertySymbols,Ym=Uo?function(r){return r==null?[]:(r=Object(r),Hm(Uo(r),function(e){return Xm.call(r,e)}))}:Wm,Km=Ym,Zm=km,Jm=Km,Qm=$t;function ew(r){return Zm(r,Qm,Jm)}var rw=ew,qo=rw,tw=1,nw=Object.prototype,iw=nw.hasOwnProperty;function aw(r,e,t,n,i,a){var o=t&tw,s=qo(r),f=s.length,c=qo(e),l=c.length;if(f!=l&&!o)return!1;for(var u=f;u--;){var d=s[u];if(!(o?d in e:iw.call(e,d)))return!1}var y=a.get(r),b=a.get(e);if(y&&b)return y==e&&b==r;var S=!0;a.set(r,e),a.set(e,r);for(var O=o;++u<f;){d=s[u];var $=r[d],E=e[d];if(n)var p=o?n(E,$,d,e,r,a):n($,E,d,r,e,a);if(!(p===void 0?$===E||i($,E,t,n,a):p)){S=!1;break}O||(O=d=="constructor")}if(S&&!O){var I=r.constructor,T=e.constructor;I!=T&&"constructor"in r&&"constructor"in e&&!(typeof I=="function"&&I instanceof I&&typeof T=="function"&&T instanceof T)&&(S=!1)}return a.delete(r),a.delete(e),S}var ow=aw,sw=Me,uw=fe,fw=sw(uw,"DataView"),cw=fw,lw=Me,dw=fe,pw=lw(dw,"Promise"),hw=pw,yw=Me,gw=fe,_w=yw(gw,"Set"),vw=_w,mw=Me,ww=fe,bw=mw(ww,"WeakMap"),$w=bw,ri=cw,ti=Jn,ni=hw,ii=vw,ai=$w,ko=ge,nr=ho,Lo="[object Map]",Ew="[object Object]",jo="[object Promise]",Vo="[object Set]",Go="[object WeakMap]",Ho="[object DataView]",Sw=nr(ri),Aw=nr(ti),Ow=nr(ni),Iw=nr(ii),xw=nr(ai),Ce=ko;(ri&&Ce(new ri(new ArrayBuffer(1)))!=Ho||ti&&Ce(new ti)!=Lo||ni&&Ce(ni.resolve())!=jo||ii&&Ce(new ii)!=Vo||ai&&Ce(new ai)!=Go)&&(Ce=function(r){var e=ko(r),t=e==Ew?r.constructor:void 0,n=t?nr(t):"";if(n)switch(n){case Sw:return Ho;case Aw:return Lo;case Ow:return jo;case Iw:return Vo;case xw:return Go}return e});var Pw=Ce,oi=Mo,Tw=Do,Rw=Dm,Fw=ow,Wo=Pw,zo=G,Xo=Ao,Mw=xo,Dw=1,Yo="[object Arguments]",Ko="[object Array]",xt="[object Object]",Cw=Object.prototype,Zo=Cw.hasOwnProperty;function Nw(r,e,t,n,i,a){var o=zo(r),s=zo(e),f=o?Ko:Wo(r),c=s?Ko:Wo(e);f=f==Yo?xt:f,c=c==Yo?xt:c;var l=f==xt,u=c==xt,d=f==c;if(d&&Xo(r)){if(!Xo(e))return!1;o=!0,l=!1}if(d&&!l)return a||(a=new oi),o||Mw(r)?Tw(r,e,t,n,i,a):Rw(r,e,f,t,n,i,a);if(!(t&Dw)){var y=l&&Zo.call(r,"__wrapped__"),b=u&&Zo.call(e,"__wrapped__");if(y||b){var S=y?r.value():r,O=b?e.value():e;return a||(a=new oi),i(S,O,t,n,a)}}return d?(a||(a=new oi),Fw(r,e,t,n,i,a)):!1}var Bw=Nw,Uw=Bw,Jo=_e;function Qo(r,e,t,n,i){return r===e?!0:r==null||e==null||!Jo(r)&&!Jo(e)?r!==r&&e!==e:Uw(r,e,t,n,Qo,i)}var es=Qo,qw=Mo,kw=es,Lw=1,jw=2;function Vw(r,e,t,n){var i=t.length,a=i,o=!n;if(r==null)return!a;for(r=Object(r);i--;){var s=t[i];if(o&&s[2]?s[1]!==r[s[0]]:!(s[0]in r))return!1}for(;++i<a;){s=t[i];var f=s[0],c=r[f],l=s[1];if(o&&s[2]){if(c===void 0&&!(f in r))return!1}else{var u=new qw;if(n)var d=n(c,l,f,r,e,u);if(!(d===void 0?kw(l,c,Lw|jw,n,u):d))return!1}}return!0}var Gw=Vw,Hw=Je;function Ww(r){return r===r&&!Hw(r)}var rs=Ww,zw=rs,Xw=$t;function Yw(r){for(var e=Xw(r),t=e.length;t--;){var n=e[t],i=r[n];e[t]=[n,i,zw(i)]}return e}var Kw=Yw;function Zw(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var ts=Zw,Jw=Gw,Qw=Kw,e0=ts;function r0(r){var e=Qw(r);return e.length==1&&e[0][2]?e0(e[0][0],e[0][1]):function(t){return t===r||Jw(t,r,e)}}var t0=r0,n0=ge,i0=_e,a0="[object Symbol]";function o0(r){return typeof r=="symbol"||i0(r)&&n0(r)==a0}var Pt=o0,s0=G,u0=Pt,f0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c0=/^\w*$/;function l0(r,e){if(s0(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||u0(r)?!0:c0.test(r)||!f0.test(r)||e!=null&&r in Object(e)}var si=l0,ns=Qn,d0="Expected a function";function ui(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(d0);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(ui.Cache||ns),t}ui.Cache=ns;var p0=ui,h0=p0,y0=500;function g0(r){var e=h0(r,function(n){return t.size===y0&&t.clear(),n}),t=e.cache;return e}var _0=g0,v0=_0,m0=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,w0=/\\(\\)?/g,b0=v0(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(m0,function(t,n,i,a){e.push(i?a.replace(w0,"$1"):n||t)}),e}),$0=b0;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 fi=E0,is=yt,S0=fi,A0=G,O0=Pt,I0=1/0,as=is?is.prototype:void 0,os=as?as.toString:void 0;function ss(r){if(typeof r=="string")return r;if(A0(r))return S0(r,ss)+"";if(O0(r))return os?os.call(r):"";var e=r+"";return e=="0"&&1/r==-I0?"-0":e}var x0=ss,P0=x0;function T0(r){return r==null?"":P0(r)}var R0=T0,F0=G,M0=si,D0=$0,C0=R0;function N0(r,e){return F0(r)?r:M0(r,e)?[r]:D0(C0(r))}var us=N0,B0=Pt,U0=1/0;function q0(r){if(typeof r=="string"||B0(r))return r;var e=r+"";return e=="0"&&1/r==-U0?"-0":e}var Tt=q0,k0=us,L0=Tt;function j0(r,e){e=k0(e,r);for(var t=0,n=e.length;r!=null&&t<n;)r=r[L0(e[t++])];return t&&t==n?r:void 0}var fs=j0,V0=fs;function G0(r,e,t){var n=r==null?void 0:V0(r,e);return n===void 0?t:n}var H0=G0;function W0(r,e){return r!=null&&e in Object(r)}var z0=W0,X0=us,Y0=So,K0=G,Z0=Kn,J0=Yn,Q0=Tt;function eb(r,e,t){e=X0(e,r);for(var n=-1,i=e.length,a=!1;++n<i;){var o=Q0(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&&J0(i)&&Z0(o,i)&&(K0(r)||Y0(r)))}var rb=eb,tb=z0,nb=rb;function ib(r,e){return r!=null&&nb(r,e,tb)}var ab=ib,ob=es,sb=H0,ub=ab,fb=si,cb=rs,lb=ts,db=Tt,pb=1,hb=2;function yb(r,e){return fb(r)&&cb(e)?lb(db(r),e):function(t){var n=sb(t,r);return n===void 0&&n===e?ub(t,r):ob(e,n,pb|hb)}}var gb=yb;function _b(r){return function(e){return e?.[r]}}var vb=_b,mb=fs;function wb(r){return function(e){return mb(e,r)}}var bb=wb,$b=vb,Eb=bb,Sb=si,Ab=Tt;function Ob(r){return Sb(r)?$b(Ab(r)):Eb(r)}var Ib=Ob,xb=t0,Pb=gb,Tb=vt,Rb=G,Fb=Ib;function Mb(r){return typeof r=="function"?r:r==null?Tb:typeof r=="object"?Rb(r)?Pb(r[0],r[1]):xb(r):Fb(r)}var cs=Mb,Db=mg,Cb=Jg,Nb=cs,Bb=G,Ub=wo;function qb(r,e,t){var n=Bb(r)?Db:Cb;return t&&Ub(r,e,t)&&(e=void 0),n(r,Nb(e))}var ci=qb;Object.defineProperty(De,"__esModule",{value:!0}),De.calculatePadding=Vb,De.slicePadding=Gb;var kb=ci,Lb=jb(kb);function jb(r){return r&&r.__esModule?r:{default:r}}function Vb(r){switch(r%4){case 0:return 0;case 1:return 3;case 2:return 2;case 3:return 1;default:return null}}function Gb(r,e){var t=r.slice(e),n=(0,Lb.default)(t.buffer(),function(i){return i===0});if(n!==!0)throw new Error("XDR Read Error: invalid padding")}Object.defineProperty(bt,"__esModule",{value:!0}),bt.Cursor=void 0;var Hb=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),Wb=De;function zb(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var li=function(){function r(e){zb(this,r),e instanceof h||(e=typeof e=="number"?h.alloc(e):h.from(e)),this._setBuffer(e),this.rewind()}return Hb(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 h?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=h.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,Wb.calculatePadding)(t.length),i=h.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){li.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){li.prototype[e]=function(n){return this.buffer()[e](n,this.tell()),this.seek("+",r[0]),this}})}),bt.Cursor=li,Object.defineProperty(D,"__esModule",{value:!0}),D.default=e1;var Xb=_g,ls=ps(Xb),Yb=zn,Kb=ps(Yb),ds=bt;function ps(r){return r&&r.__esModule?r:{default:r}}var Zb=Math.pow(2,16),Jb={toXDR:function(e){var t=new ds.Cursor(Zb);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=h.from(e,"hex");break;case"base64":n=h.from(e,"base64");break;default:throw new Error("Invalid format "+t+', must be "raw", "hex", "base64"')}var i=new ds.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}}},Qb={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 e1(r){(0,ls.default)(r,Jb),(0,Kb.default)(r)&&(0,ls.default)(r.prototype,Qb)}Object.defineProperty(ue,"__esModule",{value:!0}),ue.Int=void 0;var r1=gt,hs=ys(r1),t1=D,n1=ys(t1);function ys(r){return r&&r.__esModule?r:{default:r}}var Ir=ue.Int={read:function(e){return e.readInt32BE()},write:function(e,t){if(!(0,hs.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,hs.default)(e)||Math.floor(e)!==e?!1:e>=Ir.MIN_VALUE&&e<=Ir.MAX_VALUE}};Ir.MAX_VALUE=Math.pow(2,31)-1,Ir.MIN_VALUE=-Math.pow(2,31),(0,n1.default)(Ir);var Rt={};function i1(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 gs={exports:{}};(function(r){/**
21
21
  * @license Long.js (c) 2013 Daniel Wirtz <dcode@dcode.io>
22
22
  * Released under the Apache License, Version 2.0
23
23
  * see: https://github.com/dcodeIO/Long.js for details
24
- */(function(e,t){typeof i1=="function"&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(U,function(){function e(l,u,d){this.low=l|0,this.high=u|0,this.unsigned=!!d}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,d){var y,b;return d?(u=u>>>0,0<=u&&u<256&&(b=n[u],b)?b:(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&&(b=t[u],b)?b:(y=new e(u,u<0?-1:0,!1),-128<=u&&u<128&&(t[u]=y),y))},e.fromNumber=function(u,d){return d=!!d,isNaN(u)||!isFinite(u)?e.ZERO:!d&&u<=-f?e.MIN_VALUE:!d&&u+1>=f?e.MAX_VALUE:d&&u>=s?e.MAX_UNSIGNED_VALUE:u<0?e.fromNumber(-u,d).negate():new e(u%o|0,u/o|0,d)},e.fromBits=function(u,d,y){return new e(u,d,y)},e.fromString=function(u,d,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 d=="number"&&(y=d,d=!1),y=y||10,y<2||36<y)throw Error("radix out of range: "+y);var b;if((b=u.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+u);if(b===0)return e.fromString(u.substring(1),d,y).negate();for(var S=e.fromNumber(Math.pow(y,8)),O=e.ZERO,$=0;$<u.length;$+=8){var E=Math.min(8,u.length-$),p=parseInt(u.substring($,$+E),y);if(E<8){var I=e.fromNumber(Math.pow(y,E));O=O.multiply(I).add(e.fromNumber(p))}else O=O.multiply(S),O=O.add(e.fromNumber(p))}return O.unsigned=d,O},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=65536,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 d;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var y=e.fromNumber(u),b=this.divide(y);return d=b.multiply(y).subtract(this),b.toString(u)+d.toInt().toString(u)}else return"-"+this.negate().toString(u);var S=e.fromNumber(Math.pow(u,6),this.unsigned);d=this;for(var O="";;){var $=d.divide(S),E=d.subtract($.multiply(S)).toInt()>>>0,p=E.toString(u);if(d=$,d.isZero())return p+O;for(;p.length<6;)p="0"+p;O=""+p+O}},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,d=31;d>0&&!(u&1<<d);d--);return this.high!=0?d+33:d+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 d=this.isNegative(),y=u.isNegative();return d&&!y?-1:!d&&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 d=this.high>>>16,y=this.high&65535,b=this.low>>>16,S=this.low&65535,O=u.high>>>16,$=u.high&65535,E=u.low>>>16,p=u.low&65535,I=0,T=0,F=0,m=0;return m+=S+p,F+=m>>>16,m&=65535,F+=b+E,T+=F>>>16,F&=65535,T+=y+$,I+=T>>>16,T&=65535,I+=d+O,I&=65535,e.fromBits(F<<16|m,I<<16|T,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 d=this.high>>>16,y=this.high&65535,b=this.low>>>16,S=this.low&65535,O=u.high>>>16,$=u.high&65535,E=u.low>>>16,p=u.low&65535,I=0,T=0,F=0,m=0;return m+=S*p,F+=m>>>16,m&=65535,F+=b*p,T+=F>>>16,F&=65535,F+=S*E,T+=F>>>16,F&=65535,T+=y*p,I+=T>>>16,T&=65535,T+=b*E,I+=T>>>16,T&=65535,T+=S*$,I+=T>>>16,T&=65535,I+=d*p+y*E+b*$+S*O,I&=65535,e.fromBits(F<<16|m,I<<16|T,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 d,y,b;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 S=this.shiftRight(1);return d=S.divide(u).shiftLeft(1),d.equals(e.ZERO)?u.isNegative()?e.ONE:e.NEG_ONE:(y=this.subtract(u.multiply(d)),b=d.add(y.divide(u)),b)}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(b=e.ZERO,y=this;y.greaterThanOrEqual(u);){d=Math.max(1,Math.floor(y.toNumber()/u.toNumber()));for(var O=Math.ceil(Math.log(d)/Math.LN2),$=O<=48?1:Math.pow(2,O-48),E=e.fromNumber(d),p=E.multiply(u);p.isNegative()||p.greaterThan(y);)d-=$,E=e.fromNumber(d,this.unsigned),p=E.multiply(u);E.isZero()&&(E=e.ONE),b=b.add(E),y=y.subtract(p)}return b},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 d=this.high;if(u<32){var y=this.low;return e.fromBits(y>>>u|d<<32-u,d>>>u,this.unsigned)}else return u===32?e.fromBits(d,0,this.unsigned):e.fromBits(d>>>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})})(gs);var _s=gs.exports;Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.Hyper=void 0;var a1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),vs=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)}},o1=_s,xr=ms(o1),s1=D,u1=ms(s1);function ms(r){return r&&r.__esModule?r:{default:r}}function f1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function c1(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 l1(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 Pr=Rt.Hyper=function(r){l1(e,r),a1(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=vs(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=vs(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 f1(this,e),c1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(xr.default);(0,u1.default)(Pr),Pr.MAX_VALUE=new Pr(xr.default.MAX_VALUE.low,xr.default.MAX_VALUE.high),Pr.MIN_VALUE=new Pr(xr.default.MIN_VALUE.low,xr.default.MIN_VALUE.high);var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.UnsignedInt=void 0;var d1=gt,ws=bs(d1),p1=D,h1=bs(p1);function bs(r){return r&&r.__esModule?r:{default:r}}var Tr=Ne.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,ws.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,ws.default)(e)||Math.floor(e)!==e?!1:e>=Tr.MIN_VALUE&&e<=Tr.MAX_VALUE}};Tr.MAX_VALUE=Math.pow(2,32)-1,Tr.MIN_VALUE=0,(0,h1.default)(Tr);var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.UnsignedHyper=void 0;var y1=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}}(),$s=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)}},g1=_s,Rr=Es(g1),_1=D,v1=Es(_1);function Es(r){return r&&r.__esModule?r:{default:r}}function m1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function w1(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 b1(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 Fr=Ft.UnsignedHyper=function(r){b1(e,r),y1(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=$s(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=$s(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 m1(this,e),w1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(Rr.default);(0,v1.default)(Fr),Fr.MAX_VALUE=new Fr(Rr.default.MAX_UNSIGNED_VALUE.low,Rr.default.MAX_UNSIGNED_VALUE.high),Fr.MIN_VALUE=new Fr(Rr.default.MIN_VALUE.low,Rr.default.MIN_VALUE.high);var Mt={};Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.Float=void 0;var $1=gt,Ss=As($1),E1=D,S1=As(E1);function As(r){return r&&r.__esModule?r:{default:r}}var A1=Mt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,Ss.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,Ss.default)(e)}};(0,S1.default)(A1);var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.Double=void 0;var O1=gt,Os=Is(O1),I1=D,x1=Is(I1);function Is(r){return r&&r.__esModule?r:{default:r}}var P1=Dt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,Os.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,Os.default)(e)}};(0,x1.default)(P1);var Ct={};Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.Quadruple=void 0;var T1=D,R1=F1(T1);function F1(r){return r&&r.__esModule?r:{default:r}}var M1=Ct.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,R1.default)(M1);var Mr={},D1=ge,C1=_e,N1="[object Boolean]";function B1(r){return r===!0||r===!1||C1(r)&&D1(r)==N1}var U1=B1;Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.Bool=void 0;var q1=U1,k1=Ps(q1),xs=ue,L1=D,j1=Ps(L1);function Ps(r){return r&&r.__esModule?r:{default:r}}var V1=Mr.Bool={read:function(e){var t=xs.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 xs.Int.write(n,t)},isValid:function(e){return(0,k1.default)(e)}};(0,j1.default)(V1);var Nt={},G1=ge,H1=G,W1=_e,z1="[object String]";function X1(r){return typeof r=="string"||!H1(r)&&W1(r)&&G1(r)==z1}var Ts=X1;Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.String=void 0;var Y1=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}}(),K1=Ts,Rs=di(K1),Z1=G,J1=di(Z1),Fs=ue,Q1=Ne,Ms=De,e$=D,r$=di(e$);function di(r){return r&&r.__esModule?r:{default:r}}function t$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var n$=Nt.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Q1.UnsignedInt.MAX_VALUE;t$(this,r),this._maxLength=e}return Y1(r,[{key:"read",value:function(t){var n=Fs.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,Ms.calculatePadding)(n),a=t.slice(n);return(0,Ms.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,Rs.default)(t)?i=h.from(t,"utf8"):i=h.from(t),Fs.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,Rs.default)(t))n=h.from(t,"utf8");else if((0,J1.default)(t)||h.isBuffer(t))n=h.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,r$.default)(n$.prototype);var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Opaque=void 0;var i$=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}}(),Ds=De,a$=D,o$=s$(a$);function s$(r){return r&&r.__esModule?r:{default:r}}function u$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var f$=Bt.Opaque=function(){function r(e){u$(this,r),this._length=e,this._padding=(0,Ds.calculatePadding)(e)}return i$(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Ds.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 h.isBuffer(t)&&t.length===this._length}}]),r}();(0,o$.default)(f$.prototype);var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.VarOpaque=void 0;var c$=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}}(),Cs=ue,l$=Ne,Ns=De,d$=D,p$=h$(d$);function h$(r){return r&&r.__esModule?r:{default:r}}function y$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var g$=Ut.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:l$.UnsignedInt.MAX_VALUE;y$(this,r),this._maxLength=e}return c$(r,[{key:"read",value:function(t){var n=Cs.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,Ns.calculatePadding)(n),a=t.slice(n);return(0,Ns.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));Cs.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return h.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,p$.default)(g$.prototype);var qt={};function _$(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var v$=_$,m$=vt;function w$(r){return typeof r=="function"?r:m$}var Bs=w$,b$=v$,$$=Zn,E$=Bs,S$=G;function A$(r,e){var t=S$(r)?b$:$$;return t(r,E$(e))}var O$=A$,ir=O$,I$=/\s/;function x$(r){for(var e=r.length;e--&&I$.test(r.charAt(e)););return e}var P$=x$,T$=P$,R$=/^\s+/;function F$(r){return r&&r.slice(0,T$(r)+1).replace(R$,"")}var M$=F$,D$=M$,Us=Je,C$=Pt,qs=0/0,N$=/^[-+]0x[0-9a-f]+$/i,B$=/^0b[01]+$/i,U$=/^0o[0-7]+$/i,q$=parseInt;function k$(r){if(typeof r=="number")return r;if(C$(r))return qs;if(Us(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Us(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=D$(r);var t=B$.test(r);return t||U$.test(r)?q$(r.slice(2),t?2:8):N$.test(r)?qs:+r}var L$=k$,j$=L$,ks=1/0,V$=17976931348623157e292;function G$(r){if(!r)return r===0?r:0;if(r=j$(r),r===ks||r===-ks){var e=r<0?-1:1;return e*V$}return r===r?r:0}var H$=G$,W$=H$;function z$(r){var e=W$(r),t=e%1;return e===e?t?e-t:e:0}var X$=z$,Y$=bo,K$=Bs,Z$=X$,J$=9007199254740991,pi=4294967295,Q$=Math.min;function eE(r,e){if(r=Z$(r),r<1||r>J$)return[];var t=pi,n=Q$(r,pi);e=K$(e),r-=pi;for(var i=Y$(n,e);++t<r;)e(t);return i}var Ls=eE;Object.defineProperty(qt,"__esModule",{value:!0}),qt.Array=void 0;var rE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),tE=ci,nE=Dr(tE),iE=ir,aE=Dr(iE),oE=Ls,sE=Dr(oE),uE=G,js=Dr(uE),fE=D,cE=Dr(fE);function Dr(r){return r&&r.__esModule?r:{default:r}}function lE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var dE=qt.Array=function(){function r(e,t){lE(this,r),this._childType=e,this._length=t}return rE(r,[{key:"read",value:function(t){var n=this;return(0,sE.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,js.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,aE.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,js.default)(t)||t.length!==this._length?!1:(0,nE.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,cE.default)(dE.prototype);var kt={};Object.defineProperty(kt,"__esModule",{value:!0}),kt.VarArray=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}}(),hE=ci,yE=Cr(hE),gE=ir,_E=Cr(gE),vE=Ls,mE=Cr(vE),wE=G,Vs=Cr(wE),bE=Ne,Gs=ue,$E=D,EE=Cr($E);function Cr(r){return r&&r.__esModule?r:{default:r}}function SE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var AE=kt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bE.UnsignedInt.MAX_VALUE;SE(this,r),this._childType=e,this._maxLength=t}return pE(r,[{key:"read",value:function(t){var n=this,i=Gs.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,mE.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,Vs.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));Gs.Int.write(t.length,n),(0,_E.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,Vs.default)(t)||t.length>this._maxLength?!1:(0,yE.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,EE.default)(AE.prototype);var Lt={};function OE(r){return r===null}var IE=OE;function xE(r){return r===void 0}var Nr=xE;Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.Option=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}}(),TE=IE,Hs=hi(TE),RE=Nr,Ws=hi(RE),zs=Mr,FE=D,ME=hi(FE);function hi(r){return r&&r.__esModule?r:{default:r}}function DE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var CE=Lt.Option=function(){function r(e){DE(this,r),this._childType=e}return PE(r,[{key:"read",value:function(t){if(zs.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,Hs.default)(t)||(0,Ws.default)(t));zs.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,Hs.default)(t)||(0,Ws.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,ME.default)(CE.prototype);var Br={};Object.defineProperty(Br,"__esModule",{value:!0}),Br.Void=void 0;var NE=Nr,Xs=Ys(NE),BE=D,UE=Ys(BE);function Ys(r){return r&&r.__esModule?r:{default:r}}var qE=Br.Void={read:function(){},write:function(e){if(!(0,Xs.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,Xs.default)(e)}};(0,UE.default)(qE);var jt={},kE=fi;function LE(r,e){return kE(e,function(t){return r[t]})}var jE=LE,VE=jE,GE=$t;function HE(r){return r==null?[]:VE(r,GE(r))}var WE=HE;Object.defineProperty(jt,"__esModule",{value:!0}),jt.Enum=void 0;var zE=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=ir,YE=yi(XE),KE=WE,ZE=yi(KE),Ks=ue,JE=D,QE=yi(JE);function yi(r){return r&&r.__esModule?r:{default:r}}function eS(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 rS(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 Zs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var tS=jt.Enum=function(){function r(e,t){Zs(this,r),this.name=e,this.value=t}return zE(r,null,[{key:"read",value:function(t){var n=Ks.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);Ks.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,ZE.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){rS(s,o);function s(){return Zs(this,s),eS(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,YE.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,QE.default)(tS);var Vt={},nS=Zn,iS=Or;function aS(r,e){var t=-1,n=iS(r)?Array(r.length):[];return nS(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var oS=aS,sS=fi,uS=cs,fS=oS,cS=G;function lS(r,e){var t=cS(r)?sS:fS;return t(r,uS(e))}var dS=lS;function pS(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 hS=pS,Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});var yS=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 gS(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Ur.Reference=function(){function r(){gS(this,r)}return yS(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.Struct=void 0;var Gt=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")}}(),_S=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),vS=ir,Js=qr(vS),mS=dS,wS=qr(mS),bS=Nr,$S=qr(bS),ES=hS,SS=qr(ES),AS=Ur,OS=D,IS=qr(OS);function qr(r){return r&&r.__esModule?r:{default:r}}function xS(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 PS(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 Qs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var TS=Vt.Struct=function(){function r(e){Qs(this,r),this._attributes=e||{}}return _S(r,null,[{key:"read",value:function(t){var n=(0,wS.default)(this._fields,function(i){var a=Gt(i,2),o=a[0],s=a[1],f=s.read(t);return[o,f]});return new this((0,SS.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,Js.default)(this._fields,function(i){var a=Gt(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){PS(s,o);function s(){return Qs(this,s),xS(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=Gt(o,2),f=s[0],c=s[1];return c instanceof AS.Reference&&(c=c.resolve(t)),[f,c]}),(0,Js.default)(a._fields,function(o){var s=Gt(o,1),f=s[0];a.prototype[f]=RS(f)}),a}}]),r}();(0,IS.default)(TS);function RS(r){return function(t){return(0,$S.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.Union=void 0;var FS=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")}}(),MS=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}}(),DS=ir,Wt=Xt(DS),CS=Nr,eu=Xt(CS),NS=Ts,ru=Xt(NS),zt=Br,gi=Ur,BS=D,US=Xt(BS);function Xt(r){return r&&r.__esModule?r:{default:r}}function qS(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 kS(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 tu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var LS=Ht.Union=function(){function r(e,t){tu(this,r),this.set(e,t)}return MS(r,[{key:"set",value:function(t,n){(0,ru.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!==zt.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===zt.Void?zt.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,eu.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){kS(f,s);function f(){return tu(this,f),qS(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof gi.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,Wt.default)(i.arms,function(s,f){s instanceof gi.Reference&&(s=s.resolve(t)),a._arms[f]=s});var o=i.defaultArm;return o instanceof gi.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Wt.default)(i.switches,function(s){var f=FS(s,2),c=f[0],l=f[1];(0,ru.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,eu.default)(a._switchOn.values)||(0,Wt.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,Wt.default)(a._arms,function(s,f){s!==zt.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,US.default)(LS),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ue;Object.keys(e).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return e[p]}})});var t=Rt;Object.keys(t).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return t[p]}})});var n=Ne;Object.keys(n).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return n[p]}})});var i=Ft;Object.keys(i).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return i[p]}})});var a=Mt;Object.keys(a).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return a[p]}})});var o=Dt;Object.keys(o).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return o[p]}})});var s=Ct;Object.keys(s).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return s[p]}})});var f=Mr;Object.keys(f).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return f[p]}})});var c=Nt;Object.keys(c).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return c[p]}})});var l=Bt;Object.keys(l).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return l[p]}})});var u=Ut;Object.keys(u).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return u[p]}})});var d=qt;Object.keys(d).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return d[p]}})});var y=kt;Object.keys(y).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return y[p]}})});var b=Lt;Object.keys(b).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return b[p]}})});var S=Br;Object.keys(S).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return S[p]}})});var O=jt;Object.keys(O).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return O[p]}})});var $=Vt;Object.keys($).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return $[p]}})});var E=Ht;Object.keys(E).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return E[p]}})})}(Wn);var nu={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(g,_){for(var A=0;A<_.length;A++){var x=_[A];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(g,x.key,x)}}return function(g,_,A){return _&&m(g.prototype,_),A&&m(g,A),g}}(),t=Ur;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=b;var n=Nr,i=l(n),a=ir,o=l(a),s=Wn,f=c(s);function c(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(g[_]=m[_]);return g.default=m,g}function l(m){return m&&m.__esModule?m:{default:m}}function u(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function d(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function y(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}function b(m){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var _=new F(g);m(_),_.resolve()}return g}var S=function(m){y(g,m);function g(_){u(this,g);var A=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return A.name=_,A}return e(g,[{key:"resolve",value:function(A){var x=A.definitions[this.name];return x.resolve(A)}}]),g}(t.Reference),O=function(m){y(g,m);function g(_,A){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,g);var M=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return M.childReference=_,M.length=A,M.variable=x,M}return e(g,[{key:"resolve",value:function(A){var x=this.childReference,M=this.length;return x instanceof t.Reference&&(x=x.resolve(A)),M instanceof t.Reference&&(M=M.resolve(A)),this.variable?new f.VarArray(x,M):new f.Array(x,M)}}]),g}(t.Reference),$=function(m){y(g,m);function g(_){u(this,g);var A=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return A.childReference=_,A.name=_.name,A}return e(g,[{key:"resolve",value:function(A){var x=this.childReference;return x instanceof t.Reference&&(x=x.resolve(A)),new f.Option(x)}}]),g}(t.Reference),E=function(m){y(g,m);function g(_,A){u(this,g);var x=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return x.sizedType=_,x.length=A,x}return e(g,[{key:"resolve",value:function(A){var x=this.length;return x instanceof t.Reference&&(x=x.resolve(A)),new this.sizedType(x)}}]),g}(t.Reference),p=function(){function m(g,_,A){u(this,m),this.constructor=g,this.name=_,this.config=A}return e(m,[{key:"resolve",value:function(_){return this.name in _.results?_.results[this.name]:this.constructor(_,this.name,this.config)}}]),m}();function I(m,g,_){return _ instanceof t.Reference&&(_=_.resolve(m)),m.results[g]=_,_}function T(m,g,_){return m.results[g]=_,_}var F=function(){function m(g){u(this,m),this._destination=g,this._definitions={}}return e(m,[{key:"enum",value:function(_,A){var x=new p(f.Enum.create,_,A);this.define(_,x)}},{key:"struct",value:function(_,A){var x=new p(f.Struct.create,_,A);this.define(_,x)}},{key:"union",value:function(_,A){var x=new p(f.Union.create,_,A);this.define(_,x)}},{key:"typedef",value:function(_,A){var x=new p(I,_,A);this.define(_,x)}},{key:"const",value:function(_,A){var x=new p(T,_,A);this.define(_,x)}},{key:"void",value:function(){return f.Void}},{key:"bool",value:function(){return f.Bool}},{key:"int",value:function(){return f.Int}},{key:"hyper",value:function(){return f.Hyper}},{key:"uint",value:function(){return f.UnsignedInt}},{key:"uhyper",value:function(){return f.UnsignedHyper}},{key:"float",value:function(){return f.Float}},{key:"double",value:function(){return f.Double}},{key:"quadruple",value:function(){return f.Quadruple}},{key:"string",value:function(_){return new E(f.String,_)}},{key:"opaque",value:function(_){return new E(f.Opaque,_)}},{key:"varOpaque",value:function(_){return new E(f.VarOpaque,_)}},{key:"array",value:function(_,A){return new O(_,A)}},{key:"varArray",value:function(_,A){return new O(_,A,!0)}},{key:"option",value:function(_){return new $(_)}},{key:"define",value:function(_,A){if((0,i.default)(this._destination[_]))this._definitions[_]=A;else throw new Error("XDRTypes Error:"+_+" is already defined")}},{key:"lookup",value:function(_){return new S(_)}},{key:"resolve",value:function(){var _=this;(0,o.default)(this._definitions,function(A){A.resolve({definitions:_._definitions,results:_._destination})})}}]),m}()})(nu),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Wn;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=nu;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(oo);var _i=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)},j=(r,e,t)=>(_i(r,e,"read from private field"),t?t.call(r):e.get(r)),Be=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},vi=(r,e,t,n)=>(_i(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),ve=(r,e,t)=>(_i(r,e,"access private method"),t),ne,ie,kr,mi,iu,wi,au,Yt,bi,ar,Lr;function jS(r){const e={variantId:ce.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new ce.BundleItem({collectionId:ce.Uint64.fromString(n.collectionId.toString()),productId:ce.Uint64.fromString(n.productId.toString()),variantId:ce.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new ce.BundleItemExt(0)})),ext:new ce.BundleExt(0)},t=new ce.Bundle(e);return ce.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const ce=oo.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")}})});class VS{constructor(e,t){Be(this,mi),Be(this,wi),Be(this,Yt),Be(this,ar),Be(this,ne,void 0),Be(this,ie,void 0),Be(this,kr,void 0),vi(this,ne,ve(this,mi,iu).call(this,t)),vi(this,kr,ve(this,wi,au).call(this,t)),vi(this,ie,e)}isInitialDataValid(){if(!j(this,kr))throw"Bundle data does not exist for the given product.";if(!j(this,ne))throw"Bundle settings do not exist for the given product.";if(!Array.isArray(j(this,ie))||!j(this,ie).length)throw"No bundle selection items provided.";return!0}isValidVariant(e){if(!j(this,ne)?.variantsSettings[e])throw`The ${e} bundle variant is invalid.`;return!0}isSelectionInVariantRange(e){const t=j(this,ie).reduce((i,a)=>i+a.quantity,0),n=j(this,ne)?.variantsSettings[e].ranges||[];if(!ve(this,Yt,bi).call(this,n,t))throw"The total number of products does not fall within the required variant range.";return!0}areItemsInMaxPerItemBound(){const e=j(this,ne)?.bundleSettings.maxPerItem||0,t=j(this,ie).filter(({quantity:n})=>n>e);if(e&&t.length)throw`The selected products (${ve(this,ar,Lr).call(this,t.map(({externalProductId:n})=>n)).join(", ")}) exceed the maximum limit of ${e} items per product.`;return!0}areSelectedCollectionsValid(e){const t=j(this,ne)?.variantsSettings[e],n=j(this,ie).filter(({collectionId:i})=>!t?.optionSources[i]);if(n.length)throw`The collections (${ve(this,ar,Lr).call(this,n.map(({collectionId:i})=>i)).join(", ")}) are no longer valid for the bundle variant (${e}).`;return!0}areItemsQuantitiesValidForTheCollection(e){const t=j(this,ie).reduce((a,o)=>(a[o.collectionId]=o.quantity+(a[o.collectionId]||0),a),{}),n=j(this,ne)?.variantsSettings[e],i=Object.values(n?.optionSources||{}).filter(a=>{const o=t[a.collectionId]||0;return!ve(this,Yt,bi).call(this,[a],o)});if(!n||i.length)throw`The selection exceeds the limits for the collections (${ve(this,ar,Lr).call(this,i.map(({collectionId:a})=>a)).join(", ")}).`;return!0}areSelectedProductsValid(e){const t=j(this,ne)?.variantsSettings[e]?.optionSources||{},n=Object.values(t).reduce((a,o)=>{const s=j(this,kr)?.collections[o.collectionId];return s&&(a[o.collectionId]=s),a},{});if(!Object.values(n).length)throw`No collections found for the bundle variant (${e}).`;const i=j(this,ie).filter(({externalProductId:a,collectionId:o})=>!n[o]?.products[a]);if(i.length)throw`The products (${ve(this,ar,Lr).call(this,i.map(({externalProductId:a})=>a)).join(", ")}) are no longer valid for the bundle product.`;return!0}isBundleSelectionValid(e){return this.isInitialDataValid(),this.isValidVariant(e),this.isSelectionInVariantRange(e),this.areItemsInMaxPerItemBound(),this.areSelectedCollectionsValid(e),this.areItemsQuantitiesValidForTheCollection(e),this.areSelectedProductsValid(e),!0}}ne=new WeakMap,ie=new WeakMap,kr=new WeakMap,mi=new WeakSet,iu=function(r){try{const e=r.bundle_settings;return{bundleSettings:{maxPerItem:e.max_quantity_per_variant,isCustomizable:e.is_customizable},variantsSettings:e.variants.reduce((t,n)=>{if(!n.enabled)return t;let i=[{min:n.items_count,max:n.items_count}];return n.items_count||(i=n.ranges.map(({quantity_max:a,quantity_min:o})=>({min:o,max:a}))),t[n.external_variant_id]={externalVariantId:n.external_variant_id,optionSources:n.option_sources.reduce((a,o)=>(a[o.option_source_id]={min:o.quantity_min,max:o.quantity_max,collectionId:o.option_source_id},a),{}),ranges:i},t},{})}}catch{return null}},wi=new WeakSet,au=function(r){try{const e=Object.values(r.collections).reduce((t,n)=>(t[n.id]={...n,products:n.products.reduce((i,a)=>(i[a.id]=a,i),{})},t),{});return{...r,collections:e}}catch{return null}},Yt=new WeakSet,bi=function(r,e){return!!r.filter(({min:t,max:n})=>{const i=t??e,a=n??e;return i<=e&&e<=a}).length},ar=new WeakSet,Lr=function(r){return Array.from(new Set(r))};const GS="/bundling-storefront-manager";function ou(r){return jS({variantId:r.externalVariantId,version:0,items:r.selections.map(e=>({collectionId:e.collectionId,productId:e.externalProductId,variantId:e.externalVariantId,quantity:e.quantity,sku:""}))})}async function HS(r){const e=V(),t=await $i(r);if(t!==!0)throw new Error(t);const n=ou(r);try{const i=await Fe("post",`${GS}/api/v1/bundles`,{data:{bundle:n},headers:{Origin:`https://${e.storeIdentifier}`}});if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}async function WS(r,e){const t=await $i(e);if(t!==!0)throw new Error(t);const n=ou(e);try{const i=await w("post","/bundle_selections/bundle_id",{data:{bundle:n}},v(r,"getBundleSelectionId"));if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}function zS(r,e){const t=su(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${Wi(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 $i(r){try{return r?r.selections.length===0?"No selections defined":!0:"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}async function XS(r){try{const e=await Fe("get",`/bundle-data/${r.externalProductId}`);return{valid:new VS(r.selections,e).isBundleSelectionValid(r.externalVariantId)}}catch(e){return{valid:!1,error:String(e)}}}const YS={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 su(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=YS[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 KS(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{bundle_selection:t}=await w("get","/bundle_selections",{id:e},v(r,"getBundleSelection"));return t}function ZS(r,e){return w("get","/bundle_selections",{query:e},v(r,"listBundleSelections"))}async function JS(r,e){const{bundle_selection:t}=await w("post","/bundle_selections",{data:e},v(r,"createBundleSelection"));return t}async function QS(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{bundle_selection:n}=await w("put","/bundle_selections",{id:e,data:t},v(r,"updateBundleSelection"));return n}function eA(r,e){if(e===void 0||e==="")throw new Error("ID is required");return w("delete","/bundle_selections",{id:e},v(r,"deleteBundleSelection"))}async function rA(r,e,t,n){if(e===void 0||e==="")throw new Error("Purchase item ID is required");const{subscription:i}=await w("put","/bundles",{id:e,data:t,query:n},v(r,"updateBundle"));return i}var tA=Object.freeze({__proto__:null,createBundleSelection:JS,deleteBundleSelection:eA,getBundleId:HS,getBundleSelection:KS,getBundleSelectionId:WS,getDynamicBundleItems:zS,listBundleSelections:ZS,updateBundle:rA,updateBundleSelection:QS,validateBundle:$i,validateBundleSelection:XS,validateDynamicBundle:su});const nA=r=>{const e=r.layout_settings.addons,t=r.layout_settings.crossSells,n=r.customization_window,i=r.default_bundle_variant_id,a=r.layout_settings.defaultFrequency,o=r.layout_settings.addToCartCallback;return{default_variant_id:i?String(i):null,is_customizable:r.is_customizable,price_rule:String(r.price_rule).toUpperCase(),customization_window:n?{active_days:n,disabled_message:r.customization_window_disabled_message||""}:null,addons:e.collectionId?{collection_id:e.collectionId,collection_handle:e.collectionHandle}:null,cross_sells:t.collectionId?{collection_id:e.collectionId,collection_handle:e.collectionHandle}:null,default_selling_plan_id:a||null,collapsible_collections:r.layout_settings.collapsibleSections,max_quantity_per_variant:r.max_quantity_per_variant,show_product_variants:r.layout_settings.showVariants,product_details_modal_enabled:r.layout_settings.learnMoreModal,addToCartBehavior:{type:o.type==="none"?"cart_page":o.type,value:o.value}}},iA=r=>r.tiered_discounts.length===0?null:{tiered_discounts:r.tiered_discounts.map(e=>({eligible_charge_types:e.eligible_charge_types,eligible_line_item_types:e.eligible_line_item_types,external_bundle_product_id:{ecommerce:e.external_bundle_product_id.ecommerce},lookup_key:e.lookup_key,name:e.name,status:e.status,tiers:e.tiers.map(({tier:t})=>({tier:{lookup_key:t.lookup_key,discount_type:t.discount_type,discount_value:t.discount_value,condition_quantity_gte:t.condition_quantity_gte}}))}))},Kt=r=>({id:r.id,name:r.name,options:r.options.map(e=>({name:e.name,value:e.value})),recurring_deliveries:r.recurring_deliveries,price_adjustments:r.price_adjustments.map(({value:e,value_type:t})=>({value:e,value_type:t}))}),uu=r=>({name:r.name,options:r.options.map(e=>({name:e.name,values:e.values})),selling_plans:r.selling_plans.map(Kt)}),fu=r=>({id:String(r.id),title:r.title,price:r.price,compare_at_price:r.compare_at_price,options:r.options,available_for_sale:r.available}),Ei=r=>r==null||typeof r=="string"?r:"src"in r?r.src:null,cu=r=>({id:String(r.id),title:r.title,description:r.description,available_for_sale:r.available,featured_image:Ei(r.featured_image),images:r.images,requires_selling_plan:r.requires_selling_plan,selling_plan_groups:r.selling_plan_groups.map(uu)}),lu=r=>{const e=oA(r.selling_plan_groups);return{...cu(r),handle:r.handle,tags:r.tags,price_range:{min:r.price_min,max:r.price_max},compare_at_price_range:{min:r.compare_at_price_min,max:r.compare_at_price_max},options:r.options,variants:r.variants.map(t=>({...fu(t),selling_plan_allocations:t.selling_plan_allocations.map(n=>({price:n.price,compare_at_price:n.compare_at_price,selling_plan:Kt(e[`${n.selling_plan_group_id}-${n.selling_plan_id}`])})),option1:t.option1,option2:t.option2,option3:t.option3,sku:t.sku||"",requires_shipping:t.requires_shipping,taxable:t.taxable,featured_image:Ei(t.featured_image),public_title:t.public_title,requires_selling_plan:t.requires_selling_plan}))}},aA=({items_count:r,ranges:e})=>e.length>0?e.map(({quantity_max:t,quantity_min:n})=>({min:n,max:t})):[{min:r,max:r}],oA=r=>r.reduce((e,t)=>(t.selling_plans.forEach(n=>{const i=`${t.id}-${n.id}`;e[i]=n}),e),{});function Si(r){const e=nA(r.bundle_settings),t=r.variants.reduce((n,i)=>(n[i.id]=i,n),{});return{id:String(r.id),title:r.title,handle:r.handle,options:r.options.map(n=>({name:n.name,position:n.position,values:n.values})),default_variant_id:e.default_variant_id,default_selling_plan_id:e.default_selling_plan_id?Number(e.default_selling_plan_id):null,available_for_sale:r.available,requires_selling_plan:r.requires_selling_plan,bundle_settings:{is_customizable:e.is_customizable,price_rule:e.price_rule,customization_window:e.customization_window,max_quantity_per_variant:e.max_quantity_per_variant,collapsible_collections:e.collapsible_collections,show_product_variants:e.show_product_variants,product_details_modal_enabled:e.product_details_modal_enabled,show_variants_as_individual_products:r.bundle_settings.settings.display_variants_as_separate_products_in_list,post_add_to_cart_behavior:e.addToCartBehavior},variants:r.bundle_settings.variants.filter(({enabled:n})=>n).map((n,i)=>{const a=t[String(n.external_variant_id)];return{id:String(n.external_variant_id),title:a.title,price:a.price,compare_at_price:a.compare_at_price,image:a.image||"",available_for_sale:a.available,options:a.options,requires_selling_plan:a.requires_selling_plan,selling_plan_allocations:a.selling_plan_allocations.map(o=>({price:o.price,compare_at_price:o.compare_at_price,selling_plan:Kt(o.selling_plan)})),ranges:aA(n),collections:n.option_sources.map(o=>({id:o.option_source_id,source_platform:"shopify",min:o.quantity_min||0,max:o.quantity_max,position:o.position})),default_selections:n.selection_defaults.map(o=>({quantity:o.quantity,product:{id:String(o.product.id),handle:o.handle,title:o.product.title,description:o.product.description,images:o.product.images},variant:{id:o.external_variant_id,title:o.variant.title,featured_image:Ei(o.variant.featured_image),sku:o.sku||""}})),position:i}}),selling_plan_groups:r.selling_plan_groups.map(uu),collections:Object.values(r.collections).reduce((n,i)=>(Array.isArray(i.products)&&(n[String(i.id)]={id:String(i.id),title:i.title,handle:i.handle,products:i.products.map(lu)}),n),{}),addons:r.addons.products.length?{collection_id:e.addons?.collection_id||"",collection_handle:e.addons?.collection_handle||"",products:r.addons.products.map(n=>({...cu(n),price_range:{min:n.price,max:n.price},compare_at_price_range:{min:n.compare_at_price||0,max:n.compare_at_price},variants:n.variants.map(i=>({...fu(i),image:i.image,selling_plan_allocations:i.selling_plan_allocations.map(a=>({price:a.price,compare_at_price:a.compare_at_price,selling_plan:Kt(a.selling_plan)}))}))}))}:null,cross_sells:r.cross_sells.products.length?{collection_id:e.cross_sells?.collection_id||"",collection_handle:e.cross_sells?.collection_handle||"",products:r.cross_sells.products.map(lu)}:null,incentives:iA(r.incentives)}}async function sA(r,e){return e?.source==="shopify_storefront"?fA():uA(r,e?.country_code)}async function uA(r,e){const{appName:t,appVersion:n}=V(),i={"X-Recharge-Sdk-Fn":"loadFromOnlineStore","X-Recharge-Sdk-Version":"1.66.0",...t?{"X-Recharge-Sdk-App-Name":t}:{},...n?{"X-Recharge-Sdk-App-Version":n}:{}};if(!e){const o=await Fe("get",`/bundle-data/${r}`,{headers:i});return Si(o)}const a=new FormData;a.append("form_type","localization"),a.append("_method","put"),a.append("return_to",`${io}/bundle-data/${r}`),a.append("country_code",e);try{const o=await X("post","/localization",{headers:{"Content-Type":"multipart/form-data",...i},data:a});return Si(o)}catch{const o=await Fe("get",`/bundle-data/${r}`,{headers:i});return Si(o)}}async function fA(r,e){if(!V().storeIdentifier)throw new Error("Store identifier is required for Shopify Storefront API requests");return{}}var cA=Object.freeze({__proto__:null,loadBundleData:sA}),lA=200,Ai="__lodash_hash_undefined__",dA=1/0,du=9007199254740991,pA="[object Arguments]",hA="[object Function]",yA="[object GeneratorFunction]",gA="[object Symbol]",_A=/[\\^$.*+?()[\]{}|]/g,vA=/^\[object .+?Constructor\]$/,mA=/^(?:0|[1-9]\d*)$/,wA=typeof U=="object"&&U&&U.Object===Object&&U,bA=typeof self=="object"&&self&&self.Object===Object&&self,Oi=wA||bA||Function("return this")();function $A(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}function EA(r,e){var t=r?r.length:0;return!!t&&OA(r,e,0)>-1}function SA(r,e,t){for(var n=-1,i=r?r.length:0;++n<i;)if(t(e,r[n]))return!0;return!1}function pu(r,e){for(var t=-1,n=r?r.length:0,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}function Ii(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}function AA(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}function OA(r,e,t){if(e!==e)return AA(r,IA,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function IA(r){return r!==r}function xA(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}function PA(r){return function(e){return r(e)}}function TA(r,e){return r.has(e)}function RA(r,e){return r?.[e]}function FA(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function hu(r,e){return function(t){return r(e(t))}}var MA=Array.prototype,DA=Function.prototype,Zt=Object.prototype,xi=Oi["__core-js_shared__"],yu=function(){var r=/[^.]+$/.exec(xi&&xi.keys&&xi.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),gu=DA.toString,or=Zt.hasOwnProperty,Pi=Zt.toString,CA=RegExp("^"+gu.call(or).replace(_A,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_u=Oi.Symbol,NA=hu(Object.getPrototypeOf,Object),BA=Zt.propertyIsEnumerable,UA=MA.splice,vu=_u?_u.isConcatSpreadable:void 0,Ti=Object.getOwnPropertySymbols,mu=Math.max,qA=bu(Oi,"Map"),jr=bu(Object,"create");function Ue(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function kA(){this.__data__=jr?jr(null):{}}function LA(r){return this.has(r)&&delete this.__data__[r]}function jA(r){var e=this.__data__;if(jr){var t=e[r];return t===Ai?void 0:t}return or.call(e,r)?e[r]:void 0}function VA(r){var e=this.__data__;return jr?e[r]!==void 0:or.call(e,r)}function GA(r,e){var t=this.__data__;return t[r]=jr&&e===void 0?Ai:e,this}Ue.prototype.clear=kA,Ue.prototype.delete=LA,Ue.prototype.get=jA,Ue.prototype.has=VA,Ue.prototype.set=GA;function sr(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function HA(){this.__data__=[]}function WA(r){var e=this.__data__,t=Qt(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():UA.call(e,t,1),!0}function zA(r){var e=this.__data__,t=Qt(e,r);return t<0?void 0:e[t][1]}function XA(r){return Qt(this.__data__,r)>-1}function YA(r,e){var t=this.__data__,n=Qt(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}sr.prototype.clear=HA,sr.prototype.delete=WA,sr.prototype.get=zA,sr.prototype.has=XA,sr.prototype.set=YA;function ur(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function KA(){this.__data__={hash:new Ue,map:new(qA||sr),string:new Ue}}function ZA(r){return en(this,r).delete(r)}function JA(r){return en(this,r).get(r)}function QA(r){return en(this,r).has(r)}function eO(r,e){return en(this,r).set(r,e),this}ur.prototype.clear=KA,ur.prototype.delete=ZA,ur.prototype.get=JA,ur.prototype.has=QA,ur.prototype.set=eO;function Jt(r){var e=-1,t=r?r.length:0;for(this.__data__=new ur;++e<t;)this.add(r[e])}function rO(r){return this.__data__.set(r,Ai),this}function tO(r){return this.__data__.has(r)}Jt.prototype.add=Jt.prototype.push=rO,Jt.prototype.has=tO;function nO(r,e){var t=Ri(r)||$u(r)?xA(r.length,String):[],n=t.length,i=!!n;for(var a in r)(e||or.call(r,a))&&!(i&&(a=="length"||yO(a,n)))&&t.push(a);return t}function Qt(r,e){for(var t=r.length;t--;)if($O(r[t][0],e))return t;return-1}function iO(r,e,t,n){var i=-1,a=EA,o=!0,s=r.length,f=[],c=e.length;if(!s)return f;t&&(e=pu(e,PA(t))),n?(a=SA,o=!1):e.length>=lA&&(a=TA,o=!1,e=new Jt(e));e:for(;++i<s;){var l=r[i],u=t?t(l):l;if(l=n||l!==0?l:0,o&&u===u){for(var d=c;d--;)if(e[d]===u)continue e;f.push(l)}else a(e,u,n)||f.push(l)}return f}function wu(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=hO),i||(i=[]);++a<o;){var s=r[a];e>0&&t(s)?e>1?wu(s,e-1,t,n,i):Ii(i,s):n||(i[i.length]=s)}return i}function aO(r,e,t){var n=e(r);return Ri(r)?n:Ii(n,t(r))}function oO(r){if(!Fi(r)||_O(r))return!1;var e=Su(r)||FA(r)?CA:vA;return e.test(bO(r))}function sO(r){if(!Fi(r))return mO(r);var e=vO(r),t=[];for(var n in r)n=="constructor"&&(e||!or.call(r,n))||t.push(n);return t}function uO(r,e){return r=Object(r),fO(r,e,function(t,n){return n in r})}function fO(r,e,t){for(var n=-1,i=e.length,a={};++n<i;){var o=e[n],s=r[o];t(s,o)&&(a[o]=s)}return a}function cO(r,e){return e=mu(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=mu(t.length-e,0),a=Array(i);++n<i;)a[n]=t[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=t[n];return o[e]=a,$A(r,this,o)}}function lO(r){return aO(r,OO,pO)}function en(r,e){var t=r.__data__;return gO(e)?t[typeof e=="string"?"string":"hash"]:t.map}function bu(r,e){var t=RA(r,e);return oO(t)?t:void 0}var dO=Ti?hu(Ti,Object):Ou,pO=Ti?function(r){for(var e=[];r;)Ii(e,dO(r)),r=NA(r);return e}:Ou;function hO(r){return Ri(r)||$u(r)||!!(vu&&r&&r[vu])}function yO(r,e){return e=e??du,!!e&&(typeof r=="number"||mA.test(r))&&r>-1&&r%1==0&&r<e}function gO(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function _O(r){return!!yu&&yu in r}function vO(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Zt;return r===t}function mO(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}function wO(r){if(typeof r=="string"||AO(r))return r;var e=r+"";return e=="0"&&1/r==-dA?"-0":e}function bO(r){if(r!=null){try{return gu.call(r)}catch{}try{return r+""}catch{}}return""}function $O(r,e){return r===e||r!==r&&e!==e}function $u(r){return EO(r)&&or.call(r,"callee")&&(!BA.call(r,"callee")||Pi.call(r)==pA)}var Ri=Array.isArray;function Eu(r){return r!=null&&SO(r.length)&&!Su(r)}function EO(r){return Au(r)&&Eu(r)}function Su(r){var e=Fi(r)?Pi.call(r):"";return e==hA||e==yA}function SO(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=du}function Fi(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}function Au(r){return!!r&&typeof r=="object"}function AO(r){return typeof r=="symbol"||Au(r)&&Pi.call(r)==gA}function OO(r){return Eu(r)?nO(r,!0):sO(r)}var IO=cO(function(r,e){return r==null?{}:(e=pu(wu(e,1),wO),uO(r,iO(lO(r),e)))});function Ou(){return[]}var xO=IO,Mi=be(xO);function PO(r){try{return JSON.parse(r)}catch{return r}}function TO(r){return Object.entries(r).reduce((e,[t,n])=>({...e,[t]:PO(n)}),{})}const Iu=r=>typeof r=="string"?r!=="0"&&r!=="false":!!r;function xu(r){const e=TO(r),t=e.auto_inject===void 0?!0:e.auto_inject,n=e.display_on??[],i=e.first_option==="autodeliver";return{...Mi(e,["display_on","first_option"]),auto_inject:t,valid_pages:n,is_subscription_first:i,autoInject:t,validPages:n,isSubscriptionFirst:i}}function Pu(r){const e=r.subscription_options?.storefront_purchase_options==="subscription_only";return{...r,is_subscription_only:e,isSubscriptionOnly:e}}function RO(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=Pu(i)}),t})}const Di="2020-12",FO={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Vr=new Map;function rn(r,e){return Vr.has(r)||Vr.set(r,e()),Vr.get(r)}async function Ci(r,e){if(r===void 0||r==="")throw new Error("ID is required");const t=e?.version??"2020-12",{product:n}=await rn(`product.${r}.${t}`,()=>ht("get",`/product/${t}/${r}.json`));return t==="2020-12"?Pu(n):n}async function Tu(){return await rn("storeSettings",()=>ht("get",`/${Di}/store_settings.json`).catch(()=>FO))}async function Ru(){const{widget_settings:r}=await rn("widgetSettings",()=>ht("get",`/${Di}/widget_settings.json`));return xu(r)}async function Fu(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await rn("productsAndSettings",()=>ht("get",`/product/${Di}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:RO(r),widget_settings:xu(e),store_settings:t??{}}}async function MO(){const{products:r}=await Fu();return r}async function DO(r){const[e,t,n]=await Promise.all([Ci(r),Tu(),Ru()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function CO(r){const{bundle_product:e}=await Ci(r);return e}async function Mu(){return Array.from(Vr.keys()).forEach(r=>Vr.delete(r))}var NO=Object.freeze({__proto__:null,getCDNBundleSettings:CO,getCDNProduct:Ci,getCDNProductAndSettings:DO,getCDNProducts:MO,getCDNProductsAndSettings:Fu,getCDNStoreSettings:Tu,getCDNWidgetSettings:Ru,resetCDNCache:Mu});async function BO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("get","/charges",{id:e,query:{include:t?.include}},v(r,"getCharge"));return n}function UO(r,e){return w("get","/charges",{query:e},v(r,"listCharges"))}async function qO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},v(r,"applyDiscountToCharge"));return n}async function kO(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{charge:t}=await w("post",`/charges/${e}/remove_discount`,{},v(r,"removeDiscountsFromCharge"));return t}async function LO(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");if(t===void 0||t.length===0)throw new Error("Purchase item IDs are required");const{charge:i}=await w("post",`/charges/${e}/skip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},v(r,"skipCharge"));return i}async function jO(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");if(t===void 0||t.length===0)throw new Error("Purchase item IDs are required");const{charge:i}=await w("post",`/charges/${e}/unskip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},v(r,"unskipCharge"));return i}async function VO(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{charge:t}=await w("post",`/charges/${e}/process`,{},v(r,"processCharge"));return t}async function GO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("post",`/charges/${e}/change_next_charge_date`,{data:{next_charge_date:t}},v(r,"rescheduleCharge"));return n}var HO=Object.freeze({__proto__:null,applyDiscountToCharge:qO,getCharge:BO,listCharges:UO,processCharge:VO,removeDiscountsFromCharge:kO,rescheduleCharge:GO,skipCharge:LO,unskipCharge:jO});async function Du(r,e){if(!["2020-12","2022-06"].includes(e.format_version))throw new Error("Missing or unsupported format_version.");return w("get","/product_search",{query:e,headers:{"X-Recharge-Version":"2021-01"}},v(r,"productSearch"))}var WO=Object.freeze({__proto__:null,productSearch:Du});async function Cu(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{collection:t}=await w("get","/collections",{id:e},v(r,"getCollection"));return t}function zO(r,e){return w("get","/collections",{query:e},v(r,"listCollections"))}async function XO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");if(!["2020-12","2022-06"].includes(t.format_version))throw new Error("Missing or unsupported format_version.");const n=v(r,"listCollectionProducts"),[{sort_order:i,manual_sort_order:a},{products:o}]=await Promise.all([Cu(n,e),Du(n,{...t,collection_ids:[e],limit:250})]);if(i==="manual")return{products:a.reduce((s,f)=>{const c=o.find(l=>l.external_product_id===f);return c&&s.push(c),s},[])};{const s=YO(i);return{products:o.slice().sort(s)}}}function Nu(r,e){const t=r.external_created_at,n=e.external_created_at;return t<n?-1:n>t?1:0}function Bu(r,e){const t=r.external_product_id,n=e.external_product_id;return t<n?-1:n>t?1:0}function Uu(r,e){const t=r.title.toLowerCase(),n=e.title.toLowerCase();return t<n?-1:n>t?1:0}function YO(r){switch(r){case"created_at-asc":return Nu;case"created_at-desc":return(e,t)=>Nu(t,e);case"id-asc":return Bu;case"id-desc":return(e,t)=>Bu(t,e);case"title-asc":return Uu;case"title-desc":return(e,t)=>Uu(t,e)}}var KO=Object.freeze({__proto__:null,getCollection:Cu,listCollectionProducts:XO,listCollections:zO});async function ZO(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await w("get","/customers",{id:t,query:{include:e?.include}},v(r,"getCustomer"));return n}async function qu(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await w("put","/customers",{id:t,data:e},v(r,"updateCustomer"));return n}async function JO(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await w("get",`/customers/${t}/delivery_schedule`,{query:e},v(r,"getDeliverySchedule"));return n}async function tn(r,e){return w("get","/portal_access",{query:e},v(r,"getCustomerPortalAccess"))}async function QO(r,e,t){if(e===void 0||e==="")throw new Error("Subscription ID is required");const{base_url:n,customer_hash:i,temp_token:a}=await tn(v(r,"getActiveChurnLandingPageURL"));return`${n.replace("portal","pages")}${i}/subscriptions/${e}/cancel?token=${a}&subscription=${e}&redirect_to=${t}`}async function eI(r){const{base_url:e,customer_hash:t,temp_token:n}=await tn(v(r,"getFailedPaymentMethodRecoveryLandingPageURL"));return`${e.replace("portal","pages")}account/payment-methods?token=${n}&hash=${t}`}async function rI(r,e,t){if(e===void 0||e==="")throw new Error("Gift ID is required");const{base_url:n,customer_hash:i,temp_token:a}=await tn(v(r,"getGiftRedemptionLandingPageURL"));return`${n.replace("portal","pages")}${i}/gifts/${e}?token=${a}&redirect_to=${t}`}const tI={SHOPIFY_UPDATE_PAYMENT_INFO:{type:"email",template_type:"shopify_update_payment_information"},SHOPIFY_MIGRATE_PAYMENT_INFO:{type:"email",template_type:"shopify_migrate_payment_information"}};async function nI(r,e,t){const n=r.customerId;if(!n)throw new Error("Not logged in.");const i=tI[e];if(!i)throw new Error("Notification not supported.");return w("post",`/customers/${n}/notifications`,{data:{...i,template_vars:t}},v(r,"sendCustomerNotification"))}async function iI(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{credit_summary:n}=await w("get",`/customers/${t}/credit_summary`,{query:{include:e?.include}},v(r,"getCreditSummary"));return n}var aI=Object.freeze({__proto__:null,getActiveChurnLandingPageURL:QO,getCreditSummary:iI,getCustomer:ZO,getCustomerPortalAccess:tn,getDeliverySchedule:JO,getFailedPaymentMethodRecoveryLandingPageURL:eI,getGiftRedemptionLandingPageURL:rI,sendCustomerNotification:nI,updateCustomer:qu});async function oI(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{credit_summary:n}=await w("get",`/customers/${t}/credit_summary`,{query:{include:e?.include,presentment_currency_code:e?.presentment_currency_code}},v(r,"getCreditSummary"));return n}function sI(r,{recurring:e}){if(!r.customerId)throw new Error("Not logged in.");const t={};return e!==void 0&&(t.apply_credit_to_next_recurring_charge=e),qu(v(r,"setApplyCreditsToNextCharge"),t)}async function uI(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");return await w("get","/credit_accounts",{query:{customer_id:t,...e}},v(r,"listCreditAccounts"))}var fI=Object.freeze({__proto__:null,getCreditSummary:oI,listCreditAccounts:uI,setApplyCreditsToNextCharge:sI});async function cI(r,e,t){return await w("post","/customer_surveys/cancellation_prevention",{data:{customer_id:e,subscription_id:t}},v(r,"getCustomerSurveyReasons"))}async function lI(r,e,t,n){return await w("post",`/customer_surveys/${t}/customer_response`,{data:{customer_id:e,response_id:n}},v(r,"getCustomerSurveyOffers"))}async function dI(r,e){return await w("post","/offers/claim",{data:e},v(r,"claimOfferCustomerSurvey")),{}}var pI=Object.freeze({__proto__:null,claimOfferCustomerSurvey:dI,getCustomerSurveyOffers:lI,getCustomerSurveyReasons:cI});function hI(r,e){if(!r.customerId)throw new Error("Not logged in.");return w("get","/gift_purchases",{query:e},v(r,"listGiftPurchases"))}async function yI(r,e){if(!r.customerId)throw new Error("Not logged in.");if(e===void 0||e==="")throw new Error("ID is required");const{gift_purchase:t}=await w("get","/gift_purchases",{id:e},v(r,"getGiftPurchase"));return t}var gI=Object.freeze({__proto__:null,getGiftPurchase:yI,listGiftPurchases:hI});async function _I(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{membership:t}=await w("get","/memberships",{id:e},v(r,"getMembership"));return t}function vI(r,e){return w("get","/memberships",{query:e},v(r,"listMemberships"))}async function mI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await w("post",`/memberships/${e}/cancel`,{data:t},v(r,"cancelMembership"));return n}async function wI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await w("post",`/memberships/${e}/activate`,{data:t},v(r,"activateMembership"));return n}async function bI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await w("post",`/memberships/${e}/change`,{data:t},v(r,"changeMembership"));return n}var $I=Object.freeze({__proto__:null,activateMembership:wI,cancelMembership:mI,changeMembership:bI,getMembership:_I,listMemberships:vI});async function EI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership_program:n}=await w("get","/membership_programs",{id:e,query:{include:t?.include}},v(r,"getMembershipProgram"));return n}function SI(r,e){return w("get","/membership_programs",{query:e},v(r,"listMembershipPrograms"))}var AI=Object.freeze({__proto__:null,getMembershipProgram:EI,listMembershipPrograms:SI});async function OI(r,e){const{metafield:t}=await w("post","/metafields",{data:{metafield:e}},v(r,"createMetafield"));return t}async function II(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{metafield:n}=await w("put","/metafields",{id:e,data:{metafield:t}},v(r,"updateMetafield"));return n}function xI(r,e){if(e===void 0||e==="")throw new Error("ID is required");return w("delete","/metafields",{id:e},v(r,"deleteMetafield"))}var PI=Object.freeze({__proto__:null,createMetafield:OI,deleteMetafield:xI,updateMetafield:II});async function TI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{onetime:t}=await w("get","/onetimes",{id:e},v(r,"getOnetime"));return t}function RI(r,e){return w("get","/onetimes",{query:e},v(r,"listOnetimes"))}async function FI(r,e){const{onetime:t}=await w("post","/onetimes",{data:e},v(r,"createOnetime"));return t}async function MI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{onetime:n}=await w("put","/onetimes",{id:e,data:t},v(r,"updateOnetime"));return n}function DI(r,e){if(e===void 0||e==="")throw new Error("ID is required");return w("delete","/onetimes",{id:e},v(r,"deleteOnetime"))}var CI=Object.freeze({__proto__:null,createOnetime:FI,deleteOnetime:DI,getOnetime:TI,listOnetimes:RI,updateOnetime:MI});async function NI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{order:t}=await w("get","/orders",{id:e},v(r,"getOrder"));return t}function BI(r,e){return w("get","/orders",{query:e},v(r,"listOrders"))}async function UI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{order:t}=await w("post",`/orders/${e}/delay`,{},v(r,"delayOrder"));return t}var qI=Object.freeze({__proto__:null,delayOrder:UI,getOrder:NI,listOrders:BI});async function kI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{payment_method:n}=await w("get","/payment_methods",{id:e,query:{include:t?.include}},v(r,"getPaymentMethod"));return n}async function LI(r,e){const{payment_method:t}=await w("post","/payment_methods",{data:{...e,customer_id:r.customerId}},v(r,"createPaymentMethod"));return t}async function jI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{payment_method:n}=await w("put","/payment_methods",{id:e,data:t},v(r,"updatePaymentMethod"));return n}function VI(r,e){return w("get","/payment_methods",{query:e},v(r,"listPaymentMethods"))}var GI=Object.freeze({__proto__:null,createPaymentMethod:LI,getPaymentMethod:kI,listPaymentMethods:VI,updatePaymentMethod:jI});async function HI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{plan:t}=await w("get","/plans",{id:e},v(r,"getPlan"));return t}function WI(r,e){return w("get","/plans",{query:e},v(r,"listPlans"))}var zI=Object.freeze({__proto__:null,getPlan:HI,listPlans:WI});async function XI(r,e){return await w("get","/shop/shipping_countries",{query:e,headers:{"X-Recharge-Version":"2021-01"}},v(r,"getShippingCountries"))}async function YI(r){return await w("get","/shop/settings",{headers:{"X-Recharge-Version":"2021-01"}},v(r,"getStoreSettings"))}var KI=Object.freeze({__proto__:null,getShippingCountries:XI,getStoreSettings:YI}),ZI="Expected a function",ku="__lodash_placeholder__",qe=1,nn=2,JI=4,fr=8,Gr=16,ke=32,Hr=64,Lu=128,QI=256,ju=512,Vu=1/0,ex=9007199254740991,rx=17976931348623157e292,Gu=0/0,tx=[["ary",Lu],["bind",qe],["bindKey",nn],["curry",fr],["curryRight",Gr],["flip",ju],["partial",ke],["partialRight",Hr],["rearg",QI]],nx="[object Function]",ix="[object GeneratorFunction]",ax="[object Symbol]",ox=/[\\^$.*+?()[\]{}|]/g,sx=/^\s+|\s+$/g,ux=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,fx=/\{\n\/\* \[wrapped with (.+)\] \*/,cx=/,? & /,lx=/^[-+]0x[0-9a-f]+$/i,dx=/^0b[01]+$/i,px=/^\[object .+?Constructor\]$/,hx=/^0o[0-7]+$/i,yx=/^(?:0|[1-9]\d*)$/,gx=parseInt,_x=typeof U=="object"&&U&&U.Object===Object&&U,vx=typeof self=="object"&&self&&self.Object===Object&&self,Wr=_x||vx||Function("return this")();function Ni(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}function mx(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}function wx(r,e){var t=r?r.length:0;return!!t&&$x(r,e,0)>-1}function bx(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}function $x(r,e,t){if(e!==e)return bx(r,Ex,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function Ex(r){return r!==r}function Sx(r,e){for(var t=r.length,n=0;t--;)r[t]===e&&n++;return n}function Ax(r,e){return r?.[e]}function Ox(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function Bi(r,e){for(var t=-1,n=r.length,i=0,a=[];++t<n;){var o=r[t];(o===e||o===ku)&&(r[t]=ku,a[i++]=t)}return a}var Ix=Function.prototype,Hu=Object.prototype,Ui=Wr["__core-js_shared__"],Wu=function(){var r=/[^.]+$/.exec(Ui&&Ui.keys&&Ui.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),zu=Ix.toString,xx=Hu.hasOwnProperty,Xu=Hu.toString,Px=RegExp("^"+zu.call(xx).replace(ox,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tx=Object.create,cr=Math.max,Rx=Math.min,Yu=function(){var r=Zu(Object,"defineProperty"),e=Zu.name;return e&&e.length>2?r:void 0}();function Fx(r){return lr(r)?Tx(r):{}}function Mx(r){if(!lr(r)||Hx(r))return!1;var e=Yx(r)||Ox(r)?Px:px;return e.test(zx(r))}function Dx(r,e){return e=cr(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=cr(t.length-e,0),a=Array(i);++n<i;)a[n]=t[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=t[n];return o[e]=a,Ni(r,this,o)}}function Cx(r,e,t,n){for(var i=-1,a=r.length,o=t.length,s=-1,f=e.length,c=cr(a-o,0),l=Array(f+c),u=!n;++s<f;)l[s]=e[s];for(;++i<o;)(u||i<a)&&(l[t[i]]=r[i]);for(;c--;)l[s++]=r[i++];return l}function Nx(r,e,t,n){for(var i=-1,a=r.length,o=-1,s=t.length,f=-1,c=e.length,l=cr(a-s,0),u=Array(l+c),d=!n;++i<l;)u[i]=r[i];for(var y=i;++f<c;)u[y+f]=e[f];for(;++o<s;)(d||i<a)&&(u[y+t[o]]=r[i++]);return u}function Bx(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}function Ux(r,e,t){var n=e&qe,i=zr(r);function a(){var o=this&&this!==Wr&&this instanceof a?i:r;return o.apply(n?t:this,arguments)}return a}function zr(r){return function(){var e=arguments;switch(e.length){case 0:return new r;case 1:return new r(e[0]);case 2:return new r(e[0],e[1]);case 3:return new r(e[0],e[1],e[2]);case 4:return new r(e[0],e[1],e[2],e[3]);case 5:return new r(e[0],e[1],e[2],e[3],e[4]);case 6:return new r(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new r(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=Fx(r.prototype),n=r.apply(t,e);return lr(n)?n:t}}function qx(r,e,t){var n=zr(r);function i(){for(var a=arguments.length,o=Array(a),s=a,f=ki(i);s--;)o[s]=arguments[s];var c=a<3&&o[0]!==f&&o[a-1]!==f?[]:Bi(o,f);if(a-=c.length,a<t)return Ku(r,e,qi,i.placeholder,void 0,o,c,void 0,void 0,t-a);var l=this&&this!==Wr&&this instanceof i?n:r;return Ni(l,this,o)}return i}function qi(r,e,t,n,i,a,o,s,f,c){var l=e&Lu,u=e&qe,d=e&nn,y=e&(fr|Gr),b=e&ju,S=d?void 0:zr(r);function O(){for(var $=arguments.length,E=Array($),p=$;p--;)E[p]=arguments[p];if(y)var I=ki(O),T=Sx(E,I);if(n&&(E=Cx(E,n,i,y)),a&&(E=Nx(E,a,o,y)),$-=T,y&&$<c){var F=Bi(E,I);return Ku(r,e,qi,O.placeholder,t,E,F,s,f,c-$)}var m=u?t:this,g=d?m[r]:r;return $=E.length,s?E=Wx(E,s):b&&$>1&&E.reverse(),l&&f<$&&(E.length=f),this&&this!==Wr&&this instanceof O&&(g=S||zr(g)),g.apply(m,E)}return O}function kx(r,e,t,n){var i=e&qe,a=zr(r);function o(){for(var s=-1,f=arguments.length,c=-1,l=n.length,u=Array(l+f),d=this&&this!==Wr&&this instanceof o?a:r;++c<l;)u[c]=n[c];for(;f--;)u[c++]=arguments[++s];return Ni(d,i?t:this,u)}return o}function Ku(r,e,t,n,i,a,o,s,f,c){var l=e&fr,u=l?o:void 0,d=l?void 0:o,y=l?a:void 0,b=l?void 0:a;e|=l?ke:Hr,e&=~(l?Hr:ke),e&JI||(e&=~(qe|nn));var S=t(r,e,i,y,u,b,d,s,f,c);return S.placeholder=n,Ju(S,r,e)}function Lx(r,e,t,n,i,a,o,s){var f=e&nn;if(!f&&typeof r!="function")throw new TypeError(ZI);var c=n?n.length:0;if(c||(e&=~(ke|Hr),n=i=void 0),o=o===void 0?o:cr(Qu(o),0),s=s===void 0?s:Qu(s),c-=i?i.length:0,e&Hr){var l=n,u=i;n=i=void 0}var d=[r,e,t,n,i,l,u,a,o,s];if(r=d[0],e=d[1],t=d[2],n=d[3],i=d[4],s=d[9]=d[9]==null?f?0:r.length:cr(d[9]-c,0),!s&&e&(fr|Gr)&&(e&=~(fr|Gr)),!e||e==qe)var y=Ux(r,e,t);else e==fr||e==Gr?y=qx(r,e,s):(e==ke||e==(qe|ke))&&!i.length?y=kx(r,e,t,n):y=qi.apply(void 0,d);return Ju(y,r,e)}function ki(r){var e=r;return e.placeholder}function Zu(r,e){var t=Ax(r,e);return Mx(t)?t:void 0}function jx(r){var e=r.match(fx);return e?e[1].split(cx):[]}function Vx(r,e){var t=e.length,n=t-1;return e[n]=(t>1?"& ":"")+e[n],e=e.join(t>2?", ":" "),r.replace(ux,`{
24
+ */(function(e,t){typeof i1=="function"&&r&&r.exports?r.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(U,function(){function e(l,u,d){this.low=l|0,this.high=u|0,this.unsigned=!!d}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,d){var y,b;return d?(u=u>>>0,0<=u&&u<256&&(b=n[u],b)?b:(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&&(b=t[u],b)?b:(y=new e(u,u<0?-1:0,!1),-128<=u&&u<128&&(t[u]=y),y))},e.fromNumber=function(u,d){return d=!!d,isNaN(u)||!isFinite(u)?e.ZERO:!d&&u<=-f?e.MIN_VALUE:!d&&u+1>=f?e.MAX_VALUE:d&&u>=s?e.MAX_UNSIGNED_VALUE:u<0?e.fromNumber(-u,d).negate():new e(u%o|0,u/o|0,d)},e.fromBits=function(u,d,y){return new e(u,d,y)},e.fromString=function(u,d,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 d=="number"&&(y=d,d=!1),y=y||10,y<2||36<y)throw Error("radix out of range: "+y);var b;if((b=u.indexOf("-"))>0)throw Error('number format error: interior "-" character: '+u);if(b===0)return e.fromString(u.substring(1),d,y).negate();for(var S=e.fromNumber(Math.pow(y,8)),O=e.ZERO,$=0;$<u.length;$+=8){var E=Math.min(8,u.length-$),p=parseInt(u.substring($,$+E),y);if(E<8){var I=e.fromNumber(Math.pow(y,E));O=O.multiply(I).add(e.fromNumber(p))}else O=O.multiply(S),O=O.add(e.fromNumber(p))}return O.unsigned=d,O},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=65536,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 d;if(this.isNegative())if(this.equals(e.MIN_VALUE)){var y=e.fromNumber(u),b=this.divide(y);return d=b.multiply(y).subtract(this),b.toString(u)+d.toInt().toString(u)}else return"-"+this.negate().toString(u);var S=e.fromNumber(Math.pow(u,6),this.unsigned);d=this;for(var O="";;){var $=d.divide(S),E=d.subtract($.multiply(S)).toInt()>>>0,p=E.toString(u);if(d=$,d.isZero())return p+O;for(;p.length<6;)p="0"+p;O=""+p+O}},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,d=31;d>0&&!(u&1<<d);d--);return this.high!=0?d+33:d+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 d=this.isNegative(),y=u.isNegative();return d&&!y?-1:!d&&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 d=this.high>>>16,y=this.high&65535,b=this.low>>>16,S=this.low&65535,O=u.high>>>16,$=u.high&65535,E=u.low>>>16,p=u.low&65535,I=0,T=0,F=0,m=0;return m+=S+p,F+=m>>>16,m&=65535,F+=b+E,T+=F>>>16,F&=65535,T+=y+$,I+=T>>>16,T&=65535,I+=d+O,I&=65535,e.fromBits(F<<16|m,I<<16|T,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 d=this.high>>>16,y=this.high&65535,b=this.low>>>16,S=this.low&65535,O=u.high>>>16,$=u.high&65535,E=u.low>>>16,p=u.low&65535,I=0,T=0,F=0,m=0;return m+=S*p,F+=m>>>16,m&=65535,F+=b*p,T+=F>>>16,F&=65535,F+=S*E,T+=F>>>16,F&=65535,T+=y*p,I+=T>>>16,T&=65535,T+=b*E,I+=T>>>16,T&=65535,T+=S*$,I+=T>>>16,T&=65535,I+=d*p+y*E+b*$+S*O,I&=65535,e.fromBits(F<<16|m,I<<16|T,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 d,y,b;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 S=this.shiftRight(1);return d=S.divide(u).shiftLeft(1),d.equals(e.ZERO)?u.isNegative()?e.ONE:e.NEG_ONE:(y=this.subtract(u.multiply(d)),b=d.add(y.divide(u)),b)}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(b=e.ZERO,y=this;y.greaterThanOrEqual(u);){d=Math.max(1,Math.floor(y.toNumber()/u.toNumber()));for(var O=Math.ceil(Math.log(d)/Math.LN2),$=O<=48?1:Math.pow(2,O-48),E=e.fromNumber(d),p=E.multiply(u);p.isNegative()||p.greaterThan(y);)d-=$,E=e.fromNumber(d,this.unsigned),p=E.multiply(u);E.isZero()&&(E=e.ONE),b=b.add(E),y=y.subtract(p)}return b},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 d=this.high;if(u<32){var y=this.low;return e.fromBits(y>>>u|d<<32-u,d>>>u,this.unsigned)}else return u===32?e.fromBits(d,0,this.unsigned):e.fromBits(d>>>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})})(gs);var _s=gs.exports;Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.Hyper=void 0;var a1=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),vs=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)}},o1=_s,xr=ms(o1),s1=D,u1=ms(s1);function ms(r){return r&&r.__esModule?r:{default:r}}function f1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function c1(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 l1(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 Pr=Rt.Hyper=function(r){l1(e,r),a1(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=vs(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=vs(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 f1(this,e),c1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!1))}return e}(xr.default);(0,u1.default)(Pr),Pr.MAX_VALUE=new Pr(xr.default.MAX_VALUE.low,xr.default.MAX_VALUE.high),Pr.MIN_VALUE=new Pr(xr.default.MIN_VALUE.low,xr.default.MIN_VALUE.high);var Ne={};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.UnsignedInt=void 0;var d1=gt,ws=bs(d1),p1=D,h1=bs(p1);function bs(r){return r&&r.__esModule?r:{default:r}}var Tr=Ne.UnsignedInt={read:function(e){return e.readUInt32BE()},write:function(e,t){if(!(0,ws.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,ws.default)(e)||Math.floor(e)!==e?!1:e>=Tr.MIN_VALUE&&e<=Tr.MAX_VALUE}};Tr.MAX_VALUE=Math.pow(2,32)-1,Tr.MIN_VALUE=0,(0,h1.default)(Tr);var Ft={};Object.defineProperty(Ft,"__esModule",{value:!0}),Ft.UnsignedHyper=void 0;var y1=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}}(),$s=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)}},g1=_s,Rr=Es(g1),_1=D,v1=Es(_1);function Es(r){return r&&r.__esModule?r:{default:r}}function m1(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function w1(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 b1(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 Fr=Ft.UnsignedHyper=function(r){b1(e,r),y1(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=$s(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=$s(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 m1(this,e),w1(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n,!0))}return e}(Rr.default);(0,v1.default)(Fr),Fr.MAX_VALUE=new Fr(Rr.default.MAX_UNSIGNED_VALUE.low,Rr.default.MAX_UNSIGNED_VALUE.high),Fr.MIN_VALUE=new Fr(Rr.default.MIN_VALUE.low,Rr.default.MIN_VALUE.high);var Mt={};Object.defineProperty(Mt,"__esModule",{value:!0}),Mt.Float=void 0;var $1=gt,Ss=As($1),E1=D,S1=As(E1);function As(r){return r&&r.__esModule?r:{default:r}}var A1=Mt.Float={read:function(e){return e.readFloatBE()},write:function(e,t){if(!(0,Ss.default)(e))throw new Error("XDR Write Error: not a number");t.writeFloatBE(e)},isValid:function(e){return(0,Ss.default)(e)}};(0,S1.default)(A1);var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0}),Dt.Double=void 0;var O1=gt,Os=Is(O1),I1=D,x1=Is(I1);function Is(r){return r&&r.__esModule?r:{default:r}}var P1=Dt.Double={read:function(e){return e.readDoubleBE()},write:function(e,t){if(!(0,Os.default)(e))throw new Error("XDR Write Error: not a number");t.writeDoubleBE(e)},isValid:function(e){return(0,Os.default)(e)}};(0,x1.default)(P1);var Ct={};Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.Quadruple=void 0;var T1=D,R1=F1(T1);function F1(r){return r&&r.__esModule?r:{default:r}}var M1=Ct.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,R1.default)(M1);var Mr={},D1=ge,C1=_e,N1="[object Boolean]";function B1(r){return r===!0||r===!1||C1(r)&&D1(r)==N1}var U1=B1;Object.defineProperty(Mr,"__esModule",{value:!0}),Mr.Bool=void 0;var q1=U1,k1=Ps(q1),xs=ue,L1=D,j1=Ps(L1);function Ps(r){return r&&r.__esModule?r:{default:r}}var V1=Mr.Bool={read:function(e){var t=xs.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 xs.Int.write(n,t)},isValid:function(e){return(0,k1.default)(e)}};(0,j1.default)(V1);var Nt={},G1=ge,H1=G,W1=_e,z1="[object String]";function X1(r){return typeof r=="string"||!H1(r)&&W1(r)&&G1(r)==z1}var Ts=X1;Object.defineProperty(Nt,"__esModule",{value:!0}),Nt.String=void 0;var Y1=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}}(),K1=Ts,Rs=di(K1),Z1=G,J1=di(Z1),Fs=ue,Q1=Ne,Ms=De,e$=D,r$=di(e$);function di(r){return r&&r.__esModule?r:{default:r}}function t$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var n$=Nt.String=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Q1.UnsignedInt.MAX_VALUE;t$(this,r),this._maxLength=e}return Y1(r,[{key:"read",value:function(t){var n=Fs.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,Ms.calculatePadding)(n),a=t.slice(n);return(0,Ms.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,Rs.default)(t)?i=h.from(t,"utf8"):i=h.from(t),Fs.Int.write(i.length,n),n.writeBufferPadded(i)}},{key:"isValid",value:function(t){var n=void 0;if((0,Rs.default)(t))n=h.from(t,"utf8");else if((0,J1.default)(t)||h.isBuffer(t))n=h.from(t);else return!1;return n.length<=this._maxLength}}]),r}();(0,r$.default)(n$.prototype);var Bt={};Object.defineProperty(Bt,"__esModule",{value:!0}),Bt.Opaque=void 0;var i$=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}}(),Ds=De,a$=D,o$=s$(a$);function s$(r){return r&&r.__esModule?r:{default:r}}function u$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var f$=Bt.Opaque=function(){function r(e){u$(this,r),this._length=e,this._padding=(0,Ds.calculatePadding)(e)}return i$(r,[{key:"read",value:function(t){var n=t.slice(this._length);return(0,Ds.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 h.isBuffer(t)&&t.length===this._length}}]),r}();(0,o$.default)(f$.prototype);var Ut={};Object.defineProperty(Ut,"__esModule",{value:!0}),Ut.VarOpaque=void 0;var c$=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}}(),Cs=ue,l$=Ne,Ns=De,d$=D,p$=h$(d$);function h$(r){return r&&r.__esModule?r:{default:r}}function y$(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var g$=Ut.VarOpaque=function(){function r(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:l$.UnsignedInt.MAX_VALUE;y$(this,r),this._maxLength=e}return c$(r,[{key:"read",value:function(t){var n=Cs.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,Ns.calculatePadding)(n),a=t.slice(n);return(0,Ns.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));Cs.Int.write(t.length,n),n.writeBufferPadded(t)}},{key:"isValid",value:function(t){return h.isBuffer(t)&&t.length<=this._maxLength}}]),r}();(0,p$.default)(g$.prototype);var qt={};function _$(r,e){for(var t=-1,n=r==null?0:r.length;++t<n&&e(r[t],t,r)!==!1;);return r}var v$=_$,m$=vt;function w$(r){return typeof r=="function"?r:m$}var Bs=w$,b$=v$,$$=Zn,E$=Bs,S$=G;function A$(r,e){var t=S$(r)?b$:$$;return t(r,E$(e))}var O$=A$,ir=O$,I$=/\s/;function x$(r){for(var e=r.length;e--&&I$.test(r.charAt(e)););return e}var P$=x$,T$=P$,R$=/^\s+/;function F$(r){return r&&r.slice(0,T$(r)+1).replace(R$,"")}var M$=F$,D$=M$,Us=Je,C$=Pt,qs=0/0,N$=/^[-+]0x[0-9a-f]+$/i,B$=/^0b[01]+$/i,U$=/^0o[0-7]+$/i,q$=parseInt;function k$(r){if(typeof r=="number")return r;if(C$(r))return qs;if(Us(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=Us(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=D$(r);var t=B$.test(r);return t||U$.test(r)?q$(r.slice(2),t?2:8):N$.test(r)?qs:+r}var L$=k$,j$=L$,ks=1/0,V$=17976931348623157e292;function G$(r){if(!r)return r===0?r:0;if(r=j$(r),r===ks||r===-ks){var e=r<0?-1:1;return e*V$}return r===r?r:0}var H$=G$,W$=H$;function z$(r){var e=W$(r),t=e%1;return e===e?t?e-t:e:0}var X$=z$,Y$=bo,K$=Bs,Z$=X$,J$=9007199254740991,pi=4294967295,Q$=Math.min;function eE(r,e){if(r=Z$(r),r<1||r>J$)return[];var t=pi,n=Q$(r,pi);e=K$(e),r-=pi;for(var i=Y$(n,e);++t<r;)e(t);return i}var Ls=eE;Object.defineProperty(qt,"__esModule",{value:!0}),qt.Array=void 0;var rE=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),tE=ci,nE=Dr(tE),iE=ir,aE=Dr(iE),oE=Ls,sE=Dr(oE),uE=G,js=Dr(uE),fE=D,cE=Dr(fE);function Dr(r){return r&&r.__esModule?r:{default:r}}function lE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var dE=qt.Array=function(){function r(e,t){lE(this,r),this._childType=e,this._length=t}return rE(r,[{key:"read",value:function(t){var n=this;return(0,sE.default)(this._length,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,js.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,aE.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,js.default)(t)||t.length!==this._length?!1:(0,nE.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,cE.default)(dE.prototype);var kt={};Object.defineProperty(kt,"__esModule",{value:!0}),kt.VarArray=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}}(),hE=ci,yE=Cr(hE),gE=ir,_E=Cr(gE),vE=Ls,mE=Cr(vE),wE=G,Vs=Cr(wE),bE=Ne,Gs=ue,$E=D,EE=Cr($E);function Cr(r){return r&&r.__esModule?r:{default:r}}function SE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var AE=kt.VarArray=function(){function r(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:bE.UnsignedInt.MAX_VALUE;SE(this,r),this._childType=e,this._maxLength=t}return pE(r,[{key:"read",value:function(t){var n=this,i=Gs.Int.read(t);if(i>this._maxLength)throw new Error("XDR Read Error: Saw "+i+" length VarArray,"+("max allowed is "+this._maxLength));return(0,mE.default)(i,function(){return n._childType.read(t)})}},{key:"write",value:function(t,n){var i=this;if(!(0,Vs.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));Gs.Int.write(t.length,n),(0,_E.default)(t,function(a){return i._childType.write(a,n)})}},{key:"isValid",value:function(t){var n=this;return!(0,Vs.default)(t)||t.length>this._maxLength?!1:(0,yE.default)(t,function(i){return n._childType.isValid(i)})}}]),r}();(0,EE.default)(AE.prototype);var Lt={};function OE(r){return r===null}var IE=OE;function xE(r){return r===void 0}var Nr=xE;Object.defineProperty(Lt,"__esModule",{value:!0}),Lt.Option=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}}(),TE=IE,Hs=hi(TE),RE=Nr,Ws=hi(RE),zs=Mr,FE=D,ME=hi(FE);function hi(r){return r&&r.__esModule?r:{default:r}}function DE(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var CE=Lt.Option=function(){function r(e){DE(this,r),this._childType=e}return PE(r,[{key:"read",value:function(t){if(zs.Bool.read(t))return this._childType.read(t)}},{key:"write",value:function(t,n){var i=!((0,Hs.default)(t)||(0,Ws.default)(t));zs.Bool.write(i,n),i&&this._childType.write(t,n)}},{key:"isValid",value:function(t){return(0,Hs.default)(t)||(0,Ws.default)(t)?!0:this._childType.isValid(t)}}]),r}();(0,ME.default)(CE.prototype);var Br={};Object.defineProperty(Br,"__esModule",{value:!0}),Br.Void=void 0;var NE=Nr,Xs=Ys(NE),BE=D,UE=Ys(BE);function Ys(r){return r&&r.__esModule?r:{default:r}}var qE=Br.Void={read:function(){},write:function(e){if(!(0,Xs.default)(e))throw new Error("XDR Write Error: trying to write value to a void slot")},isValid:function(e){return(0,Xs.default)(e)}};(0,UE.default)(qE);var jt={},kE=fi;function LE(r,e){return kE(e,function(t){return r[t]})}var jE=LE,VE=jE,GE=$t;function HE(r){return r==null?[]:VE(r,GE(r))}var WE=HE;Object.defineProperty(jt,"__esModule",{value:!0}),jt.Enum=void 0;var zE=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=ir,YE=yi(XE),KE=WE,ZE=yi(KE),Ks=ue,JE=D,QE=yi(JE);function yi(r){return r&&r.__esModule?r:{default:r}}function eS(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 rS(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 Zs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var tS=jt.Enum=function(){function r(e,t){Zs(this,r),this.name=e,this.value=t}return zE(r,null,[{key:"read",value:function(t){var n=Ks.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);Ks.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,ZE.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){rS(s,o);function s(){return Zs(this,s),eS(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,YE.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,QE.default)(tS);var Vt={},nS=Zn,iS=Or;function aS(r,e){var t=-1,n=iS(r)?Array(r.length):[];return nS(r,function(i,a,o){n[++t]=e(i,a,o)}),n}var oS=aS,sS=fi,uS=cs,fS=oS,cS=G;function lS(r,e){var t=cS(r)?sS:fS;return t(r,uS(e))}var dS=lS;function pS(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 hS=pS,Ur={};Object.defineProperty(Ur,"__esModule",{value:!0});var yS=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 gS(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}Ur.Reference=function(){function r(){gS(this,r)}return yS(r,[{key:"resolve",value:function(){throw new Error("implement resolve in child class")}}]),r}(),Object.defineProperty(Vt,"__esModule",{value:!0}),Vt.Struct=void 0;var Gt=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")}}(),_S=function(){function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}}(),vS=ir,Js=qr(vS),mS=dS,wS=qr(mS),bS=Nr,$S=qr(bS),ES=hS,SS=qr(ES),AS=Ur,OS=D,IS=qr(OS);function qr(r){return r&&r.__esModule?r:{default:r}}function xS(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 PS(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 Qs(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var TS=Vt.Struct=function(){function r(e){Qs(this,r),this._attributes=e||{}}return _S(r,null,[{key:"read",value:function(t){var n=(0,wS.default)(this._fields,function(i){var a=Gt(i,2),o=a[0],s=a[1],f=s.read(t);return[o,f]});return new this((0,SS.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,Js.default)(this._fields,function(i){var a=Gt(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){PS(s,o);function s(){return Qs(this,s),xS(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=Gt(o,2),f=s[0],c=s[1];return c instanceof AS.Reference&&(c=c.resolve(t)),[f,c]}),(0,Js.default)(a._fields,function(o){var s=Gt(o,1),f=s[0];a.prototype[f]=RS(f)}),a}}]),r}();(0,IS.default)(TS);function RS(r){return function(t){return(0,$S.default)(t)||(this._attributes[r]=t),this._attributes[r]}}var Ht={};Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.Union=void 0;var FS=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")}}(),MS=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}}(),DS=ir,Wt=Xt(DS),CS=Nr,eu=Xt(CS),NS=Ts,ru=Xt(NS),zt=Br,gi=Ur,BS=D,US=Xt(BS);function Xt(r){return r&&r.__esModule?r:{default:r}}function qS(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 kS(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 tu(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}var LS=Ht.Union=function(){function r(e,t){tu(this,r),this.set(e,t)}return MS(r,[{key:"set",value:function(t,n){(0,ru.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!==zt.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===zt.Void?zt.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,eu.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){kS(f,s);function f(){return tu(this,f),qS(this,(f.__proto__||Object.getPrototypeOf(f)).apply(this,arguments))}return f}(r);a.unionName=n,t.results[n]=a,i.switchOn instanceof gi.Reference?a._switchOn=i.switchOn.resolve(t):a._switchOn=i.switchOn,a._switches=new Map,a._arms={},(0,Wt.default)(i.arms,function(s,f){s instanceof gi.Reference&&(s=s.resolve(t)),a._arms[f]=s});var o=i.defaultArm;return o instanceof gi.Reference&&(o=o.resolve(t)),a._defaultArm=o,(0,Wt.default)(i.switches,function(s){var f=FS(s,2),c=f[0],l=f[1];(0,ru.default)(c)&&(c=a._switchOn.fromName(c)),a._switches.set(c,l)}),(0,eu.default)(a._switchOn.values)||(0,Wt.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,Wt.default)(a._arms,function(s,f){s!==zt.Void&&(a.prototype[f]=function(){return this.get(f)})}),a}}]),r}();(0,US.default)(LS),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=ue;Object.keys(e).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return e[p]}})});var t=Rt;Object.keys(t).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return t[p]}})});var n=Ne;Object.keys(n).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return n[p]}})});var i=Ft;Object.keys(i).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return i[p]}})});var a=Mt;Object.keys(a).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return a[p]}})});var o=Dt;Object.keys(o).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return o[p]}})});var s=Ct;Object.keys(s).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return s[p]}})});var f=Mr;Object.keys(f).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return f[p]}})});var c=Nt;Object.keys(c).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return c[p]}})});var l=Bt;Object.keys(l).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return l[p]}})});var u=Ut;Object.keys(u).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return u[p]}})});var d=qt;Object.keys(d).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return d[p]}})});var y=kt;Object.keys(y).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return y[p]}})});var b=Lt;Object.keys(b).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return b[p]}})});var S=Br;Object.keys(S).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return S[p]}})});var O=jt;Object.keys(O).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return O[p]}})});var $=Vt;Object.keys($).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return $[p]}})});var E=Ht;Object.keys(E).forEach(function(p){p==="default"||p==="__esModule"||Object.defineProperty(r,p,{enumerable:!0,get:function(){return E[p]}})})}(Wn);var nu={};(function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=function(){function m(g,_){for(var A=0;A<_.length;A++){var x=_[A];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(g,x.key,x)}}return function(g,_,A){return _&&m(g.prototype,_),A&&m(g,A),g}}(),t=Ur;Object.keys(t).forEach(function(m){m==="default"||m==="__esModule"||Object.defineProperty(r,m,{enumerable:!0,get:function(){return t[m]}})}),r.config=b;var n=Nr,i=l(n),a=ir,o=l(a),s=Wn,f=c(s);function c(m){if(m&&m.__esModule)return m;var g={};if(m!=null)for(var _ in m)Object.prototype.hasOwnProperty.call(m,_)&&(g[_]=m[_]);return g.default=m,g}function l(m){return m&&m.__esModule?m:{default:m}}function u(m,g){if(!(m instanceof g))throw new TypeError("Cannot call a class as a function")}function d(m,g){if(!m)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g&&(typeof g=="object"||typeof g=="function")?g:m}function y(m,g){if(typeof g!="function"&&g!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof g);m.prototype=Object.create(g&&g.prototype,{constructor:{value:m,enumerable:!1,writable:!0,configurable:!0}}),g&&(Object.setPrototypeOf?Object.setPrototypeOf(m,g):m.__proto__=g)}function b(m){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(m){var _=new F(g);m(_),_.resolve()}return g}var S=function(m){y(g,m);function g(_){u(this,g);var A=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return A.name=_,A}return e(g,[{key:"resolve",value:function(A){var x=A.definitions[this.name];return x.resolve(A)}}]),g}(t.Reference),O=function(m){y(g,m);function g(_,A){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;u(this,g);var M=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return M.childReference=_,M.length=A,M.variable=x,M}return e(g,[{key:"resolve",value:function(A){var x=this.childReference,M=this.length;return x instanceof t.Reference&&(x=x.resolve(A)),M instanceof t.Reference&&(M=M.resolve(A)),this.variable?new f.VarArray(x,M):new f.Array(x,M)}}]),g}(t.Reference),$=function(m){y(g,m);function g(_){u(this,g);var A=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return A.childReference=_,A.name=_.name,A}return e(g,[{key:"resolve",value:function(A){var x=this.childReference;return x instanceof t.Reference&&(x=x.resolve(A)),new f.Option(x)}}]),g}(t.Reference),E=function(m){y(g,m);function g(_,A){u(this,g);var x=d(this,(g.__proto__||Object.getPrototypeOf(g)).call(this));return x.sizedType=_,x.length=A,x}return e(g,[{key:"resolve",value:function(A){var x=this.length;return x instanceof t.Reference&&(x=x.resolve(A)),new this.sizedType(x)}}]),g}(t.Reference),p=function(){function m(g,_,A){u(this,m),this.constructor=g,this.name=_,this.config=A}return e(m,[{key:"resolve",value:function(_){return this.name in _.results?_.results[this.name]:this.constructor(_,this.name,this.config)}}]),m}();function I(m,g,_){return _ instanceof t.Reference&&(_=_.resolve(m)),m.results[g]=_,_}function T(m,g,_){return m.results[g]=_,_}var F=function(){function m(g){u(this,m),this._destination=g,this._definitions={}}return e(m,[{key:"enum",value:function(_,A){var x=new p(f.Enum.create,_,A);this.define(_,x)}},{key:"struct",value:function(_,A){var x=new p(f.Struct.create,_,A);this.define(_,x)}},{key:"union",value:function(_,A){var x=new p(f.Union.create,_,A);this.define(_,x)}},{key:"typedef",value:function(_,A){var x=new p(I,_,A);this.define(_,x)}},{key:"const",value:function(_,A){var x=new p(T,_,A);this.define(_,x)}},{key:"void",value:function(){return f.Void}},{key:"bool",value:function(){return f.Bool}},{key:"int",value:function(){return f.Int}},{key:"hyper",value:function(){return f.Hyper}},{key:"uint",value:function(){return f.UnsignedInt}},{key:"uhyper",value:function(){return f.UnsignedHyper}},{key:"float",value:function(){return f.Float}},{key:"double",value:function(){return f.Double}},{key:"quadruple",value:function(){return f.Quadruple}},{key:"string",value:function(_){return new E(f.String,_)}},{key:"opaque",value:function(_){return new E(f.Opaque,_)}},{key:"varOpaque",value:function(_){return new E(f.VarOpaque,_)}},{key:"array",value:function(_,A){return new O(_,A)}},{key:"varArray",value:function(_,A){return new O(_,A,!0)}},{key:"option",value:function(_){return new $(_)}},{key:"define",value:function(_,A){if((0,i.default)(this._destination[_]))this._definitions[_]=A;else throw new Error("XDRTypes Error:"+_+" is already defined")}},{key:"lookup",value:function(_){return new S(_)}},{key:"resolve",value:function(){var _=this;(0,o.default)(this._definitions,function(A){A.resolve({definitions:_._definitions,results:_._destination})})}}]),m}()})(nu),function(r){Object.defineProperty(r,"__esModule",{value:!0});var e=Wn;Object.keys(e).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[n]}})});var t=nu;Object.keys(t).forEach(function(n){n==="default"||n==="__esModule"||Object.defineProperty(r,n,{enumerable:!0,get:function(){return t[n]}})})}(oo);var _i=(r,e,t)=>{if(!e.has(r))throw TypeError("Cannot "+t)},j=(r,e,t)=>(_i(r,e,"read from private field"),t?t.call(r):e.get(r)),Be=(r,e,t)=>{if(e.has(r))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(r):e.set(r,t)},vi=(r,e,t,n)=>(_i(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),ve=(r,e,t)=>(_i(r,e,"access private method"),t),ne,ie,kr,mi,iu,wi,au,Yt,bi,ar,Lr;function jS(r){const e={variantId:ce.Uint64.fromString(r.variantId.toString()),version:r.version||Math.floor(Date.now()/1e3),items:r.items.map(n=>new ce.BundleItem({collectionId:ce.Uint64.fromString(n.collectionId.toString()),productId:ce.Uint64.fromString(n.productId.toString()),variantId:ce.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new ce.BundleItemExt(0)})),ext:new ce.BundleExt(0)},t=new ce.Bundle(e);return ce.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const ce=oo.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")}})});class VS{constructor(e,t){Be(this,mi),Be(this,wi),Be(this,Yt),Be(this,ar),Be(this,ne,void 0),Be(this,ie,void 0),Be(this,kr,void 0),vi(this,ne,ve(this,mi,iu).call(this,t)),vi(this,kr,ve(this,wi,au).call(this,t)),vi(this,ie,e)}isInitialDataValid(){if(!j(this,kr))throw"Bundle data does not exist for the given product.";if(!j(this,ne))throw"Bundle settings do not exist for the given product.";if(!Array.isArray(j(this,ie))||!j(this,ie).length)throw"No bundle selection items provided.";return!0}isValidVariant(e){if(!j(this,ne)?.variantsSettings[e])throw`The ${e} bundle variant is invalid.`;return!0}isSelectionInVariantRange(e){const t=j(this,ie).reduce((i,a)=>i+a.quantity,0),n=j(this,ne)?.variantsSettings[e].ranges||[];if(!ve(this,Yt,bi).call(this,n,t))throw"The total number of products does not fall within the required variant range.";return!0}areItemsInMaxPerItemBound(){const e=j(this,ne)?.bundleSettings.maxPerItem||0,t=j(this,ie).filter(({quantity:n})=>n>e);if(e&&t.length)throw`The selected products (${ve(this,ar,Lr).call(this,t.map(({externalProductId:n})=>n)).join(", ")}) exceed the maximum limit of ${e} items per product.`;return!0}areSelectedCollectionsValid(e){const t=j(this,ne)?.variantsSettings[e],n=j(this,ie).filter(({collectionId:i})=>!t?.optionSources[i]);if(n.length)throw`The collections (${ve(this,ar,Lr).call(this,n.map(({collectionId:i})=>i)).join(", ")}) are no longer valid for the bundle variant (${e}).`;return!0}areItemsQuantitiesValidForTheCollection(e){const t=j(this,ie).reduce((a,o)=>(a[o.collectionId]=o.quantity+(a[o.collectionId]||0),a),{}),n=j(this,ne)?.variantsSettings[e],i=Object.values(n?.optionSources||{}).filter(a=>{const o=t[a.collectionId]||0;return!ve(this,Yt,bi).call(this,[a],o)});if(!n||i.length)throw`The selection exceeds the limits for the collections (${ve(this,ar,Lr).call(this,i.map(({collectionId:a})=>a)).join(", ")}).`;return!0}areSelectedProductsValid(e){const t=j(this,ne)?.variantsSettings[e]?.optionSources||{},n=Object.values(t).reduce((a,o)=>{const s=j(this,kr)?.collections[o.collectionId];return s&&(a[o.collectionId]=s),a},{});if(!Object.values(n).length)throw`No collections found for the bundle variant (${e}).`;const i=j(this,ie).filter(({externalProductId:a,collectionId:o})=>!n[o]?.products[a]);if(i.length)throw`The products (${ve(this,ar,Lr).call(this,i.map(({externalProductId:a})=>a)).join(", ")}) are no longer valid for the bundle product.`;return!0}isBundleSelectionValid(e){return this.isInitialDataValid(),this.isValidVariant(e),this.isSelectionInVariantRange(e),this.areItemsInMaxPerItemBound(),this.areSelectedCollectionsValid(e),this.areItemsQuantitiesValidForTheCollection(e),this.areSelectedProductsValid(e),!0}}ne=new WeakMap,ie=new WeakMap,kr=new WeakMap,mi=new WeakSet,iu=function(r){try{const e=r.bundle_settings;return{bundleSettings:{maxPerItem:e.max_quantity_per_variant,isCustomizable:e.is_customizable},variantsSettings:e.variants.reduce((t,n)=>{if(!n.enabled)return t;let i=[{min:n.items_count,max:n.items_count}];return n.items_count||(i=n.ranges.map(({quantity_max:a,quantity_min:o})=>({min:o,max:a}))),t[n.external_variant_id]={externalVariantId:n.external_variant_id,optionSources:n.option_sources.reduce((a,o)=>(a[o.option_source_id]={min:o.quantity_min,max:o.quantity_max,collectionId:o.option_source_id},a),{}),ranges:i},t},{})}}catch{return null}},wi=new WeakSet,au=function(r){try{const e=Object.values(r.collections).reduce((t,n)=>(t[n.id]={...n,products:n.products.reduce((i,a)=>(i[a.id]=a,i),{})},t),{});return{...r,collections:e}}catch{return null}},Yt=new WeakSet,bi=function(r,e){return!!r.filter(({min:t,max:n})=>{const i=t??e,a=n??e;return i<=e&&e<=a}).length},ar=new WeakSet,Lr=function(r){return Array.from(new Set(r))};const GS="/bundling-storefront-manager";function ou(r){return jS({variantId:r.externalVariantId,version:0,items:r.selections.map(e=>({collectionId:e.collectionId,productId:e.externalProductId,variantId:e.externalVariantId,quantity:e.quantity,sku:""}))})}async function HS(r){const e=V(),t=await $i(r);if(t!==!0)throw new Error(t);const n=ou(r);try{const i=await Fe("post",`${GS}/api/v1/bundles`,{data:{bundle:n},headers:{Origin:`https://${e.storeIdentifier}`}});if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}async function WS(r,e){const t=await $i(e);if(t!==!0)throw new Error(t);const n=ou(e);try{const i=await w("post","/bundle_selections/bundle_id",{data:{bundle:n}},v(r,"getBundleSelectionId"));if(!i.id||i.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(i)}`);return i.id}catch(i){throw new Error(`2: failed generating rb_id ${i}`)}}function zS(r,e){const t=su(r);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${Wi(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 $i(r){try{return r?r.selections.length===0?"No selections defined":!0:"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}async function XS(r){try{const e=await Fe("get",`/bundle-data/${r.externalProductId}`);return{valid:new VS(r.selections,e).isBundleSelectionValid(r.externalVariantId)}}catch(e){return{valid:!1,error:String(e)}}}const YS={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 su(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=YS[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 KS(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{bundle_selection:t}=await w("get","/bundle_selections",{id:e},v(r,"getBundleSelection"));return t}function ZS(r,e){return w("get","/bundle_selections",{query:e},v(r,"listBundleSelections"))}async function JS(r,e){const{bundle_selection:t}=await w("post","/bundle_selections",{data:e},v(r,"createBundleSelection"));return t}async function QS(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{bundle_selection:n}=await w("put","/bundle_selections",{id:e,data:t},v(r,"updateBundleSelection"));return n}function eA(r,e){if(e===void 0||e==="")throw new Error("ID is required");return w("delete","/bundle_selections",{id:e},v(r,"deleteBundleSelection"))}async function rA(r,e,t,n){if(e===void 0||e==="")throw new Error("Purchase item ID is required");const{subscription:i}=await w("put","/bundles",{id:e,data:t,query:n},v(r,"updateBundle"));return i}var tA=Object.freeze({__proto__:null,createBundleSelection:JS,deleteBundleSelection:eA,getBundleId:HS,getBundleSelection:KS,getBundleSelectionId:WS,getDynamicBundleItems:zS,listBundleSelections:ZS,updateBundle:rA,updateBundleSelection:QS,validateBundle:$i,validateBundleSelection:XS,validateDynamicBundle:su});const nA=r=>{const e=r.layout_settings.addons,t=r.layout_settings.crossSells,n=r.customization_window,i=r.default_bundle_variant_id,a=r.layout_settings.defaultFrequency,o=r.layout_settings.addToCartCallback;return{default_variant_id:i?String(i):null,is_customizable:r.is_customizable,price_rule:String(r.price_rule).toUpperCase(),customization_window:n?{active_days:n,disabled_message:r.customization_window_disabled_message||""}:null,addons:e.collectionId?{collection_id:e.collectionId,collection_handle:e.collectionHandle}:null,cross_sells:t.collectionId?{collection_id:e.collectionId,collection_handle:e.collectionHandle}:null,default_selling_plan_id:a||null,collapsible_collections:r.layout_settings.collapsibleSections,max_quantity_per_variant:r.max_quantity_per_variant,show_product_variants:r.layout_settings.showVariants,product_details_modal_enabled:r.layout_settings.learnMoreModal,addToCartBehavior:{type:o.type==="none"?"cart_page":o.type,value:o.value}}},iA=r=>r.tiered_discounts.length===0?null:{tiered_discounts:r.tiered_discounts.map(e=>({eligible_charge_types:e.eligible_charge_types,eligible_line_item_types:e.eligible_line_item_types,external_bundle_product_id:{ecommerce:e.external_bundle_product_id.ecommerce},lookup_key:e.lookup_key,name:e.name,status:e.status,tiers:e.tiers.map(({tier:t})=>({tier:{lookup_key:t.lookup_key,discount_type:t.discount_type,discount_value:t.discount_value,condition_quantity_gte:t.condition_quantity_gte}}))}))},Kt=r=>({id:r.id,name:r.name,options:r.options.map(e=>({name:e.name,value:e.value})),recurring_deliveries:r.recurring_deliveries,price_adjustments:r.price_adjustments.map(({value:e,value_type:t})=>({value:e,value_type:t}))}),uu=r=>({name:r.name,options:r.options.map(e=>({name:e.name,values:e.values})),selling_plans:r.selling_plans.map(Kt)}),fu=r=>({id:String(r.id),title:r.title,price:r.price,compare_at_price:r.compare_at_price,options:r.options,available_for_sale:r.available}),Ei=r=>r==null||typeof r=="string"?r:"src"in r?r.src:null,cu=r=>({id:String(r.id),title:r.title,description:r.description,available_for_sale:r.available,featured_image:Ei(r.featured_image),images:r.images,requires_selling_plan:r.requires_selling_plan,selling_plan_groups:r.selling_plan_groups.map(uu)}),lu=r=>{const e=oA(r.selling_plan_groups);return{...cu(r),handle:r.handle,tags:r.tags,price_range:{min:r.price_min,max:r.price_max},compare_at_price_range:{min:r.compare_at_price_min,max:r.compare_at_price_max},options:r.options,variants:r.variants.map(t=>({...fu(t),selling_plan_allocations:t.selling_plan_allocations.map(n=>({price:n.price,compare_at_price:n.compare_at_price,selling_plan:Kt(e[`${n.selling_plan_group_id}-${n.selling_plan_id}`])})),option1:t.option1,option2:t.option2,option3:t.option3,sku:t.sku||"",requires_shipping:t.requires_shipping,taxable:t.taxable,featured_image:Ei(t.featured_image),public_title:t.public_title,requires_selling_plan:t.requires_selling_plan}))}},aA=({items_count:r,ranges:e})=>e.length>0?e.map(({quantity_max:t,quantity_min:n})=>({min:n,max:t})):[{min:r,max:r}],oA=r=>r.reduce((e,t)=>(t.selling_plans.forEach(n=>{const i=`${t.id}-${n.id}`;e[i]=n}),e),{});function Si(r){const e=nA(r.bundle_settings),t=r.variants.reduce((n,i)=>(n[i.id]=i,n),{});return{id:String(r.id),title:r.title,handle:r.handle,options:r.options.map(n=>({name:n.name,position:n.position,values:n.values})),default_variant_id:e.default_variant_id,default_selling_plan_id:e.default_selling_plan_id?Number(e.default_selling_plan_id):null,available_for_sale:r.available,requires_selling_plan:r.requires_selling_plan,bundle_settings:{is_customizable:e.is_customizable,price_rule:e.price_rule,customization_window:e.customization_window,max_quantity_per_variant:e.max_quantity_per_variant,collapsible_collections:e.collapsible_collections,show_product_variants:e.show_product_variants,product_details_modal_enabled:e.product_details_modal_enabled,show_variants_as_individual_products:r.bundle_settings.settings.display_variants_as_separate_products_in_list,post_add_to_cart_behavior:e.addToCartBehavior},variants:r.bundle_settings.variants.filter(({enabled:n})=>n).map((n,i)=>{const a=t[String(n.external_variant_id)];return{id:String(n.external_variant_id),title:a.title,price:a.price,compare_at_price:a.compare_at_price,image:a.image||"",available_for_sale:a.available,options:a.options,requires_selling_plan:a.requires_selling_plan,selling_plan_allocations:a.selling_plan_allocations.map(o=>({price:o.price,compare_at_price:o.compare_at_price,selling_plan:Kt(o.selling_plan)})),ranges:aA(n),collections:n.option_sources.map(o=>({id:o.option_source_id,source_platform:"shopify",min:o.quantity_min||0,max:o.quantity_max,position:o.position})),default_selections:n.selection_defaults.map(o=>({quantity:o.quantity,product:{id:String(o.product.id),handle:o.handle,title:o.product.title,description:o.product.description,images:o.product.images},variant:{id:o.external_variant_id,title:o.variant.title,featured_image:Ei(o.variant.featured_image),sku:o.sku||""}})),position:i}}),selling_plan_groups:r.selling_plan_groups.map(uu),collections:Object.values(r.collections).reduce((n,i)=>(Array.isArray(i.products)&&(n[String(i.id)]={id:String(i.id),title:i.title,handle:i.handle,products:i.products.map(lu)}),n),{}),addons:r.addons.products.length?{collection_id:e.addons?.collection_id||"",collection_handle:e.addons?.collection_handle||"",products:r.addons.products.map(n=>({...cu(n),price_range:{min:n.price,max:n.price},compare_at_price_range:{min:n.compare_at_price||0,max:n.compare_at_price},variants:n.variants.map(i=>({...fu(i),image:i.image,selling_plan_allocations:i.selling_plan_allocations.map(a=>({price:a.price,compare_at_price:a.compare_at_price,selling_plan:Kt(a.selling_plan)}))}))}))}:null,cross_sells:r.cross_sells.products.length?{collection_id:e.cross_sells?.collection_id||"",collection_handle:e.cross_sells?.collection_handle||"",products:r.cross_sells.products.map(lu)}:null,incentives:iA(r.incentives)}}async function sA(r,e){return e?.source==="shopify_storefront"?fA():uA(r,e?.country_code)}async function uA(r,e){const{appName:t,appVersion:n}=V(),i={"X-Recharge-Sdk-Fn":"loadFromOnlineStore","X-Recharge-Sdk-Version":"1.67.1",...t?{"X-Recharge-Sdk-App-Name":t}:{},...n?{"X-Recharge-Sdk-App-Version":n}:{}};if(!e){const o=await Fe("get",`/bundle-data/${r}`,{headers:i});return Si(o)}const a=new FormData;a.append("form_type","localization"),a.append("_method","put"),a.append("return_to",`${io}/bundle-data/${r}`),a.append("country_code",e);try{const o=await X("post","/localization",{headers:{"Content-Type":"multipart/form-data",...i},data:a});return Si(o)}catch{const o=await Fe("get",`/bundle-data/${r}`,{headers:i});return Si(o)}}async function fA(r,e){if(!V().storeIdentifier)throw new Error("Store identifier is required for Shopify Storefront API requests");return{}}var cA=Object.freeze({__proto__:null,loadBundleData:sA}),lA=200,Ai="__lodash_hash_undefined__",dA=1/0,du=9007199254740991,pA="[object Arguments]",hA="[object Function]",yA="[object GeneratorFunction]",gA="[object Symbol]",_A=/[\\^$.*+?()[\]{}|]/g,vA=/^\[object .+?Constructor\]$/,mA=/^(?:0|[1-9]\d*)$/,wA=typeof U=="object"&&U&&U.Object===Object&&U,bA=typeof self=="object"&&self&&self.Object===Object&&self,Oi=wA||bA||Function("return this")();function $A(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}function EA(r,e){var t=r?r.length:0;return!!t&&OA(r,e,0)>-1}function SA(r,e,t){for(var n=-1,i=r?r.length:0;++n<i;)if(t(e,r[n]))return!0;return!1}function pu(r,e){for(var t=-1,n=r?r.length:0,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}function Ii(r,e){for(var t=-1,n=e.length,i=r.length;++t<n;)r[i+t]=e[t];return r}function AA(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}function OA(r,e,t){if(e!==e)return AA(r,IA,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function IA(r){return r!==r}function xA(r,e){for(var t=-1,n=Array(r);++t<r;)n[t]=e(t);return n}function PA(r){return function(e){return r(e)}}function TA(r,e){return r.has(e)}function RA(r,e){return r?.[e]}function FA(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function hu(r,e){return function(t){return r(e(t))}}var MA=Array.prototype,DA=Function.prototype,Zt=Object.prototype,xi=Oi["__core-js_shared__"],yu=function(){var r=/[^.]+$/.exec(xi&&xi.keys&&xi.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),gu=DA.toString,or=Zt.hasOwnProperty,Pi=Zt.toString,CA=RegExp("^"+gu.call(or).replace(_A,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_u=Oi.Symbol,NA=hu(Object.getPrototypeOf,Object),BA=Zt.propertyIsEnumerable,UA=MA.splice,vu=_u?_u.isConcatSpreadable:void 0,Ti=Object.getOwnPropertySymbols,mu=Math.max,qA=bu(Oi,"Map"),jr=bu(Object,"create");function Ue(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function kA(){this.__data__=jr?jr(null):{}}function LA(r){return this.has(r)&&delete this.__data__[r]}function jA(r){var e=this.__data__;if(jr){var t=e[r];return t===Ai?void 0:t}return or.call(e,r)?e[r]:void 0}function VA(r){var e=this.__data__;return jr?e[r]!==void 0:or.call(e,r)}function GA(r,e){var t=this.__data__;return t[r]=jr&&e===void 0?Ai:e,this}Ue.prototype.clear=kA,Ue.prototype.delete=LA,Ue.prototype.get=jA,Ue.prototype.has=VA,Ue.prototype.set=GA;function sr(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function HA(){this.__data__=[]}function WA(r){var e=this.__data__,t=Qt(e,r);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():UA.call(e,t,1),!0}function zA(r){var e=this.__data__,t=Qt(e,r);return t<0?void 0:e[t][1]}function XA(r){return Qt(this.__data__,r)>-1}function YA(r,e){var t=this.__data__,n=Qt(t,r);return n<0?t.push([r,e]):t[n][1]=e,this}sr.prototype.clear=HA,sr.prototype.delete=WA,sr.prototype.get=zA,sr.prototype.has=XA,sr.prototype.set=YA;function ur(r){var e=-1,t=r?r.length:0;for(this.clear();++e<t;){var n=r[e];this.set(n[0],n[1])}}function KA(){this.__data__={hash:new Ue,map:new(qA||sr),string:new Ue}}function ZA(r){return en(this,r).delete(r)}function JA(r){return en(this,r).get(r)}function QA(r){return en(this,r).has(r)}function eO(r,e){return en(this,r).set(r,e),this}ur.prototype.clear=KA,ur.prototype.delete=ZA,ur.prototype.get=JA,ur.prototype.has=QA,ur.prototype.set=eO;function Jt(r){var e=-1,t=r?r.length:0;for(this.__data__=new ur;++e<t;)this.add(r[e])}function rO(r){return this.__data__.set(r,Ai),this}function tO(r){return this.__data__.has(r)}Jt.prototype.add=Jt.prototype.push=rO,Jt.prototype.has=tO;function nO(r,e){var t=Ri(r)||$u(r)?xA(r.length,String):[],n=t.length,i=!!n;for(var a in r)(e||or.call(r,a))&&!(i&&(a=="length"||yO(a,n)))&&t.push(a);return t}function Qt(r,e){for(var t=r.length;t--;)if($O(r[t][0],e))return t;return-1}function iO(r,e,t,n){var i=-1,a=EA,o=!0,s=r.length,f=[],c=e.length;if(!s)return f;t&&(e=pu(e,PA(t))),n?(a=SA,o=!1):e.length>=lA&&(a=TA,o=!1,e=new Jt(e));e:for(;++i<s;){var l=r[i],u=t?t(l):l;if(l=n||l!==0?l:0,o&&u===u){for(var d=c;d--;)if(e[d]===u)continue e;f.push(l)}else a(e,u,n)||f.push(l)}return f}function wu(r,e,t,n,i){var a=-1,o=r.length;for(t||(t=hO),i||(i=[]);++a<o;){var s=r[a];e>0&&t(s)?e>1?wu(s,e-1,t,n,i):Ii(i,s):n||(i[i.length]=s)}return i}function aO(r,e,t){var n=e(r);return Ri(r)?n:Ii(n,t(r))}function oO(r){if(!Fi(r)||_O(r))return!1;var e=Su(r)||FA(r)?CA:vA;return e.test(bO(r))}function sO(r){if(!Fi(r))return mO(r);var e=vO(r),t=[];for(var n in r)n=="constructor"&&(e||!or.call(r,n))||t.push(n);return t}function uO(r,e){return r=Object(r),fO(r,e,function(t,n){return n in r})}function fO(r,e,t){for(var n=-1,i=e.length,a={};++n<i;){var o=e[n],s=r[o];t(s,o)&&(a[o]=s)}return a}function cO(r,e){return e=mu(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=mu(t.length-e,0),a=Array(i);++n<i;)a[n]=t[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=t[n];return o[e]=a,$A(r,this,o)}}function lO(r){return aO(r,OO,pO)}function en(r,e){var t=r.__data__;return gO(e)?t[typeof e=="string"?"string":"hash"]:t.map}function bu(r,e){var t=RA(r,e);return oO(t)?t:void 0}var dO=Ti?hu(Ti,Object):Ou,pO=Ti?function(r){for(var e=[];r;)Ii(e,dO(r)),r=NA(r);return e}:Ou;function hO(r){return Ri(r)||$u(r)||!!(vu&&r&&r[vu])}function yO(r,e){return e=e??du,!!e&&(typeof r=="number"||mA.test(r))&&r>-1&&r%1==0&&r<e}function gO(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}function _O(r){return!!yu&&yu in r}function vO(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||Zt;return r===t}function mO(r){var e=[];if(r!=null)for(var t in Object(r))e.push(t);return e}function wO(r){if(typeof r=="string"||AO(r))return r;var e=r+"";return e=="0"&&1/r==-dA?"-0":e}function bO(r){if(r!=null){try{return gu.call(r)}catch{}try{return r+""}catch{}}return""}function $O(r,e){return r===e||r!==r&&e!==e}function $u(r){return EO(r)&&or.call(r,"callee")&&(!BA.call(r,"callee")||Pi.call(r)==pA)}var Ri=Array.isArray;function Eu(r){return r!=null&&SO(r.length)&&!Su(r)}function EO(r){return Au(r)&&Eu(r)}function Su(r){var e=Fi(r)?Pi.call(r):"";return e==hA||e==yA}function SO(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=du}function Fi(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}function Au(r){return!!r&&typeof r=="object"}function AO(r){return typeof r=="symbol"||Au(r)&&Pi.call(r)==gA}function OO(r){return Eu(r)?nO(r,!0):sO(r)}var IO=cO(function(r,e){return r==null?{}:(e=pu(wu(e,1),wO),uO(r,iO(lO(r),e)))});function Ou(){return[]}var xO=IO,Mi=be(xO);function PO(r){try{return JSON.parse(r)}catch{return r}}function TO(r){return Object.entries(r).reduce((e,[t,n])=>({...e,[t]:PO(n)}),{})}const Iu=r=>typeof r=="string"?r!=="0"&&r!=="false":!!r;function xu(r){const e=TO(r),t=e.auto_inject===void 0?!0:e.auto_inject,n=e.display_on??[],i=e.first_option==="autodeliver";return{...Mi(e,["display_on","first_option"]),auto_inject:t,valid_pages:n,is_subscription_first:i,autoInject:t,validPages:n,isSubscriptionFirst:i}}function Pu(r){const e=r.subscription_options?.storefront_purchase_options==="subscription_only";return{...r,is_subscription_only:e,isSubscriptionOnly:e}}function RO(r){return r.map(e=>{const t={};return Object.entries(e).forEach(([n,i])=>{t[n]=Pu(i)}),t})}const Di="2020-12",FO={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Vr=new Map;function rn(r,e){return Vr.has(r)||Vr.set(r,e()),Vr.get(r)}async function Ci(r,e){if(r===void 0||r==="")throw new Error("ID is required");const t=e?.version??"2020-12",{product:n}=await rn(`product.${r}.${t}`,()=>ht("get",`/product/${t}/${r}.json`));return t==="2020-12"?Pu(n):n}async function Tu(){return await rn("storeSettings",()=>ht("get",`/${Di}/store_settings.json`).catch(()=>FO))}async function Ru(){const{widget_settings:r}=await rn("widgetSettings",()=>ht("get",`/${Di}/widget_settings.json`));return xu(r)}async function Fu(){const{products:r,widget_settings:e,store_settings:t,meta:n}=await rn("productsAndSettings",()=>ht("get",`/product/${Di}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:RO(r),widget_settings:xu(e),store_settings:t??{}}}async function MO(){const{products:r}=await Fu();return r}async function DO(r){const[e,t,n]=await Promise.all([Ci(r),Tu(),Ru()]);return{product:e,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function CO(r){const{bundle_product:e}=await Ci(r);return e}async function Mu(){return Array.from(Vr.keys()).forEach(r=>Vr.delete(r))}var NO=Object.freeze({__proto__:null,getCDNBundleSettings:CO,getCDNProduct:Ci,getCDNProductAndSettings:DO,getCDNProducts:MO,getCDNProductsAndSettings:Fu,getCDNStoreSettings:Tu,getCDNWidgetSettings:Ru,resetCDNCache:Mu});async function BO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("get","/charges",{id:e,query:{include:t?.include}},v(r,"getCharge"));return n}function UO(r,e){return w("get","/charges",{query:e},v(r,"listCharges"))}async function qO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("post",`/charges/${e}/apply_discount`,{data:{discount_code:t}},v(r,"applyDiscountToCharge"));return n}async function kO(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{charge:t}=await w("post",`/charges/${e}/remove_discount`,{},v(r,"removeDiscountsFromCharge"));return t}async function LO(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");if(t===void 0||t.length===0)throw new Error("Purchase item IDs are required");const{charge:i}=await w("post",`/charges/${e}/skip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},v(r,"skipCharge"));return i}async function jO(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");if(t===void 0||t.length===0)throw new Error("Purchase item IDs are required");const{charge:i}=await w("post",`/charges/${e}/unskip`,{query:n,data:{purchase_item_ids:t.map(a=>Number(a))}},v(r,"unskipCharge"));return i}async function VO(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{charge:t}=await w("post",`/charges/${e}/process`,{},v(r,"processCharge"));return t}async function GO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("post",`/charges/${e}/change_next_charge_date`,{data:{next_charge_date:t}},v(r,"rescheduleCharge"));return n}var HO=Object.freeze({__proto__:null,applyDiscountToCharge:qO,getCharge:BO,listCharges:UO,processCharge:VO,removeDiscountsFromCharge:kO,rescheduleCharge:GO,skipCharge:LO,unskipCharge:jO});async function Du(r,e){if(!["2020-12","2022-06"].includes(e.format_version))throw new Error("Missing or unsupported format_version.");return w("get","/product_search",{query:e,headers:{"X-Recharge-Version":"2021-01"}},v(r,"productSearch"))}var WO=Object.freeze({__proto__:null,productSearch:Du});async function Cu(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{collection:t}=await w("get","/collections",{id:e},v(r,"getCollection"));return t}function zO(r,e){return w("get","/collections",{query:e},v(r,"listCollections"))}async function XO(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");if(!["2020-12","2022-06"].includes(t.format_version))throw new Error("Missing or unsupported format_version.");const n=v(r,"listCollectionProducts"),[{sort_order:i,manual_sort_order:a},{products:o}]=await Promise.all([Cu(n,e),Du(n,{...t,collection_ids:[e],limit:250})]);if(i==="manual")return{products:a.reduce((s,f)=>{const c=o.find(l=>l.external_product_id===f);return c&&s.push(c),s},[])};{const s=YO(i);return{products:o.slice().sort(s)}}}function Nu(r,e){const t=r.external_created_at,n=e.external_created_at;return t<n?-1:n>t?1:0}function Bu(r,e){const t=r.external_product_id,n=e.external_product_id;return t<n?-1:n>t?1:0}function Uu(r,e){const t=r.title.toLowerCase(),n=e.title.toLowerCase();return t<n?-1:n>t?1:0}function YO(r){switch(r){case"created_at-asc":return Nu;case"created_at-desc":return(e,t)=>Nu(t,e);case"id-asc":return Bu;case"id-desc":return(e,t)=>Bu(t,e);case"title-asc":return Uu;case"title-desc":return(e,t)=>Uu(t,e)}}var KO=Object.freeze({__proto__:null,getCollection:Cu,listCollectionProducts:XO,listCollections:zO});async function ZO(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await w("get","/customers",{id:t,query:{include:e?.include}},v(r,"getCustomer"));return n}async function qu(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await w("put","/customers",{id:t,data:e},v(r,"updateCustomer"));return n}async function JO(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await w("get",`/customers/${t}/delivery_schedule`,{query:e},v(r,"getDeliverySchedule"));return n}async function tn(r,e){return w("get","/portal_access",{query:e},v(r,"getCustomerPortalAccess"))}async function QO(r,e,t){if(e===void 0||e==="")throw new Error("Subscription ID is required");const{base_url:n,customer_hash:i,temp_token:a}=await tn(v(r,"getActiveChurnLandingPageURL"));return`${n.replace("portal","pages")}${i}/subscriptions/${e}/cancel?token=${a}&subscription=${e}&redirect_to=${t}`}async function eI(r){const{base_url:e,customer_hash:t,temp_token:n}=await tn(v(r,"getFailedPaymentMethodRecoveryLandingPageURL"));return`${e.replace("portal","pages")}account/payment-methods?token=${n}&hash=${t}`}async function rI(r,e,t){if(e===void 0||e==="")throw new Error("Gift ID is required");const{base_url:n,customer_hash:i,temp_token:a}=await tn(v(r,"getGiftRedemptionLandingPageURL"));return`${n.replace("portal","pages")}${i}/gifts/${e}?token=${a}&redirect_to=${t}`}const tI={SHOPIFY_UPDATE_PAYMENT_INFO:{type:"email",template_type:"shopify_update_payment_information"},SHOPIFY_MIGRATE_PAYMENT_INFO:{type:"email",template_type:"shopify_migrate_payment_information"}};async function nI(r,e,t){const n=r.customerId;if(!n)throw new Error("Not logged in.");const i=tI[e];if(!i)throw new Error("Notification not supported.");return w("post",`/customers/${n}/notifications`,{data:{...i,template_vars:t}},v(r,"sendCustomerNotification"))}async function iI(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{credit_summary:n}=await w("get",`/customers/${t}/credit_summary`,{query:{include:e?.include}},v(r,"getCreditSummary"));return n}var aI=Object.freeze({__proto__:null,getActiveChurnLandingPageURL:QO,getCreditSummary:iI,getCustomer:ZO,getCustomerPortalAccess:tn,getDeliverySchedule:JO,getFailedPaymentMethodRecoveryLandingPageURL:eI,getGiftRedemptionLandingPageURL:rI,sendCustomerNotification:nI,updateCustomer:qu});async function oI(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");const{credit_summary:n}=await w("get",`/customers/${t}/credit_summary`,{query:{include:e?.include,presentment_currency_code:e?.presentment_currency_code}},v(r,"getCreditSummary"));return n}function sI(r,{recurring:e}){if(!r.customerId)throw new Error("Not logged in.");const t={};return e!==void 0&&(t.apply_credit_to_next_recurring_charge=e),qu(v(r,"setApplyCreditsToNextCharge"),t)}async function uI(r,e){const t=r.customerId;if(!t)throw new Error("Not logged in.");return await w("get","/credit_accounts",{query:{customer_id:t,...e}},v(r,"listCreditAccounts"))}var fI=Object.freeze({__proto__:null,getCreditSummary:oI,listCreditAccounts:uI,setApplyCreditsToNextCharge:sI});async function cI(r,e,t){return await w("post","/customer_surveys/cancellation_prevention",{data:{customer_id:e,subscription_id:t}},v(r,"getCustomerSurveyReasons"))}async function lI(r,e,t,n){return await w("post",`/customer_surveys/${t}/customer_response`,{data:{customer_id:e,response_id:n}},v(r,"getCustomerSurveyOffers"))}async function dI(r,e){return await w("post","/offers/claim",{data:e},v(r,"claimOfferCustomerSurvey")),{}}var pI=Object.freeze({__proto__:null,claimOfferCustomerSurvey:dI,getCustomerSurveyOffers:lI,getCustomerSurveyReasons:cI});function hI(r,e){if(!r.customerId)throw new Error("Not logged in.");return w("get","/gift_purchases",{query:e},v(r,"listGiftPurchases"))}async function yI(r,e){if(!r.customerId)throw new Error("Not logged in.");if(e===void 0||e==="")throw new Error("ID is required");const{gift_purchase:t}=await w("get","/gift_purchases",{id:e},v(r,"getGiftPurchase"));return t}var gI=Object.freeze({__proto__:null,getGiftPurchase:yI,listGiftPurchases:hI});async function _I(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{membership:t}=await w("get","/memberships",{id:e},v(r,"getMembership"));return t}function vI(r,e){return w("get","/memberships",{query:e},v(r,"listMemberships"))}async function mI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await w("post",`/memberships/${e}/cancel`,{data:t},v(r,"cancelMembership"));return n}async function wI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await w("post",`/memberships/${e}/activate`,{data:t},v(r,"activateMembership"));return n}async function bI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership:n}=await w("post",`/memberships/${e}/change`,{data:t},v(r,"changeMembership"));return n}var $I=Object.freeze({__proto__:null,activateMembership:wI,cancelMembership:mI,changeMembership:bI,getMembership:_I,listMemberships:vI});async function EI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{membership_program:n}=await w("get","/membership_programs",{id:e,query:{include:t?.include}},v(r,"getMembershipProgram"));return n}function SI(r,e){return w("get","/membership_programs",{query:e},v(r,"listMembershipPrograms"))}var AI=Object.freeze({__proto__:null,getMembershipProgram:EI,listMembershipPrograms:SI});async function OI(r,e){const{metafield:t}=await w("post","/metafields",{data:{metafield:e}},v(r,"createMetafield"));return t}async function II(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{metafield:n}=await w("put","/metafields",{id:e,data:{metafield:t}},v(r,"updateMetafield"));return n}function xI(r,e){if(e===void 0||e==="")throw new Error("ID is required");return w("delete","/metafields",{id:e},v(r,"deleteMetafield"))}var PI=Object.freeze({__proto__:null,createMetafield:OI,deleteMetafield:xI,updateMetafield:II});async function TI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{onetime:t}=await w("get","/onetimes",{id:e},v(r,"getOnetime"));return t}function RI(r,e){return w("get","/onetimes",{query:e},v(r,"listOnetimes"))}async function FI(r,e){const{onetime:t}=await w("post","/onetimes",{data:e},v(r,"createOnetime"));return t}async function MI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{onetime:n}=await w("put","/onetimes",{id:e,data:t},v(r,"updateOnetime"));return n}function DI(r,e){if(e===void 0||e==="")throw new Error("ID is required");return w("delete","/onetimes",{id:e},v(r,"deleteOnetime"))}var CI=Object.freeze({__proto__:null,createOnetime:FI,deleteOnetime:DI,getOnetime:TI,listOnetimes:RI,updateOnetime:MI});async function NI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{order:t}=await w("get","/orders",{id:e},v(r,"getOrder"));return t}function BI(r,e){return w("get","/orders",{query:e},v(r,"listOrders"))}async function UI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{order:t}=await w("post",`/orders/${e}/delay`,{},v(r,"delayOrder"));return t}var qI=Object.freeze({__proto__:null,delayOrder:UI,getOrder:NI,listOrders:BI});async function kI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{payment_method:n}=await w("get","/payment_methods",{id:e,query:{include:t?.include}},v(r,"getPaymentMethod"));return n}async function LI(r,e){const{payment_method:t}=await w("post","/payment_methods",{data:{...e,customer_id:r.customerId}},v(r,"createPaymentMethod"));return t}async function jI(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{payment_method:n}=await w("put","/payment_methods",{id:e,data:t},v(r,"updatePaymentMethod"));return n}function VI(r,e){return w("get","/payment_methods",{query:e},v(r,"listPaymentMethods"))}var GI=Object.freeze({__proto__:null,createPaymentMethod:LI,getPaymentMethod:kI,listPaymentMethods:VI,updatePaymentMethod:jI});async function HI(r,e){if(e===void 0||e==="")throw new Error("ID is required");const{plan:t}=await w("get","/plans",{id:e},v(r,"getPlan"));return t}function WI(r,e){return w("get","/plans",{query:e},v(r,"listPlans"))}var zI=Object.freeze({__proto__:null,getPlan:HI,listPlans:WI});async function XI(r,e){return await w("get","/shop/shipping_countries",{query:e,headers:{"X-Recharge-Version":"2021-01"}},v(r,"getShippingCountries"))}async function YI(r){return await w("get","/shop/settings",{headers:{"X-Recharge-Version":"2021-01"}},v(r,"getStoreSettings"))}var KI=Object.freeze({__proto__:null,getShippingCountries:XI,getStoreSettings:YI}),ZI="Expected a function",ku="__lodash_placeholder__",qe=1,nn=2,JI=4,fr=8,Gr=16,ke=32,Hr=64,Lu=128,QI=256,ju=512,Vu=1/0,ex=9007199254740991,rx=17976931348623157e292,Gu=0/0,tx=[["ary",Lu],["bind",qe],["bindKey",nn],["curry",fr],["curryRight",Gr],["flip",ju],["partial",ke],["partialRight",Hr],["rearg",QI]],nx="[object Function]",ix="[object GeneratorFunction]",ax="[object Symbol]",ox=/[\\^$.*+?()[\]{}|]/g,sx=/^\s+|\s+$/g,ux=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,fx=/\{\n\/\* \[wrapped with (.+)\] \*/,cx=/,? & /,lx=/^[-+]0x[0-9a-f]+$/i,dx=/^0b[01]+$/i,px=/^\[object .+?Constructor\]$/,hx=/^0o[0-7]+$/i,yx=/^(?:0|[1-9]\d*)$/,gx=parseInt,_x=typeof U=="object"&&U&&U.Object===Object&&U,vx=typeof self=="object"&&self&&self.Object===Object&&self,Wr=_x||vx||Function("return this")();function Ni(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}function mx(r,e){for(var t=-1,n=r?r.length:0;++t<n&&e(r[t],t,r)!==!1;);return r}function wx(r,e){var t=r?r.length:0;return!!t&&$x(r,e,0)>-1}function bx(r,e,t,n){for(var i=r.length,a=t+(n?1:-1);n?a--:++a<i;)if(e(r[a],a,r))return a;return-1}function $x(r,e,t){if(e!==e)return bx(r,Ex,t);for(var n=t-1,i=r.length;++n<i;)if(r[n]===e)return n;return-1}function Ex(r){return r!==r}function Sx(r,e){for(var t=r.length,n=0;t--;)r[t]===e&&n++;return n}function Ax(r,e){return r?.[e]}function Ox(r){var e=!1;if(r!=null&&typeof r.toString!="function")try{e=!!(r+"")}catch{}return e}function Bi(r,e){for(var t=-1,n=r.length,i=0,a=[];++t<n;){var o=r[t];(o===e||o===ku)&&(r[t]=ku,a[i++]=t)}return a}var Ix=Function.prototype,Hu=Object.prototype,Ui=Wr["__core-js_shared__"],Wu=function(){var r=/[^.]+$/.exec(Ui&&Ui.keys&&Ui.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),zu=Ix.toString,xx=Hu.hasOwnProperty,Xu=Hu.toString,Px=RegExp("^"+zu.call(xx).replace(ox,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tx=Object.create,cr=Math.max,Rx=Math.min,Yu=function(){var r=Zu(Object,"defineProperty"),e=Zu.name;return e&&e.length>2?r:void 0}();function Fx(r){return lr(r)?Tx(r):{}}function Mx(r){if(!lr(r)||Hx(r))return!1;var e=Yx(r)||Ox(r)?Px:px;return e.test(zx(r))}function Dx(r,e){return e=cr(e===void 0?r.length-1:e,0),function(){for(var t=arguments,n=-1,i=cr(t.length-e,0),a=Array(i);++n<i;)a[n]=t[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=t[n];return o[e]=a,Ni(r,this,o)}}function Cx(r,e,t,n){for(var i=-1,a=r.length,o=t.length,s=-1,f=e.length,c=cr(a-o,0),l=Array(f+c),u=!n;++s<f;)l[s]=e[s];for(;++i<o;)(u||i<a)&&(l[t[i]]=r[i]);for(;c--;)l[s++]=r[i++];return l}function Nx(r,e,t,n){for(var i=-1,a=r.length,o=-1,s=t.length,f=-1,c=e.length,l=cr(a-s,0),u=Array(l+c),d=!n;++i<l;)u[i]=r[i];for(var y=i;++f<c;)u[y+f]=e[f];for(;++o<s;)(d||i<a)&&(u[y+t[o]]=r[i++]);return u}function Bx(r,e){var t=-1,n=r.length;for(e||(e=Array(n));++t<n;)e[t]=r[t];return e}function Ux(r,e,t){var n=e&qe,i=zr(r);function a(){var o=this&&this!==Wr&&this instanceof a?i:r;return o.apply(n?t:this,arguments)}return a}function zr(r){return function(){var e=arguments;switch(e.length){case 0:return new r;case 1:return new r(e[0]);case 2:return new r(e[0],e[1]);case 3:return new r(e[0],e[1],e[2]);case 4:return new r(e[0],e[1],e[2],e[3]);case 5:return new r(e[0],e[1],e[2],e[3],e[4]);case 6:return new r(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new r(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var t=Fx(r.prototype),n=r.apply(t,e);return lr(n)?n:t}}function qx(r,e,t){var n=zr(r);function i(){for(var a=arguments.length,o=Array(a),s=a,f=ki(i);s--;)o[s]=arguments[s];var c=a<3&&o[0]!==f&&o[a-1]!==f?[]:Bi(o,f);if(a-=c.length,a<t)return Ku(r,e,qi,i.placeholder,void 0,o,c,void 0,void 0,t-a);var l=this&&this!==Wr&&this instanceof i?n:r;return Ni(l,this,o)}return i}function qi(r,e,t,n,i,a,o,s,f,c){var l=e&Lu,u=e&qe,d=e&nn,y=e&(fr|Gr),b=e&ju,S=d?void 0:zr(r);function O(){for(var $=arguments.length,E=Array($),p=$;p--;)E[p]=arguments[p];if(y)var I=ki(O),T=Sx(E,I);if(n&&(E=Cx(E,n,i,y)),a&&(E=Nx(E,a,o,y)),$-=T,y&&$<c){var F=Bi(E,I);return Ku(r,e,qi,O.placeholder,t,E,F,s,f,c-$)}var m=u?t:this,g=d?m[r]:r;return $=E.length,s?E=Wx(E,s):b&&$>1&&E.reverse(),l&&f<$&&(E.length=f),this&&this!==Wr&&this instanceof O&&(g=S||zr(g)),g.apply(m,E)}return O}function kx(r,e,t,n){var i=e&qe,a=zr(r);function o(){for(var s=-1,f=arguments.length,c=-1,l=n.length,u=Array(l+f),d=this&&this!==Wr&&this instanceof o?a:r;++c<l;)u[c]=n[c];for(;f--;)u[c++]=arguments[++s];return Ni(d,i?t:this,u)}return o}function Ku(r,e,t,n,i,a,o,s,f,c){var l=e&fr,u=l?o:void 0,d=l?void 0:o,y=l?a:void 0,b=l?void 0:a;e|=l?ke:Hr,e&=~(l?Hr:ke),e&JI||(e&=~(qe|nn));var S=t(r,e,i,y,u,b,d,s,f,c);return S.placeholder=n,Ju(S,r,e)}function Lx(r,e,t,n,i,a,o,s){var f=e&nn;if(!f&&typeof r!="function")throw new TypeError(ZI);var c=n?n.length:0;if(c||(e&=~(ke|Hr),n=i=void 0),o=o===void 0?o:cr(Qu(o),0),s=s===void 0?s:Qu(s),c-=i?i.length:0,e&Hr){var l=n,u=i;n=i=void 0}var d=[r,e,t,n,i,l,u,a,o,s];if(r=d[0],e=d[1],t=d[2],n=d[3],i=d[4],s=d[9]=d[9]==null?f?0:r.length:cr(d[9]-c,0),!s&&e&(fr|Gr)&&(e&=~(fr|Gr)),!e||e==qe)var y=Ux(r,e,t);else e==fr||e==Gr?y=qx(r,e,s):(e==ke||e==(qe|ke))&&!i.length?y=kx(r,e,t,n):y=qi.apply(void 0,d);return Ju(y,r,e)}function ki(r){var e=r;return e.placeholder}function Zu(r,e){var t=Ax(r,e);return Mx(t)?t:void 0}function jx(r){var e=r.match(fx);return e?e[1].split(cx):[]}function Vx(r,e){var t=e.length,n=t-1;return e[n]=(t>1?"& ":"")+e[n],e=e.join(t>2?", ":" "),r.replace(ux,`{
25
25
  /* [wrapped with `+e+`] */
26
26
  `)}function Gx(r,e){return e=e??ex,!!e&&(typeof r=="number"||yx.test(r))&&r>-1&&r%1==0&&r<e}function Hx(r){return!!Wu&&Wu in r}function Wx(r,e){for(var t=r.length,n=Rx(e.length,t),i=Bx(r);n--;){var a=e[n];r[n]=Gx(a,t)?i[a]:void 0}return r}var Ju=Yu?function(r,e,t){var n=e+"";return Yu(r,"toString",{configurable:!0,enumerable:!1,value:e2(Vx(n,Xx(jx(n),t)))})}:r2;function zx(r){if(r!=null){try{return zu.call(r)}catch{}try{return r+""}catch{}}return""}function Xx(r,e){return mx(tx,function(t){var n="_."+t[0];e&t[1]&&!wx(r,n)&&r.push(n)}),r.sort()}var Li=Dx(function(r,e){var t=Bi(e,ki(Li));return Lx(r,ke,void 0,e,t)});function Yx(r){var e=lr(r)?Xu.call(r):"";return e==nx||e==ix}function lr(r){var e=typeof r;return!!r&&(e=="object"||e=="function")}function Kx(r){return!!r&&typeof r=="object"}function Zx(r){return typeof r=="symbol"||Kx(r)&&Xu.call(r)==ax}function Jx(r){if(!r)return r===0?r:0;if(r=Qx(r),r===Vu||r===-Vu){var e=r<0?-1:1;return e*rx}return r===r?r:0}function Qu(r){var e=Jx(r),t=e%1;return e===e?t?e-t:e:0}function Qx(r){if(typeof r=="number")return r;if(Zx(r))return Gu;if(lr(r)){var e=typeof r.valueOf=="function"?r.valueOf():r;r=lr(e)?e+"":e}if(typeof r!="string")return r===0?r:+r;r=r.replace(sx,"");var t=dx.test(r);return t||hx.test(r)?gx(r.slice(2),t?2:8):lx.test(r)?Gu:+r}function e2(r){return function(){return r}}function r2(r){return r}Li.placeholder={};var t2=Li,ef=be(t2);function n2(r,e){return{...Mi(e,["address_id","external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","status"]),customer_id:parseInt(r,10),shopify_variant_id:e.external_variant_id.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,...e.charge_interval_frequency?{charge_interval_frequency:`${e.charge_interval_frequency}`}:{},...e.order_interval_frequency?{order_interval_frequency:`${e.order_interval_frequency}`}:{},status:e.status?e.status.toUpperCase():void 0}}function i2(r,e){return{...Mi(e,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"]),shopify_variant_id:e.external_variant_id?.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,...e.charge_interval_frequency?{charge_interval_frequency:`${e.charge_interval_frequency}`}:void 0,...e.order_interval_frequency?{order_interval_frequency:`${e.order_interval_frequency}`}:void 0,force_update:r}}function rf(r){const{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:f,created_at:c,expire_after_specific_number_of_charges:l,shopify_product_id:u,shopify_variant_id:d,has_queued_charges:y,is_prepaid:b,is_skippable:S,is_swappable:O,max_retries_reached:$,next_charge_scheduled_at:E,order_day_of_month:p,order_day_of_week:I,order_interval_frequency:T,order_interval_unit:F,presentment_currency:m,price:g,product_title:_,properties:A,quantity:x,sku:M,sku_override:Y,status:me,updated_at:dr,variant_title:we}=r;return{id:e,address_id:t,customer_id:n,analytics_data:i,cancellation_reason:a,cancellation_reason_comments:o,cancelled_at:s,charge_interval_frequency:parseInt(f,10),created_at:c,expire_after_specific_number_of_charges:l,external_product_id:{ecommerce:`${u}`},external_variant_id:{ecommerce:`${d}`},has_queued_charges:Iu(y),is_prepaid:b,is_skippable:S,is_swappable:O,max_retries_reached:Iu($),next_charge_scheduled_at:E,order_day_of_month:p,order_day_of_week:I,order_interval_frequency:parseInt(T,10),order_interval_unit:F,presentment_currency:m,price:`${g}`,product_title:_??"",properties:A,quantity:x,sku:M,sku_override:Y,status:me.toLowerCase(),updated_at:dr,variant_title:we}}async function a2(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:n}=await w("get","/subscriptions",{id:e,query:{include:t?.include}},v(r,"getSubscription"));return n}function o2(r,e){return w("get","/subscriptions",{query:e},v(r,"listSubscriptions"))}async function s2(r,e,t){const{subscription:n}=await w("post","/subscriptions",{data:e,query:t},v(r,"createSubscription"));return n}async function u2(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:i}=await w("put","/subscriptions",{id:e,data:t,query:n},v(r,"updateSubscription"));return i}async function f2(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:i}=await w("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:t},query:n},v(r,"updateSubscriptionChargeDate"));return i}async function c2(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:n}=await w("post",`/subscriptions/${e}/change_address`,{data:{address_id:t}},v(r,"updateSubscriptionAddress"));return n}async function l2(r,e,t,n){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:i}=await w("post",`/subscriptions/${e}/cancel`,{data:t,query:n},v(r,"cancelSubscription"));return i}async function d2(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{subscription:n}=await w("post",`/subscriptions/${e}/activate`,{query:t},v(r,"activateSubscription"));return n}async function p2(r,e,t){if(e===void 0||e==="")throw new Error("ID is required");const{charge:n}=await w("post",`/subscriptions/${e}/charges/skip`,{data:{date:t,subscription_id:`${e}`}},v(r,"skipSubscriptionCharge"));return n}async function h2(r,e,t){if(e===void 0||e.length===0)throw new Error("Subscription IDs are required");const{onetimes:n}=await w("post","/purchase_items/skip_gift",{data:{purchase_item_ids:e.map(Number),recipient_address:t}},v(r,"skipGiftSubscriptionCharge"));return n}async function y2(r,e,t){const n=e.length;if(n<1||n>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:i}=r;if(!i)throw new Error("No customerId in session.");const a=e[0].address_id;if(!e.every(l=>l.address_id===a))throw new Error("All subscriptions must have the same address_id.");const o=ef(n2,i),s=e.map(o);let f;t?.allow_onetimes!==void 0&&(f={allow_onetimes:t.allow_onetimes});const{subscriptions:c}=await w("post",`/addresses/${a}/subscriptions-bulk`,{data:{subscriptions:s,commit_update:!!t?.commit},headers:{"X-Recharge-Version":"2021-01"},query:f},v(r,"createSubscriptions"));return c.map(rf)}async function g2(r,e,t,n){if(e===void 0||e==="")throw new Error("Address ID is required");const i=t.length;if(i<1||i>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:a}=r;if(!a)throw new Error("No customerId in session.");const o=ef(i2,!!n?.force_update),s=t.map(o);let f;n?.allow_onetimes!==void 0&&(f={allow_onetimes:n.allow_onetimes});const{subscriptions:c}=await w("put",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:s,commit_update:!!n?.commit},headers:{"X-Recharge-Version":"2021-01"},query:f},v(r,"updateSubscriptions"));return c.map(rf)}async function _2(r,e,t,n){if(e===void 0||e==="")throw new Error("Address ID is required");const i=t.length;if(i<1||i>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:a}=r;if(!a)throw new Error("No customerId in session.");let o;n?.allow_onetimes!==void 0&&(o={allow_onetimes:n.allow_onetimes}),await w("delete",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:t,send_email:!!n?.send_email,commit_update:!!n?.commit},headers:{"X-Recharge-Version":"2021-01"},query:o},v(r,"deleteSubscriptions"))}var v2=Object.freeze({__proto__:null,activateSubscription:d2,cancelSubscription:l2,createSubscription:s2,createSubscriptions:y2,deleteSubscriptions:_2,getSubscription:a2,listSubscriptions:o2,skipGiftSubscriptionCharge:h2,skipSubscriptionCharge:p2,updateSubscription:u2,updateSubscriptionAddress:c2,updateSubscriptionChargeDate:f2,updateSubscriptions:g2});const m2={get(r,e){return X("get",r,e)},post(r,e){return X("post",r,e)},put(r,e){return X("put",r,e)},delete(r,e){return X("delete",r,e)}};function w2(r){if(r)return r;if(window?.Shopify?.shop)return window.Shopify.shop;let e=window?.domain;if(!e){const t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i)?.[1].replace(/-sp$/,"");t&&(e=`${t}.myshopify.com`)}if(e)return e;throw new Error("No storeIdentifier was passed into init.")}function b2(r={}){const e=r,{storefrontAccessToken:t}=r;if(t&&!t.startsWith("strfnt"))throw new Error("Incorrect storefront access token used. See https://storefront.rechargepayments.com/client/docs/getting_started/package_setup/#initialization-- for more information.");gd({storeIdentifier:w2(r.storeIdentifier),loginRetryFn:r.loginRetryFn,__unstable_twoFactorRetryFn:r.__unstable_twoFactorRetryFn,storefrontAccessToken:t,appName:r.appName,appVersion:r.appVersion,environment:e.environment?e.environment:"prod",environmentUri:e.environmentUri,customerHash:e.customerHash}),Mu()}const tf={init:b2,api:m2,address:Pd,auth:qd,bundle:tA,bundleData:cA,charge:HO,cdn:NO,collection:KO,credit:fI,customer:aI,customerSurveys:pI,gift:gI,membership:$I,membershipProgram:AI,metafield:PI,onetime:CI,order:qI,paymentMethod:GI,plan:zI,product:WO,store:KI,subscription:v2};try{tf.init()}catch{}return tf});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rechargeapps/storefront-client",
3
3
  "description": "Storefront client for Recharge",
4
- "version": "1.66.0",
4
+ "version": "1.67.1",
5
5
  "author": "Recharge Inc.",
6
6
  "license": "MIT",
7
7
  "main": "dist/cjs/index.js",