@rechargeapps/storefront-client 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,22 +1,22 @@
1
- // recharge-client-1.6.0.min.js | MIT License | © Recharge Inc.
2
- (function(Ae,vr){typeof exports=="object"&&typeof module<"u"?module.exports=vr():typeof define=="function"&&define.amd?define(vr):(Ae=typeof globalThis<"u"?globalThis:Ae||self,Ae.recharge=vr())})(this,function(){"use strict";var Ae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vr(e){var r=e.default;if(typeof r=="function"){var t=function(){return r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),t}var Z=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Z<"u"&&Z,ne={searchParams:"URLSearchParams"in Z,iterable:"Symbol"in Z&&"iterator"in Symbol,blob:"FileReader"in Z&&"Blob"in Z&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in Z,arrayBuffer:"ArrayBuffer"in Z};function Cs(e){return e&&DataView.prototype.isPrototypeOf(e)}if(ne.arrayBuffer)var Us=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Ds=ArrayBuffer.isView||function(e){return e&&Us.indexOf(Object.prototype.toString.call(e))>-1};function mr(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||e==="")throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function Pt(e){return typeof e!="string"&&(e=String(e)),e}function Rt(e){var r={next:function(){var t=e.shift();return{done:t===void 0,value:t}}};return ne.iterable&&(r[Symbol.iterator]=function(){return r}),r}function W(e){this.map={},e instanceof W?e.forEach(function(r,t){this.append(t,r)},this):Array.isArray(e)?e.forEach(function(r){this.append(r[0],r[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(r){this.append(r,e[r])},this)}W.prototype.append=function(e,r){e=mr(e),r=Pt(r);var t=this.map[e];this.map[e]=t?t+", "+r:r},W.prototype.delete=function(e){delete this.map[mr(e)]},W.prototype.get=function(e){return e=mr(e),this.has(e)?this.map[e]:null},W.prototype.has=function(e){return this.map.hasOwnProperty(mr(e))},W.prototype.set=function(e,r){this.map[mr(e)]=Pt(r)},W.prototype.forEach=function(e,r){for(var t in this.map)this.map.hasOwnProperty(t)&&e.call(r,this.map[t],t,this)},W.prototype.keys=function(){var e=[];return this.forEach(function(r,t){e.push(t)}),Rt(e)},W.prototype.values=function(){var e=[];return this.forEach(function(r){e.push(r)}),Rt(e)},W.prototype.entries=function(){var e=[];return this.forEach(function(r,t){e.push([t,r])}),Rt(e)},ne.iterable&&(W.prototype[Symbol.iterator]=W.prototype.entries);function Ft(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function Zn(e){return new Promise(function(r,t){e.onload=function(){r(e.result)},e.onerror=function(){t(e.error)}})}function Ns(e){var r=new FileReader,t=Zn(r);return r.readAsArrayBuffer(e),t}function Ls(e){var r=new FileReader,t=Zn(r);return r.readAsText(e),t}function Ms(e){for(var r=new Uint8Array(e),t=new Array(r.length),n=0;n<r.length;n++)t[n]=String.fromCharCode(r[n]);return t.join("")}function ei(e){if(e.slice)return e.slice(0);var r=new Uint8Array(e.byteLength);return r.set(new Uint8Array(e)),r.buffer}function ri(){return this.bodyUsed=!1,this._initBody=function(e){this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?typeof e=="string"?this._bodyText=e:ne.blob&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:ne.formData&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:ne.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():ne.arrayBuffer&&ne.blob&&Cs(e)?(this._bodyArrayBuffer=ei(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):ne.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||Ds(e))?this._bodyArrayBuffer=ei(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||(typeof e=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):ne.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},ne.blob&&(this.blob=function(){var e=Ft(this);if(e)return e;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 e=Ft(this);return e||(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(Ns)}),this.text=function(){var e=Ft(this);if(e)return e;if(this._bodyBlob)return Ls(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Ms(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},ne.formData&&(this.formData=function(){return this.text().then(Gs)}),this.json=function(){return this.text().then(JSON.parse)},this}var js=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function ks(e){var r=e.toUpperCase();return js.indexOf(r)>-1?r:e}function Me(e,r){if(!(this instanceof Me))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');r=r||{};var t=r.body;if(e instanceof Me){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,r.headers||(this.headers=new W(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,!t&&e._bodyInit!=null&&(t=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=r.credentials||this.credentials||"same-origin",(r.headers||!this.headers)&&(this.headers=new W(r.headers)),this.method=ks(r.method||this.method||"GET"),this.mode=r.mode||this.mode||null,this.signal=r.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")&&(r.cache==="no-store"||r.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var a=/\?/;this.url+=(a.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}Me.prototype.clone=function(){return new Me(this,{body:this._bodyInit})};function Gs(e){var r=new FormData;return e.trim().split("&").forEach(function(t){if(t){var n=t.split("="),a=n.shift().replace(/\+/g," "),s=n.join("=").replace(/\+/g," ");r.append(decodeURIComponent(a),decodeURIComponent(s))}}),r}function Ws(e){var r=new W,t=e.replace(/\r?\n[\t ]+/g," ");return t.split("\r").map(function(n){return n.indexOf(`
3
- `)===0?n.substr(1,n.length):n}).forEach(function(n){var a=n.split(":"),s=a.shift().trim();if(s){var c=a.join(":").trim();r.append(s,c)}}),r}ri.call(Me.prototype);function de(e,r){if(!(this instanceof de))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');r||(r={}),this.type="default",this.status=r.status===void 0?200:r.status,this.ok=this.status>=200&&this.status<300,this.statusText=r.statusText===void 0?"":""+r.statusText,this.headers=new W(r.headers),this.url=r.url||"",this._initBody(e)}ri.call(de.prototype),de.prototype.clone=function(){return new de(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new W(this.headers),url:this.url})},de.error=function(){var e=new de(null,{status:0,statusText:""});return e.type="error",e};var qs=[301,302,303,307,308];de.redirect=function(e,r){if(qs.indexOf(r)===-1)throw new RangeError("Invalid status code");return new de(null,{status:r,headers:{location:e}})};var je=Z.DOMException;try{new je}catch{je=function(r,t){this.message=r,this.name=t;var n=Error(r);this.stack=n.stack},je.prototype=Object.create(Error.prototype),je.prototype.constructor=je}function ti(e,r){return new Promise(function(t,n){var a=new Me(e,r);if(a.signal&&a.signal.aborted)return n(new je("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var h={status:s.status,statusText:s.statusText,headers:Ws(s.getAllResponseHeaders()||"")};h.url="responseURL"in s?s.responseURL:h.headers.get("X-Request-URL");var v="response"in s?s.response:s.responseText;setTimeout(function(){t(new de(v,h))},0)},s.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},s.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},s.onabort=function(){setTimeout(function(){n(new je("Aborted","AbortError"))},0)};function p(h){try{return h===""&&Z.location.href?Z.location.href:h}catch{return h}}s.open(a.method,p(a.url),!0),a.credentials==="include"?s.withCredentials=!0:a.credentials==="omit"&&(s.withCredentials=!1),"responseType"in s&&(ne.blob?s.responseType="blob":ne.arrayBuffer&&a.headers.get("Content-Type")&&a.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(s.responseType="arraybuffer")),r&&typeof r.headers=="object"&&!(r.headers instanceof W)?Object.getOwnPropertyNames(r.headers).forEach(function(h){s.setRequestHeader(h,Pt(r.headers[h]))}):a.headers.forEach(function(h,v){s.setRequestHeader(v,h)}),a.signal&&(a.signal.addEventListener("abort",c),s.onreadystatechange=function(){s.readyState===4&&a.signal.removeEventListener("abort",c)}),s.send(typeof a._bodyInit>"u"?null:a._bodyInit)})}ti.polyfill=!0,Z.fetch||(Z.fetch=ti,Z.Headers=W,Z.Request=Me,Z.Response=de),self.fetch.bind(self);var zs=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var r={},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 a=42;r[t]=a;for(t in r)return!1;if(typeof Object.keys=="function"&&Object.keys(r).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(r).length!==0)return!1;var s=Object.getOwnPropertySymbols(r);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(r,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(r,t);if(c.value!==a||c.enumerable!==!0)return!1}return!0},ni=typeof Symbol<"u"&&Symbol,Vs=zs,Hs=function(){return typeof ni!="function"||typeof Symbol!="function"||typeof ni("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Vs()},ii={foo:{}},Ys=Object,Ks=function(){return{__proto__:ii}.foo===ii.foo&&!({__proto__:null}instanceof Ys)},Xs="Function.prototype.bind called on incompatible ",Ct=Array.prototype.slice,Js=Object.prototype.toString,Qs="[object Function]",Zs=function(r){var t=this;if(typeof t!="function"||Js.call(t)!==Qs)throw new TypeError(Xs+t);for(var n=Ct.call(arguments,1),a,s=function(){if(this instanceof a){var _=t.apply(this,n.concat(Ct.call(arguments)));return Object(_)===_?_:this}else return t.apply(r,n.concat(Ct.call(arguments)))},c=Math.max(0,t.length-n.length),p=[],h=0;h<c;h++)p.push("$"+h);if(a=Function("binder","return function ("+p.join(",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var v=function(){};v.prototype=t.prototype,a.prototype=new v,v.prototype=null}return a},eu=Zs,Ut=Function.prototype.bind||eu,ru=Ut,tu=ru.call(Function.call,Object.prototype.hasOwnProperty),U,Qe=SyntaxError,oi=Function,Ze=TypeError,Dt=function(e){try{return oi('"use strict"; return ('+e+").constructor;")()}catch{}},ke=Object.getOwnPropertyDescriptor;if(ke)try{ke({},"")}catch{ke=null}var Nt=function(){throw new Ze},nu=ke?function(){try{return arguments.callee,Nt}catch{try{return ke(arguments,"callee").get}catch{return Nt}}}():Nt,er=Hs(),iu=Ks(),Y=Object.getPrototypeOf||(iu?function(e){return e.__proto__}:null),rr={},ou=typeof Uint8Array>"u"||!Y?U:Y(Uint8Array),Ge={"%AggregateError%":typeof AggregateError>"u"?U:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?U:ArrayBuffer,"%ArrayIteratorPrototype%":er&&Y?Y([][Symbol.iterator]()):U,"%AsyncFromSyncIteratorPrototype%":U,"%AsyncFunction%":rr,"%AsyncGenerator%":rr,"%AsyncGeneratorFunction%":rr,"%AsyncIteratorPrototype%":rr,"%Atomics%":typeof Atomics>"u"?U:Atomics,"%BigInt%":typeof BigInt>"u"?U:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?U:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?U:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?U:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?U:Float32Array,"%Float64Array%":typeof Float64Array>"u"?U:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?U:FinalizationRegistry,"%Function%":oi,"%GeneratorFunction%":rr,"%Int8Array%":typeof Int8Array>"u"?U:Int8Array,"%Int16Array%":typeof Int16Array>"u"?U:Int16Array,"%Int32Array%":typeof Int32Array>"u"?U:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":er&&Y?Y(Y([][Symbol.iterator]())):U,"%JSON%":typeof JSON=="object"?JSON:U,"%Map%":typeof Map>"u"?U:Map,"%MapIteratorPrototype%":typeof Map>"u"||!er||!Y?U:Y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?U:Promise,"%Proxy%":typeof Proxy>"u"?U:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?U:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?U:Set,"%SetIteratorPrototype%":typeof Set>"u"||!er||!Y?U:Y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?U:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":er&&Y?Y(""[Symbol.iterator]()):U,"%Symbol%":er?Symbol:U,"%SyntaxError%":Qe,"%ThrowTypeError%":nu,"%TypedArray%":ou,"%TypeError%":Ze,"%Uint8Array%":typeof Uint8Array>"u"?U:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?U:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?U:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?U:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?U:WeakMap,"%WeakRef%":typeof WeakRef>"u"?U:WeakRef,"%WeakSet%":typeof WeakSet>"u"?U:WeakSet};if(Y)try{null.error}catch(e){var au=Y(Y(e));Ge["%Error.prototype%"]=au}var su=function e(r){var t;if(r==="%AsyncFunction%")t=Dt("async function () {}");else if(r==="%GeneratorFunction%")t=Dt("function* () {}");else if(r==="%AsyncGeneratorFunction%")t=Dt("async function* () {}");else if(r==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(t=n.prototype)}else if(r==="%AsyncIteratorPrototype%"){var a=e("%AsyncGenerator%");a&&Y&&(t=Y(a.prototype))}return Ge[r]=t,t},ai={"%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"]},_r=Ut,kr=tu,uu=_r.call(Function.call,Array.prototype.concat),cu=_r.call(Function.apply,Array.prototype.splice),si=_r.call(Function.call,String.prototype.replace),Gr=_r.call(Function.call,String.prototype.slice),fu=_r.call(Function.call,RegExp.prototype.exec),lu=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,pu=/\\(\\)?/g,hu=function(r){var t=Gr(r,0,1),n=Gr(r,-1);if(t==="%"&&n!=="%")throw new Qe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&t!=="%")throw new Qe("invalid intrinsic syntax, expected opening `%`");var a=[];return si(r,lu,function(s,c,p,h){a[a.length]=p?si(h,pu,"$1"):c||s}),a},du=function(r,t){var n=r,a;if(kr(ai,n)&&(a=ai[n],n="%"+a[0]+"%"),kr(Ge,n)){var s=Ge[n];if(s===rr&&(s=su(n)),typeof s>"u"&&!t)throw new Ze("intrinsic "+r+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:s}}throw new Qe("intrinsic "+r+" does not exist!")},Lt=function(r,t){if(typeof r!="string"||r.length===0)throw new Ze("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Ze('"allowMissing" argument must be a boolean');if(fu(/^%?[^%]*%?$/,r)===null)throw new Qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=hu(r),a=n.length>0?n[0]:"",s=du("%"+a+"%",t),c=s.name,p=s.value,h=!1,v=s.alias;v&&(a=v[0],cu(n,uu([0,1],v)));for(var _=1,w=!0;_<n.length;_+=1){var b=n[_],d=Gr(b,0,1),E=Gr(b,-1);if((d==='"'||d==="'"||d==="`"||E==='"'||E==="'"||E==="`")&&d!==E)throw new Qe("property names with quotes must have matching quotes");if((b==="constructor"||!w)&&(h=!0),a+="."+b,c="%"+a+"%",kr(Ge,c))p=Ge[c];else if(p!=null){if(!(b in p)){if(!t)throw new Ze("base intrinsic for "+r+" exists, but the property is not available.");return}if(ke&&_+1>=n.length){var x=ke(p,b);w=!!x,w&&"get"in x&&!("originalValue"in x.get)?p=x.get:p=p[b]}else w=kr(p,b),p=p[b];w&&!h&&(Ge[c]=p)}}return p},ui={exports:{}};(function(e){var r=Ut,t=Lt,n=t("%Function.prototype.apply%"),a=t("%Function.prototype.call%"),s=t("%Reflect.apply%",!0)||r.call(a,n),c=t("%Object.getOwnPropertyDescriptor%",!0),p=t("%Object.defineProperty%",!0),h=t("%Math.max%");if(p)try{p({},"a",{value:1})}catch{p=null}e.exports=function(w){var b=s(r,a,arguments);if(c&&p){var d=c(b,"length");d.configurable&&p(b,"length",{value:1+h(0,w.length-(arguments.length-1))})}return b};var v=function(){return s(r,n,arguments)};p?p(e.exports,"apply",{value:v}):e.exports.apply=v})(ui);var ci=Lt,fi=ui.exports,yu=fi(ci("String.prototype.indexOf")),gu=function(r,t){var n=ci(r,!!t);return typeof n=="function"&&yu(r,".prototype.")>-1?fi(n):n},tr=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},ye=[],fe=[],vu=typeof Uint8Array<"u"?Uint8Array:Array,Mt=!1;function li(){Mt=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=0,t=e.length;r<t;++r)ye[r]=e[r],fe[e.charCodeAt(r)]=r;fe["-".charCodeAt(0)]=62,fe["_".charCodeAt(0)]=63}function mu(e){Mt||li();var r,t,n,a,s,c,p=e.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=e[p-2]==="="?2:e[p-1]==="="?1:0,c=new vu(p*3/4-s),n=s>0?p-4:p;var h=0;for(r=0,t=0;r<n;r+=4,t+=3)a=fe[e.charCodeAt(r)]<<18|fe[e.charCodeAt(r+1)]<<12|fe[e.charCodeAt(r+2)]<<6|fe[e.charCodeAt(r+3)],c[h++]=a>>16&255,c[h++]=a>>8&255,c[h++]=a&255;return s===2?(a=fe[e.charCodeAt(r)]<<2|fe[e.charCodeAt(r+1)]>>4,c[h++]=a&255):s===1&&(a=fe[e.charCodeAt(r)]<<10|fe[e.charCodeAt(r+1)]<<4|fe[e.charCodeAt(r+2)]>>2,c[h++]=a>>8&255,c[h++]=a&255),c}function _u(e){return ye[e>>18&63]+ye[e>>12&63]+ye[e>>6&63]+ye[e&63]}function wu(e,r,t){for(var n,a=[],s=r;s<t;s+=3)n=(e[s]<<16)+(e[s+1]<<8)+e[s+2],a.push(_u(n));return a.join("")}function pi(e){Mt||li();for(var r,t=e.length,n=t%3,a="",s=[],c=16383,p=0,h=t-n;p<h;p+=c)s.push(wu(e,p,p+c>h?h:p+c));return n===1?(r=e[t-1],a+=ye[r>>2],a+=ye[r<<4&63],a+="=="):n===2&&(r=(e[t-2]<<8)+e[t-1],a+=ye[r>>10],a+=ye[r>>4&63],a+=ye[r<<2&63],a+="="),s.push(a),s.join("")}function Wr(e,r,t,n,a){var s,c,p=a*8-n-1,h=(1<<p)-1,v=h>>1,_=-7,w=t?a-1:0,b=t?-1:1,d=e[r+w];for(w+=b,s=d&(1<<-_)-1,d>>=-_,_+=p;_>0;s=s*256+e[r+w],w+=b,_-=8);for(c=s&(1<<-_)-1,s>>=-_,_+=n;_>0;c=c*256+e[r+w],w+=b,_-=8);if(s===0)s=1-v;else{if(s===h)return c?NaN:(d?-1:1)*(1/0);c=c+Math.pow(2,n),s=s-v}return(d?-1:1)*c*Math.pow(2,s-n)}function hi(e,r,t,n,a,s){var c,p,h,v=s*8-a-1,_=(1<<v)-1,w=_>>1,b=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:s-1,E=n?1:-1,x=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(p=isNaN(r)?1:0,c=_):(c=Math.floor(Math.log(r)/Math.LN2),r*(h=Math.pow(2,-c))<1&&(c--,h*=2),c+w>=1?r+=b/h:r+=b*Math.pow(2,1-w),r*h>=2&&(c++,h/=2),c+w>=_?(p=0,c=_):c+w>=1?(p=(r*h-1)*Math.pow(2,a),c=c+w):(p=r*Math.pow(2,w-1)*Math.pow(2,a),c=0));a>=8;e[t+d]=p&255,d+=E,p/=256,a-=8);for(c=c<<a|p,v+=a;v>0;e[t+d]=c&255,d+=E,c/=256,v-=8);e[t+d-E]|=x*128}var bu={}.toString,di=Array.isArray||function(e){return bu.call(e)=="[object Array]"};/*!
1
+ // recharge-client-1.7.0.min.js | MIT License | © Recharge Inc.
2
+ (function(oe,pt){typeof exports=="object"&&typeof module<"u"?module.exports=pt():typeof define=="function"&&define.amd?define(pt):(oe=typeof globalThis<"u"?globalThis:oe||self,oe.recharge=pt())})(this,function(){"use strict";var oe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pt(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}),r}var K=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof K<"u"&&K,te={searchParams:"URLSearchParams"in K,iterable:"Symbol"in K&&"iterator"in Symbol,blob:"FileReader"in K&&"Blob"in K&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in K,arrayBuffer:"ArrayBuffer"in K};function zo(t){return t&&DataView.prototype.isPrototypeOf(t)}if(te.arrayBuffer)var Go=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],Wo=ArrayBuffer.isView||function(t){return t&&Go.indexOf(Object.prototype.toString.call(t))>-1};function ht(t){if(typeof t!="string"&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||t==="")throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function wr(t){return typeof t!="string"&&(t=String(t)),t}function vr(t){var e={next:function(){var r=t.shift();return{done:r===void 0,value:r}}};return te.iterable&&(e[Symbol.iterator]=function(){return e}),e}function j(t){this.map={},t instanceof j?t.forEach(function(e,r){this.append(r,e)},this):Array.isArray(t)?t.forEach(function(e){this.append(e[0],e[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}j.prototype.append=function(t,e){t=ht(t),e=wr(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},j.prototype.delete=function(t){delete this.map[ht(t)]},j.prototype.get=function(t){return t=ht(t),this.has(t)?this.map[t]:null},j.prototype.has=function(t){return this.map.hasOwnProperty(ht(t))},j.prototype.set=function(t,e){this.map[ht(t)]=wr(e)},j.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},j.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),vr(t)},j.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),vr(t)},j.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),vr(t)},te.iterable&&(j.prototype[Symbol.iterator]=j.prototype.entries);function _r(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function An(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function Ho(t){var e=new FileReader,r=An(e);return e.readAsArrayBuffer(t),r}function Yo(t){var e=new FileReader,r=An(e);return e.readAsText(t),r}function Xo(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}function xn(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function Sn(){return this.bodyUsed=!1,this._initBody=function(t){this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?typeof t=="string"?this._bodyText=t:te.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:te.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:te.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():te.arrayBuffer&&te.blob&&zo(t)?(this._bodyArrayBuffer=xn(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):te.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||Wo(t))?this._bodyArrayBuffer=xn(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||(typeof t=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):te.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},te.blob&&(this.blob=function(){var t=_r(this);if(t)return t;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 t=_r(this);return t||(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(Ho)}),this.text=function(){var t=_r(this);if(t)return t;if(this._bodyBlob)return Yo(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Xo(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},te.formData&&(this.formData=function(){return this.text().then(Qo)}),this.json=function(){return this.text().then(JSON.parse)},this}var Jo=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function Ko(t){var e=t.toUpperCase();return Jo.indexOf(e)>-1?e:t}function Ue(t,e){if(!(this instanceof Ue))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var r=e.body;if(t instanceof Ue){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new j(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,!r&&t._bodyInit!=null&&(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new j(e.headers)),this.method=Ko(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")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(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 a=/\?/;this.url+=(a.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}Ue.prototype.clone=function(){return new Ue(this,{body:this._bodyInit})};function Qo(t){var e=new FormData;return t.trim().split("&").forEach(function(r){if(r){var n=r.split("="),a=n.shift().replace(/\+/g," "),s=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(a),decodeURIComponent(s))}}),e}function Zo(t){var e=new j,r=t.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
3
+ `)===0?n.substr(1,n.length):n}).forEach(function(n){var a=n.split(":"),s=a.shift().trim();if(s){var f=a.join(":").trim();e.append(s,f)}}),e}Sn.call(Ue.prototype);function pe(t,e){if(!(this instanceof pe))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 j(e.headers),this.url=e.url||"",this._initBody(t)}Sn.call(pe.prototype),pe.prototype.clone=function(){return new pe(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new j(this.headers),url:this.url})},pe.error=function(){var t=new pe(null,{status:0,statusText:""});return t.type="error",t};var ea=[301,302,303,307,308];pe.redirect=function(t,e){if(ea.indexOf(e)===-1)throw new RangeError("Invalid status code");return new pe(null,{status:e,headers:{location:t}})};var Ce=K.DOMException;try{new Ce}catch{Ce=function(e,r){this.message=e,this.name=r;var n=Error(e);this.stack=n.stack},Ce.prototype=Object.create(Error.prototype),Ce.prototype.constructor=Ce}function In(t,e){return new Promise(function(r,n){var a=new Ue(t,e);if(a.signal&&a.signal.aborted)return n(new Ce("Aborted","AbortError"));var s=new XMLHttpRequest;function f(){s.abort()}s.onload=function(){var h={status:s.status,statusText:s.statusText,headers:Zo(s.getAllResponseHeaders()||"")};h.url="responseURL"in s?s.responseURL:h.headers.get("X-Request-URL");var m="response"in s?s.response:s.responseText;setTimeout(function(){r(new pe(m,h))},0)},s.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},s.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},s.onabort=function(){setTimeout(function(){n(new Ce("Aborted","AbortError"))},0)};function p(h){try{return h===""&&K.location.href?K.location.href:h}catch{return h}}s.open(a.method,p(a.url),!0),a.credentials==="include"?s.withCredentials=!0:a.credentials==="omit"&&(s.withCredentials=!1),"responseType"in s&&(te.blob?s.responseType="blob":te.arrayBuffer&&a.headers.get("Content-Type")&&a.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(s.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof j)?Object.getOwnPropertyNames(e.headers).forEach(function(h){s.setRequestHeader(h,wr(e.headers[h]))}):a.headers.forEach(function(h,m){s.setRequestHeader(m,h)}),a.signal&&(a.signal.addEventListener("abort",f),s.onreadystatechange=function(){s.readyState===4&&a.signal.removeEventListener("abort",f)}),s.send(typeof a._bodyInit>"u"?null:a._bodyInit)})}In.polyfill=!0,K.fetch||(K.fetch=In,K.Headers=j,K.Request=Ue,K.Response=pe),self.fetch.bind(self);var ta=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var a=42;e[r]=a;for(r 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 s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(e,r);if(f.value!==a||f.enumerable!==!0)return!1}return!0},Bn=typeof Symbol<"u"&&Symbol,ra=ta,na=function(){return typeof Bn!="function"||typeof Symbol!="function"||typeof Bn("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:ra()},On={foo:{}},ia=Object,oa=function(){return{__proto__:On}.foo===On.foo&&!({__proto__:null}instanceof ia)},aa="Function.prototype.bind called on incompatible ",br=Array.prototype.slice,sa=Object.prototype.toString,ua="[object Function]",ca=function(e){var r=this;if(typeof r!="function"||sa.call(r)!==ua)throw new TypeError(aa+r);for(var n=br.call(arguments,1),a,s=function(){if(this instanceof a){var v=r.apply(this,n.concat(br.call(arguments)));return Object(v)===v?v:this}else return r.apply(e,n.concat(br.call(arguments)))},f=Math.max(0,r.length-n.length),p=[],h=0;h<f;h++)p.push("$"+h);if(a=Function("binder","return function ("+p.join(",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var m=function(){};m.prototype=r.prototype,a.prototype=new m,m.prototype=null}return a},fa=ca,Er=Function.prototype.bind||fa,la=Er,pa=la.call(Function.call,Object.prototype.hasOwnProperty),C,He=SyntaxError,Tn=Function,Ye=TypeError,Ar=function(t){try{return Tn('"use strict"; return ('+t+").constructor;")()}catch{}},De=Object.getOwnPropertyDescriptor;if(De)try{De({},"")}catch{De=null}var xr=function(){throw new Ye},ha=De?function(){try{return arguments.callee,xr}catch{try{return De(arguments,"callee").get}catch{return xr}}}():xr,Xe=na(),da=oa(),W=Object.getPrototypeOf||(da?function(t){return t.__proto__}:null),Je={},ya=typeof Uint8Array>"u"||!W?C:W(Uint8Array),Ne={"%AggregateError%":typeof AggregateError>"u"?C:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?C:ArrayBuffer,"%ArrayIteratorPrototype%":Xe&&W?W([][Symbol.iterator]()):C,"%AsyncFromSyncIteratorPrototype%":C,"%AsyncFunction%":Je,"%AsyncGenerator%":Je,"%AsyncGeneratorFunction%":Je,"%AsyncIteratorPrototype%":Je,"%Atomics%":typeof Atomics>"u"?C:Atomics,"%BigInt%":typeof BigInt>"u"?C:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?C:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?C:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?C:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?C:Float32Array,"%Float64Array%":typeof Float64Array>"u"?C:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?C:FinalizationRegistry,"%Function%":Tn,"%GeneratorFunction%":Je,"%Int8Array%":typeof Int8Array>"u"?C:Int8Array,"%Int16Array%":typeof Int16Array>"u"?C:Int16Array,"%Int32Array%":typeof Int32Array>"u"?C:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Xe&&W?W(W([][Symbol.iterator]())):C,"%JSON%":typeof JSON=="object"?JSON:C,"%Map%":typeof Map>"u"?C:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Xe||!W?C:W(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?C:Promise,"%Proxy%":typeof Proxy>"u"?C:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?C:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?C:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Xe||!W?C:W(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?C:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Xe&&W?W(""[Symbol.iterator]()):C,"%Symbol%":Xe?Symbol:C,"%SyntaxError%":He,"%ThrowTypeError%":ha,"%TypedArray%":ya,"%TypeError%":Ye,"%Uint8Array%":typeof Uint8Array>"u"?C:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?C:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?C:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?C:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?C:WeakMap,"%WeakRef%":typeof WeakRef>"u"?C:WeakRef,"%WeakSet%":typeof WeakSet>"u"?C:WeakSet};if(W)try{null.error}catch(t){var ga=W(W(t));Ne["%Error.prototype%"]=ga}var ma=function t(e){var r;if(e==="%AsyncFunction%")r=Ar("async function () {}");else if(e==="%GeneratorFunction%")r=Ar("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Ar("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var a=t("%AsyncGenerator%");a&&W&&(r=W(a.prototype))}return Ne[e]=r,r},Rn={"%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"]},dt=Er,Dt=pa,wa=dt.call(Function.call,Array.prototype.concat),va=dt.call(Function.apply,Array.prototype.splice),$n=dt.call(Function.call,String.prototype.replace),Nt=dt.call(Function.call,String.prototype.slice),_a=dt.call(Function.call,RegExp.prototype.exec),ba=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Ea=/\\(\\)?/g,Aa=function(e){var r=Nt(e,0,1),n=Nt(e,-1);if(r==="%"&&n!=="%")throw new He("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new He("invalid intrinsic syntax, expected opening `%`");var a=[];return $n(e,ba,function(s,f,p,h){a[a.length]=p?$n(h,Ea,"$1"):f||s}),a},xa=function(e,r){var n=e,a;if(Dt(Rn,n)&&(a=Rn[n],n="%"+a[0]+"%"),Dt(Ne,n)){var s=Ne[n];if(s===Je&&(s=ma(n)),typeof s>"u"&&!r)throw new Ye("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:a,name:n,value:s}}throw new He("intrinsic "+e+" does not exist!")},Sr=function(e,r){if(typeof e!="string"||e.length===0)throw new Ye("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ye('"allowMissing" argument must be a boolean');if(_a(/^%?[^%]*%?$/,e)===null)throw new He("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Aa(e),a=n.length>0?n[0]:"",s=xa("%"+a+"%",r),f=s.name,p=s.value,h=!1,m=s.alias;m&&(a=m[0],va(n,wa([0,1],m)));for(var v=1,_=!0;v<n.length;v+=1){var b=n[v],y=Nt(b,0,1),x=Nt(b,-1);if((y==='"'||y==="'"||y==="`"||x==='"'||x==="'"||x==="`")&&y!==x)throw new He("property names with quotes must have matching quotes");if((b==="constructor"||!_)&&(h=!0),a+="."+b,f="%"+a+"%",Dt(Ne,f))p=Ne[f];else if(p!=null){if(!(b in p)){if(!r)throw new Ye("base intrinsic for "+e+" exists, but the property is not available.");return}if(De&&v+1>=n.length){var I=De(p,b);_=!!I,_&&"get"in I&&!("originalValue"in I.get)?p=I.get:p=p[b]}else _=Dt(p,b),p=p[b];_&&!h&&(Ne[f]=p)}}return p},Pn={exports:{}};(function(t){var e=Er,r=Sr,n=r("%Function.prototype.apply%"),a=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||e.call(a,n),f=r("%Object.getOwnPropertyDescriptor%",!0),p=r("%Object.defineProperty%",!0),h=r("%Math.max%");if(p)try{p({},"a",{value:1})}catch{p=null}t.exports=function(_){var b=s(e,a,arguments);if(f&&p){var y=f(b,"length");y.configurable&&p(b,"length",{value:1+h(0,_.length-(arguments.length-1))})}return b};var m=function(){return s(e,n,arguments)};p?p(t.exports,"apply",{value:m}):t.exports.apply=m})(Pn);var Fn=Sr,Un=Pn.exports,Sa=Un(Fn("String.prototype.indexOf")),Ia=function(e,r){var n=Fn(e,!!r);return typeof n=="function"&&Sa(e,".prototype.")>-1?Un(n):n},Ke=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},he=[],ue=[],Ba=typeof Uint8Array<"u"?Uint8Array:Array,Ir=!1;function Cn(){Ir=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,r=t.length;e<r;++e)he[e]=t[e],ue[t.charCodeAt(e)]=e;ue["-".charCodeAt(0)]=62,ue["_".charCodeAt(0)]=63}function Oa(t){Ir||Cn();var e,r,n,a,s,f,p=t.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=t[p-2]==="="?2:t[p-1]==="="?1:0,f=new Ba(p*3/4-s),n=s>0?p-4:p;var h=0;for(e=0,r=0;e<n;e+=4,r+=3)a=ue[t.charCodeAt(e)]<<18|ue[t.charCodeAt(e+1)]<<12|ue[t.charCodeAt(e+2)]<<6|ue[t.charCodeAt(e+3)],f[h++]=a>>16&255,f[h++]=a>>8&255,f[h++]=a&255;return s===2?(a=ue[t.charCodeAt(e)]<<2|ue[t.charCodeAt(e+1)]>>4,f[h++]=a&255):s===1&&(a=ue[t.charCodeAt(e)]<<10|ue[t.charCodeAt(e+1)]<<4|ue[t.charCodeAt(e+2)]>>2,f[h++]=a>>8&255,f[h++]=a&255),f}function Ta(t){return he[t>>18&63]+he[t>>12&63]+he[t>>6&63]+he[t&63]}function Ra(t,e,r){for(var n,a=[],s=e;s<r;s+=3)n=(t[s]<<16)+(t[s+1]<<8)+t[s+2],a.push(Ta(n));return a.join("")}function Dn(t){Ir||Cn();for(var e,r=t.length,n=r%3,a="",s=[],f=16383,p=0,h=r-n;p<h;p+=f)s.push(Ra(t,p,p+f>h?h:p+f));return n===1?(e=t[r-1],a+=he[e>>2],a+=he[e<<4&63],a+="=="):n===2&&(e=(t[r-2]<<8)+t[r-1],a+=he[e>>10],a+=he[e>>4&63],a+=he[e<<2&63],a+="="),s.push(a),s.join("")}function Mt(t,e,r,n,a){var s,f,p=a*8-n-1,h=(1<<p)-1,m=h>>1,v=-7,_=r?a-1:0,b=r?-1:1,y=t[e+_];for(_+=b,s=y&(1<<-v)-1,y>>=-v,v+=p;v>0;s=s*256+t[e+_],_+=b,v-=8);for(f=s&(1<<-v)-1,s>>=-v,v+=n;v>0;f=f*256+t[e+_],_+=b,v-=8);if(s===0)s=1-m;else{if(s===h)return f?NaN:(y?-1:1)*(1/0);f=f+Math.pow(2,n),s=s-m}return(y?-1:1)*f*Math.pow(2,s-n)}function Nn(t,e,r,n,a,s){var f,p,h,m=s*8-a-1,v=(1<<m)-1,_=v>>1,b=a===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=n?0:s-1,x=n?1:-1,I=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(p=isNaN(e)?1:0,f=v):(f=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-f))<1&&(f--,h*=2),f+_>=1?e+=b/h:e+=b*Math.pow(2,1-_),e*h>=2&&(f++,h/=2),f+_>=v?(p=0,f=v):f+_>=1?(p=(e*h-1)*Math.pow(2,a),f=f+_):(p=e*Math.pow(2,_-1)*Math.pow(2,a),f=0));a>=8;t[r+y]=p&255,y+=x,p/=256,a-=8);for(f=f<<a|p,m+=a;m>0;t[r+y]=f&255,y+=x,f/=256,m-=8);t[r+y-x]|=I*128}var $a={}.toString,Mn=Array.isArray||function(t){return $a.call(t)=="[object Array]"};/*!
4
4
  * The buffer module from node.js, for the browser.
5
5
  *
6
6
  * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
7
7
  * @license MIT
8
- */var $u=50;$.TYPED_ARRAY_SUPPORT=tr.TYPED_ARRAY_SUPPORT!==void 0?tr.TYPED_ARRAY_SUPPORT:!0,qr();function qr(){return $.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Ee(e,r){if(qr()<r)throw new RangeError("Invalid typed array length");return $.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(r),e.__proto__=$.prototype):(e===null&&(e=new $(r)),e.length=r),e}function $(e,r,t){if(!$.TYPED_ARRAY_SUPPORT&&!(this instanceof $))return new $(e,r,t);if(typeof e=="number"){if(typeof r=="string")throw new Error("If encoding is specified then the first argument must be a string");return jt(this,e)}return yi(this,e,r,t)}$.poolSize=8192,$._augment=function(e){return e.__proto__=$.prototype,e};function yi(e,r,t,n){if(typeof r=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&r instanceof ArrayBuffer?Su(e,r,t,n):typeof r=="string"?Eu(e,r,t):xu(e,r)}$.from=function(e,r,t){return yi(null,e,r,t)},$.TYPED_ARRAY_SUPPORT&&($.prototype.__proto__=Uint8Array.prototype,$.__proto__=Uint8Array);function gi(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Au(e,r,t,n){return gi(r),r<=0?Ee(e,r):t!==void 0?typeof n=="string"?Ee(e,r).fill(t,n):Ee(e,r).fill(t):Ee(e,r)}$.alloc=function(e,r,t){return Au(null,e,r,t)};function jt(e,r){if(gi(r),e=Ee(e,r<0?0:Gt(r)|0),!$.TYPED_ARRAY_SUPPORT)for(var t=0;t<r;++t)e[t]=0;return e}$.allocUnsafe=function(e){return jt(null,e)},$.allocUnsafeSlow=function(e){return jt(null,e)};function Eu(e,r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!$.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=vi(r,t)|0;e=Ee(e,n);var a=e.write(r,t);return a!==n&&(e=e.slice(0,a)),e}function kt(e,r){var t=r.length<0?0:Gt(r.length)|0;e=Ee(e,t);for(var n=0;n<t;n+=1)e[n]=r[n]&255;return e}function Su(e,r,t,n){if(r.byteLength,t<0||r.byteLength<t)throw new RangeError("'offset' is out of bounds");if(r.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");return t===void 0&&n===void 0?r=new Uint8Array(r):n===void 0?r=new Uint8Array(r,t):r=new Uint8Array(r,t,n),$.TYPED_ARRAY_SUPPORT?(e=r,e.__proto__=$.prototype):e=kt(e,r),e}function xu(e,r){if(ge(r)){var t=Gt(r.length)|0;return e=Ee(e,t),e.length===0||r.copy(e,0,0,t),e}if(r){if(typeof ArrayBuffer<"u"&&r.buffer instanceof ArrayBuffer||"length"in r)return typeof r.length!="number"||zu(r.length)?Ee(e,0):kt(e,r);if(r.type==="Buffer"&&di(r.data))return kt(e,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Gt(e){if(e>=qr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+qr().toString(16)+" bytes");return e|0}$.isBuffer=Vu;function ge(e){return!!(e!=null&&e._isBuffer)}$.compare=function(r,t){if(!ge(r)||!ge(t))throw new TypeError("Arguments must be Buffers");if(r===t)return 0;for(var n=r.length,a=t.length,s=0,c=Math.min(n,a);s<c;++s)if(r[s]!==t[s]){n=r[s],a=t[s];break}return n<a?-1:a<n?1:0},$.isEncoding=function(r){switch(String(r).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},$.concat=function(r,t){if(!di(r))throw new TypeError('"list" argument must be an Array of Buffers');if(r.length===0)return $.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<r.length;++n)t+=r[n].length;var a=$.allocUnsafe(t),s=0;for(n=0;n<r.length;++n){var c=r[n];if(!ge(c))throw new TypeError('"list" argument must be an Array of Buffers');c.copy(a,s),s+=c.length}return a};function vi(e,r){if(ge(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var t=e.length;if(t===0)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return Hr(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return xi(e).length;default:if(n)return Hr(e).length;r=(""+r).toLowerCase(),n=!0}}$.byteLength=vi;function Iu(e,r,t){var n=!1;if((r===void 0||r<0)&&(r=0),r>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,r>>>=0,t<=r))return"";for(e||(e="utf8");;)switch(e){case"hex":return Nu(this,r,t);case"utf8":case"utf-8":return bi(this,r,t);case"ascii":return Uu(this,r,t);case"latin1":case"binary":return Du(this,r,t);case"base64":return Fu(this,r,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Lu(this,r,t);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}$.prototype._isBuffer=!0;function We(e,r,t){var n=e[r];e[r]=e[t],e[t]=n}$.prototype.swap16=function(){var r=this.length;if(r%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<r;t+=2)We(this,t,t+1);return this},$.prototype.swap32=function(){var r=this.length;if(r%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<r;t+=4)We(this,t,t+3),We(this,t+1,t+2);return this},$.prototype.swap64=function(){var r=this.length;if(r%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<r;t+=8)We(this,t,t+7),We(this,t+1,t+6),We(this,t+2,t+5),We(this,t+3,t+4);return this},$.prototype.toString=function(){var r=this.length|0;return r===0?"":arguments.length===0?bi(this,0,r):Iu.apply(this,arguments)},$.prototype.equals=function(r){if(!ge(r))throw new TypeError("Argument must be a Buffer");return this===r?!0:$.compare(this,r)===0},$.prototype.inspect=function(){var r="",t=$u;return this.length>0&&(r=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(r+=" ... ")),"<Buffer "+r+">"},$.prototype.compare=function(r,t,n,a,s){if(!ge(r))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=r?r.length:0),a===void 0&&(a=0),s===void 0&&(s=this.length),t<0||n>r.length||a<0||s>this.length)throw new RangeError("out of range index");if(a>=s&&t>=n)return 0;if(a>=s)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,a>>>=0,s>>>=0,this===r)return 0;for(var c=s-a,p=n-t,h=Math.min(c,p),v=this.slice(a,s),_=r.slice(t,n),w=0;w<h;++w)if(v[w]!==_[w]){c=v[w],p=_[w];break}return c<p?-1:p<c?1:0};function mi(e,r,t,n,a){if(e.length===0)return-1;if(typeof t=="string"?(n=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=a?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(a)return-1;t=e.length-1}else if(t<0)if(a)t=0;else return-1;if(typeof r=="string"&&(r=$.from(r,n)),ge(r))return r.length===0?-1:_i(e,r,t,n,a);if(typeof r=="number")return r=r&255,$.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(e,r,t):Uint8Array.prototype.lastIndexOf.call(e,r,t):_i(e,[r],t,n,a);throw new TypeError("val must be string, number or Buffer")}function _i(e,r,t,n,a){var s=1,c=e.length,p=r.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||r.length<2)return-1;s=2,c/=2,p/=2,t/=2}function h(d,E){return s===1?d[E]:d.readUInt16BE(E*s)}var v;if(a){var _=-1;for(v=t;v<c;v++)if(h(e,v)===h(r,_===-1?0:v-_)){if(_===-1&&(_=v),v-_+1===p)return _*s}else _!==-1&&(v-=v-_),_=-1}else for(t+p>c&&(t=c-p),v=t;v>=0;v--){for(var w=!0,b=0;b<p;b++)if(h(e,v+b)!==h(r,b)){w=!1;break}if(w)return v}return-1}$.prototype.includes=function(r,t,n){return this.indexOf(r,t,n)!==-1},$.prototype.indexOf=function(r,t,n){return mi(this,r,t,n,!0)},$.prototype.lastIndexOf=function(r,t,n){return mi(this,r,t,n,!1)};function Tu(e,r,t,n){t=Number(t)||0;var a=e.length-t;n?(n=Number(n),n>a&&(n=a)):n=a;var s=r.length;if(s%2!==0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var c=0;c<n;++c){var p=parseInt(r.substr(c*2,2),16);if(isNaN(p))return c;e[t+c]=p}return c}function Ou(e,r,t,n){return Yr(Hr(r,e.length-t),e,t,n)}function wi(e,r,t,n){return Yr(Wu(r),e,t,n)}function Bu(e,r,t,n){return wi(e,r,t,n)}function Pu(e,r,t,n){return Yr(xi(r),e,t,n)}function Ru(e,r,t,n){return Yr(qu(r,e.length-t),e,t,n)}$.prototype.write=function(r,t,n,a){if(t===void 0)a="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")a=t,n=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(n)?(n=n|0,a===void 0&&(a="utf8")):(a=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-t;if((n===void 0||n>s)&&(n=s),r.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var c=!1;;)switch(a){case"hex":return Tu(this,r,t,n);case"utf8":case"utf-8":return Ou(this,r,t,n);case"ascii":return wi(this,r,t,n);case"latin1":case"binary":return Bu(this,r,t,n);case"base64":return Pu(this,r,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ru(this,r,t,n);default:if(c)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),c=!0}},$.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Fu(e,r,t){return r===0&&t===e.length?pi(e):pi(e.slice(r,t))}function bi(e,r,t){t=Math.min(e.length,t);for(var n=[],a=r;a<t;){var s=e[a],c=null,p=s>239?4:s>223?3:s>191?2:1;if(a+p<=t){var h,v,_,w;switch(p){case 1:s<128&&(c=s);break;case 2:h=e[a+1],(h&192)===128&&(w=(s&31)<<6|h&63,w>127&&(c=w));break;case 3:h=e[a+1],v=e[a+2],(h&192)===128&&(v&192)===128&&(w=(s&15)<<12|(h&63)<<6|v&63,w>2047&&(w<55296||w>57343)&&(c=w));break;case 4:h=e[a+1],v=e[a+2],_=e[a+3],(h&192)===128&&(v&192)===128&&(_&192)===128&&(w=(s&15)<<18|(h&63)<<12|(v&63)<<6|_&63,w>65535&&w<1114112&&(c=w))}}c===null?(c=65533,p=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|c&1023),n.push(c),a+=p}return Cu(n)}var $i=4096;function Cu(e){var r=e.length;if(r<=$i)return String.fromCharCode.apply(String,e);for(var t="",n=0;n<r;)t+=String.fromCharCode.apply(String,e.slice(n,n+=$i));return t}function Uu(e,r,t){var n="";t=Math.min(e.length,t);for(var a=r;a<t;++a)n+=String.fromCharCode(e[a]&127);return n}function Du(e,r,t){var n="";t=Math.min(e.length,t);for(var a=r;a<t;++a)n+=String.fromCharCode(e[a]);return n}function Nu(e,r,t){var n=e.length;(!r||r<0)&&(r=0),(!t||t<0||t>n)&&(t=n);for(var a="",s=r;s<t;++s)a+=Gu(e[s]);return a}function Lu(e,r,t){for(var n=e.slice(r,t),a="",s=0;s<n.length;s+=2)a+=String.fromCharCode(n[s]+n[s+1]*256);return a}$.prototype.slice=function(r,t){var n=this.length;r=~~r,t=t===void 0?n:~~t,r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<r&&(t=r);var a;if($.TYPED_ARRAY_SUPPORT)a=this.subarray(r,t),a.__proto__=$.prototype;else{var s=t-r;a=new $(s,void 0);for(var c=0;c<s;++c)a[c]=this[c+r]}return a};function K(e,r,t){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+r>t)throw new RangeError("Trying to access beyond buffer length")}$.prototype.readUIntLE=function(r,t,n){r=r|0,t=t|0,n||K(r,t,this.length);for(var a=this[r],s=1,c=0;++c<t&&(s*=256);)a+=this[r+c]*s;return a},$.prototype.readUIntBE=function(r,t,n){r=r|0,t=t|0,n||K(r,t,this.length);for(var a=this[r+--t],s=1;t>0&&(s*=256);)a+=this[r+--t]*s;return a},$.prototype.readUInt8=function(r,t){return t||K(r,1,this.length),this[r]},$.prototype.readUInt16LE=function(r,t){return t||K(r,2,this.length),this[r]|this[r+1]<<8},$.prototype.readUInt16BE=function(r,t){return t||K(r,2,this.length),this[r]<<8|this[r+1]},$.prototype.readUInt32LE=function(r,t){return t||K(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+this[r+3]*16777216},$.prototype.readUInt32BE=function(r,t){return t||K(r,4,this.length),this[r]*16777216+(this[r+1]<<16|this[r+2]<<8|this[r+3])},$.prototype.readIntLE=function(r,t,n){r=r|0,t=t|0,n||K(r,t,this.length);for(var a=this[r],s=1,c=0;++c<t&&(s*=256);)a+=this[r+c]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*t)),a},$.prototype.readIntBE=function(r,t,n){r=r|0,t=t|0,n||K(r,t,this.length);for(var a=t,s=1,c=this[r+--a];a>0&&(s*=256);)c+=this[r+--a]*s;return s*=128,c>=s&&(c-=Math.pow(2,8*t)),c},$.prototype.readInt8=function(r,t){return t||K(r,1,this.length),this[r]&128?(255-this[r]+1)*-1:this[r]},$.prototype.readInt16LE=function(r,t){t||K(r,2,this.length);var n=this[r]|this[r+1]<<8;return n&32768?n|4294901760:n},$.prototype.readInt16BE=function(r,t){t||K(r,2,this.length);var n=this[r+1]|this[r]<<8;return n&32768?n|4294901760:n},$.prototype.readInt32LE=function(r,t){return t||K(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},$.prototype.readInt32BE=function(r,t){return t||K(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},$.prototype.readFloatLE=function(r,t){return t||K(r,4,this.length),Wr(this,r,!0,23,4)},$.prototype.readFloatBE=function(r,t){return t||K(r,4,this.length),Wr(this,r,!1,23,4)},$.prototype.readDoubleLE=function(r,t){return t||K(r,8,this.length),Wr(this,r,!0,52,8)},$.prototype.readDoubleBE=function(r,t){return t||K(r,8,this.length),Wr(this,r,!1,52,8)};function ie(e,r,t,n,a,s){if(!ge(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>a||r<s)throw new RangeError('"value" argument is out of bounds');if(t+n>e.length)throw new RangeError("Index out of range")}$.prototype.writeUIntLE=function(r,t,n,a){if(r=+r,t=t|0,n=n|0,!a){var s=Math.pow(2,8*n)-1;ie(this,r,t,n,s,0)}var c=1,p=0;for(this[t]=r&255;++p<n&&(c*=256);)this[t+p]=r/c&255;return t+n},$.prototype.writeUIntBE=function(r,t,n,a){if(r=+r,t=t|0,n=n|0,!a){var s=Math.pow(2,8*n)-1;ie(this,r,t,n,s,0)}var c=n-1,p=1;for(this[t+c]=r&255;--c>=0&&(p*=256);)this[t+c]=r/p&255;return t+n},$.prototype.writeUInt8=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,1,255,0),$.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[t]=r&255,t+1};function zr(e,r,t,n){r<0&&(r=65535+r+1);for(var a=0,s=Math.min(e.length-t,2);a<s;++a)e[t+a]=(r&255<<8*(n?a:1-a))>>>(n?a:1-a)*8}$.prototype.writeUInt16LE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,2,65535,0),$.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):zr(this,r,t,!0),t+2},$.prototype.writeUInt16BE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,2,65535,0),$.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):zr(this,r,t,!1),t+2};function Vr(e,r,t,n){r<0&&(r=4294967295+r+1);for(var a=0,s=Math.min(e.length-t,4);a<s;++a)e[t+a]=r>>>(n?a:3-a)*8&255}$.prototype.writeUInt32LE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,4,4294967295,0),$.TYPED_ARRAY_SUPPORT?(this[t+3]=r>>>24,this[t+2]=r>>>16,this[t+1]=r>>>8,this[t]=r&255):Vr(this,r,t,!0),t+4},$.prototype.writeUInt32BE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,4,4294967295,0),$.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):Vr(this,r,t,!1),t+4},$.prototype.writeIntLE=function(r,t,n,a){if(r=+r,t=t|0,!a){var s=Math.pow(2,8*n-1);ie(this,r,t,n,s-1,-s)}var c=0,p=1,h=0;for(this[t]=r&255;++c<n&&(p*=256);)r<0&&h===0&&this[t+c-1]!==0&&(h=1),this[t+c]=(r/p>>0)-h&255;return t+n},$.prototype.writeIntBE=function(r,t,n,a){if(r=+r,t=t|0,!a){var s=Math.pow(2,8*n-1);ie(this,r,t,n,s-1,-s)}var c=n-1,p=1,h=0;for(this[t+c]=r&255;--c>=0&&(p*=256);)r<0&&h===0&&this[t+c+1]!==0&&(h=1),this[t+c]=(r/p>>0)-h&255;return t+n},$.prototype.writeInt8=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,1,127,-128),$.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[t]=r&255,t+1},$.prototype.writeInt16LE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,2,32767,-32768),$.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8):zr(this,r,t,!0),t+2},$.prototype.writeInt16BE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,2,32767,-32768),$.TYPED_ARRAY_SUPPORT?(this[t]=r>>>8,this[t+1]=r&255):zr(this,r,t,!1),t+2},$.prototype.writeInt32LE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,4,2147483647,-2147483648),$.TYPED_ARRAY_SUPPORT?(this[t]=r&255,this[t+1]=r>>>8,this[t+2]=r>>>16,this[t+3]=r>>>24):Vr(this,r,t,!0),t+4},$.prototype.writeInt32BE=function(r,t,n){return r=+r,t=t|0,n||ie(this,r,t,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),$.TYPED_ARRAY_SUPPORT?(this[t]=r>>>24,this[t+1]=r>>>16,this[t+2]=r>>>8,this[t+3]=r&255):Vr(this,r,t,!1),t+4};function Ai(e,r,t,n,a,s){if(t+n>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Ei(e,r,t,n,a){return a||Ai(e,r,t,4),hi(e,r,t,n,23,4),t+4}$.prototype.writeFloatLE=function(r,t,n){return Ei(this,r,t,!0,n)},$.prototype.writeFloatBE=function(r,t,n){return Ei(this,r,t,!1,n)};function Si(e,r,t,n,a){return a||Ai(e,r,t,8),hi(e,r,t,n,52,8),t+8}$.prototype.writeDoubleLE=function(r,t,n){return Si(this,r,t,!0,n)},$.prototype.writeDoubleBE=function(r,t,n){return Si(this,r,t,!1,n)},$.prototype.copy=function(r,t,n,a){if(n||(n=0),!a&&a!==0&&(a=this.length),t>=r.length&&(t=r.length),t||(t=0),a>0&&a<n&&(a=n),a===n||r.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),r.length-t<a-n&&(a=r.length-t+n);var s=a-n,c;if(this===r&&n<t&&t<a)for(c=s-1;c>=0;--c)r[c+t]=this[c+n];else if(s<1e3||!$.TYPED_ARRAY_SUPPORT)for(c=0;c<s;++c)r[c+t]=this[c+n];else Uint8Array.prototype.set.call(r,this.subarray(n,n+s),t);return s},$.prototype.fill=function(r,t,n,a){if(typeof r=="string"){if(typeof t=="string"?(a=t,t=0,n=this.length):typeof n=="string"&&(a=n,n=this.length),r.length===1){var s=r.charCodeAt(0);s<256&&(r=s)}if(a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!$.isEncoding(a))throw new TypeError("Unknown encoding: "+a)}else typeof r=="number"&&(r=r&255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t=t>>>0,n=n===void 0?this.length:n>>>0,r||(r=0);var c;if(typeof r=="number")for(c=t;c<n;++c)this[c]=r;else{var p=ge(r)?r:Hr(new $(r,a).toString()),h=p.length;for(c=0;c<n-t;++c)this[c+t]=p[c%h]}return this};var Mu=/[^+\/0-9A-Za-z-_]/g;function ju(e){if(e=ku(e).replace(Mu,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function ku(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Gu(e){return e<16?"0"+e.toString(16):e.toString(16)}function Hr(e,r){r=r||1/0;for(var t,n=e.length,a=null,s=[],c=0;c<n;++c){if(t=e.charCodeAt(c),t>55295&&t<57344){if(!a){if(t>56319){(r-=3)>-1&&s.push(239,191,189);continue}else if(c+1===n){(r-=3)>-1&&s.push(239,191,189);continue}a=t;continue}if(t<56320){(r-=3)>-1&&s.push(239,191,189),a=t;continue}t=(a-55296<<10|t-56320)+65536}else a&&(r-=3)>-1&&s.push(239,191,189);if(a=null,t<128){if((r-=1)<0)break;s.push(t)}else if(t<2048){if((r-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((r-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((r-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function Wu(e){for(var r=[],t=0;t<e.length;++t)r.push(e.charCodeAt(t)&255);return r}function qu(e,r){for(var t,n,a,s=[],c=0;c<e.length&&!((r-=2)<0);++c)t=e.charCodeAt(c),n=t>>8,a=t%256,s.push(a),s.push(n);return s}function xi(e){return mu(ju(e))}function Yr(e,r,t,n){for(var a=0;a<n&&!(a+t>=r.length||a>=e.length);++a)r[a+t]=e[a];return a}function zu(e){return e!==e}function Vu(e){return e!=null&&(!!e._isBuffer||Ii(e)||Hu(e))}function Ii(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function Hu(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&Ii(e.slice(0,0))}function Ti(){throw new Error("setTimeout has not been defined")}function Oi(){throw new Error("clearTimeout has not been defined")}var Be=Ti,Pe=Oi;typeof tr.setTimeout=="function"&&(Be=setTimeout),typeof tr.clearTimeout=="function"&&(Pe=clearTimeout);function Bi(e){if(Be===setTimeout)return setTimeout(e,0);if((Be===Ti||!Be)&&setTimeout)return Be=setTimeout,setTimeout(e,0);try{return Be(e,0)}catch{try{return Be.call(null,e,0)}catch{return Be.call(this,e,0)}}}function Yu(e){if(Pe===clearTimeout)return clearTimeout(e);if((Pe===Oi||!Pe)&&clearTimeout)return Pe=clearTimeout,clearTimeout(e);try{return Pe(e)}catch{try{return Pe.call(null,e)}catch{return Pe.call(this,e)}}}var Se=[],nr=!1,qe,Kr=-1;function Ku(){!nr||!qe||(nr=!1,qe.length?Se=qe.concat(Se):Kr=-1,Se.length&&Pi())}function Pi(){if(!nr){var e=Bi(Ku);nr=!0;for(var r=Se.length;r;){for(qe=Se,Se=[];++Kr<r;)qe&&qe[Kr].run();Kr=-1,r=Se.length}qe=null,nr=!1,Yu(e)}}function Xu(e){var r=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)r[t-1]=arguments[t];Se.push(new Ri(e,r)),Se.length===1&&!nr&&Bi(Pi)}function Ri(e,r){this.fun=e,this.array=r}Ri.prototype.run=function(){this.fun.apply(null,this.array)};var Ju="browser",Qu="browser",Zu=!0,ec={},rc=[],tc="",nc={},ic={},oc={};function ze(){}var ac=ze,sc=ze,uc=ze,cc=ze,fc=ze,lc=ze,pc=ze;function hc(e){throw new Error("process.binding is not supported")}function dc(){return"/"}function yc(e){throw new Error("process.chdir is not supported")}function gc(){return 0}var ir=tr.performance||{},vc=ir.now||ir.mozNow||ir.msNow||ir.oNow||ir.webkitNow||function(){return new Date().getTime()};function mc(e){var r=vc.call(ir)*.001,t=Math.floor(r),n=Math.floor(r%1*1e9);return e&&(t=t-e[0],n=n-e[1],n<0&&(t--,n+=1e9)),[t,n]}var _c=new Date;function wc(){var e=new Date,r=e-_c;return r/1e3}var Xr={nextTick:Xu,title:Ju,browser:Zu,env:ec,argv:rc,version:tc,versions:nc,on:ac,addListener:sc,once:uc,off:cc,removeListener:fc,removeAllListeners:lc,emit:pc,binding:hc,cwd:dc,chdir:yc,umask:gc,hrtime:mc,platform:Qu,release:ic,config:oc,uptime:wc},Wt;typeof Object.create=="function"?Wt=function(r,t){r.super_=t,r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}:Wt=function(r,t){r.super_=t;var n=function(){};n.prototype=t.prototype,r.prototype=new n,r.prototype.constructor=r};var Fi=Wt,bc=/%[sdj%]/g;function Jr(e){if(!br(e)){for(var r=[],t=0;t<arguments.length;t++)r.push(ve(arguments[t]));return r.join(" ")}for(var t=1,n=arguments,a=n.length,s=String(e).replace(bc,function(p){if(p==="%%")return"%";if(t>=a)return p;switch(p){case"%s":return String(n[t++]);case"%d":return Number(n[t++]);case"%j":try{return JSON.stringify(n[t++])}catch{return"[Circular]"}default:return p}}),c=n[t];t<a;c=n[++t])wr(c)||!Ve(c)?s+=" "+c:s+=" "+ve(c);return s}function qt(e,r){if(me(tr.process))return function(){return qt(e,r).apply(this,arguments)};if(Xr.noDeprecation===!0)return e;var t=!1;function n(){if(!t){if(Xr.throwDeprecation)throw new Error(r);Xr.traceDeprecation?console.trace(r):console.error(r),t=!0}return e.apply(this,arguments)}return n}var Qr={},zt;function Ci(e){if(me(zt)&&(zt=Xr.env.NODE_DEBUG||""),e=e.toUpperCase(),!Qr[e])if(new RegExp("\\b"+e+"\\b","i").test(zt)){var r=0;Qr[e]=function(){var t=Jr.apply(null,arguments);console.error("%s %d: %s",e,r,t)}}else Qr[e]=function(){};return Qr[e]}function ve(e,r){var t={seen:[],stylize:Ac};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),et(r)?t.showHidden=r:r&&Qt(t,r),me(t.showHidden)&&(t.showHidden=!1),me(t.depth)&&(t.depth=2),me(t.colors)&&(t.colors=!1),me(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=$c),Zr(t,e,t.depth)}ve.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},ve.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function $c(e,r){var t=ve.styles[r];return t?"\x1B["+ve.colors[t][0]+"m"+e+"\x1B["+ve.colors[t][1]+"m":e}function Ac(e,r){return e}function Ec(e){var r={};return e.forEach(function(t,n){r[t]=!0}),r}function Zr(e,r,t){if(e.customInspect&&r&&Er(r.inspect)&&r.inspect!==ve&&!(r.constructor&&r.constructor.prototype===r)){var n=r.inspect(t,e);return br(n)||(n=Zr(e,n,t)),n}var a=Sc(e,r);if(a)return a;var s=Object.keys(r),c=Ec(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),Ar(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return Vt(r);if(s.length===0){if(Er(r)){var p=r.name?": "+r.name:"";return e.stylize("[Function"+p+"]","special")}if($r(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(rt(r))return e.stylize(Date.prototype.toString.call(r),"date");if(Ar(r))return Vt(r)}var h="",v=!1,_=["{","}"];if(Yt(r)&&(v=!0,_=["[","]"]),Er(r)){var w=r.name?": "+r.name:"";h=" [Function"+w+"]"}if($r(r)&&(h=" "+RegExp.prototype.toString.call(r)),rt(r)&&(h=" "+Date.prototype.toUTCString.call(r)),Ar(r)&&(h=" "+Vt(r)),s.length===0&&(!v||r.length==0))return _[0]+h+_[1];if(t<0)return $r(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special");e.seen.push(r);var b;return v?b=xc(e,r,t,c,s):b=s.map(function(d){return Ht(e,r,t,c,d,v)}),e.seen.pop(),Ic(b,h,_)}function Sc(e,r){if(me(r))return e.stylize("undefined","undefined");if(br(r)){var t="'"+JSON.stringify(r).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}if(Kt(r))return e.stylize(""+r,"number");if(et(r))return e.stylize(""+r,"boolean");if(wr(r))return e.stylize("null","null")}function Vt(e){return"["+Error.prototype.toString.call(e)+"]"}function xc(e,r,t,n,a){for(var s=[],c=0,p=r.length;c<p;++c)ji(r,String(c))?s.push(Ht(e,r,t,n,String(c),!0)):s.push("");return a.forEach(function(h){h.match(/^\d+$/)||s.push(Ht(e,r,t,n,h,!0))}),s}function Ht(e,r,t,n,a,s){var c,p,h;if(h=Object.getOwnPropertyDescriptor(r,a)||{value:r[a]},h.get?h.set?p=e.stylize("[Getter/Setter]","special"):p=e.stylize("[Getter]","special"):h.set&&(p=e.stylize("[Setter]","special")),ji(n,a)||(c="["+a+"]"),p||(e.seen.indexOf(h.value)<0?(wr(t)?p=Zr(e,h.value,null):p=Zr(e,h.value,t-1),p.indexOf(`
8
+ */var Pa=50;E.TYPED_ARRAY_SUPPORT=Ke.TYPED_ARRAY_SUPPORT!==void 0?Ke.TYPED_ARRAY_SUPPORT:!0,Lt();function Lt(){return E.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function be(t,e){if(Lt()<e)throw new RangeError("Invalid typed array length");return E.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e),t.__proto__=E.prototype):(t===null&&(t=new E(e)),t.length=e),t}function E(t,e,r){if(!E.TYPED_ARRAY_SUPPORT&&!(this instanceof E))return new E(t,e,r);if(typeof t=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return Br(this,t)}return Ln(this,t,e,r)}E.poolSize=8192,E._augment=function(t){return t.__proto__=E.prototype,t};function Ln(t,e,r,n){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?Ca(t,e,r,n):typeof e=="string"?Ua(t,e,r):Da(t,e)}E.from=function(t,e,r){return Ln(null,t,e,r)},E.TYPED_ARRAY_SUPPORT&&(E.prototype.__proto__=Uint8Array.prototype,E.__proto__=Uint8Array);function kn(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function Fa(t,e,r,n){return kn(e),e<=0?be(t,e):r!==void 0?typeof n=="string"?be(t,e).fill(r,n):be(t,e).fill(r):be(t,e)}E.alloc=function(t,e,r){return Fa(null,t,e,r)};function Br(t,e){if(kn(e),t=be(t,e<0?0:Tr(e)|0),!E.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}E.allocUnsafe=function(t){return Br(null,t)},E.allocUnsafeSlow=function(t){return Br(null,t)};function Ua(t,e,r){if((typeof r!="string"||r==="")&&(r="utf8"),!E.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=jn(e,r)|0;t=be(t,n);var a=t.write(e,r);return a!==n&&(t=t.slice(0,a)),t}function Or(t,e){var r=e.length<0?0:Tr(e.length)|0;t=be(t,r);for(var n=0;n<r;n+=1)t[n]=e[n]&255;return t}function Ca(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return r===void 0&&n===void 0?e=new Uint8Array(e):n===void 0?e=new Uint8Array(e,r):e=new Uint8Array(e,r,n),E.TYPED_ARRAY_SUPPORT?(t=e,t.__proto__=E.prototype):t=Or(t,e),t}function Da(t,e){if(de(e)){var r=Tr(e.length)|0;return t=be(t,r),t.length===0||e.copy(t,0,0,r),t}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||ts(e.length)?be(t,0):Or(t,e);if(e.type==="Buffer"&&Mn(e.data))return Or(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Tr(t){if(t>=Lt())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Lt().toString(16)+" bytes");return t|0}E.isBuffer=rs;function de(t){return!!(t!=null&&t._isBuffer)}E.compare=function(e,r){if(!de(e)||!de(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,a=r.length,s=0,f=Math.min(n,a);s<f;++s)if(e[s]!==r[s]){n=e[s],a=r[s];break}return n<a?-1:a<n?1:0},E.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},E.concat=function(e,r){if(!Mn(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return E.alloc(0);var n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var a=E.allocUnsafe(r),s=0;for(n=0;n<e.length;++n){var f=e[n];if(!de(f))throw new TypeError('"list" argument must be an Array of Buffers');f.copy(a,s),s+=f.length}return a};function jn(t,e){if(de(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var r=t.length;if(r===0)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return qt(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Jn(t).length;default:if(n)return qt(t).length;e=(""+e).toLowerCase(),n=!0}}E.byteLength=jn;function Na(t,e,r){var n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Ha(this,e,r);case"utf8":case"utf-8":return Gn(this,e,r);case"ascii":return Ga(this,e,r);case"latin1":case"binary":return Wa(this,e,r);case"base64":return Va(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ya(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}E.prototype._isBuffer=!0;function Me(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}E.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)Me(this,r,r+1);return this},E.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)Me(this,r,r+3),Me(this,r+1,r+2);return this},E.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)Me(this,r,r+7),Me(this,r+1,r+6),Me(this,r+2,r+5),Me(this,r+3,r+4);return this},E.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?Gn(this,0,e):Na.apply(this,arguments)},E.prototype.equals=function(e){if(!de(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:E.compare(this,e)===0},E.prototype.inspect=function(){var e="",r=Pa;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},E.prototype.compare=function(e,r,n,a,s){if(!de(e))throw new TypeError("Argument must be a Buffer");if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),a===void 0&&(a=0),s===void 0&&(s=this.length),r<0||n>e.length||a<0||s>this.length)throw new RangeError("out of range index");if(a>=s&&r>=n)return 0;if(a>=s)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,a>>>=0,s>>>=0,this===e)return 0;for(var f=s-a,p=n-r,h=Math.min(f,p),m=this.slice(a,s),v=e.slice(r,n),_=0;_<h;++_)if(m[_]!==v[_]){f=m[_],p=v[_];break}return f<p?-1:p<f?1:0};function qn(t,e,r,n,a){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=a?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(a)return-1;r=t.length-1}else if(r<0)if(a)r=0;else return-1;if(typeof e=="string"&&(e=E.from(e,n)),de(e))return e.length===0?-1:Vn(t,e,r,n,a);if(typeof e=="number")return e=e&255,E.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?a?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Vn(t,[e],r,n,a);throw new TypeError("val must be string, number or Buffer")}function Vn(t,e,r,n,a){var s=1,f=t.length,p=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,f/=2,p/=2,r/=2}function h(y,x){return s===1?y[x]:y.readUInt16BE(x*s)}var m;if(a){var v=-1;for(m=r;m<f;m++)if(h(t,m)===h(e,v===-1?0:m-v)){if(v===-1&&(v=m),m-v+1===p)return v*s}else v!==-1&&(m-=m-v),v=-1}else for(r+p>f&&(r=f-p),m=r;m>=0;m--){for(var _=!0,b=0;b<p;b++)if(h(t,m+b)!==h(e,b)){_=!1;break}if(_)return m}return-1}E.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1},E.prototype.indexOf=function(e,r,n){return qn(this,e,r,n,!0)},E.prototype.lastIndexOf=function(e,r,n){return qn(this,e,r,n,!1)};function Ma(t,e,r,n){r=Number(r)||0;var a=t.length-r;n?(n=Number(n),n>a&&(n=a)):n=a;var s=e.length;if(s%2!==0)throw new TypeError("Invalid hex string");n>s/2&&(n=s/2);for(var f=0;f<n;++f){var p=parseInt(e.substr(f*2,2),16);if(isNaN(p))return f;t[r+f]=p}return f}function La(t,e,r,n){return Vt(qt(e,t.length-r),t,r,n)}function zn(t,e,r,n){return Vt(Za(e),t,r,n)}function ka(t,e,r,n){return zn(t,e,r,n)}function ja(t,e,r,n){return Vt(Jn(e),t,r,n)}function qa(t,e,r,n){return Vt(es(e,t.length-r),t,r,n)}E.prototype.write=function(e,r,n,a){if(r===void 0)a="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")a=r,n=this.length,r=0;else if(isFinite(r))r=r|0,isFinite(n)?(n=n|0,a===void 0&&(a="utf8")):(a=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-r;if((n===void 0||n>s)&&(n=s),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var f=!1;;)switch(a){case"hex":return Ma(this,e,r,n);case"utf8":case"utf-8":return La(this,e,r,n);case"ascii":return zn(this,e,r,n);case"latin1":case"binary":return ka(this,e,r,n);case"base64":return ja(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qa(this,e,r,n);default:if(f)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),f=!0}},E.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Va(t,e,r){return e===0&&r===t.length?Dn(t):Dn(t.slice(e,r))}function Gn(t,e,r){r=Math.min(t.length,r);for(var n=[],a=e;a<r;){var s=t[a],f=null,p=s>239?4:s>223?3:s>191?2:1;if(a+p<=r){var h,m,v,_;switch(p){case 1:s<128&&(f=s);break;case 2:h=t[a+1],(h&192)===128&&(_=(s&31)<<6|h&63,_>127&&(f=_));break;case 3:h=t[a+1],m=t[a+2],(h&192)===128&&(m&192)===128&&(_=(s&15)<<12|(h&63)<<6|m&63,_>2047&&(_<55296||_>57343)&&(f=_));break;case 4:h=t[a+1],m=t[a+2],v=t[a+3],(h&192)===128&&(m&192)===128&&(v&192)===128&&(_=(s&15)<<18|(h&63)<<12|(m&63)<<6|v&63,_>65535&&_<1114112&&(f=_))}}f===null?(f=65533,p=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|f&1023),n.push(f),a+=p}return za(n)}var Wn=4096;function za(t){var e=t.length;if(e<=Wn)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Wn));return r}function Ga(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;a<r;++a)n+=String.fromCharCode(t[a]&127);return n}function Wa(t,e,r){var n="";r=Math.min(t.length,r);for(var a=e;a<r;++a)n+=String.fromCharCode(t[a]);return n}function Ha(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var a="",s=e;s<r;++s)a+=Qa(t[s]);return a}function Ya(t,e,r){for(var n=t.slice(e,r),a="",s=0;s<n.length;s+=2)a+=String.fromCharCode(n[s]+n[s+1]*256);return a}E.prototype.slice=function(e,r){var n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);var a;if(E.TYPED_ARRAY_SUPPORT)a=this.subarray(e,r),a.__proto__=E.prototype;else{var s=r-e;a=new E(s,void 0);for(var f=0;f<s;++f)a[f]=this[f+e]}return a};function H(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}E.prototype.readUIntLE=function(e,r,n){e=e|0,r=r|0,n||H(e,r,this.length);for(var a=this[e],s=1,f=0;++f<r&&(s*=256);)a+=this[e+f]*s;return a},E.prototype.readUIntBE=function(e,r,n){e=e|0,r=r|0,n||H(e,r,this.length);for(var a=this[e+--r],s=1;r>0&&(s*=256);)a+=this[e+--r]*s;return a},E.prototype.readUInt8=function(e,r){return r||H(e,1,this.length),this[e]},E.prototype.readUInt16LE=function(e,r){return r||H(e,2,this.length),this[e]|this[e+1]<<8},E.prototype.readUInt16BE=function(e,r){return r||H(e,2,this.length),this[e]<<8|this[e+1]},E.prototype.readUInt32LE=function(e,r){return r||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},E.prototype.readUInt32BE=function(e,r){return r||H(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},E.prototype.readIntLE=function(e,r,n){e=e|0,r=r|0,n||H(e,r,this.length);for(var a=this[e],s=1,f=0;++f<r&&(s*=256);)a+=this[e+f]*s;return s*=128,a>=s&&(a-=Math.pow(2,8*r)),a},E.prototype.readIntBE=function(e,r,n){e=e|0,r=r|0,n||H(e,r,this.length);for(var a=r,s=1,f=this[e+--a];a>0&&(s*=256);)f+=this[e+--a]*s;return s*=128,f>=s&&(f-=Math.pow(2,8*r)),f},E.prototype.readInt8=function(e,r){return r||H(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},E.prototype.readInt16LE=function(e,r){r||H(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},E.prototype.readInt16BE=function(e,r){r||H(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},E.prototype.readInt32LE=function(e,r){return r||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},E.prototype.readInt32BE=function(e,r){return r||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},E.prototype.readFloatLE=function(e,r){return r||H(e,4,this.length),Mt(this,e,!0,23,4)},E.prototype.readFloatBE=function(e,r){return r||H(e,4,this.length),Mt(this,e,!1,23,4)},E.prototype.readDoubleLE=function(e,r){return r||H(e,8,this.length),Mt(this,e,!0,52,8)},E.prototype.readDoubleBE=function(e,r){return r||H(e,8,this.length),Mt(this,e,!1,52,8)};function re(t,e,r,n,a,s){if(!de(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>a||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}E.prototype.writeUIntLE=function(e,r,n,a){if(e=+e,r=r|0,n=n|0,!a){var s=Math.pow(2,8*n)-1;re(this,e,r,n,s,0)}var f=1,p=0;for(this[r]=e&255;++p<n&&(f*=256);)this[r+p]=e/f&255;return r+n},E.prototype.writeUIntBE=function(e,r,n,a){if(e=+e,r=r|0,n=n|0,!a){var s=Math.pow(2,8*n)-1;re(this,e,r,n,s,0)}var f=n-1,p=1;for(this[r+f]=e&255;--f>=0&&(p*=256);)this[r+f]=e/p&255;return r+n},E.prototype.writeUInt8=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,1,255,0),E.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=e&255,r+1};function kt(t,e,r,n){e<0&&(e=65535+e+1);for(var a=0,s=Math.min(t.length-r,2);a<s;++a)t[r+a]=(e&255<<8*(n?a:1-a))>>>(n?a:1-a)*8}E.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,2,65535,0),E.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):kt(this,e,r,!0),r+2},E.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,2,65535,0),E.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):kt(this,e,r,!1),r+2};function jt(t,e,r,n){e<0&&(e=4294967295+e+1);for(var a=0,s=Math.min(t.length-r,4);a<s;++a)t[r+a]=e>>>(n?a:3-a)*8&255}E.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,4,4294967295,0),E.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255):jt(this,e,r,!0),r+4},E.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,4,4294967295,0),E.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):jt(this,e,r,!1),r+4},E.prototype.writeIntLE=function(e,r,n,a){if(e=+e,r=r|0,!a){var s=Math.pow(2,8*n-1);re(this,e,r,n,s-1,-s)}var f=0,p=1,h=0;for(this[r]=e&255;++f<n&&(p*=256);)e<0&&h===0&&this[r+f-1]!==0&&(h=1),this[r+f]=(e/p>>0)-h&255;return r+n},E.prototype.writeIntBE=function(e,r,n,a){if(e=+e,r=r|0,!a){var s=Math.pow(2,8*n-1);re(this,e,r,n,s-1,-s)}var f=n-1,p=1,h=0;for(this[r+f]=e&255;--f>=0&&(p*=256);)e<0&&h===0&&this[r+f+1]!==0&&(h=1),this[r+f]=(e/p>>0)-h&255;return r+n},E.prototype.writeInt8=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,1,127,-128),E.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=e&255,r+1},E.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,2,32767,-32768),E.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8):kt(this,e,r,!0),r+2},E.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,2,32767,-32768),E.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=e&255):kt(this,e,r,!1),r+2},E.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,4,2147483647,-2147483648),E.TYPED_ARRAY_SUPPORT?(this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):jt(this,e,r,!0),r+4},E.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r|0,n||re(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),E.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255):jt(this,e,r,!1),r+4};function Hn(t,e,r,n,a,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Yn(t,e,r,n,a){return a||Hn(t,e,r,4),Nn(t,e,r,n,23,4),r+4}E.prototype.writeFloatLE=function(e,r,n){return Yn(this,e,r,!0,n)},E.prototype.writeFloatBE=function(e,r,n){return Yn(this,e,r,!1,n)};function Xn(t,e,r,n,a){return a||Hn(t,e,r,8),Nn(t,e,r,n,52,8),r+8}E.prototype.writeDoubleLE=function(e,r,n){return Xn(this,e,r,!0,n)},E.prototype.writeDoubleBE=function(e,r,n){return Xn(this,e,r,!1,n)},E.prototype.copy=function(e,r,n,a){if(n||(n=0),!a&&a!==0&&(a=this.length),r>=e.length&&(r=e.length),r||(r=0),a>0&&a<n&&(a=n),a===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-r<a-n&&(a=e.length-r+n);var s=a-n,f;if(this===e&&n<r&&r<a)for(f=s-1;f>=0;--f)e[f+r]=this[f+n];else if(s<1e3||!E.TYPED_ARRAY_SUPPORT)for(f=0;f<s;++f)e[f+r]=this[f+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+s),r);return s},E.prototype.fill=function(e,r,n,a){if(typeof e=="string"){if(typeof r=="string"?(a=r,r=0,n=this.length):typeof n=="string"&&(a=n,n=this.length),e.length===1){var s=e.charCodeAt(0);s<256&&(e=s)}if(a!==void 0&&typeof a!="string")throw new TypeError("encoding must be a string");if(typeof a=="string"&&!E.isEncoding(a))throw new TypeError("Unknown encoding: "+a)}else typeof e=="number"&&(e=e&255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);var f;if(typeof e=="number")for(f=r;f<n;++f)this[f]=e;else{var p=de(e)?e:qt(new E(e,a).toString()),h=p.length;for(f=0;f<n-r;++f)this[f+r]=p[f%h]}return this};var Xa=/[^+\/0-9A-Za-z-_]/g;function Ja(t){if(t=Ka(t).replace(Xa,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Ka(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Qa(t){return t<16?"0"+t.toString(16):t.toString(16)}function qt(t,e){e=e||1/0;for(var r,n=t.length,a=null,s=[],f=0;f<n;++f){if(r=t.charCodeAt(f),r>55295&&r<57344){if(!a){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(f+1===n){(e-=3)>-1&&s.push(239,191,189);continue}a=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(e-=3)>-1&&s.push(239,191,189);if(a=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function Za(t){for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function es(t,e){for(var r,n,a,s=[],f=0;f<t.length&&!((e-=2)<0);++f)r=t.charCodeAt(f),n=r>>8,a=r%256,s.push(a),s.push(n);return s}function Jn(t){return Oa(Ja(t))}function Vt(t,e,r,n){for(var a=0;a<n&&!(a+r>=e.length||a>=t.length);++a)e[a+r]=t[a];return a}function ts(t){return t!==t}function rs(t){return t!=null&&(!!t._isBuffer||Kn(t)||ns(t))}function Kn(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function ns(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&Kn(t.slice(0,0))}function Qn(){throw new Error("setTimeout has not been defined")}function Zn(){throw new Error("clearTimeout has not been defined")}var Be=Qn,Oe=Zn;typeof Ke.setTimeout=="function"&&(Be=setTimeout),typeof Ke.clearTimeout=="function"&&(Oe=clearTimeout);function ei(t){if(Be===setTimeout)return setTimeout(t,0);if((Be===Qn||!Be)&&setTimeout)return Be=setTimeout,setTimeout(t,0);try{return Be(t,0)}catch{try{return Be.call(null,t,0)}catch{return Be.call(this,t,0)}}}function is(t){if(Oe===clearTimeout)return clearTimeout(t);if((Oe===Zn||!Oe)&&clearTimeout)return Oe=clearTimeout,clearTimeout(t);try{return Oe(t)}catch{try{return Oe.call(null,t)}catch{return Oe.call(this,t)}}}var Ee=[],Qe=!1,Le,zt=-1;function os(){!Qe||!Le||(Qe=!1,Le.length?Ee=Le.concat(Ee):zt=-1,Ee.length&&ti())}function ti(){if(!Qe){var t=ei(os);Qe=!0;for(var e=Ee.length;e;){for(Le=Ee,Ee=[];++zt<e;)Le&&Le[zt].run();zt=-1,e=Ee.length}Le=null,Qe=!1,is(t)}}function as(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Ee.push(new ri(t,e)),Ee.length===1&&!Qe&&ei(ti)}function ri(t,e){this.fun=t,this.array=e}ri.prototype.run=function(){this.fun.apply(null,this.array)};var ss="browser",us="browser",cs=!0,fs={},ls=[],ps="",hs={},ds={},ys={};function ke(){}var gs=ke,ms=ke,ws=ke,vs=ke,_s=ke,bs=ke,Es=ke;function As(t){throw new Error("process.binding is not supported")}function xs(){return"/"}function Ss(t){throw new Error("process.chdir is not supported")}function Is(){return 0}var Ze=Ke.performance||{},Bs=Ze.now||Ze.mozNow||Ze.msNow||Ze.oNow||Ze.webkitNow||function(){return new Date().getTime()};function Os(t){var e=Bs.call(Ze)*.001,r=Math.floor(e),n=Math.floor(e%1*1e9);return t&&(r=r-t[0],n=n-t[1],n<0&&(r--,n+=1e9)),[r,n]}var Ts=new Date;function Rs(){var t=new Date,e=t-Ts;return e/1e3}var Gt={nextTick:as,title:ss,browser:cs,env:fs,argv:ls,version:ps,versions:hs,on:gs,addListener:ms,once:ws,off:vs,removeListener:_s,removeAllListeners:bs,emit:Es,binding:As,cwd:xs,chdir:Ss,umask:Is,hrtime:Os,platform:us,release:ds,config:ys,uptime:Rs},Rr;typeof Object.create=="function"?Rr=function(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:Rr=function(e,r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e};var ni=Rr,$s=/%[sdj%]/g;function Wt(t){if(!gt(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(ye(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,a=n.length,s=String(t).replace($s,function(p){if(p==="%%")return"%";if(r>=a)return p;switch(p){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return p}}),f=n[r];r<a;f=n[++r])yt(f)||!je(f)?s+=" "+f:s+=" "+ye(f);return s}function $r(t,e){if(ge(Ke.process))return function(){return $r(t,e).apply(this,arguments)};if(Gt.noDeprecation===!0)return t;var r=!1;function n(){if(!r){if(Gt.throwDeprecation)throw new Error(e);Gt.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}return n}var Ht={},Pr;function ii(t){if(ge(Pr)&&(Pr=Gt.env.NODE_DEBUG||""),t=t.toUpperCase(),!Ht[t])if(new RegExp("\\b"+t+"\\b","i").test(Pr)){var e=0;Ht[t]=function(){var r=Wt.apply(null,arguments);console.error("%s %d: %s",t,e,r)}}else Ht[t]=function(){};return Ht[t]}function ye(t,e){var r={seen:[],stylize:Fs};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Xt(e)?r.showHidden=e:e&&Lr(r,e),ge(r.showHidden)&&(r.showHidden=!1),ge(r.depth)&&(r.depth=2),ge(r.colors)&&(r.colors=!1),ge(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Ps),Yt(r,t,r.depth)}ye.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},ye.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Ps(t,e){var r=ye.styles[e];return r?"\x1B["+ye.colors[r][0]+"m"+t+"\x1B["+ye.colors[r][1]+"m":t}function Fs(t,e){return t}function Us(t){var e={};return t.forEach(function(r,n){e[r]=!0}),e}function Yt(t,e,r){if(t.customInspect&&e&&vt(e.inspect)&&e.inspect!==ye&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(r,t);return gt(n)||(n=Yt(t,n,r)),n}var a=Cs(t,e);if(a)return a;var s=Object.keys(e),f=Us(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(e)),wt(e)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return Fr(e);if(s.length===0){if(vt(e)){var p=e.name?": "+e.name:"";return t.stylize("[Function"+p+"]","special")}if(mt(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Jt(e))return t.stylize(Date.prototype.toString.call(e),"date");if(wt(e))return Fr(e)}var h="",m=!1,v=["{","}"];if(Cr(e)&&(m=!0,v=["[","]"]),vt(e)){var _=e.name?": "+e.name:"";h=" [Function"+_+"]"}if(mt(e)&&(h=" "+RegExp.prototype.toString.call(e)),Jt(e)&&(h=" "+Date.prototype.toUTCString.call(e)),wt(e)&&(h=" "+Fr(e)),s.length===0&&(!m||e.length==0))return v[0]+h+v[1];if(r<0)return mt(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var b;return m?b=Ds(t,e,r,f,s):b=s.map(function(y){return Ur(t,e,r,f,y,m)}),t.seen.pop(),Ns(b,h,v)}function Cs(t,e){if(ge(e))return t.stylize("undefined","undefined");if(gt(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(Dr(e))return t.stylize(""+e,"number");if(Xt(e))return t.stylize(""+e,"boolean");if(yt(e))return t.stylize("null","null")}function Fr(t){return"["+Error.prototype.toString.call(t)+"]"}function Ds(t,e,r,n,a){for(var s=[],f=0,p=e.length;f<p;++f)fi(e,String(f))?s.push(Ur(t,e,r,n,String(f),!0)):s.push("");return a.forEach(function(h){h.match(/^\d+$/)||s.push(Ur(t,e,r,n,h,!0))}),s}function Ur(t,e,r,n,a,s){var f,p,h;if(h=Object.getOwnPropertyDescriptor(e,a)||{value:e[a]},h.get?h.set?p=t.stylize("[Getter/Setter]","special"):p=t.stylize("[Getter]","special"):h.set&&(p=t.stylize("[Setter]","special")),fi(n,a)||(f="["+a+"]"),p||(t.seen.indexOf(h.value)<0?(yt(r)?p=Yt(t,h.value,null):p=Yt(t,h.value,r-1),p.indexOf(`
9
9
  `)>-1&&(s?p=p.split(`
10
- `).map(function(v){return" "+v}).join(`
10
+ `).map(function(m){return" "+m}).join(`
11
11
  `).substr(2):p=`
12
12
  `+p.split(`
13
- `).map(function(v){return" "+v}).join(`
14
- `))):p=e.stylize("[Circular]","special")),me(c)){if(s&&a.match(/^\d+$/))return p;c=JSON.stringify(""+a),c.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(c=c.substr(1,c.length-2),c=e.stylize(c,"name")):(c=c.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),c=e.stylize(c,"string"))}return c+": "+p}function Ic(e,r,t){var n=e.reduce(function(a,s){return s.indexOf(`
15
- `)>=0,a+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?t[0]+(r===""?"":r+`
16
- `)+" "+e.join(`,
17
- `)+" "+t[1]:t[0]+r+" "+e.join(", ")+" "+t[1]}function Yt(e){return Array.isArray(e)}function et(e){return typeof e=="boolean"}function wr(e){return e===null}function Ui(e){return e==null}function Kt(e){return typeof e=="number"}function br(e){return typeof e=="string"}function Di(e){return typeof e=="symbol"}function me(e){return e===void 0}function $r(e){return Ve(e)&&Xt(e)==="[object RegExp]"}function Ve(e){return typeof e=="object"&&e!==null}function rt(e){return Ve(e)&&Xt(e)==="[object Date]"}function Ar(e){return Ve(e)&&(Xt(e)==="[object Error]"||e instanceof Error)}function Er(e){return typeof e=="function"}function Ni(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||typeof e>"u"}function Li(e){return $.isBuffer(e)}function Xt(e){return Object.prototype.toString.call(e)}function Jt(e){return e<10?"0"+e.toString(10):e.toString(10)}var Tc=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Oc(){var e=new Date,r=[Jt(e.getHours()),Jt(e.getMinutes()),Jt(e.getSeconds())].join(":");return[e.getDate(),Tc[e.getMonth()],r].join(" ")}function Mi(){console.log("%s - %s",Oc(),Jr.apply(null,arguments))}function Qt(e,r){if(!r||!Ve(r))return e;for(var t=Object.keys(r),n=t.length;n--;)e[t[n]]=r[t[n]];return e}function ji(e,r){return Object.prototype.hasOwnProperty.call(e,r)}var Bc={inherits:Fi,_extend:Qt,log:Mi,isBuffer:Li,isPrimitive:Ni,isFunction:Er,isError:Ar,isDate:rt,isObject:Ve,isRegExp:$r,isUndefined:me,isSymbol:Di,isString:br,isNumber:Kt,isNullOrUndefined:Ui,isNull:wr,isBoolean:et,isArray:Yt,inspect:ve,deprecate:qt,format:Jr,debuglog:Ci},Pc=Object.freeze({__proto__:null,format:Jr,deprecate:qt,debuglog:Ci,inspect:ve,isArray:Yt,isBoolean:et,isNull:wr,isNullOrUndefined:Ui,isNumber:Kt,isString:br,isSymbol:Di,isUndefined:me,isRegExp:$r,isObject:Ve,isDate:rt,isError:Ar,isFunction:Er,isPrimitive:Ni,isBuffer:Li,log:Mi,inherits:Fi,_extend:Qt,default:Bc}),Rc=vr(Pc),Fc=Rc.inspect,Zt=typeof Map=="function"&&Map.prototype,en=Object.getOwnPropertyDescriptor&&Zt?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,tt=Zt&&en&&typeof en.get=="function"?en.get:null,ki=Zt&&Map.prototype.forEach,rn=typeof Set=="function"&&Set.prototype,tn=Object.getOwnPropertyDescriptor&&rn?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,nt=rn&&tn&&typeof tn.get=="function"?tn.get:null,Gi=rn&&Set.prototype.forEach,Cc=typeof WeakMap=="function"&&WeakMap.prototype,Sr=Cc?WeakMap.prototype.has:null,Uc=typeof WeakSet=="function"&&WeakSet.prototype,xr=Uc?WeakSet.prototype.has:null,Dc=typeof WeakRef=="function"&&WeakRef.prototype,Wi=Dc?WeakRef.prototype.deref:null,Nc=Boolean.prototype.valueOf,Lc=Object.prototype.toString,Mc=Function.prototype.toString,jc=String.prototype.match,nn=String.prototype.slice,Re=String.prototype.replace,kc=String.prototype.toUpperCase,qi=String.prototype.toLowerCase,zi=RegExp.prototype.test,Vi=Array.prototype.concat,_e=Array.prototype.join,Gc=Array.prototype.slice,Hi=Math.floor,on=typeof BigInt=="function"?BigInt.prototype.valueOf:null,an=Object.getOwnPropertySymbols,sn=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,or=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ee=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===or||"symbol")?Symbol.toStringTag:null,Yi=Object.prototype.propertyIsEnumerable,Ki=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Xi(e,r){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||zi.call(/e/,r))return r;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var n=e<0?-Hi(-e):Hi(e);if(n!==e){var a=String(n),s=nn.call(r,a.length+1);return Re.call(a,t,"$&_")+"."+Re.call(Re.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Re.call(r,t,"$&_")}var un=Fc,Ji=un.custom,Qi=ro(Ji)?Ji:null,Wc=function e(r,t,n,a){var s=t||{};if(Fe(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Fe(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var c=Fe(s,"customInspect")?s.customInspect:!0;if(typeof c!="boolean"&&c!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Fe(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Fe(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var p=s.numericSeparator;if(typeof r>"u")return"undefined";if(r===null)return"null";if(typeof r=="boolean")return r?"true":"false";if(typeof r=="string")return no(r,s);if(typeof r=="number"){if(r===0)return 1/0/r>0?"0":"-0";var h=String(r);return p?Xi(r,h):h}if(typeof r=="bigint"){var v=String(r)+"n";return p?Xi(r,v):v}var _=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=_&&_>0&&typeof r=="object")return cn(r)?"[Array]":"[Object]";var w=uf(s,n);if(typeof a>"u")a=[];else if(to(a,r)>=0)return"[Circular]";function b(k,re,N){if(re&&(a=Gc.call(a),a.push(re)),N){var ce={depth:s.depth};return Fe(s,"quoteStyle")&&(ce.quoteStyle=s.quoteStyle),e(k,ce,n+1,a)}return e(k,s,n+1,a)}if(typeof r=="function"&&!eo(r)){var d=Qc(r),E=it(r,b);return"[Function"+(d?": "+d:" (anonymous)")+"]"+(E.length>0?" { "+_e.call(E,", ")+" }":"")}if(ro(r)){var x=or?Re.call(String(r),/^(Symbol\(.*\))_[^)]*$/,"$1"):sn.call(r);return typeof r=="object"&&!or?Ir(x):x}if(of(r)){for(var I="<"+qi.call(String(r.nodeName)),S=r.attributes||[],T=0;T<S.length;T++)I+=" "+S[T].name+"="+Zi(qc(S[T].value),"double",s);return I+=">",r.childNodes&&r.childNodes.length&&(I+="..."),I+="</"+qi.call(String(r.nodeName))+">",I}if(cn(r)){if(r.length===0)return"[]";var P=it(r,b);return w&&!sf(P)?"["+ln(P,w)+"]":"[ "+_e.call(P,", ")+" ]"}if(Vc(r)){var B=it(r,b);return!("cause"in Error.prototype)&&"cause"in r&&!Yi.call(r,"cause")?"{ ["+String(r)+"] "+_e.call(Vi.call("[cause]: "+b(r.cause),B),", ")+" }":B.length===0?"["+String(r)+"]":"{ ["+String(r)+"] "+_e.call(B,", ")+" }"}if(typeof r=="object"&&c){if(Qi&&typeof r[Qi]=="function"&&un)return un(r,{depth:_-n});if(c!=="symbol"&&typeof r.inspect=="function")return r.inspect()}if(Zc(r)){var D=[];return ki&&ki.call(r,function(k,re){D.push(b(re,r,!0)+" => "+b(k,r))}),io("Map",tt.call(r),D,w)}if(tf(r)){var j=[];return Gi&&Gi.call(r,function(k){j.push(b(k,r))}),io("Set",nt.call(r),j,w)}if(ef(r))return fn("WeakMap");if(nf(r))return fn("WeakSet");if(rf(r))return fn("WeakRef");if(Yc(r))return Ir(b(Number(r)));if(Xc(r))return Ir(b(on.call(r)));if(Kc(r))return Ir(Nc.call(r));if(Hc(r))return Ir(b(String(r)));if(!zc(r)&&!eo(r)){var q=it(r,b),z=Ki?Ki(r)===Object.prototype:r instanceof Object||r.constructor===Object,X=r instanceof Object?"":"null prototype",V=!z&&ee&&Object(r)===r&&ee in r?nn.call(Ce(r),8,-1):X?"Object":"",ae=z||typeof r.constructor!="function"?"":r.constructor.name?r.constructor.name+" ":"",ue=ae+(V||X?"["+_e.call(Vi.call([],V||[],X||[]),": ")+"] ":"");return q.length===0?ue+"{}":w?ue+"{"+ln(q,w)+"}":ue+"{ "+_e.call(q,", ")+" }"}return String(r)};function Zi(e,r,t){var n=(t.quoteStyle||r)==="double"?'"':"'";return n+e+n}function qc(e){return Re.call(String(e),/"/g,"&quot;")}function cn(e){return Ce(e)==="[object Array]"&&(!ee||!(typeof e=="object"&&ee in e))}function zc(e){return Ce(e)==="[object Date]"&&(!ee||!(typeof e=="object"&&ee in e))}function eo(e){return Ce(e)==="[object RegExp]"&&(!ee||!(typeof e=="object"&&ee in e))}function Vc(e){return Ce(e)==="[object Error]"&&(!ee||!(typeof e=="object"&&ee in e))}function Hc(e){return Ce(e)==="[object String]"&&(!ee||!(typeof e=="object"&&ee in e))}function Yc(e){return Ce(e)==="[object Number]"&&(!ee||!(typeof e=="object"&&ee in e))}function Kc(e){return Ce(e)==="[object Boolean]"&&(!ee||!(typeof e=="object"&&ee in e))}function ro(e){if(or)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!sn)return!1;try{return sn.call(e),!0}catch{}return!1}function Xc(e){if(!e||typeof e!="object"||!on)return!1;try{return on.call(e),!0}catch{}return!1}var Jc=Object.prototype.hasOwnProperty||function(e){return e in this};function Fe(e,r){return Jc.call(e,r)}function Ce(e){return Lc.call(e)}function Qc(e){if(e.name)return e.name;var r=jc.call(Mc.call(e),/^function\s*([\w$]+)/);return r?r[1]:null}function to(e,r){if(e.indexOf)return e.indexOf(r);for(var t=0,n=e.length;t<n;t++)if(e[t]===r)return t;return-1}function Zc(e){if(!tt||!e||typeof e!="object")return!1;try{tt.call(e);try{nt.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function ef(e){if(!Sr||!e||typeof e!="object")return!1;try{Sr.call(e,Sr);try{xr.call(e,xr)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function rf(e){if(!Wi||!e||typeof e!="object")return!1;try{return Wi.call(e),!0}catch{}return!1}function tf(e){if(!nt||!e||typeof e!="object")return!1;try{nt.call(e);try{tt.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function nf(e){if(!xr||!e||typeof e!="object")return!1;try{xr.call(e,xr);try{Sr.call(e,Sr)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function of(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function no(e,r){if(e.length>r.maxStringLength){var t=e.length-r.maxStringLength,n="... "+t+" more character"+(t>1?"s":"");return no(nn.call(e,0,r.maxStringLength),r)+n}var a=Re.call(Re.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,af);return Zi(a,"single",r)}function af(e){var r=e.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[r];return t?"\\"+t:"\\x"+(r<16?"0":"")+kc.call(r.toString(16))}function Ir(e){return"Object("+e+")"}function fn(e){return e+" { ? }"}function io(e,r,t,n){var a=n?ln(t,n):_e.call(t,", ");return e+" ("+r+") {"+a+"}"}function sf(e){for(var r=0;r<e.length;r++)if(to(e[r],`
18
- `)>=0)return!1;return!0}function uf(e,r){var t;if(e.indent===" ")t=" ";else if(typeof e.indent=="number"&&e.indent>0)t=_e.call(Array(e.indent+1)," ");else return null;return{base:t,prev:_e.call(Array(r+1),t)}}function ln(e,r){if(e.length===0)return"";var t=`
19
- `+r.prev+r.base;return t+_e.call(e,","+t)+`
20
- `+r.prev}function it(e,r){var t=cn(e),n=[];if(t){n.length=e.length;for(var a=0;a<e.length;a++)n[a]=Fe(e,a)?r(e[a],e):""}var s=typeof an=="function"?an(e):[],c;if(or){c={};for(var p=0;p<s.length;p++)c["$"+s[p]]=s[p]}for(var h in e)Fe(e,h)&&(t&&String(Number(h))===h&&h<e.length||or&&c["$"+h]instanceof Symbol||(zi.call(/[^\w$]/,h)?n.push(r(h,e)+": "+r(e[h],e)):n.push(h+": "+r(e[h],e))));if(typeof an=="function")for(var v=0;v<s.length;v++)Yi.call(e,s[v])&&n.push("["+r(s[v])+"]: "+r(e[s[v]],e));return n}var pn=Lt,ar=gu,cf=Wc,ff=pn("%TypeError%"),ot=pn("%WeakMap%",!0),at=pn("%Map%",!0),lf=ar("WeakMap.prototype.get",!0),pf=ar("WeakMap.prototype.set",!0),hf=ar("WeakMap.prototype.has",!0),df=ar("Map.prototype.get",!0),yf=ar("Map.prototype.set",!0),gf=ar("Map.prototype.has",!0),hn=function(e,r){for(var t=e,n;(n=t.next)!==null;t=n)if(n.key===r)return t.next=n.next,n.next=e.next,e.next=n,n},vf=function(e,r){var t=hn(e,r);return t&&t.value},mf=function(e,r,t){var n=hn(e,r);n?n.value=t:e.next={key:r,next:e.next,value:t}},_f=function(e,r){return!!hn(e,r)},wf=function(){var r,t,n,a={assert:function(s){if(!a.has(s))throw new ff("Side channel does not contain "+cf(s))},get:function(s){if(ot&&s&&(typeof s=="object"||typeof s=="function")){if(r)return lf(r,s)}else if(at){if(t)return df(t,s)}else if(n)return vf(n,s)},has:function(s){if(ot&&s&&(typeof s=="object"||typeof s=="function")){if(r)return hf(r,s)}else if(at){if(t)return gf(t,s)}else if(n)return _f(n,s);return!1},set:function(s,c){ot&&s&&(typeof s=="object"||typeof s=="function")?(r||(r=new ot),pf(r,s,c)):at?(t||(t=new at),yf(t,s,c)):(n||(n={key:{},next:null}),mf(n,s,c))}};return a},bf=String.prototype.replace,$f=/%20/g,dn={RFC1738:"RFC1738",RFC3986:"RFC3986"},oo={default:dn.RFC3986,formatters:{RFC1738:function(e){return bf.call(e,$f,"+")},RFC3986:function(e){return String(e)}},RFC1738:dn.RFC1738,RFC3986:dn.RFC3986},Af=oo,yn=Object.prototype.hasOwnProperty,He=Array.isArray,we=function(){for(var e=[],r=0;r<256;++r)e.push("%"+((r<16?"0":"")+r.toString(16)).toUpperCase());return e}(),Ef=function(r){for(;r.length>1;){var t=r.pop(),n=t.obj[t.prop];if(He(n)){for(var a=[],s=0;s<n.length;++s)typeof n[s]<"u"&&a.push(n[s]);t.obj[t.prop]=a}}},ao=function(r,t){for(var n=t&&t.plainObjects?Object.create(null):{},a=0;a<r.length;++a)typeof r[a]<"u"&&(n[a]=r[a]);return n},Sf=function e(r,t,n){if(!t)return r;if(typeof t!="object"){if(He(r))r.push(t);else if(r&&typeof r=="object")(n&&(n.plainObjects||n.allowPrototypes)||!yn.call(Object.prototype,t))&&(r[t]=!0);else return[r,t];return r}if(!r||typeof r!="object")return[r].concat(t);var a=r;return He(r)&&!He(t)&&(a=ao(r,n)),He(r)&&He(t)?(t.forEach(function(s,c){if(yn.call(r,c)){var p=r[c];p&&typeof p=="object"&&s&&typeof s=="object"?r[c]=e(p,s,n):r.push(s)}else r[c]=s}),r):Object.keys(t).reduce(function(s,c){var p=t[c];return yn.call(s,c)?s[c]=e(s[c],p,n):s[c]=p,s},a)},xf=function(r,t){return Object.keys(t).reduce(function(n,a){return n[a]=t[a],n},r)},If=function(e,r,t){var n=e.replace(/\+/g," ");if(t==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Tf=function(r,t,n,a,s){if(r.length===0)return r;var c=r;if(typeof r=="symbol"?c=Symbol.prototype.toString.call(r):typeof r!="string"&&(c=String(r)),n==="iso-8859-1")return escape(c).replace(/%u[0-9a-f]{4}/gi,function(_){return"%26%23"+parseInt(_.slice(2),16)+"%3B"});for(var p="",h=0;h<c.length;++h){var v=c.charCodeAt(h);if(v===45||v===46||v===95||v===126||v>=48&&v<=57||v>=65&&v<=90||v>=97&&v<=122||s===Af.RFC1738&&(v===40||v===41)){p+=c.charAt(h);continue}if(v<128){p=p+we[v];continue}if(v<2048){p=p+(we[192|v>>6]+we[128|v&63]);continue}if(v<55296||v>=57344){p=p+(we[224|v>>12]+we[128|v>>6&63]+we[128|v&63]);continue}h+=1,v=65536+((v&1023)<<10|c.charCodeAt(h)&1023),p+=we[240|v>>18]+we[128|v>>12&63]+we[128|v>>6&63]+we[128|v&63]}return p},Of=function(r){for(var t=[{obj:{o:r},prop:"o"}],n=[],a=0;a<t.length;++a)for(var s=t[a],c=s.obj[s.prop],p=Object.keys(c),h=0;h<p.length;++h){var v=p[h],_=c[v];typeof _=="object"&&_!==null&&n.indexOf(_)===-1&&(t.push({obj:c,prop:v}),n.push(_))}return Ef(t),r},Bf=function(r){return Object.prototype.toString.call(r)==="[object RegExp]"},Pf=function(r){return!r||typeof r!="object"?!1:!!(r.constructor&&r.constructor.isBuffer&&r.constructor.isBuffer(r))},Rf=function(r,t){return[].concat(r,t)},Ff=function(r,t){if(He(r)){for(var n=[],a=0;a<r.length;a+=1)n.push(t(r[a]));return n}return t(r)},Cf={arrayToObject:ao,assign:xf,combine:Rf,compact:Of,decode:If,encode:Tf,isBuffer:Pf,isRegExp:Bf,maybeMap:Ff,merge:Sf},so=wf,gn=Cf,Tr=oo,Uf=Object.prototype.hasOwnProperty,uo={brackets:function(r){return r+"[]"},comma:"comma",indices:function(r,t){return r+"["+t+"]"},repeat:function(r){return r}},xe=Array.isArray,Df=String.prototype.split,Nf=Array.prototype.push,co=function(e,r){Nf.apply(e,xe(r)?r:[r])},Lf=Date.prototype.toISOString,fo=Tr.default,J={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:gn.encode,encodeValuesOnly:!1,format:fo,formatter:Tr.formatters[fo],indices:!1,serializeDate:function(r){return Lf.call(r)},skipNulls:!1,strictNullHandling:!1},Mf=function(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r=="symbol"||typeof r=="bigint"},vn={},jf=function e(r,t,n,a,s,c,p,h,v,_,w,b,d,E,x,I){for(var S=r,T=I,P=0,B=!1;(T=T.get(vn))!==void 0&&!B;){var D=T.get(r);if(P+=1,typeof D<"u"){if(D===P)throw new RangeError("Cyclic object value");B=!0}typeof T.get(vn)>"u"&&(P=0)}if(typeof h=="function"?S=h(t,S):S instanceof Date?S=w(S):n==="comma"&&xe(S)&&(S=gn.maybeMap(S,function(Ne){return Ne instanceof Date?w(Ne):Ne})),S===null){if(s)return p&&!E?p(t,J.encoder,x,"key",b):t;S=""}if(Mf(S)||gn.isBuffer(S)){if(p){var j=E?t:p(t,J.encoder,x,"key",b);if(n==="comma"&&E){for(var q=Df.call(String(S),","),z="",X=0;X<q.length;++X)z+=(X===0?"":",")+d(p(q[X],J.encoder,x,"value",b));return[d(j)+(a&&xe(S)&&q.length===1?"[]":"")+"="+z]}return[d(j)+"="+d(p(S,J.encoder,x,"value",b))]}return[d(t)+"="+d(String(S))]}var V=[];if(typeof S>"u")return V;var ae;if(n==="comma"&&xe(S))ae=[{value:S.length>0?S.join(",")||null:void 0}];else if(xe(h))ae=h;else{var ue=Object.keys(S);ae=v?ue.sort(v):ue}for(var k=a&&xe(S)&&S.length===1?t+"[]":t,re=0;re<ae.length;++re){var N=ae[re],ce=typeof N=="object"&&typeof N.value<"u"?N.value:S[N];if(!(c&&ce===null)){var hr=xe(S)?typeof n=="function"?n(k,N):k:k+(_?"."+N:"["+N+"]");I.set(r,P);var se=so();se.set(vn,I),co(V,e(ce,hr,n,a,s,c,p,h,v,_,w,b,d,E,x,se))}}return V},kf=function(r){if(!r)return J;if(r.encoder!==null&&typeof r.encoder<"u"&&typeof r.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=r.charset||J.charset;if(typeof r.charset<"u"&&r.charset!=="utf-8"&&r.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=Tr.default;if(typeof r.format<"u"){if(!Uf.call(Tr.formatters,r.format))throw new TypeError("Unknown format option provided.");n=r.format}var a=Tr.formatters[n],s=J.filter;return(typeof r.filter=="function"||xe(r.filter))&&(s=r.filter),{addQueryPrefix:typeof r.addQueryPrefix=="boolean"?r.addQueryPrefix:J.addQueryPrefix,allowDots:typeof r.allowDots>"u"?J.allowDots:!!r.allowDots,charset:t,charsetSentinel:typeof r.charsetSentinel=="boolean"?r.charsetSentinel:J.charsetSentinel,delimiter:typeof r.delimiter>"u"?J.delimiter:r.delimiter,encode:typeof r.encode=="boolean"?r.encode:J.encode,encoder:typeof r.encoder=="function"?r.encoder:J.encoder,encodeValuesOnly:typeof r.encodeValuesOnly=="boolean"?r.encodeValuesOnly:J.encodeValuesOnly,filter:s,format:n,formatter:a,serializeDate:typeof r.serializeDate=="function"?r.serializeDate:J.serializeDate,skipNulls:typeof r.skipNulls=="boolean"?r.skipNulls:J.skipNulls,sort:typeof r.sort=="function"?r.sort:null,strictNullHandling:typeof r.strictNullHandling=="boolean"?r.strictNullHandling:J.strictNullHandling}},Gf=function(e,r){var t=e,n=kf(r),a,s;typeof n.filter=="function"?(s=n.filter,t=s("",t)):xe(n.filter)&&(s=n.filter,a=s);var c=[];if(typeof t!="object"||t===null)return"";var p;r&&r.arrayFormat in uo?p=r.arrayFormat:r&&"indices"in r?p=r.indices?"indices":"repeat":p="indices";var h=uo[p];if(r&&"commaRoundTrip"in r&&typeof r.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var v=h==="comma"&&r&&r.commaRoundTrip;a||(a=Object.keys(t)),n.sort&&a.sort(n.sort);for(var _=so(),w=0;w<a.length;++w){var b=a[w];n.skipNulls&&t[b]===null||co(c,jf(t[b],b,h,v,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,_))}var d=c.join(n.delimiter),E=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?E+="utf8=%26%2310003%3B&":E+="utf8=%E2%9C%93&"),d.length>0?E+d:""};let lo={storeIdentifier:"",environment:"prod"};function Wf(e){lo=e}function be(){return lo}const qf=e=>e==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",st=e=>e==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",zf=e=>e==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",Vf="/tools/recurring";class ut{constructor(r,t){this.name="RechargeRequestError",this.message=r,this.status=t}}var Hf=Object.defineProperty,Yf=Object.defineProperties,Kf=Object.getOwnPropertyDescriptors,po=Object.getOwnPropertySymbols,Xf=Object.prototype.hasOwnProperty,Jf=Object.prototype.propertyIsEnumerable,ho=(e,r,t)=>r in e?Hf(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,ct=(e,r)=>{for(var t in r||(r={}))Xf.call(r,t)&&ho(e,t,r[t]);if(po)for(var t of po(r))Jf.call(r,t)&&ho(e,t,r[t]);return e},Qf=(e,r)=>Yf(e,Kf(r));function Zf(e){return Gf(e,{encode:!1,indices:!1,arrayFormat:"comma"})}async function ft(e,r,t={}){const n=be();return le(e,`${zf(n.environment)}/store/${n.storeIdentifier}${r}`,t)}async function O(e,r,{id:t,query:n,data:a,headers:s}={},c){const{environment:p,storeIdentifier:h,loginRetryFn:v}=be(),_=c.apiToken,w=qf(p),b=ct({"X-Recharge-Access-Token":_,"X-Recharge-Version":"2021-11"},s||{}),d=ct({shop_url:h},n);try{return await le(e,`${w}${r}`,{id:t,query:d,data:a,headers:b})}catch(E){if(v&&E instanceof ut&&E.status===401)return v().then(x=>{if(x)return le(e,`${w}${r}`,{id:t,query:d,data:a,headers:Qf(ct({},b),{"X-Recharge-Access-Token":x.apiToken})});throw E});throw E}}async function Or(e,r,t={}){return le(e,`${Vf}${r}`,t)}async function le(e,r,{id:t,query:n,data:a,headers:s}={}){let c=r.trim();if(t&&(c=[c,`${t}`.trim()].join("/")),n){let w;[c,w]=c.split("?");const b=[w,Zf(n)].join("&").replace(/^&/,"");c=`${c}${b?`?${b}`:""}`}let p;a&&e!=="get"&&(p=JSON.stringify(a));const h=ct({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},s||{}),v=await fetch(c,{method:e,headers:h,body:p});let _;try{_=await v.json()}catch{}if(!v.ok)throw _&&_.error?new ut(_.error,v.status):_&&_.errors?new ut(JSON.stringify(_.errors),v.status):new ut("A connection error occurred while making the request");return _}var el=Object.defineProperty,yo=Object.getOwnPropertySymbols,rl=Object.prototype.hasOwnProperty,tl=Object.prototype.propertyIsEnumerable,go=(e,r,t)=>r in e?el(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,nl=(e,r)=>{for(var t in r||(r={}))rl.call(r,t)&&go(e,t,r[t]);if(yo)for(var t of yo(r))tl.call(r,t)&&go(e,t,r[t]);return e};function il(e,r){return O("get","/addresses",{query:r},e)}async function ol(e,r,t){const{address:n}=await O("get","/addresses",{id:r,query:{include:t?.include}},e);return n}async function al(e,r){const{address:t}=await O("post","/addresses",{data:nl({customer_id:e.customerId?Number(e.customerId):void 0},r)},e);return t}async function mn(e,r,t){const{address:n}=await O("put","/addresses",{id:r,data:t},e);return n}async function sl(e,r,t){return mn(e,r,{discounts:[{code:t}]})}async function ul(e,r){return mn(e,r,{discounts:[]})}function cl(e,r){return O("delete","/addresses",{id:r},e)}async function fl(e,r){const{address:t}=await O("post","/addresses/merge",{data:r},e);return t}async function ll(e,r,t){const{charge:n}=await O("post",`/addresses/${r}/charges/skip`,{data:t},e);return n}var pl=Object.freeze({__proto__:null,listAddresses:il,getAddress:ol,createAddress:al,updateAddress:mn,applyDiscountToAddress:sl,removeDiscountsFromAddress:ul,deleteAddress:cl,mergeAddresses:fl,skipFutureCharge:ll}),hl=Object.defineProperty,vo=Object.getOwnPropertySymbols,dl=Object.prototype.hasOwnProperty,yl=Object.prototype.propertyIsEnumerable,mo=(e,r,t)=>r in e?hl(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,_o=(e,r)=>{for(var t in r||(r={}))dl.call(r,t)&&mo(e,t,r[t]);if(vo)for(var t of vo(r))yl.call(r,t)&&mo(e,t,r[t]);return e};async function gl(){const{storefrontAccessToken:e}=be(),r={};e&&(r["X-Recharge-Storefront-Access-Token"]=e);const t=await Or("get","/access",{headers:r});return{apiToken:t.api_token,customerId:t.customer_id}}async function vl(e,r){const{environment:t,storefrontAccessToken:n,storeIdentifier:a}=be(),s=st(t),c={};n&&(c["X-Recharge-Storefront-Access-Token"]=n);const p=await le("post",`${s}/shopify_storefront_access`,{data:{customer_token:r,storefront_token:e,shop_url:a},headers:c});return p.api_token?{apiToken:p.api_token,customerId:p.customer_id}:null}async function ml(e,r={}){const{environment:t,storefrontAccessToken:n,storeIdentifier:a}=be(),s=st(t),c={};n&&(c["X-Recharge-Storefront-Access-Token"]=n);const p=await le("post",`${s}/attempt_login`,{data:_o({email:e,shop:a},r),headers:c});if(p.errors)throw new Error(p.errors);return p.session_token}async function _l(e,r={}){const{storefrontAccessToken:t}=be(),n={};t&&(n["X-Recharge-Storefront-Access-Token"]=t);const a=await Or("post","/attempt_login",{data:_o({email:e},r),headers:n});if(a.errors)throw new Error(a.errors);return a.session_token}async function wl(e,r,t){const{environment:n,storefrontAccessToken:a,storeIdentifier:s}=be(),c=st(n),p={};a&&(p["X-Recharge-Storefront-Access-Token"]=a);const h=await le("post",`${c}/validate_login`,{data:{code:t,email:e,session_token:r,shop:s},headers:p});if(h.errors)throw new Error(h.errors);return{apiToken:h.api_token,customerId:h.customer_id}}async function bl(e,r,t){const{storefrontAccessToken:n}=be(),a={};n&&(a["X-Recharge-Storefront-Access-Token"]=n);const s=await Or("post","/validate_login",{data:{code:t,email:e,session_token:r},headers:a});if(s.errors)throw new Error(s.errors);return{apiToken:s.api_token,customerId:s.customer_id}}function $l(){const{pathname:e,search:r}=window.location,t=new URLSearchParams(r).get("token"),n=e.split("/").filter(Boolean),a=n.findIndex(c=>c==="portal"),s=a!==-1?n[a+1]:void 0;if(!t||!s)throw new Error("Not in context of Recharge Customer Portal or URL did not contain correct params");return{customerHash:s,token:t}}async function Al(){const{customerHash:e,token:r}=$l(),{environment:t,storefrontAccessToken:n,storeIdentifier:a}=be(),s=st(t),c={};n&&(c["X-Recharge-Storefront-Access-Token"]=n);const p=await le("post",`${s}/customers/${e}/access`,{headers:c,data:{token:r,shop:a}});return{apiToken:p.api_token,customerId:p.customer_id}}var El=Object.freeze({__proto__:null,loginShopifyAppProxy:gl,loginShopifyApi:vl,sendPasswordlessCode:ml,sendPasswordlessCodeAppProxy:_l,validatePasswordlessCode:wl,validatePasswordlessCodeAppProxy:bl,loginCustomerPortal:Al});let Sl=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((r,t)=>(t&=63,t<36?r+=t.toString(36):t<62?r+=(t-26).toString(36).toUpperCase():t>62?r+="-":r+="_",r),"");function xl(e,r){for(var t=-1,n=e==null?0:e.length,a=Array(n);++t<n;)a[t]=r(e[t],t,e);return a}var wo=xl;function Il(){this.__data__=[],this.size=0}var Tl=Il;function Ol(e,r){return e===r||e!==e&&r!==r}var bo=Ol,Bl=bo;function Pl(e,r){for(var t=e.length;t--;)if(Bl(e[t][0],r))return t;return-1}var lt=Pl,Rl=lt,Fl=Array.prototype,Cl=Fl.splice;function Ul(e){var r=this.__data__,t=Rl(r,e);if(t<0)return!1;var n=r.length-1;return t==n?r.pop():Cl.call(r,t,1),--this.size,!0}var Dl=Ul,Nl=lt;function Ll(e){var r=this.__data__,t=Nl(r,e);return t<0?void 0:r[t][1]}var Ml=Ll,jl=lt;function kl(e){return jl(this.__data__,e)>-1}var Gl=kl,Wl=lt;function ql(e,r){var t=this.__data__,n=Wl(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}var zl=ql,Vl=Tl,Hl=Dl,Yl=Ml,Kl=Gl,Xl=zl;function sr(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}sr.prototype.clear=Vl,sr.prototype.delete=Hl,sr.prototype.get=Yl,sr.prototype.has=Kl,sr.prototype.set=Xl;var pt=sr,Jl=pt;function Ql(){this.__data__=new Jl,this.size=0}var Zl=Ql;function ep(e){var r=this.__data__,t=r.delete(e);return this.size=r.size,t}var rp=ep;function tp(e){return this.__data__.get(e)}var np=tp;function ip(e){return this.__data__.has(e)}var op=ip,ap=typeof Ae=="object"&&Ae&&Ae.Object===Object&&Ae,$o=ap,sp=$o,up=typeof self=="object"&&self&&self.Object===Object&&self,cp=sp||up||Function("return this")(),oe=cp,fp=oe,lp=fp.Symbol,Br=lp,Ao=Br,Eo=Object.prototype,pp=Eo.hasOwnProperty,hp=Eo.toString,Pr=Ao?Ao.toStringTag:void 0;function dp(e){var r=pp.call(e,Pr),t=e[Pr];try{e[Pr]=void 0;var n=!0}catch{}var a=hp.call(e);return n&&(r?e[Pr]=t:delete e[Pr]),a}var yp=dp,gp=Object.prototype,vp=gp.toString;function mp(e){return vp.call(e)}var _p=mp,So=Br,wp=yp,bp=_p,$p="[object Null]",Ap="[object Undefined]",xo=So?So.toStringTag:void 0;function Ep(e){return e==null?e===void 0?Ap:$p:xo&&xo in Object(e)?wp(e):bp(e)}var ur=Ep;function Sp(e){var r=typeof e;return e!=null&&(r=="object"||r=="function")}var Ye=Sp,xp=ur,Ip=Ye,Tp="[object AsyncFunction]",Op="[object Function]",Bp="[object GeneratorFunction]",Pp="[object Proxy]";function Rp(e){if(!Ip(e))return!1;var r=xp(e);return r==Op||r==Bp||r==Tp||r==Pp}var Io=Rp,Fp=oe,Cp=Fp["__core-js_shared__"],Up=Cp,_n=Up,To=function(){var e=/[^.]+$/.exec(_n&&_n.keys&&_n.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function Dp(e){return!!To&&To in e}var Np=Dp,Lp=Function.prototype,Mp=Lp.toString;function jp(e){if(e!=null){try{return Mp.call(e)}catch{}try{return e+""}catch{}}return""}var Oo=jp,kp=Io,Gp=Np,Wp=Ye,qp=Oo,zp=/[\\^$.*+?()[\]{}|]/g,Vp=/^\[object .+?Constructor\]$/,Hp=Function.prototype,Yp=Object.prototype,Kp=Hp.toString,Xp=Yp.hasOwnProperty,Jp=RegExp("^"+Kp.call(Xp).replace(zp,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Qp(e){if(!Wp(e)||Gp(e))return!1;var r=kp(e)?Jp:Vp;return r.test(qp(e))}var Zp=Qp;function eh(e,r){return e?.[r]}var rh=eh,th=Zp,nh=rh;function ih(e,r){var t=nh(e,r);return th(t)?t:void 0}var Ke=ih,oh=Ke,ah=oe,sh=oh(ah,"Map"),wn=sh,uh=Ke,ch=uh(Object,"create"),ht=ch,Bo=ht;function fh(){this.__data__=Bo?Bo(null):{},this.size=0}var lh=fh;function ph(e){var r=this.has(e)&&delete this.__data__[e];return this.size-=r?1:0,r}var hh=ph,dh=ht,yh="__lodash_hash_undefined__",gh=Object.prototype,vh=gh.hasOwnProperty;function mh(e){var r=this.__data__;if(dh){var t=r[e];return t===yh?void 0:t}return vh.call(r,e)?r[e]:void 0}var _h=mh,wh=ht,bh=Object.prototype,$h=bh.hasOwnProperty;function Ah(e){var r=this.__data__;return wh?r[e]!==void 0:$h.call(r,e)}var Eh=Ah,Sh=ht,xh="__lodash_hash_undefined__";function Ih(e,r){var t=this.__data__;return this.size+=this.has(e)?0:1,t[e]=Sh&&r===void 0?xh:r,this}var Th=Ih,Oh=lh,Bh=hh,Ph=_h,Rh=Eh,Fh=Th;function cr(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}cr.prototype.clear=Oh,cr.prototype.delete=Bh,cr.prototype.get=Ph,cr.prototype.has=Rh,cr.prototype.set=Fh;var Ch=cr,Po=Ch,Uh=pt,Dh=wn;function Nh(){this.size=0,this.__data__={hash:new Po,map:new(Dh||Uh),string:new Po}}var Lh=Nh;function Mh(e){var r=typeof e;return r=="string"||r=="number"||r=="symbol"||r=="boolean"?e!=="__proto__":e===null}var jh=Mh,kh=jh;function Gh(e,r){var t=e.__data__;return kh(r)?t[typeof r=="string"?"string":"hash"]:t.map}var dt=Gh,Wh=dt;function qh(e){var r=Wh(this,e).delete(e);return this.size-=r?1:0,r}var zh=qh,Vh=dt;function Hh(e){return Vh(this,e).get(e)}var Yh=Hh,Kh=dt;function Xh(e){return Kh(this,e).has(e)}var Jh=Xh,Qh=dt;function Zh(e,r){var t=Qh(this,e),n=t.size;return t.set(e,r),this.size+=t.size==n?0:1,this}var ed=Zh,rd=Lh,td=zh,nd=Yh,id=Jh,od=ed;function fr(e){var r=-1,t=e==null?0:e.length;for(this.clear();++r<t;){var n=e[r];this.set(n[0],n[1])}}fr.prototype.clear=rd,fr.prototype.delete=td,fr.prototype.get=nd,fr.prototype.has=id,fr.prototype.set=od;var Ro=fr,ad=pt,sd=wn,ud=Ro,cd=200;function fd(e,r){var t=this.__data__;if(t instanceof ad){var n=t.__data__;if(!sd||n.length<cd-1)return n.push([e,r]),this.size=++t.size,this;t=this.__data__=new ud(n)}return t.set(e,r),this.size=t.size,this}var ld=fd,pd=pt,hd=Zl,dd=rp,yd=np,gd=op,vd=ld;function lr(e){var r=this.__data__=new pd(e);this.size=r.size}lr.prototype.clear=hd,lr.prototype.delete=dd,lr.prototype.get=yd,lr.prototype.has=gd,lr.prototype.set=vd;var md=lr;function _d(e,r){for(var t=-1,n=e==null?0:e.length;++t<n&&r(e[t],t,e)!==!1;);return e}var Fo=_d,wd=Ke,bd=function(){try{var e=wd(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Co=bd,Uo=Co;function $d(e,r,t){r=="__proto__"&&Uo?Uo(e,r,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[r]=t}var Do=$d,Ad=Do,Ed=bo,Sd=Object.prototype,xd=Sd.hasOwnProperty;function Id(e,r,t){var n=e[r];(!(xd.call(e,r)&&Ed(n,t))||t===void 0&&!(r in e))&&Ad(e,r,t)}var No=Id,Td=No,Od=Do;function Bd(e,r,t,n){var a=!t;t||(t={});for(var s=-1,c=r.length;++s<c;){var p=r[s],h=n?n(t[p],e[p],p,t,e):void 0;h===void 0&&(h=e[p]),a?Od(t,p,h):Td(t,p,h)}return t}var Rr=Bd;function Pd(e,r){for(var t=-1,n=Array(e);++t<e;)n[t]=r(t);return n}var Rd=Pd;function Fd(e){return e!=null&&typeof e=="object"}var Ue=Fd,Cd=ur,Ud=Ue,Dd="[object Arguments]";function Nd(e){return Ud(e)&&Cd(e)==Dd}var Ld=Nd,Lo=Ld,Md=Ue,Mo=Object.prototype,jd=Mo.hasOwnProperty,kd=Mo.propertyIsEnumerable,Gd=Lo(function(){return arguments}())?Lo:function(e){return Md(e)&&jd.call(e,"callee")&&!kd.call(e,"callee")},jo=Gd,Wd=Array.isArray,De=Wd,yt={exports:{}};function qd(){return!1}var zd=qd;(function(e,r){var t=oe,n=zd,a=r&&!r.nodeType&&r,s=a&&!0&&e&&!e.nodeType&&e,c=s&&s.exports===a,p=c?t.Buffer:void 0,h=p?p.isBuffer:void 0,v=h||n;e.exports=v})(yt,yt.exports);var Vd=9007199254740991,Hd=/^(?:0|[1-9]\d*)$/;function Yd(e,r){var t=typeof e;return r=r??Vd,!!r&&(t=="number"||t!="symbol"&&Hd.test(e))&&e>-1&&e%1==0&&e<r}var ko=Yd,Kd=9007199254740991;function Xd(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Kd}var Go=Xd,Jd=ur,Qd=Go,Zd=Ue,ey="[object Arguments]",ry="[object Array]",ty="[object Boolean]",ny="[object Date]",iy="[object Error]",oy="[object Function]",ay="[object Map]",sy="[object Number]",uy="[object Object]",cy="[object RegExp]",fy="[object Set]",ly="[object String]",py="[object WeakMap]",hy="[object ArrayBuffer]",dy="[object DataView]",yy="[object Float32Array]",gy="[object Float64Array]",vy="[object Int8Array]",my="[object Int16Array]",_y="[object Int32Array]",wy="[object Uint8Array]",by="[object Uint8ClampedArray]",$y="[object Uint16Array]",Ay="[object Uint32Array]",M={};M[yy]=M[gy]=M[vy]=M[my]=M[_y]=M[wy]=M[by]=M[$y]=M[Ay]=!0,M[ey]=M[ry]=M[hy]=M[ty]=M[dy]=M[ny]=M[iy]=M[oy]=M[ay]=M[sy]=M[uy]=M[cy]=M[fy]=M[ly]=M[py]=!1;function Ey(e){return Zd(e)&&Qd(e.length)&&!!M[Jd(e)]}var Sy=Ey;function xy(e){return function(r){return e(r)}}var bn=xy,Fr={exports:{}};(function(e,r){var t=$o,n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===n,c=s&&t.process,p=function(){try{var h=a&&a.require&&a.require("util").types;return h||c&&c.binding&&c.binding("util")}catch{}}();e.exports=p})(Fr,Fr.exports);var Iy=Sy,Ty=bn,Wo=Fr.exports,qo=Wo&&Wo.isTypedArray,Oy=qo?Ty(qo):Iy,By=Oy,Py=Rd,Ry=jo,Fy=De,Cy=yt.exports,Uy=ko,Dy=By,Ny=Object.prototype,Ly=Ny.hasOwnProperty;function My(e,r){var t=Fy(e),n=!t&&Ry(e),a=!t&&!n&&Cy(e),s=!t&&!n&&!a&&Dy(e),c=t||n||a||s,p=c?Py(e.length,String):[],h=p.length;for(var v in e)(r||Ly.call(e,v))&&!(c&&(v=="length"||a&&(v=="offset"||v=="parent")||s&&(v=="buffer"||v=="byteLength"||v=="byteOffset")||Uy(v,h)))&&p.push(v);return p}var zo=My,jy=Object.prototype;function ky(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||jy;return e===t}var $n=ky;function Gy(e,r){return function(t){return e(r(t))}}var Vo=Gy,Wy=Vo,qy=Wy(Object.keys,Object),zy=qy,Vy=$n,Hy=zy,Yy=Object.prototype,Ky=Yy.hasOwnProperty;function Xy(e){if(!Vy(e))return Hy(e);var r=[];for(var t in Object(e))Ky.call(e,t)&&t!="constructor"&&r.push(t);return r}var Jy=Xy,Qy=Io,Zy=Go;function eg(e){return e!=null&&Zy(e.length)&&!Qy(e)}var Ho=eg,rg=zo,tg=Jy,ng=Ho;function ig(e){return ng(e)?rg(e):tg(e)}var An=ig,og=Rr,ag=An;function sg(e,r){return e&&og(r,ag(r),e)}var ug=sg;function cg(e){var r=[];if(e!=null)for(var t in Object(e))r.push(t);return r}var fg=cg,lg=Ye,pg=$n,hg=fg,dg=Object.prototype,yg=dg.hasOwnProperty;function gg(e){if(!lg(e))return hg(e);var r=pg(e),t=[];for(var n in e)n=="constructor"&&(r||!yg.call(e,n))||t.push(n);return t}var vg=gg,mg=zo,_g=vg,wg=Ho;function bg(e){return wg(e)?mg(e,!0):_g(e)}var En=bg,$g=Rr,Ag=En;function Eg(e,r){return e&&$g(r,Ag(r),e)}var Sg=Eg,Sn={exports:{}};(function(e,r){var t=oe,n=r&&!r.nodeType&&r,a=n&&!0&&e&&!e.nodeType&&e,s=a&&a.exports===n,c=s?t.Buffer:void 0,p=c?c.allocUnsafe:void 0;function h(v,_){if(_)return v.slice();var w=v.length,b=p?p(w):new v.constructor(w);return v.copy(b),b}e.exports=h})(Sn,Sn.exports);function xg(e,r){var t=-1,n=e.length;for(r||(r=Array(n));++t<n;)r[t]=e[t];return r}var xn=xg;function Ig(e,r){for(var t=-1,n=e==null?0:e.length,a=0,s=[];++t<n;){var c=e[t];r(c,t,e)&&(s[a++]=c)}return s}var Tg=Ig;function Og(){return[]}var Yo=Og,Bg=Tg,Pg=Yo,Rg=Object.prototype,Fg=Rg.propertyIsEnumerable,Ko=Object.getOwnPropertySymbols,Cg=Ko?function(e){return e==null?[]:(e=Object(e),Bg(Ko(e),function(r){return Fg.call(e,r)}))}:Pg,In=Cg,Ug=Rr,Dg=In;function Ng(e,r){return Ug(e,Dg(e),r)}var Lg=Ng;function Mg(e,r){for(var t=-1,n=r.length,a=e.length;++t<n;)e[a+t]=r[t];return e}var Tn=Mg,jg=Vo,kg=jg(Object.getPrototypeOf,Object),On=kg,Gg=Tn,Wg=On,qg=In,zg=Yo,Vg=Object.getOwnPropertySymbols,Hg=Vg?function(e){for(var r=[];e;)Gg(r,qg(e)),e=Wg(e);return r}:zg,Xo=Hg,Yg=Rr,Kg=Xo;function Xg(e,r){return Yg(e,Kg(e),r)}var Jg=Xg,Qg=Tn,Zg=De;function ev(e,r,t){var n=r(e);return Zg(e)?n:Qg(n,t(e))}var Jo=ev,rv=Jo,tv=In,nv=An;function iv(e){return rv(e,nv,tv)}var ov=iv,av=Jo,sv=Xo,uv=En;function cv(e){return av(e,uv,sv)}var Qo=cv,fv=Ke,lv=oe,pv=fv(lv,"DataView"),hv=pv,dv=Ke,yv=oe,gv=dv(yv,"Promise"),vv=gv,mv=Ke,_v=oe,wv=mv(_v,"Set"),bv=wv,$v=Ke,Av=oe,Ev=$v(Av,"WeakMap"),Zo=Ev,Bn=hv,Pn=wn,Rn=vv,Fn=bv,Cn=Zo,ea=ur,pr=Oo,ra="[object Map]",Sv="[object Object]",ta="[object Promise]",na="[object Set]",ia="[object WeakMap]",oa="[object DataView]",xv=pr(Bn),Iv=pr(Pn),Tv=pr(Rn),Ov=pr(Fn),Bv=pr(Cn),Xe=ea;(Bn&&Xe(new Bn(new ArrayBuffer(1)))!=oa||Pn&&Xe(new Pn)!=ra||Rn&&Xe(Rn.resolve())!=ta||Fn&&Xe(new Fn)!=na||Cn&&Xe(new Cn)!=ia)&&(Xe=function(e){var r=ea(e),t=r==Sv?e.constructor:void 0,n=t?pr(t):"";if(n)switch(n){case xv:return oa;case Iv:return ra;case Tv:return ta;case Ov:return na;case Bv:return ia}return r});var Un=Xe,Pv=Object.prototype,Rv=Pv.hasOwnProperty;function Fv(e){var r=e.length,t=new e.constructor(r);return r&&typeof e[0]=="string"&&Rv.call(e,"index")&&(t.index=e.index,t.input=e.input),t}var Cv=Fv,Uv=oe,Dv=Uv.Uint8Array,Nv=Dv,aa=Nv;function Lv(e){var r=new e.constructor(e.byteLength);return new aa(r).set(new aa(e)),r}var Dn=Lv,Mv=Dn;function jv(e,r){var t=r?Mv(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.byteLength)}var kv=jv,Gv=/\w*$/;function Wv(e){var r=new e.constructor(e.source,Gv.exec(e));return r.lastIndex=e.lastIndex,r}var qv=Wv,sa=Br,ua=sa?sa.prototype:void 0,ca=ua?ua.valueOf:void 0;function zv(e){return ca?Object(ca.call(e)):{}}var Vv=zv,Hv=Dn;function Yv(e,r){var t=r?Hv(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}var Kv=Yv,Xv=Dn,Jv=kv,Qv=qv,Zv=Vv,e0=Kv,r0="[object Boolean]",t0="[object Date]",n0="[object Map]",i0="[object Number]",o0="[object RegExp]",a0="[object Set]",s0="[object String]",u0="[object Symbol]",c0="[object ArrayBuffer]",f0="[object DataView]",l0="[object Float32Array]",p0="[object Float64Array]",h0="[object Int8Array]",d0="[object Int16Array]",y0="[object Int32Array]",g0="[object Uint8Array]",v0="[object Uint8ClampedArray]",m0="[object Uint16Array]",_0="[object Uint32Array]";function w0(e,r,t){var n=e.constructor;switch(r){case c0:return Xv(e);case r0:case t0:return new n(+e);case f0:return Jv(e,t);case l0:case p0:case h0:case d0:case y0:case g0:case v0:case m0:case _0:return e0(e,t);case n0:return new n;case i0:case s0:return new n(e);case o0:return Qv(e);case a0:return new n;case u0:return Zv(e)}}var b0=w0,$0=Ye,fa=Object.create,A0=function(){function e(){}return function(r){if(!$0(r))return{};if(fa)return fa(r);e.prototype=r;var t=new e;return e.prototype=void 0,t}}(),gt=A0,E0=gt,S0=On,x0=$n;function I0(e){return typeof e.constructor=="function"&&!x0(e)?E0(S0(e)):{}}var T0=I0,O0=Un,B0=Ue,P0="[object Map]";function R0(e){return B0(e)&&O0(e)==P0}var F0=R0,C0=F0,U0=bn,la=Fr.exports,pa=la&&la.isMap,D0=pa?U0(pa):C0,N0=D0,L0=Un,M0=Ue,j0="[object Set]";function k0(e){return M0(e)&&L0(e)==j0}var G0=k0,W0=G0,q0=bn,ha=Fr.exports,da=ha&&ha.isSet,z0=da?q0(da):W0,V0=z0,H0=md,Y0=Fo,K0=No,X0=ug,J0=Sg,Q0=Sn.exports,Z0=xn,em=Lg,rm=Jg,tm=ov,nm=Qo,im=Un,om=Cv,am=b0,sm=T0,um=De,cm=yt.exports,fm=N0,lm=Ye,pm=V0,hm=An,dm=En,ym=1,gm=2,vm=4,ya="[object Arguments]",mm="[object Array]",_m="[object Boolean]",wm="[object Date]",bm="[object Error]",ga="[object Function]",$m="[object GeneratorFunction]",Am="[object Map]",Em="[object Number]",va="[object Object]",Sm="[object RegExp]",xm="[object Set]",Im="[object String]",Tm="[object Symbol]",Om="[object WeakMap]",Bm="[object ArrayBuffer]",Pm="[object DataView]",Rm="[object Float32Array]",Fm="[object Float64Array]",Cm="[object Int8Array]",Um="[object Int16Array]",Dm="[object Int32Array]",Nm="[object Uint8Array]",Lm="[object Uint8ClampedArray]",Mm="[object Uint16Array]",jm="[object Uint32Array]",L={};L[ya]=L[mm]=L[Bm]=L[Pm]=L[_m]=L[wm]=L[Rm]=L[Fm]=L[Cm]=L[Um]=L[Dm]=L[Am]=L[Em]=L[va]=L[Sm]=L[xm]=L[Im]=L[Tm]=L[Nm]=L[Lm]=L[Mm]=L[jm]=!0,L[bm]=L[ga]=L[Om]=!1;function vt(e,r,t,n,a,s){var c,p=r&ym,h=r&gm,v=r&vm;if(t&&(c=a?t(e,n,a,s):t(e)),c!==void 0)return c;if(!lm(e))return e;var _=um(e);if(_){if(c=om(e),!p)return Z0(e,c)}else{var w=im(e),b=w==ga||w==$m;if(cm(e))return Q0(e,p);if(w==va||w==ya||b&&!a){if(c=h||b?{}:sm(e),!p)return h?rm(e,J0(c,e)):em(e,X0(c,e))}else{if(!L[w])return a?e:{};c=am(e,w,p)}}s||(s=new H0);var d=s.get(e);if(d)return d;s.set(e,c),pm(e)?e.forEach(function(I){c.add(vt(I,r,t,I,e,s))}):fm(e)&&e.forEach(function(I,S){c.set(S,vt(I,r,t,S,e,s))});var E=v?h?nm:tm:h?dm:hm,x=_?void 0:E(e);return Y0(x||e,function(I,S){x&&(S=I,I=e[S]),K0(c,S,vt(I,r,t,S,e,s))}),c}var km=vt,Gm=ur,Wm=Ue,qm="[object Symbol]";function zm(e){return typeof e=="symbol"||Wm(e)&&Gm(e)==qm}var mt=zm,Vm=De,Hm=mt,Ym=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Km=/^\w*$/;function Xm(e,r){if(Vm(e))return!1;var t=typeof e;return t=="number"||t=="symbol"||t=="boolean"||e==null||Hm(e)?!0:Km.test(e)||!Ym.test(e)||r!=null&&e in Object(r)}var Jm=Xm,ma=Ro,Qm="Expected a function";function Nn(e,r){if(typeof e!="function"||r!=null&&typeof r!="function")throw new TypeError(Qm);var t=function(){var n=arguments,a=r?r.apply(this,n):n[0],s=t.cache;if(s.has(a))return s.get(a);var c=e.apply(this,n);return t.cache=s.set(a,c)||s,c};return t.cache=new(Nn.Cache||ma),t}Nn.Cache=ma;var Zm=Nn,e_=Zm,r_=500;function t_(e){var r=e_(e,function(n){return t.size===r_&&t.clear(),n}),t=r.cache;return r}var n_=t_,i_=n_,o_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,a_=/\\(\\)?/g,s_=i_(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(""),e.replace(o_,function(t,n,a,s){r.push(a?s.replace(a_,"$1"):n||t)}),r}),u_=s_,_a=Br,c_=wo,f_=De,l_=mt,p_=1/0,wa=_a?_a.prototype:void 0,ba=wa?wa.toString:void 0;function $a(e){if(typeof e=="string")return e;if(f_(e))return c_(e,$a)+"";if(l_(e))return ba?ba.call(e):"";var r=e+"";return r=="0"&&1/e==-p_?"-0":r}var h_=$a,d_=h_;function y_(e){return e==null?"":d_(e)}var g_=y_,v_=De,m_=Jm,__=u_,w_=g_;function b_(e,r){return v_(e)?e:m_(e,r)?[e]:__(w_(e))}var Ln=b_;function $_(e){var r=e==null?0:e.length;return r?e[r-1]:void 0}var A_=$_,E_=mt,S_=1/0;function x_(e){if(typeof e=="string"||E_(e))return e;var r=e+"";return r=="0"&&1/e==-S_?"-0":r}var Aa=x_,I_=Ln,T_=Aa;function O_(e,r){r=I_(r,e);for(var t=0,n=r.length;e!=null&&t<n;)e=e[T_(r[t++])];return t&&t==n?e:void 0}var B_=O_;function P_(e,r,t){var n=-1,a=e.length;r<0&&(r=-r>a?0:a+r),t=t>a?a:t,t<0&&(t+=a),a=r>t?0:t-r>>>0,r>>>=0;for(var s=Array(a);++n<a;)s[n]=e[n+r];return s}var R_=P_,F_=B_,C_=R_;function U_(e,r){return r.length<2?e:F_(e,C_(r,0,-1))}var D_=U_,N_=Ln,L_=A_,M_=D_,j_=Aa;function k_(e,r){return r=N_(r,e),e=M_(e,r),e==null||delete e[j_(L_(r))]}var G_=k_,W_=ur,q_=On,z_=Ue,V_="[object Object]",H_=Function.prototype,Y_=Object.prototype,Ea=H_.toString,K_=Y_.hasOwnProperty,X_=Ea.call(Object);function J_(e){if(!z_(e)||W_(e)!=V_)return!1;var r=q_(e);if(r===null)return!0;var t=K_.call(r,"constructor")&&r.constructor;return typeof t=="function"&&t instanceof t&&Ea.call(t)==X_}var Q_=J_,Z_=Q_;function ew(e){return Z_(e)?void 0:e}var rw=ew,Sa=Br,tw=jo,nw=De,xa=Sa?Sa.isConcatSpreadable:void 0;function iw(e){return nw(e)||tw(e)||!!(xa&&e&&e[xa])}var ow=iw,aw=Tn,sw=ow;function Ia(e,r,t,n,a){var s=-1,c=e.length;for(t||(t=sw),a||(a=[]);++s<c;){var p=e[s];r>0&&t(p)?r>1?Ia(p,r-1,t,n,a):aw(a,p):n||(a[a.length]=p)}return a}var uw=Ia,cw=uw;function fw(e){var r=e==null?0:e.length;return r?cw(e,1):[]}var lw=fw;function pw(e,r,t){switch(t.length){case 0:return e.call(r);case 1:return e.call(r,t[0]);case 2:return e.call(r,t[0],t[1]);case 3:return e.call(r,t[0],t[1],t[2])}return e.apply(r,t)}var Mn=pw,hw=Mn,Ta=Math.max;function dw(e,r,t){return r=Ta(r===void 0?e.length-1:r,0),function(){for(var n=arguments,a=-1,s=Ta(n.length-r,0),c=Array(s);++a<s;)c[a]=n[r+a];a=-1;for(var p=Array(r+1);++a<r;)p[a]=n[a];return p[r]=t(c),hw(e,this,p)}}var Oa=dw;function yw(e){return function(){return e}}var gw=yw;function vw(e){return e}var jn=vw,mw=gw,Ba=Co,_w=jn,ww=Ba?function(e,r){return Ba(e,"toString",{configurable:!0,enumerable:!1,value:mw(r),writable:!0})}:_w,bw=ww,$w=800,Aw=16,Ew=Date.now;function Sw(e){var r=0,t=0;return function(){var n=Ew(),a=Aw-(n-t);if(t=n,a>0){if(++r>=$w)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}var Pa=Sw,xw=bw,Iw=Pa,Tw=Iw(xw),kn=Tw,Ow=lw,Bw=Oa,Pw=kn;function Rw(e){return Pw(Bw(e,void 0,Ow),e+"")}var Fw=Rw,Cw=wo,Uw=km,Dw=G_,Nw=Ln,Lw=Rr,Mw=rw,jw=Fw,kw=Qo,Gw=1,Ww=2,qw=4,zw=jw(function(e,r){var t={};if(e==null)return t;var n=!1;r=Cw(r,function(s){return s=Nw(s,e),n||(n=s.length>1),s}),Lw(e,kw(e),t),n&&(t=Uw(t,Gw|Ww|qw,Mw));for(var a=r.length;a--;)Dw(t,r[a]);return t}),Gn=zw,Vw=Object.defineProperty,Hw=Object.defineProperties,Yw=Object.getOwnPropertyDescriptors,Ra=Object.getOwnPropertySymbols,Kw=Object.prototype.hasOwnProperty,Xw=Object.prototype.propertyIsEnumerable,Fa=(e,r,t)=>r in e?Vw(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Jw=(e,r)=>{for(var t in r||(r={}))Kw.call(r,t)&&Fa(e,t,r[t]);if(Ra)for(var t of Ra(r))Xw.call(r,t)&&Fa(e,t,r[t]);return e},Qw=(e,r)=>Hw(e,Yw(r));function Zw(e){try{return JSON.parse(e)}catch{return e}}function e1(e){return Object.entries(e).reduce((r,[t,n])=>Qw(Jw({},r),{[t]:Zw(n)}),{})}const Ca=e=>typeof e=="string"?e!=="0"&&e!=="false":!!e;var r1=Object.defineProperty,t1=Object.defineProperties,n1=Object.getOwnPropertyDescriptors,Ua=Object.getOwnPropertySymbols,i1=Object.prototype.hasOwnProperty,o1=Object.prototype.propertyIsEnumerable,Da=(e,r,t)=>r in e?r1(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Na=(e,r)=>{for(var t in r||(r={}))i1.call(r,t)&&Da(e,t,r[t]);if(Ua)for(var t of Ua(r))o1.call(r,t)&&Da(e,t,r[t]);return e},La=(e,r)=>t1(e,n1(r));function Ma(e){var r;const t=e1(e),n=t.auto_inject===void 0?!0:t.auto_inject,a=(r=t.display_on)!=null?r:[],s=t.first_option==="autodeliver";return La(Na({},Gn(t,["display_on","first_option"])),{auto_inject:n,valid_pages:a,is_subscription_first:s,autoInject:n,validPages:a,isSubscriptionFirst:s})}function ja(e){var r;const t=((r=e.subscription_options)==null?void 0:r.storefront_purchase_options)==="subscription_only";return La(Na({},e),{is_subscription_only:t,isSubscriptionOnly:t})}function a1(e){return e.map(r=>{const t={};return Object.entries(r).forEach(([n,a])=>{t[n]=ja(a)}),t})}const _t="2020-12",s1={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},Cr=new Map;function wt(e,r){return Cr.has(e)||Cr.set(e,r()),Cr.get(e)}async function Wn(e){const{product:r}=await wt(`product.${e}`,()=>ft("get",`/product/${_t}/${e}.json`));return ja(r)}async function ka(){return await wt("storeSettings",()=>ft("get",`/${_t}/store_settings.json`).catch(()=>s1))}async function Ga(){const{widget_settings:e}=await wt("widgetSettings",()=>ft("get",`/${_t}/widget_settings.json`));return Ma(e)}async function Wa(){const{products:e,widget_settings:r,store_settings:t,meta:n}=await wt("productsAndSettings",()=>ft("get",`/product/${_t}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:a1(e),widget_settings:Ma(r),store_settings:t??{}}}async function u1(){const{products:e}=await Wa();return e}async function c1(e){const[r,t,n]=await Promise.all([Wn(e),ka(),Ga()]);return{product:r,store_settings:t,widget_settings:n,storeSettings:t,widgetSettings:n}}async function qa(e){const{bundle_product:r}=await Wn(e);return r}async function za(){return Array.from(Cr.keys()).forEach(e=>Cr.delete(e))}var f1=Object.freeze({__proto__:null,getCDNProduct:Wn,getCDNStoreSettings:ka,getCDNWidgetSettings:Ga,getCDNProductsAndSettings:Wa,getCDNProducts:u1,getCDNProductAndSettings:c1,getCDNBundleSettings:qa,resetCDNCache:za}),Va={exports:{}};/*! For license information please see xdr.js.LICENSE.txt */(function(e,r){(function(t,n){e.exports=n()})(Ae,()=>(()=>{var t={899:(s,c,p)=>{const h=p(221);s.exports=h},221:(s,c,p)=>{p.r(c),p.d(c,{Array:()=>yr,Bool:()=>H,Double:()=>xt,Enum:()=>$e,Float:()=>Ne,Hyper:()=>k,Int:()=>V,Opaque:()=>Nr,Option:()=>Mr,Quadruple:()=>G,Reference:()=>te,String:()=>Dr,Struct:()=>Le,Union:()=>Oe,UnsignedHyper:()=>se,UnsignedInt:()=>N,VarArray:()=>Lr,VarOpaque:()=>Te,Void:()=>Q,config:()=>g});class h extends TypeError{constructor(o){super(`XDR Write Error: ${o}`)}}class v extends TypeError{constructor(o){super(`XDR Read Error: ${o}`)}}class _ extends TypeError{constructor(o){super(`XDR Type Definition Error: ${o}`)}}class w extends _{constructor(){super("method not implemented, it should be overloaded in the descendant class.")}}var b=p(764).lW;class d{constructor(o){if(!b.isBuffer(o)){if(!(o instanceof Array))throw new v("source not specified");o=b.from(o)}this._buffer=o,this._length=o.length,this._index=0}_buffer;_length;_index;get eof(){return this._index===this._length}advance(o){const l=this._index;if(this._index+=o,this._length<this._index)throw new v("attempt to read outside the boundary of the buffer");const m=4-(o%4||4);if(m>0){for(let A=0;A<m;A++)if(this._buffer[this._index+A]!==0)throw new v("invalid padding");this._index+=m}return l}rewind(){this._index=0}read(o){const l=this.advance(o);return this._buffer.subarray(l,l+o)}readInt32BE(){return this._buffer.readInt32BE(this.advance(4))}readUInt32BE(){return this._buffer.readUInt32BE(this.advance(4))}readBigInt64BE(){return this._buffer.readBigInt64BE(this.advance(8))}readBigUInt64BE(){return this._buffer.readBigUInt64BE(this.advance(8))}readFloatBE(){return this._buffer.readFloatBE(this.advance(4))}readDoubleBE(){return this._buffer.readDoubleBE(this.advance(8))}ensureInputConsumed(){if(this._index!==this._length)throw new v("invalid XDR contract typecast - source buffer not entirely consumed")}}var E=p(764).lW;const x=8192;class I{constructor(o){typeof o=="number"?o=E.allocUnsafe(o):o instanceof E||(o=E.allocUnsafe(x)),this._buffer=o,this._length=o.length}_buffer;_length;_index=0;alloc(o){const l=this._index;return this._index+=o,this._length<this._index&&this.resize(this._index),l}resize(o){const l=Math.ceil(o/x)*x,m=E.allocUnsafe(l);this._buffer.copy(m,0,0,this._length),this._buffer=m,this._length=l}finalize(){return this._buffer.subarray(0,this._index)}toArray(){return[...this.finalize()]}write(o,l){if(typeof o=="string"){const A=this.alloc(l);this._buffer.write(o,A,"utf8")}else{o instanceof E||(o=E.from(o));const A=this.alloc(l);o.copy(this._buffer,A,0,l)}const m=4-(l%4||4);if(m>0){const A=this.alloc(m);this._buffer.fill(0,A,this._index)}}writeInt32BE(o){const l=this.alloc(4);this._buffer.writeInt32BE(o,l)}writeUInt32BE(o){const l=this.alloc(4);this._buffer.writeUInt32BE(o,l)}writeBigInt64BE(o){const l=this.alloc(8);this._buffer.writeBigInt64BE(o,l)}writeBigUInt64BE(o){const l=this.alloc(8);this._buffer.writeBigUInt64BE(o,l)}writeFloatBE(o){const l=this.alloc(4);this._buffer.writeFloatBE(o,l)}writeDoubleBE(o){const l=this.alloc(8);this._buffer.writeDoubleBE(o,l)}static bufferChunkSize=x}var S=p(764).lW;class T{toXDR(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"raw";if(!this.write)return this.constructor.toXDR(this,o);const l=new I;return this.write(this,l),j(l.finalize(),o)}fromXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";if(!this.read)return this.constructor.fromXDR(o,l);const m=new d(q(o,l)),A=this.read(m);return m.ensureInputConsumed(),A}validateXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(o,l),!0}catch{return!1}}static toXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";const m=new I;return this.write(o,m),j(m.finalize(),l)}static fromXDR(o){const l=new d(q(o,arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw")),m=this.read(l);return l.ensureInputConsumed(),m}static validateXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(o,l),!0}catch{return!1}}}class P extends T{static read(o){throw new w}static write(o,l){throw new w}static isValid(o){return!1}}class B extends T{isValid(o){return!1}}class D extends TypeError{constructor(o){super(`Invalid format ${o}, must be one of "raw", "hex", "base64"`)}}function j(y,o){switch(o){case"raw":return y;case"hex":return y.toString("hex");case"base64":return y.toString("base64");default:throw new D(o)}}function q(y,o){switch(o){case"raw":return y;case"hex":return S.from(y,"hex");case"base64":return S.from(y,"base64");default:throw new D(o)}}const z=2147483647,X=-2147483648;class V extends P{static read(o){return o.readInt32BE()}static write(o,l){if(typeof o!="number")throw new h("not a number");if((0|o)!==o)throw new h("invalid i32 value");l.writeInt32BE(o)}static isValid(o){return typeof o=="number"&&(0|o)===o&&o>=X&&o<=z}}V.MAX_VALUE=z,V.MIN_VALUE=2147483648;const ae=-9223372036854775808n,ue=9223372036854775807n;class k extends P{constructor(o,l){if(super(),typeof o=="bigint"){if(o<ae||o>ue)throw new TypeError("Invalid i64 value");this._value=o}else{if((0|o)!==o||(0|l)!==l)throw new TypeError("Invalid i64 value");this._value=BigInt(l>>>0)<<32n|BigInt(o>>>0)}}get low(){return Number(0xFFFFFFFFn&this._value)<<0}get high(){return Number(this._value>>32n)>>0}get unsigned(){return!1}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}static read(o){return new k(o.readBigInt64BE())}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a Hyper`);l.writeBigInt64BE(o._value)}static fromString(o){if(!/^-?\d{0,19}$/.test(o))throw new TypeError(`Invalid i64 string value: ${o}`);return new k(BigInt(o))}static fromBits(o,l){return new this(o,l)}static isValid(o){return o instanceof this}}k.MAX_VALUE=new k(ue),k.MIN_VALUE=new k(ae);const re=4294967295;class N extends P{static read(o){return o.readUInt32BE()}static write(o,l){if(typeof o!="number"||!(o>=0&&o<=re)||o%1!=0)throw new h("invalid u32 value");l.writeUInt32BE(o)}static isValid(o){return typeof o=="number"&&o%1==0&&o>=0&&o<=re}}N.MAX_VALUE=re,N.MIN_VALUE=0;const ce=0n,hr=0xFFFFFFFFFFFFFFFFn;class se extends P{constructor(o,l){if(super(),typeof o=="bigint"){if(o<ce||o>hr)throw new TypeError("Invalid u64 value");this._value=o}else{if((0|o)!==o||(0|l)!==l)throw new TypeError("Invalid u64 value");this._value=BigInt(l>>>0)<<32n|BigInt(o>>>0)}}get low(){return Number(0xFFFFFFFFn&this._value)<<0}get high(){return Number(this._value>>32n)>>0}get unsigned(){return!0}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}static read(o){return new se(o.readBigUInt64BE())}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not an UnsignedHyper`);l.writeBigUInt64BE(o._value)}static fromString(o){if(!/^\d{0,20}$/.test(o))throw new TypeError(`Invalid u64 string value: ${o}`);return new se(BigInt(o))}static fromBits(o,l){return new this(o,l)}static isValid(o){return o instanceof this}}se.MAX_VALUE=new se(hr),se.MIN_VALUE=new se(ce);class Ne extends P{static read(o){return o.readFloatBE()}static write(o,l){if(typeof o!="number")throw new h("not a number");l.writeFloatBE(o)}static isValid(o){return typeof o=="number"}}class xt extends P{static read(o){return o.readDoubleBE()}static write(o,l){if(typeof o!="number")throw new h("not a number");l.writeDoubleBE(o)}static isValid(o){return typeof o=="number"}}class G extends P{static read(){throw new _("quadruple not supported")}static write(){throw new _("quadruple not supported")}static isValid(){return!1}}class H extends P{static read(o){const l=V.read(o);switch(l){case 0:return!1;case 1:return!0;default:throw new v(`got ${l} when trying to read a bool`)}}static write(o,l){const m=o?1:0;V.write(m,l)}static isValid(o){return typeof o=="boolean"}}var dr=p(764).lW;class Dr extends B{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N.MAX_VALUE;super(),this._maxLength=o}read(o){const l=N.read(o);if(l>this._maxLength)throw new v(`saw ${l} length String, max allowed is ${this._maxLength}`);return o.read(l)}readString(o){return this.read(o).toString("utf8")}write(o,l){const m=typeof o=="string"?dr.byteLength(o,"utf8"):o.length;if(m>this._maxLength)throw new h(`got ${o.length} bytes, max allowed is ${this._maxLength}`);N.write(m,l),l.write(o,m)}isValid(o){return typeof o=="string"?dr.byteLength(o,"utf8")<=this._maxLength:!!(o instanceof Array||dr.isBuffer(o))&&o.length<=this._maxLength}}var It=p(764).lW;class Nr extends B{constructor(o){super(),this._length=o}read(o){return o.read(this._length)}write(o,l){const{length:m}=o;if(m!==this._length)throw new h(`got ${o.length} bytes, expected ${this._length}`);l.write(o,m)}isValid(o){return It.isBuffer(o)&&o.length===this._length}}var Tt=p(764).lW;class Te extends B{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N.MAX_VALUE;super(),this._maxLength=o}read(o){const l=N.read(o);if(l>this._maxLength)throw new v(`saw ${l} length VarOpaque, max allowed is ${this._maxLength}`);return o.read(l)}write(o,l){const{length:m}=o;if(o.length>this._maxLength)throw new h(`got ${o.length} bytes, max allowed is ${this._maxLength}`);N.write(m,l),l.write(o,m)}isValid(o){return Tt.isBuffer(o)&&o.length<=this._maxLength}}class yr extends B{constructor(o,l){super(),this._childType=o,this._length=l}read(o){const l=new p.g.Array(this._length);for(let m=0;m<this._length;m++)l[m]=this._childType.read(o);return l}write(o,l){if(!(o instanceof p.g.Array))throw new h("value is not array");if(o.length!==this._length)throw new h(`got array of size ${o.length}, expected ${this._length}`);for(const m of o)this._childType.write(m,l)}isValid(o){if(!(o instanceof p.g.Array)||o.length!==this._length)return!1;for(const l of o)if(!this._childType.isValid(l))return!1;return!0}}class Lr extends B{constructor(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:N.MAX_VALUE;super(),this._childType=o,this._maxLength=l}read(o){const l=N.read(o);if(l>this._maxLength)throw new v(`saw ${l} length VarArray, max allowed is ${this._maxLength}`);const m=new Array(l);for(let A=0;A<l;A++)m[A]=this._childType.read(o);return m}write(o,l){if(!(o instanceof Array))throw new h("value is not array");if(o.length>this._maxLength)throw new h(`got array of size ${o.length}, max allowed is ${this._maxLength}`);N.write(o.length,l);for(const m of o)this._childType.write(m,l)}isValid(o){if(!(o instanceof Array)||o.length>this._maxLength)return!1;for(const l of o)if(!this._childType.isValid(l))return!1;return!0}}class Mr extends P{constructor(o){super(),this._childType=o}read(o){if(H.read(o))return this._childType.read(o)}write(o,l){const m=o!=null;H.write(m,l),m&&this._childType.write(o,l)}isValid(o){return o==null||this._childType.isValid(o)}}class Q extends P{static read(){}static write(o){if(o!==void 0)throw new h("trying to write value to a void slot")}static isValid(o){return o===void 0}}class $e extends P{constructor(o,l){super(),this.name=o,this.value=l}static read(o){const l=V.read(o),m=this._byValue[l];if(m===void 0)throw new v(`unknown ${this.enumName} member for value ${l}`);return m}static write(o,l){if(!(o instanceof this))throw new h(`unknown ${o} is not a ${this.enumName}`);V.write(o.value,l)}static isValid(o){return o instanceof this}static members(){return this._members}static values(){return Object.values(this._members)}static fromName(o){const l=this._members[o];if(!l)throw new TypeError(`${o} is not a member of ${this.enumName}`);return l}static fromValue(o){const l=this._byValue[o];if(l===void 0)throw new TypeError(`${o} is not a value of any member of ${this.enumName}`);return l}static create(o,l,m){const A=class extends $e{};A.enumName=l,o.results[l]=A,A._members={},A._byValue={};for(const[F,R]of Object.entries(m)){const C=new A(F,R);A._members[F]=C,A._byValue[R]=C,A[F]=()=>C}return A}}class te extends P{resolve(){throw new _('"resolve" method should be implemented in the descendant class')}}class Le extends P{constructor(o){super(),this._attributes=o||{}}static read(o){const l={};for(const[m,A]of this._fields)l[m]=A.read(o);return new this(l)}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a ${this.structName}`);for(const[m,A]of this._fields){const F=o._attributes[m];A.write(F,l)}}static isValid(o){return o instanceof this}static create(o,l,m){const A=class extends Le{};A.structName=l,o.results[l]=A;const F=new Array(m.length);for(let R=0;R<m.length;R++){const C=m[R],jr=C[0];let Bt=C[1];Bt instanceof te&&(Bt=Bt.resolve(o)),F[R]=[jr,Bt],A.prototype[jr]=Ot(jr)}return A._fields=F,A}}function Ot(y){return function(o){return o!==void 0&&(this._attributes[y]=o),this._attributes[y]}}class Oe extends B{constructor(o,l){super(),this.set(o,l)}set(o,l){typeof o=="string"&&(o=this.constructor._switchOn.fromName(o)),this._switch=o;const m=this.constructor.armForSwitch(this._switch);this._arm=m,this._armType=m===Q?Q:this.constructor._arms[m],this._value=l}get(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._arm;if(this._arm!==Q&&this._arm!==o)throw new TypeError(`${o} not set`);return this._value}switch(){return this._switch}arm(){return this._arm}armType(){return this._armType}value(){return this._value}static armForSwitch(o){const l=this._switches.get(o);if(l!==void 0)return l;if(this._defaultArm)return this._defaultArm;throw new TypeError(`Bad union switch: ${o}`)}static armTypeForArm(o){return o===Q?Q:this._arms[o]}static read(o){const l=this._switchOn.read(o),m=this.armForSwitch(l),A=m===Q?Q:this._arms[m];let F;return F=A!==void 0?A.read(o):m.read(o),new this(l,F)}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a ${this.unionName}`);this._switchOn.write(o.switch(),l),o.armType().write(o.value(),l)}static isValid(o){return o instanceof this}static create(o,l,m){const A=class extends Oe{};A.unionName=l,o.results[l]=A,m.switchOn instanceof te?A._switchOn=m.switchOn.resolve(o):A._switchOn=m.switchOn,A._switches=new Map,A._arms={};let F=m.defaultArm;F instanceof te&&(F=F.resolve(o)),A._defaultArm=F;for(const[R,C]of m.switches){const jr=typeof R=="string"?A._switchOn.fromName(R):R;A._switches.set(jr,C)}if(A._switchOn.values!==void 0)for(const R of A._switchOn.values())A[R.name]=function(C){return new A(R,C)},A.prototype[R.name]=function(C){return this.set(R,C)};if(m.arms)for(const[R,C]of Object.entries(m.arms))A._arms[R]=C instanceof te?C.resolve(o):C,C!==Q&&(A.prototype[R]=function(){return this.get(R)});return A}}class pe extends te{constructor(o){super(),this.name=o}resolve(o){return o.definitions[this.name].resolve(o)}}class gr extends te{constructor(o,l){let m=arguments.length>2&&arguments[2]!==void 0&&arguments[2];super(),this.childReference=o,this.length=l,this.variable=m}resolve(o){let l=this.childReference,m=this.length;return l instanceof te&&(l=l.resolve(o)),m instanceof te&&(m=m.resolve(o)),this.variable?new Lr(l,m):new yr(l,m)}}class Qn extends te{constructor(o){super(),this.childReference=o,this.name=o.name}resolve(o){let l=this.childReference;return l instanceof te&&(l=l.resolve(o)),new Mr(l)}}class he extends te{constructor(o,l){super(),this.sizedType=o,this.length=l}resolve(o){let l=this.length;return l instanceof te&&(l=l.resolve(o)),new this.sizedType(l)}}class Je{constructor(o,l,m){this.constructor=o,this.name=l,this.config=m}resolve(o){return this.name in o.results?o.results[this.name]:this.constructor(o,this.name,this.config)}}function i(y,o,l){return l instanceof te&&(l=l.resolve(y)),y.results[o]=l,l}function u(y,o,l){return y.results[o]=l,l}class f{constructor(o){this._destination=o,this._definitions={}}enum(o,l){const m=new Je($e.create,o,l);this.define(o,m)}struct(o,l){const m=new Je(Le.create,o,l);this.define(o,m)}union(o,l){const m=new Je(Oe.create,o,l);this.define(o,m)}typedef(o,l){const m=new Je(i,o,l);this.define(o,m)}const(o,l){const m=new Je(u,o,l);this.define(o,m)}void(){return Q}bool(){return H}int(){return V}hyper(){return k}uint(){return N}uhyper(){return se}float(){return Ne}double(){return xt}quadruple(){return G}string(o){return new he(Dr,o)}opaque(o){return new he(Nr,o)}varOpaque(o){return new he(Te,o)}array(o,l){return new gr(o,l)}varArray(o,l){return new gr(o,l,!0)}option(o){return new Qn(o)}define(o,l){if(this._destination[o]!==void 0)throw new _(`${o} is already defined`);this._definitions[o]=l}lookup(o){return new pe(o)}resolve(){for(const o of Object.values(this._definitions))o.resolve({definitions:this._definitions,results:this._destination})}}function g(y){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(y){const l=new f(o);y(l),l.resolve()}return o}},742:(s,c)=>{c.byteLength=function(E){var x=b(E),I=x[0],S=x[1];return 3*(I+S)/4-S},c.toByteArray=function(E){var x,I,S=b(E),T=S[0],P=S[1],B=new v(function(q,z,X){return 3*(z+X)/4-X}(0,T,P)),D=0,j=P>0?T-4:T;for(I=0;I<j;I+=4)x=h[E.charCodeAt(I)]<<18|h[E.charCodeAt(I+1)]<<12|h[E.charCodeAt(I+2)]<<6|h[E.charCodeAt(I+3)],B[D++]=x>>16&255,B[D++]=x>>8&255,B[D++]=255&x;return P===2&&(x=h[E.charCodeAt(I)]<<2|h[E.charCodeAt(I+1)]>>4,B[D++]=255&x),P===1&&(x=h[E.charCodeAt(I)]<<10|h[E.charCodeAt(I+1)]<<4|h[E.charCodeAt(I+2)]>>2,B[D++]=x>>8&255,B[D++]=255&x),B},c.fromByteArray=function(E){for(var x,I=E.length,S=I%3,T=[],P=16383,B=0,D=I-S;B<D;B+=P)T.push(d(E,B,B+P>D?D:B+P));return S===1?(x=E[I-1],T.push(p[x>>2]+p[x<<4&63]+"==")):S===2&&(x=(E[I-2]<<8)+E[I-1],T.push(p[x>>10]+p[x>>4&63]+p[x<<2&63]+"=")),T.join("")};for(var p=[],h=[],v=typeof Uint8Array<"u"?Uint8Array:Array,_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",w=0;w<64;++w)p[w]=_[w],h[_.charCodeAt(w)]=w;function b(E){var x=E.length;if(x%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=E.indexOf("=");return I===-1&&(I=x),[I,I===x?0:4-I%4]}function d(E,x,I){for(var S,T,P=[],B=x;B<I;B+=3)S=(E[B]<<16&16711680)+(E[B+1]<<8&65280)+(255&E[B+2]),P.push(p[(T=S)>>18&63]+p[T>>12&63]+p[T>>6&63]+p[63&T]);return P.join("")}h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},764:(s,c,p)=>{const h=p(742),v=p(645),_=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;c.lW=d,c.h2=50;const w=2147483647;function b(i){if(i>w)throw new RangeError('The value "'+i+'" is invalid for option "size"');const u=new Uint8Array(i);return Object.setPrototypeOf(u,d.prototype),u}function d(i,u,f){if(typeof i=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return I(i)}return E(i,u,f)}function E(i,u,f){if(typeof i=="string")return function(o,l){if(typeof l=="string"&&l!==""||(l="utf8"),!d.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const m=0|B(o,l);let A=b(m);const F=A.write(o,l);return F!==m&&(A=A.slice(0,F)),A}(i,u);if(ArrayBuffer.isView(i))return function(o){if(pe(o,Uint8Array)){const l=new Uint8Array(o);return T(l.buffer,l.byteOffset,l.byteLength)}return S(o)}(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(pe(i,ArrayBuffer)||i&&pe(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(pe(i,SharedArrayBuffer)||i&&pe(i.buffer,SharedArrayBuffer)))return T(i,u,f);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const g=i.valueOf&&i.valueOf();if(g!=null&&g!==i)return d.from(g,u,f);const y=function(o){if(d.isBuffer(o)){const l=0|P(o.length),m=b(l);return m.length===0||o.copy(m,0,0,l),m}if(o.length!==void 0)return typeof o.length!="number"||gr(o.length)?b(0):S(o);if(o.type==="Buffer"&&Array.isArray(o.data))return S(o.data)}(i);if(y)return y;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return d.from(i[Symbol.toPrimitive]("string"),u,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}function x(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function I(i){return x(i),b(i<0?0:0|P(i))}function S(i){const u=i.length<0?0:0|P(i.length),f=b(u);for(let g=0;g<u;g+=1)f[g]=255&i[g];return f}function T(i,u,f){if(u<0||i.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<u+(f||0))throw new RangeError('"length" is outside of buffer bounds');let g;return g=u===void 0&&f===void 0?new Uint8Array(i):f===void 0?new Uint8Array(i,u):new Uint8Array(i,u,f),Object.setPrototypeOf(g,d.prototype),g}function P(i){if(i>=w)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+w.toString(16)+" bytes");return 0|i}function B(i,u){if(d.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||pe(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);const f=i.length,g=arguments.length>2&&arguments[2]===!0;if(!g&&f===0)return 0;let y=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return Le(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*f;case"hex":return f>>>1;case"base64":return Ot(i).length;default:if(y)return g?-1:Le(i).length;u=(""+u).toLowerCase(),y=!0}}function D(i,u,f){let g=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0)<=(u>>>=0))return"";for(i||(i="utf8");;)switch(i){case"hex":return Ne(this,u,f);case"utf8":case"utf-8":return N(this,u,f);case"ascii":return hr(this,u,f);case"latin1":case"binary":return se(this,u,f);case"base64":return re(this,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xt(this,u,f);default:if(g)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),g=!0}}function j(i,u,f){const g=i[u];i[u]=i[f],i[f]=g}function q(i,u,f,g,y){if(i.length===0)return-1;if(typeof f=="string"?(g=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),gr(f=+f)&&(f=y?0:i.length-1),f<0&&(f=i.length+f),f>=i.length){if(y)return-1;f=i.length-1}else if(f<0){if(!y)return-1;f=0}if(typeof u=="string"&&(u=d.from(u,g)),d.isBuffer(u))return u.length===0?-1:z(i,u,f,g,y);if(typeof u=="number")return u&=255,typeof Uint8Array.prototype.indexOf=="function"?y?Uint8Array.prototype.indexOf.call(i,u,f):Uint8Array.prototype.lastIndexOf.call(i,u,f):z(i,[u],f,g,y);throw new TypeError("val must be string, number or Buffer")}function z(i,u,f,g,y){let o,l=1,m=i.length,A=u.length;if(g!==void 0&&((g=String(g).toLowerCase())==="ucs2"||g==="ucs-2"||g==="utf16le"||g==="utf-16le")){if(i.length<2||u.length<2)return-1;l=2,m/=2,A/=2,f/=2}function F(R,C){return l===1?R[C]:R.readUInt16BE(C*l)}if(y){let R=-1;for(o=f;o<m;o++)if(F(i,o)===F(u,R===-1?0:o-R)){if(R===-1&&(R=o),o-R+1===A)return R*l}else R!==-1&&(o-=o-R),R=-1}else for(f+A>m&&(f=m-A),o=f;o>=0;o--){let R=!0;for(let C=0;C<A;C++)if(F(i,o+C)!==F(u,C)){R=!1;break}if(R)return o}return-1}function X(i,u,f,g){f=Number(f)||0;const y=i.length-f;g?(g=Number(g))>y&&(g=y):g=y;const o=u.length;let l;for(g>o/2&&(g=o/2),l=0;l<g;++l){const m=parseInt(u.substr(2*l,2),16);if(gr(m))return l;i[f+l]=m}return l}function V(i,u,f,g){return Oe(Le(u,i.length-f),i,f,g)}function ae(i,u,f,g){return Oe(function(y){const o=[];for(let l=0;l<y.length;++l)o.push(255&y.charCodeAt(l));return o}(u),i,f,g)}function ue(i,u,f,g){return Oe(Ot(u),i,f,g)}function k(i,u,f,g){return Oe(function(y,o){let l,m,A;const F=[];for(let R=0;R<y.length&&!((o-=2)<0);++R)l=y.charCodeAt(R),m=l>>8,A=l%256,F.push(A),F.push(m);return F}(u,i.length-f),i,f,g)}function re(i,u,f){return u===0&&f===i.length?h.fromByteArray(i):h.fromByteArray(i.slice(u,f))}function N(i,u,f){f=Math.min(i.length,f);const g=[];let y=u;for(;y<f;){const o=i[y];let l=null,m=o>239?4:o>223?3:o>191?2:1;if(y+m<=f){let A,F,R,C;switch(m){case 1:o<128&&(l=o);break;case 2:A=i[y+1],(192&A)==128&&(C=(31&o)<<6|63&A,C>127&&(l=C));break;case 3:A=i[y+1],F=i[y+2],(192&A)==128&&(192&F)==128&&(C=(15&o)<<12|(63&A)<<6|63&F,C>2047&&(C<55296||C>57343)&&(l=C));break;case 4:A=i[y+1],F=i[y+2],R=i[y+3],(192&A)==128&&(192&F)==128&&(192&R)==128&&(C=(15&o)<<18|(63&A)<<12|(63&F)<<6|63&R,C>65535&&C<1114112&&(l=C))}}l===null?(l=65533,m=1):l>65535&&(l-=65536,g.push(l>>>10&1023|55296),l=56320|1023&l),g.push(l),y+=m}return function(o){const l=o.length;if(l<=ce)return String.fromCharCode.apply(String,o);let m="",A=0;for(;A<l;)m+=String.fromCharCode.apply(String,o.slice(A,A+=ce));return m}(g)}d.TYPED_ARRAY_SUPPORT=function(){try{const i=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(i,u),i.foo()===42}catch{return!1}}(),d.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}}),d.poolSize=8192,d.from=function(i,u,f){return E(i,u,f)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array),d.alloc=function(i,u,f){return function(g,y,o){return x(g),g<=0?b(g):y!==void 0?typeof o=="string"?b(g).fill(y,o):b(g).fill(y):b(g)}(i,u,f)},d.allocUnsafe=function(i){return I(i)},d.allocUnsafeSlow=function(i){return I(i)},d.isBuffer=function(i){return i!=null&&i._isBuffer===!0&&i!==d.prototype},d.compare=function(i,u){if(pe(i,Uint8Array)&&(i=d.from(i,i.offset,i.byteLength)),pe(u,Uint8Array)&&(u=d.from(u,u.offset,u.byteLength)),!d.isBuffer(i)||!d.isBuffer(u))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(i===u)return 0;let f=i.length,g=u.length;for(let y=0,o=Math.min(f,g);y<o;++y)if(i[y]!==u[y]){f=i[y],g=u[y];break}return f<g?-1:g<f?1:0},d.isEncoding=function(i){switch(String(i).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(i,u){if(!Array.isArray(i))throw new TypeError('"list" argument must be an Array of Buffers');if(i.length===0)return d.alloc(0);let f;if(u===void 0)for(u=0,f=0;f<i.length;++f)u+=i[f].length;const g=d.allocUnsafe(u);let y=0;for(f=0;f<i.length;++f){let o=i[f];if(pe(o,Uint8Array))y+o.length>g.length?(d.isBuffer(o)||(o=d.from(o)),o.copy(g,y)):Uint8Array.prototype.set.call(g,o,y);else{if(!d.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(g,y)}y+=o.length}return g},d.byteLength=B,d.prototype._isBuffer=!0,d.prototype.swap16=function(){const i=this.length;if(i%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let u=0;u<i;u+=2)j(this,u,u+1);return this},d.prototype.swap32=function(){const i=this.length;if(i%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let u=0;u<i;u+=4)j(this,u,u+3),j(this,u+1,u+2);return this},d.prototype.swap64=function(){const i=this.length;if(i%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let u=0;u<i;u+=8)j(this,u,u+7),j(this,u+1,u+6),j(this,u+2,u+5),j(this,u+3,u+4);return this},d.prototype.toString=function(){const i=this.length;return i===0?"":arguments.length===0?N(this,0,i):D.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(i){if(!d.isBuffer(i))throw new TypeError("Argument must be a Buffer");return this===i||d.compare(this,i)===0},d.prototype.inspect=function(){let i="";const u=c.h2;return i=this.toString("hex",0,u).replace(/(.{2})/g,"$1 ").trim(),this.length>u&&(i+=" ... "),"<Buffer "+i+">"},_&&(d.prototype[_]=d.prototype.inspect),d.prototype.compare=function(i,u,f,g,y){if(pe(i,Uint8Array)&&(i=d.from(i,i.offset,i.byteLength)),!d.isBuffer(i))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof i);if(u===void 0&&(u=0),f===void 0&&(f=i?i.length:0),g===void 0&&(g=0),y===void 0&&(y=this.length),u<0||f>i.length||g<0||y>this.length)throw new RangeError("out of range index");if(g>=y&&u>=f)return 0;if(g>=y)return-1;if(u>=f)return 1;if(this===i)return 0;let o=(y>>>=0)-(g>>>=0),l=(f>>>=0)-(u>>>=0);const m=Math.min(o,l),A=this.slice(g,y),F=i.slice(u,f);for(let R=0;R<m;++R)if(A[R]!==F[R]){o=A[R],l=F[R];break}return o<l?-1:l<o?1:0},d.prototype.includes=function(i,u,f){return this.indexOf(i,u,f)!==-1},d.prototype.indexOf=function(i,u,f){return q(this,i,u,f,!0)},d.prototype.lastIndexOf=function(i,u,f){return q(this,i,u,f,!1)},d.prototype.write=function(i,u,f,g){if(u===void 0)g="utf8",f=this.length,u=0;else if(f===void 0&&typeof u=="string")g=u,f=this.length,u=0;else{if(!isFinite(u))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");u>>>=0,isFinite(f)?(f>>>=0,g===void 0&&(g="utf8")):(g=f,f=void 0)}const y=this.length-u;if((f===void 0||f>y)&&(f=y),i.length>0&&(f<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");g||(g="utf8");let o=!1;for(;;)switch(g){case"hex":return X(this,i,u,f);case"utf8":case"utf-8":return V(this,i,u,f);case"ascii":case"latin1":case"binary":return ae(this,i,u,f);case"base64":return ue(this,i,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,i,u,f);default:if(o)throw new TypeError("Unknown encoding: "+g);g=(""+g).toLowerCase(),o=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const ce=4096;function hr(i,u,f){let g="";f=Math.min(i.length,f);for(let y=u;y<f;++y)g+=String.fromCharCode(127&i[y]);return g}function se(i,u,f){let g="";f=Math.min(i.length,f);for(let y=u;y<f;++y)g+=String.fromCharCode(i[y]);return g}function Ne(i,u,f){const g=i.length;(!u||u<0)&&(u=0),(!f||f<0||f>g)&&(f=g);let y="";for(let o=u;o<f;++o)y+=Qn[i[o]];return y}function xt(i,u,f){const g=i.slice(u,f);let y="";for(let o=0;o<g.length-1;o+=2)y+=String.fromCharCode(g[o]+256*g[o+1]);return y}function G(i,u,f){if(i%1!=0||i<0)throw new RangeError("offset is not uint");if(i+u>f)throw new RangeError("Trying to access beyond buffer length")}function H(i,u,f,g,y,o){if(!d.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>y||u<o)throw new RangeError('"value" argument is out of bounds');if(f+g>i.length)throw new RangeError("Index out of range")}function dr(i,u,f,g,y){Mr(u,g,y,i,f,7);let o=Number(u&BigInt(4294967295));i[f++]=o,o>>=8,i[f++]=o,o>>=8,i[f++]=o,o>>=8,i[f++]=o;let l=Number(u>>BigInt(32)&BigInt(4294967295));return i[f++]=l,l>>=8,i[f++]=l,l>>=8,i[f++]=l,l>>=8,i[f++]=l,f}function Dr(i,u,f,g,y){Mr(u,g,y,i,f,7);let o=Number(u&BigInt(4294967295));i[f+7]=o,o>>=8,i[f+6]=o,o>>=8,i[f+5]=o,o>>=8,i[f+4]=o;let l=Number(u>>BigInt(32)&BigInt(4294967295));return i[f+3]=l,l>>=8,i[f+2]=l,l>>=8,i[f+1]=l,l>>=8,i[f]=l,f+8}function It(i,u,f,g,y,o){if(f+g>i.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function Nr(i,u,f,g,y){return u=+u,f>>>=0,y||It(i,0,f,4),v.write(i,u,f,g,23,4),f+4}function Tt(i,u,f,g,y){return u=+u,f>>>=0,y||It(i,0,f,8),v.write(i,u,f,g,52,8),f+8}d.prototype.slice=function(i,u){const f=this.length;(i=~~i)<0?(i+=f)<0&&(i=0):i>f&&(i=f),(u=u===void 0?f:~~u)<0?(u+=f)<0&&(u=0):u>f&&(u=f),u<i&&(u=i);const g=this.subarray(i,u);return Object.setPrototypeOf(g,d.prototype),g},d.prototype.readUintLE=d.prototype.readUIntLE=function(i,u,f){i>>>=0,u>>>=0,f||G(i,u,this.length);let g=this[i],y=1,o=0;for(;++o<u&&(y*=256);)g+=this[i+o]*y;return g},d.prototype.readUintBE=d.prototype.readUIntBE=function(i,u,f){i>>>=0,u>>>=0,f||G(i,u,this.length);let g=this[i+--u],y=1;for(;u>0&&(y*=256);)g+=this[i+--u]*y;return g},d.prototype.readUint8=d.prototype.readUInt8=function(i,u){return i>>>=0,u||G(i,1,this.length),this[i]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(i,u){return i>>>=0,u||G(i,2,this.length),this[i]|this[i+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(i,u){return i>>>=0,u||G(i,2,this.length),this[i]<<8|this[i+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(i,u){return i>>>=0,u||G(i,4,this.length),(this[i]|this[i+1]<<8|this[i+2]<<16)+16777216*this[i+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(i,u){return i>>>=0,u||G(i,4,this.length),16777216*this[i]+(this[i+1]<<16|this[i+2]<<8|this[i+3])},d.prototype.readBigUInt64LE=he(function(i){Q(i>>>=0,"offset");const u=this[i],f=this[i+7];u!==void 0&&f!==void 0||$e(i,this.length-8);const g=u+256*this[++i]+65536*this[++i]+this[++i]*2**24,y=this[++i]+256*this[++i]+65536*this[++i]+f*2**24;return BigInt(g)+(BigInt(y)<<BigInt(32))}),d.prototype.readBigUInt64BE=he(function(i){Q(i>>>=0,"offset");const u=this[i],f=this[i+7];u!==void 0&&f!==void 0||$e(i,this.length-8);const g=u*2**24+65536*this[++i]+256*this[++i]+this[++i],y=this[++i]*2**24+65536*this[++i]+256*this[++i]+f;return(BigInt(g)<<BigInt(32))+BigInt(y)}),d.prototype.readIntLE=function(i,u,f){i>>>=0,u>>>=0,f||G(i,u,this.length);let g=this[i],y=1,o=0;for(;++o<u&&(y*=256);)g+=this[i+o]*y;return y*=128,g>=y&&(g-=Math.pow(2,8*u)),g},d.prototype.readIntBE=function(i,u,f){i>>>=0,u>>>=0,f||G(i,u,this.length);let g=u,y=1,o=this[i+--g];for(;g>0&&(y*=256);)o+=this[i+--g]*y;return y*=128,o>=y&&(o-=Math.pow(2,8*u)),o},d.prototype.readInt8=function(i,u){return i>>>=0,u||G(i,1,this.length),128&this[i]?-1*(255-this[i]+1):this[i]},d.prototype.readInt16LE=function(i,u){i>>>=0,u||G(i,2,this.length);const f=this[i]|this[i+1]<<8;return 32768&f?4294901760|f:f},d.prototype.readInt16BE=function(i,u){i>>>=0,u||G(i,2,this.length);const f=this[i+1]|this[i]<<8;return 32768&f?4294901760|f:f},d.prototype.readInt32LE=function(i,u){return i>>>=0,u||G(i,4,this.length),this[i]|this[i+1]<<8|this[i+2]<<16|this[i+3]<<24},d.prototype.readInt32BE=function(i,u){return i>>>=0,u||G(i,4,this.length),this[i]<<24|this[i+1]<<16|this[i+2]<<8|this[i+3]},d.prototype.readBigInt64LE=he(function(i){Q(i>>>=0,"offset");const u=this[i],f=this[i+7];u!==void 0&&f!==void 0||$e(i,this.length-8);const g=this[i+4]+256*this[i+5]+65536*this[i+6]+(f<<24);return(BigInt(g)<<BigInt(32))+BigInt(u+256*this[++i]+65536*this[++i]+this[++i]*16777216)}),d.prototype.readBigInt64BE=he(function(i){Q(i>>>=0,"offset");const u=this[i],f=this[i+7];u!==void 0&&f!==void 0||$e(i,this.length-8);const g=(u<<24)+65536*this[++i]+256*this[++i]+this[++i];return(BigInt(g)<<BigInt(32))+BigInt(this[++i]*16777216+65536*this[++i]+256*this[++i]+f)}),d.prototype.readFloatLE=function(i,u){return i>>>=0,u||G(i,4,this.length),v.read(this,i,!0,23,4)},d.prototype.readFloatBE=function(i,u){return i>>>=0,u||G(i,4,this.length),v.read(this,i,!1,23,4)},d.prototype.readDoubleLE=function(i,u){return i>>>=0,u||G(i,8,this.length),v.read(this,i,!0,52,8)},d.prototype.readDoubleBE=function(i,u){return i>>>=0,u||G(i,8,this.length),v.read(this,i,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(i,u,f,g){i=+i,u>>>=0,f>>>=0,!g&&H(this,i,u,f,Math.pow(2,8*f)-1,0);let y=1,o=0;for(this[u]=255&i;++o<f&&(y*=256);)this[u+o]=i/y&255;return u+f},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(i,u,f,g){i=+i,u>>>=0,f>>>=0,!g&&H(this,i,u,f,Math.pow(2,8*f)-1,0);let y=f-1,o=1;for(this[u+y]=255&i;--y>=0&&(o*=256);)this[u+y]=i/o&255;return u+f},d.prototype.writeUint8=d.prototype.writeUInt8=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,1,255,0),this[u]=255&i,u+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,2,65535,0),this[u]=255&i,this[u+1]=i>>>8,u+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,2,65535,0),this[u]=i>>>8,this[u+1]=255&i,u+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,4,4294967295,0),this[u+3]=i>>>24,this[u+2]=i>>>16,this[u+1]=i>>>8,this[u]=255&i,u+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,4,4294967295,0),this[u]=i>>>24,this[u+1]=i>>>16,this[u+2]=i>>>8,this[u+3]=255&i,u+4},d.prototype.writeBigUInt64LE=he(function(i,u=0){return dr(this,i,u,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeBigUInt64BE=he(function(i,u=0){return Dr(this,i,u,BigInt(0),BigInt("0xffffffffffffffff"))}),d.prototype.writeIntLE=function(i,u,f,g){if(i=+i,u>>>=0,!g){const m=Math.pow(2,8*f-1);H(this,i,u,f,m-1,-m)}let y=0,o=1,l=0;for(this[u]=255&i;++y<f&&(o*=256);)i<0&&l===0&&this[u+y-1]!==0&&(l=1),this[u+y]=(i/o>>0)-l&255;return u+f},d.prototype.writeIntBE=function(i,u,f,g){if(i=+i,u>>>=0,!g){const m=Math.pow(2,8*f-1);H(this,i,u,f,m-1,-m)}let y=f-1,o=1,l=0;for(this[u+y]=255&i;--y>=0&&(o*=256);)i<0&&l===0&&this[u+y+1]!==0&&(l=1),this[u+y]=(i/o>>0)-l&255;return u+f},d.prototype.writeInt8=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,1,127,-128),i<0&&(i=255+i+1),this[u]=255&i,u+1},d.prototype.writeInt16LE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,2,32767,-32768),this[u]=255&i,this[u+1]=i>>>8,u+2},d.prototype.writeInt16BE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,2,32767,-32768),this[u]=i>>>8,this[u+1]=255&i,u+2},d.prototype.writeInt32LE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,4,2147483647,-2147483648),this[u]=255&i,this[u+1]=i>>>8,this[u+2]=i>>>16,this[u+3]=i>>>24,u+4},d.prototype.writeInt32BE=function(i,u,f){return i=+i,u>>>=0,f||H(this,i,u,4,2147483647,-2147483648),i<0&&(i=4294967295+i+1),this[u]=i>>>24,this[u+1]=i>>>16,this[u+2]=i>>>8,this[u+3]=255&i,u+4},d.prototype.writeBigInt64LE=he(function(i,u=0){return dr(this,i,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeBigInt64BE=he(function(i,u=0){return Dr(this,i,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),d.prototype.writeFloatLE=function(i,u,f){return Nr(this,i,u,!0,f)},d.prototype.writeFloatBE=function(i,u,f){return Nr(this,i,u,!1,f)},d.prototype.writeDoubleLE=function(i,u,f){return Tt(this,i,u,!0,f)},d.prototype.writeDoubleBE=function(i,u,f){return Tt(this,i,u,!1,f)},d.prototype.copy=function(i,u,f,g){if(!d.isBuffer(i))throw new TypeError("argument should be a Buffer");if(f||(f=0),g||g===0||(g=this.length),u>=i.length&&(u=i.length),u||(u=0),g>0&&g<f&&(g=f),g===f||i.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(f<0||f>=this.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("sourceEnd out of bounds");g>this.length&&(g=this.length),i.length-u<g-f&&(g=i.length-u+f);const y=g-f;return this===i&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(u,f,g):Uint8Array.prototype.set.call(i,this.subarray(f,g),u),y},d.prototype.fill=function(i,u,f,g){if(typeof i=="string"){if(typeof u=="string"?(g=u,u=0,f=this.length):typeof f=="string"&&(g=f,f=this.length),g!==void 0&&typeof g!="string")throw new TypeError("encoding must be a string");if(typeof g=="string"&&!d.isEncoding(g))throw new TypeError("Unknown encoding: "+g);if(i.length===1){const o=i.charCodeAt(0);(g==="utf8"&&o<128||g==="latin1")&&(i=o)}}else typeof i=="number"?i&=255:typeof i=="boolean"&&(i=Number(i));if(u<0||this.length<u||this.length<f)throw new RangeError("Out of range index");if(f<=u)return this;let y;if(u>>>=0,f=f===void 0?this.length:f>>>0,i||(i=0),typeof i=="number")for(y=u;y<f;++y)this[y]=i;else{const o=d.isBuffer(i)?i:d.from(i,g),l=o.length;if(l===0)throw new TypeError('The value "'+i+'" is invalid for argument "value"');for(y=0;y<f-u;++y)this[y+u]=o[y%l]}return this};const Te={};function yr(i,u,f){Te[i]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${i}]`,this.stack,delete this.name}get code(){return i}set code(g){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:g,writable:!0})}toString(){return`${this.name} [${i}]: ${this.message}`}}}function Lr(i){let u="",f=i.length;const g=i[0]==="-"?1:0;for(;f>=g+4;f-=3)u=`_${i.slice(f-3,f)}${u}`;return`${i.slice(0,f)}${u}`}function Mr(i,u,f,g,y,o){if(i>f||i<u){const l=typeof u=="bigint"?"n":"";let m;throw m=o>3?u===0||u===BigInt(0)?`>= 0${l} and < 2${l} ** ${8*(o+1)}${l}`:`>= -(2${l} ** ${8*(o+1)-1}${l}) and < 2 ** ${8*(o+1)-1}${l}`:`>= ${u}${l} and <= ${f}${l}`,new Te.ERR_OUT_OF_RANGE("value",m,i)}(function(l,m,A){Q(m,"offset"),l[m]!==void 0&&l[m+A]!==void 0||$e(m,l.length-(A+1))})(g,y,o)}function Q(i,u){if(typeof i!="number")throw new Te.ERR_INVALID_ARG_TYPE(u,"number",i)}function $e(i,u,f){throw Math.floor(i)!==i?(Q(i,f),new Te.ERR_OUT_OF_RANGE(f||"offset","an integer",i)):u<0?new Te.ERR_BUFFER_OUT_OF_BOUNDS:new Te.ERR_OUT_OF_RANGE(f||"offset",`>= ${f?1:0} and <= ${u}`,i)}yr("ERR_BUFFER_OUT_OF_BOUNDS",function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),yr("ERR_INVALID_ARG_TYPE",function(i,u){return`The "${i}" argument must be of type number. Received type ${typeof u}`},TypeError),yr("ERR_OUT_OF_RANGE",function(i,u,f){let g=`The value of "${i}" is out of range.`,y=f;return Number.isInteger(f)&&Math.abs(f)>4294967296?y=Lr(String(f)):typeof f=="bigint"&&(y=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(y=Lr(y)),y+="n"),g+=` It must be ${u}. Received ${y}`,g},RangeError);const te=/[^+/0-9A-Za-z-_]/g;function Le(i,u){let f;u=u||1/0;const g=i.length;let y=null;const o=[];for(let l=0;l<g;++l){if(f=i.charCodeAt(l),f>55295&&f<57344){if(!y){if(f>56319){(u-=3)>-1&&o.push(239,191,189);continue}if(l+1===g){(u-=3)>-1&&o.push(239,191,189);continue}y=f;continue}if(f<56320){(u-=3)>-1&&o.push(239,191,189),y=f;continue}f=65536+(y-55296<<10|f-56320)}else y&&(u-=3)>-1&&o.push(239,191,189);if(y=null,f<128){if((u-=1)<0)break;o.push(f)}else if(f<2048){if((u-=2)<0)break;o.push(f>>6|192,63&f|128)}else if(f<65536){if((u-=3)<0)break;o.push(f>>12|224,f>>6&63|128,63&f|128)}else{if(!(f<1114112))throw new Error("Invalid code point");if((u-=4)<0)break;o.push(f>>18|240,f>>12&63|128,f>>6&63|128,63&f|128)}}return o}function Ot(i){return h.toByteArray(function(u){if((u=(u=u.split("=")[0]).trim().replace(te,"")).length<2)return"";for(;u.length%4!=0;)u+="=";return u}(i))}function Oe(i,u,f,g){let y;for(y=0;y<g&&!(y+f>=u.length||y>=i.length);++y)u[y+f]=i[y];return y}function pe(i,u){return i instanceof u||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===u.name}function gr(i){return i!=i}const Qn=function(){const i="0123456789abcdef",u=new Array(256);for(let f=0;f<16;++f){const g=16*f;for(let y=0;y<16;++y)u[g+y]=i[f]+i[y]}return u}();function he(i){return typeof BigInt>"u"?Je:i}function Je(){throw new Error("BigInt not supported")}},645:(s,c)=>{c.read=function(p,h,v,_,w){var b,d,E=8*w-_-1,x=(1<<E)-1,I=x>>1,S=-7,T=v?w-1:0,P=v?-1:1,B=p[h+T];for(T+=P,b=B&(1<<-S)-1,B>>=-S,S+=E;S>0;b=256*b+p[h+T],T+=P,S-=8);for(d=b&(1<<-S)-1,b>>=-S,S+=_;S>0;d=256*d+p[h+T],T+=P,S-=8);if(b===0)b=1-I;else{if(b===x)return d?NaN:1/0*(B?-1:1);d+=Math.pow(2,_),b-=I}return(B?-1:1)*d*Math.pow(2,b-_)},c.write=function(p,h,v,_,w,b){var d,E,x,I=8*b-w-1,S=(1<<I)-1,T=S>>1,P=w===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=_?0:b-1,D=_?1:-1,j=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(E=isNaN(h)?1:0,d=S):(d=Math.floor(Math.log(h)/Math.LN2),h*(x=Math.pow(2,-d))<1&&(d--,x*=2),(h+=d+T>=1?P/x:P*Math.pow(2,1-T))*x>=2&&(d++,x/=2),d+T>=S?(E=0,d=S):d+T>=1?(E=(h*x-1)*Math.pow(2,w),d+=T):(E=h*Math.pow(2,T-1)*Math.pow(2,w),d=0));w>=8;p[v+B]=255&E,B+=D,E/=256,w-=8);for(d=d<<w|E,I+=w;I>0;p[v+B]=255&d,B+=D,d/=256,I-=8);p[v+B-D]|=128*j}}},n={};function a(s){var c=n[s];if(c!==void 0)return c.exports;var p=n[s]={exports:{}};return t[s](p,p.exports,a),p.exports}return a.d=(s,c)=>{for(var p in c)a.o(c,p)&&!a.o(s,p)&&Object.defineProperty(s,p,{enumerable:!0,get:c[p]})},a.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),a.o=(s,c)=>Object.prototype.hasOwnProperty.call(s,c),a.r=s=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},a(899)})())})(Va);function l1(e){const r={variantId:Ie.Uint64.fromString(e.variantId.toString()),version:e.version||Math.floor(Date.now()/1e3),items:e.items.map(n=>new Ie.BundleItem({collectionId:Ie.Uint64.fromString(n.collectionId.toString()),productId:Ie.Uint64.fromString(n.productId.toString()),variantId:Ie.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new Ie.BundleItemExt(0)})),ext:new Ie.BundleExt(0)},t=new Ie.Bundle(r);return Ie.BundleEnvelope.envelopeTypeBundle(t).toXDR("base64")}const Ie=Va.exports.config(e=>{e.enum("EnvelopeType",{envelopeTypeBundle:0}),e.typedef("Uint32",e.uint()),e.typedef("Uint64",e.uhyper()),e.union("BundleItemExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("BundleItem",[["collectionId",e.lookup("Uint64")],["productId",e.lookup("Uint64")],["variantId",e.lookup("Uint64")],["sku",e.string()],["quantity",e.lookup("Uint32")],["ext",e.lookup("BundleItemExt")]]),e.union("BundleExt",{switchOn:e.int(),switchName:"v",switches:[[0,e.void()]],arms:{}}),e.struct("Bundle",[["variantId",e.lookup("Uint64")],["items",e.varArray(e.lookup("BundleItem"),500)],["version",e.lookup("Uint32")],["ext",e.lookup("BundleExt")]]),e.union("BundleEnvelope",{switchOn:e.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeBundle","v1"]],arms:{v1:e.lookup("Bundle")}})}),Ha="/bundling-storefront-manager";function p1(){return Math.ceil(Date.now()/1e3)}async function h1(){try{const{timestamp:e}=await Or("get",`${Ha}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return e}catch(e){return console.error(`Fetch failed: ${e}. Using client-side date.`),p1()}}async function d1(e){const r=be(),t=await Ya(e);if(t!==!0)throw new Error(t);const n=await h1(),a=l1({variantId:e.externalVariantId,version:n,items:e.selections.map(s=>({collectionId:s.collectionId,productId:s.externalProductId,variantId:s.externalVariantId,quantity:s.quantity,sku:""}))});try{const s=await Or("post",`${Ha}/api/v1/bundles`,{data:{bundle:a},headers:{Origin:`https://${r.storeIdentifier}`}});if(!s.id||s.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(s)}`);return s.id}catch(s){throw new Error(`2: failed generating rb_id ${s}`)}}function y1(e,r){const t=Ka(e);if(t!==!0)throw new Error(`Dynamic Bundle is invalid. ${t}`);const n=`${Sl(9)}:${e.externalProductId}`;return e.selections.map(a=>{const s={id:a.externalVariantId,quantity:a.quantity,properties:{_rc_bundle:n,_rc_bundle_variant:e.externalVariantId,_rc_bundle_parent:r,_rc_bundle_collection_id:a.collectionId}};return a.sellingPlan?s.selling_plan=a.sellingPlan:a.shippingIntervalFrequency&&(s.properties.shipping_interval_frequency=a.shippingIntervalFrequency,s.properties.shipping_interval_unit_type=a.shippingIntervalUnitType,s.id=`${a.discountedVariantId}`),s})}async function Ya(e){try{return e?await qa(e.externalProductId)?!0:"Bundle settings do not exist for the given product":"Bundle is not defined"}catch(r){return`Error fetching bundle settings: ${r}`}}const g1={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 Ka(e){if(!e)return"No bundle defined.";if(e.selections.length===0)return"No selections defined.";const{shippingIntervalFrequency:r,shippingIntervalUnitType:t}=e.selections.find(n=>n.shippingIntervalFrequency||n.shippingIntervalUnitType)||{};if(r||t){if(!r||!t)return"Shipping intervals do not match on selections.";{const n=g1[t];for(let a=0;a<e.selections.length;a++){const{shippingIntervalFrequency:s,shippingIntervalUnitType:c}=e.selections[a];if(s&&s!==r||c&&!n.includes(c))return"Shipping intervals do not match on selections."}}}return!0}async function v1(e,r){const{bundle_selection:t}=await O("get","/bundle_selections",{id:r},e);return t}function m1(e,r){return O("get","/bundle_selections",{query:r},e)}async function _1(e,r){const{bundle_selection:t}=await O("post","/bundle_selections",{data:r},e);return t}async function w1(e,r,t){const{bundle_selection:n}=await O("put","/bundle_selections",{id:r,data:t},e);return n}function b1(e,r){return O("delete","/bundle_selections",{id:r},e)}async function $1(e,r,t){const{subscription:n}=await O("put","/bundles",{id:r,data:t},e);return n}var A1=Object.freeze({__proto__:null,getBundleId:d1,getDynamicBundleItems:y1,validateBundle:Ya,validateDynamicBundle:Ka,getBundleSelection:v1,listBundleSelections:m1,createBundleSelection:_1,updateBundleSelection:w1,deleteBundleSelection:b1,updateBundle:$1});async function E1(e,r,t){const{charge:n}=await O("get","/charges",{id:r,query:{include:t?.include}},e);return n}function S1(e,r){return O("get","/charges",{query:r},e)}async function x1(e,r,t){const{charge:n}=await O("post",`/charges/${r}/apply_discount`,{data:{discount_code:t}},e);return n}async function I1(e,r){const{charge:t}=await O("post",`/charges/${r}/remove_discount`,{},e);return t}async function T1(e,r,t){const{charge:n}=await O("post",`/charges/${r}/skip`,{data:{purchase_item_ids:t.map(a=>Number(a))}},e);return n}async function O1(e,r,t){const{charge:n}=await O("post",`/charges/${r}/unskip`,{data:{purchase_item_ids:t.map(a=>Number(a))}},e);return n}async function B1(e,r){const{charge:t}=await O("post",`/charges/${r}/process`,{},e);return t}var P1=Object.freeze({__proto__:null,getCharge:E1,listCharges:S1,applyDiscountToCharge:x1,removeDiscountsFromCharge:I1,skipCharge:T1,unskipCharge:O1,processCharge:B1});async function R1(e,r){const{membership:t}=await O("get","/memberships",{id:r},e);return t}function F1(e,r){return O("get","/memberships",{query:r},e)}async function C1(e,r,t){const{membership:n}=await O("post",`/memberships/${r}/cancel`,{data:t},e);return n}async function U1(e,r,t){const{membership:n}=await O("post",`/memberships/${r}/activate`,{data:t},e);return n}async function D1(e,r,t){const{membership:n}=await O("post",`/memberships/${r}/change`,{data:t},e);return n}var N1=Object.freeze({__proto__:null,getMembership:R1,listMemberships:F1,cancelMembership:C1,activateMembership:U1,changeMembership:D1});async function L1(e,r,t){const{membership_program:n}=await O("get","/membership_programs",{id:r,query:{include:t?.include}},e);return n}function M1(e,r){return O("get","/membership_programs",{query:r},e)}var j1=Object.freeze({__proto__:null,getMembershipProgram:L1,listMembershipPrograms:M1});async function k1(e,r){const{metafield:t}=await O("post","/metafields",{data:{metafield:r}},e);return t}async function G1(e,r,t){const{metafield:n}=await O("put","/metafields",{id:r,data:{metafield:t}},e);return n}function W1(e,r){return O("delete","/metafields",{id:r},e)}var q1=Object.freeze({__proto__:null,createMetafield:k1,updateMetafield:G1,deleteMetafield:W1});async function z1(e,r){const{onetime:t}=await O("get","/onetimes",{id:r},e);return t}function V1(e,r){return O("get","/onetimes",{query:r},e)}async function H1(e,r){const{onetime:t}=await O("post","/onetimes",{data:r},e);return t}async function Y1(e,r,t){const{onetime:n}=await O("put","/onetimes",{id:r,data:t},e);return n}function K1(e,r){return O("delete","/onetimes",{id:r},e)}var X1=Object.freeze({__proto__:null,getOnetime:z1,listOnetimes:V1,createOnetime:H1,updateOnetime:Y1,deleteOnetime:K1});async function J1(e,r){const{order:t}=await O("get","/orders",{id:r},e);return t}function Q1(e,r){return O("get","/orders",{query:r},e)}var Z1=Object.freeze({__proto__:null,getOrder:J1,listOrders:Q1});async function eb(e,r,t){const{payment_method:n}=await O("get","/payment_methods",{id:r,query:{include:t?.include}},e);return n}async function rb(e,r,t){const{payment_method:n}=await O("put","/payment_methods",{id:r,data:t},e);return n}function tb(e,r){return O("get","/payment_methods",{query:r},e)}var nb=Object.freeze({__proto__:null,getPaymentMethod:eb,updatePaymentMethod:rb,listPaymentMethods:tb});async function ib(e,r){const{plan:t}=await O("get","/plans",{id:r},e);return t}function ob(e,r){return O("get","/plans",{query:r},e)}var ab=Object.freeze({__proto__:null,getPlan:ib,listPlans:ob}),sb=jn,ub=Oa,cb=kn;function fb(e,r){return cb(ub(e,r,sb),e+"")}var lb=fb,Xa=Zo,pb=Xa&&new Xa,Ja=pb,hb=jn,Qa=Ja,db=Qa?function(e,r){return Qa.set(e,r),e}:hb,Za=db,yb=gt,gb=Ye;function vb(e){return function(){var r=arguments;switch(r.length){case 0:return new e;case 1:return new e(r[0]);case 2:return new e(r[0],r[1]);case 3:return new e(r[0],r[1],r[2]);case 4:return new e(r[0],r[1],r[2],r[3]);case 5:return new e(r[0],r[1],r[2],r[3],r[4]);case 6:return new e(r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return new e(r[0],r[1],r[2],r[3],r[4],r[5],r[6])}var t=yb(e.prototype),n=e.apply(t,r);return gb(n)?n:t}}var bt=vb,mb=bt,_b=oe,wb=1;function bb(e,r,t){var n=r&wb,a=mb(e);function s(){var c=this&&this!==_b&&this instanceof s?a:e;return c.apply(n?t:this,arguments)}return s}var $b=bb,Ab=Math.max;function Eb(e,r,t,n){for(var a=-1,s=e.length,c=t.length,p=-1,h=r.length,v=Ab(s-c,0),_=Array(h+v),w=!n;++p<h;)_[p]=r[p];for(;++a<c;)(w||a<s)&&(_[t[a]]=e[a]);for(;v--;)_[p++]=e[a++];return _}var es=Eb,Sb=Math.max;function xb(e,r,t,n){for(var a=-1,s=e.length,c=-1,p=t.length,h=-1,v=r.length,_=Sb(s-p,0),w=Array(_+v),b=!n;++a<_;)w[a]=e[a];for(var d=a;++h<v;)w[d+h]=r[h];for(;++c<p;)(b||a<s)&&(w[d+t[c]]=e[a++]);return w}var rs=xb;function Ib(e,r){for(var t=e.length,n=0;t--;)e[t]===r&&++n;return n}var Tb=Ib;function Ob(){}var qn=Ob,Bb=gt,Pb=qn,Rb=4294967295;function $t(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Rb,this.__views__=[]}$t.prototype=Bb(Pb.prototype),$t.prototype.constructor=$t;var zn=$t;function Fb(){}var Cb=Fb,ts=Ja,Ub=Cb,Db=ts?function(e){return ts.get(e)}:Ub,ns=Db,Nb={},Lb=Nb,is=Lb,Mb=Object.prototype,jb=Mb.hasOwnProperty;function kb(e){for(var r=e.name+"",t=is[r],n=jb.call(is,r)?t.length:0;n--;){var a=t[n],s=a.func;if(s==null||s==e)return a.name}return r}var Gb=kb,Wb=gt,qb=qn;function At(e,r){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=void 0}At.prototype=Wb(qb.prototype),At.prototype.constructor=At;var os=At,zb=zn,Vb=os,Hb=xn;function Yb(e){if(e instanceof zb)return e.clone();var r=new Vb(e.__wrapped__,e.__chain__);return r.__actions__=Hb(e.__actions__),r.__index__=e.__index__,r.__values__=e.__values__,r}var Kb=Yb,Xb=zn,as=os,Jb=qn,Qb=De,Zb=Ue,e$=Kb,r$=Object.prototype,t$=r$.hasOwnProperty;function Et(e){if(Zb(e)&&!Qb(e)&&!(e instanceof Xb)){if(e instanceof as)return e;if(t$.call(e,"__wrapped__"))return e$(e)}return new as(e)}Et.prototype=Jb.prototype,Et.prototype.constructor=Et;var n$=Et,i$=zn,o$=ns,a$=Gb,s$=n$;function u$(e){var r=a$(e),t=s$[r];if(typeof t!="function"||!(r in i$.prototype))return!1;if(e===t)return!0;var n=o$(t);return!!n&&e===n[0]}var c$=u$,f$=Za,l$=Pa,p$=l$(f$),ss=p$,h$=/\{\n\/\* \[wrapped with (.+)\] \*/,d$=/,? & /;function y$(e){var r=e.match(h$);return r?r[1].split(d$):[]}var g$=y$,v$=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function m$(e,r){var t=r.length;if(!t)return e;var n=t-1;return r[n]=(t>1?"& ":"")+r[n],r=r.join(t>2?", ":" "),e.replace(v$,`{
21
- /* [wrapped with `+r+`] */
22
- `)}var _$=m$;function w$(e,r,t,n){for(var a=e.length,s=t+(n?1:-1);n?s--:++s<a;)if(r(e[s],s,e))return s;return-1}var b$=w$;function $$(e){return e!==e}var A$=$$;function E$(e,r,t){for(var n=t-1,a=e.length;++n<a;)if(e[n]===r)return n;return-1}var S$=E$,x$=b$,I$=A$,T$=S$;function O$(e,r,t){return r===r?T$(e,r,t):x$(e,I$,t)}var B$=O$,P$=B$;function R$(e,r){var t=e==null?0:e.length;return!!t&&P$(e,r,0)>-1}var F$=R$,C$=Fo,U$=F$,D$=1,N$=2,L$=8,M$=16,j$=32,k$=64,G$=128,W$=256,q$=512,z$=[["ary",G$],["bind",D$],["bindKey",N$],["curry",L$],["curryRight",M$],["flip",q$],["partial",j$],["partialRight",k$],["rearg",W$]];function V$(e,r){return C$(z$,function(t){var n="_."+t[0];r&t[1]&&!U$(e,n)&&e.push(n)}),e.sort()}var H$=V$,Y$=g$,K$=_$,X$=kn,J$=H$;function Q$(e,r,t){var n=r+"";return X$(e,K$(n,J$(Y$(n),t)))}var us=Q$,Z$=c$,eA=ss,rA=us,tA=1,nA=2,iA=4,oA=8,cs=32,fs=64;function aA(e,r,t,n,a,s,c,p,h,v){var _=r&oA,w=_?c:void 0,b=_?void 0:c,d=_?s:void 0,E=_?void 0:s;r|=_?cs:fs,r&=~(_?fs:cs),r&iA||(r&=~(tA|nA));var x=[e,r,a,d,w,E,b,p,h,v],I=t.apply(void 0,x);return Z$(e)&&eA(I,x),I.placeholder=n,rA(I,e,r)}var ls=aA;function sA(e){var r=e;return r.placeholder}var Vn=sA,uA=xn,cA=ko,fA=Math.min;function lA(e,r){for(var t=e.length,n=fA(r.length,t),a=uA(e);n--;){var s=r[n];e[n]=cA(s,t)?a[s]:void 0}return e}var pA=lA,ps="__lodash_placeholder__";function hA(e,r){for(var t=-1,n=e.length,a=0,s=[];++t<n;){var c=e[t];(c===r||c===ps)&&(e[t]=ps,s[a++]=t)}return s}var St=hA,dA=es,yA=rs,gA=Tb,hs=bt,vA=ls,mA=Vn,_A=pA,wA=St,bA=oe,$A=1,AA=2,EA=8,SA=16,xA=128,IA=512;function ds(e,r,t,n,a,s,c,p,h,v){var _=r&xA,w=r&$A,b=r&AA,d=r&(EA|SA),E=r&IA,x=b?void 0:hs(e);function I(){for(var S=arguments.length,T=Array(S),P=S;P--;)T[P]=arguments[P];if(d)var B=mA(I),D=gA(T,B);if(n&&(T=dA(T,n,a,d)),s&&(T=yA(T,s,c,d)),S-=D,d&&S<v){var j=wA(T,B);return vA(e,r,ds,I.placeholder,t,T,j,p,h,v-S)}var q=w?t:this,z=b?q[e]:e;return S=T.length,p?T=_A(T,p):E&&S>1&&T.reverse(),_&&h<S&&(T.length=h),this&&this!==bA&&this instanceof I&&(z=x||hs(z)),z.apply(q,T)}return I}var ys=ds,TA=Mn,OA=bt,BA=ys,PA=ls,RA=Vn,FA=St,CA=oe;function UA(e,r,t){var n=OA(e);function a(){for(var s=arguments.length,c=Array(s),p=s,h=RA(a);p--;)c[p]=arguments[p];var v=s<3&&c[0]!==h&&c[s-1]!==h?[]:FA(c,h);if(s-=v.length,s<t)return PA(e,r,BA,a.placeholder,void 0,c,v,void 0,void 0,t-s);var _=this&&this!==CA&&this instanceof a?n:e;return TA(_,this,c)}return a}var DA=UA,NA=Mn,LA=bt,MA=oe,jA=1;function kA(e,r,t,n){var a=r&jA,s=LA(e);function c(){for(var p=-1,h=arguments.length,v=-1,_=n.length,w=Array(_+h),b=this&&this!==MA&&this instanceof c?s:e;++v<_;)w[v]=n[v];for(;h--;)w[v++]=arguments[++p];return NA(b,a?t:this,w)}return c}var GA=kA,WA=es,qA=rs,gs=St,vs="__lodash_placeholder__",Hn=1,zA=2,VA=4,ms=8,Ur=128,_s=256,HA=Math.min;function YA(e,r){var t=e[1],n=r[1],a=t|n,s=a<(Hn|zA|Ur),c=n==Ur&&t==ms||n==Ur&&t==_s&&e[7].length<=r[8]||n==(Ur|_s)&&r[7].length<=r[8]&&t==ms;if(!(s||c))return e;n&Hn&&(e[2]=r[2],a|=t&Hn?0:VA);var p=r[3];if(p){var h=e[3];e[3]=h?WA(h,p,r[4]):p,e[4]=h?gs(e[3],vs):r[4]}return p=r[5],p&&(h=e[5],e[5]=h?qA(h,p,r[6]):p,e[6]=h?gs(e[5],vs):r[6]),p=r[7],p&&(e[7]=p),n&Ur&&(e[8]=e[8]==null?r[8]:HA(e[8],r[8])),e[9]==null&&(e[9]=r[9]),e[0]=r[0],e[1]=a,e}var KA=YA,XA=/\s/;function JA(e){for(var r=e.length;r--&&XA.test(e.charAt(r)););return r}var QA=JA,ZA=QA,e2=/^\s+/;function r2(e){return e&&e.slice(0,ZA(e)+1).replace(e2,"")}var t2=r2,n2=t2,ws=Ye,i2=mt,bs=0/0,o2=/^[-+]0x[0-9a-f]+$/i,a2=/^0b[01]+$/i,s2=/^0o[0-7]+$/i,u2=parseInt;function c2(e){if(typeof e=="number")return e;if(i2(e))return bs;if(ws(e)){var r=typeof e.valueOf=="function"?e.valueOf():e;e=ws(r)?r+"":r}if(typeof e!="string")return e===0?e:+e;e=n2(e);var t=a2.test(e);return t||s2.test(e)?u2(e.slice(2),t?2:8):o2.test(e)?bs:+e}var f2=c2,l2=f2,$s=1/0,p2=17976931348623157e292;function h2(e){if(!e)return e===0?e:0;if(e=l2(e),e===$s||e===-$s){var r=e<0?-1:1;return r*p2}return e===e?e:0}var d2=h2,y2=d2;function g2(e){var r=y2(e),t=r%1;return r===r?t?r-t:r:0}var v2=g2,m2=Za,_2=$b,w2=DA,b2=ys,$2=GA,A2=ns,E2=KA,S2=ss,x2=us,As=v2,I2="Expected a function",Es=1,T2=2,Yn=8,Kn=16,Xn=32,Ss=64,xs=Math.max;function O2(e,r,t,n,a,s,c,p){var h=r&T2;if(!h&&typeof e!="function")throw new TypeError(I2);var v=n?n.length:0;if(v||(r&=~(Xn|Ss),n=a=void 0),c=c===void 0?c:xs(As(c),0),p=p===void 0?p:As(p),v-=a?a.length:0,r&Ss){var _=n,w=a;n=a=void 0}var b=h?void 0:A2(e),d=[e,r,t,n,a,_,w,s,c,p];if(b&&E2(d,b),e=d[0],r=d[1],t=d[2],n=d[3],a=d[4],p=d[9]=d[9]===void 0?h?0:e.length:xs(d[9]-v,0),!p&&r&(Yn|Kn)&&(r&=~(Yn|Kn)),!r||r==Es)var E=_2(e,r,t);else r==Yn||r==Kn?E=w2(e,r,p):(r==Xn||r==(Es|Xn))&&!a.length?E=$2(e,r,t,n):E=b2.apply(void 0,d);var x=b?m2:S2;return x2(x(E,d),e,r)}var B2=O2,P2=lb,R2=B2,F2=Vn,C2=St,U2=32,Jn=P2(function(e,r){var t=C2(r,F2(Jn));return R2(e,U2,void 0,r,t)});Jn.placeholder={};var Is=Jn,D2=Object.defineProperty,N2=Object.defineProperties,L2=Object.getOwnPropertyDescriptors,Ts=Object.getOwnPropertySymbols,M2=Object.prototype.hasOwnProperty,j2=Object.prototype.propertyIsEnumerable,Os=(e,r,t)=>r in e?D2(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Bs=(e,r)=>{for(var t in r||(r={}))M2.call(r,t)&&Os(e,t,r[t]);if(Ts)for(var t of Ts(r))j2.call(r,t)&&Os(e,t,r[t]);return e},Ps=(e,r)=>N2(e,L2(r));function k2(e,r){return Ps(Bs({},Gn(r,["address_id","external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","status"])),{customer_id:parseInt(e,10),shopify_variant_id:r.external_variant_id.ecommerce?parseInt(r.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:`${r.charge_interval_frequency}`,order_interval_frequency:`${r.order_interval_frequency}`,status:r.status?r.status.toUpperCase():void 0})}function G2(e,r){var t;return Ps(Bs({},Gn(r,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"])),{shopify_variant_id:(t=r.external_variant_id)!=null&&t.ecommerce?parseInt(r.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:r.charge_interval_frequency?`${r.charge_interval_frequency}`:void 0,order_interval_frequency:r.order_interval_frequency?`${r.order_interval_frequency}`:void 0,force_update:e})}function Rs(e){const{id:r,address_id:t,customer_id:n,analytics_data:a,cancellation_reason:s,cancellation_reason_comments:c,cancelled_at:p,charge_interval_frequency:h,created_at:v,expire_after_specific_number_of_charges:_,shopify_product_id:w,shopify_variant_id:b,has_queued_charges:d,is_prepaid:E,is_skippable:x,is_swappable:I,max_retries_reached:S,next_charge_scheduled_at:T,order_day_of_month:P,order_day_of_week:B,order_interval_frequency:D,order_interval_unit:j,presentment_currency:q,price:z,product_title:X,properties:V,quantity:ae,sku:ue,sku_override:k,status:re,updated_at:N,variant_title:ce}=e;return{id:r,address_id:t,customer_id:n,analytics_data:a,cancellation_reason:s,cancellation_reason_comments:c,cancelled_at:p,charge_interval_frequency:parseInt(h,10),created_at:v,expire_after_specific_number_of_charges:_,external_product_id:{ecommerce:`${w}`},external_variant_id:{ecommerce:`${b}`},has_queued_charges:Ca(d),is_prepaid:E,is_skippable:x,is_swappable:I,max_retries_reached:Ca(S),next_charge_scheduled_at:T,order_day_of_month:P,order_day_of_week:B,order_interval_frequency:parseInt(D,10),order_interval_unit:j,presentment_currency:q,price:`${z}`,product_title:X??"",properties:V,quantity:ae,sku:ue,sku_override:k,status:re.toLowerCase(),updated_at:N,variant_title:ce}}async function W2(e,r,t){const{subscription:n}=await O("get","/subscriptions",{id:r,query:{include:t?.include}},e);return n}function q2(e,r){return O("get","/subscriptions",{query:r},e)}async function z2(e,r,t){const{subscription:n}=await O("post","/subscriptions",{data:r,query:t},e);return n}async function V2(e,r,t,n){const{subscription:a}=await O("put","/subscriptions",{id:r,data:t,query:n},e);return a}async function H2(e,r,t,n){const{subscription:a}=await O("post",`/subscriptions/${r}/set_next_charge_date`,{data:{date:t},query:n},e);return a}async function Y2(e,r,t){const{subscription:n}=await O("post",`/subscriptions/${r}/change_address`,{data:{address_id:t}},e);return n}async function K2(e,r,t,n){const{subscription:a}=await O("post",`/subscriptions/${r}/cancel`,{data:t,query:n},e);return a}async function X2(e,r,t){const{subscription:n}=await O("post",`/subscriptions/${r}/activate`,{query:t},e);return n}async function J2(e,r,t){const{charge:n}=await O("post",`/subscriptions/${r}/charges/skip`,{data:{date:t,subscription_id:`${r}`}},e);return n}async function Q2(e,r,t){const{onetimes:n}=await O("post","/purchase_items/skip_gift",{data:{purchase_item_ids:r.map(Number),recipient_address:t}},e);return n}async function Z2(e,r){const t=r.length;if(t<1||t>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:n}=e;if(!n)throw new Error("No customerId in session.");const a=r[0].address_id;if(!r.every(h=>h.address_id===a))throw new Error("All subscriptions must have the same address_id.");const s=Is(k2,n),c=r.map(s),{subscriptions:p}=await O("post",`/addresses/${a}/subscriptions-bulk`,{data:{subscriptions:c},headers:{"X-Recharge-Version":"2021-01"}},e);return p.map(Rs)}async function eE(e,r,t,n){const a=t.length;if(a<1||a>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:s}=e;if(!s)throw new Error("No customerId in session.");const c=Is(G2,!!(n!=null&&n.force_update)),p=t.map(c),{subscriptions:h}=await O("put",`/addresses/${r}/subscriptions-bulk`,{data:{subscriptions:p},headers:{"X-Recharge-Version":"2021-01"}},e);return h.map(Rs)}var rE=Object.freeze({__proto__:null,getSubscription:W2,listSubscriptions:q2,createSubscription:z2,updateSubscription:V2,updateSubscriptionChargeDate:H2,updateSubscriptionAddress:Y2,cancelSubscription:K2,activateSubscription:X2,skipSubscriptionCharge:J2,skipGiftSubscriptionCharge:Q2,createSubscriptions:Z2,updateSubscriptions:eE});async function tE(e,r){const t=e.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await O("get","/customers",{id:t,query:{include:r?.include}},e);return n}async function nE(e,r){const t=e.customerId;if(!t)throw new Error("Not logged in.");const{customer:n}=await O("put","/customers",{id:t,data:r},e);return n}async function iE(e,r){const t=e.customerId;if(!t)throw new Error("Not logged in.");const{deliveries:n}=await O("get",`/customers/${t}/delivery_schedule`,{query:r},e);return n}async function oE(e){return await O("get","/portal_access",{},e)}var aE=Object.freeze({__proto__:null,getCustomer:tE,updateCustomer:nE,getDeliverySchedule:iE,getCustomerPortalAccess:oE});const sE={get(e,r){return le("get",e,r)},post(e,r){return le("post",e,r)},put(e,r){return le("put",e,r)},delete(e,r){return le("delete",e,r)}};function uE(e){var r,t;if(e)return e;if((r=window?.Shopify)!=null&&r.shop)return window.Shopify.shop;let n=window?.domain;if(!n){const a=(t=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i))==null?void 0:t[1].replace(/-sp$/,"");a&&(n=`${a}.myshopify.com`)}if(n)return n;throw new Error("No storeIdentifier was passed into init.")}function cE(e={}){const r=e,{storefrontAccessToken:t}=e;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.");Wf({storeIdentifier:uE(e.storeIdentifier),loginRetryFn:e.loginRetryFn,storefrontAccessToken:t,environment:r.environment?r.environment:"prod"}),za()}const Fs={init:cE,api:sE,address:pl,auth:El,bundle:A1,charge:P1,cdn:f1,customer:aE,membership:N1,membershipProgram:j1,metafield:q1,onetime:X1,order:Z1,paymentMethod:nb,plan:ab,subscription:rE};try{Fs.init()}catch{}return Fs});
13
+ `).map(function(m){return" "+m}).join(`
14
+ `))):p=t.stylize("[Circular]","special")),ge(f)){if(s&&a.match(/^\d+$/))return p;f=JSON.stringify(""+a),f.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(f=f.substr(1,f.length-2),f=t.stylize(f,"name")):(f=f.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),f=t.stylize(f,"string"))}return f+": "+p}function Ns(t,e,r){var n=t.reduce(function(a,s){return s.indexOf(`
15
+ `)>=0,a+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?r[0]+(e===""?"":e+`
16
+ `)+" "+t.join(`,
17
+ `)+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function Cr(t){return Array.isArray(t)}function Xt(t){return typeof t=="boolean"}function yt(t){return t===null}function oi(t){return t==null}function Dr(t){return typeof t=="number"}function gt(t){return typeof t=="string"}function ai(t){return typeof t=="symbol"}function ge(t){return t===void 0}function mt(t){return je(t)&&Nr(t)==="[object RegExp]"}function je(t){return typeof t=="object"&&t!==null}function Jt(t){return je(t)&&Nr(t)==="[object Date]"}function wt(t){return je(t)&&(Nr(t)==="[object Error]"||t instanceof Error)}function vt(t){return typeof t=="function"}function si(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||typeof t>"u"}function ui(t){return E.isBuffer(t)}function Nr(t){return Object.prototype.toString.call(t)}function Mr(t){return t<10?"0"+t.toString(10):t.toString(10)}var Ms=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Ls(){var t=new Date,e=[Mr(t.getHours()),Mr(t.getMinutes()),Mr(t.getSeconds())].join(":");return[t.getDate(),Ms[t.getMonth()],e].join(" ")}function ci(){console.log("%s - %s",Ls(),Wt.apply(null,arguments))}function Lr(t,e){if(!e||!je(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}function fi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var ks={inherits:ni,_extend:Lr,log:ci,isBuffer:ui,isPrimitive:si,isFunction:vt,isError:wt,isDate:Jt,isObject:je,isRegExp:mt,isUndefined:ge,isSymbol:ai,isString:gt,isNumber:Dr,isNullOrUndefined:oi,isNull:yt,isBoolean:Xt,isArray:Cr,inspect:ye,deprecate:$r,format:Wt,debuglog:ii},js=Object.freeze({__proto__:null,format:Wt,deprecate:$r,debuglog:ii,inspect:ye,isArray:Cr,isBoolean:Xt,isNull:yt,isNullOrUndefined:oi,isNumber:Dr,isString:gt,isSymbol:ai,isUndefined:ge,isRegExp:mt,isObject:je,isDate:Jt,isError:wt,isFunction:vt,isPrimitive:si,isBuffer:ui,log:ci,inherits:ni,_extend:Lr,default:ks}),qs=pt(js),Vs=qs.inspect,kr=typeof Map=="function"&&Map.prototype,jr=Object.getOwnPropertyDescriptor&&kr?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Kt=kr&&jr&&typeof jr.get=="function"?jr.get:null,li=kr&&Map.prototype.forEach,qr=typeof Set=="function"&&Set.prototype,Vr=Object.getOwnPropertyDescriptor&&qr?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Qt=qr&&Vr&&typeof Vr.get=="function"?Vr.get:null,pi=qr&&Set.prototype.forEach,zs=typeof WeakMap=="function"&&WeakMap.prototype,_t=zs?WeakMap.prototype.has:null,Gs=typeof WeakSet=="function"&&WeakSet.prototype,bt=Gs?WeakSet.prototype.has:null,Ws=typeof WeakRef=="function"&&WeakRef.prototype,hi=Ws?WeakRef.prototype.deref:null,Hs=Boolean.prototype.valueOf,Ys=Object.prototype.toString,Xs=Function.prototype.toString,Js=String.prototype.match,zr=String.prototype.slice,Te=String.prototype.replace,Ks=String.prototype.toUpperCase,di=String.prototype.toLowerCase,yi=RegExp.prototype.test,gi=Array.prototype.concat,me=Array.prototype.join,Qs=Array.prototype.slice,mi=Math.floor,Gr=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Wr=Object.getOwnPropertySymbols,Hr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,et=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Q=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===et||"symbol")?Symbol.toStringTag:null,wi=Object.prototype.propertyIsEnumerable,vi=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function _i(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||yi.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-mi(-t):mi(t);if(n!==t){var a=String(n),s=zr.call(e,a.length+1);return Te.call(a,r,"$&_")+"."+Te.call(Te.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Te.call(e,r,"$&_")}var Yr=Vs,bi=Yr.custom,Ei=Si(bi)?bi:null,Zs=function t(e,r,n,a){var s=r||{};if(Re(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Re(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var f=Re(s,"customInspect")?s.customInspect:!0;if(typeof f!="boolean"&&f!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Re(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Re(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var p=s.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 Bi(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var h=String(e);return p?_i(e,h):h}if(typeof e=="bigint"){var m=String(e)+"n";return p?_i(e,m):m}var v=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=v&&v>0&&typeof e=="object")return Xr(e)?"[Array]":"[Object]";var _=mu(s,n);if(typeof a>"u")a=[];else if(Ii(a,e)>=0)return"[Circular]";function b(L,Z,N){if(Z&&(a=Qs.call(a),a.push(Z)),N){var se={depth:s.depth};return Re(s,"quoteStyle")&&(se.quoteStyle=s.quoteStyle),t(L,se,n+1,a)}return t(L,s,n+1,a)}if(typeof e=="function"&&!xi(e)){var y=uu(e),x=Zt(e,b);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(x.length>0?" { "+me.call(x,", ")+" }":"")}if(Si(e)){var I=et?Te.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Hr.call(e);return typeof e=="object"&&!et?Et(I):I}if(du(e)){for(var O="<"+di.call(String(e.nodeName)),S=e.attributes||[],B=0;B<S.length;B++)O+=" "+S[B].name+"="+Ai(eu(S[B].value),"double",s);return O+=">",e.childNodes&&e.childNodes.length&&(O+="..."),O+="</"+di.call(String(e.nodeName))+">",O}if(Xr(e)){if(e.length===0)return"[]";var $=Zt(e,b);return _&&!gu($)?"["+Kr($,_)+"]":"[ "+me.call($,", ")+" ]"}if(ru(e)){var R=Zt(e,b);return!("cause"in Error.prototype)&&"cause"in e&&!wi.call(e,"cause")?"{ ["+String(e)+"] "+me.call(gi.call("[cause]: "+b(e.cause),R),", ")+" }":R.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+me.call(R,", ")+" }"}if(typeof e=="object"&&f){if(Ei&&typeof e[Ei]=="function"&&Yr)return Yr(e,{depth:v-n});if(f!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(cu(e)){var D=[];return li&&li.call(e,function(L,Z){D.push(b(Z,e,!0)+" => "+b(L,e))}),Oi("Map",Kt.call(e),D,_)}if(pu(e)){var M=[];return pi&&pi.call(e,function(L){M.push(b(L,e))}),Oi("Set",Qt.call(e),M,_)}if(fu(e))return Jr("WeakMap");if(hu(e))return Jr("WeakSet");if(lu(e))return Jr("WeakRef");if(iu(e))return Et(b(Number(e)));if(au(e))return Et(b(Gr.call(e)));if(ou(e))return Et(Hs.call(e));if(nu(e))return Et(b(String(e)));if(!tu(e)&&!xi(e)){var q=Zt(e,b),V=vi?vi(e)===Object.prototype:e instanceof Object||e.constructor===Object,Y=e instanceof Object?"":"null prototype",z=!V&&Q&&Object(e)===e&&Q in e?zr.call($e(e),8,-1):Y?"Object":"",ne=V||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",ae=ne+(z||Y?"["+me.call(gi.call([],z||[],Y||[]),": ")+"] ":"");return q.length===0?ae+"{}":_?ae+"{"+Kr(q,_)+"}":ae+"{ "+me.call(q,", ")+" }"}return String(e)};function Ai(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function eu(t){return Te.call(String(t),/"/g,"&quot;")}function Xr(t){return $e(t)==="[object Array]"&&(!Q||!(typeof t=="object"&&Q in t))}function tu(t){return $e(t)==="[object Date]"&&(!Q||!(typeof t=="object"&&Q in t))}function xi(t){return $e(t)==="[object RegExp]"&&(!Q||!(typeof t=="object"&&Q in t))}function ru(t){return $e(t)==="[object Error]"&&(!Q||!(typeof t=="object"&&Q in t))}function nu(t){return $e(t)==="[object String]"&&(!Q||!(typeof t=="object"&&Q in t))}function iu(t){return $e(t)==="[object Number]"&&(!Q||!(typeof t=="object"&&Q in t))}function ou(t){return $e(t)==="[object Boolean]"&&(!Q||!(typeof t=="object"&&Q in t))}function Si(t){if(et)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!Hr)return!1;try{return Hr.call(t),!0}catch{}return!1}function au(t){if(!t||typeof t!="object"||!Gr)return!1;try{return Gr.call(t),!0}catch{}return!1}var su=Object.prototype.hasOwnProperty||function(t){return t in this};function Re(t,e){return su.call(t,e)}function $e(t){return Ys.call(t)}function uu(t){if(t.name)return t.name;var e=Js.call(Xs.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function Ii(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function cu(t){if(!Kt||!t||typeof t!="object")return!1;try{Kt.call(t);try{Qt.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function fu(t){if(!_t||!t||typeof t!="object")return!1;try{_t.call(t,_t);try{bt.call(t,bt)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function lu(t){if(!hi||!t||typeof t!="object")return!1;try{return hi.call(t),!0}catch{}return!1}function pu(t){if(!Qt||!t||typeof t!="object")return!1;try{Qt.call(t);try{Kt.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function hu(t){if(!bt||!t||typeof t!="object")return!1;try{bt.call(t,bt);try{_t.call(t,_t)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function du(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function Bi(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Bi(zr.call(t,0,e.maxStringLength),e)+n}var a=Te.call(Te.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,yu);return Ai(a,"single",e)}function yu(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Ks.call(e.toString(16))}function Et(t){return"Object("+t+")"}function Jr(t){return t+" { ? }"}function Oi(t,e,r,n){var a=n?Kr(r,n):me.call(r,", ");return t+" ("+e+") {"+a+"}"}function gu(t){for(var e=0;e<t.length;e++)if(Ii(t[e],`
18
+ `)>=0)return!1;return!0}function mu(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=me.call(Array(t.indent+1)," ");else return null;return{base:r,prev:me.call(Array(e+1),r)}}function Kr(t,e){if(t.length===0)return"";var r=`
19
+ `+e.prev+e.base;return r+me.call(t,","+r)+`
20
+ `+e.prev}function Zt(t,e){var r=Xr(t),n=[];if(r){n.length=t.length;for(var a=0;a<t.length;a++)n[a]=Re(t,a)?e(t[a],t):""}var s=typeof Wr=="function"?Wr(t):[],f;if(et){f={};for(var p=0;p<s.length;p++)f["$"+s[p]]=s[p]}for(var h in t)Re(t,h)&&(r&&String(Number(h))===h&&h<t.length||et&&f["$"+h]instanceof Symbol||(yi.call(/[^\w$]/,h)?n.push(e(h,t)+": "+e(t[h],t)):n.push(h+": "+e(t[h],t))));if(typeof Wr=="function")for(var m=0;m<s.length;m++)wi.call(t,s[m])&&n.push("["+e(s[m])+"]: "+e(t[s[m]],t));return n}var Qr=Sr,tt=Ia,wu=Zs,vu=Qr("%TypeError%"),er=Qr("%WeakMap%",!0),tr=Qr("%Map%",!0),_u=tt("WeakMap.prototype.get",!0),bu=tt("WeakMap.prototype.set",!0),Eu=tt("WeakMap.prototype.has",!0),Au=tt("Map.prototype.get",!0),xu=tt("Map.prototype.set",!0),Su=tt("Map.prototype.has",!0),Zr=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},Iu=function(t,e){var r=Zr(t,e);return r&&r.value},Bu=function(t,e,r){var n=Zr(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},Ou=function(t,e){return!!Zr(t,e)},Tu=function(){var e,r,n,a={assert:function(s){if(!a.has(s))throw new vu("Side channel does not contain "+wu(s))},get:function(s){if(er&&s&&(typeof s=="object"||typeof s=="function")){if(e)return _u(e,s)}else if(tr){if(r)return Au(r,s)}else if(n)return Iu(n,s)},has:function(s){if(er&&s&&(typeof s=="object"||typeof s=="function")){if(e)return Eu(e,s)}else if(tr){if(r)return Su(r,s)}else if(n)return Ou(n,s);return!1},set:function(s,f){er&&s&&(typeof s=="object"||typeof s=="function")?(e||(e=new er),bu(e,s,f)):tr?(r||(r=new tr),xu(r,s,f)):(n||(n={key:{},next:null}),Bu(n,s,f))}};return a},Ru=String.prototype.replace,$u=/%20/g,en={RFC1738:"RFC1738",RFC3986:"RFC3986"},Ti={default:en.RFC3986,formatters:{RFC1738:function(t){return Ru.call(t,$u,"+")},RFC3986:function(t){return String(t)}},RFC1738:en.RFC1738,RFC3986:en.RFC3986},Pu=Ti,tn=Object.prototype.hasOwnProperty,qe=Array.isArray,we=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Fu=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(qe(n)){for(var a=[],s=0;s<n.length;++s)typeof n[s]<"u"&&a.push(n[s]);r.obj[r.prop]=a}}},Ri=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},a=0;a<e.length;++a)typeof e[a]<"u"&&(n[a]=e[a]);return n},Uu=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(qe(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!tn.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var a=e;return qe(e)&&!qe(r)&&(a=Ri(e,n)),qe(e)&&qe(r)?(r.forEach(function(s,f){if(tn.call(e,f)){var p=e[f];p&&typeof p=="object"&&s&&typeof s=="object"?e[f]=t(p,s,n):e.push(s)}else e[f]=s}),e):Object.keys(r).reduce(function(s,f){var p=r[f];return tn.call(s,f)?s[f]=t(s[f],p,n):s[f]=p,s},a)},Cu=function(e,r){return Object.keys(r).reduce(function(n,a){return n[a]=r[a],n},e)},Du=function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Nu=function(e,r,n,a,s){if(e.length===0)return e;var f=e;if(typeof e=="symbol"?f=Symbol.prototype.toString.call(e):typeof e!="string"&&(f=String(e)),n==="iso-8859-1")return escape(f).replace(/%u[0-9a-f]{4}/gi,function(v){return"%26%23"+parseInt(v.slice(2),16)+"%3B"});for(var p="",h=0;h<f.length;++h){var m=f.charCodeAt(h);if(m===45||m===46||m===95||m===126||m>=48&&m<=57||m>=65&&m<=90||m>=97&&m<=122||s===Pu.RFC1738&&(m===40||m===41)){p+=f.charAt(h);continue}if(m<128){p=p+we[m];continue}if(m<2048){p=p+(we[192|m>>6]+we[128|m&63]);continue}if(m<55296||m>=57344){p=p+(we[224|m>>12]+we[128|m>>6&63]+we[128|m&63]);continue}h+=1,m=65536+((m&1023)<<10|f.charCodeAt(h)&1023),p+=we[240|m>>18]+we[128|m>>12&63]+we[128|m>>6&63]+we[128|m&63]}return p},Mu=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],a=0;a<r.length;++a)for(var s=r[a],f=s.obj[s.prop],p=Object.keys(f),h=0;h<p.length;++h){var m=p[h],v=f[m];typeof v=="object"&&v!==null&&n.indexOf(v)===-1&&(r.push({obj:f,prop:m}),n.push(v))}return Fu(r),e},Lu=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},ku=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},ju=function(e,r){return[].concat(e,r)},qu=function(e,r){if(qe(e)){for(var n=[],a=0;a<e.length;a+=1)n.push(r(e[a]));return n}return r(e)},Vu={arrayToObject:Ri,assign:Cu,combine:ju,compact:Mu,decode:Du,encode:Nu,isBuffer:ku,isRegExp:Lu,maybeMap:qu,merge:Uu},$i=Tu,rn=Vu,At=Ti,zu=Object.prototype.hasOwnProperty,Pi={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},Ae=Array.isArray,Gu=String.prototype.split,Wu=Array.prototype.push,Fi=function(t,e){Wu.apply(t,Ae(e)?e:[e])},Hu=Date.prototype.toISOString,Ui=At.default,X={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:rn.encode,encodeValuesOnly:!1,format:Ui,formatter:At.formatters[Ui],indices:!1,serializeDate:function(e){return Hu.call(e)},skipNulls:!1,strictNullHandling:!1},Yu=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},nn={},Xu=function t(e,r,n,a,s,f,p,h,m,v,_,b,y,x,I,O){for(var S=e,B=O,$=0,R=!1;(B=B.get(nn))!==void 0&&!R;){var D=B.get(e);if($+=1,typeof D<"u"){if(D===$)throw new RangeError("Cyclic object value");R=!0}typeof B.get(nn)>"u"&&($=0)}if(typeof h=="function"?S=h(r,S):S instanceof Date?S=_(S):n==="comma"&&Ae(S)&&(S=rn.maybeMap(S,function(Pe){return Pe instanceof Date?_(Pe):Pe})),S===null){if(s)return p&&!x?p(r,X.encoder,I,"key",b):r;S=""}if(Yu(S)||rn.isBuffer(S)){if(p){var M=x?r:p(r,X.encoder,I,"key",b);if(n==="comma"&&x){for(var q=Gu.call(String(S),","),V="",Y=0;Y<q.length;++Y)V+=(Y===0?"":",")+y(p(q[Y],X.encoder,I,"value",b));return[y(M)+(a&&Ae(S)&&q.length===1?"[]":"")+"="+V]}return[y(M)+"="+y(p(S,X.encoder,I,"value",b))]}return[y(r)+"="+y(String(S))]}var z=[];if(typeof S>"u")return z;var ne;if(n==="comma"&&Ae(S))ne=[{value:S.length>0?S.join(",")||null:void 0}];else if(Ae(h))ne=h;else{var ae=Object.keys(S);ne=m?ae.sort(m):ae}for(var L=a&&Ae(S)&&S.length===1?r+"[]":r,Z=0;Z<ne.length;++Z){var N=ne[Z],se=typeof N=="object"&&typeof N.value<"u"?N.value:S[N];if(!(f&&se===null)){var ut=Ae(S)?typeof n=="function"?n(L,N):L:L+(v?"."+N:"["+N+"]");O.set(e,$);var ie=$i();ie.set(nn,O),Fi(z,t(se,ut,n,a,s,f,p,h,m,v,_,b,y,x,I,ie))}}return z},Ju=function(e){if(!e)return X;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||X.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=At.default;if(typeof e.format<"u"){if(!zu.call(At.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var a=At.formatters[n],s=X.filter;return(typeof e.filter=="function"||Ae(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:X.addQueryPrefix,allowDots:typeof e.allowDots>"u"?X.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:X.charsetSentinel,delimiter:typeof e.delimiter>"u"?X.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:X.encode,encoder:typeof e.encoder=="function"?e.encoder:X.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:X.encodeValuesOnly,filter:s,format:n,formatter:a,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:X.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:X.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:X.strictNullHandling}},Ku=function(t,e){var r=t,n=Ju(e),a,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):Ae(n.filter)&&(s=n.filter,a=s);var f=[];if(typeof r!="object"||r===null)return"";var p;e&&e.arrayFormat in Pi?p=e.arrayFormat:e&&"indices"in e?p=e.indices?"indices":"repeat":p="indices";var h=Pi[p];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var m=h==="comma"&&e&&e.commaRoundTrip;a||(a=Object.keys(r)),n.sort&&a.sort(n.sort);for(var v=$i(),_=0;_<a.length;++_){var b=a[_];n.skipNulls&&r[b]===null||Fi(f,Xu(r[b],b,h,m,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,v))}var y=f.join(n.delimiter),x=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?x+="utf8=%26%2310003%3B&":x+="utf8=%E2%9C%93&"),y.length>0?x+y:""};let Ci={storeIdentifier:"",environment:"prod"};function Qu(t){Ci=t}function ve(){return Ci}const Zu=t=>t==="stage"?"https://api.stage.rechargeapps.com":"https://api.rechargeapps.com",rr=t=>t==="stage"?"https://admin.stage.rechargeapps.com":"https://admin.rechargeapps.com",ec=t=>t==="stage"?"https://static.stage.rechargecdn.com":"https://static.rechargecdn.com",tc="/tools/recurring";class nr{constructor(e,r){this.name="RechargeRequestError",this.message=e,this.status=r}}var rc=Object.defineProperty,nc=Object.defineProperties,ic=Object.getOwnPropertyDescriptors,Di=Object.getOwnPropertySymbols,oc=Object.prototype.hasOwnProperty,ac=Object.prototype.propertyIsEnumerable,Ni=(t,e,r)=>e in t?rc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ir=(t,e)=>{for(var r in e||(e={}))oc.call(e,r)&&Ni(t,r,e[r]);if(Di)for(var r of Di(e))ac.call(e,r)&&Ni(t,r,e[r]);return t},sc=(t,e)=>nc(t,ic(e));function uc(t){return Ku(t,{encode:!1,indices:!1,arrayFormat:"comma"})}async function or(t,e,r={}){const n=ve();return ce(t,`${ec(n.environment)}/store/${n.storeIdentifier}${e}`,r)}async function T(t,e,{id:r,query:n,data:a,headers:s}={},f){const{environment:p,storeIdentifier:h,loginRetryFn:m}=ve(),v=f.apiToken,_=Zu(p),b=ir({"X-Recharge-Access-Token":v,"X-Recharge-Version":"2021-11"},s||{}),y=ir({shop_url:h},n);try{return await ce(t,`${_}${e}`,{id:r,query:y,data:a,headers:b})}catch(x){if(m&&x instanceof nr&&x.status===401)return m().then(I=>{if(I)return ce(t,`${_}${e}`,{id:r,query:y,data:a,headers:sc(ir({},b),{"X-Recharge-Access-Token":I.apiToken})});throw x});throw x}}async function xt(t,e,r={}){return ce(t,`${tc}${e}`,r)}async function ce(t,e,{id:r,query:n,data:a,headers:s}={}){let f=e.trim();if(r&&(f=[f,`${r}`.trim()].join("/")),n){let _;[f,_]=f.split("?");const b=[_,uc(n)].join("&").replace(/^&/,"");f=`${f}${b?`?${b}`:""}`}let p;a&&t!=="get"&&(p=JSON.stringify(a));const h=ir({Accept:"application/json","Content-Type":"application/json","X-Recharge-App":"storefront-client"},s||{}),m=await fetch(f,{method:t,headers:h,body:p});let v;try{v=await m.json()}catch{}if(!m.ok)throw v&&v.error?new nr(v.error,m.status):v&&v.errors?new nr(JSON.stringify(v.errors),m.status):new nr("A connection error occurred while making the request");return v}var cc=Object.defineProperty,Mi=Object.getOwnPropertySymbols,fc=Object.prototype.hasOwnProperty,lc=Object.prototype.propertyIsEnumerable,Li=(t,e,r)=>e in t?cc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,pc=(t,e)=>{for(var r in e||(e={}))fc.call(e,r)&&Li(t,r,e[r]);if(Mi)for(var r of Mi(e))lc.call(e,r)&&Li(t,r,e[r]);return t};function hc(t,e){return T("get","/addresses",{query:e},t)}async function dc(t,e,r){const{address:n}=await T("get","/addresses",{id:e,query:{include:r?.include}},t);return n}async function yc(t,e){const{address:r}=await T("post","/addresses",{data:pc({customer_id:t.customerId?Number(t.customerId):void 0},e)},t);return r}async function on(t,e,r){const{address:n}=await T("put","/addresses",{id:e,data:r},t);return n}async function gc(t,e,r){return on(t,e,{discounts:[{code:r}]})}async function mc(t,e){return on(t,e,{discounts:[]})}function wc(t,e){return T("delete","/addresses",{id:e},t)}async function vc(t,e){const{address:r}=await T("post","/addresses/merge",{data:e},t);return r}async function _c(t,e,r){const{charge:n}=await T("post",`/addresses/${e}/charges/skip`,{data:r},t);return n}var bc=Object.freeze({__proto__:null,listAddresses:hc,getAddress:dc,createAddress:yc,updateAddress:on,applyDiscountToAddress:gc,removeDiscountsFromAddress:mc,deleteAddress:wc,mergeAddresses:vc,skipFutureCharge:_c}),Ec=Object.defineProperty,ki=Object.getOwnPropertySymbols,Ac=Object.prototype.hasOwnProperty,xc=Object.prototype.propertyIsEnumerable,ji=(t,e,r)=>e in t?Ec(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,qi=(t,e)=>{for(var r in e||(e={}))Ac.call(e,r)&&ji(t,r,e[r]);if(ki)for(var r of ki(e))xc.call(e,r)&&ji(t,r,e[r]);return t};async function Sc(){const{storefrontAccessToken:t}=ve(),e={};t&&(e["X-Recharge-Storefront-Access-Token"]=t);const r=await xt("get","/access",{headers:e});return{apiToken:r.api_token,customerId:r.customer_id}}async function Ic(t,e){const{environment:r,storefrontAccessToken:n,storeIdentifier:a}=ve(),s=rr(r),f={};n&&(f["X-Recharge-Storefront-Access-Token"]=n);const p=await ce("post",`${s}/shopify_storefront_access`,{data:{customer_token:e,storefront_token:t,shop_url:a},headers:f});return p.api_token?{apiToken:p.api_token,customerId:p.customer_id}:null}async function Bc(t,e={}){const{environment:r,storefrontAccessToken:n,storeIdentifier:a}=ve(),s=rr(r),f={};n&&(f["X-Recharge-Storefront-Access-Token"]=n);const p=await ce("post",`${s}/attempt_login`,{data:qi({email:t,shop:a},e),headers:f});if(p.errors)throw new Error(p.errors);return p.session_token}async function Oc(t,e={}){const{storefrontAccessToken:r}=ve(),n={};r&&(n["X-Recharge-Storefront-Access-Token"]=r);const a=await xt("post","/attempt_login",{data:qi({email:t},e),headers:n});if(a.errors)throw new Error(a.errors);return a.session_token}async function Tc(t,e,r){const{environment:n,storefrontAccessToken:a,storeIdentifier:s}=ve(),f=rr(n),p={};a&&(p["X-Recharge-Storefront-Access-Token"]=a);const h=await ce("post",`${f}/validate_login`,{data:{code:r,email:t,session_token:e,shop:s},headers:p});if(h.errors)throw new Error(h.errors);return{apiToken:h.api_token,customerId:h.customer_id}}async function Rc(t,e,r){const{storefrontAccessToken:n}=ve(),a={};n&&(a["X-Recharge-Storefront-Access-Token"]=n);const s=await xt("post","/validate_login",{data:{code:r,email:t,session_token:e},headers:a});if(s.errors)throw new Error(s.errors);return{apiToken:s.api_token,customerId:s.customer_id}}function $c(){const{pathname:t,search:e}=window.location,r=new URLSearchParams(e).get("token"),n=t.split("/").filter(Boolean),a=n.findIndex(f=>f==="portal"),s=a!==-1?n[a+1]:void 0;if(!r||!s)throw new Error("Not in context of Recharge Customer Portal or URL did not contain correct params");return{customerHash:s,token:r}}async function Pc(){const{customerHash:t,token:e}=$c(),{environment:r,storefrontAccessToken:n,storeIdentifier:a}=ve(),s=rr(r),f={};n&&(f["X-Recharge-Storefront-Access-Token"]=n);const p=await ce("post",`${s}/customers/${t}/access`,{headers:f,data:{token:e,shop:a}});return{apiToken:p.api_token,customerId:p.customer_id}}var Fc=Object.freeze({__proto__:null,loginShopifyAppProxy:Sc,loginShopifyApi:Ic,sendPasswordlessCode:Bc,sendPasswordlessCodeAppProxy:Oc,validatePasswordlessCode:Tc,validatePasswordlessCodeAppProxy:Rc,loginCustomerPortal:Pc});let Uc=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((e,r)=>(r&=63,r<36?e+=r.toString(36):r<62?e+=(r-26).toString(36).toUpperCase():r>62?e+="-":e+="_",e),"");var Cc=200,an="__lodash_hash_undefined__",Dc=1/0,Vi=9007199254740991,Nc="[object Arguments]",Mc="[object Function]",Lc="[object GeneratorFunction]",kc="[object Symbol]",jc=/[\\^$.*+?()[\]{}|]/g,qc=/^\[object .+?Constructor\]$/,Vc=/^(?:0|[1-9]\d*)$/,zc=typeof oe=="object"&&oe&&oe.Object===Object&&oe,Gc=typeof self=="object"&&self&&self.Object===Object&&self,sn=zc||Gc||Function("return this")();function Wc(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Hc(t,e){var r=t?t.length:0;return!!r&&Jc(t,e,0)>-1}function Yc(t,e,r){for(var n=-1,a=t?t.length:0;++n<a;)if(r(e,t[n]))return!0;return!1}function zi(t,e){for(var r=-1,n=t?t.length:0,a=Array(n);++r<n;)a[r]=e(t[r],r,t);return a}function un(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}function Xc(t,e,r,n){for(var a=t.length,s=r+(n?1:-1);n?s--:++s<a;)if(e(t[s],s,t))return s;return-1}function Jc(t,e,r){if(e!==e)return Xc(t,Kc,r);for(var n=r-1,a=t.length;++n<a;)if(t[n]===e)return n;return-1}function Kc(t){return t!==t}function Qc(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function Zc(t){return function(e){return t(e)}}function ef(t,e){return t.has(e)}function tf(t,e){return t?.[e]}function rf(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function Gi(t,e){return function(r){return t(e(r))}}var nf=Array.prototype,of=Function.prototype,ar=Object.prototype,cn=sn["__core-js_shared__"],Wi=function(){var t=/[^.]+$/.exec(cn&&cn.keys&&cn.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Hi=of.toString,rt=ar.hasOwnProperty,fn=ar.toString,af=RegExp("^"+Hi.call(rt).replace(jc,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Yi=sn.Symbol,sf=Gi(Object.getPrototypeOf,Object),uf=ar.propertyIsEnumerable,cf=nf.splice,Xi=Yi?Yi.isConcatSpreadable:void 0,ln=Object.getOwnPropertySymbols,Ji=Math.max,ff=Qi(sn,"Map"),St=Qi(Object,"create");function Ve(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function lf(){this.__data__=St?St(null):{}}function pf(t){return this.has(t)&&delete this.__data__[t]}function hf(t){var e=this.__data__;if(St){var r=e[t];return r===an?void 0:r}return rt.call(e,t)?e[t]:void 0}function df(t){var e=this.__data__;return St?e[t]!==void 0:rt.call(e,t)}function yf(t,e){var r=this.__data__;return r[t]=St&&e===void 0?an:e,this}Ve.prototype.clear=lf,Ve.prototype.delete=pf,Ve.prototype.get=hf,Ve.prototype.has=df,Ve.prototype.set=yf;function nt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function gf(){this.__data__=[]}function mf(t){var e=this.__data__,r=ur(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():cf.call(e,r,1),!0}function wf(t){var e=this.__data__,r=ur(e,t);return r<0?void 0:e[r][1]}function vf(t){return ur(this.__data__,t)>-1}function _f(t,e){var r=this.__data__,n=ur(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}nt.prototype.clear=gf,nt.prototype.delete=mf,nt.prototype.get=wf,nt.prototype.has=vf,nt.prototype.set=_f;function it(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function bf(){this.__data__={hash:new Ve,map:new(ff||nt),string:new Ve}}function Ef(t){return cr(this,t).delete(t)}function Af(t){return cr(this,t).get(t)}function xf(t){return cr(this,t).has(t)}function Sf(t,e){return cr(this,t).set(t,e),this}it.prototype.clear=bf,it.prototype.delete=Ef,it.prototype.get=Af,it.prototype.has=xf,it.prototype.set=Sf;function sr(t){var e=-1,r=t?t.length:0;for(this.__data__=new it;++e<r;)this.add(t[e])}function If(t){return this.__data__.set(t,an),this}function Bf(t){return this.__data__.has(t)}sr.prototype.add=sr.prototype.push=If,sr.prototype.has=Bf;function Of(t,e){var r=pn(t)||Zi(t)?Qc(t.length,String):[],n=r.length,a=!!n;for(var s in t)(e||rt.call(t,s))&&!(a&&(s=="length"||kf(s,n)))&&r.push(s);return r}function ur(t,e){for(var r=t.length;r--;)if(Hf(t[r][0],e))return r;return-1}function Tf(t,e,r,n){var a=-1,s=Hc,f=!0,p=t.length,h=[],m=e.length;if(!p)return h;r&&(e=zi(e,Zc(r))),n?(s=Yc,f=!1):e.length>=Cc&&(s=ef,f=!1,e=new sr(e));e:for(;++a<p;){var v=t[a],_=r?r(v):v;if(v=n||v!==0?v:0,f&&_===_){for(var b=m;b--;)if(e[b]===_)continue e;h.push(v)}else s(e,_,n)||h.push(v)}return h}function Ki(t,e,r,n,a){var s=-1,f=t.length;for(r||(r=Lf),a||(a=[]);++s<f;){var p=t[s];e>0&&r(p)?e>1?Ki(p,e-1,r,n,a):un(a,p):n||(a[a.length]=p)}return a}function Rf(t,e,r){var n=e(t);return pn(t)?n:un(n,r(t))}function $f(t){if(!hn(t)||qf(t))return!1;var e=to(t)||rf(t)?af:qc;return e.test(Wf(t))}function Pf(t){if(!hn(t))return zf(t);var e=Vf(t),r=[];for(var n in t)n=="constructor"&&(e||!rt.call(t,n))||r.push(n);return r}function Ff(t,e){return t=Object(t),Uf(t,e,function(r,n){return n in t})}function Uf(t,e,r){for(var n=-1,a=e.length,s={};++n<a;){var f=e[n],p=t[f];r(p,f)&&(s[f]=p)}return s}function Cf(t,e){return e=Ji(e===void 0?t.length-1:e,0),function(){for(var r=arguments,n=-1,a=Ji(r.length-e,0),s=Array(a);++n<a;)s[n]=r[e+n];n=-1;for(var f=Array(e+1);++n<e;)f[n]=r[n];return f[e]=s,Wc(t,this,f)}}function Df(t){return Rf(t,Kf,Mf)}function cr(t,e){var r=t.__data__;return jf(e)?r[typeof e=="string"?"string":"hash"]:r.map}function Qi(t,e){var r=tf(t,e);return $f(r)?r:void 0}var Nf=ln?Gi(ln,Object):no,Mf=ln?function(t){for(var e=[];t;)un(e,Nf(t)),t=sf(t);return e}:no;function Lf(t){return pn(t)||Zi(t)||!!(Xi&&t&&t[Xi])}function kf(t,e){return e=e??Vi,!!e&&(typeof t=="number"||Vc.test(t))&&t>-1&&t%1==0&&t<e}function jf(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function qf(t){return!!Wi&&Wi in t}function Vf(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||ar;return t===r}function zf(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function Gf(t){if(typeof t=="string"||Jf(t))return t;var e=t+"";return e=="0"&&1/t==-Dc?"-0":e}function Wf(t){if(t!=null){try{return Hi.call(t)}catch{}try{return t+""}catch{}}return""}function Hf(t,e){return t===e||t!==t&&e!==e}function Zi(t){return Yf(t)&&rt.call(t,"callee")&&(!uf.call(t,"callee")||fn.call(t)==Nc)}var pn=Array.isArray;function eo(t){return t!=null&&Xf(t.length)&&!to(t)}function Yf(t){return ro(t)&&eo(t)}function to(t){var e=hn(t)?fn.call(t):"";return e==Mc||e==Lc}function Xf(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Vi}function hn(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function ro(t){return!!t&&typeof t=="object"}function Jf(t){return typeof t=="symbol"||ro(t)&&fn.call(t)==kc}function Kf(t){return eo(t)?Of(t,!0):Pf(t)}var Qf=Cf(function(t,e){return t==null?{}:(e=zi(Ki(e,1),Gf),Ff(t,Tf(Df(t),e)))});function no(){return[]}var dn=Qf,Zf=Object.defineProperty,el=Object.defineProperties,tl=Object.getOwnPropertyDescriptors,io=Object.getOwnPropertySymbols,rl=Object.prototype.hasOwnProperty,nl=Object.prototype.propertyIsEnumerable,oo=(t,e,r)=>e in t?Zf(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,il=(t,e)=>{for(var r in e||(e={}))rl.call(e,r)&&oo(t,r,e[r]);if(io)for(var r of io(e))nl.call(e,r)&&oo(t,r,e[r]);return t},ol=(t,e)=>el(t,tl(e));function al(t){try{return JSON.parse(t)}catch{return t}}function sl(t){return Object.entries(t).reduce((e,[r,n])=>ol(il({},e),{[r]:al(n)}),{})}const ao=t=>typeof t=="string"?t!=="0"&&t!=="false":!!t;var ul=Object.defineProperty,cl=Object.defineProperties,fl=Object.getOwnPropertyDescriptors,so=Object.getOwnPropertySymbols,ll=Object.prototype.hasOwnProperty,pl=Object.prototype.propertyIsEnumerable,uo=(t,e,r)=>e in t?ul(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,co=(t,e)=>{for(var r in e||(e={}))ll.call(e,r)&&uo(t,r,e[r]);if(so)for(var r of so(e))pl.call(e,r)&&uo(t,r,e[r]);return t},fo=(t,e)=>cl(t,fl(e));function lo(t){var e;const r=sl(t),n=r.auto_inject===void 0?!0:r.auto_inject,a=(e=r.display_on)!=null?e:[],s=r.first_option==="autodeliver";return fo(co({},dn(r,["display_on","first_option"])),{auto_inject:n,valid_pages:a,is_subscription_first:s,autoInject:n,validPages:a,isSubscriptionFirst:s})}function po(t){var e;const r=((e=t.subscription_options)==null?void 0:e.storefront_purchase_options)==="subscription_only";return fo(co({},t),{is_subscription_only:r,isSubscriptionOnly:r})}function hl(t){return t.map(e=>{const r={};return Object.entries(e).forEach(([n,a])=>{r[n]=po(a)}),r})}const fr="2020-12",dl={store_currency:{currency_code:"USD",currency_symbol:"$",decimal_separator:".",thousands_separator:",",currency_symbol_location:"left"}},It=new Map;function lr(t,e){return It.has(t)||It.set(t,e()),It.get(t)}async function yn(t){const{product:e}=await lr(`product.${t}`,()=>or("get",`/product/${fr}/${t}.json`));return po(e)}async function ho(){return await lr("storeSettings",()=>or("get",`/${fr}/store_settings.json`).catch(()=>dl))}async function yo(){const{widget_settings:t}=await lr("widgetSettings",()=>or("get",`/${fr}/widget_settings.json`));return lo(t)}async function go(){const{products:t,widget_settings:e,store_settings:r,meta:n}=await lr("productsAndSettings",()=>or("get",`/product/${fr}/products.json`));return n?.status==="error"?Promise.reject(n.message):{products:hl(t),widget_settings:lo(e),store_settings:r??{}}}async function yl(){const{products:t}=await go();return t}async function gl(t){const[e,r,n]=await Promise.all([yn(t),ho(),yo()]);return{product:e,store_settings:r,widget_settings:n,storeSettings:r,widgetSettings:n}}async function mo(t){const{bundle_product:e}=await yn(t);return e}async function wo(){return Array.from(It.keys()).forEach(t=>It.delete(t))}var ml=Object.freeze({__proto__:null,getCDNProduct:yn,getCDNStoreSettings:ho,getCDNWidgetSettings:yo,getCDNProductsAndSettings:go,getCDNProducts:yl,getCDNProductAndSettings:gl,getCDNBundleSettings:mo,resetCDNCache:wo}),vo={exports:{}};/*! For license information please see xdr.js.LICENSE.txt */(function(t,e){(function(r,n){t.exports=n()})(oe,()=>(()=>{var r={899:(s,f,p)=>{const h=p(221);s.exports=h},221:(s,f,p)=>{p.r(f),p.d(f,{Array:()=>ft,Bool:()=>G,Double:()=>hr,Enum:()=>_e,Float:()=>Pe,Hyper:()=>L,Int:()=>z,Opaque:()=>Pt,Option:()=>Ut,Quadruple:()=>k,Reference:()=>ee,String:()=>$t,Struct:()=>Fe,Union:()=>Ie,UnsignedHyper:()=>ie,UnsignedInt:()=>N,VarArray:()=>Ft,VarOpaque:()=>Se,Void:()=>J,config:()=>g});class h extends TypeError{constructor(o){super(`XDR Write Error: ${o}`)}}class m extends TypeError{constructor(o){super(`XDR Read Error: ${o}`)}}class v extends TypeError{constructor(o){super(`XDR Type Definition Error: ${o}`)}}class _ extends v{constructor(){super("method not implemented, it should be overloaded in the descendant class.")}}var b=p(764).lW;class y{constructor(o){if(!b.isBuffer(o)){if(!(o instanceof Array))throw new m("source not specified");o=b.from(o)}this._buffer=o,this._length=o.length,this._index=0}_buffer;_length;_index;get eof(){return this._index===this._length}advance(o){const l=this._index;if(this._index+=o,this._length<this._index)throw new m("attempt to read outside the boundary of the buffer");const w=4-(o%4||4);if(w>0){for(let A=0;A<w;A++)if(this._buffer[this._index+A]!==0)throw new m("invalid padding");this._index+=w}return l}rewind(){this._index=0}read(o){const l=this.advance(o);return this._buffer.subarray(l,l+o)}readInt32BE(){return this._buffer.readInt32BE(this.advance(4))}readUInt32BE(){return this._buffer.readUInt32BE(this.advance(4))}readBigInt64BE(){return this._buffer.readBigInt64BE(this.advance(8))}readBigUInt64BE(){return this._buffer.readBigUInt64BE(this.advance(8))}readFloatBE(){return this._buffer.readFloatBE(this.advance(4))}readDoubleBE(){return this._buffer.readDoubleBE(this.advance(8))}ensureInputConsumed(){if(this._index!==this._length)throw new m("invalid XDR contract typecast - source buffer not entirely consumed")}}var x=p(764).lW;const I=8192;class O{constructor(o){typeof o=="number"?o=x.allocUnsafe(o):o instanceof x||(o=x.allocUnsafe(I)),this._buffer=o,this._length=o.length}_buffer;_length;_index=0;alloc(o){const l=this._index;return this._index+=o,this._length<this._index&&this.resize(this._index),l}resize(o){const l=Math.ceil(o/I)*I,w=x.allocUnsafe(l);this._buffer.copy(w,0,0,this._length),this._buffer=w,this._length=l}finalize(){return this._buffer.subarray(0,this._index)}toArray(){return[...this.finalize()]}write(o,l){if(typeof o=="string"){const A=this.alloc(l);this._buffer.write(o,A,"utf8")}else{o instanceof x||(o=x.from(o));const A=this.alloc(l);o.copy(this._buffer,A,0,l)}const w=4-(l%4||4);if(w>0){const A=this.alloc(w);this._buffer.fill(0,A,this._index)}}writeInt32BE(o){const l=this.alloc(4);this._buffer.writeInt32BE(o,l)}writeUInt32BE(o){const l=this.alloc(4);this._buffer.writeUInt32BE(o,l)}writeBigInt64BE(o){const l=this.alloc(8);this._buffer.writeBigInt64BE(o,l)}writeBigUInt64BE(o){const l=this.alloc(8);this._buffer.writeBigUInt64BE(o,l)}writeFloatBE(o){const l=this.alloc(4);this._buffer.writeFloatBE(o,l)}writeDoubleBE(o){const l=this.alloc(8);this._buffer.writeDoubleBE(o,l)}static bufferChunkSize=I}var S=p(764).lW;class B{toXDR(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"raw";if(!this.write)return this.constructor.toXDR(this,o);const l=new O;return this.write(this,l),M(l.finalize(),o)}fromXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";if(!this.read)return this.constructor.fromXDR(o,l);const w=new y(q(o,l)),A=this.read(w);return w.ensureInputConsumed(),A}validateXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(o,l),!0}catch{return!1}}static toXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";const w=new O;return this.write(o,w),M(w.finalize(),l)}static fromXDR(o){const l=new y(q(o,arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw")),w=this.read(l);return l.ensureInputConsumed(),w}static validateXDR(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"raw";try{return this.fromXDR(o,l),!0}catch{return!1}}}class $ extends B{static read(o){throw new _}static write(o,l){throw new _}static isValid(o){return!1}}class R extends B{isValid(o){return!1}}class D extends TypeError{constructor(o){super(`Invalid format ${o}, must be one of "raw", "hex", "base64"`)}}function M(d,o){switch(o){case"raw":return d;case"hex":return d.toString("hex");case"base64":return d.toString("base64");default:throw new D(o)}}function q(d,o){switch(o){case"raw":return d;case"hex":return S.from(d,"hex");case"base64":return S.from(d,"base64");default:throw new D(o)}}const V=2147483647,Y=-2147483648;class z extends ${static read(o){return o.readInt32BE()}static write(o,l){if(typeof o!="number")throw new h("not a number");if((0|o)!==o)throw new h("invalid i32 value");l.writeInt32BE(o)}static isValid(o){return typeof o=="number"&&(0|o)===o&&o>=Y&&o<=V}}z.MAX_VALUE=V,z.MIN_VALUE=2147483648;const ne=-9223372036854775808n,ae=9223372036854775807n;class L extends ${constructor(o,l){if(super(),typeof o=="bigint"){if(o<ne||o>ae)throw new TypeError("Invalid i64 value");this._value=o}else{if((0|o)!==o||(0|l)!==l)throw new TypeError("Invalid i64 value");this._value=BigInt(l>>>0)<<32n|BigInt(o>>>0)}}get low(){return Number(0xFFFFFFFFn&this._value)<<0}get high(){return Number(this._value>>32n)>>0}get unsigned(){return!1}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}static read(o){return new L(o.readBigInt64BE())}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a Hyper`);l.writeBigInt64BE(o._value)}static fromString(o){if(!/^-?\d{0,19}$/.test(o))throw new TypeError(`Invalid i64 string value: ${o}`);return new L(BigInt(o))}static fromBits(o,l){return new this(o,l)}static isValid(o){return o instanceof this}}L.MAX_VALUE=new L(ae),L.MIN_VALUE=new L(ne);const Z=4294967295;class N extends ${static read(o){return o.readUInt32BE()}static write(o,l){if(typeof o!="number"||!(o>=0&&o<=Z)||o%1!=0)throw new h("invalid u32 value");l.writeUInt32BE(o)}static isValid(o){return typeof o=="number"&&o%1==0&&o>=0&&o<=Z}}N.MAX_VALUE=Z,N.MIN_VALUE=0;const se=0n,ut=0xFFFFFFFFFFFFFFFFn;class ie extends ${constructor(o,l){if(super(),typeof o=="bigint"){if(o<se||o>ut)throw new TypeError("Invalid u64 value");this._value=o}else{if((0|o)!==o||(0|l)!==l)throw new TypeError("Invalid u64 value");this._value=BigInt(l>>>0)<<32n|BigInt(o>>>0)}}get low(){return Number(0xFFFFFFFFn&this._value)<<0}get high(){return Number(this._value>>32n)>>0}get unsigned(){return!0}toString(){return this._value.toString()}toJSON(){return{_value:this._value.toString()}}static read(o){return new ie(o.readBigUInt64BE())}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not an UnsignedHyper`);l.writeBigUInt64BE(o._value)}static fromString(o){if(!/^\d{0,20}$/.test(o))throw new TypeError(`Invalid u64 string value: ${o}`);return new ie(BigInt(o))}static fromBits(o,l){return new this(o,l)}static isValid(o){return o instanceof this}}ie.MAX_VALUE=new ie(ut),ie.MIN_VALUE=new ie(se);class Pe extends ${static read(o){return o.readFloatBE()}static write(o,l){if(typeof o!="number")throw new h("not a number");l.writeFloatBE(o)}static isValid(o){return typeof o=="number"}}class hr extends ${static read(o){return o.readDoubleBE()}static write(o,l){if(typeof o!="number")throw new h("not a number");l.writeDoubleBE(o)}static isValid(o){return typeof o=="number"}}class k extends ${static read(){throw new v("quadruple not supported")}static write(){throw new v("quadruple not supported")}static isValid(){return!1}}class G extends ${static read(o){const l=z.read(o);switch(l){case 0:return!1;case 1:return!0;default:throw new m(`got ${l} when trying to read a bool`)}}static write(o,l){const w=o?1:0;z.write(w,l)}static isValid(o){return typeof o=="boolean"}}var ct=p(764).lW;class $t extends R{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N.MAX_VALUE;super(),this._maxLength=o}read(o){const l=N.read(o);if(l>this._maxLength)throw new m(`saw ${l} length String, max allowed is ${this._maxLength}`);return o.read(l)}readString(o){return this.read(o).toString("utf8")}write(o,l){const w=typeof o=="string"?ct.byteLength(o,"utf8"):o.length;if(w>this._maxLength)throw new h(`got ${o.length} bytes, max allowed is ${this._maxLength}`);N.write(w,l),l.write(o,w)}isValid(o){return typeof o=="string"?ct.byteLength(o,"utf8")<=this._maxLength:!!(o instanceof Array||ct.isBuffer(o))&&o.length<=this._maxLength}}var dr=p(764).lW;class Pt extends R{constructor(o){super(),this._length=o}read(o){return o.read(this._length)}write(o,l){const{length:w}=o;if(w!==this._length)throw new h(`got ${o.length} bytes, expected ${this._length}`);l.write(o,w)}isValid(o){return dr.isBuffer(o)&&o.length===this._length}}var yr=p(764).lW;class Se extends R{constructor(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:N.MAX_VALUE;super(),this._maxLength=o}read(o){const l=N.read(o);if(l>this._maxLength)throw new m(`saw ${l} length VarOpaque, max allowed is ${this._maxLength}`);return o.read(l)}write(o,l){const{length:w}=o;if(o.length>this._maxLength)throw new h(`got ${o.length} bytes, max allowed is ${this._maxLength}`);N.write(w,l),l.write(o,w)}isValid(o){return yr.isBuffer(o)&&o.length<=this._maxLength}}class ft extends R{constructor(o,l){super(),this._childType=o,this._length=l}read(o){const l=new p.g.Array(this._length);for(let w=0;w<this._length;w++)l[w]=this._childType.read(o);return l}write(o,l){if(!(o instanceof p.g.Array))throw new h("value is not array");if(o.length!==this._length)throw new h(`got array of size ${o.length}, expected ${this._length}`);for(const w of o)this._childType.write(w,l)}isValid(o){if(!(o instanceof p.g.Array)||o.length!==this._length)return!1;for(const l of o)if(!this._childType.isValid(l))return!1;return!0}}class Ft extends R{constructor(o){let l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:N.MAX_VALUE;super(),this._childType=o,this._maxLength=l}read(o){const l=N.read(o);if(l>this._maxLength)throw new m(`saw ${l} length VarArray, max allowed is ${this._maxLength}`);const w=new Array(l);for(let A=0;A<l;A++)w[A]=this._childType.read(o);return w}write(o,l){if(!(o instanceof Array))throw new h("value is not array");if(o.length>this._maxLength)throw new h(`got array of size ${o.length}, max allowed is ${this._maxLength}`);N.write(o.length,l);for(const w of o)this._childType.write(w,l)}isValid(o){if(!(o instanceof Array)||o.length>this._maxLength)return!1;for(const l of o)if(!this._childType.isValid(l))return!1;return!0}}class Ut extends ${constructor(o){super(),this._childType=o}read(o){if(G.read(o))return this._childType.read(o)}write(o,l){const w=o!=null;G.write(w,l),w&&this._childType.write(o,l)}isValid(o){return o==null||this._childType.isValid(o)}}class J extends ${static read(){}static write(o){if(o!==void 0)throw new h("trying to write value to a void slot")}static isValid(o){return o===void 0}}class _e extends ${constructor(o,l){super(),this.name=o,this.value=l}static read(o){const l=z.read(o),w=this._byValue[l];if(w===void 0)throw new m(`unknown ${this.enumName} member for value ${l}`);return w}static write(o,l){if(!(o instanceof this))throw new h(`unknown ${o} is not a ${this.enumName}`);z.write(o.value,l)}static isValid(o){return o instanceof this}static members(){return this._members}static values(){return Object.values(this._members)}static fromName(o){const l=this._members[o];if(!l)throw new TypeError(`${o} is not a member of ${this.enumName}`);return l}static fromValue(o){const l=this._byValue[o];if(l===void 0)throw new TypeError(`${o} is not a value of any member of ${this.enumName}`);return l}static create(o,l,w){const A=class extends _e{};A.enumName=l,o.results[l]=A,A._members={},A._byValue={};for(const[F,P]of Object.entries(w)){const U=new A(F,P);A._members[F]=U,A._byValue[P]=U,A[F]=()=>U}return A}}class ee extends ${resolve(){throw new v('"resolve" method should be implemented in the descendant class')}}class Fe extends ${constructor(o){super(),this._attributes=o||{}}static read(o){const l={};for(const[w,A]of this._fields)l[w]=A.read(o);return new this(l)}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a ${this.structName}`);for(const[w,A]of this._fields){const F=o._attributes[w];A.write(F,l)}}static isValid(o){return o instanceof this}static create(o,l,w){const A=class extends Fe{};A.structName=l,o.results[l]=A;const F=new Array(w.length);for(let P=0;P<w.length;P++){const U=w[P],Ct=U[0];let mr=U[1];mr instanceof ee&&(mr=mr.resolve(o)),F[P]=[Ct,mr],A.prototype[Ct]=gr(Ct)}return A._fields=F,A}}function gr(d){return function(o){return o!==void 0&&(this._attributes[d]=o),this._attributes[d]}}class Ie extends R{constructor(o,l){super(),this.set(o,l)}set(o,l){typeof o=="string"&&(o=this.constructor._switchOn.fromName(o)),this._switch=o;const w=this.constructor.armForSwitch(this._switch);this._arm=w,this._armType=w===J?J:this.constructor._arms[w],this._value=l}get(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this._arm;if(this._arm!==J&&this._arm!==o)throw new TypeError(`${o} not set`);return this._value}switch(){return this._switch}arm(){return this._arm}armType(){return this._armType}value(){return this._value}static armForSwitch(o){const l=this._switches.get(o);if(l!==void 0)return l;if(this._defaultArm)return this._defaultArm;throw new TypeError(`Bad union switch: ${o}`)}static armTypeForArm(o){return o===J?J:this._arms[o]}static read(o){const l=this._switchOn.read(o),w=this.armForSwitch(l),A=w===J?J:this._arms[w];let F;return F=A!==void 0?A.read(o):w.read(o),new this(l,F)}static write(o,l){if(!(o instanceof this))throw new h(`${o} is not a ${this.unionName}`);this._switchOn.write(o.switch(),l),o.armType().write(o.value(),l)}static isValid(o){return o instanceof this}static create(o,l,w){const A=class extends Ie{};A.unionName=l,o.results[l]=A,w.switchOn instanceof ee?A._switchOn=w.switchOn.resolve(o):A._switchOn=w.switchOn,A._switches=new Map,A._arms={};let F=w.defaultArm;F instanceof ee&&(F=F.resolve(o)),A._defaultArm=F;for(const[P,U]of w.switches){const Ct=typeof P=="string"?A._switchOn.fromName(P):P;A._switches.set(Ct,U)}if(A._switchOn.values!==void 0)for(const P of A._switchOn.values())A[P.name]=function(U){return new A(P,U)},A.prototype[P.name]=function(U){return this.set(P,U)};if(w.arms)for(const[P,U]of Object.entries(w.arms))A._arms[P]=U instanceof ee?U.resolve(o):U,U!==J&&(A.prototype[P]=function(){return this.get(P)});return A}}class fe extends ee{constructor(o){super(),this.name=o}resolve(o){return o.definitions[this.name].resolve(o)}}class lt extends ee{constructor(o,l){let w=arguments.length>2&&arguments[2]!==void 0&&arguments[2];super(),this.childReference=o,this.length=l,this.variable=w}resolve(o){let l=this.childReference,w=this.length;return l instanceof ee&&(l=l.resolve(o)),w instanceof ee&&(w=w.resolve(o)),this.variable?new Ft(l,w):new ft(l,w)}}class En extends ee{constructor(o){super(),this.childReference=o,this.name=o.name}resolve(o){let l=this.childReference;return l instanceof ee&&(l=l.resolve(o)),new Ut(l)}}class le extends ee{constructor(o,l){super(),this.sizedType=o,this.length=l}resolve(o){let l=this.length;return l instanceof ee&&(l=l.resolve(o)),new this.sizedType(l)}}class We{constructor(o,l,w){this.constructor=o,this.name=l,this.config=w}resolve(o){return this.name in o.results?o.results[this.name]:this.constructor(o,this.name,this.config)}}function i(d,o,l){return l instanceof ee&&(l=l.resolve(d)),d.results[o]=l,l}function u(d,o,l){return d.results[o]=l,l}class c{constructor(o){this._destination=o,this._definitions={}}enum(o,l){const w=new We(_e.create,o,l);this.define(o,w)}struct(o,l){const w=new We(Fe.create,o,l);this.define(o,w)}union(o,l){const w=new We(Ie.create,o,l);this.define(o,w)}typedef(o,l){const w=new We(i,o,l);this.define(o,w)}const(o,l){const w=new We(u,o,l);this.define(o,w)}void(){return J}bool(){return G}int(){return z}hyper(){return L}uint(){return N}uhyper(){return ie}float(){return Pe}double(){return hr}quadruple(){return k}string(o){return new le($t,o)}opaque(o){return new le(Pt,o)}varOpaque(o){return new le(Se,o)}array(o,l){return new lt(o,l)}varArray(o,l){return new lt(o,l,!0)}option(o){return new En(o)}define(o,l){if(this._destination[o]!==void 0)throw new v(`${o} is already defined`);this._definitions[o]=l}lookup(o){return new fe(o)}resolve(){for(const o of Object.values(this._definitions))o.resolve({definitions:this._definitions,results:this._destination})}}function g(d){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(d){const l=new c(o);d(l),l.resolve()}return o}},742:(s,f)=>{f.byteLength=function(x){var I=b(x),O=I[0],S=I[1];return 3*(O+S)/4-S},f.toByteArray=function(x){var I,O,S=b(x),B=S[0],$=S[1],R=new m(function(q,V,Y){return 3*(V+Y)/4-Y}(0,B,$)),D=0,M=$>0?B-4:B;for(O=0;O<M;O+=4)I=h[x.charCodeAt(O)]<<18|h[x.charCodeAt(O+1)]<<12|h[x.charCodeAt(O+2)]<<6|h[x.charCodeAt(O+3)],R[D++]=I>>16&255,R[D++]=I>>8&255,R[D++]=255&I;return $===2&&(I=h[x.charCodeAt(O)]<<2|h[x.charCodeAt(O+1)]>>4,R[D++]=255&I),$===1&&(I=h[x.charCodeAt(O)]<<10|h[x.charCodeAt(O+1)]<<4|h[x.charCodeAt(O+2)]>>2,R[D++]=I>>8&255,R[D++]=255&I),R},f.fromByteArray=function(x){for(var I,O=x.length,S=O%3,B=[],$=16383,R=0,D=O-S;R<D;R+=$)B.push(y(x,R,R+$>D?D:R+$));return S===1?(I=x[O-1],B.push(p[I>>2]+p[I<<4&63]+"==")):S===2&&(I=(x[O-2]<<8)+x[O-1],B.push(p[I>>10]+p[I>>4&63]+p[I<<2&63]+"=")),B.join("")};for(var p=[],h=[],m=typeof Uint8Array<"u"?Uint8Array:Array,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_=0;_<64;++_)p[_]=v[_],h[v.charCodeAt(_)]=_;function b(x){var I=x.length;if(I%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var O=x.indexOf("=");return O===-1&&(O=I),[O,O===I?0:4-O%4]}function y(x,I,O){for(var S,B,$=[],R=I;R<O;R+=3)S=(x[R]<<16&16711680)+(x[R+1]<<8&65280)+(255&x[R+2]),$.push(p[(B=S)>>18&63]+p[B>>12&63]+p[B>>6&63]+p[63&B]);return $.join("")}h["-".charCodeAt(0)]=62,h["_".charCodeAt(0)]=63},764:(s,f,p)=>{const h=p(742),m=p(645),v=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;f.lW=y,f.h2=50;const _=2147483647;function b(i){if(i>_)throw new RangeError('The value "'+i+'" is invalid for option "size"');const u=new Uint8Array(i);return Object.setPrototypeOf(u,y.prototype),u}function y(i,u,c){if(typeof i=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return O(i)}return x(i,u,c)}function x(i,u,c){if(typeof i=="string")return function(o,l){if(typeof l=="string"&&l!==""||(l="utf8"),!y.isEncoding(l))throw new TypeError("Unknown encoding: "+l);const w=0|R(o,l);let A=b(w);const F=A.write(o,l);return F!==w&&(A=A.slice(0,F)),A}(i,u);if(ArrayBuffer.isView(i))return function(o){if(fe(o,Uint8Array)){const l=new Uint8Array(o);return B(l.buffer,l.byteOffset,l.byteLength)}return S(o)}(i);if(i==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i);if(fe(i,ArrayBuffer)||i&&fe(i.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(fe(i,SharedArrayBuffer)||i&&fe(i.buffer,SharedArrayBuffer)))return B(i,u,c);if(typeof i=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const g=i.valueOf&&i.valueOf();if(g!=null&&g!==i)return y.from(g,u,c);const d=function(o){if(y.isBuffer(o)){const l=0|$(o.length),w=b(l);return w.length===0||o.copy(w,0,0,l),w}if(o.length!==void 0)return typeof o.length!="number"||lt(o.length)?b(0):S(o);if(o.type==="Buffer"&&Array.isArray(o.data))return S(o.data)}(i);if(d)return d;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof i[Symbol.toPrimitive]=="function")return y.from(i[Symbol.toPrimitive]("string"),u,c);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof i)}function I(i){if(typeof i!="number")throw new TypeError('"size" argument must be of type number');if(i<0)throw new RangeError('The value "'+i+'" is invalid for option "size"')}function O(i){return I(i),b(i<0?0:0|$(i))}function S(i){const u=i.length<0?0:0|$(i.length),c=b(u);for(let g=0;g<u;g+=1)c[g]=255&i[g];return c}function B(i,u,c){if(u<0||i.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<u+(c||0))throw new RangeError('"length" is outside of buffer bounds');let g;return g=u===void 0&&c===void 0?new Uint8Array(i):c===void 0?new Uint8Array(i,u):new Uint8Array(i,u,c),Object.setPrototypeOf(g,y.prototype),g}function $(i){if(i>=_)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_.toString(16)+" bytes");return 0|i}function R(i,u){if(y.isBuffer(i))return i.length;if(ArrayBuffer.isView(i)||fe(i,ArrayBuffer))return i.byteLength;if(typeof i!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof i);const c=i.length,g=arguments.length>2&&arguments[2]===!0;if(!g&&c===0)return 0;let d=!1;for(;;)switch(u){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return Fe(i).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return gr(i).length;default:if(d)return g?-1:Fe(i).length;u=(""+u).toLowerCase(),d=!0}}function D(i,u,c){let g=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((c===void 0||c>this.length)&&(c=this.length),c<=0)||(c>>>=0)<=(u>>>=0))return"";for(i||(i="utf8");;)switch(i){case"hex":return Pe(this,u,c);case"utf8":case"utf-8":return N(this,u,c);case"ascii":return ut(this,u,c);case"latin1":case"binary":return ie(this,u,c);case"base64":return Z(this,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return hr(this,u,c);default:if(g)throw new TypeError("Unknown encoding: "+i);i=(i+"").toLowerCase(),g=!0}}function M(i,u,c){const g=i[u];i[u]=i[c],i[c]=g}function q(i,u,c,g,d){if(i.length===0)return-1;if(typeof c=="string"?(g=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),lt(c=+c)&&(c=d?0:i.length-1),c<0&&(c=i.length+c),c>=i.length){if(d)return-1;c=i.length-1}else if(c<0){if(!d)return-1;c=0}if(typeof u=="string"&&(u=y.from(u,g)),y.isBuffer(u))return u.length===0?-1:V(i,u,c,g,d);if(typeof u=="number")return u&=255,typeof Uint8Array.prototype.indexOf=="function"?d?Uint8Array.prototype.indexOf.call(i,u,c):Uint8Array.prototype.lastIndexOf.call(i,u,c):V(i,[u],c,g,d);throw new TypeError("val must be string, number or Buffer")}function V(i,u,c,g,d){let o,l=1,w=i.length,A=u.length;if(g!==void 0&&((g=String(g).toLowerCase())==="ucs2"||g==="ucs-2"||g==="utf16le"||g==="utf-16le")){if(i.length<2||u.length<2)return-1;l=2,w/=2,A/=2,c/=2}function F(P,U){return l===1?P[U]:P.readUInt16BE(U*l)}if(d){let P=-1;for(o=c;o<w;o++)if(F(i,o)===F(u,P===-1?0:o-P)){if(P===-1&&(P=o),o-P+1===A)return P*l}else P!==-1&&(o-=o-P),P=-1}else for(c+A>w&&(c=w-A),o=c;o>=0;o--){let P=!0;for(let U=0;U<A;U++)if(F(i,o+U)!==F(u,U)){P=!1;break}if(P)return o}return-1}function Y(i,u,c,g){c=Number(c)||0;const d=i.length-c;g?(g=Number(g))>d&&(g=d):g=d;const o=u.length;let l;for(g>o/2&&(g=o/2),l=0;l<g;++l){const w=parseInt(u.substr(2*l,2),16);if(lt(w))return l;i[c+l]=w}return l}function z(i,u,c,g){return Ie(Fe(u,i.length-c),i,c,g)}function ne(i,u,c,g){return Ie(function(d){const o=[];for(let l=0;l<d.length;++l)o.push(255&d.charCodeAt(l));return o}(u),i,c,g)}function ae(i,u,c,g){return Ie(gr(u),i,c,g)}function L(i,u,c,g){return Ie(function(d,o){let l,w,A;const F=[];for(let P=0;P<d.length&&!((o-=2)<0);++P)l=d.charCodeAt(P),w=l>>8,A=l%256,F.push(A),F.push(w);return F}(u,i.length-c),i,c,g)}function Z(i,u,c){return u===0&&c===i.length?h.fromByteArray(i):h.fromByteArray(i.slice(u,c))}function N(i,u,c){c=Math.min(i.length,c);const g=[];let d=u;for(;d<c;){const o=i[d];let l=null,w=o>239?4:o>223?3:o>191?2:1;if(d+w<=c){let A,F,P,U;switch(w){case 1:o<128&&(l=o);break;case 2:A=i[d+1],(192&A)==128&&(U=(31&o)<<6|63&A,U>127&&(l=U));break;case 3:A=i[d+1],F=i[d+2],(192&A)==128&&(192&F)==128&&(U=(15&o)<<12|(63&A)<<6|63&F,U>2047&&(U<55296||U>57343)&&(l=U));break;case 4:A=i[d+1],F=i[d+2],P=i[d+3],(192&A)==128&&(192&F)==128&&(192&P)==128&&(U=(15&o)<<18|(63&A)<<12|(63&F)<<6|63&P,U>65535&&U<1114112&&(l=U))}}l===null?(l=65533,w=1):l>65535&&(l-=65536,g.push(l>>>10&1023|55296),l=56320|1023&l),g.push(l),d+=w}return function(o){const l=o.length;if(l<=se)return String.fromCharCode.apply(String,o);let w="",A=0;for(;A<l;)w+=String.fromCharCode.apply(String,o.slice(A,A+=se));return w}(g)}y.TYPED_ARRAY_SUPPORT=function(){try{const i=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(i,u),i.foo()===42}catch{return!1}}(),y.TYPED_ARRAY_SUPPORT||typeof console>"u"||typeof console.error!="function"||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}}),Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}}),y.poolSize=8192,y.from=function(i,u,c){return x(i,u,c)},Object.setPrototypeOf(y.prototype,Uint8Array.prototype),Object.setPrototypeOf(y,Uint8Array),y.alloc=function(i,u,c){return function(g,d,o){return I(g),g<=0?b(g):d!==void 0?typeof o=="string"?b(g).fill(d,o):b(g).fill(d):b(g)}(i,u,c)},y.allocUnsafe=function(i){return O(i)},y.allocUnsafeSlow=function(i){return O(i)},y.isBuffer=function(i){return i!=null&&i._isBuffer===!0&&i!==y.prototype},y.compare=function(i,u){if(fe(i,Uint8Array)&&(i=y.from(i,i.offset,i.byteLength)),fe(u,Uint8Array)&&(u=y.from(u,u.offset,u.byteLength)),!y.isBuffer(i)||!y.isBuffer(u))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(i===u)return 0;let c=i.length,g=u.length;for(let d=0,o=Math.min(c,g);d<o;++d)if(i[d]!==u[d]){c=i[d],g=u[d];break}return c<g?-1:g<c?1:0},y.isEncoding=function(i){switch(String(i).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},y.concat=function(i,u){if(!Array.isArray(i))throw new TypeError('"list" argument must be an Array of Buffers');if(i.length===0)return y.alloc(0);let c;if(u===void 0)for(u=0,c=0;c<i.length;++c)u+=i[c].length;const g=y.allocUnsafe(u);let d=0;for(c=0;c<i.length;++c){let o=i[c];if(fe(o,Uint8Array))d+o.length>g.length?(y.isBuffer(o)||(o=y.from(o)),o.copy(g,d)):Uint8Array.prototype.set.call(g,o,d);else{if(!y.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(g,d)}d+=o.length}return g},y.byteLength=R,y.prototype._isBuffer=!0,y.prototype.swap16=function(){const i=this.length;if(i%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let u=0;u<i;u+=2)M(this,u,u+1);return this},y.prototype.swap32=function(){const i=this.length;if(i%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let u=0;u<i;u+=4)M(this,u,u+3),M(this,u+1,u+2);return this},y.prototype.swap64=function(){const i=this.length;if(i%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let u=0;u<i;u+=8)M(this,u,u+7),M(this,u+1,u+6),M(this,u+2,u+5),M(this,u+3,u+4);return this},y.prototype.toString=function(){const i=this.length;return i===0?"":arguments.length===0?N(this,0,i):D.apply(this,arguments)},y.prototype.toLocaleString=y.prototype.toString,y.prototype.equals=function(i){if(!y.isBuffer(i))throw new TypeError("Argument must be a Buffer");return this===i||y.compare(this,i)===0},y.prototype.inspect=function(){let i="";const u=f.h2;return i=this.toString("hex",0,u).replace(/(.{2})/g,"$1 ").trim(),this.length>u&&(i+=" ... "),"<Buffer "+i+">"},v&&(y.prototype[v]=y.prototype.inspect),y.prototype.compare=function(i,u,c,g,d){if(fe(i,Uint8Array)&&(i=y.from(i,i.offset,i.byteLength)),!y.isBuffer(i))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof i);if(u===void 0&&(u=0),c===void 0&&(c=i?i.length:0),g===void 0&&(g=0),d===void 0&&(d=this.length),u<0||c>i.length||g<0||d>this.length)throw new RangeError("out of range index");if(g>=d&&u>=c)return 0;if(g>=d)return-1;if(u>=c)return 1;if(this===i)return 0;let o=(d>>>=0)-(g>>>=0),l=(c>>>=0)-(u>>>=0);const w=Math.min(o,l),A=this.slice(g,d),F=i.slice(u,c);for(let P=0;P<w;++P)if(A[P]!==F[P]){o=A[P],l=F[P];break}return o<l?-1:l<o?1:0},y.prototype.includes=function(i,u,c){return this.indexOf(i,u,c)!==-1},y.prototype.indexOf=function(i,u,c){return q(this,i,u,c,!0)},y.prototype.lastIndexOf=function(i,u,c){return q(this,i,u,c,!1)},y.prototype.write=function(i,u,c,g){if(u===void 0)g="utf8",c=this.length,u=0;else if(c===void 0&&typeof u=="string")g=u,c=this.length,u=0;else{if(!isFinite(u))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");u>>>=0,isFinite(c)?(c>>>=0,g===void 0&&(g="utf8")):(g=c,c=void 0)}const d=this.length-u;if((c===void 0||c>d)&&(c=d),i.length>0&&(c<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");g||(g="utf8");let o=!1;for(;;)switch(g){case"hex":return Y(this,i,u,c);case"utf8":case"utf-8":return z(this,i,u,c);case"ascii":case"latin1":case"binary":return ne(this,i,u,c);case"base64":return ae(this,i,u,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,i,u,c);default:if(o)throw new TypeError("Unknown encoding: "+g);g=(""+g).toLowerCase(),o=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const se=4096;function ut(i,u,c){let g="";c=Math.min(i.length,c);for(let d=u;d<c;++d)g+=String.fromCharCode(127&i[d]);return g}function ie(i,u,c){let g="";c=Math.min(i.length,c);for(let d=u;d<c;++d)g+=String.fromCharCode(i[d]);return g}function Pe(i,u,c){const g=i.length;(!u||u<0)&&(u=0),(!c||c<0||c>g)&&(c=g);let d="";for(let o=u;o<c;++o)d+=En[i[o]];return d}function hr(i,u,c){const g=i.slice(u,c);let d="";for(let o=0;o<g.length-1;o+=2)d+=String.fromCharCode(g[o]+256*g[o+1]);return d}function k(i,u,c){if(i%1!=0||i<0)throw new RangeError("offset is not uint");if(i+u>c)throw new RangeError("Trying to access beyond buffer length")}function G(i,u,c,g,d,o){if(!y.isBuffer(i))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>d||u<o)throw new RangeError('"value" argument is out of bounds');if(c+g>i.length)throw new RangeError("Index out of range")}function ct(i,u,c,g,d){Ut(u,g,d,i,c,7);let o=Number(u&BigInt(4294967295));i[c++]=o,o>>=8,i[c++]=o,o>>=8,i[c++]=o,o>>=8,i[c++]=o;let l=Number(u>>BigInt(32)&BigInt(4294967295));return i[c++]=l,l>>=8,i[c++]=l,l>>=8,i[c++]=l,l>>=8,i[c++]=l,c}function $t(i,u,c,g,d){Ut(u,g,d,i,c,7);let o=Number(u&BigInt(4294967295));i[c+7]=o,o>>=8,i[c+6]=o,o>>=8,i[c+5]=o,o>>=8,i[c+4]=o;let l=Number(u>>BigInt(32)&BigInt(4294967295));return i[c+3]=l,l>>=8,i[c+2]=l,l>>=8,i[c+1]=l,l>>=8,i[c]=l,c+8}function dr(i,u,c,g,d,o){if(c+g>i.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function Pt(i,u,c,g,d){return u=+u,c>>>=0,d||dr(i,0,c,4),m.write(i,u,c,g,23,4),c+4}function yr(i,u,c,g,d){return u=+u,c>>>=0,d||dr(i,0,c,8),m.write(i,u,c,g,52,8),c+8}y.prototype.slice=function(i,u){const c=this.length;(i=~~i)<0?(i+=c)<0&&(i=0):i>c&&(i=c),(u=u===void 0?c:~~u)<0?(u+=c)<0&&(u=0):u>c&&(u=c),u<i&&(u=i);const g=this.subarray(i,u);return Object.setPrototypeOf(g,y.prototype),g},y.prototype.readUintLE=y.prototype.readUIntLE=function(i,u,c){i>>>=0,u>>>=0,c||k(i,u,this.length);let g=this[i],d=1,o=0;for(;++o<u&&(d*=256);)g+=this[i+o]*d;return g},y.prototype.readUintBE=y.prototype.readUIntBE=function(i,u,c){i>>>=0,u>>>=0,c||k(i,u,this.length);let g=this[i+--u],d=1;for(;u>0&&(d*=256);)g+=this[i+--u]*d;return g},y.prototype.readUint8=y.prototype.readUInt8=function(i,u){return i>>>=0,u||k(i,1,this.length),this[i]},y.prototype.readUint16LE=y.prototype.readUInt16LE=function(i,u){return i>>>=0,u||k(i,2,this.length),this[i]|this[i+1]<<8},y.prototype.readUint16BE=y.prototype.readUInt16BE=function(i,u){return i>>>=0,u||k(i,2,this.length),this[i]<<8|this[i+1]},y.prototype.readUint32LE=y.prototype.readUInt32LE=function(i,u){return i>>>=0,u||k(i,4,this.length),(this[i]|this[i+1]<<8|this[i+2]<<16)+16777216*this[i+3]},y.prototype.readUint32BE=y.prototype.readUInt32BE=function(i,u){return i>>>=0,u||k(i,4,this.length),16777216*this[i]+(this[i+1]<<16|this[i+2]<<8|this[i+3])},y.prototype.readBigUInt64LE=le(function(i){J(i>>>=0,"offset");const u=this[i],c=this[i+7];u!==void 0&&c!==void 0||_e(i,this.length-8);const g=u+256*this[++i]+65536*this[++i]+this[++i]*2**24,d=this[++i]+256*this[++i]+65536*this[++i]+c*2**24;return BigInt(g)+(BigInt(d)<<BigInt(32))}),y.prototype.readBigUInt64BE=le(function(i){J(i>>>=0,"offset");const u=this[i],c=this[i+7];u!==void 0&&c!==void 0||_e(i,this.length-8);const g=u*2**24+65536*this[++i]+256*this[++i]+this[++i],d=this[++i]*2**24+65536*this[++i]+256*this[++i]+c;return(BigInt(g)<<BigInt(32))+BigInt(d)}),y.prototype.readIntLE=function(i,u,c){i>>>=0,u>>>=0,c||k(i,u,this.length);let g=this[i],d=1,o=0;for(;++o<u&&(d*=256);)g+=this[i+o]*d;return d*=128,g>=d&&(g-=Math.pow(2,8*u)),g},y.prototype.readIntBE=function(i,u,c){i>>>=0,u>>>=0,c||k(i,u,this.length);let g=u,d=1,o=this[i+--g];for(;g>0&&(d*=256);)o+=this[i+--g]*d;return d*=128,o>=d&&(o-=Math.pow(2,8*u)),o},y.prototype.readInt8=function(i,u){return i>>>=0,u||k(i,1,this.length),128&this[i]?-1*(255-this[i]+1):this[i]},y.prototype.readInt16LE=function(i,u){i>>>=0,u||k(i,2,this.length);const c=this[i]|this[i+1]<<8;return 32768&c?4294901760|c:c},y.prototype.readInt16BE=function(i,u){i>>>=0,u||k(i,2,this.length);const c=this[i+1]|this[i]<<8;return 32768&c?4294901760|c:c},y.prototype.readInt32LE=function(i,u){return i>>>=0,u||k(i,4,this.length),this[i]|this[i+1]<<8|this[i+2]<<16|this[i+3]<<24},y.prototype.readInt32BE=function(i,u){return i>>>=0,u||k(i,4,this.length),this[i]<<24|this[i+1]<<16|this[i+2]<<8|this[i+3]},y.prototype.readBigInt64LE=le(function(i){J(i>>>=0,"offset");const u=this[i],c=this[i+7];u!==void 0&&c!==void 0||_e(i,this.length-8);const g=this[i+4]+256*this[i+5]+65536*this[i+6]+(c<<24);return(BigInt(g)<<BigInt(32))+BigInt(u+256*this[++i]+65536*this[++i]+this[++i]*16777216)}),y.prototype.readBigInt64BE=le(function(i){J(i>>>=0,"offset");const u=this[i],c=this[i+7];u!==void 0&&c!==void 0||_e(i,this.length-8);const g=(u<<24)+65536*this[++i]+256*this[++i]+this[++i];return(BigInt(g)<<BigInt(32))+BigInt(this[++i]*16777216+65536*this[++i]+256*this[++i]+c)}),y.prototype.readFloatLE=function(i,u){return i>>>=0,u||k(i,4,this.length),m.read(this,i,!0,23,4)},y.prototype.readFloatBE=function(i,u){return i>>>=0,u||k(i,4,this.length),m.read(this,i,!1,23,4)},y.prototype.readDoubleLE=function(i,u){return i>>>=0,u||k(i,8,this.length),m.read(this,i,!0,52,8)},y.prototype.readDoubleBE=function(i,u){return i>>>=0,u||k(i,8,this.length),m.read(this,i,!1,52,8)},y.prototype.writeUintLE=y.prototype.writeUIntLE=function(i,u,c,g){i=+i,u>>>=0,c>>>=0,!g&&G(this,i,u,c,Math.pow(2,8*c)-1,0);let d=1,o=0;for(this[u]=255&i;++o<c&&(d*=256);)this[u+o]=i/d&255;return u+c},y.prototype.writeUintBE=y.prototype.writeUIntBE=function(i,u,c,g){i=+i,u>>>=0,c>>>=0,!g&&G(this,i,u,c,Math.pow(2,8*c)-1,0);let d=c-1,o=1;for(this[u+d]=255&i;--d>=0&&(o*=256);)this[u+d]=i/o&255;return u+c},y.prototype.writeUint8=y.prototype.writeUInt8=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,1,255,0),this[u]=255&i,u+1},y.prototype.writeUint16LE=y.prototype.writeUInt16LE=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,2,65535,0),this[u]=255&i,this[u+1]=i>>>8,u+2},y.prototype.writeUint16BE=y.prototype.writeUInt16BE=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,2,65535,0),this[u]=i>>>8,this[u+1]=255&i,u+2},y.prototype.writeUint32LE=y.prototype.writeUInt32LE=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,4,4294967295,0),this[u+3]=i>>>24,this[u+2]=i>>>16,this[u+1]=i>>>8,this[u]=255&i,u+4},y.prototype.writeUint32BE=y.prototype.writeUInt32BE=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,4,4294967295,0),this[u]=i>>>24,this[u+1]=i>>>16,this[u+2]=i>>>8,this[u+3]=255&i,u+4},y.prototype.writeBigUInt64LE=le(function(i,u=0){return ct(this,i,u,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeBigUInt64BE=le(function(i,u=0){return $t(this,i,u,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeIntLE=function(i,u,c,g){if(i=+i,u>>>=0,!g){const w=Math.pow(2,8*c-1);G(this,i,u,c,w-1,-w)}let d=0,o=1,l=0;for(this[u]=255&i;++d<c&&(o*=256);)i<0&&l===0&&this[u+d-1]!==0&&(l=1),this[u+d]=(i/o>>0)-l&255;return u+c},y.prototype.writeIntBE=function(i,u,c,g){if(i=+i,u>>>=0,!g){const w=Math.pow(2,8*c-1);G(this,i,u,c,w-1,-w)}let d=c-1,o=1,l=0;for(this[u+d]=255&i;--d>=0&&(o*=256);)i<0&&l===0&&this[u+d+1]!==0&&(l=1),this[u+d]=(i/o>>0)-l&255;return u+c},y.prototype.writeInt8=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,1,127,-128),i<0&&(i=255+i+1),this[u]=255&i,u+1},y.prototype.writeInt16LE=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,2,32767,-32768),this[u]=255&i,this[u+1]=i>>>8,u+2},y.prototype.writeInt16BE=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,2,32767,-32768),this[u]=i>>>8,this[u+1]=255&i,u+2},y.prototype.writeInt32LE=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,4,2147483647,-2147483648),this[u]=255&i,this[u+1]=i>>>8,this[u+2]=i>>>16,this[u+3]=i>>>24,u+4},y.prototype.writeInt32BE=function(i,u,c){return i=+i,u>>>=0,c||G(this,i,u,4,2147483647,-2147483648),i<0&&(i=4294967295+i+1),this[u]=i>>>24,this[u+1]=i>>>16,this[u+2]=i>>>8,this[u+3]=255&i,u+4},y.prototype.writeBigInt64LE=le(function(i,u=0){return ct(this,i,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),y.prototype.writeBigInt64BE=le(function(i,u=0){return $t(this,i,u,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),y.prototype.writeFloatLE=function(i,u,c){return Pt(this,i,u,!0,c)},y.prototype.writeFloatBE=function(i,u,c){return Pt(this,i,u,!1,c)},y.prototype.writeDoubleLE=function(i,u,c){return yr(this,i,u,!0,c)},y.prototype.writeDoubleBE=function(i,u,c){return yr(this,i,u,!1,c)},y.prototype.copy=function(i,u,c,g){if(!y.isBuffer(i))throw new TypeError("argument should be a Buffer");if(c||(c=0),g||g===0||(g=this.length),u>=i.length&&(u=i.length),u||(u=0),g>0&&g<c&&(g=c),g===c||i.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("Index out of range");if(g<0)throw new RangeError("sourceEnd out of bounds");g>this.length&&(g=this.length),i.length-u<g-c&&(g=i.length-u+c);const d=g-c;return this===i&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(u,c,g):Uint8Array.prototype.set.call(i,this.subarray(c,g),u),d},y.prototype.fill=function(i,u,c,g){if(typeof i=="string"){if(typeof u=="string"?(g=u,u=0,c=this.length):typeof c=="string"&&(g=c,c=this.length),g!==void 0&&typeof g!="string")throw new TypeError("encoding must be a string");if(typeof g=="string"&&!y.isEncoding(g))throw new TypeError("Unknown encoding: "+g);if(i.length===1){const o=i.charCodeAt(0);(g==="utf8"&&o<128||g==="latin1")&&(i=o)}}else typeof i=="number"?i&=255:typeof i=="boolean"&&(i=Number(i));if(u<0||this.length<u||this.length<c)throw new RangeError("Out of range index");if(c<=u)return this;let d;if(u>>>=0,c=c===void 0?this.length:c>>>0,i||(i=0),typeof i=="number")for(d=u;d<c;++d)this[d]=i;else{const o=y.isBuffer(i)?i:y.from(i,g),l=o.length;if(l===0)throw new TypeError('The value "'+i+'" is invalid for argument "value"');for(d=0;d<c-u;++d)this[d+u]=o[d%l]}return this};const Se={};function ft(i,u,c){Se[i]=class extends c{constructor(){super(),Object.defineProperty(this,"message",{value:u.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${i}]`,this.stack,delete this.name}get code(){return i}set code(g){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:g,writable:!0})}toString(){return`${this.name} [${i}]: ${this.message}`}}}function Ft(i){let u="",c=i.length;const g=i[0]==="-"?1:0;for(;c>=g+4;c-=3)u=`_${i.slice(c-3,c)}${u}`;return`${i.slice(0,c)}${u}`}function Ut(i,u,c,g,d,o){if(i>c||i<u){const l=typeof u=="bigint"?"n":"";let w;throw w=o>3?u===0||u===BigInt(0)?`>= 0${l} and < 2${l} ** ${8*(o+1)}${l}`:`>= -(2${l} ** ${8*(o+1)-1}${l}) and < 2 ** ${8*(o+1)-1}${l}`:`>= ${u}${l} and <= ${c}${l}`,new Se.ERR_OUT_OF_RANGE("value",w,i)}(function(l,w,A){J(w,"offset"),l[w]!==void 0&&l[w+A]!==void 0||_e(w,l.length-(A+1))})(g,d,o)}function J(i,u){if(typeof i!="number")throw new Se.ERR_INVALID_ARG_TYPE(u,"number",i)}function _e(i,u,c){throw Math.floor(i)!==i?(J(i,c),new Se.ERR_OUT_OF_RANGE(c||"offset","an integer",i)):u<0?new Se.ERR_BUFFER_OUT_OF_BOUNDS:new Se.ERR_OUT_OF_RANGE(c||"offset",`>= ${c?1:0} and <= ${u}`,i)}ft("ERR_BUFFER_OUT_OF_BOUNDS",function(i){return i?`${i} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ft("ERR_INVALID_ARG_TYPE",function(i,u){return`The "${i}" argument must be of type number. Received type ${typeof u}`},TypeError),ft("ERR_OUT_OF_RANGE",function(i,u,c){let g=`The value of "${i}" is out of range.`,d=c;return Number.isInteger(c)&&Math.abs(c)>4294967296?d=Ft(String(c)):typeof c=="bigint"&&(d=String(c),(c>BigInt(2)**BigInt(32)||c<-(BigInt(2)**BigInt(32)))&&(d=Ft(d)),d+="n"),g+=` It must be ${u}. Received ${d}`,g},RangeError);const ee=/[^+/0-9A-Za-z-_]/g;function Fe(i,u){let c;u=u||1/0;const g=i.length;let d=null;const o=[];for(let l=0;l<g;++l){if(c=i.charCodeAt(l),c>55295&&c<57344){if(!d){if(c>56319){(u-=3)>-1&&o.push(239,191,189);continue}if(l+1===g){(u-=3)>-1&&o.push(239,191,189);continue}d=c;continue}if(c<56320){(u-=3)>-1&&o.push(239,191,189),d=c;continue}c=65536+(d-55296<<10|c-56320)}else d&&(u-=3)>-1&&o.push(239,191,189);if(d=null,c<128){if((u-=1)<0)break;o.push(c)}else if(c<2048){if((u-=2)<0)break;o.push(c>>6|192,63&c|128)}else if(c<65536){if((u-=3)<0)break;o.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(c<1114112))throw new Error("Invalid code point");if((u-=4)<0)break;o.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return o}function gr(i){return h.toByteArray(function(u){if((u=(u=u.split("=")[0]).trim().replace(ee,"")).length<2)return"";for(;u.length%4!=0;)u+="=";return u}(i))}function Ie(i,u,c,g){let d;for(d=0;d<g&&!(d+c>=u.length||d>=i.length);++d)u[d+c]=i[d];return d}function fe(i,u){return i instanceof u||i!=null&&i.constructor!=null&&i.constructor.name!=null&&i.constructor.name===u.name}function lt(i){return i!=i}const En=function(){const i="0123456789abcdef",u=new Array(256);for(let c=0;c<16;++c){const g=16*c;for(let d=0;d<16;++d)u[g+d]=i[c]+i[d]}return u}();function le(i){return typeof BigInt>"u"?We:i}function We(){throw new Error("BigInt not supported")}},645:(s,f)=>{f.read=function(p,h,m,v,_){var b,y,x=8*_-v-1,I=(1<<x)-1,O=I>>1,S=-7,B=m?_-1:0,$=m?-1:1,R=p[h+B];for(B+=$,b=R&(1<<-S)-1,R>>=-S,S+=x;S>0;b=256*b+p[h+B],B+=$,S-=8);for(y=b&(1<<-S)-1,b>>=-S,S+=v;S>0;y=256*y+p[h+B],B+=$,S-=8);if(b===0)b=1-O;else{if(b===I)return y?NaN:1/0*(R?-1:1);y+=Math.pow(2,v),b-=O}return(R?-1:1)*y*Math.pow(2,b-v)},f.write=function(p,h,m,v,_,b){var y,x,I,O=8*b-_-1,S=(1<<O)-1,B=S>>1,$=_===23?Math.pow(2,-24)-Math.pow(2,-77):0,R=v?0:b-1,D=v?1:-1,M=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(x=isNaN(h)?1:0,y=S):(y=Math.floor(Math.log(h)/Math.LN2),h*(I=Math.pow(2,-y))<1&&(y--,I*=2),(h+=y+B>=1?$/I:$*Math.pow(2,1-B))*I>=2&&(y++,I/=2),y+B>=S?(x=0,y=S):y+B>=1?(x=(h*I-1)*Math.pow(2,_),y+=B):(x=h*Math.pow(2,B-1)*Math.pow(2,_),y=0));_>=8;p[m+R]=255&x,R+=D,x/=256,_-=8);for(y=y<<_|x,O+=_;O>0;p[m+R]=255&y,R+=D,y/=256,O-=8);p[m+R-D]|=128*M}}},n={};function a(s){var f=n[s];if(f!==void 0)return f.exports;var p=n[s]={exports:{}};return r[s](p,p.exports,a),p.exports}return a.d=(s,f)=>{for(var p in f)a.o(f,p)&&!a.o(s,p)&&Object.defineProperty(s,p,{enumerable:!0,get:f[p]})},a.g=function(){if(typeof globalThis=="object")return globalThis;try{return this||new Function("return this")()}catch{if(typeof window=="object")return window}}(),a.o=(s,f)=>Object.prototype.hasOwnProperty.call(s,f),a.r=s=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})},a(899)})())})(vo);function wl(t){const e={variantId:xe.Uint64.fromString(t.variantId.toString()),version:t.version||Math.floor(Date.now()/1e3),items:t.items.map(n=>new xe.BundleItem({collectionId:xe.Uint64.fromString(n.collectionId.toString()),productId:xe.Uint64.fromString(n.productId.toString()),variantId:xe.Uint64.fromString(n.variantId.toString()),sku:n.sku||"",quantity:n.quantity,ext:new xe.BundleItemExt(0)})),ext:new xe.BundleExt(0)},r=new xe.Bundle(e);return xe.BundleEnvelope.envelopeTypeBundle(r).toXDR("base64")}const xe=vo.exports.config(t=>{t.enum("EnvelopeType",{envelopeTypeBundle:0}),t.typedef("Uint32",t.uint()),t.typedef("Uint64",t.uhyper()),t.union("BundleItemExt",{switchOn:t.int(),switchName:"v",switches:[[0,t.void()]],arms:{}}),t.struct("BundleItem",[["collectionId",t.lookup("Uint64")],["productId",t.lookup("Uint64")],["variantId",t.lookup("Uint64")],["sku",t.string()],["quantity",t.lookup("Uint32")],["ext",t.lookup("BundleItemExt")]]),t.union("BundleExt",{switchOn:t.int(),switchName:"v",switches:[[0,t.void()]],arms:{}}),t.struct("Bundle",[["variantId",t.lookup("Uint64")],["items",t.varArray(t.lookup("BundleItem"),500)],["version",t.lookup("Uint32")],["ext",t.lookup("BundleExt")]]),t.union("BundleEnvelope",{switchOn:t.lookup("EnvelopeType"),switchName:"type",switches:[["envelopeTypeBundle","v1"]],arms:{v1:t.lookup("Bundle")}})}),_o="/bundling-storefront-manager";function vl(){return Math.ceil(Date.now()/1e3)}async function _l(){try{const{timestamp:t}=await xt("get",`${_o}/t`,{headers:{"X-Recharge-App":"storefront-client"}});return t}catch(t){return console.error(`Fetch failed: ${t}. Using client-side date.`),vl()}}async function bl(t){const e=ve(),r=await bo(t);if(r!==!0)throw new Error(r);const n=await _l(),a=wl({variantId:t.externalVariantId,version:n,items:t.selections.map(s=>({collectionId:s.collectionId,productId:s.externalProductId,variantId:s.externalVariantId,quantity:s.quantity,sku:""}))});try{const s=await xt("post",`${_o}/api/v1/bundles`,{data:{bundle:a},headers:{Origin:`https://${e.storeIdentifier}`}});if(!s.id||s.code!==200)throw new Error(`1: failed generating rb_id: ${JSON.stringify(s)}`);return s.id}catch(s){throw new Error(`2: failed generating rb_id ${s}`)}}function El(t,e){const r=Eo(t);if(r!==!0)throw new Error(`Dynamic Bundle is invalid. ${r}`);const n=`${Uc(9)}:${t.externalProductId}`;return t.selections.map(a=>{const s={id:a.externalVariantId,quantity:a.quantity,properties:{_rc_bundle:n,_rc_bundle_variant:t.externalVariantId,_rc_bundle_parent:e,_rc_bundle_collection_id:a.collectionId}};return a.sellingPlan?s.selling_plan=a.sellingPlan:a.shippingIntervalFrequency&&(s.properties.shipping_interval_frequency=a.shippingIntervalFrequency,s.properties.shipping_interval_unit_type=a.shippingIntervalUnitType,s.id=`${a.discountedVariantId}`),s})}async function bo(t){try{return t?await mo(t.externalProductId)?!0:"Bundle settings do not exist for the given product":"Bundle is not defined"}catch(e){return`Error fetching bundle settings: ${e}`}}const Al={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 Eo(t){if(!t)return"No bundle defined.";if(t.selections.length===0)return"No selections defined.";const{shippingIntervalFrequency:e,shippingIntervalUnitType:r}=t.selections.find(n=>n.shippingIntervalFrequency||n.shippingIntervalUnitType)||{};if(e||r){if(!e||!r)return"Shipping intervals do not match on selections.";{const n=Al[r];for(let a=0;a<t.selections.length;a++){const{shippingIntervalFrequency:s,shippingIntervalUnitType:f}=t.selections[a];if(s&&s!==e||f&&!n.includes(f))return"Shipping intervals do not match on selections."}}}return!0}async function xl(t,e){const{bundle_selection:r}=await T("get","/bundle_selections",{id:e},t);return r}function Sl(t,e){return T("get","/bundle_selections",{query:e},t)}async function Il(t,e){const{bundle_selection:r}=await T("post","/bundle_selections",{data:e},t);return r}async function Bl(t,e,r){const{bundle_selection:n}=await T("put","/bundle_selections",{id:e,data:r},t);return n}function Ol(t,e){return T("delete","/bundle_selections",{id:e},t)}async function Tl(t,e,r,n){const{subscription:a}=await T("put","/bundles",{id:e,data:r,query:n},t);return a}var Rl=Object.freeze({__proto__:null,getBundleId:bl,getDynamicBundleItems:El,validateBundle:bo,validateDynamicBundle:Eo,getBundleSelection:xl,listBundleSelections:Sl,createBundleSelection:Il,updateBundleSelection:Bl,deleteBundleSelection:Ol,updateBundle:Tl});async function $l(t,e,r){const{charge:n}=await T("get","/charges",{id:e,query:{include:r?.include}},t);return n}function Pl(t,e){return T("get","/charges",{query:e},t)}async function Fl(t,e,r){const{charge:n}=await T("post",`/charges/${e}/apply_discount`,{data:{discount_code:r}},t);return n}async function Ul(t,e){const{charge:r}=await T("post",`/charges/${e}/remove_discount`,{},t);return r}async function Cl(t,e,r){const{charge:n}=await T("post",`/charges/${e}/skip`,{data:{purchase_item_ids:r.map(a=>Number(a))}},t);return n}async function Dl(t,e,r){const{charge:n}=await T("post",`/charges/${e}/unskip`,{data:{purchase_item_ids:r.map(a=>Number(a))}},t);return n}async function Nl(t,e){const{charge:r}=await T("post",`/charges/${e}/process`,{},t);return r}var Ml=Object.freeze({__proto__:null,getCharge:$l,listCharges:Pl,applyDiscountToCharge:Fl,removeDiscountsFromCharge:Ul,skipCharge:Cl,unskipCharge:Dl,processCharge:Nl});async function Ll(t,e){const{membership:r}=await T("get","/memberships",{id:e},t);return r}function kl(t,e){return T("get","/memberships",{query:e},t)}async function jl(t,e,r){const{membership:n}=await T("post",`/memberships/${e}/cancel`,{data:r},t);return n}async function ql(t,e,r){const{membership:n}=await T("post",`/memberships/${e}/activate`,{data:r},t);return n}async function Vl(t,e,r){const{membership:n}=await T("post",`/memberships/${e}/change`,{data:r},t);return n}var zl=Object.freeze({__proto__:null,getMembership:Ll,listMemberships:kl,cancelMembership:jl,activateMembership:ql,changeMembership:Vl});async function Gl(t,e,r){const{membership_program:n}=await T("get","/membership_programs",{id:e,query:{include:r?.include}},t);return n}function Wl(t,e){return T("get","/membership_programs",{query:e},t)}var Hl=Object.freeze({__proto__:null,getMembershipProgram:Gl,listMembershipPrograms:Wl});async function Yl(t,e){const{metafield:r}=await T("post","/metafields",{data:{metafield:e}},t);return r}async function Xl(t,e,r){const{metafield:n}=await T("put","/metafields",{id:e,data:{metafield:r}},t);return n}function Jl(t,e){return T("delete","/metafields",{id:e},t)}var Kl=Object.freeze({__proto__:null,createMetafield:Yl,updateMetafield:Xl,deleteMetafield:Jl});async function Ql(t,e){const{onetime:r}=await T("get","/onetimes",{id:e},t);return r}function Zl(t,e){return T("get","/onetimes",{query:e},t)}async function ep(t,e){const{onetime:r}=await T("post","/onetimes",{data:e},t);return r}async function tp(t,e,r){const{onetime:n}=await T("put","/onetimes",{id:e,data:r},t);return n}function rp(t,e){return T("delete","/onetimes",{id:e},t)}var np=Object.freeze({__proto__:null,getOnetime:Ql,listOnetimes:Zl,createOnetime:ep,updateOnetime:tp,deleteOnetime:rp});async function ip(t,e){const{order:r}=await T("get","/orders",{id:e},t);return r}function op(t,e){return T("get","/orders",{query:e},t)}var ap=Object.freeze({__proto__:null,getOrder:ip,listOrders:op});async function sp(t,e,r){const{payment_method:n}=await T("get","/payment_methods",{id:e,query:{include:r?.include}},t);return n}async function up(t,e,r){const{payment_method:n}=await T("put","/payment_methods",{id:e,data:r},t);return n}function cp(t,e){return T("get","/payment_methods",{query:e},t)}var fp=Object.freeze({__proto__:null,getPaymentMethod:sp,updatePaymentMethod:up,listPaymentMethods:cp});async function lp(t,e){const{plan:r}=await T("get","/plans",{id:e},t);return r}function pp(t,e){return T("get","/plans",{query:e},t)}var hp=Object.freeze({__proto__:null,getPlan:lp,listPlans:pp}),dp="Expected a function",Ao="__lodash_placeholder__",ze=1,pr=2,yp=4,ot=8,Bt=16,Ge=32,Ot=64,xo=128,gp=256,So=512,Io=1/0,mp=9007199254740991,wp=17976931348623157e292,Bo=0/0,vp=[["ary",xo],["bind",ze],["bindKey",pr],["curry",ot],["curryRight",Bt],["flip",So],["partial",Ge],["partialRight",Ot],["rearg",gp]],_p="[object Function]",bp="[object GeneratorFunction]",Ep="[object Symbol]",Ap=/[\\^$.*+?()[\]{}|]/g,xp=/^\s+|\s+$/g,Sp=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ip=/\{\n\/\* \[wrapped with (.+)\] \*/,Bp=/,? & /,Op=/^[-+]0x[0-9a-f]+$/i,Tp=/^0b[01]+$/i,Rp=/^\[object .+?Constructor\]$/,$p=/^0o[0-7]+$/i,Pp=/^(?:0|[1-9]\d*)$/,Fp=parseInt,Up=typeof oe=="object"&&oe&&oe.Object===Object&&oe,Cp=typeof self=="object"&&self&&self.Object===Object&&self,Tt=Up||Cp||Function("return this")();function gn(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function Dp(t,e){for(var r=-1,n=t?t.length:0;++r<n&&e(t[r],r,t)!==!1;);return t}function Np(t,e){var r=t?t.length:0;return!!r&&Lp(t,e,0)>-1}function Mp(t,e,r,n){for(var a=t.length,s=r+(n?1:-1);n?s--:++s<a;)if(e(t[s],s,t))return s;return-1}function Lp(t,e,r){if(e!==e)return Mp(t,kp,r);for(var n=r-1,a=t.length;++n<a;)if(t[n]===e)return n;return-1}function kp(t){return t!==t}function jp(t,e){for(var r=t.length,n=0;r--;)t[r]===e&&n++;return n}function qp(t,e){return t?.[e]}function Vp(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function mn(t,e){for(var r=-1,n=t.length,a=0,s=[];++r<n;){var f=t[r];(f===e||f===Ao)&&(t[r]=Ao,s[a++]=r)}return s}var zp=Function.prototype,Oo=Object.prototype,wn=Tt["__core-js_shared__"],To=function(){var t=/[^.]+$/.exec(wn&&wn.keys&&wn.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Ro=zp.toString,Gp=Oo.hasOwnProperty,$o=Oo.toString,Wp=RegExp("^"+Ro.call(Gp).replace(Ap,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Hp=Object.create,at=Math.max,Yp=Math.min,Po=function(){var t=Uo(Object,"defineProperty"),e=Uo.name;return e&&e.length>2?t:void 0}();function Xp(t){return st(t)?Hp(t):{}}function Jp(t){if(!st(t)||uh(t))return!1;var e=ph(t)||Vp(t)?Wp:Rp;return e.test(fh(t))}function Kp(t,e){return e=at(e===void 0?t.length-1:e,0),function(){for(var r=arguments,n=-1,a=at(r.length-e,0),s=Array(a);++n<a;)s[n]=r[e+n];n=-1;for(var f=Array(e+1);++n<e;)f[n]=r[n];return f[e]=s,gn(t,this,f)}}function Qp(t,e,r,n){for(var a=-1,s=t.length,f=r.length,p=-1,h=e.length,m=at(s-f,0),v=Array(h+m),_=!n;++p<h;)v[p]=e[p];for(;++a<f;)(_||a<s)&&(v[r[a]]=t[a]);for(;m--;)v[p++]=t[a++];return v}function Zp(t,e,r,n){for(var a=-1,s=t.length,f=-1,p=r.length,h=-1,m=e.length,v=at(s-p,0),_=Array(v+m),b=!n;++a<v;)_[a]=t[a];for(var y=a;++h<m;)_[y+h]=e[h];for(;++f<p;)(b||a<s)&&(_[y+r[f]]=t[a++]);return _}function eh(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function th(t,e,r){var n=e&ze,a=Rt(t);function s(){var f=this&&this!==Tt&&this instanceof s?a:t;return f.apply(n?r:this,arguments)}return s}function Rt(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var r=Xp(t.prototype),n=t.apply(r,e);return st(n)?n:r}}function rh(t,e,r){var n=Rt(t);function a(){for(var s=arguments.length,f=Array(s),p=s,h=_n(a);p--;)f[p]=arguments[p];var m=s<3&&f[0]!==h&&f[s-1]!==h?[]:mn(f,h);if(s-=m.length,s<r)return Fo(t,e,vn,a.placeholder,void 0,f,m,void 0,void 0,r-s);var v=this&&this!==Tt&&this instanceof a?n:t;return gn(v,this,f)}return a}function vn(t,e,r,n,a,s,f,p,h,m){var v=e&xo,_=e&ze,b=e&pr,y=e&(ot|Bt),x=e&So,I=b?void 0:Rt(t);function O(){for(var S=arguments.length,B=Array(S),$=S;$--;)B[$]=arguments[$];if(y)var R=_n(O),D=jp(B,R);if(n&&(B=Qp(B,n,a,y)),s&&(B=Zp(B,s,f,y)),S-=D,y&&S<m){var M=mn(B,R);return Fo(t,e,vn,O.placeholder,r,B,M,p,h,m-S)}var q=_?r:this,V=b?q[t]:t;return S=B.length,p?B=ch(B,p):x&&S>1&&B.reverse(),v&&h<S&&(B.length=h),this&&this!==Tt&&this instanceof O&&(V=I||Rt(V)),V.apply(q,B)}return O}function nh(t,e,r,n){var a=e&ze,s=Rt(t);function f(){for(var p=-1,h=arguments.length,m=-1,v=n.length,_=Array(v+h),b=this&&this!==Tt&&this instanceof f?s:t;++m<v;)_[m]=n[m];for(;h--;)_[m++]=arguments[++p];return gn(b,a?r:this,_)}return f}function Fo(t,e,r,n,a,s,f,p,h,m){var v=e&ot,_=v?f:void 0,b=v?void 0:f,y=v?s:void 0,x=v?void 0:s;e|=v?Ge:Ot,e&=~(v?Ot:Ge),e&yp||(e&=~(ze|pr));var I=r(t,e,a,y,_,x,b,p,h,m);return I.placeholder=n,Co(I,t,e)}function ih(t,e,r,n,a,s,f,p){var h=e&pr;if(!h&&typeof t!="function")throw new TypeError(dp);var m=n?n.length:0;if(m||(e&=~(Ge|Ot),n=a=void 0),f=f===void 0?f:at(Do(f),0),p=p===void 0?p:Do(p),m-=a?a.length:0,e&Ot){var v=n,_=a;n=a=void 0}var b=[t,e,r,n,a,v,_,s,f,p];if(t=b[0],e=b[1],r=b[2],n=b[3],a=b[4],p=b[9]=b[9]==null?h?0:t.length:at(b[9]-m,0),!p&&e&(ot|Bt)&&(e&=~(ot|Bt)),!e||e==ze)var y=th(t,e,r);else e==ot||e==Bt?y=rh(t,e,p):(e==Ge||e==(ze|Ge))&&!a.length?y=nh(t,e,r,n):y=vn.apply(void 0,b);return Co(y,t,e)}function _n(t){var e=t;return e.placeholder}function Uo(t,e){var r=qp(t,e);return Jp(r)?r:void 0}function oh(t){var e=t.match(Ip);return e?e[1].split(Bp):[]}function ah(t,e){var r=e.length,n=r-1;return e[n]=(r>1?"& ":"")+e[n],e=e.join(r>2?", ":" "),t.replace(Sp,`{
21
+ /* [wrapped with `+e+`] */
22
+ `)}function sh(t,e){return e=e??mp,!!e&&(typeof t=="number"||Pp.test(t))&&t>-1&&t%1==0&&t<e}function uh(t){return!!To&&To in t}function ch(t,e){for(var r=t.length,n=Yp(e.length,r),a=eh(t);n--;){var s=e[n];t[n]=sh(s,r)?a[s]:void 0}return t}var Co=Po?function(t,e,r){var n=e+"";return Po(t,"toString",{configurable:!0,enumerable:!1,value:mh(ah(n,lh(oh(n),r)))})}:wh;function fh(t){if(t!=null){try{return Ro.call(t)}catch{}try{return t+""}catch{}}return""}function lh(t,e){return Dp(vp,function(r){var n="_."+r[0];e&r[1]&&!Np(t,n)&&t.push(n)}),t.sort()}var bn=Kp(function(t,e){var r=mn(e,_n(bn));return ih(t,Ge,void 0,e,r)});function ph(t){var e=st(t)?$o.call(t):"";return e==_p||e==bp}function st(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function hh(t){return!!t&&typeof t=="object"}function dh(t){return typeof t=="symbol"||hh(t)&&$o.call(t)==Ep}function yh(t){if(!t)return t===0?t:0;if(t=gh(t),t===Io||t===-Io){var e=t<0?-1:1;return e*wp}return t===t?t:0}function Do(t){var e=yh(t),r=e%1;return e===e?r?e-r:e:0}function gh(t){if(typeof t=="number")return t;if(dh(t))return Bo;if(st(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=st(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(xp,"");var r=Tp.test(t);return r||$p.test(t)?Fp(t.slice(2),r?2:8):Op.test(t)?Bo:+t}function mh(t){return function(){return t}}function wh(t){return t}bn.placeholder={};var No=bn,vh=Object.defineProperty,_h=Object.defineProperties,bh=Object.getOwnPropertyDescriptors,Mo=Object.getOwnPropertySymbols,Eh=Object.prototype.hasOwnProperty,Ah=Object.prototype.propertyIsEnumerable,Lo=(t,e,r)=>e in t?vh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ko=(t,e)=>{for(var r in e||(e={}))Eh.call(e,r)&&Lo(t,r,e[r]);if(Mo)for(var r of Mo(e))Ah.call(e,r)&&Lo(t,r,e[r]);return t},jo=(t,e)=>_h(t,bh(e));function xh(t,e){return jo(ko({},dn(e,["address_id","external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","status"])),{customer_id:parseInt(t,10),shopify_variant_id:e.external_variant_id.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:`${e.charge_interval_frequency}`,order_interval_frequency:`${e.order_interval_frequency}`,status:e.status?e.status.toUpperCase():void 0})}function Sh(t,e){var r;return jo(ko({},dn(e,["external_variant_id","external_product_id","charge_interval_frequency","order_interval_frequency","price","use_external_variant_defaults"])),{shopify_variant_id:(r=e.external_variant_id)!=null&&r.ecommerce?parseInt(e.external_variant_id.ecommerce,10):void 0,charge_interval_frequency:e.charge_interval_frequency?`${e.charge_interval_frequency}`:void 0,order_interval_frequency:e.order_interval_frequency?`${e.order_interval_frequency}`:void 0,force_update:t})}function qo(t){const{id:e,address_id:r,customer_id:n,analytics_data:a,cancellation_reason:s,cancellation_reason_comments:f,cancelled_at:p,charge_interval_frequency:h,created_at:m,expire_after_specific_number_of_charges:v,shopify_product_id:_,shopify_variant_id:b,has_queued_charges:y,is_prepaid:x,is_skippable:I,is_swappable:O,max_retries_reached:S,next_charge_scheduled_at:B,order_day_of_month:$,order_day_of_week:R,order_interval_frequency:D,order_interval_unit:M,presentment_currency:q,price:V,product_title:Y,properties:z,quantity:ne,sku:ae,sku_override:L,status:Z,updated_at:N,variant_title:se}=t;return{id:e,address_id:r,customer_id:n,analytics_data:a,cancellation_reason:s,cancellation_reason_comments:f,cancelled_at:p,charge_interval_frequency:parseInt(h,10),created_at:m,expire_after_specific_number_of_charges:v,external_product_id:{ecommerce:`${_}`},external_variant_id:{ecommerce:`${b}`},has_queued_charges:ao(y),is_prepaid:x,is_skippable:I,is_swappable:O,max_retries_reached:ao(S),next_charge_scheduled_at:B,order_day_of_month:$,order_day_of_week:R,order_interval_frequency:parseInt(D,10),order_interval_unit:M,presentment_currency:q,price:`${V}`,product_title:Y??"",properties:z,quantity:ne,sku:ae,sku_override:L,status:Z.toLowerCase(),updated_at:N,variant_title:se}}async function Ih(t,e,r){const{subscription:n}=await T("get","/subscriptions",{id:e,query:{include:r?.include}},t);return n}function Bh(t,e){return T("get","/subscriptions",{query:e},t)}async function Oh(t,e,r){const{subscription:n}=await T("post","/subscriptions",{data:e,query:r},t);return n}async function Th(t,e,r,n){const{subscription:a}=await T("put","/subscriptions",{id:e,data:r,query:n},t);return a}async function Rh(t,e,r,n){const{subscription:a}=await T("post",`/subscriptions/${e}/set_next_charge_date`,{data:{date:r},query:n},t);return a}async function $h(t,e,r){const{subscription:n}=await T("post",`/subscriptions/${e}/change_address`,{data:{address_id:r}},t);return n}async function Ph(t,e,r,n){const{subscription:a}=await T("post",`/subscriptions/${e}/cancel`,{data:r,query:n},t);return a}async function Fh(t,e,r){const{subscription:n}=await T("post",`/subscriptions/${e}/activate`,{query:r},t);return n}async function Uh(t,e,r){const{charge:n}=await T("post",`/subscriptions/${e}/charges/skip`,{data:{date:r,subscription_id:`${e}`}},t);return n}async function Ch(t,e,r){const{onetimes:n}=await T("post","/purchase_items/skip_gift",{data:{purchase_item_ids:e.map(Number),recipient_address:r}},t);return n}async function Dh(t,e){const r=e.length;if(r<1||r>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:n}=t;if(!n)throw new Error("No customerId in session.");const a=e[0].address_id;if(!e.every(h=>h.address_id===a))throw new Error("All subscriptions must have the same address_id.");const s=No(xh,n),f=e.map(s),{subscriptions:p}=await T("post",`/addresses/${a}/subscriptions-bulk`,{data:{subscriptions:f},headers:{"X-Recharge-Version":"2021-01"}},t);return p.map(qo)}async function Nh(t,e,r,n){const a=r.length;if(a<1||a>21)throw new Error("Number of subscriptions must be between 1 and 20.");const{customerId:s}=t;if(!s)throw new Error("No customerId in session.");const f=No(Sh,!!(n!=null&&n.force_update)),p=r.map(f),{subscriptions:h}=await T("put",`/addresses/${e}/subscriptions-bulk`,{data:{subscriptions:p},headers:{"X-Recharge-Version":"2021-01"}},t);return h.map(qo)}var Mh=Object.freeze({__proto__:null,getSubscription:Ih,listSubscriptions:Bh,createSubscription:Oh,updateSubscription:Th,updateSubscriptionChargeDate:Rh,updateSubscriptionAddress:$h,cancelSubscription:Ph,activateSubscription:Fh,skipSubscriptionCharge:Uh,skipGiftSubscriptionCharge:Ch,createSubscriptions:Dh,updateSubscriptions:Nh});async function Lh(t,e){const r=t.customerId;if(!r)throw new Error("Not logged in.");const{customer:n}=await T("get","/customers",{id:r,query:{include:e?.include}},t);return n}async function kh(t,e){const r=t.customerId;if(!r)throw new Error("Not logged in.");const{customer:n}=await T("put","/customers",{id:r,data:e},t);return n}async function jh(t,e){const r=t.customerId;if(!r)throw new Error("Not logged in.");const{deliveries:n}=await T("get",`/customers/${r}/delivery_schedule`,{query:e},t);return n}async function qh(t){return await T("get","/portal_access",{},t)}var Vh=Object.freeze({__proto__:null,getCustomer:Lh,updateCustomer:kh,getDeliverySchedule:jh,getCustomerPortalAccess:qh});const zh={get(t,e){return ce("get",t,e)},post(t,e){return ce("post",t,e)},put(t,e){return ce("put",t,e)},delete(t,e){return ce("delete",t,e)}};function Gh(t){var e,r;if(t)return t;if((e=window?.Shopify)!=null&&e.shop)return window.Shopify.shop;let n=window?.domain;if(!n){const a=(r=location?.href.match(/(?:http[s]*:\/\/)*(.*?)\.(?=admin\.rechargeapps\.com)/i))==null?void 0:r[1].replace(/-sp$/,"");a&&(n=`${a}.myshopify.com`)}if(n)return n;throw new Error("No storeIdentifier was passed into init.")}function Wh(t={}){const e=t,{storefrontAccessToken:r}=t;if(r&&!r.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.");Qu({storeIdentifier:Gh(t.storeIdentifier),loginRetryFn:t.loginRetryFn,storefrontAccessToken:r,environment:e.environment?e.environment:"prod"}),wo()}const Vo={init:Wh,api:zh,address:bc,auth:Fc,bundle:Rl,charge:Ml,cdn:ml,customer:Vh,membership:zl,membershipProgram:Hl,metafield:Kl,onetime:np,order:ap,paymentMethod:fp,plan:hp,subscription:Mh};try{Vo.init()}catch{}return Vo});